-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from softflow24/feat/dnd
Feat/Drag-and-drop functionality
- Loading branch information
Showing
28 changed files
with
10,278 additions
and
8,011 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Node } from "reactflow"; | ||
import { NodeData } from "@/types/NodeTypes"; | ||
|
||
export const endNode: Partial<Node<NodeData>> = { | ||
type: "custom", | ||
data: { | ||
addable: false, | ||
block: "[email protected]", | ||
label: "End", | ||
color: "rgb(239 68 68)", | ||
sourceHandle: false, | ||
targetHandle: true, | ||
icon: "Flag", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { startNode } from "./startNode"; | ||
import { inputNode } from "./inputNode"; | ||
import { logicNode } from "./logicNode"; | ||
import { outputNode } from "./outputNode"; | ||
import { endNode } from "./endNode"; | ||
|
||
export const blockConfigs = { | ||
start: startNode, | ||
input: inputNode, | ||
logic: logicNode, | ||
output: outputNode, | ||
end: endNode, | ||
}; | ||
|
||
export type BlockType = keyof typeof blockConfigs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Node } from "reactflow"; | ||
import { NodeData } from "@/types/NodeTypes"; | ||
|
||
export const inputNode: Partial<Node<NodeData>> = { | ||
type: "custom", | ||
data: { | ||
block: "[email protected]", | ||
label: "Input", | ||
color: "rgb(234 179 8)", | ||
sourceHandle: true, | ||
targetHandle: true, | ||
icon: "TextCursorInput", | ||
inputs: {}, | ||
config: { | ||
input: "", | ||
}, | ||
outputs: { | ||
output: "", | ||
}, | ||
controls: [ | ||
{ | ||
type: "text", | ||
label: "Value", | ||
name: "input", | ||
placeholder: "Pass to output", | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Node } from "reactflow"; | ||
import { NodeData } from "@/types/NodeTypes"; | ||
|
||
export const logicNode: Partial<Node<NodeData>> = { | ||
type: "custom", | ||
data: { | ||
block: "[email protected]", | ||
label: "Logic", | ||
color: "rgb(59 130 246)", | ||
sourceHandle: false, | ||
targetHandle: true, | ||
icon: "GitBranch", | ||
inputs: { value: "" }, | ||
outputs: { | ||
result: "", | ||
}, | ||
config: { | ||
logicOperator: "AND", | ||
conditions: [], | ||
}, | ||
controls: [ | ||
{ | ||
type: "conditions-summary", | ||
label: "Conditions summary", | ||
name: "conditions", | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Node } from "reactflow"; | ||
import { NodeData } from "@/types/NodeTypes"; | ||
|
||
export const outputNode: Partial<Node<NodeData>> = { | ||
type: "custom", | ||
data: { | ||
block: "[email protected]", | ||
label: "Output", | ||
color: "rgb(234 179 8)", | ||
sourceHandle: true, | ||
targetHandle: true, | ||
icon: "Square", | ||
controls: [ | ||
{ | ||
label: "", | ||
type: "text-area", | ||
name: "output", | ||
placeholder: "Value from input will be displayed here after execution", | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { NodeData } from "@/types/NodeTypes"; | ||
import { Node } from "reactflow"; | ||
|
||
export const startNode: Partial<Node<NodeData>> = { | ||
type: "custom", | ||
data: { | ||
addable: false, | ||
block: "[email protected]", | ||
label: "Start", | ||
color: "rgb(34 197 94)", | ||
sourceHandle: true, | ||
targetHandle: false, | ||
icon: "Play", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.