@pygmalionjs/pygmalion 0.5.14 → 0.5.16
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/{FrozenRoutePreview-BR5CBAD3.js → FrozenRoutePreview-CZOpvN6z.js} +1545 -1515
- package/dist-lib/pygmalion.js +5034 -4955
- package/dist-lib/testing.js +1 -1
- 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 +133 -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 +365 -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 +63 -17
- package/package.json +7 -8
- package/testing.d.ts +0 -26
- package/types.d.ts +0 -2675
package/dist-lib/testing.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { FrameLodFrame } from '../editor/frameLod';
|
|
3
|
+
/** Diagnostic passthrough for headless debugging of the LOD frame inputs. */
|
|
4
|
+
export declare function __debugReadEditorFrames(): (FrameLodFrame & {
|
|
5
|
+
memoKey?: string;
|
|
6
|
+
})[];
|
|
7
|
+
export declare function CameraLayer({ children }: {
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
import { type NodeModel } from '../editor/store';
|
|
3
|
+
export declare const JUSTIFY_CSS: {
|
|
4
|
+
readonly start: "flex-start";
|
|
5
|
+
readonly center: "center";
|
|
6
|
+
readonly end: "flex-end";
|
|
7
|
+
readonly between: "space-between";
|
|
8
|
+
};
|
|
9
|
+
export declare const ALIGN_CSS: {
|
|
10
|
+
readonly start: "flex-start";
|
|
11
|
+
readonly center: "center";
|
|
12
|
+
readonly end: "flex-end";
|
|
13
|
+
};
|
|
14
|
+
export declare function sizeStyle(node: NodeModel): CSSProperties;
|
|
15
|
+
import { layoutContextStyle } from './layoutContext';
|
|
16
|
+
export { layoutContextStyle };
|
|
17
|
+
export declare const CanvasNode: import("react").NamedExoticComponent<{
|
|
18
|
+
node: NodeModel;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type PageModel } from '../editor/store';
|
|
2
|
+
export declare const FrameLabelBanner: import("react").FunctionComponent<{
|
|
3
|
+
page: PageModel;
|
|
4
|
+
active: boolean;
|
|
5
|
+
/** Drag-to-move, passed only in edit mode; view-only reads and never grabs. */
|
|
6
|
+
onLabelDown?: (event: React.MouseEvent) => void;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type PageModel } from '../editor/store';
|
|
2
|
+
export declare const FrameView: import("react").FunctionComponent<{
|
|
3
|
+
page: PageModel;
|
|
4
|
+
active: boolean;
|
|
5
|
+
selected: boolean;
|
|
6
|
+
backgroundOnly?: boolean;
|
|
7
|
+
cacheHydrated: boolean;
|
|
8
|
+
previewIdentityReady: boolean;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type PageModel } from '../editor/store';
|
|
2
|
+
export declare function FrozenRoutePreviewView({ page, snapshot, height, onDocumentReady, onDocumentHeightChange, onReplayIssuesChange, }: {
|
|
3
|
+
page: PageModel;
|
|
4
|
+
snapshot: string;
|
|
5
|
+
height: number;
|
|
6
|
+
onDocumentReady?: (iframe: HTMLIFrameElement) => void;
|
|
7
|
+
onDocumentHeightChange?: (height: number) => void;
|
|
8
|
+
onReplayIssuesChange?: (issues: string[]) => void;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
export declare const FrozenRoutePreview: typeof FrozenRoutePreviewView & {
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import { type SourceAffectedFrame } from '../editor/inspect';
|
|
3
|
+
export declare function InspectOverlay({ iframeRef, containerRef, affectedFrames, }: {
|
|
4
|
+
/** route page — when placed over a same-origin iframe. */
|
|
5
|
+
iframeRef?: RefObject<HTMLIFrameElement | null>;
|
|
6
|
+
/** fixture page — when placed over a scroll container in the body (same document). */
|
|
7
|
+
containerRef?: RefObject<HTMLElement | null>;
|
|
8
|
+
/** Current selection screen. Even before calculating the impact of all same-source frames, at least the current frame is preserved in the operation. */
|
|
9
|
+
affectedFrames?: readonly SourceAffectedFrame[];
|
|
10
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NodeModel } from '../editor/store';
|
|
2
|
+
/**
|
|
3
|
+
* Real-time DOM renderer for inactive frames.
|
|
4
|
+
* Leave only one MobX observer per frame and do not create selection/hover/drag handlers.
|
|
5
|
+
* Therefore, it is lightweight at the level of static capture, but currently uses NodeModel's text/props/style/structure.
|
|
6
|
+
* Read all, instantly displaying common changes without clicking or activating.
|
|
7
|
+
*/
|
|
8
|
+
export declare const LightweightCanvas: import("react").FunctionComponent<{
|
|
9
|
+
root: NodeModel;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type ResizeEdge = 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw';
|
|
2
|
+
export type Rect = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function resizedRect(base: Rect, edge: ResizeEdge, dx: number, dy: number, minWidth: number, minHeight: number): Rect;
|
|
9
|
+
export declare function ObjectControls({ kind, onResize, onDelete, deleteDisabled, status, readOnly, }: {
|
|
10
|
+
kind: 'frame' | 'section';
|
|
11
|
+
onResize: (edge: ResizeEdge, e: React.MouseEvent) => void;
|
|
12
|
+
onDelete: (e: React.MouseEvent) => void;
|
|
13
|
+
deleteDisabled?: boolean;
|
|
14
|
+
status?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Draws the outline and the size read-out without the grips. View-only
|
|
17
|
+
* still wants to show WHICH object is being read; it must not offer a
|
|
18
|
+
* handle to drag or a button to delete, because an affordance is a
|
|
19
|
+
* promise and this mode cannot keep it.
|
|
20
|
+
*/
|
|
21
|
+
readOnly?: boolean;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const SECTION_PAD = 28;
|
|
2
|
+
/**
|
|
3
|
+
* Section bounds on the active canvas — the union of explicit section
|
|
4
|
+
* rectangles and member frame bboxes. Empty sections are included so a frame
|
|
5
|
+
* can still be dropped onto one.
|
|
6
|
+
*
|
|
7
|
+
* A frame's box is measured to `resolveFrameHeight`, which is the frame
|
|
8
|
+
* itself; the rendered element is taller because its label banner sits in
|
|
9
|
+
* flow above it (63 canvas units on this project, font-metric dependent). Do
|
|
10
|
+
* not widen these bounds to match: they decide which section a dropped frame
|
|
11
|
+
* joins, the search takes the first section it intersects, and lanes sit 210
|
|
12
|
+
* apart while sections sit 120 plus the header reserve — so a taller box
|
|
13
|
+
* would start overlapping its neighbour and reassign frames to the wrong
|
|
14
|
+
* section. Understating is the safe direction, and nothing is drawn from
|
|
15
|
+
* these bounds any more that a designer could see the shortfall in.
|
|
16
|
+
*/
|
|
17
|
+
export declare function sectionBounds(): Map<string, {
|
|
18
|
+
x0: number;
|
|
19
|
+
y0: number;
|
|
20
|
+
x1: number;
|
|
21
|
+
y1: number;
|
|
22
|
+
explicit: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const SectionBoxes: import("react").FunctionComponent<object>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type RoutePreviewShadowArtifact } from '../editor/routePreview';
|
|
2
|
+
import { type PageModel } from '../editor/store';
|
|
3
|
+
export declare const ShadowRoutePreview: import("react").FunctionComponent<{
|
|
4
|
+
page: PageModel;
|
|
5
|
+
snapshot?: string;
|
|
6
|
+
artifact?: RoutePreviewShadowArtifact;
|
|
7
|
+
height: number;
|
|
8
|
+
baseUrl: string;
|
|
9
|
+
revision: string;
|
|
10
|
+
/** True when the backing artifact no longer matches the source screen — blocks bootless promotion. */
|
|
11
|
+
sourceStale?: boolean;
|
|
12
|
+
onDocumentHeightChange?: (height: number) => void;
|
|
13
|
+
onReplayIssuesChange?: (issues: string[]) => void;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { StoryboardGraphViewModel } from '../editor/storyboardGraphView';
|
|
2
|
+
export interface StoryboardFrameGeometry {
|
|
3
|
+
frameId: string;
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
}
|
|
9
|
+
export interface StoryboardConnectionPath {
|
|
10
|
+
id: string;
|
|
11
|
+
sourceFrameId: string;
|
|
12
|
+
targetFrameId: string;
|
|
13
|
+
path: string;
|
|
14
|
+
}
|
|
15
|
+
export type StoryboardConnectionMode = 'story' | 'focus' | 'overview';
|
|
16
|
+
export interface StoryboardConnectionPathOptions {
|
|
17
|
+
mode?: StoryboardConnectionMode;
|
|
18
|
+
activeFrameId?: string | null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Projects graph transitions into world-space paths. The calculation is kept
|
|
22
|
+
* independent from camera pan and zoom because the SVG lives inside the same
|
|
23
|
+
* transformed canvas layer as the frames.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createStoryboardConnectionPaths(model: StoryboardGraphViewModel, frames: readonly StoryboardFrameGeometry[], options?: StoryboardConnectionPathOptions): StoryboardConnectionPath[];
|
|
26
|
+
export declare function StoryboardConnections({ model, frames, mode, activeFrameId, }: {
|
|
27
|
+
model: StoryboardGraphViewModel;
|
|
28
|
+
frames: readonly StoryboardFrameGeometry[];
|
|
29
|
+
mode?: StoryboardConnectionMode;
|
|
30
|
+
activeFrameId?: string | null;
|
|
31
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface CameraView {
|
|
2
|
+
panX: number;
|
|
3
|
+
panY: number;
|
|
4
|
+
zoom: number;
|
|
5
|
+
}
|
|
6
|
+
export interface CameraViewport {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
insetLeft?: number;
|
|
10
|
+
insetRight?: number;
|
|
11
|
+
insetTop?: number;
|
|
12
|
+
insetBottom?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface CameraFrameRect {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
}
|
|
20
|
+
/** Fixed initial view of the new canvas. It has nothing to do with frame/iframe/viewport geometry. */
|
|
21
|
+
export declare const DEFAULT_CANVAS_CAMERA_VIEW: Readonly<CameraView>;
|
|
22
|
+
/**
|
|
23
|
+
* The only automatic view decisions allowed when switching canvases:
|
|
24
|
+
* If there is a previous user view, it is restored. If not, a fixed default value is used.
|
|
25
|
+
* Because it does not receive asynchronous geometry or viewport as input, ready cannot move the camera.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveCanvasCameraView(saved: CameraView | null | undefined): CameraView;
|
|
28
|
+
/**
|
|
29
|
+
* Camera placement only used when the user explicitly requests movement in the frame list.
|
|
30
|
+
* Align and center the frame within the viewport, excluding the area covered by the panel.
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolveFrameFocusCameraView(frame: CameraFrameRect, viewport: CameraViewport, options?: {
|
|
33
|
+
padding?: number;
|
|
34
|
+
minZoom?: number;
|
|
35
|
+
maxZoom?: number;
|
|
36
|
+
}): CameraView;
|
|
37
|
+
/**
|
|
38
|
+
* Reveals a sidebar-selected frame with the smallest possible pan adjustment.
|
|
39
|
+
* The user's zoom is never changed, and an already visible frame does not move
|
|
40
|
+
* the camera. Explicit fit commands continue to use resolveFrameFocusCameraView.
|
|
41
|
+
*/
|
|
42
|
+
export declare function resolveFrameRevealCameraView(frame: CameraFrameRect, viewport: CameraViewport, current: CameraView, options?: {
|
|
43
|
+
padding?: number;
|
|
44
|
+
tolerance?: number;
|
|
45
|
+
}): CameraView;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tags rendered without children.
|
|
3
|
+
*
|
|
4
|
+
* Mostly the HTML void elements plus the SVG leaves. `textarea` is not void,
|
|
5
|
+
* but its content travels as `defaultValue` rather than as children, so React
|
|
6
|
+
* treats children as a conflict — for rendering purposes it is a leaf too.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DOM_LEAF_TAGS: Set<string>;
|
|
9
|
+
/** Captured document scaffolding that must not render as itself inside a frame. */
|
|
10
|
+
export declare const DOCUMENT_CONTAINER_TAGS: Set<string>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The slice of a collapsed instance's captured styles that keeps it PLACED
|
|
4
|
+
* exactly as captured — position, box, and formatting context — while the
|
|
5
|
+
* registered component supplies its own appearance.
|
|
6
|
+
*/
|
|
7
|
+
export declare function layoutContextStyle(node: {
|
|
8
|
+
domStyle: Record<string, string>;
|
|
9
|
+
}): CSSProperties;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True while a flow session still owes this screen its snapshot. Frames use
|
|
3
|
+
* it exactly like the artifact-hydration gate: activation waits for the
|
|
4
|
+
* session's delivery instead of booting a live app of its own.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useFlowSessionPending(screenId: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* True while a viewport-variant session (committed size change) still owes
|
|
9
|
+
* this page its snapshot at the given viewport. While pending, the frame
|
|
10
|
+
* holds its provisional tree instead of live re-measuring — the delivery
|
|
11
|
+
* mounts as a frozen preview and promotes over the provisional import.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useViewportSessionPending(page: {
|
|
14
|
+
importPageId?: string;
|
|
15
|
+
id: string;
|
|
16
|
+
}, viewport: {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
}): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* True while an interactive-state session (a declared axis the frame is held
|
|
22
|
+
* in, such as a folded sidebar) still owes this page its snapshot. The frame
|
|
23
|
+
* waits for it instead of booting the app and replaying the whole recipe
|
|
24
|
+
* itself — the session does that work in one instance the warm pool keeps.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useInteractiveSessionPending(page: {
|
|
27
|
+
importPageId?: string;
|
|
28
|
+
id: string;
|
|
29
|
+
interactiveStateId?: string;
|
|
30
|
+
interactiveOptionId?: string;
|
|
31
|
+
}): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* True while this frame holds one of the host's live screen slots, meaning it
|
|
34
|
+
* renders the running app rather than its frozen capture.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useLiveScreenSlot(pageId: string): boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { FrameLifecycleTier } from '../editor/frameLod';
|
|
2
|
+
/**
|
|
3
|
+
* The lifecycle tier of one frame, read from the frame LOD controller's keyed
|
|
4
|
+
* store. Pinned frames (active, selected, preview-intended, or holding a live
|
|
5
|
+
* preview grant) always read as full — losing their DOM would kill a running
|
|
6
|
+
* producer or the surface the user is working on. The server snapshot is full
|
|
7
|
+
* so SSR markup stays the complete preview surface.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useFrameLod(frameId: string, pinned: boolean): FrameLifecycleTier;
|
|
10
|
+
/**
|
|
11
|
+
* Whether the camera currently draws this frame beyond its screenshot's pixel
|
|
12
|
+
* density, from the same keyed store as the tier. False on the server — SSR
|
|
13
|
+
* markup keeps the screenshot surface, and hydration corrects it on the first
|
|
14
|
+
* recompute if the saved camera is already magnifying.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useFrameMagnification(frameId: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The URL a frame screenshot should display right now. Native resolution
|
|
19
|
+
* while the camera magnifies past one device pixel per CSS pixel (or while
|
|
20
|
+
* the downscale still generates); the CSS-resolution downscale otherwise, so
|
|
21
|
+
* an overview does not keep every frame's full bitmap decoded. The server
|
|
22
|
+
* snapshot always uses the native URL.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useScreenshotDisplayUrl(cacheKey: string, screenshot: {
|
|
25
|
+
dataUrl: string;
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
} | null, cssWidth: number, cssHeight: number): string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Dev-only remount cost probe: marks the render that reattaches a detached
|
|
31
|
+
* frame and measures once the commit's mount effects (including the shadow
|
|
32
|
+
* preview mount, which flushes before this parent effect) have run. Off in
|
|
33
|
+
* production builds unless `globalThis.PYGMALION_PROFILE_FRAME_LOD` is true.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useFrameLodRemountProfile(frameId: string, tier: FrameLifecycleTier): void;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export interface AdaptiveFrameSize {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
}
|
|
5
|
+
export interface AdaptiveFramePosition extends AdaptiveFrameSize {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
}
|
|
9
|
+
export interface AdaptiveFrameLayout {
|
|
10
|
+
frames: AdaptiveFramePosition[];
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
rowWidth: number;
|
|
14
|
+
}
|
|
15
|
+
export interface AdaptiveFrameLayoutOptions {
|
|
16
|
+
gap?: number;
|
|
17
|
+
targetAspectRatio?: number;
|
|
18
|
+
maxRowWidth?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface LaneInput {
|
|
21
|
+
laneId: string;
|
|
22
|
+
frames: readonly AdaptiveFrameSize[];
|
|
23
|
+
}
|
|
24
|
+
export interface LaneBand {
|
|
25
|
+
laneId: string;
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
}
|
|
31
|
+
export interface LanedFrameLayout {
|
|
32
|
+
/** Positions in the input order, lanes concatenated. */
|
|
33
|
+
frames: AdaptiveFramePosition[];
|
|
34
|
+
bands: LaneBand[];
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
}
|
|
38
|
+
export interface LaneLayoutOptions {
|
|
39
|
+
/** Between frames inside one lane — "the next thing in this situation". */
|
|
40
|
+
gap?: number;
|
|
41
|
+
/** Between lanes — "a different situation". Wider than gap on purpose. */
|
|
42
|
+
laneGap?: number;
|
|
43
|
+
/** Frames per lane row before the lane wraps into a continuation row. */
|
|
44
|
+
maxFramesPerRow?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Lays lanes out as rows: one lane is one horizontal run, read left to right,
|
|
48
|
+
* and lanes stack downward separated by a wider gap.
|
|
49
|
+
*
|
|
50
|
+
* Rows are left-aligned rather than column-aligned across lanes. Forcing a
|
|
51
|
+
* grid would imply a correspondence between, say, the third screen of the
|
|
52
|
+
* recording run and the third error path, and would punch holes wherever a
|
|
53
|
+
* lane is shorter — the gap is what carries the grouping, so it does the work
|
|
54
|
+
* instead.
|
|
55
|
+
*
|
|
56
|
+
* A lane longer than `maxFramesPerRow` wraps into continuation rows at the
|
|
57
|
+
* intra-lane gap, which keeps a whole lane inside one viewport at overview
|
|
58
|
+
* zoom while still reading as one block.
|
|
59
|
+
*/
|
|
60
|
+
export declare function layoutLaneRows(lanes: readonly LaneInput[], options?: LaneLayoutOptions): LanedFrameLayout;
|
|
61
|
+
/**
|
|
62
|
+
* Packs ordered frames into a compact storyboard block. The target row width is
|
|
63
|
+
* derived from total rendered area, so larger stories gain columns gradually
|
|
64
|
+
* without relying on a fixed column count. Hosts may still provide an explicit
|
|
65
|
+
* maximum when their canvas has a known horizontal constraint.
|
|
66
|
+
*/
|
|
67
|
+
export declare function layoutAdaptiveFrames(frames: readonly AdaptiveFrameSize[], options?: AdaptiveFrameLayoutOptions): AdaptiveFrameLayout;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DesignImportAsset, DesignImportKind } from './designImport';
|
|
2
|
+
import type { NodeModel, PageModel } from './store';
|
|
3
|
+
export interface DesignAssetEditRequest {
|
|
4
|
+
kind: DesignImportKind;
|
|
5
|
+
asset: DesignImportAsset;
|
|
6
|
+
pageId: string;
|
|
7
|
+
}
|
|
8
|
+
/** Resolve the implementation layer represented by one inventory asset. */
|
|
9
|
+
export declare function findDesignAssetEditTarget(root: NodeModel, asset: DesignImportAsset): NodeModel | null;
|
|
10
|
+
export declare function pageForDesignAsset(pages: readonly PageModel[], kind: DesignImportKind, asset: DesignImportAsset): PageModel | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Palette of the reviewed banner, shared by every density. */
|
|
2
|
+
export declare const BANNER_PALETTE: {
|
|
3
|
+
readonly surface: "#343441";
|
|
4
|
+
readonly pillSurface: "#2e2c3a";
|
|
5
|
+
readonly caption: "#a1a1b3";
|
|
6
|
+
readonly code: "#ffffff";
|
|
7
|
+
readonly title: "#e7e7f0";
|
|
8
|
+
readonly titleMuted: "#a1a1b3";
|
|
9
|
+
readonly meta: "#bebecb";
|
|
10
|
+
readonly purpose: "#c4ccd8";
|
|
11
|
+
};
|
|
12
|
+
export declare const HEX_COLOR: RegExp;
|
|
13
|
+
/**
|
|
14
|
+
* The design pairs a saturated rule with a lighter tint of the same hue for
|
|
15
|
+
* the pill text (#06b6d4 / #6edcee). Mixing toward white reproduces that
|
|
16
|
+
* pairing from the one colour a host declares.
|
|
17
|
+
*/
|
|
18
|
+
export declare function lightenHex(hex: string, amount: number): string;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
import type { DesignImportCollection } from './designImport';
|
|
3
|
+
import type { ComponentRegistry, RegistryEntry, RegistryPropValue } from './registry';
|
|
4
|
+
export type DesignCatalogKind = 'icons' | 'design-tokens' | 'atoms' | 'components';
|
|
5
|
+
export interface DesignCatalogItem {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
section: string;
|
|
9
|
+
sourcePath?: string;
|
|
10
|
+
codeName?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface DesignCatalogPageDescriptor {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
section: string;
|
|
17
|
+
}
|
|
18
|
+
export interface DesignCatalogFrame {
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
}
|
|
22
|
+
export interface DesignCatalogBuild {
|
|
23
|
+
registry: ComponentRegistry;
|
|
24
|
+
collection: DesignImportCollection;
|
|
25
|
+
}
|
|
26
|
+
export interface DesignGalleryCatalogOptions<T extends DesignCatalogItem> {
|
|
27
|
+
kind: 'icons' | 'design-tokens';
|
|
28
|
+
items: readonly T[];
|
|
29
|
+
expectedCount?: number;
|
|
30
|
+
pageFor: (item: T) => DesignCatalogPageDescriptor;
|
|
31
|
+
renderPreview: (item: T) => ReactNode;
|
|
32
|
+
secondaryLabel?: (item: T) => ReactNode;
|
|
33
|
+
frame?: DesignCatalogFrame | ((page: DesignCatalogPageDescriptor, items: readonly T[]) => DesignCatalogFrame);
|
|
34
|
+
minimumColumnWidth?: number;
|
|
35
|
+
registryPrefix?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface DesignComponentCatalogOptions {
|
|
38
|
+
kind: 'atoms' | 'components';
|
|
39
|
+
items: readonly DesignCatalogItem[];
|
|
40
|
+
registry: ComponentRegistry;
|
|
41
|
+
expectedCount?: number;
|
|
42
|
+
maxVariantCells?: number;
|
|
43
|
+
registryPrefix?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface DesignComponentVariantMatrix {
|
|
46
|
+
row?: readonly [name: string, values: readonly RegistryPropValue[]];
|
|
47
|
+
column?: readonly [name: string, values: readonly RegistryPropValue[]];
|
|
48
|
+
fixed: readonly (readonly [name: string, value: RegistryPropValue])[];
|
|
49
|
+
additional: readonly (readonly [name: string, values: readonly RegistryPropValue[]])[];
|
|
50
|
+
}
|
|
51
|
+
export interface PygmalionCatalogDocumentProps {
|
|
52
|
+
title: ReactNode;
|
|
53
|
+
eyebrow?: ReactNode;
|
|
54
|
+
description?: ReactNode;
|
|
55
|
+
version?: ReactNode;
|
|
56
|
+
meta?: ReactNode;
|
|
57
|
+
children: ReactNode;
|
|
58
|
+
headerBackground?: string;
|
|
59
|
+
headerColor?: string;
|
|
60
|
+
bodyBackground?: string;
|
|
61
|
+
bodyGap?: number;
|
|
62
|
+
}
|
|
63
|
+
export interface PygmalionCatalogSectionProps {
|
|
64
|
+
title: ReactNode;
|
|
65
|
+
itemId?: string;
|
|
66
|
+
count?: number;
|
|
67
|
+
description?: ReactNode;
|
|
68
|
+
children: ReactNode;
|
|
69
|
+
tone?: 'plain' | 'tinted';
|
|
70
|
+
}
|
|
71
|
+
export interface PygmalionCatalogMatrixProps {
|
|
72
|
+
rows: readonly RegistryPropValue[];
|
|
73
|
+
columns: readonly RegistryPropValue[];
|
|
74
|
+
cornerLabel?: ReactNode;
|
|
75
|
+
renderCell: (row: RegistryPropValue, column: RegistryPropValue) => ReactNode;
|
|
76
|
+
renderRowLabel?: (row: RegistryPropValue) => ReactNode;
|
|
77
|
+
renderColumnLabel?: (column: RegistryPropValue) => ReactNode;
|
|
78
|
+
boundary?: boolean;
|
|
79
|
+
cellStyle?: CSSProperties;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Intrinsically sized catalog document inspired by a design-system source
|
|
83
|
+
* page. The root is the single content-bounds authority, so hosts never need
|
|
84
|
+
* to predict a frame width or height from item counts.
|
|
85
|
+
*/
|
|
86
|
+
export declare function PygmalionCatalogDocument({ title, eyebrow, description, version, meta, children, headerBackground, headerColor, bodyBackground, bodyGap, }: PygmalionCatalogDocumentProps): import("react").JSX.Element;
|
|
87
|
+
/**
|
|
88
|
+
* Neutral grouping surface for token families, component sets, and icon
|
|
89
|
+
* categories. Its width follows the rendered children instead of a card grid.
|
|
90
|
+
*/
|
|
91
|
+
export declare function PygmalionCatalogSection({ title, itemId, count, description, children, tone, }: PygmalionCatalogSectionProps): import("react").JSX.Element;
|
|
92
|
+
/**
|
|
93
|
+
* Variant matrix with explicit row and column axes. Cells remain open
|
|
94
|
+
* design-document content rather than forced equal-size cards.
|
|
95
|
+
*/
|
|
96
|
+
export declare function PygmalionCatalogMatrix({ rows, columns, cornerLabel, renderCell, renderRowLabel, renderColumnLabel, boundary, cellStyle, }: PygmalionCatalogMatrixProps): import("react").JSX.Element;
|
|
97
|
+
export declare function designCatalogKey(value: string): string;
|
|
98
|
+
export declare function designCatalogRegistryName(kind: DesignCatalogKind, id: string, prefix?: string): string;
|
|
99
|
+
export declare function createDesignGalleryCatalog<T extends DesignCatalogItem>(options: DesignGalleryCatalogOptions<T>): DesignCatalogBuild;
|
|
100
|
+
export declare function createDesignComponentVariantMatrix(entry: RegistryEntry | undefined, maxCells?: number): DesignComponentVariantMatrix;
|
|
101
|
+
export declare function createDesignComponentCatalog(options: DesignComponentCatalogOptions): DesignCatalogBuild;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { NodeJSON, NodeModel } from './store';
|
|
2
|
+
export type CodegenNode = NodeModel | NodeJSON;
|
|
3
|
+
export interface CodegenFrameOptions {
|
|
4
|
+
fill?: string;
|
|
5
|
+
opacity?: number;
|
|
6
|
+
radius?: number;
|
|
7
|
+
clipContent?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function codegen(node: CodegenNode, indent?: number): string;
|
|
10
|
+
/** Generates the built-in target and keeps the historical string API stable. */
|
|
11
|
+
export declare function codegenDocument(root: CodegenNode, frame?: CodegenFrameOptions): string;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export type DesignConnectionPropertyKind = 'text' | 'boolean' | 'variant' | 'instance' | 'slot';
|
|
2
|
+
export interface DesignComponentReference {
|
|
3
|
+
/** External design system name. Use "figma" for a Figma library. */
|
|
4
|
+
provider: string;
|
|
5
|
+
documentId?: string;
|
|
6
|
+
nodeId: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface DesignConnectionPropertyDef {
|
|
11
|
+
designName: string;
|
|
12
|
+
kind: DesignConnectionPropertyKind;
|
|
13
|
+
/** Complete vocabulary for a variant property. */
|
|
14
|
+
values?: readonly string[];
|
|
15
|
+
defaultValue?: string | boolean;
|
|
16
|
+
/** Existing code prop. Use "children" for a text or slot child. */
|
|
17
|
+
codeProperty?: string;
|
|
18
|
+
/** Exhaustive design-value to code-value mapping. Identity is the default. */
|
|
19
|
+
valueMap?: Readonly<Record<string, string | boolean>>;
|
|
20
|
+
/** Makes an intentionally unmapped design property visible to validation. */
|
|
21
|
+
omitReason?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface DesignComponentConnectionDef {
|
|
24
|
+
id: string;
|
|
25
|
+
componentName: string;
|
|
26
|
+
design: DesignComponentReference;
|
|
27
|
+
code?: {
|
|
28
|
+
sourcePath?: string;
|
|
29
|
+
importPath?: string;
|
|
30
|
+
};
|
|
31
|
+
properties?: readonly DesignConnectionPropertyDef[];
|
|
32
|
+
}
|
|
33
|
+
export interface DesignConnectionDiagnostic {
|
|
34
|
+
severity: 'warning' | 'error';
|
|
35
|
+
code: string;
|
|
36
|
+
message: string;
|
|
37
|
+
connectionId: string;
|
|
38
|
+
property?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface DesignComponentConnectionCase {
|
|
41
|
+
id: string;
|
|
42
|
+
label: string;
|
|
43
|
+
designValues: Readonly<Record<string, string | boolean>>;
|
|
44
|
+
codeProps: Readonly<Record<string, string | boolean>>;
|
|
45
|
+
}
|
|
46
|
+
export interface DesignComponentConnectionCases {
|
|
47
|
+
connectionId: string;
|
|
48
|
+
cases: readonly DesignComponentConnectionCase[];
|
|
49
|
+
total: number;
|
|
50
|
+
truncated: {
|
|
51
|
+
total: number;
|
|
52
|
+
limit: number;
|
|
53
|
+
} | null;
|
|
54
|
+
diagnostics: readonly DesignConnectionDiagnostic[];
|
|
55
|
+
}
|
|
56
|
+
export declare function setDesignComponentConnections(next: readonly DesignComponentConnectionDef[]): void;
|
|
57
|
+
export declare function getDesignComponentConnections(): readonly DesignComponentConnectionDef[];
|
|
58
|
+
export declare function getDesignComponentConnection(connectionId: string): DesignComponentConnectionDef | undefined;
|
|
59
|
+
export declare function getDesignComponentConnectionForComponent(componentName: string): DesignComponentConnectionDef | undefined;
|
|
60
|
+
export declare function validateDesignComponentConnections(): readonly DesignConnectionDiagnostic[];
|
|
61
|
+
export declare function enumerateDesignComponentConnectionCases(connectionId: string, options?: {
|
|
62
|
+
limit?: number;
|
|
63
|
+
}): DesignComponentConnectionCases;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ComponentRegistry, RegistryEntry, RegistryPropValue } from './registry';
|
|
2
|
+
import type { NodeModel, PageModel } from './store';
|
|
3
|
+
/** One controllable component instance found in a page tree. */
|
|
4
|
+
export interface ComponentInstanceSummary {
|
|
5
|
+
nodeId: string;
|
|
6
|
+
componentName: string;
|
|
7
|
+
/** Display label: childrenText, then a distinguishing prop value, then the ordinal. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** 1-based position among the same component's instances in the page. */
|
|
10
|
+
ordinal: number;
|
|
11
|
+
/** Effective typed prop values — instance props over registry defaults. */
|
|
12
|
+
props: Record<string, RegistryPropValue>;
|
|
13
|
+
/** Registry props that are literal-authored on the instance and writable to source. */
|
|
14
|
+
sourceWritableProps: readonly string[];
|
|
15
|
+
}
|
|
16
|
+
/** All instances of one component in a page, in document order. */
|
|
17
|
+
export interface ComponentInstanceGroup {
|
|
18
|
+
componentName: string;
|
|
19
|
+
instances: ComponentInstanceSummary[];
|
|
20
|
+
}
|
|
21
|
+
/** Registry props whose authored JSX literal can safely take a vocabulary value. */
|
|
22
|
+
export declare function sourceWritableRegistryProps(node: Pick<NodeModel, 'sourceProps'>, entry: Pick<RegistryEntry, 'props'> | undefined): string[];
|
|
23
|
+
/**
|
|
24
|
+
* Enumerates the controllable component instances of a page, grouped by
|
|
25
|
+
* component in document order.
|
|
26
|
+
*/
|
|
27
|
+
export declare function listComponentInstances(page: Pick<PageModel, 'root'>, registry: ComponentRegistry): ComponentInstanceGroup[];
|