🔥 refactor(utils.ts): remove unused imports and icons to improve code cleanliness and reduce bundle size
🎨 style(utils.ts): reorganize nodeColors and nodeNames objects to improve readability and maintainability
The changes in this commit remove unused imports and icons from the `utils.ts` file, which helps improve code cleanliness and reduces the bundle size. Additionally, the `nodeColors` and `nodeNames` objects have been reorganized to improve readability and maintainability.
This commit is contained in:
parent
8ed5287ac4
commit
197f1f9e71
1 changed files with 6 additions and 80 deletions
|
|
@ -1,21 +1,3 @@
|
||||||
import {
|
|
||||||
RocketLaunchIcon,
|
|
||||||
LinkIcon,
|
|
||||||
CpuChipIcon,
|
|
||||||
LightBulbIcon,
|
|
||||||
CommandLineIcon,
|
|
||||||
WrenchScrewdriverIcon,
|
|
||||||
WrenchIcon,
|
|
||||||
ComputerDesktopIcon,
|
|
||||||
GiftIcon,
|
|
||||||
PaperClipIcon,
|
|
||||||
QuestionMarkCircleIcon,
|
|
||||||
FingerPrintIcon,
|
|
||||||
ScissorsIcon,
|
|
||||||
CircleStackIcon,
|
|
||||||
Squares2X2Icon,
|
|
||||||
Bars3CenterLeftIcon,
|
|
||||||
} from "@heroicons/react/24/outline";
|
|
||||||
import { Connection, Edge, Node, ReactFlowInstance } from "reactflow";
|
import { Connection, Edge, Node, ReactFlowInstance } from "reactflow";
|
||||||
import { FlowType, NodeType } from "./types/flow";
|
import { FlowType, NodeType } from "./types/flow";
|
||||||
import { APITemplateType } from "./types/api";
|
import { APITemplateType } from "./types/api";
|
||||||
|
|
@ -58,6 +40,7 @@ import {
|
||||||
Paperclip,
|
Paperclip,
|
||||||
Rocket,
|
Rocket,
|
||||||
Scissors,
|
Scissors,
|
||||||
|
Search,
|
||||||
TerminalSquare,
|
TerminalSquare,
|
||||||
Wand2,
|
Wand2,
|
||||||
Wrench,
|
Wrench,
|
||||||
|
|
@ -139,6 +122,7 @@ export const nodeColors: { [char: string]: string } = {
|
||||||
toolkits: "#DB2C2C",
|
toolkits: "#DB2C2C",
|
||||||
wrappers: "#E6277A",
|
wrappers: "#E6277A",
|
||||||
utilities: "#31A3CC",
|
utilities: "#31A3CC",
|
||||||
|
retrievers: "#F5B85A",
|
||||||
unknown: "#9CA3AF",
|
unknown: "#9CA3AF",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -157,72 +141,11 @@ export const nodeNames: { [char: string]: string } = {
|
||||||
toolkits: "Toolkits",
|
toolkits: "Toolkits",
|
||||||
wrappers: "Wrappers",
|
wrappers: "Wrappers",
|
||||||
textsplitters: "Text Splitters",
|
textsplitters: "Text Splitters",
|
||||||
|
retrievers: "Retrievers",
|
||||||
utilities: "Utilities",
|
utilities: "Utilities",
|
||||||
unknown: "Unknown",
|
unknown: "Unknown",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const nodeIcons: {
|
|
||||||
[char: string]: React.ForwardRefExoticComponent<
|
|
||||||
React.SVGProps<SVGSVGElement>
|
|
||||||
>;
|
|
||||||
} = {
|
|
||||||
Chroma: ChromaIcon,
|
|
||||||
AirbyteJSONLoader: AirbyteIcon,
|
|
||||||
// SerpAPIWrapper: SerperIcon,
|
|
||||||
// AZLyricsLoader: AzIcon,
|
|
||||||
Anthropic: AnthropicIcon,
|
|
||||||
ChatAnthropic: AnthropicIcon,
|
|
||||||
BingSearchAPIWrapper: BingIcon,
|
|
||||||
BingSearchRun: BingIcon,
|
|
||||||
Cohere: CohereIcon,
|
|
||||||
CohereEmbeddings: CohereIcon,
|
|
||||||
EverNoteLoader: EvernoteIcon,
|
|
||||||
FacebookChatLoader: FBIcon,
|
|
||||||
GitbookLoader: GitBookIcon,
|
|
||||||
GoogleSearchAPIWrapper: GoogleIcon,
|
|
||||||
GoogleSearchResults: GoogleIcon,
|
|
||||||
GoogleSearchRun: GoogleIcon,
|
|
||||||
HNLoader: HackerNewsIcon,
|
|
||||||
HuggingFaceHub: HugginFaceIcon,
|
|
||||||
HuggingFaceEmbeddings: HugginFaceIcon,
|
|
||||||
IFixitLoader: IFixIcon,
|
|
||||||
Meta: MetaIcon,
|
|
||||||
Midjourney: MidjourneyIcon,
|
|
||||||
NotionDirectoryLoader: NotionIcon,
|
|
||||||
ChatOpenAI: OpenAiIcon,
|
|
||||||
OpenAI: OpenAiIcon,
|
|
||||||
OpenAIEmbeddings: OpenAiIcon,
|
|
||||||
Pinecone: PineconeIcon,
|
|
||||||
SupabaseVectorStore: SupabaseIcon,
|
|
||||||
MongoDBAtlasVectorSearch: MongoDBIcon,
|
|
||||||
// UnstructuredPowerPointLoader: PowerPointIcon, // word and powerpoint have differente styles
|
|
||||||
Qdrant: QDrantIcon,
|
|
||||||
// ReadTheDocsLoader: ReadTheDocsIcon, // does not work
|
|
||||||
Searx: SearxIcon,
|
|
||||||
SlackDirectoryLoader: SlackIcon,
|
|
||||||
// Weaviate: WeaviateIcon, // does not work
|
|
||||||
// WikipediaAPIWrapper: WikipediaIcon,
|
|
||||||
// WolframAlphaQueryRun: WolframIcon,
|
|
||||||
// WolframAlphaAPIWrapper: WolframIcon,
|
|
||||||
// UnstructuredWordDocumentLoader: WordIcon, // word and powerpoint have differente styles
|
|
||||||
agents: RocketLaunchIcon,
|
|
||||||
chains: LinkIcon,
|
|
||||||
memories: CpuChipIcon,
|
|
||||||
llms: LightBulbIcon,
|
|
||||||
prompts: CommandLineIcon,
|
|
||||||
tools: WrenchIcon,
|
|
||||||
advanced: ComputerDesktopIcon,
|
|
||||||
chat: Bars3CenterLeftIcon,
|
|
||||||
embeddings: FingerPrintIcon,
|
|
||||||
documentloaders: PaperClipIcon,
|
|
||||||
vectorstores: CircleStackIcon,
|
|
||||||
toolkits: WrenchScrewdriverIcon,
|
|
||||||
textsplitters: ScissorsIcon,
|
|
||||||
wrappers: GiftIcon,
|
|
||||||
utilities: Squares2X2Icon,
|
|
||||||
unknown: QuestionMarkCircleIcon,
|
|
||||||
};
|
|
||||||
|
|
||||||
export const nodeIconsLucide: {
|
export const nodeIconsLucide: {
|
||||||
[char: string]: React.ForwardRefExoticComponent<
|
[char: string]: React.ForwardRefExoticComponent<
|
||||||
ComponentType<SVGProps<SVGSVGElement>>
|
ComponentType<SVGProps<SVGSVGElement>>
|
||||||
|
|
@ -363,6 +286,9 @@ export const nodeIconsLucide: {
|
||||||
utilities: Wand2 as React.ForwardRefExoticComponent<
|
utilities: Wand2 as React.ForwardRefExoticComponent<
|
||||||
ComponentType<SVGProps<SVGSVGElement>>
|
ComponentType<SVGProps<SVGSVGElement>>
|
||||||
>,
|
>,
|
||||||
|
retrievers: Search as React.ForwardRefExoticComponent<
|
||||||
|
ComponentType<SVGProps<SVGSVGElement>>
|
||||||
|
>,
|
||||||
unknown: HelpCircle as React.ForwardRefExoticComponent<
|
unknown: HelpCircle as React.ForwardRefExoticComponent<
|
||||||
ComponentType<SVGProps<SVGSVGElement>>
|
ComponentType<SVGProps<SVGSVGElement>>
|
||||||
>,
|
>,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue