@pygmalionjs/pygmalion 0.6.17 → 0.6.18
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/{FrozenRoutePreview-BBgXrlKF.js → FrozenRoutePreview-CZSFEQgN.js} +202 -195
- package/dist-lib/pygmalion.js +1839 -1822
- package/dist-lib/testing.js +1 -1
- package/dist-lib/types/editor/designImport.d.ts +10 -2
- package/dist-lib/types/editor/flowSessionScheduler.d.ts +9 -0
- package/dist-lib/types/editor/screenInteractions.d.ts +2 -2
- package/dist-lib/types/lib.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1611,10 +1611,10 @@ function uu(t, e, n) {
|
|
|
1611
1611
|
if (d = !1, !g.isDisposed) {
|
|
1612
1612
|
var m = !1, S = f;
|
|
1613
1613
|
g.track(function() {
|
|
1614
|
-
var
|
|
1614
|
+
var y = Vc(!1, function() {
|
|
1615
1615
|
return t(g);
|
|
1616
1616
|
});
|
|
1617
|
-
m = l || !h(f,
|
|
1617
|
+
m = l || !h(f, y), f = y;
|
|
1618
1618
|
}), (l && n.fireImmediately || !l && m) && a(f, S, g), l = !1;
|
|
1619
1619
|
}
|
|
1620
1620
|
}
|
|
@@ -1721,9 +1721,9 @@ var bu = 0, yu = /* @__PURE__ */ (function(t) {
|
|
|
1721
1721
|
} catch (A) {
|
|
1722
1722
|
return p(A);
|
|
1723
1723
|
}
|
|
1724
|
-
|
|
1724
|
+
_(P);
|
|
1725
1725
|
}
|
|
1726
|
-
function
|
|
1726
|
+
function y(O) {
|
|
1727
1727
|
f = void 0;
|
|
1728
1728
|
var P;
|
|
1729
1729
|
try {
|
|
@@ -1731,14 +1731,14 @@ var bu = 0, yu = /* @__PURE__ */ (function(t) {
|
|
|
1731
1731
|
} catch (A) {
|
|
1732
1732
|
return p(A);
|
|
1733
1733
|
}
|
|
1734
|
-
|
|
1734
|
+
_(P);
|
|
1735
1735
|
}
|
|
1736
|
-
function
|
|
1736
|
+
function _(O) {
|
|
1737
1737
|
if ($(O == null ? void 0 : O.then)) {
|
|
1738
|
-
O.then(
|
|
1738
|
+
O.then(_, p);
|
|
1739
1739
|
return;
|
|
1740
1740
|
}
|
|
1741
|
-
return O.done ? g(O.value) : (f = Promise.resolve(O.value), f.then(S,
|
|
1741
|
+
return O.done ? g(O.value) : (f = Promise.resolve(O.value), f.then(S, y));
|
|
1742
1742
|
}
|
|
1743
1743
|
S(void 0);
|
|
1744
1744
|
});
|
|
@@ -2355,10 +2355,10 @@ var Pu = {}, De = "add", dn = "delete", os = /* @__PURE__ */ (function() {
|
|
|
2355
2355
|
}
|
|
2356
2356
|
}
|
|
2357
2357
|
for (var h = ct(o.entries()), g; !(g = h()).done; ) {
|
|
2358
|
-
var p = g.value, m = p[0], S = p[1],
|
|
2358
|
+
var p = g.value, m = p[0], S = p[1], y = i.data_.has(m);
|
|
2359
2359
|
if (i.set(m, S), i.data_.has(m)) {
|
|
2360
|
-
var
|
|
2361
|
-
s.set(m,
|
|
2360
|
+
var _ = i.data_.get(m);
|
|
2361
|
+
s.set(m, _), y || (a = !0);
|
|
2362
2362
|
}
|
|
2363
2363
|
}
|
|
2364
2364
|
if (!a)
|
|
@@ -3275,16 +3275,16 @@ function Ju() {
|
|
|
3275
3275
|
m = s({
|
|
3276
3276
|
inst: { value: p, getSnapshot: g }
|
|
3277
3277
|
});
|
|
3278
|
-
var S = m[0].inst,
|
|
3278
|
+
var S = m[0].inst, y = m[1];
|
|
3279
3279
|
return c(
|
|
3280
3280
|
function() {
|
|
3281
|
-
S.value = p, S.getSnapshot = g, n(S) &&
|
|
3281
|
+
S.value = p, S.getSnapshot = g, n(S) && y({ inst: S });
|
|
3282
3282
|
},
|
|
3283
3283
|
[h, p, g]
|
|
3284
3284
|
), a(
|
|
3285
3285
|
function() {
|
|
3286
|
-
return n(S) &&
|
|
3287
|
-
n(S) &&
|
|
3286
|
+
return n(S) && y({ inst: S }), h(function() {
|
|
3287
|
+
n(S) && y({ inst: S });
|
|
3288
3288
|
});
|
|
3289
3289
|
},
|
|
3290
3290
|
[h]
|
|
@@ -4810,7 +4810,7 @@ function qi(t, e = {}) {
|
|
|
4810
4810
|
Math.min(i, c)
|
|
4811
4811
|
);
|
|
4812
4812
|
if (o.length > 1) {
|
|
4813
|
-
const p = o.map((S) => S.width).sort((S,
|
|
4813
|
+
const p = o.map((S) => S.width).sort((S, y) => y - S), m = p[0] + n + p[1];
|
|
4814
4814
|
m <= i && (u = Math.max(u, m));
|
|
4815
4815
|
}
|
|
4816
4816
|
const l = [];
|
|
@@ -4871,9 +4871,9 @@ function Jl(t, e = {}) {
|
|
|
4871
4871
|
};
|
|
4872
4872
|
S += A.width + n;
|
|
4873
4873
|
}
|
|
4874
|
-
const
|
|
4875
|
-
Math.log(
|
|
4876
|
-
), P = Math.max(0, 1 - a /
|
|
4874
|
+
const y = Math.max(1, g * p), _ = g / Math.max(1, p), O = Math.abs(
|
|
4875
|
+
Math.log(_ / r)
|
|
4876
|
+
), P = Math.max(0, 1 - a / y);
|
|
4877
4877
|
c.push({
|
|
4878
4878
|
frames: m,
|
|
4879
4879
|
width: g,
|
|
@@ -5530,7 +5530,7 @@ function Kp(t, e) {
|
|
|
5530
5530
|
}
|
|
5531
5531
|
for (const [p, m] of Object.entries(f.props)) {
|
|
5532
5532
|
const S = (o = h.props) == null ? void 0 : o[p];
|
|
5533
|
-
(!S || !S.some((
|
|
5533
|
+
(!S || !S.some((y) => Object.is(y, m))) && n.push({
|
|
5534
5534
|
severity: "error",
|
|
5535
5535
|
cardId: s.id,
|
|
5536
5536
|
message: `option "${f.label}" sets ${p}=${JSON.stringify(m)} outside the adapter's vocabulary`
|
|
@@ -6108,8 +6108,8 @@ function qs(t, e, n, r, i, o, s) {
|
|
|
6108
6108
|
sourceProps: Sr(
|
|
6109
6109
|
t.getAttribute("data-pygmalion-own-props")
|
|
6110
6110
|
)
|
|
6111
|
-
},
|
|
6112
|
-
if (p && (g === "collapse" ||
|
|
6111
|
+
}, y = p != null && g === "expand" && ((V = o.collapseInstance) == null ? void 0 : V.call(o, p)) === !0 && !Yd(t, o) && Gd(t, p) && !qd(t);
|
|
6112
|
+
if (p && (g === "collapse" || y))
|
|
6113
6113
|
return Gt("component", {
|
|
6114
6114
|
name: p.name,
|
|
6115
6115
|
componentName: p.name,
|
|
@@ -6121,10 +6121,10 @@ function qs(t, e, n, r, i, o, s) {
|
|
|
6121
6121
|
...S,
|
|
6122
6122
|
...Qi(f, e, l.display, h)
|
|
6123
6123
|
});
|
|
6124
|
-
const
|
|
6124
|
+
const _ = Ud(t, u, p == null ? void 0 : p.name);
|
|
6125
6125
|
if (Rd.has(u) && (o.mediaMode ?? "placeholder") === "placeholder")
|
|
6126
6126
|
return Gt("rows", {
|
|
6127
|
-
name:
|
|
6127
|
+
name: _,
|
|
6128
6128
|
widthMode: "fixed",
|
|
6129
6129
|
width: Math.max(4, Math.round(f.width / h)),
|
|
6130
6130
|
heightMode: "fixed",
|
|
@@ -6140,7 +6140,7 @@ function qs(t, e, n, r, i, o, s) {
|
|
|
6140
6140
|
const O = l.display === "flex" || l.display === "inline-flex", P = O && l.flexDirection.startsWith("row") ? "columns" : "rows", A = Ae(P === "columns" ? l.columnGap : l.rowGap), I = Math.round(
|
|
6141
6141
|
(Ae(l.paddingTop) + Ae(l.paddingRight) + Ae(l.paddingBottom) + Ae(l.paddingLeft)) / 4
|
|
6142
6142
|
), D = Ae(l.borderTopWidth), k = Gt(P, {
|
|
6143
|
-
name:
|
|
6143
|
+
name: _,
|
|
6144
6144
|
...Qi(f, e, l.display, h),
|
|
6145
6145
|
gap: Number.isFinite(A) ? A : 0,
|
|
6146
6146
|
padding: I,
|
|
@@ -6828,129 +6828,132 @@ async function Xn(t, e, n) {
|
|
|
6828
6828
|
} while (!0);
|
|
6829
6829
|
return null;
|
|
6830
6830
|
}
|
|
6831
|
-
async function Nr(t, e) {
|
|
6832
|
-
let
|
|
6833
|
-
const
|
|
6831
|
+
async function Nr(t, e, n = {}) {
|
|
6832
|
+
let r = 0;
|
|
6833
|
+
const i = [];
|
|
6834
6834
|
try {
|
|
6835
|
-
const
|
|
6836
|
-
|
|
6835
|
+
const o = t.contentDocument;
|
|
6836
|
+
o && qt(o, []);
|
|
6837
6837
|
} catch {
|
|
6838
6838
|
}
|
|
6839
|
-
for (const
|
|
6840
|
-
if (
|
|
6841
|
-
if ((
|
|
6839
|
+
for (const o of e) {
|
|
6840
|
+
if (o.action === "wait") {
|
|
6841
|
+
if ((o.selector || o.text) && !await Xn(
|
|
6842
6842
|
t,
|
|
6843
|
-
|
|
6844
|
-
|
|
6843
|
+
o,
|
|
6844
|
+
o.waitState ?? "visible"
|
|
6845
6845
|
)) {
|
|
6846
|
-
if (
|
|
6846
|
+
if (o.optional) continue;
|
|
6847
6847
|
return {
|
|
6848
6848
|
complete: !1,
|
|
6849
|
-
completed:
|
|
6849
|
+
completed: r,
|
|
6850
6850
|
total: e.length,
|
|
6851
|
-
failedLabel:
|
|
6852
|
-
error: `"${
|
|
6851
|
+
failedLabel: o.label,
|
|
6852
|
+
error: `"${o.label}"I waited for the screen status of the step, but it did not appear.`
|
|
6853
6853
|
};
|
|
6854
6854
|
}
|
|
6855
|
-
await Ke(t,
|
|
6855
|
+
await Ke(t, o.settleMs ?? Number(o.value ?? 500)), r += 1;
|
|
6856
6856
|
continue;
|
|
6857
6857
|
}
|
|
6858
|
-
if (
|
|
6858
|
+
if (o.action === "storage") {
|
|
6859
6859
|
try {
|
|
6860
|
-
const
|
|
6861
|
-
if (!
|
|
6862
|
-
|
|
6860
|
+
const c = t.contentWindow, u = o.storage === "session" ? c == null ? void 0 : c.sessionStorage : c == null ? void 0 : c.localStorage;
|
|
6861
|
+
if (!u || !o.key) throw new Error("storage context unavailable");
|
|
6862
|
+
o.value == null ? u.removeItem(o.key) : u.setItem(o.key, o.value);
|
|
6863
6863
|
} catch {
|
|
6864
|
-
if (
|
|
6864
|
+
if (o.optional) continue;
|
|
6865
6865
|
return {
|
|
6866
6866
|
complete: !1,
|
|
6867
|
-
completed:
|
|
6867
|
+
completed: r,
|
|
6868
6868
|
total: e.length,
|
|
6869
|
-
failedLabel:
|
|
6870
|
-
error: `"${
|
|
6869
|
+
failedLabel: o.label,
|
|
6870
|
+
error: `"${o.label}"Failed to access the app store in step.`
|
|
6871
6871
|
};
|
|
6872
6872
|
}
|
|
6873
|
-
|
|
6873
|
+
r += 1, await Ke(t, o.settleMs ?? 50);
|
|
6874
6874
|
continue;
|
|
6875
6875
|
}
|
|
6876
|
-
if (
|
|
6877
|
-
let
|
|
6876
|
+
if (o.action === "scroll") {
|
|
6877
|
+
let c = null;
|
|
6878
6878
|
try {
|
|
6879
|
-
|
|
6879
|
+
c = t.contentDocument;
|
|
6880
6880
|
} catch {
|
|
6881
|
-
|
|
6881
|
+
c = null;
|
|
6882
6882
|
}
|
|
6883
|
-
const
|
|
6884
|
-
if (!
|
|
6885
|
-
if (
|
|
6883
|
+
const u = c && (o.selector || o.text) ? await Xn(t, o, "attached") : null;
|
|
6884
|
+
if (!c || (o.selector || o.text) && !u || !mf(c, u, o)) {
|
|
6885
|
+
if (o.optional) continue;
|
|
6886
6886
|
return {
|
|
6887
6887
|
complete: !1,
|
|
6888
|
-
completed:
|
|
6888
|
+
completed: r,
|
|
6889
6889
|
total: e.length,
|
|
6890
|
-
failedLabel:
|
|
6891
|
-
error: `"${
|
|
6890
|
+
failedLabel: o.label,
|
|
6891
|
+
error: `"${o.label}" scroll target was not found.`
|
|
6892
6892
|
};
|
|
6893
6893
|
}
|
|
6894
|
-
|
|
6894
|
+
r += 1, await Ke(t, o.settleMs ?? 100);
|
|
6895
6895
|
continue;
|
|
6896
6896
|
}
|
|
6897
|
-
const
|
|
6898
|
-
if (!
|
|
6899
|
-
if (
|
|
6897
|
+
const s = await Xn(t, o, "actionable");
|
|
6898
|
+
if (!s) {
|
|
6899
|
+
if (o.optional) continue;
|
|
6900
6900
|
return {
|
|
6901
6901
|
complete: !1,
|
|
6902
|
-
completed:
|
|
6902
|
+
completed: r,
|
|
6903
6903
|
total: e.length,
|
|
6904
|
-
failedLabel:
|
|
6905
|
-
error: `"${
|
|
6904
|
+
failedLabel: o.label,
|
|
6905
|
+
error: `"${o.label}"The screen element for the step was not found or actionable.`
|
|
6906
6906
|
};
|
|
6907
6907
|
}
|
|
6908
|
-
const
|
|
6909
|
-
if (!
|
|
6908
|
+
const a = s.ownerDocument.defaultView;
|
|
6909
|
+
if (!a)
|
|
6910
6910
|
return {
|
|
6911
6911
|
complete: !1,
|
|
6912
|
-
completed:
|
|
6912
|
+
completed: r,
|
|
6913
6913
|
total: e.length,
|
|
6914
|
-
failedLabel:
|
|
6915
|
-
error: `"${
|
|
6914
|
+
failedLabel: o.label,
|
|
6915
|
+
error: `"${o.label}"Failed to read the screen context for the step.`
|
|
6916
6916
|
};
|
|
6917
|
-
if (
|
|
6918
|
-
so(
|
|
6919
|
-
else if (
|
|
6920
|
-
|
|
6921
|
-
else if (
|
|
6922
|
-
Qs(
|
|
6923
|
-
else if (
|
|
6924
|
-
|
|
6925
|
-
else if (
|
|
6926
|
-
hf(
|
|
6927
|
-
else if (
|
|
6928
|
-
if (!(
|
|
6917
|
+
if (o.action === "click")
|
|
6918
|
+
so(s, a);
|
|
6919
|
+
else if (o.action === "focus")
|
|
6920
|
+
s.focus({ preventScroll: !0 });
|
|
6921
|
+
else if (o.action === "hover")
|
|
6922
|
+
Qs(s, a), i.push(o), qt(s.ownerDocument, i);
|
|
6923
|
+
else if (o.action === "focus-visible")
|
|
6924
|
+
s.focus({ preventScroll: !0 }), i.push(o), qt(s.ownerDocument, i);
|
|
6925
|
+
else if (o.action === "active")
|
|
6926
|
+
hf(s, a), i.push(o), qt(s.ownerDocument, i);
|
|
6927
|
+
else if (o.action === "fill") {
|
|
6928
|
+
if (!(s instanceof a.HTMLInputElement || s instanceof a.HTMLTextAreaElement))
|
|
6929
6929
|
return {
|
|
6930
6930
|
complete: !1,
|
|
6931
|
-
completed:
|
|
6931
|
+
completed: r,
|
|
6932
6932
|
total: e.length,
|
|
6933
|
-
failedLabel:
|
|
6934
|
-
error: `"${
|
|
6933
|
+
failedLabel: o.label,
|
|
6934
|
+
error: `"${o.label}"Step is not an input element.`
|
|
6935
6935
|
};
|
|
6936
|
-
pf(
|
|
6937
|
-
} else if (
|
|
6938
|
-
if (!(
|
|
6936
|
+
pf(s, o.value ?? "");
|
|
6937
|
+
} else if (o.action === "check") {
|
|
6938
|
+
if (!(s instanceof a.HTMLInputElement))
|
|
6939
6939
|
return {
|
|
6940
6940
|
complete: !1,
|
|
6941
|
-
completed:
|
|
6941
|
+
completed: r,
|
|
6942
6942
|
total: e.length,
|
|
6943
|
-
failedLabel:
|
|
6944
|
-
error: `"${
|
|
6943
|
+
failedLabel: o.label,
|
|
6944
|
+
error: `"${o.label}"The step is not a checked element.`
|
|
6945
6945
|
};
|
|
6946
|
-
|
|
6946
|
+
s.checked || so(s, a);
|
|
6947
6947
|
} else {
|
|
6948
|
-
const
|
|
6949
|
-
|
|
6948
|
+
const c = o.key ?? o.value ?? "Enter";
|
|
6949
|
+
s.dispatchEvent(new a.KeyboardEvent("keydown", { key: c, bubbles: !0 })), s.dispatchEvent(new a.KeyboardEvent("keyup", { key: c, bubbles: !0 }));
|
|
6950
6950
|
}
|
|
6951
|
-
|
|
6951
|
+
r += 1, await Ke(
|
|
6952
|
+
t,
|
|
6953
|
+
o.settleMs ?? n.defaultActionSettleMs ?? 600
|
|
6954
|
+
);
|
|
6952
6955
|
}
|
|
6953
|
-
return { complete: !0, completed:
|
|
6956
|
+
return { complete: !0, completed: r, total: e.length };
|
|
6954
6957
|
}
|
|
6955
6958
|
const Qp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6956
6959
|
__proto__: null,
|
|
@@ -7055,12 +7058,12 @@ function _f(t, e, n = {}) {
|
|
|
7055
7058
|
for (const p of e)
|
|
7056
7059
|
for (const m of t.pages) {
|
|
7057
7060
|
if (((l = n.include) == null ? void 0 : l.call(n, m, p)) === !1) continue;
|
|
7058
|
-
const S = (d = n.transformPage) == null ? void 0 : d.call(n, m, p),
|
|
7061
|
+
const S = (d = n.transformPage) == null ? void 0 : d.call(n, m, p), y = ((f = n.createPageId) == null ? void 0 : f.call(n, m, p)) ?? `${m.id}:viewport:${p.id}`, _ = ((h = n.createPageName) == null ? void 0 : h.call(n, m, p)) ?? `${m.name} · ${p.label}`, O = ((g = n.createSection) == null ? void 0 : g.call(n, m, p)) ?? `${m.section} · ${p.label}`;
|
|
7059
7062
|
i.push({
|
|
7060
7063
|
...m,
|
|
7061
7064
|
...S,
|
|
7062
|
-
id:
|
|
7063
|
-
name:
|
|
7065
|
+
id: y,
|
|
7066
|
+
name: _,
|
|
7064
7067
|
section: O,
|
|
7065
7068
|
width: Math.round(p.width),
|
|
7066
7069
|
height: Math.round(p.height),
|
|
@@ -7073,7 +7076,7 @@ function _f(t, e, n = {}) {
|
|
|
7073
7076
|
id: `${P.id}:viewport:${p.id}`,
|
|
7074
7077
|
name: `${P.name} · ${p.label}`,
|
|
7075
7078
|
section: O,
|
|
7076
|
-
pageId:
|
|
7079
|
+
pageId: y
|
|
7077
7080
|
});
|
|
7078
7081
|
}
|
|
7079
7082
|
const s = i.map((p) => p.id), a = o.map((p) => p.id), c = Le(s), u = Le(a);
|
|
@@ -7100,76 +7103,76 @@ function Sf({
|
|
|
7100
7103
|
captureRequirements: i
|
|
7101
7104
|
}) {
|
|
7102
7105
|
var S;
|
|
7103
|
-
const o = t.map((
|
|
7104
|
-
var
|
|
7106
|
+
const o = t.map((y) => {
|
|
7107
|
+
var _, O;
|
|
7105
7108
|
return {
|
|
7106
|
-
...
|
|
7107
|
-
preset: r != null && r.preset ||
|
|
7108
|
-
assertions: (
|
|
7109
|
+
...y,
|
|
7110
|
+
preset: r != null && r.preset || y.preset ? oa(r == null ? void 0 : r.preset, y.preset) : void 0,
|
|
7111
|
+
assertions: (_ = r == null ? void 0 : r.assertions) != null && _.length || (O = y.assertions) != null && O.length ? [
|
|
7109
7112
|
...((r == null ? void 0 : r.assertions) ?? []).map(lo),
|
|
7110
|
-
...(
|
|
7113
|
+
...(y.assertions ?? []).map(lo)
|
|
7111
7114
|
] : void 0
|
|
7112
7115
|
};
|
|
7113
|
-
}), s = e.map((
|
|
7114
|
-
...Le(s).map((
|
|
7115
|
-
...Le(c).map((
|
|
7116
|
+
}), s = e.map((y) => y.id), a = new Set(s), c = o.map((y) => y.id), u = [
|
|
7117
|
+
...Le(s).map((y) => `Duplicate scenario ID:${y}`),
|
|
7118
|
+
...Le(c).map((y) => `Duplicate screen case IDs:${y}`)
|
|
7116
7119
|
], l = /* @__PURE__ */ new Map();
|
|
7117
|
-
for (const
|
|
7118
|
-
i != null && i.preset && !
|
|
7119
|
-
for (const
|
|
7120
|
-
if (!a.has(
|
|
7121
|
-
u.push(`screen "${
|
|
7120
|
+
for (const y of o) {
|
|
7121
|
+
i != null && i.preset && !y.preset && u.push(`screen "${y.id}"There are no required presets.`), i != null && i.assertions && !((S = y.assertions) != null && S.length) && u.push(`screen "${y.id}" is missing a required assertion.`);
|
|
7122
|
+
for (const _ of y.scenarioIds ?? []) {
|
|
7123
|
+
if (!a.has(_)) {
|
|
7124
|
+
u.push(`screen "${y.id}"Scenario without${_}see`);
|
|
7122
7125
|
continue;
|
|
7123
7126
|
}
|
|
7124
|
-
const O = l.get(
|
|
7127
|
+
const O = l.get(_);
|
|
7125
7128
|
if (O) {
|
|
7126
|
-
u.push(`scenario${
|
|
7129
|
+
u.push(`scenario${_}Go to screen "${O}", "${y.id}"Duplicate classification in`);
|
|
7127
7130
|
continue;
|
|
7128
7131
|
}
|
|
7129
|
-
l.set(
|
|
7132
|
+
l.set(_, y.id);
|
|
7130
7133
|
}
|
|
7131
7134
|
}
|
|
7132
7135
|
const d = /* @__PURE__ */ new Set();
|
|
7133
|
-
for (const
|
|
7134
|
-
if (!a.has(
|
|
7135
|
-
u.push(`Scenario without non-visual classification${
|
|
7136
|
+
for (const y of n) {
|
|
7137
|
+
if (!a.has(y.id)) {
|
|
7138
|
+
u.push(`Scenario without non-visual classification${y.id}see`);
|
|
7136
7139
|
continue;
|
|
7137
7140
|
}
|
|
7138
|
-
if (l.has(
|
|
7139
|
-
u.push(`scenario${
|
|
7141
|
+
if (l.has(y.id)) {
|
|
7142
|
+
u.push(`scenario${y.id}Overlapping classification of visual and non-visual actions`);
|
|
7140
7143
|
continue;
|
|
7141
7144
|
}
|
|
7142
|
-
if (d.has(
|
|
7143
|
-
u.push(`scenario${
|
|
7145
|
+
if (d.has(y.id)) {
|
|
7146
|
+
u.push(`scenario${y.id}Non-visual classification overlap of`);
|
|
7144
7147
|
continue;
|
|
7145
7148
|
}
|
|
7146
|
-
d.add(
|
|
7149
|
+
d.add(y.id);
|
|
7147
7150
|
}
|
|
7148
|
-
const f = s.filter((
|
|
7151
|
+
const f = s.filter((y) => !l.has(y) && !d.has(y));
|
|
7149
7152
|
if (f.length && u.push(`Unclassified Scenario:${f.join(", ")}`), u.length)
|
|
7150
7153
|
throw new Error(`[Pygmalion] Screens scenario classification error${u.join(`
|
|
7151
7154
|
`)}`);
|
|
7152
|
-
const h = new Map(e.map((
|
|
7153
|
-
id: `state:${
|
|
7154
|
-
name:
|
|
7155
|
-
section:
|
|
7156
|
-
pageId:
|
|
7157
|
-
sourcePath:
|
|
7158
|
-
codeName:
|
|
7159
|
-
flow:
|
|
7160
|
-
scenarioId:
|
|
7161
|
-
description: [
|
|
7162
|
-
})), p = [...l.entries()].map(([
|
|
7163
|
-
const O = h.get(
|
|
7155
|
+
const h = new Map(e.map((y) => [y.id, y])), g = o.map((y) => ({
|
|
7156
|
+
id: `state:${y.id}`,
|
|
7157
|
+
name: y.name,
|
|
7158
|
+
section: y.section,
|
|
7159
|
+
pageId: y.id,
|
|
7160
|
+
sourcePath: y.sourcePath,
|
|
7161
|
+
codeName: y.codeName ?? y.state,
|
|
7162
|
+
flow: y.flow,
|
|
7163
|
+
scenarioId: y.scenarioId,
|
|
7164
|
+
description: [y.scenario, y.state].filter(Boolean).join(" · ")
|
|
7165
|
+
})), p = [...l.entries()].map(([y, _]) => {
|
|
7166
|
+
const O = h.get(y);
|
|
7164
7167
|
return {
|
|
7165
|
-
id: `scenario:${
|
|
7166
|
-
name: O.name ??
|
|
7168
|
+
id: `scenario:${y}`,
|
|
7169
|
+
name: O.name ?? y,
|
|
7167
7170
|
section: O.section,
|
|
7168
|
-
pageId:
|
|
7171
|
+
pageId: _,
|
|
7169
7172
|
sourcePath: O.sourcePath,
|
|
7170
7173
|
codeName: O.codeName,
|
|
7171
7174
|
flow: O.flow,
|
|
7172
|
-
scenarioId:
|
|
7175
|
+
scenarioId: y,
|
|
7173
7176
|
description: O.description
|
|
7174
7177
|
};
|
|
7175
7178
|
}), m = [...g, ...p];
|
|
@@ -7182,8 +7185,8 @@ function Sf({
|
|
|
7182
7185
|
// and no canonical id look uncovered.
|
|
7183
7186
|
pages: o.map(
|
|
7184
7187
|
({
|
|
7185
|
-
sourcePath:
|
|
7186
|
-
codeName:
|
|
7188
|
+
sourcePath: y,
|
|
7189
|
+
codeName: _,
|
|
7187
7190
|
coverageRoutes: O,
|
|
7188
7191
|
...P
|
|
7189
7192
|
}) => P
|
|
@@ -7379,17 +7382,17 @@ function Nf(t, e = {}) {
|
|
|
7379
7382
|
var h, g, p;
|
|
7380
7383
|
const l = [], d = [], f = [];
|
|
7381
7384
|
for (const m of ot) {
|
|
7382
|
-
const S = t.collections[m],
|
|
7383
|
-
d.push(...S.assets.map((
|
|
7384
|
-
for (const
|
|
7385
|
-
|
|
7386
|
-
for (const
|
|
7387
|
-
m === "screens" && ((h =
|
|
7388
|
-
for (const O of
|
|
7389
|
-
O.selector.trim() || l.push(`${m}:${
|
|
7390
|
-
!
|
|
7391
|
-
for (const O of
|
|
7392
|
-
n[O] || l.push(`${m}:${
|
|
7385
|
+
const S = t.collections[m], y = new Set(S.pages.map((_) => _.id));
|
|
7386
|
+
d.push(...S.assets.map((_) => `${m}:${_.id}`)), f.push(...S.pages.map((_) => `${m}:${_.id}`)), S.assets.length !== S.expectedCount && l.push(`${m}: expected ${S.expectedCount}, imported ${S.assets.length}`);
|
|
7387
|
+
for (const _ of S.assets)
|
|
7388
|
+
y.has(_.pageId) || l.push(`${m}:${_.id}: unknown pageId ${_.pageId}`);
|
|
7389
|
+
for (const _ of S.pages) {
|
|
7390
|
+
m === "screens" && ((h = _.interactions) != null && h.length || (g = _.assertions) != null && g.length || _.preset) && !_.route && l.push(`${m}:${_.id}: capture contract requires a route preview`), _.preset && !vn(_.preset) && l.push(`${m}:${_.id}: preset must contain only finite JSON-serializable data`), _.environment && !vn(_.environment) && l.push(`${m}:${_.id}: environment must contain only finite JSON-serializable data`);
|
|
7391
|
+
for (const O of _.assertions ?? [])
|
|
7392
|
+
O.selector.trim() || l.push(`${m}:${_.id}: assertion selector is required`), O.label.trim() || l.push(`${m}:${_.id}: assertion label is required`), O.attribute && !O.attribute.name.trim() && l.push(`${m}:${_.id}: assertion attribute name is required`);
|
|
7393
|
+
!_.route && !_.componentName && !((p = _.gallery) != null && p.length) && l.push(`${m}:${_.id}: componentName, gallery, or route is required`), _.frameSizeMode != null && _.frameSizeMode !== "fixed" && _.frameSizeMode !== "content" && l.push(`${m}:${_.id}: frameSizeMode must be fixed or content`), _.heightMode != null && _.heightMode !== "fixed" && _.heightMode !== "document" && l.push(`${m}:${_.id}: heightMode must be fixed or document`), _.maxHeight != null && (!Number.isFinite(_.maxHeight) || _.maxHeight <= 0) && l.push(`${m}:${_.id}: maxHeight must be a positive finite number`), _.componentName && !n[_.componentName] && l.push(`${m}:${_.id}: missing registry component ${_.componentName}`);
|
|
7394
|
+
for (const O of _.gallery ?? [])
|
|
7395
|
+
n[O] || l.push(`${m}:${_.id}: missing gallery component ${O}`);
|
|
7393
7396
|
}
|
|
7394
7397
|
}
|
|
7395
7398
|
for (const m of Le(d)) l.push(`duplicate asset id ${m}`);
|
|
@@ -7399,13 +7402,13 @@ ${l.join(`
|
|
|
7399
7402
|
`)}`);
|
|
7400
7403
|
};
|
|
7401
7404
|
c();
|
|
7402
|
-
const u = async (l, d) => {
|
|
7403
|
-
var
|
|
7404
|
-
const
|
|
7405
|
-
let
|
|
7405
|
+
const u = async (l, d, f) => {
|
|
7406
|
+
var y, _;
|
|
7407
|
+
const h = [];
|
|
7408
|
+
let g = !d.preset;
|
|
7406
7409
|
if (d.preset)
|
|
7407
7410
|
if (!e.executeScreenPreset)
|
|
7408
|
-
|
|
7411
|
+
h.push({
|
|
7409
7412
|
stage: "preset",
|
|
7410
7413
|
code: "preset_executor_missing",
|
|
7411
7414
|
label: "screen preset",
|
|
@@ -7413,41 +7416,45 @@ ${l.join(`
|
|
|
7413
7416
|
});
|
|
7414
7417
|
else
|
|
7415
7418
|
try {
|
|
7416
|
-
const
|
|
7419
|
+
const O = await e.executeScreenPreset(
|
|
7417
7420
|
{ pageId: d.pageId, route: d.route, preset: Ct(d.preset) },
|
|
7418
7421
|
{ iframe: l }
|
|
7419
7422
|
);
|
|
7420
|
-
|
|
7423
|
+
O && !O.complete ? h.push({
|
|
7421
7424
|
stage: "preset",
|
|
7422
7425
|
code: "preset_rejected",
|
|
7423
7426
|
label: "screen preset",
|
|
7424
|
-
message:
|
|
7425
|
-
actual:
|
|
7426
|
-
}) :
|
|
7427
|
-
} catch (
|
|
7428
|
-
|
|
7427
|
+
message: O.message ?? "The host refused to apply the screen preset.",
|
|
7428
|
+
actual: O.details
|
|
7429
|
+
}) : g = !0;
|
|
7430
|
+
} catch (O) {
|
|
7431
|
+
h.push({
|
|
7429
7432
|
stage: "preset",
|
|
7430
7433
|
code: "preset_error",
|
|
7431
7434
|
label: "screen preset",
|
|
7432
|
-
message: `An error occurred while applying the screen preset:${String(
|
|
7435
|
+
message: `An error occurred while applying the screen preset:${String(O).slice(0, 160)}`
|
|
7433
7436
|
});
|
|
7434
7437
|
}
|
|
7435
|
-
let
|
|
7436
|
-
|
|
7438
|
+
let p = wf(((y = d.interactions) == null ? void 0 : y.length) ?? 0), m = Of(((_ = d.assertions) == null ? void 0 : _.length) ?? 0);
|
|
7439
|
+
h.length === 0 && (p = await Nr(
|
|
7440
|
+
l,
|
|
7441
|
+
d.interactions ?? [],
|
|
7442
|
+
f
|
|
7443
|
+
), p.complete || h.push({
|
|
7437
7444
|
stage: "interaction",
|
|
7438
7445
|
code: "interaction_failed",
|
|
7439
|
-
label:
|
|
7440
|
-
message:
|
|
7441
|
-
})),
|
|
7442
|
-
const
|
|
7446
|
+
label: p.failedLabel,
|
|
7447
|
+
message: p.error ?? "Couldn't reproduce the user flow."
|
|
7448
|
+
})), h.length === 0 && (m = await xf(l, d.assertions ?? []), h.push(...m.failures));
|
|
7449
|
+
const S = h[0];
|
|
7443
7450
|
return {
|
|
7444
|
-
complete:
|
|
7445
|
-
presetApplied:
|
|
7446
|
-
interactions:
|
|
7447
|
-
assertions:
|
|
7448
|
-
failures:
|
|
7449
|
-
failedLabel:
|
|
7450
|
-
error:
|
|
7451
|
+
complete: h.length === 0,
|
|
7452
|
+
presetApplied: g,
|
|
7453
|
+
interactions: p,
|
|
7454
|
+
assertions: m,
|
|
7455
|
+
failures: h,
|
|
7456
|
+
failedLabel: S == null ? void 0 : S.label,
|
|
7457
|
+
error: S == null ? void 0 : S.message
|
|
7451
7458
|
};
|
|
7452
7459
|
};
|
|
7453
7460
|
return {
|
|
@@ -7531,17 +7538,17 @@ ${l.join(`
|
|
|
7531
7538
|
return null;
|
|
7532
7539
|
}
|
|
7533
7540
|
if (!(m != null && m.body) || !S) return null;
|
|
7534
|
-
const
|
|
7535
|
-
let
|
|
7541
|
+
const y = Date.now();
|
|
7542
|
+
let _ = Date.now(), O = m.body.querySelectorAll("*").length;
|
|
7536
7543
|
const P = S.MutationObserver, A = new P(() => {
|
|
7537
|
-
|
|
7544
|
+
_ = Date.now(), O = m.body.querySelectorAll("*").length;
|
|
7538
7545
|
});
|
|
7539
7546
|
A.observe(m.body, { childList: !0, subtree: !0, attributes: !0, characterData: !0 });
|
|
7540
7547
|
try {
|
|
7541
7548
|
await new Promise((D) => {
|
|
7542
7549
|
const k = () => {
|
|
7543
7550
|
const z = Date.now(), V = m.body.querySelectorAll("*").length;
|
|
7544
|
-
if (V !== O && (O = V,
|
|
7551
|
+
if (V !== O && (O = V, _ = z), V >= g && z - _ >= f || z - y >= h) {
|
|
7545
7552
|
D();
|
|
7546
7553
|
return;
|
|
7547
7554
|
}
|
|
@@ -7651,11 +7658,11 @@ function Rf(t) {
|
|
|
7651
7658
|
if (!g) continue;
|
|
7652
7659
|
const p = If(g);
|
|
7653
7660
|
if (!p) continue;
|
|
7654
|
-
const m = (p.x - s.x) / r - f.x, S = (p.y - s.y) / r - f.y,
|
|
7661
|
+
const m = (p.x - s.x) / r - f.x, S = (p.y - s.y) / r - f.y, y = p.width / r - f.width, _ = p.height / r - f.height, O = Math.max(
|
|
7655
7662
|
Math.abs(m),
|
|
7656
7663
|
Math.abs(S),
|
|
7657
|
-
Math.abs(
|
|
7658
|
-
Math.abs(
|
|
7664
|
+
Math.abs(y),
|
|
7665
|
+
Math.abs(_)
|
|
7659
7666
|
);
|
|
7660
7667
|
a += 1, !(O <= Pf) && (c = Math.max(c, O), u.push({
|
|
7661
7668
|
nodeId: h.id,
|
|
@@ -7675,8 +7682,8 @@ function Rf(t) {
|
|
|
7675
7682
|
},
|
|
7676
7683
|
dx: Math.round(m),
|
|
7677
7684
|
dy: Math.round(S),
|
|
7678
|
-
dwidth: Math.round(
|
|
7679
|
-
dheight: Math.round(
|
|
7685
|
+
dwidth: Math.round(y),
|
|
7686
|
+
dheight: Math.round(_),
|
|
7680
7687
|
drift: Math.round(O)
|
|
7681
7688
|
}));
|
|
7682
7689
|
}
|
|
@@ -10617,7 +10624,7 @@ function Vh({
|
|
|
10617
10624
|
}), c = yt(() => {
|
|
10618
10625
|
}), u = yt(i);
|
|
10619
10626
|
u.current = i;
|
|
10620
|
-
const l = yt(0), [d, f] = or([]), [h, g] = or("none"), p = ir.frozenPreviewOverrideCss(t), m = ir.frozenPreviewCssRules(), S = ir.frozenPreviewMutations(),
|
|
10627
|
+
const l = yt(0), [d, f] = or([]), [h, g] = or("none"), p = ir.frozenPreviewOverrideCss(t), m = ir.frozenPreviewCssRules(), S = ir.frozenPreviewMutations(), y = JSON.stringify({ cssRules: m, mutations: S }), _ = () => {
|
|
10621
10628
|
var vt, Ce;
|
|
10622
10629
|
const O = (vt = s.current) == null ? void 0 : vt.contentDocument;
|
|
10623
10630
|
if (!(O != null && O.head)) return;
|
|
@@ -10750,9 +10757,9 @@ function Vh({
|
|
|
10750
10757
|
(x) => JSON.stringify(x) === JSON.stringify(V) ? x : V
|
|
10751
10758
|
), o == null || o(V);
|
|
10752
10759
|
};
|
|
10753
|
-
return di(() => (
|
|
10760
|
+
return di(() => (_(), () => {
|
|
10754
10761
|
l.current += 1, a.current();
|
|
10755
|
-
}), [p, e,
|
|
10762
|
+
}), [p, e, y]), di(
|
|
10756
10763
|
() => () => {
|
|
10757
10764
|
c.current();
|
|
10758
10765
|
},
|
|
@@ -10774,7 +10781,7 @@ function Vh({
|
|
|
10774
10781
|
className: "block border-0 bg-white",
|
|
10775
10782
|
style: { width: "100%", height: n, pointerEvents: "none" },
|
|
10776
10783
|
onLoad: () => {
|
|
10777
|
-
|
|
10784
|
+
_();
|
|
10778
10785
|
const O = s.current;
|
|
10779
10786
|
if (!O) return;
|
|
10780
10787
|
c.current();
|