From 01b781a10828ca2c4cf32762373ad40904c02d2c Mon Sep 17 00:00:00 2001 From: Eugene Date: Thu, 19 Dec 2024 13:05:12 +0100 Subject: [PATCH] fix(editor): Nodes' icon color in dark mode (#12279) --- .../nodes/chains/ChainLLM/ChainLlm.node.ts | 1 + .../ChainRetrievalQA/ChainRetrievalQa.node.ts | 1 + .../ChainSummarization.node.ts | 1 + .../MemoryBufferWindow.node.ts | 1 + .../MemoryChatRetriever.node.ts | 1 + .../MemoryMotorhead/MemoryMotorhead.node.ts | 1 + .../OutputParserAutofixing.node.ts | 1 + .../OutputParserItemList.node.ts | 1 + .../OutputParserStructured.node.ts | 1 + .../RetrieverContextualCompression.node.ts | 1 + .../RetrieverMultiQuery.node.ts | 1 + .../RetrieverVectorStore.node.ts | 1 + .../RetrieverWorkflow.node.ts | 1 + .../TextSplitterCharacterTextSplitter.node.ts | 1 + ...tterRecursiveCharacterTextSplitter.node.ts | 1 + .../TextSplitterTokenSplitter.node.ts | 1 + .../ToolCalculator/ToolCalculator.node.ts | 1 + .../nodes/tools/ToolCode/ToolCode.node.ts | 1 + .../ToolVectorStore/ToolVectorStore.node.ts | 1 + .../tools/ToolWorkflow/ToolWorkflow.node.ts | 1 + .../VectorStoreInMemory.node.ts | 1 + .../VectorStorePinecone.node.ts | 2 +- .../VectorStorePinecone/pinecone.dark.svg | 21 ++++++++++++++++++ .../VectorStorePinecone/pinecone.svg | 22 ++++++++++++++++++- .../shared/createVectorStoreNode.ts | 3 +++ 25 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePinecone/pinecone.dark.svg diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/ChainLlm.node.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/ChainLlm.node.ts index d4e205ec88..4b2ddf5db9 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/ChainLlm.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/ChainLlm.node.ts @@ -254,6 +254,7 @@ export class ChainLlm implements INodeType { displayName: 'Basic LLM Chain', name: 'chainLlm', icon: 'fa:link', + iconColor: 'black', group: ['transform'], version: [1, 1.1, 1.2, 1.3, 1.4, 1.5], description: 'A simple chain to prompt a large language model', diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.ts index 9c7c739701..7829bc7813 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.ts @@ -31,6 +31,7 @@ export class ChainRetrievalQa implements INodeType { displayName: 'Question and Answer Chain', name: 'chainRetrievalQa', icon: 'fa:link', + iconColor: 'black', group: ['transform'], version: [1, 1.1, 1.2, 1.3, 1.4], description: 'Answer questions about retrieved documents', diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/ChainSummarization.node.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/ChainSummarization.node.ts index cd47eb6a15..9c97190952 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/ChainSummarization.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/ChainSummarization.node.ts @@ -10,6 +10,7 @@ export class ChainSummarization extends VersionedNodeType { displayName: 'Summarization Chain', name: 'chainSummarization', icon: 'fa:link', + iconColor: 'black', group: ['transform'], description: 'Transforms text into a concise summary', codex: { diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.ts index 480bed68f9..3bdcd0d1fd 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.ts @@ -78,6 +78,7 @@ export class MemoryBufferWindow implements INodeType { displayName: 'Window Buffer Memory (easiest)', name: 'memoryBufferWindow', icon: 'fa:database', + iconColor: 'black', group: ['transform'], version: [1, 1.1, 1.2, 1.3], description: 'Stores in n8n memory, so no credentials required', diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.ts index fa54f25a16..82fcba22a6 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.ts @@ -38,6 +38,7 @@ export class MemoryChatRetriever implements INodeType { displayName: 'Chat Messages Retriever', name: 'memoryChatRetriever', icon: 'fa:database', + iconColor: 'black', group: ['transform'], hidden: true, version: 1, diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.ts index f5184d7e93..06fa387ee6 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.ts @@ -19,6 +19,7 @@ export class MemoryMotorhead implements INodeType { displayName: 'Motorhead', name: 'memoryMotorhead', icon: 'fa:file-export', + iconColor: 'black', group: ['transform'], version: [1, 1.1, 1.2, 1.3], description: 'Use Motorhead Memory', diff --git a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.ts b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.ts index 0ccf4c27c0..f9e6cd2968 100644 --- a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.ts @@ -21,6 +21,7 @@ export class OutputParserAutofixing implements INodeType { displayName: 'Auto-fixing Output Parser', name: 'outputParserAutofixing', icon: 'fa:tools', + iconColor: 'black', group: ['transform'], version: 1, description: 'Automatically fix the output if it is not in the correct format', diff --git a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.ts b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.ts index 696a6be79c..b94b82fada 100644 --- a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.ts @@ -15,6 +15,7 @@ export class OutputParserItemList implements INodeType { displayName: 'Item List Output Parser', name: 'outputParserItemList', icon: 'fa:bars', + iconColor: 'black', group: ['transform'], version: 1, description: 'Return the results as separate items', diff --git a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts index 8da4cb05d8..0869020997 100644 --- a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts @@ -20,6 +20,7 @@ export class OutputParserStructured implements INodeType { displayName: 'Structured Output Parser', name: 'outputParserStructured', icon: 'fa:code', + iconColor: 'black', group: ['transform'], version: [1, 1.1, 1.2], defaultVersion: 1.2, diff --git a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.ts b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.ts index 74db608551..feb70ecb43 100644 --- a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.ts @@ -19,6 +19,7 @@ export class RetrieverContextualCompression implements INodeType { displayName: 'Contextual Compression Retriever', name: 'retrieverContextualCompression', icon: 'fa:box-open', + iconColor: 'black', group: ['transform'], version: 1, description: 'Enhances document similarity search by contextual compression.', diff --git a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.ts b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.ts index 3805eb5374..4bbc45f6d1 100644 --- a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.ts @@ -18,6 +18,7 @@ export class RetrieverMultiQuery implements INodeType { displayName: 'MultiQuery Retriever', name: 'retrieverMultiQuery', icon: 'fa:box-open', + iconColor: 'black', group: ['transform'], version: 1, description: diff --git a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.ts b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.ts index 74f88e5561..915d9766dc 100644 --- a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.ts @@ -15,6 +15,7 @@ export class RetrieverVectorStore implements INodeType { displayName: 'Vector Store Retriever', name: 'retrieverVectorStore', icon: 'fa:box-open', + iconColor: 'black', group: ['transform'], version: 1, description: 'Use a Vector Store as Retriever', diff --git a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts index 5e9fecd47a..1291b92252 100644 --- a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts @@ -41,6 +41,7 @@ export class RetrieverWorkflow implements INodeType { displayName: 'Workflow Retriever', name: 'retrieverWorkflow', icon: 'fa:box-open', + iconColor: 'black', group: ['transform'], version: [1, 1.1], description: 'Use an n8n Workflow as Retriever', diff --git a/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.ts b/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.ts index c78bd39a6c..962af5bde2 100644 --- a/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.ts @@ -17,6 +17,7 @@ export class TextSplitterCharacterTextSplitter implements INodeType { displayName: 'Character Text Splitter', name: 'textSplitterCharacterTextSplitter', icon: 'fa:grip-lines-vertical', + iconColor: 'black', group: ['transform'], version: 1, description: 'Split text into chunks by characters', diff --git a/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.ts b/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.ts index cfe8a32757..4e376c39a3 100644 --- a/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.ts @@ -37,6 +37,7 @@ export class TextSplitterRecursiveCharacterTextSplitter implements INodeType { displayName: 'Recursive Character Text Splitter', name: 'textSplitterRecursiveCharacterTextSplitter', icon: 'fa:grip-lines-vertical', + iconColor: 'black', group: ['transform'], version: 1, description: 'Split text into chunks by characters recursively, recommended for most use cases', diff --git a/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.ts b/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.ts index cd881916d6..b5dade396d 100644 --- a/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.ts @@ -16,6 +16,7 @@ export class TextSplitterTokenSplitter implements INodeType { displayName: 'Token Splitter', name: 'textSplitterTokenSplitter', icon: 'fa:grip-lines-vertical', + iconColor: 'black', group: ['transform'], version: 1, description: 'Split text into chunks by tokens', diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolCalculator/ToolCalculator.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolCalculator/ToolCalculator.node.ts index b3ed23c576..6d67a04555 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolCalculator/ToolCalculator.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolCalculator/ToolCalculator.node.ts @@ -16,6 +16,7 @@ export class ToolCalculator implements INodeType { displayName: 'Calculator', name: 'toolCalculator', icon: 'fa:calculator', + iconColor: 'black', group: ['transform'], version: 1, description: 'Make it easier for AI agents to perform arithmetic', diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolCode/ToolCode.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolCode/ToolCode.node.ts index 214d4ed82a..029bce48f6 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolCode/ToolCode.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolCode/ToolCode.node.ts @@ -26,6 +26,7 @@ export class ToolCode implements INodeType { displayName: 'Code Tool', name: 'toolCode', icon: 'fa:code', + iconColor: 'black', group: ['transform'], version: [1, 1.1], description: 'Write a tool in JS or Python', diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolVectorStore/ToolVectorStore.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolVectorStore/ToolVectorStore.node.ts index 4b539e7e85..aaa2ca37d9 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolVectorStore/ToolVectorStore.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolVectorStore/ToolVectorStore.node.ts @@ -18,6 +18,7 @@ export class ToolVectorStore implements INodeType { displayName: 'Vector Store Tool', name: 'toolVectorStore', icon: 'fa:database', + iconColor: 'black', group: ['transform'], version: [1], description: 'Retrieve context from vector store', diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/ToolWorkflow.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/ToolWorkflow.node.ts index 6b09cbfc88..227481b65c 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/ToolWorkflow.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/ToolWorkflow.node.ts @@ -32,6 +32,7 @@ export class ToolWorkflow implements INodeType { displayName: 'Call n8n Workflow Tool', name: 'toolWorkflow', icon: 'fa:network-wired', + iconColor: 'black', group: ['transform'], version: [1, 1.1, 1.2, 1.3], description: 'Uses another n8n workflow as a tool. Allows packaging any n8n node(s) as a tool.', diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.ts index dc99db630d..0323478ee8 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.ts @@ -26,6 +26,7 @@ export class VectorStoreInMemory extends createVectorStoreNode({ name: 'vectorStoreInMemory', description: 'Work with your data in In-Memory Vector Store', icon: 'fa:database', + iconColor: 'black', docsUrl: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/', }, diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.ts index 6e684ebed3..711425df55 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.ts @@ -56,7 +56,7 @@ export class VectorStorePinecone extends createVectorStoreNode({ displayName: 'Pinecone Vector Store', name: 'vectorStorePinecone', description: 'Work with your data in Pinecone Vector Store', - icon: 'file:pinecone.svg', + icon: { light: 'file:pinecone.svg', dark: 'file:pinecone.dark.svg' }, docsUrl: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorepinecone/', credentials: [ diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePinecone/pinecone.dark.svg b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePinecone/pinecone.dark.svg new file mode 100644 index 0000000000..4d163c6784 --- /dev/null +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePinecone/pinecone.dark.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePinecone/pinecone.svg b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePinecone/pinecone.svg index b94b8b3af6..e9884a4249 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePinecone/pinecone.svg +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePinecone/pinecone.svg @@ -1 +1,21 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode.ts index 6d4abfb0cd..84f1d550e5 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode.ts @@ -17,6 +17,7 @@ import type { INodeListSearchResult, Icon, INodePropertyOptions, + ThemeIconColor, } from 'n8n-workflow'; import { getMetadataFiltersValues, logAiEvent } from '@utils/helpers'; @@ -37,6 +38,7 @@ interface NodeMeta { description: string; docsUrl: string; icon: Icon; + iconColor?: ThemeIconColor; credentials?: INodeCredentialDescription[]; operationModes?: NodeOperationMode[]; } @@ -125,6 +127,7 @@ export const createVectorStoreNode = (args: VectorStoreNodeConstructorArgs) => name: args.meta.name, description: args.meta.description, icon: args.meta.icon, + iconColor: args.meta.iconColor, group: ['transform'], version: 1, defaults: {