@pygmalionjs/pygmalion 0.6.5 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist-lib/{FrozenRoutePreview-BVYL3dLT.js → FrozenRoutePreview-CBsH9Pei.js} +1574 -1494
- package/dist-lib/pygmalion.js +9179 -7869
- package/dist-lib/style.css +1 -1
- package/dist-lib/testing.js +1 -1
- package/dist-lib/types/canvas/CameraLayer.d.ts +3 -1
- package/dist-lib/types/canvas/FrameView.d.ts +2 -0
- package/dist-lib/types/editor/designImport.d.ts +7 -1
- package/dist-lib/types/editor/frameInteraction.d.ts +66 -0
- package/dist-lib/types/editor/previewBootstrap.d.ts +17 -1
- package/dist-lib/types/editor/shadowPreview.d.ts +2 -0
- package/dist-lib/types/editor/store.d.ts +27 -0
- package/dist-lib/types/editor/storyboardGraph.d.ts +17 -1
- package/dist-lib/types/editor/storyboardGraphView.d.ts +7 -0
- package/dist-lib/types/editor/storyboardJourney.d.ts +4 -0
- package/dist-lib/types/lib.d.ts +3 -1
- package/dist-lib/types/shell/ComponentStateControls.d.ts +10 -1
- package/dist-lib/types/shell/StoryboardGraphPanel.d.ts +5 -1
- package/docs/screen-state-contract.md +27 -0
- package/node/storyboard-capture-runtime.mjs +33 -0
- package/package.json +1 -1
|
@@ -423,6 +423,39 @@ export async function runStoryboardInteraction(page, interaction) {
|
|
|
423
423
|
return;
|
|
424
424
|
}
|
|
425
425
|
|
|
426
|
+
if (interaction.action === 'scroll') {
|
|
427
|
+
const position = {
|
|
428
|
+
x: Number.isFinite(interaction.scrollX) ? Math.max(0, interaction.scrollX) : null,
|
|
429
|
+
y: Number.isFinite(interaction.scrollY) ? Math.max(0, interaction.scrollY) : null,
|
|
430
|
+
};
|
|
431
|
+
if (interaction.selector || interaction.text) {
|
|
432
|
+
const timeoutMs = interaction.timeoutMs ?? 5_000;
|
|
433
|
+
const target = await waitForCandidateLocator(
|
|
434
|
+
page,
|
|
435
|
+
interaction,
|
|
436
|
+
timeoutMs,
|
|
437
|
+
);
|
|
438
|
+
if (!(await targetExists(target, Math.min(timeoutMs, 500)))) {
|
|
439
|
+
throw new Error(`"${interaction.label}" scroll target was not found.`);
|
|
440
|
+
}
|
|
441
|
+
await target.evaluate((element, next) => {
|
|
442
|
+
const left = next.x ?? element.scrollLeft;
|
|
443
|
+
const top = next.y ?? element.scrollTop;
|
|
444
|
+
if (typeof element.scrollTo === 'function') element.scrollTo(left, top);
|
|
445
|
+
else {
|
|
446
|
+
element.scrollLeft = left;
|
|
447
|
+
element.scrollTop = top;
|
|
448
|
+
}
|
|
449
|
+
}, position);
|
|
450
|
+
} else {
|
|
451
|
+
await page.evaluate((next) => {
|
|
452
|
+
window.scrollTo(next.x ?? window.scrollX, next.y ?? window.scrollY);
|
|
453
|
+
}, position);
|
|
454
|
+
}
|
|
455
|
+
await page.waitForTimeout(interaction.settleMs ?? 100);
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
|
|
426
459
|
const timeoutMs = interaction.timeoutMs ?? 5_000;
|
|
427
460
|
const target = await waitForCandidateLocator(page, interaction, timeoutMs);
|
|
428
461
|
if (!(await targetExists(target, Math.min(timeoutMs, 500)))) {
|