@eventcatalog/visualiser 0.0.1
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/README.md +3 -0
- package/dist/index.d.mts +549 -0
- package/dist/index.d.ts +549 -0
- package/dist/index.js +5988 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +5963 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles.css +3074 -0
- package/package.json +76 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/components/NodeGraph.tsx","../src/nodes/service/ServiceNode.tsx","../src/nodes/event/EventNode.tsx","../src/nodes/event/config.ts","../src/nodes/node-types.ts","../src/nodes/query/QueryNode.tsx","../src/nodes/command/CommandNode.tsx","../src/nodes/channel/ChannelNode.tsx","../src/utils/protocols.tsx","../src/nodes/data/DataNode.tsx","../src/nodes/data/config.ts","../src/nodes/view/ViewNode.tsx","../src/nodes/actor/ActorNode.tsx","../src/nodes/actor/config.ts","../src/nodes/external-system/ExternalSystem.tsx","../src/nodes/external-system/config.ts","../src/nodes/note/NoteNode.tsx","../src/nodes/Flow.tsx","../src/utils/url-builder.ts","../src/utils/badges.tsx","../src/nodes/Entity.tsx","../src/nodes/User.tsx","../src/nodes/Step.tsx","../src/nodes/Domain.tsx","../src/nodes/Custom.tsx","../src/nodes/ExternalSystem2.tsx","../src/nodes/DataProduct.tsx","../src/edges/AnimatedMessageEdge.tsx","../src/edges/MultilineEdgeLabel.tsx","../src/edges/FlowEdge.tsx","../src/components/VisualiserSearch.tsx","../src/components/StepWalkthrough.tsx","../src/components/StudioModal.tsx","../src/utils/export-node-graph.ts","../src/components/FocusModeModal.tsx","../src/components/FocusMode/FocusModeContent.tsx","../src/components/FocusMode/utils.ts","../src/components/FocusMode/FocusModeNodeActions.tsx","../src/components/FocusMode/FocusModePlaceholder.tsx","../src/components/MermaidView.tsx","../src/utils/export-mermaid.ts","../src/utils/clipboard.ts","../src/components/VisualizerDropdownContent.tsx","../src/components/NodeContextMenu.tsx","../src/nodes/index.ts","../src/edges/index.ts","../src/utils/utils/utils.ts"],"sourcesContent":["/**\n * @eventcatalog/visualizer\n *\n * Framework-agnostic visualizer components for EventCatalog\n */\n\n// Types\nexport type {\n BaseNodeData,\n NodeType,\n EdgeType,\n VisualizerCallbacks,\n NodeConfiguration,\n VisualizerMode,\n VisualizerLink,\n EventCatalogResource,\n Message,\n Service,\n Channel,\n ExternalSystem,\n Data,\n View,\n RegisteredNode,\n NodeCategory,\n ContextMenuItem,\n} from \"./types\";\n\n// Components\nexport * from \"./components\";\n\n// Nodes\nexport * from \"./nodes\";\n\n// Edges\nexport * from \"./edges\";\n\n// Utils\nexport * from \"./utils\";\n","import { useEffect, useMemo, useState, useCallback, useRef } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport {\n ReactFlow,\n Background,\n ConnectionLineType,\n Controls,\n Panel,\n MiniMap,\n ReactFlowProvider,\n useNodesState,\n useEdgesState,\n type Edge,\n type Node,\n type NodeChange,\n useReactFlow,\n getNodesBounds,\n getViewportForBounds,\n type NodeTypes,\n} from \"@xyflow/react\";\nimport \"@xyflow/react/dist/style.css\";\nimport {\n ExternalLink,\n HistoryIcon,\n CheckIcon,\n ClipboardIcon,\n MoreVertical,\n} from \"lucide-react\";\nimport * as DropdownMenu from \"@radix-ui/react-dropdown-menu\";\nimport { toPng } from \"html-to-image\";\n// Nodes and edges\n// Studio-2 nodes (named exports from directories)\nimport { Service as ServiceNode } from \"../nodes/service\";\nimport { Event as EventNode } from \"../nodes/event\";\nimport { Query as QueryNode } from \"../nodes/query\";\nimport { Command as CommandNode } from \"../nodes/command\";\nimport { Channel as ChannelNode } from \"../nodes/channel\";\nimport { Data as DataNode } from \"../nodes/data\";\nimport { View as ViewNode } from \"../nodes/view\";\nimport { Actor as ActorNode } from \"../nodes/actor\";\nimport { ExternalSystem as ExternalSystemNode } from \"../nodes/external-system\";\nimport { Note as NoteNode } from \"../nodes/note\";\n// Core nodes (default exports from flat files)\nimport FlowNode from \"../nodes/Flow\";\nimport EntityNode from \"../nodes/Entity\";\nimport UserNode from \"../nodes/User\";\nimport StepNode from \"../nodes/Step\";\nimport DomainNode from \"../nodes/Domain\";\nimport CustomNode from \"../nodes/Custom\";\nimport ExternalSystemNode2 from \"../nodes/ExternalSystem2\";\nimport DataProductNode from \"../nodes/DataProduct\";\n// Edges\nimport AnimatedMessageEdge from \"../edges/AnimatedMessageEdge\";\nimport MultilineEdgeLabel from \"../edges/MultilineEdgeLabel\";\nimport FlowEdge from \"../edges/FlowEdge\";\nimport VisualiserSearch, { type VisualiserSearchRef } from \"./VisualiserSearch\";\nimport StepWalkthrough from \"./StepWalkthrough\";\nimport StudioModal from \"./StudioModal\";\nimport FocusModeModal from \"./FocusModeModal\";\nimport MermaidView from \"./MermaidView\";\nimport VisualizerDropdownContent from \"./VisualizerDropdownContent\";\nimport NodeContextMenu from \"./NodeContextMenu\";\nimport { convertToMermaid } from \"../utils/export-mermaid\";\nimport { copyToClipboard } from \"../utils/clipboard\";\n\n// Minimum pixel change to detect layout modifications (avoids floating point comparison issues)\nconst POSITION_CHANGE_THRESHOLD = 1;\n\ninterface Props {\n nodes: any;\n edges: any;\n title?: string;\n subtitle?: string;\n includeBackground?: boolean;\n includeControls?: boolean;\n linkTo?: \"docs\" | \"visualiser\";\n includeKey?: boolean;\n linksToVisualiser?: boolean;\n links?: { label: string; url: string }[];\n mode?: \"full\" | \"simple\";\n showFlowWalkthrough?: boolean;\n showSearch?: boolean;\n zoomOnScroll?: boolean;\n designId?: string;\n isStudioModalOpen?: boolean;\n setIsStudioModalOpen?: (isOpen: boolean) => void;\n isChatEnabled?: boolean;\n maxTextSize?: number;\n isDevMode?: boolean;\n resourceKey?: string;\n\n // Callback API for framework integration\n /** Called when a node is clicked */\n onNodeClick?: (node: Node) => void;\n /** Called to build URLs for navigation (used in links dropdown) */\n onBuildUrl?: (path: string) => string;\n /** Called when navigation should occur */\n onNavigate?: (url: string) => void;\n /** Called to save layout positions (dev mode only) */\n onSaveLayout?: (\n resourceKey: string,\n positions: Record<string, { x: number; y: number }>,\n ) => Promise<boolean>;\n /** Called to reset layout positions (dev mode only) */\n onResetLayout?: (resourceKey: string) => Promise<boolean>;\n}\n\nconst NodeGraphBuilder = ({\n nodes: initialNodes,\n edges: initialEdges,\n title,\n includeBackground = true,\n linkTo: _linkTo = \"docs\",\n includeKey = true,\n linksToVisualiser = false,\n links = [],\n mode = \"full\",\n showFlowWalkthrough = true,\n showSearch = true,\n zoomOnScroll = false,\n isStudioModalOpen,\n setIsStudioModalOpen = () => {},\n isChatEnabled = false,\n maxTextSize,\n isDevMode = false,\n resourceKey,\n onNodeClick,\n onBuildUrl: _onBuildUrl,\n onNavigate,\n onSaveLayout,\n onResetLayout,\n}: Props) => {\n const nodeTypes = useMemo(() => {\n const wrapWithContextMenu = (Component: React.ComponentType<any>) => {\n const Wrapped = (props: any) => {\n const items = props.data?.contextMenu;\n if (!items?.length) return <Component {...props} />;\n return (\n <NodeContextMenu items={items}>\n <Component {...props} />\n </NodeContextMenu>\n );\n };\n Wrapped.displayName = `WithContextMenu(${Component.displayName || Component.name || \"Component\"})`;\n return Wrapped;\n };\n\n return {\n service: wrapWithContextMenu(ServiceNode),\n services: wrapWithContextMenu(ServiceNode),\n flow: wrapWithContextMenu(FlowNode),\n flows: wrapWithContextMenu(FlowNode),\n event: wrapWithContextMenu(EventNode),\n events: wrapWithContextMenu(EventNode),\n channel: wrapWithContextMenu(ChannelNode),\n channels: wrapWithContextMenu(ChannelNode),\n query: wrapWithContextMenu(QueryNode),\n queries: wrapWithContextMenu(QueryNode),\n command: wrapWithContextMenu(CommandNode),\n commands: wrapWithContextMenu(CommandNode),\n domain: wrapWithContextMenu(DomainNode),\n domains: wrapWithContextMenu(DomainNode),\n step: StepNode,\n user: UserNode,\n custom: CustomNode,\n externalSystem: wrapWithContextMenu(ExternalSystemNode),\n \"external-system\": wrapWithContextMenu(ExternalSystemNode2),\n entity: wrapWithContextMenu(EntityNode),\n entities: wrapWithContextMenu(EntityNode),\n data: wrapWithContextMenu(DataNode),\n view: wrapWithContextMenu(ViewNode),\n actor: ActorNode,\n \"data-product\": wrapWithContextMenu(DataProductNode),\n \"data-products\": wrapWithContextMenu(DataProductNode),\n note: (props: any) => <NoteNode {...props} readOnly={true} />,\n } as unknown as NodeTypes;\n }, []);\n const edgeTypes = useMemo(\n () => ({\n animated: AnimatedMessageEdge,\n multiline: MultilineEdgeLabel,\n \"flow-edge\": FlowEdge,\n }),\n [],\n );\n const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);\n const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);\n const [animateMessages, setAnimateMessages] = useState(false);\n const [_activeStepIndex, _setActiveStepIndex] = useState<number | null>(null);\n const [_isFullscreen, _setIsFullscreen] = useState(false);\n const [mermaidCode, setMermaidCode] = useState(\"\");\n const [isShareModalOpen, setIsShareModalOpen] = useState(false);\n const [shareUrlCopySuccess, setShareUrlCopySuccess] = useState(false);\n const [isMermaidView, setIsMermaidView] = useState(false);\n const [showMinimap, setShowMinimap] = useState(false);\n const [hasLayoutChanges, setHasLayoutChanges] = useState(false);\n const [isSavingLayout, setIsSavingLayout] = useState(false);\n const initialPositionsRef = useRef<Record<string, { x: number; y: number }>>(\n {},\n );\n // const [isStudioModalOpen, setIsStudioModalOpen] = useState(false);\n const [focusModeOpen, setFocusModeOpen] = useState(false);\n const [focusedNodeId, setFocusedNodeId] = useState<string | null>(null);\n\n // Check if there are channels to determine if we need the visualizer functionality\n const hasChannels = useMemo(\n () => initialNodes.some((node: any) => node.type === \"channels\"),\n [initialNodes],\n );\n // TODO: Re-enable channel visibility feature\n // const { hideChannels, toggleChannelsVisibility } = useChannelVisibility({\n // nodes,\n // edges,\n // setNodes,\n // setEdges,\n // skipProcessing: !hasChannels,\n // });\n // Temporary implementation\n const hideChannels = false;\n const toggleChannelsVisibility = () => {};\n const { fitView, getNodes } = useReactFlow();\n const searchRef = useRef<VisualiserSearchRef>(null);\n const reactFlowWrapperRef = useRef<HTMLDivElement>(null);\n const scrollableContainerRef = useRef<HTMLElement | null>(null);\n\n // Store initial node positions for change detection (dev mode only)\n useEffect(() => {\n if (isDevMode && initialNodes.length > 0) {\n const positions: Record<string, { x: number; y: number }> = {};\n initialNodes.forEach((node: Node) => {\n positions[node.id] = { x: node.position.x, y: node.position.y };\n });\n initialPositionsRef.current = positions;\n }\n }, [isDevMode, initialNodes]);\n\n // Detect layout changes by comparing current positions to initial positions\n const checkForLayoutChanges = useCallback(() => {\n if (!isDevMode) return;\n const initial = initialPositionsRef.current;\n if (Object.keys(initial).length === 0) return;\n\n const hasChanges = nodes.some((node) => {\n const initialPos = initial[node.id];\n return (\n initialPos &&\n (Math.abs(node.position.x - initialPos.x) > POSITION_CHANGE_THRESHOLD ||\n Math.abs(node.position.y - initialPos.y) > POSITION_CHANGE_THRESHOLD)\n );\n });\n\n setHasLayoutChanges(hasChanges);\n }, [isDevMode, nodes]);\n\n // Wrap onNodesChange to detect layout changes after node drag\n const handleNodesChange = useCallback(\n (changes: NodeChange[]) => {\n onNodesChange(changes);\n // Check for position changes after drag ends\n const hasDragEnd = changes.some(\n (change) => change.type === \"position\" && !change.dragging,\n );\n if (hasDragEnd) {\n // Use setTimeout to ensure state is updated\n setTimeout(checkForLayoutChanges, 0);\n }\n },\n [onNodesChange, checkForLayoutChanges],\n );\n\n const resetNodesAndEdges = useCallback(() => {\n setNodes((nds) =>\n nds.map((node) => {\n node.style = { ...node.style, opacity: 1 };\n return { ...node, animated: animateMessages };\n }),\n );\n setEdges((eds) =>\n eds.map((edge) => {\n edge.style = { ...edge.style, opacity: 1 };\n edge.labelStyle = { ...edge.labelStyle, opacity: 1 };\n return {\n ...edge,\n data: { ...edge.data, opacity: 1, animated: animateMessages },\n animated: animateMessages,\n };\n }),\n );\n }, [setNodes, setEdges, animateMessages]);\n\n const handleNodeClick = useCallback(\n (_: any, node: Node) => {\n // If custom onNodeClick is provided, use it\n if (onNodeClick) {\n onNodeClick(node);\n return;\n }\n\n // Legacy behavior for linksToVisualiser (deprecated - use onNodeClick instead)\n if (linksToVisualiser && onNavigate) {\n // Consumer should handle navigation - but onNodeClick wasn't provided\n return;\n }\n\n // Disable focus mode for flow and entity visualizations\n const isFlow = edges.some((edge: Edge) => edge.type === \"flow-edge\");\n const isEntityVisualizer = nodes.some((n: Node) => n.type === \"entities\");\n if (isFlow || isEntityVisualizer) return;\n\n // Open focus mode modal\n setFocusedNodeId(node.id);\n setFocusModeOpen(true);\n },\n [onNodeClick, linksToVisualiser, onNavigate, edges, nodes],\n );\n\n const toggleAnimateMessages = () => {\n setAnimateMessages(!animateMessages);\n localStorage.setItem(\n \"EventCatalog:animateMessages\",\n JSON.stringify(!animateMessages),\n );\n };\n\n // Handle fit to view\n const handleFitView = useCallback(() => {\n fitView({ duration: 400, padding: 0.2 });\n }, [fitView]);\n\n // animate messages, between views\n // URL parameter takes priority over localStorage\n useEffect(() => {\n const urlParams = new URLSearchParams(window.location.search);\n const animateParam = urlParams.get(\"animate\");\n\n if (animateParam === \"true\") {\n setAnimateMessages(true);\n } else if (animateParam === \"false\") {\n setAnimateMessages(false);\n } else {\n // Fall back to localStorage if no URL parameter\n const storedAnimateMessages = localStorage.getItem(\n \"EventCatalog:animateMessages\",\n );\n if (storedAnimateMessages !== null) {\n setAnimateMessages(storedAnimateMessages === \"true\");\n }\n }\n }, []);\n\n useEffect(() => {\n setEdges((eds) =>\n eds.map((edge) => ({\n ...edge,\n animated: animateMessages,\n type:\n edge.type === \"flow-edge\" || edge.type === \"multiline\"\n ? edge.type\n : animateMessages\n ? \"animated\"\n : \"default\",\n data: { ...edge.data, animateMessages, animated: animateMessages },\n })),\n );\n }, [animateMessages]);\n\n useEffect(() => {\n setTimeout(() => {\n fitView({ duration: 800 });\n }, 150);\n }, []);\n\n // Generate mermaid code from nodes and edges\n useEffect(() => {\n try {\n const code = convertToMermaid(nodes, edges, {\n includeStyles: true,\n direction: \"LR\",\n });\n setMermaidCode(code);\n } catch (error) {\n console.error(\"Error generating mermaid code:\", error);\n setMermaidCode(\"\");\n }\n }, [nodes, edges]);\n\n // Handle scroll wheel events to forward to page when no modifier keys are pressed\n // Only when zoomOnScroll is disabled\n // This is a fix for when we embed node graphs into pages, and users are scrolling the documentation pages\n // We dont want REACT FLOW to swallow the scroll events, so we forward them to the parent page\n useEffect(() => {\n // Skip scroll handling if zoomOnScroll is enabled\n if (zoomOnScroll) return;\n\n // Cache the scrollable container on mount (expensive operation done once)\n const findScrollableContainer = (): HTMLElement | null => {\n // Try specific known selectors first (fast)\n const selectors = [\n \".docs-layout .overflow-y-auto\",\n \".overflow-y-auto\",\n '[style*=\"overflow-y:auto\"]',\n '[style*=\"overflow-y: auto\"]',\n ];\n\n for (const selector of selectors) {\n const element = document.querySelector(selector) as HTMLElement;\n if (element) return element;\n }\n\n return null;\n };\n\n // Find and cache the scrollable container once\n if (!scrollableContainerRef.current) {\n scrollableContainerRef.current = findScrollableContainer();\n }\n\n const handleWheel = (event: WheelEvent) => {\n // Only forward scroll if no modifier keys are pressed\n if (!event.ctrlKey && !event.shiftKey && !event.metaKey) {\n event.preventDefault();\n\n const scrollableContainer = scrollableContainerRef.current;\n\n if (scrollableContainer) {\n scrollableContainer.scrollBy({\n top: event.deltaY,\n left: event.deltaX,\n behavior: \"instant\",\n });\n } else {\n // Fallback to window scroll\n window.scrollBy({\n top: event.deltaY,\n left: event.deltaX,\n behavior: \"instant\",\n });\n }\n }\n };\n\n const wrapper = reactFlowWrapperRef.current;\n if (wrapper) {\n wrapper.addEventListener(\"wheel\", handleWheel, { passive: false });\n return () => {\n wrapper.removeEventListener(\"wheel\", handleWheel);\n };\n }\n }, [zoomOnScroll]);\n\n const handlePaneClick = useCallback(() => {\n searchRef.current?.hideSuggestions();\n resetNodesAndEdges();\n fitView({ duration: 800 });\n }, [resetNodesAndEdges, fitView]);\n\n const handleNodeSelect = useCallback(\n (node: Node) => {\n handleNodeClick(null, node);\n },\n [handleNodeClick],\n );\n\n const handleSearchClear = useCallback(() => {\n resetNodesAndEdges();\n fitView({ duration: 800 });\n }, [resetNodesAndEdges, fitView]);\n\n const downloadImage = useCallback((dataUrl: string, filename?: string) => {\n const a = document.createElement(\"a\");\n a.setAttribute(\"download\", `${filename || \"eventcatalog\"}.png`);\n a.setAttribute(\"href\", dataUrl);\n a.click();\n }, []);\n\n const openStudioModal = () => {\n setIsStudioModalOpen(true);\n };\n\n const openChat = useCallback(() => {\n window.dispatchEvent(new CustomEvent(\"eventcatalog:open-chat\"));\n }, []);\n\n // Layout persistence handlers (dev mode only)\n const handleSaveLayout = useCallback(async (): Promise<boolean> => {\n if (!resourceKey || !onSaveLayout) return false;\n\n const positions: Record<string, { x: number; y: number }> = {};\n nodes.forEach((node) => {\n positions[node.id] = {\n x: node.position.x,\n y: node.position.y,\n };\n });\n\n return await onSaveLayout(resourceKey, positions);\n }, [nodes, resourceKey, onSaveLayout]);\n\n const handleResetLayout = useCallback(async (): Promise<boolean> => {\n if (!resourceKey || !onResetLayout) return false;\n return await onResetLayout(resourceKey);\n }, [resourceKey, onResetLayout]);\n\n // Quick save handler for the change detection UI\n const handleQuickSaveLayout = useCallback(async () => {\n setIsSavingLayout(true);\n const success = await handleSaveLayout();\n setIsSavingLayout(false);\n if (success) {\n // Update initial positions to current positions after save\n const positions: Record<string, { x: number; y: number }> = {};\n nodes.forEach((node) => {\n positions[node.id] = { x: node.position.x, y: node.position.y };\n });\n initialPositionsRef.current = positions;\n setHasLayoutChanges(false);\n }\n }, [handleSaveLayout, nodes]);\n\n const handleCopyArchitectureCode = useCallback(async () => {\n await copyToClipboard(mermaidCode);\n }, [mermaidCode]);\n\n const handleCopyShareUrl = useCallback(async () => {\n const url = typeof window !== \"undefined\" ? window.location.href : \"\";\n await copyToClipboard(url);\n setShareUrlCopySuccess(true);\n setTimeout(() => setShareUrlCopySuccess(false), 2000);\n }, []);\n\n const toggleFullScreen = useCallback(() => {\n if (!document.fullscreenElement) {\n reactFlowWrapperRef.current?.requestFullscreen().catch((err) => {\n console.error(\n `Error attempting to enable full-screen mode: ${err.message} (${err.name})`,\n );\n });\n } else {\n document.exitFullscreen();\n }\n }, []);\n\n useEffect(() => {\n const handleFullscreenChange = () => {\n _setIsFullscreen(!!document.fullscreenElement);\n setTimeout(() => {\n fitView({ duration: 800 });\n }, 100);\n };\n\n document.addEventListener(\"fullscreenchange\", handleFullscreenChange);\n return () => {\n document.removeEventListener(\"fullscreenchange\", handleFullscreenChange);\n };\n }, [fitView]);\n\n const handleExportVisual = useCallback(() => {\n const imageWidth = 1024;\n const imageHeight = 768;\n const nodesBounds = getNodesBounds(getNodes());\n const width =\n imageWidth > nodesBounds.width ? imageWidth : nodesBounds.width;\n const height =\n imageHeight > nodesBounds.height ? imageHeight : nodesBounds.height;\n const viewport = getViewportForBounds(\n nodesBounds,\n width,\n height,\n 0.5,\n 2,\n 0,\n );\n\n // Hide controls during export\n const controls = document.querySelector(\n \".react-flow__controls\",\n ) as HTMLElement;\n if (controls) controls.style.display = \"none\";\n\n toPng(document.querySelector(\".react-flow__viewport\") as HTMLElement, {\n backgroundColor: \"#f1f1f1\",\n width,\n height,\n style: {\n width: width.toString(),\n height: height.toString(),\n transform: `translate(${viewport.x}px, ${viewport.y}px) scale(${viewport.zoom})`,\n },\n }).then((dataUrl: string) => {\n downloadImage(dataUrl, title);\n // Restore controls\n if (controls) controls.style.display = \"block\";\n });\n }, [getNodes, downloadImage, title]);\n\n const handleLegendClick = useCallback(\n (collectionType: string, groupId?: string) => {\n const updatedNodes = nodes.map((node: Node<any>) => {\n // Check if the groupId is set first\n if (groupId && node.data.group && node.data.group?.id === groupId) {\n return { ...node, style: { ...node.style, opacity: 1 } };\n } else {\n if (node.type === collectionType) {\n return { ...node, style: { ...node.style, opacity: 1 } };\n }\n }\n return { ...node, style: { ...node.style, opacity: 0.1 } };\n });\n\n const updatedEdges = edges.map((edge) => {\n return {\n ...edge,\n data: { ...edge.data, opacity: 0.1 },\n style: { ...edge.style, opacity: 0.1 },\n labelStyle: { ...edge.labelStyle, opacity: 0.1 },\n animated: animateMessages,\n };\n });\n\n setNodes(updatedNodes);\n setEdges(updatedEdges);\n\n fitView({\n padding: 0.2,\n duration: 800,\n nodes: updatedNodes.filter((node) => node.type === collectionType),\n });\n },\n [nodes, edges, setNodes, setEdges, fitView],\n );\n\n const getNodesByCollectionWithColors = useCallback((nodes: Node<any>[]) => {\n const colorClasses = {\n events: \"bg-orange-600\",\n services: \"bg-pink-600\",\n flows: \"bg-teal-600\",\n commands: \"bg-blue-600\",\n queries: \"bg-green-600\",\n channels: \"bg-gray-600\",\n externalSystem: \"bg-pink-600\",\n actor: \"bg-yellow-500\",\n step: \"bg-gray-700\",\n data: \"bg-blue-600\",\n \"data-products\": \"bg-indigo-600\",\n };\n\n let legendForDomains: {\n [key: string]: { count: number; colorClass: string; groupId: string };\n } = {};\n\n // Find any groups\n const domainGroups = [\n ...new Set(\n nodes\n .filter(\n (node) => node.data.group && node.data.group?.type === \"Domain\",\n )\n .map((node) => node.data.group?.id),\n ),\n ];\n\n domainGroups.forEach((groupId) => {\n const group = nodes.filter(\n (node) => node.data.group && node.data.group?.id === groupId,\n );\n legendForDomains[`${groupId} (Domain)`] = {\n count: group.length,\n colorClass: \"bg-yellow-600\",\n groupId,\n };\n });\n\n const legendForNodes = nodes.reduce(\n (\n acc: {\n [key: string]: {\n count: number;\n colorClass: string;\n groupId?: string;\n };\n },\n node,\n ) => {\n const collection = node.type;\n if (collection) {\n if (acc[collection]) {\n acc[collection].count += 1;\n } else {\n acc[collection] = {\n count: 1,\n colorClass:\n colorClasses[collection as keyof typeof colorClasses] ||\n \"bg-black\",\n };\n }\n }\n return acc;\n },\n {},\n );\n\n return { ...legendForDomains, ...legendForNodes };\n }, []);\n\n const legend = getNodesByCollectionWithColors(nodes);\n\n const handleStepChange = useCallback(\n (\n nodeId: string | null,\n highlightPaths?: string[],\n shouldZoomOut?: boolean,\n ) => {\n if (nodeId === null) {\n // Reset all nodes and edges\n resetNodesAndEdges();\n _setActiveStepIndex(null);\n\n // If shouldZoomOut is true, fit the entire view\n if (shouldZoomOut) {\n setTimeout(() => {\n fitView({ duration: 800, padding: 0.1 });\n }, 100);\n }\n return;\n }\n\n const activeNode = nodes.find((node: Node) => node.id === nodeId);\n if (!activeNode) return;\n\n // Create set of highlighted nodes and edges\n const highlightedNodeIds = new Set<string>();\n const highlightedEdgeIds = new Set<string>();\n\n // Add current node\n highlightedNodeIds.add(activeNode.id);\n\n // Add incoming edges and their source nodes\n edges.forEach((edge: Edge) => {\n if (edge.target === activeNode.id) {\n highlightedEdgeIds.add(edge.id);\n highlightedNodeIds.add(edge.source);\n }\n });\n\n // Add outgoing edges\n if (highlightPaths) {\n // Highlight all possible paths when at a fork\n highlightPaths.forEach((pathId) => {\n const [source, target] = pathId.split(\"-\");\n edges.forEach((edge: Edge) => {\n if (edge.source === source && edge.target === target) {\n highlightedEdgeIds.add(edge.id);\n highlightedNodeIds.add(edge.target);\n }\n });\n });\n } else {\n // Highlight all outgoing edges normally\n edges.forEach((edge: Edge) => {\n if (edge.source === activeNode.id) {\n highlightedEdgeIds.add(edge.id);\n highlightedNodeIds.add(edge.target);\n }\n });\n }\n\n // Update nodes\n const updatedNodes = nodes.map((node: Node) => {\n if (highlightedNodeIds.has(node.id)) {\n return { ...node, style: { ...node.style, opacity: 1 } };\n }\n return { ...node, style: { ...node.style, opacity: 0.2 } };\n });\n\n // Update edges\n const updatedEdges = edges.map((edge: Edge) => {\n if (highlightedEdgeIds.has(edge.id)) {\n return {\n ...edge,\n data: { ...edge.data, opacity: 1, animated: true },\n style: { ...edge.style, opacity: 1, strokeWidth: 3 },\n labelStyle: { ...edge.labelStyle, opacity: 1 },\n animated: true,\n };\n }\n return {\n ...edge,\n data: { ...edge.data, opacity: 0.2, animated: false },\n style: { ...edge.style, opacity: 0.2, strokeWidth: 2 },\n labelStyle: { ...edge.labelStyle, opacity: 0.2 },\n animated: false,\n };\n });\n\n setNodes(updatedNodes);\n setEdges(updatedEdges);\n\n // Fit view to active node\n fitView({\n padding: 0.4,\n duration: 800,\n nodes: [activeNode],\n });\n },\n [nodes, edges, setNodes, setEdges, resetNodesAndEdges, fitView],\n );\n\n // Check if this is a flow visualization by checking if edges use flow-edge type\n const isFlowVisualization = edges.some(\n (edge: Edge) => edge.type === \"flow-edge\",\n );\n\n return (\n <div\n ref={reactFlowWrapperRef}\n className=\"w-full h-full bg-gray-50 flex flex-col\"\n >\n {isMermaidView ? (\n <>\n {/* Menu Bar for Mermaid View */}\n <div className=\"w-full pr-6 flex space-x-2 justify-between items-center bg-[rgb(var(--ec-page-bg))] border-b border-[rgb(var(--ec-page-border))] p-4\">\n <div className=\"flex space-x-2 ml-4\">\n {/* Settings Dropdown Menu */}\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <button\n className=\"py-2.5 px-4 bg-[rgb(var(--ec-page-bg))] hover:bg-[rgb(var(--ec-accent-subtle)/0.4)] border border-[rgb(var(--ec-page-border))] rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[rgb(var(--ec-accent))] flex items-center gap-3 transition-all duration-200 hover:border-[rgb(var(--ec-accent)/0.3)] group whitespace-nowrap\"\n aria-label=\"Open menu\"\n >\n {title && (\n <span className=\"text-base font-medium text-[rgb(var(--ec-page-text))] leading-tight\">\n {title}\n </span>\n )}\n <MoreVertical className=\"h-5 w-5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0 group-hover:text-[rgb(var(--ec-accent))] transition-colors duration-150\" />\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n className=\"min-w-56 bg-[rgb(var(--ec-page-bg))] border border-[rgb(var(--ec-page-border))] rounded-lg shadow-xl z-50 py-1.5 animate-in fade-in zoom-in-95 duration-200\"\n sideOffset={0}\n align=\"end\"\n alignOffset={-180}\n >\n <DropdownMenu.Arrow className=\"fill-[rgb(var(--ec-page-bg))] stroke-[rgb(var(--ec-page-border))] stroke-1\" />\n <VisualizerDropdownContent\n isMermaidView={isMermaidView}\n setIsMermaidView={setIsMermaidView}\n animateMessages={animateMessages}\n toggleAnimateMessages={toggleAnimateMessages}\n hideChannels={hideChannels}\n toggleChannelsVisibility={toggleChannelsVisibility}\n hasChannels={hasChannels}\n showMinimap={showMinimap}\n setShowMinimap={setShowMinimap}\n handleFitView={handleFitView}\n searchRef={searchRef}\n isChatEnabled={isChatEnabled}\n openChat={openChat}\n handleCopyArchitectureCode={handleCopyArchitectureCode}\n handleExportVisual={handleExportVisual}\n setIsShareModalOpen={setIsShareModalOpen}\n toggleFullScreen={toggleFullScreen}\n openStudioModal={openStudioModal}\n isDevMode={isDevMode}\n onSaveLayout={handleSaveLayout}\n onResetLayout={handleResetLayout}\n />\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n </div>\n {mode === \"full\" && showSearch && (\n <div className=\"flex justify-end items-center gap-2\">\n {!isMermaidView && (\n <div className=\"w-96\">\n <VisualiserSearch\n ref={searchRef}\n nodes={nodes}\n onNodeSelect={handleNodeSelect}\n onClear={handleSearchClear}\n />\n </div>\n )}\n </div>\n )}\n </div>\n {/* Mermaid View */}\n <div className=\"flex-1 overflow-hidden relative\">\n <MermaidView\n nodes={nodes}\n edges={edges}\n maxTextSize={maxTextSize}\n />\n </div>\n </>\n ) : (\n <ReactFlow\n nodeTypes={nodeTypes}\n edgeTypes={edgeTypes}\n minZoom={0.07}\n nodes={nodes}\n edges={edges}\n fitView\n onNodesChange={handleNodesChange}\n onEdgesChange={onEdgesChange}\n connectionLineType={ConnectionLineType.SmoothStep}\n nodeOrigin={[0.1, 0.1]}\n onNodeClick={handleNodeClick}\n onPaneClick={handlePaneClick}\n zoomOnScroll={zoomOnScroll}\n className=\"relative\"\n >\n <Panel position=\"top-center\" className=\"w-full pr-6 \">\n <div className=\"flex space-x-2 justify-between items-center\">\n <div className=\"flex space-x-2 ml-4\">\n {/* Settings Dropdown Menu */}\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <button\n className=\"py-2.5 px-4 bg-[rgb(var(--ec-page-bg))] hover:bg-[rgb(var(--ec-accent-subtle)/0.4)] border border-[rgb(var(--ec-page-border))] rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[rgb(var(--ec-accent))] flex items-center gap-3 transition-all duration-200 hover:border-[rgb(var(--ec-accent)/0.3)] group whitespace-nowrap\"\n aria-label=\"Open menu\"\n >\n {title && (\n <span className=\"text-base font-medium text-[rgb(var(--ec-page-text))] leading-tight\">\n {title}\n </span>\n )}\n <MoreVertical className=\"h-5 w-5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0 group-hover:text-[rgb(var(--ec-accent))] transition-colors duration-150\" />\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n className=\"min-w-56 bg-[rgb(var(--ec-page-bg))] border border-[rgb(var(--ec-page-border))] rounded-lg shadow-xl z-50 py-1.5 animate-in fade-in zoom-in-95 duration-200\"\n sideOffset={0}\n align=\"end\"\n alignOffset={-180}\n >\n <DropdownMenu.Arrow className=\"fill-[rgb(var(--ec-page-bg))] stroke-[rgb(var(--ec-page-border))] stroke-1\" />\n <VisualizerDropdownContent\n isMermaidView={isMermaidView}\n setIsMermaidView={setIsMermaidView}\n animateMessages={animateMessages}\n toggleAnimateMessages={toggleAnimateMessages}\n hideChannels={hideChannels}\n toggleChannelsVisibility={toggleChannelsVisibility}\n hasChannels={hasChannels}\n showMinimap={showMinimap}\n setShowMinimap={setShowMinimap}\n handleFitView={handleFitView}\n searchRef={searchRef}\n isChatEnabled={isChatEnabled}\n openChat={openChat}\n handleCopyArchitectureCode={handleCopyArchitectureCode}\n handleExportVisual={handleExportVisual}\n setIsShareModalOpen={setIsShareModalOpen}\n toggleFullScreen={toggleFullScreen}\n openStudioModal={openStudioModal}\n isDevMode={isDevMode}\n onSaveLayout={handleSaveLayout}\n onResetLayout={handleResetLayout}\n />\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n </div>\n {mode === \"full\" && showSearch && (\n <div className=\"flex justify-end items-center gap-2\">\n {!isMermaidView && (\n <div className=\"w-96\">\n <VisualiserSearch\n ref={searchRef}\n nodes={nodes}\n onNodeSelect={handleNodeSelect}\n onClear={handleSearchClear}\n />\n </div>\n )}\n </div>\n )}\n </div>\n {links.length > 0 && (\n <div className=\"flex justify-end mt-3\">\n <div className=\"relative flex items-center -mt-1\">\n <span className=\"absolute left-2 pointer-events-none flex items-center h-full\">\n <HistoryIcon className=\"h-4 w-4 text-gray-600\" />\n </span>\n <select\n value={\n links.find((link) =>\n window.location.href.includes(link.url),\n )?.url || links[0].url\n }\n onChange={(e) => {\n if (onNavigate) {\n onNavigate(e.target.value);\n } else {\n window.location.href = e.target.value;\n }\n }}\n className=\"appearance-none pl-7 pr-6 py-0 text-[14px] bg-white rounded-md border border-gray-200 hover:bg-gray-100/50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[rgb(var(--ec-accent))]\"\n style={{ minWidth: 120, height: \"26px\" }}\n >\n {links.map((link) => (\n <option key={link.url} value={link.url}>\n {link.label}\n </option>\n ))}\n </select>\n <span className=\"absolute right-2 pointer-events-none\">\n <svg\n className=\"w-4 h-4 text-gray-400\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M19 9l-7 7-7-7\"\n />\n </svg>\n </span>\n </div>\n </div>\n )}\n </Panel>\n\n {includeBackground && <Background color=\"#bbb\" gap={16} />}\n {includeBackground && <Controls />}\n {showMinimap && (\n <MiniMap\n nodeStrokeWidth={3}\n zoomable\n pannable\n style={{\n backgroundColor: \"rgb(var(--ec-page-bg))\",\n border: \"1px solid rgb(var(--ec-page-border))\",\n borderRadius: \"8px\",\n }}\n />\n )}\n {isFlowVisualization && showFlowWalkthrough && (\n <Panel position=\"bottom-left\">\n <StepWalkthrough\n nodes={nodes}\n edges={edges}\n isFlowVisualization={isFlowVisualization}\n onStepChange={handleStepChange}\n mode={mode}\n />\n </Panel>\n )}\n {/* Dev Mode: Layout change indicator */}\n {isDevMode && hasLayoutChanges && (\n <Panel\n position=\"bottom-left\"\n style={\n isFlowVisualization && showFlowWalkthrough\n ? { marginBottom: \"20px\", marginLeft: \"410px\" }\n : { marginLeft: \"60px\" }\n }\n >\n <div className=\"bg-[rgb(var(--ec-card-bg))] border border-[rgb(var(--ec-page-border))] rounded-lg shadow-md px-3 py-2 flex items-center gap-3\">\n <span className=\"text-xs text-[rgb(var(--ec-page-text-muted))]\">\n Layout changed\n </span>\n <button\n onClick={handleQuickSaveLayout}\n disabled={isSavingLayout}\n className=\"text-xs font-medium text-[rgb(var(--ec-accent-text))] bg-[rgb(var(--ec-accent-subtle))] hover:bg-[rgb(var(--ec-accent-subtle)/0.7)] px-2 py-1 rounded transition-colors disabled:opacity-50\"\n >\n {isSavingLayout ? \"Saving...\" : \"Save\"}\n </button>\n </div>\n </Panel>\n )}\n {includeKey && (\n <Panel\n position=\"bottom-right\"\n style={showMinimap ? { marginRight: \"230px\" } : undefined}\n >\n <div className=\" bg-white font-light px-4 text-[12px] shadow-md py-1 rounded-md\">\n <ul className=\"m-0 p-0 \">\n {Object.entries(legend).map(\n ([key, { count, colorClass, groupId }]) => (\n <li\n key={key}\n className=\"flex space-x-2 items-center text-[10px] cursor-pointer hover:text-[rgb(var(--ec-accent))] hover:underline\"\n onClick={() => handleLegendClick(key, groupId)}\n >\n <span className={`w-2 h-2 block ${colorClass}`} />\n <span className=\"block capitalize\">\n {key} ({count})\n </span>\n </li>\n ),\n )}\n </ul>\n </div>\n </Panel>\n )}\n </ReactFlow>\n )}\n <StudioModal\n isOpen={isStudioModalOpen || false}\n onClose={() => setIsStudioModalOpen(false)}\n />\n <FocusModeModal\n isOpen={focusModeOpen}\n onClose={() => setFocusModeOpen(false)}\n initialNodeId={focusedNodeId}\n nodes={nodes}\n edges={edges}\n nodeTypes={nodeTypes}\n edgeTypes={edgeTypes}\n />\n\n {/* Share Link Modal */}\n {isShareModalOpen && (\n <>\n <div\n className=\"fixed inset-0 bg-black/20 z-40\"\n onClick={() => setIsShareModalOpen(false)}\n style={{ animation: \"fadeIn 150ms ease-out\" }}\n />\n <div\n className=\"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-[rgb(var(--ec-page-bg))] rounded-lg shadow-xl z-50 w-full max-w-md p-6 border border-[rgb(var(--ec-page-border))]\"\n style={{ animation: \"slideInCenter 250ms ease-out\" }}\n >\n <style>{`\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes slideInCenter {\n from { opacity: 0; transform: translate(-50%, -48%); }\n to { opacity: 1; transform: translate(-50%, -50%); }\n }\n `}</style>\n\n <div className=\"flex justify-between items-start mb-4\">\n <h3 className=\"text-lg font-semibold text-[rgb(var(--ec-page-text))]\">\n Share Link\n </h3>\n <button\n onClick={() => setIsShareModalOpen(false)}\n className=\"text-[rgb(var(--ec-page-text-muted))] hover:text-[rgb(var(--ec-page-text))] transition-colors\"\n aria-label=\"Close modal\"\n >\n <ExternalLink className=\"w-5 h-5 rotate-180\" />\n </button>\n </div>\n\n <p className=\"text-sm text-[rgb(var(--ec-page-text-muted))] mb-4\">\n Share this link with your team to let them view this\n visualization.\n </p>\n\n <div className=\"flex gap-2\">\n <input\n type=\"text\"\n readOnly\n value={\n typeof window !== \"undefined\" ? window.location.href : \"\"\n }\n className=\"flex-1 px-3 py-2.5 bg-[rgb(var(--ec-input-bg))] border border-[rgb(var(--ec-input-border))] rounded-md text-[rgb(var(--ec-input-text))] text-sm focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ec-accent))]\"\n />\n <button\n onClick={handleCopyShareUrl}\n className={`px-4 py-2.5 rounded-md font-medium transition-all duration-200 flex items-center gap-2 ${\n shareUrlCopySuccess\n ? \"bg-green-500 text-white\"\n : \"bg-[rgb(var(--ec-accent))] text-white hover:opacity-90\"\n }`}\n aria-label={shareUrlCopySuccess ? \"Copied!\" : \"Copy link\"}\n >\n {shareUrlCopySuccess ? (\n <CheckIcon className=\"w-4 h-4\" />\n ) : (\n <ClipboardIcon className=\"w-4 h-4\" />\n )}\n <span>{shareUrlCopySuccess ? \"Copied!\" : \"Copy\"}</span>\n </button>\n </div>\n </div>\n </>\n )}\n </div>\n );\n};\n\ninterface NodeGraphProps {\n id: string;\n title?: string;\n href?: string;\n hrefLabel?: string;\n nodes: Node[];\n edges: Edge[];\n linkTo?: \"docs\" | \"visualiser\";\n includeKey?: boolean;\n footerLabel?: string;\n linksToVisualiser?: boolean;\n links?: { label: string; url: string }[];\n mode?: \"full\" | \"simple\";\n portalId?: string;\n showFlowWalkthrough?: boolean;\n showSearch?: boolean;\n zoomOnScroll?: boolean;\n designId?: string;\n isChatEnabled?: boolean;\n maxTextSize?: number;\n isDevMode?: boolean;\n resourceKey?: string;\n\n // Callback API for framework integration\n onNodeClick?: (node: Node) => void;\n onBuildUrl?: (path: string) => string;\n onNavigate?: (url: string) => void;\n onSaveLayout?: (\n resourceKey: string,\n positions: Record<string, { x: number; y: number }>,\n ) => Promise<boolean>;\n onResetLayout?: (resourceKey: string) => Promise<boolean>;\n}\n\nconst NodeGraph = ({\n id,\n nodes,\n edges,\n title,\n href,\n linkTo = \"docs\",\n hrefLabel = \"Open in visualizer\",\n includeKey = true,\n footerLabel,\n linksToVisualiser = false,\n links = [],\n mode = \"full\",\n portalId,\n showFlowWalkthrough = true,\n showSearch = true,\n zoomOnScroll = false,\n designId,\n isChatEnabled = false,\n maxTextSize,\n isDevMode = false,\n resourceKey,\n onNodeClick,\n onBuildUrl,\n onNavigate,\n onSaveLayout,\n onResetLayout,\n}: NodeGraphProps) => {\n const [elem, setElem] = useState(null);\n const [showFooter, setShowFooter] = useState(true);\n const [isStudioModalOpen, setIsStudioModalOpen] = useState(false);\n\n const openStudioModal = useCallback(() => {\n setIsStudioModalOpen(true);\n }, []);\n\n const containerToRenderInto = portalId || `${id}-portal`;\n\n useEffect(() => {\n // @ts-ignore\n setElem(document.getElementById(containerToRenderInto));\n }, []);\n\n useEffect(() => {\n const urlParams = new URLSearchParams(window.location.search);\n const embed = urlParams.get(\"embed\");\n if (embed === \"true\") {\n setShowFooter(false);\n }\n }, []);\n\n if (!elem) return null;\n\n return (\n <div>\n {createPortal(\n <ReactFlowProvider>\n <NodeGraphBuilder\n edges={edges}\n nodes={nodes}\n title={title}\n linkTo={linkTo}\n includeKey={includeKey}\n linksToVisualiser={linksToVisualiser}\n links={links}\n mode={mode}\n showFlowWalkthrough={showFlowWalkthrough}\n showSearch={showSearch}\n zoomOnScroll={zoomOnScroll}\n designId={designId || id}\n isStudioModalOpen={isStudioModalOpen}\n setIsStudioModalOpen={setIsStudioModalOpen}\n isChatEnabled={isChatEnabled}\n maxTextSize={maxTextSize}\n isDevMode={isDevMode}\n resourceKey={resourceKey}\n onNodeClick={onNodeClick}\n onBuildUrl={onBuildUrl}\n onNavigate={onNavigate}\n onSaveLayout={onSaveLayout}\n onResetLayout={onResetLayout}\n />\n\n {showFooter && (\n <div className=\"flex justify-between\" id=\"visualiser-footer\">\n {footerLabel && (\n <div className=\"py-2 w-full text-left \">\n <span className=\" text-sm no-underline py-2 text-gray-500\">\n {footerLabel}\n </span>\n </div>\n )}\n\n {href && (\n <div className=\"py-2 w-full text-right flex justify-between\">\n {/* <span className=\"text-sm text-gray-500 italic\">Right click a node to access documentation</span> */}\n <button\n onClick={openStudioModal}\n className=\" text-sm underline text-gray-800 hover:text-primary flex items-center space-x-1\"\n >\n <span>Open in EventCatalog Studio</span>\n <ExternalLink className=\"w-3 h-3\" />\n </button>\n <a\n className=\" text-sm underline text-gray-800 hover:text-primary\"\n href={href}\n >\n {hrefLabel} →\n </a>\n </div>\n )}\n </div>\n )}\n </ReactFlowProvider>,\n elem,\n )}\n </div>\n );\n};\n\nexport default NodeGraph;\n","import { ServerIcon } from \"lucide-react\";\nimport { Node, Handle, Position } from \"@xyflow/react\";\nimport { EventCatalogResource, Service as ServiceType } from \"../../types\";\n\nfunction classNames(...classes: any) {\n return classes.filter(Boolean).join(\" \");\n}\n\ntype ServiceNodeData = EventCatalogResource & {\n service: ServiceType;\n};\n\nexport type ServiceNode = Node<ServiceNodeData, \"service\">;\n\nexport default function Service(props: ServiceNode) {\n const { data: _data, selected } = props;\n const {\n version,\n owners = [],\n sends = [],\n receives = [],\n name,\n summary,\n } = props.data.service;\n\n const mode = props.data.mode || \"simple\";\n\n const nodeLabel = \"Service\";\n\n return (\n <div\n className={classNames(\n \"rounded-md border flex justify-start bg-white text-black relative\",\n selected\n ? \"border-pink-600 ring-2 ring-pink-500 shadow-lg\"\n : \"border-pink-400\",\n )}\n style={{ minHeight: \"100px\", width: \"260px\" }}\n >\n <Handle\n type=\"target\"\n position={Position.Left}\n className=\"!left-[-1px] !w-2.5 !h-2.5 !bg-pink-500 !border !border-pink-600 !rounded-full !z-10\"\n />\n <Handle\n type=\"source\"\n position={Position.Right}\n className=\"!right-[-1px] !w-2.5 !h-2.5 !bg-pink-500 !border !border-pink-600 !rounded-full !z-10\"\n />\n <div\n className={`bg-gradient-to-b from-pink-500 to-pink-700 relative flex flex-col items-center w-5 justify-between rounded-l-sm text-pink-100 border-r-[1px] border-pink-500`}\n >\n <ServerIcon className=\"w-4 h-4 opacity-90 text-white mt-1\" />\n {mode === \"full\" && (\n <span\n className=\"text-center text-[8px] text-white font-bold uppercase mb-4\"\n style={{\n transform: \"rotate(-90deg)\",\n letterSpacing: \"0.15em\",\n whiteSpace: \"nowrap\",\n }}\n >\n {nodeLabel}\n </span>\n )}\n </div>\n <div className=\"p-1 flex-1\">\n <div\n className={classNames(\n mode === \"full\" ? `border-b border-gray-200` : \"\",\n )}\n >\n <span className=\"text-xs font-bold block pt-0.5 pb-0.5\">{name}</span>\n <div className=\"flex justify-between\">\n <span className=\"text-[10px] font-light block pt-0.5 pb-0.5\">\n v{version}\n </span>\n {mode === \"simple\" && (\n <span className=\"text-[10px] text-gray-500 font-light block pt-0.5 pb-0.5\">\n {nodeLabel}\n </span>\n )}\n </div>\n </div>\n {mode === \"full\" && (\n <div className=\"divide-y divide-gray-200\">\n <div className=\"leading-3 py-1\">\n <div\n className=\"text-[8px] font-light overflow-hidden\"\n style={{\n display: \"-webkit-box\",\n WebkitLineClamp: 2,\n WebkitBoxOrient: \"vertical\",\n }}\n title={summary}\n >\n {summary}\n </div>\n </div>\n\n <div className=\"grid grid-cols-2 gap-x-4 py-1\">\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Receives messages: {receives.length}\n </span>\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Publishes messages: {sends.length}\n </span>\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Owners: {owners.length}\n </span>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n","import { Zap } from \"lucide-react\";\nimport { Node, Handle, Position } from \"@xyflow/react\";\nimport { Message, EventCatalogResource } from \"../../types\";\n\nfunction classNames(...classes: any) {\n return classes.filter(Boolean).join(\" \");\n}\n\ntype MessageNodeData = EventCatalogResource & {\n message: Message;\n};\n\nexport type EventNode = Node<MessageNodeData, \"event\">;\n\nexport default function Event(props: EventNode) {\n const {\n version,\n owners = [],\n producers = [],\n consumers = [],\n name,\n summary,\n } = props?.data?.message;\n\n const mode = props?.data?.mode || \"simple\";\n\n const nodeLabel = \"Event\";\n\n return (\n <div\n className={classNames(\n \"rounded-md border flex justify-start bg-white text-black relative\",\n props?.selected\n ? \"border-orange-600 ring-2 ring-orange-500 shadow-lg\"\n : \"border-orange-400\",\n )}\n style={{ minHeight: \"100px\", width: \"260px\" }}\n >\n <Handle\n type=\"target\"\n position={Position.Left}\n className=\"!left-[-1px] !w-2.5 !h-2.5 !bg-orange-500 !border !border-orange-600 !rounded-full !z-10\"\n />\n <Handle\n type=\"source\"\n position={Position.Right}\n className=\"!right-[-1px] !w-2.5 !h-2.5 !bg-orange-500 !border !border-orange-600 !rounded-full !z-10\"\n />\n <div\n className={`bg-gradient-to-b from-orange-500 to-orange-700 relative flex flex-col items-center w-5 justify-between rounded-l-sm text-orange-100 border-r-[1px] border-orange-500`}\n >\n <Zap className=\"w-4 h-4 opacity-90 text-white mt-1\" />\n {mode === \"full\" && (\n <span\n className=\"text-center text-[8px] text-white font-bold uppercase mb-4\"\n style={{\n transform: \"rotate(-90deg)\",\n letterSpacing: \"0.15em\",\n whiteSpace: \"nowrap\",\n }}\n >\n {nodeLabel}\n </span>\n )}\n </div>\n <div className=\"p-1 flex-1\">\n <div\n className={classNames(\n mode === \"full\" ? `border-b border-gray-200` : \"\",\n )}\n >\n <span className=\"text-xs font-bold block pt-0.5 pb-0.5\">{name}</span>\n <div className=\"flex justify-between\">\n <span className=\"text-[10px] font-light block pt-0.5 pb-0.5\">\n v{version}\n </span>\n {mode === \"simple\" && (\n <span className=\"text-[10px] text-gray-500 font-light block pt-0.5 pb-0.5\">\n {nodeLabel}\n </span>\n )}\n </div>\n </div>\n {mode === \"full\" && (\n <div className=\"divide-y divide-gray-200\">\n <div className=\"leading-3 py-1\">\n <div\n className=\"text-[8px] font-light overflow-hidden\"\n style={{\n display: \"-webkit-box\",\n WebkitLineClamp: 2,\n WebkitBoxOrient: \"vertical\",\n }}\n title={summary}\n >\n {summary}\n </div>\n </div>\n\n <div className=\"grid grid-cols-2 gap-x-4 py-1\">\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Producers: {producers.length}\n </span>\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Consumers: {consumers.length}\n </span>\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Owners: {owners.length}\n </span>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n","import { Connection, MarkerType } from \"@xyflow/react\";\nimport { Zap } from \"lucide-react\";\nimport { NodeConfiguration } from \"../../types\";\nimport { SERVICE, CHANNEL, EVENT } from \"../node-types\";\n\nexport default {\n type: \"event\",\n icon: Zap,\n color: \"orange\",\n targetCanConnectTo: [...SERVICE, ...CHANNEL],\n sourceCanConnectTo: [...SERVICE, ...CHANNEL],\n validateConnection: (connection: Connection) => {\n return connection.source !== connection.target;\n },\n getEdgeOptions: (connection: Connection) => {\n if (\n EVENT.includes(connection.source) &&\n SERVICE.includes(connection.target)\n ) {\n return {\n label: \"Publishes\",\n markerEnd: { type: MarkerType.ArrowClosed, color: \"#000000\" },\n };\n }\n return {\n label: \"Subscribes\",\n markerEnd: { type: MarkerType.ArrowClosed, color: \"#000000\" },\n };\n },\n defaultData: {\n name: \"New Event\",\n version: \"0.0.1\",\n summary: \"New event. Click edit to change the details.\",\n mode: \"full\",\n },\n editor: {\n title: \"Event\",\n subtitle: \"Edit the details of the event\",\n schema: {\n type: \"object\",\n required: [\"name\", \"version\"],\n properties: {\n name: {\n type: \"string\",\n title: \"Name\",\n default: \"Random value\",\n description:\n \"The name of the event. Use a verb-noun format (e.g., OrderPlaced).\",\n },\n version: {\n type: \"string\",\n title: \"Version\",\n default: \"1.0.0\",\n description: \"The version number (e.g., 1.0.0)\",\n pattern: \"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+(?:-[\\\\w.-]+)?(?:\\\\+[\\\\w.-]+)?$\",\n },\n summary: {\n type: \"string\",\n title: \"Summary\",\n default: \"\",\n description: \"A brief summary of the event\",\n },\n },\n },\n },\n} as NodeConfiguration;\n","export const SERVICE = [\"service\", \"services\"];\nexport const EVENT = [\"event\", \"events\"];\nexport const QUERY = [\"queries\", \"query\", \"querie\"];\nexport const COMMAND = [\"command\", \"commands\"];\nexport const CHANNEL = [\"channel\", \"channels\"];\nexport const ACTOR = [\"actor\", \"actors\"];\nexport const DATA = [\"data\"];\nexport const VIEW = [\"view\"];\n\nexport const MESSAGE = [...EVENT, ...COMMAND, ...QUERY];\n","import { Search } from \"lucide-react\";\nimport { Node, Handle, Position } from \"@xyflow/react\";\nimport { Message, EventCatalogResource } from \"../../types\";\n\nfunction classNames(...classes: any) {\n return classes.filter(Boolean).join(\" \");\n}\n\ntype QueryNodeData = EventCatalogResource & {\n message: Message;\n};\n\nexport type QueryNode = Node<QueryNodeData, \"query\">;\n\nexport default function Query(props: QueryNode) {\n const {\n version,\n owners = [],\n producers = [],\n consumers = [],\n name,\n summary,\n } = props.data.message;\n\n const mode = props.data.mode || \"simple\";\n\n const nodeLabel = \"Query\";\n\n return (\n <div\n className={classNames(\n \"rounded-md border flex justify-start bg-white text-black relative\",\n props.selected\n ? \"border-green-600 ring-2 ring-green-500 shadow-lg\"\n : \"border-green-400\",\n )}\n style={{ minHeight: \"100px\", width: \"260px\" }}\n >\n <Handle\n type=\"target\"\n position={Position.Left}\n className=\"!left-[-1px] !w-2.5 !h-2.5 !bg-green-500 !border !border-green-600 !rounded-full !z-10\"\n />\n <Handle\n type=\"source\"\n position={Position.Right}\n className=\"!right-[-1px] !w-2.5 !h-2.5 !bg-green-500 !border !border-green-600 !rounded-full !z-10\"\n />\n <div\n className={`bg-gradient-to-b from-green-500 to-green-700 relative flex flex-col items-center w-5 justify-between rounded-l-sm text-green-100 border-r-[1px] border-green-500`}\n >\n <Search className=\"w-4 h-4 opacity-90 text-white mt-1\" />\n {mode === \"full\" && (\n <span\n className=\"text-center text-[8px] text-white font-bold uppercase mb-4\"\n style={{\n transform: \"rotate(-90deg)\",\n letterSpacing: \"0.15em\",\n whiteSpace: \"nowrap\",\n }}\n >\n {nodeLabel}\n </span>\n )}\n </div>\n <div className=\"p-1 flex-1\">\n <div\n className={classNames(\n mode === \"full\" ? `border-b border-gray-200` : \"\",\n )}\n >\n <span className=\"text-xs font-bold block pt-0.5 pb-0.5\">{name}</span>\n <div className=\"flex justify-between\">\n <span className=\"text-[10px] font-light block pt-0.5 pb-0.5\">\n v{version}\n </span>\n {mode === \"simple\" && (\n <span className=\"text-[10px] text-gray-500 font-light block pt-0.5 pb-0.5\">\n {nodeLabel}\n </span>\n )}\n </div>\n </div>\n {mode === \"full\" && (\n <div className=\"divide-y divide-gray-200\">\n <div className=\"leading-3 py-1\">\n <div\n className=\"text-[8px] font-light overflow-hidden\"\n style={{\n display: \"-webkit-box\",\n WebkitLineClamp: 2,\n WebkitBoxOrient: \"vertical\",\n }}\n title={summary}\n >\n {summary}\n </div>\n </div>\n\n <div className=\"grid grid-cols-2 gap-x-4 py-1\">\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Producers: {producers.length}\n </span>\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Consumers: {consumers.length}\n </span>\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Owners: {owners.length}\n </span>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n","import { MessageSquare } from \"lucide-react\";\nimport { Node, Handle, Position } from \"@xyflow/react\";\nimport { Message, EventCatalogResource } from \"../../types\";\n\nfunction classNames(...classes: any) {\n return classes.filter(Boolean).join(\" \");\n}\n\ntype CommandNodeData = EventCatalogResource & {\n message: Message;\n};\n\nexport type CommandNode = Node<CommandNodeData, \"command\">;\n\nexport default function Command(props: CommandNode) {\n const {\n version,\n owners = [],\n producers = [],\n consumers = [],\n name,\n summary,\n } = props.data.message;\n\n const mode = props.data.mode || \"simple\";\n\n const nodeLabel = \"Command\";\n\n return (\n <div\n className={classNames(\n \"rounded-md border flex justify-start bg-white text-black relative\",\n props.selected\n ? \"border-blue-600 ring-2 ring-blue-500 shadow-lg\"\n : \"border-blue-400\",\n )}\n style={{ minHeight: \"100px\", width: \"260px\" }}\n >\n <Handle\n type=\"target\"\n position={Position.Left}\n className=\"!left-[-1px] !w-2.5 !h-2.5 !bg-blue-500 !border !border-blue-600 !rounded-full !z-10\"\n />\n <Handle\n type=\"source\"\n position={Position.Right}\n className=\"!right-[-1px] !w-2.5 !h-2.5 !bg-blue-500 !border !border-blue-600 !rounded-full !z-10\"\n />\n <div\n className={`bg-gradient-to-b from-blue-500 to-blue-700 relative flex flex-col items-center w-5 justify-between rounded-l-sm text-blue-100 border-r-[1px] border-blue-500`}\n >\n <MessageSquare className=\"w-4 h-4 opacity-90 text-white mt-1\" />\n {mode === \"full\" && (\n <span\n className=\"text-center text-[8px] text-white font-bold uppercase mb-4\"\n style={{\n transform: \"rotate(-90deg)\",\n letterSpacing: \"0.15em\",\n whiteSpace: \"nowrap\",\n }}\n >\n {nodeLabel}\n </span>\n )}\n </div>\n <div className=\"p-1 flex-1\">\n <div\n className={classNames(\n mode === \"full\" ? `border-b border-gray-200` : \"\",\n )}\n >\n <span className=\"text-xs font-bold block pt-0.5 pb-0.5\">{name}</span>\n <div className=\"flex justify-between\">\n <span className=\"text-[10px] font-light block pt-0.5 pb-0.5\">\n v{version}\n </span>\n {mode === \"simple\" && (\n <span className=\"text-[10px] text-gray-500 font-light block pt-0.5 pb-0.5\">\n {nodeLabel}\n </span>\n )}\n </div>\n </div>\n {mode === \"full\" && (\n <div className=\"divide-y divide-gray-200\">\n <div className=\"leading-3 py-1\">\n <div\n className=\"text-[8px] font-light overflow-hidden\"\n style={{\n display: \"-webkit-box\",\n WebkitLineClamp: 2,\n WebkitBoxOrient: \"vertical\",\n }}\n title={summary}\n >\n {summary}\n </div>\n </div>\n\n <div className=\"grid grid-cols-2 gap-x-4 py-1\">\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Producers: {producers.length}\n </span>\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Consumers: {consumers.length}\n </span>\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Owners: {owners.length}\n </span>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n","import { ArrowRightLeft, Link } from \"lucide-react\";\nimport { Node, Handle, Position } from \"@xyflow/react\";\nimport { getIconForProtocol } from \"../../utils/protocols\";\nimport { EventCatalogResource, Channel as ChannelType } from \"../../types\";\n\ntype ChannelNodeData = EventCatalogResource & {\n channel: ChannelType;\n};\n\nfunction classNames(...classes: any) {\n return classes.filter(Boolean).join(\" \");\n}\n\nexport type ChannelNode = Node<ChannelNodeData, \"channel\">;\n\nexport default function Channel(props: ChannelNode) {\n const { data } = props;\n\n const { version, name, summary, protocols = [], address } = data.channel;\n\n const mode = props.data.mode || \"simple\";\n\n const nodeLabel = \"Channel\";\n\n const Icon = getIconForProtocol(protocols?.[0]);\n\n return (\n <div\n className={classNames(\n \"rounded-md border flex justify-start bg-white text-black relative\",\n props.selected\n ? \"border-gray-600 ring-2 ring-gray-500 shadow-lg\"\n : \"border-gray-400\",\n )}\n style={{ minHeight: \"100px\", width: \"260px\" }}\n >\n <Handle\n type=\"target\"\n position={Position.Left}\n className=\"!left-[-1px] !w-2.5 !h-2.5 !bg-gray-500 !border !border-gray-600 !rounded-full !z-10\"\n />\n <Handle\n type=\"source\"\n position={Position.Right}\n className=\"!right-[-1px] !w-2.5 !h-2.5 !bg-gray-500 !border !border-gray-600 !rounded-full !z-10\"\n />\n <div\n className={`bg-gradient-to-b from-gray-500 to-gray-700 relative flex flex-col items-center w-5 justify-between rounded-l-sm text-gray-100 border-r-[1px] border-gray-500`}\n >\n <ArrowRightLeft className=\"w-4 h-4 opacity-90 text-white mt-1\" />\n {mode === \"full\" && (\n <span\n className=\"text-center text-[8px] text-white font-bold uppercase mb-4\"\n style={{\n transform: \"rotate(-90deg)\",\n letterSpacing: \"0.15em\",\n whiteSpace: \"nowrap\",\n }}\n >\n {nodeLabel}\n </span>\n )}\n </div>\n <div className=\"p-1 flex-1\">\n <div\n className={classNames(\n mode === \"full\" ? `border-b border-gray-200` : \"\",\n )}\n >\n <div className=\"flex justify-between items-center\">\n <span className=\"text-xs font-bold block pb-0.5\">{name}</span>\n {Icon && <Icon className=\"w-5 h-5 opacity-60 p-0.5\" />}\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-[10px] font-light block pt-0.5 pb-0.5\">\n v{version}\n </span>\n {mode === \"simple\" && (\n <span className=\"text-[10px] text-gray-500 font-light block pt-0.5 pb-0.5\">\n {nodeLabel}\n </span>\n )}\n </div>\n </div>\n {mode === \"full\" && (\n <div className=\"divide-y divide-gray-200\">\n <div className=\"leading-3 py-1\">\n <div\n className=\"text-[8px] font-light overflow-hidden\"\n style={{\n display: \"-webkit-box\",\n WebkitLineClamp: 2,\n WebkitBoxOrient: \"vertical\",\n }}\n title={summary}\n >\n {summary}\n </div>\n </div>\n\n {address && (\n <div\n className=\"leading-3 py-1 flex flex-col items-start space-y-0.5\"\n style={{ fontSize: \"0.2em\" }}\n >\n <div\n className=\"flex items-center space-x-0.5\"\n style={{ fontSize: \"0.8em\" }}\n >\n <Link className=\"w-2 h-2 opacity-60\" />\n <span\n className=\"block font-normal \"\n style={{ marginLeft: \"0.5em\" }}\n >\n {address}\n </span>\n </div>\n {protocols && protocols.length > 0 && (\n <div\n className=\"flex space-x-2 items-center \"\n style={{ fontSize: \"0.8em\" }}\n >\n {[...protocols].map((protocol, index) => {\n const ProtoColIcon = getIconForProtocol(protocol);\n return (\n <span\n key={index}\n className=\"font-normal flex items-center -ml-[1px] space-x-0.5\"\n >\n {ProtoColIcon && (\n <ProtoColIcon className=\"w-2 h-2 opacity-60 inline-block\" />\n )}\n <span style={{ marginLeft: \"0.5em\" }}>\n {protocol}\n </span>\n </span>\n );\n })}\n </div>\n )}\n </div>\n )}\n </div>\n )}\n </div>\n </div>\n );\n}\n","import { Server, Radio, Wifi, Network, Globe } from \"lucide-react\";\n\n// Map protocol names to Lucide icons\nconst protocolIconMap: { [key: string]: any } = {\n http: Server,\n https: Server,\n ws: Radio,\n wss: Radio,\n websocket: Radio,\n mqtt: Wifi,\n amqp: Network,\n kafka: Network,\n rabbitmq: Network,\n redis: Network,\n grpc: Globe,\n graphql: Globe,\n};\n\nexport const getIconForProtocol = (protocol: string) => {\n if (!protocol) return Server;\n const normalizedProtocol = protocol.replace(\"-\", \"\").toLowerCase();\n return protocolIconMap[normalizedProtocol] || Server;\n};\n","import { Database } from \"lucide-react\";\nimport { Node, Handle, Position } from \"@xyflow/react\";\nimport { EventCatalogResource, Data as DataType } from \"../../types\";\n\nfunction classNames(...classes: any) {\n return classes.filter(Boolean).join(\" \");\n}\n\ntype DataNodeData = EventCatalogResource & {\n data: DataType;\n};\n\nexport type DataNode = Node<DataNodeData, \"data\">;\n\nexport default function Data(props: DataNode) {\n const {\n version,\n owners = [],\n schemas = [],\n name,\n summary,\n type = \"Database\",\n } = props.data.data;\n\n const mode = props.data.mode || \"simple\";\n\n const nodeLabel = \"Data\";\n\n return (\n <div\n className={classNames(\n \"rounded-md border flex justify-start bg-white text-black relative\",\n props.selected\n ? \"border-blue-600 ring-2 ring-blue-500 shadow-lg\"\n : \"border-blue-400\",\n )}\n style={{ minHeight: \"100px\", width: \"260px\" }}\n >\n <Handle\n type=\"target\"\n position={Position.Left}\n className=\"!left-[-1px] !w-2.5 !h-2.5 !bg-blue-500 !border !border-blue-600 !rounded-full !z-10\"\n />\n <Handle\n type=\"source\"\n position={Position.Right}\n className=\"!right-[-1px] !w-2.5 !h-2.5 !bg-blue-500 !border !border-blue-600 !rounded-full !z-10\"\n />\n <div\n className={`bg-gradient-to-b from-blue-500 to-blue-700 relative flex flex-col items-center w-5 justify-between rounded-l-sm text-blue-100 border-r-[1px] border-blue-500`}\n >\n <Database className=\"w-4 h-4 opacity-90 text-white mt-1\" />\n {mode === \"full\" && (\n <span\n className=\"text-center text-[8px] text-white font-bold uppercase mb-4\"\n style={{\n transform: \"rotate(-90deg)\",\n letterSpacing: \"0.15em\",\n whiteSpace: \"nowrap\",\n }}\n >\n {nodeLabel}\n </span>\n )}\n </div>\n <div className=\"p-1 flex-1\">\n <div\n className={classNames(\n mode === \"full\" ? `border-b border-gray-200` : \"\",\n )}\n >\n <span className=\"text-xs font-bold block pt-0.5 pb-0.5\">{name}</span>\n <div className=\"flex justify-between\">\n <span className=\"text-[10px] font-light block pt-0.5 pb-0.5\">\n v{version}\n </span>\n {mode === \"simple\" && (\n <span className=\"text-[10px] text-gray-500 font-light block pt-0.5 pb-0.5\">\n {nodeLabel}\n </span>\n )}\n </div>\n </div>\n {mode === \"full\" && (\n <div className=\"divide-y divide-gray-200\">\n <div className=\"leading-3 py-1\">\n <div\n className=\"text-[8px] font-light overflow-hidden\"\n style={{\n display: \"-webkit-box\",\n WebkitLineClamp: 2,\n WebkitBoxOrient: \"vertical\",\n }}\n title={summary}\n >\n {summary}\n </div>\n </div>\n\n <div className=\"grid grid-cols-2 gap-x-4 py-1\">\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Type: {type}\n </span>\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Schemas: {schemas.length}\n </span>\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Owners: {owners.length}\n </span>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n","import { Connection, MarkerType } from \"@xyflow/react\";\nimport { Database } from \"lucide-react\";\nimport { NodeConfiguration } from \"../../types\";\nimport { SERVICE, CHANNEL, ACTOR } from \"../node-types\";\n\nexport default {\n type: \"data\",\n icon: Database,\n color: \"blue\",\n targetCanConnectTo: [...SERVICE, ...CHANNEL, \"external-system\", ...ACTOR],\n sourceCanConnectTo: [...SERVICE, ...CHANNEL, \"external-system\", ...ACTOR],\n validateConnection: (connection: Connection) => {\n return connection.source !== connection.target;\n },\n getEdgeOptions: (connection: Connection) => {\n if (connection.source === \"data\" && connection.target === \"service\") {\n return {\n label: \"Provides data to\",\n markerEnd: { type: MarkerType.ArrowClosed, color: \"#000000\" },\n };\n }\n if (connection.source === \"service\" && connection.target === \"data\") {\n return {\n label: \"Stores data in\",\n markerEnd: { type: MarkerType.ArrowClosed, color: \"#000000\" },\n };\n }\n return {\n label: \"Connected to\",\n markerEnd: { type: MarkerType.ArrowClosed, color: \"#000000\" },\n };\n },\n defaultData: {\n name: \"New Database\",\n version: \"0.0.1\",\n summary: \"New data store. Click edit to change the details.\",\n type: \"Database\",\n mode: \"full\",\n },\n editor: {\n title: \"Data Store\",\n subtitle: \"Edit the details of the data store\",\n schema: {\n type: \"object\",\n required: [\"name\", \"version\"],\n properties: {\n name: {\n type: \"string\",\n title: \"Name\",\n default: \"UserDatabase\",\n description: \"The name of the data store\",\n },\n version: {\n type: \"string\",\n title: \"Version\",\n default: \"1.0.0\",\n description: \"The version number (e.g., 1.0.0)\",\n pattern: \"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+(?:-[\\\\w.-]+)?(?:\\\\+[\\\\w.-]+)?$\",\n },\n summary: {\n type: \"string\",\n title: \"Summary\",\n default: \"\",\n description: \"A brief summary of the data store\",\n },\n type: {\n type: \"string\",\n title: \"Type\",\n default: \"Database\",\n description: \"The type of data store (Database, Cache, Queue, etc.)\",\n enum: [\n \"Database\",\n \"Cache\",\n \"Queue\",\n \"File System\",\n \"Data Lake\",\n \"Data Warehouse\",\n ],\n },\n },\n },\n },\n} as NodeConfiguration;\n","import { MonitorIcon } from \"lucide-react\";\nimport { Node, Handle, Position } from \"@xyflow/react\";\nimport { EventCatalogResource, View as ViewType } from \"../../types\";\n\nfunction classNames(...classes: any) {\n return classes.filter(Boolean).join(\" \");\n}\n\ntype ViewNodeData = EventCatalogResource & {\n view: ViewType;\n};\n\nexport type ViewNode = Node<ViewNodeData, \"view\">;\n\nexport default function View(props: ViewNode) {\n const { data: _data, selected } = props;\n const { name, summary, screenshot } = props.data.view;\n\n const mode = props.data.mode || \"simple\";\n\n const nodeLabel = \"View\";\n\n return (\n <div\n className={classNames(\n \"rounded-md border flex justify-start bg-white text-black min-h-[100px] relative\",\n selected\n ? \"border-blue-600 ring-2 ring-blue-500 shadow-lg\"\n : \"border-blue-400\",\n )}\n style={{ width: \"260px\" }}\n >\n <Handle\n type=\"target\"\n position={Position.Left}\n className=\"!left-[-1px] !w-2.5 !h-2.5 !bg-blue-500 !border !border-blue-600 !rounded-full !z-10\"\n />\n <Handle\n type=\"source\"\n position={Position.Right}\n className=\"!right-[-1px] !w-2.5 !h-2.5 !bg-blue-500 !border !border-blue-600 !rounded-full !z-10\"\n />\n <div\n className={`bg-gradient-to-b from-blue-500 to-blue-700 relative flex flex-col items-center w-5 justify-between rounded-l-sm text-blue-100 border-r-[1px] border-blue-500`}\n >\n <MonitorIcon className=\"w-4 h-4 opacity-90 text-white mt-1\" />\n {mode === \"full\" && (\n <span\n className=\"text-center text-[8px] text-white font-bold uppercase mb-4\"\n style={{\n transform: \"rotate(-90deg)\",\n letterSpacing: \"0.15em\",\n whiteSpace: \"nowrap\",\n }}\n >\n {nodeLabel}\n </span>\n )}\n </div>\n <div className=\"p-1 flex-1\">\n <div className=\"pb-1\">\n <span className=\"text-xs font-bold block pt-0.5 pb-0.5\">{name}</span>\n {mode === \"simple\" && (\n <span className=\"text-[10px] text-gray-500 font-light block pt-0.5 pb-0.5\">\n {nodeLabel}\n </span>\n )}\n </div>\n {summary && (\n <div className=\"pb-1\">\n <div\n className=\"text-[8px] font-light text-gray-600 block leading-tight overflow-hidden\"\n style={{\n display: \"-webkit-box\",\n WebkitLineClamp: 2,\n WebkitBoxOrient: \"vertical\",\n }}\n title={summary}\n >\n {summary}\n </div>\n </div>\n )}\n {screenshot && (\n <div className=\"py-1\">\n <img\n src={screenshot}\n alt={`${name} screenshot`}\n className=\"w-full max-w-40 h-20 object-cover rounded border border-gray-200\"\n />\n </div>\n )}\n </div>\n </div>\n );\n}\n","import { User } from \"lucide-react\";\nimport { Node, Handle, Position } from \"@xyflow/react\";\nimport { EventCatalogResource } from \"../../types\";\n\nfunction classNames(...classes: any) {\n return classes.filter(Boolean).join(\" \");\n}\n\ntype ActorNodeData = EventCatalogResource & {\n name: string;\n summary: string;\n};\n\nexport type ActorNode = Node<ActorNodeData, \"actor\">;\n\nexport default function Actor(props: ActorNode) {\n const { name, summary } = props?.data;\n\n const mode = props?.data?.mode || \"simple\";\n\n const nodeLabel = \"Actor\";\n\n return (\n <div\n className={classNames(\n \"rounded-md border flex justify-start bg-white text-black min-h-[100px] relative\",\n props?.selected\n ? \"border-yellow-600 ring-2 ring-yellow-500 shadow-lg\"\n : \"border-yellow-400\",\n )}\n style={{ width: \"260px\" }}\n >\n <Handle\n type=\"target\"\n position={Position.Left}\n className=\"!left-[-1px] !w-2.5 !h-2.5 !bg-yellow-500 !border !border-yellow-600 !rounded-full !z-10\"\n />\n <Handle\n type=\"source\"\n position={Position.Right}\n className=\"!right-[-1px] !w-2.5 !h-2.5 !bg-yellow-500 !border !border-yellow-600 !rounded-full !z-10\"\n />\n <div\n className={`bg-gradient-to-b from-yellow-500 to-yellow-700 relative flex flex-col items-center w-5 justify-between rounded-l-sm text-yellow-100 border-r-[1px] border-yellow-500`}\n >\n <User className=\"w-4 h-4 opacity-90 text-white mt-1\" />\n {mode === \"full\" && (\n <span\n className=\"text-center text-[8px] text-white font-bold uppercase mb-4\"\n style={{\n transform: \"rotate(-90deg)\",\n letterSpacing: \"0.15em\",\n whiteSpace: \"nowrap\",\n }}\n >\n {nodeLabel}\n </span>\n )}\n </div>\n <div className=\"p-1 flex-1\">\n <div\n className={classNames(\n mode === \"full\" ? `border-b border-gray-200` : \"\",\n )}\n >\n <span className=\"text-xs font-bold block pt-0.5 pb-0.5\">{name}</span>\n {mode === \"simple\" && (\n <div className=\"flex justify-between\">\n <span className=\"text-[10px] text-gray-500 font-light block pt-0.5 pb-0.5\">\n {nodeLabel}\n </span>\n </div>\n )}\n </div>\n {mode === \"full\" && (\n <div className=\"divide-y divide-gray-200\">\n <div className=\"leading-3 py-1\">\n <div\n className=\"text-[8px] font-light overflow-hidden\"\n style={{\n display: \"-webkit-box\",\n WebkitLineClamp: 2,\n WebkitBoxOrient: \"vertical\",\n }}\n title={summary}\n >\n {summary}\n </div>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n","import { Connection, MarkerType } from \"@xyflow/react\";\nimport { User } from \"lucide-react\";\nimport { NodeConfiguration } from \"../../types\";\nimport { SERVICE, MESSAGE, CHANNEL } from \"../node-types\";\n\nexport default {\n type: \"actor\",\n icon: User,\n color: \"yellow\",\n targetCanConnectTo: [\n ...SERVICE,\n ...MESSAGE,\n ...CHANNEL,\n \"external-system\",\n \"view\",\n ],\n sourceCanConnectTo: [\n ...SERVICE,\n ...MESSAGE,\n ...CHANNEL,\n \"external-system\",\n \"view\",\n ],\n validateConnection: (connection: Connection) => {\n return connection.source !== connection.target;\n },\n getEdgeOptions: (_connection: Connection) => {\n return {\n label: \"Interacts\",\n markerEnd: { type: MarkerType.ArrowClosed, color: \"#000000\" },\n };\n },\n defaultData: {\n name: \"New Actor\",\n summary:\n \"A person or user in the system. Click edit to change the details.\",\n mode: \"full\",\n },\n editor: {\n title: \"Actor\",\n subtitle: \"Edit the details of the actor\",\n schema: {\n type: \"object\",\n required: [\"name\"],\n properties: {\n name: {\n type: \"string\",\n title: \"Name\",\n default: \"New Actor\",\n description: \"The name of the actor (person/user)\",\n },\n summary: {\n type: \"string\",\n title: \"Description\",\n default: \"\",\n description: \"A brief description of the actor\",\n },\n },\n },\n },\n} as NodeConfiguration;\n","import { Globe } from \"lucide-react\";\nimport { Node, Handle, Position } from \"@xyflow/react\";\nimport {\n EventCatalogResource,\n ExternalSystem as ExternalSystemType,\n} from \"../../types\";\n\nfunction classNames(...classes: any) {\n return classes.filter(Boolean).join(\" \");\n}\n\ntype ExternalSystemNodeData = EventCatalogResource & {\n externalSystem: ExternalSystemType;\n};\n\nexport type ExternalSystemNode = Node<\n ExternalSystemNodeData,\n \"external-system\"\n>;\n\nexport default function ExternalSystem(props: ExternalSystemNode) {\n const { data, selected } = props;\n const { version, name, summary } = props.data.externalSystem;\n\n const mode = props.data.mode || \"simple\";\n\n const nodeLabel = \"External\";\n\n return (\n <div\n className={classNames(\n \"rounded-md min-h-[100px] border flex justify-start bg-white text-black relative\",\n selected\n ? \"border-pink-600 ring-2 ring-pink-500 shadow-lg\"\n : \"border-pink-400\",\n )}\n style={{ width: \"260px\" }}\n >\n <Handle\n type=\"target\"\n position={Position.Left}\n className=\"!left-[-1px] !w-2.5 !h-2.5 !bg-pink-500 !border !border-pink-600 !rounded-full !z-10\"\n />\n <Handle\n type=\"source\"\n position={Position.Right}\n className=\"!right-[-1px] !w-2.5 !h-2.5 !bg-pink-500 !border !border-pink-600 !rounded-full !z-10\"\n />\n <div\n className={`bg-gradient-to-b from-pink-500 to-pink-700 relative flex flex-col items-center w-5 justify-between rounded-l-sm text-pink-100 border-r-[1px] border-pink-500`}\n >\n <Globe className=\"w-4 h-4 opacity-90 text-white mt-1\" />\n {mode === \"full\" && (\n <span\n className=\"text-center text-[8px] text-white font-bold uppercase mb-4\"\n style={{\n transform: \"rotate(-90deg)\",\n letterSpacing: \"0.15em\",\n whiteSpace: \"nowrap\",\n }}\n >\n {nodeLabel}\n </span>\n )}\n </div>\n <div className=\"p-1 flex-1\">\n <div\n className={classNames(\n mode === \"full\" ? `border-b border-gray-200` : \"\",\n )}\n >\n <span className=\"text-xs font-bold block pt-0.5 pb-0.5\">{name}</span>\n <div className=\"flex justify-between\">\n <span className=\"text-[10px] font-light block pt-0.5 pb-0.5\">\n v{version}\n </span>\n {mode === \"simple\" && (\n <span className=\"text-[10px] text-gray-500 font-light block pt-0.5 pb-0.5\">\n {nodeLabel}\n </span>\n )}\n </div>\n </div>\n {mode === \"full\" && (\n <div className=\"divide-y divide-gray-200\">\n <div className=\"leading-3 py-1\">\n <div\n className=\"text-[8px] font-light overflow-hidden\"\n style={{\n display: \"-webkit-box\",\n WebkitLineClamp: 2,\n WebkitBoxOrient: \"vertical\",\n }}\n title={summary}\n >\n {summary}\n </div>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n","import { Connection, MarkerType } from \"@xyflow/react\";\nimport { Globe } from \"lucide-react\";\nimport { NodeConfiguration } from \"../../types\";\nimport { SERVICE, CHANNEL, ACTOR, MESSAGE } from \"../node-types\";\n\nexport default {\n type: \"external-system\",\n icon: Globe,\n color: \"pink\",\n targetCanConnectTo: [...SERVICE, ...CHANNEL, ...MESSAGE, ...ACTOR],\n sourceCanConnectTo: [...SERVICE, ...CHANNEL, ...MESSAGE, ...ACTOR],\n validateConnection: (connection: Connection) => {\n return connection.source !== connection.target;\n },\n getEdgeOptions: (connection: Connection) => {\n return {\n label: \"Connects\",\n markerEnd: { type: MarkerType.ArrowClosed, color: \"#000000\" },\n };\n },\n defaultData: {\n mode: \"full\",\n externalSystem: {\n id: \"1\",\n name: \"New External System\",\n version: \"0.0.1\",\n summary: \"New external system. Click edit to change the details.\",\n },\n },\n editor: {\n title: \"External System\",\n subtitle: \"Edit the details of the external system\",\n schema: {\n type: \"object\",\n required: [\"externalSystem\", \"mode\"],\n properties: {\n externalSystem: {\n type: \"object\",\n required: [\"name\", \"version\"],\n properties: {\n name: {\n type: \"string\",\n title: \"Name\",\n default: \"Random value\",\n description: \"The name of the external system\",\n },\n version: {\n type: \"string\",\n title: \"Version\",\n default: \"1.0.0\",\n description: \"The version number (e.g., 1.0.0)\",\n pattern: \"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+(?:-[\\\\w.-]+)?(?:\\\\+[\\\\w.-]+)?$\",\n },\n summary: {\n type: \"string\",\n title: \"Summary\",\n default: \"\",\n description: \"A brief summary of the external system\",\n },\n },\n },\n },\n },\n },\n} as NodeConfiguration;\n","import { Node, Handle, Position } from \"@xyflow/react\";\nimport React, { useState, useEffect, useRef } from \"react\";\n\nfunction classNames(...classes: any) {\n return classes.filter(Boolean).join(\" \");\n}\n\n// Define the data structure for our NoteNode\nexport type NoteNodeData = {\n id: string;\n text: string;\n color?: string;\n readOnly?: boolean;\n};\n\n// Define the NoteNode type for React Flow\nexport type NoteNode = Node<NoteNodeData, \"note\">;\n\ninterface NoteNodeProps extends NoteNode {\n onTextChange?: (id: string, text: string) => void;\n onColorChange?: (id: string, color: string) => void;\n showResizer?: boolean;\n readOnly?: boolean;\n}\n\nexport default function NoteNodeComponent({\n id,\n data,\n selected,\n onTextChange,\n onColorChange,\n readOnly = false,\n}: NoteNodeProps) {\n const [isEditing, setIsEditing] = useState(false);\n const [currentText, setCurrentText] = useState(\n data.text || \"Double-click to edit...\",\n );\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n\n // Define a list of selectable colors\n const availableColors = {\n yellow: {\n bg: \"bg-gradient-to-br from-yellow-200 to-yellow-300\",\n border: \"border-yellow-400\",\n text: \"text-yellow-900\",\n placeholder: \"placeholder-yellow-600\",\n selectedRing: \"ring-yellow-500\",\n },\n blue: {\n bg: \"bg-blue-200\",\n border: \"border-blue-400\",\n text: \"text-blue-900\",\n placeholder: \"placeholder-blue-600\",\n selectedRing: \"ring-blue-500\",\n },\n green: {\n bg: \"bg-green-200\",\n border: \"border-green-400\",\n text: \"text-green-900\",\n placeholder: \"placeholder-green-600\",\n selectedRing: \"ring-green-500\",\n },\n pink: {\n bg: \"bg-pink-200\",\n border: \"border-pink-400\",\n text: \"text-pink-900\",\n placeholder: \"placeholder-pink-600\",\n selectedRing: \"ring-pink-500\",\n },\n purple: {\n bg: \"bg-purple-200\",\n border: \"border-purple-400\",\n text: \"text-purple-900\",\n placeholder: \"placeholder-purple-600\",\n selectedRing: \"ring-purple-500\",\n },\n gray: {\n bg: \"bg-gray-200\",\n border: \"border-gray-400\",\n text: \"text-gray-900\",\n placeholder: \"placeholder-gray-600\",\n selectedRing: \"ring-gray-500\",\n },\n };\n\n type ColorName = keyof typeof availableColors;\n\n const currentColorName = (data.color as ColorName) || \"yellow\";\n const colorClasses =\n availableColors[currentColorName] || availableColors.yellow;\n\n // Simple markdown-like text formatting\n const formatText = (text: string) => {\n return (\n text\n // Headers\n .replace(\n /^### (.*$)/gim,\n '<h3 class=\"text-xs font-medium mb-1\">$1</h3>',\n )\n .replace(\n /^## (.*$)/gim,\n '<h2 class=\"text-xs font-semibold mb-1\">$1</h2>',\n )\n .replace(/^# (.*$)/gim, '<h1 class=\"text-sm font-bold mb-1\">$1</h1>')\n // Bold\n .replace(/\\*\\*(.*?)\\*\\*/gim, '<strong class=\"font-bold\">$1</strong>')\n // Italic\n .replace(/\\*(.*?)\\*/gim, '<em class=\"italic\">$1</em>')\n // Inline code\n .replace(\n /`(.*?)`/gim,\n '<code class=\"bg-gray-200 px-1 rounded text-[9px] font-mono\">$1</code>',\n )\n // Simple lists\n .replace(/^• (.*$)/gim, '<li class=\"text-[10px] ml-3\">• $1</li>')\n .replace(/^- (.*$)/gim, '<li class=\"text-[10px] ml-3\">• $1</li>')\n // Line breaks\n .replace(/\\n/g, \"<br>\")\n );\n };\n\n useEffect(() => {\n // Update internal state if data.text changes from props (e.g. undo/redo, initial load)\n setCurrentText(data.text || \"Double-click to edit...\");\n }, [data.text]);\n\n useEffect(() => {\n if (isEditing && textAreaRef.current) {\n textAreaRef.current.focus();\n // Select all text when starting to edit for quicker replacement\n textAreaRef.current.select();\n }\n }, [isEditing]);\n\n const handleDoubleClick = () => {\n if (!readOnly) {\n setIsEditing(true);\n }\n };\n\n const handleTextChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n setCurrentText(event.target.value);\n };\n\n const handleBlur = () => {\n setIsEditing(false);\n // Only update if the text has actually changed from what's in data\n // or if data.text was initially undefined/empty and now has content.\n if (currentText !== data.text && onTextChange) {\n onTextChange(id, currentText);\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault(); // Prevent newline on Enter\n handleBlur(); // Save and exit edit mode\n }\n // Allow Shift+Enter for newlines by default textarea behavior\n if (event.key === \"Escape\") {\n setIsEditing(false);\n // Revert to original text from data on Escape\n setCurrentText(data.text || \"Double-click to edit...\");\n }\n };\n\n const handleColorChange = (newColor: ColorName) => {\n if (onColorChange) {\n onColorChange(id, newColor);\n }\n };\n\n return (\n <div className=\"relative group\" style={{ width: \"100%\", height: \"100%\" }}>\n <Handle\n type=\"target\"\n position={Position.Left}\n className=\"!left-[-1px] !w-2 !h-2 !bg-gray-400 !border !border-gray-500 !rounded-full !z-10\"\n />\n <Handle\n type=\"source\"\n position={Position.Right}\n className=\"!right-[-1px] !w-2 !h-2 !bg-gray-400 !border !border-gray-500 !rounded-full !z-10\"\n />\n {selected && !isEditing && !readOnly && (\n <div className=\"absolute -top-10 left-1/2 transform -translate-x-1/2 flex space-x-1 p-1 bg-white rounded-md shadow-lg border border-gray-300 z-20\">\n {Object.keys(availableColors).map((colorKey) => (\n <button\n key={colorKey}\n onClick={() => handleColorChange(colorKey as ColorName)}\n className={classNames(\n \"w-6 h-6 rounded-full border-2\",\n availableColors[colorKey as ColorName].bg,\n availableColors[colorKey as ColorName].border,\n currentColorName === colorKey\n ? \"ring-2 ring-offset-1 \" +\n availableColors[colorKey as ColorName].selectedRing\n : \"\",\n )}\n title={colorKey.charAt(0).toUpperCase() + colorKey.slice(1)}\n />\n ))}\n </div>\n )}\n <div\n onDoubleClick={handleDoubleClick}\n className={classNames(\n \"w-full h-full rounded-lg border p-3 flex flex-col min-w-[150px] min-h-[150px] relative\",\n colorClasses.bg,\n colorClasses.border,\n colorClasses.text,\n \"prose prose-sm max-w-full\",\n selected\n ? `border-blue-600 ring-2 ${colorClasses.selectedRing} shadow-xl`\n : \"shadow-md hover:shadow-lg\",\n currentColorName === \"yellow\"\n ? \"shadow-yellow-300/50 shadow-lg transform rotate-0.5\"\n : \"\",\n )}\n style={{ position: \"relative\" }}\n >\n {isEditing ? (\n <textarea\n ref={textAreaRef}\n value={currentText}\n onChange={handleTextChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n className={classNames(\n \"w-full flex-1 bg-transparent border-none outline-none resize-none text-[10px] p-0 m-0\",\n colorClasses.text,\n colorClasses.placeholder,\n )}\n style={{ height: \"100%\", minHeight: 0 }}\n placeholder=\"Enter text...\"\n />\n ) : (\n <div\n className=\"whitespace-pre-wrap break-words w-full h-full overflow-y-auto custom-scrollbar text-[10px]\"\n dangerouslySetInnerHTML={{\n __html: formatText(currentText),\n }}\n />\n )}\n\n {/* PostIt folded corner effect */}\n {currentColorName === \"yellow\" && (\n <div className=\"absolute top-0 right-0 w-4 h-4\">\n <div className=\"absolute top-0 right-0 w-0 h-0 border-l-[16px] border-b-[16px] border-l-transparent border-b-yellow-400/30 rounded-br-lg\"></div>\n </div>\n )}\n </div>\n </div>\n );\n}\n","import { Handle } from \"@xyflow/react\";\nimport * as ContextMenu from \"@radix-ui/react-context-menu\";\nimport { buildUrl } from \"../utils/url-builder\";\nimport { getIcon } from \"../utils/badges\";\n\ninterface FlowData {\n id: string;\n version: string;\n name: string;\n summary?: string;\n owners?: string[];\n sidebar?: {\n badge?: string;\n };\n styles?: {\n backgroundColor?: string;\n borderColor?: string;\n icon?: string;\n node?: {\n color?: string;\n label?: string;\n };\n };\n}\n\ninterface Data {\n label: string;\n bgColor: string;\n color: string;\n mode: \"simple\" | \"full\";\n flow: {\n data: FlowData;\n };\n showTarget?: boolean;\n showSource?: boolean;\n}\n\nfunction classNames(...classes: any) {\n return classes.filter(Boolean).join(\" \");\n}\n\nexport default function FlowNode({\n data,\n sourcePosition,\n targetPosition,\n}: any) {\n const { mode, flow } = data as Data;\n\n const { id, version, owners = [], name, styles } = flow.data;\n const { node: { color = \"teal\", label } = {}, icon = \"QueueListIcon\" } =\n styles || {};\n\n const Icon = getIcon(icon);\n const nodeLabel = label || flow?.data?.sidebar?.badge || \"Flow\";\n const fontSize = nodeLabel.length > 10 ? \"7px\" : \"9px\";\n\n return (\n <ContextMenu.Root>\n <ContextMenu.Trigger>\n <div\n className={classNames(\n `rounded-md border flex justify-start bg-white text-black border-${color}-400`,\n )}\n style={{ width: \"260px\" }}\n >\n <div\n className={classNames(\n `bg-gradient-to-b from-${color}-500 to-${color}-700 relative flex flex-col items-center w-5 justify-between rounded-l-sm text-${color}-100`,\n `border-r-[1px] border-${color}-500`,\n )}\n >\n {Icon && <Icon className=\"w-4 h-4 opacity-90 text-white mt-1\" />}\n {mode === \"full\" && (\n <span\n className={`text-center text-[${fontSize}] text-white font-bold uppercase mb-4`}\n style={{\n transform: \"rotate(-90deg)\",\n letterSpacing: \"0.15em\",\n whiteSpace: \"nowrap\",\n }}\n >\n {nodeLabel}\n </span>\n )}\n </div>\n <div className=\"p-1 flex-1\">\n {targetPosition && (\n <Handle type=\"target\" position={targetPosition} />\n )}\n {sourcePosition && (\n <Handle type=\"source\" position={sourcePosition} />\n )}\n <div\n className={classNames(\n mode === \"full\" ? `border-b border-gray-200` : \"\",\n )}\n >\n <span className=\"text-xs font-bold block pt-0.5 pb-0.5\">\n {name}\n </span>\n <div className=\"flex justify-between\">\n <span className=\"text-[10px] font-light block pt-0.5 pb-0.5 \">\n v{version}\n </span>\n {mode === \"simple\" && (\n <span className=\"text-[10px] text-gray-500 font-light block pt-0.5 pb-0.5 \">\n {nodeLabel}\n </span>\n )}\n </div>\n </div>\n {mode === \"full\" && (\n <div className=\"divide-y divide-gray-200 \">\n <div className=\"leading-3 py-1\">\n <span className=\"text-[8px] font-light\">\n {flow.data.summary}\n </span>\n </div>\n\n <div className=\"grid grid-cols-2 gap-x-4 py-1\">\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Owners: {owners.length}\n </span>\n </div>\n </div>\n )}\n </div>\n </div>\n </ContextMenu.Trigger>\n <ContextMenu.Portal>\n <ContextMenu.Content className=\"min-w-[220px] bg-white rounded-md p-1 shadow-md border border-gray-200\">\n <ContextMenu.Item\n asChild\n className=\"text-sm px-2 py-1.5 outline-none cursor-pointer hover:bg-orange-100 rounded-sm flex items-center\"\n >\n <a href={buildUrl(`/docs/flows/${id}/${version}`)}>\n Read documentation\n </a>\n </ContextMenu.Item>\n <ContextMenu.Item\n asChild\n className=\"text-sm px-2 py-1.5 outline-none cursor-pointer hover:bg-orange-100 rounded-sm flex items-center\"\n >\n <a href={buildUrl(`/visualiser/flows/${id}/${version}`)}>\n View in visualiser\n </a>\n </ContextMenu.Item>\n <ContextMenu.Separator className=\"h-[1px] bg-gray-200 m-1\" />\n <ContextMenu.Item asChild>\n <a\n href={buildUrl(`/docs/flows/${id}/${version}/changelog`)}\n className=\"text-sm px-2 py-1.5 outline-none cursor-pointer hover:bg-orange-100 rounded-sm flex items-center\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Read changelog\n </a>\n </ContextMenu.Item>\n </ContextMenu.Content>\n </ContextMenu.Portal>\n </ContextMenu.Root>\n );\n}\n","/**\n * Simple URL builder utility\n * In the visualizer, this is a fallback - consumers should use callbacks instead\n */\n\nexport function buildUrl(path: string): string {\n // For visualizer, just return the path as-is\n // The consuming application should handle URL building via callbacks\n return path;\n}\n","import * as HeroIcons from \"@heroicons/react/24/outline\";\nimport { getIconForProtocol } from \"./protocols\";\n\nexport function getIcon(iconName: string): React.ComponentType<any> | null {\n // Try protocol icons first\n const protocolIcon = getIconForProtocol(iconName);\n if (protocolIcon) return protocolIcon;\n\n // Fall back to HeroIcons\n const heroIcon = HeroIcons[iconName as keyof typeof HeroIcons];\n return heroIcon || null;\n}\n","import { Handle, Position } from \"@xyflow/react\";\nimport { getIcon } from \"../utils/badges\";\nimport * as ContextMenu from \"@radix-ui/react-context-menu\";\nimport { buildUrl } from \"../utils/url-builder\";\nimport { useState } from \"react\";\n\ninterface EntityData {\n id: string;\n name: string;\n version: string;\n properties?: any[];\n aggregateRoot?: boolean;\n sidebar?: any;\n styles?: {\n backgroundColor?: string;\n borderColor?: string;\n icon?: string;\n node?: {\n color?: string;\n label?: string;\n };\n };\n}\n\ninterface Data {\n title: string;\n label: string;\n bgColor: string;\n color: string;\n mode: \"simple\" | \"full\";\n entity: {\n data: EntityData;\n };\n showTarget?: boolean;\n showSource?: boolean;\n externalToDomain?: boolean;\n domainName?: string;\n domainId?: string;\n group?: {\n type: string;\n value: string;\n };\n}\n\nfunction classNames(...classes: any) {\n return classes.filter(Boolean).join(\" \");\n}\n\nexport default function EntityNode({\n data,\n sourcePosition,\n targetPosition,\n}: any) {\n const { mode, entity, externalToDomain, domainName } = data as Data;\n const {\n name,\n version,\n properties = [],\n aggregateRoot,\n styles,\n sidebar: _sidebar,\n } = entity.data;\n\n const {\n node: { color: _color = \"blue\", label: _label } = {},\n icon = \"CubeIcon\",\n } = styles || {};\n\n const Icon = getIcon(icon);\n\n const [hoveredProperty, setHoveredProperty] = useState<string | null>(null);\n\n return (\n <ContextMenu.Root>\n <ContextMenu.Trigger>\n <div\n className={classNames(\n \"bg-white border border-blue-300 rounded-lg shadow-sm min-w-[200px]\",\n externalToDomain ? \"border-yellow-400\" : \"\",\n )}\n >\n {/* Table Header */}\n <div\n className={classNames(\n \"bg-blue-100 px-4 py-2 rounded-t-lg border-b border-gray-300\",\n externalToDomain ? \"bg-yellow-400\" : \"\",\n )}\n >\n <div className=\"flex items-center gap-2\">\n {Icon && <Icon className=\"w-4 h-4 text-gray-600\" />}\n <span className=\"font-semibold text-gray-800 text-sm\">\n {name}\n </span>\n {aggregateRoot && (\n <span className=\"text-xs bg-yellow-100 text-yellow-800 px-1.5 py-0.5 rounded\">\n AR\n </span>\n )}\n </div>\n {/* {externalToDomain && domainName && ( */}\n <div className=\"text-xs text-yellow-800 font-medium mt-1\">\n from {domainName} domain\n </div>\n {/* )} */}\n {mode === \"full\" && (\n <div className=\"text-xs text-gray-600 mt-1\">v{version}</div>\n )}\n </div>\n\n {/* Properties Table */}\n {properties.length > 0 ? (\n <div className=\"divide-y divide-gray-200 relative\">\n {properties.map((property: any, index: number) => {\n const propertyKey = `${property.name}-${index}`;\n const isHovered = hoveredProperty === propertyKey;\n return (\n <div\n key={propertyKey}\n className=\"relative flex items-center justify-between px-4 py-2 hover:bg-gray-50\"\n onMouseEnter={() =>\n property.description && setHoveredProperty(propertyKey)\n }\n onMouseLeave={() => setHoveredProperty(null)}\n >\n {/* Target handle */}\n <Handle\n type=\"target\"\n position={Position.Left}\n id={`${property.name}-target`}\n className=\"!w-3 !h-3 !bg-white !border-2 !border-gray-400 !rounded-full !left-[-0px]\"\n style={{ left: \"-6px\" }}\n />\n\n {/* Source handle */}\n <Handle\n type=\"source\"\n position={Position.Right}\n id={`${property.name}-source`}\n className=\"!w-3 !h-3 !bg-white !border-2 !border-gray-400 !rounded-full !right-[-0px]\"\n style={{ right: \"-6px\" }}\n />\n\n {/* Property content */}\n <div className=\"flex-1 flex items-center justify-between\">\n <div className=\"flex items-center gap-1\">\n <span className=\"text-sm font-medium text-gray-900\">\n {property.name}\n </span>\n {property.required && (\n <span className=\"text-red-500 text-xs\">*</span>\n )}\n </div>\n <span className=\"text-sm text-gray-600 font-mono\">\n {property.type}\n </span>\n </div>\n\n {/* Reference indicator */}\n {property.references && (\n <div className=\"absolute right-2 top-1/2 transform -translate-y-1/2\">\n <div\n className=\"w-2 h-2 bg-blue-500 rounded-full\"\n title={`References ${property.references}`}\n ></div>\n </div>\n )}\n\n {/* Property Tooltip */}\n {isHovered && property.description && (\n <div className=\"absolute left-full ml-2 top-1/2 transform -translate-y-1/2 z-[9999] w-[200px] bg-gray-900 text-white text-xs rounded-lg py-2 px-3 pointer-events-none shadow-xl max-w-xl opacity-100\">\n <div className=\"text-gray-200 whitespace-normal break-words\">\n {property.description}\n </div>\n <div className=\"absolute right-full top-1/2 transform -translate-y-1/2 border-4 border-transparent border-r-gray-900\"></div>\n </div>\n )}\n </div>\n );\n })}\n </div>\n ) : (\n <div className=\"px-4 py-3 text-sm text-gray-500 text-center\">\n No properties defined\n </div>\n )}\n\n {/* Main node handles (if no properties) */}\n {properties.length === 0 && (\n <>\n {targetPosition && (\n <Handle type=\"target\" position={targetPosition} />\n )}\n {sourcePosition && (\n <Handle type=\"source\" position={sourcePosition} />\n )}\n </>\n )}\n </div>\n </ContextMenu.Trigger>\n <ContextMenu.Portal>\n <ContextMenu.Content\n className=\"min-w-[220px] bg-white rounded-md p-1 shadow-md border border-gray-200\"\n onClick={(e) => e.stopPropagation()}\n >\n <ContextMenu.Item\n asChild\n className=\"text-sm px-2 py-1.5 outline-none cursor-pointer hover:bg-orange-100 rounded-sm flex items-center\"\n >\n <a href={buildUrl(`/docs/entities/${entity.data.id}/${version}`)}>\n Read documentation\n </a>\n </ContextMenu.Item>\n </ContextMenu.Content>\n </ContextMenu.Portal>\n </ContextMenu.Root>\n );\n}\n","import { UserIcon } from \"@heroicons/react/20/solid\";\nimport { Handle } from \"@xyflow/react\";\n\ninterface Data {\n title: string;\n label: string;\n bgColor: string;\n color: string;\n mode: \"simple\" | \"full\";\n step: {\n id: string;\n title: string;\n summary: string;\n name: string;\n actor: { name: string };\n };\n showTarget?: boolean;\n showSource?: boolean;\n}\n\nfunction classNames(...classes: any) {\n return classes.filter(Boolean).join(\" \");\n}\n\nexport default function UserNode({\n data,\n sourcePosition,\n targetPosition,\n}: any) {\n const {\n mode,\n step,\n showTarget: _showTarget = true,\n showSource: _showSource = true,\n } = data as Data;\n\n const { summary, actor: { name } = {} } = step;\n\n return (\n <div\n className={classNames(\n `rounded-md border flex justify-start bg-white text-black border-yellow-400`,\n mode === \"full\" ? \"min-h-[5em]\" : \"min-h-[2em]\",\n )}\n style={{ width: \"260px\" }}\n >\n <div\n className={classNames(\n \"bg-gradient-to-b from-yellow-400 to-yellow-600 relative flex flex-col items-center w-5 justify-between rounded-l-sm text-orange-100-500\",\n `border-r-[1px] border-yellow-500`,\n )}\n >\n <UserIcon className=\"w-4 h-4 opacity-90 text-white mt-1\" />\n {mode === \"full\" && (\n <span\n className=\"text-center text-[9px] text-white font-bold uppercase mb-4\"\n style={{\n transform: \"rotate(-90deg)\",\n letterSpacing: \"0.15em\",\n whiteSpace: \"nowrap\",\n }}\n >\n ACTOR\n </span>\n )}\n </div>\n <div className=\"p-1 flex-1\">\n {targetPosition && <Handle type=\"target\" position={targetPosition} />}\n {sourcePosition && <Handle type=\"source\" position={sourcePosition} />}\n\n {(!summary || mode !== \"full\") && (\n <div className=\"h-full \">\n <span className=\"text-sm font-bold block pb-0.5 w-full\">\n {name}\n </span>\n {mode === \"simple\" && (\n <div className=\"w-full text-right\">\n <span className=\" w-full text-[10px] text-gray-500 font-light block pt-0.5 pb-0.5 \">\n Event\n </span>\n </div>\n )}\n </div>\n )}\n\n {summary && mode === \"full\" && (\n <div>\n <div\n className={classNames(\n mode === \"full\" ? `border-b border-gray-200` : \"\",\n )}\n >\n <span className=\"text-xs font-bold block pb-0.5\">{name}</span>\n </div>\n {mode === \"full\" && (\n <div className=\"divide-y divide-gray-200 \">\n <div className=\"leading-3 py-1\">\n <span className=\"text-[8px] font-light\">{summary}</span>\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n </div>\n );\n}\n","import { Handle } from \"@xyflow/react\";\n\ninterface Data {\n title: string;\n label: string;\n bgColor: string;\n color: string;\n mode: \"simple\" | \"full\";\n step: { id: string; title: string; summary: string };\n showTarget?: boolean;\n showSource?: boolean;\n}\n\nfunction classNames(...classes: any) {\n return classes.filter(Boolean).join(\" \");\n}\n\nexport default function StepNode({\n data,\n sourcePosition,\n targetPosition,\n}: any) {\n const { mode, step } = data as Data;\n\n const { title, summary } = step;\n\n return (\n <div\n className={classNames(\n \"rounded-md border flex justify-start bg-white text-black border-blue-400 min-h-[3em]\",\n )}\n style={{ width: \"260px\" }}\n >\n <div\n className={classNames(\n \"bg-gradient-to-b from-gray-700 to-gray-700 relative flex flex-col items-center w-5 justify-end rounded-l-sm text-orange-100-500\",\n `border-r-[1px] border-gray-500`,\n )}\n >\n {mode === \"full\" && (\n <span\n className=\"text-center text-[9px] text-white font-bold uppercase mb-4\"\n style={{\n transform: \"rotate(-90deg)\",\n letterSpacing: \"0.15em\",\n whiteSpace: \"nowrap\",\n }}\n >\n Step\n </span>\n )}\n </div>\n <div className=\"p-1 flex-1\">\n {targetPosition && <Handle type=\"target\" position={targetPosition} />}\n {sourcePosition && <Handle type=\"source\" position={sourcePosition} />}\n\n {!summary && (\n <div className=\"h-full flex items-center\">\n <span className=\"text-sm font-bold block pb-0.5\">{title}</span>\n </div>\n )}\n\n {summary && (\n <div>\n <div\n className={classNames(\n mode === \"full\" ? `border-b border-gray-200` : \"\",\n )}\n >\n <span className=\"text-xs font-bold block pb-0.5\">{title}</span>\n </div>\n {mode === \"full\" && (\n <div className=\"divide-y divide-gray-200 \">\n <div className=\"leading-3 py-1\">\n <span className=\"text-[8px] font-light\">{summary}</span>\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n </div>\n );\n}\n","import {\n Handle,\n useReactFlow,\n useOnSelectionChange,\n Position,\n} from \"@xyflow/react\";\nimport * as ContextMenu from \"@radix-ui/react-context-menu\";\nimport { buildUrl } from \"../utils/url-builder\";\nimport { getIcon } from \"../utils/badges\";\nimport { useState } from \"react\";\n\ninterface DomainData {\n id: string;\n version: string;\n name: string;\n services?: string[];\n styles?: {\n backgroundColor?: string;\n borderColor?: string;\n icon?: string;\n };\n}\n\ninterface Data {\n mode: \"simple\" | \"full\";\n domain: {\n data: DomainData;\n };\n}\n\nexport default function DomainNode({ data, id: nodeId }: any) {\n const { mode, domain } = data as Data;\n const reactFlow = useReactFlow();\n const [highlightedServices, setHighlightedServices] = useState<Set<string>>(\n new Set(),\n );\n\n const { id, version, name, services = [], styles } = domain.data;\n const { icon = \"RectangleGroupIcon\" } = styles || {};\n\n const Icon = getIcon(icon);\n const ServerIcon = getIcon(\"ServerIcon\");\n\n // Listen for selection changes to highlight connected services\n useOnSelectionChange({\n onChange: ({ nodes: selectedNodes }) => {\n if (selectedNodes.length === 0) {\n setHighlightedServices(new Set());\n return;\n }\n\n const selectedNode = selectedNodes[0];\n if (!selectedNode) {\n setHighlightedServices(new Set());\n return;\n }\n\n // Get all edges\n const edges = reactFlow.getEdges();\n const connectedServiceIds = new Set<string>();\n\n // Find services connected to the selected node\n edges.forEach((edge) => {\n if (\n edge.source === selectedNode.id ||\n edge.target === selectedNode.id\n ) {\n // Check if this edge connects to our domain\n if (edge.source === nodeId && edge.sourceHandle) {\n // Extract service ID from sourceHandle (format: \"serviceId-source\")\n const serviceId = edge.sourceHandle.replace(\"-source\", \"\");\n connectedServiceIds.add(serviceId);\n }\n if (edge.target === nodeId && edge.targetHandle) {\n // Extract service ID from targetHandle (format: \"serviceId-target\")\n const serviceId = edge.targetHandle.replace(\"-target\", \"\");\n connectedServiceIds.add(serviceId);\n }\n }\n });\n\n setHighlightedServices(connectedServiceIds);\n },\n });\n\n return (\n <ContextMenu.Root>\n <ContextMenu.Trigger>\n <div className=\"w-full rounded-lg border-2 border-yellow-400 bg-white shadow-lg\">\n <div className=\"bg-yellow-100 px-3 py-2 flex items-center space-x-2\">\n {Icon && <Icon className=\"w-4 h-4 text-yellow-700\" />}\n <div>\n <span className=\"text-sm font-bold text-yellow-900\">{name}</span>\n <span className=\"text-xs text-yellow-700 ml-2\">v{version}</span>\n </div>\n </div>\n {mode === \"full\" && services.length > 0 && (\n <div>\n {services.map((service: any, index: number) => {\n const isHighlighted = highlightedServices.has(service.data.id);\n\n return (\n <ContextMenu.Root key={`${service.data.id}-${index}`}>\n <ContextMenu.Trigger asChild>\n <div\n className={`relative flex items-center justify-between px-3 py-2 cursor-pointer ${index !== services.length - 1 ? \"border-b border-gray-300\" : \"\"} ${isHighlighted ? \"bg-pink-100 border-pink-300\" : \"\"}`}\n >\n <Handle\n type=\"target\"\n position={Position.Left}\n id={`${service.data.id}-target`}\n className=\"!left-[-1px] !w-2 !h-2 !bg-gray-400 !border !border-gray-500 !rounded-full !z-10\"\n style={{ left: \"-1px\" }}\n />\n <Handle\n type=\"source\"\n position={Position.Right}\n id={`${service.data.id}-source`}\n className=\"!right-[-1px] !w-2 !h-2 !bg-gray-400 !border !border-gray-500 !rounded-full !z-10\"\n style={{ right: \"-1px\" }}\n />\n <div className=\"flex items-center space-x-3\">\n <div className=\"flex items-center justify-center w-5 h-5 bg-pink-500 rounded\">\n {ServerIcon && (\n <ServerIcon className=\"w-3 h-3 text-white\" />\n )}\n </div>\n <span className=\"text-sm font-medium text-gray-900\">\n {service.data.name || service.data.id}\n </span>\n </div>\n <div className=\"flex items-center space-x-4 text-sm text-gray-600\">\n <span className=\"text-xs\">\n v{service.data.version}\n </span>\n </div>\n </div>\n </ContextMenu.Trigger>\n <ContextMenu.Portal>\n <ContextMenu.Content className=\"min-w-[220px] bg-white rounded-md p-1 shadow-md border border-gray-200\">\n <ContextMenu.Item\n className=\"text-sm px-2 py-1.5 outline-none cursor-pointer hover:bg-orange-100 rounded-sm flex items-center\"\n onClick={() =>\n (window.location.href = buildUrl(\n `/docs/services/${service.data.id}/${service.data.version}`,\n ))\n }\n >\n View Service Documentation\n </ContextMenu.Item>\n <ContextMenu.Item\n className=\"text-sm px-2 py-1.5 outline-none cursor-pointer hover:bg-orange-100 rounded-sm flex items-center\"\n onClick={() =>\n (window.location.href = buildUrl(\n `/visualiser/services/${service.data.id}/${service.data.version}`,\n ))\n }\n >\n View Service Visualizer\n </ContextMenu.Item>\n </ContextMenu.Content>\n </ContextMenu.Portal>\n </ContextMenu.Root>\n );\n })}\n </div>\n )}\n </div>\n </ContextMenu.Trigger>\n <ContextMenu.Portal>\n <ContextMenu.Content className=\"min-w-[220px] bg-white rounded-md p-1 shadow-md border border-gray-200\">\n <ContextMenu.Item\n className=\"text-sm px-2 py-1.5 outline-none cursor-pointer hover:bg-orange-100 rounded-sm flex items-center\"\n onClick={() =>\n (window.location.href = buildUrl(\n `/docs/domains/${id}/${version}`,\n ))\n }\n >\n View Domain Documentation\n </ContextMenu.Item>\n <ContextMenu.Item\n className=\"text-sm px-2 py-1.5 outline-none cursor-pointer hover:bg-orange-100 rounded-sm flex items-center\"\n onClick={() =>\n (window.location.href = buildUrl(\n `/visualiser/domains/${id}/${version}`,\n ))\n }\n >\n View Domain Visualizer\n </ContextMenu.Item>\n </ContextMenu.Content>\n </ContextMenu.Portal>\n </ContextMenu.Root>\n );\n}\n","import { Handle } from \"@xyflow/react\";\nimport * as Icons from \"@heroicons/react/24/solid\";\nimport type { ComponentType } from \"react\";\nimport * as ContextMenu from \"@radix-ui/react-context-menu\";\nimport * as Tooltip from \"@radix-ui/react-tooltip\";\n\ntype MenuItem = {\n label: string;\n url?: string;\n};\n\ninterface Data {\n title: string;\n label: string;\n bgColor: string;\n color: string;\n mode: \"simple\" | \"full\";\n step: {\n id: string;\n title: string;\n summary: string;\n name: string;\n actor: { name: string };\n };\n showTarget?: boolean;\n showSource?: boolean;\n custom: {\n icon?: string;\n type?: string;\n title?: string;\n summary?: string;\n url?: string;\n color?: string;\n properties?: Record<string, string>;\n menu?: MenuItem[];\n height?: number;\n };\n}\n\nfunction classNames(...classes: any) {\n return classes.filter(Boolean).join(\" \");\n}\n\nexport default function UserNode({\n data,\n sourcePosition,\n targetPosition,\n}: any) {\n const { mode, step, custom: customProps } = data as Data;\n\n const {\n color = \"blue\",\n title = \"Custom\",\n icon = \"UserIcon\",\n type = \"custom\",\n summary = \"\",\n url: _url = \"\",\n properties = {},\n menu = [],\n height = 5,\n } = customProps;\n\n const IconComponent: ComponentType<{ className?: string }> | undefined =\n Icons[icon as keyof typeof Icons];\n\n const { actor: { name: _name } = {} } = step;\n\n const isLongType = type && type.length > 10;\n const displayType = isLongType ? `${type.substring(0, 10)}...` : type;\n\n return (\n <ContextMenu.Root>\n <ContextMenu.Trigger>\n <div\n className={classNames(\n `rounded-md border flex justify-start bg-white text-black border-${color}-400`,\n )}\n style={{\n minHeight: mode === \"full\" ? `${height}em` : \"2em\",\n width: \"260px\",\n }}\n >\n <div\n className={classNames(\n `bg-gradient-to-b from-${color}-400 to-${color}-600 relative flex flex-col items-center w-5 justify-between rounded-l-sm text-orange-100-500`,\n `border-r-[1px] border-${color}`,\n )}\n >\n <IconComponent className=\"w-4 h-4 opacity-90 text-white mt-1\" />\n {mode === \"full\" && (\n <Tooltip.Provider>\n <Tooltip.Root>\n <Tooltip.Trigger asChild>\n <span\n className=\"text-center text-[9px] text-white font-bold uppercase mb-4\"\n style={{\n transform: \"rotate(-90deg)\",\n letterSpacing: \"0.15em\",\n whiteSpace: \"nowrap\",\n }}\n >\n {displayType}\n </span>\n </Tooltip.Trigger>\n {isLongType && (\n <Tooltip.Portal>\n <Tooltip.Content\n className=\"bg-slate-800 text-white rounded px-2 py-1 text-xs shadow-md z-50\"\n side=\"right\"\n sideOffset={5}\n >\n {type}\n <Tooltip.Arrow className=\"fill-slate-800\" />\n </Tooltip.Content>\n </Tooltip.Portal>\n )}\n </Tooltip.Root>\n </Tooltip.Provider>\n )}\n </div>\n <div className=\"p-1 flex-1\">\n {targetPosition && (\n <Handle type=\"target\" position={targetPosition} />\n )}\n {sourcePosition && (\n <Handle type=\"source\" position={sourcePosition} />\n )}\n\n {(!summary || mode !== \"full\") && (\n <div className=\"h-full \">\n <span className=\"text-sm font-bold block pb-0.5 w-full\">\n {title}\n </span>\n </div>\n )}\n\n {summary && mode === \"full\" && (\n <div>\n <div\n className={classNames(\n mode === \"full\" ? `border-b border-gray-200` : \"\",\n )}\n >\n <span className=\"text-xs font-bold block pb-0.5\">\n {title}\n </span>\n </div>\n {mode === \"full\" && (\n <div className=\"divide-y divide-gray-200 \">\n <div className=\"leading-3 py-1\">\n <span className=\"text-[8px] font-light\">{summary}</span>\n </div>\n {properties && (\n <div className=\"grid grid-cols-2 gap-x-4 py-1\">\n {Object.entries(properties).map(([key, value]) => (\n <span\n key={key}\n className=\"text-xs\"\n style={{ fontSize: \"0.2em\" }}\n >\n {key}:{\" \"}\n {typeof value === \"string\" &&\n value.startsWith(\"http\") ? (\n <a\n href={value}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-blue-500 underline\"\n >\n {value}\n </a>\n ) : (\n value\n )}\n </span>\n ))}\n </div>\n )}\n </div>\n )}\n </div>\n )}\n </div>\n </div>\n </ContextMenu.Trigger>\n {menu?.length > 0 && (\n <ContextMenu.Portal>\n <ContextMenu.Content className=\"min-w-[220px] bg-white rounded-md p-1 shadow-md border border-gray-200\">\n {menu?.map((item) => {\n return (\n <ContextMenu.Item\n asChild\n className=\"text-sm px-2 py-1.5 outline-none cursor-pointer hover:bg-orange-100 rounded-sm flex items-center\"\n >\n <a href={item.url}>{item.label}</a>\n </ContextMenu.Item>\n );\n })}\n </ContextMenu.Content>\n </ContextMenu.Portal>\n )}\n </ContextMenu.Root>\n );\n}\n","import { Handle, Position } from \"@xyflow/react\";\nimport ExternalSystemComponent from \"./external-system/ExternalSystem\";\n\nexport default function ExternalSystemNode(props: any) {\n return (\n <div className=\"relative\">\n <Handle\n type=\"target\"\n position={Position.Left}\n style={{ width: 10, height: 10, background: \"pink\", zIndex: 10 }}\n className=\"bg-gray-500\"\n />\n <Handle\n type=\"source\"\n position={Position.Right}\n style={{ width: 10, height: 10, background: \"pink\", zIndex: 10 }}\n className=\"bg-gray-500\"\n />\n <ExternalSystemComponent {...props} />\n </div>\n );\n}\n","import { Handle } from \"@xyflow/react\";\nimport * as ContextMenu from \"@radix-ui/react-context-menu\";\nimport { buildUrl } from \"../utils/url-builder\";\nimport { Position } from \"@xyflow/react\";\nimport { Package } from \"lucide-react\";\n\nfunction classNames(...classes: any) {\n return classes.filter(Boolean).join(\" \");\n}\n\ninterface DataProductNodeProps {\n data: {\n mode: \"simple\" | \"full\";\n dataProduct: {\n id: string;\n version: string;\n name: string;\n summary?: string;\n inputs?: any[];\n outputs?: any[];\n owners?: any[];\n };\n };\n selected?: boolean;\n}\n\nexport default function DataProductNode(props: DataProductNodeProps) {\n const {\n id,\n version,\n name,\n summary,\n inputs = [],\n outputs = [],\n owners = [],\n } = props.data.dataProduct;\n const mode = props.data.mode || \"simple\";\n const nodeLabel = \"Data Product\";\n const rotatedLabel = \"Product\";\n\n return (\n <ContextMenu.Root>\n <ContextMenu.Trigger>\n <div className=\"relative\">\n <Handle\n type=\"target\"\n position={Position.Left}\n style={{ width: 10, height: 10, background: \"#6366f1\", zIndex: 10 }}\n className=\"bg-indigo-500\"\n />\n <Handle\n type=\"source\"\n position={Position.Right}\n style={{ width: 10, height: 10, background: \"#6366f1\", zIndex: 10 }}\n className=\"bg-indigo-500\"\n />\n <div\n className={classNames(\n \"rounded-md border flex justify-start bg-white text-black\",\n props.selected\n ? \"border-indigo-600 ring-2 ring-indigo-500 shadow-lg\"\n : \"border-indigo-400\",\n )}\n style={{ width: \"260px\" }}\n >\n <div\n className={`bg-gradient-to-b from-indigo-500 to-indigo-700 relative flex flex-col items-center w-5 justify-between rounded-l-sm text-indigo-100 border-r-[1px] border-indigo-500`}\n >\n <Package className=\"w-4 h-4 opacity-90 text-white mt-1\" />\n {mode === \"full\" && (\n <span\n className=\"text-center text-[8px] text-white font-bold uppercase mb-4\"\n style={{\n transform: \"rotate(-90deg)\",\n letterSpacing: \"0.15em\",\n whiteSpace: \"nowrap\",\n }}\n >\n {rotatedLabel}\n </span>\n )}\n </div>\n <div className=\"p-1 flex-1\">\n <div\n className={classNames(\n mode === \"full\" ? `border-b border-gray-200` : \"\",\n )}\n >\n <span className=\"text-xs font-bold block pt-0.5 pb-0.5\">\n {name}\n </span>\n <div className=\"flex justify-between\">\n <span className=\"text-[10px] font-light block pt-0.5 pb-0.5\">\n v{version}\n </span>\n {mode === \"simple\" && (\n <span className=\"text-[10px] text-gray-500 font-light block pt-0.5 pb-0.5\">\n {nodeLabel}\n </span>\n )}\n </div>\n </div>\n {mode === \"full\" && (\n <div className=\"divide-y divide-gray-200\">\n <div className=\"leading-3 py-1\">\n <div\n className=\"text-[8px] font-light overflow-hidden\"\n style={{\n display: \"-webkit-box\",\n WebkitLineClamp: 2,\n WebkitBoxOrient: \"vertical\",\n }}\n title={summary}\n >\n {summary}\n </div>\n </div>\n\n <div className=\"grid grid-cols-2 gap-x-4 py-1\">\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Inputs: {inputs.length}\n </span>\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Outputs: {outputs.length}\n </span>\n <span className=\"text-xs\" style={{ fontSize: \"0.2em\" }}>\n Owners: {owners.length}\n </span>\n </div>\n </div>\n )}\n </div>\n </div>\n </div>\n </ContextMenu.Trigger>\n <ContextMenu.Portal>\n <ContextMenu.Content className=\"min-w-[220px] bg-white rounded-md p-1 shadow-md border border-gray-200\">\n <ContextMenu.Item\n asChild\n className=\"text-sm px-2 py-1.5 outline-none cursor-pointer hover:bg-indigo-100 rounded-sm flex items-center\"\n >\n <a href={buildUrl(`/docs/data-products/${id}/${version}`)}>\n Read documentation\n </a>\n </ContextMenu.Item>\n <ContextMenu.Separator className=\"h-[1px] bg-gray-200 m-1\" />\n <ContextMenu.Item asChild>\n <a\n href={buildUrl(`/visualiser/data-products/${id}/${version}`)}\n className=\"text-sm px-2 py-1.5 outline-none cursor-pointer hover:bg-indigo-100 rounded-sm flex items-center\"\n >\n View in Visualiser\n </a>\n </ContextMenu.Item>\n </ContextMenu.Content>\n </ContextMenu.Portal>\n </ContextMenu.Root>\n );\n}\n","import { useMemo } from \"react\";\nimport { BaseEdge, getBezierPath } from \"@xyflow/react\";\n\nconst AnimatedMessageEdge = ({\n id,\n sourceX,\n sourceY,\n targetX,\n targetY,\n sourcePosition,\n targetPosition,\n data,\n label = \"\",\n markerEnd,\n markerStart,\n}: any) => {\n const [edgePath, labelX, labelY] = getBezierPath({\n sourceX,\n sourceY,\n sourcePosition,\n targetX,\n targetY,\n targetPosition,\n });\n\n const messageColor = useMemo(\n () => (collection: string) => {\n switch (collection) {\n case \"events\":\n return \"orange\";\n case \"commands\":\n return \"blue\";\n case \"queries\":\n return \"green\";\n default:\n return \"gray\";\n }\n },\n [],\n );\n\n const collection = data?.message?.collection;\n const opacity = data?.opacity ?? 1;\n const customColor =\n data?.customColor || messageColor(collection ?? \"default\");\n const warning = data?.warning;\n\n // For each customColor (string or array of strings), we need to create the animated nodes\n const customColors = Array.isArray(customColor) ? customColor : [customColor];\n\n const randomDelay = useMemo(() => Math.random() * 1, []);\n\n const animatedNodes = customColors.map((color, index) => {\n // Stagger the animations so multiple colored nodes are visible\n const delay = randomDelay + index * 0.3;\n return (\n <g\n className={`z-30 ${opacity === 1 ? \"opacity-100\" : \"opacity-10\"}`}\n key={`${id}-${color}-${index}`}\n >\n <circle\n key={`${id}-${color}-${index}`}\n cx=\"0\"\n cy=\"0\"\n r=\"7\"\n fill={color}\n >\n <animateMotion\n dur=\"2s\"\n repeatCount=\"indefinite\"\n path={edgePath}\n rotate=\"auto\"\n begin={`${delay}s`}\n >\n <mpath href={`#${id}`} />\n </animateMotion>\n </circle>\n </g>\n );\n });\n\n // Label can be spit using \\n to create multiple lines\n const lines = String(label ?? \"\").split(\"\\n\");\n\n return (\n // @ts-ignore\n <>\n <BaseEdge\n id={id}\n path={edgePath}\n markerEnd={markerEnd}\n markerStart={markerStart}\n style={\n warning ? { stroke: \"red\", strokeWidth: 1 } : { stroke: \"#d1d5db\" }\n }\n />\n {/* Circle Icon */}\n {animatedNodes}\n {/* <g className={`z-30 ${opacity === 1 ? 'opacity-100' : 'opacity-10'}`}>\n </g> */}\n <g>\n {/* Background rect for label */}\n {label && (\n <rect\n x={labelX - 30}\n y={labelY - lines.length * 6}\n width={60}\n height={lines.length * 14}\n fill=\"white\"\n fillOpacity={0.3}\n rx={4}\n ry={4}\n />\n )}\n {/* Text element */}\n <text\n x={labelX}\n y={labelY}\n textAnchor=\"middle\"\n dominantBaseline=\"middle\"\n fontSize=\"10px\"\n pointerEvents=\"none\"\n >\n {lines.map((line, i) => (\n <tspan\n key={i}\n x={labelX}\n dy={i === 0 ? 0 : \"1.2em\"}\n style={{ fontStyle: i === 0 ? \"normal\" : \"italic\" }}\n >\n {line}\n </tspan>\n ))}\n </text>\n </g>\n </>\n );\n};\n\nexport default AnimatedMessageEdge;\n","import { type EdgeProps, getBezierPath } from \"@xyflow/react\";\n\nexport default function MultilineEdgeLabel(props: EdgeProps) {\n const {\n id,\n sourceX,\n sourceY,\n targetX,\n targetY,\n sourcePosition,\n targetPosition,\n label,\n markerStart, // <-- forward these\n markerEnd,\n style,\n selected,\n } = props;\n\n const [edgePath, labelX, labelY] = getBezierPath({\n sourceX,\n sourceY,\n targetX,\n targetY,\n sourcePosition,\n targetPosition,\n });\n\n const lines = String(label ?? \"\").split(\"\\n\");\n\n return (\n <>\n <path\n id={id}\n d={edgePath}\n className={`react-flow__edge-path${selected ? \" selected\" : \"\"}`}\n markerStart={markerStart}\n markerEnd={markerEnd}\n style={style as any}\n />\n\n {/* Optional: bigger hitbox for hover/selection */}\n\n <text\n x={labelX}\n y={labelY}\n textAnchor=\"middle\"\n dominantBaseline=\"middle\"\n fontSize=\"10px\"\n pointerEvents=\"none\"\n >\n {lines.map((line, i) => (\n <tspan\n key={i}\n x={labelX}\n dy={i === 0 ? 0 : \"1.2em\"}\n style={{ fontStyle: i === 0 ? \"normal\" : \"italic\" }}\n >\n {line}\n </tspan>\n ))}\n </text>\n </>\n );\n}\n","import { useMemo } from \"react\";\nimport {\n BaseEdge,\n EdgeLabelRenderer,\n getBezierPath,\n type EdgeProps as XYFlowEdgeProps,\n} from \"@xyflow/react\";\n\ninterface EdgeData {\n message?: {\n collection?: string;\n };\n opacity?: number;\n animated?: boolean;\n}\n\ninterface CustomEdgeProps extends Omit<XYFlowEdgeProps, \"data\"> {\n data?: EdgeData;\n}\n\nexport default function CustomEdge({\n id,\n sourceX,\n sourceY,\n targetX,\n targetY,\n sourcePosition,\n targetPosition,\n style = {},\n markerEnd,\n label,\n labelStyle,\n data,\n}: CustomEdgeProps) {\n const [edgePath, labelX, labelY] = getBezierPath({\n sourceX,\n sourceY,\n sourcePosition,\n targetX,\n targetY,\n targetPosition,\n });\n\n const randomDelay = useMemo(() => Math.random() * 1, []);\n const collection = data?.message?.collection;\n const opacity = data?.opacity ?? 1;\n\n const messageColor = useMemo(\n () => (collection: string) => {\n switch (collection) {\n case \"events\":\n return \"orange\";\n case \"commands\":\n return \"blue\";\n case \"queries\":\n return \"green\";\n default:\n return \"gray\";\n }\n },\n [],\n );\n\n return (\n <>\n <BaseEdge\n path={edgePath}\n markerEnd={markerEnd}\n style={{\n strokeWidth: 2,\n stroke: \"#fff\",\n ...style,\n }}\n />\n {data?.animated && (\n <g className={`z-30 ${opacity === 1 ? \"opacity-100\" : \"opacity-10\"}`}>\n <circle\n cx=\"0\"\n cy=\"0\"\n r=\"7\"\n fill={messageColor(collection || \"default\")}\n >\n <animateMotion\n dur=\"2s\"\n repeatCount=\"indefinite\"\n path={edgePath}\n rotate=\"auto\"\n begin={`${randomDelay}s`}\n >\n <mpath href={`#${id}`} />\n </animateMotion>\n </circle>\n </g>\n )}\n {label && (\n <EdgeLabelRenderer>\n <div\n style={{\n position: \"absolute\",\n transform: `translate(-50%, -50%) translate(${labelX}px,${labelY}px)`,\n zIndex: 1000,\n ...(labelStyle as any),\n }}\n className=\"nodrag nopan max-w-[120px] text-xs bg-white px-2 py-1 rounded border border-gray-200 text-gray-600 font-medium shadow-sm text-center\"\n >\n {label}\n </div>\n </EdgeLabelRenderer>\n )}\n </>\n );\n}\n","import {\n useState,\n useCallback,\n useRef,\n useEffect,\n forwardRef,\n useImperativeHandle,\n} from \"react\";\nimport type { Node } from \"@xyflow/react\";\n\n// Define interfaces for different node data structures\ninterface MessageData {\n name: string;\n version?: string;\n}\n\ninterface ServiceData {\n name: string;\n version?: string;\n}\n\ninterface DomainData {\n name: string;\n version?: string;\n}\n\ninterface EntityData {\n name: string;\n version?: string;\n}\n\ninterface NodeDataContent extends Record<string, unknown> {\n message?: {\n data: MessageData;\n };\n service?: {\n data: ServiceData;\n };\n domain?: {\n data: DomainData;\n };\n entity?: {\n data: EntityData;\n };\n name?: string;\n version?: string;\n}\n\n// Extend the Node type with our custom data structure\ntype CustomNode = Node<NodeDataContent>;\n\ninterface VisualiserSearchProps {\n nodes: CustomNode[];\n onNodeSelect: (node: CustomNode) => void;\n onClear: () => void;\n onPaneClick?: () => void;\n}\n\nexport interface VisualiserSearchRef {\n hideSuggestions: () => void;\n}\n\nconst VisualiserSearch = forwardRef<VisualiserSearchRef, VisualiserSearchProps>(\n ({ nodes, onNodeSelect, onClear, onPaneClick: _onPaneClick }, ref) => {\n const [searchQuery, setSearchQuery] = useState(\"\");\n const [filteredSuggestions, setFilteredSuggestions] = useState<\n CustomNode[]\n >([]);\n const [showSuggestions, setShowSuggestions] = useState(false);\n const [selectedSuggestionIndex, setSelectedSuggestionIndex] = useState(-1);\n const searchInputRef = useRef<HTMLInputElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n const hideSuggestions = useCallback(() => {\n setShowSuggestions(false);\n setSelectedSuggestionIndex(-1);\n }, []);\n\n useImperativeHandle(\n ref,\n () => ({\n hideSuggestions,\n }),\n [hideSuggestions],\n );\n\n const getNodeDisplayName = useCallback((node: CustomNode) => {\n const name =\n node.data?.message?.data?.name ||\n node.data?.service?.data?.name ||\n node.data?.domain?.data?.name ||\n node.data?.entity?.data?.name ||\n node.data?.name ||\n node.id;\n const version =\n node.data?.message?.data?.version ||\n node.data?.service?.data?.version ||\n node.data?.domain?.data?.version ||\n node.data?.entity?.data?.version ||\n node.data?.version;\n return version ? `${name} (v${version})` : name;\n }, []);\n\n const getNodeTypeColorClass = useCallback((nodeType: string) => {\n const colorClasses: { [key: string]: string } = {\n events: \"bg-orange-600 text-white\",\n services: \"bg-pink-600 text-white\",\n flows: \"bg-teal-600 text-white\",\n commands: \"bg-blue-600 text-white\",\n queries: \"bg-green-600 text-white\",\n channels: \"bg-gray-600 text-white\",\n domains: \"bg-yellow-500 text-white\",\n externalSystem: \"bg-pink-600 text-white\",\n actor: \"bg-yellow-500 text-white\",\n step: \"bg-gray-700 text-white\",\n user: \"bg-yellow-500 text-white\",\n custom: \"bg-gray-500 text-white\",\n };\n return colorClasses[nodeType] || \"bg-gray-100 text-gray-700\";\n }, []);\n\n const handleSearchChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const query = event.target.value;\n setSearchQuery(query);\n\n if (query.length > 0) {\n const filtered = nodes.filter((node) => {\n const nodeName = getNodeDisplayName(node);\n return nodeName.toLowerCase().includes(query.toLowerCase());\n });\n setFilteredSuggestions(filtered);\n setShowSuggestions(true);\n setSelectedSuggestionIndex(-1);\n } else {\n setFilteredSuggestions(nodes);\n setShowSuggestions(true);\n setSelectedSuggestionIndex(-1);\n }\n },\n [nodes, getNodeDisplayName],\n );\n\n const handleSearchFocus = useCallback(() => {\n if (searchQuery.length === 0) {\n setFilteredSuggestions(nodes);\n }\n setShowSuggestions(true);\n setSelectedSuggestionIndex(-1);\n }, [nodes, searchQuery]);\n\n const handleSuggestionClick = useCallback(\n (node: CustomNode) => {\n setSearchQuery(getNodeDisplayName(node));\n setShowSuggestions(false);\n onNodeSelect(node);\n },\n [onNodeSelect, getNodeDisplayName],\n );\n\n const handleSearchKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (!showSuggestions || filteredSuggestions.length === 0) return;\n\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault();\n setSelectedSuggestionIndex((prev) =>\n prev < filteredSuggestions.length - 1 ? prev + 1 : 0,\n );\n break;\n case \"ArrowUp\":\n event.preventDefault();\n setSelectedSuggestionIndex((prev) =>\n prev > 0 ? prev - 1 : filteredSuggestions.length - 1,\n );\n break;\n case \"Enter\":\n event.preventDefault();\n if (selectedSuggestionIndex >= 0) {\n handleSuggestionClick(\n filteredSuggestions[selectedSuggestionIndex],\n );\n }\n break;\n case \"Escape\":\n setShowSuggestions(false);\n setSelectedSuggestionIndex(-1);\n break;\n }\n },\n [\n showSuggestions,\n filteredSuggestions,\n selectedSuggestionIndex,\n handleSuggestionClick,\n ],\n );\n\n const clearSearch = useCallback(() => {\n setSearchQuery(\"\");\n setShowSuggestions(false);\n setFilteredSuggestions([]);\n setSelectedSuggestionIndex(-1);\n onClear();\n if (searchInputRef.current) {\n searchInputRef.current.focus();\n }\n }, [onClear]);\n\n // Close suggestions when clicking outside\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target as any)\n ) {\n setShowSuggestions(false);\n setSelectedSuggestionIndex(-1);\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, []);\n\n return (\n <div ref={containerRef} className=\"w-full max-w-md mx-auto relative\">\n <div className=\"relative\">\n <input\n ref={searchInputRef}\n type=\"text\"\n placeholder=\"Search nodes...\"\n value={searchQuery}\n onChange={handleSearchChange}\n onKeyDown={handleSearchKeyDown}\n onFocus={handleSearchFocus}\n className=\"w-full px-4 py-2 pr-10 bg-white border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ec-accent))] focus:border-transparent\"\n />\n {searchQuery && (\n <button\n onClick={clearSearch}\n className=\"absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600\"\n aria-label=\"Clear search\"\n >\n <svg\n className=\"w-5 h-5\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n </button>\n )}\n </div>\n {showSuggestions && filteredSuggestions.length > 0 && (\n <div className=\"absolute top-full left-0 right-0 mt-1 bg-white border border-gray-300 rounded-md shadow-lg z-50 max-h-60 overflow-y-auto\">\n {filteredSuggestions.map((node, index) => {\n const nodeName = getNodeDisplayName(node);\n const nodeType = node.type || \"unknown\";\n return (\n <div\n key={node.id}\n onClick={() => handleSuggestionClick(node)}\n className={`px-4 py-2 cursor-pointer flex items-center justify-between hover:bg-gray-100 ${\n index === selectedSuggestionIndex\n ? \"bg-[rgb(var(--ec-accent-subtle))]\"\n : \"\"\n }`}\n >\n <span className=\"text-sm font-medium text-gray-900\">\n {nodeName}\n </span>\n <span\n className={`text-xs capitalize px-2 py-1 rounded ${getNodeTypeColorClass(nodeType)}`}\n >\n {nodeType}\n </span>\n </div>\n );\n })}\n </div>\n )}\n </div>\n );\n },\n);\n\nVisualiserSearch.displayName = \"VisualiserSearch\";\n\nexport default VisualiserSearch;\n","import React, { useState, useEffect, useCallback } from \"react\";\nimport { ChevronLeftIcon, ChevronRightIcon } from \"@heroicons/react/24/outline\";\nimport type { Edge } from \"@xyflow/react\";\n\ninterface NodeData {\n step?: {\n title?: string;\n summary?: string;\n };\n service?: {\n data?: {\n name?: string;\n summary?: string;\n };\n };\n message?: {\n data?: {\n name?: string;\n summary?: string;\n };\n };\n flow?: {\n data?: {\n name?: string;\n };\n };\n custom?: {\n title?: string;\n label?: string;\n summary?: string;\n };\n actor?: {\n label?: string;\n };\n externalSystem?: {\n label?: string;\n };\n}\n\ninterface CustomNode {\n id: string;\n data: NodeData;\n}\n\ninterface StepWalkthroughProps {\n nodes: CustomNode[];\n edges: Edge[];\n isFlowVisualization: boolean;\n onStepChange: (\n nodeId: string | null,\n highlightPaths?: string[],\n shouldZoomOut?: boolean,\n ) => void;\n mode?: \"full\" | \"simple\";\n}\n\ninterface PathOption {\n targetId: string;\n label?: string;\n targetNode: CustomNode;\n}\n\nexport default function StepWalkthrough({\n nodes,\n edges,\n isFlowVisualization,\n onStepChange,\n mode = \"full\",\n}: StepWalkthroughProps) {\n const [currentNodeId, setCurrentNodeId] = useState<string | null>(null);\n const [pathHistory, setPathHistory] = useState<string[]>([]);\n const [currentStepIndex, setCurrentStepIndex] = useState<number>(-1); // -1 means not started\n const [availablePaths, setAvailablePaths] = useState<PathOption[]>([]);\n const [selectedPathIndex, setSelectedPathIndex] = useState<number>(0);\n const [startNodeId, setStartNodeId] = useState<string | null>(null);\n\n useEffect(() => {\n if (isFlowVisualization && nodes.length > 0) {\n // Find the starting node (node with no incoming edges)\n const incomingEdgeMap = new Map<string, number>();\n nodes.forEach((node: CustomNode) => incomingEdgeMap.set(node.id, 0));\n\n edges.forEach((edge: Edge) => {\n if (incomingEdgeMap.has(edge.target)) {\n incomingEdgeMap.set(\n edge.target,\n (incomingEdgeMap.get(edge.target) || 0) + 1,\n );\n }\n });\n\n const startNodes = nodes.filter(\n (node: CustomNode) => incomingEdgeMap.get(node.id) === 0,\n );\n if (startNodes.length > 0 && !startNodeId) {\n const firstStartNode = startNodes[0];\n setStartNodeId(firstStartNode.id);\n }\n }\n }, [nodes, edges, isFlowVisualization, startNodeId]);\n\n useEffect(() => {\n if (currentNodeId) {\n // Find available paths from current node\n const outgoingEdges = edges.filter(\n (edge: Edge) => edge.source === currentNodeId,\n );\n const paths: PathOption[] = outgoingEdges.map((edge: Edge) => {\n const targetNode = nodes.find((n: CustomNode) => n.id === edge.target);\n return {\n targetId: edge.target,\n label: edge.label as string | undefined,\n targetNode: targetNode!,\n };\n });\n setAvailablePaths(paths);\n setSelectedPathIndex(0);\n } else {\n setAvailablePaths([]);\n }\n }, [currentNodeId, nodes, edges]);\n\n const handleNextStep = useCallback(() => {\n if (currentStepIndex === -1) {\n // Start the walkthrough\n if (startNodeId) {\n setPathHistory([startNodeId]);\n setCurrentNodeId(startNodeId);\n setCurrentStepIndex(0);\n onStepChange(startNodeId);\n }\n } else if (availablePaths.length > 0) {\n // Move to the selected path\n const selectedPath = availablePaths[selectedPathIndex];\n const newHistory = [...pathHistory, selectedPath.targetId];\n setPathHistory(newHistory);\n setCurrentNodeId(selectedPath.targetId);\n setCurrentStepIndex((prev) => prev + 1);\n\n // Highlight the selected path\n const allPaths = availablePaths.map(\n (p) => `${currentNodeId}-${p.targetId}`,\n );\n onStepChange(selectedPath.targetId, allPaths);\n }\n }, [\n currentStepIndex,\n startNodeId,\n availablePaths,\n selectedPathIndex,\n currentNodeId,\n onStepChange,\n ]);\n\n const handlePreviousStep = useCallback(() => {\n if (currentStepIndex > 0) {\n // Go back to previous step\n const newIndex = currentStepIndex - 1;\n const prevNodeId = pathHistory[newIndex];\n setCurrentNodeId(prevNodeId);\n setCurrentStepIndex(newIndex);\n onStepChange(prevNodeId);\n } else if (currentStepIndex === 0) {\n // Go back to the start (no selection)\n setCurrentNodeId(null);\n setCurrentStepIndex(-1);\n onStepChange(null);\n }\n }, [currentStepIndex, pathHistory, onStepChange]);\n\n const handlePathSelection = useCallback((index: number) => {\n setSelectedPathIndex(index);\n }, []);\n\n const handleFinish = useCallback(() => {\n setCurrentNodeId(null);\n setCurrentStepIndex(-1);\n setPathHistory([]);\n onStepChange(null, [], true); // Pass true to indicate full reset with zoom out\n }, [onStepChange]);\n\n if (!isFlowVisualization || nodes.length === 0 || mode !== \"full\") {\n return null;\n }\n\n const getCurrentStepInfo = () => {\n if (currentStepIndex === -1) {\n return {\n title: \"Walk through business flow\",\n description: \"Step through the flow to understand the business process\",\n };\n }\n\n const currentNode = nodes.find((n: CustomNode) => n.id === currentNodeId);\n if (!currentNode) return { title: \"Unknown step\", description: \"\" };\n\n let stepNumber = currentStepIndex + 1;\n let title = `Step ${stepNumber}`;\n let description = \"\";\n\n // Get node information based on type - check step data first, then type-specific data\n if (currentNode.data.step?.title) {\n title += `: ${currentNode.data.step.title}`;\n } else if (currentNode.data.service?.data?.name) {\n title += `: ${currentNode.data.service.data.name}`;\n } else if (currentNode.data.message?.data?.name) {\n title += `: ${currentNode.data.message.data.name}`;\n } else if (currentNode.data.flow?.data?.name) {\n title += `: ${currentNode.data.flow.data.name}`;\n } else if (currentNode.data.custom?.title) {\n title += `: ${currentNode.data.custom.title}`;\n } else if (currentNode.data.custom?.label) {\n title += `: ${currentNode.data.custom.label}`;\n } else if (currentNode.data.actor?.label) {\n title += `: ${currentNode.data.actor.label}`;\n } else if (currentNode.data.externalSystem?.label) {\n title += `: ${currentNode.data.externalSystem.label}`;\n }\n\n // Get description - check step data first, then type-specific data\n if (currentNode.data.step?.summary) {\n description = currentNode.data.step.summary;\n } else if (currentNode.data.service?.data?.summary) {\n description = currentNode.data.service.data.summary;\n } else if (currentNode.data.message?.data?.summary) {\n description = currentNode.data.message.data.summary;\n } else if (currentNode.data.custom?.summary) {\n description = currentNode.data.custom.summary;\n }\n\n return { title, description };\n };\n\n const { title, description } = getCurrentStepInfo();\n\n return (\n <div className=\"ml-12 bg-white rounded-lg shadow-sm px-4 py-2 z-30 border border-gray-200 w-[350px]\">\n <div className=\"mb-2\">\n <h3 className=\"text-sm font-semibold text-gray-900\">{title}</h3>\n {description && (\n <p className=\"text-xs text-gray-600 mt-1\">{description}</p>\n )}\n </div>\n\n {/* Show path options when there are multiple paths */}\n {currentNodeId && availablePaths.length > 1 && (\n <div className=\"mb-3\">\n <label className=\"block text-xs font-medium text-gray-700 mb-2\">\n Choose next path:\n </label>\n <select\n value={selectedPathIndex}\n onChange={(e: React.ChangeEvent<HTMLSelectElement>) =>\n handlePathSelection(parseInt(e.target.value))\n }\n className=\"w-full px-3 py-2 text-xs border border-gray-300 rounded-md bg-white focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ec-accent))] focus:border-[rgb(var(--ec-accent))]\"\n >\n {availablePaths.map((path, index) => {\n // @ts-ignore\n const nodeLabel =\n path.targetNode.data.step?.title ||\n (path.targetNode.data as any).service?.data?.name ||\n (path.targetNode.data as any).message?.data?.name ||\n (path.targetNode.data as any).flow?.data?.name ||\n (path.targetNode.data as any).custom?.title ||\n (path.targetNode.data as any).custom?.label ||\n (path.targetNode.data as any).actor?.label ||\n (path.targetNode.data as any).externalSystem?.label ||\n \"Unknown\";\n\n return (\n <option key={path.targetId} value={index}>\n {path.label ? `${path.label}: ${nodeLabel}` : nodeLabel}\n </option>\n );\n })}\n </select>\n </div>\n )}\n\n <div className=\"flex items-center justify-between\">\n {currentStepIndex === -1 ? (\n // Initial state - show only Start button on the right\n <>\n <div className=\"flex-1\"></div>\n <button\n onClick={handleNextStep}\n className=\"flex items-center justify-center px-6 py-2 text-xs font-medium bg-[rgb(var(--ec-accent))] text-white rounded-md hover:bg-[rgb(var(--ec-accent-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ec-accent))] focus:ring-offset-2 transition-colors\"\n >\n Start\n </button>\n </>\n ) : (\n // In walkthrough - show Previous on left, Next on right (only if paths available)\n <>\n <button\n onClick={handlePreviousStep}\n className=\"flex items-center justify-center px-4 py-2 text-xs font-medium bg-[rgb(var(--ec-accent))] text-white rounded-md hover:bg-[rgb(var(--ec-accent-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ec-accent))] focus:ring-offset-2 transition-colors\"\n >\n <ChevronLeftIcon className=\"w-4 h-4 mr-1\" />\n Previous\n </button>\n\n {availablePaths.length > 0 ? (\n <button\n onClick={handleNextStep}\n className=\"flex items-center justify-center px-4 py-2 text-xs font-medium bg-[rgb(var(--ec-accent))] text-white rounded-md hover:bg-[rgb(var(--ec-accent-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ec-accent))] focus:ring-offset-2 transition-colors\"\n >\n Next\n <ChevronRightIcon className=\"w-4 h-4 ml-1\" />\n </button>\n ) : (\n <button\n onClick={handleFinish}\n className=\"flex items-center justify-center px-4 py-2 text-xs font-medium bg-green-600 text-white rounded-md hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 transition-colors\"\n >\n Finish\n </button>\n )}\n </>\n )}\n </div>\n </div>\n );\n}\n","import React, { useState, useCallback } from \"react\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport { CheckIcon, ClipboardIcon, ExternalLinkIcon } from \"lucide-react\";\nimport { useReactFlow } from \"@xyflow/react\";\nimport { exportNodeGraphForStudio } from \"../utils/export-node-graph\";\n\ninterface StudioModalProps {\n isOpen: boolean;\n onClose: () => void;\n}\n\nconst StudioModal: React.FC<StudioModalProps> = ({ isOpen, onClose }) => {\n const [copySuccess, setCopySuccess] = useState(false);\n\n const { toObject } = useReactFlow();\n\n const handleCopyToClipboard = useCallback(async () => {\n const visualizerData = toObject();\n const studioData = exportNodeGraphForStudio(visualizerData);\n\n try {\n await navigator.clipboard.writeText(JSON.stringify(studioData, null, 2));\n setCopySuccess(true);\n setTimeout(() => setCopySuccess(false), 2000);\n } catch (error) {\n console.error(\"Failed to copy to clipboard:\", error);\n // Fallback for older browsers\n const textarea = document.createElement(\"textarea\");\n textarea.value = JSON.stringify(studioData, null, 2);\n document.body.appendChild(textarea);\n textarea.select();\n document.execCommand(\"copy\");\n document.body.removeChild(textarea);\n setCopySuccess(true);\n setTimeout(() => setCopySuccess(false), 2000);\n }\n }, []);\n\n const handleOpenStudio = () => {\n window.open(\n \"https://app.eventcatalog.studio/playground?import=true&utm_source=eventcatalog&utm_medium=referral&utm_campaign=playground-import\",\n \"_blank\",\n );\n onClose();\n };\n\n return (\n <Dialog.Root open={isOpen} onOpenChange={onClose}>\n <Dialog.Portal>\n <Dialog.Overlay className=\"fixed inset-0 bg-black/50 data-[state=open]:animate-overlayShow z-50\" />\n <Dialog.Content className=\"fixed top-1/2 left-1/2 w-[90vw] max-w-md -translate-x-1/2 -translate-y-1/2 rounded-lg bg-white p-6 shadow-xl focus:outline-none data-[state=open]:animate-contentShow z-[100]\">\n <Dialog.Title className=\"text-lg font-semibold text-gray-900 mb-3\">\n Open in EventCatalog Studio\n </Dialog.Title>\n\n <Dialog.Description className=\"text-sm text-gray-600 mb-6\">\n Import your diagram into{\" \"}\n <a\n href=\"https://eventcatalog.studio\"\n className=\"text-[rgb(var(--ec-accent))] hover:text-[rgb(var(--ec-accent-hover))] underline\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n EventCatalog Studio\n </a>{\" \"}\n to create designs from your visualization of your architecture.\n </Dialog.Description>\n\n <div className=\"space-y-4\">\n <div className=\"bg-gray-50 rounded-lg p-4 border border-gray-200\">\n <h4 className=\"text-sm font-bold text-gray-900 mb-2\">\n Step 1: Copy diagram\n </h4>\n <p className=\"text-xs text-gray-600 mb-3\">\n Copy your diagram data to your clipboard.\n </p>\n <button\n onClick={handleCopyToClipboard}\n className={`w-full flex items-center justify-center space-x-2 px-4 py-2 text-sm font-medium rounded-md border transition-colors ${\n copySuccess\n ? \"bg-green-50 border-green-200 text-green-700\"\n : \"bg-white border-gray-300 text-gray-700 hover:bg-gray-50\"\n }`}\n >\n {copySuccess ? (\n <>\n <CheckIcon className=\"w-4 h-4\" />\n <span>Copied!</span>\n </>\n ) : (\n <>\n <ClipboardIcon className=\"w-4 h-4\" />\n <span>Copy diagram to clipboard</span>\n </>\n )}\n </button>\n </div>\n\n <div className=\"bg-[rgb(var(--ec-accent-subtle))] rounded-lg p-4 border border-[rgb(var(--ec-accent)/0.3)]\">\n <h4 className=\"text-sm font-bold text-gray-900 mb-2\">\n Step 2: Open EventCatalog Studio\n </h4>\n <p className=\"text-xs text-gray-600 mb-3\">\n Go to EventCatalog Studio and import your design using the\n \"Import from EventCatalog\" button.\n </p>\n\n <button\n onClick={handleOpenStudio}\n className=\"w-full flex items-center justify-center space-x-2 px-4 py-2 bg-[rgb(var(--ec-accent))] text-white text-sm font-medium rounded-md hover:bg-[rgb(var(--ec-accent-hover))] transition-colors\"\n >\n <ExternalLinkIcon className=\"w-4 h-4\" />\n <span>Open EventCatalog Studio</span>\n </button>\n <p className=\"text-[12px] text-gray-500 italic mt-4 mb-0\">\n Don't worry, none of your data is stored by EventCatalog Studio,\n everything is local to your browser.\n </p>\n </div>\n </div>\n\n <div className=\"mt-6 flex justify-end\">\n <Dialog.Close asChild>\n <button\n type=\"button\"\n className=\"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ec-accent))] focus:ring-offset-2 transition-colors\"\n onClick={onClose}\n >\n Close\n </button>\n </Dialog.Close>\n </div>\n </Dialog.Content>\n </Dialog.Portal>\n </Dialog.Root>\n );\n};\n\nexport default StudioModal;\n","import type { Node, ReactFlowJsonObject, Edge } from \"@xyflow/react\";\n\n// Define the structure of resource data that can be found in nodes\ninterface ResourceData {\n id?: string;\n name?: string;\n summary?: string;\n version?: string;\n}\n\n// Define the possible node data structure\ninterface NodeDataWithResources {\n [key: string]: any;\n channel?: ResourceData;\n custom?: ResourceData;\n data?: ResourceData;\n domain?: ResourceData;\n entity?: ResourceData;\n message?: ResourceData;\n flow?: ResourceData;\n service?: ResourceData;\n step?: ResourceData;\n user?: ResourceData;\n}\n\nexport const exportNodeGraphForStudio = (\n data: ReactFlowJsonObject,\n): ReactFlowJsonObject => {\n const dataTypes: (keyof NodeDataWithResources)[] = [\n \"channel\",\n \"custom\",\n \"data\",\n \"domain\",\n \"entity\",\n \"message\",\n \"flow\",\n \"service\",\n \"step\",\n \"user\",\n ];\n\n // try and remove unwanted data for studio\n const nodes = data.nodes.map((node: Node) => {\n let nodeData = node.data as NodeDataWithResources;\n const dataProperties = Object.keys(\n nodeData,\n ) as (keyof NodeDataWithResources)[];\n\n // If we find a match.....\n const hasCustomDataType = dataProperties.find((property) =>\n dataTypes.includes(property),\n );\n\n if (hasCustomDataType && nodeData[hasCustomDataType]) {\n const resourceData = nodeData[hasCustomDataType] as ResourceData;\n nodeData = {\n ...nodeData,\n [hasCustomDataType]: {\n id: resourceData?.id,\n name: resourceData?.name,\n summary: resourceData?.summary,\n version: resourceData?.version,\n },\n };\n }\n\n return {\n ...node,\n data: {\n ...nodeData,\n // We dont need these for studio\n source: undefined,\n target: undefined,\n // Studio wants all nodes in full mode\n mode: \"full\",\n },\n };\n });\n\n const edges = data.edges.map((edge: Edge) => {\n return {\n ...edge,\n data: undefined,\n type: \"animatedMessage\",\n };\n });\n\n return {\n ...data,\n nodes,\n edges,\n };\n};\n","import React, { useState, useCallback, useEffect } from \"react\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport { XIcon, FocusIcon } from \"lucide-react\";\nimport {\n ReactFlowProvider,\n type Node,\n type Edge,\n type NodeTypes,\n type EdgeTypes,\n} from \"@xyflow/react\";\nimport FocusModeContent from \"./FocusMode/FocusModeContent\";\nimport { getNodeDisplayInfo } from \"./FocusMode/utils\";\n\ninterface FocusModeModalProps {\n isOpen: boolean;\n onClose: () => void;\n initialNodeId: string | null;\n nodes: Node[];\n edges: Edge[];\n nodeTypes: NodeTypes;\n edgeTypes: EdgeTypes;\n}\n\nconst FocusModeModal: React.FC<FocusModeModalProps> = ({\n isOpen,\n onClose,\n initialNodeId,\n nodes,\n edges,\n nodeTypes,\n edgeTypes,\n}) => {\n const [centerNodeId, setCenterNodeId] = useState<string | null>(\n initialNodeId,\n );\n\n // Reset center node when modal opens with new initial node\n useEffect(() => {\n if (isOpen && initialNodeId) {\n setCenterNodeId(initialNodeId);\n }\n }, [isOpen, initialNodeId]);\n\n const handleSwitchCenter = useCallback(\n (newCenterNodeId: string, _direction: \"left\" | \"right\") => {\n setCenterNodeId(newCenterNodeId);\n },\n [],\n );\n\n // Get center node info for title\n const centerNode = centerNodeId\n ? nodes.find((n) => n.id === centerNodeId)\n : null;\n const centerNodeInfo = centerNode ? getNodeDisplayInfo(centerNode) : null;\n\n if (!centerNodeId) {\n return null;\n }\n\n return (\n <Dialog.Root open={isOpen} onOpenChange={(open) => !open && onClose()}>\n <Dialog.Portal\n container={typeof document !== \"undefined\" ? document.body : undefined}\n >\n <div\n className=\"fixed inset-0 z-[99999]\"\n style={{ isolation: \"isolate\" }}\n >\n <Dialog.Overlay className=\"fixed inset-0 bg-black/70 data-[state=open]:animate-overlayShow\" />\n <Dialog.Content className=\"fixed inset-4 md:inset-8 lg:inset-12 rounded-lg bg-[rgb(var(--ec-card-bg,var(--ec-page-bg)))] shadow-xl focus:outline-none flex flex-col overflow-hidden\">\n {/* Header */}\n <div className=\"flex items-center justify-between px-6 py-4 border-b border-[rgb(var(--ec-page-border))] flex-shrink-0\">\n <div className=\"flex items-center gap-3\">\n <div className=\"flex items-center justify-center w-10 h-10 rounded-lg bg-[rgb(var(--ec-accent-subtle))]\">\n <FocusIcon className=\"w-5 h-5 text-[rgb(var(--ec-accent))]\" />\n </div>\n <div>\n <Dialog.Title className=\"text-lg font-semibold text-[rgb(var(--ec-page-text))]\">\n Focus Mode\n </Dialog.Title>\n <Dialog.Description className=\"text-sm text-[rgb(var(--ec-page-text-muted))]\">\n {centerNodeInfo\n ? `Exploring: ${centerNodeInfo.name} - Click on connected nodes to navigate`\n : \"Explore node connections\"}\n </Dialog.Description>\n </div>\n </div>\n <Dialog.Close asChild>\n <button\n className=\"flex items-center justify-center w-10 h-10 rounded-lg text-[rgb(var(--ec-icon-color))] hover:text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-content-hover,var(--ec-page-border)/0.5))] transition-colors\"\n aria-label=\"Close\"\n >\n <XIcon className=\"w-5 h-5\" />\n </button>\n </Dialog.Close>\n </div>\n\n {/* Content */}\n <div className=\"flex-1 overflow-hidden\">\n <ReactFlowProvider>\n <FocusModeContent\n centerNodeId={centerNodeId}\n nodes={nodes}\n edges={edges}\n nodeTypes={nodeTypes}\n edgeTypes={edgeTypes}\n onSwitchCenter={handleSwitchCenter}\n />\n </ReactFlowProvider>\n </div>\n </Dialog.Content>\n </div>\n </Dialog.Portal>\n </Dialog.Root>\n );\n};\n\nexport default FocusModeModal;\n","import React, {\n useMemo,\n useCallback,\n useEffect,\n useState,\n useRef,\n} from \"react\";\nimport {\n ReactFlow,\n Background,\n Controls,\n useReactFlow,\n useNodesState,\n useEdgesState,\n type Node,\n type Edge,\n type NodeTypes,\n type EdgeTypes,\n} from \"@xyflow/react\";\nimport { getConnectedNodes, getNodeDisplayInfo } from \"./utils\";\nimport FocusModeNodeActions from \"./FocusModeNodeActions\";\nimport FocusModePlaceholder from \"./FocusModePlaceholder\";\n\ninterface FocusModeContentProps {\n centerNodeId: string;\n nodes: Node[];\n edges: Edge[];\n nodeTypes: NodeTypes;\n edgeTypes: EdgeTypes;\n onSwitchCenter: (\n newCenterNodeId: string,\n direction: \"left\" | \"right\",\n ) => void;\n}\n\nconst HORIZONTAL_SPACING = 450;\nconst VERTICAL_SPACING = 200;\nconst SLIDE_DURATION = 300;\n\nconst FocusModeContent: React.FC<FocusModeContentProps> = ({\n centerNodeId,\n nodes: allNodes,\n edges: allEdges,\n nodeTypes,\n edgeTypes,\n onSwitchCenter,\n}) => {\n const { fitView } = useReactFlow();\n const [isAnimating, setIsAnimating] = useState(false);\n const [needsFitView, setNeedsFitView] = useState(false);\n const [hoveredEdgeId, setHoveredEdgeId] = useState<string | null>(null);\n const [isReady, setIsReady] = useState(false);\n const reactFlowInitialized = useRef(false);\n const animationTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n\n // Cleanup timeout on unmount\n useEffect(() => {\n return () => {\n if (animationTimeoutRef.current) {\n clearTimeout(animationTimeoutRef.current);\n }\n };\n }, []);\n\n // Calculate focused nodes and edges with positions\n const calculateFocusedGraph = useCallback(\n (centerId: string) => {\n const centerNode = allNodes.find((n) => n.id === centerId);\n if (!centerNode) {\n return { nodes: [], edges: [] };\n }\n\n const { leftNodes, rightNodes } = getConnectedNodes(\n centerId,\n allNodes,\n allEdges,\n );\n const centerNodeInfo = getNodeDisplayInfo(centerNode);\n const positionedNodes: Node[] = [];\n\n // Center node at origin\n positionedNodes.push({\n ...centerNode,\n position: { x: 0, y: 0 },\n style: { ...centerNode.style, opacity: 1 },\n data: { ...centerNode.data, isFocusCenter: true },\n });\n\n // Left nodes (incoming)\n leftNodes.forEach((node, index) => {\n const yOffset = (index - (leftNodes.length - 1) / 2) * VERTICAL_SPACING;\n positionedNodes.push({\n ...node,\n position: { x: -HORIZONTAL_SPACING, y: yOffset },\n style: { ...node.style, opacity: 1 },\n });\n });\n\n // Right nodes (outgoing)\n rightNodes.forEach((node, index) => {\n const yOffset =\n (index - (rightNodes.length - 1) / 2) * VERTICAL_SPACING;\n positionedNodes.push({\n ...node,\n position: { x: HORIZONTAL_SPACING, y: yOffset },\n style: { ...node.style, opacity: 1 },\n });\n });\n\n // Add placeholder nodes if no connections exist\n if (leftNodes.length === 0) {\n positionedNodes.push({\n id: \"__placeholder-left__\",\n type: \"placeholder\",\n position: { x: -HORIZONTAL_SPACING, y: 0 },\n data: {\n label: `No inputs found for \"${centerNodeInfo.name}\" in this diagram`,\n side: \"left\",\n },\n draggable: false,\n selectable: false,\n } as Node);\n }\n\n if (rightNodes.length === 0) {\n positionedNodes.push({\n id: \"__placeholder-right__\",\n type: \"placeholder\",\n position: { x: HORIZONTAL_SPACING, y: 0 },\n data: {\n label: `No outputs found for \"${centerNodeInfo.name}\" in this diagram`,\n side: \"right\",\n },\n draggable: false,\n selectable: false,\n } as Node);\n }\n\n // Filter edges - only show edges connected to center node\n const focusedNodeIds = new Set(positionedNodes.map((n) => n.id));\n const filteredEdges = allEdges\n .filter((edge) => {\n // Only include edges where center node is either source or target\n const connectsToCenter =\n edge.source === centerId || edge.target === centerId;\n // And the other end is in our focused nodes\n const otherEndInFocus =\n focusedNodeIds.has(edge.source) && focusedNodeIds.has(edge.target);\n return connectsToCenter && otherEndInFocus;\n })\n .map((edge) => ({\n ...edge,\n style: { ...edge.style, opacity: 1 },\n labelStyle: { ...edge.labelStyle, opacity: 1 },\n data: { ...edge.data, opacity: 1, animated: false },\n animated: false,\n }));\n\n return { nodes: positionedNodes, edges: filteredEdges };\n },\n [allNodes, allEdges],\n );\n\n // Initial graph\n const initialGraph = useMemo(\n () => calculateFocusedGraph(centerNodeId),\n [centerNodeId, calculateFocusedGraph],\n );\n\n const [displayNodes, setDisplayNodes] = useNodesState(initialGraph.nodes);\n const [displayEdges, setDisplayEdges] = useEdgesState(initialGraph.edges);\n\n // Update when centerNodeId changes externally\n useEffect(() => {\n const { nodes, edges } = calculateFocusedGraph(centerNodeId);\n setDisplayNodes(nodes);\n setDisplayEdges(edges);\n setNeedsFitView(true);\n }, [centerNodeId, calculateFocusedGraph, setDisplayNodes, setDisplayEdges]);\n\n // FitView when needed - triggered after nodes are updated\n useEffect(() => {\n if (needsFitView && reactFlowInitialized.current) {\n // Small delay to ensure nodes are rendered, then fit view\n const timer = setTimeout(() => {\n fitView({ padding: 0.2, duration: 300 });\n setNeedsFitView(false);\n }, 50);\n return () => clearTimeout(timer);\n }\n }, [needsFitView, displayNodes, fitView]);\n\n // Handle ReactFlow initialization\n const handleInit = useCallback(() => {\n reactFlowInitialized.current = true;\n // Dialog opens instantly (no animation), so fitView immediately\n requestAnimationFrame(() => {\n fitView({ padding: 0.2, duration: 0 });\n setIsReady(true);\n });\n }, [fitView]);\n\n // Handle switching to a new center node with animation\n const handleSwitchNode = useCallback(\n (nodeId: string, direction: \"left\" | \"right\") => {\n if (nodeId === centerNodeId || isAnimating) return;\n\n setIsAnimating(true);\n\n // Animate: clicked node slides to center, current center hides\n setDisplayNodes((currentNodes) =>\n currentNodes.map((node) => {\n if (node.id === nodeId) {\n // Clicked node slides to center\n return {\n ...node,\n position: { x: 0, y: 0 },\n style: {\n ...node.style,\n transition: `all ${SLIDE_DURATION}ms ease-out`,\n },\n };\n }\n if (node.id === centerNodeId) {\n // Current center node hides\n return {\n ...node,\n style: {\n ...node.style,\n opacity: 0,\n transition: `opacity ${SLIDE_DURATION}ms ease-out`,\n },\n };\n }\n return node;\n }),\n );\n\n // After slide completes, switch to new center\n animationTimeoutRef.current = setTimeout(() => {\n onSwitchCenter(nodeId, direction);\n setIsAnimating(false);\n }, SLIDE_DURATION);\n },\n [centerNodeId, isAnimating, setDisplayNodes, onSwitchCenter],\n );\n\n // Handle node click with animation\n const handleNodeClick = useCallback(\n (_: React.MouseEvent, clickedNode: Node) => {\n if (clickedNode.id === centerNodeId || isAnimating) return;\n const direction = (clickedNode.position?.x ?? 0) < 0 ? \"left\" : \"right\";\n handleSwitchNode(clickedNode.id, direction);\n },\n [centerNodeId, isAnimating, handleSwitchNode],\n );\n\n // Handle edge hover for animation\n const handleEdgeMouseEnter = useCallback(\n (_: React.MouseEvent, edge: Edge) => {\n setHoveredEdgeId(edge.id);\n },\n [],\n );\n\n const handleEdgeMouseLeave = useCallback(() => {\n setHoveredEdgeId(null);\n }, []);\n\n // Apply hover animation to edges - use ReactFlow's built-in animated property\n const edgesWithHover = useMemo(() => {\n return displayEdges.map((edge) => {\n if (edge.id === hoveredEdgeId) {\n return {\n ...edge,\n animated: true,\n };\n }\n return edge;\n });\n }, [displayEdges, hoveredEdgeId]);\n\n // Merge nodeTypes with placeholder\n const mergedNodeTypes = useMemo(\n () => ({\n ...nodeTypes,\n placeholder: FocusModePlaceholder,\n }),\n [nodeTypes],\n );\n\n if (displayNodes.length === 0) {\n return (\n <div className=\"flex items-center justify-center h-full text-[rgb(var(--ec-page-text-muted))]\">\n Node not found\n </div>\n );\n }\n\n return (\n <div\n className=\"h-full w-full focus-mode-container\"\n style={{ opacity: isReady ? 1 : 0 }}\n >\n <ReactFlow\n nodes={displayNodes}\n edges={edgesWithHover}\n nodeTypes={mergedNodeTypes}\n edgeTypes={edgeTypes}\n onNodeClick={handleNodeClick}\n onEdgeMouseEnter={handleEdgeMouseEnter}\n onEdgeMouseLeave={handleEdgeMouseLeave}\n onInit={handleInit}\n proOptions={{ hideAttribution: true }}\n nodesDraggable={true}\n nodesConnectable={false}\n elementsSelectable={true}\n panOnDrag={true}\n zoomOnScroll={true}\n minZoom={0.3}\n maxZoom={2}\n >\n <Background color=\"rgb(var(--ec-page-border))\" gap={20} />\n <Controls showInteractive={false} />\n {displayNodes.map((node, index) => (\n <FocusModeNodeActions\n key={`actions-${node.id}-${index}`}\n node={node}\n isCenter={node.id === centerNodeId}\n onSwitch={handleSwitchNode}\n />\n ))}\n </ReactFlow>\n </div>\n );\n};\n\nexport default FocusModeContent;\n","import type { Node, Edge } from \"@xyflow/react\";\n\nexport interface NodeDisplayInfo {\n id: string;\n name: string;\n type: string;\n version?: string;\n description?: string;\n}\n\nexport interface ConnectedNodes {\n leftNodes: Node[];\n rightNodes: Node[];\n}\n\nexport const NODE_COLOR_CLASSES: Record<string, string> = {\n events: \"bg-orange-600\",\n services: \"bg-pink-600\",\n flows: \"bg-teal-600\",\n commands: \"bg-blue-600\",\n queries: \"bg-green-600\",\n channels: \"bg-gray-600\",\n externalSystem: \"bg-pink-600\",\n actor: \"bg-yellow-500\",\n step: \"bg-gray-700\",\n data: \"bg-blue-600\",\n \"data-products\": \"bg-indigo-600\",\n domains: \"bg-yellow-600\",\n entities: \"bg-purple-600\",\n};\n\nexport const NODE_TYPE_LABELS: Record<string, string> = {\n events: \"Event\",\n services: \"Service\",\n flows: \"Flow\",\n commands: \"Command\",\n queries: \"Query\",\n channels: \"Channel\",\n externalSystem: \"External System\",\n actor: \"Actor\",\n step: \"Step\",\n data: \"Data\",\n \"data-products\": \"Data Product\",\n domains: \"Domain\",\n entities: \"Entity\",\n};\n\n/**\n * Get connected nodes for a given center node\n * Left nodes: incoming edges (they send TO this node)\n * Right nodes: outgoing edges (this node sends TO them)\n */\nexport function getConnectedNodes(\n centerNodeId: string,\n nodes: Node[],\n edges: Edge[],\n): ConnectedNodes {\n const leftIds = new Set<string>();\n const rightIds = new Set<string>();\n\n edges.forEach((edge) => {\n if (edge.target === centerNodeId) {\n leftIds.add(edge.source);\n }\n if (edge.source === centerNodeId) {\n rightIds.add(edge.target);\n }\n });\n\n return {\n leftNodes: nodes.filter((n) => leftIds.has(n.id)),\n rightNodes: nodes.filter((n) => rightIds.has(n.id)),\n };\n}\n\n// Entity keys that follow the standard data structure pattern\nconst ENTITY_KEYS = [\n \"service\",\n \"message\",\n \"flow\",\n \"channel\",\n \"domain\",\n \"entity\",\n \"dataProduct\",\n] as const;\n\n/**\n * Extract display information from a ReactFlow node\n */\nexport function getNodeDisplayInfo(node: Node): NodeDisplayInfo {\n const nodeType = node.type || \"unknown\";\n const data = node.data as any;\n\n // Find the entity in data using standard keys\n const entityKey = ENTITY_KEYS.find((key) => data[key]);\n const entity = entityKey ? data[entityKey] : null;\n\n const name =\n entity?.data?.name || entity?.id || data.label || data.name || node.id;\n const version =\n entity?.data?.version || entity?.version || data.version || \"\";\n const description =\n entity?.data?.summary ||\n entity?.data?.description ||\n data.summary ||\n data.description ||\n \"\";\n\n return {\n id: node.id,\n name,\n type: nodeType,\n version,\n description: description\n ? truncateDescription(description, 100)\n : undefined,\n };\n}\n\n/**\n * Truncate description to a max length\n */\nfunction truncateDescription(text: string, maxLength: number): string {\n if (text.length <= maxLength) return text;\n return text.slice(0, maxLength).trim() + \"...\";\n}\n\n/**\n * Get the color class for a node type\n */\nexport function getNodeColorClass(nodeType: string): string {\n return NODE_COLOR_CLASSES[nodeType] || \"bg-gray-500\";\n}\n\n/**\n * Get the display label for a node type\n */\nexport function getNodeTypeLabel(nodeType: string): string {\n return NODE_TYPE_LABELS[nodeType] || nodeType;\n}\n\n// Mapping from entity key to doc path\nconst DOC_PATH_MAP: Record<string, string> = {\n service: \"services\",\n flow: \"flows\",\n channel: \"channels\",\n domain: \"domains\",\n entity: \"entities\",\n dataProduct: \"data-products\",\n};\n\n/**\n * Get the documentation URL for a node\n */\nexport function getNodeDocUrl(node: Node): string | null {\n const nodeType = node.type || \"unknown\";\n const data = node.data as any;\n\n // Handle message type separately due to type mapping\n if (data.message) {\n const id = data.message.data?.id || data.message.id || \"\";\n const version = data.message.data?.version || data.message.version || \"\";\n const collectionType =\n nodeType === \"events\"\n ? \"events\"\n : nodeType === \"commands\"\n ? \"commands\"\n : \"queries\";\n return id && version ? `/docs/${collectionType}/${id}/${version}` : null;\n }\n\n // Handle data/container nodes with nested data.data structure\n if (data.data && nodeType === \"data\") {\n const id = data.data.id || \"\";\n const version = data.data.version || \"\";\n return id && version ? `/docs/containers/${id}/${version}` : null;\n }\n\n // Handle standard entity types\n for (const [key, path] of Object.entries(DOC_PATH_MAP)) {\n if (data[key]) {\n const id = data[key].data?.id || data[key].id || \"\";\n const version = data[key].data?.version || data[key].version || \"\";\n return id && version ? `/docs/${path}/${id}/${version}` : null;\n }\n }\n\n return null;\n}\n","import React from \"react\";\nimport { NodeToolbar, Position, useViewport, type Node } from \"@xyflow/react\";\nimport { ArrowRightLeft, FileText } from \"lucide-react\";\nimport { getNodeDocUrl } from \"./utils\";\nimport { buildUrl } from \"../../utils/url-builder\";\n\ninterface FocusModeNodeActionsProps {\n node: Node;\n isCenter: boolean;\n onSwitch: (nodeId: string, direction: \"left\" | \"right\") => void;\n}\n\nconst FocusModeNodeActions: React.FC<FocusModeNodeActionsProps> = ({\n node,\n isCenter,\n onSwitch,\n}) => {\n const { zoom } = useViewport();\n\n // Don't show actions for placeholder nodes\n if (node.type === \"placeholder\") return null;\n\n const docUrl = getNodeDocUrl(node);\n const direction = (node.position?.x ?? 0) < 0 ? \"left\" : \"right\";\n\n // Scale sizes based on zoom (inverse relationship - smaller when zoomed out)\n const baseButtonSize = 32;\n const baseIconSize = 16;\n const scaleFactor = Math.max(0.6, Math.min(1, zoom));\n const buttonSize = Math.round(baseButtonSize * scaleFactor);\n const iconSize = Math.round(baseIconSize * scaleFactor);\n\n const handleSwitch = (e: React.MouseEvent) => {\n e.stopPropagation();\n onSwitch(node.id, direction);\n };\n\n const handleDocClick = (e: React.MouseEvent) => {\n e.stopPropagation();\n if (docUrl) {\n window.location.href = buildUrl(docUrl);\n }\n };\n\n // Center node only shows docs icon (if available)\n if (isCenter) {\n if (!docUrl) return null;\n return (\n <NodeToolbar\n nodeId={node.id}\n position={Position.Bottom}\n isVisible={true}\n offset={-16}\n >\n <div\n className=\"flex items-center gap-1 bg-[rgb(var(--ec-card-bg,var(--ec-page-bg)))] border border-[rgb(var(--ec-page-border))] rounded-lg shadow-md\"\n style={{ padding: Math.round(4 * scaleFactor) }}\n >\n <button\n onClick={handleDocClick}\n className=\"flex items-center justify-center rounded-md text-[rgb(var(--ec-icon-color))] hover:text-[rgb(var(--ec-accent))] hover:bg-[rgb(var(--ec-accent-subtle))] transition-colors\"\n style={{ width: buttonSize, height: buttonSize }}\n title=\"View documentation\"\n >\n <FileText style={{ width: iconSize, height: iconSize }} />\n </button>\n </div>\n </NodeToolbar>\n );\n }\n\n return (\n <NodeToolbar\n nodeId={node.id}\n position={Position.Bottom}\n isVisible={true}\n offset={-16}\n >\n <div\n className=\"flex items-center gap-1 bg-[rgb(var(--ec-card-bg,var(--ec-page-bg)))] border border-[rgb(var(--ec-page-border))] rounded-lg shadow-md\"\n style={{ padding: Math.round(4 * scaleFactor) }}\n >\n {docUrl && (\n <button\n onClick={handleDocClick}\n className=\"flex items-center justify-center rounded-md text-[rgb(var(--ec-icon-color))] hover:text-[rgb(var(--ec-accent))] hover:bg-[rgb(var(--ec-accent-subtle))] transition-colors\"\n style={{ width: buttonSize, height: buttonSize }}\n title=\"View documentation\"\n >\n <FileText style={{ width: iconSize, height: iconSize }} />\n </button>\n )}\n <button\n onClick={handleSwitch}\n className=\"flex items-center justify-center rounded-md text-[rgb(var(--ec-icon-color))] hover:text-[rgb(var(--ec-accent))] hover:bg-[rgb(var(--ec-accent-subtle))] transition-colors\"\n style={{ width: buttonSize, height: buttonSize }}\n title=\"Focus on this node\"\n >\n <ArrowRightLeft style={{ width: iconSize, height: iconSize }} />\n </button>\n </div>\n </NodeToolbar>\n );\n};\n\nexport default FocusModeNodeActions;\n","import React from \"react\";\nimport { Handle, Position } from \"@xyflow/react\";\n\ninterface FocusModePlaceholderProps {\n data: {\n label: string;\n side: \"left\" | \"right\";\n };\n}\n\nconst FocusModePlaceholder: React.FC<FocusModePlaceholderProps> = ({\n data,\n}) => {\n const { label, side } = data;\n\n return (\n <div\n className=\"px-4 py-4 rounded-lg border-2 border-dashed border-[rgb(var(--ec-page-border))] bg-[rgb(var(--ec-page-bg)/0.5)] max-w-[280px] flex items-center justify-center\"\n style={{ opacity: 0.6, minHeight: \"130px\" }}\n >\n {side === \"right\" && (\n <Handle\n type=\"target\"\n position={Position.Left}\n style={{ visibility: \"hidden\" }}\n />\n )}\n <div className=\"text-center text-sm text-[rgb(var(--ec-page-text-muted))] italic\">\n {label}\n </div>\n {side === \"left\" && (\n <Handle\n type=\"source\"\n position={Position.Right}\n style={{ visibility: \"hidden\" }}\n />\n )}\n </div>\n );\n};\n\nexport default FocusModePlaceholder;\n","import { useState, useEffect, useRef, useCallback } from \"react\";\nimport { CheckIcon, ClipboardIcon } from \"lucide-react\";\nimport type { Node, Edge } from \"@xyflow/react\";\nimport { convertToMermaid } from \"../utils/export-mermaid\";\nimport { copyToClipboard } from \"../utils/clipboard\";\n\ninterface MermaidViewProps {\n nodes: Node[];\n edges: Edge[];\n maxTextSize?: number;\n}\n\nconst MermaidView = ({\n nodes,\n edges,\n maxTextSize = 100000,\n}: MermaidViewProps) => {\n const [copySuccess, setCopySuccess] = useState(false);\n const [mermaidCode, setMermaidCode] = useState(\"\");\n const [previewSvg, setPreviewSvg] = useState<string | null>(null);\n const [previewError, setPreviewError] = useState<string | null>(null);\n const [isRendering, setIsRendering] = useState(true);\n const containerRef = useRef<HTMLDivElement>(null);\n const svgContainerRef = useRef<HTMLDivElement>(null);\n const panZoomInstanceRef = useRef<any>(null);\n\n // Generate mermaid code\n useEffect(() => {\n const code = convertToMermaid(nodes, edges, {\n includeStyles: true,\n direction: \"LR\",\n });\n setMermaidCode(code);\n }, [nodes, edges]);\n\n // Render mermaid preview\n useEffect(() => {\n if (!mermaidCode) return;\n\n let cancelled = false;\n setIsRendering(true);\n setPreviewError(null);\n\n const renderMermaid = async () => {\n try {\n const { default: mermaid } = await import(\"mermaid\");\n\n // Detect current theme\n const isDarkMode =\n document.documentElement.getAttribute(\"data-theme\") === \"dark\";\n const currentTheme = isDarkMode ? \"dark\" : \"default\";\n\n mermaid.initialize({\n maxTextSize: maxTextSize,\n startOnLoad: false,\n theme: currentTheme,\n flowchart: {\n curve: \"basis\",\n padding: 20,\n },\n securityLevel: \"loose\",\n });\n\n const id = \"mermaid-view-\" + Math.random().toString(36).substring(2, 9);\n const { svg } = await mermaid.render(id, mermaidCode);\n\n if (!cancelled) {\n setPreviewSvg(svg);\n setPreviewError(null);\n }\n } catch (error) {\n if (!cancelled) {\n console.error(\"Mermaid render error:\", error);\n setPreviewError(\n error instanceof Error ? error.message : \"Failed to render diagram\",\n );\n setPreviewSvg(null);\n }\n } finally {\n if (!cancelled) {\n setIsRendering(false);\n }\n }\n };\n\n renderMermaid();\n\n return () => {\n cancelled = true;\n };\n }, [mermaidCode]);\n\n // Initialize pan/zoom after SVG is rendered\n useEffect(() => {\n if (!previewSvg || !svgContainerRef.current) return;\n\n const initZoom = async () => {\n const svgElement = svgContainerRef.current?.querySelector(\"svg\");\n if (!svgElement) return;\n\n try {\n const { default: svgPanZoom } = await import(\"svg-pan-zoom\");\n\n // Set SVG to fill container\n svgElement.style.width = \"100%\";\n svgElement.style.height = \"100%\";\n svgElement.removeAttribute(\"height\");\n svgElement.removeAttribute(\"width\");\n\n const instance = svgPanZoom(svgElement, {\n zoomEnabled: true,\n controlIconsEnabled: false,\n fit: true,\n center: true,\n minZoom: 0.1,\n maxZoom: 10,\n zoomScaleSensitivity: 0.15,\n dblClickZoomEnabled: true,\n mouseWheelZoomEnabled: true,\n panEnabled: true,\n });\n\n panZoomInstanceRef.current = instance;\n } catch (e) {\n console.warn(\"Failed to initialize zoom:\", e);\n }\n };\n\n initZoom();\n\n return () => {\n if (panZoomInstanceRef.current) {\n try {\n panZoomInstanceRef.current.destroy();\n } catch (e) {\n // Ignore\n }\n panZoomInstanceRef.current = null;\n }\n };\n }, [previewSvg]);\n\n const handleCopyToClipboard = useCallback(async () => {\n await copyToClipboard(mermaidCode);\n setCopySuccess(true);\n setTimeout(() => setCopySuccess(false), 2000);\n }, [mermaidCode]);\n\n return (\n <div\n ref={containerRef}\n className=\"absolute inset-0 bg-[rgb(var(--ec-page-bg))]\"\n style={{ animation: \"fadeIn 200ms ease-out\" }}\n >\n <style>{`\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n `}</style>\n\n {/* Copy button - top right */}\n <div className=\"absolute top-[10px] right-4 z-20\">\n <div className=\"relative group\">\n <button\n onClick={handleCopyToClipboard}\n className={`p-2.5 rounded-md shadow-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[rgb(var(--ec-accent))] transition-all duration-150 ${\n copySuccess\n ? \"bg-green-500 text-white scale-110\"\n : \"bg-[rgb(var(--ec-card-bg))] hover:bg-[rgb(var(--ec-page-border))/0.5] text-[rgb(var(--ec-icon-color))] hover:scale-105\"\n }`}\n aria-label={copySuccess ? \"Copied!\" : \"Copy Mermaid code\"}\n >\n {copySuccess ? (\n <CheckIcon className=\"h-5 w-5\" />\n ) : (\n <ClipboardIcon className=\"h-5 w-5\" />\n )}\n </button>\n <div className=\"absolute top-full right-0 mt-2 px-2 py-1 bg-[rgb(var(--ec-page-text))] text-[rgb(var(--ec-page-bg))] text-xs rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-50\">\n {copySuccess ? \"Copied!\" : \"Copy Mermaid code\"}\n </div>\n </div>\n </div>\n\n {/* Mermaid diagram container */}\n <div className=\"absolute inset-0 overflow-hidden\">\n {isRendering && (\n <div className=\"w-full h-full flex items-center justify-center\">\n <div className=\"relative\">\n <div className=\"flex items-center gap-4 opacity-40\">\n <div className=\"w-24 h-10 bg-[rgb(var(--ec-page-border))] rounded animate-pulse\" />\n <div className=\"w-12 h-0.5 bg-[rgb(var(--ec-page-border))] animate-pulse\" />\n <div\n className=\"w-20 h-10 bg-[rgb(var(--ec-page-border))] rounded-full animate-pulse\"\n style={{ animationDelay: \"75ms\" }}\n />\n <div\n className=\"w-12 h-0.5 bg-[rgb(var(--ec-page-border))] animate-pulse\"\n style={{ animationDelay: \"150ms\" }}\n />\n <div\n className=\"w-24 h-10 bg-[rgb(var(--ec-page-border))] rounded animate-pulse\"\n style={{ animationDelay: \"225ms\" }}\n />\n </div>\n <p className=\"text-center text-sm text-[rgb(var(--ec-page-text-muted))] mt-4\">\n Rendering diagram...\n </p>\n </div>\n </div>\n )}\n\n {previewError && !isRendering && (\n <div className=\"w-full h-full flex flex-col items-center justify-center p-4\">\n <div className=\"text-red-500 text-sm mb-2\">\n Failed to render diagram\n </div>\n <div className=\"text-[rgb(var(--ec-page-text-muted))] text-xs font-mono bg-[rgb(var(--ec-code-bg))] p-2 rounded max-w-lg overflow-auto\">\n {previewError}\n </div>\n <div className=\"mt-4 text-sm text-[rgb(var(--ec-page-text-muted))]\">\n <p>You can still copy the Mermaid code and paste it into</p>\n <a\n href=\"https://mermaid.live\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-[rgb(var(--ec-accent))] hover:underline\"\n >\n mermaid.live\n </a>\n </div>\n </div>\n )}\n\n {previewSvg && !isRendering && !previewError && (\n <div\n ref={svgContainerRef}\n className=\"w-full h-full cursor-grab active:cursor-grabbing [&_svg]:w-full [&_svg]:h-full\"\n dangerouslySetInnerHTML={{ __html: previewSvg }}\n />\n )}\n </div>\n\n {/* Footer hint */}\n <div className=\"absolute bottom-4 left-4 z-20\">\n <div className=\"flex items-center gap-2 bg-[rgb(var(--ec-card-bg))]/90 backdrop-blur-sm px-3 py-1.5 rounded-md shadow-sm border border-[rgb(var(--ec-page-border))]\">\n <svg\n className=\"w-3.5 h-3.5 text-[rgb(var(--ec-icon-color))]\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122\"\n />\n </svg>\n <span className=\"text-xs text-[rgb(var(--ec-page-text-muted))]\">\n Scroll to zoom · Drag to pan\n </span>\n </div>\n </div>\n </div>\n );\n};\n\nexport default MermaidView;\n","import type { Node, Edge } from \"@xyflow/react\";\n\n/**\n * Mermaid Export Utility\n * Converts React Flow nodes and edges to Mermaid flowchart syntax\n */\n\nexport interface MermaidExportOptions {\n /** Include class definitions for styling */\n includeStyles?: boolean;\n /** Direction of the flowchart: LR (left-right), TB (top-bottom), etc. */\n direction?: \"LR\" | \"TB\" | \"RL\" | \"BT\";\n}\n\n/**\n * Mapping of node types to their Mermaid shape syntax\n * Format: [prefix, suffix]\n */\nconst NODE_SHAPE_MAP: Record<string, [string, string]> = {\n services: [\"[[\", \"]]\"], // stadium shape\n service: [\"[[\", \"]]\"],\n events: [\">\", \"]\"], // flag/asymmetric shape (message-like)\n event: [\">\", \"]\"],\n commands: [\">\", \"]\"], // flag/asymmetric shape (message-like)\n command: [\">\", \"]\"],\n queries: [\"{{\", \"}}\"], // hexagon\n query: [\"{{\", \"}}\"],\n channels: [\"[(\", \")]\"], // cylinder\n channel: [\"[(\", \")]\"],\n domains: [\"[\", \"]\"], // rectangle\n domain: [\"[\", \"]\"],\n flows: [\"([\", \"])\"], // stadium (rounded)\n flow: [\"([\", \"])\"],\n step: [\"[\", \"]\"], // rectangle\n user: [\"((\", \"))\"], // circle\n actor: [\"((\", \"))\"], // circle\n externalSystem: [\"[[\", \"]]\"], // stadium\n \"external-system\": [\"[[\", \"]]\"],\n data: [\"[(\", \")]\"], // cylinder (database)\n \"data-product\": [\"[[\", \"]]\"], // stadium\n \"data-products\": [\"[[\", \"]]\"],\n entities: [\"[\", \"]\"], // rectangle\n entity: [\"[\", \"]\"],\n custom: [\"[\", \"]\"], // rectangle\n view: [\"[\", \"]\"], // rectangle\n note: [\"[\", \"]\"], // rectangle\n};\n\n/**\n * Mermaid class definitions for styling different node types\n */\nconst NODE_STYLE_CLASSES: Record<string, string> = {\n services: \"fill:#ec4899,stroke:#be185d,color:#fff\",\n service: \"fill:#ec4899,stroke:#be185d,color:#fff\",\n events: \"fill:#f97316,stroke:#c2410c,color:#fff\",\n event: \"fill:#f97316,stroke:#c2410c,color:#fff\",\n commands: \"fill:#3b82f6,stroke:#1d4ed8,color:#fff\",\n command: \"fill:#3b82f6,stroke:#1d4ed8,color:#fff\",\n queries: \"fill:#22c55e,stroke:#15803d,color:#fff\",\n query: \"fill:#22c55e,stroke:#15803d,color:#fff\",\n channels: \"fill:#6b7280,stroke:#374151,color:#fff\",\n channel: \"fill:#6b7280,stroke:#374151,color:#fff\",\n domains: \"fill:#eab308,stroke:#a16207,color:#000\",\n domain: \"fill:#eab308,stroke:#a16207,color:#000\",\n flows: \"fill:#14b8a6,stroke:#0f766e,color:#fff\",\n flow: \"fill:#14b8a6,stroke:#0f766e,color:#fff\",\n step: \"fill:#374151,stroke:#1f2937,color:#fff\",\n user: \"fill:#8b5cf6,stroke:#6d28d9,color:#fff\",\n actor: \"fill:#eab308,stroke:#a16207,color:#000\",\n externalSystem: \"fill:#ec4899,stroke:#be185d,color:#fff\",\n \"external-system\": \"fill:#ec4899,stroke:#be185d,color:#fff\",\n data: \"fill:#3b82f6,stroke:#1d4ed8,color:#fff\",\n \"data-product\": \"fill:#6366f1,stroke:#4338ca,color:#fff\",\n \"data-products\": \"fill:#6366f1,stroke:#4338ca,color:#fff\",\n entities: \"fill:#6b7280,stroke:#374151,color:#fff\",\n entity: \"fill:#6b7280,stroke:#374151,color:#fff\",\n custom: \"fill:#9ca3af,stroke:#6b7280,color:#000\",\n view: \"fill:#9ca3af,stroke:#6b7280,color:#000\",\n note: \"fill:#fef3c7,stroke:#d97706,color:#000\",\n};\n\n/**\n * Sanitize a string to be a valid Mermaid node ID\n * Mermaid IDs should be alphanumeric with underscores\n */\nexport function sanitizeMermaidId(id: string): string {\n // Replace any non-alphanumeric characters (except underscores) with underscores\n // Also handle dots and hyphens which are common in version strings\n return id.replace(/[^a-zA-Z0-9_]/g, \"_\");\n}\n\n/**\n * Escape special characters in Mermaid labels\n */\nfunction escapeMermaidLabel(label: string): string {\n // Escape quotes and other special characters\n return label.replace(/\"/g, \"#quot;\").replace(/\\n/g, \"<br/>\");\n}\n\n/**\n * Get the Mermaid shape syntax for a node type\n */\nexport function getMermaidNodeShape(type: string): [string, string] {\n return NODE_SHAPE_MAP[type] || [\"[\", \"]\"];\n}\n\n/**\n * Helper to format label with version\n */\nfunction formatLabelWithVersion(name: string, version?: string): string {\n if (version) {\n return `${name} (${version})`;\n }\n return name;\n}\n\n/**\n * Extract the display label from a node based on its type and data\n * Includes version information when available\n */\nexport function getNodeLabel(node: Node): string {\n const { type, data } = node;\n\n if (!data) return node.id;\n\n // Handle different node types and their data structures\n if (type === \"services\" || type === \"service\") {\n const service = (data as any).service;\n const name = service?.name || service?.id || node.id;\n const version = service?.data?.version || service?.version;\n return formatLabelWithVersion(name, version);\n }\n\n if (\n type === \"events\" ||\n type === \"event\" ||\n type === \"commands\" ||\n type === \"command\" ||\n type === \"queries\" ||\n type === \"query\"\n ) {\n const message = (data as any).message;\n const name = message?.name || message?.id || node.id;\n const version = message?.data?.version || message?.version;\n return formatLabelWithVersion(name, version);\n }\n\n if (type === \"channels\" || type === \"channel\") {\n const channel = (data as any).channel;\n const name = channel?.name || channel?.id || node.id;\n const version = channel?.data?.version || channel?.version;\n return formatLabelWithVersion(name, version);\n }\n\n if (type === \"domains\" || type === \"domain\") {\n const domain = (data as any).domain;\n // Domain data can be nested in .data\n const domainData = domain?.data || domain;\n const name = domainData?.name || domainData?.id || node.id;\n const version = domainData?.version || domain?.version;\n return formatLabelWithVersion(name, version);\n }\n\n if (type === \"flows\" || type === \"flow\") {\n const flow = (data as any).flow;\n const name = flow?.name || flow?.id || node.id;\n const version = flow?.data?.version || flow?.version;\n return formatLabelWithVersion(name, version);\n }\n\n if (type === \"step\") {\n const step = (data as any).step;\n return step?.title || step?.name || step?.id || node.id;\n }\n\n if (type === \"user\" || type === \"actor\") {\n return (\n (data as any).name || (data as any).label || (data as any).id || node.id\n );\n }\n\n if (type === \"externalSystem\" || type === \"external-system\") {\n const system = (data as any).externalSystem || data;\n return system?.name || system?.id || node.id;\n }\n\n if (type === \"data\") {\n const dataNode = (data as any).data;\n return dataNode?.name || dataNode?.id || node.id;\n }\n\n if (type === \"data-product\" || type === \"data-products\") {\n const dataProduct = (data as any).dataProduct;\n const name = dataProduct?.name || dataProduct?.id || node.id;\n const version = dataProduct?.data?.version || dataProduct?.version;\n return formatLabelWithVersion(name, version);\n }\n\n if (type === \"entities\" || type === \"entity\") {\n const entity = (data as any).entity;\n return entity?.name || entity?.id || node.id;\n }\n\n if (type === \"note\") {\n return (data as any).text || (data as any).label || \"Note\";\n }\n\n // Fallback: try common data patterns\n return (\n (data as any).name ||\n (data as any).label ||\n (data as any).title ||\n (data as any).id ||\n node.id\n );\n}\n\n/**\n * Extract label from an edge\n */\nfunction getEdgeLabel(edge: Edge): string | undefined {\n if (edge.label && typeof edge.label === \"string\") {\n return edge.label;\n }\n if (edge.data?.label && typeof edge.data.label === \"string\") {\n return edge.data.label;\n }\n return undefined;\n}\n\n/**\n * Convert React Flow nodes and edges to Mermaid flowchart syntax\n */\nexport function convertToMermaid(\n nodes: Node[],\n edges: Edge[],\n options: MermaidExportOptions = {},\n): string {\n const { includeStyles = true, direction = \"LR\" } = options;\n\n const lines: string[] = [];\n\n // Add flowchart header\n lines.push(`flowchart ${direction}`);\n\n // Collect used node types for class definitions\n const usedTypes = new Set<string>();\n\n // Add class definitions if styles are enabled\n if (includeStyles) {\n lines.push(\"\");\n lines.push(\" %% Style definitions\");\n\n // First pass: collect all used node types\n nodes.forEach((node) => {\n if (node.type && NODE_STYLE_CLASSES[node.type]) {\n usedTypes.add(node.type);\n }\n });\n\n // Add class definitions for used types\n usedTypes.forEach((type) => {\n const style = NODE_STYLE_CLASSES[type];\n if (style) {\n lines.push(` classDef ${sanitizeMermaidId(type)} ${style}`);\n }\n });\n }\n\n // Add node definitions\n lines.push(\"\");\n lines.push(\" %% Nodes\");\n\n nodes.forEach((node) => {\n const sanitizedId = sanitizeMermaidId(node.id);\n const label = escapeMermaidLabel(getNodeLabel(node));\n const [prefix, suffix] = getMermaidNodeShape(node.type || \"custom\");\n\n let nodeLine = ` ${sanitizedId}${prefix}\"${label}\"${suffix}`;\n\n // Add class reference if styles are enabled\n if (includeStyles && node.type && usedTypes.has(node.type)) {\n nodeLine += `:::${sanitizeMermaidId(node.type)}`;\n }\n\n lines.push(nodeLine);\n });\n\n // Add edge definitions\n lines.push(\"\");\n lines.push(\" %% Edges\");\n\n edges.forEach((edge) => {\n const sourceId = sanitizeMermaidId(edge.source);\n const targetId = sanitizeMermaidId(edge.target);\n const label = getEdgeLabel(edge);\n\n let edgeLine: string;\n if (label) {\n // Clean up multi-line labels\n const cleanLabel = label.replace(/\\n/g, \" \").trim();\n edgeLine = ` ${sourceId} -->|\"${escapeMermaidLabel(cleanLabel)}\"| ${targetId}`;\n } else {\n edgeLine = ` ${sourceId} --> ${targetId}`;\n }\n\n lines.push(edgeLine);\n });\n\n return lines.join(\"\\n\");\n}\n","/**\n * Utility to copy text to clipboard\n */\nexport async function copyToClipboard(text: string): Promise<boolean> {\n try {\n if (navigator?.clipboard?.writeText) {\n await navigator.clipboard.writeText(text);\n return true;\n }\n // Fallback for older browsers\n const textArea = document.createElement(\"textarea\");\n textArea.value = text;\n textArea.style.position = \"fixed\";\n textArea.style.left = \"-999999px\";\n document.body.appendChild(textArea);\n textArea.select();\n const success = document.execCommand(\"copy\");\n document.body.removeChild(textArea);\n return success;\n } catch (error) {\n console.error(\"Failed to copy to clipboard:\", error);\n return false;\n }\n}\n","import React, { type RefObject, useState } from \"react\";\nimport * as DropdownMenu from \"@radix-ui/react-dropdown-menu\";\nimport {\n Code,\n Share2,\n Search,\n Grid3x3,\n Maximize2,\n Map,\n Sparkles,\n Zap,\n EyeOff,\n ExternalLink,\n Save,\n RotateCcw,\n Loader2,\n} from \"lucide-react\";\nimport {\n DocumentArrowDownIcon,\n PresentationChartLineIcon,\n} from \"@heroicons/react/24/outline\";\nimport type { VisualiserSearchRef } from \"./VisualiserSearch\";\n\ninterface VisualizerDropdownContentProps {\n isMermaidView: boolean;\n setIsMermaidView: (value: boolean) => void;\n animateMessages: boolean;\n toggleAnimateMessages: () => void;\n hideChannels: boolean;\n toggleChannelsVisibility: () => void;\n hasChannels: boolean;\n showMinimap: boolean;\n setShowMinimap: (value: boolean) => void;\n handleFitView: () => void;\n searchRef: RefObject<VisualiserSearchRef | null>;\n isChatEnabled: boolean;\n openChat: () => void;\n handleCopyArchitectureCode: () => void;\n handleExportVisual: () => void;\n setIsShareModalOpen: (value: boolean) => void;\n toggleFullScreen: () => void;\n openStudioModal: () => void;\n isDevMode?: boolean;\n onSaveLayout?: () => Promise<boolean>;\n onResetLayout?: () => Promise<boolean>;\n}\n\nconst VisualizerDropdownContent: React.FC<VisualizerDropdownContentProps> = ({\n isMermaidView,\n setIsMermaidView,\n animateMessages,\n toggleAnimateMessages,\n hideChannels,\n toggleChannelsVisibility,\n hasChannels,\n showMinimap,\n setShowMinimap,\n handleFitView,\n searchRef,\n isChatEnabled,\n openChat,\n handleCopyArchitectureCode,\n handleExportVisual,\n setIsShareModalOpen,\n toggleFullScreen,\n openStudioModal,\n isDevMode = false,\n onSaveLayout,\n onResetLayout,\n}) => {\n const [layoutStatus, setLayoutStatus] = useState<\n \"idle\" | \"saving\" | \"resetting\"\n >(\"idle\");\n\n const handleSaveLayout = async () => {\n if (!onSaveLayout) return;\n setLayoutStatus(\"saving\");\n await onSaveLayout();\n setLayoutStatus(\"idle\");\n };\n\n const handleResetLayout = async () => {\n if (!onResetLayout) return;\n if (\n !window.confirm(\n \"Reset layout to auto-positioning? This will delete your saved layout.\",\n )\n ) {\n return;\n }\n setLayoutStatus(\"resetting\");\n const success = await onResetLayout();\n if (success) {\n window.location.reload();\n } else {\n setLayoutStatus(\"idle\");\n }\n };\n\n return (\n <>\n {/* Canvas Settings Submenu */}\n <DropdownMenu.Sub>\n <DropdownMenu.SubTrigger className=\"flex items-center px-3 py-2 text-xs text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-accent-subtle)/0.3)] cursor-pointer transition-colors gap-2 outline-none\">\n <Grid3x3 className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0\" />\n <span className=\"flex-1 font-normal\">Canvas</span>\n <svg\n className=\"w-3 h-3 text-[rgb(var(--ec-page-text-muted))]\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M9 5l7 7-7 7\"\n />\n </svg>\n </DropdownMenu.SubTrigger>\n <DropdownMenu.Portal>\n <DropdownMenu.SubContent\n className=\"min-w-[200px] bg-[rgb(var(--ec-card-bg))] rounded-lg shadow-xl border border-[rgb(var(--ec-page-border))] py-1.5 z-[60]\"\n sideOffset={8}\n alignOffset={-8}\n >\n <DropdownMenu.CheckboxItem\n checked={isMermaidView}\n onCheckedChange={setIsMermaidView}\n className=\"flex items-center px-3 py-2 text-xs text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-accent-subtle)/0.3)] cursor-pointer transition-colors gap-2\"\n >\n <Code className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0\" />\n <span className=\"flex-1 font-normal\">Render as mermaid</span>\n <div\n className={`w-7 h-4 rounded-full transition-all duration-200 flex-shrink-0 relative ${isMermaidView ? \"bg-[rgb(var(--ec-accent))]\" : \"bg-[rgb(var(--ec-page-border))]\"}`}\n >\n <div\n className={`absolute top-0.5 w-3 h-3 rounded-full bg-white shadow-sm transition-all duration-200 ${isMermaidView ? \"left-3.5\" : \"left-0.5\"}`}\n />\n </div>\n </DropdownMenu.CheckboxItem>\n\n <DropdownMenu.Separator className=\"my-1 h-px bg-[rgb(var(--ec-page-border))]\" />\n\n <DropdownMenu.CheckboxItem\n checked={animateMessages}\n onCheckedChange={toggleAnimateMessages}\n className=\"flex items-center px-3 py-2 text-xs text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-accent-subtle)/0.3)] cursor-pointer transition-colors gap-2\"\n >\n <Zap className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0\" />\n <span className=\"flex-1 font-normal\">Simulate Messages</span>\n <div\n className={`w-7 h-4 rounded-full transition-all duration-200 flex-shrink-0 relative ${animateMessages ? \"bg-[rgb(var(--ec-accent))]\" : \"bg-[rgb(var(--ec-page-border))]\"}`}\n >\n <div\n className={`absolute top-0.5 w-3 h-3 rounded-full bg-white shadow-sm transition-all duration-200 ${animateMessages ? \"left-3.5\" : \"left-0.5\"}`}\n />\n </div>\n </DropdownMenu.CheckboxItem>\n\n {hasChannels && (\n <DropdownMenu.CheckboxItem\n checked={hideChannels}\n onCheckedChange={toggleChannelsVisibility}\n className=\"flex items-center px-3 py-2 text-xs text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-accent-subtle)/0.3)] cursor-pointer transition-colors gap-2\"\n >\n <EyeOff className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0\" />\n <span className=\"flex-1 font-normal\">Hide channels</span>\n <div\n className={`w-7 h-4 rounded-full transition-all duration-200 flex-shrink-0 relative ${hideChannels ? \"bg-[rgb(var(--ec-accent))]\" : \"bg-[rgb(var(--ec-page-border))]\"}`}\n >\n <div\n className={`absolute top-0.5 w-3 h-3 rounded-full bg-white shadow-sm transition-all duration-200 ${hideChannels ? \"left-3.5\" : \"left-0.5\"}`}\n />\n </div>\n </DropdownMenu.CheckboxItem>\n )}\n\n <DropdownMenu.CheckboxItem\n checked={showMinimap}\n onCheckedChange={setShowMinimap}\n className=\"flex items-center px-3 py-2 text-xs text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-accent-subtle)/0.3)] cursor-pointer transition-colors gap-2\"\n >\n <Map className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0\" />\n <span className=\"flex-1 font-normal\">Show minimap</span>\n <div\n className={`w-7 h-4 rounded-full transition-all duration-200 flex-shrink-0 relative ${showMinimap ? \"bg-[rgb(var(--ec-accent))]\" : \"bg-[rgb(var(--ec-page-border))]\"}`}\n >\n <div\n className={`absolute top-0.5 w-3 h-3 rounded-full bg-white shadow-sm transition-all duration-200 ${showMinimap ? \"left-3.5\" : \"left-0.5\"}`}\n />\n </div>\n </DropdownMenu.CheckboxItem>\n\n <DropdownMenu.Separator className=\"my-1 h-px bg-[rgb(var(--ec-page-border))]\" />\n\n <DropdownMenu.Item\n onClick={handleFitView}\n className=\"px-3 py-2 text-xs text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-accent-subtle)/0.3)] cursor-pointer flex items-center gap-2 transition-colors\"\n >\n <Maximize2 className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0\" />\n <span className=\"flex-1 font-normal\">Fit to view</span>\n </DropdownMenu.Item>\n\n <DropdownMenu.Item\n onClick={() => {\n searchRef.current?.hideSuggestions();\n setTimeout(() => {\n const searchInput = document.querySelector(\n 'input[placeholder=\"Search nodes...\"]',\n ) as HTMLInputElement;\n searchInput?.focus();\n }, 50);\n }}\n className=\"px-3 py-2 text-xs text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-accent-subtle)/0.3)] cursor-pointer flex items-center gap-2 transition-colors\"\n >\n <Search className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0\" />\n <span className=\"flex-1 font-normal\">Find on canvas</span>\n </DropdownMenu.Item>\n </DropdownMenu.SubContent>\n </DropdownMenu.Portal>\n </DropdownMenu.Sub>\n\n {/* Dev Mode: Layout Submenu */}\n {isDevMode && onSaveLayout && (\n <DropdownMenu.Sub>\n <DropdownMenu.SubTrigger className=\"flex items-center px-3 py-2 text-xs text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-accent-subtle)/0.3)] cursor-pointer transition-colors gap-2 outline-none\">\n <Save className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0\" />\n <span className=\"flex-1 font-normal\">Layout</span>\n <span className=\"text-[10px] text-amber-600 font-medium\">DEV</span>\n <svg\n className=\"w-3 h-3 text-[rgb(var(--ec-page-text-muted))]\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M9 5l7 7-7 7\"\n />\n </svg>\n </DropdownMenu.SubTrigger>\n <DropdownMenu.Portal>\n <DropdownMenu.SubContent\n className=\"min-w-[180px] bg-[rgb(var(--ec-card-bg))] rounded-lg shadow-xl border border-[rgb(var(--ec-page-border))] py-1.5 z-[60]\"\n sideOffset={8}\n alignOffset={-8}\n >\n <DropdownMenu.Item\n onClick={handleSaveLayout}\n disabled={layoutStatus !== \"idle\"}\n className=\"px-3 py-2 text-xs text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-accent-subtle)/0.3)] cursor-pointer flex items-center gap-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n {layoutStatus === \"saving\" ? (\n <Loader2 className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0 animate-spin\" />\n ) : (\n <Save className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0\" />\n )}\n <span className=\"flex-1 font-normal\">\n {layoutStatus === \"saving\" ? \"Saving...\" : \"Save Layout\"}\n </span>\n </DropdownMenu.Item>\n <DropdownMenu.Item\n onClick={handleResetLayout}\n disabled={layoutStatus !== \"idle\"}\n className=\"px-3 py-2 text-xs text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-accent-subtle)/0.3)] cursor-pointer flex items-center gap-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n {layoutStatus === \"resetting\" ? (\n <Loader2 className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0 animate-spin\" />\n ) : (\n <RotateCcw className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0\" />\n )}\n <span className=\"flex-1 font-normal\">\n {layoutStatus === \"resetting\"\n ? \"Resetting...\"\n : \"Reset Layout\"}\n </span>\n </DropdownMenu.Item>\n </DropdownMenu.SubContent>\n </DropdownMenu.Portal>\n </DropdownMenu.Sub>\n )}\n\n {/* Ask AI */}\n {isChatEnabled && (\n <>\n <DropdownMenu.Separator className=\"my-1 h-px bg-[rgb(var(--ec-page-border))]\" />\n <DropdownMenu.Item\n onClick={openChat}\n className=\"px-3 py-2 text-xs text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-accent-subtle)/0.3)] cursor-pointer flex items-center gap-2 transition-colors\"\n >\n <Sparkles className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0\" />\n <span className=\"flex-1 font-normal\">Ask a question</span>\n </DropdownMenu.Item>\n </>\n )}\n\n {/* Export Items */}\n <DropdownMenu.Separator className=\"my-1 h-px bg-[rgb(var(--ec-page-border))]\" />\n <DropdownMenu.Item\n onClick={handleCopyArchitectureCode}\n className=\"px-3 py-2 text-xs text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-accent-subtle)/0.3)] cursor-pointer flex items-center gap-2 transition-colors\"\n >\n <Code className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0\" />\n <span className=\"flex-1 font-normal\">Copy as mermaid</span>\n </DropdownMenu.Item>\n\n <DropdownMenu.Item\n onClick={handleExportVisual}\n className=\"px-3 py-2 text-xs text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-accent-subtle)/0.3)] cursor-pointer flex items-center gap-2 transition-colors\"\n >\n <DocumentArrowDownIcon className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0\" />\n <span className=\"flex-1 font-normal\">Export image</span>\n </DropdownMenu.Item>\n\n {/* Share Link */}\n <DropdownMenu.Item\n onClick={() => setIsShareModalOpen(true)}\n className=\"px-3 py-2 text-xs text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-accent-subtle)/0.3)] cursor-pointer flex items-center gap-2 transition-colors\"\n >\n <Share2 className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0\" />\n <span className=\"flex-1 font-normal\">Share Link</span>\n </DropdownMenu.Item>\n\n {/* Start Presentation */}\n <DropdownMenu.Separator className=\"my-1 h-px bg-[rgb(var(--ec-page-border))]\" />\n <DropdownMenu.Item\n onClick={toggleFullScreen}\n className=\"px-3 py-2 text-xs text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-accent-subtle)/0.3)] cursor-pointer flex items-center gap-2 transition-colors\"\n >\n <PresentationChartLineIcon className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0\" />\n <span className=\"flex-1 font-normal\">Start Presentation</span>\n </DropdownMenu.Item>\n\n {/* Open in EventCatalog Studio */}\n <DropdownMenu.Separator className=\"my-1 h-px bg-[rgb(var(--ec-page-border))]\" />\n <DropdownMenu.Item\n onClick={openStudioModal}\n className=\"px-3 py-2 text-xs text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-accent-subtle)/0.3)] cursor-pointer flex items-center gap-2 transition-colors\"\n >\n <ExternalLink className=\"w-3.5 h-3.5 text-[rgb(var(--ec-page-text-muted))] flex-shrink-0\" />\n <span className=\"flex-1 font-normal\">Open in EventCatalog Studio</span>\n </DropdownMenu.Item>\n </>\n );\n};\n\nexport default VisualizerDropdownContent;\n","import * as ContextMenu from \"@radix-ui/react-context-menu\";\nimport type { ContextMenuItem } from \"../types\";\n\ninterface NodeContextMenuProps {\n items: ContextMenuItem[];\n children: React.ReactNode;\n}\n\nexport default function NodeContextMenu({\n items,\n children,\n}: NodeContextMenuProps) {\n if (!items || items.length === 0) return <>{children}</>;\n\n return (\n <ContextMenu.Root>\n <ContextMenu.Trigger>{children}</ContextMenu.Trigger>\n <ContextMenu.Portal>\n <ContextMenu.Content\n className=\"min-w-[220px] bg-white rounded-md p-1 shadow-md border border-gray-200 z-50\"\n onClick={(e) => e.stopPropagation()}\n >\n {items.map((item, index) => (\n <div key={index}>\n {item.separator && index > 0 && (\n <ContextMenu.Separator className=\"h-[1px] bg-gray-200 m-1\" />\n )}\n <ContextMenu.Item\n asChild\n className=\"text-sm px-2 py-1.5 outline-none cursor-pointer hover:bg-orange-100 rounded-sm flex items-center\"\n >\n <a\n href={item.href}\n {...(item.download ? { download: item.download } : {})}\n {...(item.external\n ? { target: \"_blank\", rel: \"noopener noreferrer\" }\n : {})}\n >\n {item.label}\n </a>\n </ContextMenu.Item>\n </div>\n ))}\n </ContextMenu.Content>\n </ContextMenu.Portal>\n </ContextMenu.Root>\n );\n}\n","/**\n * Node components for EventCatalog Visualizer\n */\n\n// Studio-2 nodes (organized in directories) - import for nodeComponents\nimport { Event, eventConfig } from \"./event\";\nimport { Command } from \"./command\";\nimport { Query } from \"./query\";\nimport { Service } from \"./service\";\nimport { Channel } from \"./channel\";\nimport { Note } from \"./note\";\nimport { Data, dataNodeConfig } from \"./data\";\nimport { View } from \"./view\";\nimport { Actor, actorConfig } from \"./actor\";\nimport { ExternalSystem, externalSystemConfig } from \"./external-system\";\n\n// Re-export studio-2 nodes\nexport { Event, eventConfig };\nexport type { EventNode } from \"./event\";\n\nexport { Command };\nexport type { CommandNode } from \"./command\";\n\nexport { Query };\nexport type { QueryNode } from \"./query\";\n\nexport { Service };\nexport type { ServiceNode } from \"./service\";\n\nexport { Channel };\nexport type { ChannelNode } from \"./channel\";\n\nexport { Note };\nexport type { NoteNode } from \"./note\";\n\nexport { Data, dataNodeConfig };\nexport type { DataNode } from \"./data\";\n\nexport { View };\nexport type { ViewNode } from \"./view\";\n\nexport { Actor, actorConfig };\nexport type { ActorNode } from \"./actor\";\n\nexport { ExternalSystem, externalSystemConfig };\nexport type { ExternalSystemNode } from \"./external-system\";\n\n// Core nodes (single files) - import then re-export for nodeComponents\nimport CustomNode from \"./Custom\";\nimport DomainNode from \"./Domain\";\nimport EntityNode from \"./Entity\";\nimport FlowNode from \"./Flow\";\nimport StepNode from \"./Step\";\nimport UserNode from \"./User\";\nimport DataProductNode from \"./DataProduct\";\nimport ExternalSystem2Node from \"./ExternalSystem2\";\n\nexport {\n CustomNode,\n DomainNode,\n EntityNode,\n FlowNode,\n StepNode,\n UserNode,\n DataProductNode,\n ExternalSystem2Node,\n};\n\n// Node type constants\nexport {\n SERVICE,\n EVENT,\n QUERY,\n COMMAND,\n CHANNEL,\n ACTOR,\n MESSAGE,\n DATA,\n VIEW,\n} from \"./node-types\";\n\n// Re-export for convenience (studio-2 nodes only)\nexport const nodeComponents = {\n event: Event,\n command: Command,\n query: Query,\n service: Service,\n channel: Channel,\n note: Note,\n externalSystem: ExternalSystem,\n data: Data,\n view: View,\n actor: Actor,\n // Core nodes are available via individual imports\n custom: CustomNode,\n domain: DomainNode,\n entity: EntityNode,\n flow: FlowNode,\n step: StepNode,\n user: UserNode,\n dataProduct: DataProductNode,\n externalSystem2: ExternalSystem2Node,\n};\n\nexport const nodeConfigs = {\n event: eventConfig,\n data: dataNodeConfig,\n actor: actorConfig,\n externalSystem: externalSystemConfig,\n};\n","/**\n * Edge components for EventCatalog Visualizer\n */\n\n// Import for edgeTypes object\nimport AnimatedMessageEdge from \"./AnimatedMessageEdge\";\nimport FlowEdge from \"./FlowEdge\";\nimport MultilineEdgeLabel from \"./MultilineEdgeLabel\";\n\n// Re-export\nexport { AnimatedMessageEdge, FlowEdge, MultilineEdgeLabel };\n\n// Re-export for convenience\nexport const edgeTypes = {\n animated: AnimatedMessageEdge,\n \"flow-edge\": FlowEdge,\n multiline: MultilineEdgeLabel,\n};\n","// Can't use the CollectionEntry type from astro:content because a client component is using this util\n\nimport { MarkerType, Position, type Edge, type Node } from \"@xyflow/react\";\nimport dagre from \"dagre\";\n// import { getItemsFromCollectionByIdAndSemverOrLatest } from \"@utils/collections/util\"; // Not used in visualizer\ninterface BaseCollectionData {\n id: string;\n version: string;\n}\n\ninterface CollectionItem {\n collection: string;\n data: BaseCollectionData;\n}\n\ninterface MessageCollectionItem extends CollectionItem {\n collection: \"commands\" | \"events\" | \"queries\";\n}\n\nexport const generateIdForNode = (node: CollectionItem) => {\n return `${node.data.id}-${node.data.version}`;\n};\nexport const generateIdForNodes = (nodes: any) => {\n return nodes\n .map((node: any) => `${node.data.id}-${node.data.version}`)\n .join(\"-\");\n};\nexport const generatedIdForEdge = (\n source: CollectionItem,\n target: CollectionItem,\n) => {\n return `${source.data.id}-${source.data.version}-${target.data.id}-${target.data.version}`;\n};\n\nexport const getColorFromString = (id: string) => {\n // Takes the given id (string) and returns a custom hex color based on the id\n // Create a hash from the string\n let hash = 0;\n for (let i = 0; i < id.length; i++) {\n hash = id.charCodeAt(i) + ((hash << 5) - hash);\n }\n\n // Convert the hash into a hex color\n let color = \"#\";\n for (let i = 0; i < 3; i++) {\n const value = (hash >> (i * 8)) & 0xff;\n color += value.toString(16).padStart(2, \"0\");\n }\n\n return color;\n};\n\nexport const getEdgeLabelForServiceAsTarget = (data: MessageCollectionItem) => {\n const type = data.collection;\n switch (type) {\n case \"commands\":\n return \"invokes\";\n case \"events\":\n return \"publishes \\nevent\";\n case \"queries\":\n return \"requests\";\n default:\n return \"sends to\";\n }\n};\nexport const getEdgeLabelForMessageAsSource = (\n data: MessageCollectionItem,\n throughChannel = false,\n) => {\n const type = data.collection;\n switch (type) {\n case \"commands\":\n return \"accepts\";\n case \"events\":\n return throughChannel ? \"subscribed to\" : \"subscribed by\";\n case \"queries\":\n return \"accepts\";\n default:\n return \"sends to\";\n }\n};\n\nexport const calculatedNodes = (flow: dagre.graphlib.Graph, nodes: Node[]) => {\n return nodes.map((node: any) => {\n const { x, y } = flow.node(node.id);\n return { ...node, position: { x, y } };\n });\n};\n\n// Creates a new dagre graph\nexport const createDagreGraph = ({\n ranksep = 180,\n nodesep = 50,\n ...rest\n}: any) => {\n const graph = new dagre.graphlib.Graph({ compound: true });\n graph.setGraph({ rankdir: \"LR\", ranksep, nodesep, ...rest });\n graph.setDefaultEdgeLabel(() => ({}));\n return graph;\n};\n\nexport const createEdge = (edgeOptions: Edge): Edge => {\n return {\n label: \"subscribed by\",\n animated: false,\n // markerStart: {\n // type: MarkerType.Arrow,\n // width: 40,\n // height: 40,\n // },\n markerEnd: {\n type: MarkerType.ArrowClosed,\n width: 40,\n height: 40,\n },\n style: {\n strokeWidth: 1,\n },\n ...edgeOptions,\n };\n};\n\nexport const createNode = (values: Node): Node => {\n return {\n sourcePosition: Position.Right,\n targetPosition: Position.Left,\n ...values,\n };\n};\n\ntype DagreGraph = any;\n\nexport const getNodesAndEdgesFromDagre = ({\n nodes,\n edges,\n defaultFlow,\n}: {\n nodes: Node[];\n edges: Edge[];\n defaultFlow?: DagreGraph;\n}) => {\n const flow = defaultFlow || createDagreGraph({ ranksep: 300, nodesep: 50 });\n\n nodes.forEach((node: any) => {\n flow.setNode(node.id, { width: 150, height: 100 });\n });\n\n edges.forEach((edge: any) => {\n flow.setEdge(edge.source, edge.target);\n });\n\n // Render the diagram in memory getting hte X and Y\n dagre.layout(flow);\n\n return {\n nodes: calculatedNodes(flow, nodes),\n edges,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAA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SAAO;AAAA,IACL,OAAO;AAAA,IACP,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMV,WAAW;AAAA,MACT,MAAM,0BAAW;AAAA,MACjB,OAAO;AAAA,MACP,QAAQ;AAAA,IACV;AAAA,IACA,OAAO;AAAA,MACL,aAAa;AAAA,IACf;AAAA,IACA,GAAG;AAAA,EACL;AACF;AAEO,IAAM,aAAa,CAAC,WAAuB;AAChD,SAAO;AAAA,IACL,gBAAgB,wBAAS;AAAA,IACzB,gBAAgB,wBAAS;AAAA,IACzB,GAAG;AAAA,EACL;AACF;AAIO,IAAM,4BAA4B,CAAC;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AACF,MAIM;AACJ,QAAM,OAAO,eAAe,iBAAiB,EAAE,SAAS,KAAK,SAAS,GAAG,CAAC;AAE1E,QAAM,QAAQ,CAAC,SAAc;AAC3B,SAAK,QAAQ,KAAK,IAAI,EAAE,OAAO,KAAK,QAAQ,IAAI,CAAC;AAAA,EACnD,CAAC;AAED,QAAM,QAAQ,CAAC,SAAc;AAC3B,SAAK,QAAQ,KAAK,QAAQ,KAAK,MAAM;AAAA,EACvC,CAAC;AAGD,eAAAA,QAAM,OAAO,IAAI;AAEjB,SAAO;AAAA,IACL,OAAO,gBAAgB,MAAM,KAAK;AAAA,IAClC;AAAA,EACF;AACF;","names":["UserNode","config_default","import_react","import_lucide_react","DropdownMenu","import_lucide_react","import_react","import_jsx_runtime","classNames","import_react","import_lucide_react","import_lucide_react","import_react","import_jsx_runtime","classNames","import_lucide_react","import_react","import_jsx_runtime","classNames","import_lucide_react","import_react","import_lucide_react","import_jsx_runtime","classNames","import_lucide_react","import_react","import_jsx_runtime","classNames","import_react","import_lucide_react","config_default","import_lucide_react","import_react","import_jsx_runtime","classNames","import_lucide_react","import_react","import_jsx_runtime","classNames","import_react","import_lucide_react","config_default","import_lucide_react","import_react","import_jsx_runtime","classNames","import_react","import_lucide_react","config_default","import_react","import_jsx_runtime","classNames","import_react","import_jsx_runtime","classNames","import_react","ContextMenu","import_react","import_jsx_runtime","classNames","import_react","import_jsx_runtime","classNames","import_react","import_jsx_runtime","classNames","import_react","ContextMenu","import_react","import_jsx_runtime","ServerIcon","import_react","ContextMenu","import_jsx_runtime","classNames","UserNode","import_react","import_jsx_runtime","import_react","ContextMenu","import_react","import_lucide_react","import_jsx_runtime","classNames","import_react","import_jsx_runtime","collection","import_react","import_jsx_runtime","import_react","import_jsx_runtime","collection","import_react","import_jsx_runtime","import_react","import_jsx_runtime","title","description","import_react","import_lucide_react","import_jsx_runtime","import_react","Dialog","import_lucide_react","import_react","import_react","import_lucide_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","edgeTypes","import_jsx_runtime","edgeTypes","import_react","import_lucide_react","import_jsx_runtime","import_react","import_lucide_react","import_outline","import_jsx_runtime","ContextMenu","import_jsx_runtime","import_jsx_runtime","UserNode","edgeTypes","nodes","UserNode","config_default","import_react","dagre"]}
|