@pygmalionjs/pygmalion 0.6.17 → 0.6.19

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.
@@ -1,4 +1,4 @@
1
- import { F as s, N as a, e as r, s as i, a as t } from "./FrozenRoutePreview-BBgXrlKF.js";
1
+ import { F as s, N as a, e as r, s as i, a as t } from "./FrozenRoutePreview-B6UY1aLt.js";
2
2
  export {
3
3
  s as FrozenRoutePreviewView,
4
4
  a as NodeModel,
@@ -1,3 +1,4 @@
1
+ import { type InteractiveSessionSurface } from '../editor/interactiveSessionSurface';
1
2
  /**
2
3
  * True while a flow session still owes this screen its snapshot. Frames use
3
4
  * it exactly like the artifact-hydration gate: activation waits for the
@@ -24,11 +25,18 @@ export declare function useViewportSessionPending(page: {
24
25
  * itself — the session does that work in one instance the warm pool keeps.
25
26
  */
26
27
  export declare function useInteractiveSessionPending(page: {
27
- importPageId?: string;
28
28
  id: string;
29
29
  interactiveStateId?: string;
30
30
  interactiveOptionId?: string;
31
- }): boolean;
31
+ interactiveOptionIds?: readonly string[];
32
+ }, targetCacheKey?: string): boolean;
33
+ /** The runner-owned live document currently reproducing this state. */
34
+ export declare function useInteractiveSessionSurface(page: {
35
+ id: string;
36
+ interactiveStateId?: string;
37
+ interactiveOptionId?: string;
38
+ interactiveOptionIds?: readonly string[];
39
+ }): InteractiveSessionSurface | null;
32
40
  /**
33
41
  * True while this frame holds one of the host's live screen slots, meaning it
34
42
  * renders the running app rather than its frozen capture.
@@ -60,6 +60,16 @@ export interface DesignScreenInteraction {
60
60
  settleMs?: number;
61
61
  optional?: boolean;
62
62
  }
63
+ /** Timing policy for replaying a screen recipe outside the capture pipeline. */
64
+ export interface DesignScreenInteractionRunOptions {
65
+ /**
66
+ * Fallback pause after click, focus, hover, fill, check, and press steps.
67
+ * The capture default is 600ms. A step's explicit `settleMs` always wins.
68
+ */
69
+ defaultActionSettleMs?: number;
70
+ /** Called after boot presets succeed and immediately before actions begin. */
71
+ onBeforeInteractions?: () => void;
72
+ }
63
73
  /** A JSON-compatible value that conveys host-specific meaning without Pygmalion interpreting it. */
64
74
  export type DesignSerializable = string | number | boolean | null | readonly DesignSerializable[] | {
65
75
  readonly [key: string]: DesignSerializable;
@@ -442,9 +452,9 @@ export interface DesignImportController {
442
452
  timeoutMs?: number;
443
453
  minElementCount?: number;
444
454
  }): Promise<DomImportResult | null>;
445
- runScreenInteractions(iframe: HTMLIFrameElement, interactions: readonly DesignScreenInteraction[]): Promise<DesignScreenInteractionReport>;
455
+ runScreenInteractions(iframe: HTMLIFrameElement, interactions: readonly DesignScreenInteraction[], options?: DesignScreenInteractionRunOptions): Promise<DesignScreenInteractionReport>;
446
456
  /** Reproduces and verifies state without waiting for capture-only stability. */
447
- prepareScreenState?(iframe: HTMLIFrameElement, spec: DesignScreenCaptureSpec): Promise<DesignScreenCaptureReport>;
457
+ prepareScreenState?(iframe: HTMLIFrameElement, spec: DesignScreenCaptureSpec, options?: DesignScreenInteractionRunOptions): Promise<DesignScreenCaptureReport>;
448
458
  prepareScreenCapture(iframe: HTMLIFrameElement, spec: DesignScreenCaptureSpec): Promise<DesignScreenCaptureReport>;
