input highlights

This commit is contained in:
2026-03-08 09:29:41 +01:00
parent 4065bde50d
commit 78c3ebddd7
7 changed files with 90 additions and 7 deletions

View File

@@ -1,4 +1,7 @@
import React from 'react'
import type { Connection } from '@xyflow/react'
export type ConnectionFrom = { nodeId: string; sourceHandle?: string } | null
export type FlowContextValue = {
nodes: any[]
@@ -7,6 +10,10 @@ export type FlowContextValue = {
setEdges: (updater: any) => void
renamingNodeId: string | null
setRenamingNodeId: (id: string | null) => void
/** Set when user starts dragging from an output handle; cleared on connect end. Used to highlight valid targets. */
connectionFrom: ConnectionFrom
setConnectionFrom: (v: ConnectionFrom) => void
isValidConnection: (connection: Connection) => boolean
}
const FlowContext = React.createContext<FlowContextValue | null>(null)