@pygmalionjs/pygmalion 0.8.0 → 0.9.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.
Files changed (130) hide show
  1. package/binding-source.d.ts +25 -0
  2. package/dist-lib/{CameraLayer-nkNrazn8.js → CameraLayer-BdOko8XE.js} +17 -17
  3. package/dist-lib/pygmalion.js +24599 -12746
  4. package/dist-lib/{runtime-DdYnT6k4.js → runtime-Dxb-IaLN.js} +12427 -11116
  5. package/dist-lib/style.css +1 -1
  6. package/dist-lib/testing.js +10 -10
  7. package/dist-lib/types/binding/catalog.d.ts +10 -0
  8. package/dist-lib/types/binding/contracts.d.ts +202 -0
  9. package/dist-lib/types/binding/documentCommands.d.ts +38 -0
  10. package/dist-lib/types/binding/index.d.ts +6 -0
  11. package/dist-lib/types/binding/preview.d.ts +37 -0
  12. package/dist-lib/types/binding/source.d.ts +109 -0
  13. package/dist-lib/types/binding/useDataProjection.d.ts +9 -0
  14. package/dist-lib/types/binding/validate.d.ts +8 -0
  15. package/dist-lib/types/core/runtime.d.ts +6 -0
  16. package/dist-lib/types/document/appearance.d.ts +112 -0
  17. package/dist-lib/types/document/assets.d.ts +204 -0
  18. package/dist-lib/types/document/components.d.ts +169 -0
  19. package/dist-lib/types/document/contracts.d.ts +171 -0
  20. package/dist-lib/types/document/engine.d.ts +20 -0
  21. package/dist-lib/types/document/exportSettings.d.ts +45 -0
  22. package/dist-lib/types/document/geometry.d.ts +11 -0
  23. package/dist-lib/types/document/layout.d.ts +53 -0
  24. package/dist-lib/types/document/prototype.d.ts +424 -0
  25. package/dist-lib/types/document/prototypeReferences.d.ts +3 -0
  26. package/dist-lib/types/document/richText.d.ts +185 -0
  27. package/dist-lib/types/document/styles.d.ts +216 -0
  28. package/dist-lib/types/document/svgImport.d.ts +17 -0
  29. package/dist-lib/types/document/vector.d.ts +222 -0
  30. package/dist-lib/types/editor/designCompiler.d.ts +7 -0
  31. package/dist-lib/types/editor/designImport.d.ts +7 -0
  32. package/dist-lib/types/editor/inspect.d.ts +8 -0
  33. package/dist-lib/types/editor/revisionCatalogInstall.d.ts +1 -1
  34. package/dist-lib/types/editor/screenInteractions.d.ts +3 -3
  35. package/dist-lib/types/editor/store.d.ts +1 -1
  36. package/dist-lib/types/editor/surfaceDemands.d.ts +3 -1
  37. package/dist-lib/types/host/project.d.ts +44 -0
  38. package/dist-lib/types/host/registryConnections.d.ts +11 -0
  39. package/dist-lib/types/host/sourceFilePlan.d.ts +15 -0
  40. package/dist-lib/types/host/sourceWriteback.d.ts +50 -0
  41. package/dist-lib/types/lib.d.ts +101 -3
  42. package/dist-lib/types/token-library/bindings.d.ts +62 -0
  43. package/dist-lib/types/token-library/contracts.d.ts +117 -0
  44. package/dist-lib/types/token-library/engine.d.ts +13 -0
  45. package/dist-lib/types/workspace/WorkspaceShell.d.ts +9 -0
  46. package/dist-lib/types/workspace/application/ApplicationWorkspace.d.ts +3 -0
  47. package/dist-lib/types/workspace/configuration.d.ts +39 -0
  48. package/dist-lib/types/workspace/contracts.d.ts +64 -0
  49. package/dist-lib/types/workspace/controller.d.ts +35 -0
  50. package/dist-lib/types/workspace/documentSessions.d.ts +42 -0
  51. package/dist-lib/types/workspace/edit/AppearancePanel.d.ts +23 -0
  52. package/dist-lib/types/workspace/edit/ArrangeLayers.d.ts +10 -0
  53. package/dist-lib/types/workspace/edit/AssetsPanel.d.ts +16 -0
  54. package/dist-lib/types/workspace/edit/CanvasGuides.d.ts +19 -0
  55. package/dist-lib/types/workspace/edit/ComponentPanel.d.ts +11 -0
  56. package/dist-lib/types/workspace/edit/DataPanel.d.ts +16 -0
  57. package/dist-lib/types/workspace/edit/DesignWorkspace.d.ts +10 -0
  58. package/dist-lib/types/workspace/edit/LayerTree.d.ts +14 -0
  59. package/dist-lib/types/workspace/edit/LayoutPanel.d.ts +13 -0
  60. package/dist-lib/types/workspace/edit/PrototypePanel.d.ts +12 -0
  61. package/dist-lib/types/workspace/edit/ScopeTransferDialog.d.ts +40 -0
  62. package/dist-lib/types/workspace/edit/SelectionHandles.d.ts +52 -0
  63. package/dist-lib/types/workspace/edit/StylesPanel.d.ts +8 -0
  64. package/dist-lib/types/workspace/edit/TextEditor.d.ts +50 -0
  65. package/dist-lib/types/workspace/edit/VectorEditor.d.ts +89 -0
  66. package/dist-lib/types/workspace/edit/VectorToolbar.d.ts +5 -0
  67. package/dist-lib/types/workspace/edit/canvasGuideModel.d.ts +102 -0
  68. package/dist-lib/types/workspace/edit/clipboard.d.ts +35 -0
  69. package/dist-lib/types/workspace/edit/duplicateMetadata.d.ts +2 -0
  70. package/dist-lib/types/workspace/edit/geometryHandles.d.ts +224 -0
  71. package/dist-lib/types/workspace/edit/layerArrangement.d.ts +39 -0
  72. package/dist-lib/types/workspace/edit/layerMoves.d.ts +44 -0
  73. package/dist-lib/types/workspace/edit/projection.d.ts +12 -0
  74. package/dist-lib/types/workspace/edit/scopeTransfer.d.ts +96 -0
  75. package/dist-lib/types/workspace/edit/textStyles.d.ts +75 -0
  76. package/dist-lib/types/workspace/edit/vectorTools.d.ts +136 -0
  77. package/dist-lib/types/workspace/legacyModeAdapter.d.ts +13 -0
  78. package/dist-lib/types/workspace/source/ResponsiveLayoutPanel.d.ts +20 -0
  79. package/dist-lib/types/workspace/source/SourceReview.d.ts +11 -0
  80. package/dist-lib/types/workspace/source/appearanceSource.d.ts +19 -0
  81. package/dist-lib/types/workspace/source/compiler.d.ts +5 -0
  82. package/dist-lib/types/workspace/source/contracts.d.ts +156 -0
  83. package/dist-lib/types/workspace/source/controller.d.ts +50 -0
  84. package/dist-lib/types/workspace/source/documentRevision.d.ts +2 -0
  85. package/dist-lib/types/workspace/source/draftPreviewClient.d.ts +13 -0
  86. package/dist-lib/types/workspace/source/draftRecipe.d.ts +30 -0
  87. package/dist-lib/types/workspace/source/flowContracts.d.ts +72 -0
  88. package/dist-lib/types/workspace/source/prototypeSource.d.ts +4 -0
  89. package/dist-lib/types/workspace/source/responsive.d.ts +13 -0
  90. package/dist-lib/types/workspace/source/responsiveContracts.d.ts +78 -0
  91. package/dist-lib/types/workspace/source/structure.d.ts +21 -0
  92. package/dist-lib/types/workspace/source/textSource.d.ts +28 -0
  93. package/dist-lib/types/workspace/tokens/TokenLibraryContext.d.ts +11 -0
  94. package/dist-lib/types/workspace/tokens/TokenLibraryWorkspace.d.ts +14 -0
  95. package/dist-lib/types/workspace/tokens/contracts.d.ts +74 -0
  96. package/dist-lib/types/workspace/tokens/controller.d.ts +44 -0
  97. package/dist-lib/types/workspace/view/PrototypePlayer.d.ts +17 -0
  98. package/dist-lib/types/workspace/view/StoryboardWorkspace.d.ts +3 -0
  99. package/dist-lib/types/workspace/view/prototypePlayback.d.ts +46 -0
  100. package/draft-preview.d.ts +54 -0
  101. package/inspect.d.ts +2 -0
  102. package/node/design-session.mjs +3 -0
  103. package/node/inspect-plugin.mjs +3 -1
  104. package/node/inspect-writeback.mjs +18 -2
  105. package/node/preview-artifact-store.mjs +10 -7
  106. package/node/source-archive.mjs +88 -0
  107. package/node/source-bindings.mjs +65 -0
  108. package/node/source-file-lock.mjs +15 -0
  109. package/node/source-file-plan.mjs +162 -0
  110. package/node/source-file-proofs.mjs +44 -0
  111. package/node/source-responsive-codec.d.mts +17 -0
  112. package/node/source-responsive-codec.mjs +133 -0
  113. package/node/source-responsive.mjs +189 -0
  114. package/node/source-structure-reconcile.mjs +186 -0
  115. package/node/source-structure-wrapper-codec.d.mts +20 -0
  116. package/node/source-structure-wrapper-codec.mjs +205 -0
  117. package/node/source-structure.mjs +404 -0
  118. package/node/token-source-references.mjs +136 -0
  119. package/node/workspace-draft-preview-plugin.mjs +70 -0
  120. package/node/workspace-draft-preview.mjs +231 -0
  121. package/node/workspace-source-identity.d.mts +1 -0
  122. package/node/workspace-source-identity.mjs +21 -0
  123. package/node/workspace-source-plan.mjs +195 -0
  124. package/package.json +52 -6
  125. package/source-files.d.ts +35 -0
  126. package/source-responsive.d.ts +10 -0
  127. package/source-structure.d.ts +155 -0
  128. package/workspace-source-plan.d.ts +44 -0
  129. package/docs/coverage-contracts.md +0 -431
  130. package/docs/screen-state-contract.md +0 -252
