Line

You are reading docs for v0.8. See latest (v0.9)

ui/client/features/workflows/hooks/useCanvasSelection

Cockpit client (features), v0.8. Source: ui/client/features/workflows/hooks/useCanvasSelection.tsx.

Functions#

useCanvasSelection()#

useCanvasSelection(file): object

Defined in: ui/client/features/workflows/hooks/useCanvasSelection.tsx:10

What the diagram and the tools tabs share: which machine of the open file the tabs act on, the event name typed for new transitions, the selected arrow and the "type an event name first" hint. Reset whenever another file is opened; kept across a confirmed edit of the same file.

Parameters#

file

string

Returns#

object

eventName

eventName: string

hint

hint: string | null

machineIndex

machineIndex: number

pickMachine

pickMachine: (index) => void

Parameters
index

number

Returns

void

selectedEdge

selectedEdge: SelectedEdge | null

setEventName

setEventName: Dispatch<SetStateAction<string>>

setHint

setHint: Dispatch<SetStateAction<string | null>>

setSelectedEdge

setSelectedEdge: Dispatch<SetStateAction<SelectedEdge | null>>