diff --git a/pyproject.toml b/pyproject.toml index 1285caeaa..dab73887c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,14 +1,17 @@ [tool.poetry] name = "langflow" -version = "0.3.2" +version = "0.3.3" description = "A Python package with a built-in web application" authors = ["Logspace "] maintainers = [ + "Carlos Coelho ", "Cristhian Zanforlin ", "Gabriel Almeida ", "Gustavo Schaedler ", + "Igor Carvalho ", "Lucas Eduoli ", "Otávio Anovazzi ", + "Rodrigo Nader ", ] repository = "https://github.com/logspace-ai/langflow" license = "MIT" diff --git a/src/backend/langflow/template/frontend_node/constants.py b/src/backend/langflow/template/frontend_node/constants.py index 670fcb3fb..3cf5dfffd 100644 --- a/src/backend/langflow/template/frontend_node/constants.py +++ b/src/backend/langflow/template/frontend_node/constants.py @@ -8,6 +8,7 @@ FORCE_SHOW_FIELDS = [ "headers", "max_value_length", "max_tokens", + "google_cse_id", ] DEFAULT_PROMPT = """ diff --git a/src/frontend/package-lock.json b/src/frontend/package-lock.json index 7af2a6e04..ed3eacd4f 100644 --- a/src/frontend/package-lock.json +++ b/src/frontend/package-lock.json @@ -20,6 +20,7 @@ "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-menubar": "^1.0.3", + "@radix-ui/react-popover": "^1.0.6", "@radix-ui/react-progress": "^1.0.3", "@radix-ui/react-separator": "^1.0.3", "@radix-ui/react-slot": "^1.0.2", @@ -29,6 +30,7 @@ "@tabler/icons-react": "^2.18.0", "@tailwindcss/forms": "^0.5.3", "@tailwindcss/line-clamp": "^0.4.4", + "@types/axios": "^0.14.0", "accordion": "^3.0.2", "ace-builds": "^1.16.0", "add": "^2.0.6", @@ -143,6 +145,8 @@ }, "node_modules/@babel/compat-data": { "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.6.tgz", + "integrity": "sha512-29tfsWTq2Ftu7MXmimyC0C5FDZv5DYxOZkh3XD3+QW4V/BYuv/LyEsjj3c0hqedEaDt6DBfDvexMKU8YevdqFg==", "license": "MIT", "engines": { "node": ">=6.9.0" @@ -1460,6 +1464,43 @@ } } }, + "node_modules/@radix-ui/react-popover": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.0.6.tgz", + "integrity": "sha512-cZ4defGpkZ0qTRtlIBzJLSzL6ht7ofhhW4i1+pkemjV1IKXm0wgCRnee154qlV6r9Ttunmh2TNZhMfV2bavUyA==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.1", + "@radix-ui/react-compose-refs": "1.0.1", + "@radix-ui/react-context": "1.0.1", + "@radix-ui/react-dismissable-layer": "1.0.4", + "@radix-ui/react-focus-guards": "1.0.1", + "@radix-ui/react-focus-scope": "1.0.3", + "@radix-ui/react-id": "1.0.1", + "@radix-ui/react-popper": "1.1.2", + "@radix-ui/react-portal": "1.0.3", + "@radix-ui/react-presence": "1.0.1", + "@radix-ui/react-primitive": "1.0.3", + "@radix-ui/react-slot": "1.0.2", + "@radix-ui/react-use-controllable-state": "1.0.1", + "aria-hidden": "^1.1.1", + "react-remove-scroll": "2.5.5" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-popper": { "version": "1.1.2", "license": "MIT", @@ -2610,6 +2651,15 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/axios": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@types/axios/-/axios-0.14.0.tgz", + "integrity": "sha512-KqQnQbdYE54D7oa/UmYVMZKq7CO4l8DEENzOKc4aBRwxCXSlJXGz83flFx5L7AWrOQnmuN3kVsRdt+GZPPjiVQ==", + "deprecated": "This is a stub types definition for axios (https://github.com/mzabriskie/axios). axios provides its own type definitions, so you don't need @types/axios installed!", + "dependencies": { + "axios": "*" + } + }, "node_modules/@types/cacheable-request": { "version": "6.0.3", "dev": true, @@ -9533,8 +9583,9 @@ "license": "MIT" }, "node_modules/word-wrap": { - "version": "1.2.3", - "license": "MIT", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "engines": { "node": ">=0.10.0" } diff --git a/src/frontend/package.json b/src/frontend/package.json index 323a9a7be..e3814c1ad 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -15,6 +15,7 @@ "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-menubar": "^1.0.3", + "@radix-ui/react-popover": "^1.0.6", "@radix-ui/react-progress": "^1.0.3", "@radix-ui/react-separator": "^1.0.3", "@radix-ui/react-slot": "^1.0.2", @@ -24,6 +25,7 @@ "@tabler/icons-react": "^2.18.0", "@tailwindcss/forms": "^0.5.3", "@tailwindcss/line-clamp": "^0.4.4", + "@types/axios": "^0.14.0", "accordion": "^3.0.2", "ace-builds": "^1.16.0", "add": "^2.0.6", diff --git a/src/frontend/src/alerts/alertDropDown/index.tsx b/src/frontend/src/alerts/alertDropDown/index.tsx index a3f69d707..90838d693 100644 --- a/src/frontend/src/alerts/alertDropDown/index.tsx +++ b/src/frontend/src/alerts/alertDropDown/index.tsx @@ -1,66 +1,72 @@ -import { useContext, useRef } from "react"; +import { useContext, useState } from "react"; import IconComponent from "../../components/genericIconComponent"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "../../components/ui/popover"; import { alertContext } from "../../contexts/alertContext"; -import { PopUpContext } from "../../contexts/popUpContext"; import { AlertDropdownType } from "../../types/alerts"; -import { useOnClickOutside } from "../hooks/useOnClickOutside"; import SingleAlert from "./components/singleAlertComponent"; -export default function AlertDropdown({}: AlertDropdownType) { - const { closePopUp } = useContext(PopUpContext); - const componentRef = useRef(null); - - // Use the custom hook - useOnClickOutside(componentRef, () => { - closePopUp(); - }); - +export default function AlertDropdown({ children }: AlertDropdownType) { const { notificationList, clearNotificationList, removeFromNotificationList, + setNotificationCenter, } = useContext(alertContext); + const [open, setOpen] = useState(false); + return ( -
{ + setOpen(k); + if (k) setNotificationCenter(false); + }} > -
- Notifications -
- - -
-
-
- {notificationList.length !== 0 ? ( - notificationList.map((alertItem, index) => ( - - )) - ) : ( -
- No new notifications + {children} + +
+ Notifications +
+ +
- )} -
-
+
+
+ {notificationList.length !== 0 ? ( + notificationList.map((alertItem, index) => ( + + )) + ) : ( +
+ No new notifications +
+ )} +
+ + ); } diff --git a/src/frontend/src/components/floatComponent/index.tsx b/src/frontend/src/components/floatComponent/index.tsx index 278b3d203..40d6fc3fe 100644 --- a/src/frontend/src/components/floatComponent/index.tsx +++ b/src/frontend/src/components/floatComponent/index.tsx @@ -1,5 +1,6 @@ import { useEffect } from "react"; import { FloatComponentType } from "../../types/components"; +import { Input } from "../ui/input"; export default function FloatComponent({ value, @@ -19,8 +20,8 @@ export default function FloatComponent({ }, [disabled, onChange]); return ( -
- + )} - + +
+ {notificationCenter && ( +
+ )} +
+
diff --git a/src/frontend/src/components/inputComponent/index.tsx b/src/frontend/src/components/inputComponent/index.tsx index 682d5716c..78b06c411 100644 --- a/src/frontend/src/components/inputComponent/index.tsx +++ b/src/frontend/src/components/inputComponent/index.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from "react"; import { InputComponentType } from "../../types/components"; import { classNames } from "../../utils/utils"; +import { Input } from "../ui/input"; export default function InputComponent({ value, @@ -19,16 +20,15 @@ export default function InputComponent({ }, [disabled, onChange]); return ( -
- + { diff --git a/src/frontend/src/components/inputListComponent/index.tsx b/src/frontend/src/components/inputListComponent/index.tsx index ed563b735..13f5f7cca 100644 --- a/src/frontend/src/components/inputListComponent/index.tsx +++ b/src/frontend/src/components/inputListComponent/index.tsx @@ -2,7 +2,9 @@ import { useEffect } from "react"; import { InputListComponentType } from "../../types/components"; import _ from "lodash"; +import { classNames } from "../../utils/utils"; import IconComponent from "../genericIconComponent"; +import { Input } from "../ui/input"; export default function InputListComponent({ value, @@ -18,23 +20,19 @@ export default function InputListComponent({ return (
1 && editNode ? "my-1" : "", "flex flex-col gap-3" - } + )} > {value.map((i, idx) => { return (
- { let newInputList = _.cloneDeep(value); diff --git a/src/frontend/src/components/intComponent/index.tsx b/src/frontend/src/components/intComponent/index.tsx index 24d28e4f5..c43055b47 100644 --- a/src/frontend/src/components/intComponent/index.tsx +++ b/src/frontend/src/components/intComponent/index.tsx @@ -1,5 +1,6 @@ import { useEffect } from "react"; import { FloatComponentType } from "../../types/components"; +import { Input } from "../ui/input"; export default function IntComponent({ value, @@ -17,13 +18,8 @@ export default function IntComponent({ }, [disabled, onChange]); return ( -
- + { if ( event.key !== "Backspace" && @@ -51,12 +47,8 @@ export default function IntComponent({ } }} value={value ?? ""} - className={ - "nopan nodrag noundo nocopy " + - (editNode - ? " input-edit-node " - : " input-primary " + (disabled ? " input-disable" : "")) - } + className={editNode ? "input-edit-node" : ""} + disabled={disabled} placeholder={editNode ? "Integer number" : "Type an integer number"} onChange={(e) => { onChange(e.target.value); diff --git a/src/frontend/src/components/textAreaComponent/index.tsx b/src/frontend/src/components/textAreaComponent/index.tsx index 2bead9a2d..cd598f01e 100644 --- a/src/frontend/src/components/textAreaComponent/index.tsx +++ b/src/frontend/src/components/textAreaComponent/index.tsx @@ -3,6 +3,7 @@ import { TypeModal } from "../../constants/enums"; import GenericModal from "../../modals/genericModal"; import { TextAreaComponentType } from "../../types/components"; import IconComponent from "../genericIconComponent"; +import { Input } from "../ui/input"; export default function TextAreaComponent({ value, @@ -18,42 +19,36 @@ export default function TextAreaComponent({ }, [disabled]); return ( -
-
- + { + onChange(e.target.value); + }} + /> +
+ { - onChange(e.target.value); + setValue={(t: string) => { + onChange(t); }} - /> -
- { - onChange(t); - }} - > - {!editNode && ( - - )} - -
+ > + {!editNode && ( + + )} +
); diff --git a/src/frontend/src/components/ui/input.tsx b/src/frontend/src/components/ui/input.tsx index 0942a3930..c025f8de3 100644 --- a/src/frontend/src/components/ui/input.tsx +++ b/src/frontend/src/components/ui/input.tsx @@ -9,10 +9,7 @@ const Input = React.forwardRef( return ( diff --git a/src/frontend/src/components/ui/popover.tsx b/src/frontend/src/components/ui/popover.tsx new file mode 100644 index 000000000..63c80bb7e --- /dev/null +++ b/src/frontend/src/components/ui/popover.tsx @@ -0,0 +1,30 @@ +"use client"; + +import * as PopoverPrimitive from "@radix-ui/react-popover"; +import * as React from "react"; +import { cn } from "../../utils/utils"; + +const Popover = PopoverPrimitive.Root; + +const PopoverTrigger = PopoverPrimitive.Trigger; + +const PopoverContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, align = "center", sideOffset = 4, ...props }, ref) => ( + + + +)); +PopoverContent.displayName = PopoverPrimitive.Content.displayName; + +export { Popover, PopoverTrigger, PopoverContent }; diff --git a/src/frontend/src/components/ui/textarea.tsx b/src/frontend/src/components/ui/textarea.tsx index 64aec41a1..cfad1cf72 100644 --- a/src/frontend/src/components/ui/textarea.tsx +++ b/src/frontend/src/components/ui/textarea.tsx @@ -8,10 +8,7 @@ const Textarea = React.forwardRef( ({ className, ...props }, ref) => { return (