@eventcatalog/visualiser 4.1.4 → 5.0.0-beta.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/LICENSE CHANGED
@@ -19,13 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
-
23
- ---
24
-
25
- Note: Source code within the following directories is licensed under the
26
- EventCatalog Commercial License and is NOT covered by the MIT License above:
27
-
28
- - `packages/core/eventcatalog/src/enterprise/`
29
- - `packages/core/src/federation/`
30
-
31
- See the `LICENSE` file in each directory for the full terms.
package/dist/index.d.mts CHANGED
@@ -3,7 +3,6 @@ import { Node, Connection, MarkerType, Edge, NodeTypes, EdgeTypes, NodeProps, Ed
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import react__default from 'react';
6
- import dagre from 'dagre';
7
6
 
8
7
  /**
9
8
  * EventCatalog resource mode
@@ -324,6 +323,17 @@ interface DslGraph {
324
323
  };
325
324
  }
326
325
 
326
+ /** What a flow's swimlanes group its steps by */
327
+ type SwimlaneGroupBy = "domain" | "system" | "team";
328
+ /** What a flow's steps can be grouped by: one of those, or domains with their systems in them */
329
+ type FlowGroupBy = SwimlaneGroupBy | "domain-system";
330
+ /**
331
+ * How the groups are shown: full-width lanes stacked top to bottom, or boxes
332
+ * around their steps (like the pools of a process diagram), placed by the layout
333
+ */
334
+ type FlowGroupStyle = "lanes" | "boxes";
335
+ declare const isFlowGroupBy: (value: unknown) => value is FlowGroupBy;
336
+
327
337
  interface NodeGraphProps {
328
338
  id: string;
329
339
  title?: string;
@@ -344,6 +354,12 @@ interface NodeGraphProps {
344
354
  portalId?: string;
345
355
  showFlowWalkthrough?: boolean;
346
356
  showSearch?: boolean;
357
+ /** Show the settings menu (top left). Defaults to true. */
358
+ showMenu?: boolean;
359
+ /** Use a narrower search box, for small spaces. */
360
+ compactSearch?: boolean;
361
+ /** Hide the React Flow attribution (bottom right). */
362
+ hideAttribution?: boolean;
347
363
  zoomOnScroll?: boolean;
348
364
  designId?: string;
349
365
  isChatEnabled?: boolean;
@@ -359,6 +375,29 @@ interface NodeGraphProps {
359
375
  * flows, e.g. the System Diagram.
360
376
  */
361
377
  disableMessageAnimation?: boolean;
378
+ /**
379
+ * A simpler graph shown as level 1 in the toolbar (e.g. a system's context
380
+ * diagram), before this graph's detail levels.
381
+ */
382
+ overviewGraph?: {
383
+ nodes: Node[];
384
+ edges: Edge[];
385
+ /** Describes the level, e.g. "system context" */
386
+ label: string;
387
+ resourceKey?: string;
388
+ };
389
+ /**
390
+ * This graph laid out with its messages and channels hidden (level 2). Used
391
+ * instead of hiding them and laying the graph out again in the browser.
392
+ */
393
+ hiddenMessagesGraph?: {
394
+ nodes: Node[];
395
+ edges: Edge[];
396
+ };
397
+ /** The kind of diagram (e.g. "services"), so the level is remembered for each kind */
398
+ preferenceScope?: string;
399
+ /** Group a flow's steps to start with (the `group` URL parameter wins) */
400
+ swimlanes?: FlowGroupBy;
362
401
  /** When set, the graph will zoom to this node id. */
363
402
  focusNodeId?: string;
364
403
  /** Optional token to force repeated focus for the same node id. */
@@ -374,7 +413,7 @@ interface NodeGraphProps {
374
413
  }>) => Promise<boolean>;
375
414
  onResetLayout?: (resourceKey: string) => Promise<boolean>;
376
415
  }
377
- declare const NodeGraph: ({ id, nodes: nodesProp, edges: edgesProp, graph, title: titleProp, href, linkTo, hrefLabel, includeKey: includeKeyProp, footerLabel, linksToVisualiser, links, mode, portalId, showFlowWalkthrough, showSearch: showSearchProp, zoomOnScroll, designId, isChatEnabled, maxTextSize, isDevMode, resourceKey, animated: animatedProp, focusNodeId, focusRequestId, fitRequestId, onNodeClick, onBuildUrl, onNavigate, onSaveLayout, onResetLayout, }: NodeGraphProps) => react_jsx_runtime.JSX.Element | null;
416
+ declare const NodeGraph: ({ id, nodes: nodesProp, edges: edgesProp, graph, title: titleProp, href, linkTo, hrefLabel, includeKey: includeKeyProp, footerLabel, linksToVisualiser, links, mode, portalId, showFlowWalkthrough, showSearch: showSearchProp, showMenu, compactSearch, hideAttribution, zoomOnScroll, designId, isChatEnabled, maxTextSize, isDevMode, resourceKey, animated: animatedProp, disableMessageAnimation, overviewGraph, hiddenMessagesGraph, preferenceScope, swimlanes, focusNodeId, focusRequestId, fitRequestId, onNodeClick, onBuildUrl, onNavigate, onSaveLayout, onResetLayout, }: NodeGraphProps) => react_jsx_runtime.JSX.Element | null;
378
417
 
379
418
  interface MermaidViewProps {
380
419
  nodes: Node[];
@@ -447,55 +486,48 @@ interface VisualiserSearchRef {
447
486
  }
448
487
  declare const VisualiserSearch: react.NamedExoticComponent<VisualiserSearchProps & react.RefAttributes<VisualiserSearchRef>>;
449
488
 
450
- interface NodeData {
451
- label?: string;
489
+ type Resource = {
452
490
  summary?: string;
453
- step?: {
454
- title?: string;
491
+ data?: {
455
492
  summary?: string;
456
493
  };
457
- service?: {
458
- name?: string;
494
+ };
495
+ type NodeData = {
496
+ summary?: string;
497
+ step?: {
498
+ title?: string;
459
499
  summary?: string;
460
- data?: {
461
- name?: string;
462
- summary?: string;
463
- };
464
- };
465
- message?: {
466
- name?: string;
467
- summary?: string;
468
- data?: {
469
- name?: string;
470
- summary?: string;
471
- };
472
- };
473
- flow?: {
474
- data?: {
475
- name?: string;
476
- };
477
500
  };
501
+ service?: Resource;
502
+ message?: Resource;
503
+ agent?: Resource;
504
+ flow?: Resource;
505
+ container?: Resource;
506
+ dataProduct?: Resource;
478
507
  custom?: {
479
- title?: string;
480
- label?: string;
508
+ type?: string;
481
509
  summary?: string;
482
- };
483
- actor?: {
484
- label?: string;
510
+ url?: string;
485
511
  };
486
512
  externalSystem?: {
487
- label?: string;
513
+ url?: string;
488
514
  };
489
- }
515
+ };
490
516
  interface CustomNode {
491
517
  id: string;
518
+ type?: string;
492
519
  data: NodeData;
493
520
  }
494
521
  interface StepWalkthroughProps {
495
522
  nodes: CustomNode[];
496
523
  edges: Edge[];
497
524
  isFlowVisualization: boolean;
498
- onStepChange: (nodeId: string | null, highlightPaths?: string[], shouldZoomOut?: boolean) => void;
525
+ /**
526
+ * Called when the step changes: the step (null when the walkthrough ends),
527
+ * whether to zoom out to the whole flow, and the steps walked so far, in
528
+ * order (ending with this one)
529
+ */
530
+ onStepChange: (nodeId: string | null, shouldZoomOut?: boolean, trail?: string[]) => void;
499
531
  mode?: "full" | "simple";
500
532
  }
501
533
  declare const _default$w: react__default.NamedExoticComponent<StepWalkthroughProps>;
@@ -850,7 +882,7 @@ interface CustomEdgeProps extends Omit<EdgeProps, "data"> {
850
882
  }
851
883
  declare const _default$1: react.NamedExoticComponent<CustomEdgeProps>;
852
884
 
853
- declare const AnimatedMessageEdge: react.MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, data, label, markerEnd, markerStart, }: any) => react_jsx_runtime.JSX.Element>;
885
+ declare const AnimatedMessageEdge: react.MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, source, target, sourceHandleId, targetHandleId, data, label, markerEnd, markerStart, }: any) => react_jsx_runtime.JSX.Element>;
854
886
 
855
887
  declare const _default: react.NamedExoticComponent<EdgeProps>;
856
888
 
@@ -859,7 +891,7 @@ declare function LabelledSmoothStepEdge(props: EdgeProps): react_jsx_runtime.JSX
859
891
  declare function LabelledStepEdge(props: EdgeProps): react_jsx_runtime.JSX.Element;
860
892
 
861
893
  declare const edgeTypes: {
862
- animated: react.MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, data, label, markerEnd, markerStart, }: any) => react_jsx_runtime.JSX.Element>;
894
+ animated: react.MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, source, target, sourceHandleId, targetHandleId, data, label, markerEnd, markerStart, }: any) => react_jsx_runtime.JSX.Element>;
863
895
  "flow-edge": react.NamedExoticComponent<CustomEdgeProps>;
