shortcuts

This commit is contained in:
2026-03-09 16:22:22 +01:00
parent 40379161e0
commit c596fc70eb
5 changed files with 212 additions and 3 deletions

View File

@@ -4,6 +4,11 @@ import type { AppNode, AppEdge } from '@/lib/nodeTypes'
export type ConnectionFrom = { nodeId: string; sourceHandle?: string } | null
export type FlowActions = {
pasteAtViewportCenter: () => void
fitView: () => void
}
export type FlowContextValue = {
nodes: AppNode[]
setNodes: (updater: AppNode[] | ((prev: AppNode[]) => AppNode[])) => void
@@ -15,6 +20,8 @@ export type FlowContextValue = {
connectionFrom: ConnectionFrom
setConnectionFrom: (v: ConnectionFrom) => void
isValidConnection: (connection: Connection) => boolean
/** Set by FlowKeyboardShortcuts so Node menubar can trigger paste / fit view. */
flowActionsRef: React.MutableRefObject<FlowActions | null>
}
const FlowContext = React.createContext<FlowContextValue | null>(null)