@notmrabhi/flowforge 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.
Files changed (56) hide show
  1. package/README.md +70 -0
  2. package/dist/GatewayBranchEdge-C-AVfqfT.js +1 -0
  3. package/dist/GatewayBranchEdge-gncIBR-0.js +854 -0
  4. package/dist/SchemaBuilderDrawer-DFyGUCZM.js +3235 -0
  5. package/dist/SchemaBuilderDrawer-zci9aEUc.js +4 -0
  6. package/dist/_commonjsHelpers-DKOUU3wS.js +1 -0
  7. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  8. package/dist/bpmn-CcuE2X_Q.js +2 -0
  9. package/dist/bpmn-CtfWDaOY.js +33 -0
  10. package/dist/canvas.cjs +1 -0
  11. package/dist/canvas.d.ts +646 -0
  12. package/dist/canvas.js +28 -0
  13. package/dist/canvasTokens-CAD6G24b.js +32 -0
  14. package/dist/canvasTokens-gKNYrPl4.js +1 -0
  15. package/dist/core.cjs +1 -0
  16. package/dist/core.d.ts +333 -0
  17. package/dist/core.js +24 -0
  18. package/dist/defaultUi.cjs +1 -0
  19. package/dist/defaultUi.d.ts +83 -0
  20. package/dist/defaultUi.js +18 -0
  21. package/dist/form.cjs +1 -0
  22. package/dist/form.d.ts +857 -0
  23. package/dist/form.js +43 -0
  24. package/dist/index-B31-Y5uO.js +11 -0
  25. package/dist/index-B3aHpb84.js +13 -0
  26. package/dist/index-BnzttJ4w.js +13758 -0
  27. package/dist/index-BysKSEtZ.js +1 -0
  28. package/dist/index-C-CpxcAF.js +8132 -0
  29. package/dist/index-C9lDjGKB.js +2553 -0
  30. package/dist/index-CChSmn-Q.js +6 -0
  31. package/dist/index-CIbEqy9U.js +7319 -0
  32. package/dist/index-CkjEllpd.js +1 -0
  33. package/dist/index-CpKKFxCT.js +2 -0
  34. package/dist/index-Cw9DC-tf.js +76 -0
  35. package/dist/index-CzPi8KQC.js +1310 -0
  36. package/dist/index-D14V8rKX.js +1 -0
  37. package/dist/index-DVIy64gf.js +41 -0
  38. package/dist/index-gtgq_241.js +3 -0
  39. package/dist/index-l6kvDx-m.js +1360 -0
  40. package/dist/index-lcviy90e.js +613 -0
  41. package/dist/index-wOnYb3DO.js +567 -0
  42. package/dist/index.cjs +1 -0
  43. package/dist/index.d.ts +1354 -0
  44. package/dist/index.js +106 -0
  45. package/dist/messages-CO299wPN.js +22 -0
  46. package/dist/messages-O9Tw_XXR.js +1 -0
  47. package/dist/nodeRegistry.cjs +1 -0
  48. package/dist/nodeRegistry.d.ts +293 -0
  49. package/dist/nodeRegistry.js +538 -0
  50. package/dist/style.css +6 -0
  51. package/dist/templateRegistry.cjs +1 -0
  52. package/dist/templateRegistry.d.ts +83 -0
  53. package/dist/templateRegistry.js +43 -0
  54. package/dist/templateSkeletons-B3DkIUbY.js +1 -0
  55. package/dist/templateSkeletons-D60ixh5T.js +2617 -0
  56. package/package.json +112 -0
