From 756e623dd52307bd6a7e3fe8ac615d824000ec59 Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Fri, 8 Mar 2024 02:10:06 -0300 Subject: [PATCH] add new icons to new components --- .../experimental/ClearMessageHistory.py | 2 +- .../components/experimental/ListFlows.py | 2 +- .../components/experimental/Notify.py | 2 +- .../components/helpers/PythonFunction.py | 2 +- .../langflow/components/inputs/ChatInput.py | 1 + .../langflow/components/outputs/ChatOutput.py | 2 +- .../BotMessageSquare/BotMessageSquare.jsx | 23 +++ .../src/icons/BotMessageSquare/index.tsx | 9 + src/frontend/src/icons/Python/Python.jsx | 158 ++++++++++++++++++ src/frontend/src/icons/Python/Python.svg | 41 +++++ src/frontend/src/icons/Python/index.tsx | 9 + .../src/icons/QianFanChat/QianFanChat.jsx | 23 +++ .../src/icons/QianFanChat/QianFanChat.svg | 1 + src/frontend/src/icons/QianFanChat/index.tsx | 9 + src/frontend/src/utils/styleUtils.ts | 16 +- 15 files changed, 292 insertions(+), 8 deletions(-) create mode 100644 src/frontend/src/icons/BotMessageSquare/BotMessageSquare.jsx create mode 100644 src/frontend/src/icons/BotMessageSquare/index.tsx create mode 100644 src/frontend/src/icons/Python/Python.jsx create mode 100644 src/frontend/src/icons/Python/Python.svg create mode 100644 src/frontend/src/icons/Python/index.tsx create mode 100644 src/frontend/src/icons/QianFanChat/QianFanChat.jsx create mode 100644 src/frontend/src/icons/QianFanChat/QianFanChat.svg create mode 100644 src/frontend/src/icons/QianFanChat/index.tsx diff --git a/src/backend/langflow/components/experimental/ClearMessageHistory.py b/src/backend/langflow/components/experimental/ClearMessageHistory.py index 6d264422fc..6d429b6104 100644 --- a/src/backend/langflow/components/experimental/ClearMessageHistory.py +++ b/src/backend/langflow/components/experimental/ClearMessageHistory.py @@ -5,7 +5,7 @@ class ClearMessageHistoryComponent(CustomComponent): display_name = "Clear Message History" description = "A component to clear the message history." - + icon="ClearMessageHistory" def build_config(self): return { "session_id": { diff --git a/src/backend/langflow/components/experimental/ListFlows.py b/src/backend/langflow/components/experimental/ListFlows.py index 724cd9a821..4920aadb3a 100644 --- a/src/backend/langflow/components/experimental/ListFlows.py +++ b/src/backend/langflow/components/experimental/ListFlows.py @@ -7,7 +7,7 @@ class ListFlowsComponent(CustomComponent): display_name = "List Flows" description = "A component to list all available flows." - + icon = "ListFlows" def build_config(self): return {} diff --git a/src/backend/langflow/components/experimental/Notify.py b/src/backend/langflow/components/experimental/Notify.py index 3b56623553..7c8f6503b1 100644 --- a/src/backend/langflow/components/experimental/Notify.py +++ b/src/backend/langflow/components/experimental/Notify.py @@ -7,7 +7,7 @@ class NotifyComponent(CustomComponent): display_name = "Notify" description = "A component to generate a notification to Get Notified component." - + icon = "Notify" def build_config(self): return { "name": {"display_name": "Name", "info": "The name of the notification."}, diff --git a/src/backend/langflow/components/helpers/PythonFunction.py b/src/backend/langflow/components/helpers/PythonFunction.py index fdbc40cbd3..a33c9dac1d 100644 --- a/src/backend/langflow/components/helpers/PythonFunction.py +++ b/src/backend/langflow/components/helpers/PythonFunction.py @@ -8,7 +8,7 @@ class PythonFunctionComponent(CustomComponent): display_name = "Python Function" description = "Define a Python function." - + icon = "Python" def build_config(self): return { "function_code": { diff --git a/src/backend/langflow/components/inputs/ChatInput.py b/src/backend/langflow/components/inputs/ChatInput.py index e5867751cf..2ed1ab22c3 100644 --- a/src/backend/langflow/components/inputs/ChatInput.py +++ b/src/backend/langflow/components/inputs/ChatInput.py @@ -8,6 +8,7 @@ class ChatInput(ChatComponent): display_name = "Chat Input" description = "Used to get user input from the chat." + icon = "ChatInput" def build( self, diff --git a/src/backend/langflow/components/outputs/ChatOutput.py b/src/backend/langflow/components/outputs/ChatOutput.py index aa61159c97..3fded100c5 100644 --- a/src/backend/langflow/components/outputs/ChatOutput.py +++ b/src/backend/langflow/components/outputs/ChatOutput.py @@ -8,7 +8,7 @@ class ChatOutput(ChatComponent): display_name = "Chat Output" description = "Used to send a message to the chat." - + icon = "ChatOutput" def build( self, sender: Optional[str] = "Machine", diff --git a/src/frontend/src/icons/BotMessageSquare/BotMessageSquare.jsx b/src/frontend/src/icons/BotMessageSquare/BotMessageSquare.jsx new file mode 100644 index 0000000000..64c8fbb0fa --- /dev/null +++ b/src/frontend/src/icons/BotMessageSquare/BotMessageSquare.jsx @@ -0,0 +1,23 @@ +const SvgBotMessageSquare = (props) => ( + + + + + + + + +); +export default SvgBotMessageSquare; diff --git a/src/frontend/src/icons/BotMessageSquare/index.tsx b/src/frontend/src/icons/BotMessageSquare/index.tsx new file mode 100644 index 0000000000..c3b4b04a5e --- /dev/null +++ b/src/frontend/src/icons/BotMessageSquare/index.tsx @@ -0,0 +1,9 @@ +import React, { forwardRef } from "react"; +import SvgChroma from "./BotMessageSquare"; + +export const BotMessageSquareIcon = forwardRef< + SVGSVGElement, + React.PropsWithChildren<{}> +>((props, ref) => { + return ; +}); diff --git a/src/frontend/src/icons/Python/Python.jsx b/src/frontend/src/icons/Python/Python.jsx new file mode 100644 index 0000000000..253e7747ea --- /dev/null +++ b/src/frontend/src/icons/Python/Python.jsx @@ -0,0 +1,158 @@ +export const SvgPython = (props) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +); +export default SvgPython; diff --git a/src/frontend/src/icons/Python/Python.svg b/src/frontend/src/icons/Python/Python.svg new file mode 100644 index 0000000000..8e00c5e76b --- /dev/null +++ b/src/frontend/src/icons/Python/Python.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/frontend/src/icons/Python/index.tsx b/src/frontend/src/icons/Python/index.tsx new file mode 100644 index 0000000000..2a6fc1fc0c --- /dev/null +++ b/src/frontend/src/icons/Python/index.tsx @@ -0,0 +1,9 @@ +import React, { forwardRef } from "react"; +import SvgPython from "./Python"; + +export const PythonIcon = forwardRef< + SVGSVGElement, + React.PropsWithChildren<{}> +>((props, ref) => { + return ; +}); diff --git a/src/frontend/src/icons/QianFanChat/QianFanChat.jsx b/src/frontend/src/icons/QianFanChat/QianFanChat.jsx new file mode 100644 index 0000000000..6724a2b0dc --- /dev/null +++ b/src/frontend/src/icons/QianFanChat/QianFanChat.jsx @@ -0,0 +1,23 @@ +export const SvgQianFanChat = (props) => ( + + + + + +); +export default SvgQianFanChat; diff --git a/src/frontend/src/icons/QianFanChat/QianFanChat.svg b/src/frontend/src/icons/QianFanChat/QianFanChat.svg new file mode 100644 index 0000000000..a25c4f6a3c --- /dev/null +++ b/src/frontend/src/icons/QianFanChat/QianFanChat.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/frontend/src/icons/QianFanChat/index.tsx b/src/frontend/src/icons/QianFanChat/index.tsx new file mode 100644 index 0000000000..3b45e0ce47 --- /dev/null +++ b/src/frontend/src/icons/QianFanChat/index.tsx @@ -0,0 +1,9 @@ +import React, { forwardRef } from "react"; +import SvgQianFanChat from "./QianFanChat"; + +export const QianFanChatIcon = forwardRef< + SVGSVGElement, + React.PropsWithChildren<{}> +>((props, ref) => { + return ; +}); diff --git a/src/frontend/src/utils/styleUtils.ts b/src/frontend/src/utils/styleUtils.ts index 7ebcda3c27..73c9a2ae0e 100644 --- a/src/frontend/src/utils/styleUtils.ts +++ b/src/frontend/src/utils/styleUtils.ts @@ -41,8 +41,8 @@ import { Eye, EyeOff, File, + FileClock, FileDown, - SquarePen, FileSearch, FileSearch2, FileSliders, @@ -108,6 +108,7 @@ import { Snowflake, Sparkles, Square, + SquarePen, Store, SunIcon, TerminalIcon, @@ -132,12 +133,13 @@ import { XCircle, Zap, } from "lucide-react"; -import { FaApple, FaGithub, FaRobot } from "react-icons/fa"; +import { FaApple, FaGithub } from "react-icons/fa"; import { AWSIcon } from "../icons/AWS"; import { AirbyteIcon } from "../icons/Airbyte"; import { AnthropicIcon } from "../icons/Anthropic"; import { AzureIcon } from "../icons/Azure"; import { BingIcon } from "../icons/Bing"; +import { BotMessageSquareIcon } from "../icons/BotMessageSquare"; import { ChromaIcon } from "../icons/ChromaIcon"; import { CohereIcon } from "../icons/Cohere"; import { ElasticsearchIcon } from "../icons/ElasticsearchStore"; @@ -160,7 +162,9 @@ import { OllamaIcon } from "../icons/Ollama"; import { OpenAiIcon } from "../icons/OpenAi"; import { PineconeIcon } from "../icons/Pinecone"; import { PostgresIcon } from "../icons/Postgres"; +import { PythonIcon } from "../icons/Python"; import { QDrantIcon } from "../icons/QDrant"; +import { QianFanChatIcon } from "../icons/QianFanChat"; import { RedisIcon } from "../icons/Redis"; import { SearxIcon } from "../icons/Searx"; import { ShareIcon } from "../icons/Share"; @@ -273,6 +277,12 @@ export const nodeNames: { [char: string]: string } = { }; export const nodeIconsLucide: iconsType = { + Notify: Bell, + ListFlows: Group, + ClearMessageHistory: FileClock, + Python: PythonIcon, + ChatOutput: BotMessageSquareIcon, + ChatInput: MessagesSquare, inputs: Download, outputs: Upload, data: Database, @@ -289,7 +299,7 @@ export const nodeIconsLucide: iconsType = { Redis: RedisIcon, RedisSearch: RedisIcon, PostgresChatMessageHistory: PostgresIcon, - BaiduQianfan: FaRobot, + BaiduQianfan: QianFanChatIcon, Play, Vectara: VectaraIcon, ArrowUpToLine: ArrowUpToLine,