From d33ca318c9daef98963f814362682b8a7990e221 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 15 Jul 2022 00:18:19 +0300 Subject: [PATCH 1/4] Create Math Node --- .../FlowEditor/nodes/basic/NodeMath.tsx | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 components/FlowEditor/nodes/basic/NodeMath.tsx diff --git a/components/FlowEditor/nodes/basic/NodeMath.tsx b/components/FlowEditor/nodes/basic/NodeMath.tsx new file mode 100644 index 0000000..65e37dc --- /dev/null +++ b/components/FlowEditor/nodes/basic/NodeMath.tsx @@ -0,0 +1,38 @@ +import styles from "./Node.module.css"; +import { Handle, Position } from "react-flow-renderer"; + +type MathNodeProps = {}; + +const MathNode = (props: MathNodeProps) => { + return ( + // Базовый класс generic-node - прописана ширина и положение, цвет текста и фона + + // Nandle - ручка для коннекта. Можно задать оформление при помощи className, тип (target / source) и позицию + + // Label - подпись ноды. Можно стилизовать + + // Select - DropDown меню, можно стилизовать. Стоит класс nodrag для предотвращения залипания + +
+ + +
+ + первое число + + второе число +
+ + +
+ ); +}; + +export default MathNode; \ No newline at end of file From 1c7ded5d6dd51013670906657fd6e3a97f205993 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 15 Jul 2022 00:32:46 +0300 Subject: [PATCH 2/4] Create input node --- .../FlowEditor/nodes/basic/InputNode.tsx | 39 +++++++++++++++++++ .../basic/{NodeMath.tsx => MathNode.tsx} | 0 2 files changed, 39 insertions(+) create mode 100644 components/FlowEditor/nodes/basic/InputNode.tsx rename components/FlowEditor/nodes/basic/{NodeMath.tsx => MathNode.tsx} (100%) diff --git a/components/FlowEditor/nodes/basic/InputNode.tsx b/components/FlowEditor/nodes/basic/InputNode.tsx new file mode 100644 index 0000000..06844f4 --- /dev/null +++ b/components/FlowEditor/nodes/basic/InputNode.tsx @@ -0,0 +1,39 @@ +import styles from "./Node.module.css"; +import { Handle, Position } from "react-flow-renderer"; + +type InputNodeProps = {}; + +const InputNode = (props: InputNodeProps) => { + return ( + // Базовый класс generic-node - прописана ширина и положение, цвет текста и фона + + // Nandle - ручка для коннекта. Можно задать оформление при помощи className, тип (target / source) и позицию + + // Label - подпись ноды. Можно стилизовать + + // Select - DropDown меню, можно стилизовать. Стоит класс nodrag для предотвращения залипания + +
+ + +
+ + + + +
+ + +
+ ); +}; + +export default InputNode; \ No newline at end of file diff --git a/components/FlowEditor/nodes/basic/NodeMath.tsx b/components/FlowEditor/nodes/basic/MathNode.tsx similarity index 100% rename from components/FlowEditor/nodes/basic/NodeMath.tsx rename to components/FlowEditor/nodes/basic/MathNode.tsx From 82cdd14bb2fb6e95d777b74b908ae36a583d1bf9 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 15 Jul 2022 00:48:40 +0300 Subject: [PATCH 3/4] Output and timer node --- .../FlowEditor/nodes/basic/OutputNode.tsx | 33 +++++++++++++++++++ .../FlowEditor/nodes/basic/TimerNode.tsx | 31 +++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 components/FlowEditor/nodes/basic/OutputNode.tsx create mode 100644 components/FlowEditor/nodes/basic/TimerNode.tsx diff --git a/components/FlowEditor/nodes/basic/OutputNode.tsx b/components/FlowEditor/nodes/basic/OutputNode.tsx new file mode 100644 index 0000000..8d9e03e --- /dev/null +++ b/components/FlowEditor/nodes/basic/OutputNode.tsx @@ -0,0 +1,33 @@ +import styles from "./Node.module.css"; +import { Handle, Position } from "react-flow-renderer"; + +type OutputNodeProps = {}; + +const OutputNode = (props: OutputNodeProps) => { + return ( + // Базовый класс generic-node - прописана ширина и положение, цвет текста и фона + + // Nandle - ручка для коннекта. Можно задать оформление при помощи className, тип (target / source) и позицию + + // Label - подпись ноды. Можно стилизовать + + // Select - DropDown меню, можно стилизовать. Стоит класс nodrag для предотвращения залипания + +
+ + +
+ + + +
+ + +
+ ); +}; + +export default OutputNode; \ No newline at end of file diff --git a/components/FlowEditor/nodes/basic/TimerNode.tsx b/components/FlowEditor/nodes/basic/TimerNode.tsx new file mode 100644 index 0000000..6912ea2 --- /dev/null +++ b/components/FlowEditor/nodes/basic/TimerNode.tsx @@ -0,0 +1,31 @@ +import styles from "./Node.module.css"; +import { Handle, Position } from "react-flow-renderer"; + +type TimerNodeProps = {}; + +const TimerNode = (props: TimerNodeProps) => { + return ( + // Базовый класс generic-node - прописана ширина и положение, цвет текста и фона + + // Nandle - ручка для коннекта. Можно задать оформление при помощи className, тип (target / source) и позицию + + // Label - подпись ноды. Можно стилизовать + + // Select - DropDown меню, можно стилизовать. Стоит класс nodrag для предотвращения залипания + +
+ + +
+ + + Время задержки + +
+ + +
+ ); +}; + +export default TimerNode; \ No newline at end of file From cb83e9632e96eb57070484bbd589cf166119745b Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 15 Jul 2022 00:49:43 +0300 Subject: [PATCH 4/4] some fix --- components/FlowEditor/nodes/basic/TimerNode.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/FlowEditor/nodes/basic/TimerNode.tsx b/components/FlowEditor/nodes/basic/TimerNode.tsx index 6912ea2..2461fb0 100644 --- a/components/FlowEditor/nodes/basic/TimerNode.tsx +++ b/components/FlowEditor/nodes/basic/TimerNode.tsx @@ -18,7 +18,7 @@ const TimerNode = (props: TimerNodeProps) => {
- + Время задержки