@xui/node-graph 2.0.0-alpha.11 → 2.0.0-alpha.13

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.
@@ -1 +1 @@
1
- {"version":3,"file":"xui-node-graph.mjs","sources":["../../../../../../libs/ui/node-graph/xui/src/lib/node-graph.types.ts","../../../../../../libs/ui/node-graph/xui/src/lib/node-graph-store.ts","../../../../../../libs/ui/node-graph/xui/src/lib/node-graph.token.ts","../../../../../../libs/ui/node-graph/xui/src/lib/graph-controls.ts","../../../../../../libs/ui/node-graph/xui/src/lib/graph-group.ts","../../../../../../libs/ui/node-graph/xui/src/lib/graph-minimap.ts","../../../../../../libs/ui/node-graph/xui/src/lib/graph-node.token.ts","../../../../../../libs/ui/node-graph/xui/src/lib/graph-port.ts","../../../../../../libs/ui/node-graph/xui/src/lib/graph-node.ts","../../../../../../libs/ui/node-graph/xui/src/lib/graph-node-slots.ts","../../../../../../libs/ui/node-graph/xui/src/lib/node-graph.routing.ts","../../../../../../libs/ui/node-graph/xui/src/lib/node-graph.ts","../../../../../../libs/ui/node-graph/xui/src/index.ts","../../../../../../libs/ui/node-graph/xui/src/xui-node-graph.ts"],"sourcesContent":["import type { Signal } from '@angular/core';\n\n/** A point in *graph space* — the untransformed coordinate system nodes live in. */\nexport interface XuiGraphPoint {\n x: number;\n y: number;\n}\n\n/** A size in graph space. Screen pixels only match at zoom 1. */\nexport interface XuiGraphSize {\n width: number;\n height: number;\n}\n\nexport interface XuiGraphRect extends XuiGraphPoint, XuiGraphSize {}\n\n/**\n * The pan/zoom state of the canvas. `x`/`y` are a *screen-pixel* translation\n * applied after scaling, so `screen = graph * zoom + pan`.\n */\nexport interface XuiGraphViewport extends XuiGraphPoint {\n zoom: number;\n}\n\n/**\n * Which way data flows through a port. `inout` is the bidirectional case that\n * electrical schematics need — a terminal is neither a source nor a sink, and a\n * wire may be drawn from either end.\n */\nexport type XuiGraphPortDirection = 'input' | 'output' | 'inout';\n\n/** Which edge of the node the connector sits on. Drives layout and edge routing. */\nexport type XuiGraphPortSide = 'left' | 'right' | 'top' | 'bottom';\n\n/**\n * The connector glyph. `circle` reads as a data socket (VFX/shader graphs),\n * `pin` as a component lead (schematics), and the rest are available to encode a\n * second dimension — by convention `diamond` marks an optional/nullable input.\n */\nexport type XuiGraphPortShape = 'circle' | 'square' | 'diamond' | 'triangle' | 'pin';\n\n/** How ports are arranged inside a node's body. */\nexport type XuiGraphPortLayout = 'stacked' | 'columns';\n\n/**\n * Edge geometry.\n *\n * - `bezier` — cubic curve leaving each port along its normal. The node-editor default.\n * - `orthogonal` — axis-aligned segments with sharp corners. The schematic default.\n * - `smoothstep` — orthogonal with rounded corners.\n * - `straight` — a single line.\n */\nexport type XuiGraphRouting = 'bezier' | 'orthogonal' | 'smoothstep' | 'straight';\n\n/** Decoration drawn at the target end of an edge. */\nexport type XuiGraphMarker = 'none' | 'arrow' | 'arrow-closed' | 'dot';\n\n/** The canvas backdrop. `grid` draws a minor/major rule pair, as schematic paper does. */\nexport type XuiGraphBackground = 'none' | 'dots' | 'grid';\n\n/** Addresses one connector: a port is only unique within its node. */\nexport interface XuiGraphPortRef {\n nodeId: string;\n portId: string;\n}\n\n/** A connection the user has drawn but that the model does not contain yet. */\nexport interface XuiGraphConnection {\n source: XuiGraphPortRef;\n target: XuiGraphPortRef;\n}\n\n/**\n * A wire between two ports. Purely declarative and serialisable — geometry is\n * derived from the live position of the two ports, never stored here.\n */\nexport interface XuiGraphEdge {\n id: string;\n\n /** Where the wire starts. For `inout` ports this is simply the end drawn first. */\n source: XuiGraphPortRef;\n target: XuiGraphPortRef;\n\n /** Overrides the routing the graph is configured with, per edge. */\n routing?: XuiGraphRouting;\n\n /** Overrides the colour inherited from the source port's data type. */\n color?: string;\n\n /** Text rendered at the midpoint of the wire. */\n label?: string;\n\n /** Marching-ants animation, for showing that data or current is flowing. */\n animated?: boolean;\n\n dashed?: boolean;\n\n /** Stroke width in graph units. Defaults to the graph's `edgeWidth`. */\n width?: number;\n\n marker?: XuiGraphMarker;\n\n /** Arbitrary payload carried through selection and click events. */\n data?: unknown;\n}\n\n/**\n * A flattened, framework-free view of a port, handed to\n * {@link XuiGraphConnectionValidator} so validation logic never touches\n * component instances.\n */\nexport interface XuiGraphPortDescriptor extends XuiGraphPortRef {\n direction: XuiGraphPortDirection;\n side: XuiGraphPortSide;\n dataType: string | undefined;\n maxConnections: number;\n disabled: boolean;\n\n /** How many edges already terminate here. */\n connections: number;\n}\n\n/** The two ends of a proposed connection, resolved against the live port registry. */\nexport interface XuiGraphConnectionContext {\n source: XuiGraphPortDescriptor;\n target: XuiGraphPortDescriptor;\n edges: readonly XuiGraphEdge[];\n}\n\n/**\n * Returns whether a connection may be made. Runs *after* the built-in rules\n * (direction, arity, duplicates, data type), so it can only narrow them.\n */\nexport type XuiGraphConnectionValidator = (\n connection: XuiGraphConnection,\n context: XuiGraphConnectionContext\n) => boolean;\n\n/** Emitted when a wire is dropped on empty canvas, for \"drag out to create a node\". */\nexport interface XuiGraphConnectionDrop {\n source: XuiGraphPortRef;\n\n /**\n * The port the wire came from, described in full so a create menu can filter\n * itself to what would actually connect without looking the port up again.\n */\n port: XuiGraphPortDescriptor;\n\n /** Where the pointer was released, in graph space — where a new node belongs. */\n position: XuiGraphPoint;\n\n /**\n * The same release point relative to the canvas element's top-left corner, so\n * a popup can be placed without converting through the viewport.\n */\n surfacePosition: XuiGraphPoint;\n}\n\n/** One node's resting place after a drag. */\nexport interface XuiGraphNodeMoved {\n nodeId: string;\n position: XuiGraphPoint;\n\n /**\n * Innermost group frame the node's centre now sits inside, ignoring the nodes\n * that moved with it — the hook for \"drag a node into a frame to join it\".\n *\n * `undefined` when it came to rest outside every frame, and always `undefined`\n * for a group drag, where no node changed hands.\n */\n group: string | undefined;\n}\n\n/** Emitted whenever a drag settles, with the final position of every moved node. */\nexport interface XuiGraphNodeMove {\n /** Whether the gesture started on a node (or node selection) or on a group frame. */\n source: 'node' | 'group';\n nodes: readonly XuiGraphNodeMoved[];\n}\n\n/**\n * The contract {@link XuiGraphNode} fulfils for the store.\n *\n * Declared here rather than imported from the component so that the store, the\n * routing helpers and the node itself do not form an import cycle.\n *\n * @internal\n */\nexport interface XuiGraphNodeHandle {\n readonly nodeId: Signal<string>;\n readonly position: Signal<XuiGraphPoint>;\n readonly size: Signal<XuiGraphSize>;\n readonly locked: Signal<boolean>;\n\n /** Id of the group frame this node belongs to, if any. */\n readonly group: Signal<string | undefined>;\n\n readonly element: HTMLElement;\n moveTo(point: XuiGraphPoint): void;\n}\n\n/**\n * The contract {@link XuiGraphGroup} fulfils for the store.\n *\n * A group owns no geometry of its own — it is sized from its members — so the\n * store keeps only the knobs it needs in order to compute that box itself.\n *\n * @internal\n */\nexport interface XuiGraphGroupHandle {\n readonly groupId: Signal<string>;\n\n /** Blank margin between the members' bounding box and the frame, in graph units. */\n readonly padding: Signal<number>;\n\n /** Extra room reserved above the members for the frame's title bar. */\n readonly headerHeight: Signal<number>;\n\n readonly locked: Signal<boolean>;\n}\n\n/**\n * The contract {@link XuiGraphPort} fulfils for the store.\n *\n * @internal\n */\nexport interface XuiGraphPortHandle {\n readonly key: string;\n readonly nodeId: Signal<string>;\n readonly portId: Signal<string>;\n readonly direction: Signal<XuiGraphPortDirection>;\n readonly resolvedSide: Signal<XuiGraphPortSide>;\n readonly dataType: Signal<string | undefined>;\n readonly resolvedMaxConnections: Signal<number>;\n readonly disabled: Signal<boolean>;\n readonly resolvedColor: Signal<string>;\n\n /** Connector centre relative to the owning node's top-left corner, in graph units. */\n readonly offset: Signal<XuiGraphPoint>;\n}\n\n/**\n * Composite key for the port registry. A port id is only unique within its node.\n *\n * Length-prefixed so the pair can never be ambiguous: a node called `a` with a\n * port called `b:c` and a node called `a:b` with a port called `c` must not\n * collide, which any plain separator would allow.\n */\nexport function xuiGraphPortKey(nodeId: string, portId: string): string {\n return `${nodeId.length}:${nodeId}:${portId}`;\n}\n","import { computed, inject, Injectable, signal, untracked, type Signal, type WritableSignal } from '@angular/core';\nimport type { XuiGraphPortType } from './node-graph.token';\nimport type {\n XuiGraphConnection,\n XuiGraphConnectionDrop,\n XuiGraphConnectionValidator,\n XuiGraphEdge,\n XuiGraphGroupHandle,\n XuiGraphNodeHandle,\n XuiGraphNodeMove,\n XuiGraphPoint,\n XuiGraphPortDescriptor,\n XuiGraphPortHandle,\n XuiGraphPortRef,\n XuiGraphPortShape,\n XuiGraphRect,\n XuiGraphRouting,\n XuiGraphViewport\n} from './node-graph.types';\nimport { xuiGraphPortKey } from './node-graph.types';\n\n/**\n * The subset of the graph's inputs that the store, the nodes and the ports all\n * need to see. Owned by {@link XuiNodeGraph}, which hands the store a signal of\n * it rather than pushing values in from an effect.\n *\n * @internal\n */\nexport interface XuiGraphSettings {\n routing: XuiGraphRouting;\n gridSize: number;\n snapToGrid: boolean;\n minZoom: number;\n maxZoom: number;\n stubLength: number;\n cornerRadius: number;\n curvature: number;\n edgeWidth: number;\n portSize: number;\n portShape: XuiGraphPortShape;\n portColor: string;\n portTypes: Record<string, XuiGraphPortType>;\n allowSelfConnection: boolean;\n enforcePortTypes: boolean;\n isValidConnection: XuiGraphConnectionValidator | undefined;\n locked: boolean;\n}\n\n/** A wire being dragged out of a port. @internal */\nexport interface XuiGraphLinking {\n /** The port the drag started at — not necessarily the source end. */\n from: XuiGraphPortRef;\n fromKey: string;\n\n /**\n * `true` when the drag began at an input, so the fixed end is the *target* of\n * the connection that will be produced. Dragging backwards off an input is how\n * every node editor lets you re-route an existing wire.\n */\n reversed: boolean;\n\n /** Live pointer position in graph space. */\n pointer: XuiGraphPoint;\n\n /** Key of the port under the pointer, if it is a legal landing spot. */\n hoverKey: string | null;\n}\n\n/** A drag in flight, with the group frames frozen as they stood when it began. @internal */\nexport interface XuiGraphDragState {\n source: 'node' | 'group';\n\n /** Ids of the nodes actually moving — locked ones are left out. */\n ids: ReadonlySet<string>;\n frames: ReadonlyMap<string, XuiGraphRect>;\n}\n\n/** How a port should render while a wire is being dragged. */\nexport type XuiGraphPortLinkState = 'idle' | 'source' | 'valid' | 'invalid';\n\n/** Callbacks {@link XuiNodeGraph} registers so the store can raise its outputs. @internal */\nexport interface XuiGraphStoreListeners {\n connect(connection: XuiGraphConnection): void;\n connectionDrop(drop: XuiGraphConnectionDrop): void;\n nodeMove(move: XuiGraphNodeMove): void;\n selectionChange(): void;\n}\n\n/**\n * Reactive state shared by a graph and everything inside it.\n *\n * Provided by {@link XuiNodeGraph}, so every node, port and edge in one canvas\n * sees the same instance and two graphs on a page never interfere.\n */\n@Injectable()\nexport class XuiNodeGraphStore {\n private settingsSource: Signal<XuiGraphSettings> | null = null;\n private listeners: XuiGraphStoreListeners | null = null;\n private surface: HTMLElement | null = null;\n\n /** Node top-left positions captured at the start of a drag, keyed by node id. */\n private dragOrigins = new Map<string, XuiGraphPoint>();\n private dragMoved = false;\n\n /**\n * The drag in flight, including every group frame as it stood when the drag\n * began. Reactive, because those frozen frames are what the groups *render*\n * while a node is being dragged, not merely what the drop is judged against.\n *\n * Both uses come from the same problem: a frame is sized from its members, so\n * a live frame stretches to follow the very node being dragged out of it and\n * then snaps back on release. Pinning the frame for the duration makes the\n * node visibly leave a box that stays put — and makes the box you can see the\n * box that decides where the node lands.\n */\n private readonly drag = signal<XuiGraphDragState | null>(null);\n\n /**\n * The graph binds its own `viewport` model and `edges` input here, so those\n * stay the single source of truth and the store never has to mirror them\n * through an effect that could fight the host for ownership.\n */\n private viewportSource: WritableSignal<XuiGraphViewport> | null = null;\n private edgesSource: Signal<readonly XuiGraphEdge[]> | null = null;\n private readonly ownViewport = signal<XuiGraphViewport>({ x: 0, y: 0, zoom: 1 });\n\n readonly viewport: Signal<XuiGraphViewport> = computed(() => (this.viewportSource ?? this.ownViewport)());\n readonly edges: Signal<readonly XuiGraphEdge[]> = computed(() => this.edgesSource?.() ?? EMPTY_EDGES);\n readonly selectedNodes = signal<ReadonlySet<string>>(new Set());\n readonly selectedEdges = signal<ReadonlySet<string>>(new Set());\n readonly linking = signal<XuiGraphLinking | null>(null);\n\n /** Size of the visible canvas in screen pixels; kept current by a ResizeObserver. */\n readonly surfaceSize = signal({ width: 0, height: 0 });\n\n private readonly nodeMap = signal<ReadonlyMap<string, XuiGraphNodeHandle>>(new Map());\n private readonly portMap = signal<ReadonlyMap<string, XuiGraphPortHandle>>(new Map());\n private readonly groupMap = signal<ReadonlyMap<string, XuiGraphGroupHandle>>(new Map());\n\n readonly nodes = computed(() => [...this.nodeMap().values()]);\n readonly ports = computed(() => [...this.portMap().values()]);\n readonly groups = computed(() => [...this.groupMap().values()]);\n\n readonly settings = computed<XuiGraphSettings>(() => this.settingsSource?.() ?? FALLBACK_SETTINGS);\n\n /** How many edges terminate at each port, keyed the same way as the registry. */\n private readonly connectionCounts = computed(() => {\n const counts = new Map<string, number>();\n\n for (const edge of this.edges()) {\n for (const ref of [edge.source, edge.target]) {\n const key = xuiGraphPortKey(ref.nodeId, ref.portId);\n counts.set(key, (counts.get(key) ?? 0) + 1);\n }\n }\n\n return counts;\n });\n\n /**\n * Wire the store to the graph that provides it. Called from the graph's\n * constructor, before anything can read the bound signals.\n *\n * @internal\n */\n configure(bindings: {\n settings: Signal<XuiGraphSettings>;\n viewport: WritableSignal<XuiGraphViewport>;\n edges: Signal<readonly XuiGraphEdge[]>;\n listeners: XuiGraphStoreListeners;\n }): void {\n this.settingsSource = bindings.settings;\n this.viewportSource = bindings.viewport;\n this.edgesSource = bindings.edges;\n this.listeners = bindings.listeners;\n }\n\n /** Writes through to whichever signal is bound as the viewport. */\n private updateViewport(next: (current: XuiGraphViewport) => XuiGraphViewport): void {\n const target = this.viewportSource ?? this.ownViewport;\n\n target.set(next(untracked(target)));\n }\n\n /** @internal */\n setSurface(element: HTMLElement): void {\n this.surface = element;\n }\n\n // ------------------------------------------------------------------ registry\n\n /** @internal */\n registerNode(node: XuiGraphNodeHandle): void {\n this.nodeMap.update(map => new Map(map).set(node.nodeId(), node));\n }\n\n /** @internal */\n unregisterNode(node: XuiGraphNodeHandle): void {\n this.nodeMap.update(map => {\n const next = new Map(map);\n\n // Guard against a re-registered id: a node that has already been replaced\n // by another instance must not be deleted by its predecessor's teardown.\n if (next.get(node.nodeId()) === node) {\n next.delete(node.nodeId());\n }\n\n return next;\n });\n }\n\n /** @internal */\n registerPort(port: XuiGraphPortHandle): void {\n this.portMap.update(map => new Map(map).set(port.key, port));\n }\n\n /** @internal */\n unregisterPort(port: XuiGraphPortHandle): void {\n this.portMap.update(map => {\n const next = new Map(map);\n\n if (next.get(port.key) === port) {\n next.delete(port.key);\n }\n\n return next;\n });\n }\n\n /** @internal */\n registerGroup(group: XuiGraphGroupHandle): void {\n this.groupMap.update(map => new Map(map).set(group.groupId(), group));\n }\n\n /** @internal */\n unregisterGroup(group: XuiGraphGroupHandle): void {\n this.groupMap.update(map => {\n const next = new Map(map);\n\n if (next.get(group.groupId()) === group) {\n next.delete(group.groupId());\n }\n\n return next;\n });\n }\n\n node(nodeId: string): XuiGraphNodeHandle | undefined {\n return this.nodeMap().get(nodeId);\n }\n\n port(key: string): XuiGraphPortHandle | undefined {\n return this.portMap().get(key);\n }\n\n /**\n * Absolute position of a connector in graph space.\n *\n * Composed from the node's position and the port's node-relative offset rather\n * than measured directly, so dragging a node re-routes its wires from a single\n * signal write with no DOM reads.\n */\n portPoint(key: string): XuiGraphPoint | null {\n const port = this.portMap().get(key);\n const node = port && this.nodeMap().get(port.nodeId());\n\n if (!port || !node) {\n return null;\n }\n\n const position = node.position();\n const offset = port.offset();\n\n return { x: position.x + offset.x, y: position.y + offset.y };\n }\n\n descriptor(key: string): XuiGraphPortDescriptor | null {\n const port = this.portMap().get(key);\n\n if (!port) {\n return null;\n }\n\n return {\n nodeId: port.nodeId(),\n portId: port.portId(),\n direction: port.direction(),\n side: port.resolvedSide(),\n dataType: port.dataType(),\n maxConnections: port.resolvedMaxConnections(),\n disabled: port.disabled(),\n connections: this.connectionCounts().get(key) ?? 0\n };\n }\n\n connectionCount(key: string): number {\n return this.connectionCounts().get(key) ?? 0;\n }\n\n // --------------------------------------------------------------- coordinates\n\n /** Client (viewport) coordinates to graph space. */\n toGraphPoint(clientX: number, clientY: number): XuiGraphPoint {\n const rect = this.surface?.getBoundingClientRect();\n const { x, y, zoom } = this.viewport();\n\n return {\n x: (clientX - (rect?.left ?? 0) - x) / zoom,\n y: (clientY - (rect?.top ?? 0) - y) / zoom\n };\n }\n\n /** Graph space to coordinates relative to the canvas element's top-left corner. */\n toSurfacePoint(point: XuiGraphPoint): XuiGraphPoint {\n const { x, y, zoom } = this.viewport();\n\n return { x: point.x * zoom + x, y: point.y * zoom + y };\n }\n\n /** Rounds to the nearest grid intersection when snapping is on. */\n snap(point: XuiGraphPoint): XuiGraphPoint {\n const { snapToGrid, gridSize } = this.settings();\n\n if (!snapToGrid || gridSize <= 0) {\n return point;\n }\n\n return { x: Math.round(point.x / gridSize) * gridSize, y: Math.round(point.y / gridSize) * gridSize };\n }\n\n // ------------------------------------------------------------------ viewport\n\n panBy(dx: number, dy: number): void {\n this.updateViewport(v => ({ ...v, x: v.x + dx, y: v.y + dy }));\n }\n\n /**\n * Scale about a fixed point, given in surface coordinates.\n *\n * Holding that point still is what makes wheel-zoom feel anchored to the\n * cursor instead of to the centre of the canvas.\n */\n zoomTo(zoom: number, anchor?: XuiGraphPoint): void {\n const { minZoom, maxZoom } = this.settings();\n\n this.updateViewport(v => {\n const next = Math.min(maxZoom, Math.max(minZoom, zoom));\n const size = this.surfaceSize();\n const point = anchor ?? { x: size.width / 2, y: size.height / 2 };\n const ratio = next / v.zoom;\n\n return { zoom: next, x: point.x - (point.x - v.x) * ratio, y: point.y - (point.y - v.y) * ratio };\n });\n }\n\n zoomBy(factor: number, anchor?: XuiGraphPoint): void {\n this.zoomTo(this.viewport().zoom * factor, anchor);\n }\n\n /** Bounding box of every node, or `null` while the graph is empty. */\n contentBounds(): XuiGraphRect | null {\n const nodes = this.nodes();\n\n if (nodes.length === 0) {\n return null;\n }\n\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n\n for (const node of nodes) {\n const { x, y } = node.position();\n const { width, height } = node.size();\n\n minX = Math.min(minX, x);\n minY = Math.min(minY, y);\n maxX = Math.max(maxX, x + width);\n maxY = Math.max(maxY, y + height);\n }\n\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };\n }\n\n /** Frame every node, leaving `padding` screen pixels of margin. */\n fitView(padding = 40): void {\n const bounds = this.contentBounds();\n const { width, height } = this.surfaceSize();\n\n if (!bounds || width === 0 || height === 0) {\n return;\n }\n\n const { minZoom, maxZoom } = this.settings();\n const scale = Math.min(\n (width - padding * 2) / Math.max(bounds.width, 1),\n (height - padding * 2) / Math.max(bounds.height, 1)\n );\n const zoom = Math.min(maxZoom, Math.max(minZoom, scale));\n\n this.updateViewport(() => ({\n zoom,\n x: width / 2 - (bounds.x + bounds.width / 2) * zoom,\n y: height / 2 - (bounds.y + bounds.height / 2) * zoom\n }));\n }\n\n /** Centre the viewport on a node without changing the zoom. */\n centerOn(nodeId: string): void {\n const node = this.nodeMap().get(nodeId);\n const { width, height } = this.surfaceSize();\n\n if (!node) {\n return;\n }\n\n const position = node.position();\n const size = node.size();\n\n this.updateViewport(v => ({\n ...v,\n x: width / 2 - (position.x + size.width / 2) * v.zoom,\n y: height / 2 - (position.y + size.height / 2) * v.zoom\n }));\n }\n\n // ----------------------------------------------------------------- selection\n\n isNodeSelected(nodeId: string): boolean {\n return this.selectedNodes().has(nodeId);\n }\n\n isEdgeSelected(edgeId: string): boolean {\n return this.selectedEdges().has(edgeId);\n }\n\n selectNode(nodeId: string, additive = false): void {\n this.selectedNodes.update(current => {\n if (!additive) {\n return current.size === 1 && current.has(nodeId) ? current : new Set([nodeId]);\n }\n\n const next = new Set(current);\n next.has(nodeId) ? next.delete(nodeId) : next.add(nodeId);\n\n return next;\n });\n\n if (!additive) {\n this.selectedEdges.set(new Set());\n }\n\n this.listeners?.selectionChange();\n }\n\n selectEdge(edgeId: string, additive = false): void {\n this.selectedEdges.update(current => {\n if (!additive) {\n return current.size === 1 && current.has(edgeId) ? current : new Set([edgeId]);\n }\n\n const next = new Set(current);\n next.has(edgeId) ? next.delete(edgeId) : next.add(edgeId);\n\n return next;\n });\n\n if (!additive) {\n this.selectedNodes.set(new Set());\n }\n\n this.listeners?.selectionChange();\n }\n\n setSelection(nodeIds: Iterable<string>, edgeIds: Iterable<string> = []): void {\n this.selectedNodes.set(new Set(nodeIds));\n this.selectedEdges.set(new Set(edgeIds));\n this.listeners?.selectionChange();\n }\n\n clearSelection(): void {\n if (this.selectedNodes().size === 0 && this.selectedEdges().size === 0) {\n return;\n }\n\n this.selectedNodes.set(new Set());\n this.selectedEdges.set(new Set());\n this.listeners?.selectionChange();\n }\n\n selectAll(): void {\n this.setSelection(\n this.nodes().map(node => node.nodeId()),\n this.edges().map(edge => edge.id)\n );\n }\n\n /** Select every node whose box intersects `rect`, in graph space. */\n selectInRect(rect: XuiGraphRect, additive = false): void {\n const hits = this.nodes()\n .filter(node => {\n const position = node.position();\n const size = node.size();\n\n return (\n position.x < rect.x + rect.width &&\n position.x + size.width > rect.x &&\n position.y < rect.y + rect.height &&\n position.y + size.height > rect.y\n );\n })\n .map(node => node.nodeId());\n\n this.setSelection(additive ? [...this.selectedNodes(), ...hits] : hits, additive ? this.selectedEdges() : []);\n }\n\n // -------------------------------------------------------------------- groups\n\n /** The nodes that declare themselves members of a group, in registration order. */\n nodesInGroup(groupId: string): XuiGraphNodeHandle[] {\n return this.nodes().filter(node => node.group() === groupId);\n }\n\n /**\n * The frame a group draws: its members' bounding box, grown by the group's own\n * padding and title bar. A group owns no geometry, so an empty one has no box\n * at all and renders nothing.\n *\n */\n groupBounds(groupId: string): XuiGraphRect | null {\n const group = this.groupMap().get(groupId);\n const members = this.nodesInGroup(groupId);\n\n if (!group || members.length === 0) {\n return null;\n }\n\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n\n for (const node of members) {\n const { x, y } = node.position();\n const { width, height } = node.size();\n\n minX = Math.min(minX, x);\n minY = Math.min(minY, y);\n maxX = Math.max(maxX, x + width);\n maxY = Math.max(maxY, y + height);\n }\n\n const padding = group.padding();\n const header = group.headerHeight();\n\n return {\n x: minX - padding,\n y: minY - padding - header,\n width: maxX - minX + padding * 2,\n height: maxY - minY + padding * 2 + header\n };\n }\n\n /**\n * The box a frame should be drawn at right now: its live bounds, except while a\n * node drag is in flight, when it is pinned to where it stood as that drag\n * began. A group being dragged is never pinned — it has to travel with the\n * members it is carrying.\n */\n groupFrame(groupId: string): XuiGraphRect | null {\n const drag = this.drag();\n\n if (drag?.source === 'node') {\n return drag.frames.get(groupId) ?? this.groupBounds(groupId);\n }\n\n return this.groupBounds(groupId);\n }\n\n /**\n * Frames that would take one of the nodes being dragged if it were released\n * now. Groups render this as a highlight, so which frame is about to claim the\n * node is visible before the button comes up rather than after.\n */\n readonly dropTargetGroups = computed<ReadonlySet<string>>(() => {\n const drag = this.drag();\n\n if (!drag || drag.source === 'group') {\n return EMPTY_IDS;\n }\n\n const frames = [...drag.frames];\n const targets = new Set<string>();\n\n for (const id of drag.ids) {\n const node = this.nodeMap().get(id);\n\n if (!node) {\n continue;\n }\n\n const position = node.position();\n const size = node.size();\n const hit = smallestContaining({ x: position.x + size.width / 2, y: position.y + size.height / 2 }, frames);\n\n if (hit) {\n targets.add(hit);\n }\n }\n\n return targets;\n });\n\n /**\n * Innermost group frame containing a point. Smallest-first, so a frame nested\n * inside another wins the node that lands in the overlap.\n */\n groupAt(point: XuiGraphPoint): string | undefined {\n const frames = this.groups()\n .map(group => [group.groupId(), this.groupBounds(group.groupId())] as const)\n .filter((entry): entry is readonly [string, XuiGraphRect] => !!entry[1]);\n\n return smallestContaining(point, frames);\n }\n\n // ------------------------------------------------------------------ dragging\n\n /**\n * Capture the starting position of everything a drag will move.\n *\n * Deltas are applied to these captured origins rather than accumulated onto\n * live positions, so snapping cannot compound rounding error over a long drag.\n */\n beginNodeDrag(nodeId: string): void {\n const selected = this.selectedNodes();\n\n this.captureDrag(selected.has(nodeId) ? selected : [nodeId], 'node');\n }\n\n /**\n * Drag a whole group: every member moves together, and the frame follows them\n * because it is sized from where they are.\n *\n * @internal\n */\n beginGroupDrag(groupId: string): void {\n this.captureDrag(\n this.nodesInGroup(groupId).map(node => node.nodeId()),\n 'group'\n );\n }\n\n private captureDrag(ids: Iterable<string>, source: 'node' | 'group'): void {\n const frames = new Map<string, XuiGraphRect>();\n\n this.dragOrigins = new Map();\n this.dragMoved = false;\n\n for (const group of this.groups()) {\n const bounds = this.groupBounds(group.groupId());\n\n if (bounds) {\n frames.set(group.groupId(), bounds);\n }\n }\n\n for (const id of ids) {\n const node = this.nodeMap().get(id);\n\n if (node && !node.locked()) {\n this.dragOrigins.set(id, node.position());\n }\n }\n\n this.drag.set({ source, ids: new Set(this.dragOrigins.keys()), frames });\n }\n\n /** Offset every dragged node from its captured origin, in graph units. */\n dragNodesBy(delta: XuiGraphPoint): void {\n if (delta.x !== 0 || delta.y !== 0) {\n this.dragMoved = true;\n }\n\n for (const [id, origin] of this.dragOrigins) {\n this.nodeMap()\n .get(id)\n ?.moveTo(this.snap({ x: origin.x + delta.x, y: origin.y + delta.y }));\n }\n }\n\n /** Ends the drag and raises `nodeMove`. Returns whether anything actually moved. */\n endNodeDrag(): boolean {\n const moved = this.dragMoved;\n const drag = this.drag();\n const source = drag?.source ?? 'node';\n\n if (moved) {\n const nodes = [...this.dragOrigins.keys()]\n .map(id => this.nodeMap().get(id))\n .filter((node): node is XuiGraphNodeHandle => !!node)\n .map(node => {\n const position = node.position();\n const size = node.size();\n // The centre, not the corner: a node half over a frame's edge reads as\n // being wherever the bulk of it sits.\n const centre = { x: position.x + size.width / 2, y: position.y + size.height / 2 };\n\n return {\n nodeId: node.nodeId(),\n position,\n // A group drag carries its own members around; none of them can have\n // changed hands, so there is nothing to report.\n group: source === 'group' || !drag ? undefined : smallestContaining(centre, drag.frames)\n };\n });\n\n this.listeners?.nodeMove({ source, nodes });\n }\n\n this.dragOrigins = new Map();\n this.dragMoved = false;\n this.drag.set(null);\n\n return moved;\n }\n\n // ------------------------------------------------------------------- linking\n\n /** @internal */\n beginLink(port: XuiGraphPortHandle, pointer: XuiGraphPoint): void {\n this.linking.set({\n from: { nodeId: port.nodeId(), portId: port.portId() },\n fromKey: port.key,\n reversed: port.direction() === 'input',\n pointer,\n hoverKey: null\n });\n }\n\n /** @internal */\n moveLink(pointer: XuiGraphPoint): void {\n this.linking.update(state => (state ? { ...state, pointer } : null));\n }\n\n /** @internal */\n setLinkHover(key: string | null): void {\n this.linking.update(state => (state ? { ...state, hoverKey: key } : null));\n }\n\n /**\n * Finish a link. Dropping on a legal port raises `connect`; dropping anywhere\n * else raises `connectionDrop` so the host can offer to create a node there.\n *\n * @internal\n */\n endLink(dropKey: string | null): void {\n const state = this.linking();\n this.linking.set(null);\n\n if (!state) {\n return;\n }\n\n const connection = dropKey && this.orient(state, dropKey);\n\n if (connection && this.canConnect(connection)) {\n this.listeners?.connect(connection);\n return;\n }\n\n if (!dropKey) {\n const port = this.descriptor(state.fromKey);\n\n if (port) {\n this.listeners?.connectionDrop({\n source: state.from,\n port,\n position: state.pointer,\n surfacePosition: this.toSurfacePoint(state.pointer)\n });\n }\n }\n }\n\n /** Resolve which end of a dragged wire is the source. */\n private orient(state: XuiGraphLinking, dropKey: string): XuiGraphConnection | null {\n const dropped = this.portMap().get(dropKey);\n\n if (!dropped) {\n return null;\n }\n\n const droppedRef = { nodeId: dropped.nodeId(), portId: dropped.portId() };\n\n return state.reversed ? { source: droppedRef, target: state.from } : { source: state.from, target: droppedRef };\n }\n\n /**\n * How a port should render while a wire is in flight — the affordance that\n * tells you where a wire may land before you release it.\n */\n linkState(key: string): XuiGraphPortLinkState {\n const state = this.linking();\n\n if (!state) {\n return 'idle';\n }\n\n if (state.fromKey === key) {\n return 'source';\n }\n\n const connection = this.orient(state, key);\n\n return connection && this.canConnect(connection) ? 'valid' : 'invalid';\n }\n\n /**\n * The full connection rule set: existence, arity, direction, duplicates and\n * data type, then the host's own validator, which can only narrow the result.\n */\n canConnect(connection: XuiGraphConnection): boolean {\n const settings = this.settings();\n\n if (settings.locked) {\n return false;\n }\n\n const sourceKey = xuiGraphPortKey(connection.source.nodeId, connection.source.portId);\n const targetKey = xuiGraphPortKey(connection.target.nodeId, connection.target.portId);\n\n if (sourceKey === targetKey) {\n return false;\n }\n\n const source = this.descriptor(sourceKey);\n const target = this.descriptor(targetKey);\n\n if (!source || !target || source.disabled || target.disabled) {\n return false;\n }\n\n if (!settings.allowSelfConnection && source.nodeId === target.nodeId) {\n return false;\n }\n\n // An `inout` port plays either role; a plain input can never be a source.\n if (source.direction === 'input' || target.direction === 'output') {\n return false;\n }\n\n if (source.connections >= source.maxConnections || target.connections >= target.maxConnections) {\n return false;\n }\n\n const edges = this.edges();\n const duplicate = edges.some(\n edge => samePort(edge.source, connection.source) && samePort(edge.target, connection.target)\n );\n\n if (duplicate) {\n return false;\n }\n\n // An undeclared type is a wildcard, so untyped graphs need no configuration.\n if (settings.enforcePortTypes && source.dataType && target.dataType && source.dataType !== target.dataType) {\n return false;\n }\n\n return settings.isValidConnection?.(connection, { source, target, edges }) ?? true;\n }\n}\n\n/**\n * The smallest of the frames containing a point, so a frame nested inside\n * another wins the node that lands in the overlap.\n */\nfunction smallestContaining(\n point: XuiGraphPoint,\n frames: Iterable<readonly [string, XuiGraphRect]>\n): string | undefined {\n let best: string | undefined;\n let bestArea = Infinity;\n\n for (const [id, bounds] of frames) {\n const inside =\n point.x >= bounds.x &&\n point.x <= bounds.x + bounds.width &&\n point.y >= bounds.y &&\n point.y <= bounds.y + bounds.height;\n const area = bounds.width * bounds.height;\n\n if (inside && area < bestArea) {\n bestArea = area;\n best = id;\n }\n }\n\n return best;\n}\n\n/** Shared so the `edges` computed keeps a stable identity while unbound. */\nconst EMPTY_EDGES: readonly XuiGraphEdge[] = [];\nconst EMPTY_IDS: ReadonlySet<string> = new Set();\n\nfunction samePort(a: XuiGraphPortRef, b: XuiGraphPortRef): boolean {\n return a.nodeId === b.nodeId && a.portId === b.portId;\n}\n\n/** Used only if a node or port is somehow instantiated outside a graph. @internal */\nconst FALLBACK_SETTINGS: XuiGraphSettings = {\n routing: 'bezier',\n gridSize: 16,\n snapToGrid: false,\n minZoom: 0.15,\n maxZoom: 4,\n stubLength: 18,\n cornerRadius: 8,\n curvature: 0.5,\n edgeWidth: 2,\n portSize: 11,\n portShape: 'circle',\n portColor: 'var(--color-foreground-subtle)',\n portTypes: {},\n allowSelfConnection: false,\n enforcePortTypes: true,\n isValidConnection: undefined,\n locked: false\n};\n\n/**\n * The store for the enclosing `<xui-node-graph>`.\n *\n * Use it to drive the canvas from outside — `fitView()`, `zoomBy()`,\n * `setSelection()` — from a toolbar or a host component.\n */\nexport function injectXuiNodeGraphStore(): XuiNodeGraphStore {\n return inject(XuiNodeGraphStore);\n}\n","import { inject, InjectionToken, ValueProvider } from '@angular/core';\nimport type { XuiGraphBackground, XuiGraphMarker, XuiGraphPortShape, XuiGraphRouting } from './node-graph.types';\n\n/**\n * Presentation attached to a port *data type* — the string that decides which\n * ports may legally be wired together.\n *\n * Colouring by data type rather than by port is the whole point: in a shader or\n * VFX graph the colour is how you read compatibility at a glance, so it must be\n * declared once per type and not repeated at every call site.\n */\nexport interface XuiGraphPortType {\n /** Any CSS colour. Prefer a theme token so it follows light/dark. */\n color: string;\n\n /** Connector glyph for ports of this type. Falls back to the graph default. */\n shape?: XuiGraphPortShape;\n\n /** Human-readable name, used for the connector's tooltip. */\n label?: string;\n}\n\n/**\n * Application-wide defaults for the node graph.\n *\n * Provide it once at the app root to give every graph the same wiring style;\n * individual inputs still override the configured value.\n */\nexport interface XuiNodeGraphConfig {\n routing: XuiGraphRouting;\n background: XuiGraphBackground;\n marker: XuiGraphMarker;\n\n /** Spacing of the background rule and of `snapToGrid`, in graph units. */\n gridSize: number;\n\n /** How many minor cells make one emphasised major cell in the `grid` backdrop. */\n gridMajorEvery: number;\n\n snapToGrid: boolean;\n\n minZoom: number;\n maxZoom: number;\n\n /** Multiplier applied per zoom step, both for the wheel and the zoom buttons. */\n zoomStep: number;\n\n /** Straight run out of a port before an orthogonal wire may turn. */\n stubLength: number;\n\n /** Corner rounding for `smoothstep` routing. */\n cornerRadius: number;\n\n /** Bezier slack, as a fraction of the port separation. */\n curvature: number;\n\n edgeWidth: number;\n\n /** Connector diameter in graph units. */\n portSize: number;\n\n portShape: XuiGraphPortShape;\n\n /** Colour for a port that declares no data type, and for edges leaving one. */\n portColor: string;\n\n /** Data-type registry. Keys are matched against a port's `dataType`. */\n portTypes: Record<string, XuiGraphPortType>;\n\n /** Whether a wire may start and end on the same node. */\n allowSelfConnection: boolean;\n\n /**\n * Require both ends of a wire to declare the same `dataType`. A port with no\n * declared type is a wildcard and always passes.\n */\n enforcePortTypes: boolean;\n}\n\nconst defaultConfig: XuiNodeGraphConfig = {\n routing: 'bezier',\n background: 'dots',\n marker: 'none',\n gridSize: 16,\n gridMajorEvery: 5,\n snapToGrid: false,\n minZoom: 0.15,\n maxZoom: 4,\n zoomStep: 1.15,\n stubLength: 18,\n cornerRadius: 8,\n curvature: 0.5,\n edgeWidth: 2,\n portSize: 11,\n portShape: 'circle',\n portColor: 'var(--color-foreground-subtle)',\n portTypes: {},\n allowSelfConnection: false,\n enforcePortTypes: true\n};\n\nconst XuiNodeGraphConfigToken = new InjectionToken<XuiNodeGraphConfig>('XuiNodeGraphConfig');\n\nexport function provideXuiNodeGraphConfig(config: Partial<XuiNodeGraphConfig>): ValueProvider {\n return { provide: XuiNodeGraphConfigToken, useValue: { ...defaultConfig, ...config } };\n}\n\nexport function injectXuiNodeGraphConfig(): XuiNodeGraphConfig {\n return inject(XuiNodeGraphConfigToken, { optional: true }) ?? defaultConfig;\n}\n\n/**\n * A ready-made data-type palette drawn from the categorical chart ramp, for\n * graphs that need distinguishable typed ports without designing a palette.\n *\n * ```ts\n * provideXuiNodeGraphConfig({ portTypes: { ...xuiGraphChartPortTypes(['float', 'vector', 'color']) } })\n * ```\n */\nexport function xuiGraphChartPortTypes(types: readonly string[]): Record<string, XuiGraphPortType> {\n return Object.fromEntries(\n types.map((type, index) => [type, { color: `var(--color-chart-${(index % 8) + 1})`, label: type }])\n );\n}\n","import type { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n ViewEncapsulation\n} from '@angular/core';\nimport { xui } from '@xui/core';\nimport type { ClassValue } from 'clsx';\nimport { XuiNodeGraphStore } from './node-graph-store';\nimport { injectXuiNodeGraphConfig } from './node-graph.token';\n\n/**\n * Zoom and framing buttons for the enclosing canvas.\n *\n * ```html\n * <xui-node-graph>\n * …\n * <xui-graph-controls class=\"bottom-4 left-4\" />\n * </xui-node-graph>\n * ```\n *\n * Placed anywhere inside `<xui-node-graph>`; it is projected into the overlay\n * layer, above the canvas and outside its transform, so it neither pans nor\n * scales with the content.\n */\n@Component({\n selector: 'xui-graph-controls',\n template: `\n <button type=\"button\" [class]=\"buttonClass\" aria-label=\"Zoom in\" (click)=\"store.zoomBy(step)\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <path d=\"M7 2 V12 M2 7 H12\" [attr.stroke]=\"'currentColor'\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n </button>\n\n <button type=\"button\" [class]=\"buttonClass\" aria-label=\"Zoom out\" (click)=\"store.zoomBy(1 / step)\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <path d=\"M2 7 H12\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n </button>\n\n @if (showFit()) {\n <button type=\"button\" [class]=\"buttonClass\" aria-label=\"Fit view\" (click)=\"store.fitView()\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M2 5 V2 H5 M9 2 H12 V5 M12 9 V12 H9 M5 12 H2 V9\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n }\n\n @if (showZoomLevel()) {\n <span class=\"text-foreground-subtle px-1 text-center text-[10px] tabular-nums\">{{ zoomPercent() }}%</span>\n }\n\n <ng-content />\n `,\n host: { '[class]': 'computedClass()', 'data-xui-graph-overlay': '' },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphControls {\n private readonly config = injectXuiNodeGraphConfig();\n\n protected readonly store = inject(XuiNodeGraphStore);\n protected readonly step = this.config.zoomStep;\n\n protected readonly buttonClass =\n 'text-foreground-muted hover:bg-hover-overlay hover:text-foreground focus-visible:ring-focus flex h-7 w-7 ' +\n 'cursor-pointer items-center justify-center rounded transition-colors focus-visible:ring-2 focus-visible:outline-none';\n\n readonly class = input<ClassValue>('');\n\n readonly showFit = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n readonly showZoomLevel = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** Lay the buttons out in a row rather than a column. */\n readonly horizontal = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n protected readonly zoomPercent = computed(() => Math.round(this.store.viewport().zoom * 100));\n\n protected readonly computedClass = computed(() =>\n xui(\n 'bg-surface-overlay border-border shadow-elevation-2 pointer-events-auto absolute z-10 flex gap-0.5 rounded-md border p-1 select-none',\n this.horizontal() ? 'flex-row items-center' : 'flex-col',\n // A sensible default corner; override with `class` to move it.\n 'bottom-4 left-4',\n this.class()\n )\n );\n}\n","import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n numberAttribute,\n type OnInit,\n signal,\n ViewEncapsulation\n} from '@angular/core';\nimport { xui } from '@xui/core';\nimport type { ClassValue } from 'clsx';\nimport { XuiNodeGraphStore } from './node-graph-store';\nimport type { XuiGraphGroupHandle } from './node-graph.types';\n\n/** Room reserved above the members for the title bar, in graph units. */\nconst HEADER_HEIGHT = 26;\n\n/**\n * A frame around a set of nodes that moves them all together.\n *\n * ```html\n * <xui-node-graph>\n * <xui-graph-group groupId=\"filter\" label=\"Filter stage\" color=\"var(--color-chart-1)\" />\n *\n * <xui-graph-node nodeId=\"lp\" group=\"filter\" [(position)]=\"a\">…</xui-graph-node>\n * <xui-graph-node nodeId=\"hp\" group=\"filter\" [(position)]=\"b\">…</xui-graph-node>\n * </xui-node-graph>\n * ```\n *\n * Membership is declared by the nodes, not by nesting them inside the frame:\n * a node keeps its own place in the template and its own `[(position)]`, and the\n * frame is derived from wherever its members happen to be. That is what lets a\n * group be added, removed or re-membered without moving anything in the DOM, and\n * why dragging a member out of a frame is just an ordinary node drag.\n *\n * A group with no members has no box, so it renders nothing.\n *\n * To let a node join a frame by being dropped on it, read `group` off the graph's\n * `nodeMove` event and reassign the node's own `group` input.\n */\n@Component({\n selector: 'xui-graph-group',\n template: `\n @if (label()) {\n <div\n data-xui-graph-group-header\n class=\"flex items-center gap-2 truncate px-2.5 text-xs font-medium\"\n [style.height.px]=\"headerHeight()\"\n [style.color]=\"color()\"\n >\n <span class=\"truncate\">{{ label() }}</span>\n <ng-content />\n </div>\n }\n `,\n host: {\n '[class]': 'computedClass()',\n '[attr.data-xui-graph-group]': 'groupId()',\n '[style.transform]': 'transform()',\n '[style.width.px]': 'bounds()?.width',\n '[style.height.px]': 'bounds()?.height',\n '[style.display]': 'bounds() ? null : \"none\"',\n '[style.border-color]': 'color()',\n '[style.background]': 'background()',\n '[style.cursor]': 'cursor()',\n '(pointerdown)': 'onPointerDown($event)',\n '(pointermove)': 'onPointerMove($event)',\n '(pointerup)': 'onPointerUp($event)',\n '(pointercancel)': 'onPointerUp($event)'\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphGroup implements XuiGraphGroupHandle, OnInit {\n private readonly store = inject(XuiNodeGraphStore);\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly dragOrigin = signal<{ x: number; y: number } | null>(null);\n\n /** Matches the `group` input on the nodes that belong to this frame. */\n readonly groupId = input.required<string>();\n\n readonly class = input<ClassValue>('');\n\n readonly label = input<string>('');\n\n /** Border and title colour; a tint of it fills the frame. Any CSS colour. */\n readonly color = input<string>('var(--color-border-strong)');\n\n /** Blank margin between the members' bounding box and the frame. */\n readonly padding = input<number, NumberInput>(24, { transform: numberAttribute });\n\n readonly selectable = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n readonly draggable = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** Pins the frame and everything in it. */\n readonly locked = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * `group` drags from anywhere on the frame, as a node editor's frames do.\n * `header` restricts it to the title bar, which leaves the frame's interior\n * free for panning and marquee selection.\n */\n readonly dragHandle = input<'group' | 'header'>('group');\n\n /**\n * @internal Part of {@link XuiGraphGroupHandle}.\n *\n * A frame only reserves room for a title bar when it has a label — an unlabelled\n * frame is a plain box, and projected content rides along inside the labelled one.\n */\n readonly headerHeight = computed(() => (this.label() ? HEADER_HEIGHT : 0));\n\n /**\n * The frame, in graph space. `null` while the group has no members.\n *\n * Pinned to where it stood at the start of a node drag, so a member dragged out\n * leaves a box that stays still instead of stretching it and snapping back.\n */\n readonly bounds = computed(() => this.store.groupFrame(this.groupId()));\n\n /** `true` while a dragged node hovers over this frame and would land in it. */\n readonly dropTarget = computed(() => this.store.dropTargetGroups().has(this.groupId()));\n\n readonly members = computed(() => this.store.nodesInGroup(this.groupId()).map(node => node.nodeId()));\n\n /** A frame reads as selected only when its whole membership is. */\n readonly selected = computed(() => {\n const members = this.members();\n\n return members.length > 0 && members.every(id => this.store.isNodeSelected(id));\n });\n\n protected readonly immovable = computed(() => this.locked() || !this.draggable() || this.store.settings().locked);\n\n protected readonly transform = computed(() => {\n const bounds = this.bounds();\n\n return bounds ? `translate(${bounds.x}px, ${bounds.y}px)` : null;\n });\n\n protected readonly cursor = computed(() => (this.dragOrigin() ? 'grabbing' : this.immovable() ? null : 'grab'));\n\n // Deepen the tint when the frame is about to claim a node, so the answer to\n // \"which group is this going into?\" is visible before the button comes up.\n protected readonly background = computed(\n () => `color-mix(in oklab, ${this.color()} ${this.dropTarget() ? 22 : 10}%, transparent)`\n );\n\n protected readonly computedClass = computed(() =>\n xui(\n // z-index 0 puts the frame under every node, so pressing a member still\n // moves that member and only the gaps between them belong to the group.\n 'absolute top-0 left-0 z-0 flex flex-col rounded-xl border-2 border-dashed transition-colors select-none',\n (this.selected() || this.dropTarget()) && 'border-solid',\n this.class()\n )\n );\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.store.unregisterGroup(this));\n }\n\n ngOnInit(): void {\n this.store.registerGroup(this);\n }\n\n protected onPointerDown(event: PointerEvent): void {\n const target = event.target as HTMLElement;\n\n if (event.button !== 0) {\n return;\n }\n\n // When the frame only answers to its title bar, a press on its interior is\n // left to bubble so the canvas can still pan or marquee through it.\n if (this.dragHandle() === 'header' && !target.closest('[data-xui-graph-group-header]')) {\n return;\n }\n\n event.stopPropagation();\n\n if (this.selectable()) {\n const additive = event.shiftKey || event.ctrlKey || event.metaKey;\n\n this.store.setSelection(additive ? [...this.store.selectedNodes(), ...this.members()] : this.members());\n }\n\n if (this.immovable()) {\n return;\n }\n\n event.preventDefault();\n this.element.setPointerCapture(event.pointerId);\n this.dragOrigin.set({ x: event.clientX, y: event.clientY });\n this.store.beginGroupDrag(this.groupId());\n }\n\n protected onPointerMove(event: PointerEvent): void {\n const origin = this.dragOrigin();\n\n if (!origin) {\n return;\n }\n\n const { zoom } = this.store.viewport();\n\n this.store.dragNodesBy({ x: (event.clientX - origin.x) / zoom, y: (event.clientY - origin.y) / zoom });\n }\n\n protected onPointerUp(event: PointerEvent): void {\n if (!this.dragOrigin()) {\n return;\n }\n\n this.dragOrigin.set(null);\n this.element.releasePointerCapture(event.pointerId);\n this.store.endNodeDrag();\n }\n}\n","import type { NumberInput } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n numberAttribute,\n ViewEncapsulation\n} from '@angular/core';\nimport { xui } from '@xui/core';\nimport type { ClassValue } from 'clsx';\nimport { XuiNodeGraphStore } from './node-graph-store';\nimport type { XuiGraphRect } from './node-graph.types';\n\n/**\n * An overview of the whole graph with the current viewport drawn on it.\n *\n * ```html\n * <xui-node-graph>\n * …\n * <xui-graph-minimap class=\"right-4 bottom-4\" />\n * </xui-node-graph>\n * ```\n *\n * Click or drag inside it to move the view. Like the controls, it is projected\n * into the overlay layer and so stays put while the canvas pans.\n */\n@Component({\n selector: 'xui-graph-minimap',\n template: `\n <svg\n class=\"h-full w-full cursor-pointer\"\n [attr.viewBox]=\"viewBox()\"\n preserveAspectRatio=\"xMidYMid meet\"\n role=\"img\"\n aria-label=\"Graph overview\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n >\n @for (node of nodes(); track node.id) {\n <rect\n [attr.x]=\"node.x\"\n [attr.y]=\"node.y\"\n [attr.width]=\"node.width\"\n [attr.height]=\"node.height\"\n [attr.rx]=\"cornerRadius()\"\n [attr.fill]=\"node.selected ? 'var(--color-primary)' : 'var(--color-border-strong)'\"\n />\n }\n\n @if (viewportRect(); as rect) {\n <rect\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n fill=\"var(--color-selection)\"\n stroke=\"var(--color-primary)\"\n [attr.stroke-width]=\"strokeWidth()\"\n />\n }\n </svg>\n `,\n host: { '[class]': 'computedClass()', 'data-xui-graph-overlay': '' },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphMinimap {\n private readonly store = inject(XuiNodeGraphStore);\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private dragging = false;\n\n readonly class = input<ClassValue>('');\n\n /** Blank margin around the content, in graph units. */\n readonly padding = input<number, NumberInput>(40, { transform: numberAttribute });\n\n protected readonly nodes = computed(() =>\n this.store.nodes().map(node => {\n const { x, y } = node.position();\n const { width, height } = node.size();\n\n return { id: node.nodeId(), x, y, width, height, selected: this.store.isNodeSelected(node.nodeId()) };\n })\n );\n\n /**\n * The extent the minimap shows: everything drawn, unioned with wherever the\n * viewport currently is, so panning off into empty space still tells you where\n * you are instead of silently clamping.\n */\n private readonly extent = computed<XuiGraphRect>(() => {\n const content = this.store.contentBounds();\n const view = this.viewportRect();\n const padding = this.padding();\n\n if (!content && !view) {\n return { x: 0, y: 0, width: 1, height: 1 };\n }\n\n const boxes = [content, view].filter((box): box is XuiGraphRect => !!box);\n const minX = Math.min(...boxes.map(box => box.x)) - padding;\n const minY = Math.min(...boxes.map(box => box.y)) - padding;\n const maxX = Math.max(...boxes.map(box => box.x + box.width)) + padding;\n const maxY = Math.max(...boxes.map(box => box.y + box.height)) + padding;\n\n return { x: minX, y: minY, width: Math.max(maxX - minX, 1), height: Math.max(maxY - minY, 1) };\n });\n\n protected readonly viewportRect = computed<XuiGraphRect | null>(() => {\n const { x, y, zoom } = this.store.viewport();\n const { width, height } = this.store.surfaceSize();\n\n if (width === 0 || height === 0) {\n return null;\n }\n\n return { x: -x / zoom, y: -y / zoom, width: width / zoom, height: height / zoom };\n });\n\n protected readonly viewBox = computed(() => {\n const { x, y, width, height } = this.extent();\n\n return `${x} ${y} ${width} ${height}`;\n });\n\n /** Keep hairlines and corners visually constant however far the extent zooms out. */\n private readonly unitScale = computed(() => this.extent().width / Math.max(this.element.clientWidth, 1));\n\n protected readonly strokeWidth = computed(() => this.unitScale());\n protected readonly cornerRadius = computed(() => this.unitScale() * 2);\n\n protected readonly computedClass = computed(() =>\n xui(\n 'bg-surface-overlay/90 border-border shadow-elevation-2 pointer-events-auto absolute z-10 block h-32 w-48 ' +\n 'overflow-hidden rounded-md border p-1 select-none',\n 'right-4 bottom-4',\n this.class()\n )\n );\n\n protected onPointerDown(event: PointerEvent): void {\n if (event.button !== 0) {\n return;\n }\n\n event.stopPropagation();\n this.dragging = true;\n (event.target as Element).setPointerCapture(event.pointerId);\n this.centerOnPointer(event);\n }\n\n protected onPointerMove(event: PointerEvent): void {\n if (this.dragging) {\n this.centerOnPointer(event);\n }\n }\n\n protected onPointerUp(event: PointerEvent): void {\n this.dragging = false;\n (event.target as Element).releasePointerCapture(event.pointerId);\n }\n\n /**\n * Map the pointer through the SVG's `preserveAspectRatio` fit and centre the\n * canvas there. The fit letterboxes on one axis, so the scale has to be taken\n * from the tighter of the two — using the element's own aspect ratio would put\n * the target off by the size of the letterbox.\n */\n private centerOnPointer(event: PointerEvent): void {\n const rect = this.element.getBoundingClientRect();\n const extent = this.extent();\n\n if (rect.width === 0 || rect.height === 0) {\n return;\n }\n\n const scale = Math.min(rect.width / extent.width, rect.height / extent.height);\n const offsetX = (rect.width - extent.width * scale) / 2;\n const offsetY = (rect.height - extent.height * scale) / 2;\n const graphX = (event.clientX - rect.left - offsetX) / scale + extent.x;\n const graphY = (event.clientY - rect.top - offsetY) / scale + extent.y;\n const surface = this.store.surfaceSize();\n const { zoom } = this.store.viewport();\n\n this.store.panBy(\n surface.width / 2 - (graphX * zoom + this.store.viewport().x),\n surface.height / 2 - (graphY * zoom + this.store.viewport().y)\n );\n }\n}\n","import { InjectionToken, type Signal } from '@angular/core';\nimport type { XuiGraphPortLayout, XuiGraphPortSide } from './node-graph.types';\n\n/** The slice of a port a sibling needs in order to work out its own index. @internal */\nexport interface XuiGraphPortSlot {\n readonly key: string;\n readonly resolvedSide: Signal<XuiGraphPortSide>;\n}\n\n/**\n * What a port needs from the node that contains it.\n *\n * Exposed through a token rather than by injecting `XuiGraphNode` directly: the\n * node queries its ports with `contentChildren`, so a direct injection would\n * close an import cycle between the two components.\n *\n * @internal\n */\nexport interface XuiGraphNodeContext {\n readonly nodeId: Signal<string>;\n readonly element: HTMLElement;\n readonly portLayout: Signal<XuiGraphPortLayout>;\n readonly collapsed: Signal<boolean>;\n readonly locked: Signal<boolean>;\n\n /** Ports in DOM order. Drives side-relative indexing and rail spacing. */\n readonly portSlots: Signal<readonly XuiGraphPortSlot[]>;\n\n /**\n * Bumped whenever the node's own box changes size. Ports re-measure their\n * offset off this rather than observing themselves, because a port moves when\n * a *sibling* reflows, which no observer on the port itself would ever see.\n */\n readonly layoutEpoch: Signal<number>;\n}\n\n/** @internal */\nexport const XUI_GRAPH_NODE = new InjectionToken<XuiGraphNodeContext>('XuiGraphNode');\n","import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n afterRenderEffect,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n numberAttribute,\n type OnInit,\n signal,\n untracked,\n viewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { xui } from '@xui/core';\nimport type { ClassValue } from 'clsx';\nimport { XUI_GRAPH_NODE } from './graph-node.token';\nimport { XuiNodeGraphStore } from './node-graph-store';\nimport type {\n XuiGraphPoint,\n XuiGraphPortDirection,\n XuiGraphPortHandle,\n XuiGraphPortShape,\n XuiGraphPortSide\n} from './node-graph.types';\nimport { xuiGraphPortKey } from './node-graph.types';\n\n/** Side a port takes when the author states only its direction. */\nconst SIDE_FOR_DIRECTION: Record<XuiGraphPortDirection, XuiGraphPortSide> = {\n input: 'left',\n output: 'right',\n inout: 'right'\n};\n\n/**\n * A connector on a node, together with the row of content that belongs to it.\n *\n * ```html\n * <xui-graph-node nodeId=\"mul\" label=\"Multiply\" [(position)]=\"position\">\n * <xui-graph-port portId=\"a\" direction=\"input\" dataType=\"float\" label=\"A\" />\n * <xui-graph-port portId=\"b\" direction=\"input\" dataType=\"float\" label=\"B\" />\n * <xui-graph-port portId=\"out\" direction=\"output\" dataType=\"float\" label=\"Result\" />\n * </xui-graph-node>\n * ```\n *\n * The host element is the whole row, so anything projected into it — a numeric\n * input, a colour swatch, a dropdown — sits inline with the connector, the way a\n * shader or VFX editor lays out its sockets. The connector itself is pinned to\n * the node's border, because that is what a wire attaches to.\n *\n * A hollow connector has nothing attached to it; a filled one is wired up.\n */\n@Component({\n selector: 'xui-graph-port',\n template: `\n <div\n #connector\n role=\"button\"\n [class]=\"connectorClass()\"\n [style.width.px]=\"connectorWidth()\"\n [style.height.px]=\"connectorHeight()\"\n [style.background]=\"connected() ? resolvedColor() : 'var(--color-surface)'\"\n [style.border-color]=\"resolvedColor()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.title]=\"tooltip()\"\n [attr.tabindex]=\"disabled() ? null : 0\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (keydown)=\"onKeydown($event)\"\n ></div>\n\n @if (label()) {\n <span class=\"truncate\">{{ label() }}</span>\n }\n\n <ng-content />\n `,\n host: {\n '[class]': 'computedClass()',\n '[attr.data-xui-graph-port]': 'portId()',\n '[attr.data-xui-graph-port-node]': 'nodeId()',\n '[attr.data-side]': 'resolvedSide()',\n '[attr.data-link-state]': 'linkState()',\n '[style.order]': 'order()',\n '[style.grid-column]': 'gridColumn()',\n '[style.grid-row]': 'gridRow()',\n '[style.left.%]': 'railOffset()',\n '[style.opacity]': \"linkState() === 'invalid' ? 0.35 : null\"\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphPort implements XuiGraphPortHandle, OnInit {\n private readonly store = inject(XuiNodeGraphStore);\n private readonly node = inject(XUI_GRAPH_NODE);\n private readonly document = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement.ownerDocument;\n private readonly connectorRef = viewChild.required<ElementRef<HTMLElement>>('connector');\n private readonly offsetState = signal<XuiGraphPoint>({ x: 0, y: 0 });\n\n /**\n * Registry identity. Empty until `ngOnInit`, because a required input is not\n * readable during construction.\n */\n key = '';\n\n /** Unique within the owning node — the node id supplies the rest of the identity. */\n readonly portId = input.required<string>();\n\n readonly class = input<ClassValue>('');\n\n /**\n * Which way data flows. `inout` covers terminals that are neither source nor\n * sink — a component lead in a schematic, where either end of a wire may be\n * drawn first.\n */\n readonly direction = input<XuiGraphPortDirection>('input');\n\n readonly label = input<string>('');\n\n /**\n * The compatibility key. Two ports may only be wired together when their data\n * types match, and the type also picks the connector's colour — see\n * `provideXuiNodeGraphConfig({ portTypes })`. Leaving it unset makes the port a\n * wildcard that connects to anything.\n */\n readonly dataType = input<string>();\n\n /** Overrides the colour inherited from {@link dataType}. */\n readonly color = input<string>();\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Which node edge the connector sits on. Leave unset to take it from\n * {@link direction} — inputs on the left, outputs on the right.\n */\n readonly side = input<XuiGraphPortSide>();\n\n readonly shape = input<XuiGraphPortShape>();\n\n /**\n * How many wires may terminate here. Defaults to 1 for an input — the usual\n * rule that a value has exactly one producer — and unlimited for outputs and\n * `inout` terminals, which fan out freely.\n */\n readonly maxConnections = input<number, NumberInput>(NaN, { transform: value => numberAttribute(value, NaN) });\n\n readonly nodeId = this.node.nodeId;\n\n readonly resolvedSide = computed(() => this.side() ?? SIDE_FOR_DIRECTION[this.direction()]);\n\n readonly resolvedMaxConnections = computed(() => {\n const explicit = this.maxConnections();\n\n return Number.isNaN(explicit) ? (this.direction() === 'input' ? 1 : Infinity) : explicit;\n });\n\n /** Connector centre relative to the node's top-left corner, in graph units. */\n readonly offset = this.offsetState.asReadonly();\n\n readonly resolvedColor = computed(() => {\n const explicit = this.color();\n\n if (explicit) {\n return explicit;\n }\n\n const settings = this.store.settings();\n const type = this.dataType();\n\n return (type ? settings.portTypes[type]?.color : undefined) ?? settings.portColor;\n });\n\n protected readonly resolvedShape = computed(() => {\n const settings = this.store.settings();\n const type = this.dataType();\n\n return this.shape() ?? (type ? settings.portTypes[type]?.shape : undefined) ?? settings.portShape;\n });\n\n protected readonly horizontal = computed(() => this.resolvedSide() === 'left' || this.resolvedSide() === 'right');\n\n private readonly size = computed(() => this.store.settings().portSize);\n\n // A pin is a lead rather than a socket: stretched along the node's normal.\n protected readonly connectorWidth = computed(() =>\n this.resolvedShape() === 'pin' && this.horizontal() ? this.size() * 2 : this.size()\n );\n\n protected readonly connectorHeight = computed(() =>\n this.resolvedShape() === 'pin' && !this.horizontal() ? this.size() * 2 : this.size()\n );\n\n protected readonly connected = computed(() => this.store.connectionCount(this.key) > 0);\n protected readonly linkState = computed(() => this.store.linkState(this.key));\n\n /** Position among the ports sharing this side; drives rails and column rows. */\n private readonly indexOnSide = computed(() => {\n const side = this.resolvedSide();\n const index = this.node\n .portSlots()\n .filter(slot => slot.resolvedSide() === side)\n .findIndex(slot => slot.key === this.key);\n\n return Math.max(index, 0);\n });\n\n private readonly countOnSide = computed(\n () => this.node.portSlots().filter(slot => slot.resolvedSide() === this.resolvedSide()).length\n );\n\n /**\n * Top and bottom ports spread evenly along their edge instead of stacking,\n * because a schematic reads those terminals as a rail, not as a list.\n */\n protected readonly railOffset = computed(() =>\n this.horizontal() ? null : ((this.indexOnSide() + 1) / (this.countOnSide() + 1)) * 100\n );\n\n protected readonly order = computed(() =>\n this.node.portLayout() === 'stacked' && this.horizontal() ? (this.resolvedSide() === 'right' ? 0 : 1) : null\n );\n\n protected readonly gridColumn = computed(() =>\n this.node.portLayout() === 'columns' && this.horizontal() ? (this.resolvedSide() === 'left' ? 1 : 2) : null\n );\n\n protected readonly gridRow = computed(() =>\n this.node.portLayout() === 'columns' && this.horizontal() ? this.indexOnSide() + 1 : null\n );\n\n protected readonly tooltip = computed(() => {\n const type = this.dataType();\n const typeLabel = type ? (this.store.settings().portTypes[type]?.label ?? type) : '';\n\n return [this.label(), typeLabel && `(${typeLabel})`].filter(Boolean).join(' ') || null;\n });\n\n protected readonly ariaLabel = computed(() => {\n const role = this.direction() === 'output' ? 'Output' : this.direction() === 'input' ? 'Input' : 'Terminal';\n\n return `${role} ${this.label() || this.portId()}`;\n });\n\n protected readonly computedClass = computed(() =>\n xui(\n 'relative flex min-h-7 items-center gap-2 text-xs leading-tight',\n this.horizontal() ? 'px-3' : 'absolute w-max -translate-x-1/2 flex-col gap-1',\n this.resolvedSide() === 'left' && 'justify-start text-left',\n this.resolvedSide() === 'right' && 'flex-row-reverse justify-start text-right',\n this.resolvedSide() === 'top' && 'top-0 -translate-y-full flex-col-reverse pb-1',\n this.resolvedSide() === 'bottom' && 'bottom-0 translate-y-full pt-1',\n // Collapsed: every connector converges on the node's midline and the row's\n // own content is hidden, leaving the wiring intact but the card folded.\n // `inset-x-0` resolves against the node, since the ports container is not\n // itself positioned.\n this.node.collapsed() &&\n this.horizontal() &&\n 'absolute inset-x-0 top-1/2 min-h-0 -translate-y-1/2 px-0 [&>:not(:first-child)]:hidden',\n this.disabled() ? 'text-foreground-subtle' : 'text-foreground-muted',\n this.class()\n )\n );\n\n protected readonly connectorClass = computed(() => {\n const shape = this.resolvedShape();\n const state = this.linkState();\n\n return xui(\n 'absolute box-border border-2 transition-transform duration-100',\n // Pinned to the node's border box. The ports container carries no\n // horizontal padding, so `left-0` really is the node's own edge.\n this.resolvedSide() === 'left' && 'top-1/2 left-0 -translate-x-1/2 -translate-y-1/2',\n this.resolvedSide() === 'right' && 'top-1/2 right-0 translate-x-1/2 -translate-y-1/2',\n this.resolvedSide() === 'top' && 'bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2',\n this.resolvedSide() === 'bottom' && 'top-0 left-1/2 -translate-x-1/2 -translate-y-1/2',\n shape === 'circle' && 'rounded-full',\n shape === 'square' && 'rounded-xs',\n shape === 'diamond' && 'rounded-xs rotate-45',\n shape === 'triangle' && 'rounded-none border-0 [clip-path:polygon(0_0,100%_50%,0_100%)]',\n shape === 'pin' && 'rounded-full',\n this.disabled() ? 'cursor-not-allowed opacity-40' : 'cursor-crosshair hover:scale-125',\n state === 'valid' && 'scale-150',\n state === 'source' && 'ring-focus scale-125 ring-2 ring-offset-1',\n 'focus-visible:ring-focus focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:outline-none'\n );\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.store.unregisterPort(this));\n\n // Re-measure whenever something that could move the connector changes. The\n // reads happen in the post-render read phase, so no layout is forced during\n // rendering.\n afterRenderEffect({\n read: () => {\n this.node.layoutEpoch();\n this.node.collapsed();\n this.node.portLayout();\n this.resolvedSide();\n this.connectorWidth();\n this.connectorHeight();\n this.indexOnSide();\n this.countOnSide();\n\n this.measure();\n }\n });\n }\n\n ngOnInit(): void {\n this.key = xuiGraphPortKey(untracked(this.nodeId), untracked(this.portId));\n this.store.registerPort(this);\n }\n\n private measure(): void {\n const nodeRect = this.node.element.getBoundingClientRect();\n const rect = this.connectorRef().nativeElement.getBoundingClientRect();\n\n // Rects are post-transform, so undo the canvas scale to land in graph units.\n const zoom = untracked(this.store.viewport).zoom || 1;\n const next = {\n x: (rect.left + rect.width / 2 - nodeRect.left) / zoom,\n y: (rect.top + rect.height / 2 - nodeRect.top) / zoom\n };\n const current = untracked(this.offsetState);\n\n if (Math.abs(current.x - next.x) > 0.01 || Math.abs(current.y - next.y) > 0.01) {\n this.offsetState.set(next);\n }\n }\n\n protected onPointerDown(event: PointerEvent): void {\n if (event.button !== 0 || this.disabled() || this.store.settings().locked) {\n return;\n }\n\n // Keep the node from reading this as the start of a move.\n event.stopPropagation();\n event.preventDefault();\n\n this.connectorRef().nativeElement.setPointerCapture(event.pointerId);\n this.store.beginLink(this, this.store.toGraphPoint(event.clientX, event.clientY));\n }\n\n protected onPointerMove(event: PointerEvent): void {\n const linking = this.store.linking();\n\n if (!linking || linking.fromKey !== this.key) {\n return;\n }\n\n this.store.moveLink(this.store.toGraphPoint(event.clientX, event.clientY));\n this.store.setLinkHover(this.portKeyAt(event.clientX, event.clientY));\n }\n\n protected onPointerUp(event: PointerEvent): void {\n const linking = this.store.linking();\n\n if (!linking || linking.fromKey !== this.key) {\n return;\n }\n\n this.connectorRef().nativeElement.releasePointerCapture(event.pointerId);\n\n // Refresh the pointer before ending: a release with no preceding move would\n // otherwise report a create-on-drop position one event out of date.\n this.store.moveLink(this.store.toGraphPoint(event.clientX, event.clientY));\n this.store.endLink(this.portKeyAt(event.clientX, event.clientY));\n }\n\n /**\n * Keyboard equivalent of dragging a wire: commit on one port, move focus,\n * commit on the other. Without it the graph cannot be wired without a mouse.\n */\n protected onKeydown(event: KeyboardEvent): void {\n if (this.disabled() || this.store.settings().locked) {\n return;\n }\n\n const linking = this.store.linking();\n\n if (event.key === 'Escape' && linking) {\n event.preventDefault();\n this.store.endLink(null);\n return;\n }\n\n if (event.key !== 'Enter' && event.key !== ' ') {\n return;\n }\n\n event.preventDefault();\n\n if (!linking) {\n this.store.beginLink(this, this.store.portPoint(this.key) ?? { x: 0, y: 0 });\n } else {\n this.store.endLink(linking.fromKey === this.key ? null : this.key);\n }\n }\n\n /**\n * Which port, if any, lies under a screen point. Used for drop targeting.\n *\n * The two halves of the identity are read back as separate attributes rather\n * than as one composite key, so the registry is free to key ports however it\n * likes without that encoding having to survive a DOM round-trip.\n */\n private portKeyAt(clientX: number, clientY: number): string | null {\n const host = this.document.elementFromPoint(clientX, clientY)?.closest('[data-xui-graph-port]');\n const portId = host?.getAttribute('data-xui-graph-port');\n const nodeId = host?.getAttribute('data-xui-graph-port-node');\n\n if (portId == null || nodeId == null) {\n return null;\n }\n\n const key = xuiGraphPortKey(nodeId, portId);\n\n return key === this.key ? null : key;\n }\n}\n","import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n DestroyRef,\n ElementRef,\n inject,\n input,\n model,\n numberAttribute,\n type OnInit,\n output,\n signal,\n untracked,\n ViewEncapsulation\n} from '@angular/core';\nimport { xui } from '@xui/core';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type { ClassValue } from 'clsx';\nimport { XUI_GRAPH_NODE } from './graph-node.token';\nimport { XuiGraphPort } from './graph-port';\nimport { XuiNodeGraphStore } from './node-graph-store';\nimport type { XuiGraphNodeHandle, XuiGraphPoint, XuiGraphPortLayout, XuiGraphSize } from './node-graph.types';\n\nexport const graphNodeVariants = cva(\n 'bg-surface-raised text-foreground absolute top-0 left-0 flex flex-col rounded-lg border select-none',\n {\n variants: {\n selected: {\n true: 'border-primary ring-primary/60 ring-2',\n false: 'border-border shadow-elevation-2'\n },\n locked: {\n true: 'cursor-default',\n false: ''\n },\n dimmed: {\n true: 'opacity-45',\n false: ''\n }\n },\n defaultVariants: { selected: false, locked: false, dimmed: false }\n }\n);\n\nexport type XuiGraphNodeVariants = VariantProps<typeof graphNodeVariants>;\n\n/**\n * A card on the canvas: a header, an optional body, and a set of ports.\n *\n * ```html\n * <xui-graph-node nodeId=\"osc\" label=\"Oscillator\" [(position)]=\"position\" accent=\"var(--color-chart-4)\">\n * <xui-graph-port portId=\"freq\" direction=\"input\" dataType=\"float\" label=\"Frequency\" />\n * <xui-graph-port portId=\"out\" direction=\"output\" dataType=\"signal\" label=\"Out\" />\n * </xui-graph-node>\n * ```\n *\n * The node is deliberately unopinionated about its body — projected content\n * renders below the ports, so the same component serves a shader node, a\n * two-terminal resistor and a form-like settings card. What it does own is the\n * geometry: its position drives every wire attached to it, and its border is\n * where connectors sit.\n *\n * `position` is a model, so `[(position)]` keeps the host's own state authoritative\n * — nothing is mutated behind the caller's back.\n */\n@Component({\n selector: 'xui-graph-node',\n template: `\n <div\n data-xui-graph-node-header\n [class]=\"headerClass()\"\n [style.border-top-color]=\"accent()\"\n (dblclick)=\"onHeaderDoubleClick($event)\"\n >\n @if (collapsible()) {\n <button\n type=\"button\"\n class=\"text-foreground-subtle hover:text-foreground -ml-1 shrink-0 cursor-pointer p-0.5 leading-none\"\n [attr.aria-label]=\"collapsed() ? 'Expand node' : 'Collapse node'\"\n [attr.aria-expanded]=\"!collapsed()\"\n (click)=\"collapsed.set(!collapsed())\"\n >\n <svg\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 10 10\"\n aria-hidden=\"true\"\n class=\"transition-transform duration-150\"\n [style.transform]=\"collapsed() ? 'rotate(-90deg)' : null\"\n >\n <path d=\"M1 3 L5 7 L9 3\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n </button>\n }\n\n <ng-content select=\"xui-graph-node-header\" />\n\n @if (label()) {\n <span class=\"min-w-0 flex-1 truncate\">{{ label() }}</span>\n }\n\n <ng-content select=\"xui-graph-node-actions\" />\n </div>\n\n @if (!collapsed()) {\n <ng-content select=\"xui-graph-node-preview\" />\n }\n\n <!--\n Deliberately not positioned: left/right connectors resolve their inset\n against this box (full node width, no horizontal padding), while top and\n bottom ports are absolute and must resolve against the node itself.\n -->\n <div [class]=\"portsClass()\">\n <ng-content select=\"xui-graph-port\" />\n </div>\n\n @if (!collapsed()) {\n <ng-content />\n }\n `,\n host: {\n '[class]': 'computedClass()',\n '[attr.data-xui-graph-node]': 'nodeId()',\n '[attr.aria-selected]': 'selectable() ? selected() : null',\n '[attr.role]': \"selectable() ? 'option' : null\",\n '[style.transform]': 'transform()',\n '[style.width.px]': 'width()',\n '[style.z-index]': 'selected() ? 2 : 1',\n '[style.cursor]': 'dragCursor()',\n '(pointerdown)': 'onPointerDown($event)',\n '(pointermove)': 'onPointerMove($event)',\n '(pointerup)': 'onPointerUp($event)',\n '(pointercancel)': 'onPointerUp($event)'\n },\n providers: [{ provide: XUI_GRAPH_NODE, useExisting: XuiGraphNode }],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphNode implements XuiGraphNodeHandle, OnInit {\n private readonly store = inject(XuiNodeGraphStore);\n private readonly sizeState = signal<XuiGraphSize>({ width: 0, height: 0 });\n private readonly layoutEpochState = signal(0);\n private dragOrigin: { x: number; y: number } | null = null;\n\n /** Host element. Ports measure their connector offsets against this box. */\n readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n /** Identifies the node to edges and to the selection. Must be stable and unique. */\n readonly nodeId = input.required<string>();\n\n readonly class = input<ClassValue>('');\n\n /** Top-left corner in graph space. Two-way bound so the host owns the value. */\n readonly position = model<XuiGraphPoint>({ x: 0, y: 0 });\n\n readonly label = input<string>('');\n\n /** Fixed width in graph units. Leave unset to size to content. */\n readonly width = input<number | undefined, NumberInput>(undefined, {\n transform: value => (value == null || value === '' ? undefined : numberAttribute(value))\n });\n\n /**\n * Accent colour for the header's top rule — the usual way a node editor shows\n * which category a node belongs to. Any CSS colour; prefer a theme token.\n */\n readonly accent = input<string>();\n\n /**\n * Id of the `<xui-graph-group>` this node belongs to. Membership lives on the\n * node rather than in the frame, so a node never has to move in the template to\n * join or leave one.\n */\n readonly group = input<string>();\n\n /** Arrangement of the port rows. */\n readonly portLayout = input<XuiGraphPortLayout>('stacked');\n\n /**\n * Hides the body and pulls every connector onto the header, so a finished\n * subtree can be folded away without breaking its wiring.\n */\n readonly collapsed = model(false);\n\n readonly collapsible = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly selectable = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n readonly draggable = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** Pins the node in place while leaving it selectable. */\n readonly locked = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Restrict dragging to the header, as a window manager does. */\n readonly dragHandle = input<'node' | 'header'>('node');\n\n /** Renders the node faded — for a disabled branch or a bypassed effect. */\n readonly dimmed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Double-click on the header. The usual gesture for entering a subgraph. */\n readonly activated = output<void>();\n\n /** Measured border-box size in graph units, from a ResizeObserver. */\n readonly size = this.sizeState.asReadonly();\n\n /** @internal Bumped on reflow so ports know to re-measure. */\n readonly layoutEpoch = this.layoutEpochState.asReadonly();\n\n /** @internal Ports in DOM order, for side-relative indexing. */\n readonly portSlots = contentChildren(XuiGraphPort);\n\n readonly selected = computed(() => this.store.isNodeSelected(this.nodeId()));\n\n protected readonly immovable = computed(() => this.locked() || !this.draggable() || this.store.settings().locked);\n\n protected readonly transform = computed(() => {\n const { x, y } = this.position();\n\n return `translate(${x}px, ${y}px)`;\n });\n\n protected readonly dragCursor = computed(() =>\n this.immovable() ? null : this.dragHandle() === 'header' ? null : 'grab'\n );\n\n protected readonly computedClass = computed(() =>\n xui(\n graphNodeVariants({ selected: this.selected(), locked: this.locked(), dimmed: this.dimmed() }),\n !this.width() && 'min-w-40',\n this.class()\n )\n );\n\n protected readonly headerClass = computed(() =>\n xui(\n 'flex items-center gap-2 rounded-t-lg px-3 py-2 text-sm font-medium',\n // The accent is painted as a thicker top rule, so it survives a dark theme\n // and never fights the node's own surface colour for contrast.\n this.accent() ? 'border-t-3' : 'border-t-3 border-t-transparent',\n !this.collapsed() && 'border-border-muted border-b',\n this.immovable() || this.dragHandle() === 'node' ? '' : 'cursor-grab'\n )\n );\n\n protected readonly portsClass = computed(() =>\n xui(\n this.portLayout() === 'columns' ? 'grid grid-cols-2' : 'flex flex-col',\n // Collapsed ports are absolute, so the container takes no room on its own.\n !this.collapsed() && this.portSlots().length > 0 && 'py-1.5'\n )\n );\n\n constructor() {\n const observer = new ResizeObserver(entries => {\n const box = entries[0]?.borderBoxSize?.[0];\n const width = box ? box.inlineSize : this.element.offsetWidth;\n const height = box ? box.blockSize : this.element.offsetHeight;\n const current = untracked(this.sizeState);\n\n if (Math.abs(current.width - width) > 0.5 || Math.abs(current.height - height) > 0.5) {\n this.sizeState.set({ width, height });\n }\n\n // Bump unconditionally: a reflow that leaves the node's own box unchanged\n // — a label swap, a row appearing and another disappearing — still moves\n // the ports inside it.\n this.layoutEpochState.update(epoch => epoch + 1);\n });\n\n observer.observe(this.element);\n\n inject(DestroyRef).onDestroy(() => {\n observer.disconnect();\n this.store.unregisterNode(this);\n });\n }\n\n ngOnInit(): void {\n this.store.registerNode(this);\n }\n\n /** @internal Called by the store while dragging a selection. */\n moveTo(point: XuiGraphPoint): void {\n this.position.set(point);\n }\n\n protected onPointerDown(event: PointerEvent): void {\n if (event.button !== 0) {\n return;\n }\n\n // A press anywhere on a node belongs to the node, never to the canvas — even\n // when it lands on a control and starts no drag at all.\n event.stopPropagation();\n\n const target = event.target as HTMLElement;\n\n if (this.selectable()) {\n const additive = event.shiftKey || event.ctrlKey || event.metaKey;\n\n if (additive || !this.store.isNodeSelected(this.nodeId())) {\n this.store.selectNode(this.nodeId(), additive);\n }\n }\n\n if (this.immovable() || target.closest(NON_DRAGGABLE)) {\n return;\n }\n\n if (this.dragHandle() === 'header' && !target.closest('[data-xui-graph-node-header]')) {\n return;\n }\n\n event.preventDefault();\n this.element.setPointerCapture(event.pointerId);\n this.dragOrigin = { x: event.clientX, y: event.clientY };\n this.store.beginNodeDrag(this.nodeId());\n }\n\n protected onPointerMove(event: PointerEvent): void {\n if (!this.dragOrigin) {\n return;\n }\n\n const { zoom } = this.store.viewport();\n\n this.store.dragNodesBy({\n x: (event.clientX - this.dragOrigin.x) / zoom,\n y: (event.clientY - this.dragOrigin.y) / zoom\n });\n }\n\n protected onPointerUp(event: PointerEvent): void {\n if (!this.dragOrigin) {\n return;\n }\n\n this.dragOrigin = null;\n this.element.releasePointerCapture(event.pointerId);\n this.store.endNodeDrag();\n }\n\n protected onHeaderDoubleClick(event: MouseEvent): void {\n event.stopPropagation();\n this.activated.emit();\n }\n}\n\n/**\n * Descendants that own their own pointer gestures. Ports link, native controls\n * take input, and anything marked `xuiGraphNoDrag` opts out explicitly.\n */\nconst NON_DRAGGABLE =\n '[data-xui-graph-port], [data-xui-graph-no-drag], input, textarea, select, button, a, [contenteditable=\"true\"]';\n","import { ChangeDetectionStrategy, Component, computed, Directive, input, ViewEncapsulation } from '@angular/core';\nimport { xui } from '@xui/core';\nimport type { ClassValue } from 'clsx';\n\n/*\n * The slots are elements rather than attribute directives on purpose.\n *\n * Content projection matches `ng-content select` against the template's own\n * markup, and an attribute selector that fails to match raises nothing — the\n * element quietly lands in the default slot instead. For a node header that means\n * rendering below the ports; for an overlay it means being placed inside the\n * canvas transform, where it pans and zooms with the content and sizes itself\n * against a zero-height box. Element selectors match reliably, so a slot cannot\n * end up in the wrong layer without anyone noticing.\n */\n\n/**\n * Replaces a node's default header. Use it when the title needs an icon, a\n * badge, or anything beyond the `label` input.\n *\n * ```html\n * <xui-graph-node nodeId=\"n1\" [(position)]=\"position\">\n * <xui-graph-node-header><ng-icon name=\"matBolt\" /> Amplifier</xui-graph-node-header>\n * </xui-graph-node>\n * ```\n */\n@Component({\n selector: 'xui-graph-node-header',\n template: '<ng-content />',\n host: { '[class]': 'computedClass()' },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphNodeHeader {\n readonly class = input<ClassValue>('');\n\n protected readonly computedClass = computed(() =>\n xui('flex min-w-0 flex-1 items-center gap-2 truncate', this.class())\n );\n}\n\n/** Trailing controls in a node header — a menu button, a toggle, a status dot. */\n@Component({\n selector: 'xui-graph-node-actions',\n template: '<ng-content />',\n host: { '[class]': 'computedClass()' },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphNodeActions {\n readonly class = input<ClassValue>('');\n\n protected readonly computedClass = computed(() => xui('flex shrink-0 items-center gap-1', this.class()));\n}\n\n/**\n * A full-bleed block between the header and the ports — a thumbnail, a preview\n * render, a waveform. Sits above the port rows, as it does in a VFX graph.\n */\n@Component({\n selector: 'xui-graph-node-preview',\n template: '<ng-content />',\n host: { '[class]': 'computedClass()' },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphNodePreview {\n readonly class = input<ClassValue>('');\n\n protected readonly computedClass = computed(() =>\n xui('border-border-muted block overflow-hidden border-b', this.class())\n );\n}\n\n/**\n * Furniture layered over the canvas — a legend, a toolbar, a context menu.\n *\n * It sits outside the canvas transform, so it neither pans nor scales with the\n * content, and positions itself against the graph's own box:\n *\n * ```html\n * <xui-node-graph>\n * …\n * <xui-graph-overlay class=\"top-4 right-4\">Read only</xui-graph-overlay>\n * </xui-node-graph>\n * ```\n *\n * Keep the element itself outside any `@if` or `@for`, and put the condition on\n * its contents instead. A control-flow block is projected as one embedded view,\n * so anything wrapped in one goes to the canvas layer whatever its own selector\n * says — an overlay put there pans and zooms away with the content:\n *\n * ```html\n * <xui-graph-overlay class=\"inset-0\" [class.pointer-events-none]=\"!menu()\">\n * @if (menu(); as open) { … }\n * </xui-graph-overlay>\n * ```\n */\n@Component({\n selector: 'xui-graph-overlay',\n template: '<ng-content />',\n host: {\n '[class]': 'computedClass()',\n // Tells the canvas to keep its hands off presses that land here. Without it\n // the canvas captures the pointer for a pan and the release never reaches\n // whatever was pressed, so buttons in an overlay never see a click.\n 'data-xui-graph-overlay': ''\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphOverlay {\n readonly class = input<ClassValue>('');\n\n protected readonly computedClass = computed(() => xui('pointer-events-auto absolute z-10 block', this.class()));\n}\n\n/**\n * Marks a subtree inside a node as not draggable, so pointer gestures on it\n * belong to the control rather than moving the node.\n *\n * Native form controls, buttons and links are exempt already; this is for\n * anything custom — a slider, a curve editor, a colour wheel.\n */\n@Directive({\n selector: '[xuiGraphNoDrag]',\n host: { 'data-xui-graph-no-drag': '' }\n})\nexport class XuiGraphNoDrag {}\n","import type { XuiGraphPoint, XuiGraphPortSide, XuiGraphRouting } from './node-graph.types';\n\n/** Unit vector pointing away from the node, per port side. */\nconst NORMALS: Record<XuiGraphPortSide, XuiGraphPoint> = {\n left: { x: -1, y: 0 },\n right: { x: 1, y: 0 },\n top: { x: 0, y: -1 },\n bottom: { x: 0, y: 1 }\n};\n\nexport function xuiGraphPortNormal(side: XuiGraphPortSide): XuiGraphPoint {\n return NORMALS[side];\n}\n\nexport interface XuiGraphRouteOptions {\n /**\n * How far a wire runs straight out of a port before it may turn, in graph\n * units. Keeps the first segment perpendicular to the node edge, which is what\n * makes a schematic readable.\n */\n stubLength: number;\n\n /** Corner rounding for `smoothstep`, in graph units. */\n cornerRadius: number;\n\n /**\n * Bezier control-point pull as a fraction of the port-to-port distance along\n * the port normal. `0` degenerates to a straight line; ~0.5 matches the slack\n * of a real cable.\n */\n curvature: number;\n}\n\nexport const XUI_GRAPH_DEFAULT_ROUTE_OPTIONS: XuiGraphRouteOptions = {\n stubLength: 18,\n cornerRadius: 8,\n curvature: 0.5\n};\n\n/**\n * Build the `d` attribute for a wire between two ports.\n *\n * The two sides matter as much as the two points: an edge leaving a right-hand\n * port must set off rightwards even when its target sits to the left, otherwise\n * it appears to pass through the node it came from.\n */\nexport function xuiGraphEdgePath(\n source: XuiGraphPoint,\n sourceSide: XuiGraphPortSide,\n target: XuiGraphPoint,\n targetSide: XuiGraphPortSide,\n routing: XuiGraphRouting,\n options: XuiGraphRouteOptions = XUI_GRAPH_DEFAULT_ROUTE_OPTIONS\n): string {\n switch (routing) {\n case 'straight':\n return `M ${round(source.x)} ${round(source.y)} L ${round(target.x)} ${round(target.y)}`;\n case 'orthogonal':\n return polylinePath(orthogonalPoints(source, sourceSide, target, targetSide, options.stubLength), 0);\n case 'smoothstep':\n return polylinePath(\n orthogonalPoints(source, sourceSide, target, targetSide, options.stubLength),\n options.cornerRadius\n );\n case 'bezier':\n default:\n return bezierPath(source, sourceSide, target, targetSide, options.curvature);\n }\n}\n\n/**\n * The point at the middle of a route, used to place edge labels.\n *\n * For a bezier this is the curve's t=0.5 point; for the orthogonal families it\n * is the point half the total run from the source. Picking the longest segment\n * instead would flip the label between two legs of equal length as the wire\n * moved, and the halfway point is where a reader looks anyway.\n */\nexport function xuiGraphEdgeMidpoint(\n source: XuiGraphPoint,\n sourceSide: XuiGraphPortSide,\n target: XuiGraphPoint,\n targetSide: XuiGraphPortSide,\n routing: XuiGraphRouting,\n options: XuiGraphRouteOptions = XUI_GRAPH_DEFAULT_ROUTE_OPTIONS\n): XuiGraphPoint {\n if (routing === 'straight') {\n return { x: (source.x + target.x) / 2, y: (source.y + target.y) / 2 };\n }\n\n if (routing === 'bezier') {\n const [c1, c2] = bezierControlPoints(source, sourceSide, target, targetSide, options.curvature);\n\n // Cubic Bezier at t = 0.5 reduces to the average of the four weights 1:3:3:1.\n return {\n x: (source.x + 3 * c1.x + 3 * c2.x + target.x) / 8,\n y: (source.y + 3 * c1.y + 3 * c2.y + target.y) / 8\n };\n }\n\n const points = orthogonalPoints(source, sourceSide, target, targetSide, options.stubLength);\n const lengths = points.slice(1).map((point, index) => distance(points[index], point));\n const half = lengths.reduce((sum, length) => sum + length, 0) / 2;\n let travelled = 0;\n\n for (let i = 0; i < lengths.length; i++) {\n if (travelled + lengths[i] >= half) {\n return lerp(points[i], points[i + 1], lengths[i] === 0 ? 0 : (half - travelled) / lengths[i]);\n }\n\n travelled += lengths[i];\n }\n\n return { x: (source.x + target.x) / 2, y: (source.y + target.y) / 2 };\n}\n\nfunction bezierControlPoints(\n source: XuiGraphPoint,\n sourceSide: XuiGraphPortSide,\n target: XuiGraphPoint,\n targetSide: XuiGraphPortSide,\n curvature: number\n): [XuiGraphPoint, XuiGraphPoint] {\n const sourceNormal = NORMALS[sourceSide];\n const targetNormal = NORMALS[targetSide];\n\n // Pull along each normal, scaled by the separation *on that normal's axis*.\n // A floor keeps near-coincident ports from collapsing into a straight stub,\n // which is what makes a self-connection or a tight back-link still legible.\n const dx = Math.abs(target.x - source.x);\n const dy = Math.abs(target.y - source.y);\n const sourcePull = Math.max(30, (sourceNormal.x !== 0 ? dx : dy) * curvature);\n const targetPull = Math.max(30, (targetNormal.x !== 0 ? dx : dy) * curvature);\n\n return [\n { x: source.x + sourceNormal.x * sourcePull, y: source.y + sourceNormal.y * sourcePull },\n { x: target.x + targetNormal.x * targetPull, y: target.y + targetNormal.y * targetPull }\n ];\n}\n\nfunction bezierPath(\n source: XuiGraphPoint,\n sourceSide: XuiGraphPortSide,\n target: XuiGraphPoint,\n targetSide: XuiGraphPortSide,\n curvature: number\n): string {\n const [c1, c2] = bezierControlPoints(source, sourceSide, target, targetSide, curvature);\n\n return (\n `M ${round(source.x)} ${round(source.y)} ` +\n `C ${round(c1.x)} ${round(c1.y)}, ${round(c2.x)} ${round(c2.y)}, ${round(target.x)} ${round(target.y)}`\n );\n}\n\n/**\n * Manhattan route between two ports.\n *\n * Both ends first travel `stub` along their normal; the remaining gap is closed\n * with one or two turns. Which turn pattern applies depends on whether the two\n * normals share an axis and whether the far stub is already \"ahead\" of the near\n * one — when it is not, the wire has to detour on the cross axis to get around.\n */\nfunction orthogonalPoints(\n source: XuiGraphPoint,\n sourceSide: XuiGraphPortSide,\n target: XuiGraphPoint,\n targetSide: XuiGraphPortSide,\n stub: number\n): XuiGraphPoint[] {\n const sourceNormal = NORMALS[sourceSide];\n const targetNormal = NORMALS[targetSide];\n const a = { x: source.x + sourceNormal.x * stub, y: source.y + sourceNormal.y * stub };\n const b = { x: target.x + targetNormal.x * stub, y: target.y + targetNormal.y * stub };\n\n const sourceHorizontal = sourceNormal.x !== 0;\n const targetHorizontal = targetNormal.x !== 0;\n const middle: XuiGraphPoint[] = [];\n\n if (sourceHorizontal && targetHorizontal) {\n // Facing each other with room between them: split the gap and turn twice.\n const facing = sourceNormal.x !== targetNormal.x;\n const hasRoom = facing && (b.x - a.x) * sourceNormal.x > 0;\n\n if (hasRoom) {\n const midX = (a.x + b.x) / 2;\n middle.push({ x: midX, y: a.y }, { x: midX, y: b.y });\n } else if (facing) {\n // Facing but overlapping — go around on the cross axis.\n const midY = (a.y + b.y) / 2;\n middle.push({ x: a.x, y: midY }, { x: b.x, y: midY });\n } else {\n // Same direction — run both stubs out to the furthest of the two.\n const x = sourceNormal.x > 0 ? Math.max(a.x, b.x) : Math.min(a.x, b.x);\n middle.push({ x, y: a.y }, { x, y: b.y });\n }\n } else if (!sourceHorizontal && !targetHorizontal) {\n const facing = sourceNormal.y !== targetNormal.y;\n const hasRoom = facing && (b.y - a.y) * sourceNormal.y > 0;\n\n if (hasRoom) {\n const midY = (a.y + b.y) / 2;\n middle.push({ x: a.x, y: midY }, { x: b.x, y: midY });\n } else if (facing) {\n const midX = (a.x + b.x) / 2;\n middle.push({ x: midX, y: a.y }, { x: midX, y: b.y });\n } else {\n const y = sourceNormal.y > 0 ? Math.max(a.y, b.y) : Math.min(a.y, b.y);\n middle.push({ x: a.x, y }, { x: b.x, y });\n }\n } else if (sourceHorizontal) {\n // Horizontal into vertical: a single elbow, turning under/over the target.\n middle.push({ x: b.x, y: a.y });\n } else {\n middle.push({ x: a.x, y: b.y });\n }\n\n return simplify([source, a, ...middle, b, target]);\n}\n\n/** Drop duplicate and collinear vertices so corner rounding never sees a zero-length leg. */\nfunction simplify(points: XuiGraphPoint[]): XuiGraphPoint[] {\n const result: XuiGraphPoint[] = [];\n\n for (const point of points) {\n const last = result[result.length - 1];\n\n if (last && Math.abs(last.x - point.x) < 0.01 && Math.abs(last.y - point.y) < 0.01) {\n continue;\n }\n\n const previous = result[result.length - 2];\n\n if (previous && last && isCollinear(previous, last, point)) {\n result[result.length - 1] = point;\n continue;\n }\n\n result.push(point);\n }\n\n return result;\n}\n\nfunction isCollinear(a: XuiGraphPoint, b: XuiGraphPoint, c: XuiGraphPoint): boolean {\n return (\n (Math.abs(a.x - b.x) < 0.01 && Math.abs(b.x - c.x) < 0.01) ||\n (Math.abs(a.y - b.y) < 0.01 && Math.abs(b.y - c.y) < 0.01)\n );\n}\n\n/**\n * Turn a polyline into a path, optionally rounding each interior corner.\n *\n * The rounding radius is clamped to half the shorter of the two legs meeting at\n * the corner, so a tight zig-zag degrades to sharp corners instead of producing\n * arcs that overshoot their own segments.\n */\nfunction polylinePath(points: XuiGraphPoint[], radius: number): string {\n if (points.length === 0) {\n return '';\n }\n\n if (radius <= 0 || points.length < 3) {\n return points.map((p, i) => `${i === 0 ? 'M' : 'L'} ${round(p.x)} ${round(p.y)}`).join(' ');\n }\n\n let path = `M ${round(points[0].x)} ${round(points[0].y)}`;\n\n for (let i = 1; i < points.length - 1; i++) {\n const previous = points[i - 1];\n const corner = points[i];\n const next = points[i + 1];\n const inLength = distance(previous, corner);\n const outLength = distance(corner, next);\n const r = Math.min(radius, inLength / 2, outLength / 2);\n\n if (r < 0.5) {\n path += ` L ${round(corner.x)} ${round(corner.y)}`;\n continue;\n }\n\n const enter = lerp(corner, previous, r / inLength);\n const exit = lerp(corner, next, r / outLength);\n\n path += ` L ${round(enter.x)} ${round(enter.y)}`;\n path += ` Q ${round(corner.x)} ${round(corner.y)}, ${round(exit.x)} ${round(exit.y)}`;\n }\n\n const last = points[points.length - 1];\n\n return `${path} L ${round(last.x)} ${round(last.y)}`;\n}\n\nfunction distance(a: XuiGraphPoint, b: XuiGraphPoint): number {\n return Math.hypot(b.x - a.x, b.y - a.y);\n}\n\nfunction lerp(from: XuiGraphPoint, to: XuiGraphPoint, t: number): XuiGraphPoint {\n return { x: from.x + (to.x - from.x) * t, y: from.y + (to.y - from.y) * t };\n}\n\nfunction round(value: number): number {\n return Math.round(value * 100) / 100;\n}\n","import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n model,\n numberAttribute,\n output,\n signal,\n untracked,\n ViewEncapsulation\n} from '@angular/core';\nimport { xui } from '@xui/core';\nimport type { ClassValue } from 'clsx';\nimport { XuiNodeGraphStore, type XuiGraphSettings } from './node-graph-store';\nimport { xuiGraphEdgeMidpoint, xuiGraphEdgePath, type XuiGraphRouteOptions } from './node-graph.routing';\nimport { injectXuiNodeGraphConfig, type XuiGraphPortType } from './node-graph.token';\nimport type {\n XuiGraphBackground,\n XuiGraphConnection,\n XuiGraphConnectionDrop,\n XuiGraphConnectionValidator,\n XuiGraphEdge,\n XuiGraphMarker,\n XuiGraphNodeMove,\n XuiGraphPoint,\n XuiGraphPortShape,\n XuiGraphRect,\n XuiGraphRouting,\n XuiGraphViewport\n} from './node-graph.types';\nimport { xuiGraphPortKey } from './node-graph.types';\n\n/** What the canvas is currently doing with the pointer. */\ntype Gesture = 'none' | 'pan' | 'marquee';\n\n/** Everything the template needs to draw one wire. */\ninterface RenderedEdge {\n edge: XuiGraphEdge;\n d: string;\n color: string;\n width: number;\n selected: boolean;\n dashArray: string | null;\n animated: boolean;\n markerId: string | null;\n label: string | null;\n labelPosition: XuiGraphPoint;\n}\n\nlet nextGraphId = 0;\n\n/**\n * A pannable, zoomable canvas for node-based editors and schematics.\n *\n * ```html\n * <xui-node-graph class=\"h-[600px]\" [edges]=\"edges()\" routing=\"orthogonal\" snapToGrid (connect)=\"add($event)\">\n * @for (node of nodes(); track node.id) {\n * <xui-graph-node [nodeId]=\"node.id\" [label]=\"node.label\" [(position)]=\"node.position\">\n * <xui-graph-port portId=\"in\" direction=\"input\" />\n * <xui-graph-port portId=\"out\" direction=\"output\" />\n * </xui-graph-node>\n * }\n * </xui-node-graph>\n * ```\n *\n * Nodes are ordinary projected content, so they keep Angular's template model —\n * `@for`, `@if`, your own components — instead of being described by a\n * configuration object. Edges are an input rather than content because a wire\n * has no content of its own: its whole geometry is derived from the two ports it\n * joins, which the graph already tracks.\n *\n * The graph never mutates `edges`. `connect` reports an approved connection and\n * the host decides what to add, which is what keeps undo/redo and persistence in\n * the host's hands.\n */\n@Component({\n selector: 'xui-node-graph',\n template: `\n <div\n class=\"pointer-events-none absolute inset-0\"\n [style.background-image]=\"backgroundImage()\"\n [style.background-size]=\"backgroundSize()\"\n [style.background-position]=\"backgroundPosition()\"\n ></div>\n\n <div class=\"absolute top-0 left-0 origin-top-left\" [style.transform]=\"canvasTransform()\">\n <svg class=\"pointer-events-none absolute overflow-visible\" width=\"1\" height=\"1\" aria-hidden=\"true\">\n <defs>\n <marker\n [id]=\"arrowId\"\n markerWidth=\"10\"\n markerHeight=\"10\"\n refX=\"9\"\n refY=\"5\"\n orient=\"auto-start-reverse\"\n markerUnits=\"userSpaceOnUse\"\n >\n <path d=\"M 1 1 L 9 5 L 1 9\" fill=\"none\" stroke=\"context-stroke\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </marker>\n <marker\n [id]=\"arrowClosedId\"\n markerWidth=\"10\"\n markerHeight=\"10\"\n refX=\"9\"\n refY=\"5\"\n orient=\"auto-start-reverse\"\n markerUnits=\"userSpaceOnUse\"\n >\n <path d=\"M 1 1 L 9 5 L 1 9 Z\" fill=\"context-stroke\" stroke=\"context-stroke\" stroke-width=\"1\" />\n </marker>\n <marker [id]=\"dotId\" markerWidth=\"8\" markerHeight=\"8\" refX=\"4\" refY=\"4\" markerUnits=\"userSpaceOnUse\">\n <circle cx=\"4\" cy=\"4\" r=\"3\" fill=\"context-stroke\" />\n </marker>\n </defs>\n\n @for (item of renderedEdges(); track item.edge.id) {\n <g class=\"pointer-events-auto\">\n @if (item.selected) {\n <path\n [attr.d]=\"item.d\"\n fill=\"none\"\n stroke=\"var(--color-selection)\"\n [attr.stroke-width]=\"item.width + 8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n }\n <path\n class=\"cursor-pointer\"\n [attr.d]=\"item.d\"\n fill=\"none\"\n stroke=\"transparent\"\n [attr.stroke-width]=\"Math.max(item.width * 4, 14)\"\n [attr.pointer-events]=\"locked() ? 'none' : 'stroke'\"\n (pointerdown)=\"onEdgePointerDown(item.edge, $event)\"\n />\n <path\n [class]=\"item.animated ? 'xui-graph-edge-flow' : null\"\n [attr.d]=\"item.d\"\n fill=\"none\"\n [attr.stroke]=\"item.color\"\n [attr.stroke-width]=\"item.width\"\n [attr.stroke-dasharray]=\"item.dashArray\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n [attr.marker-end]=\"item.markerId\"\n pointer-events=\"none\"\n />\n </g>\n }\n\n @if (linkPreview(); as preview) {\n <path\n [attr.d]=\"preview.d\"\n fill=\"none\"\n [attr.stroke]=\"preview.color\"\n [attr.stroke-width]=\"edgeWidth()\"\n stroke-dasharray=\"6 5\"\n stroke-linecap=\"round\"\n pointer-events=\"none\"\n />\n }\n </svg>\n\n <ng-content />\n\n @for (item of renderedEdges(); track item.edge.id) {\n @if (item.label) {\n <div\n class=\"bg-surface-overlay text-foreground-muted border-border-muted pointer-events-none absolute rounded border px-1.5 py-0.5 text-[10px] whitespace-nowrap\"\n [style.left.px]=\"item.labelPosition.x\"\n [style.top.px]=\"item.labelPosition.y\"\n style=\"transform: translate(-50%, -50%)\"\n >\n {{ item.label }}\n </div>\n }\n }\n </div>\n\n @if (marqueeRect(); as rect) {\n <div\n class=\"border-primary bg-primary/15 pointer-events-none absolute border\"\n [style.left.px]=\"rect.x\"\n [style.top.px]=\"rect.y\"\n [style.width.px]=\"rect.width\"\n [style.height.px]=\"rect.height\"\n ></div>\n }\n\n <ng-content select=\"xui-graph-overlay, xui-graph-controls, xui-graph-minimap\" />\n `,\n styles: `\n @keyframes xui-graph-edge-flow {\n to {\n stroke-dashoffset: -16;\n }\n }\n\n .xui-graph-edge-flow {\n stroke-dasharray: 8 8;\n animation: xui-graph-edge-flow 0.6s linear infinite;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .xui-graph-edge-flow {\n animation: none;\n }\n }\n `,\n host: {\n '[class]': 'computedClass()',\n '[attr.tabindex]': '0',\n role: 'application',\n '(pointerdown)': 'onPointerDown($event)',\n '(pointermove)': 'onPointerMove($event)',\n '(pointerup)': 'onPointerUp($event)',\n '(pointercancel)': 'onPointerUp($event)',\n '(wheel)': 'onWheel($event)',\n '(keydown)': 'onKeydown($event)',\n '(contextmenu)': 'onContextMenu($event)'\n },\n providers: [XuiNodeGraphStore],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiNodeGraph {\n private readonly config = injectXuiNodeGraphConfig();\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly uid = nextGraphId++;\n\n /** Pointer position where the current gesture began, in client coordinates. */\n private gestureOrigin: XuiGraphPoint = { x: 0, y: 0 };\n private gesture: Gesture = 'none';\n private gestureMoved = false;\n\n private readonly marqueeState = signal<XuiGraphRect | null>(null);\n\n /** The store for this canvas. Use it to drive the view from a host component. */\n readonly store = inject(XuiNodeGraphStore);\n\n readonly class = input<ClassValue>('');\n\n /** The wires to draw. Never mutated — see `connect`. */\n readonly edges = input<readonly XuiGraphEdge[]>([]);\n\n /** Pan and zoom. Two-way bindable, so a host can save and restore the view. */\n readonly viewport = model<XuiGraphViewport>({ x: 0, y: 0, zoom: 1 });\n\n readonly routing = input<XuiGraphRouting>(this.config.routing);\n readonly background = input<XuiGraphBackground>(this.config.background);\n readonly marker = input<XuiGraphMarker>(this.config.marker);\n\n readonly gridSize = input<number, NumberInput>(this.config.gridSize, { transform: numberAttribute });\n\n readonly snapToGrid = input<boolean, BooleanInput>(this.config.snapToGrid, { transform: booleanAttribute });\n\n readonly minZoom = input<number, NumberInput>(this.config.minZoom, { transform: numberAttribute });\n readonly maxZoom = input<number, NumberInput>(this.config.maxZoom, { transform: numberAttribute });\n\n readonly edgeWidth = input<number, NumberInput>(this.config.edgeWidth, { transform: numberAttribute });\n readonly portSize = input<number, NumberInput>(this.config.portSize, { transform: numberAttribute });\n readonly portShape = input<XuiGraphPortShape>(this.config.portShape);\n readonly portColor = input<string>(this.config.portColor);\n\n /** Data-type registry: colour, glyph and label per `dataType`. */\n readonly portTypes = input<Record<string, XuiGraphPortType>>(this.config.portTypes);\n\n readonly allowSelfConnection = input<boolean, BooleanInput>(this.config.allowSelfConnection, {\n transform: booleanAttribute\n });\n\n readonly enforcePortTypes = input<boolean, BooleanInput>(this.config.enforcePortTypes, {\n transform: booleanAttribute\n });\n\n /** Last say on whether a connection may be made. Runs after the built-in rules. */\n readonly isValidConnection = input<XuiGraphConnectionValidator>();\n\n /** Read-only canvas: pan and zoom still work, editing does not. */\n readonly locked = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Dragging empty canvas pans. Turn it off to make dragging a marquee select instead. */\n readonly panOnDrag = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /**\n * `wheel` zooms on a bare wheel, as node editors do. `ctrl-wheel` reserves the\n * bare wheel for panning and zooms only with the modifier, as design tools do.\n */\n readonly zoomActivation = input<'wheel' | 'ctrl-wheel'>('wheel');\n\n readonly zoomOnScroll = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** A connection that passed every rule. The host decides whether to add it. */\n readonly connect = output<XuiGraphConnection>();\n\n /** A wire dropped on empty canvas — the hook for \"drag out to create a node\". */\n readonly connectionDrop = output<XuiGraphConnectionDrop>();\n\n readonly edgeClick = output<XuiGraphEdge>();\n\n /** Fired once per drag, when the pointer is released. */\n readonly nodeMove = output<XuiGraphNodeMove>();\n\n readonly selectionChange = output<{ nodes: string[]; edges: string[] }>();\n\n /** Delete or Backspace over the canvas. The host performs the removal. */\n readonly deleteSelection = output<{ nodes: string[]; edges: string[] }>();\n\n readonly canvasContextMenu = output<{ event: MouseEvent; position: XuiGraphPoint }>();\n\n protected readonly Math = Math;\n protected readonly arrowId = `xui-graph-arrow-${this.uid}`;\n protected readonly arrowClosedId = `xui-graph-arrow-closed-${this.uid}`;\n protected readonly dotId = `xui-graph-dot-${this.uid}`;\n\n protected readonly marqueeRect = computed(() => {\n const rect = this.marqueeState();\n\n if (!rect) {\n return null;\n }\n\n const origin = this.store.toSurfacePoint(rect);\n const { zoom } = this.viewport();\n\n return { x: origin.x, y: origin.y, width: rect.width * zoom, height: rect.height * zoom };\n });\n\n private readonly settings = computed<XuiGraphSettings>(() => ({\n routing: this.routing(),\n gridSize: this.gridSize(),\n snapToGrid: this.snapToGrid(),\n minZoom: this.minZoom(),\n maxZoom: this.maxZoom(),\n stubLength: this.config.stubLength,\n cornerRadius: this.config.cornerRadius,\n curvature: this.config.curvature,\n edgeWidth: this.edgeWidth(),\n portSize: this.portSize(),\n portShape: this.portShape(),\n portColor: this.portColor(),\n portTypes: this.portTypes(),\n allowSelfConnection: this.allowSelfConnection(),\n enforcePortTypes: this.enforcePortTypes(),\n isValidConnection: this.isValidConnection(),\n locked: this.locked()\n }));\n\n private readonly routeOptions = computed<XuiGraphRouteOptions>(() => ({\n stubLength: this.config.stubLength,\n cornerRadius: this.config.cornerRadius,\n curvature: this.config.curvature\n }));\n\n protected readonly canvasTransform = computed(() => {\n const { x, y, zoom } = this.viewport();\n\n return `translate(${x}px, ${y}px) scale(${zoom})`;\n });\n\n protected readonly renderedEdges = computed<RenderedEdge[]>(() => {\n const routing = this.routing();\n const options = this.routeOptions();\n const defaultWidth = this.edgeWidth();\n const defaultMarker = this.marker();\n const selected = this.store.selectedEdges();\n const rendered: RenderedEdge[] = [];\n\n for (const edge of this.edges()) {\n const sourceKey = xuiGraphPortKey(edge.source.nodeId, edge.source.portId);\n const targetKey = xuiGraphPortKey(edge.target.nodeId, edge.target.portId);\n const sourcePort = this.store.port(sourceKey);\n const targetPort = this.store.port(targetKey);\n const sourcePoint = this.store.portPoint(sourceKey);\n const targetPoint = this.store.portPoint(targetKey);\n\n // An edge naming a port that has not rendered yet is skipped rather than\n // guessed at, so a lazily-created node never draws a wire to the origin.\n if (!sourcePort || !targetPort || !sourcePoint || !targetPoint) {\n continue;\n }\n\n const edgeRouting = edge.routing ?? routing;\n const sourceSide = sourcePort.resolvedSide();\n const targetSide = targetPort.resolvedSide();\n const markerType = edge.marker ?? defaultMarker;\n\n rendered.push({\n edge,\n d: xuiGraphEdgePath(sourcePoint, sourceSide, targetPoint, targetSide, edgeRouting, options),\n color: edge.color ?? sourcePort.resolvedColor(),\n width: edge.width ?? defaultWidth,\n selected: selected.has(edge.id),\n dashArray: edge.dashed && !edge.animated ? '5 5' : null,\n animated: !!edge.animated,\n markerId: this.markerUrl(markerType),\n label: edge.label ?? null,\n labelPosition: xuiGraphEdgeMidpoint(sourcePoint, sourceSide, targetPoint, targetSide, edgeRouting, options)\n });\n }\n\n return rendered;\n });\n\n /** The wire that follows the pointer while a connection is being drawn. */\n protected readonly linkPreview = computed(() => {\n const linking = this.store.linking();\n\n if (!linking) {\n return null;\n }\n\n const port = this.store.port(linking.fromKey);\n const from = this.store.portPoint(linking.fromKey);\n\n if (!port || !from) {\n return null;\n }\n\n // Land on whichever port is hovered, so the preview snaps before release.\n const hoverPoint = linking.hoverKey ? this.store.portPoint(linking.hoverKey) : null;\n const hoverSide = linking.hoverKey ? this.store.port(linking.hoverKey)?.resolvedSide() : undefined;\n const to = hoverPoint ?? linking.pointer;\n const toSide = hoverSide ?? OPPOSITE[port.resolvedSide()];\n const valid = linking.hoverKey ? this.store.linkState(linking.hoverKey) === 'valid' : true;\n\n return {\n d: xuiGraphEdgePath(from, port.resolvedSide(), to, toSide, this.routing(), this.routeOptions()),\n color: valid ? port.resolvedColor() : 'var(--color-error)'\n };\n });\n\n protected readonly backgroundImage = computed(() => {\n const background = this.background();\n const step = this.gridSize() * this.viewport().zoom;\n\n // Below a few pixels a rule turns into noise, so it is dropped entirely.\n if (background === 'none' || step < 4) {\n return null;\n }\n\n if (background === 'dots') {\n return 'radial-gradient(circle, var(--color-border-strong) 1px, transparent 1px)';\n }\n\n return [\n 'linear-gradient(to right, var(--color-border-muted) 1px, transparent 1px)',\n 'linear-gradient(to bottom, var(--color-border-muted) 1px, transparent 1px)',\n 'linear-gradient(to right, var(--color-border) 1px, transparent 1px)',\n 'linear-gradient(to bottom, var(--color-border) 1px, transparent 1px)'\n ].join(', ');\n });\n\n protected readonly backgroundSize = computed(() => {\n const step = this.gridSize() * this.viewport().zoom;\n const major = step * this.config.gridMajorEvery;\n\n return this.background() === 'dots'\n ? `${step}px ${step}px`\n : `${step}px ${step}px, ${step}px ${step}px, ${major}px ${major}px, ${major}px ${major}px`;\n });\n\n protected readonly backgroundPosition = computed(() => {\n const { x, y } = this.viewport();\n const offset = `${x}px ${y}px`;\n\n return this.background() === 'dots' ? offset : `${offset}, ${offset}, ${offset}, ${offset}`;\n });\n\n protected readonly computedClass = computed(() =>\n xui(\n // The canvas is focusable so its shortcuts work, but draws no focus ring:\n // a ring around the whole editor reads as a selection the user did not make,\n // and every element inside it that can hold focus rings on its own.\n 'bg-background relative block touch-none overflow-hidden outline-none',\n this.class()\n )\n );\n\n constructor() {\n this.store.configure({\n settings: this.settings,\n viewport: this.viewport,\n edges: this.edges,\n listeners: {\n connect: connection => this.connect.emit(connection),\n connectionDrop: drop => this.connectionDrop.emit(drop),\n nodeMove: move => this.nodeMove.emit(move),\n selectionChange: () =>\n this.selectionChange.emit({\n nodes: [...this.store.selectedNodes()],\n edges: [...this.store.selectedEdges()]\n })\n }\n });\n\n this.store.setSurface(this.element);\n\n const observer = new ResizeObserver(() =>\n this.store.surfaceSize.set({ width: this.element.clientWidth, height: this.element.clientHeight })\n );\n\n observer.observe(this.element);\n inject(DestroyRef).onDestroy(() => observer.disconnect());\n }\n\n /** Frame every node, leaving `padding` screen pixels of margin. */\n fitView(padding?: number): void {\n this.store.fitView(padding);\n }\n\n zoomIn(): void {\n this.store.zoomBy(this.config.zoomStep);\n }\n\n zoomOut(): void {\n this.store.zoomBy(1 / this.config.zoomStep);\n }\n\n /** Return to 1:1 without moving the centre of the view. */\n resetZoom(): void {\n this.store.zoomTo(1);\n }\n\n private markerUrl(marker: XuiGraphMarker): string | null {\n switch (marker) {\n case 'arrow':\n return `url(#${this.arrowId})`;\n case 'arrow-closed':\n return `url(#${this.arrowClosedId})`;\n case 'dot':\n return `url(#${this.dotId})`;\n default:\n return null;\n }\n }\n\n protected onEdgePointerDown(edge: XuiGraphEdge, event: PointerEvent): void {\n if (event.button !== 0 || this.locked()) {\n return;\n }\n\n event.stopPropagation();\n this.store.selectEdge(edge.id, event.shiftKey || event.ctrlKey || event.metaKey);\n this.edgeClick.emit(edge);\n }\n\n /**\n * Presses that reach here landed on empty canvas — nodes, ports and edges all\n * stop propagation — so this only ever starts a pan or a marquee.\n */\n protected onPointerDown(event: PointerEvent): void {\n const middle = event.button === 1;\n\n if (event.button !== 0 && !middle) {\n return;\n }\n\n // Overlay furniture sits above the canvas but still bubbles to it. Capturing\n // the pointer here would retarget the release and the button would never see\n // a click at all, so the whole overlay layer is left alone.\n if ((event.target as HTMLElement).closest('[data-xui-graph-overlay]')) {\n return;\n }\n\n this.element.focus({ preventScroll: true });\n this.element.setPointerCapture(event.pointerId);\n this.gestureOrigin = { x: event.clientX, y: event.clientY };\n this.gestureMoved = false;\n\n // Middle-drag always pans, whatever the primary gesture is bound to;\n // shift inverts the primary gesture, which is the convention everywhere.\n const pan = middle || this.panOnDrag() !== event.shiftKey;\n\n if (pan) {\n this.gesture = 'pan';\n return;\n }\n\n this.gesture = 'marquee';\n\n const start = this.store.toGraphPoint(event.clientX, event.clientY);\n this.marqueeState.set({ x: start.x, y: start.y, width: 0, height: 0 });\n }\n\n protected onPointerMove(event: PointerEvent): void {\n if (this.gesture === 'none') {\n return;\n }\n\n const dx = event.clientX - this.gestureOrigin.x;\n const dy = event.clientY - this.gestureOrigin.y;\n\n if (Math.abs(dx) > 2 || Math.abs(dy) > 2) {\n this.gestureMoved = true;\n }\n\n if (this.gesture === 'pan') {\n this.store.panBy(dx, dy);\n this.gestureOrigin = { x: event.clientX, y: event.clientY };\n return;\n }\n\n const start = this.store.toGraphPoint(this.gestureOrigin.x, this.gestureOrigin.y);\n const current = this.store.toGraphPoint(event.clientX, event.clientY);\n\n this.marqueeState.set({\n x: Math.min(start.x, current.x),\n y: Math.min(start.y, current.y),\n width: Math.abs(current.x - start.x),\n height: Math.abs(current.y - start.y)\n });\n }\n\n protected onPointerUp(event: PointerEvent): void {\n if (this.gesture === 'none') {\n return;\n }\n\n this.element.releasePointerCapture(event.pointerId);\n\n const rect = untracked(this.marqueeState);\n const gesture = this.gesture;\n\n this.gesture = 'none';\n this.marqueeState.set(null);\n\n if (gesture === 'marquee' && rect && this.gestureMoved) {\n this.store.selectInRect(rect, event.shiftKey || event.ctrlKey || event.metaKey);\n return;\n }\n\n // A press that never moved is a click on the backdrop: deselect.\n if (!this.gestureMoved) {\n this.store.clearSelection();\n }\n }\n\n protected onWheel(event: WheelEvent): void {\n if (!this.zoomOnScroll()) {\n return;\n }\n\n const rect = this.element.getBoundingClientRect();\n const anchor = { x: event.clientX - rect.left, y: event.clientY - rect.top };\n\n if (this.zoomActivation() === 'ctrl-wheel' && !event.ctrlKey && !event.metaKey) {\n event.preventDefault();\n this.store.panBy(-event.deltaX, -event.deltaY);\n return;\n }\n\n event.preventDefault();\n\n // Exponential in the raw delta so a trackpad's fine-grained events and a\n // mouse wheel's coarse notches both feel proportional.\n this.store.zoomBy(Math.exp(-clamp(event.deltaY, -120, 120) * 0.0025), anchor);\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const modifier = event.ctrlKey || event.metaKey;\n\n if (modifier && event.key.toLowerCase() === 'a') {\n event.preventDefault();\n this.store.selectAll();\n return;\n }\n\n if (event.key === 'Escape') {\n this.store.endLink(null);\n this.store.clearSelection();\n return;\n }\n\n if ((event.key === 'Delete' || event.key === 'Backspace') && !this.locked()) {\n const nodes = [...this.store.selectedNodes()];\n const edges = [...this.store.selectedEdges()];\n\n if (nodes.length || edges.length) {\n event.preventDefault();\n this.deleteSelection.emit({ nodes, edges });\n }\n\n return;\n }\n\n const nudge = ARROW_NUDGE[event.key];\n\n if (nudge && !this.locked() && this.store.selectedNodes().size > 0) {\n event.preventDefault();\n\n // Shift steps a whole grid cell; a bare arrow moves by one unit, or by the\n // grid when snapping is on and any smaller step would be discarded anyway.\n const step = event.shiftKey || this.snapToGrid() ? this.gridSize() : 1;\n const first = [...this.store.selectedNodes()][0];\n\n this.store.beginNodeDrag(first);\n this.store.dragNodesBy({ x: nudge.x * step, y: nudge.y * step });\n this.store.endNodeDrag();\n }\n }\n\n protected onContextMenu(event: MouseEvent): void {\n this.canvasContextMenu.emit({ event, position: this.store.toGraphPoint(event.clientX, event.clientY) });\n }\n}\n\nconst OPPOSITE = { left: 'right', right: 'left', top: 'bottom', bottom: 'top' } as const;\n\nconst ARROW_NUDGE: Record<string, XuiGraphPoint | undefined> = {\n ArrowLeft: { x: -1, y: 0 },\n ArrowRight: { x: 1, y: 0 },\n ArrowUp: { x: 0, y: -1 },\n ArrowDown: { x: 0, y: 1 }\n};\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, value));\n}\n","import { XuiGraphControls } from './lib/graph-controls';\nimport { XuiGraphGroup } from './lib/graph-group';\nimport { XuiGraphMinimap } from './lib/graph-minimap';\nimport { XuiGraphNode } from './lib/graph-node';\nimport {\n XuiGraphNodeActions,\n XuiGraphNodeHeader,\n XuiGraphNodePreview,\n XuiGraphNoDrag,\n XuiGraphOverlay\n} from './lib/graph-node-slots';\nimport { XuiGraphPort } from './lib/graph-port';\nimport { XuiNodeGraph } from './lib/node-graph';\n\nexport * from './lib/graph-controls';\nexport * from './lib/graph-group';\nexport * from './lib/graph-minimap';\nexport * from './lib/graph-node';\nexport * from './lib/graph-node-slots';\nexport * from './lib/graph-port';\nexport * from './lib/node-graph';\nexport * from './lib/node-graph-store';\nexport * from './lib/node-graph.routing';\nexport * from './lib/node-graph.token';\nexport * from './lib/node-graph.types';\n\nexport const XuiNodeGraphImports = [\n XuiNodeGraph,\n XuiGraphNode,\n XuiGraphPort,\n XuiGraphGroup,\n XuiGraphControls,\n XuiGraphMinimap,\n XuiGraphNodeHeader,\n XuiGraphNodeActions,\n XuiGraphNodePreview,\n XuiGraphNoDrag,\n XuiGraphOverlay\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAiPA;;;;;;AAMG;AACG,SAAU,eAAe,CAAC,MAAc,EAAE,MAAc,EAAA;IAC5D,OAAO,CAAA,EAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAA,CAAA,EAAI,MAAM,CAAA,CAAE;AAC/C;;AClKA;;;;;AAKG;MAEU,iBAAiB,CAAA;IACpB,cAAc,GAAoC,IAAI;IACtD,SAAS,GAAkC,I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EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IAC1B,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE;IACxB,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;CACxB;AAED,SAAS,KAAK,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAA;AACpD,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAC5C;;AC3rBO,MAAM,mBAAmB,GAAG;IACjC,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,eAAe;IACf,kBAAkB;IAClB,mBAAmB;IACnB,mBAAmB;IACnB,cAAc;IACd;;;ACrCF;;AAEG;;;;"}
1
+ {"version":3,"file":"xui-node-graph.mjs","sources":["../../../../../../libs/ui/node-graph/xui/src/lib/node-graph.types.ts","../../../../../../libs/ui/node-graph/xui/src/lib/node-graph-store.ts","../../../../../../libs/ui/node-graph/xui/src/lib/node-graph.token.ts","../../../../../../libs/ui/node-graph/xui/src/lib/graph-controls.ts","../../../../../../libs/ui/node-graph/xui/src/lib/graph-group.ts","../../../../../../libs/ui/node-graph/xui/src/lib/graph-minimap.ts","../../../../../../libs/ui/node-graph/xui/src/lib/graph-node.token.ts","../../../../../../libs/ui/node-graph/xui/src/lib/graph-port.ts","../../../../../../libs/ui/node-graph/xui/src/lib/graph-node.ts","../../../../../../libs/ui/node-graph/xui/src/lib/graph-node-slots.ts","../../../../../../libs/ui/node-graph/xui/src/lib/node-graph.routing.ts","../../../../../../libs/ui/node-graph/xui/src/lib/node-graph.ts","../../../../../../libs/ui/node-graph/xui/src/index.ts","../../../../../../libs/ui/node-graph/xui/src/xui-node-graph.ts"],"sourcesContent":["import type { Signal } from '@angular/core';\n\n/** A point in *graph space* — the untransformed coordinate system nodes live in. */\nexport interface XuiGraphPoint {\n x: number;\n y: number;\n}\n\n/** A size in graph space. Screen pixels only match at zoom 1. */\nexport interface XuiGraphSize {\n width: number;\n height: number;\n}\n\nexport interface XuiGraphRect extends XuiGraphPoint, XuiGraphSize {}\n\n/**\n * The pan/zoom state of the canvas. `x`/`y` are a *screen-pixel* translation\n * applied after scaling, so `screen = graph * zoom + pan`.\n */\nexport interface XuiGraphViewport extends XuiGraphPoint {\n zoom: number;\n}\n\n/**\n * Which way data flows through a port. `inout` is the bidirectional case that\n * electrical schematics need — a terminal is neither a source nor a sink, and a\n * wire may be drawn from either end.\n */\nexport type XuiGraphPortDirection = 'input' | 'output' | 'inout';\n\n/** Which edge of the node the connector sits on. Drives layout and edge routing. */\nexport type XuiGraphPortSide = 'left' | 'right' | 'top' | 'bottom';\n\n/**\n * The connector glyph. `circle` reads as a data socket (VFX/shader graphs),\n * `pin` as a component lead (schematics), and the rest are available to encode a\n * second dimension — by convention `diamond` marks an optional/nullable input.\n */\nexport type XuiGraphPortShape = 'circle' | 'square' | 'diamond' | 'triangle' | 'pin';\n\n/** How ports are arranged inside a node's body. */\nexport type XuiGraphPortLayout = 'stacked' | 'columns';\n\n/**\n * Edge geometry.\n *\n * - `bezier` — cubic curve leaving each port along its normal. The node-editor default.\n * - `orthogonal` — axis-aligned segments with sharp corners. The schematic default.\n * - `smoothstep` — orthogonal with rounded corners.\n * - `straight` — a single line.\n */\nexport type XuiGraphRouting = 'bezier' | 'orthogonal' | 'smoothstep' | 'straight';\n\n/** Decoration drawn at the target end of an edge. */\nexport type XuiGraphMarker = 'none' | 'arrow' | 'arrow-closed' | 'dot';\n\n/** The canvas backdrop. `grid` draws a minor/major rule pair, as schematic paper does. */\nexport type XuiGraphBackground = 'none' | 'dots' | 'grid';\n\n/** Addresses one connector: a port is only unique within its node. */\nexport interface XuiGraphPortRef {\n nodeId: string;\n portId: string;\n}\n\n/** A connection the user has drawn but that the model does not contain yet. */\nexport interface XuiGraphConnection {\n source: XuiGraphPortRef;\n target: XuiGraphPortRef;\n}\n\n/**\n * A wire between two ports. Purely declarative and serialisable — geometry is\n * derived from the live position of the two ports, never stored here.\n */\nexport interface XuiGraphEdge {\n id: string;\n\n /** Where the wire starts. For `inout` ports this is simply the end drawn first. */\n source: XuiGraphPortRef;\n target: XuiGraphPortRef;\n\n /** Overrides the routing the graph is configured with, per edge. */\n routing?: XuiGraphRouting;\n\n /** Overrides the colour inherited from the source port's data type. */\n color?: string;\n\n /** Text rendered at the midpoint of the wire. */\n label?: string;\n\n /** Marching-ants animation, for showing that data or current is flowing. */\n animated?: boolean;\n\n dashed?: boolean;\n\n /** Stroke width in graph units. Defaults to the graph's `edgeWidth`. */\n width?: number;\n\n marker?: XuiGraphMarker;\n\n /** Arbitrary payload carried through selection and click events. */\n data?: unknown;\n}\n\n/**\n * A flattened, framework-free view of a port, handed to\n * {@link XuiGraphConnectionValidator} so validation logic never touches\n * component instances.\n */\nexport interface XuiGraphPortDescriptor extends XuiGraphPortRef {\n direction: XuiGraphPortDirection;\n side: XuiGraphPortSide;\n dataType: string | undefined;\n maxConnections: number;\n disabled: boolean;\n\n /** How many edges already terminate here. */\n connections: number;\n}\n\n/** The two ends of a proposed connection, resolved against the live port registry. */\nexport interface XuiGraphConnectionContext {\n source: XuiGraphPortDescriptor;\n target: XuiGraphPortDescriptor;\n edges: readonly XuiGraphEdge[];\n}\n\n/**\n * Returns whether a connection may be made. Runs *after* the built-in rules\n * (direction, arity, duplicates, data type), so it can only narrow them.\n */\nexport type XuiGraphConnectionValidator = (\n connection: XuiGraphConnection,\n context: XuiGraphConnectionContext\n) => boolean;\n\n/** Emitted when a wire is dropped on empty canvas, for \"drag out to create a node\". */\nexport interface XuiGraphConnectionDrop {\n source: XuiGraphPortRef;\n\n /**\n * The port the wire came from, described in full so a create menu can filter\n * itself to what would actually connect without looking the port up again.\n */\n port: XuiGraphPortDescriptor;\n\n /** Where the pointer was released, in graph space — where a new node belongs. */\n position: XuiGraphPoint;\n\n /**\n * The same release point relative to the canvas element's top-left corner, so\n * a popup can be placed without converting through the viewport.\n */\n surfacePosition: XuiGraphPoint;\n}\n\n/** One node's resting place after a drag. */\nexport interface XuiGraphNodeMoved {\n nodeId: string;\n position: XuiGraphPoint;\n\n /**\n * Innermost group frame the node's centre now sits inside, ignoring the nodes\n * that moved with it — the hook for \"drag a node into a frame to join it\".\n *\n * `undefined` when it came to rest outside every frame, and always `undefined`\n * for a group drag, where no node changed hands.\n */\n group: string | undefined;\n}\n\n/** Emitted whenever a drag settles, with the final position of every moved node. */\nexport interface XuiGraphNodeMove {\n /** Whether the gesture started on a node (or node selection) or on a group frame. */\n source: 'node' | 'group';\n nodes: readonly XuiGraphNodeMoved[];\n}\n\n/**\n * The contract {@link XuiGraphNode} fulfils for the store.\n *\n * Declared here rather than imported from the component so that the store, the\n * routing helpers and the node itself do not form an import cycle.\n *\n * @internal\n */\nexport interface XuiGraphNodeHandle {\n readonly nodeId: Signal<string>;\n readonly position: Signal<XuiGraphPoint>;\n readonly size: Signal<XuiGraphSize>;\n readonly locked: Signal<boolean>;\n\n /** Id of the group frame this node belongs to, if any. */\n readonly group: Signal<string | undefined>;\n\n readonly element: HTMLElement;\n moveTo(point: XuiGraphPoint): void;\n}\n\n/**\n * The contract {@link XuiGraphGroup} fulfils for the store.\n *\n * A group owns no geometry of its own — it is sized from its members — so the\n * store keeps only the knobs it needs in order to compute that box itself.\n *\n * @internal\n */\nexport interface XuiGraphGroupHandle {\n readonly groupId: Signal<string>;\n\n /** Blank margin between the members' bounding box and the frame, in graph units. */\n readonly padding: Signal<number>;\n\n /** Extra room reserved above the members for the frame's title bar. */\n readonly headerHeight: Signal<number>;\n\n readonly locked: Signal<boolean>;\n}\n\n/**\n * The contract {@link XuiGraphPort} fulfils for the store.\n *\n * @internal\n */\nexport interface XuiGraphPortHandle {\n readonly key: string;\n readonly nodeId: Signal<string>;\n readonly portId: Signal<string>;\n readonly direction: Signal<XuiGraphPortDirection>;\n readonly resolvedSide: Signal<XuiGraphPortSide>;\n readonly dataType: Signal<string | undefined>;\n readonly resolvedMaxConnections: Signal<number>;\n readonly disabled: Signal<boolean>;\n readonly resolvedColor: Signal<string>;\n\n /** Connector centre relative to the owning node's top-left corner, in graph units. */\n readonly offset: Signal<XuiGraphPoint>;\n}\n\n/**\n * Composite key for the port registry. A port id is only unique within its node.\n *\n * Length-prefixed so the pair can never be ambiguous: a node called `a` with a\n * port called `b:c` and a node called `a:b` with a port called `c` must not\n * collide, which any plain separator would allow.\n */\nexport function xuiGraphPortKey(nodeId: string, portId: string): string {\n return `${nodeId.length}:${nodeId}:${portId}`;\n}\n","import { computed, inject, Injectable, signal, untracked, type Signal, type WritableSignal } from '@angular/core';\nimport type { XuiGraphPortType } from './node-graph.token';\nimport type {\n XuiGraphConnection,\n XuiGraphConnectionDrop,\n XuiGraphConnectionValidator,\n XuiGraphEdge,\n XuiGraphGroupHandle,\n XuiGraphNodeHandle,\n XuiGraphNodeMove,\n XuiGraphPoint,\n XuiGraphPortDescriptor,\n XuiGraphPortHandle,\n XuiGraphPortRef,\n XuiGraphPortShape,\n XuiGraphRect,\n XuiGraphRouting,\n XuiGraphViewport\n} from './node-graph.types';\nimport { xuiGraphPortKey } from './node-graph.types';\n\n/**\n * The subset of the graph's inputs that the store, the nodes and the ports all\n * need to see. Owned by {@link XuiNodeGraph}, which hands the store a signal of\n * it rather than pushing values in from an effect.\n *\n * @internal\n */\nexport interface XuiGraphSettings {\n routing: XuiGraphRouting;\n gridSize: number;\n snapToGrid: boolean;\n minZoom: number;\n maxZoom: number;\n stubLength: number;\n cornerRadius: number;\n curvature: number;\n edgeWidth: number;\n portSize: number;\n portShape: XuiGraphPortShape;\n portColor: string;\n portTypes: Record<string, XuiGraphPortType>;\n allowSelfConnection: boolean;\n enforcePortTypes: boolean;\n isValidConnection: XuiGraphConnectionValidator | undefined;\n locked: boolean;\n}\n\n/** A wire being dragged out of a port. @internal */\nexport interface XuiGraphLinking {\n /** The port the drag started at — not necessarily the source end. */\n from: XuiGraphPortRef;\n fromKey: string;\n\n /**\n * `true` when the drag began at an input, so the fixed end is the *target* of\n * the connection that will be produced. Dragging backwards off an input is how\n * every node editor lets you re-route an existing wire.\n */\n reversed: boolean;\n\n /** Live pointer position in graph space. */\n pointer: XuiGraphPoint;\n\n /** Key of the port under the pointer, if it is a legal landing spot. */\n hoverKey: string | null;\n}\n\n/** A drag in flight, with the group frames frozen as they stood when it began. @internal */\nexport interface XuiGraphDragState {\n source: 'node' | 'group';\n\n /** Ids of the nodes actually moving — locked ones are left out. */\n ids: ReadonlySet<string>;\n frames: ReadonlyMap<string, XuiGraphRect>;\n}\n\n/** How a port should render while a wire is being dragged. */\nexport type XuiGraphPortLinkState = 'idle' | 'source' | 'valid' | 'invalid';\n\n/** Callbacks {@link XuiNodeGraph} registers so the store can raise its outputs. @internal */\nexport interface XuiGraphStoreListeners {\n connect(connection: XuiGraphConnection): void;\n connectionDrop(drop: XuiGraphConnectionDrop): void;\n nodeMove(move: XuiGraphNodeMove): void;\n selectionChange(): void;\n}\n\n/**\n * Reactive state shared by a graph and everything inside it.\n *\n * Provided by {@link XuiNodeGraph}, so every node, port and edge in one canvas\n * sees the same instance and two graphs on a page never interfere.\n */\n@Injectable()\nexport class XuiNodeGraphStore {\n private settingsSource: Signal<XuiGraphSettings> | null = null;\n private listeners: XuiGraphStoreListeners | null = null;\n private surface: HTMLElement | null = null;\n\n /** Node top-left positions captured at the start of a drag, keyed by node id. */\n private dragOrigins = new Map<string, XuiGraphPoint>();\n private dragMoved = false;\n\n /**\n * The drag in flight, including every group frame as it stood when the drag\n * began. Reactive, because those frozen frames are what the groups *render*\n * while a node is being dragged, not merely what the drop is judged against.\n *\n * Both uses come from the same problem: a frame is sized from its members, so\n * a live frame stretches to follow the very node being dragged out of it and\n * then snaps back on release. Pinning the frame for the duration makes the\n * node visibly leave a box that stays put — and makes the box you can see the\n * box that decides where the node lands.\n */\n private readonly drag = signal<XuiGraphDragState | null>(null);\n\n /**\n * The graph binds its own `viewport` model and `edges` input here, so those\n * stay the single source of truth and the store never has to mirror them\n * through an effect that could fight the host for ownership.\n */\n private viewportSource: WritableSignal<XuiGraphViewport> | null = null;\n private edgesSource: Signal<readonly XuiGraphEdge[]> | null = null;\n private readonly ownViewport = signal<XuiGraphViewport>({ x: 0, y: 0, zoom: 1 });\n\n readonly viewport: Signal<XuiGraphViewport> = computed(() => (this.viewportSource ?? this.ownViewport)());\n readonly edges: Signal<readonly XuiGraphEdge[]> = computed(() => this.edgesSource?.() ?? EMPTY_EDGES);\n readonly selectedNodes = signal<ReadonlySet<string>>(new Set());\n readonly selectedEdges = signal<ReadonlySet<string>>(new Set());\n readonly linking = signal<XuiGraphLinking | null>(null);\n\n /** Size of the visible canvas in screen pixels; kept current by a ResizeObserver. */\n readonly surfaceSize = signal({ width: 0, height: 0 });\n\n private readonly nodeMap = signal<ReadonlyMap<string, XuiGraphNodeHandle>>(new Map());\n private readonly portMap = signal<ReadonlyMap<string, XuiGraphPortHandle>>(new Map());\n private readonly groupMap = signal<ReadonlyMap<string, XuiGraphGroupHandle>>(new Map());\n\n readonly nodes = computed(() => [...this.nodeMap().values()]);\n readonly ports = computed(() => [...this.portMap().values()]);\n readonly groups = computed(() => [...this.groupMap().values()]);\n\n readonly settings = computed<XuiGraphSettings>(() => this.settingsSource?.() ?? FALLBACK_SETTINGS);\n\n /** How many edges terminate at each port, keyed the same way as the registry. */\n private readonly connectionCounts = computed(() => {\n const counts = new Map<string, number>();\n\n for (const edge of this.edges()) {\n for (const ref of [edge.source, edge.target]) {\n const key = xuiGraphPortKey(ref.nodeId, ref.portId);\n counts.set(key, (counts.get(key) ?? 0) + 1);\n }\n }\n\n return counts;\n });\n\n /**\n * Wire the store to the graph that provides it. Called from the graph's\n * constructor, before anything can read the bound signals.\n *\n * @internal\n */\n configure(bindings: {\n settings: Signal<XuiGraphSettings>;\n viewport: WritableSignal<XuiGraphViewport>;\n edges: Signal<readonly XuiGraphEdge[]>;\n listeners: XuiGraphStoreListeners;\n }): void {\n this.settingsSource = bindings.settings;\n this.viewportSource = bindings.viewport;\n this.edgesSource = bindings.edges;\n this.listeners = bindings.listeners;\n }\n\n /** Writes through to whichever signal is bound as the viewport. */\n private updateViewport(next: (current: XuiGraphViewport) => XuiGraphViewport): void {\n const target = this.viewportSource ?? this.ownViewport;\n\n target.set(next(untracked(target)));\n }\n\n /** @internal */\n setSurface(element: HTMLElement): void {\n this.surface = element;\n }\n\n // ------------------------------------------------------------------ registry\n\n /** @internal */\n registerNode(node: XuiGraphNodeHandle): void {\n this.nodeMap.update(map => new Map(map).set(node.nodeId(), node));\n }\n\n /** @internal */\n unregisterNode(node: XuiGraphNodeHandle): void {\n this.nodeMap.update(map => {\n const next = new Map(map);\n\n // Guard against a re-registered id: a node that has already been replaced\n // by another instance must not be deleted by its predecessor's teardown.\n if (next.get(node.nodeId()) === node) {\n next.delete(node.nodeId());\n }\n\n return next;\n });\n }\n\n /** @internal */\n registerPort(port: XuiGraphPortHandle): void {\n this.portMap.update(map => new Map(map).set(port.key, port));\n }\n\n /** @internal */\n unregisterPort(port: XuiGraphPortHandle): void {\n this.portMap.update(map => {\n const next = new Map(map);\n\n if (next.get(port.key) === port) {\n next.delete(port.key);\n }\n\n return next;\n });\n }\n\n /** @internal */\n registerGroup(group: XuiGraphGroupHandle): void {\n this.groupMap.update(map => new Map(map).set(group.groupId(), group));\n }\n\n /** @internal */\n unregisterGroup(group: XuiGraphGroupHandle): void {\n this.groupMap.update(map => {\n const next = new Map(map);\n\n if (next.get(group.groupId()) === group) {\n next.delete(group.groupId());\n }\n\n return next;\n });\n }\n\n node(nodeId: string): XuiGraphNodeHandle | undefined {\n return this.nodeMap().get(nodeId);\n }\n\n port(key: string): XuiGraphPortHandle | undefined {\n return this.portMap().get(key);\n }\n\n /**\n * Absolute position of a connector in graph space.\n *\n * Composed from the node's position and the port's node-relative offset rather\n * than measured directly, so dragging a node re-routes its wires from a single\n * signal write with no DOM reads.\n */\n portPoint(key: string): XuiGraphPoint | null {\n const port = this.portMap().get(key);\n const node = port && this.nodeMap().get(port.nodeId());\n\n if (!port || !node) {\n return null;\n }\n\n const position = node.position();\n const offset = port.offset();\n\n return { x: position.x + offset.x, y: position.y + offset.y };\n }\n\n descriptor(key: string): XuiGraphPortDescriptor | null {\n const port = this.portMap().get(key);\n\n if (!port) {\n return null;\n }\n\n return {\n nodeId: port.nodeId(),\n portId: port.portId(),\n direction: port.direction(),\n side: port.resolvedSide(),\n dataType: port.dataType(),\n maxConnections: port.resolvedMaxConnections(),\n disabled: port.disabled(),\n connections: this.connectionCounts().get(key) ?? 0\n };\n }\n\n connectionCount(key: string): number {\n return this.connectionCounts().get(key) ?? 0;\n }\n\n // --------------------------------------------------------------- coordinates\n\n /** Client (viewport) coordinates to graph space. */\n toGraphPoint(clientX: number, clientY: number): XuiGraphPoint {\n const rect = this.surface?.getBoundingClientRect();\n const { x, y, zoom } = this.viewport();\n\n return {\n x: (clientX - (rect?.left ?? 0) - x) / zoom,\n y: (clientY - (rect?.top ?? 0) - y) / zoom\n };\n }\n\n /** Graph space to coordinates relative to the canvas element's top-left corner. */\n toSurfacePoint(point: XuiGraphPoint): XuiGraphPoint {\n const { x, y, zoom } = this.viewport();\n\n return { x: point.x * zoom + x, y: point.y * zoom + y };\n }\n\n /** Rounds to the nearest grid intersection when snapping is on. */\n snap(point: XuiGraphPoint): XuiGraphPoint {\n const { snapToGrid, gridSize } = this.settings();\n\n if (!snapToGrid || gridSize <= 0) {\n return point;\n }\n\n return { x: Math.round(point.x / gridSize) * gridSize, y: Math.round(point.y / gridSize) * gridSize };\n }\n\n // ------------------------------------------------------------------ viewport\n\n panBy(dx: number, dy: number): void {\n this.updateViewport(v => ({ ...v, x: v.x + dx, y: v.y + dy }));\n }\n\n /**\n * Scale about a fixed point, given in surface coordinates.\n *\n * Holding that point still is what makes wheel-zoom feel anchored to the\n * cursor instead of to the centre of the canvas.\n */\n zoomTo(zoom: number, anchor?: XuiGraphPoint): void {\n const { minZoom, maxZoom } = this.settings();\n\n this.updateViewport(v => {\n const next = Math.min(maxZoom, Math.max(minZoom, zoom));\n const size = this.surfaceSize();\n const point = anchor ?? { x: size.width / 2, y: size.height / 2 };\n const ratio = next / v.zoom;\n\n return { zoom: next, x: point.x - (point.x - v.x) * ratio, y: point.y - (point.y - v.y) * ratio };\n });\n }\n\n zoomBy(factor: number, anchor?: XuiGraphPoint): void {\n this.zoomTo(this.viewport().zoom * factor, anchor);\n }\n\n /** Bounding box of every node, or `null` while the graph is empty. */\n contentBounds(): XuiGraphRect | null {\n const nodes = this.nodes();\n\n if (nodes.length === 0) {\n return null;\n }\n\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n\n for (const node of nodes) {\n const { x, y } = node.position();\n const { width, height } = node.size();\n\n minX = Math.min(minX, x);\n minY = Math.min(minY, y);\n maxX = Math.max(maxX, x + width);\n maxY = Math.max(maxY, y + height);\n }\n\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };\n }\n\n /** Frame every node, leaving `padding` screen pixels of margin. */\n fitView(padding = 40): void {\n const bounds = this.contentBounds();\n const { width, height } = this.surfaceSize();\n\n if (!bounds || width === 0 || height === 0) {\n return;\n }\n\n const { minZoom, maxZoom } = this.settings();\n const scale = Math.min(\n (width - padding * 2) / Math.max(bounds.width, 1),\n (height - padding * 2) / Math.max(bounds.height, 1)\n );\n const zoom = Math.min(maxZoom, Math.max(minZoom, scale));\n\n this.updateViewport(() => ({\n zoom,\n x: width / 2 - (bounds.x + bounds.width / 2) * zoom,\n y: height / 2 - (bounds.y + bounds.height / 2) * zoom\n }));\n }\n\n /** Centre the viewport on a node without changing the zoom. */\n centerOn(nodeId: string): void {\n const node = this.nodeMap().get(nodeId);\n const { width, height } = this.surfaceSize();\n\n if (!node) {\n return;\n }\n\n const position = node.position();\n const size = node.size();\n\n this.updateViewport(v => ({\n ...v,\n x: width / 2 - (position.x + size.width / 2) * v.zoom,\n y: height / 2 - (position.y + size.height / 2) * v.zoom\n }));\n }\n\n // ----------------------------------------------------------------- selection\n\n isNodeSelected(nodeId: string): boolean {\n return this.selectedNodes().has(nodeId);\n }\n\n isEdgeSelected(edgeId: string): boolean {\n return this.selectedEdges().has(edgeId);\n }\n\n selectNode(nodeId: string, additive = false): void {\n this.selectedNodes.update(current => {\n if (!additive) {\n return current.size === 1 && current.has(nodeId) ? current : new Set([nodeId]);\n }\n\n const next = new Set(current);\n next.has(nodeId) ? next.delete(nodeId) : next.add(nodeId);\n\n return next;\n });\n\n if (!additive) {\n this.selectedEdges.set(new Set());\n }\n\n this.listeners?.selectionChange();\n }\n\n selectEdge(edgeId: string, additive = false): void {\n this.selectedEdges.update(current => {\n if (!additive) {\n return current.size === 1 && current.has(edgeId) ? current : new Set([edgeId]);\n }\n\n const next = new Set(current);\n next.has(edgeId) ? next.delete(edgeId) : next.add(edgeId);\n\n return next;\n });\n\n if (!additive) {\n this.selectedNodes.set(new Set());\n }\n\n this.listeners?.selectionChange();\n }\n\n setSelection(nodeIds: Iterable<string>, edgeIds: Iterable<string> = []): void {\n this.selectedNodes.set(new Set(nodeIds));\n this.selectedEdges.set(new Set(edgeIds));\n this.listeners?.selectionChange();\n }\n\n clearSelection(): void {\n if (this.selectedNodes().size === 0 && this.selectedEdges().size === 0) {\n return;\n }\n\n this.selectedNodes.set(new Set());\n this.selectedEdges.set(new Set());\n this.listeners?.selectionChange();\n }\n\n selectAll(): void {\n this.setSelection(\n this.nodes().map(node => node.nodeId()),\n this.edges().map(edge => edge.id)\n );\n }\n\n /** Select every node whose box intersects `rect`, in graph space. */\n selectInRect(rect: XuiGraphRect, additive = false): void {\n const hits = this.nodes()\n .filter(node => {\n const position = node.position();\n const size = node.size();\n\n return (\n position.x < rect.x + rect.width &&\n position.x + size.width > rect.x &&\n position.y < rect.y + rect.height &&\n position.y + size.height > rect.y\n );\n })\n .map(node => node.nodeId());\n\n this.setSelection(additive ? [...this.selectedNodes(), ...hits] : hits, additive ? this.selectedEdges() : []);\n }\n\n // -------------------------------------------------------------------- groups\n\n /** The nodes that declare themselves members of a group, in registration order. */\n nodesInGroup(groupId: string): XuiGraphNodeHandle[] {\n return this.nodes().filter(node => node.group() === groupId);\n }\n\n /**\n * The frame a group draws: its members' bounding box, grown by the group's own\n * padding and title bar. A group owns no geometry, so an empty one has no box\n * at all and renders nothing.\n *\n */\n groupBounds(groupId: string): XuiGraphRect | null {\n const group = this.groupMap().get(groupId);\n const members = this.nodesInGroup(groupId);\n\n if (!group || members.length === 0) {\n return null;\n }\n\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n\n for (const node of members) {\n const { x, y } = node.position();\n const { width, height } = node.size();\n\n minX = Math.min(minX, x);\n minY = Math.min(minY, y);\n maxX = Math.max(maxX, x + width);\n maxY = Math.max(maxY, y + height);\n }\n\n const padding = group.padding();\n const header = group.headerHeight();\n\n return {\n x: minX - padding,\n y: minY - padding - header,\n width: maxX - minX + padding * 2,\n height: maxY - minY + padding * 2 + header\n };\n }\n\n /**\n * The box a frame should be drawn at right now: its live bounds, except while a\n * node drag is in flight, when it is pinned to where it stood as that drag\n * began. A group being dragged is never pinned — it has to travel with the\n * members it is carrying.\n */\n groupFrame(groupId: string): XuiGraphRect | null {\n const drag = this.drag();\n\n if (drag?.source === 'node') {\n return drag.frames.get(groupId) ?? this.groupBounds(groupId);\n }\n\n return this.groupBounds(groupId);\n }\n\n /**\n * Frames that would take one of the nodes being dragged if it were released\n * now. Groups render this as a highlight, so which frame is about to claim the\n * node is visible before the button comes up rather than after.\n */\n readonly dropTargetGroups = computed<ReadonlySet<string>>(() => {\n const drag = this.drag();\n\n if (!drag || drag.source === 'group') {\n return EMPTY_IDS;\n }\n\n const frames = [...drag.frames];\n const targets = new Set<string>();\n\n for (const id of drag.ids) {\n const node = this.nodeMap().get(id);\n\n if (!node) {\n continue;\n }\n\n const position = node.position();\n const size = node.size();\n const hit = smallestContaining({ x: position.x + size.width / 2, y: position.y + size.height / 2 }, frames);\n\n if (hit) {\n targets.add(hit);\n }\n }\n\n return targets;\n });\n\n /**\n * Innermost group frame containing a point. Smallest-first, so a frame nested\n * inside another wins the node that lands in the overlap.\n */\n groupAt(point: XuiGraphPoint): string | undefined {\n const frames = this.groups()\n .map(group => [group.groupId(), this.groupBounds(group.groupId())] as const)\n .filter((entry): entry is readonly [string, XuiGraphRect] => !!entry[1]);\n\n return smallestContaining(point, frames);\n }\n\n // ------------------------------------------------------------------ dragging\n\n /**\n * Capture the starting position of everything a drag will move.\n *\n * Deltas are applied to these captured origins rather than accumulated onto\n * live positions, so snapping cannot compound rounding error over a long drag.\n */\n beginNodeDrag(nodeId: string): void {\n const selected = this.selectedNodes();\n\n this.captureDrag(selected.has(nodeId) ? selected : [nodeId], 'node');\n }\n\n /**\n * Drag a whole group: every member moves together, and the frame follows them\n * because it is sized from where they are.\n *\n * @internal\n */\n beginGroupDrag(groupId: string): void {\n this.captureDrag(\n this.nodesInGroup(groupId).map(node => node.nodeId()),\n 'group'\n );\n }\n\n private captureDrag(ids: Iterable<string>, source: 'node' | 'group'): void {\n const frames = new Map<string, XuiGraphRect>();\n\n this.dragOrigins = new Map();\n this.dragMoved = false;\n\n for (const group of this.groups()) {\n const bounds = this.groupBounds(group.groupId());\n\n if (bounds) {\n frames.set(group.groupId(), bounds);\n }\n }\n\n for (const id of ids) {\n const node = this.nodeMap().get(id);\n\n if (node && !node.locked()) {\n this.dragOrigins.set(id, node.position());\n }\n }\n\n this.drag.set({ source, ids: new Set(this.dragOrigins.keys()), frames });\n }\n\n /** Offset every dragged node from its captured origin, in graph units. */\n dragNodesBy(delta: XuiGraphPoint): void {\n if (delta.x !== 0 || delta.y !== 0) {\n this.dragMoved = true;\n }\n\n for (const [id, origin] of this.dragOrigins) {\n this.nodeMap()\n .get(id)\n ?.moveTo(this.snap({ x: origin.x + delta.x, y: origin.y + delta.y }));\n }\n }\n\n /** Ends the drag and raises `nodeMove`. Returns whether anything actually moved. */\n endNodeDrag(): boolean {\n const moved = this.dragMoved;\n const drag = this.drag();\n const source = drag?.source ?? 'node';\n\n if (moved) {\n const nodes = [...this.dragOrigins.keys()]\n .map(id => this.nodeMap().get(id))\n .filter((node): node is XuiGraphNodeHandle => !!node)\n .map(node => {\n const position = node.position();\n const size = node.size();\n // The centre, not the corner: a node half over a frame's edge reads as\n // being wherever the bulk of it sits.\n const centre = { x: position.x + size.width / 2, y: position.y + size.height / 2 };\n\n return {\n nodeId: node.nodeId(),\n position,\n // A group drag carries its own members around; none of them can have\n // changed hands, so there is nothing to report.\n group: source === 'group' || !drag ? undefined : smallestContaining(centre, drag.frames)\n };\n });\n\n this.listeners?.nodeMove({ source, nodes });\n }\n\n this.dragOrigins = new Map();\n this.dragMoved = false;\n this.drag.set(null);\n\n return moved;\n }\n\n // ------------------------------------------------------------------- linking\n\n /** @internal */\n beginLink(port: XuiGraphPortHandle, pointer: XuiGraphPoint): void {\n this.linking.set({\n from: { nodeId: port.nodeId(), portId: port.portId() },\n fromKey: port.key,\n reversed: port.direction() === 'input',\n pointer,\n hoverKey: null\n });\n }\n\n /** @internal */\n moveLink(pointer: XuiGraphPoint): void {\n this.linking.update(state => (state ? { ...state, pointer } : null));\n }\n\n /** @internal */\n setLinkHover(key: string | null): void {\n this.linking.update(state => (state ? { ...state, hoverKey: key } : null));\n }\n\n /**\n * Finish a link. Dropping on a legal port raises `connect`; dropping anywhere\n * else raises `connectionDrop` so the host can offer to create a node there.\n *\n * @internal\n */\n endLink(dropKey: string | null): void {\n const state = this.linking();\n this.linking.set(null);\n\n if (!state) {\n return;\n }\n\n const connection = dropKey && this.orient(state, dropKey);\n\n if (connection && this.canConnect(connection)) {\n this.listeners?.connect(connection);\n return;\n }\n\n if (!dropKey) {\n const port = this.descriptor(state.fromKey);\n\n if (port) {\n this.listeners?.connectionDrop({\n source: state.from,\n port,\n position: state.pointer,\n surfacePosition: this.toSurfacePoint(state.pointer)\n });\n }\n }\n }\n\n /** Resolve which end of a dragged wire is the source. */\n private orient(state: XuiGraphLinking, dropKey: string): XuiGraphConnection | null {\n const dropped = this.portMap().get(dropKey);\n\n if (!dropped) {\n return null;\n }\n\n const droppedRef = { nodeId: dropped.nodeId(), portId: dropped.portId() };\n\n return state.reversed ? { source: droppedRef, target: state.from } : { source: state.from, target: droppedRef };\n }\n\n /**\n * How a port should render while a wire is in flight — the affordance that\n * tells you where a wire may land before you release it.\n */\n linkState(key: string): XuiGraphPortLinkState {\n const state = this.linking();\n\n if (!state) {\n return 'idle';\n }\n\n if (state.fromKey === key) {\n return 'source';\n }\n\n const connection = this.orient(state, key);\n\n return connection && this.canConnect(connection) ? 'valid' : 'invalid';\n }\n\n /**\n * The full connection rule set: existence, arity, direction, duplicates and\n * data type, then the host's own validator, which can only narrow the result.\n */\n canConnect(connection: XuiGraphConnection): boolean {\n const settings = this.settings();\n\n if (settings.locked) {\n return false;\n }\n\n const sourceKey = xuiGraphPortKey(connection.source.nodeId, connection.source.portId);\n const targetKey = xuiGraphPortKey(connection.target.nodeId, connection.target.portId);\n\n if (sourceKey === targetKey) {\n return false;\n }\n\n const source = this.descriptor(sourceKey);\n const target = this.descriptor(targetKey);\n\n if (!source || !target || source.disabled || target.disabled) {\n return false;\n }\n\n if (!settings.allowSelfConnection && source.nodeId === target.nodeId) {\n return false;\n }\n\n // An `inout` port plays either role; a plain input can never be a source.\n if (source.direction === 'input' || target.direction === 'output') {\n return false;\n }\n\n if (source.connections >= source.maxConnections || target.connections >= target.maxConnections) {\n return false;\n }\n\n const edges = this.edges();\n const duplicate = edges.some(\n edge => samePort(edge.source, connection.source) && samePort(edge.target, connection.target)\n );\n\n if (duplicate) {\n return false;\n }\n\n // An undeclared type is a wildcard, so untyped graphs need no configuration.\n if (settings.enforcePortTypes && source.dataType && target.dataType && source.dataType !== target.dataType) {\n return false;\n }\n\n return settings.isValidConnection?.(connection, { source, target, edges }) ?? true;\n }\n}\n\n/**\n * The smallest of the frames containing a point, so a frame nested inside\n * another wins the node that lands in the overlap.\n */\nfunction smallestContaining(\n point: XuiGraphPoint,\n frames: Iterable<readonly [string, XuiGraphRect]>\n): string | undefined {\n let best: string | undefined;\n let bestArea = Infinity;\n\n for (const [id, bounds] of frames) {\n const inside =\n point.x >= bounds.x &&\n point.x <= bounds.x + bounds.width &&\n point.y >= bounds.y &&\n point.y <= bounds.y + bounds.height;\n const area = bounds.width * bounds.height;\n\n if (inside && area < bestArea) {\n bestArea = area;\n best = id;\n }\n }\n\n return best;\n}\n\n/** Shared so the `edges` computed keeps a stable identity while unbound. */\nconst EMPTY_EDGES: readonly XuiGraphEdge[] = [];\nconst EMPTY_IDS: ReadonlySet<string> = new Set();\n\nfunction samePort(a: XuiGraphPortRef, b: XuiGraphPortRef): boolean {\n return a.nodeId === b.nodeId && a.portId === b.portId;\n}\n\n/** Used only if a node or port is somehow instantiated outside a graph. @internal */\nconst FALLBACK_SETTINGS: XuiGraphSettings = {\n routing: 'bezier',\n gridSize: 16,\n snapToGrid: false,\n minZoom: 0.15,\n maxZoom: 4,\n stubLength: 18,\n cornerRadius: 8,\n curvature: 0.5,\n edgeWidth: 2,\n portSize: 11,\n portShape: 'circle',\n portColor: 'var(--color-foreground-subtle)',\n portTypes: {},\n allowSelfConnection: false,\n enforcePortTypes: true,\n isValidConnection: undefined,\n locked: false\n};\n\n/**\n * The store for the enclosing `<xui-node-graph>`.\n *\n * Use it to drive the canvas from outside — `fitView()`, `zoomBy()`,\n * `setSelection()` — from a toolbar or a host component.\n */\nexport function injectXuiNodeGraphStore(): XuiNodeGraphStore {\n return inject(XuiNodeGraphStore);\n}\n","import { createXConfigToken } from '@xui/core';\nimport type { XuiGraphBackground, XuiGraphMarker, XuiGraphPortShape, XuiGraphRouting } from './node-graph.types';\n\n/**\n * Presentation attached to a port *data type* — the string that decides which\n * ports may legally be wired together.\n *\n * Colouring by data type rather than by port is the whole point: in a shader or\n * VFX graph the colour is how you read compatibility at a glance, so it must be\n * declared once per type and not repeated at every call site.\n */\nexport interface XuiGraphPortType {\n /** Any CSS colour. Prefer a theme token so it follows light/dark. */\n color: string;\n\n /** Connector glyph for ports of this type. Falls back to the graph default. */\n shape?: XuiGraphPortShape;\n\n /** Human-readable name, used for the connector's tooltip. */\n label?: string;\n}\n\n/**\n * Application-wide defaults for the node graph.\n *\n * Provide it once at the app root to give every graph the same wiring style;\n * individual inputs still override the configured value.\n */\nexport interface XuiNodeGraphConfig {\n routing: XuiGraphRouting;\n background: XuiGraphBackground;\n marker: XuiGraphMarker;\n\n /** Spacing of the background rule and of `snapToGrid`, in graph units. */\n gridSize: number;\n\n /** How many minor cells make one emphasised major cell in the `grid` backdrop. */\n gridMajorEvery: number;\n\n snapToGrid: boolean;\n\n minZoom: number;\n maxZoom: number;\n\n /** Multiplier applied per zoom step, both for the wheel and the zoom buttons. */\n zoomStep: number;\n\n /** Straight run out of a port before an orthogonal wire may turn. */\n stubLength: number;\n\n /** Corner rounding for `smoothstep` routing. */\n cornerRadius: number;\n\n /** Bezier slack, as a fraction of the port separation. */\n curvature: number;\n\n edgeWidth: number;\n\n /** Connector diameter in graph units. */\n portSize: number;\n\n portShape: XuiGraphPortShape;\n\n /** Colour for a port that declares no data type, and for edges leaving one. */\n portColor: string;\n\n /** Data-type registry. Keys are matched against a port's `dataType`. */\n portTypes: Record<string, XuiGraphPortType>;\n\n /** Whether a wire may start and end on the same node. */\n allowSelfConnection: boolean;\n\n /**\n * Require both ends of a wire to declare the same `dataType`. A port with no\n * declared type is a wildcard and always passes.\n */\n enforcePortTypes: boolean;\n}\n\nexport const [injectXuiNodeGraphConfig, provideXuiNodeGraphConfig] = createXConfigToken<XuiNodeGraphConfig>(\n 'XuiNodeGraphConfig',\n {\n routing: 'bezier',\n background: 'dots',\n marker: 'none',\n gridSize: 16,\n gridMajorEvery: 5,\n snapToGrid: false,\n minZoom: 0.15,\n maxZoom: 4,\n zoomStep: 1.15,\n stubLength: 18,\n cornerRadius: 8,\n curvature: 0.5,\n edgeWidth: 2,\n portSize: 11,\n portShape: 'circle',\n portColor: 'var(--color-foreground-subtle)',\n portTypes: {},\n allowSelfConnection: false,\n enforcePortTypes: true\n }\n);\n\n/**\n * A ready-made data-type palette drawn from the categorical chart ramp, for\n * graphs that need distinguishable typed ports without designing a palette.\n *\n * ```ts\n * provideXuiNodeGraphConfig({ portTypes: { ...xuiGraphChartPortTypes(['float', 'vector', 'color']) } })\n * ```\n */\nexport function xuiGraphChartPortTypes(types: readonly string[]): Record<string, XuiGraphPortType> {\n return Object.fromEntries(\n types.map((type, index) => [type, { color: `var(--color-chart-${(index % 8) + 1})`, label: type }])\n );\n}\n","import type { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n ViewEncapsulation\n} from '@angular/core';\nimport { xui } from '@xui/core';\nimport type { ClassValue } from 'clsx';\nimport { XuiNodeGraphStore } from './node-graph-store';\nimport { injectXuiNodeGraphConfig } from './node-graph.token';\n\n/**\n * Zoom and framing buttons for the enclosing canvas.\n *\n * ```html\n * <xui-node-graph>\n * …\n * <xui-graph-controls class=\"bottom-4 left-4\" />\n * </xui-node-graph>\n * ```\n *\n * Placed anywhere inside `<xui-node-graph>`; it is projected into the overlay\n * layer, above the canvas and outside its transform, so it neither pans nor\n * scales with the content.\n */\n@Component({\n selector: 'xui-graph-controls',\n template: `\n <button type=\"button\" [class]=\"buttonClass\" aria-label=\"Zoom in\" (click)=\"store.zoomBy(step)\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <path d=\"M7 2 V12 M2 7 H12\" [attr.stroke]=\"'currentColor'\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n </button>\n\n <button type=\"button\" [class]=\"buttonClass\" aria-label=\"Zoom out\" (click)=\"store.zoomBy(1 / step)\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <path d=\"M2 7 H12\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n </button>\n\n @if (showFit()) {\n <button type=\"button\" [class]=\"buttonClass\" aria-label=\"Fit view\" (click)=\"store.fitView()\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M2 5 V2 H5 M9 2 H12 V5 M12 9 V12 H9 M5 12 H2 V9\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n }\n\n @if (showZoomLevel()) {\n <span class=\"text-foreground-subtle px-1 text-center text-[10px] tabular-nums\">{{ zoomPercent() }}%</span>\n }\n\n <ng-content />\n `,\n host: { '[class]': 'computedClass()', 'data-xui-graph-overlay': '' },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphControls {\n private readonly config = injectXuiNodeGraphConfig();\n\n protected readonly store = inject(XuiNodeGraphStore);\n protected readonly step = this.config.zoomStep;\n\n protected readonly buttonClass =\n 'text-foreground-muted hover:bg-hover-overlay hover:text-foreground focus-visible:ring-focus flex h-7 w-7 ' +\n 'cursor-pointer items-center justify-center rounded transition-colors focus-visible:ring-2 focus-visible:outline-none';\n\n readonly class = input<ClassValue>('');\n\n readonly showFit = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n readonly showZoomLevel = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** Lay the buttons out in a column (default) or a row. */\n readonly orientation = input<'horizontal' | 'vertical'>('vertical');\n\n protected readonly zoomPercent = computed(() => Math.round(this.store.viewport().zoom * 100));\n\n protected readonly computedClass = computed(() =>\n xui(\n // eslint-disable-next-line local/no-hand-z-index -- the controls float above the canvas inside the graph’s own stacking context\n 'bg-surface-overlay border-border shadow-elevation-2 pointer-events-auto absolute z-10 flex gap-0.5 rounded-md border p-1 select-none',\n this.orientation() === 'horizontal' ? 'flex-row items-center' : 'flex-col',\n // A sensible default corner; override with `class` to move it.\n 'bottom-4 left-4',\n this.class()\n )\n );\n}\n","import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n numberAttribute,\n type OnInit,\n signal,\n ViewEncapsulation\n} from '@angular/core';\nimport { xui } from '@xui/core';\nimport type { ClassValue } from 'clsx';\nimport { XuiNodeGraphStore } from './node-graph-store';\nimport type { XuiGraphGroupHandle } from './node-graph.types';\n\n/** Room reserved above the members for the title bar, in graph units. */\nconst HEADER_HEIGHT = 26;\n\n/**\n * A frame around a set of nodes that moves them all together.\n *\n * ```html\n * <xui-node-graph>\n * <xui-graph-group groupId=\"filter\" label=\"Filter stage\" color=\"var(--color-chart-1)\" />\n *\n * <xui-graph-node nodeId=\"lp\" group=\"filter\" [(position)]=\"a\">…</xui-graph-node>\n * <xui-graph-node nodeId=\"hp\" group=\"filter\" [(position)]=\"b\">…</xui-graph-node>\n * </xui-node-graph>\n * ```\n *\n * Membership is declared by the nodes, not by nesting them inside the frame:\n * a node keeps its own place in the template and its own `[(position)]`, and the\n * frame is derived from wherever its members happen to be. That is what lets a\n * group be added, removed or re-membered without moving anything in the DOM, and\n * why dragging a member out of a frame is just an ordinary node drag.\n *\n * A group with no members has no box, so it renders nothing.\n *\n * To let a node join a frame by being dropped on it, read `group` off the graph's\n * `nodeMove` event and reassign the node's own `group` input.\n */\n@Component({\n selector: 'xui-graph-group',\n template: `\n @if (label()) {\n <div\n data-xui-graph-group-header\n class=\"flex items-center gap-2 truncate px-2.5 text-xs font-medium\"\n [style.height.px]=\"headerHeight()\"\n [style.color]=\"color()\"\n >\n <span class=\"truncate\">{{ label() }}</span>\n <ng-content />\n </div>\n }\n `,\n host: {\n '[class]': 'computedClass()',\n '[attr.data-xui-graph-group]': 'groupId()',\n '[style.transform]': 'transform()',\n '[style.width.px]': 'bounds()?.width',\n '[style.height.px]': 'bounds()?.height',\n '[style.display]': 'bounds() ? null : \"none\"',\n '[style.border-color]': 'color()',\n '[style.background]': 'background()',\n '[style.cursor]': 'cursor()',\n '(pointerdown)': 'onPointerDown($event)',\n '(pointermove)': 'onPointerMove($event)',\n '(pointerup)': 'onPointerUp($event)',\n '(pointercancel)': 'onPointerUp($event)'\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphGroup implements XuiGraphGroupHandle, OnInit {\n private readonly store = inject(XuiNodeGraphStore);\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly dragOrigin = signal<{ x: number; y: number } | null>(null);\n\n /** Matches the `group` input on the nodes that belong to this frame. */\n readonly groupId = input.required<string>();\n\n readonly class = input<ClassValue>('');\n\n readonly label = input<string>('');\n\n /** Border and title colour; a tint of it fills the frame. Any CSS colour. */\n readonly color = input<string>('var(--color-border-strong)');\n\n /** Blank margin between the members' bounding box and the frame. */\n readonly padding = input<number, NumberInput>(24, { transform: numberAttribute });\n\n readonly selectable = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n readonly draggable = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** Pins the frame and everything in it. */\n readonly locked = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * `group` drags from anywhere on the frame, as a node editor's frames do.\n * `header` restricts it to the title bar, which leaves the frame's interior\n * free for panning and marquee selection.\n */\n readonly dragHandle = input<'group' | 'header'>('group');\n\n /**\n * @internal Part of {@link XuiGraphGroupHandle}.\n *\n * A frame only reserves room for a title bar when it has a label — an unlabelled\n * frame is a plain box, and projected content rides along inside the labelled one.\n */\n readonly headerHeight = computed(() => (this.label() ? HEADER_HEIGHT : 0));\n\n /**\n * The frame, in graph space. `null` while the group has no members.\n *\n * Pinned to where it stood at the start of a node drag, so a member dragged out\n * leaves a box that stays still instead of stretching it and snapping back.\n */\n readonly bounds = computed(() => this.store.groupFrame(this.groupId()));\n\n /** `true` while a dragged node hovers over this frame and would land in it. */\n readonly dropTarget = computed(() => this.store.dropTargetGroups().has(this.groupId()));\n\n readonly members = computed(() => this.store.nodesInGroup(this.groupId()).map(node => node.nodeId()));\n\n /** A frame reads as selected only when its whole membership is. */\n readonly selected = computed(() => {\n const members = this.members();\n\n return members.length > 0 && members.every(id => this.store.isNodeSelected(id));\n });\n\n protected readonly immovable = computed(() => this.locked() || !this.draggable() || this.store.settings().locked);\n\n protected readonly transform = computed(() => {\n const bounds = this.bounds();\n\n return bounds ? `translate(${bounds.x}px, ${bounds.y}px)` : null;\n });\n\n protected readonly cursor = computed(() => (this.dragOrigin() ? 'grabbing' : this.immovable() ? null : 'grab'));\n\n // Deepen the tint when the frame is about to claim a node, so the answer to\n // \"which group is this going into?\" is visible before the button comes up.\n protected readonly background = computed(\n () => `color-mix(in oklab, ${this.color()} ${this.dropTarget() ? 22 : 10}%, transparent)`\n );\n\n protected readonly computedClass = computed(() =>\n xui(\n // z-index 0 puts the frame under every node, so pressing a member still\n // moves that member and only the gaps between them belong to the group.\n // eslint-disable-next-line local/no-hand-z-index -- the group frame sits under its member nodes inside the graph’s stacking context\n 'absolute top-0 left-0 z-0 flex flex-col rounded-xl border-2 border-dashed transition-colors select-none',\n (this.selected() || this.dropTarget()) && 'border-solid',\n this.class()\n )\n );\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.store.unregisterGroup(this));\n }\n\n ngOnInit(): void {\n this.store.registerGroup(this);\n }\n\n protected onPointerDown(event: PointerEvent): void {\n const target = event.target as HTMLElement;\n\n if (event.button !== 0) {\n return;\n }\n\n // When the frame only answers to its title bar, a press on its interior is\n // left to bubble so the canvas can still pan or marquee through it.\n if (this.dragHandle() === 'header' && !target.closest('[data-xui-graph-group-header]')) {\n return;\n }\n\n event.stopPropagation();\n\n if (this.selectable()) {\n const additive = event.shiftKey || event.ctrlKey || event.metaKey;\n\n this.store.setSelection(additive ? [...this.store.selectedNodes(), ...this.members()] : this.members());\n }\n\n if (this.immovable()) {\n return;\n }\n\n event.preventDefault();\n this.element.setPointerCapture(event.pointerId);\n this.dragOrigin.set({ x: event.clientX, y: event.clientY });\n this.store.beginGroupDrag(this.groupId());\n }\n\n protected onPointerMove(event: PointerEvent): void {\n const origin = this.dragOrigin();\n\n if (!origin) {\n return;\n }\n\n const { zoom } = this.store.viewport();\n\n this.store.dragNodesBy({ x: (event.clientX - origin.x) / zoom, y: (event.clientY - origin.y) / zoom });\n }\n\n protected onPointerUp(event: PointerEvent): void {\n if (!this.dragOrigin()) {\n return;\n }\n\n this.dragOrigin.set(null);\n this.element.releasePointerCapture(event.pointerId);\n this.store.endNodeDrag();\n }\n}\n","import type { NumberInput } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n numberAttribute,\n ViewEncapsulation\n} from '@angular/core';\nimport { xui } from '@xui/core';\nimport type { ClassValue } from 'clsx';\nimport { XuiNodeGraphStore } from './node-graph-store';\nimport type { XuiGraphRect } from './node-graph.types';\n\n/**\n * An overview of the whole graph with the current viewport drawn on it.\n *\n * ```html\n * <xui-node-graph>\n * …\n * <xui-graph-minimap class=\"right-4 bottom-4\" />\n * </xui-node-graph>\n * ```\n *\n * Click or drag inside it to move the view. Like the controls, it is projected\n * into the overlay layer and so stays put while the canvas pans.\n */\n@Component({\n selector: 'xui-graph-minimap',\n template: `\n <svg\n class=\"h-full w-full cursor-pointer\"\n [attr.viewBox]=\"viewBox()\"\n preserveAspectRatio=\"xMidYMid meet\"\n role=\"img\"\n aria-label=\"Graph overview\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n >\n @for (node of nodes(); track node.id) {\n <rect\n [attr.x]=\"node.x\"\n [attr.y]=\"node.y\"\n [attr.width]=\"node.width\"\n [attr.height]=\"node.height\"\n [attr.rx]=\"cornerRadius()\"\n [attr.fill]=\"node.selected ? 'var(--color-primary)' : 'var(--color-border-strong)'\"\n />\n }\n\n @if (viewportRect(); as rect) {\n <rect\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n fill=\"var(--color-selection)\"\n stroke=\"var(--color-primary)\"\n [attr.stroke-width]=\"strokeWidth()\"\n />\n }\n </svg>\n `,\n host: { '[class]': 'computedClass()', 'data-xui-graph-overlay': '' },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphMinimap {\n private readonly store = inject(XuiNodeGraphStore);\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private dragging = false;\n\n readonly class = input<ClassValue>('');\n\n /** Blank margin around the content, in graph units. */\n readonly padding = input<number, NumberInput>(40, { transform: numberAttribute });\n\n protected readonly nodes = computed(() =>\n this.store.nodes().map(node => {\n const { x, y } = node.position();\n const { width, height } = node.size();\n\n return { id: node.nodeId(), x, y, width, height, selected: this.store.isNodeSelected(node.nodeId()) };\n })\n );\n\n /**\n * The extent the minimap shows: everything drawn, unioned with wherever the\n * viewport currently is, so panning off into empty space still tells you where\n * you are instead of silently clamping.\n */\n private readonly extent = computed<XuiGraphRect>(() => {\n const content = this.store.contentBounds();\n const view = this.viewportRect();\n const padding = this.padding();\n\n if (!content && !view) {\n return { x: 0, y: 0, width: 1, height: 1 };\n }\n\n const boxes = [content, view].filter((box): box is XuiGraphRect => !!box);\n const minX = Math.min(...boxes.map(box => box.x)) - padding;\n const minY = Math.min(...boxes.map(box => box.y)) - padding;\n const maxX = Math.max(...boxes.map(box => box.x + box.width)) + padding;\n const maxY = Math.max(...boxes.map(box => box.y + box.height)) + padding;\n\n return { x: minX, y: minY, width: Math.max(maxX - minX, 1), height: Math.max(maxY - minY, 1) };\n });\n\n protected readonly viewportRect = computed<XuiGraphRect | null>(() => {\n const { x, y, zoom } = this.store.viewport();\n const { width, height } = this.store.surfaceSize();\n\n if (width === 0 || height === 0) {\n return null;\n }\n\n return { x: -x / zoom, y: -y / zoom, width: width / zoom, height: height / zoom };\n });\n\n protected readonly viewBox = computed(() => {\n const { x, y, width, height } = this.extent();\n\n return `${x} ${y} ${width} ${height}`;\n });\n\n /** Keep hairlines and corners visually constant however far the extent zooms out. */\n private readonly unitScale = computed(() => this.extent().width / Math.max(this.element.clientWidth, 1));\n\n protected readonly strokeWidth = computed(() => this.unitScale());\n protected readonly cornerRadius = computed(() => this.unitScale() * 2);\n\n protected readonly computedClass = computed(() =>\n xui(\n // eslint-disable-next-line local/no-hand-z-index -- the minimap floats above the canvas inside the graph’s own stacking context\n 'bg-surface-overlay/90 border-border shadow-elevation-2 pointer-events-auto absolute z-10 block h-32 w-48 ' +\n 'overflow-hidden rounded-md border p-1 select-none',\n 'right-4 bottom-4',\n this.class()\n )\n );\n\n protected onPointerDown(event: PointerEvent): void {\n if (event.button !== 0) {\n return;\n }\n\n event.stopPropagation();\n this.dragging = true;\n (event.target as Element).setPointerCapture(event.pointerId);\n this.centerOnPointer(event);\n }\n\n protected onPointerMove(event: PointerEvent): void {\n if (this.dragging) {\n this.centerOnPointer(event);\n }\n }\n\n protected onPointerUp(event: PointerEvent): void {\n this.dragging = false;\n (event.target as Element).releasePointerCapture(event.pointerId);\n }\n\n /**\n * Map the pointer through the SVG's `preserveAspectRatio` fit and centre the\n * canvas there. The fit letterboxes on one axis, so the scale has to be taken\n * from the tighter of the two — using the element's own aspect ratio would put\n * the target off by the size of the letterbox.\n */\n private centerOnPointer(event: PointerEvent): void {\n const rect = this.element.getBoundingClientRect();\n const extent = this.extent();\n\n if (rect.width === 0 || rect.height === 0) {\n return;\n }\n\n const scale = Math.min(rect.width / extent.width, rect.height / extent.height);\n const offsetX = (rect.width - extent.width * scale) / 2;\n const offsetY = (rect.height - extent.height * scale) / 2;\n const graphX = (event.clientX - rect.left - offsetX) / scale + extent.x;\n const graphY = (event.clientY - rect.top - offsetY) / scale + extent.y;\n const surface = this.store.surfaceSize();\n const { zoom } = this.store.viewport();\n\n this.store.panBy(\n surface.width / 2 - (graphX * zoom + this.store.viewport().x),\n surface.height / 2 - (graphY * zoom + this.store.viewport().y)\n );\n }\n}\n","import { InjectionToken, type Signal } from '@angular/core';\nimport type { XuiGraphPortLayout, XuiGraphPortSide } from './node-graph.types';\n\n/** The slice of a port a sibling needs in order to work out its own index. @internal */\nexport interface XuiGraphPortSlot {\n readonly key: string;\n readonly resolvedSide: Signal<XuiGraphPortSide>;\n}\n\n/**\n * What a port needs from the node that contains it.\n *\n * Exposed through a token rather than by injecting `XuiGraphNode` directly: the\n * node queries its ports with `contentChildren`, so a direct injection would\n * close an import cycle between the two components.\n *\n * @internal\n */\nexport interface XuiGraphNodeContext {\n readonly nodeId: Signal<string>;\n readonly element: HTMLElement;\n readonly portLayout: Signal<XuiGraphPortLayout>;\n readonly collapsed: Signal<boolean>;\n readonly locked: Signal<boolean>;\n\n /** Ports in DOM order. Drives side-relative indexing and rail spacing. */\n readonly portSlots: Signal<readonly XuiGraphPortSlot[]>;\n\n /**\n * Bumped whenever the node's own box changes size. Ports re-measure their\n * offset off this rather than observing themselves, because a port moves when\n * a *sibling* reflows, which no observer on the port itself would ever see.\n */\n readonly layoutEpoch: Signal<number>;\n}\n\n/** @internal */\nexport const XUI_GRAPH_NODE = new InjectionToken<XuiGraphNodeContext>('XuiGraphNode');\n","import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n afterRenderEffect,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n numberAttribute,\n type OnInit,\n signal,\n untracked,\n viewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { xui } from '@xui/core';\nimport type { ClassValue } from 'clsx';\nimport { XUI_GRAPH_NODE } from './graph-node.token';\nimport { XuiNodeGraphStore } from './node-graph-store';\nimport type {\n XuiGraphPoint,\n XuiGraphPortDirection,\n XuiGraphPortHandle,\n XuiGraphPortShape,\n XuiGraphPortSide\n} from './node-graph.types';\nimport { xuiGraphPortKey } from './node-graph.types';\n\n/** Side a port takes when the author states only its direction. */\nconst SIDE_FOR_DIRECTION: Record<XuiGraphPortDirection, XuiGraphPortSide> = {\n input: 'left',\n output: 'right',\n inout: 'right'\n};\n\n/**\n * A connector on a node, together with the row of content that belongs to it.\n *\n * ```html\n * <xui-graph-node nodeId=\"mul\" label=\"Multiply\" [(position)]=\"position\">\n * <xui-graph-port portId=\"a\" direction=\"input\" dataType=\"float\" label=\"A\" />\n * <xui-graph-port portId=\"b\" direction=\"input\" dataType=\"float\" label=\"B\" />\n * <xui-graph-port portId=\"out\" direction=\"output\" dataType=\"float\" label=\"Result\" />\n * </xui-graph-node>\n * ```\n *\n * The host element is the whole row, so anything projected into it — a numeric\n * input, a colour swatch, a dropdown — sits inline with the connector, the way a\n * shader or VFX editor lays out its sockets. The connector itself is pinned to\n * the node's border, because that is what a wire attaches to.\n *\n * A hollow connector has nothing attached to it; a filled one is wired up.\n */\n@Component({\n selector: 'xui-graph-port',\n template: `\n <div\n #connector\n role=\"button\"\n [class]=\"connectorClass()\"\n [style.width.px]=\"connectorWidth()\"\n [style.height.px]=\"connectorHeight()\"\n [style.background]=\"connected() ? resolvedColor() : 'var(--color-surface)'\"\n [style.border-color]=\"resolvedColor()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.title]=\"tooltip()\"\n [attr.tabindex]=\"disabled() ? null : 0\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (keydown)=\"onKeydown($event)\"\n ></div>\n\n @if (label()) {\n <span class=\"truncate\">{{ label() }}</span>\n }\n\n <ng-content />\n `,\n host: {\n '[class]': 'computedClass()',\n '[attr.data-xui-graph-port]': 'portId()',\n '[attr.data-xui-graph-port-node]': 'nodeId()',\n '[attr.data-side]': 'resolvedSide()',\n '[attr.data-link-state]': 'linkState()',\n '[style.order]': 'order()',\n '[style.grid-column]': 'gridColumn()',\n '[style.grid-row]': 'gridRow()',\n '[style.left.%]': 'railOffset()',\n '[style.opacity]': \"linkState() === 'invalid' ? 0.35 : null\"\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphPort implements XuiGraphPortHandle, OnInit {\n private readonly store = inject(XuiNodeGraphStore);\n private readonly node = inject(XUI_GRAPH_NODE);\n private readonly document = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement.ownerDocument;\n private readonly connectorRef = viewChild.required<ElementRef<HTMLElement>>('connector');\n private readonly offsetState = signal<XuiGraphPoint>({ x: 0, y: 0 });\n\n /**\n * Registry identity. Empty until `ngOnInit`, because a required input is not\n * readable during construction.\n */\n key = '';\n\n /** Unique within the owning node — the node id supplies the rest of the identity. */\n readonly portId = input.required<string>();\n\n readonly class = input<ClassValue>('');\n\n /**\n * Which way data flows. `inout` covers terminals that are neither source nor\n * sink — a component lead in a schematic, where either end of a wire may be\n * drawn first.\n */\n readonly direction = input<XuiGraphPortDirection>('input');\n\n readonly label = input<string>('');\n\n /**\n * The compatibility key. Two ports may only be wired together when their data\n * types match, and the type also picks the connector's colour — see\n * `provideXuiNodeGraphConfig({ portTypes })`. Leaving it unset makes the port a\n * wildcard that connects to anything.\n */\n readonly dataType = input<string>();\n\n /** Overrides the colour inherited from {@link dataType}. */\n readonly color = input<string>();\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Which node edge the connector sits on. Leave unset to take it from\n * {@link direction} — inputs on the left, outputs on the right.\n */\n readonly side = input<XuiGraphPortSide>();\n\n readonly shape = input<XuiGraphPortShape>();\n\n /**\n * How many wires may terminate here. Defaults to 1 for an input — the usual\n * rule that a value has exactly one producer — and unlimited for outputs and\n * `inout` terminals, which fan out freely.\n */\n readonly maxConnections = input<number, NumberInput>(NaN, { transform: value => numberAttribute(value, NaN) });\n\n readonly nodeId = this.node.nodeId;\n\n readonly resolvedSide = computed(() => this.side() ?? SIDE_FOR_DIRECTION[this.direction()]);\n\n readonly resolvedMaxConnections = computed(() => {\n const explicit = this.maxConnections();\n\n return Number.isNaN(explicit) ? (this.direction() === 'input' ? 1 : Infinity) : explicit;\n });\n\n /** Connector centre relative to the node's top-left corner, in graph units. */\n readonly offset = this.offsetState.asReadonly();\n\n readonly resolvedColor = computed(() => {\n const explicit = this.color();\n\n if (explicit) {\n return explicit;\n }\n\n const settings = this.store.settings();\n const type = this.dataType();\n\n return (type ? settings.portTypes[type]?.color : undefined) ?? settings.portColor;\n });\n\n protected readonly resolvedShape = computed(() => {\n const settings = this.store.settings();\n const type = this.dataType();\n\n return this.shape() ?? (type ? settings.portTypes[type]?.shape : undefined) ?? settings.portShape;\n });\n\n protected readonly horizontal = computed(() => this.resolvedSide() === 'left' || this.resolvedSide() === 'right');\n\n private readonly size = computed(() => this.store.settings().portSize);\n\n // A pin is a lead rather than a socket: stretched along the node's normal.\n protected readonly connectorWidth = computed(() =>\n this.resolvedShape() === 'pin' && this.horizontal() ? this.size() * 2 : this.size()\n );\n\n protected readonly connectorHeight = computed(() =>\n this.resolvedShape() === 'pin' && !this.horizontal() ? this.size() * 2 : this.size()\n );\n\n protected readonly connected = computed(() => this.store.connectionCount(this.key) > 0);\n protected readonly linkState = computed(() => this.store.linkState(this.key));\n\n /** Position among the ports sharing this side; drives rails and column rows. */\n private readonly indexOnSide = computed(() => {\n const side = this.resolvedSide();\n const index = this.node\n .portSlots()\n .filter(slot => slot.resolvedSide() === side)\n .findIndex(slot => slot.key === this.key);\n\n return Math.max(index, 0);\n });\n\n private readonly countOnSide = computed(\n () => this.node.portSlots().filter(slot => slot.resolvedSide() === this.resolvedSide()).length\n );\n\n /**\n * Top and bottom ports spread evenly along their edge instead of stacking,\n * because a schematic reads those terminals as a rail, not as a list.\n */\n protected readonly railOffset = computed(() =>\n this.horizontal() ? null : ((this.indexOnSide() + 1) / (this.countOnSide() + 1)) * 100\n );\n\n protected readonly order = computed(() =>\n this.node.portLayout() === 'stacked' && this.horizontal() ? (this.resolvedSide() === 'right' ? 0 : 1) : null\n );\n\n protected readonly gridColumn = computed(() =>\n this.node.portLayout() === 'columns' && this.horizontal() ? (this.resolvedSide() === 'left' ? 1 : 2) : null\n );\n\n protected readonly gridRow = computed(() =>\n this.node.portLayout() === 'columns' && this.horizontal() ? this.indexOnSide() + 1 : null\n );\n\n protected readonly tooltip = computed(() => {\n const type = this.dataType();\n const typeLabel = type ? (this.store.settings().portTypes[type]?.label ?? type) : '';\n\n return [this.label(), typeLabel && `(${typeLabel})`].filter(Boolean).join(' ') || null;\n });\n\n protected readonly ariaLabel = computed(() => {\n const role = this.direction() === 'output' ? 'Output' : this.direction() === 'input' ? 'Input' : 'Terminal';\n\n return `${role} ${this.label() || this.portId()}`;\n });\n\n protected readonly computedClass = computed(() =>\n xui(\n 'relative flex min-h-7 items-center gap-2 text-xs leading-tight',\n this.horizontal() ? 'px-3' : 'absolute w-max -translate-x-1/2 flex-col gap-1',\n this.resolvedSide() === 'left' && 'justify-start text-left',\n this.resolvedSide() === 'right' && 'flex-row-reverse justify-start text-right',\n this.resolvedSide() === 'top' && 'top-0 -translate-y-full flex-col-reverse pb-1',\n this.resolvedSide() === 'bottom' && 'bottom-0 translate-y-full pt-1',\n // Collapsed: every connector converges on the node's midline and the row's\n // own content is hidden, leaving the wiring intact but the card folded.\n // `inset-x-0` resolves against the node, since the ports container is not\n // itself positioned.\n this.node.collapsed() &&\n this.horizontal() &&\n 'absolute inset-x-0 top-1/2 min-h-0 -translate-y-1/2 px-0 [&>:not(:first-child)]:hidden',\n this.disabled() ? 'text-foreground-subtle' : 'text-foreground-muted',\n this.class()\n )\n );\n\n protected readonly connectorClass = computed(() => {\n const shape = this.resolvedShape();\n const state = this.linkState();\n\n return xui(\n 'absolute box-border border-2 transition-transform duration-100',\n // Pinned to the node's border box. The ports container carries no\n // horizontal padding, so `left-0` really is the node's own edge.\n this.resolvedSide() === 'left' && 'top-1/2 left-0 -translate-x-1/2 -translate-y-1/2',\n this.resolvedSide() === 'right' && 'top-1/2 right-0 translate-x-1/2 -translate-y-1/2',\n this.resolvedSide() === 'top' && 'bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2',\n this.resolvedSide() === 'bottom' && 'top-0 left-1/2 -translate-x-1/2 -translate-y-1/2',\n shape === 'circle' && 'rounded-full',\n shape === 'square' && 'rounded-xs',\n shape === 'diamond' && 'rounded-xs rotate-45',\n shape === 'triangle' && 'rounded-none border-0 [clip-path:polygon(0_0,100%_50%,0_100%)]',\n shape === 'pin' && 'rounded-full',\n this.disabled() ? 'cursor-not-allowed opacity-40' : 'cursor-crosshair hover:scale-125',\n state === 'valid' && 'scale-150',\n state === 'source' && 'ring-focus scale-125 ring-2 ring-offset-1',\n 'focus-visible:ring-focus focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:outline-none'\n );\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.store.unregisterPort(this));\n\n // Re-measure whenever something that could move the connector changes. The\n // reads happen in the post-render read phase, so no layout is forced during\n // rendering.\n afterRenderEffect({\n read: () => {\n this.node.layoutEpoch();\n this.node.collapsed();\n this.node.portLayout();\n this.resolvedSide();\n this.connectorWidth();\n this.connectorHeight();\n this.indexOnSide();\n this.countOnSide();\n\n this.measure();\n }\n });\n }\n\n ngOnInit(): void {\n this.key = xuiGraphPortKey(untracked(this.nodeId), untracked(this.portId));\n this.store.registerPort(this);\n }\n\n private measure(): void {\n const nodeRect = this.node.element.getBoundingClientRect();\n const rect = this.connectorRef().nativeElement.getBoundingClientRect();\n\n // Rects are post-transform, so undo the canvas scale to land in graph units.\n const zoom = untracked(this.store.viewport).zoom || 1;\n const next = {\n x: (rect.left + rect.width / 2 - nodeRect.left) / zoom,\n y: (rect.top + rect.height / 2 - nodeRect.top) / zoom\n };\n const current = untracked(this.offsetState);\n\n if (Math.abs(current.x - next.x) > 0.01 || Math.abs(current.y - next.y) > 0.01) {\n this.offsetState.set(next);\n }\n }\n\n protected onPointerDown(event: PointerEvent): void {\n if (event.button !== 0 || this.disabled() || this.store.settings().locked) {\n return;\n }\n\n // Keep the node from reading this as the start of a move.\n event.stopPropagation();\n event.preventDefault();\n\n this.connectorRef().nativeElement.setPointerCapture(event.pointerId);\n this.store.beginLink(this, this.store.toGraphPoint(event.clientX, event.clientY));\n }\n\n protected onPointerMove(event: PointerEvent): void {\n const linking = this.store.linking();\n\n if (!linking || linking.fromKey !== this.key) {\n return;\n }\n\n this.store.moveLink(this.store.toGraphPoint(event.clientX, event.clientY));\n this.store.setLinkHover(this.portKeyAt(event.clientX, event.clientY));\n }\n\n protected onPointerUp(event: PointerEvent): void {\n const linking = this.store.linking();\n\n if (!linking || linking.fromKey !== this.key) {\n return;\n }\n\n this.connectorRef().nativeElement.releasePointerCapture(event.pointerId);\n\n // Refresh the pointer before ending: a release with no preceding move would\n // otherwise report a create-on-drop position one event out of date.\n this.store.moveLink(this.store.toGraphPoint(event.clientX, event.clientY));\n this.store.endLink(this.portKeyAt(event.clientX, event.clientY));\n }\n\n /**\n * Keyboard equivalent of dragging a wire: commit on one port, move focus,\n * commit on the other. Without it the graph cannot be wired without a mouse.\n */\n protected onKeydown(event: KeyboardEvent): void {\n if (this.disabled() || this.store.settings().locked) {\n return;\n }\n\n const linking = this.store.linking();\n\n if (event.key === 'Escape' && linking) {\n event.preventDefault();\n this.store.endLink(null);\n return;\n }\n\n if (event.key !== 'Enter' && event.key !== ' ') {\n return;\n }\n\n event.preventDefault();\n\n if (!linking) {\n this.store.beginLink(this, this.store.portPoint(this.key) ?? { x: 0, y: 0 });\n } else {\n this.store.endLink(linking.fromKey === this.key ? null : this.key);\n }\n }\n\n /**\n * Which port, if any, lies under a screen point. Used for drop targeting.\n *\n * The two halves of the identity are read back as separate attributes rather\n * than as one composite key, so the registry is free to key ports however it\n * likes without that encoding having to survive a DOM round-trip.\n */\n private portKeyAt(clientX: number, clientY: number): string | null {\n const host = this.document.elementFromPoint(clientX, clientY)?.closest('[data-xui-graph-port]');\n const portId = host?.getAttribute('data-xui-graph-port');\n const nodeId = host?.getAttribute('data-xui-graph-port-node');\n\n if (portId == null || nodeId == null) {\n return null;\n }\n\n const key = xuiGraphPortKey(nodeId, portId);\n\n return key === this.key ? null : key;\n }\n}\n","import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n DestroyRef,\n ElementRef,\n inject,\n input,\n model,\n numberAttribute,\n type OnInit,\n output,\n signal,\n untracked,\n ViewEncapsulation\n} from '@angular/core';\nimport { xui } from '@xui/core';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type { ClassValue } from 'clsx';\nimport { XUI_GRAPH_NODE } from './graph-node.token';\nimport { XuiGraphPort } from './graph-port';\nimport { XuiNodeGraphStore } from './node-graph-store';\nimport type { XuiGraphNodeHandle, XuiGraphPoint, XuiGraphPortLayout, XuiGraphSize } from './node-graph.types';\n\nexport const graphNodeVariants = cva(\n 'bg-surface-raised text-foreground absolute top-0 left-0 flex flex-col rounded-lg border select-none',\n {\n variants: {\n selected: {\n true: 'border-primary ring-primary/60 ring-2',\n false: 'border-border shadow-elevation-2'\n },\n locked: {\n true: 'cursor-default',\n false: ''\n },\n dimmed: {\n true: 'opacity-45',\n false: ''\n }\n },\n defaultVariants: { selected: false, locked: false, dimmed: false }\n }\n);\n\nexport type XuiGraphNodeVariants = VariantProps<typeof graphNodeVariants>;\n\n/**\n * A card on the canvas: a header, an optional body, and a set of ports.\n *\n * ```html\n * <xui-graph-node nodeId=\"osc\" label=\"Oscillator\" [(position)]=\"position\" accent=\"var(--color-chart-4)\">\n * <xui-graph-port portId=\"freq\" direction=\"input\" dataType=\"float\" label=\"Frequency\" />\n * <xui-graph-port portId=\"out\" direction=\"output\" dataType=\"signal\" label=\"Out\" />\n * </xui-graph-node>\n * ```\n *\n * The node is deliberately unopinionated about its body — projected content\n * renders below the ports, so the same component serves a shader node, a\n * two-terminal resistor and a form-like settings card. What it does own is the\n * geometry: its position drives every wire attached to it, and its border is\n * where connectors sit.\n *\n * `position` is a model, so `[(position)]` keeps the host's own state authoritative\n * — nothing is mutated behind the caller's back.\n */\n@Component({\n selector: 'xui-graph-node',\n template: `\n <div\n data-xui-graph-node-header\n [class]=\"headerClass()\"\n [style.border-top-color]=\"accent()\"\n (dblclick)=\"onHeaderDoubleClick($event)\"\n >\n @if (collapsible()) {\n <button\n type=\"button\"\n class=\"text-foreground-subtle hover:text-foreground -ml-1 shrink-0 cursor-pointer p-0.5 leading-none\"\n [attr.aria-label]=\"collapsed() ? 'Expand node' : 'Collapse node'\"\n [attr.aria-expanded]=\"!collapsed()\"\n (click)=\"collapsed.set(!collapsed())\"\n >\n <svg\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 10 10\"\n aria-hidden=\"true\"\n class=\"transition-transform duration-150\"\n [style.transform]=\"collapsed() ? 'rotate(-90deg)' : null\"\n >\n <path d=\"M1 3 L5 7 L9 3\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n </button>\n }\n\n <ng-content select=\"xui-graph-node-header\" />\n\n @if (label()) {\n <span class=\"min-w-0 flex-1 truncate\">{{ label() }}</span>\n }\n\n <ng-content select=\"xui-graph-node-actions\" />\n </div>\n\n @if (!collapsed()) {\n <ng-content select=\"xui-graph-node-preview\" />\n }\n\n <!--\n Deliberately not positioned: left/right connectors resolve their inset\n against this box (full node width, no horizontal padding), while top and\n bottom ports are absolute and must resolve against the node itself.\n -->\n <div [class]=\"portsClass()\">\n <ng-content select=\"xui-graph-port\" />\n </div>\n\n @if (!collapsed()) {\n <ng-content />\n }\n `,\n host: {\n '[class]': 'computedClass()',\n '[attr.data-xui-graph-node]': 'nodeId()',\n '[attr.aria-selected]': 'selectable() ? selected() : null',\n '[attr.role]': \"selectable() ? 'option' : null\",\n '[style.transform]': 'transform()',\n '[style.width.px]': 'width()',\n '[style.z-index]': 'selected() ? 2 : 1',\n '[style.cursor]': 'dragCursor()',\n '(pointerdown)': 'onPointerDown($event)',\n '(pointermove)': 'onPointerMove($event)',\n '(pointerup)': 'onPointerUp($event)',\n '(pointercancel)': 'onPointerUp($event)'\n },\n providers: [{ provide: XUI_GRAPH_NODE, useExisting: XuiGraphNode }],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphNode implements XuiGraphNodeHandle, OnInit {\n private readonly store = inject(XuiNodeGraphStore);\n private readonly sizeState = signal<XuiGraphSize>({ width: 0, height: 0 });\n private readonly layoutEpochState = signal(0);\n private dragOrigin: { x: number; y: number } | null = null;\n\n /** Host element. Ports measure their connector offsets against this box. */\n readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n /** Identifies the node to edges and to the selection. Must be stable and unique. */\n readonly nodeId = input.required<string>();\n\n readonly class = input<ClassValue>('');\n\n /** Top-left corner in graph space. Two-way bound so the host owns the value. */\n readonly position = model<XuiGraphPoint>({ x: 0, y: 0 });\n\n readonly label = input<string>('');\n\n /** Fixed width in graph units. Leave unset to size to content. */\n readonly width = input<number | undefined, NumberInput>(undefined, {\n transform: value => (value == null || value === '' ? undefined : numberAttribute(value))\n });\n\n /**\n * Accent colour for the header's top rule — the usual way a node editor shows\n * which category a node belongs to. Any CSS colour; prefer a theme token.\n */\n readonly accent = input<string>();\n\n /**\n * Id of the `<xui-graph-group>` this node belongs to. Membership lives on the\n * node rather than in the frame, so a node never has to move in the template to\n * join or leave one.\n */\n readonly group = input<string>();\n\n /** Arrangement of the port rows. */\n readonly portLayout = input<XuiGraphPortLayout>('stacked');\n\n /**\n * Hides the body and pulls every connector onto the header, so a finished\n * subtree can be folded away without breaking its wiring.\n */\n readonly collapsed = model(false);\n\n readonly collapsible = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly selectable = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n readonly draggable = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** Pins the node in place while leaving it selectable. */\n readonly locked = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Restrict dragging to the header, as a window manager does. */\n readonly dragHandle = input<'node' | 'header'>('node');\n\n /** Renders the node faded — for a disabled branch or a bypassed effect. */\n readonly dimmed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Double-click on the header. The usual gesture for entering a subgraph. */\n readonly activated = output<void>();\n\n /** Measured border-box size in graph units, from a ResizeObserver. */\n readonly size = this.sizeState.asReadonly();\n\n /** @internal Bumped on reflow so ports know to re-measure. */\n readonly layoutEpoch = this.layoutEpochState.asReadonly();\n\n /** @internal Ports in DOM order, for side-relative indexing. */\n readonly portSlots = contentChildren(XuiGraphPort);\n\n readonly selected = computed(() => this.store.isNodeSelected(this.nodeId()));\n\n protected readonly immovable = computed(() => this.locked() || !this.draggable() || this.store.settings().locked);\n\n protected readonly transform = computed(() => {\n const { x, y } = this.position();\n\n return `translate(${x}px, ${y}px)`;\n });\n\n protected readonly dragCursor = computed(() =>\n this.immovable() ? null : this.dragHandle() === 'header' ? null : 'grab'\n );\n\n protected readonly computedClass = computed(() =>\n xui(\n graphNodeVariants({ selected: this.selected(), locked: this.locked(), dimmed: this.dimmed() }),\n !this.width() && 'min-w-40',\n this.class()\n )\n );\n\n protected readonly headerClass = computed(() =>\n xui(\n 'flex items-center gap-2 rounded-t-lg px-3 py-2 text-sm font-medium',\n // The accent is painted as a thicker top rule, so it survives a dark theme\n // and never fights the node's own surface colour for contrast.\n this.accent() ? 'border-t-3' : 'border-t-3 border-t-transparent',\n !this.collapsed() && 'border-border-muted border-b',\n this.immovable() || this.dragHandle() === 'node' ? '' : 'cursor-grab'\n )\n );\n\n protected readonly portsClass = computed(() =>\n xui(\n this.portLayout() === 'columns' ? 'grid grid-cols-2' : 'flex flex-col',\n // Collapsed ports are absolute, so the container takes no room on its own.\n !this.collapsed() && this.portSlots().length > 0 && 'py-1.5'\n )\n );\n\n constructor() {\n const observer = new ResizeObserver(entries => {\n const box = entries[0]?.borderBoxSize?.[0];\n const width = box ? box.inlineSize : this.element.offsetWidth;\n const height = box ? box.blockSize : this.element.offsetHeight;\n const current = untracked(this.sizeState);\n\n if (Math.abs(current.width - width) > 0.5 || Math.abs(current.height - height) > 0.5) {\n this.sizeState.set({ width, height });\n }\n\n // Bump unconditionally: a reflow that leaves the node's own box unchanged\n // — a label swap, a row appearing and another disappearing — still moves\n // the ports inside it.\n this.layoutEpochState.update(epoch => epoch + 1);\n });\n\n observer.observe(this.element);\n\n inject(DestroyRef).onDestroy(() => {\n observer.disconnect();\n this.store.unregisterNode(this);\n });\n }\n\n ngOnInit(): void {\n this.store.registerNode(this);\n }\n\n /** @internal Called by the store while dragging a selection. */\n moveTo(point: XuiGraphPoint): void {\n this.position.set(point);\n }\n\n protected onPointerDown(event: PointerEvent): void {\n if (event.button !== 0) {\n return;\n }\n\n // A press anywhere on a node belongs to the node, never to the canvas — even\n // when it lands on a control and starts no drag at all.\n event.stopPropagation();\n\n const target = event.target as HTMLElement;\n\n if (this.selectable()) {\n const additive = event.shiftKey || event.ctrlKey || event.metaKey;\n\n if (additive || !this.store.isNodeSelected(this.nodeId())) {\n this.store.selectNode(this.nodeId(), additive);\n }\n }\n\n if (this.immovable() || target.closest(NON_DRAGGABLE)) {\n return;\n }\n\n if (this.dragHandle() === 'header' && !target.closest('[data-xui-graph-node-header]')) {\n return;\n }\n\n event.preventDefault();\n this.element.setPointerCapture(event.pointerId);\n this.dragOrigin = { x: event.clientX, y: event.clientY };\n this.store.beginNodeDrag(this.nodeId());\n }\n\n protected onPointerMove(event: PointerEvent): void {\n if (!this.dragOrigin) {\n return;\n }\n\n const { zoom } = this.store.viewport();\n\n this.store.dragNodesBy({\n x: (event.clientX - this.dragOrigin.x) / zoom,\n y: (event.clientY - this.dragOrigin.y) / zoom\n });\n }\n\n protected onPointerUp(event: PointerEvent): void {\n if (!this.dragOrigin) {\n return;\n }\n\n this.dragOrigin = null;\n this.element.releasePointerCapture(event.pointerId);\n this.store.endNodeDrag();\n }\n\n protected onHeaderDoubleClick(event: MouseEvent): void {\n event.stopPropagation();\n this.activated.emit();\n }\n}\n\n/**\n * Descendants that own their own pointer gestures. Ports link, native controls\n * take input, and anything marked `xuiGraphNoDrag` opts out explicitly.\n */\nconst NON_DRAGGABLE =\n '[data-xui-graph-port], [data-xui-graph-no-drag], input, textarea, select, button, a, [contenteditable=\"true\"]';\n","import { ChangeDetectionStrategy, Component, computed, Directive, input, ViewEncapsulation } from '@angular/core';\nimport { xui } from '@xui/core';\nimport type { ClassValue } from 'clsx';\n\n/*\n * The slots are elements rather than attribute directives on purpose.\n *\n * Content projection matches `ng-content select` against the template's own\n * markup, and an attribute selector that fails to match raises nothing — the\n * element quietly lands in the default slot instead. For a node header that means\n * rendering below the ports; for an overlay it means being placed inside the\n * canvas transform, where it pans and zooms with the content and sizes itself\n * against a zero-height box. Element selectors match reliably, so a slot cannot\n * end up in the wrong layer without anyone noticing.\n */\n\n/**\n * Replaces a node's default header. Use it when the title needs an icon, a\n * badge, or anything beyond the `label` input.\n *\n * ```html\n * <xui-graph-node nodeId=\"n1\" [(position)]=\"position\">\n * <xui-graph-node-header><ng-icon name=\"matBolt\" /> Amplifier</xui-graph-node-header>\n * </xui-graph-node>\n * ```\n */\n@Component({\n selector: 'xui-graph-node-header',\n template: '<ng-content />',\n host: { '[class]': 'computedClass()' },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphNodeHeader {\n readonly class = input<ClassValue>('');\n\n protected readonly computedClass = computed(() =>\n xui('flex min-w-0 flex-1 items-center gap-2 truncate', this.class())\n );\n}\n\n/** Trailing controls in a node header — a menu button, a toggle, a status dot. */\n@Component({\n selector: 'xui-graph-node-actions',\n template: '<ng-content />',\n host: { '[class]': 'computedClass()' },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphNodeActions {\n readonly class = input<ClassValue>('');\n\n protected readonly computedClass = computed(() => xui('flex shrink-0 items-center gap-1', this.class()));\n}\n\n/**\n * A full-bleed block between the header and the ports — a thumbnail, a preview\n * render, a waveform. Sits above the port rows, as it does in a VFX graph.\n */\n@Component({\n selector: 'xui-graph-node-preview',\n template: '<ng-content />',\n host: { '[class]': 'computedClass()' },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphNodePreview {\n readonly class = input<ClassValue>('');\n\n protected readonly computedClass = computed(() =>\n xui('border-border-muted block overflow-hidden border-b', this.class())\n );\n}\n\n/**\n * Furniture layered over the canvas — a legend, a toolbar, a context menu.\n *\n * It sits outside the canvas transform, so it neither pans nor scales with the\n * content, and positions itself against the graph's own box:\n *\n * ```html\n * <xui-node-graph>\n * …\n * <xui-graph-overlay class=\"top-4 right-4\">Read only</xui-graph-overlay>\n * </xui-node-graph>\n * ```\n *\n * Keep the element itself outside any `@if` or `@for`, and put the condition on\n * its contents instead. A control-flow block is projected as one embedded view,\n * so anything wrapped in one goes to the canvas layer whatever its own selector\n * says — an overlay put there pans and zooms away with the content:\n *\n * ```html\n * <xui-graph-overlay class=\"inset-0\" [class.pointer-events-none]=\"!menu()\">\n * @if (menu(); as open) { … }\n * </xui-graph-overlay>\n * ```\n */\n@Component({\n selector: 'xui-graph-overlay',\n template: '<ng-content />',\n host: {\n '[class]': 'computedClass()',\n // Tells the canvas to keep its hands off presses that land here. Without it\n // the canvas captures the pointer for a pan and the release never reaches\n // whatever was pressed, so buttons in an overlay never see a click.\n 'data-xui-graph-overlay': ''\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiGraphOverlay {\n readonly class = input<ClassValue>('');\n\n // eslint-disable-next-line local/no-hand-z-index -- slots overlay their own node inside the graph’s stacking context\n protected readonly computedClass = computed(() => xui('pointer-events-auto absolute z-10 block', this.class()));\n}\n\n/**\n * Marks a subtree inside a node as not draggable, so pointer gestures on it\n * belong to the control rather than moving the node.\n *\n * Native form controls, buttons and links are exempt already; this is for\n * anything custom — a slider, a curve editor, a colour wheel.\n */\n@Directive({\n selector: '[xuiGraphNoDrag]',\n exportAs: 'xuiGraphNoDrag',\n host: { 'data-xui-graph-no-drag': '' }\n})\nexport class XuiGraphNoDrag {}\n","import type { XuiGraphPoint, XuiGraphPortSide, XuiGraphRouting } from './node-graph.types';\n\n/** Unit vector pointing away from the node, per port side. */\nconst NORMALS: Record<XuiGraphPortSide, XuiGraphPoint> = {\n left: { x: -1, y: 0 },\n right: { x: 1, y: 0 },\n top: { x: 0, y: -1 },\n bottom: { x: 0, y: 1 }\n};\n\nexport function xuiGraphPortNormal(side: XuiGraphPortSide): XuiGraphPoint {\n return NORMALS[side];\n}\n\nexport interface XuiGraphRouteOptions {\n /**\n * How far a wire runs straight out of a port before it may turn, in graph\n * units. Keeps the first segment perpendicular to the node edge, which is what\n * makes a schematic readable.\n */\n stubLength: number;\n\n /** Corner rounding for `smoothstep`, in graph units. */\n cornerRadius: number;\n\n /**\n * Bezier control-point pull as a fraction of the port-to-port distance along\n * the port normal. `0` degenerates to a straight line; ~0.5 matches the slack\n * of a real cable.\n */\n curvature: number;\n}\n\nexport const XUI_GRAPH_DEFAULT_ROUTE_OPTIONS: XuiGraphRouteOptions = {\n stubLength: 18,\n cornerRadius: 8,\n curvature: 0.5\n};\n\n/**\n * Build the `d` attribute for a wire between two ports.\n *\n * The two sides matter as much as the two points: an edge leaving a right-hand\n * port must set off rightwards even when its target sits to the left, otherwise\n * it appears to pass through the node it came from.\n */\nexport function xuiGraphEdgePath(\n source: XuiGraphPoint,\n sourceSide: XuiGraphPortSide,\n target: XuiGraphPoint,\n targetSide: XuiGraphPortSide,\n routing: XuiGraphRouting,\n options: XuiGraphRouteOptions = XUI_GRAPH_DEFAULT_ROUTE_OPTIONS\n): string {\n switch (routing) {\n case 'straight':\n return `M ${round(source.x)} ${round(source.y)} L ${round(target.x)} ${round(target.y)}`;\n case 'orthogonal':\n return polylinePath(orthogonalPoints(source, sourceSide, target, targetSide, options.stubLength), 0);\n case 'smoothstep':\n return polylinePath(\n orthogonalPoints(source, sourceSide, target, targetSide, options.stubLength),\n options.cornerRadius\n );\n case 'bezier':\n default:\n return bezierPath(source, sourceSide, target, targetSide, options.curvature);\n }\n}\n\n/**\n * The point at the middle of a route, used to place edge labels.\n *\n * For a bezier this is the curve's t=0.5 point; for the orthogonal families it\n * is the point half the total run from the source. Picking the longest segment\n * instead would flip the label between two legs of equal length as the wire\n * moved, and the halfway point is where a reader looks anyway.\n */\nexport function xuiGraphEdgeMidpoint(\n source: XuiGraphPoint,\n sourceSide: XuiGraphPortSide,\n target: XuiGraphPoint,\n targetSide: XuiGraphPortSide,\n routing: XuiGraphRouting,\n options: XuiGraphRouteOptions = XUI_GRAPH_DEFAULT_ROUTE_OPTIONS\n): XuiGraphPoint {\n if (routing === 'straight') {\n return { x: (source.x + target.x) / 2, y: (source.y + target.y) / 2 };\n }\n\n if (routing === 'bezier') {\n const [c1, c2] = bezierControlPoints(source, sourceSide, target, targetSide, options.curvature);\n\n // Cubic Bezier at t = 0.5 reduces to the average of the four weights 1:3:3:1.\n return {\n x: (source.x + 3 * c1.x + 3 * c2.x + target.x) / 8,\n y: (source.y + 3 * c1.y + 3 * c2.y + target.y) / 8\n };\n }\n\n const points = orthogonalPoints(source, sourceSide, target, targetSide, options.stubLength);\n const lengths = points.slice(1).map((point, index) => distance(points[index], point));\n const half = lengths.reduce((sum, length) => sum + length, 0) / 2;\n let travelled = 0;\n\n for (let i = 0; i < lengths.length; i++) {\n if (travelled + lengths[i] >= half) {\n return lerp(points[i], points[i + 1], lengths[i] === 0 ? 0 : (half - travelled) / lengths[i]);\n }\n\n travelled += lengths[i];\n }\n\n return { x: (source.x + target.x) / 2, y: (source.y + target.y) / 2 };\n}\n\nfunction bezierControlPoints(\n source: XuiGraphPoint,\n sourceSide: XuiGraphPortSide,\n target: XuiGraphPoint,\n targetSide: XuiGraphPortSide,\n curvature: number\n): [XuiGraphPoint, XuiGraphPoint] {\n const sourceNormal = NORMALS[sourceSide];\n const targetNormal = NORMALS[targetSide];\n\n // Pull along each normal, scaled by the separation *on that normal's axis*.\n // A floor keeps near-coincident ports from collapsing into a straight stub,\n // which is what makes a self-connection or a tight back-link still legible.\n const dx = Math.abs(target.x - source.x);\n const dy = Math.abs(target.y - source.y);\n const sourcePull = Math.max(30, (sourceNormal.x !== 0 ? dx : dy) * curvature);\n const targetPull = Math.max(30, (targetNormal.x !== 0 ? dx : dy) * curvature);\n\n return [\n { x: source.x + sourceNormal.x * sourcePull, y: source.y + sourceNormal.y * sourcePull },\n { x: target.x + targetNormal.x * targetPull, y: target.y + targetNormal.y * targetPull }\n ];\n}\n\nfunction bezierPath(\n source: XuiGraphPoint,\n sourceSide: XuiGraphPortSide,\n target: XuiGraphPoint,\n targetSide: XuiGraphPortSide,\n curvature: number\n): string {\n const [c1, c2] = bezierControlPoints(source, sourceSide, target, targetSide, curvature);\n\n return (\n `M ${round(source.x)} ${round(source.y)} ` +\n `C ${round(c1.x)} ${round(c1.y)}, ${round(c2.x)} ${round(c2.y)}, ${round(target.x)} ${round(target.y)}`\n );\n}\n\n/**\n * Manhattan route between two ports.\n *\n * Both ends first travel `stub` along their normal; the remaining gap is closed\n * with one or two turns. Which turn pattern applies depends on whether the two\n * normals share an axis and whether the far stub is already \"ahead\" of the near\n * one — when it is not, the wire has to detour on the cross axis to get around.\n */\nfunction orthogonalPoints(\n source: XuiGraphPoint,\n sourceSide: XuiGraphPortSide,\n target: XuiGraphPoint,\n targetSide: XuiGraphPortSide,\n stub: number\n): XuiGraphPoint[] {\n const sourceNormal = NORMALS[sourceSide];\n const targetNormal = NORMALS[targetSide];\n const a = { x: source.x + sourceNormal.x * stub, y: source.y + sourceNormal.y * stub };\n const b = { x: target.x + targetNormal.x * stub, y: target.y + targetNormal.y * stub };\n\n const sourceHorizontal = sourceNormal.x !== 0;\n const targetHorizontal = targetNormal.x !== 0;\n const middle: XuiGraphPoint[] = [];\n\n if (sourceHorizontal && targetHorizontal) {\n // Facing each other with room between them: split the gap and turn twice.\n const facing = sourceNormal.x !== targetNormal.x;\n const hasRoom = facing && (b.x - a.x) * sourceNormal.x > 0;\n\n if (hasRoom) {\n const midX = (a.x + b.x) / 2;\n middle.push({ x: midX, y: a.y }, { x: midX, y: b.y });\n } else if (facing) {\n // Facing but overlapping — go around on the cross axis.\n const midY = (a.y + b.y) / 2;\n middle.push({ x: a.x, y: midY }, { x: b.x, y: midY });\n } else {\n // Same direction — run both stubs out to the furthest of the two.\n const x = sourceNormal.x > 0 ? Math.max(a.x, b.x) : Math.min(a.x, b.x);\n middle.push({ x, y: a.y }, { x, y: b.y });\n }\n } else if (!sourceHorizontal && !targetHorizontal) {\n const facing = sourceNormal.y !== targetNormal.y;\n const hasRoom = facing && (b.y - a.y) * sourceNormal.y > 0;\n\n if (hasRoom) {\n const midY = (a.y + b.y) / 2;\n middle.push({ x: a.x, y: midY }, { x: b.x, y: midY });\n } else if (facing) {\n const midX = (a.x + b.x) / 2;\n middle.push({ x: midX, y: a.y }, { x: midX, y: b.y });\n } else {\n const y = sourceNormal.y > 0 ? Math.max(a.y, b.y) : Math.min(a.y, b.y);\n middle.push({ x: a.x, y }, { x: b.x, y });\n }\n } else if (sourceHorizontal) {\n // Horizontal into vertical: a single elbow, turning under/over the target.\n middle.push({ x: b.x, y: a.y });\n } else {\n middle.push({ x: a.x, y: b.y });\n }\n\n return simplify([source, a, ...middle, b, target]);\n}\n\n/** Drop duplicate and collinear vertices so corner rounding never sees a zero-length leg. */\nfunction simplify(points: XuiGraphPoint[]): XuiGraphPoint[] {\n const result: XuiGraphPoint[] = [];\n\n for (const point of points) {\n const last = result[result.length - 1];\n\n if (last && Math.abs(last.x - point.x) < 0.01 && Math.abs(last.y - point.y) < 0.01) {\n continue;\n }\n\n const previous = result[result.length - 2];\n\n if (previous && last && isCollinear(previous, last, point)) {\n result[result.length - 1] = point;\n continue;\n }\n\n result.push(point);\n }\n\n return result;\n}\n\nfunction isCollinear(a: XuiGraphPoint, b: XuiGraphPoint, c: XuiGraphPoint): boolean {\n return (\n (Math.abs(a.x - b.x) < 0.01 && Math.abs(b.x - c.x) < 0.01) ||\n (Math.abs(a.y - b.y) < 0.01 && Math.abs(b.y - c.y) < 0.01)\n );\n}\n\n/**\n * Turn a polyline into a path, optionally rounding each interior corner.\n *\n * The rounding radius is clamped to half the shorter of the two legs meeting at\n * the corner, so a tight zig-zag degrades to sharp corners instead of producing\n * arcs that overshoot their own segments.\n */\nfunction polylinePath(points: XuiGraphPoint[], radius: number): string {\n if (points.length === 0) {\n return '';\n }\n\n if (radius <= 0 || points.length < 3) {\n return points.map((p, i) => `${i === 0 ? 'M' : 'L'} ${round(p.x)} ${round(p.y)}`).join(' ');\n }\n\n let path = `M ${round(points[0].x)} ${round(points[0].y)}`;\n\n for (let i = 1; i < points.length - 1; i++) {\n const previous = points[i - 1];\n const corner = points[i];\n const next = points[i + 1];\n const inLength = distance(previous, corner);\n const outLength = distance(corner, next);\n const r = Math.min(radius, inLength / 2, outLength / 2);\n\n if (r < 0.5) {\n path += ` L ${round(corner.x)} ${round(corner.y)}`;\n continue;\n }\n\n const enter = lerp(corner, previous, r / inLength);\n const exit = lerp(corner, next, r / outLength);\n\n path += ` L ${round(enter.x)} ${round(enter.y)}`;\n path += ` Q ${round(corner.x)} ${round(corner.y)}, ${round(exit.x)} ${round(exit.y)}`;\n }\n\n const last = points[points.length - 1];\n\n return `${path} L ${round(last.x)} ${round(last.y)}`;\n}\n\nfunction distance(a: XuiGraphPoint, b: XuiGraphPoint): number {\n return Math.hypot(b.x - a.x, b.y - a.y);\n}\n\nfunction lerp(from: XuiGraphPoint, to: XuiGraphPoint, t: number): XuiGraphPoint {\n return { x: from.x + (to.x - from.x) * t, y: from.y + (to.y - from.y) * t };\n}\n\nfunction round(value: number): number {\n return Math.round(value * 100) / 100;\n}\n","import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n model,\n numberAttribute,\n output,\n signal,\n untracked,\n ViewEncapsulation\n} from '@angular/core';\nimport { xui } from '@xui/core';\nimport type { ClassValue } from 'clsx';\nimport { XuiNodeGraphStore, type XuiGraphSettings } from './node-graph-store';\nimport { xuiGraphEdgeMidpoint, xuiGraphEdgePath, type XuiGraphRouteOptions } from './node-graph.routing';\nimport { injectXuiNodeGraphConfig, type XuiGraphPortType } from './node-graph.token';\nimport type {\n XuiGraphBackground,\n XuiGraphConnection,\n XuiGraphConnectionDrop,\n XuiGraphConnectionValidator,\n XuiGraphEdge,\n XuiGraphMarker,\n XuiGraphNodeMove,\n XuiGraphPoint,\n XuiGraphPortShape,\n XuiGraphRect,\n XuiGraphRouting,\n XuiGraphViewport\n} from './node-graph.types';\nimport { xuiGraphPortKey } from './node-graph.types';\n\n/** What the canvas is currently doing with the pointer. */\ntype Gesture = 'none' | 'pan' | 'marquee';\n\n/** Everything the template needs to draw one wire. */\ninterface RenderedEdge {\n edge: XuiGraphEdge;\n d: string;\n color: string;\n width: number;\n selected: boolean;\n dashArray: string | null;\n animated: boolean;\n markerId: string | null;\n label: string | null;\n labelPosition: XuiGraphPoint;\n}\n\nlet nextGraphId = 0;\n\n/**\n * A pannable, zoomable canvas for node-based editors and schematics.\n *\n * ```html\n * <xui-node-graph class=\"h-[600px]\" [edges]=\"edges()\" routing=\"orthogonal\" snapToGrid (connect)=\"add($event)\">\n * @for (node of nodes(); track node.id) {\n * <xui-graph-node [nodeId]=\"node.id\" [label]=\"node.label\" [(position)]=\"node.position\">\n * <xui-graph-port portId=\"in\" direction=\"input\" />\n * <xui-graph-port portId=\"out\" direction=\"output\" />\n * </xui-graph-node>\n * }\n * </xui-node-graph>\n * ```\n *\n * Nodes are ordinary projected content, so they keep Angular's template model —\n * `@for`, `@if`, your own components — instead of being described by a\n * configuration object. Edges are an input rather than content because a wire\n * has no content of its own: its whole geometry is derived from the two ports it\n * joins, which the graph already tracks.\n *\n * The graph never mutates `edges`. `connect` reports an approved connection and\n * the host decides what to add, which is what keeps undo/redo and persistence in\n * the host's hands.\n */\n@Component({\n selector: 'xui-node-graph',\n template: `\n <div\n class=\"pointer-events-none absolute inset-0\"\n [style.background-image]=\"backgroundImage()\"\n [style.background-size]=\"backgroundSize()\"\n [style.background-position]=\"backgroundPosition()\"\n ></div>\n\n <div class=\"absolute top-0 left-0 origin-top-left\" [style.transform]=\"canvasTransform()\">\n <svg class=\"pointer-events-none absolute overflow-visible\" width=\"1\" height=\"1\" aria-hidden=\"true\">\n <defs>\n <marker\n [id]=\"arrowId\"\n markerWidth=\"10\"\n markerHeight=\"10\"\n refX=\"9\"\n refY=\"5\"\n orient=\"auto-start-reverse\"\n markerUnits=\"userSpaceOnUse\"\n >\n <path d=\"M 1 1 L 9 5 L 1 9\" fill=\"none\" stroke=\"context-stroke\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </marker>\n <marker\n [id]=\"arrowClosedId\"\n markerWidth=\"10\"\n markerHeight=\"10\"\n refX=\"9\"\n refY=\"5\"\n orient=\"auto-start-reverse\"\n markerUnits=\"userSpaceOnUse\"\n >\n <path d=\"M 1 1 L 9 5 L 1 9 Z\" fill=\"context-stroke\" stroke=\"context-stroke\" stroke-width=\"1\" />\n </marker>\n <marker [id]=\"dotId\" markerWidth=\"8\" markerHeight=\"8\" refX=\"4\" refY=\"4\" markerUnits=\"userSpaceOnUse\">\n <circle cx=\"4\" cy=\"4\" r=\"3\" fill=\"context-stroke\" />\n </marker>\n </defs>\n\n @for (item of renderedEdges(); track item.edge.id) {\n <g class=\"pointer-events-auto\">\n @if (item.selected) {\n <path\n [attr.d]=\"item.d\"\n fill=\"none\"\n stroke=\"var(--color-selection)\"\n [attr.stroke-width]=\"item.width + 8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n }\n <path\n class=\"cursor-pointer\"\n [attr.d]=\"item.d\"\n fill=\"none\"\n stroke=\"transparent\"\n [attr.stroke-width]=\"Math.max(item.width * 4, 14)\"\n [attr.pointer-events]=\"locked() ? 'none' : 'stroke'\"\n (pointerdown)=\"onEdgePointerDown(item.edge, $event)\"\n />\n <path\n [class]=\"item.animated ? 'xui-graph-edge-flow' : null\"\n [attr.d]=\"item.d\"\n fill=\"none\"\n [attr.stroke]=\"item.color\"\n [attr.stroke-width]=\"item.width\"\n [attr.stroke-dasharray]=\"item.dashArray\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n [attr.marker-end]=\"item.markerId\"\n pointer-events=\"none\"\n />\n </g>\n }\n\n @if (linkPreview(); as preview) {\n <path\n [attr.d]=\"preview.d\"\n fill=\"none\"\n [attr.stroke]=\"preview.color\"\n [attr.stroke-width]=\"edgeWidth()\"\n stroke-dasharray=\"6 5\"\n stroke-linecap=\"round\"\n pointer-events=\"none\"\n />\n }\n </svg>\n\n <ng-content />\n\n @for (item of renderedEdges(); track item.edge.id) {\n @if (item.label) {\n <div\n class=\"bg-surface-overlay text-foreground-muted border-border-muted pointer-events-none absolute rounded border px-1.5 py-0.5 text-[10px] whitespace-nowrap\"\n [style.left.px]=\"item.labelPosition.x\"\n [style.top.px]=\"item.labelPosition.y\"\n style=\"transform: translate(-50%, -50%)\"\n >\n {{ item.label }}\n </div>\n }\n }\n </div>\n\n @if (marqueeRect(); as rect) {\n <div\n class=\"border-primary bg-primary/15 pointer-events-none absolute border\"\n [style.left.px]=\"rect.x\"\n [style.top.px]=\"rect.y\"\n [style.width.px]=\"rect.width\"\n [style.height.px]=\"rect.height\"\n ></div>\n }\n\n <ng-content select=\"xui-graph-overlay, xui-graph-controls, xui-graph-minimap\" />\n `,\n styles: `\n @keyframes xui-graph-edge-flow {\n to {\n stroke-dashoffset: -16;\n }\n }\n\n .xui-graph-edge-flow {\n stroke-dasharray: 8 8;\n animation: xui-graph-edge-flow 0.6s linear infinite;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .xui-graph-edge-flow {\n animation: none;\n }\n }\n `,\n host: {\n '[class]': 'computedClass()',\n '[attr.tabindex]': '0',\n role: 'application',\n '(pointerdown)': 'onPointerDown($event)',\n '(pointermove)': 'onPointerMove($event)',\n '(pointerup)': 'onPointerUp($event)',\n '(pointercancel)': 'onPointerUp($event)',\n '(wheel)': 'onWheel($event)',\n '(keydown)': 'onKeydown($event)',\n '(contextmenu)': 'onContextMenu($event)'\n },\n providers: [XuiNodeGraphStore],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiNodeGraph {\n private readonly config = injectXuiNodeGraphConfig();\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly uid = nextGraphId++;\n\n /** Pointer position where the current gesture began, in client coordinates. */\n private gestureOrigin: XuiGraphPoint = { x: 0, y: 0 };\n private gesture: Gesture = 'none';\n private gestureMoved = false;\n\n private readonly marqueeState = signal<XuiGraphRect | null>(null);\n\n /** The store for this canvas. Use it to drive the view from a host component. */\n readonly store = inject(XuiNodeGraphStore);\n\n readonly class = input<ClassValue>('');\n\n /** The wires to draw. Never mutated — see `connect`. */\n readonly edges = input<readonly XuiGraphEdge[]>([]);\n\n /** Pan and zoom. Two-way bindable, so a host can save and restore the view. */\n readonly viewport = model<XuiGraphViewport>({ x: 0, y: 0, zoom: 1 });\n\n readonly routing = input<XuiGraphRouting>(this.config.routing);\n readonly background = input<XuiGraphBackground>(this.config.background);\n readonly marker = input<XuiGraphMarker>(this.config.marker);\n\n readonly gridSize = input<number, NumberInput>(this.config.gridSize, { transform: numberAttribute });\n\n readonly snapToGrid = input<boolean, BooleanInput>(this.config.snapToGrid, { transform: booleanAttribute });\n\n readonly minZoom = input<number, NumberInput>(this.config.minZoom, { transform: numberAttribute });\n readonly maxZoom = input<number, NumberInput>(this.config.maxZoom, { transform: numberAttribute });\n\n readonly edgeWidth = input<number, NumberInput>(this.config.edgeWidth, { transform: numberAttribute });\n readonly portSize = input<number, NumberInput>(this.config.portSize, { transform: numberAttribute });\n readonly portShape = input<XuiGraphPortShape>(this.config.portShape);\n readonly portColor = input<string>(this.config.portColor);\n\n /** Data-type registry: colour, glyph and label per `dataType`. */\n readonly portTypes = input<Record<string, XuiGraphPortType>>(this.config.portTypes);\n\n readonly allowSelfConnection = input<boolean, BooleanInput>(this.config.allowSelfConnection, {\n transform: booleanAttribute\n });\n\n readonly enforcePortTypes = input<boolean, BooleanInput>(this.config.enforcePortTypes, {\n transform: booleanAttribute\n });\n\n /** Last say on whether a connection may be made. Runs after the built-in rules. */\n readonly isValidConnection = input<XuiGraphConnectionValidator>();\n\n /** Read-only canvas: pan and zoom still work, editing does not. */\n readonly locked = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Dragging empty canvas pans. Turn it off to make dragging a marquee select instead. */\n readonly panOnDrag = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /**\n * `wheel` zooms on a bare wheel, as node editors do. `ctrl-wheel` reserves the\n * bare wheel for panning and zooms only with the modifier, as design tools do.\n */\n readonly zoomActivation = input<'wheel' | 'ctrl-wheel'>('wheel');\n\n readonly zoomOnScroll = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** A connection that passed every rule. The host decides whether to add it. */\n readonly connect = output<XuiGraphConnection>();\n\n /** A wire dropped on empty canvas — the hook for \"drag out to create a node\". */\n readonly connectionDrop = output<XuiGraphConnectionDrop>();\n\n readonly edgeClick = output<XuiGraphEdge>();\n\n /** Fired once per drag, when the pointer is released. */\n readonly nodeMove = output<XuiGraphNodeMove>();\n\n readonly selectionChange = output<{ nodes: string[]; edges: string[] }>();\n\n /** Delete or Backspace over the canvas. The host performs the removal. */\n readonly deleteSelection = output<{ nodes: string[]; edges: string[] }>();\n\n readonly canvasContextMenu = output<{ event: MouseEvent; position: XuiGraphPoint }>();\n\n protected readonly Math = Math;\n protected readonly arrowId = `xui-graph-arrow-${this.uid}`;\n protected readonly arrowClosedId = `xui-graph-arrow-closed-${this.uid}`;\n protected readonly dotId = `xui-graph-dot-${this.uid}`;\n\n protected readonly marqueeRect = computed(() => {\n const rect = this.marqueeState();\n\n if (!rect) {\n return null;\n }\n\n const origin = this.store.toSurfacePoint(rect);\n const { zoom } = this.viewport();\n\n return { x: origin.x, y: origin.y, width: rect.width * zoom, height: rect.height * zoom };\n });\n\n private readonly settings = computed<XuiGraphSettings>(() => ({\n routing: this.routing(),\n gridSize: this.gridSize(),\n snapToGrid: this.snapToGrid(),\n minZoom: this.minZoom(),\n maxZoom: this.maxZoom(),\n stubLength: this.config.stubLength,\n cornerRadius: this.config.cornerRadius,\n curvature: this.config.curvature,\n edgeWidth: this.edgeWidth(),\n portSize: this.portSize(),\n portShape: this.portShape(),\n portColor: this.portColor(),\n portTypes: this.portTypes(),\n allowSelfConnection: this.allowSelfConnection(),\n enforcePortTypes: this.enforcePortTypes(),\n isValidConnection: this.isValidConnection(),\n locked: this.locked()\n }));\n\n private readonly routeOptions = computed<XuiGraphRouteOptions>(() => ({\n stubLength: this.config.stubLength,\n cornerRadius: this.config.cornerRadius,\n curvature: this.config.curvature\n }));\n\n protected readonly canvasTransform = computed(() => {\n const { x, y, zoom } = this.viewport();\n\n return `translate(${x}px, ${y}px) scale(${zoom})`;\n });\n\n protected readonly renderedEdges = computed<RenderedEdge[]>(() => {\n const routing = this.routing();\n const options = this.routeOptions();\n const defaultWidth = this.edgeWidth();\n const defaultMarker = this.marker();\n const selected = this.store.selectedEdges();\n const rendered: RenderedEdge[] = [];\n\n for (const edge of this.edges()) {\n const sourceKey = xuiGraphPortKey(edge.source.nodeId, edge.source.portId);\n const targetKey = xuiGraphPortKey(edge.target.nodeId, edge.target.portId);\n const sourcePort = this.store.port(sourceKey);\n const targetPort = this.store.port(targetKey);\n const sourcePoint = this.store.portPoint(sourceKey);\n const targetPoint = this.store.portPoint(targetKey);\n\n // An edge naming a port that has not rendered yet is skipped rather than\n // guessed at, so a lazily-created node never draws a wire to the origin.\n if (!sourcePort || !targetPort || !sourcePoint || !targetPoint) {\n continue;\n }\n\n const edgeRouting = edge.routing ?? routing;\n const sourceSide = sourcePort.resolvedSide();\n const targetSide = targetPort.resolvedSide();\n const markerType = edge.marker ?? defaultMarker;\n\n rendered.push({\n edge,\n d: xuiGraphEdgePath(sourcePoint, sourceSide, targetPoint, targetSide, edgeRouting, options),\n color: edge.color ?? sourcePort.resolvedColor(),\n width: edge.width ?? defaultWidth,\n selected: selected.has(edge.id),\n dashArray: edge.dashed && !edge.animated ? '5 5' : null,\n animated: !!edge.animated,\n markerId: this.markerUrl(markerType),\n label: edge.label ?? null,\n labelPosition: xuiGraphEdgeMidpoint(sourcePoint, sourceSide, targetPoint, targetSide, edgeRouting, options)\n });\n }\n\n return rendered;\n });\n\n /** The wire that follows the pointer while a connection is being drawn. */\n protected readonly linkPreview = computed(() => {\n const linking = this.store.linking();\n\n if (!linking) {\n return null;\n }\n\n const port = this.store.port(linking.fromKey);\n const from = this.store.portPoint(linking.fromKey);\n\n if (!port || !from) {\n return null;\n }\n\n // Land on whichever port is hovered, so the preview snaps before release.\n const hoverPoint = linking.hoverKey ? this.store.portPoint(linking.hoverKey) : null;\n const hoverSide = linking.hoverKey ? this.store.port(linking.hoverKey)?.resolvedSide() : undefined;\n const to = hoverPoint ?? linking.pointer;\n const toSide = hoverSide ?? OPPOSITE[port.resolvedSide()];\n const valid = linking.hoverKey ? this.store.linkState(linking.hoverKey) === 'valid' : true;\n\n return {\n d: xuiGraphEdgePath(from, port.resolvedSide(), to, toSide, this.routing(), this.routeOptions()),\n color: valid ? port.resolvedColor() : 'var(--color-error)'\n };\n });\n\n protected readonly backgroundImage = computed(() => {\n const background = this.background();\n const step = this.gridSize() * this.viewport().zoom;\n\n // Below a few pixels a rule turns into noise, so it is dropped entirely.\n if (background === 'none' || step < 4) {\n return null;\n }\n\n if (background === 'dots') {\n return 'radial-gradient(circle, var(--color-border-strong) 1px, transparent 1px)';\n }\n\n return [\n 'linear-gradient(to right, var(--color-border-muted) 1px, transparent 1px)',\n 'linear-gradient(to bottom, var(--color-border-muted) 1px, transparent 1px)',\n 'linear-gradient(to right, var(--color-border) 1px, transparent 1px)',\n 'linear-gradient(to bottom, var(--color-border) 1px, transparent 1px)'\n ].join(', ');\n });\n\n protected readonly backgroundSize = computed(() => {\n const step = this.gridSize() * this.viewport().zoom;\n const major = step * this.config.gridMajorEvery;\n\n return this.background() === 'dots'\n ? `${step}px ${step}px`\n : `${step}px ${step}px, ${step}px ${step}px, ${major}px ${major}px, ${major}px ${major}px`;\n });\n\n protected readonly backgroundPosition = computed(() => {\n const { x, y } = this.viewport();\n const offset = `${x}px ${y}px`;\n\n return this.background() === 'dots' ? offset : `${offset}, ${offset}, ${offset}, ${offset}`;\n });\n\n protected readonly computedClass = computed(() =>\n xui(\n // The canvas is focusable so its shortcuts work, but draws no focus ring:\n // a ring around the whole editor reads as a selection the user did not make,\n // and every element inside it that can hold focus rings on its own.\n 'bg-background relative block touch-none overflow-hidden outline-none',\n this.class()\n )\n );\n\n constructor() {\n this.store.configure({\n settings: this.settings,\n viewport: this.viewport,\n edges: this.edges,\n listeners: {\n connect: connection => this.connect.emit(connection),\n connectionDrop: drop => this.connectionDrop.emit(drop),\n nodeMove: move => this.nodeMove.emit(move),\n selectionChange: () =>\n this.selectionChange.emit({\n nodes: [...this.store.selectedNodes()],\n edges: [...this.store.selectedEdges()]\n })\n }\n });\n\n this.store.setSurface(this.element);\n\n const observer = new ResizeObserver(() =>\n this.store.surfaceSize.set({ width: this.element.clientWidth, height: this.element.clientHeight })\n );\n\n observer.observe(this.element);\n inject(DestroyRef).onDestroy(() => observer.disconnect());\n }\n\n /** Frame every node, leaving `padding` screen pixels of margin. */\n fitView(padding?: number): void {\n this.store.fitView(padding);\n }\n\n zoomIn(): void {\n this.store.zoomBy(this.config.zoomStep);\n }\n\n zoomOut(): void {\n this.store.zoomBy(1 / this.config.zoomStep);\n }\n\n /** Return to 1:1 without moving the centre of the view. */\n resetZoom(): void {\n this.store.zoomTo(1);\n }\n\n private markerUrl(marker: XuiGraphMarker): string | null {\n switch (marker) {\n case 'arrow':\n return `url(#${this.arrowId})`;\n case 'arrow-closed':\n return `url(#${this.arrowClosedId})`;\n case 'dot':\n return `url(#${this.dotId})`;\n default:\n return null;\n }\n }\n\n protected onEdgePointerDown(edge: XuiGraphEdge, event: PointerEvent): void {\n if (event.button !== 0 || this.locked()) {\n return;\n }\n\n event.stopPropagation();\n this.store.selectEdge(edge.id, event.shiftKey || event.ctrlKey || event.metaKey);\n this.edgeClick.emit(edge);\n }\n\n /**\n * Presses that reach here landed on empty canvas — nodes, ports and edges all\n * stop propagation — so this only ever starts a pan or a marquee.\n */\n protected onPointerDown(event: PointerEvent): void {\n const middle = event.button === 1;\n\n if (event.button !== 0 && !middle) {\n return;\n }\n\n // Overlay furniture sits above the canvas but still bubbles to it. Capturing\n // the pointer here would retarget the release and the button would never see\n // a click at all, so the whole overlay layer is left alone.\n if ((event.target as HTMLElement).closest('[data-xui-graph-overlay]')) {\n return;\n }\n\n this.element.focus({ preventScroll: true });\n this.element.setPointerCapture(event.pointerId);\n this.gestureOrigin = { x: event.clientX, y: event.clientY };\n this.gestureMoved = false;\n\n // Middle-drag always pans, whatever the primary gesture is bound to;\n // shift inverts the primary gesture, which is the convention everywhere.\n const pan = middle || this.panOnDrag() !== event.shiftKey;\n\n if (pan) {\n this.gesture = 'pan';\n return;\n }\n\n this.gesture = 'marquee';\n\n const start = this.store.toGraphPoint(event.clientX, event.clientY);\n this.marqueeState.set({ x: start.x, y: start.y, width: 0, height: 0 });\n }\n\n protected onPointerMove(event: PointerEvent): void {\n if (this.gesture === 'none') {\n return;\n }\n\n const dx = event.clientX - this.gestureOrigin.x;\n const dy = event.clientY - this.gestureOrigin.y;\n\n if (Math.abs(dx) > 2 || Math.abs(dy) > 2) {\n this.gestureMoved = true;\n }\n\n if (this.gesture === 'pan') {\n this.store.panBy(dx, dy);\n this.gestureOrigin = { x: event.clientX, y: event.clientY };\n return;\n }\n\n const start = this.store.toGraphPoint(this.gestureOrigin.x, this.gestureOrigin.y);\n const current = this.store.toGraphPoint(event.clientX, event.clientY);\n\n this.marqueeState.set({\n x: Math.min(start.x, current.x),\n y: Math.min(start.y, current.y),\n width: Math.abs(current.x - start.x),\n height: Math.abs(current.y - start.y)\n });\n }\n\n protected onPointerUp(event: PointerEvent): void {\n if (this.gesture === 'none') {\n return;\n }\n\n this.element.releasePointerCapture(event.pointerId);\n\n const rect = untracked(this.marqueeState);\n const gesture = this.gesture;\n\n this.gesture = 'none';\n this.marqueeState.set(null);\n\n if (gesture === 'marquee' && rect && this.gestureMoved) {\n this.store.selectInRect(rect, event.shiftKey || event.ctrlKey || event.metaKey);\n return;\n }\n\n // A press that never moved is a click on the backdrop: deselect.\n if (!this.gestureMoved) {\n this.store.clearSelection();\n }\n }\n\n protected onWheel(event: WheelEvent): void {\n if (!this.zoomOnScroll()) {\n return;\n }\n\n const rect = this.element.getBoundingClientRect();\n const anchor = { x: event.clientX - rect.left, y: event.clientY - rect.top };\n\n if (this.zoomActivation() === 'ctrl-wheel' && !event.ctrlKey && !event.metaKey) {\n event.preventDefault();\n this.store.panBy(-event.deltaX, -event.deltaY);\n return;\n }\n\n event.preventDefault();\n\n // Exponential in the raw delta so a trackpad's fine-grained events and a\n // mouse wheel's coarse notches both feel proportional.\n this.store.zoomBy(Math.exp(-clamp(event.deltaY, -120, 120) * 0.0025), anchor);\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const modifier = event.ctrlKey || event.metaKey;\n\n if (modifier && event.key.toLowerCase() === 'a') {\n event.preventDefault();\n this.store.selectAll();\n return;\n }\n\n if (event.key === 'Escape') {\n this.store.endLink(null);\n this.store.clearSelection();\n return;\n }\n\n if ((event.key === 'Delete' || event.key === 'Backspace') && !this.locked()) {\n const nodes = [...this.store.selectedNodes()];\n const edges = [...this.store.selectedEdges()];\n\n if (nodes.length || edges.length) {\n event.preventDefault();\n this.deleteSelection.emit({ nodes, edges });\n }\n\n return;\n }\n\n const nudge = ARROW_NUDGE[event.key];\n\n if (nudge && !this.locked() && this.store.selectedNodes().size > 0) {\n event.preventDefault();\n\n // Shift steps a whole grid cell; a bare arrow moves by one unit, or by the\n // grid when snapping is on and any smaller step would be discarded anyway.\n const step = event.shiftKey || this.snapToGrid() ? this.gridSize() : 1;\n const first = [...this.store.selectedNodes()][0];\n\n this.store.beginNodeDrag(first);\n this.store.dragNodesBy({ x: nudge.x * step, y: nudge.y * step });\n this.store.endNodeDrag();\n }\n }\n\n protected onContextMenu(event: MouseEvent): void {\n this.canvasContextMenu.emit({ event, position: this.store.toGraphPoint(event.clientX, event.clientY) });\n }\n}\n\nconst OPPOSITE = { left: 'right', right: 'left', top: 'bottom', bottom: 'top' } as const;\n\nconst ARROW_NUDGE: Record<string, XuiGraphPoint | undefined> = {\n ArrowLeft: { x: -1, y: 0 },\n ArrowRight: { x: 1, y: 0 },\n ArrowUp: { x: 0, y: -1 },\n ArrowDown: { x: 0, y: 1 }\n};\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, value));\n}\n","import { XuiGraphControls } from './lib/graph-controls';\nimport { XuiGraphGroup } from './lib/graph-group';\nimport { XuiGraphMinimap } from './lib/graph-minimap';\nimport { XuiGraphNode } from './lib/graph-node';\nimport {\n XuiGraphNodeActions,\n XuiGraphNodeHeader,\n XuiGraphNodePreview,\n XuiGraphNoDrag,\n XuiGraphOverlay\n} from './lib/graph-node-slots';\nimport { XuiGraphPort } from './lib/graph-port';\nimport { XuiNodeGraph } from './lib/node-graph';\n\nexport * from './lib/graph-controls';\nexport * from './lib/graph-group';\nexport * from './lib/graph-minimap';\nexport * from './lib/graph-node';\nexport * from './lib/graph-node-slots';\nexport * from './lib/graph-port';\nexport * from './lib/node-graph';\nexport * from './lib/node-graph-store';\nexport * from './lib/node-graph.routing';\nexport * from './lib/node-graph.token';\nexport * from './lib/node-graph.types';\n\nexport const XuiNodeGraphImports = [\n XuiNodeGraph,\n XuiGraphNode,\n XuiGraphPort,\n XuiGraphGroup,\n XuiGraphControls,\n XuiGraphMinimap,\n XuiGraphNodeHeader,\n XuiGraphNodeActions,\n XuiGraphNodePreview,\n XuiGraphNoDrag,\n XuiGraphOverlay\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAiPA;;;;;;AAMG;AACG,SAAU,eAAe,CAAC,MAAc,EAAE,MAAc,EAAA;IAC5D,OAAO,CAAA,EAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAA,CAAA,EAAI,MAAM,CAAA,CAAE;AAC/C;;AClKA;;;;;AAKG;MAEU,iBAAiB,CAAA;IACpB,cAAc,GAAoC,IAAI;IACtD,SAAS,GAAkC,IAAI;IAC/C,OAAO,GAAuB,IAAI;;AAGlC,IAAA,WAAW,GAAG,IAAI,GAAG,EAAyB;IAC9C,SAAS,GAAG,KAAK;AAEzB;;;;;;;;;;AAUG;IACc,IAAI,GAAG,MAAM,CAA2B,IAAI;6EAAC;AAE9D;;;;AAIG;IACK,cAAc,GAA4C,IAAI;IAC9D,WAAW,GAA2C,IAAI;AACjD,IAAA,WAAW,GAAG,MAAM,CAAmB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;oFAAC;AAEvE,IAAA,QAAQ,GAA6B,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,WAAW,GAAG;iFAAC;AAChG,IAAA,KAAK,GAAoC,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,IAAI,IAAI,WAAW;8EAAC;AAC5F,IAAA,aAAa,GAAG,MAAM,CAAsB,IAAI,GAAG,EAAE;sFAAC;AACtD,IAAA,aAAa,GAAG,MAAM,CAAsB,IAAI,GAAG,EAAE;sFAAC;IACtD,OAAO,GAAG,MAAM,CAAyB,IAAI;gFAAC;;IAG9C,WAAW,GAAG,MAAM,CAAC,EAAE,KAAK,EAAE,CAA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