@coral-viz/viz 0.2.3
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/LICENSE +4 -0
- package/README.md +11 -0
- package/dist/compatibility/CompatibilityEdge.d.ts +106 -0
- package/dist/compatibility/CompatibilityEdge.d.ts.map +1 -0
- package/dist/compatibility/CompatibilityEdge.js +233 -0
- package/dist/compatibility/CompatibilityEdge.js.map +1 -0
- package/dist/compatibility/IncompatibilityTooltip.d.ts +44 -0
- package/dist/compatibility/IncompatibilityTooltip.d.ts.map +1 -0
- package/dist/compatibility/IncompatibilityTooltip.js +145 -0
- package/dist/compatibility/IncompatibilityTooltip.js.map +1 -0
- package/dist/compatibility/index.d.ts +10 -0
- package/dist/compatibility/index.d.ts.map +1 -0
- package/dist/compatibility/index.js +10 -0
- package/dist/compatibility/index.js.map +1 -0
- package/dist/compatibility/useEdgeCompatibility.d.ts +82 -0
- package/dist/compatibility/useEdgeCompatibility.d.ts.map +1 -0
- package/dist/compatibility/useEdgeCompatibility.js +170 -0
- package/dist/compatibility/useEdgeCompatibility.js.map +1 -0
- package/dist/compatibility/validateConnection.d.ts +56 -0
- package/dist/compatibility/validateConnection.d.ts.map +1 -0
- package/dist/compatibility/validateConnection.js +382 -0
- package/dist/compatibility/validateConnection.js.map +1 -0
- package/dist/components/EditContext.d.ts +45 -0
- package/dist/components/EditContext.d.ts.map +1 -0
- package/dist/components/EditContext.js +41 -0
- package/dist/components/EditContext.js.map +1 -0
- package/dist/components/ShapeRenderer.d.ts +35 -0
- package/dist/components/ShapeRenderer.d.ts.map +1 -0
- package/dist/components/ShapeRenderer.js +77 -0
- package/dist/components/ShapeRenderer.js.map +1 -0
- package/dist/components/SymbolNode.d.ts +53 -0
- package/dist/components/SymbolNode.d.ts.map +1 -0
- package/dist/components/SymbolNode.js +333 -0
- package/dist/components/SymbolNode.js.map +1 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +10 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/nodes.d.ts +43 -0
- package/dist/components/nodes.d.ts.map +1 -0
- package/dist/components/nodes.js +111 -0
- package/dist/components/nodes.js.map +1 -0
- package/dist/editor/CoralEditor.d.ts +29 -0
- package/dist/editor/CoralEditor.d.ts.map +1 -0
- package/dist/editor/CoralEditor.js +112 -0
- package/dist/editor/CoralEditor.js.map +1 -0
- package/dist/editor/FileControls.d.ts +34 -0
- package/dist/editor/FileControls.d.ts.map +1 -0
- package/dist/editor/FileControls.js +139 -0
- package/dist/editor/FileControls.js.map +1 -0
- package/dist/editor/LayoutControls.d.ts +41 -0
- package/dist/editor/LayoutControls.d.ts.map +1 -0
- package/dist/editor/LayoutControls.js +124 -0
- package/dist/editor/LayoutControls.js.map +1 -0
- package/dist/editor/converter.d.ts +37 -0
- package/dist/editor/converter.d.ts.map +1 -0
- package/dist/editor/converter.js +256 -0
- package/dist/editor/converter.js.map +1 -0
- package/dist/editor/index.d.ts +8 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/index.js +8 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/file/deserialize.d.ts +15 -0
- package/dist/file/deserialize.d.ts.map +1 -0
- package/dist/file/deserialize.js +145 -0
- package/dist/file/deserialize.js.map +1 -0
- package/dist/file/index.d.ts +15 -0
- package/dist/file/index.d.ts.map +1 -0
- package/dist/file/index.js +20 -0
- package/dist/file/index.js.map +1 -0
- package/dist/file/migrate.d.ts +29 -0
- package/dist/file/migrate.d.ts.map +1 -0
- package/dist/file/migrate.js +103 -0
- package/dist/file/migrate.js.map +1 -0
- package/dist/file/schema.d.ts +385 -0
- package/dist/file/schema.d.ts.map +1 -0
- package/dist/file/schema.js +180 -0
- package/dist/file/schema.js.map +1 -0
- package/dist/file/serialize.d.ts +30 -0
- package/dist/file/serialize.d.ts.map +1 -0
- package/dist/file/serialize.js +218 -0
- package/dist/file/serialize.js.map +1 -0
- package/dist/file/validate.d.ts +21 -0
- package/dist/file/validate.d.ts.map +1 -0
- package/dist/file/validate.js +165 -0
- package/dist/file/validate.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/elk.d.ts +77 -0
- package/dist/layout/elk.d.ts.map +1 -0
- package/dist/layout/elk.js +379 -0
- package/dist/layout/elk.js.map +1 -0
- package/dist/layout/index.d.ts +12 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +12 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/nodeSizing.d.ts +65 -0
- package/dist/layout/nodeSizing.d.ts.map +1 -0
- package/dist/layout/nodeSizing.js +319 -0
- package/dist/layout/nodeSizing.js.map +1 -0
- package/dist/layout/positionStability.d.ts +73 -0
- package/dist/layout/positionStability.d.ts.map +1 -0
- package/dist/layout/positionStability.js +199 -0
- package/dist/layout/positionStability.js.map +1 -0
- package/dist/layout/useAxisConstrain.d.ts +20 -0
- package/dist/layout/useAxisConstrain.d.ts.map +1 -0
- package/dist/layout/useAxisConstrain.js +106 -0
- package/dist/layout/useAxisConstrain.js.map +1 -0
- package/dist/layout/useDiagramState.d.ts +92 -0
- package/dist/layout/useDiagramState.d.ts.map +1 -0
- package/dist/layout/useDiagramState.js +256 -0
- package/dist/layout/useDiagramState.js.map +1 -0
- package/dist/layout/useLayoutHistory.d.ts +53 -0
- package/dist/layout/useLayoutHistory.d.ts.map +1 -0
- package/dist/layout/useLayoutHistory.js +124 -0
- package/dist/layout/useLayoutHistory.js.map +1 -0
- package/dist/properties/NodePropertiesPanel.d.ts +47 -0
- package/dist/properties/NodePropertiesPanel.d.ts.map +1 -0
- package/dist/properties/NodePropertiesPanel.js +199 -0
- package/dist/properties/NodePropertiesPanel.js.map +1 -0
- package/dist/properties/index.d.ts +10 -0
- package/dist/properties/index.d.ts.map +1 -0
- package/dist/properties/index.js +10 -0
- package/dist/properties/index.js.map +1 -0
- package/dist/properties/propertyUtils.d.ts +60 -0
- package/dist/properties/propertyUtils.d.ts.map +1 -0
- package/dist/properties/propertyUtils.js +89 -0
- package/dist/properties/propertyUtils.js.map +1 -0
- package/dist/settings/FontSettingsForm.d.ts +28 -0
- package/dist/settings/FontSettingsForm.d.ts.map +1 -0
- package/dist/settings/FontSettingsForm.js +129 -0
- package/dist/settings/FontSettingsForm.js.map +1 -0
- package/dist/settings/LayoutSettingsForm.d.ts +37 -0
- package/dist/settings/LayoutSettingsForm.d.ts.map +1 -0
- package/dist/settings/LayoutSettingsForm.js +165 -0
- package/dist/settings/LayoutSettingsForm.js.map +1 -0
- package/dist/settings/SettingsPanel.d.ts +55 -0
- package/dist/settings/SettingsPanel.d.ts.map +1 -0
- package/dist/settings/SettingsPanel.js +84 -0
- package/dist/settings/SettingsPanel.js.map +1 -0
- package/dist/settings/index.d.ts +13 -0
- package/dist/settings/index.d.ts.map +1 -0
- package/dist/settings/index.js +13 -0
- package/dist/settings/index.js.map +1 -0
- package/dist/settings/useSettings.d.ts +51 -0
- package/dist/settings/useSettings.d.ts.map +1 -0
- package/dist/settings/useSettings.js +154 -0
- package/dist/settings/useSettings.js.map +1 -0
- package/dist/text-editor/SplitEditor.d.ts +72 -0
- package/dist/text-editor/SplitEditor.d.ts.map +1 -0
- package/dist/text-editor/SplitEditor.js +172 -0
- package/dist/text-editor/SplitEditor.js.map +1 -0
- package/dist/text-editor/TextEditor.d.ts +53 -0
- package/dist/text-editor/TextEditor.d.ts.map +1 -0
- package/dist/text-editor/TextEditor.js +181 -0
- package/dist/text-editor/TextEditor.js.map +1 -0
- package/dist/text-editor/hooks/useBidirectionalSync.d.ts +106 -0
- package/dist/text-editor/hooks/useBidirectionalSync.d.ts.map +1 -0
- package/dist/text-editor/hooks/useBidirectionalSync.js +151 -0
- package/dist/text-editor/hooks/useBidirectionalSync.js.map +1 -0
- package/dist/text-editor/index.d.ts +9 -0
- package/dist/text-editor/index.d.ts.map +1 -0
- package/dist/text-editor/index.js +11 -0
- package/dist/text-editor/index.js.map +1 -0
- package/dist/types.d.ts +242 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/waypoints/index.d.ts +8 -0
- package/dist/waypoints/index.d.ts.map +1 -0
- package/dist/waypoints/index.js +7 -0
- package/dist/waypoints/index.js.map +1 -0
- package/dist/waypoints/operations.d.ts +29 -0
- package/dist/waypoints/operations.d.ts.map +1 -0
- package/dist/waypoints/operations.js +85 -0
- package/dist/waypoints/operations.js.map +1 -0
- package/dist/waypoints/router.d.ts +23 -0
- package/dist/waypoints/router.d.ts.map +1 -0
- package/dist/waypoints/router.js +109 -0
- package/dist/waypoints/router.js.map +1 -0
- package/dist/waypoints/types.d.ts +15 -0
- package/dist/waypoints/types.d.ts.map +1 -0
- package/dist/waypoints/types.js +5 -0
- package/dist/waypoints/types.js.map +1 -0
- package/dist/waypoints/useWaypointManager.d.ts +38 -0
- package/dist/waypoints/useWaypointManager.d.ts.map +1 -0
- package/dist/waypoints/useWaypointManager.js +106 -0
- package/dist/waypoints/useWaypointManager.js.map +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coral Document Schema (CORAL-REQ-008)
|
|
3
|
+
*
|
|
4
|
+
* Defines the TypeScript types for the Coral file format.
|
|
5
|
+
* File extension: .coral.json
|
|
6
|
+
*/
|
|
7
|
+
import type { GraphIR, SizingMode } from '../types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Current schema version. Increment when making breaking changes.
|
|
10
|
+
*/
|
|
11
|
+
export declare const CURRENT_SCHEMA_VERSION = "1.0.0";
|
|
12
|
+
/**
|
|
13
|
+
* Supported schema versions for migration
|
|
14
|
+
*/
|
|
15
|
+
export declare const SUPPORTED_SCHEMA_VERSIONS: readonly ["0.9.0", "1.0.0", "1.0"];
|
|
16
|
+
/**
|
|
17
|
+
* Document metadata
|
|
18
|
+
*/
|
|
19
|
+
export interface DocumentMetadata {
|
|
20
|
+
/** Document name (required) */
|
|
21
|
+
name: string;
|
|
22
|
+
/** Optional description */
|
|
23
|
+
description?: string;
|
|
24
|
+
/** Optional tags for organization */
|
|
25
|
+
tags?: string[];
|
|
26
|
+
/** User-defined document version */
|
|
27
|
+
version?: string;
|
|
28
|
+
/** ISO 8601 timestamp of creation */
|
|
29
|
+
created: string;
|
|
30
|
+
/** ISO 8601 timestamp of last modification */
|
|
31
|
+
modified: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Layout direction options
|
|
35
|
+
*/
|
|
36
|
+
export type LayoutDirection = 'UP' | 'DOWN' | 'LEFT' | 'RIGHT';
|
|
37
|
+
/**
|
|
38
|
+
* Layout spacing options
|
|
39
|
+
*/
|
|
40
|
+
export interface LayoutSpacing {
|
|
41
|
+
/** Spacing between nodes */
|
|
42
|
+
nodeNode?: number;
|
|
43
|
+
/** Spacing between edges and nodes */
|
|
44
|
+
edgeNode?: number;
|
|
45
|
+
/** Spacing between layers (for layered algorithm) */
|
|
46
|
+
layerSpacing?: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Layout configuration
|
|
50
|
+
*/
|
|
51
|
+
export interface LayoutSettings {
|
|
52
|
+
/** Layout algorithm (e.g., 'layered', 'stress', 'force') */
|
|
53
|
+
algorithm: string;
|
|
54
|
+
/** Layout direction */
|
|
55
|
+
direction: LayoutDirection;
|
|
56
|
+
/** Spacing options */
|
|
57
|
+
spacing?: LayoutSpacing;
|
|
58
|
+
/** Additional ELK options as key-value pairs */
|
|
59
|
+
elkOptions?: Record<string, string | number | boolean>;
|
|
60
|
+
/** Node sizing mode (CORAL-REQ-011) */
|
|
61
|
+
sizingMode?: SizingMode;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Document settings (saved with file)
|
|
65
|
+
*/
|
|
66
|
+
export interface DocumentSettings {
|
|
67
|
+
/** Notation type (e.g., 'flowchart', 'bpmn', 'erd') */
|
|
68
|
+
notation: string;
|
|
69
|
+
/** Layout configuration */
|
|
70
|
+
layout: LayoutSettings;
|
|
71
|
+
/** Font settings (CORAL-REQ-012) */
|
|
72
|
+
font?: DiagramFontSettings;
|
|
73
|
+
/** Suppress error annotations on edges (issues still appear in diagnostics log) */
|
|
74
|
+
suppressErrorAnnotations?: boolean;
|
|
75
|
+
/** Suppress warning annotations on edges (issues still appear in diagnostics log) */
|
|
76
|
+
suppressWarningAnnotations?: boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* View state for restoring exact view
|
|
80
|
+
*/
|
|
81
|
+
export interface ViewState {
|
|
82
|
+
/** Zoom level */
|
|
83
|
+
zoom: number;
|
|
84
|
+
/** Pan offset */
|
|
85
|
+
pan: {
|
|
86
|
+
x: number;
|
|
87
|
+
y: number;
|
|
88
|
+
};
|
|
89
|
+
/** Currently selected node IDs */
|
|
90
|
+
selectedNodes?: string[];
|
|
91
|
+
/** If true, fit view on load instead of using zoom/pan */
|
|
92
|
+
fitView?: boolean;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Node position
|
|
96
|
+
*/
|
|
97
|
+
export interface NodePosition {
|
|
98
|
+
x: number;
|
|
99
|
+
y: number;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* DSL content type
|
|
103
|
+
*/
|
|
104
|
+
export type DslType = 'coral' | 'mermaid' | 'dot';
|
|
105
|
+
/**
|
|
106
|
+
* Document content - either DSL text or Graph-IR
|
|
107
|
+
*/
|
|
108
|
+
export interface DocumentContent {
|
|
109
|
+
/** Content format */
|
|
110
|
+
format: 'dsl' | 'graph-ir';
|
|
111
|
+
/** DSL type if format is 'dsl' */
|
|
112
|
+
dslType?: DslType;
|
|
113
|
+
/** DSL text if format is 'dsl' */
|
|
114
|
+
text?: string;
|
|
115
|
+
/** Graph-IR if format is 'graph-ir' */
|
|
116
|
+
graphIR?: GraphIR;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Saved waypoint data for manual edge routing (CORAL-REQ-015)
|
|
120
|
+
*/
|
|
121
|
+
export interface SavedWaypoint {
|
|
122
|
+
id: string;
|
|
123
|
+
x: number;
|
|
124
|
+
y: number;
|
|
125
|
+
type: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Saved edge routing data (ELK-compatible bend points)
|
|
129
|
+
*/
|
|
130
|
+
export interface EdgeRoutingData {
|
|
131
|
+
/** Bend point coordinates */
|
|
132
|
+
bendPoints: NodePosition[];
|
|
133
|
+
/** Whether this routing was user-pinned (vs computed) */
|
|
134
|
+
isPinned: boolean;
|
|
135
|
+
/** User-placed waypoints (CORAL-REQ-015) — present when isPinned is true */
|
|
136
|
+
waypoints?: SavedWaypoint[];
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Coral Document - the complete file format
|
|
140
|
+
*/
|
|
141
|
+
export interface CoralDocument {
|
|
142
|
+
/** Schema version for migrations */
|
|
143
|
+
schemaVersion: string;
|
|
144
|
+
/** Document metadata */
|
|
145
|
+
metadata: DocumentMetadata;
|
|
146
|
+
/** Document content */
|
|
147
|
+
content: DocumentContent;
|
|
148
|
+
/** Document settings */
|
|
149
|
+
settings: DocumentSettings;
|
|
150
|
+
/** Optional view state for restoring exact view */
|
|
151
|
+
viewState?: ViewState;
|
|
152
|
+
/** Node positions (for preserving manual layout) */
|
|
153
|
+
nodePositions?: Record<string, NodePosition>;
|
|
154
|
+
/** Edge routing data (bend points, keyed by edge ID) */
|
|
155
|
+
edgeRouting?: Record<string, EdgeRoutingData>;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Options for creating a new document
|
|
159
|
+
*/
|
|
160
|
+
export interface CreateDocumentOptions {
|
|
161
|
+
/** Document name (required) */
|
|
162
|
+
name: string;
|
|
163
|
+
/** Optional description */
|
|
164
|
+
description?: string;
|
|
165
|
+
/** Optional tags */
|
|
166
|
+
tags?: string[];
|
|
167
|
+
/** Optional version */
|
|
168
|
+
version?: string;
|
|
169
|
+
/** Content configuration */
|
|
170
|
+
content?: Partial<DocumentContent>;
|
|
171
|
+
/** Settings configuration */
|
|
172
|
+
settings?: Partial<DocumentSettings>;
|
|
173
|
+
/** View state */
|
|
174
|
+
viewState?: ViewState;
|
|
175
|
+
/** Node positions */
|
|
176
|
+
nodePositions?: Record<string, NodePosition>;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Options for serializing nodes/edges
|
|
180
|
+
*/
|
|
181
|
+
export interface SerializeOptions {
|
|
182
|
+
/** Document name (required) */
|
|
183
|
+
name: string;
|
|
184
|
+
/** Optional description */
|
|
185
|
+
description?: string;
|
|
186
|
+
/** Optional tags */
|
|
187
|
+
tags?: string[];
|
|
188
|
+
/** Optional version */
|
|
189
|
+
version?: string;
|
|
190
|
+
/** Settings configuration */
|
|
191
|
+
settings?: Partial<DocumentSettings>;
|
|
192
|
+
/** View state */
|
|
193
|
+
viewState?: ViewState;
|
|
194
|
+
/** Existing created timestamp (for updates) */
|
|
195
|
+
created?: string;
|
|
196
|
+
/** Existing GraphIR envelope whose graph-level fields must survive a save. */
|
|
197
|
+
graphIR?: GraphIR;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Result of deserializing a document
|
|
201
|
+
*/
|
|
202
|
+
export interface DeserializeResult {
|
|
203
|
+
/** React Flow nodes */
|
|
204
|
+
nodes: import('../types.js').CoralNode[];
|
|
205
|
+
/** React Flow edges */
|
|
206
|
+
edges: import('../types.js').CoralEdge[];
|
|
207
|
+
/** Document settings */
|
|
208
|
+
settings: DocumentSettings;
|
|
209
|
+
/** View state (if present) */
|
|
210
|
+
viewState?: ViewState;
|
|
211
|
+
/** Document metadata */
|
|
212
|
+
metadata: DocumentMetadata;
|
|
213
|
+
/** Restored edge waypoints (CORAL-REQ-015) — Map<edgeId, waypoints> */
|
|
214
|
+
edgeWaypoints?: Map<string, Array<{
|
|
215
|
+
id: string;
|
|
216
|
+
x: number;
|
|
217
|
+
y: number;
|
|
218
|
+
type: string;
|
|
219
|
+
}>>;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Validation result
|
|
223
|
+
*/
|
|
224
|
+
export interface ValidationResult {
|
|
225
|
+
/** Whether the document is valid */
|
|
226
|
+
valid: boolean;
|
|
227
|
+
/** List of validation errors */
|
|
228
|
+
errors: string[];
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Font settings for diagram text
|
|
232
|
+
*/
|
|
233
|
+
export interface FontSettings {
|
|
234
|
+
/** Font family (CSS font-family value) */
|
|
235
|
+
family: string;
|
|
236
|
+
/** Font size in pixels */
|
|
237
|
+
size: number;
|
|
238
|
+
/** Font weight */
|
|
239
|
+
weight: 'normal' | 'bold' | number;
|
|
240
|
+
/** Line height multiplier */
|
|
241
|
+
lineHeight: number;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Diagram font settings with optional symbol overrides
|
|
245
|
+
*/
|
|
246
|
+
export interface DiagramFontSettings {
|
|
247
|
+
/** Default font settings for all text */
|
|
248
|
+
default: FontSettings;
|
|
249
|
+
/** Override font settings for specific symbol types */
|
|
250
|
+
symbolOverrides?: Record<string, Partial<FontSettings>>;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Font family preset
|
|
254
|
+
*/
|
|
255
|
+
export interface FontFamilyPreset {
|
|
256
|
+
id: string;
|
|
257
|
+
name: string;
|
|
258
|
+
family: string;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Font size preset
|
|
262
|
+
*/
|
|
263
|
+
export interface FontSizePreset {
|
|
264
|
+
id: string;
|
|
265
|
+
name: string;
|
|
266
|
+
size: number;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Default font settings
|
|
270
|
+
*/
|
|
271
|
+
export declare const DEFAULT_FONT_SETTINGS: FontSettings;
|
|
272
|
+
/**
|
|
273
|
+
* Font family presets
|
|
274
|
+
*/
|
|
275
|
+
export declare const FONT_FAMILY_PRESETS: FontFamilyPreset[];
|
|
276
|
+
/**
|
|
277
|
+
* Font size presets
|
|
278
|
+
*/
|
|
279
|
+
export declare const FONT_SIZE_PRESETS: FontSizePreset[];
|
|
280
|
+
/**
|
|
281
|
+
* Get a font family preset by ID
|
|
282
|
+
*/
|
|
283
|
+
export declare function getFontFamilyPreset(id: string): FontFamilyPreset | undefined;
|
|
284
|
+
/**
|
|
285
|
+
* Get a font size preset by ID
|
|
286
|
+
*/
|
|
287
|
+
export declare function getFontSizePreset(id: string): FontSizePreset | undefined;
|
|
288
|
+
/**
|
|
289
|
+
* ELK edge routing options
|
|
290
|
+
*/
|
|
291
|
+
export type EdgeRouting = 'ORTHOGONAL' | 'POLYLINE' | 'SPLINES';
|
|
292
|
+
/**
|
|
293
|
+
* ELK layout algorithm options
|
|
294
|
+
*/
|
|
295
|
+
export type LayoutAlgorithm = 'layered' | 'mrtree' | 'stress' | 'force' | 'radial' | 'box';
|
|
296
|
+
/**
|
|
297
|
+
* Layout preset identifier
|
|
298
|
+
*/
|
|
299
|
+
export type LayoutPresetId = 'flowchart' | 'org-chart' | 'network' | 'radial' | 'custom';
|
|
300
|
+
/**
|
|
301
|
+
* Layout preset definition
|
|
302
|
+
*/
|
|
303
|
+
export interface LayoutPreset {
|
|
304
|
+
/** Unique identifier */
|
|
305
|
+
id: LayoutPresetId;
|
|
306
|
+
/** Display name */
|
|
307
|
+
name: string;
|
|
308
|
+
/** Description of when to use this preset */
|
|
309
|
+
description: string;
|
|
310
|
+
/** Preset settings */
|
|
311
|
+
settings: LayoutSettings;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* LLM provider identifier for AI generation
|
|
315
|
+
*/
|
|
316
|
+
export type LLMProviderPreference = 'anthropic' | 'openai' | 'google' | 'mistral';
|
|
317
|
+
/**
|
|
318
|
+
* Speech recognition mode for voice input (#49)
|
|
319
|
+
* - 'local': On-device Whisper via Web Worker (default)
|
|
320
|
+
* - 'browser': Native Web Speech API (Chrome/Edge, sends audio to cloud)
|
|
321
|
+
* - 'off': Disabled
|
|
322
|
+
*/
|
|
323
|
+
export type SpeechRecognitionMode = 'local' | 'browser' | 'off';
|
|
324
|
+
/**
|
|
325
|
+
* User preferences stored in localStorage
|
|
326
|
+
* These are NOT saved with the document
|
|
327
|
+
*/
|
|
328
|
+
export interface UserPreferences {
|
|
329
|
+
/** Default notation for new diagrams */
|
|
330
|
+
defaultNotation: string;
|
|
331
|
+
/** Default layout preset for new diagrams */
|
|
332
|
+
defaultLayoutPreset: LayoutPresetId;
|
|
333
|
+
/** Theme (future use) */
|
|
334
|
+
theme: 'light' | 'dark' | 'system';
|
|
335
|
+
/** Show minimap by default */
|
|
336
|
+
showMinimap: boolean;
|
|
337
|
+
/** Show controls by default */
|
|
338
|
+
showControls: boolean;
|
|
339
|
+
/** Fit view on load */
|
|
340
|
+
fitViewOnLoad: boolean;
|
|
341
|
+
/** Auto-save interval in ms (0 = disabled) */
|
|
342
|
+
autoSaveInterval: number;
|
|
343
|
+
/** Remember last opened files */
|
|
344
|
+
recentFiles: string[];
|
|
345
|
+
/** Maximum recent files to remember */
|
|
346
|
+
maxRecentFiles: number;
|
|
347
|
+
/** LLM provider for AI generation */
|
|
348
|
+
llmProvider: LLMProviderPreference;
|
|
349
|
+
/** LLM model for AI generation */
|
|
350
|
+
llmModel: string;
|
|
351
|
+
/** Whether to save API key to localStorage */
|
|
352
|
+
llmSaveApiKey: boolean;
|
|
353
|
+
/** Saved API key (only if llmSaveApiKey is true) */
|
|
354
|
+
llmSavedApiKey: string;
|
|
355
|
+
/** Speech recognition mode for voice input (#49) */
|
|
356
|
+
speechRecognitionMode: SpeechRecognitionMode;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Default user preferences
|
|
360
|
+
*/
|
|
361
|
+
export declare const DEFAULT_USER_PREFERENCES: UserPreferences;
|
|
362
|
+
/**
|
|
363
|
+
* Default layout settings
|
|
364
|
+
*/
|
|
365
|
+
export declare const DEFAULT_LAYOUT_SETTINGS: LayoutSettings;
|
|
366
|
+
/**
|
|
367
|
+
* Layout presets
|
|
368
|
+
*/
|
|
369
|
+
export declare const LAYOUT_PRESETS: LayoutPreset[];
|
|
370
|
+
/**
|
|
371
|
+
* Get a layout preset by ID
|
|
372
|
+
*/
|
|
373
|
+
export declare function getLayoutPreset(id: LayoutPresetId): LayoutPreset | undefined;
|
|
374
|
+
/**
|
|
375
|
+
* Combined settings for the settings panel
|
|
376
|
+
*/
|
|
377
|
+
export interface SettingsPanelState {
|
|
378
|
+
/** Document-level settings (saved with file) */
|
|
379
|
+
document: DocumentSettings;
|
|
380
|
+
/** User preferences (saved to localStorage) */
|
|
381
|
+
user: UserPreferences;
|
|
382
|
+
/** Currently selected preset (for UI display) */
|
|
383
|
+
selectedPreset: LayoutPresetId;
|
|
384
|
+
}
|
|
385
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/file/schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,sBAAsB,UAAU,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,yBAAyB,oCAAqC,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,M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;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,8CAA8C;IAC9C,gBAAgB,EAAE,MAAM,CAAC;IACzB,iCAAiC;IACjC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,uCAAuC;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,qCAAqC;IACrC,WAAW,EAAE,qBAAqB,CAAC;IACnC,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,aAAa,EAAE,OAAO,CAAC;IACvB,oDAAoD;IACpD,cAAc,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,qBAAqB,EAAE,qBAAqB,CAAC;CAC9C;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,eAetC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,cAYrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,YAAY,EA4DxC,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,cAAc,GAAG,YAAY,GAAG,SAAS,CAE5E;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,+CAA+C;IAC/C,IAAI,EAAE,eAAe,CAAC;IACtB,iDAAiD;IACjD,cAAc,EAAE,cAAc,CAAC;CAChC"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coral Document Schema (CORAL-REQ-008)
|
|
3
|
+
*
|
|
4
|
+
* Defines the TypeScript types for the Coral file format.
|
|
5
|
+
* File extension: .coral.json
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Current schema version. Increment when making breaking changes.
|
|
9
|
+
*/
|
|
10
|
+
export const CURRENT_SCHEMA_VERSION = '1.0.0';
|
|
11
|
+
/**
|
|
12
|
+
* Supported schema versions for migration
|
|
13
|
+
*/
|
|
14
|
+
export const SUPPORTED_SCHEMA_VERSIONS = ['0.9.0', '1.0.0', '1.0'];
|
|
15
|
+
/**
|
|
16
|
+
* Default font settings
|
|
17
|
+
*/
|
|
18
|
+
export const DEFAULT_FONT_SETTINGS = {
|
|
19
|
+
family: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
20
|
+
size: 14,
|
|
21
|
+
weight: 'normal',
|
|
22
|
+
lineHeight: 1.3,
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Font family presets
|
|
26
|
+
*/
|
|
27
|
+
export const FONT_FAMILY_PRESETS = [
|
|
28
|
+
{
|
|
29
|
+
id: 'system',
|
|
30
|
+
name: 'System',
|
|
31
|
+
family: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'sans',
|
|
35
|
+
name: 'Sans Serif',
|
|
36
|
+
family: '"Inter", "Helvetica Neue", Arial, sans-serif',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'serif',
|
|
40
|
+
name: 'Serif',
|
|
41
|
+
family: '"Georgia", "Times New Roman", serif',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'mono',
|
|
45
|
+
name: 'Monospace',
|
|
46
|
+
family: '"JetBrains Mono", "Fira Code", "Consolas", monospace',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'handwritten',
|
|
50
|
+
name: 'Handwritten',
|
|
51
|
+
family: '"Comic Neue", "Comic Sans MS", cursive',
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
/**
|
|
55
|
+
* Font size presets
|
|
56
|
+
*/
|
|
57
|
+
export const FONT_SIZE_PRESETS = [
|
|
58
|
+
{ id: 'small', name: 'Small', size: 11 },
|
|
59
|
+
{ id: 'normal', name: 'Normal', size: 14 },
|
|
60
|
+
{ id: 'large', name: 'Large', size: 16 },
|
|
61
|
+
{ id: 'xlarge', name: 'Extra Large', size: 18 },
|
|
62
|
+
];
|
|
63
|
+
/**
|
|
64
|
+
* Get a font family preset by ID
|
|
65
|
+
*/
|
|
66
|
+
export function getFontFamilyPreset(id) {
|
|
67
|
+
return FONT_FAMILY_PRESETS.find((p) => p.id === id);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Get a font size preset by ID
|
|
71
|
+
*/
|
|
72
|
+
export function getFontSizePreset(id) {
|
|
73
|
+
return FONT_SIZE_PRESETS.find((p) => p.id === id);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Default user preferences
|
|
77
|
+
*/
|
|
78
|
+
export const DEFAULT_USER_PREFERENCES = {
|
|
79
|
+
defaultNotation: 'flowchart',
|
|
80
|
+
defaultLayoutPreset: 'flowchart',
|
|
81
|
+
theme: 'system',
|
|
82
|
+
showMinimap: true,
|
|
83
|
+
showControls: true,
|
|
84
|
+
fitViewOnLoad: true,
|
|
85
|
+
autoSaveInterval: 0,
|
|
86
|
+
recentFiles: [],
|
|
87
|
+
maxRecentFiles: 10,
|
|
88
|
+
llmProvider: 'anthropic',
|
|
89
|
+
llmModel: 'claude-sonnet-4-5-20250929',
|
|
90
|
+
llmSaveApiKey: false,
|
|
91
|
+
llmSavedApiKey: '',
|
|
92
|
+
speechRecognitionMode: 'local',
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Default layout settings
|
|
96
|
+
*/
|
|
97
|
+
export const DEFAULT_LAYOUT_SETTINGS = {
|
|
98
|
+
algorithm: 'layered',
|
|
99
|
+
direction: 'DOWN',
|
|
100
|
+
spacing: {
|
|
101
|
+
nodeNode: 50,
|
|
102
|
+
edgeNode: 20,
|
|
103
|
+
layerSpacing: 70,
|
|
104
|
+
},
|
|
105
|
+
elkOptions: {
|
|
106
|
+
'elk.edgeRouting': 'ORTHOGONAL',
|
|
107
|
+
},
|
|
108
|
+
sizingMode: 'adaptive',
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Layout presets
|
|
112
|
+
*/
|
|
113
|
+
export const LAYOUT_PRESETS = [
|
|
114
|
+
{
|
|
115
|
+
id: 'flowchart',
|
|
116
|
+
name: 'Flowchart',
|
|
117
|
+
description: 'Top-to-bottom layered layout, ideal for process flows',
|
|
118
|
+
settings: {
|
|
119
|
+
algorithm: 'layered',
|
|
120
|
+
direction: 'DOWN',
|
|
121
|
+
spacing: { nodeNode: 50, layerSpacing: 70 },
|
|
122
|
+
elkOptions: { 'elk.edgeRouting': 'ORTHOGONAL' },
|
|
123
|
+
sizingMode: 'adaptive',
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: 'org-chart',
|
|
128
|
+
name: 'Org Chart',
|
|
129
|
+
description: 'Tree layout for hierarchical structures',
|
|
130
|
+
settings: {
|
|
131
|
+
algorithm: 'mrtree',
|
|
132
|
+
direction: 'DOWN',
|
|
133
|
+
spacing: { nodeNode: 40, layerSpacing: 80 },
|
|
134
|
+
elkOptions: {
|
|
135
|
+
'elk.edgeRouting': 'POLYLINE',
|
|
136
|
+
'elk.mrtree.weighting': 'CONSTRAINT',
|
|
137
|
+
},
|
|
138
|
+
sizingMode: 'uniform',
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: 'network',
|
|
143
|
+
name: 'Network',
|
|
144
|
+
description: 'Force-directed layout for even distribution',
|
|
145
|
+
settings: {
|
|
146
|
+
algorithm: 'stress',
|
|
147
|
+
direction: 'DOWN',
|
|
148
|
+
spacing: { nodeNode: 80 },
|
|
149
|
+
elkOptions: {
|
|
150
|
+
'elk.stress.desiredEdgeLength': '100',
|
|
151
|
+
},
|
|
152
|
+
sizingMode: 'adaptive',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: 'radial',
|
|
157
|
+
name: 'Radial',
|
|
158
|
+
description: 'Circular layout radiating from a center point',
|
|
159
|
+
settings: {
|
|
160
|
+
algorithm: 'radial',
|
|
161
|
+
direction: 'DOWN',
|
|
162
|
+
spacing: { nodeNode: 60, layerSpacing: 100 },
|
|
163
|
+
elkOptions: {},
|
|
164
|
+
sizingMode: 'adaptive',
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: 'custom',
|
|
169
|
+
name: 'Custom',
|
|
170
|
+
description: 'Manual configuration of layout options',
|
|
171
|
+
settings: DEFAULT_LAYOUT_SETTINGS,
|
|
172
|
+
},
|
|
173
|
+
];
|
|
174
|
+
/**
|
|
175
|
+
* Get a layout preset by ID
|
|
176
|
+
*/
|
|
177
|
+
export function getLayoutPreset(id) {
|
|
178
|
+
return LAYOUT_PRESETS.find((p) => p.id === id);
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/file/schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAU,CAAC;AA8Q5E;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAiB;IACjD,MAAM,EAAE,mEAAmE;IAC3E,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,GAAG;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAuB;IACrD;QACE,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,mEAAmE;KAC5E;IACD;QACE,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,8CAA8C;KACvD;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,qCAAqC;KAC9C;IACD;QACE,E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E,EAAE,QAAQ,EAAE,EAAE,EAAE;YACzB,UAAU,EAAE;gBACV,8BAA8B,EAAE,KAAK;aACtC;YACD,UAAU,EAAE,UAAU;SACvB;KACF;IACD;QACE,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,+CAA+C;QAC5D,QAAQ,EAAE;YACR,SAAS,EAAE,QAAQ;YACnB,SAAS,EAAE,MAAM;YACjB,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE;YAC5C,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,UAAU;SACvB;KACF;IACD;QACE,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,wCAAwC;QACrD,QAAQ,EAAE,uBAAuB;KAClC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,EAAkB;IAChD,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coral Document Serialization (CORAL-REQ-008)
|
|
3
|
+
*
|
|
4
|
+
* Converts React Flow nodes/edges to CoralDocument format.
|
|
5
|
+
*/
|
|
6
|
+
import type { CoralNode, CoralEdge } from '../types.js';
|
|
7
|
+
import type { CoralDocument, CreateDocumentOptions, SerializeOptions } from './schema.js';
|
|
8
|
+
/**
|
|
9
|
+
* Create a new CoralDocument with default values
|
|
10
|
+
*
|
|
11
|
+
* @param options - Document creation options
|
|
12
|
+
* @returns New CoralDocument
|
|
13
|
+
*/
|
|
14
|
+
export declare function createDocument(options: CreateDocumentOptions): CoralDocument;
|
|
15
|
+
/**
|
|
16
|
+
* Serialize React Flow nodes and edges to a CoralDocument
|
|
17
|
+
*
|
|
18
|
+
* @param nodes - React Flow nodes
|
|
19
|
+
* @param edges - React Flow edges
|
|
20
|
+
* @param options - Serialization options
|
|
21
|
+
* @param waypointMap - Optional map of edge ID to waypoints (CORAL-REQ-015)
|
|
22
|
+
* @returns CoralDocument
|
|
23
|
+
*/
|
|
24
|
+
export declare function serialize(nodes: CoralNode[], edges: CoralEdge[], options: SerializeOptions, waypointMap?: Map<string, Array<{
|
|
25
|
+
id: string;
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
type: string;
|
|
29
|
+
}>>): CoralDocument;
|
|
30
|
+
//# sourceMappingURL=serialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/file/serialize.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAiC,MAAM,aAAa,CAAC;AACvF,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAKjB,MAAM,aAAa,CAAC;AAuBrB;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,aAAa,CAqC5E;AAoED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,SAAS,EAAE,EAClB,KAAK,EAAE,SAAS,EAAE,EAClB,OAAO,EAAE,gBAAgB,EACzB,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,GACnF,aAAa,CAoFf"}
|