449
459
  }
450
460
  /**
@@ -1,4 +1,9 @@
1
+ import { type DesignImportController, type DesignScreenCaptureSpec } from './designImport';
2
+ import type { ResolvedFlowPath } from './flowSessions';
3
+ import type { ScreenFlowPath } from './screenFlows';
1
4
  import { type PageModel } from './store';
5
+ /** Applies the active frame's own boot condition to a path-specific session. */
6
+ export declare function resolveActivePagePath(resolved: ResolvedFlowPath, path: ScreenFlowPath, page: PageModel): ResolvedFlowPath;
2
7
  /** Diagnostic counters for the headless debug surface. */
3
8
  export declare const __flowSchedulerDebug: {
4
9
  calls: number;
@@ -62,6 +67,19 @@ export declare function viewportSessionWillDeliver(page: {
62
67
  }): boolean;
63
68
  /** Subscribe to viewport-variant delivery changes. */
64
69
  export declare function subscribeViewportSessions(listener: () => void): () => void;
70
+ type InteractivePreparationController = Pick<DesignImportController, 'prepareScreenCapture' | 'prepareScreenState'>;
71
+ /**
72
+ * Reproduces an editor-controlled state without capture-only quiescence.
73
+ * The runner already waits for a trailing paint and stable geometry before it
74
+ * serializes, so repeating the capture stability pass only delays the panel.
75
+ */
76
+ export declare function prepareInteractiveSessionState(iframe: HTMLIFrameElement, spec: DesignScreenCaptureSpec, controller?: InteractivePreparationController | null, onBeforeInteractions?: () => void): Promise<import("./designImport").DesignScreenCaptureReport>;
77
+ export declare function interactiveSessionScreenId(page: {
78
+ id: string;
79
+ interactiveStateId?: string;
80
+ interactiveOptionId?: string;
81
+ interactiveOptionIds?: readonly string[];
82
+ }): string;
65
83
  /**
66
84
  * Materializes one screen in its declared interactive state through the
67
85
  * screen's flow path. The prefix walks as pass-through; the target publishes
@@ -70,14 +88,14 @@ export declare function subscribeViewportSessions(listener: () => void): () => v
70
88
  * Returns false when no flow claims the screen — those frames keep the live
71
89
  * boot fallback.
72
90
  */
73
- export declare function materializePageInteractiveState(page: PageModel, previewRevision: string): boolean;
91
+ export declare function materializePageInteractiveState(page: PageModel, previewRevision: string, targetCacheKey?: string): boolean;
74
92
  /** True while an interactive-state session still owes this page its snapshot. */
75
93
  export declare function interactiveSessionWillDeliver(page: {
76
- importPageId?: string;
77
94
  id: string;
78
95
  interactiveStateId?: string;
79
96
  interactiveOptionId?: string;
80
- }): boolean;
97
+ interactiveOptionIds?: readonly string[];
98
+ }, targetCacheKey?: string): boolean;
81
99
  /** Subscribe to interactive-state delivery changes. */
82
100
  export declare function subscribeInteractiveSessions(listener: () => void): () => void;
83
101
  /** Diagnostic counters for the interactive-state path. */
@@ -101,3 +119,4 @@ export declare const __viewportCommitDebug: {
101
119
  };
102
120
  /** Viewport-runner delivery states for the headless debug surface. */
103
121
  export declare function __debugViewportSessionStates(): Record<string, unknown>;
122
+ export {};
@@ -87,7 +87,7 @@ export interface FlowSessionRunnerOptions {
87
87
  preset?: DesignScreenPreset;
88
88
  interactions?: readonly DesignScreenInteraction[];
89
89
  assertions?: readonly DesignScreenAssertion[];
90
- }) => Promise<DesignScreenCaptureReport>;
90
+ }, waypoint: ResolvedFlowWaypoint) => Promise<DesignScreenCaptureReport>;
91
91
  /** Extra settle before serializing a waypoint (fonts, trailing paints). */
