Formatting changes
This commit is contained in:
parent
df8912055d
commit
0bc74b5251
2 changed files with 22 additions and 15 deletions
|
|
@ -26,21 +26,20 @@ import { FlowsContext } from "../../../../contexts/flowsContext";
|
|||
import { locationContext } from "../../../../contexts/locationContext";
|
||||
import { typesContext } from "../../../../contexts/typesContext";
|
||||
import { undoRedoContext } from "../../../../contexts/undoRedoContext";
|
||||
import useFlow from "../../../../stores/flowManagerStore";
|
||||
import { APIClassType } from "../../../../types/api";
|
||||
import { FlowType, NodeType, targetHandleType } from "../../../../types/flow";
|
||||
import { FlowType, NodeType } from "../../../../types/flow";
|
||||
import {
|
||||
generateFlow,
|
||||
generateNodeFromFlow,
|
||||
getNodeId,
|
||||
isValidConnection,
|
||||
scapeJSONParse,
|
||||
validateSelection,
|
||||
} from "../../../../utils/reactflowUtils";
|
||||
import { cn, getRandomName, isWrappedWithClass } from "../../../../utils/utils";
|
||||
import ConnectionLineComponent from "../ConnectionLineComponent";
|
||||
import SelectionMenu from "../SelectionMenuComponent";
|
||||
import ExtraSidebar from "../extraSidebarComponent";
|
||||
import useFlow from "../../../../stores/flowManagerStore";
|
||||
|
||||
const nodeTypes = {
|
||||
genericNode: GenericNode,
|
||||
|
|
@ -53,15 +52,8 @@ export default function Page({
|
|||
flow: FlowType;
|
||||
view?: boolean;
|
||||
}): JSX.Element {
|
||||
let {
|
||||
uploadFlow,
|
||||
saveFlow,
|
||||
} = useContext(FlowsContext);
|
||||
const {
|
||||
types,
|
||||
templates,
|
||||
setFilterEdge,
|
||||
} = useContext(typesContext);
|
||||
let { uploadFlow, saveFlow } = useContext(FlowsContext);
|
||||
const { types, templates, setFilterEdge } = useContext(typesContext);
|
||||
const reactFlowWrapper = useRef<HTMLDivElement>(null);
|
||||
|
||||
const [lastCopiedSelection, setLastCopiedSelection] = useState<{
|
||||
|
|
@ -71,7 +63,22 @@ export default function Page({
|
|||
|
||||
const { takeSnapshot } = useContext(undoRedoContext);
|
||||
|
||||
const { reactFlowInstance, setReactFlowInstance, nodes, edges, onNodesChange, onEdgesChange, onConnect, setNodes, setEdges, deleteNode, deleteEdge, setPending, isPending, paste } = useFlow();
|
||||
const {
|
||||
reactFlowInstance,
|
||||
setReactFlowInstance,
|
||||
nodes,
|
||||
edges,
|
||||
onNodesChange,
|
||||
onEdgesChange,
|
||||
onConnect,
|
||||
setNodes,
|
||||
setEdges,
|
||||
deleteNode,
|
||||
deleteEdge,
|
||||
setPending,
|
||||
isPending,
|
||||
paste,
|
||||
} = useFlow();
|
||||
|
||||
const position = useRef({ x: 0, y: 0 });
|
||||
const [lastSelection, setLastSelection] =
|
||||
|
|
|
|||
|
|
@ -40,11 +40,11 @@ type RFState = {
|
|||
onConnect: OnConnect;
|
||||
deleteNode: (nodeId: string | Array<string>) => void;
|
||||
deleteEdge: (edgeId: string | Array<string>) => void;
|
||||
isBuilt: boolean;
|
||||
paste: (
|
||||
selection: { nodes: any; edges: any },
|
||||
position: { x: number; y: number; paneX?: number; paneY?: number }
|
||||
) => void;
|
||||
) => void;
|
||||
isBuilt: boolean;
|
||||
isPending: boolean;
|
||||
setPending: (pending: boolean) => void;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue