@pygmalionjs/pygmalion 0.2.18 → 0.2.20

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/storyboard.d.ts CHANGED
@@ -66,6 +66,21 @@ export interface StoryboardCaptureOptions<
66
66
  contextOptions?: Record<string, unknown>;
67
67
  navigationOptions?: Record<string, unknown>;
68
68
  screenshotOptions?: Record<string, unknown>;
69
+ /** How long to wait for a still document, and what may keep moving. */
70
+ stability?: StoryboardStabilityOptions;
71
+ }
72
+
73
+ export interface StoryboardStabilityOptions {
74
+ /** Samples before giving up. Default 40 at 100ms, so a 4s ceiling. */
75
+ attempts?: number;
76
+ requiredStableSamples?: number;
77
+ intervalMs?: number;
78
+ minimumWaitMs?: number;
79
+ /**
80
+ * Regions that are expected to keep changing — an elapsed clock, a level
81
+ * meter, a marquee. Mutations confined to them do not count as churn.
82
+ */
83
+ volatileSelectors?: readonly string[];
69
84
  }
70
85
 
71
86
  export declare const STORYBOARD_CAPTURE_STATUSES: Readonly<{
@@ -132,14 +147,11 @@ export declare function assertFinalStoryboardState(
132
147
  ): Promise<void>;
133
148
  export declare function waitForStableStoryboardDocument(
134
149
  page: unknown,
135
- options?: {
136
- attempts?: number;
137
- requiredStableSamples?: number;
138
- intervalMs?: number;
139
- minimumWaitMs?: number;
140
- },
150
+ options?: StoryboardStabilityOptions,
141
151
  ): Promise<boolean>;
142
- export declare function storyboardDocumentStabilitySignature(): string;
152
+ export declare function storyboardDocumentStabilitySignature(
153
+ volatileSelectors?: readonly string[],
154
+ ): string;
143
155
  export declare function storyboardCaptureCandidateTexts(
144
156
  element: Element,
145
157
  ): string[];
package/types.d.ts CHANGED
@@ -161,6 +161,17 @@ export interface TokenDef {
161
161
  group?: string;
162
162
  }
163
163
 
164
+ export interface ViewportPresetDef {
165
+ /** Button text. The panel column is narrow, so keep it to a few characters. */
166
+ label: string;
167
+ /** Frame width in CSS pixels. */
168
+ width: number;
169
+ /** Frame height. Omit to resize width only and leave the current height alone. */
170
+ height?: number;
171
+ /** Tooltip text. Defaults to the dimensions. */
172
+ description?: string;
173
+ }
174
+
164
175
  export const DESIGN_IMPORT_KINDS: readonly [
165
176
  'icons',
166
177
  'design-tokens',
@@ -623,6 +634,12 @@ export declare function setComponentRegistry(r: ComponentRegistry): void;
623
634
 
624
635
  export declare function setTokens(t: TokenDef[]): void;
625
636
 
637
+ /** Declares the frame widths the panel offers. A malformed entry throws at mount. */
638
+ export declare function setViewportPresets(
639
+ presets: readonly ViewportPresetDef[],
640
+ ): void;
641
+ export declare function getViewportPresets(): ViewportPresetDef[];
642
+
626
643
  /** Updates the standard route of the running route iframe. The existing editing status is maintained. */
627
644
  export declare function setPygmalionAppOrigin(origin: string): void;
628
645
  /** Update the static screen cache when a preview of the same URL points to a new code version. */
@@ -1620,6 +1637,8 @@ export declare function PygmalionEditor(props: {
1620
1637
  registry?: ComponentRegistry;
1621
1638
  tokens?: TokenDef[];
1622
1639
  initialPages?: InitialPageDef[];
1640
+ /** Named frame widths the application supports — rendered as one-click buttons beside the W/H boxes. */
1641
+ viewportPresets?: readonly ViewportPresetDef[];
1623
1642
  /** icons/tokens/atoms/components/screens Controller for getting inventory and full DOM layers. */
1624
1643
  designImport?: DesignImportController;
1625
1644
  /** Called with cumulative changes when editing asset panel tokens — Host is responsible for write-back (file saving). */