diff --git a/space_flow/src/CustomNodes/BooleanNode/index.tsx b/space_flow/src/CustomNodes/BooleanNode/index.tsx index 75a76577a..3f8653988 100644 --- a/space_flow/src/CustomNodes/BooleanNode/index.tsx +++ b/space_flow/src/CustomNodes/BooleanNode/index.tsx @@ -1,4 +1,4 @@ -import { Bars3CenterLeftIcon, TrashIcon } from "@heroicons/react/24/outline"; +import { Bars3CenterLeftIcon, CheckCircleIcon, TrashIcon } from "@heroicons/react/24/outline"; import { Input } from "@mui/material"; import { Handle, Position } from "reactflow"; import { isValidConnection, nodeColors } from "../../utils"; @@ -11,9 +11,9 @@ export default function BooleanNode({ data }) {
- Boolean
diff --git a/space_flow/src/CustomNodes/ChatInputNode/index.tsx b/space_flow/src/CustomNodes/ChatInputNode/index.tsx index be4266db3..160759241 100644 --- a/space_flow/src/CustomNodes/ChatInputNode/index.tsx +++ b/space_flow/src/CustomNodes/ChatInputNode/index.tsx @@ -16,7 +16,7 @@ export default function ChatInputNode({ data }) { isValidConnection(data, connection) } className="ml-1 bg-transparent border-solid border-l-8 border-y-transparent border-y-8 border-r-0 rounded-none" - style={{ borderLeftColor: 'white' }} + style={{ borderLeftColor: nodeColors['chat'] }} > diff --git a/space_flow/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/space_flow/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index 22d728a59..cac97a131 100644 --- a/space_flow/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/space_flow/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -18,6 +18,7 @@ export default function ParameterComponent({ color, type, name = "", + required = false, }) { const ref = useRef(null); const updateNodeInternals = useUpdateNodeInternals(); @@ -38,8 +39,8 @@ export default function ParameterComponent({ return (
<> -
{title}
- +
{title}{required ? " *" : ""}
+ { data.node.template[name].value = t; }} diff --git a/space_flow/src/CustomNodes/GenericNode/index.tsx b/space_flow/src/CustomNodes/GenericNode/index.tsx index fa2c49975..e47938cf5 100644 --- a/space_flow/src/CustomNodes/GenericNode/index.tsx +++ b/space_flow/src/CustomNodes/GenericNode/index.tsx @@ -35,7 +35,7 @@ export default function GenericNode({ data }) { {Object.keys(data.node.template) .filter((t) => t.charAt(0) !== "_") .map((t, idx) => ( - <> +
{idx === 0 ? (
Inputs:
) : ( @@ -43,23 +43,22 @@ export default function GenericNode({ data }) { )} {data.node.template[t].show ? ( )} - +
))}
Output:
(" " + b))} tooltipTitle={"Type: str"} - id={data.name + "|" + data.node.base_class + "|" + data.id} + id={data.name + "|" + data.id + data.node.base_classes.map((b) => ("|" + b))} type={'str'} left={false} /> diff --git a/space_flow/src/CustomNodes/InputNode/index.tsx b/space_flow/src/CustomNodes/InputNode/index.tsx index 1cfd5d75c..c1fb65c8a 100644 --- a/space_flow/src/CustomNodes/InputNode/index.tsx +++ b/space_flow/src/CustomNodes/InputNode/index.tsx @@ -29,8 +29,8 @@ export default function InputNode({ data }) {
String
@@ -44,6 +44,7 @@ export default function InputNode({ data }) {
{ data.text = e; }} diff --git a/space_flow/src/components/inputComponent/index.tsx b/space_flow/src/components/inputComponent/index.tsx index bb7e875b0..831d6638b 100644 --- a/space_flow/src/components/inputComponent/index.tsx +++ b/space_flow/src/components/inputComponent/index.tsx @@ -1,11 +1,16 @@ -export default function Input({onChange}){ +import { useState } from "react"; + +export default function Input({value, onChange}){ + const [myValue, setMyValue] = useState(value ?? ""); return ( <> { + setMyValue(e.target.value); onChange(e.target.value); }} /> diff --git a/space_flow/src/pages/FlowPage/components/extraSidebarComponent/index.tsx b/space_flow/src/pages/FlowPage/components/extraSidebarComponent/index.tsx index cbf1c1e3c..52658db37 100644 --- a/space_flow/src/pages/FlowPage/components/extraSidebarComponent/index.tsx +++ b/space_flow/src/pages/FlowPage/components/extraSidebarComponent/index.tsx @@ -10,7 +10,7 @@ export default function ExtraSidebar() { const types = Object.keys(data).reduce((acc, curr) => { Object.keys(data[curr]).forEach((c) => { acc[c] = curr; - acc[data[curr][c].base_class] = curr; + data[curr][c].base_classes?.forEach((b) => {acc[b] = curr;}) }); console.log(acc); return acc; diff --git a/space_flow/src/utils.ts b/space_flow/src/utils.ts index 98aa35db7..de98a136a 100644 --- a/space_flow/src/utils.ts +++ b/space_flow/src/utils.ts @@ -341,7 +341,7 @@ export function isValidConnection( ) { if ( targetHandle.split('|')[0] === sourceHandle.split("|")[0] || - targetHandle.split('|')[1] === sourceHandle.split("|")[0] || + targetHandle.split('|').slice(2).some((t) => t === sourceHandle.split("|")[0]) || sourceHandle.split("|")[0] === "str" ) { let sourceNode = data.reactFlowInstance.getNode(source).data.node;