@pygmalionjs/pygmalion 0.5.13 → 0.5.15
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/types/App.d.ts +5 -0
- package/dist-lib/types/canvas/CameraLayer.d.ts +9 -0
- package/dist-lib/types/canvas/Canvas.d.ts +19 -0
- package/dist-lib/types/canvas/FrameLabelBanner.d.ts +7 -0
- package/dist-lib/types/canvas/FrameView.d.ts +9 -0
- package/dist-lib/types/canvas/FrozenRoutePreview.d.ts +12 -0
- package/dist-lib/types/canvas/InspectOverlay.d.ts +10 -0
- package/dist-lib/types/canvas/LightweightCanvas.d.ts +10 -0
- package/dist-lib/types/canvas/ObjectControls.d.ts +22 -0
- package/dist-lib/types/canvas/Preview.d.ts +3 -0
- package/dist-lib/types/canvas/SectionBoxes.d.ts +24 -0
- package/dist-lib/types/canvas/ShadowRoutePreview.d.ts +14 -0
- package/dist-lib/types/canvas/StoryboardConnections.d.ts +31 -0
- package/dist-lib/types/canvas/cameraPlacement.d.ts +45 -0
- package/dist-lib/types/canvas/domTags.d.ts +10 -0
- package/dist-lib/types/canvas/layoutContext.d.ts +9 -0
- package/dist-lib/types/canvas/useFlowSession.d.ts +36 -0
- package/dist-lib/types/canvas/useFrameLod.d.ts +35 -0
- package/dist-lib/types/editor/adaptiveFrameLayout.d.ts +67 -0
- package/dist-lib/types/editor/assetEditing.d.ts +10 -0
- package/dist-lib/types/editor/bannerStyle.d.ts +18 -0
- package/dist-lib/types/editor/catalog.d.ts +101 -0
- package/dist-lib/types/editor/codegen.d.ts +11 -0
- package/dist-lib/types/editor/componentConnections.d.ts +63 -0
- package/dist-lib/types/editor/componentInstances.d.ts +27 -0
- package/dist-lib/types/editor/contentBounds.d.ts +34 -0
- package/dist-lib/types/editor/designCompiler.d.ts +100 -0
- package/dist-lib/types/editor/designImport.d.ts +448 -0
- package/dist-lib/types/editor/documentSync.d.ts +28 -0
- package/dist-lib/types/editor/domImport.d.ts +58 -0
- package/dist-lib/types/editor/editModePolicy.d.ts +17 -0
- package/dist-lib/types/editor/fiberMap.d.ts +16 -0
- package/dist-lib/types/editor/flowSessionScheduler.d.ts +97 -0
- package/dist-lib/types/editor/flowSessions.d.ts +137 -0
- package/dist-lib/types/editor/frameHeight.d.ts +14 -0
- package/dist-lib/types/editor/frameIdentity.d.ts +9 -0
- package/dist-lib/types/editor/frameLabels.d.ts +124 -0
- package/dist-lib/types/editor/frameLanes.d.ts +62 -0
- package/dist-lib/types/editor/frameLod.d.ts +123 -0
- package/dist-lib/types/editor/frameLodRuntime.d.ts +64 -0
- package/dist-lib/types/editor/framePointerHit.d.ts +67 -0
- package/dist-lib/types/editor/framePointerIntent.d.ts +53 -0
- package/dist-lib/types/editor/framePreviewChannels.d.ts +26 -0
- package/dist-lib/types/editor/framePreviewKeys.d.ts +21 -0
- package/dist-lib/types/editor/frameWheelRouting.d.ts +16 -0
- package/dist-lib/types/editor/frozenImport.d.ts +70 -0
- package/dist-lib/types/editor/host.d.ts +114 -0
- package/dist-lib/types/editor/inspect.d.ts +225 -0
- package/dist-lib/types/editor/interactiveStates.d.ts +103 -0
- package/dist-lib/types/editor/livePreviewInstances.d.ts +93 -0
- package/dist-lib/types/editor/liveScreens.d.ts +20 -0
- package/dist-lib/types/editor/nodeSelector.d.ts +20 -0
- package/dist-lib/types/editor/previewBootstrap.d.ts +189 -0
- package/dist-lib/types/editor/previewEnvironmentControls.d.ts +33 -0
- package/dist-lib/types/editor/previewHydration.d.ts +5 -0
- package/dist-lib/types/editor/previewIntent.d.ts +17 -0
- package/dist-lib/types/editor/previewSweep.d.ts +129 -0
- package/dist-lib/types/editor/previewWarmup.d.ts +77 -0
- package/dist-lib/types/editor/projectBootGate.d.ts +45 -0
- package/dist-lib/types/editor/projectRuntime.d.ts +138 -0
- package/dist-lib/types/editor/registry.d.ts +38 -0
- package/dist-lib/types/editor/routePreview.d.ts +285 -0
- package/dist-lib/types/editor/routePreviewArtifactV2.d.ts +34 -0
- package/dist-lib/types/editor/routePreviewArtifactV3.d.ts +64 -0
- package/dist-lib/types/editor/routePreviewPlacement.d.ts +9 -0
- package/dist-lib/types/editor/routePreviewStatus.d.ts +48 -0
- package/dist-lib/types/editor/scenarioCoverage.d.ts +167 -0
- package/dist-lib/types/editor/screenCards.d.ts +101 -0
- package/dist-lib/types/editor/screenDimensions.d.ts +63 -0
- package/dist-lib/types/editor/screenFlows.d.ts +47 -0
- package/dist-lib/types/editor/screenInteractions.d.ts +4 -0
- package/dist-lib/types/editor/screenLists.d.ts +40 -0
- package/dist-lib/types/editor/screenStateGroups.d.ts +36 -0
- package/dist-lib/types/editor/screenshotBitmaps.d.ts +20 -0
- package/dist-lib/types/editor/sectionHeaders.d.ts +117 -0
- package/dist-lib/types/editor/shadowPreview.d.ts +103 -0
- package/dist-lib/types/editor/sharedSource.d.ts +40 -0
- package/dist-lib/types/editor/sourceJournal.d.ts +27 -0
- package/dist-lib/types/editor/store.d.ts +838 -0
- package/dist-lib/types/editor/storyboardComposition.d.ts +116 -0
- package/dist-lib/types/editor/storyboardDiscovery.d.ts +105 -0
- package/dist-lib/types/editor/storyboardEnvironment.d.ts +22 -0
- package/dist-lib/types/editor/storyboardGraph.d.ts +120 -0
- package/dist-lib/types/editor/storyboardGraphRuntime.d.ts +12 -0
- package/dist-lib/types/editor/storyboardGraphView.d.ts +104 -0
- package/dist-lib/types/editor/surfaceDemands.d.ts +138 -0
- package/dist-lib/types/editor/tokens.d.ts +26 -0
- package/dist-lib/types/editor/useObserved.d.ts +1 -0
- package/dist-lib/types/editor/viewportPresets.d.ts +21 -0
- package/dist-lib/types/editor/visualQa.d.ts +50 -0
- package/dist-lib/types/lib.d.ts +345 -0
- package/dist-lib/types/shell/ApplyPanel.d.ts +1 -0
- package/dist-lib/types/shell/AssetsPanel.d.ts +3 -0
- package/dist-lib/types/shell/CanvasStatusProbe.d.ts +5 -0
- package/dist-lib/types/shell/CodePanel.d.ts +1 -0
- package/dist-lib/types/shell/ComponentStateControls.d.ts +108 -0
- package/dist-lib/types/shell/ContextMenu.d.ts +1 -0
- package/dist-lib/types/shell/LayerTree.d.ts +7 -0
- package/dist-lib/types/shell/PropsPanel.d.ts +1 -0
- package/dist-lib/types/shell/StoryboardGraphPanel.d.ts +23 -0
- package/dist-lib/types/shell/ZoomIndicator.d.ts +4 -0
- package/dist-lib/types/shell/qaPresentation.d.ts +9 -0
- package/dist-lib/types/testing.d.ts +8 -0
- package/dist-lib/types/ui/SourceRefControl.d.ts +38 -0
- package/dist-lib/types/ui/icons.d.ts +30 -0
- package/node/dev-mirror.mjs +142 -1
- package/node/dev-view.vite.mjs +37 -0
- package/package.json +7 -8
- package/testing.d.ts +0 -26
- package/types.d.ts +0 -2675
|
@@ -0,0 +1,838 @@
|
|
|
1
|
+
import { type InteractiveStateDef } from './interactiveStates';
|
|
2
|
+
import { type ScreenDimensionDef } from './screenDimensions';
|
|
3
|
+
import { type CardBadgeOption, type CardSlotDef, type ScreenCardDef } from './screenCards';
|
|
4
|
+
import { type ScreenListDef } from './screenLists';
|
|
5
|
+
import { type DesignImportAsset, type DesignImportKind, type DesignFrameSizeMode, type DesignScreenAssertion, type DesignScreenInteraction, type DesignScreenPreset, type StoryboardEnvironment } from './designImport';
|
|
6
|
+
import { type DomImportDiagnostic, type DomImportResult } from './domImport';
|
|
7
|
+
import { type DesignFrameHeightMode } from './frameHeight';
|
|
8
|
+
import { type RegistryPropValue } from './registry';
|
|
9
|
+
import { type PrimitiveSourceValue } from './inspect';
|
|
10
|
+
import { type SourceJournalSnapshot } from './sourceJournal';
|
|
11
|
+
import { type SharedSourceEditScope, type SharedSourceImpact } from './sharedSource';
|
|
12
|
+
export type NodeType = 'rows' | 'columns' | 'text' | 'component';
|
|
13
|
+
/** Autolayout container type (with direction, gap, and alignment). */
|
|
14
|
+
export declare const isContainerType: (t: NodeType) => t is "rows" | "columns";
|
|
15
|
+
/** Can contain child nodes — container + children:'nodes' components (Card, etc.). */
|
|
16
|
+
export declare const canHaveChildren: (n: NodeModel) => boolean;
|
|
17
|
+
export type SizeMode = 'fill' | 'fit' | 'fixed';
|
|
18
|
+
export type TextAlign = 'left' | 'center' | 'right';
|
|
19
|
+
export type JustifyMode = 'start' | 'center' | 'end' | 'between';
|
|
20
|
+
export type AlignMode = 'start' | 'center' | 'end';
|
|
21
|
+
export declare class NodeModel {
|
|
22
|
+
id: string;
|
|
23
|
+
type: NodeType;
|
|
24
|
+
name: string;
|
|
25
|
+
children: NodeModel[];
|
|
26
|
+
widthMode: SizeMode;
|
|
27
|
+
width: number;
|
|
28
|
+
heightMode: SizeMode;
|
|
29
|
+
height: number;
|
|
30
|
+
gap: number;
|
|
31
|
+
padding: number;
|
|
32
|
+
justify: JustifyMode;
|
|
33
|
+
alignItems: AlignMode;
|
|
34
|
+
fill: string;
|
|
35
|
+
radius: number;
|
|
36
|
+
borderWidth: number;
|
|
37
|
+
borderColor: string;
|
|
38
|
+
opacity: number;
|
|
39
|
+
hidden: boolean;
|
|
40
|
+
locked: boolean;
|
|
41
|
+
text: string;
|
|
42
|
+
fontSize: number;
|
|
43
|
+
fontWeight: number;
|
|
44
|
+
color: string;
|
|
45
|
+
textAlign: TextAlign;
|
|
46
|
+
componentName: string;
|
|
47
|
+
componentProps: Record<string, RegistryPropValue>;
|
|
48
|
+
childrenText: string;
|
|
49
|
+
domTag: string;
|
|
50
|
+
domAttributes: Record<string, string>;
|
|
51
|
+
domStyle: Record<string, string>;
|
|
52
|
+
/** registry importPath/component file boundary. Connects sub-DOMs of the same implementation between frames. */
|
|
53
|
+
sourceComponent: string;
|
|
54
|
+
/** CSS module source (file#localClass). The strongest shared identifier for style editing. */
|
|
55
|
+
sourceStyle: string;
|
|
56
|
+
/** Stable shared key calculated from the sourceComponent/sourceStyle/route structure. */
|
|
57
|
+
sourceKey: string;
|
|
58
|
+
/** Primitive literals authored on this rendered element's owning JSX opening. */
|
|
59
|
+
sourceProps: Record<string, PrimitiveSourceValue>;
|
|
60
|
+
linkTo: string;
|
|
61
|
+
constructor(type: NodeType, patch?: Partial<NodeModel>);
|
|
62
|
+
}
|
|
63
|
+
export interface NodeJSON {
|
|
64
|
+
id: string;
|
|
65
|
+
type: NodeType;
|
|
66
|
+
name: string;
|
|
67
|
+
widthMode: SizeMode;
|
|
68
|
+
width: number;
|
|
69
|
+
heightMode: SizeMode;
|
|
70
|
+
height: number;
|
|
71
|
+
gap: number;
|
|
72
|
+
padding: number;
|
|
73
|
+
justify: JustifyMode;
|
|
74
|
+
alignItems: AlignMode;
|
|
75
|
+
fill: string;
|
|
76
|
+
radius: number;
|
|
77
|
+
borderWidth: number;
|
|
78
|
+
borderColor: string;
|
|
79
|
+
opacity: number;
|
|
80
|
+
hidden: boolean;
|
|
81
|
+
locked: boolean;
|
|
82
|
+
text: string;
|
|
83
|
+
fontSize: number;
|
|
84
|
+
fontWeight: number;
|
|
85
|
+
color: string;
|
|
86
|
+
textAlign: TextAlign;
|
|
87
|
+
componentName: string;
|
|
88
|
+
componentProps: Record<string, RegistryPropValue>;
|
|
89
|
+
childrenText: string;
|
|
90
|
+
domTag: string;
|
|
91
|
+
domAttributes: Record<string, string>;
|
|
92
|
+
domStyle: Record<string, string>;
|
|
93
|
+
sourceComponent?: string;
|
|
94
|
+
sourceStyle?: string;
|
|
95
|
+
sourceKey?: string;
|
|
96
|
+
sourceProps?: Record<string, PrimitiveSourceValue>;
|
|
97
|
+
linkTo: string;
|
|
98
|
+
children: NodeJSON[];
|
|
99
|
+
}
|
|
100
|
+
export interface FrozenPreviewMutation {
|
|
101
|
+
key: string;
|
|
102
|
+
selector: string;
|
|
103
|
+
text?: string;
|
|
104
|
+
textNodeOrdinal?: number;
|
|
105
|
+
hidden?: boolean;
|
|
106
|
+
attributes?: Record<string, string | null>;
|
|
107
|
+
replaceChildrenHtml?: string;
|
|
108
|
+
/** A serialization descriptor to re-execute the registry component within the ownerDocument of the frozen iframe. */
|
|
109
|
+
component?: {
|
|
110
|
+
name: string;
|
|
111
|
+
props: Record<string, RegistryPropValue>;
|
|
112
|
+
childrenText: string;
|
|
113
|
+
};
|
|
114
|
+
/** Changes that cannot be expressed accurately without rerunning React. Specifies on the screen where the selector exists. */
|
|
115
|
+
staleReason?: string;
|
|
116
|
+
}
|
|
117
|
+
export interface FrozenPreviewCssRule {
|
|
118
|
+
key: string;
|
|
119
|
+
selector: string;
|
|
120
|
+
css: string;
|
|
121
|
+
}
|
|
122
|
+
export declare function serializeNode(n: NodeModel): NodeJSON;
|
|
123
|
+
export declare function deserializeNode(j: NodeJSON, freshIds?: boolean): NodeModel;
|
|
124
|
+
export interface DropHint {
|
|
125
|
+
parentId: string;
|
|
126
|
+
index: number;
|
|
127
|
+
/** Drop indicator line — viewport(fixed) coordinates. */
|
|
128
|
+
indicator: {
|
|
129
|
+
left: number;
|
|
130
|
+
top: number;
|
|
131
|
+
width: number;
|
|
132
|
+
height: number;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
export interface PageModel {
|
|
136
|
+
/** Frame size (px). Default 390×600 (mobile). */
|
|
137
|
+
width?: number;
|
|
138
|
+
height?: number;
|
|
139
|
+
/** Immutable manifest-authored viewport used by the reset action and responsive preview source. */
|
|
140
|
+
authoredFrameSize?: {
|
|
141
|
+
width: number;
|
|
142
|
+
height: number;
|
|
143
|
+
frameSizeMode?: DesignFrameSizeMode;
|
|
144
|
+
heightMode?: DesignFrameHeightMode;
|
|
145
|
+
maxHeight?: number;
|
|
146
|
+
};
|
|
147
|
+
/** Generated catalog pages may replace their measurement seed with actual rendered DOM bounds. */
|
|
148
|
+
frameSizeMode?: DesignFrameSizeMode;
|
|
149
|
+
/** Transient guard that prevents content measurement from overwriting a manual frame layout. */
|
|
150
|
+
contentAutoLayout?: boolean;
|
|
151
|
+
/** Manifest-owned frame sizing policy. Runtime document measurements never replace the configured viewport height. */
|
|
152
|
+
heightMode?: DesignFrameHeightMode;
|
|
153
|
+
maxHeight?: number;
|
|
154
|
+
/** Transient rendered document height shared by live, frozen, and detailed preview states. */
|
|
155
|
+
resolvedDocumentHeight?: number;
|
|
156
|
+
/** Canvas deformation and appearance of the frame itself. */
|
|
157
|
+
rotation?: number;
|
|
158
|
+
flipX?: boolean;
|
|
159
|
+
flipY?: boolean;
|
|
160
|
+
clipContent?: boolean;
|
|
161
|
+
fill?: string;
|
|
162
|
+
opacity?: number;
|
|
163
|
+
radius?: number;
|
|
164
|
+
/** Screen path to use when publishing. route is for actual app reference, and path is the output path of the creation screen. */
|
|
165
|
+
path?: string;
|
|
166
|
+
/** If false, it is excluded from reflection/publishing output. */
|
|
167
|
+
publish?: boolean;
|
|
168
|
+
/** Owning canvas. Switching canvases replaces the visible frame set. */
|
|
169
|
+
canvas?: string;
|
|
170
|
+
/** Page list section headers (line breaks within the canvas — "Design System"/"Screen", etc.). */
|
|
171
|
+
section?: string;
|
|
172
|
+
/** Actual app routes running (iframe referencing page — not editable, actual routing in preview). */
|
|
173
|
+
route?: string;
|
|
174
|
+
/** Whether the design importer replaces the first actual DOM render with the entire layer tree and the processing status. */
|
|
175
|
+
importLayers?: boolean;
|
|
176
|
+
layersImported?: boolean;
|
|
177
|
+
importPageId?: string;
|
|
178
|
+
importKind?: string;
|
|
179
|
+
/** Link to actual assets/source files in your code inventory. It is passed as is to the auto-save payload. */
|
|
180
|
+
assetIds?: string[];
|
|
181
|
+
sourcePaths?: string[];
|
|
182
|
+
/** User flow-based screen capture metadata. */
|
|
183
|
+
flow?: string;
|
|
184
|
+
scenario?: string;
|
|
185
|
+
state?: string;
|
|
186
|
+
/** Host-declared kind of the state branch (overlay, badge, layout, ...). Drives the Screen states control's presentation only. */
|
|
187
|
+
stateKind?: string;
|
|
188
|
+
/** Host-declared situation group the frame is arranged into (see frameLanes). */
|
|
189
|
+
lane?: string;
|
|
190
|
+
scenarioId?: string;
|
|
191
|
+
/** Every scenario the screen demonstrates; coverage counts this set. */
|
|
192
|
+
scenarioIds?: readonly string[];
|
|
193
|
+
interactions?: DesignScreenInteraction[];
|
|
194
|
+
/** Captured recipe, kept while a declared interactive state extends it. */
|
|
195
|
+
baseInteractions?: DesignScreenInteraction[];
|
|
196
|
+
/** Declared interactive axis the frame is currently held in, if any. */
|
|
197
|
+
interactiveStateId?: string;
|
|
198
|
+
interactiveOptionId?: string;
|
|
199
|
+
/**
|
|
200
|
+
* The case's own environment, kept so clearing an interactive option can put
|
|
201
|
+
* `environment` back without reconstructing what the case declared. Same shape
|
|
202
|
+
* as authoredFrameSize: the live field is what everything reads, the authored
|
|
203
|
+
* one is what restores it.
|
|
204
|
+
*
|
|
205
|
+
* A selected option's boot condition is merged INTO `environment` rather than
|
|
206
|
+
* held beside it, because every consumer already reads that field — the boot
|
|
207
|
+
* URL, the flow-session environment, the artifact fingerprint, the cache key.
|
|
208
|
+
* Holding it apart would mean finding and updating each of them, and missing
|
|
209
|
+
* one is silent: the frame re-keys and re-supplies, but boots without the
|
|
210
|
+
* condition, so the axis looks dead for a reason nothing reports.
|
|
211
|
+
*/
|
|
212
|
+
authoredEnvironment?: StoryboardEnvironment;
|
|
213
|
+
environment?: StoryboardEnvironment;
|
|
214
|
+
preset?: DesignScreenPreset;
|
|
215
|
+
assertions?: DesignScreenAssertion[];
|
|
216
|
+
/** Host-declared warm instance group. Set when the screen state is declared, not replayed. */
|
|
217
|
+
session?: string;
|
|
218
|
+
layerImportCount?: number;
|
|
219
|
+
layerImportTruncated?: boolean;
|
|
220
|
+
layerImportDiagnostics?: readonly DomImportDiagnostic[];
|
|
221
|
+
layerImportError?: string;
|
|
222
|
+
/** Page edit revision recorded when the layers were imported. */
|
|
223
|
+
layerImportRevision?: number;
|
|
224
|
+
/** Frame width the layers were imported at — their geometry is only valid there. */
|
|
225
|
+
layerImportViewportWidth?: number;
|
|
226
|
+
/** Infinite canvas coordinates (multi-frame placement). */
|
|
227
|
+
x?: number;
|
|
228
|
+
y?: number;
|
|
229
|
+
id: string;
|
|
230
|
+
name: string;
|
|
231
|
+
root: NodeModel;
|
|
232
|
+
}
|
|
233
|
+
export interface FrameResizeOptions {
|
|
234
|
+
/** Records a history checkpoint before applying the resize. */
|
|
235
|
+
recordHistory?: boolean;
|
|
236
|
+
/** Applies the horizontal viewport change. */
|
|
237
|
+
resizeWidth?: boolean;
|
|
238
|
+
/** Applies the vertical viewport change and converts document-height frames to a fixed viewport. */
|
|
239
|
+
resizeHeight?: boolean;
|
|
240
|
+
}
|
|
241
|
+
/** A first-class organizational section that can exist without a frame. */
|
|
242
|
+
export interface SectionRect {
|
|
243
|
+
canvas: string;
|
|
244
|
+
name: string;
|
|
245
|
+
x: number;
|
|
246
|
+
y: number;
|
|
247
|
+
width: number;
|
|
248
|
+
height: number;
|
|
249
|
+
}
|
|
250
|
+
interface CanvasFrameLayout {
|
|
251
|
+
key: string;
|
|
252
|
+
x: number;
|
|
253
|
+
y: number;
|
|
254
|
+
width: number;
|
|
255
|
+
height: number;
|
|
256
|
+
section?: string;
|
|
257
|
+
/**
|
|
258
|
+
* Content-fit frames stay in deterministic catalog layout until a user
|
|
259
|
+
* explicitly moves them. Optional for backward compatibility with snapshots
|
|
260
|
+
* written before this state was persisted.
|
|
261
|
+
*/
|
|
262
|
+
contentAutoLayout?: boolean;
|
|
263
|
+
}
|
|
264
|
+
interface CanvasLayoutSnapshotV5 {
|
|
265
|
+
version: 5;
|
|
266
|
+
scope: string;
|
|
267
|
+
frames: CanvasFrameLayout[];
|
|
268
|
+
sections: SectionRect[];
|
|
269
|
+
}
|
|
270
|
+
export declare const CANVAS_LAYOUT_VERSION = 5;
|
|
271
|
+
export declare function isCanvasLayoutSnapshot(value: unknown, scope: string): value is CanvasLayoutSnapshotV5;
|
|
272
|
+
export type CanvasObjectSelection = {
|
|
273
|
+
kind: 'frame';
|
|
274
|
+
id: string;
|
|
275
|
+
} | {
|
|
276
|
+
kind: 'section';
|
|
277
|
+
name: string;
|
|
278
|
+
} | null;
|
|
279
|
+
export declare class EditorStore {
|
|
280
|
+
/** Multi-page — each page has an independent tree. */
|
|
281
|
+
pages: PageModel[];
|
|
282
|
+
activePageId: string;
|
|
283
|
+
/** Multiple selection — Last element is primary (targeted in the Properties panel). */
|
|
284
|
+
selectedIds: string[];
|
|
285
|
+
/** Frames and sections are selected as canvas objects separate from internal nodes. */
|
|
286
|
+
selectedCanvasObject: CanvasObjectSelection;
|
|
287
|
+
hoveredId: string | null;
|
|
288
|
+
showRenderCount: boolean;
|
|
289
|
+
/** Canvas zoom from 0.25 to 3, controlled by Command/Ctrl-scroll or keyboard shortcuts. */
|
|
290
|
+
zoom: number;
|
|
291
|
+
/** Infinite canvas pan (viewport px, no limit — negative numbers allowed). The initial value is an offset that avoids the left panel. */
|
|
292
|
+
panX: number;
|
|
293
|
+
panY: number;
|
|
294
|
+
/** Active canvas. Each canvas preserves its pan and zoom in canvasViews. */
|
|
295
|
+
activeCanvas: string;
|
|
296
|
+
private canvasViews;
|
|
297
|
+
/**
|
|
298
|
+
* Canvas names in the order a designer navigates them.
|
|
299
|
+
*
|
|
300
|
+
* Appearance order alone made this list inherit however the host happened to
|
|
301
|
+
* order its case array, so one misplaced case reordered the whole panel. A
|
|
302
|
+
* declared section carries the order its author intended, so canvases are
|
|
303
|
+
* ordered by that — within each import kind, since the kinds themselves keep
|
|
304
|
+
* the order they appear in. That is what holds the catalog canvases where
|
|
305
|
+
* they sit relative to the screens while the screens sort themselves.
|
|
306
|
+
*
|
|
307
|
+
* A canvas whose sections are undeclared keeps its appearance position, so a
|
|
308
|
+
* host that declares no section headers sees no change.
|
|
309
|
+
*/
|
|
310
|
+
get canvasNames(): string[];
|
|
311
|
+
/** Frames belonging to the active canvas. */
|
|
312
|
+
get canvasPages(): PageModel[];
|
|
313
|
+
/** canvas + scenario -> the group member currently holding the canvas slot. */
|
|
314
|
+
private screenStateSelections;
|
|
315
|
+
private screenStateSlotKey;
|
|
316
|
+
/**
|
|
317
|
+
* Declared state variants sharing a scenario on one canvas, in declaration
|
|
318
|
+
* order. Folding never crosses canvases: a scenario that also names a
|
|
319
|
+
* screen on another canvas (a flow's entry point, say) keeps that screen
|
|
320
|
+
* as a normal frame there — otherwise a canvas could fold down to nothing.
|
|
321
|
+
*/
|
|
322
|
+
screenStateGroup(scenario: string, canvas: string): PageModel[];
|
|
323
|
+
/** The group member holding the group's canvas slot, or null for non-groups. */
|
|
324
|
+
shownScreenStateId(scenario: string, canvas: string): string | null;
|
|
325
|
+
/** False only for state variants folded into the Screen states control. */
|
|
326
|
+
isScreenStateShown(page: PageModel): boolean;
|
|
327
|
+
/** Swaps a folded variant into its group's canvas slot; the camera stays. */
|
|
328
|
+
private revealScreenState;
|
|
329
|
+
/** Switch canvases, restore their view, and activate the first frame. */
|
|
330
|
+
switchCanvas(name: string): void;
|
|
331
|
+
setPan(x: number, y: number): void;
|
|
332
|
+
setCameraView(view: {
|
|
333
|
+
panX: number;
|
|
334
|
+
panY: number;
|
|
335
|
+
zoom: number;
|
|
336
|
+
}): void;
|
|
337
|
+
/**
|
|
338
|
+
* Selects a frame and commits its camera destination in one observable action.
|
|
339
|
+
* Observers never render the newly active frame at the previous camera view.
|
|
340
|
+
*/
|
|
341
|
+
focusFrame(id: string, view: {
|
|
342
|
+
panX: number;
|
|
343
|
+
panY: number;
|
|
344
|
+
zoom: number;
|
|
345
|
+
}): boolean;
|
|
346
|
+
panBy(dx: number, dy: number): void;
|
|
347
|
+
/** Cursor anchor zoom — Pan correction to anchor the world point below local (container coordinates). */
|
|
348
|
+
zoomAt(localX: number, localY: number, factor: number): void;
|
|
349
|
+
/** Shows the docked source code drawer. */
|
|
350
|
+
codeOpen: boolean;
|
|
351
|
+
/** Collapsed node id in the layer tree. */
|
|
352
|
+
collapsed: Set<string>;
|
|
353
|
+
/** The node id being dragged (displayed semi-transparently on the canvas). */
|
|
354
|
+
dragNodeId: string | null;
|
|
355
|
+
/** Preview drop location while dragging. */
|
|
356
|
+
dropHint: DropHint | null;
|
|
357
|
+
/** Right-click context menu location (viewport). */
|
|
358
|
+
ctxMenu: {
|
|
359
|
+
x: number;
|
|
360
|
+
y: number;
|
|
361
|
+
} | null;
|
|
362
|
+
/** Layer tree inline rename target (⌘R·double-click). */
|
|
363
|
+
renamingId: string | null;
|
|
364
|
+
/** Canvas inline text editing target (double click, Enter). */
|
|
365
|
+
editingTextId: string | null;
|
|
366
|
+
/** Internal clipboard (⌘C/X/V — OS clipboard integration is on the roadmap). */
|
|
367
|
+
private clipboardJSON;
|
|
368
|
+
private undoStack;
|
|
369
|
+
private redoStack;
|
|
370
|
+
private lastCheckpointTag;
|
|
371
|
+
private lastCheckpointTime;
|
|
372
|
+
/** Final shared style patch that will also be applied to the same source frame that has not yet been rendered/fetched. */
|
|
373
|
+
private sharedSourceOverrides;
|
|
374
|
+
/** Child structures of the same source container. It is applied immediately after import to frames that have not yet been captured. */
|
|
375
|
+
private sharedSourceStructureOverrides;
|
|
376
|
+
/** Common CSS to be immediately injected into route snapshots that have not yet created a detailed layer. */
|
|
377
|
+
private sharedFrozenCssRules;
|
|
378
|
+
/** A script-free DOM patch with text and display states that cannot be expressed in CSS. */
|
|
379
|
+
private sharedFrozenDomMutations;
|
|
380
|
+
/** sourceSha + Canvas layout repository with fixed scope as a page catalog. */
|
|
381
|
+
private canvasLayoutScope;
|
|
382
|
+
private canvasLayoutStorageKey;
|
|
383
|
+
private canvasLayoutDisposer;
|
|
384
|
+
/** Explicit edit scope by sourceKey. Unspecified is shared like the existing operation. */
|
|
385
|
+
private sharedSourceEditScopes;
|
|
386
|
+
/** The final change that can be safely reflected to the original source during a regular canvas NodeModel patch. */
|
|
387
|
+
private sourcePatchJournal;
|
|
388
|
+
/** Asset-list edit intent waiting for the catalog page's DOM layer import. */
|
|
389
|
+
private pendingDesignAssetEdit;
|
|
390
|
+
/** Page DOM as of last load/reflection. Asynchronous screens register upon completion of each capture. */
|
|
391
|
+
private pageRootBaselines;
|
|
392
|
+
/** Monotonic per-page edit revision derived from the checkpoint funnel every mutation passes through. */
|
|
393
|
+
private pageEditRevisions;
|
|
394
|
+
/** pageId → edit revision at the moment a frozen preview was promoted without a boot (D2). */
|
|
395
|
+
private provisionalLayerImports;
|
|
396
|
+
private contentLayoutScheduled;
|
|
397
|
+
private contentLayoutCanvases;
|
|
398
|
+
constructor();
|
|
399
|
+
get activePage(): PageModel;
|
|
400
|
+
get selectedFrame(): PageModel | null;
|
|
401
|
+
get selectedSection(): SectionRect | null;
|
|
402
|
+
get canUndo(): boolean;
|
|
403
|
+
get canRedo(): boolean;
|
|
404
|
+
get canAddFrame(): boolean;
|
|
405
|
+
designAssetPage(kind: DesignImportKind, asset: DesignImportAsset): PageModel | null;
|
|
406
|
+
/** Open an inventory asset as an editable implementation layer. */
|
|
407
|
+
beginDesignAssetEdit(kind: DesignImportKind, asset: DesignImportAsset): PageModel | null;
|
|
408
|
+
private resolvePendingDesignAssetEdit;
|
|
409
|
+
sharedSourceImpactFor(node: NodeModel): SharedSourceImpact;
|
|
410
|
+
/**
|
|
411
|
+
* Common source CSS to put into script-free DOM previews on inactive screens.
|
|
412
|
+
* Component-level changes are immediately visible even without mounting the entire React layer tree.
|
|
413
|
+
*/
|
|
414
|
+
frozenPreviewOverrideCss(_page: PageModel): string;
|
|
415
|
+
frozenPreviewCssRules(): FrozenPreviewCssRule[];
|
|
416
|
+
frozenPreviewMutations(): FrozenPreviewMutation[];
|
|
417
|
+
/** Only frames with common props/structure that cannot be expressed as a snapshot patch are promoted to a live model. */
|
|
418
|
+
pageRequiresLiveSharedPreview(page: PageModel): boolean;
|
|
419
|
+
sharedSourceEditScopeFor(node: NodeModel): SharedSourceEditScope;
|
|
420
|
+
/** source-backed revision + InspectApplyPayload compatible final state of generic canvas changes. */
|
|
421
|
+
getPendingSourceChanges(): SourceJournalSnapshot;
|
|
422
|
+
/** During asynchronous apply, the revision is acked only when there is no new patch/undo. */
|
|
423
|
+
ackPendingSourceChanges(expectedRevision: number): boolean;
|
|
424
|
+
/**
|
|
425
|
+
* Unreflected style and text edits are discarded based on the last load/reflection criteria.
|
|
426
|
+
* Pan/zoom and frame placement are maintained as they are in the workspace state.
|
|
427
|
+
*/
|
|
428
|
+
resetCurrentEdits(): boolean;
|
|
429
|
+
private sourceEditScopeForNode;
|
|
430
|
+
setSharedSourceEditScope(node: NodeModel, scope: SharedSourceEditScope): void;
|
|
431
|
+
private pagesInitialized;
|
|
432
|
+
/**
|
|
433
|
+
* Host injects “real screen components” into editor pages — 1 component node per page (root fill).
|
|
434
|
+
* StrictMode applies only once even to dual mounts (idempotent).
|
|
435
|
+
*/
|
|
436
|
+
initPagesFromComponents(defs: {
|
|
437
|
+
name: string;
|
|
438
|
+
componentName?: string;
|
|
439
|
+
/** Registry Name List — Created as a vertical gallery page (listing component nodes). */
|
|
440
|
+
gallery?: string[];
|
|
441
|
+
canvas?: string;
|
|
442
|
+
section?: string;
|
|
443
|
+
route?: string;
|
|
444
|
+
width?: number;
|
|
445
|
+
height?: number;
|
|
446
|
+
frameSizeMode?: DesignFrameSizeMode;
|
|
447
|
+
heightMode?: DesignFrameHeightMode;
|
|
448
|
+
maxHeight?: number;
|
|
449
|
+
path?: string;
|
|
450
|
+
publish?: boolean;
|
|
451
|
+
importLayers?: boolean;
|
|
452
|
+
importPageId?: string;
|
|
453
|
+
importKind?: string;
|
|
454
|
+
assetIds?: string[];
|
|
455
|
+
sourcePaths?: string[];
|
|
456
|
+
flow?: string;
|
|
457
|
+
scenario?: string;
|
|
458
|
+
state?: string;
|
|
459
|
+
stateKind?: string;
|
|
460
|
+
lane?: string;
|
|
461
|
+
scenarioId?: string;
|
|
462
|
+
scenarioIds?: readonly string[];
|
|
463
|
+
interactions?: DesignScreenInteraction[];
|
|
464
|
+
environment?: StoryboardEnvironment;
|
|
465
|
+
preset?: DesignScreenPreset;
|
|
466
|
+
assertions?: DesignScreenAssertion[];
|
|
467
|
+
session?: string;
|
|
468
|
+
}[], options?: {
|
|
469
|
+
initialCanvas?: string;
|
|
470
|
+
}): void;
|
|
471
|
+
/** Tree root of the active page — getter(computed) for compatibility with existing code. */
|
|
472
|
+
get root(): NodeModel;
|
|
473
|
+
addPage(): boolean;
|
|
474
|
+
switchPage(id: string, opts?: {
|
|
475
|
+
fromHistory?: boolean;
|
|
476
|
+
}): void;
|
|
477
|
+
renamePage(id: string, name: string): void;
|
|
478
|
+
patchPage(id: string, partial: Partial<Pick<PageModel, 'name' | 'path' | 'publish' | 'x' | 'y' | 'width' | 'height' | 'rotation' | 'flipX' | 'flipY' | 'clipContent' | 'fill' | 'opacity' | 'radius'>>): void;
|
|
479
|
+
setPagePath(id: string, rawPath: string): void;
|
|
480
|
+
/** Change section name — applies to section rectangles and member frames on the same canvas. It is only a classification for canvas organization and has no effect on code calculation. */
|
|
481
|
+
renameSection(canvas: string | undefined, oldName: string, newName: string): void;
|
|
482
|
+
/** Section title drag — Absolute movement of the member frame/section rectangle based on the drag start coordinate (no cumulative error). */
|
|
483
|
+
moveSectionTo(name: string, base: {
|
|
484
|
+
frames: {
|
|
485
|
+
id: string;
|
|
486
|
+
x: number;
|
|
487
|
+
y: number;
|
|
488
|
+
}[];
|
|
489
|
+
rect: {
|
|
490
|
+
x: number;
|
|
491
|
+
y: number;
|
|
492
|
+
} | null;
|
|
493
|
+
}, dx: number, dy: number, recordHistory?: boolean): void;
|
|
494
|
+
/** Relocate a frame to another section — when dropped into a section pane box on the canvas. */
|
|
495
|
+
setPageSection(id: string, section: string): void;
|
|
496
|
+
/** Canvas coordinates for a newly inserted frame within its ordered story section. */
|
|
497
|
+
private nextFramePos;
|
|
498
|
+
/**
|
|
499
|
+
* Records asynchronous document measurements without changing canvas camera state
|
|
500
|
+
* or the configured capture viewport used by route cache identity.
|
|
501
|
+
*/
|
|
502
|
+
setPageDocumentHeight(id: string, measuredHeight: number): boolean;
|
|
503
|
+
resetPageDocumentHeight(id: string): boolean;
|
|
504
|
+
/**
|
|
505
|
+
* Automatically places authored frames by canvas and story section. Section
|
|
506
|
+
* order and frame order remain manifest-owned; only wrapping is adaptive.
|
|
507
|
+
*/
|
|
508
|
+
private layoutFrames;
|
|
509
|
+
private scheduleContentFrameLayout;
|
|
510
|
+
private flushContentFrameLayout;
|
|
511
|
+
/**
|
|
512
|
+
* Replaces a generated catalog page's 1×1 measurement seed with its actual
|
|
513
|
+
* rendered DOM bounds. The update is transient and never changes camera state.
|
|
514
|
+
*/
|
|
515
|
+
setPageContentBounds(id: string, bounds: {
|
|
516
|
+
width: number;
|
|
517
|
+
height: number;
|
|
518
|
+
}): boolean;
|
|
519
|
+
private canvasLayoutSnapshot;
|
|
520
|
+
private restoreCanvasLayout;
|
|
521
|
+
/**
|
|
522
|
+
* Canvas geometry is owned by Pygmalion, separate from the code documentation.
|
|
523
|
+
* Embeds without source revision do not enable persistence because projects cannot be safely distinguished.
|
|
524
|
+
*/
|
|
525
|
+
private startCanvasLayoutPersistence;
|
|
526
|
+
/** Called once when a direct-manipulation gesture starts. Subsequent pointer updates skip history. */
|
|
527
|
+
beginFrameTransform(id: string, kind: 'move' | 'resize'): boolean;
|
|
528
|
+
moveFrame(id: string, x: number, y: number, recordHistory?: boolean): void;
|
|
529
|
+
resizeFrame(id: string, rect: {
|
|
530
|
+
x: number;
|
|
531
|
+
y: number;
|
|
532
|
+
width: number;
|
|
533
|
+
height: number;
|
|
534
|
+
}, options?: FrameResizeOptions): void;
|
|
535
|
+
/** True when the imported tree carries no user edits since its import. */
|
|
536
|
+
private layersUneditedSinceImport;
|
|
537
|
+
/**
|
|
538
|
+
* Imported layer geometry is only valid at the width it was captured at.
|
|
539
|
+
* A committed width change on an unedited tree schedules a provisional
|
|
540
|
+
* re-import: the live pipeline boots at the new width and swaps its
|
|
541
|
+
* capture in, while the frozen replay covers the wait. An edited tree is
|
|
542
|
+
* never volunteered for replacement — edits win, as everywhere else.
|
|
543
|
+
* `uneditedSinceImport` is judged by the caller before its checkpoint
|
|
544
|
+
* bumps the edit revision.
|
|
545
|
+
*/
|
|
546
|
+
private scheduleLayerReimportForWidthChange;
|
|
547
|
+
frameSizeDiffersFromAuthored(id: string): boolean;
|
|
548
|
+
/**
|
|
549
|
+
* Restores only the viewport contract supplied by the host manifest.
|
|
550
|
+
* Canvas position and camera state intentionally remain untouched.
|
|
551
|
+
*/
|
|
552
|
+
resetFrameSize(id: string): boolean;
|
|
553
|
+
/** Called once when the pointer gesture starts — Afterwards, the move is updated with recordHistory=false. */
|
|
554
|
+
beginSectionTransform(name: string, kind: 'move' | 'resize'): boolean;
|
|
555
|
+
resizeSection(name: string, rect: {
|
|
556
|
+
x: number;
|
|
557
|
+
y: number;
|
|
558
|
+
width: number;
|
|
559
|
+
height: number;
|
|
560
|
+
}, recordHistory?: boolean): void;
|
|
561
|
+
removeFrame(id: string): boolean;
|
|
562
|
+
removeSection(name: string): void;
|
|
563
|
+
/** DOM snapshot of the route page into the page for editing — "Import as Layer". */
|
|
564
|
+
importDomAsPage(rootJson: NodeJSON, opts: {
|
|
565
|
+
name: string;
|
|
566
|
+
section?: string;
|
|
567
|
+
width?: number;
|
|
568
|
+
height?: number;
|
|
569
|
+
}): void;
|
|
570
|
+
/**
|
|
571
|
+
* D2 bootless edit promotion: when the page being activated still needs its
|
|
572
|
+
* layer import and a stamped, non-stale frozen preview is mounted for it,
|
|
573
|
+
* that preview is imported synchronously — no boot, no scheduling.
|
|
574
|
+
*
|
|
575
|
+
* The promotion is final. A mounted non-stale preview replays an
|
|
576
|
+
* assertion-verified capture of the same source revision, so a background
|
|
577
|
+
* live boot could only re-measure identical content — and it measures
|
|
578
|
+
* worse: a live app is mid-animation, so stacked title variants import as
|
|
579
|
+
* overlapping text, and its capture then replaced this verified tree.
|
|
580
|
+
* Stale or unstamped previews never reach this path and keep the boot
|
|
581
|
+
* pipeline; committed size changes schedule their own provisional
|
|
582
|
+
* re-import (resizeFrame/resetFrameSize).
|
|
583
|
+
*/
|
|
584
|
+
private promoteFrozenLayerImport;
|
|
585
|
+
/**
|
|
586
|
+
* Applies a screen dimension value: adopts the matched raw captured node
|
|
587
|
+
* into the declared adapter instance (an undoable tree edit that keeps the
|
|
588
|
+
* captured layout box), or re-props an already adopted instance. Returns
|
|
589
|
+
* false when the page has no matching node.
|
|
590
|
+
*/
|
|
591
|
+
/**
|
|
592
|
+
* Puts one captured piece into a declared state.
|
|
593
|
+
*
|
|
594
|
+
* `nodeId` targets a specific match, which is what a list needs: five
|
|
595
|
+
* repeated rows each own their badge, and without it every control on the
|
|
596
|
+
* panel would fight over the first one.
|
|
597
|
+
*/
|
|
598
|
+
applyScreenDimension(pageId: string, dimension: ScreenDimensionDef, value: string, nodeId?: string): boolean;
|
|
599
|
+
/**
|
|
600
|
+
* Sets how many rows a declared list shows.
|
|
601
|
+
*
|
|
602
|
+
* Growth clones the last row — identical on purpose, because the core has
|
|
603
|
+
* no idea what a second row would say, and the per-row dimension
|
|
604
|
+
* controls are how a designer makes them differ. Shrinking drops trailing
|
|
605
|
+
* rows. One checkpoint covers the whole change, so it is a single undo,
|
|
606
|
+
* and because this only edits the captured tree the frame never waits on
|
|
607
|
+
* a walk.
|
|
608
|
+
*/
|
|
609
|
+
applyScreenListLength(pageId: string, def: ScreenListDef, count: number): boolean;
|
|
610
|
+
/**
|
|
611
|
+
* Adds or removes one badge in one slot of one card.
|
|
612
|
+
*
|
|
613
|
+
* Adding clones a captured instance from another card when the screen has
|
|
614
|
+
* one, so the result is the product's own markup; only a badge nothing on
|
|
615
|
+
* screen shows is built from the declared adapter. The badge lands where
|
|
616
|
+
* the component would put it (the anchor), and a slot the product renders
|
|
617
|
+
* conditionally is created from a donor and removed again when it empties.
|
|
618
|
+
*/
|
|
619
|
+
applyCardBadge(pageId: string, def: ScreenCardDef, cardNodeId: string, slot: CardSlotDef, option: CardBadgeOption, present: boolean): boolean;
|
|
620
|
+
/**
|
|
621
|
+
* Puts a frame into a declared interactive state by extending its recipe.
|
|
622
|
+
*
|
|
623
|
+
* The steps become part of `page.interactions`, which is what the preview
|
|
624
|
+
* cache key, the live replay and the session walk all read — so the frame
|
|
625
|
+
* asks for the variant through the ordinary supply instead of a parallel
|
|
626
|
+
* path. Returning to the base option restores the captured recipe.
|
|
627
|
+
*/
|
|
628
|
+
applyInteractiveState(pageId: string, def: InteractiveStateDef, optionId: string): boolean;
|
|
629
|
+
/** Pages whose mounted frozen preview was refused at the import boundary. */
|
|
630
|
+
private frozenPromotionRefusals;
|
|
631
|
+
/** True when the page's frozen capture was refused and activation should boot live instead. */
|
|
632
|
+
frozenPromotionRefused(pageId: string): boolean;
|
|
633
|
+
/**
|
|
634
|
+
* Retries the bootless promotion for the active page once its frozen
|
|
635
|
+
* preview finishes mounting. An activation click without a hover dwell has
|
|
636
|
+
* no mounted preview to import from at switchPage time; the activated frame
|
|
637
|
+
* then renders its stamped frozen preview instead of booting live, and the
|
|
638
|
+
* mount registration calls back here — so every activation of a frame with
|
|
639
|
+
* a fresh stamped capture promotes within the mount, not a boot.
|
|
640
|
+
*/
|
|
641
|
+
promoteFrozenLayerImportIfPending(pageId: string): void;
|
|
642
|
+
/** Monotonic revision of the page's content — bumps on every checkpointed mutation, restore, and DOM import. */
|
|
643
|
+
pageEditRevision(pageId: string): number;
|
|
644
|
+
private bumpPageEditRevision;
|
|
645
|
+
/** Edit revision recorded when the page was provisionally imported from a frozen preview, or null. */
|
|
646
|
+
provisionalLayerImportRevision(pageId: string): number | null;
|
|
647
|
+
/** Keeps the current (user-edited) tree and stops further live re-import attempts for the page. */
|
|
648
|
+
discardProvisionalLayerImport(pageId: string): void;
|
|
649
|
+
/** Design importer automatically inserts the capture results into the existing frame. The route is maintained for live preview. */
|
|
650
|
+
replacePageRootFromDom(pageId: string, rootJson: NodeJSON, result?: Pick<DomImportResult, 'count' | 'truncated'> & Partial<Pick<DomImportResult, 'diagnostics' | 'metrics'>>): void;
|
|
651
|
+
setPageLayerImportError(pageId: string, message: string): void;
|
|
652
|
+
/** Switch pages by name — Path used by the host fixture's actual button handler (pygmalionNavigate). */
|
|
653
|
+
navigateToPageByName(name: string): void;
|
|
654
|
+
/** Show preview overlay — page navigation with Scyllender, linkTo/host navigation without editor chrome. */
|
|
655
|
+
previewOpen: boolean;
|
|
656
|
+
/** Preview navigation history (back) — Stack of page ids. */
|
|
657
|
+
previewHistory: string[];
|
|
658
|
+
/** Edit Mode (top right toggle) — If false, block manipulation of canvas (view only). */
|
|
659
|
+
editMode: boolean;
|
|
660
|
+
/** Shows the Reflect (Change Summary) panel. */
|
|
661
|
+
applyOpen: boolean;
|
|
662
|
+
private editModeInitialized;
|
|
663
|
+
/**
|
|
664
|
+
* Applies the host's declared starting mode, once.
|
|
665
|
+
*
|
|
666
|
+
* Initial rather than controlled: the mode is a toggle the designer owns, and
|
|
667
|
+
* a prop that re-asserted itself on every render would snap them back out of
|
|
668
|
+
* whichever mode they chose. Once means once for the life of the store, so a
|
|
669
|
+
* canvas switch or a re-render does not reset it either. Nothing is persisted
|
|
670
|
+
* — a reload returns to the declared mode, which is a place a designer can
|
|
671
|
+
* find, unlike a remembered state with no visible home.
|
|
672
|
+
*/
|
|
673
|
+
initEditMode(editMode: boolean): void;
|
|
674
|
+
toggleEditMode(): void;
|
|
675
|
+
setApplyOpen(v: boolean): void;
|
|
676
|
+
tool: 'select' | 'hand' | 'zoom' | 'section';
|
|
677
|
+
/** A section is a first-class object. Its display bounds include its rectangle and member frames. */
|
|
678
|
+
sections: SectionRect[];
|
|
679
|
+
/** Section name whose name is entered immediately after creation/double-clicking — SectionBoxes are rendered as input. */
|
|
680
|
+
sectionRenameTarget: string | null;
|
|
681
|
+
setTool(tool: 'select' | 'hand' | 'zoom' | 'section'): void;
|
|
682
|
+
setSectionRenameTarget(name: string | null): void;
|
|
683
|
+
/**
|
|
684
|
+
* Completing a section drag creates the rectangle immediately and includes intersecting frames.
|
|
685
|
+
* Immediately after creation, the state switches to name input, and the tool returns to select.
|
|
686
|
+
*/
|
|
687
|
+
createSectionFromRect(x0: number, y0: number, x1: number, y1: number): void;
|
|
688
|
+
/**
|
|
689
|
+
* Enters the app screen for one frame, whichever frame is asked for.
|
|
690
|
+
*
|
|
691
|
+
* ▶ plays from the *current* frame, which is right for a toolbar button but
|
|
692
|
+
* makes "see this one for real" a two-step gesture: select the frame, then
|
|
693
|
+
* find the button. Double-clicking the frame's own label is the direct form of
|
|
694
|
+
* the same intent, so it names the frame instead of relying on selection.
|
|
695
|
+
*/
|
|
696
|
+
openFramePreview(pageId: string): void;
|
|
697
|
+
openPreview(options?: {
|
|
698
|
+
notifyHost?: boolean;
|
|
699
|
+
}): void;
|
|
700
|
+
closePreview(options?: {
|
|
701
|
+
notifyHost?: boolean;
|
|
702
|
+
}): void;
|
|
703
|
+
previewBack(): void;
|
|
704
|
+
get selectedId(): string | null;
|
|
705
|
+
get selected(): NodeModel | null;
|
|
706
|
+
/** Select nodes — tree DFS order (preserve visual order when grouping/copying). */
|
|
707
|
+
get selectedNodes(): NodeModel[];
|
|
708
|
+
isSelected(id: string): boolean;
|
|
709
|
+
select(id: string | null): void;
|
|
710
|
+
setSelection(ids: string[]): void;
|
|
711
|
+
selectFrame(id: string): void;
|
|
712
|
+
/**
|
|
713
|
+
* An implicit section with only page.section promotes the currently displayed bbox to a first-class SectionRect at the moment of selection.
|
|
714
|
+
* Since this is a normalization step where the visible geometry does not change, no undo items are created, and only the actual move/resize is recorded thereafter.
|
|
715
|
+
*/
|
|
716
|
+
selectSection(name: string, implicitRect?: {
|
|
717
|
+
x: number;
|
|
718
|
+
y: number;
|
|
719
|
+
width: number;
|
|
720
|
+
height: number;
|
|
721
|
+
}): void;
|
|
722
|
+
toggleInSelection(id: string): void;
|
|
723
|
+
hover(id: string | null): void;
|
|
724
|
+
/** "Only the top" during selection — exclude nodes whose ancestors are also selected (group/copy/delete target calculations). */
|
|
725
|
+
private topLevelSelected;
|
|
726
|
+
toggleRenderCount(): void;
|
|
727
|
+
setZoom(z: number): void;
|
|
728
|
+
toggleCode(): void;
|
|
729
|
+
toggleCollapsed(id: string): void;
|
|
730
|
+
setDrag(id: string | null): void;
|
|
731
|
+
setDropHint(hint: DropHint | null): void;
|
|
732
|
+
openCtxMenu(x: number, y: number): void;
|
|
733
|
+
closeCtxMenu(): void;
|
|
734
|
+
requestRename(): void;
|
|
735
|
+
setRenaming(id: string | null): void;
|
|
736
|
+
startTextEdit(id: string): void;
|
|
737
|
+
stopTextEdit(): void;
|
|
738
|
+
private currentSnapshot;
|
|
739
|
+
/** Called just before mutation. Consecutive changes (resizing, dragging, typing) within 600ms of the same tag are grouped into one entry. */
|
|
740
|
+
checkpoint(tag: string, force?: boolean): void;
|
|
741
|
+
undo(): void;
|
|
742
|
+
redo(): void;
|
|
743
|
+
private restore;
|
|
744
|
+
/**
|
|
745
|
+
* The DOM import node preserves and renders the computed style. Only semantic fields in the properties panel
|
|
746
|
+
* If you change it, it may be hidden by the computed style, so the actual DOM style in the same patch is also
|
|
747
|
+
* Update. This is a key path that ensures that the active/inactive renderer only reads the same model.
|
|
748
|
+
*/
|
|
749
|
+
private withImportedDomStyle;
|
|
750
|
+
private escapeFrozenSelectorValue;
|
|
751
|
+
private frozenStyleSelector;
|
|
752
|
+
private frozenSemanticSelector;
|
|
753
|
+
private escapeFrozenHtml;
|
|
754
|
+
private serializeFrozenNode;
|
|
755
|
+
private recordFrozenPreviewStructure;
|
|
756
|
+
private recordFrozenPreviewPatch;
|
|
757
|
+
/**
|
|
758
|
+
* Reapplies common structural edits previously performed to frames whose capture ended late.
|
|
759
|
+
* The structured JSON materializes into a new NodeModel each frame without sharing ids.
|
|
760
|
+
*/
|
|
761
|
+
private applySharedSourceStructureOverrides;
|
|
762
|
+
/**
|
|
763
|
+
* Instantly replicates the structure of the common source container to all already captured frames,
|
|
764
|
+
* A final structure override is also left for frames that have not yet been captured.
|
|
765
|
+
*/
|
|
766
|
+
private syncSharedSourceStructure;
|
|
767
|
+
/** A single action through which all changes pass through the properties panel, resize, and rename. */
|
|
768
|
+
patch(node: NodeModel, partial: Partial<NodeModel>): void;
|
|
769
|
+
/** Update one source-authored primitive JSX prop and keep the imported DOM preview in sync. */
|
|
770
|
+
patchSourceProp(node: NodeModel, prop: string, value: PrimitiveSourceValue): boolean;
|
|
771
|
+
/**
|
|
772
|
+
* Flips one registry-typed prop on a component instance through the regular
|
|
773
|
+
* patch spine: a single patch call means one undo step, shared-source
|
|
774
|
+
* propagation to peer instances, and frozen-preview replay. When the prop is
|
|
775
|
+
* literal-authored (present in sourceProps with a matching primitive type)
|
|
776
|
+
* the same sourceProps/domAttributes/own-props mirror patchSourceProp
|
|
777
|
+
* records is applied so Apply writes it back to source; otherwise the flip
|
|
778
|
+
* is preview-only.
|
|
779
|
+
*/
|
|
780
|
+
patchComponentInstanceProp(node: NodeModel, prop: string, value: RegistryPropValue): {
|
|
781
|
+
applied: boolean;
|
|
782
|
+
sourceWritable: boolean;
|
|
783
|
+
};
|
|
784
|
+
/** Selection criteria Insert target — If it is a child-accepting node, it is inside it, if it is a leaf, it is the parent, and if it is not, it is the root. */
|
|
785
|
+
private insertTarget;
|
|
786
|
+
addNode(type: NodeType): void;
|
|
787
|
+
/** Insert a registry component into the canvas — an “actual React component” node. */
|
|
788
|
+
addComponentNode(name: string): void;
|
|
789
|
+
removeSelected(): void;
|
|
790
|
+
/** ⌘D · Alt+drag — Duplicate the top selections into their siblings (issue new IDs). */
|
|
791
|
+
duplicateSelected(): void;
|
|
792
|
+
copySelection(): void;
|
|
793
|
+
cutSelection(): void;
|
|
794
|
+
paste(): void;
|
|
795
|
+
/** Command/Ctrl-G groups selected siblings into a Rows container. */
|
|
796
|
+
groupSelected(): void;
|
|
797
|
+
/** ⌘⇧G — Unpacks the selected container and spreads its children into the parent's place. */
|
|
798
|
+
ungroupSelected(): void;
|
|
799
|
+
/**
|
|
800
|
+
* Decomposes the entire component node into the entire actual DOM layer.
|
|
801
|
+
* Internal registry component boundaries maintain their names, but sub-DOMs also continue to recurse.
|
|
802
|
+
*/
|
|
803
|
+
decomposeSelectedComponent(): void;
|
|
804
|
+
/** Brackets move to the first or last position; modified brackets move one position. */
|
|
805
|
+
reorderSelected(dir: -1 | 1 | 'front' | 'back'): void;
|
|
806
|
+
toggleHiddenSelected(): void;
|
|
807
|
+
toggleLockedSelected(): void;
|
|
808
|
+
/** Number keys 1–9 set 10–90% opacity; 0 sets 100%. */
|
|
809
|
+
setOpacitySelected(v: number): void;
|
|
810
|
+
/** Drag drop commit — reorder/reparent. index is based on the child list “excluding the drag node”. */
|
|
811
|
+
moveNode(id: string, parentId: string, index: number): void;
|
|
812
|
+
/** root → corresponding node path. If not, []. */
|
|
813
|
+
pathTo(id: string): NodeModel[];
|
|
814
|
+
/** Is id in the rootId subtree (including itself)? */
|
|
815
|
+
isInSubtree(rootId: string, id: string): boolean;
|
|
816
|
+
/**
|
|
817
|
+
* Selection rules:
|
|
818
|
+
* · Click: Top level (immediate root). If you are already in the depth, you are the brother of that depth.
|
|
819
|
+
* · Double click (drill): Enter one step. · ⌘click (deep): Deepest part. · Shift(additive): Toggle.
|
|
820
|
+
*/
|
|
821
|
+
selectFromHit(deepestId: string, opts?: {
|
|
822
|
+
deep?: boolean;
|
|
823
|
+
drill?: boolean;
|
|
824
|
+
additive?: boolean;
|
|
825
|
+
}): void;
|
|
826
|
+
/** ⌘A — All siblings of the current depth (directly at the root if none exist). */
|
|
827
|
+
selectAllSiblings(): void;
|
|
828
|
+
/** Tab/⇧Tab — Sibling cycle. */
|
|
829
|
+
selectSibling(delta: -1 | 1): void;
|
|
830
|
+
/** Enter — First child entry. */
|
|
831
|
+
selectFirstChild(): void;
|
|
832
|
+
/** ⇧Enter — To Parent. */
|
|
833
|
+
selectParent(): void;
|
|
834
|
+
}
|
|
835
|
+
export declare function findNode(from: NodeModel, id: string): NodeModel | null;
|
|
836
|
+
export declare function findParent(from: NodeModel, id: string): NodeModel | null;
|
|
837
|
+
export declare const editor: EditorStore;
|
|
838
|
+
export {};
|