@pygmalionjs/pygmalion 0.17.0 → 0.19.0
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/README.md +71 -0
- package/dist-lib/{CameraLayer-Clqgdcjb.js → CameraLayer-Bv1TqRim.js} +1 -1
- package/dist-lib/pygmalion.js +17841 -16123
- package/dist-lib/{runtime-B8Qu1ung.js → runtime-DlZpODq8.js} +45 -45
- package/dist-lib/style.css +1 -1
- package/dist-lib/testing.js +5 -5
- package/dist-lib/types/document/textLayout.d.ts +77 -0
- package/dist-lib/types/lib.d.ts +11 -1
- package/dist-lib/types/token-library/bindings.d.ts +44 -0
- package/dist-lib/types/workspace/edit/ArrangeLayers.d.ts +5 -1
- package/dist-lib/types/workspace/edit/CanvasGuides.d.ts +5 -1
- package/dist-lib/types/workspace/edit/ClipboardRelationshipDialog.d.ts +21 -0
- package/dist-lib/types/workspace/edit/PrototypeWiring.d.ts +4 -0
- package/dist-lib/types/workspace/edit/SelectionHandles.d.ts +10 -2
- package/dist-lib/types/workspace/edit/VectorEditor.d.ts +12 -1
- package/dist-lib/types/workspace/edit/clipboard.d.ts +1 -0
- package/dist-lib/types/workspace/edit/clipboardGraph.d.ts +9 -0
- package/dist-lib/types/workspace/edit/clipboardPrototype.d.ts +55 -0
- package/dist-lib/types/workspace/edit/clipboardStyles.d.ts +46 -0
- package/dist-lib/types/workspace/edit/clipboardTransfer.d.ts +38 -0
- package/dist-lib/types/workspace/edit/editorCanvas.d.ts +6 -1
- package/dist-lib/types/workspace/edit/geometryHandles.d.ts +13 -1
- package/dist-lib/types/workspace/edit/layerArrangement.d.ts +4 -1
- package/dist-lib/types/workspace/edit/preparedTextFace.d.ts +31 -0
- package/dist-lib/types/workspace/edit/projection.d.ts +23 -1
- package/dist-lib/types/workspace/edit/prototypeWiringModel.d.ts +2 -1
- package/dist-lib/types/workspace/edit/staticTextRaster.d.ts +4 -15
- package/dist-lib/types/workspace/edit/textLayoutBrowser.d.ts +3 -0
- package/dist-lib/types/workspace/edit/textLayoutPlan.d.ts +12 -0
- package/dist-lib/types/workspace/edit/textLayoutProjection.d.ts +28 -0
- package/dist-lib/types/workspace/edit/textLayoutRuntime.d.ts +20 -0
- package/dist-lib/types/workspace/edit/useDesignClipboardPaste.d.ts +19 -0
- package/dist-lib/types/workspace/edit/useTextLayout.d.ts +19 -0
- package/dist-lib/types/workspace/edit/vectorTools.d.ts +9 -5
- package/package.json +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { TextFontFaceRequest, TextResizeMode } from './richText.js';
|
|
2
|
+
export interface TextLayoutAddress {
|
|
3
|
+
readonly sourceNodeId: string;
|
|
4
|
+
readonly instancePath: readonly string[];
|
|
5
|
+
readonly rowPath: readonly {
|
|
6
|
+
readonly repeatId: string;
|
|
7
|
+
readonly key: string | number;
|
|
8
|
+
}[];
|
|
9
|
+
}
|
|
10
|
+
export interface TextLayoutRect {
|
|
11
|
+
readonly x: number;
|
|
12
|
+
readonly y: number;
|
|
13
|
+
readonly width: number;
|
|
14
|
+
readonly height: number;
|
|
15
|
+
}
|
|
16
|
+
/** Captured effective input, not a replacement canonical node or a saved document sidecar. */
|
|
17
|
+
export interface TextLayoutPlan {
|
|
18
|
+
readonly documentId: string;
|
|
19
|
+
readonly sourceRevision: string;
|
|
20
|
+
readonly revisionKey: string;
|
|
21
|
+
readonly address: TextLayoutAddress;
|
|
22
|
+
readonly authoredBounds: TextLayoutRect;
|
|
23
|
+
readonly mode: TextResizeMode;
|
|
24
|
+
readonly text: string;
|
|
25
|
+
readonly font: Omit<TextFontFaceRequest, 'sample'>;
|
|
26
|
+
readonly fontSize: number;
|
|
27
|
+
readonly lineHeight: number;
|
|
28
|
+
readonly align: 'start' | 'center' | 'end';
|
|
29
|
+
}
|
|
30
|
+
export interface TextLayoutFace {
|
|
31
|
+
readonly environmentId: string;
|
|
32
|
+
readonly faceId: string;
|
|
33
|
+
readonly family: string;
|
|
34
|
+
readonly weight: number;
|
|
35
|
+
readonly style: 'normal' | 'italic';
|
|
36
|
+
readonly sample: string;
|
|
37
|
+
}
|
|
38
|
+
export interface TextLayoutRange {
|
|
39
|
+
/** UTF-16 offsets into the complete plain string; boundaries follow native grapheme segmentation. */
|
|
40
|
+
readonly start: number;
|
|
41
|
+
readonly end: number;
|
|
42
|
+
readonly line: number;
|
|
43
|
+
readonly rects: readonly TextLayoutRect[];
|
|
44
|
+
}
|
|
45
|
+
export interface TextLayoutLine {
|
|
46
|
+
readonly paragraph: number;
|
|
47
|
+
readonly start: number;
|
|
48
|
+
readonly end: number;
|
|
49
|
+
readonly box: TextLayoutRect;
|
|
50
|
+
readonly baseline: number;
|
|
51
|
+
readonly fragments: readonly TextLayoutRect[];
|
|
52
|
+
}
|
|
53
|
+
export interface TextLayoutGeometry {
|
|
54
|
+
/** Native advance/line extents, not glyph ink bounds or ancestor-clipped output extents. */
|
|
55
|
+
readonly effectiveBounds: TextLayoutRect;
|
|
56
|
+
readonly contentBounds: TextLayoutRect;
|
|
57
|
+
readonly lines: readonly TextLayoutLine[];
|
|
58
|
+
readonly ranges: readonly TextLayoutRange[];
|
|
59
|
+
}
|
|
60
|
+
/** All geometry is local CSS pixels. Apply the existing scene transform and ancestor clip at consumption. */
|
|
61
|
+
export interface TextLayoutSnapshot extends TextLayoutGeometry {
|
|
62
|
+
readonly inputKey: string;
|
|
63
|
+
readonly plan: TextLayoutPlan;
|
|
64
|
+
readonly environmentId: string;
|
|
65
|
+
readonly faces: readonly TextLayoutFace[];
|
|
66
|
+
}
|
|
67
|
+
export declare const TEXT_LAYOUT_MAX_UNITS = 32768;
|
|
68
|
+
export declare const TEXT_LAYOUT_MAX_RANGES = 8192;
|
|
69
|
+
export declare const TEXT_LAYOUT_MAX_LINES = 2048;
|
|
70
|
+
/** This initial LTR contract conservatively excludes bidi controls and RTL script blocks. */
|
|
71
|
+
export declare const textLayoutNeedsBidi: (text: string) => boolean;
|
|
72
|
+
/** Only immutable data is accepted; DOM objects and mutable resolver state never enter a snapshot. */
|
|
73
|
+
export declare function freezeTextLayout<T>(value: T): T;
|
|
74
|
+
export declare function captureTextLayoutPlan(value: TextLayoutPlan): TextLayoutPlan;
|
|
75
|
+
export declare const textLayoutInputKey: (plan: TextLayoutPlan) => string;
|
|
76
|
+
/** Empty paragraphs explicitly prepare the same face's space metric for their native strut. */
|
|
77
|
+
export declare function textLayoutFontRequests(plan: TextLayoutPlan): readonly TextFontFaceRequest[];
|
package/dist-lib/types/lib.d.ts
CHANGED
|
@@ -427,7 +427,17 @@ export { assetInteropSourceDeltaDiagnostics, ASSETS_METADATA_KEY, ASSET_STORE_VE
|
|
|
427
427
|
export type { DocumentAsset, ImageAsset, SvgAsset, AssetStore, ImageAssetInput, SvgAssetInput, AssetFileLike, InventoryAssetMedia, InventoryAssetEntry } from './document/assets.js';
|
|
428
428
|
export * from './document/svgImport.js';
|
|
429
429
|
export * from './document/exportSettings.js';
|
|
430
|
-
export
|
|
430
|
+
export { DESIGN_CLIPBOARD_FORMAT, DESIGN_INTERCHANGE_FORMAT, copyDesignSubtrees, serializeDesignClipboard, parseDesignClipboard, pasteDesignSubtrees, applyDesignPaste, exportDesignInterchange, importDesignInterchange } from './workspace/edit/clipboard.js';
|
|
431
|
+
export type { DesignClipboard, PasteDesignResult } from './workspace/edit/clipboard.js';
|
|
432
|
+
export * from './workspace/edit/clipboardTransfer.js';
|
|
433
|
+
export * from './workspace/edit/clipboardStyles.js';
|
|
434
|
+
export * from './workspace/edit/clipboardPrototype.js';
|
|
435
|
+
export { createTextLayoutPlan } from './workspace/edit/textLayoutPlan.js';
|
|
436
|
+
export type { TextLayoutPlanOptions } from './workspace/edit/textLayoutPlan.js';
|
|
437
|
+
export { createTextLayoutRuntime } from './workspace/edit/textLayoutRuntime.js';
|
|
438
|
+
export type { TextLayoutRuntime } from './workspace/edit/textLayoutRuntime.js';
|
|
439
|
+
export type { TextLayoutAddress, TextLayoutRect, TextLayoutPlan, TextLayoutFace, TextLayoutRange, TextLayoutLine, TextLayoutGeometry, TextLayoutSnapshot } from './document/textLayout.js';
|
|
440
|
+
export type { PreparedTextFaceReference, PreparedTextFaceResolver } from './workspace/edit/preparedTextFace.js';
|
|
431
441
|
export { AssetsPanel } from './workspace/edit/AssetsPanel.js';
|
|
432
442
|
export type { AssetsPanelProps } from './workspace/edit/AssetsPanel.js';
|
|
433
443
|
export * from './document/prototype.js';
|
|
@@ -8,6 +8,43 @@ export interface VariableBinding {
|
|
|
8
8
|
}
|
|
9
9
|
export type VariableBindings = Record<string, VariableBinding>;
|
|
10
10
|
export type VariableValueCodec = (library: TokenLibraryDocument, resolved: TokenValueResolution) => VariableScalar;
|
|
11
|
+
export type VariableModeProvider = {
|
|
12
|
+
kind: 'binding';
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'node';
|
|
15
|
+
nodeId: string;
|
|
16
|
+
} | {
|
|
17
|
+
kind: 'instance';
|
|
18
|
+
instanceId: string;
|
|
19
|
+
overrideAddress: string;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'default';
|
|
22
|
+
};
|
|
23
|
+
export interface VariableModeResolution {
|
|
24
|
+
collectionId: string;
|
|
25
|
+
/** The requested mode, even when an alias is authored in a fallback mode. */
|
|
26
|
+
modeId: string;
|
|
27
|
+
provider: VariableModeProvider;
|
|
28
|
+
visitedNodeIds: readonly string[];
|
|
29
|
+
}
|
|
30
|
+
export interface VariableInstanceAddress {
|
|
31
|
+
instanceId: string;
|
|
32
|
+
overrideAddress: string;
|
|
33
|
+
}
|
|
34
|
+
export type VariableOccurrenceAddress = {
|
|
35
|
+
nodeId: string;
|
|
36
|
+
} | VariableInstanceAddress;
|
|
37
|
+
export interface VariableOccurrencePlan {
|
|
38
|
+
address: VariableOccurrenceAddress;
|
|
39
|
+
property: VariableTarget;
|
|
40
|
+
binding: VariableBinding;
|
|
41
|
+
mode: VariableModeResolution;
|
|
42
|
+
resolved: TokenValueResolution;
|
|
43
|
+
value: VariableScalar;
|
|
44
|
+
before: DocumentValue | undefined;
|
|
45
|
+
/** Literal projection only. Binding identity and transaction ownership stay with the caller. */
|
|
46
|
+
patch: DocumentNodePatch;
|
|
47
|
+
}
|
|
11
48
|
export interface VariableChange {
|
|
12
49
|
nodeId: string;
|
|
13
50
|
overrideAddress?: string;
|
|
@@ -50,8 +87,15 @@ export declare function isVariableBinding(value: unknown): value is VariableBind
|
|
|
50
87
|
export declare function nodeVariableBindings(node: Pick<DocumentNode, 'properties'>): VariableBindings;
|
|
51
88
|
/** Built-in values are JSON scalars. Other syntax remains the host codec's responsibility. */
|
|
52
89
|
export declare function resolveScalarVariable(library: TokenLibraryDocument, resolved: TokenValueResolution, seen?: Set<string>): VariableScalar;
|
|
90
|
+
export declare function resolveVariableModeForNode(document: DesignDocument, nodeId: string, library: TokenLibraryDocument, tokenId: string, explicit?: string): VariableModeResolution;
|
|
53
91
|
export declare function variableModeForNode(document: DesignDocument, nodeId: string, library: TokenLibraryDocument, tokenId: string, explicit?: string): string;
|
|
92
|
+
/** Resolves an opaque override address through the actual component resolver. */
|
|
93
|
+
export declare function resolveVariableModeForInstance(document: DesignDocument, address: VariableInstanceAddress, library: TokenLibraryDocument, binding: VariableBinding): VariableModeResolution;
|
|
54
94
|
export declare function variableTargetsForNode(node: DocumentNode): VariableTarget[];
|
|
95
|
+
/** Override projection stays sparse; unrelated inherited properties never become local overrides. */
|
|
96
|
+
export declare function projectVariableScalar(node: DocumentNode, property: VariableTarget, value: VariableScalar, placement: 'own' | 'override'): DocumentNodePatch;
|
|
97
|
+
/** Reads one occurrence without refreshing unrelated nodes or changing either document. */
|
|
98
|
+
export declare function planVariableOccurrence(document: DesignDocument, address: VariableOccurrenceAddress, property: VariableTarget, library: TokenLibraryDocument, codec?: VariableValueCodec): VariableOccurrencePlan;
|
|
55
99
|
export declare function bindVariablePatch(document: DesignDocument, nodeId: string, property: VariableTarget, library: TokenLibraryDocument, binding: VariableBinding, codec?: VariableValueCodec): DocumentNodePatch;
|
|
56
100
|
export declare function detachVariablePatch(node: DocumentNode, property: VariableTarget): DocumentNodePatch;
|
|
57
101
|
/** A refresh plan records all affected nodes before the caller commits one history entry. */
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { DesignDocument, DocumentEngineOptions, DocumentTransaction } from '../../document/contracts.js';
|
|
2
|
+
import type { ProjectedDocumentNode } from './projection.js';
|
|
2
3
|
import type { DataProjection } from '../../binding/preview.js';
|
|
3
4
|
|
|
4
|
-
export declare function ArrangeLayers({ document, selected, projection, preflight, act, compact }: {
|
|
5
|
+
export declare function ArrangeLayers({ document, selected, projection, scene, visibleRootIds, isGeometryCurrent, preflight, act, compact }: {
|
|
5
6
|
document: DesignDocument;
|
|
6
7
|
selected: readonly string[];
|
|
7
8
|
projection: DataProjection | null;
|
|
9
|
+
scene?: ProjectedDocumentNode;
|
|
10
|
+
visibleRootIds?: readonly string[];
|
|
11
|
+
isGeometryCurrent?: () => boolean;
|
|
8
12
|
compact?: boolean;
|
|
9
13
|
preflight?: DocumentEngineOptions['preflight'];
|
|
10
14
|
act(label: string, apply: (transaction: DocumentTransaction) => void): boolean;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { DataProjection } from '../../binding/preview.js';
|
|
2
2
|
import type { WorkspaceCamera } from '../contracts.js';
|
|
3
|
+
import { type ProjectedDocumentNode } from './projection.js';
|
|
3
4
|
import type { DesignDocument, DocumentNode, DocumentTransaction } from '../../document/contracts.js';
|
|
4
5
|
|
|
5
6
|
type Act = (label: string, apply: (transaction: DocumentTransaction) => void) => unknown;
|
|
6
7
|
/** A camera mounts rulers in viewport pixels and transforms document annotations exactly once. */
|
|
7
|
-
export declare function CanvasGuides({ document, selected, projection, camera, zoom: suppliedZoom, act, width, height, visibleRootIds }: {
|
|
8
|
+
export declare function CanvasGuides({ document, selected, projection, scene, geometryKey, isGeometryCurrent, camera, zoom: suppliedZoom, act, width, height, visibleRootIds }: {
|
|
8
9
|
document: DesignDocument;
|
|
9
10
|
selected?: readonly string[];
|
|
10
11
|
projection?: DataProjection | null;
|
|
12
|
+
scene?: ProjectedDocumentNode;
|
|
13
|
+
geometryKey?: string;
|
|
14
|
+
isGeometryCurrent?: () => boolean;
|
|
11
15
|
camera?: WorkspaceCamera;
|
|
12
16
|
zoom?: number;
|
|
13
17
|
act: Act;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DesignDocument } from '../../document/contracts.js';
|
|
2
|
+
import type { DesignClipboardRelationshipMaps, DesignClipboardWithRelationships } from './clipboardTransfer.js';
|
|
3
|
+
import type { ClipboardPrototypeFlowPolicy } from './clipboardPrototype.js';
|
|
4
|
+
|
|
5
|
+
export interface ClipboardRelationshipChoice {
|
|
6
|
+
relationships: DesignClipboardRelationshipMaps;
|
|
7
|
+
flowPolicy: ClipboardPrototypeFlowPolicy;
|
|
8
|
+
}
|
|
9
|
+
export interface ClipboardRelationshipDialogProps {
|
|
10
|
+
document: DesignDocument;
|
|
11
|
+
payload: DesignClipboardWithRelationships;
|
|
12
|
+
error?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
onChoiceChange?(): void;
|
|
15
|
+
onConfirm(choice: ClipboardRelationshipChoice): void;
|
|
16
|
+
onCancel(): void;
|
|
17
|
+
}
|
|
18
|
+
/** Internal default for validated pastes that need no naming or destination decision. */
|
|
19
|
+
export declare function defaultClipboardRelationshipChoice(document: DesignDocument, payload: DesignClipboardWithRelationships): ClipboardRelationshipChoice;
|
|
20
|
+
/** Collects explicit relationship decisions. Only the caller may validate and commit a paste. */
|
|
21
|
+
export declare function ClipboardRelationshipDialog(props: ClipboardRelationshipDialogProps): import("react").JSX.Element | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ProjectedDocumentNode } from './projection.js';
|
|
1
2
|
import type { DataProjection } from '../../binding/preview.js';
|
|
2
3
|
import type { DesignDocument, DocumentTransaction } from '../../document/contracts.js';
|
|
3
4
|
import { type PrototypeConnectionSelection } from './prototypeWiringModel.js';
|
|
@@ -8,6 +9,9 @@ export interface PrototypeWiringProps {
|
|
|
8
9
|
selected: readonly string[];
|
|
9
10
|
projection: DataProjection | null;
|
|
10
11
|
zoom: number;
|
|
12
|
+
scene?: ProjectedDocumentNode;
|
|
13
|
+
geometryKey?: string;
|
|
14
|
+
isGeometryCurrent?: () => boolean;
|
|
11
15
|
visibleRootIds?: readonly string[];
|
|
12
16
|
selectedConnection: PrototypeConnectionSelection | null;
|
|
13
17
|
onSelectConnection(value: PrototypeConnectionSelection | null): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DataProjection } from '../../binding/preview.js';
|
|
2
2
|
import type { DesignDocument, DocumentTransaction } from '../../document/contracts.js';
|
|
3
|
+
import type { ProjectedDocumentNode } from './projection.js';
|
|
3
4
|
import { type LayerPlacement, type SnapGuide } from './geometryHandles.js';
|
|
4
5
|
|
|
5
6
|
type Act = (label: string, apply: (transaction: DocumentTransaction) => void) => boolean;
|
|
@@ -11,6 +12,11 @@ export interface SelectionHandlesProps {
|
|
|
11
12
|
selected: readonly string[];
|
|
12
13
|
visibleRootIds?: readonly string[];
|
|
13
14
|
projection: DataProjection | null;
|
|
15
|
+
scene?: ProjectedDocumentNode;
|
|
16
|
+
/** Measurement/provider lifetime, including changes that return to the same screen. */
|
|
17
|
+
geometryKey?: string;
|
|
18
|
+
/** Synchronous owner check, captured at gesture start and checked before committing. */
|
|
19
|
+
isGeometryCurrent?: () => boolean;
|
|
14
20
|
/** Canvas scale; handles keep a constant screen size and snapping a constant screen tolerance. */
|
|
15
21
|
zoom: number;
|
|
16
22
|
act: Act;
|
|
@@ -41,15 +47,17 @@ export declare const SELECTION_BOX_ID = "selection";
|
|
|
41
47
|
* mirroring layer arrangement. The dimension badge follows the live world bounds without
|
|
42
48
|
* applying its own document changes.
|
|
43
49
|
*/
|
|
44
|
-
export declare function SelectionHandles({ document, selected, visibleRootIds, projection, zoom, act, movePreview, movePreviews, onPreview, onPreviewMany }: SelectionHandlesProps): import("react").JSX.Element;
|
|
50
|
+
export declare function SelectionHandles({ document, selected, visibleRootIds, projection, scene, geometryKey, isGeometryCurrent, zoom, act, movePreview, movePreviews, onPreview, onPreviewMany }: SelectionHandlesProps): import("react").JSX.Element;
|
|
45
51
|
/**
|
|
46
52
|
* Inspector section: the geometry policy for the whole selection, plus parent-relative rotation
|
|
47
53
|
* in degrees and resize constraints when exactly one layer is selected.
|
|
48
54
|
*/
|
|
49
|
-
export declare function LayerGeometryInspector({ document, selected, projection, act, compact }: {
|
|
55
|
+
export declare function LayerGeometryInspector({ document, selected, projection, scene, isGeometryCurrent, act, compact }: {
|
|
50
56
|
document: DesignDocument;
|
|
51
57
|
selected: readonly string[];
|
|
52
58
|
projection: DataProjection | null;
|
|
59
|
+
scene?: ProjectedDocumentNode;
|
|
60
|
+
isGeometryCurrent?: () => boolean;
|
|
53
61
|
act: Act;
|
|
54
62
|
compact?: boolean;
|
|
55
63
|
}): import("react").JSX.Element | null;
|
|
@@ -3,6 +3,7 @@ import type { DataProjection } from '../../binding/preview.js';
|
|
|
3
3
|
import type { DesignDocument, DocumentNode, DocumentTransaction } from '../../document/contracts.js';
|
|
4
4
|
import { type VectorAnchor, type VectorAnchorAddress, type VectorBooleanOperation, type VectorProperties, type VectorShape } from '../../document/vector.js';
|
|
5
5
|
import { type VectorAnchorAction, type VectorAnchorActions, type VectorBooleanPlan, type VectorEditPlan, type VectorStyle, type VectorTool } from './vectorTools.js';
|
|
6
|
+
import type { ProjectedDocumentNode } from './projection.js';
|
|
6
7
|
|
|
7
8
|
type Act = (label: string, apply: (transaction: DocumentTransaction) => void) => boolean;
|
|
8
9
|
/** Box geometry a canvas gesture is previewing for one layer; the surface draws it instead of the stored path. */
|
|
@@ -13,6 +14,12 @@ export interface VectorGeometryPreview {
|
|
|
13
14
|
export interface VectorEditingSession {
|
|
14
15
|
readonly document: DesignDocument;
|
|
15
16
|
readonly projection: DataProjection | null;
|
|
17
|
+
/** The same disposable measured scene rendered by the canvas. */
|
|
18
|
+
readonly scene?: ProjectedDocumentNode;
|
|
19
|
+
readonly geometryKey?: string;
|
|
20
|
+
/** Captured at gesture start and checked again before any document command. */
|
|
21
|
+
readonly isGeometryCurrent?: () => boolean;
|
|
22
|
+
readonly visibleRootIds?: readonly string[];
|
|
16
23
|
readonly selection: readonly string[];
|
|
17
24
|
readonly tool: VectorTool;
|
|
18
25
|
setTool(tool: VectorTool): void;
|
|
@@ -42,6 +49,10 @@ export interface VectorEditingInput {
|
|
|
42
49
|
document: DesignDocument;
|
|
43
50
|
selection: readonly string[];
|
|
44
51
|
projection: DataProjection | null;
|
|
52
|
+
scene?: ProjectedDocumentNode;
|
|
53
|
+
geometryKey?: string;
|
|
54
|
+
isGeometryCurrent?: () => boolean;
|
|
55
|
+
visibleRootIds?: readonly string[];
|
|
45
56
|
act: Act;
|
|
46
57
|
select(id: string): void;
|
|
47
58
|
}
|
|
@@ -67,7 +78,7 @@ export declare function VectorNodeSurface({ node, width, height, vector }: {
|
|
|
67
78
|
* The returned `toolbar` and `inspector` are ready to mount; the canvas mounts `VectorEditor`
|
|
68
79
|
* with the same session inside the stage.
|
|
69
80
|
*/
|
|
70
|
-
export declare function useVectorEditing({ document, selection, projection, act, select }: VectorEditingInput): VectorEditing;
|
|
81
|
+
export declare function useVectorEditing({ document, selection, projection, scene, geometryKey, isGeometryCurrent, visibleRootIds, act, select }: VectorEditingInput): VectorEditing;
|
|
71
82
|
/**
|
|
72
83
|
* Canvas overlay inside the scaled stage. With the pen tool it covers the stage and turns
|
|
73
84
|
* clicks into anchors (a click on the first anchor closes the path, Enter finishes an open
|
|
@@ -15,6 +15,7 @@ export interface DesignClipboard {
|
|
|
15
15
|
/** Copies owned subtrees and the transitive component definitions they reference. */
|
|
16
16
|
export declare function copyDesignSubtrees(document: DesignDocument, selection: readonly string[]): DesignClipboard;
|
|
17
17
|
export declare function serializeDesignClipboard(payload: DesignClipboard): string;
|
|
18
|
+
export declare function designClipboardDocument(payload: DesignClipboard): DesignDocument;
|
|
18
19
|
export declare function parseDesignClipboard(serialized: string): DesignClipboard;
|
|
19
20
|
export interface PasteDesignResult {
|
|
20
21
|
document: DesignDocument;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DesignDocument, DocumentNode } from '../../document/contracts.js';
|
|
2
|
+
export interface ClipboardGraph {
|
|
3
|
+
roots: string[];
|
|
4
|
+
nodes: DocumentNode[];
|
|
5
|
+
definitions: DocumentNode[];
|
|
6
|
+
includedNodeIds: string[];
|
|
7
|
+
}
|
|
8
|
+
/** Shared structural closure for a validated source; relationship planners use these exact IDs. */
|
|
9
|
+
export declare function collectClipboardGraph(document: DesignDocument, selection: readonly string[]): ClipboardGraph;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { DesignDocument } from '../../document/contracts.js';
|
|
2
|
+
import { type PrototypeDocument, type PrototypeFlow, type PrototypeInteraction, type PrototypeVariable } from '../../document/prototype.js';
|
|
3
|
+
export type ClipboardPrototypeFlowPolicy = 'selected-starts' | 'none';
|
|
4
|
+
export type ClipboardPrototypeDestinationKind = 'navigate' | 'change-to' | 'open-overlay' | 'swap-overlay' | 'scroll-to';
|
|
5
|
+
export interface ClipboardPrototypeOwner {
|
|
6
|
+
readonly nodeId: string;
|
|
7
|
+
readonly targetNodeId: string;
|
|
8
|
+
/** Opaque source address; structural clipboard code remaps it through the component graph. */
|
|
9
|
+
readonly overrideAddress?: string;
|
|
10
|
+
readonly interactions: readonly PrototypeInteraction[];
|
|
11
|
+
}
|
|
12
|
+
export interface ClipboardPrototypeData {
|
|
13
|
+
readonly version: 1;
|
|
14
|
+
readonly includedNodeIds: readonly string[];
|
|
15
|
+
readonly copiedRoots: readonly string[];
|
|
16
|
+
readonly flowPolicy: ClipboardPrototypeFlowPolicy;
|
|
17
|
+
readonly owners: readonly ClipboardPrototypeOwner[];
|
|
18
|
+
readonly variables: readonly PrototypeVariable[];
|
|
19
|
+
readonly flows: readonly PrototypeFlow[];
|
|
20
|
+
readonly externalNodes: readonly {
|
|
21
|
+
readonly nodeId: string;
|
|
22
|
+
readonly kinds: readonly ClipboardPrototypeDestinationKind[];
|
|
23
|
+
}[];
|
|
24
|
+
}
|
|
25
|
+
export interface ClipboardPrototypeMaps {
|
|
26
|
+
readonly nodeIds: Readonly<Record<string, string>>;
|
|
27
|
+
readonly externalNodeIds: Readonly<Record<string, string>>;
|
|
28
|
+
readonly variableIds: Readonly<Record<string, string>>;
|
|
29
|
+
readonly flowIds: Readonly<Record<string, string>>;
|
|
30
|
+
readonly variableNames?: Readonly<Record<string, string>>;
|
|
31
|
+
}
|
|
32
|
+
export interface ClipboardPrototypeTransferPlan {
|
|
33
|
+
readonly prototype: PrototypeDocument;
|
|
34
|
+
readonly owners: readonly {
|
|
35
|
+
readonly sourceNodeId: string;
|
|
36
|
+
readonly sourceOverrideAddress?: string;
|
|
37
|
+
readonly nodeId: string;
|
|
38
|
+
readonly targetNodeId: string;
|
|
39
|
+
readonly interactions: readonly PrototypeInteraction[];
|
|
40
|
+
}[];
|
|
41
|
+
readonly nodeIds: Readonly<Record<string, string>>;
|
|
42
|
+
readonly externalNodeIds: Readonly<Record<string, string>>;
|
|
43
|
+
readonly variableIds: Readonly<Record<string, string>>;
|
|
44
|
+
readonly flowIds: Readonly<Record<string, string>>;
|
|
45
|
+
/** Source-wide presentation settings are intentionally not imported with a selection. */
|
|
46
|
+
readonly settingsPolicy: 'preserve-target';
|
|
47
|
+
}
|
|
48
|
+
/** The root collector supplies the exact structural/definition closure; this helper never adds nodes. */
|
|
49
|
+
export declare function collectClipboardPrototype(sourceInput: DesignDocument, includedNodeIdsInput: readonly string[], copiedRootsInput: readonly string[], options: {
|
|
50
|
+
flowPolicy: ClipboardPrototypeFlowPolicy;
|
|
51
|
+
}): ClipboardPrototypeData;
|
|
52
|
+
/** Validates untrusted serialized relationships without consulting or changing a document. */
|
|
53
|
+
export declare function validateClipboardPrototypeClosure(input: unknown): ClipboardPrototypeData;
|
|
54
|
+
/** Pure relationship plan for an already allocated structural candidate; callers commit atomically. */
|
|
55
|
+
export declare function planClipboardPrototypeTransfer(dataInput: ClipboardPrototypeData, targetInput: DesignDocument, mapsInput: ClipboardPrototypeMaps): ClipboardPrototypeTransferPlan;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { DesignDocument, DocumentDiagnostic } from '../../document/contracts.js';
|
|
2
|
+
import { type StylesMetadata, type StyleSlot } from '../../document/styles.js';
|
|
3
|
+
import { type AssetStore } from '../../document/assets.js';
|
|
4
|
+
export interface ClipboardStyleReference {
|
|
5
|
+
nodeId: string;
|
|
6
|
+
overrideAddress?: string;
|
|
7
|
+
slot: StyleSlot;
|
|
8
|
+
styleId: string;
|
|
9
|
+
}
|
|
10
|
+
/** Only the style-owned closure. Graph selection and other sidecar guards belong to the clipboard coordinator. */
|
|
11
|
+
export interface ClipboardStyleClosure {
|
|
12
|
+
sourceDocumentId: string;
|
|
13
|
+
includedNodeIds: string[];
|
|
14
|
+
styleReferences: ClipboardStyleReference[];
|
|
15
|
+
metadata: StylesMetadata;
|
|
16
|
+
assets: AssetStore;
|
|
17
|
+
}
|
|
18
|
+
export interface ClipboardStyleOptions {
|
|
19
|
+
/** Complete source-style to destination-style mapping; no identity or name guessing. */
|
|
20
|
+
styleIds: Readonly<Record<string, string>>;
|
|
21
|
+
/** When present, declares the destination name for every source style. */
|
|
22
|
+
names?: Readonly<Record<string, string>>;
|
|
23
|
+
/** Source style IDs explicitly authorized to reuse an identical destination style. */
|
|
24
|
+
reuse?: readonly string[];
|
|
25
|
+
}
|
|
26
|
+
export interface ClipboardStyleDiagnostic extends DocumentDiagnostic {
|
|
27
|
+
styleId?: string;
|
|
28
|
+
targetStyleId?: string;
|
|
29
|
+
libraryId?: string;
|
|
30
|
+
}
|
|
31
|
+
export type ClipboardStylePlan = {
|
|
32
|
+
ok: true;
|
|
33
|
+
metadata: StylesMetadata;
|
|
34
|
+
assets: AssetStore;
|
|
35
|
+
styleIds: Record<string, string>;
|
|
36
|
+
targetFingerprint: string;
|
|
37
|
+
} | {
|
|
38
|
+
ok: false;
|
|
39
|
+
diagnostics: ClipboardStyleDiagnostic[];
|
|
40
|
+
};
|
|
41
|
+
/** Reads own properties and every declared opaque override address, including inactive component overrides. */
|
|
42
|
+
export declare function collectClipboardStyles(sourceInput: DesignDocument, includedNodeIdsInput: readonly string[]): ClipboardStyleClosure;
|
|
43
|
+
/** Validates serialized style-owned data; the coordinator additionally compares the references with its node payload. */
|
|
44
|
+
export declare function validateClipboardStylesClosure(input: unknown): ClipboardStyleDiagnostic[];
|
|
45
|
+
/** Pure merge plan. Existing target styles and consumers are never updated by a clipboard operation. */
|
|
46
|
+
export declare function planClipboardStyles(targetInput: DesignDocument, closureInput: ClipboardStyleClosure, optionsInput: ClipboardStyleOptions): ClipboardStylePlan;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { DesignDocument, DocumentTransaction } from '../../document/contracts.js';
|
|
2
|
+
import { pasteDesignSubtrees, type DesignClipboard, type PasteDesignResult } from './clipboard.js';
|
|
3
|
+
import { type ClipboardStyleClosure, type ClipboardStyleOptions } from './clipboardStyles.js';
|
|
4
|
+
import { type ClipboardPrototypeData, type ClipboardPrototypeFlowPolicy, type ClipboardPrototypeMaps } from './clipboardPrototype.js';
|
|
5
|
+
export interface DesignClipboardWithRelationships extends Omit<DesignClipboard, 'version'> {
|
|
6
|
+
version: 2;
|
|
7
|
+
relationships: {
|
|
8
|
+
styles: ClipboardStyleClosure;
|
|
9
|
+
prototype: ClipboardPrototypeData;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export type DesignTransferClipboard = DesignClipboard | DesignClipboardWithRelationships;
|
|
13
|
+
export interface DesignClipboardRelationshipMaps {
|
|
14
|
+
styles: ClipboardStyleOptions;
|
|
15
|
+
prototype: Omit<ClipboardPrototypeMaps, 'nodeIds'>;
|
|
16
|
+
}
|
|
17
|
+
export interface DesignTransferPasteResult extends PasteDesignResult {
|
|
18
|
+
targetFingerprint: string;
|
|
19
|
+
styleIds: Readonly<Record<string, string>>;
|
|
20
|
+
variableIds: Readonly<Record<string, string>>;
|
|
21
|
+
flowIds: Readonly<Record<string, string>>;
|
|
22
|
+
externalNodeIds: Readonly<Record<string, string>>;
|
|
23
|
+
settingsPolicy: 'preserve-target';
|
|
24
|
+
}
|
|
25
|
+
/** Opt-in owned relationship transfer. Legacy copy retains its existing refusal boundary. */
|
|
26
|
+
export declare function copyDesignSubtreesWithRelationships(documentInput: DesignDocument, selectionInput: readonly string[], options: {
|
|
27
|
+
flowPolicy: ClipboardPrototypeFlowPolicy;
|
|
28
|
+
}): DesignTransferClipboard;
|
|
29
|
+
export declare function serializeDesignClipboardWithRelationships(payload: DesignTransferClipboard): string;
|
|
30
|
+
export declare function parseDesignClipboardWithRelationships(text: string): DesignTransferClipboard;
|
|
31
|
+
/** A reviewed paste may explicitly omit copied flow starts; absent source flows cannot be inferred. */
|
|
32
|
+
export declare function withDesignClipboardFlowPolicy(payload: DesignClipboardWithRelationships, flowPolicy: ClipboardPrototypeFlowPolicy): DesignClipboardWithRelationships;
|
|
33
|
+
/** Captures every caller input before allocation and returns one complete document transaction. */
|
|
34
|
+
export declare function pasteDesignSubtreesWithRelationships(targetInput: DesignDocument, payloadInput: DesignTransferClipboard, options: Parameters<typeof pasteDesignSubtrees>[2] & {
|
|
35
|
+
relationships?: DesignClipboardRelationshipMaps;
|
|
36
|
+
}): DesignTransferPasteResult;
|
|
37
|
+
/** New relationship plans must be applied against the exact target that was reviewed. */
|
|
38
|
+
export declare function applyDesignTransferPaste(transaction: Pick<DocumentTransaction, 'replaceDocument'>, current: DesignDocument, plan: DesignTransferPasteResult): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DataProjection } from '../../binding/preview.js';
|
|
2
2
|
import type { DesignDocument, DocumentNode } from '../../document/contracts.js';
|
|
3
3
|
import { type VectorShape } from '../../document/vector.js';
|
|
4
|
+
import { type ProjectedDocumentNode } from './projection.js';
|
|
4
5
|
export interface CanvasBox {
|
|
5
6
|
x: number;
|
|
6
7
|
y: number;
|
|
@@ -13,7 +14,11 @@ export interface CanvasEntry {
|
|
|
13
14
|
topLevel: boolean;
|
|
14
15
|
}
|
|
15
16
|
export type DrawingTool = 'frame' | 'text' | VectorShape;
|
|
16
|
-
|
|
17
|
+
/** A selected definition descendant keeps its shared root visible without exposing inactive pages. */
|
|
18
|
+
export declare function selectedSharedRootIds(document: DesignDocument, selected: readonly string[]): readonly string[];
|
|
19
|
+
export declare function canvasEntries(document: DesignDocument, projection: DataProjection | null, selected?: readonly string[], visibleRootIds?: readonly string[], scene?: ProjectedDocumentNode): CanvasEntry[];
|
|
20
|
+
/** A mixed unavailable/preparing scene must not finalize a fit using partial bounds. */
|
|
21
|
+
export declare function canvasGeometryReady(scene: ProjectedDocumentNode): boolean;
|
|
17
22
|
export declare function canvasBounds(entries: readonly CanvasEntry[]): CanvasBox;
|
|
18
23
|
export declare function marqueeSelection(document: DesignDocument, entries: readonly CanvasEntry[], box: CanvasBox): readonly string[];
|
|
19
24
|
export declare function drawingBox(start: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DataProjection } from '../../binding/preview.js';
|
|
2
2
|
import type { DesignDocument, DocumentDiagnostic, DocumentMatrix, DocumentNodeConstraints, DocumentTransaction } from '../../document/contracts.js';
|
|
3
3
|
import { documentTransformedBounds } from '../../document/geometry.js';
|
|
4
|
+
import { type ProjectedDocumentNode } from './projection.js';
|
|
4
5
|
/**
|
|
5
6
|
* Pure geometry for the selection handles: which layers may be edited on the
|
|
6
7
|
* canvas, how a handle drag becomes a new size and placement, how a rotation
|
|
@@ -36,6 +37,15 @@ export interface LayerGeometry extends LayerPlacement {
|
|
|
36
37
|
readonly width: boolean;
|
|
37
38
|
readonly height: boolean;
|
|
38
39
|
};
|
|
40
|
+
/** Canonical sizes are retained even when the disposable scene derives an axis. */
|
|
41
|
+
readonly authoredSize?: {
|
|
42
|
+
readonly width: number;
|
|
43
|
+
readonly height: number;
|
|
44
|
+
};
|
|
45
|
+
readonly derivedAxes?: {
|
|
46
|
+
readonly width: boolean;
|
|
47
|
+
readonly height: boolean;
|
|
48
|
+
};
|
|
39
49
|
readonly notes: readonly DocumentDiagnostic[];
|
|
40
50
|
readonly constraints: DocumentNodeConstraints | undefined;
|
|
41
51
|
/** Constraints only act inside a free-placement container that can itself be resized. */
|
|
@@ -95,6 +105,8 @@ export interface SnapResult {
|
|
|
95
105
|
readonly guides: readonly SnapGuide[];
|
|
96
106
|
}
|
|
97
107
|
export interface SnapCandidateOptions {
|
|
108
|
+
/** The same disposable final scene used by the canvas, including measured text. */
|
|
109
|
+
readonly scene?: ProjectedDocumentNode;
|
|
98
110
|
/** Ordinary root layers visible on the current page; undefined retains the complete scene. */
|
|
99
111
|
readonly visibleRootIds?: readonly string[];
|
|
100
112
|
/** Include the moving layers' own children: right for a resize, wrong for a move (the children travel along). */
|
|
@@ -226,6 +238,6 @@ export declare function snapMove(session: MoveSnapSession, delta: {
|
|
|
226
238
|
* uses `resize` so child constraints apply, a placement change uses `move`, and a rotation
|
|
227
239
|
* replaces the transform. Nothing is issued when the placement is unchanged.
|
|
228
240
|
*/
|
|
229
|
-
export declare function applyLayerPlacement(transaction: DocumentTransaction, nodeId: string, before: LayerPlacement, after: LayerPlacement): boolean;
|
|
241
|
+
export declare function applyLayerPlacement(transaction: DocumentTransaction, nodeId: string, before: LayerPlacement & Pick<LayerGeometry, 'authoredSize' | 'derivedAxes' | 'resizeAxes'>, after: LayerPlacement): boolean;
|
|
230
242
|
/** Commit every member of a selection gesture in the caller's transaction; true when any layer changed. */
|
|
231
243
|
export declare function applySelectionPlacements(transaction: DocumentTransaction, layers: readonly LayerGeometry[], placements: readonly SelectionPlacement[]): boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DataProjection } from '../../binding/preview.js';
|
|
2
2
|
import type { DesignDocument, DocumentDiagnostic, DocumentEngineOptions, DocumentTransaction } from '../../document/contracts.js';
|
|
3
|
+
import { type ProjectedDocumentNode } from './projection.js';
|
|
3
4
|
export type DocumentLayerArrangement = 'align-left' | 'align-center-x' | 'align-right' | 'align-top' | 'align-center-y' | 'align-bottom' | 'distribute-horizontal' | 'distribute-vertical';
|
|
4
5
|
export interface DocumentLayerArrangementRequest {
|
|
5
6
|
nodeIds: readonly string[];
|
|
@@ -7,6 +8,8 @@ export interface DocumentLayerArrangementRequest {
|
|
|
7
8
|
}
|
|
8
9
|
export interface DocumentLayerArrangementOptions extends Pick<DocumentEngineOptions, 'preflight'> {
|
|
9
10
|
projection?: DataProjection | null;
|
|
11
|
+
scene?: ProjectedDocumentNode;
|
|
12
|
+
visibleRootIds?: readonly string[];
|
|
10
13
|
}
|
|
11
14
|
export interface ReadyDocumentLayerArrangement {
|
|
12
15
|
readonly status: 'ready';
|
|
@@ -36,4 +39,4 @@ export type DocumentLayerArrangementPlan = ReadyDocumentLayerArrangement | {
|
|
|
36
39
|
*/
|
|
37
40
|
export declare function planDocumentLayerArrangement(document: DesignDocument, request: DocumentLayerArrangementRequest, options?: DocumentLayerArrangementOptions): DocumentLayerArrangementPlan;
|
|
38
41
|
/** Run as the only move batch in one live transaction; let validation errors roll it back. */
|
|
39
|
-
export declare function applyDocumentLayerArrangement(transaction: DocumentTransaction, plan: ReadyDocumentLayerArrangement, currentDocument: DesignDocument, projection?: DataProjection | null): void;
|
|
42
|
+
export declare function applyDocumentLayerArrangement(transaction: DocumentTransaction, plan: ReadyDocumentLayerArrangement, currentDocument: DesignDocument, projection?: DataProjection | null, scene?: ProjectedDocumentNode): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { TextFontFaceRequest } from '../../document/richText.js';
|
|
2
|
+
import type { TextFontPreparationRuntime } from './textFontRuntime.js';
|
|
3
|
+
export interface PreparedTextFaceReference {
|
|
4
|
+
readonly environmentId: string;
|
|
5
|
+
readonly faceId: string;
|
|
6
|
+
readonly family: string;
|
|
7
|
+
readonly weight: number;
|
|
8
|
+
readonly style: 'normal' | 'italic';
|
|
9
|
+
readonly sample: string;
|
|
10
|
+
}
|
|
11
|
+
/** The owner maps its exact prepared identity to the same FontFace object registered for drawing. */
|
|
12
|
+
export type PreparedTextFaceResolver = (reference: PreparedTextFaceReference) => FontFace | undefined;
|
|
13
|
+
/** Registered face descriptors must support the requested style and weight without synthesis. */
|
|
14
|
+
export declare function supportsPreparedTextFace(face: Pick<FontFace, 'family' | 'style' | 'weight' | 'stretch' | 'status'>, family: string, request: TextFontFaceRequest): boolean;
|
|
15
|
+
/** Registered unicode-range restrictions are distinct from the provider's glyph-coverage attestation. */
|
|
16
|
+
export declare function preparedTextFaceCoversSample(unicodeRange: string, sample: string): boolean;
|
|
17
|
+
export interface PreparedBrowserTextFace {
|
|
18
|
+
readonly reference: PreparedTextFaceReference;
|
|
19
|
+
readonly face: FontFace;
|
|
20
|
+
readonly descriptor: string;
|
|
21
|
+
readonly owner: Document;
|
|
22
|
+
}
|
|
23
|
+
/** Revalidates the current browser registration even when preparation was served from a cache. */
|
|
24
|
+
export declare function prepareBrowserTextFace(font: TextFontFaceRequest, fontSize: number, runtime: TextFontPreparationRuntime, options: {
|
|
25
|
+
nodeId: string;
|
|
26
|
+
signal?: AbortSignal;
|
|
27
|
+
retry?: boolean;
|
|
28
|
+
ownerDocument?: Document;
|
|
29
|
+
resolvePreparedFace?: PreparedTextFaceResolver;
|
|
30
|
+
diagnosticPrefix?: string;
|
|
31
|
+
}): Promise<PreparedBrowserTextFace>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BindingRuntimeScope } from '../../binding/contracts.js';
|
|
2
2
|
import type { DataProjection } from '../../binding/preview.js';
|
|
3
|
-
import type { DesignDocument, DocumentNode, DocumentResolveOptions } from '../../document/contracts.js';
|
|
3
|
+
import type { DesignDocument, DocumentDiagnostic, DocumentNode, DocumentResolveOptions } from '../../document/contracts.js';
|
|
4
|
+
import type { TextLayoutSnapshot } from '../../document/textLayout.js';
|
|
4
5
|
export interface ProjectedDocumentNode {
|
|
5
6
|
sourceNodeId: string;
|
|
6
7
|
instanceId?: string;
|
|
@@ -9,6 +10,27 @@ export interface ProjectedDocumentNode {
|
|
|
9
10
|
rowPath: BindingRuntimeScope['rowPath'];
|
|
10
11
|
node: DocumentNode;
|
|
11
12
|
children: ProjectedDocumentNode[];
|
|
13
|
+
/** Disposable measured geometry; never serialized into the authored document. */
|
|
14
|
+
textLayout?: ProjectedTextLayout;
|
|
12
15
|
}
|
|
16
|
+
export interface ProjectedTextLayout {
|
|
17
|
+
readonly status: 'preparing' | 'ready' | 'unavailable' | 'failed';
|
|
18
|
+
readonly authoredSize: {
|
|
19
|
+
readonly width: number;
|
|
20
|
+
readonly height: number;
|
|
21
|
+
};
|
|
22
|
+
readonly derivedAxes: {
|
|
23
|
+
readonly width: boolean;
|
|
24
|
+
readonly height: boolean;
|
|
25
|
+
};
|
|
26
|
+
readonly diagnostics: readonly DocumentDiagnostic[];
|
|
27
|
+
readonly snapshot?: TextLayoutSnapshot;
|
|
28
|
+
/** Parent bounds may be fixed while unresolved layout changes its child placements. */
|
|
29
|
+
readonly childrenPending?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/** Fixed parent bounds remain usable; only derived size or unresolved ancestor placement is refused. */
|
|
32
|
+
export declare function projectedGeometryDiagnostics(item: ProjectedDocumentNode, ancestors?: readonly ProjectedDocumentNode[]): readonly DocumentDiagnostic[];
|
|
33
|
+
/** Reuses the canonical layout solver on a disposable scene, including repeated index addresses. */
|
|
34
|
+
export declare function reflowProjectedDocumentScene(scene: ProjectedDocumentNode): ProjectedDocumentNode;
|
|
13
35
|
/** Fixture rows affect this disposable scene only, never canonical document geometry. */
|
|
14
36
|
export declare function projectDocumentScene(document: DesignDocument, data: DataProjection | null, resolveOptions?: DocumentResolveOptions, resolveRowOptions?: (rowPath: BindingRuntimeScope['rowPath']) => DocumentResolveOptions): ProjectedDocumentNode;
|