@cere/cere-design-system 0.0.45 → 0.1.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/dist/WorkflowNode-BnxXO6t_.d.mts +46 -0
- package/dist/WorkflowNode-BnxXO6t_.d.ts +46 -0
- package/dist/buttons.d.mts +114 -0
- package/dist/buttons.d.ts +114 -0
- package/dist/buttons.js +19 -0
- package/dist/buttons.js.map +1 -0
- package/dist/buttons.mjs +19 -0
- package/dist/buttons.mjs.map +1 -0
- package/dist/carousel.d.mts +51 -0
- package/dist/carousel.d.ts +51 -0
- package/dist/carousel.js +185 -0
- package/dist/carousel.js.map +1 -0
- package/dist/carousel.mjs +185 -0
- package/dist/carousel.mjs.map +1 -0
- package/dist/charts.d.mts +209 -0
- package/dist/charts.d.ts +209 -0
- package/dist/charts.js +20 -0
- package/dist/charts.js.map +1 -0
- package/dist/charts.mjs +20 -0
- package/dist/charts.mjs.map +1 -0
- package/dist/chunk-27JEWSWA.mjs +233 -0
- package/dist/chunk-27JEWSWA.mjs.map +1 -0
- package/dist/chunk-2EBCST6X.js +25 -0
- package/dist/chunk-2EBCST6X.js.map +1 -0
- package/dist/chunk-3WCMINE5.mjs +490 -0
- package/dist/chunk-3WCMINE5.mjs.map +1 -0
- package/dist/chunk-463SRKKD.js +111 -0
- package/dist/chunk-463SRKKD.js.map +1 -0
- package/dist/chunk-5ASG6G6U.mjs +40 -0
- package/dist/chunk-5ASG6G6U.mjs.map +1 -0
- package/dist/chunk-6EUAU67C.mjs +374 -0
- package/dist/chunk-6EUAU67C.mjs.map +1 -0
- package/dist/chunk-AIY6222Q.js +11 -0
- package/dist/chunk-AIY6222Q.js.map +1 -0
- package/dist/chunk-AJBM7IE6.mjs +2366 -0
- package/dist/chunk-AJBM7IE6.mjs.map +1 -0
- package/dist/chunk-ATIFLPH6.mjs +278 -0
- package/dist/chunk-ATIFLPH6.mjs.map +1 -0
- package/dist/chunk-BIZK6FUD.js +37 -0
- package/dist/chunk-BIZK6FUD.js.map +1 -0
- package/dist/chunk-CCN6M4LI.js +103 -0
- package/dist/chunk-CCN6M4LI.js.map +1 -0
- package/dist/chunk-CUCKULYC.mjs +2658 -0
- package/dist/chunk-CUCKULYC.mjs.map +1 -0
- package/dist/chunk-CWJ4OU6W.mjs +45 -0
- package/dist/chunk-CWJ4OU6W.mjs.map +1 -0
- package/dist/chunk-EOF3QNPF.js +2366 -0
- package/dist/chunk-EOF3QNPF.js.map +1 -0
- package/dist/chunk-FFZ5S7PQ.mjs +146 -0
- package/dist/chunk-FFZ5S7PQ.mjs.map +1 -0
- package/dist/chunk-FN5YL4BK.js +278 -0
- package/dist/chunk-FN5YL4BK.js.map +1 -0
- package/dist/chunk-HLH2VWXL.js +2658 -0
- package/dist/chunk-HLH2VWXL.js.map +1 -0
- package/dist/chunk-IE6GCHDI.mjs +530 -0
- package/dist/chunk-IE6GCHDI.mjs.map +1 -0
- package/dist/chunk-JBHRAAN3.js +31 -0
- package/dist/chunk-JBHRAAN3.js.map +1 -0
- package/dist/chunk-JS4IB5IU.mjs +162 -0
- package/dist/chunk-JS4IB5IU.mjs.map +1 -0
- package/dist/chunk-KF2Y7HO3.js +595 -0
- package/dist/chunk-KF2Y7HO3.js.map +1 -0
- package/dist/chunk-KPDYKK3V.js +162 -0
- package/dist/chunk-KPDYKK3V.js.map +1 -0
- package/dist/chunk-KVBMZNWT.mjs +103 -0
- package/dist/chunk-KVBMZNWT.mjs.map +1 -0
- package/dist/chunk-L2TIGA7I.js +530 -0
- package/dist/chunk-L2TIGA7I.js.map +1 -0
- package/dist/chunk-MNM6HE72.js +146 -0
- package/dist/chunk-MNM6HE72.js.map +1 -0
- package/dist/chunk-NXTVJ6PY.js +374 -0
- package/dist/chunk-NXTVJ6PY.js.map +1 -0
- package/dist/chunk-OWWDNDF4.js +40 -0
- package/dist/chunk-OWWDNDF4.js.map +1 -0
- package/dist/chunk-PHMNZK2R.mjs +18 -0
- package/dist/chunk-PHMNZK2R.mjs.map +1 -0
- package/dist/chunk-PWF2NJDB.mjs +377 -0
- package/dist/chunk-PWF2NJDB.mjs.map +1 -0
- package/dist/chunk-QBCRH7YF.mjs +37 -0
- package/dist/chunk-QBCRH7YF.mjs.map +1 -0
- package/dist/chunk-QD6RLAO2.mjs +11 -0
- package/dist/chunk-QD6RLAO2.mjs.map +1 -0
- package/dist/chunk-QY65OUAC.mjs +111 -0
- package/dist/chunk-QY65OUAC.mjs.map +1 -0
- package/dist/chunk-QYYQYZHV.js +45 -0
- package/dist/chunk-QYYQYZHV.js.map +1 -0
- package/dist/chunk-T7LPABOL.mjs +595 -0
- package/dist/chunk-T7LPABOL.mjs.map +1 -0
- package/dist/chunk-THQKYTQE.js +490 -0
- package/dist/chunk-THQKYTQE.js.map +1 -0
- package/dist/chunk-U2QHFISG.js +18 -0
- package/dist/chunk-U2QHFISG.js.map +1 -0
- package/dist/chunk-UPGFBPFX.mjs +25 -0
- package/dist/chunk-UPGFBPFX.mjs.map +1 -0
- package/dist/chunk-X7E6GMFL.js +233 -0
- package/dist/chunk-X7E6GMFL.js.map +1 -0
- package/dist/chunk-XF66WQZE.mjs +1535 -0
- package/dist/chunk-XF66WQZE.mjs.map +1 -0
- package/dist/chunk-YQOZPLTY.js +1535 -0
- package/dist/chunk-YQOZPLTY.js.map +1 -0
- package/dist/chunk-ZGCN5WCG.js +377 -0
- package/dist/chunk-ZGCN5WCG.js.map +1 -0
- package/dist/chunk-ZP26PGMS.mjs +31 -0
- package/dist/chunk-ZP26PGMS.mjs.map +1 -0
- package/dist/feedback.d.mts +356 -0
- package/dist/feedback.d.ts +356 -0
- package/dist/feedback.js +43 -0
- package/dist/feedback.js.map +1 -0
- package/dist/feedback.mjs +43 -0
- package/dist/feedback.mjs.map +1 -0
- package/dist/icons.d.mts +22 -0
- package/dist/icons.d.ts +22 -0
- package/dist/icons.js +23 -0
- package/dist/icons.js.map +1 -0
- package/dist/icons.mjs +23 -0
- package/dist/icons.mjs.map +1 -0
- package/dist/index.d.mts +165 -3080
- package/dist/index.d.ts +165 -3080
- package/dist/index.js +320 -10082
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +262 -9983
- package/dist/index.mjs.map +1 -1
- package/dist/inputs.d.mts +109 -0
- package/dist/inputs.d.ts +109 -0
- package/dist/inputs.js +43 -0
- package/dist/inputs.js.map +1 -0
- package/dist/inputs.mjs +43 -0
- package/dist/inputs.mjs.map +1 -0
- package/dist/layout.d.mts +927 -0
- package/dist/layout.d.ts +927 -0
- package/dist/layout.js +122 -0
- package/dist/layout.js.map +1 -0
- package/dist/layout.mjs +122 -0
- package/dist/layout.mjs.map +1 -0
- package/dist/navigation.d.mts +716 -0
- package/dist/navigation.d.ts +716 -0
- package/dist/navigation.js +58 -0
- package/dist/navigation.js.map +1 -0
- package/dist/navigation.mjs +58 -0
- package/dist/navigation.mjs.map +1 -0
- package/dist/third-party.d.mts +637 -0
- package/dist/third-party.d.ts +637 -0
- package/dist/third-party.js +45 -0
- package/dist/third-party.js.map +1 -0
- package/dist/third-party.mjs +45 -0
- package/dist/third-party.mjs.map +1 -0
- package/dist/utilities.d.mts +39 -0
- package/dist/utilities.d.ts +39 -0
- package/dist/utilities.js +19 -0
- package/dist/utilities.js.map +1 -0
- package/dist/utilities.mjs +19 -0
- package/dist/utilities.mjs.map +1 -0
- package/package.json +55 -1
|
@@ -0,0 +1,637 @@
|
|
|
1
|
+
import React__default, { ReactNode } from 'react';
|
|
2
|
+
import { ReactFlowProps, Node, Edge, OnNodesChange, OnEdgesChange, NodeTypes, EdgeTypes, BackgroundVariant, MiniMapProps, ReactFlowInstance, NodeProps } from 'reactflow';
|
|
3
|
+
export { Background, BackgroundVariant, ConnectionLineType, Controls, Edge, EdgeTypes, MiniMap, Node, NodeTypes, OnEdgesChange, OnNodesChange, Panel, ReactFlowInstance } from 'reactflow';
|
|
4
|
+
import { BoxProps } from '@mui/material';
|
|
5
|
+
import { Monaco } from '@monaco-editor/react';
|
|
6
|
+
import { editor } from 'monaco-editor';
|
|
7
|
+
import { d as WorkflowNodeType } from './WorkflowNode-BnxXO6t_.mjs';
|
|
8
|
+
import '@mui/material/Paper';
|
|
9
|
+
|
|
10
|
+
interface FlowEditorProps extends Omit<ReactFlowProps, 'nodes' | 'edges'> {
|
|
11
|
+
/**
|
|
12
|
+
* Nodes to display in the flow
|
|
13
|
+
*/
|
|
14
|
+
nodes: Node[];
|
|
15
|
+
/**
|
|
16
|
+
* Edges to display in the flow
|
|
17
|
+
*/
|
|
18
|
+
edges: Edge[];
|
|
19
|
+
/**
|
|
20
|
+
* Callback when nodes change
|
|
21
|
+
*/
|
|
22
|
+
onNodesChange?: OnNodesChange;
|
|
23
|
+
/**
|
|
24
|
+
* Callback when edges change
|
|
25
|
+
*/
|
|
26
|
+
onEdgesChange?: OnEdgesChange;
|
|
27
|
+
/**
|
|
28
|
+
* Custom node types
|
|
29
|
+
*/
|
|
30
|
+
nodeTypes?: NodeTypes;
|
|
31
|
+
/**
|
|
32
|
+
* Custom edge types
|
|
33
|
+
*/
|
|
34
|
+
edgeTypes?: EdgeTypes;
|
|
35
|
+
/**
|
|
36
|
+
* Height of the flow editor
|
|
37
|
+
* @default '600px'
|
|
38
|
+
*/
|
|
39
|
+
height?: string | number;
|
|
40
|
+
/**
|
|
41
|
+
* Show background grid
|
|
42
|
+
* @default true
|
|
43
|
+
*/
|
|
44
|
+
showBackground?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Background variant
|
|
47
|
+
* @default 'dots'
|
|
48
|
+
*/
|
|
49
|
+
backgroundVariant?: BackgroundVariant;
|
|
50
|
+
/**
|
|
51
|
+
* Show controls
|
|
52
|
+
* @default true
|
|
53
|
+
*/
|
|
54
|
+
showControls?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Show minimap
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
59
|
+
showMinimap?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Allow nodes to be dragged by the user
|
|
62
|
+
* @default true
|
|
63
|
+
*/
|
|
64
|
+
nodesDraggable?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Show border around the container
|
|
67
|
+
* @default true
|
|
68
|
+
*/
|
|
69
|
+
showBorder?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Border radius of the container in theme spacing units (e.g. 1 = 8px, 2 = 16px)
|
|
72
|
+
* @default 1
|
|
73
|
+
*/
|
|
74
|
+
borderRadius?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Container props
|
|
77
|
+
*/
|
|
78
|
+
containerProps?: BoxProps;
|
|
79
|
+
/**
|
|
80
|
+
* Props passed directly to the ReactFlow MiniMap component, allowing full customization
|
|
81
|
+
* of colors, mask, style, and any other MiniMap option. Consumer values override defaults.
|
|
82
|
+
*/
|
|
83
|
+
minimapProps?: Partial<MiniMapProps>;
|
|
84
|
+
/**
|
|
85
|
+
* Callback when flow instance is initialized
|
|
86
|
+
*/
|
|
87
|
+
onInit?: (instance: ReactFlowInstance) => void;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* FlowEditor component - wrapper around ReactFlow with theme integration
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```tsx
|
|
94
|
+
* <FlowEditor
|
|
95
|
+
* nodes={nodes}
|
|
96
|
+
* edges={edges}
|
|
97
|
+
* onNodesChange={onNodesChange}
|
|
98
|
+
* onEdgesChange={onEdgesChange}
|
|
99
|
+
* height="500px"
|
|
100
|
+
* showBackground
|
|
101
|
+
* showControls
|
|
102
|
+
* />
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
declare const FlowEditor: React__default.FC<FlowEditorProps>;
|
|
106
|
+
|
|
107
|
+
type CodeEditorLanguage = 'typescript' | 'javascript' | 'json' | 'html' | 'css' | 'python' | 'yaml' | 'markdown' | 'sql' | 'xml' | 'plaintext';
|
|
108
|
+
interface CodeEditorProps {
|
|
109
|
+
/**
|
|
110
|
+
* Current value of the editor
|
|
111
|
+
*/
|
|
112
|
+
value: string;
|
|
113
|
+
/**
|
|
114
|
+
* Callback when value changes
|
|
115
|
+
*/
|
|
116
|
+
onChange: (value: string) => void;
|
|
117
|
+
/**
|
|
118
|
+
* Programming language
|
|
119
|
+
* @default 'typescript'
|
|
120
|
+
*/
|
|
121
|
+
language?: CodeEditorLanguage;
|
|
122
|
+
/**
|
|
123
|
+
* Height of the editor
|
|
124
|
+
* @default '400px'
|
|
125
|
+
*/
|
|
126
|
+
height?: string | number;
|
|
127
|
+
/**
|
|
128
|
+
* Minimum height
|
|
129
|
+
*/
|
|
130
|
+
minHeight?: string | number;
|
|
131
|
+
/**
|
|
132
|
+
* Theme ('light' | 'dark' | 'vs-dark' | 'hc-black')
|
|
133
|
+
* If not provided, will use theme from design system
|
|
134
|
+
*/
|
|
135
|
+
theme?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Show line numbers
|
|
138
|
+
* @default 'on'
|
|
139
|
+
*/
|
|
140
|
+
lineNumbers?: 'on' | 'off' | 'relative' | 'interval';
|
|
141
|
+
/**
|
|
142
|
+
* Editor options (monaco editor options)
|
|
143
|
+
*/
|
|
144
|
+
options?: editor.IStandaloneEditorConstructionOptions;
|
|
145
|
+
/**
|
|
146
|
+
* Callback when editor is mounted
|
|
147
|
+
*/
|
|
148
|
+
onMount?: (editor: editor.IStandaloneCodeEditor, monaco: Monaco) => void;
|
|
149
|
+
/**
|
|
150
|
+
* Callback for validation errors
|
|
151
|
+
*/
|
|
152
|
+
onValidate?: (markers: editor.IMarker[]) => void;
|
|
153
|
+
/**
|
|
154
|
+
* Ref to editor instance
|
|
155
|
+
*/
|
|
156
|
+
editorRef?: React__default.MutableRefObject<editor.IStandaloneCodeEditor | null>;
|
|
157
|
+
/**
|
|
158
|
+
* Ref to Monaco instance
|
|
159
|
+
*/
|
|
160
|
+
monacoRef?: React__default.MutableRefObject<Monaco | null>;
|
|
161
|
+
/**
|
|
162
|
+
* Callback when fullscreen state changes
|
|
163
|
+
*/
|
|
164
|
+
onFullscreenChange?: (isFullscreen: boolean) => void;
|
|
165
|
+
/**
|
|
166
|
+
* Props for the container Box.
|
|
167
|
+
*/
|
|
168
|
+
containerProps?: BoxProps;
|
|
169
|
+
/**
|
|
170
|
+
* Additional TypeScript type definitions to add to the editor context.
|
|
171
|
+
* Can be a string with type definitions or an array of type definition strings.
|
|
172
|
+
* Each string will be added as a separate extra lib to Monaco.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```tsx
|
|
176
|
+
* <CodeEditor
|
|
177
|
+
* value={code}
|
|
178
|
+
* onChange={setCode}
|
|
179
|
+
* typeDefinitions={`
|
|
180
|
+
* declare interface MyCustomType {
|
|
181
|
+
* id: string;
|
|
182
|
+
* name: string;
|
|
183
|
+
* }
|
|
184
|
+
* `}
|
|
185
|
+
* />
|
|
186
|
+
* ```
|
|
187
|
+
*/
|
|
188
|
+
typeDefinitions?: string | string[];
|
|
189
|
+
/**
|
|
190
|
+
* When true, the editor skips internal value syncing and lets an external
|
|
191
|
+
* source (e.g. useCodeEditorWorkspace) manage Monaco models directly.
|
|
192
|
+
* The `value` prop is still used as the initial/display value but won't
|
|
193
|
+
* be force-synced to the editor.
|
|
194
|
+
* @default false
|
|
195
|
+
*/
|
|
196
|
+
externalModelManagement?: boolean;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* CodeEditor component - wrapper around Monaco Editor matching dynamic-indexer-client implementation
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```tsx
|
|
203
|
+
* <CodeEditor
|
|
204
|
+
* value={code}
|
|
205
|
+
* onChange={setCode}
|
|
206
|
+
* language="typescript"
|
|
207
|
+
* height="500px"
|
|
208
|
+
* onValidate={(markers) => console.log('Errors:', markers)}
|
|
209
|
+
* />
|
|
210
|
+
* ```
|
|
211
|
+
*/
|
|
212
|
+
declare const CodeEditor: React__default.FC<CodeEditorProps>;
|
|
213
|
+
|
|
214
|
+
/** Data shape expected by the WorkflowNodeHandle custom ReactFlow node */
|
|
215
|
+
interface WorkflowNodeData {
|
|
216
|
+
/** Workflow node type — drives accent color, icon, and badge */
|
|
217
|
+
nodeType: WorkflowNodeType;
|
|
218
|
+
/** Primary title */
|
|
219
|
+
title: string;
|
|
220
|
+
/** Optional description */
|
|
221
|
+
description?: string;
|
|
222
|
+
/** Override default icon */
|
|
223
|
+
icon?: React__default.ReactNode;
|
|
224
|
+
/** Override default badge label */
|
|
225
|
+
badgeLabel?: string;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Thin ReactFlow custom-node wrapper around WorkflowNode.
|
|
229
|
+
*
|
|
230
|
+
* Renders a target Handle (top), the WorkflowNode card, and a source Handle (bottom).
|
|
231
|
+
* Register as a custom nodeType:
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* ```tsx
|
|
235
|
+
* const nodeTypes = { workflowNode: WorkflowNodeHandle };
|
|
236
|
+
* <FlowEditor nodes={nodes} edges={edges} nodeTypes={nodeTypes} />
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
239
|
+
declare const WorkflowNodeHandle: React__default.FC<NodeProps<WorkflowNodeData>>;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Represents a single file in the workspace.
|
|
243
|
+
*/
|
|
244
|
+
interface CodeEditorFile {
|
|
245
|
+
/** Unique file path, e.g. "src/index.ts" */
|
|
246
|
+
path: string;
|
|
247
|
+
/** Programming language (auto-detected from extension when omitted) */
|
|
248
|
+
language?: CodeEditorLanguage;
|
|
249
|
+
/** File content */
|
|
250
|
+
value: string;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Represents an open tab in the editor.
|
|
254
|
+
*/
|
|
255
|
+
interface CodeEditorTab {
|
|
256
|
+
/** File path this tab corresponds to */
|
|
257
|
+
path: string;
|
|
258
|
+
/** Display label (defaults to the filename portion of path) */
|
|
259
|
+
label?: string;
|
|
260
|
+
/** Whether the file has unsaved changes */
|
|
261
|
+
isDirty?: boolean;
|
|
262
|
+
/** Git sync status — distinct from isDirty (editor changes) */
|
|
263
|
+
syncStatus?: 'new' | 'modified';
|
|
264
|
+
}
|
|
265
|
+
/** Git sync status for a file tree node. */
|
|
266
|
+
type FileTreeNodeStatus = 'new' | 'modified' | 'deleted';
|
|
267
|
+
/**
|
|
268
|
+
* A node in the file tree.
|
|
269
|
+
*/
|
|
270
|
+
interface FileTreeNode {
|
|
271
|
+
/** Display name */
|
|
272
|
+
name: string;
|
|
273
|
+
/** Full path (unique identifier) */
|
|
274
|
+
path: string;
|
|
275
|
+
/** Whether this is a file or folder */
|
|
276
|
+
type: 'file' | 'folder';
|
|
277
|
+
/** Children nodes (only for folders) */
|
|
278
|
+
children?: FileTreeNode[];
|
|
279
|
+
/** Optional custom icon */
|
|
280
|
+
icon?: ReactNode;
|
|
281
|
+
/** Git sync status indicator (new / modified / deleted) */
|
|
282
|
+
status?: FileTreeNodeStatus;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Git repository information passed into the workspace.
|
|
286
|
+
* The consuming app is responsible for fetching this data.
|
|
287
|
+
*/
|
|
288
|
+
interface GitInfo {
|
|
289
|
+
/** Current branch name, e.g. "feat/advanced-code-editor" */
|
|
290
|
+
branch: string;
|
|
291
|
+
/** Whether the working tree has uncommitted changes */
|
|
292
|
+
isDirty?: boolean;
|
|
293
|
+
/** Short commit hash of HEAD */
|
|
294
|
+
commitHash?: string;
|
|
295
|
+
/** Remote name, e.g. "origin" */
|
|
296
|
+
remote?: string;
|
|
297
|
+
/** Number of commits ahead of remote */
|
|
298
|
+
ahead?: number;
|
|
299
|
+
/** Number of commits behind remote */
|
|
300
|
+
behind?: number;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* A custom item to render in the status bar.
|
|
304
|
+
*/
|
|
305
|
+
interface CodeEditorStatusBarItem {
|
|
306
|
+
/** Unique key */
|
|
307
|
+
id: string;
|
|
308
|
+
/** Content to display (string or ReactNode) */
|
|
309
|
+
content: ReactNode;
|
|
310
|
+
/** Side of the status bar */
|
|
311
|
+
align?: 'left' | 'right';
|
|
312
|
+
/** Optional click handler */
|
|
313
|
+
onClick?: () => void;
|
|
314
|
+
/** Tooltip text */
|
|
315
|
+
tooltip?: string;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Map from file extension to CodeEditorLanguage.
|
|
319
|
+
*/
|
|
320
|
+
declare const EXTENSION_LANGUAGE_MAP: Record<string, CodeEditorLanguage>;
|
|
321
|
+
/**
|
|
322
|
+
* Detect language from a file path extension.
|
|
323
|
+
*/
|
|
324
|
+
declare function detectLanguage(path: string): CodeEditorLanguage;
|
|
325
|
+
/**
|
|
326
|
+
* Extract the filename from a path.
|
|
327
|
+
*/
|
|
328
|
+
declare function getFileName(path: string): string;
|
|
329
|
+
|
|
330
|
+
interface UseCodeEditorWorkspaceOptions {
|
|
331
|
+
/** All files available in the workspace */
|
|
332
|
+
files: CodeEditorFile[];
|
|
333
|
+
/** File paths to open as tabs initially */
|
|
334
|
+
initialOpenPaths?: string[];
|
|
335
|
+
/** Called when a file's content is modified in the editor */
|
|
336
|
+
onFileChange?: (path: string, value: string) => void;
|
|
337
|
+
/** Called when validation markers change across all open models */
|
|
338
|
+
onValidationChange?: (markers: Record<string, editor.IMarker[]>) => void;
|
|
339
|
+
}
|
|
340
|
+
interface UseCodeEditorWorkspaceReturn {
|
|
341
|
+
/** Currently open tabs */
|
|
342
|
+
openTabs: CodeEditorTab[];
|
|
343
|
+
/** Path of the active file (shown in editor) */
|
|
344
|
+
activeFilePath: string | null;
|
|
345
|
+
/** Open a file by path (creates tab if not already open, sets it active) */
|
|
346
|
+
openFile: (path: string) => void;
|
|
347
|
+
/** Close a tab by path */
|
|
348
|
+
closeFile: (path: string) => void;
|
|
349
|
+
/** Set a specific file as active */
|
|
350
|
+
setActiveFile: (path: string) => void;
|
|
351
|
+
/** Programmatically update file content */
|
|
352
|
+
updateFileContent: (path: string, value: string) => void;
|
|
353
|
+
/** Get the current content of a file */
|
|
354
|
+
getFileContent: (path: string) => string | undefined;
|
|
355
|
+
/** Get the active file data */
|
|
356
|
+
activeFile: CodeEditorFile | undefined;
|
|
357
|
+
/** Ref to hold the Monaco instance — pass to CodeEditor's monacoRef */
|
|
358
|
+
monacoRef: React.MutableRefObject<Monaco | null>;
|
|
359
|
+
/** Ref to hold the editor instance — pass to CodeEditor's editorRef */
|
|
360
|
+
editorRef: React.MutableRefObject<editor.IStandaloneCodeEditor | null>;
|
|
361
|
+
/** Handler to pass to CodeEditor's onMount */
|
|
362
|
+
handleEditorMount: (editorInstance: editor.IStandaloneCodeEditor, monacoInstance: Monaco) => void;
|
|
363
|
+
/** Handler to pass to CodeEditor's onChange */
|
|
364
|
+
handleEditorChange: (value: string) => void;
|
|
365
|
+
/** Aggregated validation markers keyed by file path */
|
|
366
|
+
validationMarkers: Record<string, editor.IMarker[]>;
|
|
367
|
+
/** Mark a file as saved (clears dirty flag) */
|
|
368
|
+
markSaved: (path: string) => void;
|
|
369
|
+
/** Mark all files as saved */
|
|
370
|
+
markAllSaved: () => void;
|
|
371
|
+
/** Current cursor position in the active editor */
|
|
372
|
+
cursorPosition: {
|
|
373
|
+
line: number;
|
|
374
|
+
column: number;
|
|
375
|
+
} | null;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Headless hook for managing a multi-file Monaco editor workspace.
|
|
379
|
+
*
|
|
380
|
+
* Manages Monaco models, open tabs, active file, and dirty tracking.
|
|
381
|
+
* Pass the returned refs/handlers to a `CodeEditor` component.
|
|
382
|
+
*
|
|
383
|
+
* @example
|
|
384
|
+
* ```tsx
|
|
385
|
+
* const workspace = useCodeEditorWorkspace({ files, onFileChange });
|
|
386
|
+
*
|
|
387
|
+
* <CodeEditorTabs
|
|
388
|
+
* tabs={workspace.openTabs}
|
|
389
|
+
* activeTab={workspace.activeFilePath}
|
|
390
|
+
* onTabSelect={workspace.setActiveFile}
|
|
391
|
+
* onTabClose={workspace.closeFile}
|
|
392
|
+
* />
|
|
393
|
+
* <CodeEditor
|
|
394
|
+
* value={workspace.activeFile?.value ?? ''}
|
|
395
|
+
* onChange={workspace.handleEditorChange}
|
|
396
|
+
* language={workspace.activeFile?.language}
|
|
397
|
+
* editorRef={workspace.editorRef}
|
|
398
|
+
* monacoRef={workspace.monacoRef}
|
|
399
|
+
* onMount={workspace.handleEditorMount}
|
|
400
|
+
* />
|
|
401
|
+
* ```
|
|
402
|
+
*/
|
|
403
|
+
declare function useCodeEditorWorkspace({ files, initialOpenPaths, onFileChange, onValidationChange, }: UseCodeEditorWorkspaceOptions): UseCodeEditorWorkspaceReturn;
|
|
404
|
+
|
|
405
|
+
interface CodeEditorTabRenderProps {
|
|
406
|
+
tab: CodeEditorTab;
|
|
407
|
+
isActive: boolean;
|
|
408
|
+
onSelect: () => void;
|
|
409
|
+
onClose: () => void;
|
|
410
|
+
}
|
|
411
|
+
interface CodeEditorTabsProps {
|
|
412
|
+
/** Open tabs to display */
|
|
413
|
+
tabs: CodeEditorTab[];
|
|
414
|
+
/** Path of the currently active tab */
|
|
415
|
+
activeTab?: string | null;
|
|
416
|
+
/** Called when a tab is selected */
|
|
417
|
+
onTabSelect?: (path: string) => void;
|
|
418
|
+
/** Called when a tab's close button is clicked */
|
|
419
|
+
onTabClose?: (path: string) => void;
|
|
420
|
+
/**
|
|
421
|
+
* Render prop for full tab customisation.
|
|
422
|
+
* When provided, default tab rendering is skipped entirely.
|
|
423
|
+
*/
|
|
424
|
+
renderTab?: (props: CodeEditorTabRenderProps) => React__default.ReactNode;
|
|
425
|
+
/** Props for the outer container */
|
|
426
|
+
containerProps?: BoxProps;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Tab bar for the CodeEditor workspace.
|
|
430
|
+
*
|
|
431
|
+
* Provides default MUI-based rendering, but consumers can fully replace it
|
|
432
|
+
* via the `renderTab` render prop.
|
|
433
|
+
*
|
|
434
|
+
* @example
|
|
435
|
+
* ```tsx
|
|
436
|
+
* <CodeEditorTabs
|
|
437
|
+
* tabs={workspace.openTabs}
|
|
438
|
+
* activeTab={workspace.activeFilePath}
|
|
439
|
+
* onTabSelect={workspace.setActiveFile}
|
|
440
|
+
* onTabClose={workspace.closeFile}
|
|
441
|
+
* />
|
|
442
|
+
* ```
|
|
443
|
+
*/
|
|
444
|
+
declare const CodeEditorTabs: React__default.FC<CodeEditorTabsProps>;
|
|
445
|
+
|
|
446
|
+
interface FileTreeNodeRenderProps {
|
|
447
|
+
node: FileTreeNode;
|
|
448
|
+
depth: number;
|
|
449
|
+
isSelected: boolean;
|
|
450
|
+
isExpanded: boolean;
|
|
451
|
+
onSelect: () => void;
|
|
452
|
+
onToggle: () => void;
|
|
453
|
+
}
|
|
454
|
+
interface CodeEditorFileTreeProps {
|
|
455
|
+
/** Tree data to render */
|
|
456
|
+
tree: FileTreeNode[];
|
|
457
|
+
/** Currently selected file path */
|
|
458
|
+
selectedPath?: string | null;
|
|
459
|
+
/** Called when a file node is clicked */
|
|
460
|
+
onFileSelect?: (path: string) => void;
|
|
461
|
+
/** Called when a folder is expanded/collapsed */
|
|
462
|
+
onFolderToggle?: (path: string, isExpanded: boolean) => void;
|
|
463
|
+
/**
|
|
464
|
+
* Render prop for full node customisation.
|
|
465
|
+
* When provided, default rendering is skipped.
|
|
466
|
+
*/
|
|
467
|
+
renderNode?: (props: FileTreeNodeRenderProps) => React__default.ReactNode;
|
|
468
|
+
/** Paths of folders that should be expanded initially */
|
|
469
|
+
defaultExpandedPaths?: string[];
|
|
470
|
+
/** Width of the file tree panel */
|
|
471
|
+
width?: string | number;
|
|
472
|
+
/** Props for the outer container */
|
|
473
|
+
containerProps?: BoxProps;
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* File tree navigator for the CodeEditor workspace.
|
|
477
|
+
*
|
|
478
|
+
* Provides default MUI-based rendering with collapsible folders.
|
|
479
|
+
* Consumers can fully replace rendering via `renderNode`.
|
|
480
|
+
*
|
|
481
|
+
* @example
|
|
482
|
+
* ```tsx
|
|
483
|
+
* <CodeEditorFileTree
|
|
484
|
+
* tree={fileTree}
|
|
485
|
+
* selectedPath={workspace.activeFilePath}
|
|
486
|
+
* onFileSelect={workspace.openFile}
|
|
487
|
+
* />
|
|
488
|
+
* ```
|
|
489
|
+
*/
|
|
490
|
+
declare const CodeEditorFileTree: React__default.FC<CodeEditorFileTreeProps>;
|
|
491
|
+
|
|
492
|
+
interface CodeEditorStatusBarRenderProps {
|
|
493
|
+
gitInfo?: GitInfo;
|
|
494
|
+
language?: CodeEditorLanguage;
|
|
495
|
+
cursorPosition?: {
|
|
496
|
+
line: number;
|
|
497
|
+
column: number;
|
|
498
|
+
};
|
|
499
|
+
items?: CodeEditorStatusBarItem[];
|
|
500
|
+
}
|
|
501
|
+
interface CodeEditorStatusBarProps {
|
|
502
|
+
/** Git repository information */
|
|
503
|
+
gitInfo?: GitInfo;
|
|
504
|
+
/** Language of the active file */
|
|
505
|
+
language?: CodeEditorLanguage;
|
|
506
|
+
/** Current cursor position */
|
|
507
|
+
cursorPosition?: {
|
|
508
|
+
line: number;
|
|
509
|
+
column: number;
|
|
510
|
+
};
|
|
511
|
+
/** Additional custom items */
|
|
512
|
+
items?: CodeEditorStatusBarItem[];
|
|
513
|
+
/**
|
|
514
|
+
* Render prop for full status bar customisation.
|
|
515
|
+
* When provided, default rendering is skipped entirely.
|
|
516
|
+
*/
|
|
517
|
+
renderStatusBar?: (props: CodeEditorStatusBarRenderProps) => React__default.ReactNode;
|
|
518
|
+
/** Called when the user clicks the branch name in the status bar */
|
|
519
|
+
onBranchClick?: () => void;
|
|
520
|
+
/** Props for the outer container */
|
|
521
|
+
containerProps?: BoxProps;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Status bar for the CodeEditor workspace.
|
|
525
|
+
*
|
|
526
|
+
* Displays git branch info, cursor position, file language, and custom items.
|
|
527
|
+
* Fully replaceable via `renderStatusBar` render prop.
|
|
528
|
+
*
|
|
529
|
+
* @example
|
|
530
|
+
* ```tsx
|
|
531
|
+
* <CodeEditorStatusBar
|
|
532
|
+
* gitInfo={{ branch: 'main', isDirty: true, commitHash: 'a1b2c3d' }}
|
|
533
|
+
* language="typescript"
|
|
534
|
+
* cursorPosition={{ line: 10, column: 5 }}
|
|
535
|
+
* />
|
|
536
|
+
* ```
|
|
537
|
+
*/
|
|
538
|
+
declare const CodeEditorStatusBar: React__default.FC<CodeEditorStatusBarProps>;
|
|
539
|
+
|
|
540
|
+
interface CodeEditorWelcomeScreenProps {
|
|
541
|
+
/** Custom logo or icon displayed in the center. Defaults to the Cere logo. */
|
|
542
|
+
logo?: React__default.ReactNode;
|
|
543
|
+
/**
|
|
544
|
+
* Content rendered below the logo. Accepts any ReactNode —
|
|
545
|
+
* shortcut hints, action buttons, descriptive text, etc.
|
|
546
|
+
*/
|
|
547
|
+
children?: React__default.ReactNode;
|
|
548
|
+
/** Props forwarded to the outer container `Box`. */
|
|
549
|
+
containerProps?: BoxProps;
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Default empty-state screen shown inside `CodeEditorWorkspace` when no file
|
|
553
|
+
* is open. Renders a centered logo with an optional content slot underneath.
|
|
554
|
+
*
|
|
555
|
+
* @example
|
|
556
|
+
* ```tsx
|
|
557
|
+
* <CodeEditorWelcomeScreen>
|
|
558
|
+
* <Typography variant="body2" color="text.secondary">
|
|
559
|
+
* Open a file from the tree to start editing
|
|
560
|
+
* </Typography>
|
|
561
|
+
* </CodeEditorWelcomeScreen>
|
|
562
|
+
* ```
|
|
563
|
+
*/
|
|
564
|
+
declare const CodeEditorWelcomeScreen: React__default.FC<CodeEditorWelcomeScreenProps>;
|
|
565
|
+
|
|
566
|
+
interface CodeEditorWorkspaceProps extends Pick<UseCodeEditorWorkspaceOptions, 'files' | 'initialOpenPaths' | 'onFileChange' | 'onValidationChange'> {
|
|
567
|
+
/** File tree data. When omitted the file tree panel is hidden. */
|
|
568
|
+
fileTree?: FileTreeNode[];
|
|
569
|
+
/** Paths of folders expanded by default in the file tree */
|
|
570
|
+
defaultExpandedPaths?: string[];
|
|
571
|
+
/** Whether to show the tab bar. @default true */
|
|
572
|
+
showTabs?: boolean;
|
|
573
|
+
/** Whether to show the file tree panel. @default true (when fileTree is provided) */
|
|
574
|
+
showFileTree?: boolean;
|
|
575
|
+
/** Width of the file tree panel */
|
|
576
|
+
fileTreeWidth?: string | number;
|
|
577
|
+
/** Overall height of the workspace */
|
|
578
|
+
height?: string | number;
|
|
579
|
+
/** Props passed through to the inner CodeEditor */
|
|
580
|
+
editorProps?: Partial<Omit<CodeEditorProps, 'value' | 'onChange' | 'language' | 'editorRef' | 'monacoRef' | 'onMount'>>;
|
|
581
|
+
/** Props for the outer container */
|
|
582
|
+
containerProps?: BoxProps;
|
|
583
|
+
/** Replace the default tab bar rendering */
|
|
584
|
+
renderTabs?: (props: CodeEditorTabsProps & {
|
|
585
|
+
workspace: UseCodeEditorWorkspaceReturn;
|
|
586
|
+
}) => React__default.ReactNode;
|
|
587
|
+
/** Replace the default file tree rendering */
|
|
588
|
+
renderFileTree?: (props: CodeEditorFileTreeProps & {
|
|
589
|
+
workspace: UseCodeEditorWorkspaceReturn;
|
|
590
|
+
}) => React__default.ReactNode;
|
|
591
|
+
/** Replace the default editor rendering */
|
|
592
|
+
renderEditor?: (workspace: UseCodeEditorWorkspaceReturn) => React__default.ReactNode;
|
|
593
|
+
/** Replace the default status bar rendering */
|
|
594
|
+
renderStatusBar?: (props: CodeEditorStatusBarProps & {
|
|
595
|
+
workspace: UseCodeEditorWorkspaceReturn;
|
|
596
|
+
}) => React__default.ReactNode;
|
|
597
|
+
/** Replace the default welcome screen rendering (shown when no file is open) */
|
|
598
|
+
renderWelcomeScreen?: (workspace: UseCodeEditorWorkspaceReturn) => React__default.ReactNode;
|
|
599
|
+
/** Static ReactNode that replaces the default welcome screen entirely */
|
|
600
|
+
welcomeScreen?: React__default.ReactNode;
|
|
601
|
+
/** Props forwarded to the default `CodeEditorWelcomeScreen` (ignored when `welcomeScreen` or `renderWelcomeScreen` is provided) */
|
|
602
|
+
welcomeScreenProps?: CodeEditorWelcomeScreenProps;
|
|
603
|
+
/** Git repository information to display in the status bar */
|
|
604
|
+
gitInfo?: GitInfo;
|
|
605
|
+
/** Whether to show the status bar. @default true */
|
|
606
|
+
showStatusBar?: boolean;
|
|
607
|
+
/** Additional custom items for the status bar */
|
|
608
|
+
statusBarItems?: CodeEditorStatusBarItem[];
|
|
609
|
+
/** Expose the workspace instance to the parent via ref-like callback */
|
|
610
|
+
onWorkspaceReady?: (workspace: UseCodeEditorWorkspaceReturn) => void;
|
|
611
|
+
/** Called when the user presses Ctrl+S / Cmd+S. Receives all dirty files. */
|
|
612
|
+
onSave?: (dirtyFiles: CodeEditorFile[]) => void;
|
|
613
|
+
/** Called when the user clicks the branch name in the status bar */
|
|
614
|
+
onBranchClick?: () => void;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* Convenience composed workspace that combines `CodeEditorFileTree`,
|
|
618
|
+
* `CodeEditorTabs`, and `CodeEditor` into a single layout.
|
|
619
|
+
*
|
|
620
|
+
* For full control, use `useCodeEditorWorkspace` directly and assemble
|
|
621
|
+
* the pieces yourself.
|
|
622
|
+
*
|
|
623
|
+
* @example
|
|
624
|
+
* ```tsx
|
|
625
|
+
* <CodeEditorWorkspace
|
|
626
|
+
* files={files}
|
|
627
|
+
* fileTree={tree}
|
|
628
|
+
* initialOpenPaths={['src/index.ts']}
|
|
629
|
+
* height="600px"
|
|
630
|
+
* gitInfo={{ branch: 'main', isDirty: true, commitHash: 'a1b2c3d' }}
|
|
631
|
+
* onFileChange={(path, value) => console.log(path, value)}
|
|
632
|
+
* />
|
|
633
|
+
* ```
|
|
634
|
+
*/
|
|
635
|
+
declare const CodeEditorWorkspace: React__default.FC<CodeEditorWorkspaceProps>;
|
|
636
|
+
|
|
637
|
+
export { CodeEditor, type CodeEditorFile, CodeEditorFileTree, type CodeEditorFileTreeProps, type CodeEditorLanguage, type CodeEditorProps, CodeEditorStatusBar, type CodeEditorStatusBarItem, type CodeEditorStatusBarProps, type CodeEditorStatusBarRenderProps, type CodeEditorTab, type CodeEditorTabRenderProps, CodeEditorTabs, type CodeEditorTabsProps, CodeEditorWelcomeScreen, type CodeEditorWelcomeScreenProps, CodeEditorWorkspace, type CodeEditorWorkspaceProps, EXTENSION_LANGUAGE_MAP, type FileTreeNode, type FileTreeNodeRenderProps, FlowEditor, type FlowEditorProps, type GitInfo, type UseCodeEditorWorkspaceOptions, type UseCodeEditorWorkspaceReturn, type WorkflowNodeData, WorkflowNodeHandle, detectLanguage, getFileName, useCodeEditorWorkspace };
|