diff --git a/frontend/src/components/visual-editor/hooks/useVisualEditor.tsx b/frontend/src/components/visual-editor/hooks/useVisualEditor.tsx index 18dd47a..eb1e9e1 100644 --- a/frontend/src/components/visual-editor/hooks/useVisualEditor.tsx +++ b/frontend/src/components/visual-editor/hooks/useVisualEditor.tsx @@ -23,10 +23,8 @@ import { } from "@/types/visual-editor.types"; import { ZOOM_LEVEL } from "../constants"; -import { - AdvancedLinkFactory, - AdvancedLinkModel, -} from "../v2/AdvancedLink/AdvancedLink"; +import { AdvancedLinkFactory } from "../v2/AdvancedLink/AdvancedLinkFactory"; +import { AdvancedLinkModel } from "../v2/AdvancedLink/AdvancedLinkModel"; import { CustomCanvasWidget } from "../v2/CustomCanvasWidget"; import { CustomDeleteItemsAction } from "../v2/CustomDiagramNodes/CustomDeleteAction"; import { NodeFactory } from "../v2/CustomDiagramNodes/NodeFactory"; diff --git a/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLink.tsx b/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkFactory.tsx similarity index 90% rename from frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLink.tsx rename to frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkFactory.tsx index fbf933f..7dcb511 100644 --- a/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLink.tsx +++ b/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkFactory.tsx @@ -2,16 +2,17 @@ import { css, keyframes } from "@emotion/react"; import styled from "@emotion/styled"; import { DefaultLinkFactory, - DefaultLinkModel, - DefaultLinkModelOptions, DefaultLinkWidget, } from "@projectstorm/react-diagrams"; import React from "react"; +import { AdvancedLinkModel } from "./AdvancedLinkModel"; + interface Point { x: number; y: number; } + const createCurvedPath = (start: Point, end: Point) => { const controlPoint1X = start.x + 220; const controlPoint1Y = start.y - 250; @@ -43,15 +44,6 @@ namespace S { `; } -export class AdvancedLinkModel extends DefaultLinkModel { - constructor(options?: DefaultLinkModelOptions) { - super({ - ...options, - type: "advanced", - }); - } -} - export class AdvancedLinkFactory extends DefaultLinkFactory { constructor() { super("advanced"); diff --git a/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkModel.tsx b/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkModel.tsx new file mode 100644 index 0000000..a576f5c --- /dev/null +++ b/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkModel.tsx @@ -0,0 +1,13 @@ +import { + DefaultLinkModel, + DefaultLinkModelOptions, +} from "@projectstorm/react-diagrams"; + +export class AdvancedLinkModel extends DefaultLinkModel { + constructor(options?: DefaultLinkModelOptions) { + super({ + ...options, + type: "advanced", + }); + } +} diff --git a/frontend/src/components/visual-editor/v2/Diagrams.tsx b/frontend/src/components/visual-editor/v2/Diagrams.tsx index 3b5aee3..3e223ba 100644 --- a/frontend/src/components/visual-editor/v2/Diagrams.tsx +++ b/frontend/src/components/visual-editor/v2/Diagrams.tsx @@ -53,7 +53,7 @@ import { IBlock } from "@/types/block.types"; import { ICategory } from "@/types/category.types"; import { BlockPorts } from "@/types/visual-editor.types"; -import { AdvancedLinkModel } from "./AdvancedLink/AdvancedLink"; +import { AdvancedLinkModel } from "./AdvancedLink/AdvancedLinkModel"; import BlockDialog from "../BlockDialog"; import { ZOOM_LEVEL } from "../constants"; import { useVisualEditor } from "../hooks/useVisualEditor";