import './VisProgUI.css' import { Background, Controls, ReactFlow, ReactFlowProvider, MarkerType, Panel, } from '@xyflow/react'; import '@xyflow/react/dist/style.css'; import { StartNode, EndNode, PhaseNode, NormNode } from "./components/NodeDefinitions.tsx"; import { Sidebar } from './components/DragDropSidebar.tsx'; import useStore from "./VisProgStores.tsx"; import {useShallow} from "zustand/react/shallow"; import type {FlowState} from "./VisProgTypes.tsx"; // --| config starting params for flow |-- const nodeTypes = { start: StartNode, end: EndNode, phase: PhaseNode, norm: NormNode }; const defaultEdgeOptions = { type: 'default', markerEnd: { type: MarkerType.ArrowClosed, color: '#505050', }, }; const selector = (state: FlowState) => ({ nodes: state.nodes, edges: state.edges, onNodesChange: state.onNodesChange, onEdgesChange: state.onEdgesChange, onConnect: state.onConnect, onReconnectStart: state.onReconnectStart, onReconnectEnd: state.onReconnectEnd, onReconnect: state.onReconnect }); // --| define ReactFlow editor |-- const VisProgUI = ()=> { const { nodes, edges, onNodesChange, onEdgesChange, onConnect, onReconnect, onReconnectStart, onReconnectEnd } = useStore( useShallow(selector), ); // handles connection of newly created edges return (