@@ -0,0 +1,50 @@
1
+ import type { InspectApplyPayload } from '../editor/inspect.js';
2
+ import type { InspectApplyResult, InspectPreviewResult } from '../editor/host.js';
3
+ export type SourceWriteErrorCode = 'invalid-path' | 'empty-change' | 'excluded-source' | 'empty-diff' | 'unexpected-file' | 'missing-file' | 'review-required' | 'stale-preview' | 'busy' | 'not-applied';
4
+ export declare class SourceWriteError extends Error {
5
+ readonly code: SourceWriteErrorCode;
6
+ readonly path?: string;
7
+ constructor(code: SourceWriteErrorCode, message: string, path?: string);
8
+ }
9
+ export interface SourceWritePolicy {
10
+ /** Repository-owned recovery outputs that must never count as source changes. */
11
+ excludedSourcePrefixes?: readonly string[];
12
+ requireBranch?: boolean;
13
+ /** Optional workspace identity; a change invalidates a reviewed payload. */
14
+ scope?: () => string;
15
+ }
16
+ export interface InspectSourceRuntime {
17
+ previewVisual(payload: InspectApplyPayload): Promise<InspectPreviewResult>;
18
+ applyVisual(payload: InspectApplyPayload): Promise<InspectApplyResult>;
19
+ }
20
+ /** Payloads must be JSON-serializable. Each runtime call receives an independent snapshot. */
21
+ export interface ReviewedSourceOperationRuntime<TPayload> {
22
+ preview(payload: TPayload): Promise<InspectPreviewResult>;
23
+ apply(payload: TPayload): Promise<InspectApplyResult>;
24
+ }
25
+ export interface ReviewedSourceOperationFiles {
26
+ /** Existing inputs whose paths must satisfy the source policy, including read-only dependencies. */
27
+ proofFiles: readonly string[];
28
+ /** The only files this operation may change, including newly created files. */
29
+ changedFiles: readonly string[];
30
+ }
31
+ export interface ReviewedSourceOperationPolicy<TPayload> extends SourceWritePolicy {
32
+ /** A synchronous, side-effect-free declaration for the captured payload. */
33
+ files(payload: TPayload): ReviewedSourceOperationFiles;
34
+ /** Additional payload validation, run before preview and apply. */
35
+ validate?(payload: TPayload): void;
36
+ /** Require each changed file exactly once in both diffs and affectedFiles. Defaults to false. */
37
+ requireCompletePreview?: boolean;
38
+ }
39
+ export declare function inspectPayloadSourceFiles(payload: InspectApplyPayload): string[];
40
+ export declare function assertInspectSourcePayload(payload: InspectApplyPayload, policy?: SourceWritePolicy): void;
41
+ /** Review tickets are single-use and survive neither a new preview nor a workspace change. */
42
+ export declare function createReviewedSourceOperation<TPayload>(runtime: ReviewedSourceOperationRuntime<TPayload>, policy: ReviewedSourceOperationPolicy<TPayload>): {
43
+ preview: (payload: TPayload) => Promise<InspectPreviewResult>;
44
+ apply: (payload: TPayload) => Promise<InspectApplyResult>;
45
+ };
46
+ /** Compatibility adapter for visual Inspect payloads; unchanged files may be omitted from a preview. */
47
+ export declare function createReviewedSourceWriter(runtime: InspectSourceRuntime, policy?: SourceWritePolicy): {
48
+ preview: (payload: InspectApplyPayload) => Promise<InspectPreviewResult>;
49
+ apply: (payload: InspectApplyPayload) => Promise<InspectApplyResult>;
50
+ };
@@ -1,3 +1,72 @@
1
+ export * from './document/components.js';
2
+ export * from './token-library/bindings.js';
3
+ export { STYLE_KINDS, STYLE_SLOTS, STYLE_SLOT_KIND, STYLE_KIND_LABEL, STYLE_SLOT_LABEL, TEXT_STYLE_CHARACTER_KEYS, TEXT_STYLE_PARAGRAPH_KEYS, TEXT_STYLE_KEYS, StyleError, isStylePaint, isTextStyleValue, isStyleEffect, isStyleValue, isDesignStyle, isStylesMetadata, isStyleReferences, validateStyleLibrary, EMPTY_STYLES, documentStyles, documentStyle, documentStylesOfKind, nodeStyleReferences, styleSlotsFor, documentStyleDiagnostics, createStyle, renameStyle, describeStyle, setStyleValue, removeStyle, detachStyleFromLibrary, projectStyle, detachStyleReference, styleValueFromNode, styleConsumers, propagateStyle, applyStylePropagation, writeStyles, applyStylePatch, detachStylePatch, commitCreateStyle, commitStyleValue, commitRenameStyle, commitRemoveStyle, commitApplyStyle, commitDetachStyle, commitStyleFromNode, importLibraryStyle, planStyleLibraryUpdate, commitStyleLibraryUpdate, stylesDuplicateRemapper, STYLES_METADATA_KEY, STYLE_SIDECAR_PROPERTY_KEYS, stylesSourceDiagnostics } from './document/styles.js';
4
+ export type { StyleKind, StyleSlot, StylePaint, PaintStyleValue, TextStyleValue, StyleEffect, EffectStyleValue, GridStyleValue, StyleValue, StyleValueByKind, StyleOrigin, DesignStyle, StylesMetadata, StyleLibraryDocument, StyleReferences, StyleConsumer, StylePropagation, StyleLibraryChange, StyleLibraryUpdatePlan } from './document/styles.js';
5
+ export { componentOverrideTarget, remapComponentOverrideAddress } from './document/engine.js';
6
+ export { ComponentPanel } from './workspace/edit/ComponentPanel.js';
7
+ export type { ComponentPanelProps } from './workspace/edit/ComponentPanel.js';
8
+ export { StylesPanel } from './workspace/edit/StylesPanel.js';
9
+ export type { StylesPanelProps } from './workspace/edit/StylesPanel.js';
10
+ export { TokenLibraryProvider, useTokenLibraryController, useHasTokenLibraryProvider } from './workspace/tokens/TokenLibraryContext.js';
11
+ export { createTokenLibraryEngine, reopenTokenLibrary, validateTokenLibraryDocument, resolveTokenLibraryValue, tokenValueEditability, TokenLibraryValidationError } from './token-library/engine.js';
12
+ export type * from './token-library/contracts.js';
13
+ export type * from './workspace/tokens/contracts.js';
14
+ export { WorkspaceTokenLibraryController } from './workspace/tokens/controller.js';
15
+ export type { WorkspaceTokenLibraryState } from './workspace/tokens/controller.js';
16
+ export { createReviewedSourceOperation } from './host/sourceWriteback.js';
17
+ export type { ReviewedSourceOperationRuntime, ReviewedSourceOperationPolicy, ReviewedSourceOperationFiles } from './host/sourceWriteback.js';
18
+ export type { SourceFilePlan } from './host/sourceFilePlan.js';
19
+ export type { WorkspaceDraftPreviewClient } from './workspace/source/draftPreviewClient.js';
20
+ import { type PygmalionHostProject } from './host/project.js';
21
+ export { createPygmalionHostProject, createPygmalionRevisionCatalog, PYGMALION_HOST_PROJECT_VERSION, } from './host/project.js';
22
+ export type { PygmalionHostProject, PygmalionHostProjectDefinition, PygmalionHostStoryboard, PygmalionHostDesign, } from './host/project.js';
23
+ export { createDesignRegistryConnections } from './host/registryConnections.js';
24
+ export type { DesignRegistryInventoryEntry } from './host/registryConnections.js';
25
+ export { createReviewedSourceWriter, assertInspectSourcePayload, inspectPayloadSourceFiles, SourceWriteError, } from './host/sourceWriteback.js';
26
+ export type { InspectSourceRuntime, SourceWritePolicy, SourceWriteErrorCode } from './host/sourceWriteback.js';
27
+ export { WorkspaceController } from './workspace/controller.js';
28
+ export { createLegacyModeAdapter } from './workspace/legacyModeAdapter.js';
29
+ export type * from './workspace/contracts.js';
30
+ export { resolveWorkspaceTarget } from './workspace/configuration.js';
31
+ export type { WorkspaceConfiguration, WorkspaceTargetConfiguration } from './workspace/configuration.js';
32
+ export { compileWorkspaceVisualSource, workspaceSourceFingerprint } from './workspace/source/compiler.js';
33
+ export { compileWorkspaceDocumentSource, jsxStructureWrapperClassName } from './workspace/source/structure.js';
34
+ export { compileWorkspaceResponsiveSource, resolveResponsiveLayout, setResponsiveLayoutOverride } from './workspace/source/responsive.js';
35
+ export { describeResponsiveValueContract, responsiveRangePreviewWidth, sortResponsiveRanges } from './workspace/source/responsive.js';
36
+ export { useWorkspaceResponsiveViewport } from './workspace/source/ResponsiveLayoutPanel.js';
37
+ export type * from './workspace/source/responsiveContracts.js';
38
+ export type { WorkspaceDocumentSourceChanges } from './workspace/source/structure.js';
39
+ export { WorkspaceSourceReviewController } from './workspace/source/controller.js';
40
+ export { createWorkspaceDraftPreviewClient } from './workspace/source/draftPreviewClient.js';
41
+ export { runWorkspaceDraftRecipe, WorkspaceDraftRecipeError } from './workspace/source/draftRecipe.js';
42
+ export type { WorkspaceDraftDocumentContext, WorkspaceDraftRecipe, WorkspaceDraftRecipeOptions, WorkspaceDraftRecipeReport } from './workspace/source/draftRecipe.js';
43
+ export type * from './workspace/source/contracts.js';
44
+ export type * from './workspace/source/flowContracts.js';
45
+ export type { WorkspaceSourceReviewState } from './workspace/source/controller.js';
46
+ export * from './binding/index.js';
47
+ export { planScopeTransfer, resolveScopeTransfer, applyScopeTransfer } from './workspace/edit/scopeTransfer.js';
48
+ export type { ScopeTransferPlan, ScopeTransferDecisionPlan, ScopeTransferItem, ScopeTransferChoice, ScopeTransferDecision, ScopeTransferOptions, ResolvedScopeTransfer } from './workspace/edit/scopeTransfer.js';
49
+ export { planDocumentLayerMove, applyDocumentLayerMove, normalizeDocumentLayerSelection } from './workspace/edit/layerMoves.js';
50
+ export type { DocumentLayerMoveRequest, DocumentLayerMovePlan, DocumentLayerMoveOperation, ReadyDocumentLayerMove } from './workspace/edit/layerMoves.js';
51
+ export { TEXT_CHARACTER_KEYS, TEXT_PARAGRAPH_KEYS, TEXT_RESIZE_MODES, RICH_TEXT_CASES, RICH_TEXT_LISTS, RICH_TEXT_ALIGNMENTS, TEXT_PARAGRAPH_PROPERTY, TEXT_NODE_PROPERTY_KEYS, isTextLink, isTextResizeMode, isRichTextCharacterValue, isRichTextParagraphValue, isRichTextCharacterStyle, isRichTextParagraphStyle, isRichTextRun, isRichTextParagraph, isRichText, richTextPlain, richTextLength, richTextFromPlain, normalizeRichText, applyRichTextCharacterStyle, clearRichTextCharacterStyle, setRichTextParagraphStyle, clearRichTextParagraphStyle, richTextInheritedStyle, insertRichText, deleteRichText, replaceRichText, splitRichTextParagraph, mergeRichTextParagraphs, applyPlainTextEdit, richTextCharacterStyleAt, richTextParagraphStyleAt, richTextVaryingKeys, textNodeStyle, textResizeMode, textNodePlain, textNodeModel, isRichTextTrivial, hoistRichTextStyle, richTextValue, normalizeTextProperties, plainTextProperties, textFontRequirements, documentFontRequirements, textNodeFontRequirements, loadTextFonts, loadDocumentFonts, fontFaceSetLoader, } from './document/richText.js';
52
+ export type * from './document/richText.js';
53
+ export { VECTOR_SHAPES, VECTOR_BOOLEAN_OPERATIONS, VECTOR_FLATNESS, VECTOR_MERGE_DISTANCE, VECTOR_SIDE_SAMPLE, isVectorProperties, parseVector, serializeVector, vectorPathAnchors, vectorPathFromAnchors, vectorPathSegments, vectorBounds, transformVector, translateVector, vectorFitTransform, normalizeVectorOrigin, fitVectorNode, rectangleVector, ellipseVector, arcVector, lineVector, polygonVector, starVector, createShapeVector, roundVectorCorners, vectorPathData, vectorAnchorMode, moveVectorAnchor, moveVectorHandle, setVectorAnchorMode, insertVectorAnchor, deleteVectorAnchor, canSplitVectorPath, splitVectorPath, canJoinVectorPaths, joinVectorPaths, nearestVectorSegmentPoint, flattenVector, vectorContainsPoint, vectorArea, booleanRings, booleanVectors, booleanVectorPrecision, vectorRenderTransform, } from './document/vector.js';
54
+ export type * from './document/vector.js';
55
+ export { VectorEditor, VectorInspector, VectorNodeSurface, useVectorEditing } from './workspace/edit/VectorEditor.js';
56
+ export type { VectorEditing, VectorEditingInput, VectorEditingSession, VectorEditorProps, VectorGeometryPreview } from './workspace/edit/VectorEditor.js';
57
+ export { VectorToolbar } from './workspace/edit/VectorToolbar.js';
58
+ export { VECTOR_TOOLS, VECTOR_SHAPE_LABELS, VECTOR_BOOLEAN_LABELS, VECTOR_DEFAULT_FILL, VECTOR_DEFAULT_STROKE, VECTOR_NO_ANCHOR_ACTIONS, vectorNodeGeometry, vectorBoxGeometry, vectorRenderModel, vectorGeometryPatch, vectorStylePatch, renderedWorldTransform, vectorInsertParent, shapeInsertion, penClosesOnFirst, penPathNode, penDragAnchor, vectorAnchorsInBox, planVectorEdit, vectorAnchorActions, applyVectorAnchorAction, planVectorBoolean, vectorBooleanNode, vectorBooleanPrecision, applyVectorBoolean, vectorMaskClips, } from './workspace/edit/vectorTools.js';
59
+ export type { VectorTool, VectorAnchorAction, VectorStyle, VectorRenderModel, VectorEditTarget, VectorEditPlan, VectorAnchorActions, VectorAnchorActionResult, VectorBooleanPlan, VectorInsertion } from './workspace/edit/vectorTools.js';
60
+ export { richTextSourceDiagnostics, richTextSourceProjection, TEXT_SOURCE_MAPPED_PROPERTIES } from './workspace/source/textSource.js';
61
+ export type { RichTextSourceProjection } from './workspace/source/textSource.js';
62
+ export { TextEditor, TextInlineEditor, TextNodeSurface, useTextFontStatus } from './workspace/edit/TextEditor.js';
63
+ export type { TextEditorProps, TextInlineEditorProps } from './workspace/edit/TextEditor.js';
64
+ export { applyTextCharacterStyle, applyTextParagraphStyle, characterStyleCss, commitTextEdit, decorationCss, isBoundTextNode, paragraphStyleCss, richTextBlocks, setTextResize, textEditorModel, textResizeCss, textStyleTarget, textStyleValues, TEXT_ALIGN_OPTIONS, TEXT_CASE_OPTIONS, TEXT_FONT_WEIGHT_OPTIONS, TEXT_INDENT_STEP, TEXT_LIST_OPTIONS, TEXT_RESIZE_OPTIONS, } from './workspace/edit/textStyles.js';
65
+ export type { TextBlock, TextStyleTarget, TextStyleValues } from './workspace/edit/textStyles.js';
66
+ export * from './document/contracts.js';
67
+ export * from './document/geometry.js';
68
+ export { createDesignDocument, createDocumentNode, createDocumentEngine, reopenDesignDocument, resolveDocumentNode, projectDesignDocument, validateDesignDocument, DocumentValidationError, } from './document/engine.js';
69
+ import type { WorkspaceConfiguration } from './workspace/configuration.js';
1
70
  import type { DesignImportController, DesignImportInitialPage, DesignScenarioSource } from './editor/designImport.js';
