// Public API for `@barefootjs/xyflow`. // // JSX-native renderer components (`` / `` / // `` / `` / `` / `` / // ``) are distributed via the shadcn registry at // `ui/components/ui/xyflow/` — install with `bf add xyflow`. // This package ships the utility helpers, types, signal hooks, store, // and the imperative pointer-paced subsystems those components attach // via `ref` callbacks. // Store / context / signal hooks export { createFlowStore } from './store.ts' export { FlowContext } from './context.ts' export { useFlow, useViewport, useNodes, useEdges, useNodesInitialized, useStore, screenToFlowPosition, } from './hooks.ts' // Geometry helpers consumed by the JSX `` component export { computeEdgePosition, getEdgePath } from './edge-path.ts' export type { EdgePathTuple } from './edge-path.ts' // Pointer-paced subsystems attached via `` / `` `ref` // callbacks. JSX gives these no leverage — pan/zoom is owned by // `XYPanZoom` (D3-zoom-derived), the selection rectangle owns global // pointer capture, connection drag uses `elementFromPoint`, and the // node resizer needs raw dimension math. export { attachFlowSubsystems, clampDragPositionToParent } from './flow-subsystems.ts' export { attachConnectionHandler, attachReconnectionHandler } from './connection.ts' export { dispatchNodeType } from './node-type-dispatch.ts' export type { NodeInitFn } from './node-type-dispatch.ts' export { initNodeResizer, ResizeControlVariant } from './node-resizer.ts' export type { NodeResizerOptions, ControlPosition, ControlLinePosition, OnResize, OnResizeStart, OnResizeEnd, ShouldResize, ResizeControlDirection, } from './node-resizer.ts' export { setupKeyboardHandlers, setupNodeSelection, setupSelectionRectangle } from './selection.ts' export type { SelectionRectOptions } from './selection.ts' // Stable CSS class names for the registry-side JSX components. // Imported (rather than declared as inline literals) so site/ui's // cssLayerPrefixer leaves the `bf-flow*` names un-prefixed, matching // the chart pattern (`CHART_CLASS_*` from `@barefootjs/chart`). export { BF_FLOW, BF_FLOW_VIEWPORT, BF_FLOW_EDGES, BF_FLOW_NODES, BF_FLOW_NODE, BF_FLOW_NODE_GROUP, BF_FLOW_NODE_CHILD, BF_FLOW_NODE_SELECTED, BF_FLOW_NODE_CUSTOM, BF_FLOW_EDGE, BF_FLOW_EDGE_SELECTED, BF_FLOW_EDGE_ANIMATED, BF_FLOW_HANDLE, BF_FLOW_HANDLE_TARGET, BF_FLOW_HANDLE_SOURCE, BF_FLOW_CONTROLS, BF_FLOW_CONTROLS_BUTTON, BF_FLOW_MINIMAP, BF_FLOW_MINIMAP_MASK, XYFLOW_VIEWPORT, } from './classes.ts' // Types export type { FlowProps, FlowStore, InternalFlowStore, FlowStoreOptions, FitViewOptions, NodeBase, EdgeBase, InternalNodeBase, Viewport, NodeLookup, ParentLookup, EdgeLookup, ConnectionLookup, CoordinateExtent, SnapGrid, NodeOrigin, Transform, PanZoomInstance, XYPosition, OnConnect, OnConnectStart, OnConnectEnd, IsValidConnection, NodeDragItem, ConnectionMode, NodeComponentProps, EdgeComponentProps, SelectionMode, OnReconnect, Connection, } from './types.ts' // HandleType is consumed by the JSX `` component (registry-side) // for its `type` prop typing. Re-exported here from `@xyflow/system` so // consumers don't need a separate import. export type { HandleType } from '@xyflow/system' // Compat layer (React Flow API shims for desk migration) export { useNodesState, useEdgesState, useReactFlow, addEdge, reconnectEdge } from './compat.ts' // Re-export useful utilities from @xyflow/system export { getBezierPath, getSmoothStepPath, getStraightPath, getConnectedEdges, getOutgoers, getIncomers, getNodesBounds, getNodesInside, getEdgeToolbarTransform, Position, ConnectionMode as ConnectionModeEnum, MarkerType, } from '@xyflow/system'