864
896
  multiline: react.NamedExoticComponent<_xyflow_react.EdgeProps>;
865
897
  default: typeof LabelledDefaultEdge;
@@ -880,7 +912,7 @@ interface MermaidExportOptions {
880
912
  /**
881
913
  * Convert React Flow nodes and edges to Mermaid flowchart syntax
882
914
  */
883
- declare function convertToMermaid(nodes: Node[], edges: Edge[], options?: MermaidExportOptions): string;
915
+ declare function convertToMermaid(graphNodes: Node[], edges: Edge[], options?: MermaidExportOptions): string;
884
916
 
885
917
  declare const exportNodeGraphForStudio: (data: ReactFlowJsonObject) => ReactFlowJsonObject;
886
918
 
@@ -901,39 +933,26 @@ declare const generatedIdForEdge: (source: CollectionItem, target: CollectionIte
901
933
  declare const getColorFromString: (id: string) => string;
902
934
  declare const getEdgeLabelForServiceAsTarget: (data: MessageCollectionItem) => "invokes" | "publishes \nevent" | "requests" | "sends to";
903
935
  declare const getEdgeLabelForMessageAsSource: (data: MessageCollectionItem, throughChannel?: boolean) => "sends to" | "accepts" | "subscribed to" | "subscribed by";
904
- declare const calculatedNodes: (flow: dagre.graphlib.Graph, nodes: Node[]) => any[];
905
- declare const createDagreGraph: ({ ranksep, nodesep, ...rest }: any) => dagre.graphlib.Graph<{}>;
906
936
  /**
907
- * network-simplex produces the nicest layered layout but is O(V·E) and hangs on
908
- * large architecture maps. tight-tree keeps the same LR layering with far less
909
- * work. Callers can still force a ranker via createDagreGraph({ ranker }).
937
+ * Rough size of an edge label, so the layout can leave room for it on its edge
910
938
  */
911
- declare const LARGE_GRAPH_NODE_THRESHOLD = 80;
912
- declare const LARGE_GRAPH_EDGE_THRESHOLD = 200;
913
- declare const LARGE_GRAPH_RANKER = "tight-tree";
914
- declare const selectDagreRanker: (nodeCount: number, edgeCount: number, explicitRanker?: string) => string | undefined;
915
- declare const layoutDagreGraph: (flow: dagre.graphlib.Graph) => void;
939
+ declare const getEdgeLabelSize: (label: unknown) => {
940
+ width: number;
941
+ height: number;
942
+ };
916
943
  declare const createEdge: (edgeOptions: Edge) => Edge;
917
944
  declare const createNode: (values: Node) => Node;
918
- type DagreGraph = any;
919
- declare const getNodesAndEdgesFromDagre: ({ nodes, edges, defaultFlow, }: {
920
- nodes: Node[];
921
- edges: Edge[];
922
- defaultFlow?: DagreGraph;
923
- }) => {
924
- nodes: any[];
925
- edges: Edge[];
926
- };
927
945
 
928
946
  declare function buildNodeData(node: GraphNode, style?: string): Record<string, unknown>;
929
- declare function layoutGraph(nodes: GraphNode[], edges: GraphEdge[], options?: {
930
- rankdir?: string;
931
- nodesep?: number;
932
- ranksep?: number;
933
- edgesep?: number;
934
- }, style?: string): {
947
+ /**
948
+ * Lays a DSL graph out (left to right), as React Flow nodes and edges. Domains,
949
+ * and nodes other nodes sit in, become groups sized to fit their children.
950
+ */
951
+ declare function layoutGraph(nodes: GraphNode[], edges: GraphEdge[], { style }?: {
952
+ style?: string;
953
+ }): Promise<{
935
954
  nodes: Node[];
936
955
  edges: Edge[];
937
- };
956
+ }>;
938
957
 
939
- export { ACTOR, AGENT, AGENT_TOOL, _default$o as Actor, type ActorNode, type Agent$1 as Agent, _default$i as AgentNode, type AgentTool$1 as AgentTool, _default$j as AgentToolNode, type AgentToolNode as AgentToolNodeType, AnimatedMessageEdge, type BaseNodeData, CHANNEL, COMMAND, type Channel, type ChannelNode, _default$f as Command, type CommandNode, _default$8 as ContextActorNode, type ContextMenuItem, _default$b as CustomNode, DATA, type Data, type DataNode, _default$s as DataProductNode, _default$a as DomainNode, type DslGraph, ENTITY_TARGET_HANDLE_ID, EVENT, type EdgeType, _default$c as EntityNode, type EntityProperty, _default$e as Event, type EventCatalogResource, type EventNode, type ExternalSystem, _default$2 as ExternalSystem2Node, type ExternalSystemNode, _default$q as Field, type FieldNode as FieldNodeType, _default$1 as FlowEdge, _default$r as FlowExpandedNode, _default$6 as FlowNode, FocusModeModal, type GraphEdge, type GraphEdgeType, type GraphNode, _default$5 as GroupNode, LARGE_GRAPH_EDGE_THRESHOLD, LARGE_GRAPH_NODE_THRESHOLD, LARGE_GRAPH_RANKER, LabelledDefaultEdge, LabelledSmoothStepEdge, LabelledStepEdge, MESSAGE, type MermaidExportOptions, MermaidView, type Message, _default$t as MessageGroupExpandedNode, type MessageGroupExpandedNodeData, _default$u as MessageGroupNode, type MessageGroupNodeData, type MessageGroupNode as MessageGroupNodeType, _default as MultilineEdgeLabel, type NodeCategory, type NodeConfiguration, _default$v as NodeContextMenu, NodeGraph, type NodeGraphProps, type NodeType, _default$k as Note, type NoteNode, NotesIndicator, OwnerIndicator, QUERY, _default$g as Query, type QueryNode, type RegisteredNode, SERVICE, _default$h as Service, type ServiceNode, type Service as ServiceType, _default$4 as StepNode, _default$w as StepWalkthrough, _default$7 as SystemGroupNode, _default$9 as SystemNode, _default$3 as UserNode, VIEW, type View, type ViewNode, VisualiserSearch, type VisualizerCallbacks, type VisualizerLink, type VisualizerMode, _default$n as actorConfig, buildNodeData, calculatedNodes, convertToMermaid, createDagreGraph, createEdge, createNode, _default$m as dataNodeConfig, edgeTypes, _default$d as eventConfig, exportNodeGraphForStudio, _default$l as externalSystemConfig, _default$p as fieldConfig, generateIdForNode, generateIdForNodes, generatedIdForEdge, getColorFromString, getEdgeLabelForMessageAsSource, getEdgeLabelForServiceAsTarget, getNestedEntityProperties, getNodesAndEdgesFromDagre, getPropertyTypeLabel, layoutDagreGraph, layoutGraph, nodeComponents, nodeConfigs, normalizeOwners, selectDagreRanker };
958
+ export { ACTOR, AGENT, AGENT_TOOL, _default$o as Actor, type ActorNode, type Agent$1 as Agent, _default$i as AgentNode, type AgentTool$1 as AgentTool, _default$j as AgentToolNode, type AgentToolNode as AgentToolNodeType, AnimatedMessageEdge, type BaseNodeData, CHANNEL, COMMAND, type Channel, type ChannelNode, _default$f as Command, type CommandNode, _default$8 as ContextActorNode, type ContextMenuItem, _default$b as CustomNode, DATA, type Data, type DataNode, _default$s as DataProductNode, _default$a as DomainNode, type DslGraph, ENTITY_TARGET_HANDLE_ID, EVENT, type EdgeType, _default$c as EntityNode, type EntityProperty, _default$e as Event, type EventCatalogResource, type EventNode, type ExternalSystem, _default$2 as ExternalSystem2Node, type ExternalSystemNode, _default$q as Field, type FieldNode as FieldNodeType, _default$1 as FlowEdge, _default$r as FlowExpandedNode, type FlowGroupBy, type FlowGroupStyle, _default$6 as FlowNode, FocusModeModal, type GraphEdge, type GraphEdgeType, type GraphNode, _default$5 as GroupNode, LabelledDefaultEdge, LabelledSmoothStepEdge, LabelledStepEdge, MESSAGE, type MermaidExportOptions, MermaidView, type Message, _default$t as MessageGroupExpandedNode, type MessageGroupExpandedNodeData, _default$u as MessageGroupNode, type MessageGroupNodeData, type MessageGroupNode as MessageGroupNodeType, _default as MultilineEdgeLabel, type NodeCategory, type NodeConfiguration, _default$v as NodeContextMenu, NodeGraph, type NodeGraphProps, type NodeType, _default$k as Note, type NoteNode, NotesIndicator, OwnerIndicator, QUERY, _default$g as Query, type QueryNode, type RegisteredNode, SERVICE, _default$h as Service, type ServiceNode, type Service as ServiceType, _default$4 as StepNode, _default$w as StepWalkthrough, _default$7 as SystemGroupNode, _default$9 as SystemNode, _default$3 as UserNode, VIEW, type View, type ViewNode, VisualiserSearch, type VisualizerCallbacks, type VisualizerLink, type VisualizerMode, _default$n as actorConfig, buildNodeData, convertToMermaid, createEdge, createNode, _default$m as dataNodeConfig, edgeTypes, _default$d as eventConfig, exportNodeGraphForStudio, _default$l as externalSystemConfig, _default$p as fieldConfig, generateIdForNode, generateIdForNodes, generatedIdForEdge, getColorFromString, getEdgeLabelForMessageAsSource, getEdgeLabelForServiceAsTarget, getEdgeLabelSize, getNestedEntityProperties, getPropertyTypeLabel, isFlowGroupBy, layoutGraph, nodeComponents, nodeConfigs, normalizeOwners };
package/dist/index.d.ts CHANGED
@@ -3,7 +3,6 @@ import { Node, Connection, MarkerType, Edge, NodeTypes, EdgeTypes, NodeProps, Ed
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import react__default from 'react';
6
- import dagre from 'dagre';
7
6
 
8
7
  /**
9
8
  * EventCatalog resource mode
@@ -324,6 +323,17 @@ interface DslGraph {
324
323
  };
325
324
  }
326
325
 
326
+ /** What a flow's swimlanes group its steps by */
327
+ type SwimlaneGroupBy = "domain" | "system" | "team";
328
+ /** What a flow's steps can be grouped by: one of those, or domains with their systems in them */
329
+ type FlowGroupBy = SwimlaneGroupBy | "domain-system";
330
+ /**
331
+ * How the groups are shown: full-width lanes stacked top to bottom, or boxes
332
+ * around their steps (like the pools of a process diagram), placed by the layout
333
+ */
334
+ type FlowGroupStyle = "lanes" | "boxes";
335
+ declare const isFlowGroupBy: (value: unknown) => value is FlowGroupBy;
336
+
327
337
  interface NodeGraphProps {
328
338
  id: string;
329
339
  title?: string;
@@ -344,6 +354,12 @@ interface NodeGraphProps {
344
354
  portalId?: string;
345
355
  showFlowWalkthrough?: boolean;
346
356
  showSearch?: boolean;
357
+ /** Show the settings menu (top left). Defaults to true. */
358
+ showMenu?: boolean;
359
+ /** Use a narrower search box, for small spaces. */
360
+ compactSearch?: boolean;
361
+ /** Hide the React Flow attribution (bottom right). */
362
+ hideAttribution?: boolean;
347
363
  zoomOnScroll?: boolean;
348
364
  designId?: string;
349
365
  isChatEnabled?: boolean;
@@ -359,6 +375,29 @@ interface NodeGraphProps {
359
375
  * flows, e.g. the System Diagram.
360
376
  */
361
377
  disableMessageAnimation?: boolean;
378
+ /**
379
+ * A simpler graph shown as level 1 in the toolbar (e.g. a system's context
380
+ * diagram), before this graph's detail levels.
381
+ */
382
+ overviewGraph?: {
383
+ nodes: Node[];
384
+ edges: Edge[];
385
+ /** Describes the level, e.g. "system context" */
386
+ label: string;
387
+ resourceKey?: string;
388
+ };
389
+ /**
390
+ * This graph laid out with its messages and channels hidden (level 2). Used
391
+ * instead of hiding them and laying the graph out again in the browser.
392
+ */
393
+ hiddenMessagesGraph?: {
394
+ nodes: Node[];
395
+ edges: Edge[];
396
+ };
397
+ /** The kind of diagram (e.g. "services"), so the level is remembered for each kind */
398
+ preferenceScope?: string;
399
+ /** Group a flow's steps to start with (the `group` URL parameter wins) */
400
+ swimlanes?: FlowGroupBy;
362
401
  /** When set, the graph will zoom to this node id. */
363
402
  focusNodeId?: string;
364
403
  /** Optional token to force repeated focus for the same node id. */
@@ -374,7 +413,7 @@ interface NodeGraphProps {
374
413
  }>) => Promise<boolean>;
375
414
  onResetLayout?: (resourceKey: string) => Promise<boolean>;
376
415
  }
377
- declare const NodeGraph: ({ id, nodes: nodesProp, edges: edgesProp, graph, title: titleProp, href, linkTo, hrefLabel, includeKey: includeKeyProp, footerLabel, linksToVisualiser, links, mode, portalId, showFlowWalkthrough, showSearch: showSearchProp, zoomOnScroll, designId, isChatEnabled, maxTextSize, isDevMode, resourceKey, animated: animatedProp, focusNodeId, focusRequestId, fitRequestId, onNodeClick, onBuildUrl, onNavigate, onSaveLayout, onResetLayout, }: NodeGraphProps) => react_jsx_runtime.JSX.Element | null;
416
+ declare const NodeGraph: ({ id, nodes: nodesProp, edges: edgesProp, graph, title: titleProp, href, linkTo, hrefLabel, includeKey: includeKeyProp, footerLabel, linksToVisualiser, links, mode, portalId, showFlowWalkthrough, showSearch: showSearchProp, showMenu, compactSearch, hideAttribution, zoomOnScroll, designId, isChatEnabled, maxTextSize, isDevMode, resourceKey, animated: animatedProp, disableMessageAnimation, overviewGraph, hiddenMessagesGraph, preferenceScope, swimlanes, focusNodeId, focusRequestId, fitRequestId, onNodeClick, onBuildUrl, onNavigate, onSaveLayout, onResetLayout, }: NodeGraphProps) => react_jsx_runtime.JSX.Element | null;
378
417
 
379
418
  interface MermaidViewProps {
380
419
  nodes: Node[];
@@ -447,55 +486,48 @@ interface VisualiserSearchRef {
447
486
  }
448
487
  declare const VisualiserSearch: react.NamedExoticComponent<VisualiserSearchProps & react.RefAttributes<VisualiserSearchRef>>;
449
488
 
450
- interface NodeData {
451
- label?: string;
489
+ type Resource = {
452
490
  summary?: string;
453
- step?: {
454
- title?: string;
491
+ data?: {
455
492
  summary?: string;
456
493
  };
457
- service?: {
458
- name?: string;
494
+ };
495
+ type NodeData = {
496
+ summary?: string;
497
+ step?: {
498
+ title?: string;
459
499
  summary?: string;
460
- data?: {
461
- name?: string;
462
- summary?: string;
463
- };
464
- };
465
- message?: {
466
- name?: string;
467
- summary?: string;
468
- data?: {
469
- name?: string;
470
- summary?: string;
471
- };
472
- };
473
- flow?: {
474
- data?: {
475
- name?: string;
476
- };
477
500
  };
501
+ service?: Resource;
502
+ message?: Resource;
503
+ agent?: Resource;
504
+ flow?: Resource;
505
+ container?: Resource;
506
+ dataProduct?: Resource;
478
507
  custom?: {
479
- title?: string;
480
- label?: string;
508
+ type?: string;
481
509
  summary?: string;
482
- };
483
- actor?: {
484
- label?: string;
510
+ url?: string;
485
511
  };
486
512
  externalSystem?: {
487
- label?: string;
513
+ url?: string;
488
514
  };
489
- }
515
+ };
490
516
  interface CustomNode {
491
517
  id: string;
518
+ type?: string;
492
519
  data: NodeData;
493
520
  }
494
521
  interface StepWalkthroughProps {
495
522
  nodes: CustomNode[];
496
523
  edges: Edge[];
497
524
  isFlowVisualization: boolean;
498
- onStepChange: (nodeId: string | null, highlightPaths?: string[], shouldZoomOut?: boolean) => void;
525
+ /**
526
+ * Called when the step changes: the step (null when the walkthrough ends),
527
+ * whether to zoom out to the whole flow, and the steps walked so far, in
528
+ * order (ending with this one)
529
+ */
530
+ onStepChange: (nodeId: string | null, shouldZoomOut?: boolean, trail?: string[]) => void;
499
531
  mode?: "full" | "simple";
500
532
  }
501
533
  declare const _default$w: react__default.NamedExoticComponent<StepWalkthroughProps>;
@@ -850,7 +882,7 @@ interface CustomEdgeProps extends Omit<EdgeProps, "data"> {
850
882
  }
851
883
  declare const _default$1: react.NamedExoticComponent<CustomEdgeProps>;
852
884
 
853
- declare const AnimatedMessageEdge: react.MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, data, label, markerEnd, markerStart, }: any) => react_jsx_runtime.JSX.Element>;
885
+ declare const AnimatedMessageEdge: react.MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, source, target, sourceHandleId, targetHandleId, data, label, markerEnd, markerStart, }: any) => react_jsx_runtime.JSX.Element>;
854
886
 
855
887
  declare const _default: react.NamedExoticComponent<EdgeProps>;
856
888
 
@@ -859,7 +891,7 @@ declare function LabelledSmoothStepEdge(props: EdgeProps): react_jsx_runtime.JSX
859
891
  declare function LabelledStepEdge(props: EdgeProps): react_jsx_runtime.JSX.Element;
860
892
 
861
893
  declare const edgeTypes: {
862
- animated: react.MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, data, label, markerEnd, markerStart, }: any) => react_jsx_runtime.JSX.Element>;
894
+ animated: react.MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, source, target, sourceHandleId, targetHandleId, data, label, markerEnd, markerStart, }: any) => react_jsx_runtime.JSX.Element>;
863
895
  "flow-edge": react.NamedExoticComponent<CustomEdgeProps>;