92
92
  settle?: (iframe: HTMLIFrameElement, ms: number) => Promise<void>;
93
93
  /** Layout-stability wait before serializing. Defaults to waitForGeometryStability. */
@@ -95,6 +95,8 @@ export interface FlowSessionRunnerOptions {
95
95
  serialize?: (iframe: HTMLIFrameElement, fallbackUrl: string) => string | null;
96
96
  /** Writes one waypoint snapshot into the route preview store. */
97
97
  publish?: (cacheKey: string, snapshot: string) => boolean;
98
+ /** Releases a live document after its delivery finishes or is abandoned. */
99
+ onWaypointFinish?: (iframe: HTMLIFrameElement, waypoint: ResolvedFlowWaypoint, outcome: 'completed' | 'failed' | 'cancelled') => void;
98
100
  onError?: (pathId: string, error: unknown) => void;
99
101
  }
100
102
  /**
@@ -144,6 +146,11 @@ export declare function createFlowSessionRunner(options?: FlowSessionRunnerOptio
144
146
  setConcurrency(next: number): void;
145
147
  /** Session state of one screen, or null when no session claims it. */
146
148
  screenState(screenId: string): FlowScreenState | null;
149
+ /**
150
+ * Forgets a terminal delivery whose external snapshot was evicted. A
151
+ * running or queued screen keeps its claim and cannot be invalidated.
152
+ */
153
+ forgetScreen(screenId: string): boolean;
147
154
  /** True while the session still owes this screen its snapshot. */
148
155
  willDeliver(screenId: string): boolean;
149
156
  subscribe(listener: () => void): () => void;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The live document currently reproducing a right-panel screen state.
3
+ *
4
+ * State preservation and state presentation are intentionally separate. The
5
+ * flow runner keeps this iframe alive until its exact frozen snapshot is
6
+ * published, while the active frame may mirror the running document
7
+ * immediately so capture stability never becomes interaction latency.
8
+ */
9
+ export interface InteractiveSessionSurface {
10
+ iframe: HTMLIFrameElement;
11
+ screenId: string;
12
+ }
13
+ /** Exposes a runner-owned iframe without transferring its ownership. */
14
+ export declare function exposeInteractiveSessionSurface(screenId: string, iframe: HTMLIFrameElement): void;
15
+ /** Releases a surface only when the caller still owns the registered iframe. */
16
+ export declare function releaseInteractiveSessionSurface(screenId: string, iframe: HTMLIFrameElement): void;
17
+ export declare function getInteractiveSessionSurface(screenId: string): InteractiveSessionSurface | null;
18
+ export declare function subscribeInteractiveSessionSurface(screenId: string, listener: () => void): () => void;
@@ -1,4 +1,4 @@
1
- import type { DesignScreenInteraction, DesignScreenInteractionReport } from './designImport';
1
+ import type { DesignScreenInteraction, DesignScreenInteractionRunOptions, DesignScreenInteractionReport } from './designImport';
2
2
  export declare function settleScreen(iframe: HTMLIFrameElement, settleMs: number): Promise<void>;
3
3
  export declare function elementVisible(element: Element): boolean;
