@pygmalionjs/pygmalion 0.6.31 → 0.6.32

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-D9J35QsM.js";
1
+ import { F as s, N as a, e as r, s as i, a as t } from "./FrozenRoutePreview-BwkyYvUV.js";
2
2
  export {
3
3
  s as FrozenRoutePreviewView,
4
4
  a as NodeModel,
@@ -323,6 +323,12 @@ interface CanvasLayoutSnapshotV5 {
323
323
  sections: SectionRect[];
324
324
  }
325
325
  export declare const CANVAS_LAYOUT_VERSION = 5;
326
+ export declare const ACTIVE_FRAME_STORAGE_VERSION = 1;
327
+ interface ActiveFrameSnapshotV1 {
328
+ version: typeof ACTIVE_FRAME_STORAGE_VERSION;
329
+ frameId: string;
330
+ }
331
+ export declare function isActiveFrameSnapshot(value: unknown): value is ActiveFrameSnapshotV1;
326
332
  export declare function isCanvasLayoutSnapshot(value: unknown, scope: string): value is CanvasLayoutSnapshotV5;
327
333
  export type CanvasObjectSelection = {
328
334
  kind: 'frame';
@@ -457,6 +463,9 @@ export declare class EditorStore {
457
463
  private canvasLayoutScope;
458
464
  private canvasLayoutStorageKey;
459
465
  private canvasLayoutDisposer;
466
+ /** Same-tab reload restoration keyed by a host-provided workspace identity. */
467
+ private activeFrameStorageKey;
468
+ private activeFrameDisposer;
460
469
  /** Explicit edit scope by sourceKey. Unspecified is shared like the existing operation. */
461
470
  private sharedSourceEditScopes;
462
471
  /** The final change that can be safely reflected to the original source during a regular canvas NodeModel patch. */
@@ -612,6 +621,15 @@ export declare class EditorStore {
612
621
  * Embeds without source revision do not enable persistence because projects cannot be safely distinguished.
613
622
  */
614
623
  private startCanvasLayoutPersistence;
624
+ /**
625
+ * Restores the last deliberately viewed frame after a same-tab reload.
626
+ *
627
+ * Internal page ids are allocation-order values (`p42`) and cannot survive a
628
+ * reload. The snapshot therefore stores the host's canonical import id, with
629
+ * route/path/name only as fallbacks for smaller embeds. Missing, malformed,
630
+ * or stale snapshots leave the configured initial frame in place.
631
+ */
632
+ configureActiveFramePersistence(scope: string | undefined): void;
615
633
  /** Called once when a direct-manipulation gesture starts. Subsequent pointer updates skip history. */
616
634
  beginFrameTransform(id: string, kind: 'move' | 'resize'): boolean;
617
635
  moveFrame(id: string, x: number, y: number, recordHistory?: boolean): void;
@@ -283,12 +283,19 @@ export declare function pygmalionOpenPreview(): void;
283
283
  export declare function pygmalionResetCurrentEdits(): boolean;
284
284
  export interface InitialPageDef extends DesignImportInitialPage {
285
285
  }
286
- export declare function PygmalionEditor({ registry, tokens, initialPages, initialCanvas, initialEditMode, componentConnections, codegenProject, codegenValidator, codegenValidationScope, viewportPresets, sessionPresets, previewEnvironmentControls, designImport, onTokensChange, appOrigin, previewRevision, previewCacheNamespace, previewArtifacts, previewArtifactEndpoint, previewConcurrency, previewOpen, onPreviewOpenChange, flowCanvas, frameSurface, captureSupply, screenFlows, screenFlowConcurrency, scenarioCoverage, screenDimensions, screenLists, sectionHeaders, sectionHeaderLabels, screenLanes, frameBranchKinds, frameLabelLabels, screenCards, liveScreenBudget, screenStateAxes, interactiveStates, surfaceClassifications, onApply, onDesignChange, onInspectApply, onInspectPreview, onInspectImpact, storyboard, storyboardScenarios, sessionStoryboards, storyboardDiscovery, storyboardDiscoveryEndpoint, }: {
286
+ export declare function PygmalionEditor({ registry, tokens, initialPages, initialCanvas, activeFramePersistenceKey, initialEditMode, componentConnections, codegenProject, codegenValidator, codegenValidationScope, viewportPresets, sessionPresets, previewEnvironmentControls, designImport, onTokensChange, appOrigin, previewRevision, previewCacheNamespace, previewArtifacts, previewArtifactEndpoint, previewConcurrency, previewOpen, onPreviewOpenChange, flowCanvas, frameSurface, captureSupply, screenFlows, screenFlowConcurrency, scenarioCoverage, screenDimensions, screenLists, sectionHeaders, sectionHeaderLabels, screenLanes, frameBranchKinds, frameLabelLabels, screenCards, liveScreenBudget, screenStateAxes, interactiveStates, surfaceClassifications, onApply, onDesignChange, onInspectApply, onInspectPreview, onInspectImpact, storyboard, storyboardScenarios, sessionStoryboards, storyboardDiscovery, storyboardDiscoveryEndpoint, }: {
287
287
  registry?: ComponentRegistry;
288
288
  tokens?: TokenDef[];
289
289
  initialPages?: InitialPageDef[];
290
290
  /** Canvas shown on first mount. Useful when an earlier catalog canvas is expensive to render. */
291
291
  initialCanvas?: string;
292
+ /**
293
+ * Stable host/workspace identity used to restore the last active frame after
294
+ * a same-tab reload. Pygmalion namespaces and hashes this value before using
295
+ * sessionStorage; canonical `importPageId` values are stored, never transient
296
+ * internal page ids.
297
+ */
298
+ activeFramePersistenceKey?: string;
292
299
  /**
293
300
  * Mode the editor opens in. Defaults to 'edit'. A host whose editor is a
294
301
  * review surface declares 'view-only' so a reader is not one keystroke from
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pygmalionjs/pygmalion",
3
- "version": "0.6.31",
3
+ "version": "0.6.32",
4
4
  "description": "Code-backed DOM design sandbox and visual QA editor",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {