diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index dcf45b3d9..ae2c144a0 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -24,6 +24,7 @@ import { nodeNames, nodeIcons } from "../../../../utils"; import React from "react"; import { nodeColors } from "../../../../utils"; import ShadTooltip from "../../../../components/ShadTooltipComponent"; +import { PopUpContext } from "../../../../contexts/popUpContext"; export default function ParameterComponent({ left, @@ -40,6 +41,8 @@ export default function ParameterComponent({ const refHtml = useRef(null); const updateNodeInternals = useUpdateNodeInternals(); const [position, setPosition] = useState(0); + const { closePopUp } = useContext(PopUpContext); + useEffect(() => { if (ref.current && ref.current.offsetTop && ref.current.clientHeight) { setPosition(ref.current.offsetTop + ref.current.clientHeight / 2); @@ -54,6 +57,9 @@ export default function ParameterComponent({ const [enabled, setEnabled] = useState( data.node.template[name]?.value ?? false ); + + useEffect(() => {}, [closePopUp, data.node.template]); + const { reactFlowInstance } = useContext(typesContext); let disabled = reactFlowInstance?.getEdges().some((e) => e.targetHandle === id) ?? false; @@ -103,7 +109,7 @@ export default function ParameterComponent({ return (
<>
@@ -124,6 +130,7 @@ export default function ParameterComponent({ delayDuration={0} content={refHtml.current} side={left ? "left" : "right"} + open={refHtml?.current?.length > 0} >
) : left === true && type === "float" ? ( - { - data.node.template[name].value = t; - }} - /> +
+ { + data.node.template[name].value = t; + }} + /> +
) : left === true && type === "str" && data.node.template[name].options ? ( - (data.node.template[name].value = newValue)} - value={data.node.template[name].value ?? "Choose an option"} - > +
+ + (data.node.template[name].value = newValue) + } + value={data.node.template[name].value ?? "Choose an option"} + > +
) : left === true && type === "code" ? ( ) : left === true && type === "int" ? ( - { - data.node.template[name].value = t; - - }} - /> +
+ { + data.node.template[name].value = t; + + }} + /> +
) : left === true && type === "prompt" ? ( {}, [closePopUp]); + const validateNode = useCallback( debounce(async () => { try { @@ -112,11 +115,11 @@ export default function GenericNode({
-
+
-
{data.type}
+
{data.type}
@@ -187,7 +190,7 @@ export default function GenericNode({
-
+
{data.node.description}
diff --git a/src/frontend/src/alerts/alertDropDown/components/singleAlertComponent/index.tsx b/src/frontend/src/alerts/alertDropDown/components/singleAlertComponent/index.tsx index ace9b5a0b..ad505e23e 100644 --- a/src/frontend/src/alerts/alertDropDown/components/singleAlertComponent/index.tsx +++ b/src/frontend/src/alerts/alertDropDown/components/singleAlertComponent/index.tsx @@ -94,7 +94,7 @@ export default function SingleAlert({ {dropItem.link ? ( Details diff --git a/src/frontend/src/alerts/notice/index.tsx b/src/frontend/src/alerts/notice/index.tsx index 1b2fb1514..81dce8ca0 100644 --- a/src/frontend/src/alerts/notice/index.tsx +++ b/src/frontend/src/alerts/notice/index.tsx @@ -51,7 +51,7 @@ export default function NoticeAlert({ {link !== "" ? ( Details diff --git a/src/frontend/src/components/ExtraSidebarComponent/index.tsx b/src/frontend/src/components/ExtraSidebarComponent/index.tsx index b06a58d9c..e03db68c8 100644 --- a/src/frontend/src/components/ExtraSidebarComponent/index.tsx +++ b/src/frontend/src/components/ExtraSidebarComponent/index.tsx @@ -21,10 +21,7 @@ export default function ExtraSidebar() { isStackedOpen ? "w-52" : "w-0 " } flex-shrink-0 flex overflow-hidden flex-col border-r dark:border-r-gray-700 transition-all duration-500`} > -
-
- -
+
{extraNavigation.options ? (
@@ -36,8 +33,8 @@ export default function ExtraSidebar() { to={item.href} className={classNames( item.href.split("/")[2] === current[4] - ? "bg-gray-100 text-gray-900" - : "bg-white text-gray-600 hover:bg-gray-50 hover:text-gray-900", + ? "bg-muted text-gray-900" + : "bg-white text-gray-600 hover:bg-muted hover:text-gray-900", "group w-full flex items-center pl-2 py-2 text-sm font-medium rounded-md" )} > @@ -63,9 +60,9 @@ export default function ExtraSidebar() { diff --git a/src/frontend/src/components/ShadTooltipComponent/index.tsx b/src/frontend/src/components/ShadTooltipComponent/index.tsx index a360f3ff0..6dfde8f8f 100644 --- a/src/frontend/src/components/ShadTooltipComponent/index.tsx +++ b/src/frontend/src/components/ShadTooltipComponent/index.tsx @@ -10,13 +10,15 @@ const ShadTooltip = (props) => { {props.children} - - {props.content} - + {props.open && ( + + {props.content} + + )} ); diff --git a/src/frontend/src/pages/MainPage/components/cardComponent/index.tsx b/src/frontend/src/components/cardComponent/index.tsx similarity index 69% rename from src/frontend/src/pages/MainPage/components/cardComponent/index.tsx rename to src/frontend/src/components/cardComponent/index.tsx index 88dad5ff1..5688eefaa 100644 --- a/src/frontend/src/pages/MainPage/components/cardComponent/index.tsx +++ b/src/frontend/src/components/cardComponent/index.tsx @@ -1,13 +1,13 @@ import { Trash2, ExternalLink } from "lucide-react"; import { useContext } from "react"; import { Link } from "react-router-dom"; -import { TabsContext } from "../../../../contexts/tabsContext"; -import { FlowType } from "../../../../types/flow"; -import { gradients } from "../../../../utils"; -import { CardTitle, CardDescription, CardFooter, Card, CardHeader } from "../../../../components/ui/card"; -import { Button } from "../../../../components/ui/button"; +import { TabsContext } from "../../contexts/tabsContext"; +import { FlowType } from "../../types/flow"; +import { gradients } from "../../utils"; +import { CardTitle, CardDescription, CardFooter, Card, CardHeader } from "../ui/card"; -export const CardComponent = ({ flow, id }: { flow: FlowType; id: string }) => { + +export const CardComponent = ({ flow, id, onDelete, button }: { flow: FlowType; id: string, onDelete?: () => void, button?: JSX.Element }) => { const { removeFlow } = useContext(TabsContext); return ( @@ -26,13 +26,13 @@ export const CardComponent = ({ flow, id }: { flow: FlowType; id: string }) => { {flow.name}
+ {onDelete && + }
@@ -53,17 +53,10 @@ export const CardComponent = ({ flow, id }: { flow: FlowType; id: string }) => {  OpenAI+ */}
- - - + {button && + button + } +
diff --git a/src/frontend/src/components/codeAreaComponent/index.tsx b/src/frontend/src/components/codeAreaComponent/index.tsx index 7ba38918b..137e0917e 100644 --- a/src/frontend/src/components/codeAreaComponent/index.tsx +++ b/src/frontend/src/components/codeAreaComponent/index.tsx @@ -4,6 +4,7 @@ import { PopUpContext } from "../../contexts/popUpContext"; import CodeAreaModal from "../../modals/codeAreaModal"; import TextAreaModal from "../../modals/textAreaModal"; import { TextAreaComponentType } from "../../types/components"; +import { INPUT_STYLE } from "../../constants"; export default function CodeAreaComponent({ value, @@ -40,12 +41,14 @@ export default function CodeAreaComponent({ }} className={ editNode - ? "h-7 truncate placeholder:text-center text-gray-500 border-0 block w-full pt-0.5 pb-0.5 form-input dark:bg-gray-900 dark:text-gray-300 dark:border-gray-600 rounded-md border-gray-300 shadow-sm sm:text-sm focus:outline-none focus:ring-1 focus:ring-inset focus:ring-gray-200" - : "truncate block w-full text-gray-500 px-3 py-2 rounded-md border border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm" + + ? "truncate cursor-pointer placeholder:text-center text-gray-500 border-0 block w-full pt-0.5 pb-0.5 form-input dark:bg-gray-900 dark:text-gray-300 dark:border-gray-600 rounded-md border-gray-300 shadow-sm sm:text-sm" + + INPUT_STYLE + : "truncate block w-full text-gray-500 px-3 py-2 rounded-md border border-gray-300 dark:border-gray-700 shadow-sm sm:text-sm" + + INPUT_STYLE + (disabled ? " bg-gray-200" : "") } > - {myValue !== "" ? myValue : "Text empty"} + {myValue !== "" ? myValue : "Type something..."}
diff --git a/src/frontend/src/components/dropdownComponent/index.tsx b/src/frontend/src/components/dropdownComponent/index.tsx index 48c41d118..6e4325a1b 100644 --- a/src/frontend/src/components/dropdownComponent/index.tsx +++ b/src/frontend/src/components/dropdownComponent/index.tsx @@ -3,12 +3,14 @@ import { ChevronUpDownIcon, CheckIcon } from "@heroicons/react/24/outline"; import { Fragment, useState } from "react"; import { DropDownComponentType } from "../../types/components"; import { classNames } from "../../utils"; +import { INPUT_STYLE } from "../../constants"; export default function Dropdown({ value, options, onSelect, editNode = false, + numberOfOptions = 0, }: DropDownComponentType) { let [internalValue, setInternalValue] = useState( value === "" || !value ? "Choose an option" : value @@ -25,16 +27,14 @@ export default function Dropdown({ > {({ open }) => ( <> -
+
{internalValue} @@ -62,8 +62,8 @@ export default function Dropdown({ {options.map((option, id) => ( @@ -71,11 +71,8 @@ export default function Dropdown({ key={id} className={({ active }) => classNames( - active && !editNode - ? "text-white bg-indigo-600 dark:bg-indigo-500" - : "text-gray-900", - active && editNode - ? "text-white bg-gray-400 dark:bg-gray-500" + active + ? "text-white bg-slate-400 dark:bg-white dark:text-gray-500" : "", editNode ? "relative cursor-default select-none py-0.5 pl-3 pr-12 dark:text-gray-300 dark:bg-gray-800" @@ -89,7 +86,7 @@ export default function Dropdown({ {option} @@ -98,13 +95,16 @@ export default function Dropdown({ {selected ? ( diff --git a/src/frontend/src/components/floatComponent/index.tsx b/src/frontend/src/components/floatComponent/index.tsx index a7cf9b2e4..8fef867ab 100644 --- a/src/frontend/src/components/floatComponent/index.tsx +++ b/src/frontend/src/components/floatComponent/index.tsx @@ -1,6 +1,7 @@ import { useContext, useEffect, useState } from "react"; import { FloatComponentType } from "../../types/components"; import { TabsContext } from "../../contexts/tabsContext"; +import { INPUT_STYLE } from "../../constants"; export default function FloatComponent({ value, @@ -12,6 +13,10 @@ export default function FloatComponent({ const [myValue, setMyValue] = useState(value ?? ""); const { setDisableCopyPaste } = useContext(TabsContext); + const step = 0.1; + const min = 0; + const max = 1; + useEffect(() => { if (disabled) { setMyValue(""); @@ -32,11 +37,24 @@ export default function FloatComponent({ if (disableCopyPaste) setDisableCopyPaste(false); }} type="number" + step={step} + min={min} + onInput={(e: React.ChangeEvent) => { + if (e.target.value < min.toString()) { + e.target.value = min.toString(); + } + if (e.target.value > max.toString()) { + e.target.value = max.toString(); + } + }} + max={max} value={myValue} className={ editNode - ? "text-center arrow-hide placeholder:text-center border-0 block w-full pt-0.5 pb-0.5 form-input dark:bg-gray-900 dark:text-gray-300 dark:border-gray-600 rounded-md border-gray-300 shadow-sm sm:text-sm focus:outline-none focus:ring-1 focus:ring-inset focus:ring-gray-200" - : "block w-full form-input dark:bg-gray-900 arrow-hide dark:text-gray-300 dark:border-gray-600 rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm" + + ? "focus:placeholder-transparent text-center placeholder:text-center border-1 block w-full pt-0.5 pb-0.5 form-input dark:bg-gray-900 dark:text-gray-300 dark:border-gray-600 rounded-md border-gray-300 shadow-sm sm:text-sm" + + INPUT_STYLE + : "focus:placeholder-transparent block w-full form-input dark:bg-gray-900 dark:text-gray-300 dark:border-gray-600 rounded-md border-gray-300 shadow-sm ring-offset-gray-200 sm:text-sm" + + INPUT_STYLE + (disabled ? " bg-gray-200 dark:bg-gray-700" : "") } placeholder={ diff --git a/src/frontend/src/components/inputComponent/index.tsx b/src/frontend/src/components/inputComponent/index.tsx index a4072e9c1..98e643871 100644 --- a/src/frontend/src/components/inputComponent/index.tsx +++ b/src/frontend/src/components/inputComponent/index.tsx @@ -2,6 +2,8 @@ import { useContext, useEffect, useState } from "react"; import { InputComponentType } from "../../types/components"; import { classNames } from "../../utils"; import { TabsContext } from "../../contexts/tabsContext"; +import { PopUpContext } from "../../contexts/popUpContext"; +import { INPUT_STYLE } from "../../constants"; export default function InputComponent({ value, @@ -14,6 +16,8 @@ export default function InputComponent({ const [myValue, setMyValue] = useState(value ?? ""); const [pwdVisible, setPwdVisible] = useState(false); const { setDisableCopyPaste } = useContext(TabsContext); + const { closePopUp } = useContext(PopUpContext); + useEffect(() => { if (disabled) { setMyValue(""); @@ -21,6 +25,10 @@ export default function InputComponent({ } }, [disabled, onChange]); + useEffect(() => { + setMyValue(value ?? ""); + }, [closePopUp]); + return (
{ + setMyValue(value); + }, [value]); + const handleButtonClick = () => { const input = document.createElement("input"); input.type = "file"; @@ -73,8 +78,10 @@ export default function InputFileComponent({ onClick={handleButtonClick} className={ editNode - ? "placeholder:text-center text-gray-500 border-0 block w-full pt-0.5 pb-0.5 form-input dark:bg-gray-900 dark:text-gray-300 dark:border-gray-600 rounded-md border-gray-300 shadow-sm sm:text-sm focus:outline-none focus:ring-1 focus:ring-inset focus:ring-gray-200" - : "truncate block w-full text-gray-500 dark:text-gray-300 px-3 py-2 rounded-md border border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm" + + ? "truncate placeholder:text-center text-gray-500 border-0 block w-full pt-0.5 pb-0.5 form-input dark:bg-gray-900 dark:text-gray-300 dark:border-gray-600 rounded-md border-gray-300 shadow-sm sm:text-sm" + + INPUT_STYLE + : "truncate block w-full text-gray-500 dark:text-gray-300 px-3 py-2 rounded-md border border-gray-300 dark:border-gray-700 shadow-sm sm:text-sm" + + INPUT_STYLE + (disabled ? " bg-gray-200" : "") } > @@ -82,7 +89,7 @@ export default function InputFileComponent({
diff --git a/src/frontend/src/components/inputListComponent/index.tsx b/src/frontend/src/components/inputListComponent/index.tsx index 49b0a1a5a..4bb82147f 100644 --- a/src/frontend/src/components/inputListComponent/index.tsx +++ b/src/frontend/src/components/inputListComponent/index.tsx @@ -4,11 +4,12 @@ import { InputListComponentType } from "../../types/components"; import { TabsContext } from "../../contexts/tabsContext"; import _ from "lodash"; - +import { INPUT_STYLE } from "../../constants"; export default function InputListComponent({ value, onChange, disabled, + editNode = false, }: InputListComponentType) { const [inputList, setInputList] = useState(value ?? [""]); useEffect(() => { @@ -21,7 +22,7 @@ export default function InputListComponent({
{inputList.map((i, idx) => ( @@ -30,8 +31,12 @@ export default function InputListComponent({ type="text" value={i} className={ - "block w-full form-input rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm" + - (disabled ? " bg-gray-200" : "") + editNode + ? "border-[1px] truncate cursor-pointer text-center placeholder:text-center text-gray-500 block w-full pt-0.5 pb-0.5 form-input dark:bg-gray-900 dark:text-gray-300 dark:border-gray-600 rounded-md border-gray-300 shadow-sm sm:text-sm" + + INPUT_STYLE + : "block w-full form-input rounded-md border-gray-300 shadow-sm focus:border-gray-500 focus:ring-gray-500 sm:text-sm" + + (disabled ? " bg-gray-200" : "") + + "focus:placeholder-transparent" } placeholder="Type something..." onChange={(e) => { @@ -54,7 +59,7 @@ export default function InputListComponent({ onChange(inputList); }} > - + ) : (
diff --git a/src/frontend/src/components/textAreaComponent/index.tsx b/src/frontend/src/components/textAreaComponent/index.tsx index 0693411bf..4c0412994 100644 --- a/src/frontend/src/components/textAreaComponent/index.tsx +++ b/src/frontend/src/components/textAreaComponent/index.tsx @@ -4,7 +4,7 @@ import { PopUpContext } from "../../contexts/popUpContext"; import { TextAreaComponentType } from "../../types/components"; import GenericModal from "../../modals/genericModal"; import { TypeModal } from "../../utils"; - +import { INPUT_STYLE } from "../../constants"; export default function TextAreaComponent({ value, onChange, @@ -12,16 +12,28 @@ export default function TextAreaComponent({ editNode = false, }: TextAreaComponentType) { const [myValue, setMyValue] = useState(value); - const { openPopUp } = useContext(PopUpContext); + const { openPopUp, closePopUp } = useContext(PopUpContext); + useEffect(() => { if (disabled) { setMyValue(""); onChange(""); } }, [disabled, onChange]); + + useEffect(() => { + setMyValue(value); + }, [closePopUp]); + return (
-
+
{ openPopUp( @@ -39,12 +51,13 @@ export default function TextAreaComponent({ }} className={ editNode - ? "h-7 truncate placeholder:text-center text-gray-500 border-0 block w-full pt-0.5 pb-0.5 form-input dark:bg-gray-900 dark:text-gray-300 dark:border-gray-600 rounded-md border-gray-300 shadow-sm sm:text-sm focus:outline-none focus:ring-1 focus:ring-inset focus:ring-gray-200" - : "truncate block w-full text-gray-500 dark:text-gray-100 px-3 py-2 rounded-md border border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm" + + ? "truncate cursor-pointer placeholder:text-center text-gray-500 border-1 block w-full pt-0.5 pb-0.5 form-input dark:bg-gray-900 dark:text-gray-300 dark:border-gray-600 rounded-md border-gray-300 shadow-sm sm:text-sm" + + INPUT_STYLE + : "truncate block w-full text-gray-500 dark:text-muted px-3 py-2 rounded-md border border-gray-300 dark:border-gray-700 shadow-sm sm:text-sm" + (disabled ? " bg-gray-200" : "") } > - {myValue !== "" ? myValue : "Text empty"} + {myValue !== "" ? myValue : "Type something..."}
diff --git a/src/frontend/src/components/toggleComponent/index.tsx b/src/frontend/src/components/toggleComponent/index.tsx index f7140bdee..9481f6760 100644 --- a/src/frontend/src/components/toggleComponent/index.tsx +++ b/src/frontend/src/components/toggleComponent/index.tsx @@ -21,8 +21,8 @@ export default function ToggleComponent({ setEnabled(x); }} className={classNames( - enabled ? "bg-indigo-600" : "bg-gray-200", - "relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-indigo-600 focus:ring-offset-2" + enabled ? "bg-primary" : "bg-gray-200", + "relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-1 focus:ring-primary focus:ring-offset-1" )} > Use setting diff --git a/src/frontend/src/components/toggleShadComponent/index.tsx b/src/frontend/src/components/toggleShadComponent/index.tsx index 188ddccf9..632ee1bad 100644 --- a/src/frontend/src/components/toggleShadComponent/index.tsx +++ b/src/frontend/src/components/toggleShadComponent/index.tsx @@ -19,6 +19,7 @@ export default function ToggleShadComponent({ style={{ transform: "scaleX(0.6) scaleY(0.6)", }} + className="data-[state=unchecked]:bg-slate-500" checked={enabled} onCheckedChange={(x: boolean) => { setEnabled(x); diff --git a/src/frontend/src/constants.tsx b/src/frontend/src/constants.tsx index d08aa75e7..285da5277 100644 --- a/src/frontend/src/constants.tsx +++ b/src/frontend/src/constants.tsx @@ -4,7 +4,7 @@ * The base text for subtitle of Export Dialog (Toolbar) * @constant */ -export const EXPORT_DIALOG_SUBTITLE = "Export your models."; +export const EXPORT_DIALOG_SUBTITLE = "Export flow as JSON file."; /** * The base text for subtitle of Flow Settings (Menubar) @@ -24,25 +24,27 @@ export const CODE_DIALOG_SUBTITLE = * @constant */ export const EDIT_DIALOG_SUBTITLE = - "Make configurations changes to your nodes. Click save when you're done."; + "Adjust the configurations of your component. Define parameter visibility for the canvas view. Remember to save once you’re finished."; /** * The base text for subtitle of Code Dialog * @constant */ -export const CODE_PROMPT_DIALOG_SUBTITLE = "Edit you python code."; +export const CODE_PROMPT_DIALOG_SUBTITLE = + "Edit your Python code. This code snippet accepts module import and a single function definition. Make sure that your function returns a string."; /** * The base text for subtitle of Prompt Dialog * @constant */ -export const PROMPT_DIALOG_SUBTITLE = "Edit you prompt."; +export const PROMPT_DIALOG_SUBTITLE = + "Create your prompt. Prompts can help guide the behavior of a Language Model."; /** * The base text for subtitle of Text Dialog * @constant */ -export const TEXT_DIALOG_SUBTITLE = "Edit you text."; +export const TEXT_DIALOG_SUBTITLE = "Edit your text."; /** * Function to get the python code for the API @@ -103,3 +105,25 @@ export const getPythonCode = (flowName: string): string => { # Now you can use it like any chain flow("Hey, have you heard of LangFlow?")`; }; + +/** + * The base text for subtitle of Import Dialog + * @constant + */ +export const IMPORT_DIALOG_SUBTITLE = + "Upload a JSON file or select from the available community examples."; + +/** + * The base text for subtitle of code dialog + * @constant + */ +export const EXPORT_CODE_DIALOG = + "Generate the code to integrate your flow into an external application."; + +/** + * The base text for subtitle of code dialog + * @constant + */ +export const INPUT_STYLE = + " focus:ring-1 focus:ring-offset-1 focus:ring-ring focus:outline-none "; + diff --git a/src/frontend/src/index.css b/src/frontend/src/index.css index f6bad16a2..2c00dbc22 100644 --- a/src/frontend/src/index.css +++ b/src/frontend/src/index.css @@ -70,16 +70,63 @@ } } - @layer base { - * { - @apply border-border; - } - body { - @apply bg-background text-foreground; - font-feature-settings: "rlig" 1, "calt" 1; - } +:root { + --background: 0 0% 100%; + --foreground: 222.2 47.4% 11.2%; + --muted: 210 40% 98%; + --muted-foreground: 215.4 16.3% 46.9%; + --popover: 0 0% 100%; + --popover-foreground: 222.2 47.4% 11.2%; + --card: 0 0% 100%; + --card-foreground: 222.2 47.4% 11.2%; + --border: 214.3 31.8% 91.4%; + --input: 214.3 31.8% 91.4%; + --primary: 222.2 47.4% 18%; + --primary-foreground: 210 40% 98%; + --secondary: 210 40% 96.1%; + --secondary-foreground: 222.2 47.4% 11.2%; + --accent: 210 40% 96.1%; + --accent-foreground: 222.2 47.4% 11.2%; + --destructive: 0 100% 50%; + --destructive-foreground: 210 40% 98%; + --ring: 215 20.2% 65.1%; + --radius: 0.5rem; +} + +.dark { + -background: 224 71% 4%; + -foreground: 213 31% 91%; + -muted: 223 47% 11%; + -muted-foreground: 215.4 16.3% 56.9%; + -popover: 224 71% 4%; + -popover-foreground: 215 20.2% 65.1%; + -card: 224 71% 4%; + -card-foreground: 213 31% 91%; + -border: 216 34% 17%; + -input: 216 34% 17%; + -primary: 210 40% 98%; + -primary-foreground: 222.2 47.4% 1.2%; + -secondary: 222.2 47.4% 11.2%; + -secondary-foreground: 210 40% 98%; + -accent: 216 34% 17%; + -accent-foreground: 210 40% 98%; + -destructive: 0 63% 31%; + -destructive-foreground: 210 40% 98%; + -ring: 216 34% 17%; + -radius: 0.5rem; +} + +@layer base { + * { + @apply border-border; } + body { + @apply bg-background text-foreground; + font-feature-settings: "rlig" 1, "calt" 1; + } +} + body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", @@ -98,4 +145,4 @@ code { The cursor: default; property value restores the browser's default cursor style for the targeted element. By applying this style, the element will no longer have a custom cursor appearance such as "grab" or any other custom cursor defined elsewhere in the application. Instead, it will revert to the default cursor style determined by the browser, typically an arrow-shaped cursor. */ .react-flow__pane { cursor: default; -} +} \ No newline at end of file diff --git a/src/frontend/src/modals/ApiModal/index.tsx b/src/frontend/src/modals/ApiModal/index.tsx index 6a58d467a..c34cb4afb 100644 --- a/src/frontend/src/modals/ApiModal/index.tsx +++ b/src/frontend/src/modals/ApiModal/index.tsx @@ -26,6 +26,7 @@ import { import { Button } from "../../components/ui/button"; import { FlowType } from "src/types/flow"; import { getCurlCode, getPythonApiCode, getPythonCode } from "../../constants"; +import { EXPORT_CODE_DIALOG } from "../../constants"; export default function ApiModal({ flow }: { flow: FlowType }) { const [open, setOpen] = useState(true); @@ -83,7 +84,7 @@ export default function ApiModal({ flow }: { flow: FlowType }) { return ( - + Code @@ -92,9 +93,7 @@ export default function ApiModal({ flow }: { flow: FlowType }) { aria-hidden="true" /> - - Export your flow to use it with this code. - + {EXPORT_CODE_DIALOG}
@@ -106,18 +105,18 @@ export default function ApiModal({ flow }: { flow: FlowType }) { setActiveTab(index); }} className={ - "p-2 rounded-t-lg w-44 border border-b-0 border-gray-300 dark:border-gray-700 dark:text-gray-300 -mr-px flex justify-center items-center gap-4 " + + "p-1.5 rounded-t-lg w-44 border border-b-0 border-gray-300 dark:border-gray-700 dark:text-gray-300 -mr-px flex justify-center items-center gap-4 " + (activeTab === index ? " bg-white dark:bg-gray-800" - : "bg-gray-100 dark:bg-gray-900") + : "bg-muted dark:bg-gray-900") } > {tab.name} - + ))}
-
+
{}, [closePopUp, data.node.template]); + function changeAdvanced(node): void { Object.keys(data.node.template).filter((n, i) => { if (n === node.name) { @@ -87,12 +89,10 @@ export default function EditNodeModal({ data }: { data: NodeDataType }) { setNodeValue(!nodeValue); } - console.log(data.node.template); - return ( - + Edit Node @@ -103,21 +103,21 @@ export default function EditNodeModal({ data }: { data: NodeDataType }) { {EDIT_DIALOG_SUBTITLE} -
- +
+   - + Parameters
-
+
limitScrollFieldsModal ? "overflow-scroll overflow-x-hidden custom-scroll" : "overflow-hidden" @@ -125,9 +125,9 @@ export default function EditNodeModal({ data }: { data: NodeDataType }) { > {nodeLength > 0 && (
- - - +
+ + PARAM VALUE @@ -150,8 +150,8 @@ export default function EditNodeModal({ data }: { data: NodeDataType }) { data.node.template[t].type === "int") ) .map((n, i) => ( - - + + {data.node.template[n].name ? data.node.template[n].name : data.node.template[n].display_name} @@ -162,6 +162,7 @@ export default function EditNodeModal({ data }: { data: NodeDataType }) {
{data.node.template[n].list ? ( diff --git a/src/frontend/src/modals/NodeModal/index.tsx b/src/frontend/src/modals/NodeModal/index.tsx index b44dd5bf3..6ceba62bf 100644 --- a/src/frontend/src/modals/NodeModal/index.tsx +++ b/src/frontend/src/modals/NodeModal/index.tsx @@ -146,7 +146,7 @@ export default function NodeModal({ data }: { data: NodeDataType }) {