4
- export declare function runScreenInteractions(iframe: HTMLIFrameElement, interactions: readonly DesignScreenInteraction[]): Promise<DesignScreenInteractionReport>;
4
+ export declare function runScreenInteractions(iframe: HTMLIFrameElement, interactions: readonly DesignScreenInteraction[], options?: DesignScreenInteractionRunOptions): Promise<DesignScreenInteractionReport>;
@@ -91,7 +91,7 @@ export type { ConditionCoverageRoute, ConditionCoverageScreen, ConformanceScreen
91
91
  export { clearPreviewEnvironmentControlValues, getPreviewEnvironmentControlValue, getPreviewEnvironmentControls, getPreviewEnvironmentOverride, setPreviewEnvironmentControlValue, setPreviewEnvironmentControls, subscribePreviewEnvironmentControls, } from './editor/previewEnvironmentControls';
92
92
  export type { PreviewEnvironmentControlDef, PreviewEnvironmentControlOptionDef, } from './editor/previewEnvironmentControls';
93
93
  export { createDesignImportController, createDesignScreenCollection, DESIGN_IMPORT_KINDS, expandDesignScreenCasesViewports, expandDesignScreenCollectionViewports, mergeScreenPresets, } from './editor/designImport';
94
- export type { CreateDesignImportOptions, DesignBehaviorScenario, DesignImportAsset, DesignImportCollection, DesignImportController, DesignImportCoverage, DesignImportCoverageItem, DesignImportInitialPage, DesignImportKind, DesignImportManifest, DesignImportPage, DesignFrameHeightMode, DesignFrameSizeMode, DesignScenarioCoverage, DesignScenarioSource, DesignScreenCase, DesignScreenAssertion, DesignScreenAssertionReport, DesignScreenAssertionVisibility, DesignScreenAttributeAssertion, DesignScreenCaptureFailure, DesignScreenCaptureFailureCode, DesignScreenCaptureFailureStage, DesignScreenCaptureDefaults, DesignScreenCaptureRequirements, DesignScreenCaptureReport, DesignScreenCaptureSpec, DesignScreenCollectionResult, DesignScreenInteraction, DesignScreenInteractionAction, DesignScreenInteractionReport, DesignScreenPreset, DesignScreenPresetContext, DesignScreenPresetExecutionResult, DesignScreenPresetExecutor, DesignScreenPresetRequest, DesignScreenViewport, DesignScreenViewportExpansionOptions, DesignScreenViewportPagePatch, DesignSerializable, StoryboardEnvironment, StoryboardMediaDevice, StoryboardMediaFailure, StoryboardNetwork, StoryboardPermissionState, StoryboardRequestCondition, StoryboardRequestOutcome, } from './editor/designImport';
94
+ export type { CreateDesignImportOptions, DesignBehaviorScenario, DesignImportAsset, DesignImportCollection, DesignImportController, DesignImportCoverage, DesignImportCoverageItem, DesignImportInitialPage, DesignImportKind, DesignImportManifest, DesignImportPage, DesignFrameHeightMode, DesignFrameSizeMode, DesignScenarioCoverage, DesignScenarioSource, DesignScreenCase, DesignScreenAssertion, DesignScreenAssertionReport, DesignScreenAssertionVisibility, DesignScreenAttributeAssertion, DesignScreenCaptureFailure, DesignScreenCaptureFailureCode, DesignScreenCaptureFailureStage, DesignScreenCaptureDefaults, DesignScreenCaptureRequirements, DesignScreenCaptureReport, DesignScreenCaptureSpec, DesignScreenCollectionResult, DesignScreenInteraction, DesignScreenInteractionAction, DesignScreenInteractionRunOptions, DesignScreenInteractionReport, DesignScreenPreset, DesignScreenPresetContext, DesignScreenPresetExecutionResult, DesignScreenPresetExecutor, DesignScreenPresetRequest, DesignScreenViewport, DesignScreenViewportExpansionOptions, DesignScreenViewportPagePatch, DesignSerializable, StoryboardEnvironment, StoryboardMediaDevice, StoryboardMediaFailure, StoryboardNetwork, StoryboardPermissionState, StoryboardRequestCondition, StoryboardRequestOutcome, } from './editor/designImport';
95
95
  export type { DomImportDiagnostic, DomImportMetrics, DomImportOptions, DomImportResult, } from './editor/domImport';
96
96
  export type { SharedSourceEditScope, SharedSourceFrameSummary, SharedSourceImpact, } from './editor/sharedSource';
97
97
  export type { NodeJSON } from './editor/store';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pygmalionjs/pygmalion",
3
- "version": "0.6.17",
3
+ "version": "0.6.19",
4
4
  "description": "Code-backed DOM design sandbox and visual QA editor",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {