@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.
- package/binding-source.d.ts +25 -0
- package/dist-lib/{CameraLayer-nkNrazn8.js → CameraLayer-BdOko8XE.js} +17 -17
- package/dist-lib/pygmalion.js +24599 -12746
- package/dist-lib/{runtime-DdYnT6k4.js → runtime-Dxb-IaLN.js} +12427 -11116
- package/dist-lib/style.css +1 -1
- package/dist-lib/testing.js +10 -10
- package/dist-lib/types/binding/catalog.d.ts +10 -0
- package/dist-lib/types/binding/contracts.d.ts +202 -0
- package/dist-lib/types/binding/documentCommands.d.ts +38 -0
- package/dist-lib/types/binding/index.d.ts +6 -0
- package/dist-lib/types/binding/preview.d.ts +37 -0
- package/dist-lib/types/binding/source.d.ts +109 -0
- package/dist-lib/types/binding/useDataProjection.d.ts +9 -0
- package/dist-lib/types/binding/validate.d.ts +8 -0
- package/dist-lib/types/core/runtime.d.ts +6 -0
- package/dist-lib/types/document/appearance.d.ts +112 -0
- package/dist-lib/types/document/assets.d.ts +204 -0
- package/dist-lib/types/document/components.d.ts +169 -0
- package/dist-lib/types/document/contracts.d.ts +171 -0
- package/dist-lib/types/document/engine.d.ts +20 -0
- package/dist-lib/types/document/exportSettings.d.ts +45 -0
- package/dist-lib/types/document/geometry.d.ts +11 -0
- package/dist-lib/types/document/layout.d.ts +53 -0
- package/dist-lib/types/document/prototype.d.ts +424 -0
- package/dist-lib/types/document/prototypeReferences.d.ts +3 -0
- package/dist-lib/types/document/richText.d.ts +185 -0
- package/dist-lib/types/document/styles.d.ts +216 -0
- package/dist-lib/types/document/svgImport.d.ts +17 -0
- package/dist-lib/types/document/vector.d.ts +222 -0
- package/dist-lib/types/editor/designCompiler.d.ts +7 -0
- package/dist-lib/types/editor/designImport.d.ts +7 -0
- package/dist-lib/types/editor/inspect.d.ts +8 -0
- package/dist-lib/types/editor/revisionCatalogInstall.d.ts +1 -1
- package/dist-lib/types/editor/screenInteractions.d.ts +3 -3
- package/dist-lib/types/editor/store.d.ts +1 -1
- package/dist-lib/types/editor/surfaceDemands.d.ts +3 -1
- package/dist-lib/types/host/project.d.ts +44 -0
- package/dist-lib/types/host/registryConnections.d.ts +11 -0
- package/dist-lib/types/host/sourceFilePlan.d.ts +15 -0
- package/dist-lib/types/host/sourceWriteback.d.ts +50 -0
- package/dist-lib/types/lib.d.ts +101 -3
- package/dist-lib/types/token-library/bindings.d.ts +62 -0
- package/dist-lib/types/token-library/contracts.d.ts +117 -0
- package/dist-lib/types/token-library/engine.d.ts +13 -0
- package/dist-lib/types/workspace/WorkspaceShell.d.ts +9 -0
- package/dist-lib/types/workspace/application/ApplicationWorkspace.d.ts +3 -0
- package/dist-lib/types/workspace/configuration.d.ts +39 -0
- package/dist-lib/types/workspace/contracts.d.ts +64 -0
- package/dist-lib/types/workspace/controller.d.ts +35 -0
- package/dist-lib/types/workspace/documentSessions.d.ts +42 -0
- package/dist-lib/types/workspace/edit/AppearancePanel.d.ts +23 -0
- package/dist-lib/types/workspace/edit/ArrangeLayers.d.ts +10 -0
- package/dist-lib/types/workspace/edit/AssetsPanel.d.ts +16 -0
- package/dist-lib/types/workspace/edit/CanvasGuides.d.ts +19 -0
- package/dist-lib/types/workspace/edit/ComponentPanel.d.ts +11 -0
- package/dist-lib/types/workspace/edit/DataPanel.d.ts +16 -0
- package/dist-lib/types/workspace/edit/DesignWorkspace.d.ts +10 -0
- package/dist-lib/types/workspace/edit/LayerTree.d.ts +14 -0
- package/dist-lib/types/workspace/edit/LayoutPanel.d.ts +13 -0
- package/dist-lib/types/workspace/edit/PrototypePanel.d.ts +12 -0
- package/dist-lib/types/workspace/edit/ScopeTransferDialog.d.ts +40 -0
- package/dist-lib/types/workspace/edit/SelectionHandles.d.ts +52 -0
- package/dist-lib/types/workspace/edit/StylesPanel.d.ts +8 -0
- package/dist-lib/types/workspace/edit/TextEditor.d.ts +50 -0
- package/dist-lib/types/workspace/edit/VectorEditor.d.ts +89 -0
- package/dist-lib/types/workspace/edit/VectorToolbar.d.ts +5 -0
- package/dist-lib/types/workspace/edit/canvasGuideModel.d.ts +102 -0
- package/dist-lib/types/workspace/edit/clipboard.d.ts +35 -0
- package/dist-lib/types/workspace/edit/duplicateMetadata.d.ts +2 -0
- package/dist-lib/types/workspace/edit/geometryHandles.d.ts +224 -0
- package/dist-lib/types/workspace/edit/layerArrangement.d.ts +39 -0
- package/dist-lib/types/workspace/edit/layerMoves.d.ts +44 -0
- package/dist-lib/types/workspace/edit/projection.d.ts +12 -0
- package/dist-lib/types/workspace/edit/scopeTransfer.d.ts +96 -0
- package/dist-lib/types/workspace/edit/textStyles.d.ts +75 -0
- package/dist-lib/types/workspace/edit/vectorTools.d.ts +136 -0
- package/dist-lib/types/workspace/legacyModeAdapter.d.ts +13 -0
- package/dist-lib/types/workspace/source/ResponsiveLayoutPanel.d.ts +20 -0
- package/dist-lib/types/workspace/source/SourceReview.d.ts +11 -0
- package/dist-lib/types/workspace/source/appearanceSource.d.ts +19 -0
- package/dist-lib/types/workspace/source/compiler.d.ts +5 -0
- package/dist-lib/types/workspace/source/contracts.d.ts +156 -0
- package/dist-lib/types/workspace/source/controller.d.ts +50 -0
- package/dist-lib/types/workspace/source/documentRevision.d.ts +2 -0
- package/dist-lib/types/workspace/source/draftPreviewClient.d.ts +13 -0
- package/dist-lib/types/workspace/source/draftRecipe.d.ts +30 -0
- package/dist-lib/types/workspace/source/flowContracts.d.ts +72 -0
- package/dist-lib/types/workspace/source/prototypeSource.d.ts +4 -0
- package/dist-lib/types/workspace/source/responsive.d.ts +13 -0
- package/dist-lib/types/workspace/source/responsiveContracts.d.ts +78 -0
- package/dist-lib/types/workspace/source/structure.d.ts +21 -0
- package/dist-lib/types/workspace/source/textSource.d.ts +28 -0
- package/dist-lib/types/workspace/tokens/TokenLibraryContext.d.ts +11 -0
- package/dist-lib/types/workspace/tokens/TokenLibraryWorkspace.d.ts +14 -0
- package/dist-lib/types/workspace/tokens/contracts.d.ts +74 -0
- package/dist-lib/types/workspace/tokens/controller.d.ts +44 -0
- package/dist-lib/types/workspace/view/PrototypePlayer.d.ts +17 -0
- package/dist-lib/types/workspace/view/StoryboardWorkspace.d.ts +3 -0
- package/dist-lib/types/workspace/view/prototypePlayback.d.ts +46 -0
- package/draft-preview.d.ts +54 -0
- package/inspect.d.ts +2 -0
- package/node/design-session.mjs +3 -0
- package/node/inspect-plugin.mjs +3 -1
- package/node/inspect-writeback.mjs +18 -2
- package/node/preview-artifact-store.mjs +10 -7
- package/node/source-archive.mjs +88 -0
- package/node/source-bindings.mjs +65 -0
- package/node/source-file-lock.mjs +15 -0
- package/node/source-file-plan.mjs +162 -0
- package/node/source-file-proofs.mjs +44 -0
- package/node/source-responsive-codec.d.mts +17 -0
- package/node/source-responsive-codec.mjs +133 -0
- package/node/source-responsive.mjs +189 -0
- package/node/source-structure-reconcile.mjs +186 -0
- package/node/source-structure-wrapper-codec.d.mts +20 -0
- package/node/source-structure-wrapper-codec.mjs +205 -0
- package/node/source-structure.mjs +404 -0
- package/node/token-source-references.mjs +136 -0
- package/node/workspace-draft-preview-plugin.mjs +70 -0
- package/node/workspace-draft-preview.mjs +231 -0
- package/node/workspace-source-identity.d.mts +1 -0
- package/node/workspace-source-identity.mjs +21 -0
- package/node/workspace-source-plan.mjs +195 -0
- package/package.json +52 -6
- package/source-files.d.ts +35 -0
- package/source-responsive.d.ts +10 -0
- package/source-structure.d.ts +155 -0
- package/workspace-source-plan.d.ts +44 -0
- package/docs/coverage-contracts.md +0 -431
- package/docs/screen-state-contract.md +0 -252
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { DesignDocument, DocumentEngine } from '../../document/contracts.js';
|
|
3
|
+
import type { WorkspaceResponsiveSourceMapping } from './responsiveContracts.js';
|
|
4
|
+
/** Preview width is view state, separate from the authored responsive declarations. */
|
|
5
|
+
export declare function ResponsiveViewportProvider({ children }: {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export declare function useWorkspaceResponsiveViewport(): {
|
|
9
|
+
width: number;
|
|
10
|
+
setWidth: (width: number) => void;
|
|
11
|
+
};
|
|
12
|
+
export declare function ResponsiveLayoutPanel({ engine, document, mapping, selectedId, disabled, initialRangeId }: {
|
|
13
|
+
engine: DocumentEngine;
|
|
14
|
+
document: DesignDocument;
|
|
15
|
+
mapping: WorkspaceResponsiveSourceMapping;
|
|
16
|
+
selectedId?: string;
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
/** The range opened first; the base range when omitted. Selection stays view state afterwards. */
|
|
19
|
+
initialRangeId?: string;
|
|
20
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { EditorRuntime } from '../../core/runtime.js';
|
|
2
|
+
import type { DocumentEngine } from '../../document/contracts.js';
|
|
3
|
+
import type { WorkspaceTarget } from '../contracts.js';
|
|
4
|
+
import type { WorkspaceSourceCapabilities } from './flowContracts.js';
|
|
5
|
+
export interface WorkspaceSourcePanelProps {
|
|
6
|
+
runtime: EditorRuntime;
|
|
7
|
+
target: WorkspaceTarget;
|
|
8
|
+
engine: DocumentEngine;
|
|
9
|
+
capabilities?: WorkspaceSourceCapabilities;
|
|
10
|
+
}
|
|
11
|
+
export declare function WorkspaceSourcePanel(props: WorkspaceSourcePanelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DocumentDiagnostic, DocumentNode } from '../../document/contracts.js';
|
|
2
|
+
export interface AppearanceSourceProjection {
|
|
3
|
+
declarations: Record<string, string>;
|
|
4
|
+
diagnostics: DocumentDiagnostic[];
|
|
5
|
+
}
|
|
6
|
+
export declare const APPEARANCE_SOURCE_FIELDS: readonly ["properties.paints", "properties.strokes", "properties.effects", "properties.blendMode"];
|
|
7
|
+
/** Only declarations supported by the existing stylesheet writer are returned. Unsupported output blocks the whole appearance delta. */
|
|
8
|
+
export declare function appearanceSourceProjection(node: DocumentNode): AppearanceSourceProjection;
|
|
9
|
+
/** A compiler field maps to exactly one existing CSS declaration. Coupled stroke/effect shadows must use one mapping. */
|
|
10
|
+
export declare function appearanceSourceValue(node: DocumentNode, field: string): {
|
|
11
|
+
value: string | null;
|
|
12
|
+
diagnostics: DocumentDiagnostic[];
|
|
13
|
+
};
|
|
14
|
+
export interface AppearanceSourceFieldMapping {
|
|
15
|
+
nodeId: string;
|
|
16
|
+
field: string;
|
|
17
|
+
}
|
|
18
|
+
/** Guard for custom source compilers: every advanced appearance delta needs an explicit field mapping. */
|
|
19
|
+
export declare function appearanceSourceDeltaDiagnostics(before: import('../../document/contracts.js').DesignDocument, after: import('../../document/contracts.js').DesignDocument, mapped?: readonly AppearanceSourceFieldMapping[]): DocumentDiagnostic[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { WorkspaceVisualSourceCompileInput, WorkspaceVisualSourceCompileResult } from './contracts.js';
|
|
2
|
+
/** Lossless identity shared with the isolated source builder. */
|
|
3
|
+
export declare const workspaceSourceFingerprint: (value: unknown) => string;
|
|
4
|
+
/** Converts a complete draft delta to existing inspect operators, or rejects the entire delta. */
|
|
5
|
+
export declare function compileWorkspaceVisualSource(input: WorkspaceVisualSourceCompileInput): WorkspaceVisualSourceCompileResult;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import type { DesignDocument } from '../../document/contracts.js';
|
|
2
|
+
import type { InspectApplyPayload, InspectMedia, SourceAffectedFrame, SourceEditScope, SourceIdentity } from '../../editor/inspect.js';
|
|
3
|
+
import type { WorkspaceTarget } from '../contracts.js';
|
|
4
|
+
import type { WorkspaceResponsiveSourceMapping } from './responsiveContracts.js';
|
|
5
|
+
/** Only properties with implemented visual semantics may become source edits. */
|
|
6
|
+
export type WorkspaceVisualSourceField = 'width' | 'height' | 'properties.fill' | 'properties.color' | 'properties.radius' | 'properties.fontSize' | 'properties.opacity' | 'properties.text' | 'properties.paints' | 'properties.strokes' | 'properties.effects';
|
|
7
|
+
export interface WorkspaceSourceFileProof {
|
|
8
|
+
/** Exact project-relative path. The host checks these bytes before review and apply. */
|
|
9
|
+
file: string;
|
|
10
|
+
/** Null is an explicit absence proof for a new file in a complete file plan. */
|
|
11
|
+
sha256: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface WorkspaceVisualStyleSource {
|
|
14
|
+
kind: 'style';
|
|
15
|
+
file: string;
|
|
16
|
+
className: string;
|
|
17
|
+
componentFile: string;
|
|
18
|
+
property: string;
|
|
19
|
+
/** Lengths accept finite numbers as pixels or an explicitly permitted CSS token. */
|
|
20
|
+
encoding: 'css-length' | 'number' | 'string';
|
|
21
|
+
affectedFrames: readonly SourceAffectedFrame[];
|
|
22
|
+
media?: InspectMedia;
|
|
23
|
+
}
|
|
24
|
+
export interface WorkspaceVisualTextSource {
|
|
25
|
+
kind: 'text';
|
|
26
|
+
identity: SourceIdentity;
|
|
27
|
+
scope: SourceEditScope;
|
|
28
|
+
affectedFrames: readonly SourceAffectedFrame[];
|
|
29
|
+
}
|
|
30
|
+
export interface WorkspaceVisualSourceRule {
|
|
31
|
+
nodeId: string;
|
|
32
|
+
field: WorkspaceVisualSourceField;
|
|
33
|
+
label?: string;
|
|
34
|
+
/** Host-owned tokens or literal choices. Omission permits otherwise valid visual values. */
|
|
35
|
+
permittedValues?: readonly (string | number)[];
|
|
36
|
+
source: WorkspaceVisualStyleSource | WorkspaceVisualTextSource;
|
|
37
|
+
}
|
|
38
|
+
/** Source locations and proofs are supplied by the host, never inferred from rendered values. */
|
|
39
|
+
export interface WorkspaceVisualSourceMapping {
|
|
40
|
+
version: 1;
|
|
41
|
+
target: WorkspaceTarget;
|
|
42
|
+
documentId: string;
|
|
43
|
+
/** workspaceSourceFingerprint of the complete source-derived baseline. */
|
|
44
|
+
baselineFingerprint: string;
|
|
45
|
+
files: readonly WorkspaceSourceFileProof[];
|
|
46
|
+
rules: readonly WorkspaceVisualSourceRule[];
|
|
47
|
+
/** One intrinsic-layout source island; expressions remain opaque owned leaves. */
|
|
48
|
+
structure?: WorkspaceStructureSourceMapping;
|
|
49
|
+
/** Responsive declarations use the same complete source baseline and file proofs. */
|
|
50
|
+
responsive?: WorkspaceResponsiveSourceMapping;
|
|
51
|
+
}
|
|
52
|
+
export interface WorkspaceStructureSourceAnchor {
|
|
53
|
+
nodeId: string;
|
|
54
|
+
file: string;
|
|
55
|
+
start: number;
|
|
56
|
+
end: number;
|
|
57
|
+
expected: string;
|
|
58
|
+
}
|
|
59
|
+
export type WorkspaceStructureGroupAlignment = 'start' | 'center' | 'end' | 'stretch';
|
|
60
|
+
/** The source-relevant part of a group's document layout; sizing stays an authoring value. */
|
|
61
|
+
export interface WorkspaceStructureGroupLayout {
|
|
62
|
+
direction: 'horizontal' | 'vertical' | 'grid';
|
|
63
|
+
gap: number;
|
|
64
|
+
padding: number;
|
|
65
|
+
align?: WorkspaceStructureGroupAlignment;
|
|
66
|
+
wrap?: boolean;
|
|
67
|
+
crossGap?: number;
|
|
68
|
+
distribute?: 'start' | 'center' | 'end' | 'space-between';
|
|
69
|
+
paddingTop?: number;
|
|
70
|
+
paddingRight?: number;
|
|
71
|
+
paddingBottom?: number;
|
|
72
|
+
paddingLeft?: number;
|
|
73
|
+
columns?: number;
|
|
74
|
+
minWidth?: number;
|
|
75
|
+
maxWidth?: number;
|
|
76
|
+
minHeight?: number;
|
|
77
|
+
maxHeight?: number;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Declares how a source group with a layout becomes one intrinsic element plus a generated
|
|
81
|
+
* stylesheet class. Absent, groups compile to transparent fragments only. Spacing pairs the
|
|
82
|
+
* document's pixel values with the host's exact CSS spellings; the core never invents tokens.
|
|
83
|
+
*/
|
|
84
|
+
export interface WorkspaceStructureWrapperDeclaration {
|
|
85
|
+
/** Stylesheet receiving generated class blocks; requires an exact file proof. */
|
|
86
|
+
stylesheet: string;
|
|
87
|
+
/** JSX identifier of the imported stylesheet module, as in `className={alias.name}`. */
|
|
88
|
+
styleAlias: string;
|
|
89
|
+
/** Intrinsic non-void element for generated wrappers; defaults to `div`. */
|
|
90
|
+
tagName?: string;
|
|
91
|
+
spacing: readonly {
|
|
92
|
+
px: number;
|
|
93
|
+
css: string;
|
|
94
|
+
}[];
|
|
95
|
+
/** Permitted alignments; omission permits every document alignment. */
|
|
96
|
+
align?: readonly WorkspaceStructureGroupAlignment[];
|
|
97
|
+
}
|
|
98
|
+
export interface WorkspaceStructureSourceMapping {
|
|
99
|
+
rootId: string;
|
|
100
|
+
anchors: readonly WorkspaceStructureSourceAnchor[];
|
|
101
|
+
wrapper?: WorkspaceStructureWrapperDeclaration;
|
|
102
|
+
}
|
|
103
|
+
export type WorkspaceStructureSourceOperation = {
|
|
104
|
+
kind: 'reorder';
|
|
105
|
+
parentId: string;
|
|
106
|
+
children: string[];
|
|
107
|
+
} | {
|
|
108
|
+
kind: 'group';
|
|
109
|
+
nodeIds: string[];
|
|
110
|
+
groupId: string;
|
|
111
|
+
layout?: WorkspaceStructureGroupLayout;
|
|
112
|
+
} | {
|
|
113
|
+
kind: 'ungroup';
|
|
114
|
+
nodeId: string;
|
|
115
|
+
} | {
|
|
116
|
+
kind: 'reparent';
|
|
117
|
+
nodeId: string;
|
|
118
|
+
parentId: string;
|
|
119
|
+
index: number;
|
|
120
|
+
};
|
|
121
|
+
export interface WorkspaceVisualSourceDiagnostic {
|
|
122
|
+
code: string;
|
|
123
|
+
message: string;
|
|
124
|
+
nodeId?: string;
|
|
125
|
+
field?: string;
|
|
126
|
+
}
|
|
127
|
+
export interface WorkspaceVisualSourceIdentity {
|
|
128
|
+
version: 1;
|
|
129
|
+
target: WorkspaceTarget;
|
|
130
|
+
documentId: string;
|
|
131
|
+
/** Lossless, deterministic JSON fingerprints cover all fields, not just mapped deltas. */
|
|
132
|
+
beforeFingerprint: string;
|
|
133
|
+
afterFingerprint: string;
|
|
134
|
+
mappingFingerprint: string;
|
|
135
|
+
payloadFingerprint: string;
|
|
136
|
+
fingerprint: string;
|
|
137
|
+
}
|
|
138
|
+
export interface WorkspaceVisualSourceCompileInput {
|
|
139
|
+
target: WorkspaceTarget;
|
|
140
|
+
before: DesignDocument;
|
|
141
|
+
after: DesignDocument;
|
|
142
|
+
mapping: WorkspaceVisualSourceMapping;
|
|
143
|
+
}
|
|
144
|
+
export type WorkspaceVisualSourceCompileResult = {
|
|
145
|
+
status: 'ready';
|
|
146
|
+
identity: WorkspaceVisualSourceIdentity;
|
|
147
|
+
payload: InspectApplyPayload;
|
|
148
|
+
diagnostics: readonly [];
|
|
149
|
+
} | {
|
|
150
|
+
status: 'unchanged';
|
|
151
|
+
identity: WorkspaceVisualSourceIdentity;
|
|
152
|
+
diagnostics: readonly [];
|
|
153
|
+
} | {
|
|
154
|
+
status: 'blocked';
|
|
155
|
+
diagnostics: readonly WorkspaceVisualSourceDiagnostic[];
|
|
156
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { DocumentEngine } from '../../document/contracts.js';
|
|
2
|
+
import type { InspectApplyResult, InspectPreviewResult } from '../../editor/host.js';
|
|
3
|
+
import type { WorkspaceTarget } from '../contracts.js';
|
|
4
|
+
import type { WorkspaceVisualSourceDiagnostic } from './contracts.js';
|
|
5
|
+
import type { WorkspaceSourceBaseline, WorkspaceSourceCapabilities, WorkspaceSourceRequest } from './flowContracts.js';
|
|
6
|
+
export interface WorkspaceSourceReviewState {
|
|
7
|
+
status: 'idle' | 'loading' | 'reconciling' | 'reconciled' | 'reviewing' | 'blocked' | 'unchanged' | 'reviewed' | 'applying' | 'applied' | 'error';
|
|
8
|
+
baseline?: WorkspaceSourceBaseline;
|
|
9
|
+
request?: WorkspaceSourceRequest;
|
|
10
|
+
preview?: InspectPreviewResult;
|
|
11
|
+
result?: InspectApplyResult;
|
|
12
|
+
diagnostics: readonly WorkspaceVisualSourceDiagnostic[];
|
|
13
|
+
error?: string;
|
|
14
|
+
reconciliation?: {
|
|
15
|
+
beforeFingerprint: string;
|
|
16
|
+
baseline: WorkspaceSourceBaseline;
|
|
17
|
+
document: WorkspaceSourceBaseline['document'];
|
|
18
|
+
changedFiles: readonly string[];
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** Each review binds complete draft contents, source proofs, target, and capabilities. */
|
|
22
|
+
export declare class WorkspaceSourceReviewController {
|
|
23
|
+
private state;
|
|
24
|
+
private listeners;
|
|
25
|
+
private epoch;
|
|
26
|
+
private pending;
|
|
27
|
+
private disposed;
|
|
28
|
+
private invalidating;
|
|
29
|
+
private applying;
|
|
30
|
+
private unsubscribe;
|
|
31
|
+
private writer;
|
|
32
|
+
readonly target: WorkspaceTarget;
|
|
33
|
+
readonly engine: DocumentEngine;
|
|
34
|
+
readonly capabilities: WorkspaceSourceCapabilities;
|
|
35
|
+
constructor(target: WorkspaceTarget, engine: DocumentEngine, capabilities: WorkspaceSourceCapabilities);
|
|
36
|
+
subscribe: (listener: () => void) => () => void;
|
|
37
|
+
getSnapshot: () => WorkspaceSourceReviewState;
|
|
38
|
+
private update;
|
|
39
|
+
private invalidate;
|
|
40
|
+
private current;
|
|
41
|
+
load(): Promise<boolean>;
|
|
42
|
+
review(): Promise<boolean>;
|
|
43
|
+
/** Propose a merge without replacing the current draft or granting source-write approval. */
|
|
44
|
+
reconcile(): Promise<boolean>;
|
|
45
|
+
acceptReconciliation(): boolean;
|
|
46
|
+
discardReconciliation(): boolean;
|
|
47
|
+
apply(): Promise<boolean>;
|
|
48
|
+
resetToSource(): boolean;
|
|
49
|
+
dispose(): void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { WorkspaceSourceRequest } from './flowContracts.js';
|
|
2
|
+
import type { WorkspaceTokenSourceRequest } from '../tokens/contracts.js';
|
|
3
|
+
import type { WorkspaceApplicationSurface } from '../contracts.js';
|
|
4
|
+
export type WorkspaceDraftPreviewClient = (request: WorkspaceSourceRequest | WorkspaceTokenSourceRequest, options: {
|
|
5
|
+
signal: AbortSignal;
|
|
6
|
+
documentRevision: string;
|
|
7
|
+
modeId?: string;
|
|
8
|
+
}) => Promise<WorkspaceApplicationSurface>;
|
|
9
|
+
/** A hosted implementation can replace this local transport without changing authoring ports. */
|
|
10
|
+
export declare function createWorkspaceDraftPreviewClient(options?: {
|
|
11
|
+
endpoint?: string;
|
|
12
|
+
fetch?: typeof globalThis.fetch;
|
|
13
|
+
}): WorkspaceDraftPreviewClient;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { DesignScreenAssertion, DesignScreenAssertionReport, DesignScreenCaptureFailure, DesignScreenDesiredState, DesignScreenInteraction, DesignScreenInteractionReport, DesignScreenPresetExecutionResult } from '../../editor/designImport.js';
|
|
2
|
+
export interface WorkspaceDraftDocumentContext {
|
|
3
|
+
document: Document;
|
|
4
|
+
window: Window;
|
|
5
|
+
}
|
|
6
|
+
export interface WorkspaceDraftRecipe {
|
|
7
|
+
interactions?: readonly DesignScreenInteraction[];
|
|
8
|
+
assertions?: readonly DesignScreenAssertion[];
|
|
9
|
+
desiredState?: DesignScreenDesiredState;
|
|
10
|
+
}
|
|
11
|
+
export interface WorkspaceDraftRecipeOptions {
|
|
12
|
+
signal?: AbortSignal;
|
|
13
|
+
/** Replaces host-owned state after mount; an omitted desired state is an empty replacement. */
|
|
14
|
+
applyDesiredState?: (state: DesignScreenDesiredState, context: WorkspaceDraftDocumentContext & {
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
}) => DesignScreenPresetExecutionResult | void | Promise<DesignScreenPresetExecutionResult | void>;
|
|
17
|
+
}
|
|
18
|
+
export interface WorkspaceDraftRecipeReport {
|
|
19
|
+
complete: boolean;
|
|
20
|
+
desiredStateApplied: boolean;
|
|
21
|
+
interactions: DesignScreenInteractionReport;
|
|
22
|
+
assertions: DesignScreenAssertionReport;
|
|
23
|
+
failures: readonly DesignScreenCaptureFailure[];
|
|
24
|
+
}
|
|
25
|
+
export declare class WorkspaceDraftRecipeError extends Error {
|
|
26
|
+
readonly report: WorkspaceDraftRecipeReport;
|
|
27
|
+
constructor(report: WorkspaceDraftRecipeReport);
|
|
28
|
+
}
|
|
29
|
+
/** Replays the host recipe inside its mounted artifact, using the same screen runners as implementation capture. */
|
|
30
|
+
export declare function runWorkspaceDraftRecipe(context: WorkspaceDraftDocumentContext, recipe: WorkspaceDraftRecipe, options?: WorkspaceDraftRecipeOptions): Promise<WorkspaceDraftRecipeReport>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { DesignDocument } from '../../document/contracts.js';
|
|
2
|
+
import type { InspectApplyPayload } from '../../editor/inspect.js';
|
|
3
|
+
import type { InspectApplyResult, InspectPreviewResult } from '../../editor/host.js';
|
|
4
|
+
import type { WorkspaceApplicationSurface, WorkspaceTarget } from '../contracts.js';
|
|
5
|
+
import type { WorkspaceVisualSourceDiagnostic, WorkspaceVisualSourceIdentity, WorkspaceVisualSourceMapping } from './contracts.js';
|
|
6
|
+
import type { SourceFilePlan } from '../../host/sourceFilePlan.js';
|
|
7
|
+
export interface WorkspaceSourceBaseline {
|
|
8
|
+
document: DesignDocument;
|
|
9
|
+
mapping: WorkspaceVisualSourceMapping;
|
|
10
|
+
}
|
|
11
|
+
export interface WorkspaceSourceReconcileInput {
|
|
12
|
+
target: WorkspaceTarget;
|
|
13
|
+
baseline: WorkspaceSourceBaseline;
|
|
14
|
+
document: DesignDocument;
|
|
15
|
+
}
|
|
16
|
+
/** A host proves current bytes and explicit source identities before proposing a merge. */
|
|
17
|
+
export type WorkspaceSourceReconcileResult = {
|
|
18
|
+
status: 'ready';
|
|
19
|
+
baseline: WorkspaceSourceBaseline;
|
|
20
|
+
document: DesignDocument;
|
|
21
|
+
} | {
|
|
22
|
+
status: 'conflict';
|
|
23
|
+
diagnostics: readonly WorkspaceVisualSourceDiagnostic[];
|
|
24
|
+
};
|
|
25
|
+
export interface WorkspaceInspectSourceRequest {
|
|
26
|
+
sourceKind?: never;
|
|
27
|
+
/** The controller supplies a detached, deeply frozen capture to every host callback. */
|
|
28
|
+
target: WorkspaceTarget;
|
|
29
|
+
document: DesignDocument;
|
|
30
|
+
identity: WorkspaceVisualSourceIdentity;
|
|
31
|
+
payload: InspectApplyPayload;
|
|
32
|
+
}
|
|
33
|
+
export interface WorkspaceFileSourceRequest {
|
|
34
|
+
sourceKind: 'file-plan';
|
|
35
|
+
target: WorkspaceTarget;
|
|
36
|
+
document: DesignDocument;
|
|
37
|
+
identity: WorkspaceVisualSourceIdentity;
|
|
38
|
+
payload: SourceFilePlan;
|
|
39
|
+
}
|
|
40
|
+
export type WorkspaceSourceRequest = WorkspaceInspectSourceRequest | WorkspaceFileSourceRequest;
|
|
41
|
+
/** Product source ownership stays in the host; review and stale-state policy stay in the editor.
|
|
42
|
+
* A controller captures these callbacks once. Replace the controller when capabilities change.
|
|
43
|
+
* Aborting an apply does not prove that a host-side write was rolled back; its promise must settle.
|
|
44
|
+
*/
|
|
45
|
+
export interface WorkspaceSourceCapabilities {
|
|
46
|
+
loadSource(target: WorkspaceTarget, options: {
|
|
47
|
+
signal: AbortSignal;
|
|
48
|
+
}): Promise<WorkspaceSourceBaseline>;
|
|
49
|
+
/** Refresh a working copy at the same commit. Revision switches require a new target and renderer. */
|
|
50
|
+
reconcileSource?(input: WorkspaceSourceReconcileInput, options: {
|
|
51
|
+
signal: AbortSignal;
|
|
52
|
+
}): Promise<WorkspaceSourceReconcileResult>;
|
|
53
|
+
/** Compile a complete validated document change against server-owned source bytes. */
|
|
54
|
+
compileSource?(input: {
|
|
55
|
+
target: WorkspaceTarget;
|
|
56
|
+
baseline: WorkspaceSourceBaseline;
|
|
57
|
+
document: DesignDocument;
|
|
58
|
+
}, options: {
|
|
59
|
+
signal: AbortSignal;
|
|
60
|
+
}): Promise<SourceFilePlan>;
|
|
61
|
+
previewSource(request: WorkspaceSourceRequest, options: {
|
|
62
|
+
signal: AbortSignal;
|
|
63
|
+
}): Promise<InspectPreviewResult>;
|
|
64
|
+
applySource(request: WorkspaceSourceRequest, options: {
|
|
65
|
+
signal: AbortSignal;
|
|
66
|
+
}): Promise<InspectApplyResult>;
|
|
67
|
+
/** Build an isolated artifact for the exact reviewed document without publishing source. */
|
|
68
|
+
preparePreview?(request: WorkspaceSourceRequest, options: {
|
|
69
|
+
signal: AbortSignal;
|
|
70
|
+
documentRevision: string;
|
|
71
|
+
}): Promise<WorkspaceApplicationSurface>;
|
|
72
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DesignDocument } from '../../document/contracts.js';
|
|
2
|
+
import type { WorkspaceVisualSourceDiagnostic } from './contracts.js';
|
|
3
|
+
/** The prototype runtime is a draft feature; no source-action mapping is declared by this SDK yet. */
|
|
4
|
+
export declare function prototypeSourceDiagnostics(after: DesignDocument, before: DesignDocument): WorkspaceVisualSourceDiagnostic[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ResponsiveLayoutDeclarations, ResponsiveLayoutDocument, ResponsiveLayoutProperty, ResponsiveLayoutRange, WorkspaceResponsiveSourceCompileInput, WorkspaceResponsiveSourceCompileResult } from './responsiveContracts.js';
|
|
2
|
+
/** Only the responsive sidecar may differ. The caller composes other validated source compilers. */
|
|
3
|
+
export declare function compileWorkspaceResponsiveSource(input: WorkspaceResponsiveSourceCompileInput): WorkspaceResponsiveSourceCompileResult;
|
|
4
|
+
/** Authored media overrides resolve over the authored base, without mutating scene geometry. */
|
|
5
|
+
export declare function resolveResponsiveLayout(document: ResponsiveLayoutDocument, nodeId: string, width: number): ResponsiveLayoutDeclarations;
|
|
6
|
+
/** The returned sidecar is suitable for one existing DocumentEngine metadata transaction. */
|
|
7
|
+
export declare function setResponsiveLayoutOverride(state: ResponsiveLayoutDocument, nodeId: string, rangeId: string, property: ResponsiveLayoutProperty, value: string | undefined): ResponsiveLayoutDocument;
|
|
8
|
+
/** Breakpoint order for a range catalog: base first, then max-width ranges by descending width, then min-width ranges by ascending width. */
|
|
9
|
+
export declare function sortResponsiveRanges<T extends ResponsiveLayoutRange>(ranges: readonly T[]): T[];
|
|
10
|
+
/** A preview width that resolves to the selected range; the base range needs a width no media range covers. */
|
|
11
|
+
export declare function responsiveRangePreviewWidth(ranges: readonly ResponsiveLayoutRange[], rangeId: string, preferred?: number): number;
|
|
12
|
+
/** One sentence a panel can show next to a rejected value. */
|
|
13
|
+
export declare function describeResponsiveValueContract(property: string, permitted?: readonly string[]): string;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { DesignDocument } from '../../document/contracts.js';
|
|
2
|
+
import type { InspectApplyPayload, SourceAffectedFrame } from '../../editor/inspect.js';
|
|
3
|
+
import type { WorkspaceTarget } from '../contracts.js';
|
|
4
|
+
import type { WorkspaceSourceFileProof, WorkspaceVisualSourceDiagnostic } from './contracts.js';
|
|
5
|
+
/**
|
|
6
|
+
* Flex controls require a flex source container. Sizing constraints and `display` do not.
|
|
7
|
+
* `display` models a collapsed state only: a media range declares `none`; the base keeps the source display.
|
|
8
|
+
*/
|
|
9
|
+
export type ResponsiveLayoutProperty = 'flex-direction' | 'flex-wrap' | 'align-items' | 'justify-content' | 'gap' | 'padding' | 'width' | 'height' | 'min-width' | 'max-width' | 'min-height' | 'max-height' | 'display';
|
|
10
|
+
export type ResponsiveLayoutDeclarations = Partial<Record<ResponsiveLayoutProperty, string>>;
|
|
11
|
+
/** The host certifies the numeric range and source directive have equivalent semantics. */
|
|
12
|
+
export type ResponsiveRangeSource = {
|
|
13
|
+
kind: 'media';
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'scss-include';
|
|
16
|
+
name: string;
|
|
17
|
+
argument: string;
|
|
18
|
+
proofFile: string;
|
|
19
|
+
};
|
|
20
|
+
export type ResponsiveLayoutRange = {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
/**
|
|
24
|
+
* The first range is base, without media or source. Remaining ranges do not overlap and follow
|
|
25
|
+
* breakpoint order: max-width ranges by descending width, then bounded and min-width ranges by
|
|
26
|
+
* ascending minimum width. One proven mixin maps to one range; a host declares several ranges by
|
|
27
|
+
* pairing each with its own mixin and variable (for example a max-width mixin and a min-width mixin
|
|
28
|
+
* with different variables) or with an explicit media rule.
|
|
29
|
+
*/
|
|
30
|
+
media?: {
|
|
31
|
+
minWidth?: number;
|
|
32
|
+
maxWidth?: number;
|
|
33
|
+
};
|
|
34
|
+
source?: ResponsiveRangeSource;
|
|
35
|
+
};
|
|
36
|
+
/** Canonical authored CSS values. Canvas bounds and generated geometry are never source values. */
|
|
37
|
+
export type ResponsiveLayoutDocument = {
|
|
38
|
+
version: 1;
|
|
39
|
+
ranges: ResponsiveLayoutRange[];
|
|
40
|
+
styles: Record<string, Record<string, ResponsiveLayoutDeclarations>>;
|
|
41
|
+
};
|
|
42
|
+
export interface ResponsiveLayoutSourceTarget {
|
|
43
|
+
nodeId: string;
|
|
44
|
+
file: string;
|
|
45
|
+
className: string;
|
|
46
|
+
componentFile: string;
|
|
47
|
+
affectedFrames: readonly SourceAffectedFrame[];
|
|
48
|
+
/** Every admitted property must have an authored base declaration in the source snapshot. */
|
|
49
|
+
properties: readonly ResponsiveLayoutProperty[];
|
|
50
|
+
/** Token and expression spellings are admitted only by an explicit host allowlist. */
|
|
51
|
+
permittedValues?: Partial<Record<ResponsiveLayoutProperty, readonly string[]>>;
|
|
52
|
+
}
|
|
53
|
+
export interface WorkspaceResponsiveSourceMapping {
|
|
54
|
+
version: 1;
|
|
55
|
+
target: WorkspaceTarget;
|
|
56
|
+
documentId: string;
|
|
57
|
+
baselineFingerprint: string;
|
|
58
|
+
files: readonly WorkspaceSourceFileProof[];
|
|
59
|
+
ranges: readonly ResponsiveLayoutRange[];
|
|
60
|
+
targets: readonly ResponsiveLayoutSourceTarget[];
|
|
61
|
+
}
|
|
62
|
+
export interface WorkspaceResponsiveSourceCompileInput {
|
|
63
|
+
target: WorkspaceTarget;
|
|
64
|
+
before: DesignDocument;
|
|
65
|
+
after: DesignDocument;
|
|
66
|
+
mapping: WorkspaceResponsiveSourceMapping;
|
|
67
|
+
}
|
|
68
|
+
export type WorkspaceResponsiveSourceCompileResult = {
|
|
69
|
+
status: 'ready';
|
|
70
|
+
payload: InspectApplyPayload;
|
|
71
|
+
before: ResponsiveLayoutDocument;
|
|
72
|
+
after: ResponsiveLayoutDocument;
|
|
73
|
+
} | {
|
|
74
|
+
status: 'unchanged';
|
|
75
|
+
} | {
|
|
76
|
+
status: 'blocked';
|
|
77
|
+
diagnostics: readonly WorkspaceVisualSourceDiagnostic[];
|
|
78
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { InspectApplyPayload } from '../../editor/inspect.js';
|
|
2
|
+
import type { WorkspaceStructureSourceOperation, WorkspaceVisualSourceCompileInput, WorkspaceVisualSourceDiagnostic } from './contracts.js';
|
|
3
|
+
/** The CSS module class a wrapper group compiles to, so hosts can address an applied wrapper without re-deriving it. */
|
|
4
|
+
export declare const jsxStructureWrapperClassName: (groupId: string) => string | null;
|
|
5
|
+
export type WorkspaceDocumentSourceChanges = {
|
|
6
|
+
status: 'ready';
|
|
7
|
+
operations: WorkspaceStructureSourceOperation[];
|
|
8
|
+
visualPayload?: InspectApplyPayload;
|
|
9
|
+
} | {
|
|
10
|
+
status: 'unchanged';
|
|
11
|
+
operations: readonly [];
|
|
12
|
+
} | {
|
|
13
|
+
status: 'blocked';
|
|
14
|
+
diagnostics: readonly WorkspaceVisualSourceDiagnostic[];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Plan a complete document delta. Intrinsic leaves keep their source expressions,
|
|
18
|
+
* dimensions and content; only hierarchy, source groups and their declared layouts change.
|
|
19
|
+
* The Node compiler subsequently proves every source range against the AST.
|
|
20
|
+
*/
|
|
21
|
+
export declare function compileWorkspaceDocumentSource(input: WorkspaceVisualSourceCompileInput): WorkspaceDocumentSourceChanges;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { DesignDocument, DocumentNode } from '../../document/contracts.js';
|
|
2
|
+
import type { WorkspaceVisualSourceDiagnostic } from './contracts.js';
|
|
3
|
+
import { type RichTextCharacterKey, type RichTextParagraphKey } from '../../document/richText.js';
|
|
4
|
+
/**
|
|
5
|
+
* The visual compiler edits static JSX text through `properties.text` and node-level `fontSize`/`color`
|
|
6
|
+
* through stylesheet rules. This module decides whether a text node still fits that plain path.
|
|
7
|
+
*/
|
|
8
|
+
export declare const TEXT_SOURCE_MAPPED_PROPERTIES: readonly string[];
|
|
9
|
+
export type RichTextSourceProjection = {
|
|
10
|
+
kind: 'plain';
|
|
11
|
+
text: string; /** Node-level typography with no visual source rule; the draft keeps it. */
|
|
12
|
+
unmappedStyleFields: readonly string[];
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'blocked';
|
|
15
|
+
reason: string;
|
|
16
|
+
text: string;
|
|
17
|
+
varying: {
|
|
18
|
+
character: readonly RichTextCharacterKey[];
|
|
19
|
+
paragraph: readonly RichTextParagraphKey[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
/** Plain when the existing `properties.text` rule can carry the node; blocked, with the reason, when a range differs from the layer. */
|
|
23
|
+
export declare function richTextSourceProjection(node: DocumentNode): RichTextSourceProjection;
|
|
24
|
+
/**
|
|
25
|
+
* Diagnostics the source review can show before the visual compiler reports a generic unmapped field.
|
|
26
|
+
* With a baseline, only nodes whose typography changed are reported; without one, every text node is checked.
|
|
27
|
+
*/
|
|
28
|
+
export declare function richTextSourceDiagnostics(after: DesignDocument, before?: DesignDocument): WorkspaceVisualSourceDiagnostic[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { WorkspaceTokenLibraryController } from './controller.js';
|
|
3
|
+
import type { WorkspaceTokenLibraryCapabilities } from './contracts.js';
|
|
4
|
+
export declare const useTokenLibraryController: () => WorkspaceTokenLibraryController | null;
|
|
5
|
+
export declare const useHasTokenLibraryProvider: () => boolean;
|
|
6
|
+
/** One effect-owned controller spans the Variables dialog and document inspector. */
|
|
7
|
+
export declare function TokenLibraryProvider({ sourceRevision, capabilities, children }: {
|
|
8
|
+
sourceRevision: string;
|
|
9
|
+
capabilities?: WorkspaceTokenLibraryCapabilities;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
import type { EditorRuntime } from '../../core/runtime.js';
|
|
3
|
+
import type { WorkspaceTarget } from '../contracts.js';
|
|
4
|
+
import type { WorkspaceTokenLibraryCapabilities } from './contracts.js';
|
|
5
|
+
|
|
6
|
+
export interface TokenLibraryWorkspaceProps {
|
|
7
|
+
runtime: EditorRuntime;
|
|
8
|
+
sourceRevision: string;
|
|
9
|
+
capabilities: WorkspaceTokenLibraryCapabilities;
|
|
10
|
+
target?: WorkspaceTarget;
|
|
11
|
+
workspaceRoot: RefObject<HTMLDivElement | null>;
|
|
12
|
+
}
|
|
13
|
+
/** The owner is recreated by effects so StrictMode cleanup never reuses a disposed controller. */
|
|
14
|
+
export declare function TokenLibraryWorkspace(props: TokenLibraryWorkspaceProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { VariableValueCodec } from '../../token-library/bindings.js';
|
|
2
|
+
import type { TokenLibraryDiagnostic, TokenLibraryDocument, TokenValue } from '../../token-library/contracts.js';
|
|
3
|
+
import type { SourceFilePlan } from '../../host/sourceFilePlan.js';
|
|
4
|
+
import type { InspectApplyResult, InspectPreviewResult } from '../../editor/host.js';
|
|
5
|
+
import type { WorkspaceApplicationSurface, WorkspaceTarget } from '../contracts.js';
|
|
6
|
+
export interface WorkspaceTokenLibraryBaseline {
|
|
7
|
+
document: TokenLibraryDocument;
|
|
8
|
+
/** Captures token declarations, generator configuration, and the consumer inventory. */
|
|
9
|
+
proofs: SourceFilePlan['proofs'];
|
|
10
|
+
}
|
|
11
|
+
export interface WorkspaceFileSourceIdentity {
|
|
12
|
+
version: 1;
|
|
13
|
+
target: WorkspaceTarget;
|
|
14
|
+
documentId: string;
|
|
15
|
+
beforeFingerprint: string;
|
|
16
|
+
afterFingerprint: string;
|
|
17
|
+
mappingFingerprint: string;
|
|
18
|
+
payloadFingerprint: string;
|
|
19
|
+
fingerprint: string;
|
|
20
|
+
}
|
|
21
|
+
/** Shared-library changes are independent of a screen's visual document draft. */
|
|
22
|
+
export interface WorkspaceTokenSourceRequest {
|
|
23
|
+
sourceKind: 'file-plan';
|
|
24
|
+
target: WorkspaceTarget;
|
|
25
|
+
document: TokenLibraryDocument;
|
|
26
|
+
identity: WorkspaceFileSourceIdentity;
|
|
27
|
+
payload: SourceFilePlan;
|
|
28
|
+
}
|
|
29
|
+
export interface WorkspaceTokenLibraryCapabilities {
|
|
30
|
+
loadLibrary(sourceRevision: string, options: {
|
|
31
|
+
signal: AbortSignal;
|
|
32
|
+
}): Promise<WorkspaceTokenLibraryBaseline>;
|
|
33
|
+
loadDraft?(baseline: WorkspaceTokenLibraryBaseline, options: {
|
|
34
|
+
signal: AbortSignal;
|
|
35
|
+
}): Promise<string | null>;
|
|
36
|
+
saveDraft?(document: TokenLibraryDocument): Promise<void>;
|
|
37
|
+
/** Host codecs preserve the native value type and actual reference syntax. */
|
|
38
|
+
parseValue(document: TokenLibraryDocument, text: string, context: {
|
|
39
|
+
tokenId?: string;
|
|
40
|
+
modeId: string;
|
|
41
|
+
collectionId?: string;
|
|
42
|
+
type?: string;
|
|
43
|
+
format?: string;
|
|
44
|
+
}): TokenValue;
|
|
45
|
+
formatValue(document: TokenLibraryDocument, value: TokenValue): string;
|
|
46
|
+
/** Converts host token syntax to a scalar for document property bindings. */
|
|
47
|
+
resolveBindingValue?: VariableValueCodec;
|
|
48
|
+
/** Optional types for an empty collection; existing declared types are the fallback. */
|
|
49
|
+
availableTypes?(document: TokenLibraryDocument, collectionId: string): readonly string[];
|
|
50
|
+
canAuthorMode?(collectionId: string, modeId: string): boolean;
|
|
51
|
+
validateChange?(before: TokenLibraryDocument, after: TokenLibraryDocument): readonly TokenLibraryDiagnostic[];
|
|
52
|
+
/** Computed custom properties for the actual component canvas, never document-root overrides. */
|
|
53
|
+
previewVariables?(document: TokenLibraryDocument, modeId: string): readonly {
|
|
54
|
+
name: string;
|
|
55
|
+
value: string;
|
|
56
|
+
}[];
|
|
57
|
+
compileSource(input: {
|
|
58
|
+
baseline: WorkspaceTokenLibraryBaseline;
|
|
59
|
+
document: TokenLibraryDocument;
|
|
60
|
+
}, options: {
|
|
61
|
+
signal: AbortSignal;
|
|
62
|
+
}): Promise<SourceFilePlan>;
|
|
63
|
+
previewSource(request: WorkspaceTokenSourceRequest, options: {
|
|
64
|
+
signal: AbortSignal;
|
|
65
|
+
}): Promise<InspectPreviewResult>;
|
|
66
|
+
applySource(request: WorkspaceTokenSourceRequest, options: {
|
|
67
|
+
signal: AbortSignal;
|
|
68
|
+
}): Promise<InspectApplyResult>;
|
|
69
|
+
preparePreview?(request: WorkspaceTokenSourceRequest, options: {
|
|
70
|
+
signal: AbortSignal;
|
|
71
|
+
documentRevision: string;
|
|
72
|
+
modeId: string;
|
|
73
|
+
}): Promise<WorkspaceApplicationSurface>;
|
|
74
|
+
}
|