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