Merge branch 'dev' into optional_deps

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-07-26 08:34:10 -03:00 committed by GitHub
commit 6f2165402a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
167 changed files with 9094 additions and 8187 deletions

49
.github/workflows/pre-release.yml vendored Normal file
View file

@ -0,0 +1,49 @@
name: pre-release
on:
pull_request:
types:
- closed
branches:
- dev
paths:
- "pyproject.toml"
env:
POETRY_VERSION: "1.5.1"
jobs:
if_release:
if: |
${{ github.event.pull_request.merged == true }}
&& ${{ contains(github.event.pull_request.labels.*.name, 'pre-release') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry==$POETRY_VERSION
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
- name: Build project for distribution
run: make build
- name: Check Version
id: check-version
run: |
echo version=$(poetry version --short) >> $GITHUB_OUTPUT
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
generateReleaseNotes: true
tag: v${{ steps.check-version.outputs.version }}
commit: main
- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry publish

View file

@ -10,7 +10,7 @@ on:
- "pyproject.toml"
env:
POETRY_VERSION: "1.4.0"
POETRY_VERSION: "1.5.1"
jobs:
if_release:

1551
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

5
package.json Normal file
View file

@ -0,0 +1,5 @@
{
"devDependencies": {
"@svgr/cli": "^8.0.1"
}
}

26
poetry.lock generated
View file

@ -2126,17 +2126,17 @@ setuptools = "*"
[[package]]
name = "gunicorn"
version = "20.1.0"
version = "21.2.0"
description = "WSGI HTTP Server for UNIX"
optional = false
python-versions = ">=3.5"
files = [
{file = "gunicorn-20.1.0-py3-none-any.whl", hash = "sha256:9dcc4547dbb1cb284accfb15ab5667a0e5d1881cc443e0677b4882a4067a807e"},
{file = "gunicorn-20.1.0.tar.gz", hash = "sha256:e0a968b5ba15f8a328fdfd7ab1fcb5af4470c28aaf7e55df02a99bc13138e6e8"},
{file = "gunicorn-21.2.0-py3-none-any.whl", hash = "sha256:3213aa5e8c24949e792bcacfc176fef362e7aac80b76c56f6b5122bf350722f0"},
{file = "gunicorn-21.2.0.tar.gz", hash = "sha256:88ec8bff1d634f98e61b9f65bc4bf3cd918a90806c6f5c48bc5603849ec81033"},
]
[package.dependencies]
setuptools = ">=3.0"
packaging = "*"
[package.extras]
eventlet = ["eventlet (>=0.24.1)"]
@ -2813,20 +2813,20 @@ testing = ["pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)",
[[package]]
name = "langchain"
version = "0.0.237"
version = "0.0.240"
description = "Building applications with LLMs through composability"
optional = false
python-versions = ">=3.8.1,<4.0"
files = [
{file = "langchain-0.0.237-py3-none-any.whl", hash = "sha256:8eed8ea374b3487387ab81e418a1b629d2475f7af884ad83ff7172dc93b580dd"},
{file = "langchain-0.0.237.tar.gz", hash = "sha256:186e2d99b4aac91c4d128234d6f206732c70a9688e9cc63863f23520746eefaf"},
{file = "langchain-0.0.240-py3-none-any.whl", hash = "sha256:110d68116b9bf4eff3aa342a3d6e521f841f9af22fcc02ed52699ada41a46b90"},
{file = "langchain-0.0.240.tar.gz", hash = "sha256:698669880d94498ce90f33b28222d46be6297c7b280a399612af7e7a5af39dd6"},
]
[package.dependencies]
aiohttp = ">=3.8.3,<4.0.0"
async-timeout = {version = ">=4.0.0,<5.0.0", markers = "python_version < \"3.11\""}
dataclasses-json = ">=0.5.7,<0.6.0"
langsmith = ">=0.0.10,<0.0.11"
langsmith = ">=0.0.11,<0.1.0"
numexpr = ">=2.8.4,<3.0.0"
numpy = ">=1,<2"
openapi-schema-pydantic = ">=1.2,<2.0"
@ -2837,13 +2837,13 @@ SQLAlchemy = ">=1.4,<3"
tenacity = ">=8.1.0,<9.0.0"
[package.extras]
all = ["O365 (>=2.0.26,<3.0.0)", "aleph-alpha-client (>=2.15.0,<3.0.0)", "anthropic (>=0.3,<0.4)", "arxiv (>=1.4,<2.0)", "atlassian-python-api (>=3.36.0,<4.0.0)", "awadb (>=0.3.3,<0.4.0)", "azure-ai-formrecognizer (>=3.2.1,<4.0.0)", "azure-ai-vision (>=0.11.1b1,<0.12.0)", "azure-cognitiveservices-speech (>=1.28.0,<2.0.0)", "azure-cosmos (>=4.4.0b1,<5.0.0)", "azure-identity (>=1.12.0,<2.0.0)", "beautifulsoup4 (>=4,<5)", "clarifai (>=9.1.0)", "clickhouse-connect (>=0.5.14,<0.6.0)", "cohere (>=3,<4)", "deeplake (>=3.6.8,<4.0.0)", "docarray[hnswlib] (>=0.32.0,<0.33.0)", "duckduckgo-search (>=3.8.3,<4.0.0)", "elasticsearch (>=8,<9)", "esprima (>=4.0.1,<5.0.0)", "faiss-cpu (>=1,<2)", "google-api-python-client (==2.70.0)", "google-auth (>=2.18.1,<3.0.0)", "google-search-results (>=2,<3)", "gptcache (>=0.1.7)", "html2text (>=2020.1.16,<2021.0.0)", "huggingface_hub (>=0,<1)", "jina (>=3.14,<4.0)", "jinja2 (>=3,<4)", "jq (>=1.4.1,<2.0.0)", "lancedb (>=0.1,<0.2)", "langkit (>=0.0.6,<0.1.0)", "lark (>=1.1.5,<2.0.0)", "libdeeplake (>=0.0.60,<0.0.61)", "lxml (>=4.9.2,<5.0.0)", "manifest-ml (>=0.0.1,<0.0.2)", "marqo (>=0.11.0,<0.12.0)", "momento (>=1.5.0,<2.0.0)", "nebula3-python (>=3.4.0,<4.0.0)", "neo4j (>=5.8.1,<6.0.0)", "networkx (>=2.6.3,<3.0.0)", "nlpcloud (>=1,<2)", "nltk (>=3,<4)", "nomic (>=1.0.43,<2.0.0)", "octoai-sdk (>=0.1.1,<0.2.0)", "openai (>=0,<1)", "openlm (>=0.0.5,<0.0.6)", "opensearch-py (>=2.0.0,<3.0.0)", "pdfminer-six (>=20221105,<20221106)", "pexpect (>=4.8.0,<5.0.0)", "pgvector (>=0.1.6,<0.2.0)", "pinecone-client (>=2,<3)", "pinecone-text (>=0.4.2,<0.5.0)", "psycopg2-binary (>=2.9.5,<3.0.0)", "pymongo (>=4.3.3,<5.0.0)", "pyowm (>=3.3.0,<4.0.0)", "pypdf (>=3.4.0,<4.0.0)", "pytesseract (>=0.3.10,<0.4.0)", "pyvespa (>=0.33.0,<0.34.0)", "qdrant-client (>=1.3.1,<2.0.0)", "rdflib (>=6.3.2,<7.0.0)", "redis (>=4,<5)", "requests-toolbelt (>=1.0.0,<2.0.0)", "sentence-transformers (>=2,<3)", "singlestoredb (>=0.7.1,<0.8.0)", "spacy (>=3,<4)", "steamship (>=2.16.9,<3.0.0)", "tensorflow-text (>=2.11.0,<3.0.0)", "tigrisdb (>=1.0.0b6,<2.0.0)", "tiktoken (>=0.3.2,<0.4.0)", "torch (>=1,<3)", "transformers (>=4,<5)", "weaviate-client (>=3,<4)", "wikipedia (>=1,<2)", "wolframalpha (==5.0.0)"]
all = ["O365 (>=2.0.26,<3.0.0)", "aleph-alpha-client (>=2.15.0,<3.0.0)", "amadeus (>=8.1.0)", "anthropic (>=0.3,<0.4)", "arxiv (>=1.4,<2.0)", "atlassian-python-api (>=3.36.0,<4.0.0)", "awadb (>=0.3.3,<0.4.0)", "azure-ai-formrecognizer (>=3.2.1,<4.0.0)", "azure-ai-vision (>=0.11.1b1,<0.12.0)", "azure-cognitiveservices-speech (>=1.28.0,<2.0.0)", "azure-cosmos (>=4.4.0b1,<5.0.0)", "azure-identity (>=1.12.0,<2.0.0)", "beautifulsoup4 (>=4,<5)", "clarifai (>=9.1.0)", "clickhouse-connect (>=0.5.14,<0.6.0)", "cohere (>=3,<4)", "deeplake (>=3.6.8,<4.0.0)", "docarray[hnswlib] (>=0.32.0,<0.33.0)", "duckduckgo-search (>=3.8.3,<4.0.0)", "elasticsearch (>=8,<9)", "esprima (>=4.0.1,<5.0.0)", "faiss-cpu (>=1,<2)", "google-api-python-client (==2.70.0)", "google-auth (>=2.18.1,<3.0.0)", "google-search-results (>=2,<3)", "gptcache (>=0.1.7)", "html2text (>=2020.1.16,<2021.0.0)", "huggingface_hub (>=0,<1)", "jina (>=3.14,<4.0)", "jinja2 (>=3,<4)", "jq (>=1.4.1,<2.0.0)", "lancedb (>=0.1,<0.2)", "langkit (>=0.0.6,<0.1.0)", "lark (>=1.1.5,<2.0.0)", "libdeeplake (>=0.0.60,<0.0.61)", "lxml (>=4.9.2,<5.0.0)", "manifest-ml (>=0.0.1,<0.0.2)", "marqo (>=0.11.0,<0.12.0)", "momento (>=1.5.0,<2.0.0)", "nebula3-python (>=3.4.0,<4.0.0)", "neo4j (>=5.8.1,<6.0.0)", "networkx (>=2.6.3,<3.0.0)", "nlpcloud (>=1,<2)", "nltk (>=3,<4)", "nomic (>=1.0.43,<2.0.0)", "octoai-sdk (>=0.1.1,<0.2.0)", "openai (>=0,<1)", "openlm (>=0.0.5,<0.0.6)", "opensearch-py (>=2.0.0,<3.0.0)", "pdfminer-six (>=20221105,<20221106)", "pexpect (>=4.8.0,<5.0.0)", "pgvector (>=0.1.6,<0.2.0)", "pinecone-client (>=2,<3)", "pinecone-text (>=0.4.2,<0.5.0)", "psycopg2-binary (>=2.9.5,<3.0.0)", "pymongo (>=4.3.3,<5.0.0)", "pyowm (>=3.3.0,<4.0.0)", "pypdf (>=3.4.0,<4.0.0)", "pytesseract (>=0.3.10,<0.4.0)", "pyvespa (>=0.33.0,<0.34.0)", "qdrant-client (>=1.3.1,<2.0.0)", "rdflib (>=6.3.2,<7.0.0)", "redis (>=4,<5)", "requests-toolbelt (>=1.0.0,<2.0.0)", "sentence-transformers (>=2,<3)", "singlestoredb (>=0.7.1,<0.8.0)", "spacy (>=3,<4)", "steamship (>=2.16.9,<3.0.0)", "tensorflow-text (>=2.11.0,<3.0.0)", "tigrisdb (>=1.0.0b6,<2.0.0)", "tiktoken (>=0.3.2,<0.4.0)", "torch (>=1,<3)", "transformers (>=4,<5)", "weaviate-client (>=3,<4)", "wikipedia (>=1,<2)", "wolframalpha (==5.0.0)"]
azure = ["azure-ai-formrecognizer (>=3.2.1,<4.0.0)", "azure-ai-vision (>=0.11.1b1,<0.12.0)", "azure-cognitiveservices-speech (>=1.28.0,<2.0.0)", "azure-core (>=1.26.4,<2.0.0)", "azure-cosmos (>=4.4.0b1,<5.0.0)", "azure-identity (>=1.12.0,<2.0.0)", "azure-search-documents (==11.4.0a20230509004)", "openai (>=0,<1)"]
clarifai = ["clarifai (>=9.1.0)"]
cohere = ["cohere (>=3,<4)"]
docarray = ["docarray[hnswlib] (>=0.32.0,<0.33.0)"]
embeddings = ["sentence-transformers (>=2,<3)"]
extended-testing = ["atlassian-python-api (>=3.36.0,<4.0.0)", "beautifulsoup4 (>=4,<5)", "bibtexparser (>=1.4.0,<2.0.0)", "cassio (>=0.0.7,<0.0.8)", "chardet (>=5.1.0,<6.0.0)", "esprima (>=4.0.1,<5.0.0)", "gql (>=3.4.1,<4.0.0)", "html2text (>=2020.1.16,<2021.0.0)", "jq (>=1.4.1,<2.0.0)", "lxml (>=4.9.2,<5.0.0)", "mwparserfromhell (>=0.6.4,<0.7.0)", "mwxml (>=0.3.3,<0.4.0)", "openai (>=0,<1)", "pandas (>=2.0.1,<3.0.0)", "pdfminer-six (>=20221105,<20221106)", "pgvector (>=0.1.6,<0.2.0)", "psychicapi (>=0.8.0,<0.9.0)", "py-trello (>=0.19.0,<0.20.0)", "pymupdf (>=1.22.3,<2.0.0)", "pypdf (>=3.4.0,<4.0.0)", "pypdfium2 (>=4.10.0,<5.0.0)", "pyspark (>=3.4.0,<4.0.0)", "rank-bm25 (>=0.2.2,<0.3.0)", "rapidfuzz (>=3.1.1,<4.0.0)", "requests-toolbelt (>=1.0.0,<2.0.0)", "scikit-learn (>=1.2.2,<2.0.0)", "streamlit (>=1.18.0,<2.0.0)", "sympy (>=1.12,<2.0)", "telethon (>=1.28.5,<2.0.0)", "tqdm (>=4.48.0)", "zep-python (>=0.32)"]
extended-testing = ["atlassian-python-api (>=3.36.0,<4.0.0)", "beautifulsoup4 (>=4,<5)", "bibtexparser (>=1.4.0,<2.0.0)", "cassio (>=0.0.7,<0.0.8)", "chardet (>=5.1.0,<6.0.0)", "esprima (>=4.0.1,<5.0.0)", "geopandas (>=0.13.1,<0.14.0)", "gql (>=3.4.1,<4.0.0)", "html2text (>=2020.1.16,<2021.0.0)", "jinja2 (>=3,<4)", "jq (>=1.4.1,<2.0.0)", "lxml (>=4.9.2,<5.0.0)", "mwparserfromhell (>=0.6.4,<0.7.0)", "mwxml (>=0.3.3,<0.4.0)", "openai (>=0,<1)", "pandas (>=2.0.1,<3.0.0)", "pdfminer-six (>=20221105,<20221106)", "pgvector (>=0.1.6,<0.2.0)", "psychicapi (>=0.8.0,<0.9.0)", "py-trello (>=0.19.0,<0.20.0)", "pymupdf (>=1.22.3,<2.0.0)", "pypdf (>=3.4.0,<4.0.0)", "pypdfium2 (>=4.10.0,<5.0.0)", "pyspark (>=3.4.0,<4.0.0)", "rank-bm25 (>=0.2.2,<0.3.0)", "rapidfuzz (>=3.1.1,<4.0.0)", "requests-toolbelt (>=1.0.0,<2.0.0)", "scikit-learn (>=1.2.2,<2.0.0)", "streamlit (>=1.18.0,<2.0.0)", "sympy (>=1.12,<2.0)", "telethon (>=1.28.5,<2.0.0)", "tqdm (>=4.48.0)", "zep-python (>=0.32)"]
javascript = ["esprima (>=4.0.1,<5.0.0)"]
llms = ["anthropic (>=0.3,<0.4)", "clarifai (>=9.1.0)", "cohere (>=3,<4)", "huggingface_hub (>=0,<1)", "manifest-ml (>=0.0.1,<0.0.2)", "nlpcloud (>=1,<2)", "openai (>=0,<1)", "openllm (>=0.1.19)", "openlm (>=0.0.5,<0.0.6)", "torch (>=1,<3)", "transformers (>=4,<5)"]
openai = ["openai (>=0,<1)", "tiktoken (>=0.3.2,<0.4.0)"]
@ -2877,13 +2877,13 @@ test = ["psutil", "pytest", "pytest-asyncio"]
[[package]]
name = "langsmith"
version = "0.0.10"
version = "0.0.14"
description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform."
optional = false
python-versions = ">=3.8.1,<4.0"
files = [
{file = "langsmith-0.0.10-py3-none-any.whl", hash = "sha256:716412979613a5eb550c9bce33165cd1bad296eb19009040155deccef427ef07"},
{file = "langsmith-0.0.10.tar.gz", hash = "sha256:11e5db0d8e29ee5583cabd872eeece8ce50738737b1f52f316ac984f4a1a58c5"},
{file = "langsmith-0.0.14-py3-none-any.whl", hash = "sha256:d3c367fa72b88a226919e6c902e34d83791efd1250f284e84cf17eacc37558b9"},
{file = "langsmith-0.0.14.tar.gz", hash = "sha256:146379f4ed8a7a28794c52b74009d40875371080a16a87bba95c410160b00b92"},
]
[package.dependencies]

View file

@ -32,8 +32,8 @@ beautifulsoup4 = "^4.12.2"
google-search-results = "^2.4.1"
google-api-python-client = "^2.79.0"
typer = "^0.9.0"
gunicorn = "^20.1.0"
langchain = "^0.0.237"
gunicorn = "^21.1.0"
langchain = "^0.0.240"
openai = "^0.27.8"
pandas = "^2.0.0"
chromadb = "^0.3.21"

File diff suppressed because it is too large Load diff

View file

@ -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",

View file

@ -1,10 +1,11 @@
import { Info } from "lucide-react";
import { cloneDeep } from "lodash";
import React, { useContext, useEffect, useRef, useState } from "react";
import { Handle, Position, useUpdateNodeInternals } from "reactflow";
import ShadTooltip from "../../../../components/ShadTooltipComponent";
import CodeAreaComponent from "../../../../components/codeAreaComponent";
import Dropdown from "../../../../components/dropdownComponent";
import FloatComponent from "../../../../components/floatComponent";
import IconComponent from "../../../../components/genericIconComponent";
import InputComponent from "../../../../components/inputComponent";
import InputFileComponent from "../../../../components/inputFileComponent";
import InputListComponent from "../../../../components/inputListComponent";
@ -12,26 +13,27 @@ import IntComponent from "../../../../components/intComponent";
import PromptAreaComponent from "../../../../components/promptComponent";
import TextAreaComponent from "../../../../components/textAreaComponent";
import ToggleShadComponent from "../../../../components/toggleShadComponent";
import { MAX_LENGTH_TO_SCROLL_TOOLTIP } from "../../../../constants";
import { PopUpContext } from "../../../../contexts/popUpContext";
import { MAX_LENGTH_TO_SCROLL_TOOLTIP } from "../../../../constants/constants";
import { TabsContext } from "../../../../contexts/tabsContext";
import { typesContext } from "../../../../contexts/typesContext";
import { ParameterComponentType } from "../../../../types/components";
import { cleanEdges } from "../../../../util/reactflowUtils";
import { isValidConnection } from "../../../../utils/reactflowUtils";
import {
nodeColors,
nodeIconsLucide,
nodeNames,
} from "../../../../utils/styleUtils";
import {
classNames,
getRandomKeyByssmm,
groupByFamily,
isValidConnection,
nodeColors,
nodeIconsLucide,
nodeNames,
} from "../../../../utils";
} from "../../../../utils/utils";
export default function ParameterComponent({
left,
id,
data,
setData,
tooltipTitle,
title,
color,
@ -47,9 +49,9 @@ export default function ParameterComponent({
const infoHtml = useRef(null);
const updateNodeInternals = useUpdateNodeInternals();
const [position, setPosition] = useState(0);
const { closePopUp } = useContext(PopUpContext);
const { setTabsState, tabId, save } = useContext(TabsContext);
// Update component position
useEffect(() => {
if (ref.current && ref.current.offsetTop && ref.current.clientHeight) {
setPosition(ref.current.offsetTop + ref.current.clientHeight / 2);
@ -61,15 +63,16 @@ export default function ParameterComponent({
updateNodeInternals(data.id);
}, [data.id, position, updateNodeInternals]);
useEffect(() => {}, [closePopUp, data.node.template]);
const { reactFlowInstance } = useContext(typesContext);
let disabled =
reactFlowInstance?.getEdges().some((e) => e.targetHandle === id) ?? false;
const [myData, setMyData] = useState(useContext(typesContext).data);
const { data: myData } = useContext(typesContext);
const handleOnNewValue = (newValue: any) => {
data.node.template[name].value = newValue;
let newData = cloneDeep(data);
newData.node.template[name].value = newValue;
setData(newData);
// Set state to pending
setTabsState((prev) => {
return {
@ -83,6 +86,7 @@ export default function ParameterComponent({
};
useEffect(() => {
if (name === "openai_api_base") console.log(info);
infoHtml.current = (
<div className="h-full w-full break-words">
{info.split("\n").map((line, i) => (
@ -145,7 +149,6 @@ export default function ParameterComponent({
);
});
}, [tooltipTitle]);
return (
<div
ref={ref}
@ -164,7 +167,13 @@ export default function ParameterComponent({
<div className="">
{info !== "" && (
<ShadTooltip content={infoHtml.current}>
<Info className="relative bottom-0.5 ml-2 h-3 w-3" />
{/* put div to avoid bug that does not display tooltip */}
<div>
<IconComponent
name="Info"
className="relative bottom-0.5 ml-2 h-3 w-4"
/>
</div>
</ShadTooltip>
)}
</div>
@ -233,7 +242,6 @@ export default function ParameterComponent({
) : (
<InputComponent
disabled={disabled}
disableCopyPaste={true}
password={data.node.template[name].password ?? false}
value={data.node.template[name].value ?? ""}
onChange={handleOnNewValue}
@ -255,7 +263,6 @@ export default function ParameterComponent({
<div className="mt-2 w-full">
<FloatComponent
disabled={disabled}
disableCopyPaste={true}
value={data.node.template[name].value ?? ""}
onChange={handleOnNewValue}
/>
@ -300,7 +307,6 @@ export default function ParameterComponent({
<div className="mt-2 w-full">
<IntComponent
disabled={disabled}
disableCopyPaste={true}
value={data.node.template[name].value ?? ""}
onChange={handleOnNewValue}
/>
@ -311,15 +317,6 @@ export default function ParameterComponent({
field_name={name}
setNodeClass={(nodeClass) => {
data.node = nodeClass;
if (reactFlowInstance) {
cleanEdges({
flow: {
edges: reactFlowInstance.getEdges(),
nodes: reactFlowInstance.getNodes(),
},
updateEdge: (edge) => reactFlowInstance.setEdges(edge),
});
}
}}
nodeClass={data.node}
disabled={disabled}

View file

@ -1,48 +1,60 @@
import { Zap } from "lucide-react";
import { cloneDeep } from "lodash";
import { useContext, useEffect, useRef, useState } from "react";
import { NodeToolbar } from "reactflow";
import { NodeToolbar, useUpdateNodeInternals } from "reactflow";
import ShadTooltip from "../../components/ShadTooltipComponent";
import Tooltip from "../../components/TooltipComponent";
import IconComponent from "../../components/genericIconComponent";
import { useSSE } from "../../contexts/SSEContext";
import { alertContext } from "../../contexts/alertContext";
import { PopUpContext } from "../../contexts/popUpContext";
import { TabsContext } from "../../contexts/tabsContext";
import { typesContext } from "../../contexts/typesContext";
import NodeModal from "../../modals/NodeModal";
import NodeToolbarComponent from "../../pages/FlowPage/components/nodeToolbarComponent";
import { NodeDataType } from "../../types/flow";
import {
classNames,
nodeColors,
nodeIconsLucide,
toTitleCase,
} from "../../utils";
import { cleanEdges } from "../../utils/reactflowUtils";
import { nodeColors, nodeIconsLucide } from "../../utils/styleUtils";
import { classNames, toTitleCase } from "../../utils/utils";
import ParameterComponent from "./components/parameterComponent";
export default function GenericNode({
data,
data: olddata,
selected,
}: {
data: NodeDataType;
selected: boolean;
}) {
const [data, setData] = useState(olddata);
const { setErrorData } = useContext(alertContext);
const { updateFlow, flows, tabId } = useContext(TabsContext);
const updateNodeInternals = useUpdateNodeInternals();
const showError = useRef(true);
const { types, deleteNode } = useContext(typesContext);
const { closePopUp, openPopUp } = useContext(PopUpContext);
const { types, deleteNode, reactFlowInstance } = useContext(typesContext);
// any to avoid type conflict
const Icon: any =
nodeIconsLucide[data.type] || nodeIconsLucide[types[data.type]];
const name = nodeIconsLucide[data.type] ? data.type : types[data.type];
const [validationStatus, setValidationStatus] = useState(null);
// State for outline color
const { sseData, isBuilding } = useSSE();
const refHtml = useRef(null);
// useEffect(() => {
// if (reactFlowInstance) {
// setParams(Object.values(reactFlowInstance.toObject()));
// }
// }, [save]);
useEffect(() => {
olddata.node = data.node;
let myFlow = flows.find((flow) => flow.id === tabId);
if (reactFlowInstance && myFlow) {
let flow = cloneDeep(myFlow);
flow.data = reactFlowInstance.toObject();
cleanEdges({
flow: {
edges: flow.data.edges,
nodes: flow.data.nodes,
},
updateEdge: (edge) => {
flow.data.edges = edge;
reactFlowInstance.setEdges(edge);
updateNodeInternals(data.id);
},
});
updateFlow(flow);
}
}, [data]);
// New useEffect to watch for changes in sseData and update validation status
useEffect(() => {
@ -67,13 +79,12 @@ export default function GenericNode({
deleteNode(data.id);
return;
}
useEffect(() => {}, [closePopUp, data.node.template]);
return (
<>
<NodeToolbar>
<NodeToolbarComponent
data={data}
openPopUp={openPopUp}
setData={setData}
deleteNode={deleteNode}
></NodeToolbarComponent>
</NodeToolbar>
@ -86,12 +97,10 @@ export default function GenericNode({
>
<div className="generic-node-div-title">
<div className="generic-node-title-arrangement">
<Icon
strokeWidth={1.5}
<IconComponent
name={name}
className="generic-node-icon"
style={{
color: nodeColors[types[data.type]] ?? nodeColors.unknown,
}}
iconColor={`${nodeColors[types[data.type]]}`}
/>
<div className="generic-node-tooltip-div">
<ShadTooltip content={data.node.display_name}>
@ -101,15 +110,6 @@ export default function GenericNode({
</ShadTooltip>
</div>
</div>
<div className="round-button-div">
<button
className="relative"
onClick={(event) => {
event.preventDefault();
openPopUp(<NodeModal data={data} />);
}}
></button>
</div>
<div className="round-button-div">
<div>
<Tooltip
@ -119,9 +119,9 @@ export default function GenericNode({
) : !validationStatus ? (
<span className="flex">
Build{" "}
<Zap
<IconComponent
name="Zap"
className="mx-0.5 h-5 fill-build-trigger stroke-build-trigger stroke-1"
strokeWidth={1.5}
/>{" "}
flow to validate status.
</span>
@ -175,29 +175,11 @@ export default function GenericNode({
.filter((t) => t.charAt(0) !== "_")
.map((t: string, idx) => (
<div key={idx}>
{/* {idx === 0 ? (
<div
className={classNames(
"px-5 py-2 mt-2 text-center",
Object.keys(data.node.template).filter(
(key) =>
!key.startsWith("_") &&
data.node.template[key].show &&
!data.node.template[key].advanced
).length === 0
? "hidden"
: ""
)}
>
Inputs
</div>
) : (
<></>
)} */}
{data.node.template[t].show &&
!data.node.template[t].advanced ? (
<ParameterComponent
data={data}
setData={setData}
color={
nodeColors[types[data.node.template[t].type]] ??
nodeColors[data.node.template[t].type] ??
@ -242,11 +224,9 @@ export default function GenericNode({
>
{" "}
</div>
{/* <div className="px-5 py-2 mt-2 text-center">
Output
</div> */}
<ParameterComponent
data={data}
setData={setData}
color={nodeColors[types[data.type]] ?? nodeColors.unknown}
title={
data.node.output_types && data.node.output_types.length > 0

View file

@ -1,7 +1,7 @@
import { Transition } from "@headlessui/react";
import { CheckCircle2, Info, X, XCircle } from "lucide-react";
import { useState } from "react";
import { Link } from "react-router-dom";
import IconComponent from "../../../../components/genericIconComponent";
import { SingleAlertComponentType } from "../../../../types/alerts";
export default function SingleAlert({
@ -29,7 +29,11 @@ export default function SingleAlert({
key={dropItem.id}
>
<div className="flex-shrink-0">
<XCircle className="h-5 w-5 text-status-red" aria-hidden="true" />
<IconComponent
name="XCircle"
className="h-5 w-5 text-status-red"
aria-hidden="true"
/>
</div>
<div className="ml-3">
<h3 className="break-words text-sm font-medium text-error-foreground">
@ -62,7 +66,8 @@ export default function SingleAlert({
className="inline-flex rounded-md p-1.5 text-status-red"
>
<span className="sr-only">Dismiss</span>
<X
<IconComponent
name="X"
className="h-4 w-4 text-error-foreground"
aria-hidden="true"
/>
@ -76,7 +81,11 @@ export default function SingleAlert({
key={dropItem.id}
>
<div className="flex-shrink-0">
<Info className="h-5 w-5 text-status-blue " aria-hidden="true" />
<IconComponent
name="Info"
className="h-5 w-5 text-status-blue "
aria-hidden="true"
/>
</div>
<div className="ml-3 flex-1 md:flex md:justify-between">
<p className="text-sm font-medium text-info-foreground">
@ -108,7 +117,8 @@ export default function SingleAlert({
className="inline-flex rounded-md p-1.5 text-info-foreground"
>
<span className="sr-only">Dismiss</span>
<X
<IconComponent
name="X"
className="h-4 w-4 text-info-foreground"
aria-hidden="true"
/>
@ -122,7 +132,8 @@ export default function SingleAlert({
key={dropItem.id}
>
<div className="flex-shrink-0">
<CheckCircle2
<IconComponent
name="CheckCircle2"
className="h-5 w-5 text-status-green"
aria-hidden="true"
/>
@ -145,7 +156,8 @@ export default function SingleAlert({
className="inline-flex rounded-md p-1.5 text-status-green"
>
<span className="sr-only">Dismiss</span>
<X
<IconComponent
name="X"
className="h-4 w-4 text-success-foreground"
aria-hidden="true"
/>

View file

@ -1,66 +1,72 @@
import { Trash2, X } from "lucide-react";
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<HTMLDivElement>(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 (
<div
ref={componentRef}
className="z-10 flex h-[500px] w-[400px] flex-col overflow-hidden rounded-md bg-muted px-2 py-3 pb-4 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
<Popover
open={open}
onOpenChange={(k) => {
setOpen(k);
if (k) setNotificationCenter(false);
}}
>
<div className="text-md flex flex-row justify-between pl-3 font-medium text-foreground">
Notifications
<div className="flex gap-3 pr-3 ">
<button
className="text-foreground hover:text-status-red"
onClick={() => {
closePopUp();
setTimeout(clearNotificationList, 100);
}}
>
<Trash2 className="h-[1.1rem] w-[1.1rem]" />
</button>
<button
className="text-foreground hover:text-status-red"
onClick={closePopUp}
>
<X className="h-5 w-5" />
</button>
</div>
</div>
<div className="text-high-foreground mt-3 flex h-full w-full flex-col overflow-y-scroll scrollbar-hide">
{notificationList.length !== 0 ? (
notificationList.map((alertItem, index) => (
<SingleAlert
key={alertItem.id}
dropItem={alertItem}
removeAlert={removeFromNotificationList}
/>
))
) : (
<div className="flex h-full w-full items-center justify-center pb-16 text-ring">
No new notifications
<PopoverTrigger>{children}</PopoverTrigger>
<PopoverContent className="flex h-[500px] w-[500px] flex-col">
<div className="text-md flex flex-row justify-between pl-3 font-medium text-foreground">
Notifications
<div className="flex gap-3 pr-3 ">
<button
className="text-foreground hover:text-status-red"
onClick={() => {
setOpen(false);
setTimeout(clearNotificationList, 100);
}}
>
<IconComponent name="Trash2" className="h-[1.1rem] w-[1.1rem]" />
</button>
<button
className="text-foreground hover:text-status-red"
onClick={() => {
setOpen(false);
}}
>
<IconComponent name="X" className="h-5 w-5" />
</button>
</div>
)}
</div>
</div>
</div>
<div className="text-high-foreground mt-3 flex h-full w-full flex-col overflow-y-scroll scrollbar-hide">
{notificationList.length !== 0 ? (
notificationList.map((alertItem, index) => (
<SingleAlert
key={alertItem.id}
dropItem={alertItem}
removeAlert={removeFromNotificationList}
/>
))
) : (
<div className="flex h-full w-full items-center justify-center pb-16 text-ring">
No new notifications
</div>
)}
</div>
</PopoverContent>
</Popover>
);
}

View file

@ -1,6 +1,6 @@
import { Transition } from "@headlessui/react";
import { XCircle } from "lucide-react";
import { useEffect, useState } from "react";
import IconComponent from "../../components/genericIconComponent";
import { ErrorAlertType } from "../../types/alerts";
export default function ErrorAlert({
@ -44,7 +44,8 @@ export default function ErrorAlert({
>
<div className="flex">
<div className="flex-shrink-0">
<XCircle
<IconComponent
name="XCircle"
className="error-build-message-circle"
aria-hidden="true"
/>

View file

@ -1,7 +1,7 @@
import { Transition } from "@headlessui/react";
import { Info } from "lucide-react";
import { useEffect, useState } from "react";
import { Link } from "react-router-dom";
import IconComponent from "../../components/genericIconComponent";
import { NoticeAlertType } from "../../types/alerts";
export default function NoticeAlert({
@ -40,7 +40,11 @@ export default function NoticeAlert({
>
<div className="flex">
<div className="flex-shrink-0">
<Info className="h-5 w-5 text-status-blue " aria-hidden="true" />
<IconComponent
name="Info"
className="h-5 w-5 text-status-blue "
aria-hidden="true"
/>
</div>
<div className="ml-3 flex-1 md:flex md:justify-between">
<p className="text-sm text-info-foreground">{title}</p>

View file

@ -1,6 +1,6 @@
import { Transition } from "@headlessui/react";
import { CheckCircle2 } from "lucide-react";
import { useEffect, useState } from "react";
import IconComponent from "../../components/genericIconComponent";
import { SuccessAlertType } from "../../types/alerts";
export default function SuccessAlert({
@ -38,7 +38,11 @@ export default function SuccessAlert({
>
<div className="flex">
<div className="flex-shrink-0">
<CheckCircle2 className="success-alert-icon" aria-hidden="true" />
<IconComponent
name="CheckCircle2"
className="success-alert-icon"
aria-hidden="true"
/>
</div>
<div className="ml-3">
<p className="success-alert-message">{title}</p>

View file

@ -11,6 +11,7 @@ export default function AccordionComponent({
trigger,
children,
open = [],
keyValue,
}: AccordionComponentType) {
const [value, setValue] = useState(
open.length === 0 ? "" : getOpenAccordion()
@ -28,13 +29,18 @@ export default function AccordionComponent({
}
function handleClick() {
value == "" ? setValue(trigger) : setValue("");
value === "" ? setValue(keyValue) : setValue("");
}
return (
<>
<Accordion type="single" value={value} onValueChange={setValue}>
<AccordionItem value={trigger} className="border-none">
<Accordion
type="single"
className="w-full"
value={value}
onValueChange={setValue}
>
<AccordionItem value={keyValue} className="border-b">
<AccordionTrigger
onClick={() => {
handleClick();
@ -43,7 +49,9 @@ export default function AccordionComponent({
>
{trigger}
</AccordionTrigger>
<AccordionContent>{children}</AccordionContent>
<AccordionContent className="AccordionContent">
{children}
</AccordionContent>
</AccordionItem>
</Accordion>
</>

View file

@ -7,7 +7,7 @@ type InputProps = {
name: string | null;
description: string | null;
maxLength?: number;
flows: Array<{ id: string; name: string }>;
flows: Array<{ id: string; name: string; description: string }>;
tabId: string;
setName: (name: string) => void;
setDescription: (description: string) => void;
@ -37,7 +37,13 @@ export const EditFlowSettings: React.FC<InputProps> = ({
setName(value);
};
const [desc, setDesc] = useState(
flows.find((f) => f.id === tabId).description
);
const handleDescriptionChange = (event: ChangeEvent<HTMLTextAreaElement>) => {
flows.find((f) => f.id === tabId).description = event.target.value;
setDesc(flows.find((f) => f.id === tabId).description);
setDescription(event.target.value);
};
@ -51,7 +57,7 @@ export const EditFlowSettings: React.FC<InputProps> = ({
)}
</div>
<Input
className="mt-2 font-normal"
className="nopan nodrag noundo nocopy mt-2 font-normal"
onChange={handleNameChange}
type="text"
name="name"
@ -62,12 +68,15 @@ export const EditFlowSettings: React.FC<InputProps> = ({
/>
</Label>
<Label>
<span className="font-medium">Description (optional)</span>
<div className="edit-flow-arrangement mt-3">
<span className="font-medium ">Description (optional)</span>
</div>
<Textarea
name="description"
id="description"
onChange={handleDescriptionChange}
value={description ?? ""}
value={desc}
placeholder="Flow description"
className="mt-2 max-h-[100px] font-normal"
rows={3}

View file

@ -1,117 +0,0 @@
import { Disclosure } from "@headlessui/react";
import { useContext } from "react";
import { Link } from "react-router-dom";
import { locationContext } from "../../contexts/locationContext";
import { classNames } from "../../utils";
export default function ExtraSidebar() {
const {
current,
isStackedOpen,
setIsStackedOpen,
extraNavigation,
extraComponent,
} = useContext(locationContext);
return (
<>
<aside
className={` ${isStackedOpen ? "w-52" : "w-0 "} unused-side-bar-aside`}
>
<div className="unused-side-bar-arrangement">
<div className="unused-side-bar-division">
{extraNavigation.options ? (
<div className="p-4">
<nav className="unused-side-bar-nav">
{extraNavigation.options.map((item) =>
!item.children ? (
<div key={item.name}>
<Link
to={item.href}
className={classNames(
item.href.split("/")[2] === current[4]
? "unused-side-bar-link-colors-true"
: "unused-side-bar-link-colors-false",
"unused-side-bar-link"
)}
>
<item.icon
className={classNames(
item.href.split("/")[2] === current[4]
? "text-ring"
: "unused-side-bar-icon-false",
"unused-side-bar-icon"
)}
/>
{item.name}
</Link>
</div>
) : (
<Disclosure
as="div"
key={item.name}
className="space-y-1"
>
{({ open }) => (
<>
<Disclosure.Button
className={classNames(
item.href.split("/")[2] === current[4]
? "unused-side-bar-link-colors-true"
: "unused-side-bar-link-colors-false",
"unused-side-bar-disclosure"
)}
>
<item.icon
className="unused-side-bar-disclosure-icon"
aria-hidden="true"
/>
<span className="flex-1">{item.name}</span>
<svg
className={classNames(
open
? "unused-side-bar-svg-true"
: "text-ring",
"unused-side-bar-svg"
)}
viewBox="0 0 20 20"
aria-hidden="true"
>
<path
d="M6 6L14 10L6 14V6Z"
fill="currentColor"
/>
</svg>
</Disclosure.Button>
<Disclosure.Panel className="space-y-1">
{item.children.map((subItem) => (
<Link
key={subItem.name}
to={subItem.href}
className={classNames(
subItem.href.split("/")[3] === current[5]
? "unused-side-bar-link-colors-true"
: "unused-side-bar-link-colors-false",
"unused-side-bar-disclosure-panel"
)}
>
{subItem.name}
</Link>
))}
</Disclosure.Panel>
</>
)}
</Disclosure>
)
)}
</nav>
</div>
) : (
extraComponent
)}
</div>
</div>
</aside>
</>
);
}

View file

@ -3,7 +3,7 @@ import type { FC } from "react";
import React from "react";
import { Tooltip as ReactTooltip } from "react-tooltip";
import "react-tooltip/dist/react-tooltip.css";
import { classNames } from "../../utils";
import { classNames } from "../../utils/utils";
type TooltipProps = {
selector: string;

View file

@ -1,8 +1,8 @@
import { Trash2 } from "lucide-react";
import { useContext } from "react";
import { TabsContext } from "../../contexts/tabsContext";
import { FlowType } from "../../types/flow";
import { gradients } from "../../utils";
import { gradients } from "../../utils/styleUtils";
import IconComponent from "../genericIconComponent";
import {
Card,
CardDescription,
@ -37,7 +37,10 @@ export const CardComponent = ({
<span className="card-component-title-size">{flow.name}</span>
{onDelete && (
<button className="card-component-delete-button" onClick={onDelete}>
<Trash2 className="card-component-delete-icon" />
<IconComponent
name="Trash2"
className="card-component-delete-icon"
/>
</button>
)}
</CardTitle>
@ -51,15 +54,7 @@ export const CardComponent = ({
<CardFooter>
<div className="card-component-footer-arrangement">
<div className="card-component-footer">
{/* <Badge variant="secondary">Agent</Badge>
<Badge variant="secondary">
<div className="w-3">
<OpenAiIcon />
</div>
<span className="text-base">&nbsp;</span>OpenAI+
</Badge> */}
</div>
<div className="card-component-footer"></div>
{button && button}
</div>
</CardFooter>

View file

@ -1,5 +1,4 @@
import { Transition } from "@headlessui/react";
import { Zap } from "lucide-react";
import { useContext, useState } from "react";
import Loading from "../../../components/ui/loading";
import { useSSE } from "../../../contexts/SSEContext";
@ -7,10 +6,11 @@ import { alertContext } from "../../../contexts/alertContext";
import { typesContext } from "../../../contexts/typesContext";
import { postBuildInit } from "../../../controllers/API";
import { FlowType } from "../../../types/flow";
import { validateNodes } from "../../../utils";
import { TabsContext } from "../../../contexts/tabsContext";
import { validateNodes } from "../../../utils/reactflowUtils";
import RadialProgressComponent from "../../RadialProgress";
import IconComponent from "../../genericIconComponent";
export default function BuildTrigger({
open,
@ -190,8 +190,8 @@ export default function BuildTrigger({
className="build-trigger-loading-icon"
/>
) : (
<Zap
strokeWidth={1.5}
<IconComponent
name="Zap"
className="sh-6 w-6 fill-build-trigger stroke-build-trigger stroke-1"
/>
)}

View file

@ -1,5 +1,4 @@
import { Transition } from "@headlessui/react";
import { MessagesSquare } from "lucide-react";
import { useContext } from "react";
import {
@ -7,8 +6,9 @@ import {
CHAT_CANNOT_OPEN_TITLE,
FLOW_NOT_BUILT_DESCRIPTION,
FLOW_NOT_BUILT_TITLE,
} from "../../../constants";
} from "../../../constants/constants";
import { alertContext } from "../../../contexts/alertContext";
import IconComponent from "../../genericIconComponent";
export default function ChatTrigger({ open, setOpen, isBuilt, canOpen }) {
const { setErrorData } = useContext(alertContext);
@ -50,15 +50,14 @@ export default function ChatTrigger({ open, setOpen, isBuilt, canOpen }) {
}
>
<div className="flex gap-3">
<MessagesSquare
<IconComponent
name="MessagesSquare"
className={
"h-6 w-6 transition-all " +
(isBuilt && canOpen
? "message-button-icon"
: "disabled-message-button-icon")
}
style={{ color: "white" }}
strokeWidth={1.5}
/>
</div>
</button>

View file

@ -1,9 +1,8 @@
import { useContext, useEffect, useState } from "react";
import { PopUpContext } from "../../contexts/popUpContext";
import { useEffect, useState } from "react";
import CodeAreaModal from "../../modals/codeAreaModal";
import { TextAreaComponentType } from "../../types/components";
import { ExternalLink } from "lucide-react";
import IconComponent from "../genericIconComponent";
export default function CodeAreaComponent({
value,
@ -16,7 +15,6 @@ export default function CodeAreaComponent({
const [myValue, setMyValue] = useState(
typeof value == "string" ? value : JSON.stringify(value)
);
const { openPopUp } = useContext(PopUpContext);
useEffect(() => {
if (disabled) {
setMyValue("");
@ -30,56 +28,37 @@ export default function CodeAreaComponent({
return (
<div className={disabled ? "pointer-events-none w-full " : " w-full"}>
<div className="flex w-full items-center">
<span
onClick={() => {
openPopUp(
<CodeAreaModal
value={myValue}
nodeClass={nodeClass}
setNodeClass={setNodeClass}
setValue={(t: string) => {
setMyValue(t);
onChange(t);
}}
/>
);
}}
className={
editNode
? "input-edit-node input-dialog"
: (disabled ? " input-disable input-ring " : "") +
" input-primary text-muted-foreground "
}
>
{myValue !== "" ? myValue : "Type something..."}
</span>
<button
onClick={() => {
openPopUp(
<CodeAreaModal
setNodeClass={setNodeClass}
value={myValue}
nodeClass={nodeClass}
setValue={(t: string) => {
setMyValue(t);
onChange(t);
}}
/>
);
}}
>
<CodeAreaModal
value={myValue}
nodeClass={nodeClass}
setNodeClass={setNodeClass}
setValue={(t: string) => {
setMyValue(t);
onChange(t);
}}
>
<div className="flex w-full items-center">
<span
className={
editNode
? "input-edit-node input-dialog"
: (disabled ? " input-disable input-ring " : "") +
" input-primary text-muted-foreground "
}
>
{myValue !== "" ? myValue : "Type something..."}
</span>
{!editNode && (
<ExternalLink
strokeWidth={1.5}
<IconComponent
name="ExternalLink"
className={
"icons-parameters-comp" +
(disabled ? " text-ring" : " hover:text-accent-foreground")
}
/>
)}
</button>
</div>
</div>
</CodeAreaModal>
</div>
);
}

View file

@ -0,0 +1,667 @@
import { cloneDeep } from "lodash";
import { useContext, useEffect, useState } from "react";
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { oneDark } from "react-syntax-highlighter/dist/cjs/styles/prism";
import AccordionComponent from "../../components/AccordionComponent";
import ShadTooltip from "../../components/ShadTooltipComponent";
import CodeAreaComponent from "../../components/codeAreaComponent";
import Dropdown from "../../components/dropdownComponent";
import FloatComponent from "../../components/floatComponent";
import InputComponent from "../../components/inputComponent";
import InputFileComponent from "../../components/inputFileComponent";
import InputListComponent from "../../components/inputListComponent";
import IntComponent from "../../components/intComponent";
import PromptAreaComponent from "../../components/promptComponent";
import TextAreaComponent from "../../components/textAreaComponent";
import ToggleShadComponent from "../../components/toggleShadComponent";
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from "../../components/ui/table";
import {
Tabs,
TabsContent,
TabsList,
TabsTrigger,
} from "../../components/ui/tabs";
import { darkContext } from "../../contexts/darkContext";
import { FlowType } from "../../types/flow/index";
import { classNames } from "../../utils/utils";
import IconComponent from "../genericIconComponent";
export default function CodeTabsComponent({
flow,
tabs,
activeTab,
setActiveTab,
isMessage,
tweaks,
}: {
flow?: FlowType;
tabs: any;
activeTab: string;
setActiveTab: any;
isMessage?: boolean;
tweaks?: {
tweak?: any;
tweaksList?: any;
buildContent?: any;
getValue?: any;
buildTweakObject?: any;
};
}) {
const [isCopied, setIsCopied] = useState<Boolean>(false);
const [data, setData] = useState(flow ? flow["data"]["nodes"] : null);
const [openAccordion, setOpenAccordion] = useState([]);
const { dark } = useContext(darkContext);
useEffect(() => {
if (flow && flow["data"]["nodes"]) {
setData(flow["data"]["nodes"]);
}
}, [flow]);
const copyToClipboard = () => {
if (!navigator.clipboard || !navigator.clipboard.writeText) {
return;
}
navigator.clipboard.writeText(tabs[activeTab].code).then(() => {
setIsCopied(true);
setTimeout(() => {
setIsCopied(false);
}, 2000);
});
};
const downloadAsFile = () => {
const fileExtension = tabs[activeTab].language || ".txt";
const suggestedFileName = `${"generated-code."}${fileExtension}`;
const fileName = window.prompt("Enter the file name.", suggestedFileName);
if (!fileName) {
// user pressed cancel on prompt
return;
}
const blob = new Blob([tabs[activeTab].code], { type: "text/plain" });
const url = URL.createObjectURL(blob);
const link = document.createElement("a");
link.download = fileName;
link.href = url;
link.style.display = "none";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(url);
};
function openAccordions() {
let accordionsToOpen = [];
tweaks.tweak.current.forEach((el) => {
Object.keys(el).forEach((key) => {
if (Object.keys(el[key]).length > 0) {
accordionsToOpen.push(key);
setOpenAccordion(accordionsToOpen);
}
});
});
if (accordionsToOpen.length == 0) {
setOpenAccordion([]);
}
}
return (
<Tabs
value={activeTab}
className={
"api-modal-tabs " +
(isMessage ? "dark " : "") +
(dark && isMessage ? "bg-background" : "")
}
onValueChange={(value) => {
setActiveTab(value);
if (value === "3") {
openAccordions();
}
}}
>
<div className="api-modal-tablist-div">
<TabsList>
{tabs.map((tab, index) => (
<TabsTrigger
className={
isMessage ? "data-[state=active]:bg-primary-foreground" : ""
}
key={index}
value={index.toString()}
>
{tab.name}
</TabsTrigger>
))}
</TabsList>
{Number(activeTab) < 3 && (
<div className="float-right mx-1 flex gap-2">
<button
className="flex items-center gap-1.5 rounded bg-none p-1 text-xs text-gray-500 dark:text-gray-300"
onClick={copyToClipboard}
>
{isCopied ? (
<IconComponent name="Check" className="h-4 w-4" />
) : (
<IconComponent name="Clipboard" className="h-4 w-4" />
)}
{isCopied ? "Copied!" : "Copy code"}
</button>
<button
className="flex items-center gap-1.5 rounded bg-none p-1 text-xs text-gray-500 dark:text-gray-300"
onClick={downloadAsFile}
>
<IconComponent name="Download" className="h-5 w-5" />
</button>
</div>
)}
</div>
{tabs.map((tab, index) => (
<TabsContent
value={index.toString()}
className="api-modal-tabs-content"
key={index} // Remember to add a unique key prop
>
{index < 3 ? (
<SyntaxHighlighter
className="mt-0 h-full w-full overflow-auto custom-scroll"
language={tab.mode}
style={oneDark}
>
{tab.code}
</SyntaxHighlighter>
) : index === 3 ? (
<>
<div className="api-modal-according-display">
<div
className={classNames(
"h-[70vh] w-full rounded-lg bg-muted",
1 == 1
? "overflow-scroll overflow-x-hidden custom-scroll"
: "overflow-hidden"
)}
>
{data.map((t: any, index) => (
<div className="px-3" key={index}>
{tweaks.tweaksList.current.includes(t["data"]["id"]) && (
<AccordionComponent
trigger={t["data"]["id"]}
open={openAccordion}
keyValue={t["data"]["id"]}
>
<div className="api-modal-table-arrangement">
<Table className="table-fixed bg-muted outline-1">
<TableHeader className="h-10 border-input text-xs font-medium text-ring">
<TableRow className="dark:border-b-muted">
<TableHead className="h-7 text-center">
PARAM
</TableHead>
<TableHead className="h-7 p-0 text-center">
VALUE
</TableHead>
</TableRow>
</TableHeader>
<TableBody className="p-0">
{Object.keys(t["data"]["node"]["template"])
.filter(
(n) =>
n.charAt(0) !== "_" &&
t.data.node.template[n].show &&
(t.data.node.template[n].type === "str" ||
t.data.node.template[n].type ===
"bool" ||
t.data.node.template[n].type ===
"float" ||
t.data.node.template[n].type ===
"code" ||
t.data.node.template[n].type ===
"prompt" ||
t.data.node.template[n].type ===
"file" ||
t.data.node.template[n].type === "int")
)
.map((n, i) => {
return (
<TableRow
key={i}
className="h-10 dark:border-b-muted"
>
<TableCell className="p-0 text-center text-sm text-foreground">
{n}
</TableCell>
<TableCell className="p-0 text-xs text-foreground">
<div className="m-auto w-[250px]">
{t.data.node.template[n].type ===
"str" &&
!t.data.node.template[n].options ? (
<div className="mx-auto">
{t.data.node.template[n]
.list ? (
<InputListComponent
editNode={true}
disabled={false}
value={
!t.data.node.template[n]
.value ||
t.data.node.template[n]
.value === ""
? [""]
: t.data.node.template[
n
].value
}
onChange={(k) => {
setData((old) => {
let newInputList =
cloneDeep(old);
newInputList[
index
].data.node.template[
n
].value = k;
return newInputList;
});
tweaks.buildTweakObject(
t["data"]["id"],
k,
t.data.node.template[n]
);
}}
/>
) : t.data.node.template[n]
.multiline ? (
<ShadTooltip
content={tweaks.buildContent(
t.data.node.template[n]
.value
)}
>
<div>
<TextAreaComponent
disabled={false}
editNode={true}
value={
!t.data.node.template[
n
].value ||
t.data.node.template[
n
].value === ""
? ""
: t.data.node
.template[n]
.value
}
onChange={(k) => {
setData((old) => {
let newInputList =
cloneDeep(old);
newInputList[
index
].data.node.template[
n
].value = k;
return newInputList;
});
tweaks.buildTweakObject(
t["data"]["id"],
k,
t.data.node
.template[n]
);
}}
/>
</div>
</ShadTooltip>
) : (
<InputComponent
editNode={true}
disabled={false}
password={
t.data.node.template[n]
.password ?? false
}
value={
!t.data.node.template[n]
.value ||
t.data.node.template[n]
.value === ""
? ""
: t.data.node.template[
n
].value
}
onChange={(k) => {
setData((old) => {
let newInputList =
cloneDeep(old);
newInputList[
index
].data.node.template[
n
].value = k;
return newInputList;
});
tweaks.buildTweakObject(
t["data"]["id"],
k,
t.data.node.template[n]
);
}}
/>
)}
</div>
) : t.data.node.template[n].type ===
"bool" ? (
<div className="ml-auto">
{" "}
<ToggleShadComponent
enabled={
t.data.node.template[n]
.value
}
setEnabled={(e) => {
setData((old) => {
let newInputList =
cloneDeep(old);
newInputList[
index
].data.node.template[
n
].value = e;
return newInputList;
});
tweaks.buildTweakObject(
t["data"]["id"],
e,
t.data.node.template[n]
);
}}
size="small"
disabled={false}
/>
</div>
) : t.data.node.template[n].type ===
"file" ? (
<ShadTooltip
content={tweaks.buildContent(
!t.data.node.template[n]
.value ||
t.data.node.template[n]
.value === ""
? ""
: t.data.node.template[n]
.value
)}
>
<div className="mx-auto">
<InputFileComponent
editNode={true}
disabled={false}
value={
t.data.node.template[n]
.value ?? ""
}
onChange={(k: any) => {}}
fileTypes={
t.data.node.template[n]
.fileTypes
}
suffixes={
t.data.node.template[n]
.suffixes
}
onFileChange={(
k: any
) => {}}
></InputFileComponent>
</div>
</ShadTooltip>
) : t.data.node.template[n].type ===
"float" ? (
<div className="mx-auto">
<FloatComponent
disabled={false}
editNode={true}
value={
!t.data.node.template[n]
.value ||
t.data.node.template[n]
.value === ""
? ""
: t.data.node.template[n]
.value
}
onChange={(k) => {
setData((old) => {
let newInputList =
cloneDeep(old);
newInputList[
index
].data.node.template[
n
].value = k;
return newInputList;
});
tweaks.buildTweakObject(
t["data"]["id"],
k,
t.data.node.template[n]
);
}}
/>
</div>
) : t.data.node.template[n].type ===
"str" &&
t.data.node.template[n]
.options ? (
<div className="mx-auto">
<Dropdown
editNode={true}
apiModal={true}
options={
t.data.node.template[n]
.options
}
onSelect={(k) => {
setData((old) => {
let newInputList =
cloneDeep(old);
newInputList[
index
].data.node.template[
n
].value = k;
return newInputList;
});
tweaks.buildTweakObject(
t["data"]["id"],
k,
t.data.node.template[n]
);
}}
value={
!t.data.node.template[n]
.value ||
t.data.node.template[n]
.value === ""
? ""
: t.data.node.template[n]
.value
}
></Dropdown>
</div>
) : t.data.node.template[n].type ===
"int" ? (
<div className="mx-auto">
<IntComponent
disabled={false}
editNode={true}
value={
!t.data.node.template[n]
.value ||
t.data.node.template[n]
.value === ""
? ""
: t.data.node.template[n]
.value
}
onChange={(k) => {
setData((old) => {
let newInputList =
cloneDeep(old);
newInputList[
index
].data.node.template[
n
].value = k;
return newInputList;
});
tweaks.buildTweakObject(
t["data"]["id"],
k,
t.data.node.template[n]
);
}}
/>
</div>
) : t.data.node.template[n].type ===
"prompt" ? (
<ShadTooltip
content={tweaks.buildContent(
!t.data.node.template[n]
.value ||
t.data.node.template[n]
.value === ""
? ""
: t.data.node.template[n]
.value
)}
>
<div className="mx-auto">
<PromptAreaComponent
editNode={true}
disabled={false}
value={
!t.data.node.template[n]
.value ||
t.data.node.template[n]
.value === ""
? ""
: t.data.node.template[
n
].value
}
onChange={(k) => {
setData((old) => {
let newInputList =
cloneDeep(old);
newInputList[
index
].data.node.template[
n
].value = k;
return newInputList;
});
tweaks.buildTweakObject(
t["data"]["id"],
k,
t.data.node.template[n]
);
}}
/>
</div>
</ShadTooltip>
) : t.data.node.template[n].type ===
"code" ? (
<ShadTooltip
content={tweaks.buildContent(
tweaks.getValue(
t.data.node.template[n]
.value,
t.data,
t.data.node.template[n]
)
)}
>
<div className="mx-auto">
<CodeAreaComponent
disabled={false}
editNode={true}
value={
!t.data.node.template[n]
.value ||
t.data.node.template[n]
.value === ""
? ""
: t.data.node.template[
n
].value
}
onChange={(k) => {
setData((old) => {
let newInputList =
cloneDeep(old);
newInputList[
index
].data.node.template[
n
].value = k;
return newInputList;
});
tweaks.buildTweakObject(
t["data"]["id"],
k,
t.data.node.template[n]
);
}}
/>
</div>
</ShadTooltip>
) : t.data.node.template[n].type ===
"Any" ? (
"-"
) : (
<div className="hidden"></div>
)}
</div>
</TableCell>
</TableRow>
);
})}
</TableBody>
</Table>
</div>
</AccordionComponent>
)}
{tweaks.tweaksList.current.length === 0 && (
<>
<div className="pt-3">
No tweaks are available for this flow.
</div>
</>
)}
</div>
))}
</div>
</div>
</>
) : null}
</TabsContent>
))}
</Tabs>
);
}

View file

@ -1,9 +1,8 @@
import { Listbox, Transition } from "@headlessui/react";
import { Check, ChevronsUpDown } from "lucide-react";
import { Fragment, useContext, useEffect, useState } from "react";
import { PopUpContext } from "../../contexts/popUpContext";
import { Fragment, useEffect, useState } from "react";
import { DropDownComponentType } from "../../types/components";
import { classNames } from "../../utils";
import { classNames } from "../../utils/utils";
import IconComponent from "../genericIconComponent";
export default function Dropdown({
value,
@ -13,15 +12,13 @@ export default function Dropdown({
numberOfOptions = 0,
apiModal = false,
}: DropDownComponentType) {
const { closePopUp } = useContext(PopUpContext);
let [internalValue, setInternalValue] = useState(
value === "" || !value ? "Choose an option" : value
);
useEffect(() => {
setInternalValue(value === "" || !value ? "Choose an option" : value);
}, [closePopUp]);
}, [value]);
return (
<>
@ -46,7 +43,8 @@ export default function Dropdown({
{internalValue}
</span>
<span className={"dropdown-component-arrow"}>
<ChevronsUpDown
<IconComponent
name="ChevronsUpDown"
className="dropdown-component-arrow-color"
aria-hidden="true"
/>
@ -99,7 +97,8 @@ export default function Dropdown({
"dropdown-component-choosal"
)}
>
<Check
<IconComponent
name="Check"
className={
active
? "dropdown-component-check-icon"

View file

@ -1,43 +1,27 @@
import { useContext, useEffect, useState } from "react";
import { PopUpContext } from "../../contexts/popUpContext";
import { TabsContext } from "../../contexts/tabsContext";
import { useEffect } from "react";
import { FloatComponentType } from "../../types/components";
import { Input } from "../ui/input";
export default function FloatComponent({
value,
onChange,
disableCopyPaste = false,
disabled,
editNode = false,
}: FloatComponentType) {
const [myValue, setMyValue] = useState(value ?? "");
const { setDisableCopyPaste } = useContext(TabsContext);
const { closePopUp } = useContext(PopUpContext);
const step = 0.1;
const min = 0;
const max = 1;
// Clear component state
useEffect(() => {
if (disabled) {
setMyValue("");
onChange("");
}
}, [disabled, onChange]);
useEffect(() => {
setMyValue(value);
}, [closePopUp]);
return (
<div className={"w-full " + (disabled ? "float-component-pointer" : "")}>
<input
onFocus={() => {
if (disableCopyPaste) setDisableCopyPaste(true);
}}
onBlur={() => {
if (disableCopyPaste) setDisableCopyPaste(false);
}}
<div className="w-full">
<Input
type="number"
step={step}
min={min}
@ -50,17 +34,13 @@ export default function FloatComponent({
}
}}
max={max}
value={myValue}
className={
editNode
? "input-edit-node"
: "input-primary" + (disabled ? " input-disable " : "")
}
value={value ?? ""}
disabled={disabled}
className={editNode ? "input-edit-node" : ""}
placeholder={
editNode ? "Number 0 to 1" : "Type a number from zero to one"
}
onChange={(e) => {
setMyValue(e.target.value);
onChange(e.target.value);
}}
/>

View file

@ -0,0 +1,11 @@
import { IconComponentProps } from "../../types/components";
import { nodeIconsLucide } from "../../utils/styleUtils";
export default function IconComponent({
name,
className,
iconColor,
}: IconComponentProps): JSX.Element {
const TargetIcon = nodeIconsLucide[name] ?? nodeIconsLucide["unknown"];
return <TargetIcon className={className} style={{ color: iconColor }} />;
}

View file

@ -1,13 +1,4 @@
import {
ChevronDown,
ChevronLeft,
Plus,
Redo,
Settings2,
Undo,
} from "lucide-react";
import { useContext } from "react";
import { PopUpContext } from "../../../../contexts/popUpContext";
import { useContext, useState } from "react";
import { TabsContext } from "../../../../contexts/tabsContext";
import {
DropdownMenu,
@ -21,13 +12,14 @@ import { Link, useNavigate } from "react-router-dom";
import { alertContext } from "../../../../contexts/alertContext";
import { undoRedoContext } from "../../../../contexts/undoRedoContext";
import FlowSettingsModal from "../../../../modals/flowSettingsModal";
import IconComponent from "../../../genericIconComponent";
import { Button } from "../../../ui/button";
export const MenuBar = ({ flows, tabId }) => {
const { updateFlow, setTabId, addFlow } = useContext(TabsContext);
const { addFlow } = useContext(TabsContext);
const { setErrorData } = useContext(alertContext);
const { openPopUp } = useContext(PopUpContext);
const { undo, redo } = useContext(undoRedoContext);
const [openSettings, setOpenSettings] = useState(false);
const navigate = useNavigate();
@ -46,7 +38,7 @@ export const MenuBar = ({ flows, tabId }) => {
return (
<div className="round-button-div">
<Link to="/">
<ChevronLeft className="w-4" />
<IconComponent name="ChevronLeft" className="w-4" />
</Link>
<div className="header-menu-bar">
<DropdownMenu>
@ -54,7 +46,7 @@ export const MenuBar = ({ flows, tabId }) => {
<Button asChild variant="primary" size="sm">
<div className="header-menu-bar-display">
<div className="header-menu-flow-name">{current_flow.name}</div>
<ChevronDown className="h-4 w-4" />
<IconComponent name="ChevronDown" className="h-4 w-4" />
</div>
</Button>
</DropdownMenuTrigger>
@ -66,25 +58,30 @@ export const MenuBar = ({ flows, tabId }) => {
}}
className="cursor-pointer"
>
<Plus className="header-menu-options" />
<IconComponent name="Plus" className="header-menu-options" />
New
</DropdownMenuItem>
<DropdownMenuItem
onClick={() => {
openPopUp(<FlowSettingsModal />);
setOpenSettings(true);
}}
className="cursor-pointer"
>
<Settings2 className="header-menu-options " />
<IconComponent
name="Settings2"
className="header-menu-options "
/>
Settings
</DropdownMenuItem>
<DropdownMenuItem
onClick={() => {
undo();
}}
className="cursor-pointer"
>
<Undo className="header-menu-options " />
<IconComponent name="Undo" className="header-menu-options " />
Undo
</DropdownMenuItem>
<DropdownMenuItem
@ -93,35 +90,15 @@ export const MenuBar = ({ flows, tabId }) => {
}}
className="cursor-pointer"
>
<Redo className="header-menu-options " />
<IconComponent name="Redo" className="header-menu-options " />
Redo
</DropdownMenuItem>
{/* <DropdownMenuSeparator /> */}
{/* <DropdownMenuLabel>Projects</DropdownMenuLabel> */}
{/* <DropdownMenuRadioGroup className="max-h-full overflow-scroll"
value={tabId}
onValueChange={(value) => {
setTabId(value);
}}
>
{flows.map((flow, idx) => {
return (
<Link
to={"/flow/" + flow.id}
className="flex w-full items-center"
>
<DropdownMenuRadioItem
value={flow.id}
className="flex-1 w-full inline-block truncate break-words mr-2"
>
{flow.name}
</DropdownMenuRadioItem>
</Link>
);
})}
</DropdownMenuRadioGroup> */}
</DropdownMenuContent>
</DropdownMenu>
<FlowSettingsModal
open={openSettings}
setOpen={setOpenSettings}
></FlowSettingsModal>
</div>
</div>
);

View file

@ -1,32 +1,26 @@
import { Bell, Home, MoonIcon, SunIcon, Users2 } from "lucide-react";
import { useContext, useEffect, useState } from "react";
import { FaDiscord, FaGithub, FaTwitter } from "react-icons/fa";
import { Link, useLocation, useParams } from "react-router-dom";
import { Link, useLocation } from "react-router-dom";
import AlertDropdown from "../../alerts/alertDropDown";
import { USER_PROJECTS_HEADER } from "../../constants";
import { USER_PROJECTS_HEADER } from "../../constants/constants";
import { alertContext } from "../../contexts/alertContext";
import { darkContext } from "../../contexts/darkContext";
import { PopUpContext } from "../../contexts/popUpContext";
import { TabsContext } from "../../contexts/tabsContext";
import { typesContext } from "../../contexts/typesContext";
import { getRepoStars } from "../../controllers/API";
import IconComponent from "../genericIconComponent";
import { Button } from "../ui/button";
import { Separator } from "../ui/separator";
import MenuBar from "./components/menuBar";
export default function Header() {
const { flows, addFlow, tabId } = useContext(TabsContext);
const { openPopUp } = useContext(PopUpContext);
const { templates } = useContext(typesContext);
const { id } = useParams();
const AlertWidth = 384;
const { flows, tabId } = useContext(TabsContext);
const { dark, setDark } = useContext(darkContext);
const { notificationCenter, setNotificationCenter, setErrorData } =
useContext(alertContext);
const { notificationCenter } = useContext(alertContext);
const location = useLocation();
const [stars, setStars] = useState(null);
// Get and set numbers of stars on header
useEffect(() => {
async function fetchStars() {
const starsCount = await getRepoStars("logspace-ai", "langflow");
@ -51,7 +45,7 @@ export default function Header() {
variant={location.pathname === "/" ? "primary" : "secondary"}
size="sm"
>
<Home className="h-4 w-4" />
<IconComponent name="Home" className="h-4 w-4" />
<div className="flex-1">{USER_PROJECTS_HEADER}</div>
</Button>
</Link>
@ -63,7 +57,7 @@ export default function Header() {
}
size="sm"
>
<Users2 className="h-4 w-4" />
<IconComponent name="Users2" className="h-4 w-4" />
<div className="flex-1">Community Examples</div>
</Button>
</Link>
@ -105,34 +99,23 @@ export default function Header() {
}}
>
{dark ? (
<SunIcon className="side-bar-button-size" />
<IconComponent name="SunIcon" className="side-bar-button-size" />
) : (
<MoonIcon className="side-bar-button-size" />
<IconComponent name="MoonIcon" className="side-bar-button-size" />
)}
</button>
<button
className="extra-side-bar-save-disable relative"
onClick={(event: React.MouseEvent<HTMLElement>) => {
setNotificationCenter(false);
const { top, left } = (
event.target as Element
).getBoundingClientRect();
openPopUp(
<>
<div
className="absolute z-10"
style={{ top: top + 40, left: left - AlertWidth }}
>
<AlertDropdown />
</div>
<div className="header-notifications-box"></div>
</>
);
}}
>
{notificationCenter && <div className="header-notifications"></div>}
<Bell className="side-bar-button-size" aria-hidden="true" />
</button>
<AlertDropdown>
<div className="extra-side-bar-save-disable relative">
{notificationCenter && (
<div className="header-notifications"></div>
)}
<IconComponent
name="Bell"
className="side-bar-button-size"
aria-hidden="true"
/>
</div>
</AlertDropdown>
</div>
</div>
</div>

View file

@ -1,55 +1,37 @@
import { useContext, useEffect, useState } from "react";
import { PopUpContext } from "../../contexts/popUpContext";
import { TabsContext } from "../../contexts/tabsContext";
import { useEffect, useState } from "react";
import { InputComponentType } from "../../types/components";
import { classNames } from "../../utils";
import { classNames } from "../../utils/utils";
import { Input } from "../ui/input";
export default function InputComponent({
value,
onChange,
disableCopyPaste = false,
disabled,
password,
editNode = false,
}: InputComponentType) {
const [myValue, setMyValue] = useState(value ?? "");
const [pwdVisible, setPwdVisible] = useState(false);
const { setDisableCopyPaste } = useContext(TabsContext);
const { closePopUp } = useContext(PopUpContext);
// Clear component state
useEffect(() => {
if (disabled) {
setMyValue("");
onChange("");
}
}, [disabled, onChange]);
useEffect(() => {
setMyValue(value ?? "");
}, [closePopUp]);
return (
<div className={disabled ? "input-component-div" : "relative"}>
<input
value={myValue}
onFocus={() => {
if (disableCopyPaste) setDisableCopyPaste(true);
}}
onBlur={() => {
if (disableCopyPaste) setDisableCopyPaste(false);
}}
<div className="relative w-full">
<Input
value={value}
disabled={disabled}
className={classNames(
disabled ? " input-disable " : "",
password && !pwdVisible && myValue !== ""
? " text-clip password "
: "",
editNode ? " input-edit-node " : " input-primary ",
password && !pwdVisible && value !== "" ? " text-clip password " : "",
editNode ? " input-edit-node " : "",
password && editNode ? "pr-8" : "",
password && !editNode ? "pr-10" : ""
)}
placeholder={password && editNode ? "Key" : "Type something..."}
onChange={(e) => {
setMyValue(e.target.value);
onChange(e.target.value);
}}
/>

View file

@ -1,9 +1,9 @@
import { FileSearch2 } from "lucide-react";
import { useContext, useEffect, useState } from "react";
import { alertContext } from "../../contexts/alertContext";
import { TabsContext } from "../../contexts/tabsContext";
import { uploadFile } from "../../controllers/API";
import { FileComponentType } from "../../types/components";
import IconComponent from "../genericIconComponent";
export default function InputFileComponent({
value,
@ -18,6 +18,8 @@ export default function InputFileComponent({
const [loading, setLoading] = useState(false);
const { setErrorData } = useContext(alertContext);
const { tabId } = useContext(TabsContext);
// Clear component state
useEffect(() => {
if (disabled) {
setMyValue("");
@ -108,8 +110,8 @@ export default function InputFileComponent({
</span>
<button onClick={handleButtonClick}>
{!editNode && !loading && (
<FileSearch2
strokeWidth={1.5}
<IconComponent
name="FileSearch2"
className={
"icons-parameters-comp" +
(disabled ? " text-ring " : " hover:text-accent-foreground")

View file

@ -1,84 +1,70 @@
import { useContext, useEffect, useState } from "react";
import { useEffect } from "react";
import { InputListComponentType } from "../../types/components";
import _ from "lodash";
import { Plus, X } from "lucide-react";
import { PopUpContext } from "../../contexts/popUpContext";
import { classNames } from "../../utils/utils";
import IconComponent from "../genericIconComponent";
import { Input } from "../ui/input";
export default function InputListComponent({
value,
onChange,
disabled,
editNode = false,
onAddInput,
}: InputListComponentType) {
const [inputList, setInputList] = useState(value ?? [""]);
const { closePopUp } = useContext(PopUpContext);
useEffect(() => {
if (disabled) {
setInputList([""]);
onChange([""]);
}
}, [disabled, onChange]);
useEffect(() => {
setInputList(value);
}, [closePopUp]);
}, [disabled]);
return (
<div
className={
(disabled ? "pointer-events-none cursor-not-allowed" : "") +
className={classNames(
value.length > 1 && editNode ? "my-1" : "",
"flex flex-col gap-3"
}
)}
>
{inputList.map((i, idx) => {
{value.map((i, idx) => {
return (
<div key={idx} className="flex w-full gap-3">
<input
<Input
disabled={disabled}
type="text"
value={i}
className={
editNode
? "input-edit-node "
: "input-primary " + (disabled ? "input-disable" : "")
}
className={editNode ? "input-edit-node" : ""}
placeholder="Type something..."
onChange={(e) => {
setInputList((old) => {
let newInputList = _.cloneDeep(old);
newInputList[idx] = e.target.value;
return newInputList;
});
onChange(inputList);
let newInputList = _.cloneDeep(value);
newInputList[idx] = e.target.value;
onChange(newInputList);
}}
/>
{idx === inputList.length - 1 ? (
{idx === value.length - 1 ? (
<button
onClick={() => {
setInputList((old) => {
let newInputList = _.cloneDeep(old);
newInputList.push("");
return newInputList;
});
onChange(inputList);
let newInputList = _.cloneDeep(value);
newInputList.push("");
onChange(newInputList);
}}
>
<Plus className={"h-4 w-4 hover:text-accent-foreground"} />
<IconComponent
name="Plus"
className={"h-4 w-4 hover:text-accent-foreground"}
/>
</button>
) : (
<button
onClick={() => {
setInputList((old) => {
let newInputList = _.cloneDeep(old);
newInputList.splice(idx, 1);
return newInputList;
});
onChange(inputList);
let newInputList = _.cloneDeep(value);
newInputList.splice(idx, 1);
onChange(newInputList);
}}
>
<X className="h-4 w-4 hover:text-status-red" />
<IconComponent
name="X"
className="h-4 w-4 hover:text-status-red"
/>
</button>
)}
</div>

View file

@ -1,45 +1,25 @@
import { useContext, useEffect, useState } from "react";
import { PopUpContext } from "../../contexts/popUpContext";
import { TabsContext } from "../../contexts/tabsContext";
import { useEffect } from "react";
import { FloatComponentType } from "../../types/components";
import { Input } from "../ui/input";
export default function IntComponent({
value,
onChange,
disableCopyPaste = false,
disabled,
editNode = false,
}: FloatComponentType) {
const [myValue, setMyValue] = useState(value ?? "");
const { setDisableCopyPaste } = useContext(TabsContext);
const min = 0;
const { closePopUp } = useContext(PopUpContext);
// Clear component state
useEffect(() => {
if (disabled) {
setMyValue("");
onChange("");
}
}, [disabled, onChange]);
useEffect(() => {
setMyValue(value);
}, [closePopUp]);
return (
<div
className={
"w-full " +
(disabled ? "pointer-events-none w-full cursor-not-allowed" : "")
}
>
<input
onFocus={() => {
if (disableCopyPaste) setDisableCopyPaste(true);
}}
onBlur={() => {
if (disableCopyPaste) setDisableCopyPaste(false);
}}
<div className="w-full">
<Input
onKeyDown={(event) => {
if (
event.key !== "Backspace" &&
@ -66,15 +46,11 @@ export default function IntComponent({
e.target.value = min.toString();
}
}}
value={myValue}
className={
editNode
? " input-edit-node "
: " input-primary " + (disabled ? " input-disable" : "")
}
value={value ?? ""}
className={editNode ? "input-edit-node" : ""}
disabled={disabled}
placeholder={editNode ? "Integer number" : "Type an integer number"}
onChange={(e) => {
setMyValue(e.target.value);
onChange(e.target.value);
}}
/>

View file

@ -1,12 +1,10 @@
import { useContext, useEffect, useState } from "react";
import { PopUpContext } from "../../contexts/popUpContext";
import { useEffect } from "react";
import { TypeModal } from "../../constants/enums";
import { postValidatePrompt } from "../../controllers/API";
import GenericModal from "../../modals/genericModal";
import { TextAreaComponentType } from "../../types/components";
import { TypeModal } from "../../utils";
import { ExternalLink } from "lucide-react";
import { typesContext } from "../../contexts/typesContext";
import { postValidatePrompt } from "../../controllers/API";
import IconComponent from "../genericIconComponent";
export default function PromptAreaComponent({
field_name,
@ -17,18 +15,13 @@ export default function PromptAreaComponent({
disabled,
editNode = false,
}: TextAreaComponentType) {
const [myValue, setMyValue] = useState(value);
const { openPopUp } = useContext(PopUpContext);
const { reactFlowInstance } = useContext(typesContext);
useEffect(() => {
if (disabled) {
setMyValue("");
onChange("");
}
}, [disabled, onChange]);
}, [disabled]);
useEffect(() => {
setMyValue(value);
if (value !== "" && !editNode) {
postValidatePrompt(field_name, value, nodeClass).then((apiReturn) => {
if (apiReturn.data) {
@ -37,85 +30,43 @@ export default function PromptAreaComponent({
}
});
}
}, [value, reactFlowInstance]);
// useEffect(() => {
// if (value !== "" && myValue !== value && reactFlowInstance) {
// // only executed once
// setMyValue(value);
// postValidatePrompt(field_name, value, nodeClass)
// .then((apiReturn) => {
// if (apiReturn.data) {
// setNodeClass(apiReturn.data.frontend_node);
// // need to update reactFlowInstance to re-render the nodes.
// reactFlowInstance.setEdges(
// _.cloneDeep(reactFlowInstance.getEdges())
// );
// }
// })
// .catch((error) => {});
// }
// }, [reactFlowInstance, field_name, myValue, nodeClass, setNodeClass, value]);
}, []);
return (
<div className={disabled ? "pointer-events-none w-full " : " w-full"}>
<div className="flex w-full items-center">
<span
onClick={() => {
openPopUp(
<GenericModal
type={TypeModal.PROMPT}
value={myValue}
buttonText="Check & Save"
modalTitle="Edit Prompt"
setValue={(t: string) => {
setMyValue(t);
onChange(t);
}}
nodeClass={nodeClass}
setNodeClass={setNodeClass}
/>
);
}}
className={
editNode
? "input-edit-node input-dialog"
: (disabled ? " input-disable text-ring " : "") +
" input-primary text-muted-foreground "
}
>
{myValue !== "" ? myValue : "Type your prompt here"}
</span>
<button
onClick={() => {
openPopUp(
<GenericModal
field_name={field_name}
type={TypeModal.PROMPT}
value={myValue}
buttonText="Check & Save"
modalTitle="Edit Prompt"
setValue={(t: string) => {
setMyValue(t);
onChange(t);
}}
nodeClass={nodeClass}
setNodeClass={setNodeClass}
/>
);
}}
>
<GenericModal
type={TypeModal.PROMPT}
value={value}
buttonText="Check & Save"
modalTitle="Edit Prompt"
setValue={(t: string) => {
onChange(t);
}}
nodeClass={nodeClass}
setNodeClass={setNodeClass}
>
<div className="flex w-full items-center">
<span
className={
editNode
? "input-edit-node input-dialog"
: (disabled ? " input-disable text-ring " : "") +
" input-primary text-muted-foreground "
}
>
{value !== "" ? value : "Type your prompt here..."}
</span>
{!editNode && (
<ExternalLink
strokeWidth={1.5}
<IconComponent
name="ExternalLink"
className={
"icons-parameters-comp" +
(disabled ? " text-ring" : " hover:text-accent-foreground")
}
/>
)}
</button>
</div>
</div>
</GenericModal>
</div>
);
}

View file

@ -1,11 +1,9 @@
import { useContext, useEffect, useState } from "react";
import { PopUpContext } from "../../contexts/popUpContext";
import { useEffect } from "react";
import { TypeModal } from "../../constants/enums";
import GenericModal from "../../modals/genericModal";
import { TextAreaComponentType } from "../../types/components";
import { TypeModal } from "../../utils";
import { ExternalLink } from "lucide-react";
import { TabsContext } from "../../contexts/tabsContext";
import IconComponent from "../genericIconComponent";
import { Input } from "../ui/input";
export default function TextAreaComponent({
value,
@ -13,70 +11,44 @@ export default function TextAreaComponent({
disabled,
editNode = false,
}: TextAreaComponentType) {
const [myValue, setMyValue] = useState(value);
const { openPopUp, closePopUp } = useContext(PopUpContext);
const { setDisableCopyPaste } = useContext(TabsContext);
// Clear text area
useEffect(() => {
if (disabled) {
setMyValue("");
onChange("");
}
}, [disabled, onChange]);
useEffect(() => {
setMyValue(value);
}, [closePopUp]);
}, [disabled]);
return (
<div className={disabled ? "pointer-events-none w-full " : " w-full"}>
<div className="flex w-full items-center">
<input
value={myValue}
onFocus={() => {
setDisableCopyPaste(true);
}}
onBlur={() => {
setDisableCopyPaste(false);
}}
className={
editNode
? " input-edit-node "
: " input-primary " + (disabled ? " input-disable" : "")
}
placeholder={"Type something..."}
onChange={(e) => {
setMyValue(e.target.value);
onChange(e.target.value);
}}
/>
<button
onClick={() => {
openPopUp(
<GenericModal
type={TypeModal.TEXT}
buttonText="Finishing Editing"
modalTitle="Edit Text"
value={myValue}
setValue={(t: string) => {
setMyValue(t);
onChange(t);
}}
/>
);
<div className="flex w-full items-center">
<Input
value={value}
disabled={disabled}
className={editNode ? "input-edit-node" : ""}
placeholder={"Type something..."}
onChange={(e) => {
onChange(e.target.value);
}}
/>
<div>
<GenericModal
type={TypeModal.TEXT}
buttonText="Finishing Editing"
modalTitle="Edit Text"
value={value}
setValue={(t: string) => {
onChange(t);
}}
>
{!editNode && (
<ExternalLink
strokeWidth={1.5}
<IconComponent
name="ExternalLink"
className={
"icons-parameters-comp" +
(disabled ? " text-ring" : " hover:text-accent-foreground")
}
/>
)}
</button>
</GenericModal>
</div>
</div>
);

View file

@ -1,13 +1,14 @@
import { Switch } from "@headlessui/react";
import { useEffect } from "react";
import { ToggleComponentType } from "../../types/components";
import { classNames } from "../../utils";
import { classNames } from "../../utils/utils";
export default function ToggleComponent({
enabled,
setEnabled,
disabled,
}: ToggleComponentType) {
// set component state as disabled
useEffect(() => {
if (disabled) {
setEnabled(false);

View file

@ -25,6 +25,7 @@ export default function ToggleShadComponent({
scaleX = 1;
scaleY = 1;
}
return (
<div className={disabled ? "pointer-events-none cursor-not-allowed " : ""}>
<Switch

View file

@ -3,7 +3,7 @@
import * as AccordionPrimitive from "@radix-ui/react-accordion";
import { ChevronDownIcon } from "@radix-ui/react-icons";
import * as React from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
const Accordion = AccordionPrimitive.Root;
@ -46,7 +46,7 @@ const AccordionContent = React.forwardRef<
<AccordionPrimitive.Content
ref={ref}
className={cn(
"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
className
)}
{...props}
@ -56,4 +56,4 @@ const AccordionContent = React.forwardRef<
));
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };

View file

@ -1,6 +1,6 @@
import { cva, type VariantProps } from "class-variance-authority";
import * as React from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
const badgeVariants = cva(
"inline-flex items-center border rounded-full px-2.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",

View file

@ -1,7 +1,7 @@
import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "class-variance-authority";
import * as React from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
const buttonVariants = cva(
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background",

View file

@ -1,5 +1,5 @@
import * as React from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
const Card = React.forwardRef<
HTMLDivElement,
@ -77,9 +77,9 @@ CardFooter.displayName = "CardFooter";
export {
Card,
CardHeader,
CardFooter,
CardTitle,
CardDescription,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
};

View file

@ -1,9 +1,9 @@
"use client";
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
import { Check } from "lucide-react";
import * as React from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
import IconComponent from "../genericIconComponent";
const Checkbox = React.forwardRef<
React.ElementRef<typeof CheckboxPrimitive.Root>,
@ -20,7 +20,7 @@ const Checkbox = React.forwardRef<
<CheckboxPrimitive.Indicator
className={cn("flex items-center justify-center text-current")}
>
<Check className="h-4 w-4" />
<IconComponent name="Check" className="h-4 w-4" />
</CheckboxPrimitive.Indicator>
</CheckboxPrimitive.Root>
));

View file

@ -1,7 +1,7 @@
import * as DialogPrimitive from "@radix-ui/react-dialog";
import { X } from "lucide-react";
import * as React from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
import IconComponent from "../genericIconComponent";
const Dialog = DialogPrimitive.Root;
@ -44,14 +44,14 @@ const DialogContent = React.forwardRef<
<DialogPrimitive.Content
ref={ref}
className={cn(
"fixed z-50 grid w-full gap-3 rounded-b-lg border bg-background p-6 shadow-lg animate-in data-[state=open]:fade-in-90 data-[state=open]:slide-in-from-bottom-10 sm:max-w-lg sm:rounded-lg sm:zoom-in-90 data-[state=open]:sm:slide-in-from-bottom-0",
"noundo nocopy fixed z-50 flex w-full flex-col gap-3 rounded-b-lg border bg-background p-6 shadow-lg animate-in data-[state=open]:fade-in-90 data-[state=open]:slide-in-from-bottom-10 sm:max-w-lg sm:rounded-lg sm:zoom-in-90 data-[state=open]:sm:slide-in-from-bottom-0",
className
)}
{...props}
>
{children}
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
<X className="h-4 w-4" />
<IconComponent name="X" className="h-4 w-4" />
<span className="sr-only">Close</span>
</DialogPrimitive.Close>
</DialogPrimitive.Content>
@ -116,10 +116,10 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName;
export {
Dialog,
DialogTrigger,
DialogContent,
DialogHeader,
DialogFooter,
DialogTitle,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
};

View file

@ -1,9 +1,9 @@
"use client";
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
import { Check, ChevronRight, Circle } from "lucide-react";
import * as React from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
import IconComponent from "../genericIconComponent";
const DropdownMenu = DropdownMenuPrimitive.Root;
@ -33,7 +33,7 @@ const DropdownMenuSubTrigger = React.forwardRef<
{...props}
>
{children}
<ChevronRight className="ml-auto h-4 w-4" />
<IconComponent name="ChevronRight" className="ml-auto h-4 w-4" />
</DropdownMenuPrimitive.SubTrigger>
));
DropdownMenuSubTrigger.displayName =
@ -106,7 +106,7 @@ const DropdownMenuCheckboxItem = React.forwardRef<
>
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<DropdownMenuPrimitive.ItemIndicator>
<Check className="h-4 w-4" />
<IconComponent name="Check" className="h-4 w-4" />
</DropdownMenuPrimitive.ItemIndicator>
</span>
{children}
@ -129,7 +129,7 @@ const DropdownMenuRadioItem = React.forwardRef<
>
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<DropdownMenuPrimitive.ItemIndicator>
<Circle className="h-2 w-2 fill-current" />
<IconComponent name="Circle" className="h-2 w-2 fill-current" />
</DropdownMenuPrimitive.ItemIndicator>
</span>
{children}
@ -182,18 +182,18 @@ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
export {
DropdownMenu,
DropdownMenuTrigger,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuCheckboxItem,
DropdownMenuRadioItem,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuPortal,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuSeparator,
DropdownMenuShortcut,
DropdownMenuGroup,
DropdownMenuPortal,
DropdownMenuSub,
DropdownMenuSubContent,
DropdownMenuSubTrigger,
DropdownMenuRadioGroup,
DropdownMenuTrigger,
};

View file

@ -1,5 +1,5 @@
import * as React from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {}
@ -9,10 +9,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
return (
<input
type={type}
className={cn(
"flex h-10 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
className
)}
className={cn("nopan nodrag noundo nocopy input-primary", className)}
ref={ref}
{...props}
/>

View file

@ -3,7 +3,7 @@
import * as LabelPrimitive from "@radix-ui/react-label";
import { cva, type VariantProps } from "class-variance-authority";
import * as React from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
const labelVariants = cva(
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"

View file

@ -1,10 +1,10 @@
"use client";
import * as MenubarPrimitive from "@radix-ui/react-menubar";
import { Check, ChevronRight, Circle } from "lucide-react";
import * as React from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
import IconComponent from "../genericIconComponent";
const MenubarMenu = MenubarPrimitive.Menu;
@ -62,7 +62,7 @@ const MenubarSubTrigger = React.forwardRef<
{...props}
>
{children}
<ChevronRight className="ml-auto h-4 w-4" />
<IconComponent name="ChevronRight" className="ml-auto h-4 w-4" />
</MenubarPrimitive.SubTrigger>
));
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
@ -140,7 +140,7 @@ const MenubarCheckboxItem = React.forwardRef<
>
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<MenubarPrimitive.ItemIndicator>
<Check className="h-4 w-4" />
<IconComponent name="Check" className="h-4 w-4" />
</MenubarPrimitive.ItemIndicator>
</span>
{children}
@ -162,7 +162,7 @@ const MenubarRadioItem = React.forwardRef<
>
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<MenubarPrimitive.ItemIndicator>
<Circle className="h-2 w-2 fill-current" />
<IconComponent name="Circle" className="h-2 w-2 fill-current" />
</MenubarPrimitive.ItemIndicator>
</span>
{children}
@ -218,19 +218,19 @@ MenubarShortcut.displayname = "MenubarShortcut";
export {
Menubar,
MenubarMenu,
MenubarTrigger,
MenubarContent,
MenubarItem,
MenubarSeparator,
MenubarLabel,
MenubarCheckboxItem,
MenubarContent,
MenubarGroup,
MenubarItem,
MenubarLabel,
MenubarMenu,
MenubarPortal,
MenubarRadioGroup,
MenubarRadioItem,
MenubarPortal,
MenubarSeparator,
MenubarShortcut,
MenubarSub,
MenubarSubContent,
MenubarSubTrigger,
MenubarGroup,
MenubarSub,
MenubarShortcut,
MenubarTrigger,
};

View file

@ -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<typeof PopoverPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
<PopoverPrimitive.Portal>
<PopoverPrimitive.Content
ref={ref}
align={align}
sideOffset={sideOffset}
className={cn(
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
className
)}
{...props}
/>
</PopoverPrimitive.Portal>
));
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
export { Popover, PopoverTrigger, PopoverContent };

View file

@ -2,7 +2,7 @@
import * as ProgressPrimitive from "@radix-ui/react-progress";
import * as React from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
const Progress = React.forwardRef<
React.ElementRef<typeof ProgressPrimitive.Root>,

View file

@ -1,5 +1,5 @@
import { useEffect, useRef, useState } from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
export default function RenameLabel(props) {
const [internalState, setInternalState] = useState(false);
@ -57,7 +57,7 @@ export default function RenameLabel(props) {
ref={inputRef}
onInput={resizeInput}
className={cn(
"rounded-md bg-transparent px-2 outline-ring hover:outline focus:border-none focus:outline active:outline",
"nopan nodrag noundo nocopy rounded-md bg-transparent px-2 outline-ring hover:outline focus:border-none focus:outline active:outline",
props.className
)}
onBlur={() => {

View file

@ -2,7 +2,7 @@
import * as SeparatorPrimitive from "@radix-ui/react-separator";
import * as React from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
const Separator = React.forwardRef<
React.ElementRef<typeof SeparatorPrimitive.Root>,

View file

@ -2,7 +2,7 @@
import * as SwitchPrimitives from "@radix-ui/react-switch";
import * as React from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
const Switch = React.forwardRef<
React.ElementRef<typeof SwitchPrimitives.Root>,

View file

@ -1,5 +1,5 @@
import * as React from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
const Table = React.forwardRef<
HTMLTableElement,
@ -103,11 +103,11 @@ TableCaption.displayName = "TableCaption";
export {
Table,
TableHeader,
TableBody,
TableCaption,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
TableCell,
TableCaption,
};

View file

@ -2,7 +2,7 @@
import * as TabsPrimitive from "@radix-ui/react-tabs";
import * as React from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
const Tabs = TabsPrimitive.Root;
@ -13,7 +13,7 @@ const TabsList = React.forwardRef<
<TabsPrimitive.List
ref={ref}
className={cn(
"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
"inline-flex h-10 items-center justify-center rounded-md p-1 text-muted-foreground",
className
)}
{...props}
@ -51,4 +51,4 @@ const TabsContent = React.forwardRef<
));
TabsContent.displayName = TabsPrimitive.Content.displayName;
export { Tabs, TabsList, TabsTrigger, TabsContent };
export { Tabs, TabsContent, TabsList, TabsTrigger };

View file

@ -1,5 +1,5 @@
import * as React from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
export interface TextareaProps
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
@ -8,10 +8,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
({ className, ...props }, ref) => {
return (
<textarea
className={cn(
"flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
className
)}
className={cn("nopan nodrag noundo nocopy textarea-primary", className)}
ref={ref}
{...props}
/>

View file

@ -2,7 +2,7 @@
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
import * as React from "react";
import { cn } from "../../utils";
import { cn } from "../../utils/utils";
const TooltipProvider = TooltipPrimitive.Provider;
@ -28,4 +28,4 @@ const TooltipContent = React.forwardRef<
));
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };

View file

@ -1,10 +1,61 @@
// src/constants.tsx
// src/constants/constants.ts
import { MessageSquare } from "lucide-react";
import { FlowType } from "./types/flow";
import { TabsState } from "./types/tabs";
import { buildInputs, buildTweaks } from "./utils";
import { languageMap } from "../types/components";
/**
* invalid characters for flow name
* @constant
*/
export const INVALID_CHARACTERS = [
" ",
",",
".",
":",
";",
"!",
"?",
"/",
"\\",
"(",
")",
"[",
"]",
"\n",
];
/**
* regex to highlight the variables in the text
* @constant
*/
export const regexHighlight = /\{([^}]+)\}/g;
export const programmingLanguages: languageMap = {
javascript: ".js",
python: ".py",
java: ".java",
c: ".c",
cpp: ".cpp",
"c++": ".cpp",
"c#": ".cs",
ruby: ".rb",
php: ".php",
swift: ".swift",
"objective-c": ".m",
kotlin: ".kt",
typescript: ".ts",
go: ".go",
perl: ".pl",
rust: ".rs",
scala: ".scala",
haskell: ".hs",
lua: ".lua",
shell: ".sh",
sql: ".sql",
html: ".html",
css: ".css",
// add more file extensions here, make sure the key is same as language prop in CodeBlock.tsx component
};
/**
* Number maximum of components to scroll on tooltips
* @constant
@ -17,6 +68,12 @@ export const MAX_LENGTH_TO_SCROLL_TOOLTIP = 200;
*/
export const MAX_WORDS_HIGHLIGHT = 79;
/**
* Limit of items before show scroll on fields modal
* @constant
*/
export const limitScrollFieldsModal = 10;
/**
* The base text for subtitle of Export Dialog (Toolbar)
* @constant
@ -70,8 +127,6 @@ export const CHAT_CANNOT_OPEN_DESCRIPTION = "This is not a chat flow.";
export const FLOW_NOT_BUILT_TITLE = "Flow not built";
export const THOUGHTS_ICON = MessageSquare;
export const FLOW_NOT_BUILT_DESCRIPTION =
"Please build the flow before chatting.";
@ -81,127 +136,6 @@ export const FLOW_NOT_BUILT_DESCRIPTION =
*/
export const TEXT_DIALOG_SUBTITLE = "Edit your text.";
/**
* Function to get the python code for the API
* @param {string} flowId - The id of the flow
* @returns {string} - The python code
*/
export const getPythonApiCode = (
flow: FlowType,
tweak?: any[],
tabsState?: TabsState
): string => {
const flowId = flow.id;
// create a dictionary of node ids and the values is an empty dictionary
// flow.data.nodes.forEach((node) => {
// node.data.id
// }
const tweaks = buildTweaks(flow);
const inputs = buildInputs(tabsState, flow.id);
return `import requests
from typing import Optional
BASE_API_URL = "${window.location.protocol}//${
window.location.host
}/api/v1/process"
FLOW_ID = "${flowId}"
# You can tweak the flow by adding a tweaks dictionary
# e.g {"OpenAI-XXXXX": {"model_name": "gpt-4"}}
TWEAKS = ${
tweak && tweak.length > 0
? buildTweakObject(tweak)
: JSON.stringify(tweaks, null, 2)
}
def run_flow(inputs: dict, flow_id: str, tweaks: Optional[dict] = None) -> dict:
"""
Run a flow with a given message and optional tweaks.
:param message: The message to send to the flow
:param flow_id: The ID of the flow to run
:param tweaks: Optional tweaks to customize the flow
:return: The JSON response from the flow
"""
api_url = f"{BASE_API_URL}/{flow_id}"
payload = {"inputs": inputs}
if tweaks:
payload["tweaks"] = tweaks
response = requests.post(api_url, json=payload)
return response.json()
# Setup any tweaks you want to apply to the flow
inputs = ${inputs}
print(run_flow(inputs, flow_id=FLOW_ID, tweaks=TWEAKS))`;
};
/**
* Function to get the curl code for the API
* @param {string} flowId - The id of the flow
* @returns {string} - The curl code
*/
export const getCurlCode = (
flow: FlowType,
tweak?: any[],
tabsState?: TabsState
): string => {
const flowId = flow.id;
const tweaks = buildTweaks(flow);
const inputs = buildInputs(tabsState, flow.id);
return `curl -X POST \\
${window.location.protocol}//${
window.location.host
}/api/v1/process/${flowId} \\
-H 'Content-Type: application/json' \\
-d '{"inputs": ${inputs}, "tweaks": ${
tweak && tweak.length > 0
? buildTweakObject(tweak)
: JSON.stringify(tweaks, null, 2)
}}'`;
};
/**
* Function to get the python code for the API
* @param {string} flowName - The name of the flow
* @returns {string} - The python code
*/
export const getPythonCode = (
flow: FlowType,
tweak?: any[],
tabsState?: TabsState
): string => {
const flowName = flow.name;
const tweaks = buildTweaks(flow);
const inputs = buildInputs(tabsState, flow.id);
return `from langflow import load_flow_from_json
TWEAKS = ${
tweak && tweak.length > 0
? buildTweakObject(tweak)
: JSON.stringify(tweaks, null, 2)
}
flow = load_flow_from_json("${flowName}.json", tweaks=TWEAKS)
# Now you can use it like any chain
inputs = ${inputs}
flow(inputs)`;
};
function buildTweakObject(tweak) {
tweak.forEach((el) => {
Object.keys(el).forEach((key) => {
for (let kp in el[key]) {
try {
el[key][kp] = JSON.parse(el[key][kp]);
} catch {}
}
});
});
const tweakString = JSON.stringify(tweak[0], null, 2);
return tweakString;
}
/**
* The base text for subtitle of Import Dialog
* @constant

View file

@ -0,0 +1,8 @@
/**
* enum for the different types of nodes
* @enum
*/
export enum TypeModal {
TEXT = 1,
PROMPT = 2,
}

View file

@ -5,7 +5,6 @@ import { SSEProvider } from "./SSEContext";
import { AlertProvider } from "./alertContext";
import { DarkProvider } from "./darkContext";
import { LocationProvider } from "./locationContext";
import PopUpProvider from "./popUpContext";
import { TabsProvider } from "./tabsContext";
import { TypesProvider } from "./typesContext";
import { UndoRedoProvider } from "./undoRedoContext";
@ -22,9 +21,7 @@ export default function ContextWrapper({ children }: { children: ReactNode }) {
<AlertProvider>
<SSEProvider>
<TabsProvider>
<UndoRedoProvider>
<PopUpProvider>{children}</PopUpProvider>
</UndoRedoProvider>
<UndoRedoProvider>{children}</UndoRedoProvider>
</TabsProvider>
</SSEProvider>
</AlertProvider>

View file

@ -1,38 +0,0 @@
import React, { createContext, useState } from "react";
// context to set JSX element on the DOM
export const PopUpContext = createContext({
openPopUp: (popUpElement: JSX.Element) => {},
closePopUp: () => {},
setCloseEdit: (value: string) => {},
closeEdit: "",
});
interface PopUpProviderProps {
children: React.ReactNode;
}
const PopUpProvider = ({ children }: PopUpProviderProps) => {
const [popUpElements, setPopUpElements] = useState<JSX.Element[]>([]);
const openPopUp = (element: JSX.Element) => {
setPopUpElements((prevPopUps) => [element, ...prevPopUps]);
};
const closePopUp = () => {
setPopUpElements((prevPopUps) => prevPopUps.slice(1));
};
const [closeEdit, setCloseEdit] = useState("");
return (
<PopUpContext.Provider
value={{ openPopUp, closePopUp, closeEdit, setCloseEdit }}
>
{children}
{popUpElements[0]}
</PopUpContext.Provider>
);
};
export default PopUpProvider;

View file

@ -20,12 +20,8 @@ import {
import { APIClassType, APITemplateType } from "../types/api";
import { FlowType, NodeType } from "../types/flow";
import { TabsContextType, TabsState } from "../types/tabs";
import {
getRandomDescription,
getRandomName,
updateIds,
updateTemplate,
} from "../utils";
import { updateIds, updateTemplate } from "../utils/reactflowUtils";
import { getRandomDescription, getRandomName } from "../utils/utils";
import { alertContext } from "./alertContext";
import { typesContext } from "./typesContext";
@ -46,8 +42,6 @@ const TabsContextInitialValue: TabsContextType = {
uploadFlow: () => {},
hardReset: () => {},
saveFlow: async (flow: FlowType) => {},
disableCopyPaste: false,
setDisableCopyPaste: (state: boolean) => {},
lastCopiedSelection: null,
setLastCopiedSelection: (selection: any) => {},
tabsState: {},
@ -106,53 +100,6 @@ export function TabsProvider({ children }: { children: ReactNode }) {
}
}
// function loadCookie(cookie: string) {
// if (cookie && Object.keys(templates).length > 0) {
// let cookieObject: LangflowState = JSON.parse(cookie);
// try {
// cookieObject.flows.forEach((flow) => {
// if (!flow.data) {
// return;
// }
// flow.data.edges.forEach((edge) => {
// edge.className = "";
// edge.style = { stroke: "#555555" };
// });
// flow.data.nodes.forEach((node) => {
// const template = templates[node.data.type];
// if (!template) {
// setErrorData({ title: `Unknown node type: ${node.data.type}` });
// return;
// }
// if (Object.keys(template["template"]).length > 0) {
// node.data.node.base_classes = template["base_classes"];
// flow.data.edges.forEach((edge) => {
// if (edge.source === node.id) {
// edge.sourceHandle = edge.sourceHandle
// .split("|")
// .slice(0, 2)
// .concat(template["base_classes"])
// .join("|");
// }
// });
// node.data.node.description = template["description"];
// node.data.node.template = updateTemplate(
// template["template"] as unknown as APITemplateType,
// node.data.node.template as APITemplateType
// );
// }
// });
// });
// setTabIndex(cookieObject.tabIndex);
// setFlows(cookieObject.flows);
// setId(cookieObject.id);
// } catch (e) {
// console.log(e);
// }
// }
// }
function refreshFlows() {
getTabsDataFromDB().then((DbData) => {
if (DbData && Object.keys(templates).length > 0) {
@ -636,16 +583,12 @@ export function TabsProvider({ children }: { children: ReactNode }) {
}
}
const [disableCopyPaste, setDisableCopyPaste] = useState(false);
return (
<TabsContext.Provider
value={{
saveFlow,
lastCopiedSelection,
setLastCopiedSelection,
disableCopyPaste,
setDisableCopyPaste,
hardReset,
tabId,
setTabId,

View file

@ -71,18 +71,7 @@ export function TypesProvider({ children }: { children: ReactNode }) {
// Clear the interval if successful.
clearInterval(intervalId);
} catch (error) {
retryCount++;
// On error, double the delay for the next attempt up to a maximum.
delay = Math.min(30000, delay * 2);
// Log errors but don't do anything else - the function will try again on the next interval.
console.error(error);
// Clear the old interval and start a new one with the new delay.
if (retryCount <= maxRetryCount) {
clearInterval(intervalId);
intervalId = setInterval(getTypes, delay);
} else {
console.error("Max retry attempts reached. Stopping retries.");
}
console.error("An error has occurred while fetching types.");
}
}

View file

@ -7,6 +7,7 @@ import {
useState,
} from "react";
import { Edge, Node, useReactFlow } from "reactflow";
import { isWrappedWithClass } from "../utils/utils";
import { TabsContext } from "./tabsContext";
type undoRedoContextType = {
@ -20,14 +21,6 @@ type UseUndoRedoOptions = {
enableShortcuts: boolean;
};
type UseUndoRedo = (options?: UseUndoRedoOptions) => {
undo: () => void;
redo: () => void;
takeSnapshot: () => void;
canUndo: boolean;
canRedo: boolean;
};
type HistoryItem = {
nodes: Node[];
edges: Edge[];
@ -156,17 +149,21 @@ export function UndoRedoProvider({ children }) {
}
const keyDownHandler = (event: KeyboardEvent) => {
if (
event.key === "z" &&
(event.ctrlKey || event.metaKey) &&
event.shiftKey
) {
redo();
} else if (event.key === "y" && (event.ctrlKey || event.metaKey)) {
event.preventDefault(); // prevent the default action
redo();
} else if (event.key === "z" && (event.ctrlKey || event.metaKey)) {
undo();
if (!isWrappedWithClass(event, "noundo")) {
if (
event.key === "z" &&
(event.ctrlKey || event.metaKey) &&
event.shiftKey
) {
event.preventDefault();
redo();
} else if (event.key === "y" && (event.ctrlKey || event.metaKey)) {
event.preventDefault(); // prevent the default action
redo();
} else if (event.key === "z" && (event.ctrlKey || event.metaKey)) {
event.preventDefault();
undo();
}
}
};

View file

@ -0,0 +1,58 @@
import axios, { AxiosError, AxiosInstance } from "axios";
import { useContext, useEffect, useRef } from "react";
import { alertContext } from "../../contexts/alertContext";
// Create a new Axios instance
const api: AxiosInstance = axios.create({
baseURL: "",
});
function ApiInterceptor() {
const retryCounts = useRef([]);
const { setErrorData } = useContext(alertContext);
useEffect(() => {
const interceptor = api.interceptors.response.use(
(response) => response,
async (error: AxiosError) => {
let retryCount = 0;
while (retryCount < 4) {
await sleep(5000); // Sleep for 5 seconds
retryCount++;
try {
const response = await axios.request(error.config);
return response;
} catch (error) {
if (retryCount === 3) {
setErrorData({
title: "There was an error on web connection, please: ",
list: [
"Refresh the page",
"Use a new flow tab",
"Check if the backend is up",
"Endpoint: " + error.config.url,
],
});
return Promise.reject(error);
}
}
}
}
);
return () => {
// Clean up the interceptor when the component unmounts
api.interceptors.response.eject(interceptor);
};
}, [retryCounts]);
return null;
}
// Function to sleep for a given duration in milliseconds
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
export { ApiInterceptor, api };

View file

@ -1,5 +1,6 @@
import axios, { AxiosResponse } from "axios";
import { AxiosResponse } from "axios";
import { ReactFlowJsonObject } from "reactflow";
import { api } from "../../controllers/API/api";
import { APIObjectType, sendAllProps } from "../../types/api/index";
import { FlowStyleType, FlowType } from "../../types/flow";
import {
@ -17,16 +18,14 @@ import {
* @returns {Promise<AxiosResponse<APIObjectType>>} A promise that resolves to an AxiosResponse containing all the objects.
*/
export async function getAll(): Promise<AxiosResponse<APIObjectType>> {
return await axios.get(`/api/v1/all`);
return await api.get(`/api/v1/all`);
}
const GITHUB_API_URL = "https://api.github.com";
export async function getRepoStars(owner, repo) {
try {
const response = await axios.get(
`${GITHUB_API_URL}/repos/${owner}/${repo}`
);
const response = await api.get(`${GITHUB_API_URL}/repos/${owner}/${repo}`);
return response.data.stargazers_count;
} catch (error) {
console.error("Error fetching repository data:", error);
@ -41,13 +40,13 @@ export async function getRepoStars(owner, repo) {
* @returns {AxiosResponse<any>} The API response.
*/
export async function sendAll(data: sendAllProps) {
return await axios.post(`/api/v1/predict`, data);
return await api.post(`/api/v1/predict`, data);
}
export async function postValidateCode(
code: string
): Promise<AxiosResponse<errorsTypeAPI>> {
return await axios.post("/api/v1/validate/code", { code });
return await api.post("/api/v1/validate/code", { code });
}
/**
@ -62,7 +61,7 @@ export async function postValidatePrompt(
template: string,
frontend_node: APIClassType
): Promise<AxiosResponse<PromptTypeAPI>> {
return await axios.post("/api/v1/validate/prompt", {
return await api.post("/api/v1/validate/prompt", {
name: name,
template: template,
frontend_node: frontend_node,
@ -77,14 +76,14 @@ export async function postValidatePrompt(
export async function getExamples(): Promise<FlowType[]> {
const url =
"https://api.github.com/repos/logspace-ai/langflow_examples/contents/examples?ref=main";
const response = await axios.get(url);
const response = await api.get(url);
const jsonFiles = response.data.filter((file: any) => {
return file.name.endsWith(".json");
});
const contentsPromises = jsonFiles.map(async (file: any) => {
const contentResponse = await axios.get(file.download_url);
const contentResponse = await api.get(file.download_url);
return contentResponse.data;
});
@ -106,11 +105,12 @@ export async function saveFlowToDatabase(newFlow: {
style?: FlowStyleType;
}): Promise<FlowType> {
try {
const response = await axios.post("/api/v1/flows/", {
const response = await api.post("/api/v1/flows/", {
name: newFlow.name,
data: newFlow.data,
description: newFlow.description,
});
if (response.status !== 201) {
throw new Error(`HTTP error! status: ${response.status}`);
}
@ -131,7 +131,7 @@ export async function updateFlowInDatabase(
updatedFlow: FlowType
): Promise<FlowType> {
try {
const response = await axios.patch(`/api/v1/flows/${updatedFlow.id}`, {
const response = await api.patch(`/api/v1/flows/${updatedFlow.id}`, {
name: updatedFlow.name,
data: updatedFlow.data,
description: updatedFlow.description,
@ -155,7 +155,7 @@ export async function updateFlowInDatabase(
*/
export async function readFlowsFromDatabase() {
try {
const response = await axios.get("/api/v1/flows/");
const response = await api.get("/api/v1/flows/");
if (response.status !== 200) {
throw new Error(`HTTP error! status: ${response.status}`);
}
@ -168,7 +168,7 @@ export async function readFlowsFromDatabase() {
export async function downloadFlowsFromDatabase() {
try {
const response = await axios.get("/api/v1/flows/download/");
const response = await api.get("/api/v1/flows/download/");
if (response.status !== 200) {
throw new Error(`HTTP error! status: ${response.status}`);
}
@ -181,7 +181,7 @@ export async function downloadFlowsFromDatabase() {
export async function uploadFlowsToDatabase(flows) {
try {
const response = await axios.post(`/api/v1/flows/upload/`, flows);
const response = await api.post(`/api/v1/flows/upload/`, flows);
if (response.status !== 201) {
throw new Error(`HTTP error! status: ${response.status}`);
@ -202,7 +202,7 @@ export async function uploadFlowsToDatabase(flows) {
*/
export async function deleteFlowFromDatabase(flowId: string) {
try {
const response = await axios.delete(`/api/v1/flows/${flowId}`);
const response = await api.delete(`/api/v1/flows/${flowId}`);
if (response.status !== 200) {
throw new Error(`HTTP error! status: ${response.status}`);
}
@ -222,7 +222,7 @@ export async function deleteFlowFromDatabase(flowId: string) {
*/
export async function getFlowFromDatabase(flowId: number) {
try {
const response = await axios.get(`/api/v1/flows/${flowId}`);
const response = await api.get(`/api/v1/flows/${flowId}`);
if (response.status !== 200) {
throw new Error(`HTTP error! status: ${response.status}`);
}
@ -241,7 +241,7 @@ export async function getFlowFromDatabase(flowId: number) {
*/
export async function getFlowStylesFromDatabase() {
try {
const response = await axios.get("/api/v1/flow_styles/");
const response = await api.get("/api/v1/flow_styles/");
if (response.status !== 200) {
throw new Error(`HTTP error! status: ${response.status}`);
}
@ -261,7 +261,7 @@ export async function getFlowStylesFromDatabase() {
*/
export async function saveFlowStyleToDatabase(flowStyle: FlowStyleType) {
try {
const response = await axios.post("/api/v1/flow_styles/", flowStyle, {
const response = await api.post("/api/v1/flow_styles/", flowStyle, {
headers: {
accept: "application/json",
"Content-Type": "application/json",
@ -284,7 +284,7 @@ export async function saveFlowStyleToDatabase(flowStyle: FlowStyleType) {
* @returns {Promise<AxiosResponse<any>>} A promise that resolves to an AxiosResponse containing the version information.
*/
export async function getVersion() {
const respnose = await axios.get("/api/v1/version");
const respnose = await api.get("/api/v1/version");
return respnose.data;
}
@ -294,7 +294,7 @@ export async function getVersion() {
* @returns {Promise<AxiosResponse<any>>} A promise that resolves to an AxiosResponse containing the health status.
*/
export async function getHealth() {
return await axios.get("/health"); // Health is the only endpoint that doesn't require /api/v1
return await api.get("/health"); // Health is the only endpoint that doesn't require /api/v1
}
/**
@ -306,7 +306,7 @@ export async function getHealth() {
export async function getBuildStatus(
flowId: string
): Promise<BuildStatusTypeAPI> {
return await axios.get(`/api/v1/build/${flowId}/status`);
return await api.get(`/api/v1/build/${flowId}/status`);
}
//docs for postbuildinit
@ -319,7 +319,7 @@ export async function getBuildStatus(
export async function postBuildInit(
flow: FlowType
): Promise<AxiosResponse<InitTypeAPI>> {
return await axios.post(`/api/v1/build/init/${flow.id}`, flow);
return await api.post(`/api/v1/build/init/${flow.id}`, flow);
}
// fetch(`/upload/${id}`, {
@ -337,5 +337,5 @@ export async function uploadFile(
): Promise<AxiosResponse<UploadFileTypeAPI>> {
const formData = new FormData();
formData.append("file", file);
return await axios.post(`/api/v1/upload/${id}`, formData);
return await api.post(`/api/v1/upload/${id}`, formData);
}

View file

@ -0,0 +1,23 @@
const SvgAirbyte = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
xmlSpace="preserve"
style={{
enableBackground: "new 0 0 841.89 595.28",
}}
viewBox="0 0 841.89 595.28"
width="1em"
height="1em"
{...props}
>
<path
d="M349.6 124.45c48.94-54.99 129.98-71.12 196.61-39.38 88.52 42.17 120.82 149.6 72.62 232.48L510.41 503.76c-6.06 10.41-16.03 18-27.72 21.11a45.99 45.99 0 0 1-34.64-4.51l131.26-225.49c34.97-60.15 11.58-138.11-52.6-168.8-48.16-23.03-107.02-11.53-142.6 28.08-19.62 21.74-30.64 49.82-31.01 79.01-.37 29.2 9.94 57.53 29.01 79.76 3.43 3.99 7.12 7.75 11.04 11.25l-76.63 131.88c-3 5.16-6.99 9.67-11.74 13.3a45.845 45.845 0 0 1-15.97 7.82 46.098 46.098 0 0 1-17.77 1.16 46.124 46.124 0 0 1-16.87-5.68l83.19-143.17a164.492 164.492 0 0 1-25.29-56.58l-50.97 87.9c-6.06 10.41-16.03 18-27.72 21.11a45.99 45.99 0 0 1-34.64-4.51l131.83-226.76a168.65 168.65 0 0 1 19.03-26.19zm152.16 72.18c31.75 18.21 42.71 58.7 24.34 90.22L399.69 503.74c-6.06 10.41-16.03 18-27.72 21.11a45.99 45.99 0 0 1-34.64-4.51l117.38-201.93a66.675 66.675 0 0 1-26.01-11.65 66.228 66.228 0 0 1-18.7-21.4 65.82 65.82 0 0 1-7.95-27.22c-.64-9.54.82-19.1 4.27-28.02 3.45-8.92 8.8-17 15.7-23.67a66.558 66.558 0 0 1 24.24-14.95c9.08-3.18 18.74-4.37 28.32-3.49s18.85 3.82 27.18 8.62zm-45.98 40.76c-2.17 1.66-4 3.72-5.36 6.08h-.01a20.613 20.613 0 0 0-2.75 11.71c.27 4.09 1.76 8 4.27 11.25s5.94 5.69 9.84 7c3.91 1.32 8.12 1.45 12.1.39 3.99-1.06 7.56-3.27 10.28-6.35 2.72-3.08 4.46-6.89 5-10.95s-.15-8.19-1.97-11.87a20.806 20.806 0 0 0-8.28-8.78 20.964 20.964 0 0 0-15.83-2.07c-2.64.72-5.12 1.93-7.29 3.59z"
style={{
fillRule: "evenodd",
clipRule: "evenodd",
fill: "#505aa5",
}}
/>
</svg>
);
export default SvgAirbyte;

View file

@ -1,9 +1,9 @@
import React, { forwardRef } from "react";
import { ReactComponent as AirbyteSVG } from "./airbyte.svg";
import SvgAirbyte from "./Airbyte";
export const AirbyteIcon = forwardRef<
SVGSVGElement,
React.PropsWithChildren<{}>
>((props, ref) => {
return <AirbyteSVG ref={ref} {...props} />;
return <SvgAirbyte ref={ref} {...props} />;
});

View file

@ -0,0 +1,17 @@
const SvgAnthropic = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
viewBox="-170.333 113.047 600 67.4"
{...props}
>
<path
d="M-23.533 126.747h21.9v52.6h14v-52.6h21.9v-12.6h-57.8v12.6Zm-24.6 33-29.3-45.6h-15.8v65.1h13.5v-45.6l29.3 45.7h15.8v-65.1h-13.5v45.5Zm138.2-19.6h-30.7v-26h-14v65.1h14v-26.6h30.7v26.6h14v-65.1h-14v26Zm-234.4-26-26 65.1h14.5l5.3-13.7h27.2l5.3 13.7h14.5l-26-65.1h-14.8Zm-1.5 39.4 8.9-22.9 8.9 22.9h-17.8Zm365.5-40.5c-18.8 0-32.1 14-32.1 33.8 0 19.6 13.3 33.6 32.1 33.6 18.7 0 31.9-14 31.9-33.6 0-19.8-13.2-33.8-31.9-33.8Zm0 54.4c-11 0-17.7-7.8-17.7-20.6 0-12.9 6.7-20.8 17.7-20.8 10.9 0 17.5 7.8 17.5 20.8 0 12.7-6.6 20.6-17.5 20.6Zm195.1-10c-2.4 6.3-7.3 10-13.9 10-11 0-17.7-7.8-17.7-20.6 0-12.9 6.7-20.8 17.7-20.8 6.6 0 11.4 3.6 13.9 10h14.8c-3.6-14-14.5-23-28.7-23-18.8 0-32.1 14-32.1 33.8 0 19.6 13.3 33.6 32.1 33.6 14.2 0 25.1-9.1 28.8-23h-14.9Zm-88.9-43.3 26 65.1h14.2l-26-65.1h-14.2Zm-29.5 0h-31.8v65.1h14v-23.6h17.9c14.8 0 23.8-7.8 23.8-20.8 0-12.9-9.1-20.7-23.9-20.7Zm-.6 29h-17.2v-16.4h17.2c6.9 0 10.5 2.8 10.5 8.2 0 5.4-3.6 8.2-10.5 8.2Zm-118.9-9.1c0-12.3-9-19.8-23.8-19.8h-31.8v65.1h14v-25.5h15.5l14 25.5h15.4l-15.5-27.4c7.7-3.1 12.2-9.3 12.2-17.9Zm-41.7-7.3h17.2c6.9 0 10.5 2.5 10.5 7.3 0 4.7-3.6 7.3-10.5 7.3h-17.2v-14.6Z"
style={{
fill: "#1f1f1e",
}}
/>
</svg>
);
export default SvgAnthropic;

View file

@ -0,0 +1,18 @@
const SvgAnthropicBox = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
viewBox="-126.9 247.9 207.161 212.728"
{...props}
>
<defs>
<style>{".anthropic_box_svg__st0{fill:#1f1f1e}"}</style>
</defs>
<path
d="M19.9 260.5h21.9v52.6h14v-52.6h21.9v-12.6H19.9v12.6Zm-24.6 33L-34 247.9h-15.8V313h13.5v-45.6L-7 313.1H8.8V248H-4.7v45.5Zm-96.2-45.6-26 65.1h14.5l5.3-13.7h27.2l5.3 13.7h14.5l-26-65.1h-14.8Zm-1.5 39.4 8.9-22.9 8.9 22.9h-17.8ZM38.246 437.628c-2.4 6.3-7.3 10-13.9 10-11 0-17.7-7.8-17.7-20.6 0-12.9 6.7-20.8 17.7-20.8 6.6 0 11.4 3.6 13.9 10h14.8c-3.6-14-14.5-23-28.7-23-18.8 0-32.1 14-32.1 33.8 0 19.6 13.3 33.6 32.1 33.6 14.2 0 25.1-9.1 28.8-23h-14.9Zm-88.9-43.3 26 65.1h14.2l-26-65.1h-14.2Zm-29.5 0h-31.8v65.1h14v-23.6h17.9c14.8 0 23.8-7.8 23.8-20.8 0-12.9-9.1-20.7-23.9-20.7Zm-.6 29h-17.2v-16.4h17.2c6.9 0 10.5 2.8 10.5 8.2 0 5.4-3.6 8.2-10.5 8.2ZM-81.239 347.704h-30.7v-26h-14v65.1h14v-26.6h30.7v26.6h14v-65.1h-14v26Zm129.6-27.1c-18.8 0-32.1 14-32.1 33.8 0 19.6 13.3 33.6 32.1 33.6 18.7 0 31.9-14 31.9-33.6 0-19.8-13.2-33.8-31.9-33.8Zm0 54.4c-11 0-17.7-7.8-17.7-20.6 0-12.9 6.7-20.8 17.7-20.8 10.9 0 17.5 7.8 17.5 20.8 0 12.7-6.6 20.6-17.5 20.6Zm-42.8-33.4c0-12.3-9-19.8-23.8-19.8h-31.8v65.1h14v-25.5h15.5l14 25.5h15.4l-15.5-27.4c7.7-3.1 12.2-9.3 12.2-17.9Zm-41.7-7.3h17.2c6.9 0 10.5 2.5 10.5 7.3 0 4.7-3.6 7.3-10.5 7.3h-17.2v-14.6Z"
className="anthropic_box_svg__st0"
/>
</svg>
);
export default SvgAnthropicBox;

View file

@ -1,9 +1,9 @@
import React, { forwardRef } from "react";
import { ReactComponent as AnthropicSVG } from "./anthropic_box.svg";
import SvgAnthropicBox from "./AnthropicBox";
export const AnthropicIcon = forwardRef<
SVGSVGElement,
React.PropsWithChildren<{}>
>((props, ref) => {
return <AnthropicSVG ref={ref} {...props} />;
return <SvgAnthropicBox ref={ref} {...props} />;
});

View file

@ -0,0 +1,17 @@
const SvgAzLogo = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
xmlSpace="preserve"
width="1em"
height="1em"
viewBox="0 0 103 103"
{...props}
>
<image
width={103}
height={103}
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGcAAABnCAYAAAAdQVz5AAAABGdBTUEAALGPC/xhBQAAACBjSFJN AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAC gXpUWHRSYXcgcHJvZmlsZSB0eXBlIHhtcAAAOI2VVV3WnTAIfGcVXUIEAslyvGreek4fu/wOeH+s 2vbr9dyohDAwTCL9/P6DvsWvaSNZZHjzYpOJPay6cjG2am7dNlmZt/F4PAYz7N00LNWl6ipFVy8q 8G3WSZvPjoVVfNatquGOgCJYxCxDNi6yeJPZm2GhrQFmE5d4t8U2l5ijQEA2aiPykHmfeLtnJp8w sD1ihb5XcKlN11qII7nhaZLKmxRekU8RE6BiVNgmUVg6xs4LrIy3CZ4DI2Ms4sRrmGQW1IaxxPLT xc/yGFmYzJVV1U6lMeVklNdccSEkyhmeP94cXrxlxp74Pa7MITJhjOsOgIxcHP0JRryhLCDE/O9Z IAW0Co1g68lUB0PweM3bRCBsOIiNrHZij70IgnVFqy85J+D2aRPhBWTbinIackoCk3LYwnoJLq41 dHYihO6i/zl4KNFRHHxGhHPJetiEIMWMH7zcFfbvonZYusN9hXzyM2t0re+bBgEWjRDiNWQbbdKu msreFyGy5m6aQ3haZVJGs2EUgXIq9lYVgQQmhQwVapIGG5xDtqRTPjQIsl8yuUG+A0YMZMRqz+gV uNhFKf8J6Mgr7zU8MI+8YGMAC7waNs8BmBI5BCkhSQvi6gW5f5APwHoEpv9DRrBQd0VzNDZOjeKH LbLS6UgoOKRGOkk+lTgdwHGcC9jOde9czGMbvjcSQOhAbM2dZMDDC55DkuWg5Nn+QgEdOUAZE5rd Yy1KjeZyyuDV9mAkCm8oO/jKf7ZpojjCkoMj8hfbftQbfVVwJ709z3Ier4OE7k+as9t+Kr6tl0+B bBRTNx+kGr3Jcnj/ltAv3lyKr0wOoNMAAAZzSURBVHja7Z1LT1tHFMd/Y2wDtiFpeBuT8LIc0qSq BInUbqJAWFWqVAkpUnb9CpGSqFI/QGIp/RDdRapaKVJWLQsWySJRRDetgFCQCeERDAnCvPyALhxH gA2BY98HvvOTLKHB5/rcOT4z/zn33rF68OBPClABfA8MARHg649tmtKQAf4GxoHfgCf379/MHHyT q4BhBHgO/A7cBnrRgSk1FWT79TbZfn7+8OFfkYNvciml2PO6o5QaVUpdO9CuX8a+rimlRqPR4Tv7 grPn7yjwCKi2+mvlUKqBR9HocDTXkAvOLeCu1d5pALgbjQ7fAlDR6LAXmAJarfZK84lJ4EsXWUWm A2MvuoEht1LqO6s90RTkOxdZSaexH9+4lVLNVnuhKUirCzhjtReagnjdSimrndAcgqv4Q2iMQmeO jdGZY2N05tgYt1EHvn69k4aGgCknMTLyH0tL64f+f2joK1P8OIylpQQjI1MntjMkcwYHw1y61GTa yVdVeTjqPEIh61cLkn4ueXAGB8P09DSafuJ2H54l/pVUEFgRmHKmZJlz82a3hYGxd+YoZeGwNjDQ TU9Pw6k7eRM9tGZYszow5UxRmTMw0MXFi9YHplwFgTg4/f2dtghM7sTLMTiiYa21tdY2gSlnhJlj t2+pvTPHVLVmt34oV7VmWG3tMMbH44yPx/PaI5F6IpF6Qz7zyZOxoo9RU1PJjRsdItvt7bTITpg5 8m/p2lqS+flEXnswWCs+5ucEQaHPOyn19X6xbSy2auawJg/OYUNQMaOSGWrtyhVZITeZzDAxsWym lC6mIw7rSCOOWRrq6qqpqfGKbKWBAX0l9FhcviyvGU5MLIttTVdrxgxrxqq19vazIrvl5U1WVrbE vpk+5xgxrBk554TD5/B6Zc+OvX69UpRfWhB8hgsX5FdRJyffF+WXnnOOIBDwioMTi62STGZEtjm0 WjuCcPic2LbYrAEtCI4kHP5CZJdMZnjzZs2q4Ngrc4yYc5qb/QQCsrXN5OSHkvijBcEhdHfLsgZg bEy+8NyLFgQF8HoraGurEdmurGyRSKRK4ocWBAU4f75WvLYZGytubbMXLQgK0NV1Vmw7O5uwOjj2 ypxSzjl+v4emJp/IdmpqlVRq5/QGx+6CoKtLXhEoZdaAFgR5dHbKgrO+nmJ2tviLenvRgmAPjY0+ /H6PyLbUWQNaEOyjs1N+qXxiQnYp+ii0IPiIx+MiFJI97PXhwzYbG+nTHxy7CoJQKIDHI5uCjcga 0HPOJzo6ZBWBVGqHubkNQ4Kj1Rrg97tpaJDtAfj27Tqp1I4hfmlBAITDZ8W2sVjpVVoOLQiA1lZZ RWBjI008vl0+wbGbIAgGffh8sruSjcwa0IKAYFCWNQAzM8YIgRyOnnM8Hhfnz8vugY7Ht9nczBga HEertZYW+S7NMzPrYtvj4mhB0NUlX9ssLMjv5DwujhUEPl8FZ87IipwLC1uk07v2DE45CILOTlnW AExNrZvyJJ1jBUFzc5XoszY2Mqytlb7IWQhHCoLm5ip8PtkNHNPTxguBHKbPOW1tPurqKvPapZ2V 8+ckPkmzBmBx0biKwEFMD051dQXV1aX9OZ6TBMfjUYRCMgm9uLjN1lbpbuD4HI7bh6Cp6XRkDThw H4L2dlm5JpXaZW7O3OA4ShDU1rqprZUVOd+92zbdXwsqBKXnuHNOa6t8SIvFjK8IHEQH5xhsbu6Q SBhb5CyEYwRBY6MXt1vm98yM+VkDDppzWlpkD0IBzM2ZP9+AQ9Sa261obJQFZ2kpRSZjzVDuiDkn GKw8wdH2Mz+ftOx8HRIcWdak07vE4+YUOQth+n5r09NbTE/nj+EdHZV0dMil7lEEArJykdut6O8v fqv99+/TjI6evGDq2Os5ZnJqtpG0y/Ucc7Fo02+NcTj6Bg8z0dtI2hg9rJUZWq2ZgFZrNg6OVmtl iFZrJqHVmo0R9fOzZ1u7VjuuKYz+hV0bowWBjdGZY2N05tgYt1JqFbD+x5s1B0m4gAWrvdAU5K1b KfUKiFjtiSaPVy7gqdVeaAryVL14kfEC/wDdVnuj+cQ0cNEFJIGfrfZGs4+frl51JXPrnMfANeCO 1V5p+KWvTz2G/euce2QzKGm1dw4lN4LdyzWoly/zNnKLAL+SzSSNObwAfuzrU//ubSxUvhkHvgV+ AIbICoVeq70vQ16RnfgfA3/09pL3M1X/AznvTJ80sftLAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIz LTA1LTI5VDIzOjEwOjMwKzAwOjAwEYyoUQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMy0wNS0yOVQy MzoxMDozMCswMDowMGDREO0AAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjMtMDUtMjlUMjM6MTA6 MzArMDA6MDA3xDEyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5E rkJggg=="
/>
</svg>
);
export default SvgAzLogo;

View file

@ -1,8 +1,8 @@
import React, { forwardRef } from "react";
import { ReactComponent as AzSVG } from "./az_logo.svg";
import SvgAzLogo from "./AzLogo";
export const AzIcon = forwardRef<SVGSVGElement, React.PropsWithChildren<{}>>(
(props, ref) => {
return <AzSVG ref={ref} {...props} />;
return <SvgAzLogo ref={ref} {...props} />;
}
);

View file

@ -0,0 +1,94 @@
const SvgBing = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
viewBox="-29.622 0.1 574.392 799.81"
{...props}
>
<linearGradient
id="bing_svg__a"
x1={286.383}
x2={542.057}
y1={284.169}
y2={569.112}
gradientUnits="userSpaceOnUse"
>
<stop offset={0} stopColor="#37bdff" />
<stop offset={0.25} stopColor="#26c6f4" />
<stop offset={0.5} stopColor="#15d0e9" />
<stop offset={0.75} stopColor="#3bd6df" />
<stop offset={1} stopColor="#62dcd4" />
</linearGradient>
<linearGradient
id="bing_svg__b"
x1={108.979}
x2={100.756}
y1={675.98}
y2={43.669}
gradientUnits="userSpaceOnUse"
>
<stop offset={0} stopColor="#1b48ef" />
<stop offset={0.5} stopColor="#2080f1" />
<stop offset={1} stopColor="#26b8f4" />
</linearGradient>
<linearGradient
id="bing_svg__c"
x1={256.823}
x2={875.632}
y1={649.719}
y2={649.719}
gradientUnits="userSpaceOnUse"
>
<stop offset={0} stopColor="#39d2ff" />
<stop offset={0.5} stopColor="#248ffa" />
<stop offset={1} stopColor="#104cf5" />
</linearGradient>
<linearGradient
id="bing_svg__d"
x1={256.823}
x2={875.632}
y1={649.719}
y2={649.719}
gradientUnits="userSpaceOnUse"
>
<stop offset={0} stopColor="#fff" />
<stop offset={1} />
</linearGradient>
<path
fill="#7f7f7f"
d="M249.97 277.48c-.12.96-.12 2.05-.12 3.12 0 4.16.83 8.16 2.33 11.84l1.34 2.76 5.3 13.56 27.53 70.23 24.01 61.33c6.85 12.38 17.82 22.1 31.05 27.28l4.11 1.51c.16.05.43.05.65.11l65.81 22.63v.05l25.16 8.64 1.72.58c.06 0 .16.06.22.06 4.96 1.25 9.82 2.93 14.46 4.98 10.73 4.63 20.46 11.23 28.77 19.28 3.35 3.2 6.43 6.65 9.28 10.33a88.64 88.64 0 0 1 6.64 9.72c8.78 14.58 13.82 31.72 13.82 49.97 0 3.26-.16 6.41-.49 9.61-.11 1.41-.28 2.77-.49 4.12v.11c-.22 1.43-.49 2.91-.76 4.36-.28 1.41-.54 2.81-.86 4.21-.05.16-.11.33-.17.49-.3 1.42-.68 2.82-1.07 4.23-.35 1.33-.79 2.7-1.28 3.99a42.96 42.96 0 0 1-1.51 4.16c-.49 1.4-1.07 2.82-1.72 4.16-1.78 4.11-3.9 8.06-6.28 11.83a97.889 97.889 0 0 1-10.47 13.95c30.88-33.2 51.41-76.07 56.52-123.51.86-7.78 1.3-15.67 1.3-23.61 0-5.07-.22-10.09-.55-15.13-3.89-56.89-29.79-107.77-69.32-144.08-10.9-10.09-22.81-19.07-35.62-26.69l-24.2-12.37-122.63-62.93a30.15 30.15 0 0 0-11.93-2.44c-15.88 0-28.99 12.11-30.55 27.56z"
/>
<path
fill="url(#bing_svg__a)"
d="M249.97 277.48c-.12.96-.12 2.05-.12 3.12 0 4.16.83 8.16 2.33 11.84l1.34 2.76 5.3 13.56 27.53 70.23 24.01 61.33c6.85 12.38 17.82 22.1 31.05 27.28l4.11 1.51c.16.05.43.05.65.11l65.81 22.63v.05l25.16 8.64 1.72.58c.06 0 .16.06.22.06 4.96 1.25 9.82 2.93 14.46 4.98 10.73 4.63 20.46 11.23 28.77 19.28 3.35 3.2 6.43 6.65 9.28 10.33a88.64 88.64 0 0 1 6.64 9.72c8.78 14.58 13.82 31.72 13.82 49.97 0 3.26-.16 6.41-.49 9.61-.11 1.41-.28 2.77-.49 4.12v.11c-.22 1.43-.49 2.91-.76 4.36-.28 1.41-.54 2.81-.86 4.21-.05.16-.11.33-.17.49-.3 1.42-.68 2.82-1.07 4.23-.35 1.33-.79 2.7-1.28 3.99a42.96 42.96 0 0 1-1.51 4.16c-.49 1.4-1.07 2.82-1.72 4.16-1.78 4.11-3.9 8.06-6.28 11.83a97.889 97.889 0 0 1-10.47 13.95c30.88-33.2 51.41-76.07 56.52-123.51.86-7.78 1.3-15.67 1.3-23.61 0-5.07-.22-10.09-.55-15.13-3.89-56.89-29.79-107.77-69.32-144.08-10.9-10.09-22.81-19.07-35.62-26.69l-24.2-12.37-122.63-62.93a30.15 30.15 0 0 0-11.93-2.44c-15.88 0-28.99 12.11-30.55 27.56z"
/>
<path
fill="#7f7f7f"
d="M31.62.1C14.17.41.16 14.69.16 32.15v559.06c.07 3.9.29 7.75.57 11.66.25 2.06.52 4.2.9 6.28 7.97 44.87 47.01 78.92 94.15 78.92 16.53 0 32.03-4.21 45.59-11.53.08-.06.22-.14.29-.14l4.88-2.95 19.78-11.64 25.16-14.93.06-496.73c0-33.01-16.52-62.11-41.81-79.4-.6-.36-1.18-.74-1.71-1.17L50.12 5.56C45.16 2.28 39.18.22 32.77.1z"
/>
<path
fill="url(#bing_svg__b)"
d="M31.62.1C14.17.41.16 14.69.16 32.15v559.06c.07 3.9.29 7.75.57 11.66.25 2.06.52 4.2.9 6.28 7.97 44.87 47.01 78.92 94.15 78.92 16.53 0 32.03-4.21 45.59-11.53.08-.06.22-.14.29-.14l4.88-2.95 19.78-11.64 25.16-14.93.06-496.73c0-33.01-16.52-62.11-41.81-79.4-.6-.36-1.18-.74-1.71-1.17L50.12 5.56C45.16 2.28 39.18.22 32.77.1z"
/>
<path
fill="#7f7f7f"
d="M419.81 510.84 194.72 644.26l-3.24 1.95v.71l-25.16 14.9-19.77 11.67-4.85 2.93-.33.16c-13.53 7.35-29.04 11.51-45.56 11.51-47.13 0-86.22-34.03-94.16-78.92 3.77 32.84 14.96 63.41 31.84 90.04 34.76 54.87 93.54 93.04 161.54 99.67h41.58c36.78-3.84 67.49-18.57 99.77-38.46l49.64-30.36c22.36-14.33 83.05-49.58 100.93-69.36 3.89-4.33 7.4-8.97 10.47-13.94 2.38-3.78 4.5-7.73 6.28-11.84.6-1.4 1.17-2.76 1.72-4.15.52-1.38 1.01-2.77 1.51-4.18.93-2.7 1.67-5.41 2.38-8.2.36-1.59.69-3.16 1.02-4.72 1.08-5.89 1.67-11.94 1.67-18.21 0-18.25-5.04-35.39-13.77-49.95-2-3.4-4.2-6.65-6.64-9.72-2.85-3.7-5.93-7.13-9.28-10.33-8.31-8.05-18.01-14.65-28.77-19.29-4.64-2.05-9.48-3.74-14.46-4.97-.06 0-.16-.06-.22-.06l-1.72-.58z"
/>
<path
fill="url(#bing_svg__c)"
d="M419.81 510.84 194.72 644.26l-3.24 1.95v.71l-25.16 14.9-19.77 11.67-4.85 2.93-.33.16c-13.53 7.35-29.04 11.51-45.56 11.51-47.13 0-86.22-34.03-94.16-78.92 3.77 32.84 14.96 63.41 31.84 90.04 34.76 54.87 93.54 93.04 161.54 99.67h41.58c36.78-3.84 67.49-18.57 99.77-38.46l49.64-30.36c22.36-14.33 83.05-49.58 100.93-69.36 3.89-4.33 7.4-8.97 10.47-13.94 2.38-3.78 4.5-7.73 6.28-11.84.6-1.4 1.17-2.76 1.72-4.15.52-1.38 1.01-2.77 1.51-4.18.93-2.7 1.67-5.41 2.38-8.2.36-1.59.69-3.16 1.02-4.72 1.08-5.89 1.67-11.94 1.67-18.21 0-18.25-5.04-35.39-13.77-49.95-2-3.4-4.2-6.65-6.64-9.72-2.85-3.7-5.93-7.13-9.28-10.33-8.31-8.05-18.01-14.65-28.77-19.29-4.64-2.05-9.48-3.74-14.46-4.97-.06 0-.16-.06-.22-.06l-1.72-.58z"
/>
<path
fill="#7f7f7f"
d="M512 595.46c0 6.27-.59 12.33-1.68 18.22-.32 1.56-.65 3.12-1.02 4.7-.7 2.8-1.44 5.51-2.37 8.22-.49 1.4-.99 2.8-1.51 4.16-.54 1.4-1.12 2.76-1.73 4.16a87.873 87.873 0 0 1-6.26 11.83 96.567 96.567 0 0 1-10.48 13.94c-17.88 19.79-78.57 55.04-100.93 69.37l-49.64 30.36c-36.39 22.42-70.77 38.29-114.13 39.38-2.05.06-4.06.11-6.05.11-2.8 0-5.56-.05-8.33-.16-73.42-2.8-137.45-42.25-174.38-100.54a213.368 213.368 0 0 1-31.84-90.04c7.94 44.89 47.03 78.92 94.16 78.92 16.52 0 32.03-4.17 45.56-11.51l.33-.17 4.85-2.92 19.77-11.67 25.16-14.9v-.71l3.24-1.95 225.09-133.43 17.33-10.27 1.72.58c.05 0 .16.06.22.06 4.98 1.23 9.83 2.92 14.46 4.97 10.76 4.64 20.45 11.24 28.77 19.29a92.13 92.13 0 0 1 9.28 10.33c2.44 3.07 4.64 6.32 6.64 9.72 8.73 14.56 13.77 31.7 13.77 49.95z"
opacity={0.15}
/>
<path
fill="url(#bing_svg__d)"
d="M512 595.46c0 6.27-.59 12.33-1.68 18.22-.32 1.56-.65 3.12-1.02 4.7-.7 2.8-1.44 5.51-2.37 8.22-.49 1.4-.99 2.8-1.51 4.16-.54 1.4-1.12 2.76-1.73 4.16a87.873 87.873 0 0 1-6.26 11.83 96.567 96.567 0 0 1-10.48 13.94c-17.88 19.79-78.57 55.04-100.93 69.37l-49.64 30.36c-36.39 22.42-70.77 38.29-114.13 39.38-2.05.06-4.06.11-6.05.11-2.8 0-5.56-.05-8.33-.16-73.42-2.8-137.45-42.25-174.38-100.54a213.368 213.368 0 0 1-31.84-90.04c7.94 44.89 47.03 78.92 94.16 78.92 16.52 0 32.03-4.17 45.56-11.51l.33-.17 4.85-2.92 19.77-11.67 25.16-14.9v-.71l3.24-1.95 225.09-133.43 17.33-10.27 1.72.58c.05 0 .16.06.22.06 4.98 1.23 9.83 2.92 14.46 4.97 10.76 4.64 20.45 11.24 28.77 19.29a92.13 92.13 0 0 1 9.28 10.33c2.44 3.07 4.64 6.32 6.64 9.72 8.73 14.56 13.77 31.7 13.77 49.95z"
opacity={0.15}
/>
</svg>
);
export default SvgBing;

View file

@ -1,8 +1,8 @@
import React, { forwardRef } from "react";
import { ReactComponent as BingSVG } from "./bing.svg";
import SvgBing from "./Bing";
export const BingIcon = forwardRef<SVGSVGElement, React.PropsWithChildren<{}>>(
(props, ref) => {
return <BingSVG ref={ref} {...props} />;
return <SvgBing ref={ref} {...props} />;
}
);

View file

@ -0,0 +1,22 @@
const SvgChroma = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
fill="none"
viewBox="0 0 209 135"
{...props}
>
<ellipse cx={136.019} cy={67.23} fill="#FFDE2D" rx={66.667} ry={64} />
<ellipse cx={69.352} cy={67.23} fill="#327EFF" rx={66.667} ry={64} />
<path
fill="#327EFF"
d="M2.685 67.23c0-35.346 29.848-64 66.667-64v64H2.685Z"
/>
<path
fill="#FF6446"
d="M136.019 67.23c0 35.347-29.848 64-66.667 64v-64h66.667ZM69.352 67.23c0-35.346 29.848-64 66.667-64v64H69.352Z"
/>
</svg>
);
export default SvgChroma;

View file

@ -1,9 +1,9 @@
import React, { forwardRef } from "react";
import { ReactComponent as ChromaSVG } from "./chroma.svg";
import SvgChroma from "./Chroma";
export const ChromaIcon = forwardRef<
SVGSVGElement,
React.PropsWithChildren<{}>
>((props, ref) => {
return <ChromaSVG ref={ref} {...props} />;
return <SvgChroma ref={ref} {...props} />;
});

View file

@ -0,0 +1,52 @@
const SvgCohere = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="165.883 110.821 117.8 117.78"
width="1em"
height="1em"
{...props}
>
<g transform="translate(97.843 -127.708)">
<clipPath id="cohere_svg__a">
<path
d="M68.05 238.52h117.78V356.3H68.05z"
style={{
overflow: "visible",
}}
/>
</clipPath>
<g
style={{
clipPath: "url(#cohere_svg__a)",
}}
>
<path
d="M106.21 308.65c3.17 0 9.48-.17 18.19-3.76 10.16-4.18 30.37-11.77 44.94-19.57 10.2-5.45 14.66-12.67 14.66-22.38 0-13.48-10.93-24.41-24.41-24.41H103.1c-19.37 0-35.06 15.7-35.06 35.06s14.71 35.06 38.17 35.06z"
className="cohere_svg__st2"
style={{
clipRule: "evenodd",
fill: "#3a594d",
fillRule: "evenodd",
}}
/>
<path
d="M115.77 332.79c0-9.49 5.71-18.05 14.48-21.69l17.79-7.38c17.99-7.47 37.8 5.76 37.8 25.24 0 15.09-12.24 27.33-27.33 27.32h-19.26c-12.97-.01-23.48-10.52-23.48-23.49z"
className="cohere_svg__st3"
style={{
clipRule: "evenodd",
fill: "#bd8fc0",
fillRule: "evenodd",
}}
/>
<path
d="M88.27 313.27c-11.16 0-20.21 9.05-20.21 20.21v2.62c0 11.16 9.05 20.21 20.21 20.21s20.21-9.05 20.21-20.21v-2.62c0-11.16-9.05-20.21-20.21-20.21z"
className="cohere_svg__st4"
style={{
fill: "#ee765c",
}}
/>
</g>
</g>
</svg>
);
export default SvgCohere;

View file

@ -1,9 +1,9 @@
import React, { forwardRef } from "react";
import { ReactComponent as CohereSVG } from "./cohere.svg";
import SvgCohere from "./Cohere";
export const CohereIcon = forwardRef<
SVGSVGElement,
React.PropsWithChildren<{}>
>((props, ref) => {
return <CohereSVG ref={ref} {...props} />;
return <SvgCohere ref={ref} {...props} />;
});

View file

@ -0,0 +1,13 @@
const SvgEvernoteIcon = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
fill="#7fce2c"
viewBox="0 0 32 32"
{...props}
>
<path d="M29.343 16.818c.1 1.695-.08 3.368-.305 5.045-.225 1.712-.508 3.416-.964 5.084-.3 1.067-.673 2.1-1.202 3.074-.65 1.192-1.635 1.87-2.992 1.924l-3.832.036c-.636-.017-1.278-.146-1.9-.297-1.192-.3-1.862-1.1-2.06-2.3a8.976 8.976 0 0 1 .04-3.264c.252-1.23 1-1.96 2.234-2.103.817-.1 1.65-.077 2.476-.1.205-.007.275.098.203.287a2.695 2.695 0 0 0-.098 1.623c.053.207-.023.307-.26.305a7.77 7.77 0 0 0-1.123.053c-.636.086-.96.47-.96 1.112 0 .205.026.416.066.622.103.507.45.78.944.837 1.123.127 2.247.138 3.37-.05.675-.114 1.08-.54 1.16-1.208.152-1.3.155-2.587-.228-3.845-.33-1.092-1.006-1.565-2.134-1.7l-3.36-.54c-1.06-.193-1.7-.887-1.92-1.9-.13-.572-.14-1.17-.214-1.757-.013-.106-.074-.208-.1-.3-.04.1-.106.212-.117.326-.066.68-.053 1.373-.185 2.04-.16.8-.404 1.566-.67 2.33-.185.535-.616.837-1.205.8a37.76 37.76 0 0 1-7.123-1.353l-.64-.207c-.927-.26-1.487-.903-1.74-1.787l-1-3.853-.74-4.3c-.115-.755-.2-1.523-.083-2.293.154-1.112.914-1.903 2.04-1.964l3.558-.062c.127 0 .254.003.373-.026a1.23 1.23 0 0 0 1.01-1.255l-.05-3.036c-.048-1.576.8-2.38 2.156-2.622a10.58 10.58 0 0 1 4.91.26c.933.275 1.467.923 1.715 1.83.058.22.146.3.37.287l2.582.01 3.333.37c.686.095 1.364.25 2.032.42 1.165.298 1.793 1.112 1.962 2.256l.357 3.355.3 5.577.01 2.277zm-4.534-1.155c-.02-.666-.07-1.267-.444-1.784a1.66 1.66 0 0 0-2.469-.15c-.364.4-.494.88-.564 1.4-.008.034.106.126.16.126l.8-.053c.768.007 1.523.113 2.25.393.066.026.136.04.265.077zM8.787 1.154a3.82 3.82 0 0 0-.278 1.592l.05 2.934c.005.357-.075.45-.433.45L5.1 6.156c-.583 0-1.143.1-1.554.278l5.2-5.332c.02.013.04.033.06.053z" />
</svg>
);
export default SvgEvernoteIcon;

View file

@ -1,9 +1,9 @@
import React, { forwardRef } from "react";
import { ReactComponent as EvernoteSVG } from "./evernote-icon.svg";
import SvgEvernoteIcon from "./EvernoteIcon";
export const EvernoteIcon = forwardRef<
SVGSVGElement,
React.PropsWithChildren<{}>
>((props, ref) => {
return <EvernoteSVG ref={ref} {...props} />;
return <SvgEvernoteIcon ref={ref} {...props} />;
});

View file

@ -0,0 +1,52 @@
const SvgFacebookMessengerLogo2020 = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 800 800"
width="1em"
height="1em"
{...props}
>
<radialGradient
id="Facebook_Messenger_logo_2020_svg__a"
cx={101.9}
cy={809}
r={1.1}
gradientTransform="matrix(800 0 0 -800 -81386 648000)"
gradientUnits="userSpaceOnUse"
>
<stop
offset={0}
style={{
stopColor: "#09f",
}}
/>
<stop
offset={0.6}
style={{
stopColor: "#a033ff",
}}
/>
<stop
offset={0.9}
style={{
stopColor: "#ff5280",
}}
/>
<stop
offset={1}
style={{
stopColor: "#ff7061",
}}
/>
</radialGradient>
<path
fill="url(#Facebook_Messenger_logo_2020_svg__a)"
d="M400 0C174.7 0 0 165.1 0 388c0 116.6 47.8 217.4 125.6 287 6.5 5.8 10.5 14 10.7 22.8l2.2 71.2a32 32 0 0 0 44.9 28.3l79.4-35c6.7-3 14.3-3.5 21.4-1.6 36.5 10 75.3 15.4 115.8 15.4 225.3 0 400-165.1 400-388S625.3 0 400 0z"
/>
<path
fill="#FFF"
d="m159.8 501.5 117.5-186.4a60 60 0 0 1 86.8-16l93.5 70.1a24 24 0 0 0 28.9-.1l126.2-95.8c16.8-12.8 38.8 7.4 27.6 25.3L522.7 484.9a60 60 0 0 1-86.8 16l-93.5-70.1a24 24 0 0 0-28.9.1l-126.2 95.8c-16.8 12.8-38.8-7.3-27.5-25.2z"
/>
</svg>
);
export default SvgFacebookMessengerLogo2020;

View file

@ -1,8 +1,8 @@
import React, { forwardRef } from "react";
import { ReactComponent as FacebookMessengerSVG } from "./Facebook_Messenger_logo_2020.svg";
import SvgFacebookMessengerLogo2020 from "./FacebookMessengerLogo2020";
export const FBIcon = forwardRef<SVGSVGElement, React.PropsWithChildren<{}>>(
(props, ref) => {
return <FacebookMessengerSVG ref={ref} {...props} />;
return <SvgFacebookMessengerLogo2020 ref={ref} {...props} />;
}
);

View file

@ -0,0 +1,12 @@
const SvgGitbookSvgrepoCom = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
viewBox="0 0 24 24"
{...props}
>
<path d="M10.802 17.77a.703.703 0 1 1-.002 1.406.703.703 0 0 1 .002-1.406m11.024-4.347a.703.703 0 1 1 .001-1.406.703.703 0 0 1-.001 1.406m0-2.876a2.176 2.176 0 0 0-2.174 2.174c0 .233.039.465.115.691l-7.181 3.823a2.165 2.165 0 0 0-1.784-.937c-.829 0-1.584.475-1.95 1.216l-6.451-3.402c-.682-.358-1.192-1.48-1.138-2.502.028-.533.212-.947.493-1.107.178-.1.392-.092.62.027l.042.023c1.71.9 7.304 3.847 7.54 3.956.363.169.565.237 1.185-.057l11.564-6.014c.17-.064.368-.227.368-.474 0-.342-.354-.477-.355-.477-.658-.315-1.669-.788-2.655-1.25-2.108-.987-4.497-2.105-5.546-2.655-.906-.474-1.635-.074-1.765.006l-.252.125C7.78 6.048 1.46 9.178 1.1 9.397.457 9.789.058 10.57.006 11.539c-.08 1.537.703 3.14 1.824 3.727l6.822 3.518a2.175 2.175 0 0 0 2.15 1.862 2.177 2.177 0 0 0 2.173-2.14l7.514-4.073c.38.298.853.461 1.337.461A2.176 2.176 0 0 0 24 12.72a2.176 2.176 0 0 0-2.174-2.174" />
</svg>
);
export default SvgGitbookSvgrepoCom;

View file

@ -1,9 +1,9 @@
import React, { forwardRef } from "react";
import { ReactComponent as GitBookSVG } from "./gitbook-svgrepo-com.svg";
import SvgGitbookSvgrepoCom from "./GitbookSvgrepoCom";
export const GitBookIcon = forwardRef<
SVGSVGElement,
React.PropsWithChildren<{}>
>((props, ref) => {
return <GitBookSVG ref={ref} {...props} />;
return <SvgGitbookSvgrepoCom ref={ref} {...props} />;
});

View file

@ -0,0 +1,28 @@
const SvgGoogle = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
preserveAspectRatio="xMidYMid"
viewBox="0 0 256 262"
{...props}
>
<path
fill="#4285F4"
d="M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027"
/>
<path
fill="#34A853"
d="M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1"
/>
<path
fill="#FBBC05"
d="M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782"
/>
<path
fill="#EB4335"
d="M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251"
/>
</svg>
);
export default SvgGoogle;

View file

@ -1,9 +1,9 @@
import React, { forwardRef } from "react";
import { ReactComponent as GoogleSVG } from "./google.svg";
import SvgGoogle from "./Google";
export const GoogleIcon = forwardRef<
SVGSVGElement,
React.PropsWithChildren<{}>
>((props, ref) => {
return <GoogleSVG ref={ref} {...props} />;
return <SvgGoogle ref={ref} {...props} />;
});

File diff suppressed because one or more lines are too long

View file

@ -1,9 +1,9 @@
import React, { forwardRef } from "react";
import { ReactComponent as HugginFaceSVG } from "./hf-logo.svg";
import SvgHfLogo from "./HfLogo";
export const HuggingFaceIcon = forwardRef<
SVGSVGElement,
React.PropsWithChildren<{}>
>((props, ref) => {
return <HugginFaceSVG ref={ref} {...props} />;
return <SvgHfLogo ref={ref} {...props} />;
});

View file

@ -0,0 +1,15 @@
const SvgIfixitSeeklogocom = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
viewBox="8.4 8.4 51.2 51.2"
{...props}
>
<path
fill="#0071BA"
d="M34 8.4C19.813 8.4 8.4 19.813 8.4 34S19.813 59.6 34 59.6 59.6 48.187 59.6 34 48.187 8.4 34 8.4zm9.493 13.226c.64.32 1.28.747 1.707 1.173 1.173 1.173 1.6 2.24 1.28 3.2l-5.44 7.467c-.106.32-.106 1.066 0 1.387l5.333 7.253c.107.32.213.96.107 1.28-.854 1.6-2.348 2.773-3.84 3.307-.32 0-.534 0-.747-.106l-7.253-5.333c-.32-.214-.854-.214-1.281-.107l-7.573 5.547c-.64.213-1.173.106-1.813-.32-1.387-.96-2.347-2.133-2.667-3.413 0-.427 0-.533.213-.747l5.333-7.359a1.705 1.705 0 0 0-.213-1.6l-5.12-6.934c-.106-.106-.106-.32-.213-.533.107-2.027 1.6-3.093 3.307-4.267.32-.107.854-.107 1.173 0l7.36 5.546c.427.107 1.174.107 1.494-.106L42 21.626c.533-.213.96-.106 1.387 0h.106z"
/>
</svg>
);
export default SvgIfixitSeeklogocom;

View file

@ -1,8 +1,8 @@
import React, { forwardRef } from "react";
import { ReactComponent as IFixItSVG } from "./ifixit-seeklogo.com.svg";
import SvgIfixitSeeklogocom from "./IfixitSeeklogoCom";
export const IFixIcon = forwardRef<SVGSVGElement, React.PropsWithChildren<{}>>(
(props, ref) => {
return <IFixItSVG ref={ref} {...props} />;
return <SvgIfixitSeeklogocom ref={ref} {...props} />;
}
);

View file

@ -0,0 +1,58 @@
const SvgMetaIcon = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
data-name="Layer 1"
viewBox="0 0 287.56 191"
width="1em"
height="1em"
{...props}
>
<defs>
<linearGradient
id="meta-icon_svg__a"
x1={62.34}
x2={260.34}
y1={101.45}
y2={91.45}
gradientTransform="matrix(1 0 0 -1 0 192)"
gradientUnits="userSpaceOnUse"
>
<stop offset={0} stopColor="#0064e1" />
<stop offset={0.4} stopColor="#0064e1" />
<stop offset={0.83} stopColor="#0073ee" />
<stop offset={1} stopColor="#0082fb" />
</linearGradient>
<linearGradient
id="meta-icon_svg__b"
x1={41.42}
x2={41.42}
y1={53}
y2={126}
gradientTransform="matrix(1 0 0 -1 0 192)"
gradientUnits="userSpaceOnUse"
>
<stop offset={0} stopColor="#0082fb" />
<stop offset={1} stopColor="#0064e0" />
</linearGradient>
</defs>
<path
d="M31.06 126c0 11 2.41 19.41 5.56 24.51A19 19 0 0 0 53.19 160c8.1 0 15.51-2 29.79-21.76 11.44-15.83 24.92-38 34-52l15.36-23.6c10.67-16.39 23-34.61 37.18-47C181.07 5.6 193.54 0 206.09 0c21.07 0 41.14 12.21 56.5 35.11 16.81 25.08 25 56.67 25 89.27 0 19.38-3.82 33.62-10.32 44.87C271 180.13 258.72 191 238.13 191v-31c17.63 0 22-16.2 22-34.74 0-26.42-6.16-55.74-19.73-76.69-9.63-14.86-22.11-23.94-35.84-23.94-14.85 0-26.8 11.2-40.23 31.17-7.14 10.61-14.47 23.54-22.7 38.13l-9.06 16c-18.2 32.27-22.81 39.62-31.91 51.75C84.74 183 71.12 191 53.19 191c-21.27 0-34.72-9.21-43-23.09C3.34 156.6 0 141.76 0 124.85Z"
style={{
fill: "#0081fb",
}}
/>
<path
d="M24.49 37.3C38.73 15.35 59.28 0 82.85 0c13.65 0 27.22 4 41.39 15.61 15.5 12.65 32 33.48 52.63 67.81l7.39 12.32c17.84 29.72 28 45 33.93 52.22 7.64 9.26 13 12 19.94 12 17.63 0 22-16.2 22-34.74l27.4-.86c0 19.38-3.82 33.62-10.32 44.87C271 180.13 258.72 191 238.13 191c-12.8 0-24.14-2.78-36.68-14.61-9.64-9.08-20.91-25.21-29.58-39.71L146.08 93.6c-12.94-21.62-24.81-37.74-31.68-45-7.4-7.89-16.89-17.37-32.05-17.37-12.27 0-22.69 8.61-31.41 21.78Z"
style={{
fill: "url(#meta-icon_svg__a)",
}}
/>
<path
d="M82.35 31.23c-12.27 0-22.69 8.61-31.41 21.78C38.61 71.62 31.06 99.34 31.06 126c0 11 2.41 19.41 5.56 24.51l-26.48 17.4C3.34 156.6 0 141.76 0 124.85 0 94.1 8.44 62.05 24.49 37.3 38.73 15.35 59.28 0 82.85 0Z"
style={{
fill: "url(#meta-icon_svg__b)",
}}
/>
</svg>
);
export default SvgMetaIcon;

View file

@ -1,8 +1,8 @@
import React, { forwardRef } from "react";
import { ReactComponent as MetaSVG } from "./meta-icon.svg";
import SvgMetaIcon from "./MetaIcon";
export const MetaIcon = forwardRef<SVGSVGElement, React.PropsWithChildren<{}>>(
(props, ref) => {
return <MetaSVG ref={ref} {...props} />;
return <SvgMetaIcon ref={ref} {...props} />;
}
);

View file

@ -0,0 +1,13 @@
const SvgMidjourneyEmblem = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
viewBox="0 0 1024 1024"
{...props}
>
<path d="M261 222.8c-4.5 4.6-4 7.5 3.3 21.1 32.2 59 53.7 120.8 60.2 173.1 1.8 14.4 2 47.9.5 65.8-5.9 68.9-29.7 131.7-64.2 169.9-5.5 6-6.5 9.1-4.8 13.4 3.2 7.7 9.1 7.8 21 .5 32.9-20.4 79.4-37.4 122-44.7 12.2-2.1 16.6-2.3 46-2.4 33.9 0 39.1.5 68 5.6 24.8 4.4 54.3 12.6 76.1 21 7.4 2.8 14.6 5.3 16 5.6 3.7.7 8.4-2 9.9-5.7 1.7-4.1-.4-17.8-6.2-40.4-18.4-72.5-60.4-151.6-115.2-217-54.1-64.5-126.6-121.3-203.4-159.3-20.7-10.2-24.6-11.1-29.2-6.5zm43.4 35.8c31.5 17.3 66.9 41.4 96.6 65.8 84 69 149.2 162.5 181.7 260.4 4.9 14.9 11.3 40.6 10.1 41.1-.5.1-4.8-1.1-9.6-2.7-28.1-9.8-61.9-17.5-94.2-21.4-25.3-3.1-64.1-3.1-86.1 0-31.3 4.4-60.5 12.5-89.4 24.7-6 2.6-11.6 4.9-12.4 5.3-1 .4-.8-.5.7-2.9 3.3-5.5 13.6-26.6 17.5-36 20-48.5 30.4-117.1 25.6-168.9-4.4-47.7-23.4-110-49.5-162.2-2.4-4.8-4.4-9-4.4-9.3 0-1 1.5-.3 13.4 6.1z" />
<path d="M448.8 292.6c-3.4 1.8-4.8 4.3-4.8 8.6 0 4.5 1.1 5.8 10.2 12 25.8 17.7 61.5 50.8 80.1 74.3 41.9 52.7 86.1 142.6 111.8 227.5 2.8 9 5.8 17.3 6.7 18.3 3 3.4 5.9 3.8 14.4 2.2 4.4-.8 12.4-1.8 17.7-2.1 11.8-.7 21.3 1.6 42.5 10 17.9 7.2 22.2 7.2 25.1.2 1.7-4.1 1.3-5.9-6.6-26.1-23.9-61.6-55.5-120.6-87.3-163-5.1-6.9-18-23-19.6-24.5-.3-.3-3-3.2-5.9-6.5-57.4-63.2-114.1-109.3-155.1-126-6.8-2.7-21.1-6.5-24.5-6.5-1.1.1-3.2.7-4.7 1.6zM554 372.4c14.9 12.9 57.7 55.8 70.4 70.6 31.5 36.7 62.5 87.4 87.3 143 7 15.7 14.3 33.5 14.3 34.9 0 .5-4.8-.7-10.7-2.7-10.4-3.5-11.4-3.6-25.3-3.6-8-.1-16.5.1-18.9.4l-4.4.4-5.2-16.4c-21.4-67.7-54.3-138.3-90.2-193.5-4.7-7.2-10.4-15.5-12.6-18.5-6.1-8-22.1-27.2-24.6-29.4-1.1-1.1-2.1-2.3-2.1-2.8 0-1.1 5.5 3.3 22 17.6zM808 660.8c-4.7.2-69.9 4.4-135.5 8.7-20.9 1.4-45.6 2.9-55 3.5-9.3.6-26.4 1.7-38 2.5-11.5.8-29.1 1.9-39 2.5-9.9.6-34.9 2.2-55.5 3.5-20.6 1.4-58.6 3.8-84.5 5.5-25.8 1.7-60.7 3.9-77.5 5-16.8 1.1-45.1 2.9-63 4-48.3 2.9-47.8 2.8-50 9.6-1.3 3.9-.5 6 12.3 30l6.5 12.1-16.6 11.4c-26.9 18.5-36.6 23.9-42.9 23.9-1.4 0-3.7 1.3-5.4 2.9-4.1 4.1-4 9.1.2 13.3 2.9 2.9 3.3 3 9.5 2.5 8.7-.7 19.7-6 37.8-18.4 30.5-21 38.1-25.3 44.6-25.3 4.8 0 10 3.2 25.9 15.9 21.5 17.1 29.6 22 42.6 26 10.8 3.4 21.3 3.8 31.5 1.2 11.9-2.9 20.2-7.5 37.7-20.5 20.1-15.1 24.3-17.1 35.3-17.1 10.8 0 15.5 2.2 29.5 13.5 15.9 12.9 20.2 16 27.9 19.9 9.1 4.6 16.8 6.4 27.1 6.4 15.4-.1 28.4-6.3 47.5-22.4 17.8-15 25.7-18.5 39.3-17.6 10.1.7 16 3.5 29 14.1 26.5 21.5 36.8 26.6 54.5 26.6 16.1 0 28.1-5.4 49-22.2 8.1-6.4 17.6-13.2 21.2-15 6-3 7.2-3.3 16.5-3.3s10.5.2 16.6 3.2c3.8 1.9 11.4 7.4 17.6 12.7 6.1 5.2 13.3 11.1 15.9 13.2 11.2 8.6 29.4 14.3 36.3 11.4 3.6-1.5 6.1-5.5 6.1-9.8 0-4.4-5.8-9.2-11-9.2-8.4 0-14.5-3.4-31-17.5-21-18-30.1-22.7-46.6-24.1-16.2-1.5-30.4 4.5-52.4 22.1-21.1 16.9-30.7 20.9-44.2 18.5-5.5-1-17.5-5.7-16.6-6.5.2-.2 5.9-3.1 12.8-6.6 25-12.5 63.7-34.4 80-45.3 21.3-14.2 64-46.3 66.5-50 2-2.8 1.8-8.6-.3-11.3-2-2.7-6.1-3.9-12.2-3.5zm-28 21.9c0 .9-27.4 20.5-39.6 28.5-23 15-74.5 42.9-91.6 49.7l-5.6 2.3-6.9-5.3c-18.4-14.2-38.5-18.1-57.4-11.3-9.2 3.3-17.1 8.4-32.4 20.9-6.6 5.4-14.9 11.2-18.5 12.9-5.8 2.7-7.5 3.1-15.5 3.1-13.3 0-18.5-2.7-42.4-22.2-21-17.1-38.3-21.6-57.6-15.1-8.1 2.8-15.4 7.3-32 19.8-7.7 5.8-16.9 11.9-20.5 13.5-6 2.8-7.4 3-17.5 3-10.6 0-11.3-.1-18.7-3.7-9.8-4.6-14.3-7.7-29.3-19.9-21.7-17.4-30.7-21.8-42.4-20.4l-5.7.7-5.6-10.4c-3-5.7-5.2-10.6-4.9-10.9.6-.7 24.1-2.4 79.1-5.9 17.3-1.1 56-3.6 86-5.5s71.8-4.6 93-6c21.2-1.3 49.3-3.2 62.5-4 13.2-.9 44.9-2.9 70.5-4.5 60.9-4 120.5-7.9 135.5-8.9 17.2-1.2 17.5-1.2 17.5-.4z" />
</svg>
);
export default SvgMidjourneyEmblem;

View file

@ -1,9 +1,9 @@
import React, { forwardRef } from "react";
import { ReactComponent as MidjourneySVG } from "./Midjourney_Emblem.svg";
import SvgMidjourneyEmblem from "./MidjourneyEmblem";
export const MidjourneyIcon = forwardRef<
SVGSVGElement,
React.PropsWithChildren<{}>
>((props, ref) => {
return <MidjourneySVG ref={ref} {...props} />;
return <SvgMidjourneyEmblem ref={ref} {...props} />;
});

View file

@ -0,0 +1,23 @@
const SvgMongodbIcon = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
viewBox="0 0 32 32"
{...props}
>
<path
fill="#599636"
d="m15.9.087.854 1.604c.192.296.4.558.645.802a22.406 22.406 0 0 1 2.004 2.266c1.447 1.9 2.423 4.01 3.12 6.292.418 1.394.645 2.824.662 4.27.07 4.323-1.412 8.035-4.4 11.12a12.7 12.7 0 0 1-1.57 1.342c-.296 0-.436-.227-.558-.436a3.589 3.589 0 0 1-.436-1.255c-.105-.523-.174-1.046-.14-1.586v-.244C16.057 24.21 15.796.21 15.9.087z"
/>
<path
fill="#6cac48"
d="M15.9.034c-.035-.07-.07-.017-.105.017.017.35-.105.662-.296.96-.21.296-.488.523-.767.767-1.55 1.342-2.77 2.963-3.747 4.776-1.3 2.44-1.97 5.055-2.16 7.808-.087.993.314 4.497.627 5.508.854 2.684 2.388 4.933 4.375 6.885.488.47 1.01.906 1.55 1.325.157 0 .174-.14.21-.244a4.78 4.78 0 0 0 .157-.68l.35-2.614L15.9.034z"
/>
<path
fill="#c2bfbf"
d="M16.754 28.845c.035-.4.227-.732.436-1.063-.21-.087-.366-.26-.488-.453a3.235 3.235 0 0 1-.26-.575c-.244-.732-.296-1.5-.366-2.248v-.453c-.087.07-.105.662-.105.75a17.37 17.37 0 0 1-.314 2.353c-.052.314-.087.627-.28.906 0 .035 0 .07.017.122.314.924.4 1.865.453 2.824v.35c0 .418-.017.33.33.47.14.052.296.07.436.174.105 0 .122-.087.122-.157l-.052-.575v-1.604c-.017-.28.035-.558.07-.82z"
/>
</svg>
);
export default SvgMongodbIcon;

View file

@ -1,9 +1,9 @@
import React, { forwardRef } from "react";
import { ReactComponent as MongoDBSVG } from "./mongodb-icon.svg";
import SvgMongodbIcon from "./MongodbIcon";
export const MongoDBIcon = forwardRef<
SVGSVGElement,
React.PropsWithChildren<{}>
>((props, ref) => {
return <MongoDBSVG ref={ref} {...props} />;
return <SvgMongodbIcon ref={ref} {...props} />;
});

View file

@ -0,0 +1,22 @@
const SvgNotionLogo = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
fill="none"
viewBox="0 0 100 100"
{...props}
>
<path
fill="#fff"
d="M6.017 4.313 61.35.226c6.797-.583 8.543-.19 12.817 2.917L91.83 15.586c2.913 2.14 3.883 2.723 3.883 5.053v68.243c0 4.277-1.553 6.807-6.99 7.193l-64.256 3.892c-4.08.193-6.023-.39-8.16-3.113L3.3 79.94C.967 76.827 0 74.497 0 71.773v-60.66c0-3.497 1.553-6.413 6.017-6.8z"
/>
<path
fill="#000"
fillRule="evenodd"
d="M61.35.227 6.017 4.314C1.553 4.7 0 7.617 0 11.113v60.66c0 2.723.967 5.053 3.3 8.167l13.007 16.913c2.137 2.723 4.08 3.307 8.16 3.113l64.257-3.89c5.433-.387 6.99-2.917 6.99-7.193V20.64c0-2.21-.873-2.847-3.443-4.733L74.167 3.143C69.894.036 68.147-.357 61.35.226zM25.92 19.523c-5.247.353-6.437.433-9.417-1.99l-7.576-6.026c-.77-.78-.383-1.753 1.557-1.947l53.193-3.887c4.467-.39 6.793 1.167 8.54 2.527l9.123 6.61c.39.197 1.36 1.36.193 1.36L26.6 19.477l-.68.047zM19.803 88.3V30.367c0-2.53.777-3.697 3.103-3.893L86 22.78c2.14-.193 3.107 1.167 3.107 3.693V84.02c0 2.53-.39 4.67-3.883 4.863l-60.377 3.5c-3.493.193-5.043-.97-5.043-4.083zm59.6-54.827c.387 1.75 0 3.5-1.75 3.7l-2.91.577v42.773c-2.527 1.36-4.853 2.137-6.797 2.137-3.107 0-3.883-.973-6.21-3.887l-19.03-29.94V77.8l6.02 1.363s0 3.5-4.857 3.5l-13.39.777c-.39-.78 0-2.723 1.357-3.11l3.497-.97v-38.3l-4.853-.393c-.39-1.75.58-4.277 3.3-4.473l14.367-.967 19.8 30.327v-26.83l-5.047-.58c-.39-2.143 1.163-3.7 3.103-3.89l13.4-.78z"
clipRule="evenodd"
/>
</svg>
);
export default SvgNotionLogo;

View file

@ -1,9 +1,9 @@
import React, { forwardRef } from "react";
import { ReactComponent as NotionSVG } from "./Notion-logo.svg";
import SvgNotionLogo from "./NotionLogo";
export const NotionIcon = forwardRef<
SVGSVGElement,
React.PropsWithChildren<{}>
>((props, ref) => {
return <NotionSVG ref={ref} {...props} />;
return <SvgNotionLogo ref={ref} {...props} />;
});

View file

@ -0,0 +1,22 @@
const SvgOpenAi = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
fillRule="evenodd"
clipRule="evenodd"
imageRendering="optimizeQuality"
shapeRendering="geometricPrecision"
textRendering="geometricPrecision"
viewBox="0 0 512 512"
width="1em"
height="1em"
{...props}
>
<rect width={512} height={512} fill="#10A37F" rx={104.187} ry={105.042} />
<path
fill="#fff"
fillRule="nonzero"
d="M378.68 230.011a71.432 71.432 0 0 0 3.654-22.541 71.383 71.383 0 0 0-9.783-36.064c-12.871-22.404-36.747-36.236-62.587-36.236a72.31 72.31 0 0 0-15.145 1.604 71.362 71.362 0 0 0-53.37-23.991h-.453l-.17.001c-31.297 0-59.052 20.195-68.673 49.967a71.372 71.372 0 0 0-47.709 34.618 72.224 72.224 0 0 0-9.755 36.226 72.204 72.204 0 0 0 18.628 48.395 71.395 71.395 0 0 0-3.655 22.541 71.388 71.388 0 0 0 9.783 36.064 72.187 72.187 0 0 0 77.728 34.631 71.375 71.375 0 0 0 53.374 23.992H271l.184-.001c31.314 0 59.06-20.196 68.681-49.995a71.384 71.384 0 0 0 47.71-34.619 72.107 72.107 0 0 0 9.736-36.194 72.201 72.201 0 0 0-18.628-48.394l-.003-.004zM271.018 380.492h-.074a53.576 53.576 0 0 1-34.287-12.423 44.928 44.928 0 0 0 1.694-.96l57.032-32.943a9.278 9.278 0 0 0 4.688-8.06v-80.459l24.106 13.919a.859.859 0 0 1 .469.661v66.586c-.033 29.604-24.022 53.619-53.628 53.679zm-115.329-49.257a53.563 53.563 0 0 1-7.196-26.798c0-3.069.268-6.146.79-9.17.424.254 1.164.706 1.695 1.011l57.032 32.943a9.289 9.289 0 0 0 9.37-.002l69.63-40.205v27.839l.001.048a.864.864 0 0 1-.345.691l-57.654 33.288a53.791 53.791 0 0 1-26.817 7.17 53.746 53.746 0 0 1-46.506-26.818v.003zm-15.004-124.506a53.5 53.5 0 0 1 27.941-23.534c0 .491-.028 1.361-.028 1.965v65.887l-.001.054a9.27 9.27 0 0 0 4.681 8.053l69.63 40.199-24.105 13.919a.864.864 0 0 1-.813.074l-57.66-33.316a53.746 53.746 0 0 1-26.805-46.5 53.787 53.787 0 0 1 7.163-26.798l-.003-.003zm198.055 46.089-69.63-40.204 24.106-13.914a.863.863 0 0 1 .813-.074l57.659 33.288a53.71 53.71 0 0 1 26.835 46.491c0 22.489-14.033 42.612-35.133 50.379v-67.857c.003-.025.003-.051.003-.076a9.265 9.265 0 0 0-4.653-8.033zm23.993-36.111a81.919 81.919 0 0 0-1.694-1.01l-57.032-32.944a9.31 9.31 0 0 0-4.684-1.266 9.31 9.31 0 0 0-4.684 1.266l-69.631 40.205v-27.839l-.001-.048c0-.272.129-.528.346-.691l57.654-33.26a53.696 53.696 0 0 1 26.816-7.177c29.644 0 53.684 24.04 53.684 53.684a53.91 53.91 0 0 1-.774 9.077v.003zm-150.831 49.618-24.111-13.919a.859.859 0 0 1-.469-.661v-66.587c.013-29.628 24.053-53.648 53.684-53.648a53.719 53.719 0 0 1 34.349 12.426c-.434.237-1.191.655-1.694.96l-57.032 32.943a9.272 9.272 0 0 0-4.687 8.057v.053l-.04 80.376zm13.095-28.233 31.012-17.912 31.012 17.9v35.812l-31.012 17.901-31.012-17.901v-35.8z"
/>
</svg>
);
export default SvgOpenAi;

View file

@ -1,9 +1,9 @@
import React, { forwardRef } from "react";
import { ReactComponent as OpenAiSVG } from "./openAI.svg";
import SvgOpenAi from "./OpenAi";
export const OpenAiIcon = forwardRef<
SVGSVGElement,
React.PropsWithChildren<{}>
>((props, ref) => {
return <OpenAiSVG ref={ref} {...props} />;
return <SvgOpenAi ref={ref} {...props} />;
});

Some files were not shown because too many files have changed in this diff Show more