@@ -0,0 +1,646 @@
1
+ import { AnySchema } from 'yup';
2
+ import { default as default_2 } from 'react';
3
+ import { EdgeProps } from 'reactflow';
4
+ import { EdgeTypes } from 'reactflow';
5
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
6
+ import { NodeProps } from 'reactflow';
7
+ import { NodeTypes } from 'reactflow';
8
+ import { ReactNode } from 'react';
9
+
10
+ export declare const accessRequestSkeleton: WorkflowState;
11
+
12
+ export declare const ActionNode: ({ id, data }: NodeProps) => JSX_2.Element;
13
+
14
+ export declare interface AddStepContext {
15
+ edgeId: string;
16
+ nodeId: string;
17
+ sourceNodeId: string;
18
+ targetNodeId: string;
19
+ position: 'between';
20
+ referenceNodeId: string;
21
+ referenceNodeType?: string;
22
+ stepVisibility?: unknown;
23
+ filterId?: string;
24
+ branch?: string;
25
+ }
26
+
27
+ export declare const ApprovalNode: ({ id, data }: NodeProps) => JSX_2.Element;
28
+
29
+ export declare interface BpmnElement {
30
+ id: string;
31
+ $type: string;
32
+ [key: string]: unknown;
33
+ }
34
+
35
+ declare interface BpmnElement_2 {
36
+ id: string;
37
+ $type: string;
38
+ [key: string]: unknown;
39
+ }
40
+
41
+ export declare interface BpmnSaveOptions {
42
+ processId?: string;
43
+ processName?: string;
44
+ }
45
+
46
+ declare type BranchChain = CanvasSlot_2[];
47
+
48
+ declare type BranchChain_2 = CanvasSlot[];
49
+
50
+ export declare interface BranchMap {
51
+ [filterId: string]: {
52
+ [branchKey: string]: BranchChain_2;
53
+ };
54
+ }
55
+
56
+ declare interface BranchMap_2 {
57
+ [filterId: string]: {
58
+ [branchKey: string]: BranchChain;
59
+ };
60
+ }
61
+
62
+ export declare const builtInNodeTypes: NodeTypes;
63
+
64
+ export declare interface CanvasSlot {
65
+ id: string;
66
+ kind: SlotKind_2;
67
+ reactFlowType: string;
68
+ descriptorType?: string;
69
+ formData?: Record<string, unknown>;
70
+ nodeData?: Record<string, unknown>;
71
+ deletable?: boolean;
72
+ label?: string;
73
+ /** Maps branch key → display label. e.g. { pass: 'Pass', fail: 'Fail' } */
74
+ branchLabels?: Record<string, string>;
75
+ }
76
+
77
+ declare interface CanvasSlot_2 {
78
+ id: string;
79
+ kind: SlotKind;
80
+ reactFlowType: string;
81
+ descriptorType?: string;
82
+ formData?: Record<string, unknown>;
83
+ nodeData?: Record<string, unknown>;
84
+ deletable?: boolean;
85
+ label?: string;
86
+ /** Maps branch key → display label. e.g. { pass: 'Pass', fail: 'Fail' } */
87
+ branchLabels?: Record<string, string>;
88
+ }
89
+
90
+ /** One column in a per-field condition row */
91
+ declare interface ConditionFieldDef {
92
+ /** Key used to store this column's value in ConditionEntry */
93
+ id: string;
94
+ /**
95
+ * 'select' — native <select> with user-supplied options
96
+ * 'operator' — native <select> pre-filled with the standard operator list (no options needed)
97
+ * 'text' — plain <input>
98
+ * any other string — falls back to <input>
99
+ */
100
+ type: 'select' | 'operator' | 'text' | string;
101
+ colSpan?: number;
102
+ label?: string;
103
+ placeholder?: string;
104
+ /** Options for select columns — user defines these, renderer just renders them */
105
+ options?: Array<{
106
+ value: string;
107
+ label: string;
108
+ }>;
109
+ /** When true, renders a FormulaInput chip editor instead of a plain <input> */
110
+ formula?: boolean;
111
+ }
112
+
113
+ /** One column in a per-field condition row */
114
+ declare interface ConditionFieldDef_2 {
115
+ /** Key used to store this column's value in ConditionEntry */
116
+ id: string;
117
+ /**
118
+ * 'select' — native <select> with user-supplied options
119
+ * 'operator' — native <select> pre-filled with the standard operator list (no options needed)
120
+ * 'text' — plain <input>
121
+ * any other string — falls back to <input>
122
+ */
123
+ type: 'select' | 'operator' | 'text' | string;
124
+ colSpan?: number;
125
+ label?: string;
126
+ placeholder?: string;
127
+ /** Options for select columns — user defines these, renderer just renders them */
128
+ options?: Array<{
129
+ value: string;
130
+ label: string;
131
+ }>;
132
+ /** When true, renders a FormulaInput chip editor instead of a plain <input> */
133
+ formula?: boolean;
134
+ }
135
+
136
+ export declare const defaultFlowForgeMessages: FlowForgeMessages;
137
+
138
+ export declare interface DmnDefinition {
139
+ id: string;
140
+ [key: string]: unknown;
141
+ }
142
+
143
+ declare interface DmnDefinition_2 {
144
+ id: string;
145
+ [key: string]: unknown;
146
+ }
147
+
148
+ export declare const EdgeWithPlusLabel: ({ id: edgeId, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, source, target, data, }: EdgeProps<EdgeWithPlusLabelData>) => JSX_2.Element;
149
+
150
+ export declare interface EdgeWithPlusLabelData {
151
+ label?: string;
152
+ onAddStepClick?: (sourceNodeId: string, context: AddStepContext) => void;
153
+ referenceNodeType?: string;
154
+ stepVisibility?: unknown;
155
+ }
156
+
157
+ export declare const EndNode: () => JSX_2.Element;
158
+
159
+ export declare interface ExecutionRecord {
160
+ id: string;
161
+ workflowId?: string;
162
+ triggeredBy?: string;
163
+ triggeredAt: string;
164
+ status: ExecutionStatus;
165
+ inputs?: Record<string, unknown>;
166
+ steps: ExecutionStep[];
167
+ completedAt?: string;
168
+ error?: string;
169
+ }
170
+
171
+ export declare type ExecutionStatus = 'running' | 'success' | 'failed' | 'cancelled';
172
+
173
+ export declare interface ExecutionStep {
174
+ nodeId: string;
175
+ nodeType?: string;
176
+ label?: string;
177
+ startedAt: string;
178
+ completedAt?: string;
179
+ status: StepStatus;
180
+ inputs?: Record<string, unknown>;
181
+ outputs?: Record<string, unknown>;
182
+ branchTaken?: string;
183
+ error?: string;
184
+ }
185
+
186
+ /** Condition definition attached to a FieldDescriptor */
187
+ declare interface FieldConditionDef {
188
+ fields: ConditionFieldDef[];
189
+ /** Enables nested condition groups. Defaults to false. */
190
+ allowGroups?: boolean;
191
+ /** Optional depth limit for nested groups when allowGroups is true. */
192
+ maxGroupDepth?: number;
193
+ }
194
+
195
+ /** Condition definition attached to a FieldDescriptor */
196
+ declare interface FieldConditionDef_2 {
197
+ fields: ConditionFieldDef_2[];
198
+ /** Enables nested condition groups. Defaults to false. */
199
+ allowGroups?: boolean;
200
+ /** Optional depth limit for nested groups when allowGroups is true. */
201
+ maxGroupDepth?: number;
202
+ }
203
+
204
+ declare interface FieldContext {
205
+ values: Record<string, unknown>;
206
+ }
207
+
208
+ declare interface FieldContext_2 {
209
+ values: Record<string, unknown>;
210
+ }
211
+
212
+ declare interface FieldDescriptor {
213
+ /**
214
+ * The formik key for this field.
215
+ * Use `id` (preferred) or `name` — both are accepted.
216
+ * `id` takes precedence if both are provided.
217
+ */
218
+ id?: string;
219
+ name?: string;
220
+ type: FieldType | string;
221
+ /** Child field descriptors — used by type: 'object' to render a nested group. */
222
+ children?: FieldDescriptor[];
223
+ /** Optional per-field condition guard — renders a condition row below this field. */
224
+ condition?: FieldConditionDef;
225
+ label?: string;
226
+ placeholder?: string;
227
+ required?: boolean;
228
+ showOptional?: boolean;
229
+ disabled?: boolean | ((ctx: FieldContext) => boolean);
230
+ hidden?: boolean;
231
+ colSpan?: number;
232
+ dividerAfter?: boolean;
233
+ info?: string;
234
+ helperText?: string;
235
+ dataTestId?: string;
236
+ validation?: AnySchema;
237
+ shouldHide?: (ctx: FieldContext) => boolean;
238
+ shouldDisable?: (ctx: FieldContext) => boolean;
239
+ shouldRequire?: (ctx: FieldContext) => boolean;
240
+ compute?: (ctx: FieldContext) => unknown;
241
+ transform?: FieldTransform;
242
+ onChange?: (value: unknown, ctx: FieldContext & {
243
+ setFieldValue: (name: string, value: unknown) => void;
244
+ }) => void;
245
+ [key: string]: unknown;
246
+ }
247
+
248
+ declare interface FieldDescriptor_2 {
249
+ /**
250
+ * The formik key for this field.
251
+ * Use `id` (preferred) or `name` — both are accepted.
252
+ * `id` takes precedence if both are provided.
253
+ */
254
+ id?: string;
255
+ name?: string;
256
+ type: FieldType_2 | string;
257
+ /** Child field descriptors — used by type: 'object' to render a nested group. */
258
+ children?: FieldDescriptor_2[];
259
+ /** Optional per-field condition guard — renders a condition row below this field. */
260
+ condition?: FieldConditionDef_2;
261
+ label?: string;
262
+ placeholder?: string;
263
+ required?: boolean;
264
+ showOptional?: boolean;
265
+ disabled?: boolean | ((ctx: FieldContext_2) => boolean);
266
+ hidden?: boolean;
267
+ colSpan?: number;
268
+ dividerAfter?: boolean;
269
+ info?: string;
270
+ helperText?: string;
271
+ dataTestId?: string;
272
+ validation?: AnySchema;
273
+ shouldHide?: (ctx: FieldContext_2) => boolean;
274
+ shouldDisable?: (ctx: FieldContext_2) => boolean;
275
+ shouldRequire?: (ctx: FieldContext_2) => boolean;
276
+ compute?: (ctx: FieldContext_2) => unknown;
277
+ transform?: FieldTransform_2;
278
+ onChange?: (value: unknown, ctx: FieldContext_2 & {
279
+ setFieldValue: (name: string, value: unknown) => void;
280
+ }) => void;
281
+ [key: string]: unknown;
282
+ }
283
+
284
+ declare interface FieldTransform {
285
+ in?: (value: unknown) => unknown;
286
+ out?: (value: unknown) => unknown;
287
+ }
288
+
289
+ declare interface FieldTransform_2 {
290
+ in?: (value: unknown) => unknown;
291
+ out?: (value: unknown) => unknown;
292
+ }
293
+
294
+ declare type FieldType = 'text' | 'textarea' | 'number' | 'toggle' | 'radio-group' | 'select' | 'descriptive-select' | 'key-value' | 'array' | 'object' | 'reference' | 'cron' | 'schema';
295
+
296
+ declare type FieldType_2 = 'text' | 'textarea' | 'number' | 'toggle' | 'radio-group' | 'select' | 'descriptive-select' | 'key-value' | 'array' | 'object' | 'reference' | 'cron' | 'schema';
297
+
298
+ export declare const FilterNode: ({ id, data }: NodeProps) => JSX_2.Element;
299
+
300
+ declare interface FixedEdge {
301
+ id: string;
302
+ source: string;
303
+ target: string;
304
+ }
305
+
306
+ declare interface FixedEdge_2 {
307
+ id: string;
308
+ source: string;
309
+ target: string;
310
+ }
311
+
312
+ declare interface FixedNode {
313
+ id: string;
314
+ type: string;
315
+ data?: Record<string, unknown>;
316
+ deletable?: false;
317
+ }
318
+
319
+ declare interface FixedNode_2 {
320
+ id: string;
321
+ type: string;
322
+ data?: Record<string, unknown>;
323
+ deletable?: false;
324
+ }
325
+
326
+ declare const FlowForgeCanvas: ({ nodeRegistry, templateRegistry, initialValue, nodeTypes: consumerNodeTypes, edgeTypes: consumerEdgeTypes, onSave, readOnly, theme, messages: messageOverrides, canvasOptions, renderTriggerSelector, renderNodePicker, renderNodeConfig, onNodeClick: onNodeClickProp, maxNodes, layoutDirection, executionRecord, onFetchWorkflow, }: FlowForgeCanvasProps) => JSX_2.Element;
327
+ export { FlowForgeCanvas }
328
+ export { FlowForgeCanvas as WorkflowCanvas }
329
+
330
+ /** All ReactFlow behaviour settings — serialisable as JSON config */
331
+ export declare interface FlowForgeCanvasOptions {
332
+ /** Fit the whole graph into view on mount. Default: true */
333
+ fitView?: boolean;
334
+ fitViewPadding?: number;
335
+ /** Show the zoom-in / zoom-out / fit controls. Default: true */
336
+ showControls?: boolean;
337
+ /** Show the mini-map overview. Default: false */
338
+ showMiniMap?: boolean;
339
+ /** Pan the canvas by scrolling (no Ctrl needed). Default: true */
340
+ panOnScroll?: boolean;
341
+ /** Zoom with the scroll wheel. Default: false */
342
+ zoomOnScroll?: boolean;
343
+ minZoom?: number;
344
+ maxZoom?: number;
345
+ /** Snap nodes to a grid while dragging. Default: false */
346
+ snapToGrid?: boolean;
347
+ snapGrid?: [number, number];
348
+ /**
349
+ * How branches under a conditional/gateway node are arranged.
350
+ * 'horizontal' (default): branches spread side-by-side (Dagre).
351
+ * 'vertical': branches stack top-to-bottom, indented right under their parent (Workato style).
352
+ */
353
+ branchLayout?: 'horizontal' | 'vertical';
354
+ /**
355
+ * How much of a node's data to show on its card.
356
+ * 'full' (default): show configured value badges / the descriptor's custom body.
357
+ * 'title-only': show just the node title — for teams that want minimal cards.
358
+ */
359
+ nodeBody?: 'full' | 'title-only';
360
+ }
361
+
362
+ export declare interface FlowForgeCanvasProps {
363
+ nodeRegistry: NodeTypeRegistry;
364
+ templateRegistry: TemplateRegistry;
365
+ /** Pre-populate the canvas from a previously saved WorkflowState. */
366
+ initialValue?: WorkflowState;
367
+ nodeTypes?: NodeTypes;
368
+ edgeTypes?: EdgeTypes;
369
+ onSave?: (workflow: WorkflowState) => void;
370
+ /** Disables all editing — no add/delete/config, edges have no "+" button */
371
+ readOnly?: boolean;
372
+ /** Brand colors applied across edges, plus button, and node accents */
373
+ theme?: FlowForgeTheme;
374
+ /** Built-in UI labels for i18n/white-label copy. */
375
+ messages?: Partial<FlowForgeMessages>;
376
+ /** ReactFlow behaviour settings — all serialisable as plain JSON */
377
+ canvasOptions?: FlowForgeCanvasOptions;
378
+ /** Replace the trigger selector UI entirely */
379
+ renderTriggerSelector?: (templates: WorkflowTemplate[], onSelect: (t: WorkflowTemplate) => void, onClose: () => void) => default_2.ReactNode;
380
+ /** Replace the node picker UI entirely */
381
+ renderNodePicker?: (descriptors: NodeDescriptor[], onSelect: (d: NodeDescriptor) => void, onClose: () => void) => default_2.ReactNode;
382
+ /** Replace the node config drawer entirely */
383
+ renderNodeConfig?: (descriptor: NodeDescriptor | undefined, slot: CanvasSlot | null, onSave: (id: string, values: Record<string, unknown>) => void, onClose: () => void) => default_2.ReactNode;
384
+ /** Intercept node click — return true to suppress default behaviour */
385
+ onNodeClick?: (slot: CanvasSlot) => boolean | void;
386
+ /** Global cap on total user task nodes */
387
+ maxNodes?: number;
388
+ /** Flow layout direction. 'TB' = top-to-bottom (default), 'LR' = left-to-right */
389
+ layoutDirection?: 'TB' | 'LR';
390
+ /**
391
+ * When provided, renders an execution overlay on the canvas nodes:
392
+ * green = success, red = failed, grey = skipped/pending.
393
+ * Combine with readOnly=true to show a past run without editing.
394
+ */
395
+ executionRecord?: ExecutionRecord;
396
+ /**
397
+ * Called when a SubWorkflowNode's "Preview" button is clicked.
398
+ * Return the WorkflowState for the given workflowId to render it in a drawer.
399
+ */
400
+ onFetchWorkflow?: (workflowId: string) => Promise<WorkflowState>;
401
+ }
402
+
403
+ export declare interface FlowForgeMessages {
404
+ addTriggerTitle: string;
405
+ addTriggerTooltip: string;
406
+ addTriggerButton: string;
407
+ chooseTrigger: string;
408
+ noTriggers: string;
409
+ addStepTitle: string;
410
+ chooseAction: string;
411
+ noActions: string;
412
+ configureStep: string;
413
+ loadingConfiguration: string;
414
+ noConfigurationNeeded: string;
415
+ save: string;
416
+ cancel: string;
417
+ }
418
+
419
+ export declare interface FlowForgeTheme {
420
+ primaryColor?: string;
421
+ edgeColor?: string;
422
+ textColor?: string;
423
+ mutedTextColor?: string;
424
+ surfaceColor?: string;
425
+ borderColor?: string;
426
+ dangerColor?: string;
427
+ borderRadius?: number;
428
+ fontFamily?: string;
429
+ /** ReactFlow canvas background style. 'none' hides the background entirely. Default: 'dots' */
430
+ background?: 'dots' | 'lines' | 'cross' | 'none';
431
+ /** Background dot/line color. Default: '#e0e0e0' */
432
+ backgroundColor?: string;
433
+ }
434
+
435
+ export declare function loadWorkflowFromBpmn(xml: string): WorkflowState;
436
+
437
+ export declare interface NodeDescriptor {
438
+ type: string;
439
+ label: string;
440
+ icon?: ReactNode;
441
+ /**
442
+ * Optional "app" this action belongs to (Slack, Salesforce, …). When present,
443
+ * the node picker drills down: stage 1 lists unique apps, stage 2 lists this
444
+ * app's actions, stage 3 is the action's config form. Descriptors without an
445
+ * `app` field appear ungrouped at stage 1, alongside the app cards.
446
+ */
447
+ app?: {
448
+ key: string;
449
+ label: string;
450
+ icon?: ReactNode;
451
+ description?: string;
452
+ };
453
+ matches: (id: string) => boolean;
454
+ bpmnEntry: (nodeId: string) => string;
455
+ bpmnExit: (nodeId: string) => string;
456
+ emitBpmnElements: (nodeId: string, nodeData: unknown) => BpmnElement[];
457
+ emitDmnDefinition?: (nodeId: string, nodeData: unknown) => DmnDefinition;
458
+ outgoingCondition?: (nodeId: string, targetId: string, nodeData: unknown) => string;
459
+ reactFlowType: string;
460
+ previewNodeType?: string;
461
+ /**
462
+ * Optional custom node-card body. When provided, the node renderer shows this
463
+ * instead of the default value badges — lets a node author fully design the
464
+ * card body while keeping the shared frame (title, edit/delete, handles).
465
+ * Receives the node's saved formData.
466
+ */
467
+ renderNode?: (nodeData: Record<string, unknown>) => ReactNode;
468
+ /** Maps branch key → display label. e.g. { pass: 'Pass', fail: 'Fail' }. Only applies to branching nodes (filterNode, approvalNode). */
469
+ branchLabels?: Record<string, string>;
470
+ formSchema: FieldDescriptor_2[] | ((nodeId: string) => Promise<FieldDescriptor_2[]>);
471
+ maxPerWorkflow?: number;
472
+ relatedNodePrefixes?: string[];
473
+ }
474
+
475
+ declare interface NodeDescriptor_2 {
476
+ type: string;
477
+ label: string;
478
+ icon?: ReactNode;
479
+ /**
480
+ * Optional "app" this action belongs to (Slack, Salesforce, …). When present,
481
+ * the node picker drills down: stage 1 lists unique apps, stage 2 lists this
482
+ * app's actions, stage 3 is the action's config form. Descriptors without an
483
+ * `app` field appear ungrouped at stage 1, alongside the app cards.
484
+ */
485
+ app?: {
486
+ key: string;
487
+ label: string;
488
+ icon?: ReactNode;
489
+ description?: string;
490
+ };
491
+ matches: (id: string) => boolean;
492
+ bpmnEntry: (nodeId: string) => string;
493
+ bpmnExit: (nodeId: string) => string;
494
+ emitBpmnElements: (nodeId: string, nodeData: unknown) => BpmnElement_2[];
495
+ emitDmnDefinition?: (nodeId: string, nodeData: unknown) => DmnDefinition_2;
496
+ outgoingCondition?: (nodeId: string, targetId: string, nodeData: unknown) => string;
497
+ reactFlowType: string;
498
+ previewNodeType?: string;
499
+ /**
500
+ * Optional custom node-card body. When provided, the node renderer shows this
501
+ * instead of the default value badges — lets a node author fully design the
502
+ * card body while keeping the shared frame (title, edit/delete, handles).
503
+ * Receives the node's saved formData.
504
+ */
505
+ renderNode?: (nodeData: Record<string, unknown>) => ReactNode;
506
+ /** Maps branch key → display label. e.g. { pass: 'Pass', fail: 'Fail' }. Only applies to branching nodes (filterNode, approvalNode). */
507
+ branchLabels?: Record<string, string>;
508
+ formSchema: FieldDescriptor[] | ((nodeId: string) => Promise<FieldDescriptor[]>);
509
+ maxPerWorkflow?: number;
510
+ relatedNodePrefixes?: string[];
511
+ }
512
+
513
+ declare class NodeTypeRegistry {
514
+ private descriptors;
515
+ register(descriptor: NodeDescriptor_2): this;
516
+ forType(type: string): NodeDescriptor_2 | undefined;
517
+ forId(id: string): NodeDescriptor_2 | undefined;
518
+ list(): NodeDescriptor_2[];
519
+ }
520
+
521
+ export declare const offboardingSkeleton: WorkflowState;
522
+
523
+ export declare const RestApiNode: ({ id, data }: NodeProps) => JSX_2.Element;
524
+
525
+ export declare function saveWorkflowToBpmn(workflow: WorkflowState, options?: BpmnSaveOptions): string;
526
+
527
+ declare type SlotKind = 'start' | 'end' | 'addTrigger' | 'triggerFixed' | 'userTask' | 'addStep' | 'filter' | 'approval';
528
+
529
+ declare type SlotKind_2 = 'start' | 'end' | 'addTrigger' | 'triggerFixed' | 'userTask' | 'addStep' | 'filter' | 'approval';
530
+
531
+ export declare const StartNode: () => JSX_2.Element;
532
+
533
+ export declare type StepStatus = 'pending' | 'running' | 'success' | 'failed' | 'skipped';
534
+
535
+ export declare const SubWorkflowPreviewDrawer: default_2.FC<SubWorkflowPreviewDrawerProps>;
536
+
537
+ declare interface SubWorkflowPreviewDrawerProps {
538
+ isOpen: boolean;
539
+ onClose: () => void;
540
+ workflowId: string | null;
541
+ workflowLabel?: string;
542
+ /** Host-provided async loader — returns the WorkflowState for the given ID */
543
+ onFetchWorkflow: (workflowId: string) => Promise<WorkflowState>;
544
+ }
545
+
546
+ declare class TemplateRegistry {
547
+ private templates;
548
+ register(template: WorkflowTemplate_2): this;
549
+ lookup(triggerKey: string): WorkflowTemplate_2 | undefined;
550
+ list(): WorkflowTemplate_2[];
551
+ listByCategory(category: string): WorkflowTemplate_2[];
552
+ listByTag(tag: string): WorkflowTemplate_2[];
553
+ search(query: string): WorkflowTemplate_2[];
554
+ categories(): string[];
555
+ }
556
+
557
+ export declare const TriggerNode: ({ data }: NodeProps) => JSX_2.Element;
558
+
559
+ export declare const userOnboardingSkeleton: WorkflowState;
560
+
561
+ export declare const webhookIntegrationSkeleton: WorkflowState;
562
+
563
+ export declare const WebhookTriggerNode: ({ data }: NodeProps) => JSX_2.Element;
564
+
565
+ /** @deprecated Use FlowForgeCanvasProps */
566
+ export declare type WorkflowCanvasProps = FlowForgeCanvasProps;
567
+
568
+ export declare const WorkflowExecutionHistory: default_2.FC<WorkflowExecutionHistoryProps>;
569
+
570
+ declare interface WorkflowExecutionHistoryProps {
571
+ records: ExecutionRecord[];
572
+ /** Called when the "view on canvas" button is clicked for a record */
573
+ onViewOnCanvas?: (record: ExecutionRecord) => void;
574
+ }
575
+
576
+ export declare interface WorkflowState {
577
+ slots: CanvasSlot[];
578
+ branches: BranchMap;
579
+ }
580
+
581
+ declare interface WorkflowState_2 {
582
+ slots: CanvasSlot_2[];
583
+ branches: BranchMap_2;
584
+ }
585
+
586
+ export declare interface WorkflowTemplate {
587
+ triggerKey: string;
588
+ label: string;
589
+ description?: string;
590
+ icon?: ReactNode;
591
+ triggerCategory?: 'event' | 'scheduler' | 'webhook' | string;
592
+ availableTasks?: string[];
593
+ maxTasks?: number;
594
+ taskLabels?: Record<string, string>;
595
+ fixedNodes?: FixedNode_2[];
596
+ fixedEdges?: FixedEdge_2[];
597
+ insertionPoints?: string[];
598
+ source?: string;
599
+ product?: string;
600
+ /** Pre-built workflow state to clone when user selects this template */
601
+ skeletonState?: WorkflowState;
602
+ /** Tags for filtering in the template library */
603
+ tags?: string[];
604
+ /** Category grouping in the library */
605
+ category?: string;
606
+ /** Team or author that owns this template */
607
+ author?: string;
608
+ /** Relative popularity score (higher = shown first in library) */
609
+ popularity?: number;
610
+ }
611
+
612
+ declare interface WorkflowTemplate_2 {
613
+ triggerKey: string;
614
+ label: string;
615
+ description?: string;
616
+ icon?: ReactNode;
617
+ triggerCategory?: 'event' | 'scheduler' | 'webhook' | string;
618
+ availableTasks?: string[];
619
+ maxTasks?: number;
620
+ taskLabels?: Record<string, string>;
621
+ fixedNodes?: FixedNode[];
622
+ fixedEdges?: FixedEdge[];
623
+ insertionPoints?: string[];
624
+ source?: string;
625
+ product?: string;
626
+ /** Pre-built workflow state to clone when user selects this template */
627
+ skeletonState?: WorkflowState_2;
628
+ /** Tags for filtering in the template library */
629
+ tags?: string[];
630
+ /** Category grouping in the library */
631
+ category?: string;
632
+ /** Team or author that owns this template */
633
+ author?: string;
634
+ /** Relative popularity score (higher = shown first in library) */
635
+ popularity?: number;
636
+ }
637
+
638
+ export declare const WorkflowTemplateLibrary: default_2.FC<WorkflowTemplateLibraryProps>;
639
+
640
+ declare interface WorkflowTemplateLibraryProps {
641
+ templates: WorkflowTemplate[];
642
+ onSelectTemplate: (template: WorkflowTemplate) => void;
643
+ onStartFromScratch?: () => void;
644
+ }
645
+
646
+ export { }
package/dist/canvas.js ADDED
@@ -0,0 +1,28 @@
1
+ import { F as a, S as s, F as r, W as t, a as l, b as n, o as d, u as i, w as f } from "./templateSkeletons-D60ixh5T.js";
2
+ import { d as w } from "./messages-CO299wPN.js";
3
+ import { l as p, s as b } from "./bpmn-CtfWDaOY.js";
4
+ import { A as F, b as N, E as m, c as u, F as S, R as T, S as c, T as v, W as x, e as A } from "./GatewayBranchEdge-gncIBR-0.js";
5
+ export {
6
+ F as ActionNode,
7
+ N as ApprovalNode,
8
+ m as EdgeWithPlusLabel,
9
+ u as EndNode,
10
+ S as FilterNode,
11
+ a as FlowForgeCanvas,
12
+ T as RestApiNode,
13
+ c as StartNode,
14
+ s as SubWorkflowPreviewDrawer,
15
+ v as TriggerNode,
16
+ x as WebhookTriggerNode,
17
+ r as WorkflowCanvas,
18
+ t as WorkflowExecutionHistory,
19
+ l as WorkflowTemplateLibrary,
20
+ n as accessRequestSkeleton,
21
+ A as builtInNodeTypes,
22
+ w as defaultFlowForgeMessages,
23
+ p as loadWorkflowFromBpmn,
24
+ d as offboardingSkeleton,
25
+ b as saveWorkflowToBpmn,
26
+ i as userOnboardingSkeleton,
27
+ f as webhookIntegrationSkeleton
28
+ };
@@ -0,0 +1,32 @@
1
+ const e = 350, o = 18, c = [
2
+ { bg: "#e3f2fd", color: "#1565c0" },
3
+ { bg: "#e8f5e9", color: "#2e7d32" },
4
+ { bg: "#fff3e0", color: "#e65100" },
5
+ { bg: "#fce4ec", color: "#880e4f" },
6
+ { bg: "#ede7f6", color: "#4527a0" }
7
+ ], f = {
8
+ running: "#1976d2",
9
+ success: "#2e7d32",
10
+ failed: "#c62828",
11
+ cancelled: "#757575",
12
+ pending: "#9e9e9e",
13
+ skipped: "#9e9e9e"
14
+ }, l = {
15
+ GET: { bg: "#e8f5e9", color: "#2e7d32" },
16
+ POST: { bg: "#e3f2fd", color: "#1565c0" },
17
+ PUT: { bg: "#fff3e0", color: "#e65100" },
18
+ PATCH: { bg: "#fce4ec", color: "#880e4f" },
19
+ DELETE: { bg: "#ffebee", color: "#b71c1c" }
20
+ }, b = {
21
+ event: { label: "Event", bg: "#e8f5e9", color: "#2e7d32" },
22
+ scheduler: { label: "Scheduler", bg: "#fff3e0", color: "#e65100" },
23
+ webhook: { label: "Webhook", bg: "#e3f2fd", color: "#1565c0" }
24
+ };
25
+ export {
26
+ c as B,
27
+ f as E,
28
+ l as H,
29
+ o as N,
30
+ b as T,
31
+ e as a
32
+ };