)}
- className="prompt-node relative bg-white h-16 w-40 border rounded-sm solid border-black flex flex-col justify-center"
+
);
}
diff --git a/space_flow/src/CustomNodes/ValidatorNode/index.tsx b/space_flow/src/CustomNodes/ValidatorNode/index.tsx
index c7543b8a7..0bb1e71fe 100644
--- a/space_flow/src/CustomNodes/ValidatorNode/index.tsx
+++ b/space_flow/src/CustomNodes/ValidatorNode/index.tsx
@@ -1,17 +1,30 @@
+import { Transition } from "@headlessui/react";
import { Handle, Position } from "reactflow";
export default function ValidatorNode({ data }) {
- console.log(data)
+ console.log(data);
return (
-
-
-
-
- validator data
+
+
+
+
+
validator data
+
-
-
+
);
}
diff --git a/space_flow/src/CustomNodes/inputTextFolder/index.tsx b/space_flow/src/CustomNodes/inputTextFolder/index.tsx
deleted file mode 100644
index aad97e857..000000000
--- a/space_flow/src/CustomNodes/inputTextFolder/index.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import { useCallback } from 'react';
-import { Handle, Position } from 'reactflow';
-
-
-const handleStyle = {left:10};
-
-export default function TextUpdaterNode({data})
-{
- const onChange = useCallback((evt)=>{
- console.log(evt.target.value)
- },[])
-
-
- return (
-
- )
-}
-
-
-
diff --git a/space_flow/src/CustomNodes/inputTextFolder/inputText.css b/space_flow/src/CustomNodes/inputTextFolder/inputText.css
deleted file mode 100644
index 73ae5bfbf..000000000
--- a/space_flow/src/CustomNodes/inputTextFolder/inputText.css
+++ /dev/null
@@ -1,14 +0,0 @@
-.text-updater-node {
- height: 50px;
- border: 1px solid black;
- padding: 5px;
- border-radius: 5px;
- background: white;
- }
-
- .text-updater-node label {
- display: block;
- color: #777;
- font-size: 12px;
- }
-
\ No newline at end of file
diff --git a/space_flow/src/pages/FlowPage/components/DisclosureComponent/index.tsx b/space_flow/src/pages/FlowPage/components/DisclosureComponent/index.tsx
new file mode 100644
index 000000000..66f84e555
--- /dev/null
+++ b/space_flow/src/pages/FlowPage/components/DisclosureComponent/index.tsx
@@ -0,0 +1,49 @@
+import {
+ CpuChipIcon,
+ PlusIcon,
+ ChevronRightIcon,
+ ArrowPathIcon,
+ BoltIcon,
+ ChevronDoubleRightIcon,
+} from "@heroicons/react/24/outline";
+import { Disclosure } from "@headlessui/react";
+import { useState } from "react";
+
+export default function DisclosureComponent({
+ button: { title, Icon, Modal = null, buttons = [] },
+ children,
+}) {
+ return (
+
+ {({ open }) => (
+ <>
+
+
+
+
+ {title}
+
+
+
+ {buttons.map((x, index)=>(
+
+ ))}
+
+
+
+
+
+
+ {children}
+
+ >
+ )}
+
+ );
+}
diff --git a/space_flow/src/pages/FlowPage/components/extraSidebarComponent/index.tsx b/space_flow/src/pages/FlowPage/components/extraSidebarComponent/index.tsx
index 4a42e1394..7e9a15322 100644
--- a/space_flow/src/pages/FlowPage/components/extraSidebarComponent/index.tsx
+++ b/space_flow/src/pages/FlowPage/components/extraSidebarComponent/index.tsx
@@ -1,39 +1,85 @@
+import { Bars2Icon, CommandLineIcon, LightBulbIcon, LinkIcon, RocketLaunchIcon, ShieldCheckIcon, ViewColumnsIcon } from "@heroicons/react/24/outline";
import { llm_chain } from "../../../../data_assets/llm_chain";
import { prompt } from "../../../../data_assets/prompt";
+import DisclosureComponent from "../DisclosureComponent";
-
-export function ExtraSidebar(){
-
- function onDragStart(event:React.DragEvent
,nodeType){
- let json;
- event.dataTransfer.setData('application/reactflow',nodeType)
- event.dataTransfer.effectAllowed = 'move'
- if(nodeType==="promptNode"){
- json = JSON.stringify(prompt)
- }
- if(nodeType==="modelNode"){
- json = JSON.stringify(llm_chain)
- }
- if(nodeType==="chainNode"){
- json = JSON.stringify({content:""})
- }
- if(nodeType==="agentNode"){
- json = JSON.stringify({content:""})
- }
- if(nodeType==="validatorNode"){
- json = JSON.stringify({content:""})
- }
- event.dataTransfer.setData('json',json);
+export function ExtraSidebar() {
+ function onDragStart(event: React.DragEvent, nodeType) {
+ let json;
+ event.dataTransfer.setData("application/reactflow", nodeType);
+ event.dataTransfer.effectAllowed = "move";
+ if (nodeType === "promptNode") {
+ json = JSON.stringify(prompt);
}
+ if (nodeType === "modelNode") {
+ json = JSON.stringify(llm_chain);
+ }
+ if (nodeType === "chainNode") {
+ json = JSON.stringify({ content: "" });
+ }
+ if (nodeType === "agentNode") {
+ json = JSON.stringify({ content: "" });
+ }
+ if (nodeType === "validatorNode") {
+ json = JSON.stringify({ content: "" });
+ }
+ event.dataTransfer.setData("json", json);
+ }
- return(
-
-
onDragStart(event,'promptNode')}> Prompt Node
-
onDragStart(event,'modelNode')}> Model Node
-
onDragStart(event,'chainNode')}> Chain Node
-
onDragStart(event,'agentNode')}> Agent Node
-
onDragStart(event,'validatorNode')}> Validator Node
-
+ return (
+
+
+ onDragStart(event, "promptNode")}
+ >
+ Prompt
+
+
+
+
+ onDragStart(event, "modelNode")}
+ >
+ Model
+
+
+
+
+ onDragStart(event, "chainNode")}
+ >
+ Chain
+
+
+
+
+ onDragStart(event, "agentNode")}
+ >
+ Agent
+
+
+
+
+ onDragStart(event, "validatorNode")}
+ >
+ Validator
+
+
+
- )
-}
\ No newline at end of file
+ );
+}
diff --git a/space_flow/src/pages/FlowPage/index.tsx b/space_flow/src/pages/FlowPage/index.tsx
index c0c1eac22..f17ca6e65 100644
--- a/space_flow/src/pages/FlowPage/index.tsx
+++ b/space_flow/src/pages/FlowPage/index.tsx
@@ -6,7 +6,6 @@ import ReactFlow, {
useEdgesState,
useNodesState,
} from "reactflow";
-import TextUpdaterNode from "../../CustomNodes/inputTextFolder";
import PromptNode from "../../CustomNodes/PromptNode";
import ModelNode from "../../CustomNodes/ModelNode";
import { locationContext } from "../../contexts/locationContext";
@@ -16,7 +15,6 @@ import ChainNode from "../../CustomNodes/ChainNode";
import ValidatorNode from "../../CustomNodes/ValidatorNode";
const nodeTypes = {
- textUpdater: TextUpdaterNode,
promptNode: PromptNode,
modelNode: ModelNode,
chainNode: ChainNode,
@@ -37,10 +35,11 @@ export default function FlowPage() {
const getId = () => `dndnode_${id++}`;
- const { setExtraComponent } = useContext(locationContext);
+ const { setExtraComponent, setExtraNavigation } = useContext(locationContext);
useEffect(() => {
setExtraComponent(ExtraSidebar);
+ setExtraNavigation({title: "Nodes"})
}, []);
const [nodes, setNodes, onNodesChange] = useNodesState([]);