2
71
  import type { ComponentRegistry } from './editor/registry.js';
3
72
  import type { DesignComponentConnectionDef } from './editor/componentConnections.js';
@@ -80,7 +149,7 @@ export { createStoryboardRouteScenarioId, createStoryboardGraphFromDiscovery, ge
80
149
  export type { LoadStoryboardDiscoveryOptions, StoryboardDiscoveryCandidate, StoryboardDiscoveryEdge, StoryboardDiscoveryGraphOptions, StoryboardDiscoveryManifest, StoryboardDiscoveryResult, StoryboardDiscoveryRoute, StoryboardDiscoveryScenario, StoryboardResolvedPage, } from './editor/storyboardDiscovery.js';
81
150
  export { createStoryboardGraphViewModel } from './editor/storyboardGraphView.js';
82
151
  export type { StoryboardFrameReference, StoryboardGraphCanonicalView, StoryboardGraphFrameView, StoryboardGraphSourceView, StoryboardGraphTransitionView, StoryboardGraphViewModel, } from './editor/storyboardGraphView.js';
83
- export { createStoryboardRouteUrl, mergeStoryboardEnvironment, STORYBOARD_ENVIRONMENT_CONTROL, STORYBOARD_ENVIRONMENT_QUERY, } from './editor/storyboardEnvironment.js';
152
+ export { createStoryboardRouteUrl, mergeStoryboardEnvironment, resolveStoryboardBootEnvironment, STORYBOARD_ENVIRONMENT_CONTROL, STORYBOARD_ENVIRONMENT_QUERY, } from './editor/storyboardEnvironment.js';
84
153
  export type { ApplyPayload, DesignChangePayload, DesignChangeResult, DesignCodeDocument, DesignElementChange, DesignElementDocument, DesignTokenDocument, InspectApplyResult, InspectImpactFrame, InspectImpactResult, InspectPreviewResult, } from './editor/host.js';
85
154
  export type { InspectApplyPayload, PrimitiveSourceValue, PrimitiveSourceValueType, SourceAffectedFrame, SourceEditOperation, SourceEditScope, SourceIdentity, SourceInsertComponent, } from './editor/inspect.js';
86
155
  export type { InspectQaArtifactHash, InspectQaCaptureRequest, InspectQaFailure, InspectQaFrameResult, InspectQaPixelDiff, InspectQaPixelDimensions, InspectQaResult, } from './editor/visualQa.js';
@@ -103,7 +172,9 @@ export type { SharedSourceEditScope, SharedSourceFrameSummary, SharedSourceImpac
103
172
  export type { NodeJSON } from './editor/store.js';
104
173
  export interface InitialPageDef extends DesignImportInitialPage {
105
174
  }
106
- export declare function PygmalionEditor({ runtime, registry, tokens, initialPages, initialCanvas, activeFramePersistenceKey, initialEditMode, componentConnections, codegenProject, codegenValidator, codegenValidationScope, viewportPresets, sessionPresets, previewEnvironmentControls, designImport, onTokensChange, appOrigin, previewRevision, previewCacheNamespace, previewArtifacts, previewConcurrency, previewOpen, onPreviewOpenChange, flowCanvas, frameSurface, captureSupply, screenFlows, screenFlowConcurrency, scenarioCoverage, screenDimensions, screenLists, sectionHeaders, sectionHeaderLabels, screenLanes, frameBranchKinds, frameLabelLabels, screenCards, liveScreenBudget, screenStateAxes, interactiveStates, surfaceClassifications, onApply, onDesignChange, onInspectApply, onInspectPreview, onInspectImpact, storyboard, storyboardScenarios, sessionStoryboards, storyboardDiscovery, }: {
175
+ export interface PygmalionEditorProps {
176
+ /** Host-owned inventory, storyboard, reproduction and design bindings. */
177
+ project?: PygmalionHostProject;
107
178
  /**
108
179
  * The runtime this editor renders. Create one with `createEditorRuntime()`
109
180
  * and keep it for the editor's lifetime; two editors on one page each take
@@ -129,6 +200,8 @@ export declare function PygmalionEditor({ runtime, registry, tokens, initialPage
129
200
  * once rather than re-asserting over whatever the designer picked.
130
201
  */
131
202
  initialEditMode?: 'edit' | 'view-only';
203
+ /** The redesigned workspaces use a canonical document and separate run state. */
204
+ workspace?: WorkspaceConfiguration;
132
205
  /** Explicit external-design to registered-code component mappings. */
133
206
  componentConnections?: readonly DesignComponentConnectionDef[];
134
207
  /**
@@ -323,4 +396,29 @@ export declare function PygmalionEditor({ runtime, registry, tokens, initialPage
323
396
  * environment service.
324
397
  */
325
398
  storyboardDiscovery?: boolean;
326
- }): import("react").JSX.Element;
399
+ }
400
+ export declare function PygmalionEditor(props: PygmalionEditorProps): import("react").JSX.Element;
401
+ export { applyLayout, layoutHugAxes, layoutProblem, layoutChildProblem, layoutChild, isAbsoluteLayoutChild, participatesInLayout } from './document/layout.js';
402
+ export type { LayoutSpec, LayoutChild, LayoutPlacement, LayoutResult } from './document/layout.js';
403
+ export { LayoutPanel } from './workspace/edit/LayoutPanel.js';
404
+ export type { LayoutPanelProps } from './workspace/edit/LayoutPanel.js';
405
+ export { CanvasGuides, CanvasGuidesPanel } from './workspace/edit/CanvasGuides.js';
406
+ export { nodeGuides, guidesPatch, nodeLayoutGrids, layoutGridsPatch, isCanvasGuide, isLayoutGrid, defaultLayoutGrid, rulerTicks, rulerScale } from './workspace/edit/canvasGuideModel.js';
407
+ export type { CanvasGuide, LayoutGrid, LayoutGridTracks, LayoutGridPixels } from './workspace/edit/canvasGuideModel.js';
408
+ export * from './document/appearance.js';
409
+ export { AppearancePanel, AppearanceSurface, AppearanceVectorSurface } from './workspace/edit/AppearancePanel.js';
410
+ export type { AppearancePanelProps } from './workspace/edit/AppearancePanel.js';
411
+ export * from './workspace/source/appearanceSource.js';
412
+ export { assetInteropSourceDeltaDiagnostics, ASSETS_METADATA_KEY, ASSET_STORE_VERSION, IMAGE_MEDIA_TYPES, IMAGE_SCALE_MODES, IMAGE_SCALE_MODE_LABELS, createImageAsset, createSvgAsset, documentAssets, resolveAsset, addAsset, removeAsset, renameAsset, mergeAssetStores, assetStoreDiagnostics, serializeAssetStore, writeDocumentAssets, addDocumentAsset, nodeImagePaints, nodeAssetIds, assetReferences, unusedAssetIds, pruneUnusedAssets, missingAssetIds, assetsDuplicateMetadata, assetSourceUrl, imagePaint, imagePaintCss, nodeImageCss, imageNode, isImageNode, importAssetFiles, assetsFromInventory } from './document/assets.js';
413
+ export type { DocumentAsset, ImageAsset, SvgAsset, AssetStore, ImageAssetInput, SvgAssetInput, AssetFileLike, InventoryAssetMedia, InventoryAssetEntry } from './document/assets.js';
414
+ export * from './document/svgImport.js';
415
+ export * from './document/exportSettings.js';
416
+ export * from './workspace/edit/clipboard.js';
417
+ export { AssetsPanel } from './workspace/edit/AssetsPanel.js';
418
+ export type { AssetsPanelProps } from './workspace/edit/AssetsPanel.js';
419
+ export * from './document/prototype.js';
420
+ export { remapPrototypeProperties } from './document/prototypeReferences.js';
421
+ export { PrototypePanel } from './workspace/edit/PrototypePanel.js';
422
+ export { PrototypePlayer } from './workspace/view/PrototypePlayer.js';
423
+ export type { PrototypePlayerProps } from './workspace/view/PrototypePlayer.js';
424
+ export * from './workspace/view/prototypePlayback.js';
@@ -0,0 +1,62 @@
1
+ import type { DesignDocument, DocumentDiagnostic, DocumentNode, DocumentNodePatch, DocumentTransaction, DocumentValue } from '../document/contracts.js';
2
+ import type { TokenLibraryDocument, TokenValueResolution } from './contracts.js';
3
+ export type VariableScalar = string | number | boolean;
4
+ export interface VariableBinding {
5
+ libraryId: string;
6
+ tokenId: string;
7
+ modeId?: string;
8
+ }
9
+ export type VariableBindings = Record<string, VariableBinding>;
10
+ export type VariableValueCodec = (library: TokenLibraryDocument, resolved: TokenValueResolution) => VariableScalar;
11
+ export interface VariableChange {
12
+ nodeId: string;
13
+ overrideAddress?: string;
14
+ property: string;
15
+ tokenId: string;
16
+ before: DocumentValue | undefined;
17
+ after: VariableScalar;
18
+ }
19
+ export interface VariableUpdatePlan {
20
+ documentFingerprint: string;
21
+ libraryId: string;
22
+ sourceRevision: string;
23
+ libraryFingerprint: string;
24
+ patches: {
25
+ nodeId: string;
26
+ overrideAddress?: string;
27
+ patch: DocumentNodePatch;
28
+ }[];
29
+ changes: VariableChange[];
30
+ diagnostics: DocumentDiagnostic[];
31
+ }
32
+ export declare const VARIABLE_TARGETS: {
33
+ readonly width: "number";
34
+ readonly height: "number";
35
+ readonly radius: "number";
36
+ readonly opacity: "number";
37
+ readonly fontSize: "number";
38
+ readonly fontWeight: "number";
39
+ readonly lineHeight: "number";
40
+ readonly letterSpacing: "number";
41
+ readonly text: "string";
42
+ readonly fontFamily: "string";
43
+ readonly fill: "string";
44
+ readonly color: "string";
45
+ readonly hidden: "boolean";
46
+ readonly clip: "boolean";
47
+ };
48
+ export type VariableTarget = keyof typeof VARIABLE_TARGETS;
49
+ export declare function isVariableBinding(value: unknown): value is VariableBinding;
50
+ export declare function nodeVariableBindings(node: Pick<DocumentNode, 'properties'>): VariableBindings;
51
+ /** Built-in values are JSON scalars. Other syntax remains the host codec's responsibility. */
52
+ export declare function resolveScalarVariable(library: TokenLibraryDocument, resolved: TokenValueResolution, seen?: Set<string>): VariableScalar;
53
+ export declare function variableModeForNode(document: DesignDocument, nodeId: string, library: TokenLibraryDocument, tokenId: string, explicit?: string): string;
54
+ export declare function variableTargetsForNode(node: DocumentNode): VariableTarget[];
55
+ export declare function bindVariablePatch(document: DesignDocument, nodeId: string, property: VariableTarget, library: TokenLibraryDocument, binding: VariableBinding, codec?: VariableValueCodec): DocumentNodePatch;
56
+ export declare function detachVariablePatch(node: DocumentNode, property: VariableTarget): DocumentNodePatch;
57
+ /** A refresh plan records all affected nodes before the caller commits one history entry. */
58
+ export declare function planVariableLibraryUpdate(document: DesignDocument, library: TokenLibraryDocument, codec?: VariableValueCodec): VariableUpdatePlan;
59
+ export declare function commitVariableLibraryUpdate(tx: DocumentTransaction, document: DesignDocument, plan: VariableUpdatePlan): void;
60
+ export declare function commitVariableMode(tx: DocumentTransaction, document: DesignDocument, nodeId: string, library: TokenLibraryDocument, collectionId: string, modeId: string | null, codec?: VariableValueCodec): void;
61
+ /** Literal projection does not claim that source code preserves the binding or mode relationship. */
62
+ export declare function variablesSourceDiagnostics(after: DesignDocument, before: DesignDocument): DocumentDiagnostic[];
@@ -0,0 +1,117 @@
1
+ /** Authored token state. Source paths, CSS names, and codecs belong to the host baseline. */
2
+ export interface TokenLibraryDocument {
3
+ schemaVersion: 1;
4
+ id: string;
5
+ sourceRevision: string;
6
+ collections: Record<string, TokenCollection>;
7
+ tokens: Record<string, LibraryToken>;
8
+ }
9
+ export interface TokenCollection {
10
+ id: string;
11
+ name: string;
12
+ defaultModeId: string;
13
+ modes: TokenMode[];
14
+ }
15
+ export interface TokenMode {
16
+ id: string;
17
+ name: string;
18
+ /** An absent authored value may inherit from this mode. Empty text is still authored. */
19
+ fallbackModeId?: string;
20
+ }
21
+ export interface LibraryToken {
22
+ /** Stable across rename, draft persistence, and source regeneration. */
23
+ id: string;
24
+ collectionId: string;
25
+ name: string;
26
+ /** The host's declared value type, preserved without inferring it from text. */
27
+ type: string;
28
+ valuesByMode: Record<string, TokenValue>;
29
+ }
30
+ export interface TokenReferenceSpan {
31
+ /** Non-overlapping UTF-16 offsets in the exact authored text. Syntax belongs to the codec. */
32
+ start: number;
33
+ end: number;
34
+ tokenId: string;
35
+ /** Omission keeps the requested evaluation mode, including through inherited values. */
36
+ modeId?: string;
37
+ }
38
+ export interface TokenValue {
39
+ kind: 'literal' | 'alias' | 'expression' | 'opaque';
40
+ /** Exact authored value text; codecs preserve delimiters, units, and embedded expressions. */
41
+ text: string;
42
+ /** An opaque host codec identity. The core never parses or formats this syntax. */
43
+ format: string;
44
+ references: TokenReferenceSpan[];
45
+ }
46
+ export interface ResolvedTokenReference extends TokenReferenceSpan {
47
+ modeId: string;
48
+ }
49
+ /** Resolves authorship and graph edges, not host value syntax or computed CSS. */
50
+ export interface TokenValueResolution {
51
+ tokenId: string;
52
+ collectionId: string;
53
+ modeId: string;
54
+ authoredModeId: string;
55
+ inherited: boolean;
56
+ value: TokenValue;
57
+ references: ResolvedTokenReference[];
58
+ }
59
+ export interface TokenLibraryDiagnostic {
60
+ code: string;
61
+ message: string;
62
+ tokenId?: string;
63
+ collectionId?: string;
64
+ modeId?: string;
65
+ }
66
+ export interface TokenLibraryValidationResult {
67
+ valid: boolean;
68
+ diagnostics: readonly TokenLibraryDiagnostic[];
69
+ }
70
+ export interface TokenValueEditability {
71
+ editable: boolean;
72
+ reason?: 'opaque-value';
73
+ }
74
+ export interface TokenLibraryTransaction {
75
+ createCollection(collection: TokenCollection): void;
76
+ renameCollection(collectionId: string, name: string): void;
77
+ /** Only an empty collection may be removed. */
78
+ removeCollection(collectionId: string): void;
79
+ addMode(collectionId: string, mode: TokenMode): void;
80
+ renameMode(collectionId: string, modeId: string, name: string): void;
81
+ /** Referenced/default modes must be retargeted explicitly before removal. */
82
+ removeMode(collectionId: string, modeId: string): void;
83
+ setDefaultMode(collectionId: string, modeId: string): void;
84
+ setModeFallback(collectionId: string, modeId: string, fallbackModeId: string | null): void;
85
+ create(token: LibraryToken): void;
86
+ /** Creates an authored override when this mode previously inherited a value. */
87
+ setValue(tokenId: string, modeId: string, value: TokenValue): void;
88
+ /** Removes an authored override; validation requires every mode to remain resolvable. */
89
+ clearValue(tokenId: string, modeId: string): void;
90
+ /** Stable references remain attached to the same token; the host formats source names. */
91
+ rename(tokenId: string, name: string): void;
92
+ /** Referenced tokens, including references in inactive modes, cannot be removed. */
93
+ remove(tokenId: string): void;
94
+ /** Restores a same-library, same-source snapshot as one undoable transaction. */
95
+ replaceDocument(document: TokenLibraryDocument): void;
96
+ }
97
+ export interface TokenLibraryEngineOptions {
98
+ historyLimit?: number;
99
+ /** Pure host policy checks run before the entire transaction commits. */
100
+ preflight?(input: {
101
+ before: TokenLibraryDocument;
102
+ after: TokenLibraryDocument;
103
+ operations: readonly string[];
104
+ }): readonly TokenLibraryDiagnostic[];
105
+ }
106
+ export interface TokenLibraryEngine {
107
+ readonly snapshot: TokenLibraryDocument;
108
+ readonly revision: number;
109
+ readonly canUndo: boolean;
110
+ readonly canRedo: boolean;
111
+ transact(label: string, apply: (transaction: TokenLibraryTransaction) => void): boolean;
112
+ undo(): boolean;
113
+ redo(): boolean;
114
+ /** Serializes the library only; the internal history envelope is not a public format. */
115
+ serialize(): string;
116
+ subscribe(listener: () => void): () => void;
117
+ }
@@ -0,0 +1,13 @@
1
+ import type { TokenLibraryDiagnostic, TokenLibraryDocument, TokenLibraryEngine, TokenLibraryEngineOptions, TokenLibraryValidationResult, TokenValueEditability, TokenValueResolution } from './contracts.js';
2
+ export declare class TokenLibraryValidationError extends Error {
3
+ readonly diagnostics: readonly TokenLibraryDiagnostic[];
4
+ constructor(diagnostics: readonly TokenLibraryDiagnostic[]);
5
+ }
6
+ /** Validate authored syntax boundaries and the complete token/mode reference graph. */
7
+ export declare function validateTokenLibraryDocument(input: unknown): TokenLibraryValidationResult;
8
+ /** A lightweight lookup for an already validated library; returned data is detached and frozen. */
9
+ export declare function resolveTokenLibraryValue(document: TokenLibraryDocument, tokenId: string, modeId: string): TokenValueResolution;
10
+ export declare function tokenValueEditability(document: TokenLibraryDocument, tokenId: string, modeId: string): TokenValueEditability;
11
+ /** Separate library sessions share the existing document transaction and history implementation. */
12
+ export declare function createTokenLibraryEngine(document: TokenLibraryDocument, options?: TokenLibraryEngineOptions): TokenLibraryEngine;
13
+ export declare function reopenTokenLibrary(serialized: string, options?: TokenLibraryEngineOptions): TokenLibraryEngine;
@@ -0,0 +1,9 @@
1
+ import type { WorkspaceConfiguration } from './configuration.js';
2
+
3
+ export interface WorkspaceShellProps {
4
+ configuration: WorkspaceConfiguration;
5
+ sourceRevision: string;
6
+ previewIdentityReady: boolean;
7
+ previewOpen?: boolean;
8
+ }
9
+ export declare const WorkspaceShell: import("react").FunctionComponent<WorkspaceShellProps>;
@@ -0,0 +1,3 @@
1
+ export declare function ApplicationWorkspace({ ready }: {
2
+ ready: boolean;
3
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,39 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { HostDataCapabilities } from '../binding/contracts.js';
3
+ import type { DesignDocument, DocumentNode, DocumentDuplicateMetadataRemapper } from '../document/contracts.js';
4
+ import type { WorkspaceSourceCapabilities } from './source/flowContracts.js';
5
+ import type { WorkspaceTarget } from './contracts.js';
6
+ import type { WorkspaceTokenLibraryCapabilities } from './tokens/contracts.js';
7
+ /** One target's source, data, rendering, and persistence capabilities travel together. */
8
+ export interface WorkspaceTargetConfiguration {
9
+ data?: HostDataCapabilities;
10
+ source?: WorkspaceSourceCapabilities;
11
+ duplicateMetadata?: DocumentDuplicateMetadataRemapper;
12
+ loadDocument?(target: WorkspaceTarget, options: {
13
+ signal: AbortSignal;
14
+ }): Promise<DesignDocument>;
15
+ /** Persist the versioned design draft; this is not permission to write source. */
16
+ saveDocument?(target: WorkspaceTarget, serializedDocument: string): Promise<void>;
17
+ /** Render the actual registered implementation with resolved input props. */
18
+ renderComponent?(node: DocumentNode, props: Readonly<Record<string, unknown>>, context: {
19
+ document: DesignDocument;
20
+ }): ReactNode;
21
+ onRequestData?(request: {
22
+ screenId: string;
23
+ description: string;
24
+ }): void;
25
+ }
26
+ /** Source loading and product interpretation stay with the host adapter. */
27
+ export interface WorkspaceConfiguration extends WorkspaceTargetConfiguration {
28
+ /** One shared token library, independent of per-screen visual document drafts. */
29
+ tokenLibrary?: WorkspaceTokenLibraryCapabilities;
30
+ initialMode?: 'view' | 'edit';
31
+ /** Host source/session controls occupy the shared header, outside mode panels. */
32
+ chrome?: ReactNode;
33
+ /** Undefined explicitly marks an unsupported screen or source revision. */
34
+ resolveTarget?(target: WorkspaceTarget): WorkspaceTargetConfiguration | undefined;
35
+ }
36
+ /** An explicit target resolver never inherits capabilities from the root configuration. */
37
+ export declare function resolveWorkspaceTarget(configuration: WorkspaceConfiguration, target: WorkspaceTarget): WorkspaceTargetConfiguration | undefined;
38
+ /** Compares captured capability identities without invoking any host callbacks. */
39
+ export declare function sameWorkspaceTargetConfiguration(left: WorkspaceTargetConfiguration | undefined, right: WorkspaceTargetConfiguration | undefined): boolean;
@@ -0,0 +1,64 @@
1
+ /** Navigation state belongs to the workspace, never to document history. */
2
+ export type WorkspaceMode = 'view' | 'edit' | 'application';
3
+ export interface WorkspaceTarget {
4
+ screenId: string;
5
+ sourceRevision: string;
6
+ }
7
+ export interface WorkspaceCamera {
8
+ x: number;
9
+ y: number;
10
+ zoom: number;
11
+ }
12
+ export interface WorkspaceDesignContext {
13
+ target: WorkspaceTarget;
14
+ selection: readonly string[];
15
+ camera: WorkspaceCamera;
16
+ }
17
+ export interface WorkspaceApplicationSurface {
18
+ /** An implementation URL or a built draft URL supplied by the host. */
19
+ url: string;
20
+ /** A built draft must identify the exact document revision it executes. */
21
+ documentRevision?: string;
22
+ /** The artifact must confirm that its declared screen recipe has completed. */
23
+ waitForReady?: boolean;
24
+ }
25
+ /** A fixed CSS viewport width for an executed surface; the host application still owns its own layout. */
26
+ export interface WorkspaceRunViewport {
27
+ width: number;
28
+ label?: string;
29
+ }
30
+ export interface WorkspaceApplicationRun {
31
+ id: number;
32
+ target: WorkspaceTarget;
33
+ kind: 'implementation' | 'built-draft';
34
+ documentRevision?: string;
35
+ viewport?: WorkspaceRunViewport;
36
+ status: 'preparing' | 'ready' | 'failed';
37
+ surface?: WorkspaceApplicationSurface;
38
+ error?: string;
39
+ /** Run navigation cannot change the selected storyboard or design target. */
40
+ locations: readonly string[];
41
+ locationIndex: number;
42
+ }
43
+ export interface WorkspaceSnapshot {
44
+ mode: WorkspaceMode;
45
+ view: {
46
+ target: WorkspaceTarget | null;
47
+ camera: WorkspaceCamera;
48
+ };
49
+ design: WorkspaceDesignContext | null;
50
+ application: WorkspaceApplicationRun | null;
51
+ returnMode: 'view' | 'edit';
52
+ }
53
+ export interface WorkspaceRunRequest {
54
+ target: WorkspaceTarget;
55
+ kind?: WorkspaceApplicationRun['kind'];
56
+ documentRevision?: string;
57
+ /** Requested execution width; omitted means the surface fills the workspace. */
58
+ viewport?: WorkspaceRunViewport;
59
+ }
60
+ export type WorkspaceApplicationPreparer = (
61
+ /** Captured run identity; caller mutations cannot retarget preparation. */
62
+ request: WorkspaceRunRequest,
63
+ /** Return, replacement, and disposal abort pending work. */
64
+ signal: AbortSignal) => Promise<WorkspaceApplicationSurface>;
@@ -0,0 +1,35 @@
1
+ import type { WorkspaceApplicationPreparer, WorkspaceRunViewport, WorkspaceApplicationSurface, WorkspaceCamera, WorkspaceMode, WorkspaceRunRequest, WorkspaceSnapshot, WorkspaceTarget } from './contracts.js';
2
+ /** Runtime-scoped navigation with independent design and application contexts. */
3
+ export declare class WorkspaceController {
4
+ private value;
5
+ private listeners;
6
+ private designContexts;
7
+ private runSequence;
8
+ /** Owns both pending preparation and the lifetime of its ready surface. */
9
+ private activeRunController;
10
+ private cancellingPreparation;
11
+ private disposed;
12
+ constructor(initialMode?: 'view' | 'edit');
13
+ getSnapshot: () => WorkspaceSnapshot;
14
+ subscribe: (listener: () => void) => (() => void);
15
+ private update;
16
+ selectView(target: WorkspaceTarget): void;
17
+ edit(target?: WorkspaceTarget | null): void;
18
+ setMode(mode: Exclude<WorkspaceMode, 'application'>): void;
19
+ setSelection(selection: readonly string[]): void;
20
+ setCamera(mode: 'view' | 'edit', next: WorkspaceCamera): void;
21
+ beginApplication(request: WorkspaceRunRequest): number;
22
+ private startApplication;
23
+ completeApplication(id: number, surface: WorkspaceApplicationSurface): boolean;
24
+ failApplication(id: number, error: string): boolean;
25
+ invalidateApplication(id: number, error: string): boolean;
26
+ prepareApplication(request: WorkspaceRunRequest, prepare: WorkspaceApplicationPreparer): Promise<boolean>;
27
+ /** Resizing the executed surface is view state; it never restarts or re-prepares the run. */
28
+ setApplicationViewport(id: number, viewport: WorkspaceRunViewport | undefined): boolean;
29
+ navigateApplication(id: number, location: string): boolean;
30
+ backApplication(): boolean;
31
+ returnFromApplication(): void;
32
+ private cancelPreparation;
33
+ private abortRunController;
34
+ dispose(): void;
35
+ }
@@ -0,0 +1,42 @@
1
+ import type { BindingNodeContext, HostDataCapabilities } from '../binding/contracts.js';
2
+ import type { DesignDocument, DocumentDiagnostic, DocumentEngine } from '../document/contracts.js';
3
+ import { type WorkspaceConfiguration, type WorkspaceTargetConfiguration } from './configuration.js';
4
+ import type { WorkspaceTarget } from './contracts.js';
5
+ export interface WorkspaceDocumentSession {
6
+ target: WorkspaceTarget;
7
+ status: 'idle' | 'loading' | 'ready' | 'error';
8
+ engine?: DocumentEngine;
9
+ error?: string;
10
+ saving: boolean;
11
+ savedRevision: number;
12
+ dirty: boolean;
13
+ configuration?: WorkspaceTargetConfiguration;
14
+ configurationRevision: number;
15
+ }
16
+ export declare function documentBindingNodes(document: DesignDocument): BindingNodeContext[];
17
+ /** Bindings participate in the document commit, never in a parallel history. */
18
+ export declare function documentBindingPreflight(capabilities: HostDataCapabilities | undefined | (() => HostDataCapabilities | undefined)): ({ before, after }: {
19
+ before: DesignDocument;
20
+ after: DesignDocument;
21
+ }) => readonly DocumentDiagnostic[];
22
+ /** A runtime owns this collection; mode switches do not destroy its draft engines. */
23
+ export declare class WorkspaceDocumentSessions {
24
+ private sessions;
25
+ private pending;
26
+ private subscriptions;
27
+ private configurations;
28
+ private baselines;
29
+ private savedSnapshots;
30
+ private pendingSaves;
31
+ private listeners;
32
+ private disposed;
33
+ subscribe: (listener: () => void) => () => void;
34
+ getSnapshot: (target: WorkspaceTarget) => WorkspaceDocumentSession;
35
+ private update;
36
+ load(target: WorkspaceTarget, configuration: WorkspaceConfiguration): Promise<DocumentEngine | null>;
37
+ save(target: WorkspaceTarget, explicitSave?: NonNullable<WorkspaceTargetConfiguration['saveDocument']>): Promise<boolean>;
38
+ /** Reset means the snapshot first loaded for this target, including a persisted draft. */
39
+ reset(target: WorkspaceTarget): boolean;
40
+ hasUnsavedChanges(): boolean;
41
+ dispose(): void;
42
+ }
@@ -0,0 +1,23 @@
1
+ import type { DesignDocument, DocumentEngine, DocumentNode } from '../../document/contracts.js';
2
+ import { appearanceToCss } from '../../document/appearance.js';
3
+
4
+ export interface AppearancePanelProps {
5
+ engine: DocumentEngine;
6
+ nodeId: string;
7
+ disabled?: boolean;
8
+ }
9
+ export declare function AppearancePanel({ engine, nodeId, disabled }: AppearancePanelProps): import("react").JSX.Element | null;
10
+ /** Separate decorative layers preserve each paint's opacity independently of the content. */
11
+ export declare function AppearanceSurface({ node, document }: {
12
+ node: DocumentNode;
13
+ document: DesignDocument;
14
+ }): import("react").JSX.Element | null;
15
+ export { appearanceToCss };
16
+ /** Canvas paths remain real SVG elements, including editable geometry previews. */
17
+ export declare function AppearanceVectorSurface({ node, document, width, height, vector }: {
18
+ node: DocumentNode;
19
+ document: DesignDocument;
20
+ width?: number;
21
+ height?: number;
22
+ vector?: import('../../document/vector.js').VectorProperties;
23
+ }): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { DesignDocument, DocumentEngineOptions, DocumentTransaction } from '../../document/contracts.js';
2
+ import type { DataProjection } from '../../binding/preview.js';
3
+
4
+ export declare function ArrangeLayers({ document, selected, projection, preflight, act }: {
5
+ document: DesignDocument;
6
+ selected: readonly string[];
7
+ projection: DataProjection | null;
8
+ preflight?: DocumentEngineOptions['preflight'];
9
+ act(label: string, apply: (transaction: DocumentTransaction) => void): boolean;
10
+ }): import("react").JSX.Element;