864
896
  multiline: react.NamedExoticComponent<_xyflow_react.EdgeProps>;
865
897
  default: typeof LabelledDefaultEdge;
@@ -880,7 +912,7 @@ interface MermaidExportOptions {
880
912
  /**
881
913
  * Convert React Flow nodes and edges to Mermaid flowchart syntax
882
914
  */
883
- declare function convertToMermaid(nodes: Node[], edges: Edge[], options?: MermaidExportOptions): string;
915
+ declare function convertToMermaid(graphNodes: Node[], edges: Edge[], options?: MermaidExportOptions): string;
884
916
 
885
917
  declare const exportNodeGraphForStudio: (data: ReactFlowJsonObject) => ReactFlowJsonObject;
886
918
 
@@ -901,39 +933,26 @@ declare const generatedIdForEdge: (source: CollectionItem, target: CollectionIte
901
933
  declare const getColorFromString: (id: string) => string;
902
934
  declare const getEdgeLabelForServiceAsTarget: (data: MessageCollectionItem) => "invokes" | "publishes \nevent" | "requests" | "sends to";
903
935
  declare const getEdgeLabelForMessageAsSource: (data: MessageCollectionItem, throughChannel?: boolean) => "sends to" | "accepts" | "subscribed to" | "subscribed by";
904
- declare const calculatedNodes: (flow: dagre.graphlib.Graph, nodes: Node[]) => any[];
905
- declare const createDagreGraph: ({ ranksep, nodesep, ...rest }: any) => dagre.graphlib.Graph<{}>;
906
936
  /**
907
- * network-simplex produces the nicest layered layout but is O(V·E) and hangs on
908
- * large architecture maps. tight-tree keeps the same LR layering with far less
909
- * work. Callers can still force a ranker via createDagreGraph({ ranker }).
937
+ * Rough size of an edge label, so the layout can leave room for it on its edge
910
938
  */
911
- declare const LARGE_GRAPH_NODE_THRESHOLD = 80;
912
- declare const LARGE_GRAPH_EDGE_THRESHOLD = 200;
913
- declare const LARGE_GRAPH_RANKER = "tight-tree";
914
- declare const selectDagreRanker: (nodeCount: number, edgeCount: number, explicitRanker?: string) => string | undefined;
915
- declare const layoutDagreGraph: (flow: dagre.graphlib.Graph) => void;
939
+ declare const getEdgeLabelSize: (label: unknown) => {
940
+ width: number;
941
+ height: number;
942
+ };
916
943
  declare const createEdge: (edgeOptions: Edge) => Edge;
917
944
  declare const createNode: (values: Node) => Node;
918
- type DagreGraph = any;
919
- declare const getNodesAndEdgesFromDagre: ({ nodes, edges, defaultFlow, }: {
920
- nodes: Node[];
921
- edges: Edge[];
922
- defaultFlow?: DagreGraph;
923
- }) => {
924
- nodes: any[];
925
- edges: Edge[];
926
- };
927
945
 
928
946
  declare function buildNodeData(node: GraphNode, style?: string): Record<string, unknown>;
929
- declare function layoutGraph(nodes: GraphNode[], edges: GraphEdge[], options?: {
930
- rankdir?: string;
931
- nodesep?: number;
932
- ranksep?: number;
933
- edgesep?: number;
934
- }, style?: string): {
947
+ /**
948
+ * Lays a DSL graph out (left to right), as React Flow nodes and edges. Domains,
949
+ * and nodes other nodes sit in, become groups sized to fit their children.
950
+ */
951
+ declare function layoutGraph(nodes: GraphNode[], edges: GraphEdge[], { style }?: {
952
+ style?: string;
953
+ }): Promise<{
935
954
  nodes: Node[];
936
955
  edges: Edge[];
937
- };
956
+ }>;
938
957
 
939
- export { ACTOR, AGENT, AGENT_TOOL, _default$o as Actor, type ActorNode, type Agent$1 as Agent, _default$i as AgentNode, type AgentTool$1 as AgentTool, _default$j as AgentToolNode, type AgentToolNode as AgentToolNodeType, AnimatedMessageEdge, type BaseNodeData, CHANNEL, COMMAND, type Channel, type ChannelNode, _default$f as Command, type CommandNode, _default$8 as ContextActorNode, type ContextMenuItem, _default$b as CustomNode, DATA, type Data, type DataNode, _default$s as DataProductNode, _default$a as DomainNode, type DslGraph, ENTITY_TARGET_HANDLE_ID, EVENT, type EdgeType, _default$c as EntityNode, type EntityProperty, _default$e as Event, type EventCatalogResource, type EventNode, type ExternalSystem, _default$2 as ExternalSystem2Node, type ExternalSystemNode, _default$q as Field, type FieldNode as FieldNodeType, _default$1 as FlowEdge, _default$r as FlowExpandedNode, _default$6 as FlowNode, FocusModeModal, type GraphEdge, type GraphEdgeType, type GraphNode, _default$5 as GroupNode, LARGE_GRAPH_EDGE_THRESHOLD, LARGE_GRAPH_NODE_THRESHOLD, LARGE_GRAPH_RANKER, LabelledDefaultEdge, LabelledSmoothStepEdge, LabelledStepEdge, MESSAGE, type MermaidExportOptions, MermaidView, type Message, _default$t as MessageGroupExpandedNode, type MessageGroupExpandedNodeData, _default$u as MessageGroupNode, type MessageGroupNodeData, type MessageGroupNode as MessageGroupNodeType, _default as MultilineEdgeLabel, type NodeCategory, type NodeConfiguration, _default$v as NodeContextMenu, NodeGraph, type NodeGraphProps, type NodeType, _default$k as Note, type NoteNode, NotesIndicator, OwnerIndicator, QUERY, _default$g as Query, type QueryNode, type RegisteredNode, SERVICE, _default$h as Service, type ServiceNode, type Service as ServiceType, _default$4 as StepNode, _default$w as StepWalkthrough, _default$7 as SystemGroupNode, _default$9 as SystemNode, _default$3 as UserNode, VIEW, type View, type ViewNode, VisualiserSearch, type VisualizerCallbacks, type VisualizerLink, type VisualizerMode, _default$n as actorConfig, buildNodeData, calculatedNodes, convertToMermaid, createDagreGraph, createEdge, createNode, _default$m as dataNodeConfig, edgeTypes, _default$d as eventConfig, exportNodeGraphForStudio, _default$l as externalSystemConfig, _default$p as fieldConfig, generateIdForNode, generateIdForNodes, generatedIdForEdge, getColorFromString, getEdgeLabelForMessageAsSource, getEdgeLabelForServiceAsTarget, getNestedEntityProperties, getNodesAndEdgesFromDagre, getPropertyTypeLabel, layoutDagreGraph, layoutGraph, nodeComponents, nodeConfigs, normalizeOwners, selectDagreRanker };
958
+ export { ACTOR, AGENT, AGENT_TOOL, _default$o as Actor, type ActorNode, type Agent$1 as Agent, _default$i as AgentNode, type AgentTool$1 as AgentTool, _default$j as AgentToolNode, type AgentToolNode as AgentToolNodeType, AnimatedMessageEdge, type BaseNodeData, CHANNEL, COMMAND, type Channel, type ChannelNode, _default$f as Command, type CommandNode, _default$8 as ContextActorNode, type ContextMenuItem, _default$b as CustomNode, DATA, type Data, type DataNode, _default$s as DataProductNode, _default$a as DomainNode, type DslGraph, ENTITY_TARGET_HANDLE_ID, EVENT, type EdgeType, _default$c as EntityNode, type EntityProperty, _default$e as Event, type EventCatalogResource, type EventNode, type ExternalSystem, _default$2 as ExternalSystem2Node, type ExternalSystemNode, _default$q as Field, type FieldNode as FieldNodeType, _default$1 as FlowEdge, _default$r as FlowExpandedNode, type FlowGroupBy, type FlowGroupStyle, _default$6 as FlowNode, FocusModeModal, type GraphEdge, type GraphEdgeType, type GraphNode, _default$5 as GroupNode, LabelledDefaultEdge, LabelledSmoothStepEdge, LabelledStepEdge, MESSAGE, type MermaidExportOptions, MermaidView, type Message, _default$t as MessageGroupExpandedNode, type MessageGroupExpandedNodeData, _default$u as MessageGroupNode, type MessageGroupNodeData, type MessageGroupNode as MessageGroupNodeType, _default as MultilineEdgeLabel, type NodeCategory, type NodeConfiguration, _default$v as NodeContextMenu, NodeGraph, type NodeGraphProps, type NodeType, _default$k as Note, type NoteNode, NotesIndicator, OwnerIndicator, QUERY, _default$g as Query, type QueryNode, type RegisteredNode, SERVICE, _default$h as Service, type ServiceNode, type Service as ServiceType, _default$4 as StepNode, _default$w as StepWalkthrough, _default$7 as SystemGroupNode, _default$9 as SystemNode, _default$3 as UserNode, VIEW, type View, type ViewNode, VisualiserSearch, type VisualizerCallbacks, type VisualizerLink, type VisualizerMode, _default$n as actorConfig, buildNodeData, convertToMermaid, createEdge, createNode, _default$m as dataNodeConfig, edgeTypes, _default$d as eventConfig, exportNodeGraphForStudio, _default$l as externalSystemConfig, _default$p as fieldConfig, generateIdForNode, generateIdForNodes, generatedIdForEdge, getColorFromString, getEdgeLabelForMessageAsSource, getEdgeLabelForServiceAsTarget, getEdgeLabelSize, getNestedEntityProperties, getPropertyTypeLabel, isFlowGroupBy, layoutGraph, nodeComponents, nodeConfigs, normalizeOwners };