diff --git a/docs/docs/components/chains.mdx b/docs/docs/components/chains.mdx index 52de6c481..96dcac2d0 100644 --- a/docs/docs/components/chains.mdx +++ b/docs/docs/components/chains.mdx @@ -1,6 +1,7 @@ import ThemedImage from "@theme/ThemedImage"; import useBaseUrl from "@docusaurus/useBaseUrl"; import ZoomableImage from "/src/theme/ZoomableImage.js"; +import Admonition from "@theme/Admonition"; # Chains @@ -12,22 +13,23 @@ Chains, in the context of language models, refer to a series of calls made to a The `CombineDocsChain` incorporates methods to combine or aggregate loaded documents for question-answering functionality. -:::info + Works as a proxy of LangChain’s [documents](https://python.langchain.com/docs/modules/chains/document/) chains generated by the `load_qa_chain` function. -::: + **Params** - **LLM:** Language Model to use in the chain. - **chain_type:** The chain type to be used. Each one of them applies a different “combination strategy”. - - **stuff**: The stuff [documents](https://python.langchain.com/docs/modules/chains/document/stuff) chain (“stuff" as in "to stuff" or "to fill") is the most straightforward of *the* document chains. It takes a list of documents, inserts them all into a prompt, and passes that prompt to an LLM. This chain is well-suited for applications where documents are small and only a few are passed in for most calls. - - **map_reduce**: The map-reduce [documents](https://python.langchain.com/docs/modules/chains/document/map_reduce) chain first applies an LLM chain to each document individually (the Map step), treating the chain output as a new document. It then passes all the new documents to a separate combined documents chain to get a single output (the Reduce step). It can optionally first compress or collapse the mapped documents to make sure that they fit in the combined documents chain (which will often pass them to an LLM). This compression step is performed recursively if necessary. - - **map_rerank**: The map re-rank [documents](https://python.langchain.com/docs/modules/chains/document/map_rerank) chain runs an initial prompt on each document that not only tries to complete a task but also gives a score for how certain it is in its answer. The highest-scoring response is returned. - - **refine**: The refine [documents](https://python.langchain.com/docs/modules/chains/document/refine) chain constructs a response by looping over the input documents and iteratively updating its answer. For each document, it passes all non-document inputs, the current document, and the latest intermediate answer to an LLM chain to get a new answer. - Since the Refine chain only passes a single document to the LLM at a time, it is well-suited for tasks that require analyzing more documents than can fit in the model's context. The obvious tradeoff is that this chain will make far more LLM calls than, for example, the Stuff documents chain. There are also certain tasks that are difficult to accomplish iteratively. For example, the Refine chain can perform poorly when documents frequently cross-reference one another or when a task requires detailed information from many documents. + - **stuff**: The stuff [documents](https://python.langchain.com/docs/modules/chains/document/stuff) chain (“stuff" as in "to stuff" or "to fill") is the most straightforward of _the_ document chains. It takes a list of documents, inserts them all into a prompt, and passes that prompt to an LLM. This chain is well-suited for applications where documents are small and only a few are passed in for most calls. + - **map_reduce**: The map-reduce [documents](https://python.langchain.com/docs/modules/chains/document/map_reduce) chain first applies an LLM chain to each document individually (the Map step), treating the chain output as a new document. It then passes all the new documents to a separate combined documents chain to get a single output (the Reduce step). It can optionally first compress or collapse the mapped documents to make sure that they fit in the combined documents chain (which will often pass them to an LLM). This compression step is performed recursively if necessary. + - **map_rerank**: The map re-rank [documents](https://python.langchain.com/docs/modules/chains/document/map_rerank) chain runs an initial prompt on each document that not only tries to complete a task but also gives a score for how certain it is in its answer. The highest-scoring response is returned. + - **refine**: The refine [documents](https://python.langchain.com/docs/modules/chains/document/refine) chain constructs a response by looping over the input documents and iteratively updating its answer. For each document, it passes all non-document inputs, the current document, and the latest intermediate answer to an LLM chain to get a new answer. + + Since the Refine chain only passes a single document to the LLM at a time, it is well-suited for tasks that require analyzing more documents than can fit in the model's context. The obvious tradeoff is that this chain will make far more LLM calls than, for example, the Stuff documents chain. There are also certain tasks that are difficult to accomplish iteratively. For example, the Refine chain can perform poorly when documents frequently cross-reference one another or when a task requires detailed information from many documents. --- @@ -41,7 +43,7 @@ The `ConversationChain` is a straightforward chain for interactive conversations - **Memory:** Default memory store. - **input_key:** Used to specify the key under which the user input will be stored in the conversation memory. It allows you to provide the user's input to the chain for processing and generating a response. - **output_key:** Used to specify the key under which the generated response will be stored in the conversation memory. It allows you to retrieve the response using the specified key. -- **verbose:** This parameter is used to control the level of detail in the output of the chain. When set to True, it will print out some internal states of the chain while it is being run, which can be helpful for debugging and understanding the chain's behavior. If set to False, it will suppress the verbose output — defaults to `False`. +- **verbose:** This parameter is used to control the level of detail in the output of the chain. When set to True, it will print out some internal states of the chain while it is being run, which can be helpful for debugging and understanding the chain's behavior. If set to False, it will suppress the verbose output — defaults to `False`. --- @@ -49,11 +51,11 @@ The `ConversationChain` is a straightforward chain for interactive conversations The `ConversationalRetrievalChain` extracts information and provides answers by combining document search and question-answering abilities. -:::info + A retriever is a component that finds documents based on a query. It doesn't store the documents themselves, but it returns the ones that match the query. -::: + **Params** @@ -61,12 +63,13 @@ A retriever is a component that finds documents based on a query. It doesn't sto - **Memory:** Default memory store. - **Retriever:** The retriever used to fetch relevant documents. - **chain_type:** The chain type to be used. Each one of them applies a different “combination strategy”. - - **stuff**: The stuff [documents](https://python.langchain.com/docs/modules/chains/document/stuff) chain (“stuff" as in "to stuff" or "to fill") is the most straightforward of *the* document chains. It takes a list of documents, inserts them all into a prompt, and passes that prompt to an LLM. This chain is well-suited for applications where documents are small and only a few are passed in for most calls. - - **map_reduce**: The map-reduce [documents](https://python.langchain.com/docs/modules/chains/document/map_reduce) chain first applies an LLM chain to each document individually (the Map step), treating the chain output as a new document. It then passes all the new documents to a separate combined documents chain to get a single output (the Reduce step). It can optionally first compress or collapse the mapped documents to make sure that they fit in the combined documents chain (which will often pass them to an LLM). This compression step is performed recursively if necessary. - - **map_rerank**: The map re-rank [documents](https://python.langchain.com/docs/modules/chains/document/map_rerank) chain runs an initial prompt on each document that not only tries to complete a task but also gives a score for how certain it is in its answer. The highest-scoring response is returned. - - **refine**: The refine [documents](https://python.langchain.com/docs/modules/chains/document/refine) chain constructs a response by looping over the input documents and iteratively updating its answer. For each document, it passes all non-document inputs, the current document, and the latest intermediate answer to an LLM chain to get a new answer. - Since the Refine chain only passes a single document to the LLM at a time, it is well-suited for tasks that require analyzing more documents than can fit in the model's context. The obvious tradeoff is that this chain will make far more LLM calls than, for example, the Stuff documents chain. There are also certain tasks that are difficult to accomplish iteratively. For example, the Refine chain can perform poorly when documents frequently cross-reference one another or when a task requires detailed information from many documents. + - **stuff**: The stuff [documents](https://python.langchain.com/docs/modules/chains/document/stuff) chain (“stuff" as in "to stuff" or "to fill") is the most straightforward of _the_ document chains. It takes a list of documents, inserts them all into a prompt, and passes that prompt to an LLM. This chain is well-suited for applications where documents are small and only a few are passed in for most calls. + - **map_reduce**: The map-reduce [documents](https://python.langchain.com/docs/modules/chains/document/map_reduce) chain first applies an LLM chain to each document individually (the Map step), treating the chain output as a new document. It then passes all the new documents to a separate combined documents chain to get a single output (the Reduce step). It can optionally first compress or collapse the mapped documents to make sure that they fit in the combined documents chain (which will often pass them to an LLM). This compression step is performed recursively if necessary. + - **map_rerank**: The map re-rank [documents](https://python.langchain.com/docs/modules/chains/document/map_rerank) chain runs an initial prompt on each document that not only tries to complete a task but also gives a score for how certain it is in its answer. The highest-scoring response is returned. + - **refine**: The refine [documents](https://python.langchain.com/docs/modules/chains/document/refine) chain constructs a response by looping over the input documents and iteratively updating its answer. For each document, it passes all non-document inputs, the current document, and the latest intermediate answer to an LLM chain to get a new answer. + + Since the Refine chain only passes a single document to the LLM at a time, it is well-suited for tasks that require analyzing more documents than can fit in the model's context. The obvious tradeoff is that this chain will make far more LLM calls than, for example, the Stuff documents chain. There are also certain tasks that are difficult to accomplish iteratively. For example, the Refine chain can perform poorly when documents frequently cross-reference one another or when a task requires detailed information from many documents. - **return_source_documents:** Used to specify whether or not to include the source documents that were used to answer the question in the output. When set to `True`, source documents will be included in the output along with the generated answer. This can be useful for providing additional context or references to the user — defaults to `True`. - **verbose:** Whether or not to run in verbose mode. In verbose mode, intermediate logs will be printed to the console — defaults to `False`. @@ -108,17 +111,17 @@ The `LLMMathChain` works by using the language model with an `LLMChain` to under `RetrievalQA` is a chain used to find relevant documents or information to answer a given query. The retriever is responsible for returning the relevant documents based on the query, and the QA component then extracts the answer from those documents. The retrieval QA system combines the capabilities of both the retriever and the QA component to provide accurate and relevant answers to user queries. -:::info + A retriever is a component that finds documents based on a query. It doesn't store the documents themselves, but it returns the ones that match the query. -::: + **Params** - **Combine Documents Chain:** Chain to use to combine the documents. - **Memory:** Default memory store. -- **Retriever:** The retriever used to fetch relevant documents. +- **Retriever:** The retriever used to fetch relevant documents. - **input_key:** This parameter is used to specify the key in the input data that contains the question. It is used to retrieve the question from the input data and pass it to the question-answering model for generating the answer — defaults to `query`. - **output_key:** This parameter is used to specify the key in the output data where the generated answer will be stored. It is used to retrieve the answer from the output data after the question-answering model has generated it — defaults to `result`. - **return_source_documents:** Used to specify whether or not to include the source documents that were used to answer the question in the output. When set to `True`, source documents will be included in the output along with the generated answer. This can be useful for providing additional context or references to the user — defaults to `True`. @@ -134,4 +137,4 @@ The `SQLDatabaseChain` finds answers to questions using a SQL database. It works - **Db:** SQL Database to connect to. - **LLM:** Language Model to use in the chain. -- **Prompt:** Prompt template to translate natural language to SQL. \ No newline at end of file +- **Prompt:** Prompt template to translate natural language to SQL. diff --git a/docs/docs/components/custom.mdx b/docs/docs/components/custom.mdx new file mode 100644 index 000000000..9f7fa65ca --- /dev/null +++ b/docs/docs/components/custom.mdx @@ -0,0 +1,79 @@ +import Admonition from "@theme/Admonition"; + +# Custom Component + +Used to create a custom component. The code is the class that will be converted to a Custom Component with the fields and formatting you define. + +**Params** + +- **Code:** The Python code to define the component. + +The code must be a class that inherits from the _`langflow.CustomComponent`_ class. + +The type annotations of the _`build`_ instance method will be used to create the fields of the component. + +| Supported types | +| --------------------------------------------------------- | +| _`str`_, _`int`_, _`float`_, _`bool`_, _`list`_, _`dict`_ | +| _`langchain.chains.base.Chain`_ | +| _`langchain.PromptTemplate`_ | +| _`langchain.llms.base.BaseLLM`_ | +| _`langchain.Tool`_ | +| _`langchain.document_loaders.base.BaseLoader`_ | +| _`langchain.schema.Document`_ | +| _`langchain.text_splitters.TextSplitter`_ | +| _`langchain.vectorstores.base.VectorStore`_ | +| _`langchain.embeddings.base.Embeddings`_ | +| _`langchain.schema.BaseRetriever`_ | + +The class can have a [_`build_config`_](focus://8) instance method, which is used to define configuration fields for the component. +The [_`build_config`_](focus://8) method should always return a dictionary with specific keys representing the field names and their corresponding configurations. +It must follow the format described below: + +The top-level keys are the field names. + +Their values are of type _`dict`_ with any of the following keys (all of them are **optional**): + +| Key | Description | +| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| _`field_type: str`_ | The type of the field (can be any of the types supported by the _`build`_ method, passed as a string). | +| _`is_list: bool`_ | If the field is a list. | +| _`options: List[str]`_ | This defines the options to be displayed. The _`field_type`_ should invariably be _`str`_. If you set the _`value`_ attribute to one of the options, it will be selected by default. Having _`options`_ will display a dropdown menu. | +| _`multiline: bool`_ | When the field is a string, this would allow the user to open a text editor. | +| _`input_types: List[str]`_ | To be used when you want a _`str`_ field to have connectable handles. | +| _`display_name: str`_ | To define the name of the field. | +| _`advanced: bool`_ | To hide the field in default view. This is useful when a field is for advanced users or you simply want to remove it from view. | +| _`password: bool`_ | To mask the input text. This is used to allow the user to hide the values of the text (e.g. API keys). | +| _`required: bool`_ | To make the field required. | +| _`info: str`_ | To add a tooltip to the field. | +| _`file_types: List[str]`_ | This is a requirement if the _`field_type`_ is file. Defines which file types will be accepted. For example, json, yaml or yml. | + +The CustomComponent class provides the following methods: + +| Method name | Description | +| -------------- | ------------------------------------------------------------- | +| _`list_flows`_ | Returns a list of Flow objects with an _`id`_ and a _`name`_. | +| _`load_flow`_ | Loads a flow from the given _`id`_. | + +### Usage + +```python +# In the CustomComponent class +def build(self, flow_name: str) + # This is a list of Flow objects with an id and a name + flows = self.list_flows() + found_flow = next((f for f in flows if f.name == flow_name), None) + if not found_flow: + raise ValueError(f"Flow {flow_name} not found") + + flow = self.load_flow(found_flow.id) + result = flow() # Run the flow + return result + +``` + + + +[Learn more about Custom Components](../guidelines/custom-component) + + diff --git a/docs/docs/components/prompts.mdx b/docs/docs/components/prompts.mdx index f4f2c4cae..0c7257272 100644 --- a/docs/docs/components/prompts.mdx +++ b/docs/docs/components/prompts.mdx @@ -1,3 +1,5 @@ +import Admonition from "@theme/Admonition"; + # Prompts A prompt refers to the input given to a language model. It is constructed from multiple components and can be parametrized using prompt templates. A prompt template is a reproducible way to generate prompts and allow for easy customization through input variables. @@ -8,8 +10,10 @@ A prompt refers to the input given to a language model. It is constructed from m The `PromptTemplate` component allows users to create prompts and define variables that provide control over instructing the model. The template can take in a set of variables from the end user and generates the prompt once the conversation is initiated. -:::info -Once a variable is defined in the prompt template, it becomes a component input of its own. Check out [Prompt Customization](../guidelines/prompt-customization.mdx) to learn more. -::: + + Once a variable is defined in the prompt template, it becomes a component + input of its own. Check out [Prompt + Customization](../guidelines/prompt-customization.mdx) to learn more. + -- **template:** Template used to format an individual request. \ No newline at end of file +- **template:** Template used to format an individual request. diff --git a/docs/docs/examples/buffer-memory.mdx b/docs/docs/examples/buffer-memory.mdx index c3e886cf9..d34649991 100644 --- a/docs/docs/examples/buffer-memory.mdx +++ b/docs/docs/examples/buffer-memory.mdx @@ -1,3 +1,5 @@ +import Admonition from "@theme/Admonition"; + # Buffer Memory For certain applications, retaining past interactions is crucial. For that, chains and agents may accept a memory component as one of their input parameters. The `ConversationBufferMemory` component is one of them. It stores messages and extracts them into variables. @@ -17,9 +19,10 @@ import ZoomableImage from "/src/theme/ZoomableImage.js"; #### Download Flow -:::note LangChain Components 🦜🔗 + - [`ConversationBufferMemory`](https://python.langchain.com/docs/modules/memory/how_to/buffer) - [`ConversationChain`](https://python.langchain.com/docs/modules/chains/) - [`ChatOpenAI`](https://python.langchain.com/docs/modules/model_io/models/chat/integrations/openai) - ::: + + diff --git a/docs/docs/examples/conversation-chain.mdx b/docs/docs/examples/conversation-chain.mdx index b8cbb11bb..db3181881 100644 --- a/docs/docs/examples/conversation-chain.mdx +++ b/docs/docs/examples/conversation-chain.mdx @@ -1,10 +1,14 @@ +import Admonition from "@theme/Admonition"; + # Conversation Chain This example shows how to instantiate a simple `ConversationChain` component using a Language Model (LLM). Once the Node Status turns green 🟢, the chat will be ready to take in user messages. Here, we used `ChatOpenAI` to act as the required LLM input, but you can use any LLM for this purpose. -:::info + + Make sure to always get the API key from the provider. -::: + + ## ⛓️ Langflow Example @@ -21,8 +25,9 @@ import ZoomableImage from "/src/theme/ZoomableImage.js"; #### Download Flow -:::note LangChain Components 🦜🔗 + - [`ConversationChain`](https://python.langchain.com/docs/modules/chains/) - [`ChatOpenAI`](https://python.langchain.com/docs/modules/model_io/models/chat/integrations/openai) - ::: + + diff --git a/docs/docs/examples/csv-loader.mdx b/docs/docs/examples/csv-loader.mdx index de808ec3d..c59dfc1e7 100644 --- a/docs/docs/examples/csv-loader.mdx +++ b/docs/docs/examples/csv-loader.mdx @@ -1,3 +1,5 @@ +import Admonition from "@theme/Admonition"; + # CSV Loader The `VectoStoreAgent` component retrieves information from one or more vector stores. This example shows a `VectoStoreAgent` connected to a CSV file through the `Chroma` vector store. Process description: @@ -7,13 +9,18 @@ The `VectoStoreAgent` component retrieves information from one or more vector st - These chunks feed the `Chroma` vector store, which converts them into vectors and stores them for fast indexing. - Finally, the agent accesses the information of the vector store through the `VectorStoreInfo` tool. -:::info -The vector store is used for efficient semantic search, while `VectorStoreInfo` carries information about it, such as its name and description. Embeddings are a way to represent words, phrases, or any entities in a vector space. Learn more about them [here](https://platform.openai.com/docs/guides/embeddings/what-are-embeddings). -::: + + The vector store is used for efficient semantic search, while + `VectorStoreInfo` carries information about it, such as its name and + description. Embeddings are a way to represent words, phrases, or any entities + in a vector space. Learn more about them + [here](https://platform.openai.com/docs/guides/embeddings/what-are-embeddings). + -:::tip -Once you build this flow, ask questions about the data in the chat interface (e.g., number of rows or columns). -::: + + Once you build this flow, ask questions about the data in the chat interface + (e.g., number of rows or columns). + ## ⛓️ Langflow Example @@ -30,7 +37,7 @@ import ZoomableImage from "/src/theme/ZoomableImage.js"; #### Download Flow -:::note LangChain Components 🦜🔗 + - [`CSVLoader`](https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/csv) - [`CharacterTextSplitter`](https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/character_text_splitter) @@ -39,4 +46,5 @@ import ZoomableImage from "/src/theme/ZoomableImage.js"; - [`VectorStoreInfo`](https://python.langchain.com/docs/modules/data_connection/vectorstores/) - [`OpenAI`](https://python.langchain.com/docs/modules/model_io/models/llms/integrations/openai) - [`VectorStoreAgent`](https://python.langchain.com/docs/modules/agents/toolkits/vectorstore) - ::: + + diff --git a/docs/docs/examples/flow-runner.mdx b/docs/docs/examples/flow-runner.mdx new file mode 100644 index 000000000..606e1ad15 --- /dev/null +++ b/docs/docs/examples/flow-runner.mdx @@ -0,0 +1,354 @@ +--- +description: Custom Components +hide_table_of_contents: true +--- + +import ZoomableImage from "/src/theme/ZoomableImage.js"; +import Admonition from "@theme/Admonition"; + +# FlowRunner Component + +The CustomComponent allows us to create new components that can interact with Langflow itself. + +In this example, we are going to create a component that allows us to run other flows. + +What we will see: + +- How to list the flows in the collection using the _`list_flows`_ method. +- How to load a flow using the _`load_flow`_ method. +- Configure a field to be a dropdown menu using the _`options`_ parameter. + + + +```python +from langflow import CustomComponent + +class MyComponent(CustomComponent): + display_name = "Custom Component" + description = "This is a custom component" + + def build_config(self): + ... + + def build(self): + ... + +``` + +This is the basic structure of a custom component. + +--- + +```python +from langflow import CustomComponent + +# focus +class FlowRunner(CustomComponent): + # focus + display_name = "Flow Runner" + # focus + description = "Run other flows" + + def build_config(self): + ... + + def build(self): + ... + +``` + +So, let's start by adding the _`display_name`_ and a _`description`_. + +--- + +```python +from langflow import CustomComponent +# focus +from langchain.schema import Document + + +class FlowRunner(CustomComponent): + display_name = "Flow Runner" + description = "Run other flows using a document as input." + + def build_config(self): + ... + + def build(self): + ... + +``` + +Now let's import _`Document`_ from the _`langchain.schema`_ module, which will be our return type for the _`build`_ method. + +--- + +```python +from langflow import CustomComponent +# focus +from langchain.schema import Document + +class FlowRunner(CustomComponent): + display_name = "Flow Runner" + description = "Run other flows using a document as input." + + def build_config(self): + ... + + # focus + def build(self, flow_name: str, document: Document) -> Document: + ... + +``` + +Let's add the [parameters](focus://11[20:55]) and the [return type](focus://11[60:69]) to the _`build`_ method. + +The parameters we added are: + +- _`flow_name`_ is the name of the flow to be run. +- _`document`_ is what is going to be passed to the flow. + - We are using the _`Document`_ type, which will add a [handle](../guidelines/components) to the component. + +--- + +```python +from langflow import CustomComponent +from langchain.schema import Document + + +class FlowRunner(CustomComponent): + display_name = "Flow Runner" + description = "Run other flows using a document as input." + + def build_config(self): + ... + + def build(self, flow_name: str, document: Document) -> Document: + # focus + # List the flows + # focus + flows = self.list_flows() + +``` + +Now we can start writing the code for the _`build`_ method. + +We will start by listing the flows in the collection using the _`list_flows`_ method. + +--- + +```python +from langflow import CustomComponent +from langchain.schema import Document + + +class FlowRunner(CustomComponent): + display_name = "Flow Runner" + description = "Run other flows using a document as input." + + def build_config(self): + ... + + def build(self, flow_name: str, document: Document) -> Document: + # List the flows + flows = self.list_flows() + # focus + # Get the flow that matches the selected name + # focus + flow = next(filter(lambda f: f.name == flow_name, flows)) + +``` + +We can then get the flow that matches the selected name. + + + From version 0.4.0 names are unique, but in previous versions, they were not. + This might lead to unexpected results if you have flows with the same name. + + +--- + +```python +from langflow import CustomComponent +from langchain.schema import Document + + +class FlowRunner(CustomComponent): + display_name = "Flow Runner" + description = "Run other flows using a document as input." + + def build_config(self): + ... + + def build(self, flow_name: str, document: Document) -> Document: + # List the flows + flows = self.list_flows() + # Get the flow that matches the selected name + flow = next(filter(lambda f: f.name == flow_name, flows)) + # focus + # Load the flow + # focus + tweaks = {} + # focus + flow = self.load_flow(flow.id, tweaks) + +``` + +Now we can load the flow using the _`load_flow`_ method. + +The _`tweaks`_ parameter is a dictionary that allows you to customize the flow. +You can find more information about it in the [features guidelines](../guidelines/features#code). + +--- + +```python +from langflow import CustomComponent +from langchain.schema import Document + + +class FlowRunner(CustomComponent): + display_name = "Flow Runner" + description = "Run other flows using a document as input." + + def build_config(self): + ... + + def build(self, flow_name: str, document: Document) -> Document: + # List the flows + flows = self.list_flows() + # Get the flow that matches the selected name + flow = next(filter(lambda f: f.name == flow_name, flows)) + # Load the flow + tweaks = {} + flow = self.load_flow(flow.id, tweaks) + # focus + # Get the page_content from the document + # focus + page_content = document.page_content +``` + +Now we can get the _`page_content`_ from the document. + +This is the content that will be passed to the flow and it depends on many factors. + +In this example, we are using a Document because we can use a [Loader](../components/loaders) to load a Document but +then we'll have to process the page_content depending on what is the input of the flow we are running. + + + One other approach would be to create another CustomComponent that builds a + dictionary and then we use that as the input for the FlowRunner. + + +--- + +```python +from langflow import CustomComponent +from langchain.schema import Document + + +class FlowRunner(CustomComponent): + display_name = "Flow Runner" + description = "Run other flows using a document as input." + + def build_config(self): + ... + + def build(self, flow_name: str, document: Document) -> Document: + # List the flows + flows = self.list_flows() + # Get the flow that matches the selected name + flow = next(filter(lambda f: f.name == flow_name, flows)) + # Load the flow + tweaks = {} + flow = self.load_flow(flow.id, tweaks) + # Get the page_content from the document + page_content = document.page_content + # Use it in the flow + result = flow(page_content) + return Document(page_content=str(result)) +``` + +Finally, we can use the _`page_content`_ in the flow and return the result. + +--- + +```python focus=9:16 +from langflow import CustomComponent +from langchain.schema import Document + + +class FlowRunner(CustomComponent): + display_name = "Flow Runner" + description = "Run other flows using a document as input." + + def build_config(self): + flows = self.list_flows() + flow_names = [f.name for f in flows] + return {"flow_name": {"options": flow_names, + "display_name": "Flow Name", + }, + "document": {"display_name": "Document"} + } + + + def build(self, flow_name: str, document: Optional[Document] = None) -> Document: + # List the flows + flows = self.list_flows() + # Get the flow that matches the selected name + flow = next(filter(lambda f: f.name == flow_name, flows)) + # Load the flow + tweaks = {} + flow = self.load_flow(flow.id, tweaks) + # Get the page_content from the document + page_content = document.page_content + # Use it in the flow + result = flow(page_content) + return Document(page_content=str(result)) +``` + +Now we can add the field customization to the _`build_config`_ method. + +We are using the _`options`_ parameter to make the _`flow_name`_ field a dropdown menu. + + + Make sure the type of the field is _`str`_ and the values of the _`options`_ + are strings. + + +--- + + + +In Langflow, this is how our script looks like: + +{" "} + + + +And here is our brand new custom component: + +{" "} + + diff --git a/docs/docs/examples/how-upload-examples.mdx b/docs/docs/examples/how-upload-examples.mdx index 8a4306212..2b1a2b06c 100644 --- a/docs/docs/examples/how-upload-examples.mdx +++ b/docs/docs/examples/how-upload-examples.mdx @@ -7,16 +7,14 @@ import ZoomableImage from "/src/theme/ZoomableImage.js"; We welcome all examples that can help our community learn and explore Langflow's capabilities. Langflow Examples is a repository on [GitHub](https://github.com/logspace-ai/langflow_examples) that contains examples of flows that people can use for inspiration and learning. -
- -
+{" "} + To upload examples, please follow these steps: diff --git a/docs/docs/examples/midjourney-prompt-chain.mdx b/docs/docs/examples/midjourney-prompt-chain.mdx index d3ca57c91..c79bb0b27 100644 --- a/docs/docs/examples/midjourney-prompt-chain.mdx +++ b/docs/docs/examples/midjourney-prompt-chain.mdx @@ -1,3 +1,5 @@ +import Admonition from "@theme/Admonition"; + # MidJourney Prompt Chain The `MidJourneyPromptChain` can be used to generate imaginative and detailed MidJourney prompts. @@ -14,9 +16,11 @@ And get a response such as: Imagine a mysterious forest, the trees are tall and ancient, their branches reaching up to the sky. Through the darkness, a dragon emerges from the shadows, its scales shimmering in the moonlight. Its wingspan is immense, and its eyes glow with a fierce intensity. It is a majestic and powerful creature, one that commands both respect and fear. ``` -:::tip -Notice that the `ConversationSummaryMemory` stores a summary of the conversation over time. Try using it to create better prompts as the conversation goes on. -::: + + Notice that the `ConversationSummaryMemory` stores a summary of the + conversation over time. Try using it to create better prompts as the + conversation goes on. + ## ⛓️ Langflow Example @@ -33,8 +37,9 @@ import ZoomableImage from "/src/theme/ZoomableImage.js"; #### Download Flow -:::note LangChain Components 🦜🔗 + - [`OpenAI`](https://python.langchain.com/docs/modules/model_io/models/llms/integrations/openai) - [`ConversationSummaryMemory`](https://python.langchain.com/docs/modules/memory/how_to/summary) - ::: + + diff --git a/docs/docs/examples/multiple-vectorstores.mdx b/docs/docs/examples/multiple-vectorstores.mdx index 36890c866..0bb6b9ade 100644 --- a/docs/docs/examples/multiple-vectorstores.mdx +++ b/docs/docs/examples/multiple-vectorstores.mdx @@ -1,12 +1,15 @@ +import Admonition from "@theme/Admonition"; + # Multiple Vector Stores The example below shows an agent operating with two vector stores built upon different data sources. The `TextLoader` loads a TXT file, while the `WebBaseLoader` pulls text from webpages into a document format to accessed downstream. The `Chroma` vector stores are created analogous to what we have demonstrated in our [CSV Loader](/examples/csv-loader.mdx) example. Finally, the `VectorStoreRouterAgent` constructs an agent that routes between the vector stores. -:::info -Get the TXT file used [here](https://github.com/hwchase17/chat-your-data/blob/master/state_of_the_union.txt). -::: + + Get the TXT file used + [here](https://github.com/hwchase17/chat-your-data/blob/master/state_of_the_union.txt). + URL used by the `WebBaseLoader`: @@ -14,13 +17,15 @@ URL used by the `WebBaseLoader`: https://pt.wikipedia.org/wiki/Harry_Potter ``` -:::tip -When you build the flow, request information about one of the sources. The agent should be able to use the correct source to generate a response. -::: + + When you build the flow, request information about one of the sources. The + agent should be able to use the correct source to generate a response. + -:::info -Learn more about Multiple Vector Stores [here](https://python.langchain.com/docs/modules/agents/toolkits/vectorstore?highlight=Multiple%20Vector%20Stores#multiple-vectorstores). -::: + + Learn more about Multiple Vector Stores + [here](https://python.langchain.com/docs/modules/agents/toolkits/vectorstore?highlight=Multiple%20Vector%20Stores#multiple-vectorstores). + ## ⛓️ Langflow Example @@ -37,7 +42,7 @@ import ZoomableImage from "/src/theme/ZoomableImage.js"; #### Download Flow -:::note LangChain Components 🦜🔗 + - [`WebBaseLoader`](https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/web_base) - [`TextLoader`](https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/unstructured_file) @@ -49,4 +54,4 @@ import ZoomableImage from "/src/theme/ZoomableImage.js"; - [`VectorStoreRouterToolkit`](https://python.langchain.com/docs/modules/agents/toolkits/vectorstore) - [`VectorStoreRouterAgent`](https://python.langchain.com/docs/modules/agents/toolkits/vectorstore) -::: + diff --git a/docs/docs/examples/python-function.mdx b/docs/docs/examples/python-function.mdx index 12a262a3f..f537075c6 100644 --- a/docs/docs/examples/python-function.mdx +++ b/docs/docs/examples/python-function.mdx @@ -1,3 +1,5 @@ +import Admonition from "@theme/Admonition"; + # Python Function Langflow allows you to create a customized tool using the `PythonFunction` connected to a `Tool` component. In this example, Regex is used in Python to validate a pattern. @@ -15,15 +17,19 @@ def is_brazilian_zipcode(zipcode: str) -> bool: return False ``` -:::tip -When a tool is called, it is often desirable to have its output returned directly to the user. You can do this by setting the **return_direct** flag for a tool to be True. -::: + + When a tool is called, it is often desirable to have its output returned + directly to the user. You can do this by setting the **return_direct** flag + for a tool to be True. + The `AgentInitializer` component is a quick way to construct an agent from the model and tools. -:::info -The `PythonFunction` is a custom component that uses the LangChain 🦜🔗 tool decorator. Learn more about it [here](https://python.langchain.com/docs/modules/agents/tools/how_to/custom_tools). -::: + + The `PythonFunction` is a custom component that uses the LangChain 🦜🔗 tool + decorator. Learn more about it + [here](https://python.langchain.com/docs/modules/agents/tools/how_to/custom_tools). + ## ⛓️ Langflow Example @@ -40,9 +46,10 @@ import ZoomableImage from "/src/theme/ZoomableImage.js"; #### Download Flow -:::note LangChain Components 🦜🔗 + - [`PythonFunctionTool`](https://python.langchain.com/docs/modules/agents/tools/how_to/custom_tools) - [`ChatOpenAI`](https://python.langchain.com/docs/modules/model_io/models/chat/integrations/openai) - [`AgentInitializer`](https://python.langchain.com/docs/modules/agents/) - ::: + + diff --git a/docs/docs/examples/serp-api-tool.mdx b/docs/docs/examples/serp-api-tool.mdx index a7e1d3d8e..60e55791a 100644 --- a/docs/docs/examples/serp-api-tool.mdx +++ b/docs/docs/examples/serp-api-tool.mdx @@ -1,24 +1,29 @@ +import Admonition from "@theme/Admonition"; + # Serp API Tool The [Serp API](https://serpapi.com/) (Search Engine Results Page) allows developers to scrape results from search engines such as Google, Bing and Yahoo, and can be used as in Langflow through the `Search` component. -:::info -To use the Serp API, you first need to sign up [Serp API](https://serpapi.com/) for an API key on the provider's website. -::: + + To use the Serp API, you first need to sign up [Serp + API](https://serpapi.com/) for an API key on the provider's website. + Here, the `ZeroShotPrompt` component specifies a prompt template for the `ZeroShotAgent`. Set a _Prefix_ and _Suffix_ with rules for the agent to obey. In the example, we used default templates. The `LLMChain` is a simple chain that takes in a prompt template, formats it with the user input, and returns the response from an LLM. -:::tip -In this example, we used [`ChatOpenAI`](https://platform.openai.com/) as the LLM, but feel free to experiment with other Language Models! -::: + + In this example, we used [`ChatOpenAI`](https://platform.openai.com/) as the + LLM, but feel free to experiment with other Language Models! + The `ZeroShotAgent` takes the `LLMChain` and the `Search` tool as inputs, using the tool to find information when necessary. -:::info -Learn more about the Serp API [here](https://python.langchain.com/docs/modules/agents/tools/integrations/serpapi). -::: + + Learn more about the Serp API + [here](https://python.langchain.com/docs/modules/agents/tools/integrations/serpapi). + ## ⛓️ Langflow Example @@ -35,11 +40,12 @@ import ZoomableImage from "/src/theme/ZoomableImage.js"; #### Download Flow -:::note LangChain Components 🦜🔗 + - [`ZeroShotPrompt`](https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/) - [`OpenAI`](https://python.langchain.com/docs/modules/model_io/models/llms/integrations/openai) - [`LLMChain`](https://python.langchain.com/docs/modules/chains/foundational/llm_chain) - [`Search`](https://python.langchain.com/docs/modules/agents/tools/integrations/serpapi) - [`ZeroShotAgent`](https://python.langchain.com/docs/modules/agents/how_to/custom_mrkl_agent) - ::: + + diff --git a/docs/docs/getting-started/hugging-face-spaces.mdx b/docs/docs/getting-started/hugging-face-spaces.mdx index e8b3852a9..acc4bb8d5 100644 --- a/docs/docs/getting-started/hugging-face-spaces.mdx +++ b/docs/docs/getting-started/hugging-face-spaces.mdx @@ -6,15 +6,14 @@ import ThemedImage from "@theme/ThemedImage"; import useBaseUrl from "@docusaurus/useBaseUrl"; import ZoomableImage from "/src/theme/ZoomableImage.js"; -
- -
+{" "} + + Check out Langflow on [HuggingFace Spaces](https://huggingface.co/spaces/Logspace/Langflow). diff --git a/docs/docs/guidelines/chat-interface.mdx b/docs/docs/guidelines/chat-interface.mdx index c09f00076..0ac23dc8a 100644 --- a/docs/docs/guidelines/chat-interface.mdx +++ b/docs/docs/guidelines/chat-interface.mdx @@ -7,58 +7,46 @@ import ReactPlayer from "react-player"; Langflow’s chat interface provides a user-friendly experience and functionality to interact with the model and customize the prompt. The sidebar brings options that allow users to view and edit pre-defined prompt variables. This feature facilitates quick experimentation by enabling the modification of variable values right in the chat. -
- -
+{" "} + Notice that editing variables in the chat interface take place temporarily and won’t change their original value in the components once the chat is closed. -
- -
+{" "} + + To view the complete prompt in its original, structured format, click the "Display Prompt" option. This feature lets you see the prompt exactly as it entered the model. -
- -
- +{" "} + In the chat interface, you can redefine which variable should be interpreted as the chat input. This gives you control over these inputs and allows dynamic and creative interactions. -
- -
+{" "} + diff --git a/docs/docs/guidelines/chat-widget.mdx b/docs/docs/guidelines/chat-widget.mdx new file mode 100644 index 000000000..7f6737fea --- /dev/null +++ b/docs/docs/guidelines/chat-widget.mdx @@ -0,0 +1,209 @@ +import ThemedImage from "@theme/ThemedImage"; +import useBaseUrl from "@docusaurus/useBaseUrl"; +import ZoomableImage from "/src/theme/ZoomableImage.js"; +import ReactPlayer from "react-player"; +import Admonition from "@theme/Admonition"; + +# Chat Widget + +
+ The Langflow Chat Widget is a powerful web component that enables + communication with a Langflow project. This widget allows for a chat interface + embedding, allowing the integration of Langflow into web applications + effortlessly. +
+ +## Features + +🌟 **Seamless Integration:** Easily integrate the Langflow Chat Widget into your website or web application with just a few lines of JavaScript. + +🚀 **Interactive Chat Interface:** Engage your users with a user-friendly conversation, powered by Langflow's advanced language understanding capabilities. + +🎛️ **Customizable Styling:** Customize the appearance of the chat widget to match your application's design and branding. + +🌐 **Multilingual Support:** Communicate with users in multiple languages, opening up your application to a global audience. + +--- + +## Usage + +
+ You can get the HTML code embedded with the chat by clicking the Code button + at the Sidebar after building a flow. +
+ +{" "} + + + +
+ Clicking the Chat Widget HTML tab, you'll get the code to be inserted. Read + below to learn how to use it with HTML, React and Angular. +
+ +{" "} + + + +--- + +### HTML + +The Chat Widget can be embedded into any HTML page, inside a _``_ tag, as demonstrated in the video below. + +
+ +
+ +--- + +### React + +To embed the Chat Widget using React, you'll need to insert this _` +``` + +Then, declare your Web Component and encapsulate it in a React component. + +```jsx +declare global { + namespace JSX { + interface IntrinsicElements { + "langflow-chat": any; + } + } +} + +export default function ChatWidget({ className }) { + return ( +
+ +
+ ); +} +``` + +Finally, you can place the component anywhere in your code to display the Chat Widget. + +--- + +### Angular + +To use it in Angular, first add this _` +``` + +When you use a custom web component in an Angular template, the Angular compiler might show a warning when it doesn't recognize the custom elements by default. To suppress this warning, add _`CUSTOM_ELEMENTS_SCHEMA`_ to the module's _`@NgModule.schemas`_. + +- Open the module file (it typically ends with _.module.ts_) where you'd add the _`langflow-chat`_ web component. +- Import _`CUSTOM_ELEMENTS_SCHEMA`_ at the top of the file: + +```ts +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core"; +``` + +- Add _`CUSTOM_ELEMENTS_SCHEMA`_ to the 'schemas' array inside the '@NgModule' decorator: + +```ts +@NgModule({ + declarations: [ + // ... Other components and directives ... + ], + imports: [ + // ... Other imported modules ... + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], // Add the CUSTOM_ELEMENTS_SCHEMA here +}) +export class YourModule {} +``` + +In your Angular project, find the component belonging to the module where _`CUSTOM_ELEMENTS_SCHEMA`_ was added. + +- Inside the template, add the _`langflow-chat`_ tag to include the Chat Widget in your component's view: + +```jsx + +``` + + +
    +
  • + _`CUSTOM_ELEMENTS_SCHEMA`_ is a built-in schema that allows Angular to + recognize custom elements. +
  • +
  • + Adding _`CUSTOM_ELEMENTS_SCHEMA`_ tells Angular to allow custom elements + in your templates, and it will suppress the warning related to unknown + elements like _`langflow-chat`_. +
  • +
  • + Notice that you can only use the Chat Widget in components that are part + of the module where you added _`CUSTOM_ELEMENTS_SCHEMA`_. +
  • +
+
+ +--- + +## Configuration + +Use the widget API to customize your Chat Widget: + + + Props with the type JSON need to be passed as Stringified JSONs, with the + format {"key":"value"}. + + +| Prop | Type | Required | Description | +| --------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| bot_message_style | JSON | No | Applies custom formatting to bot messages. | +| chat_input_field | String | Yes | Defines the type of the input field for chat messages. | +| chat_inputs | JSON | Yes | Determines the chat input elements and their respective values. | +| chat_output_key | String | No | Specifies which output to display if multiple outputs are available. | +| chat_position | String | No | Positions the chat window on the screen (options include: top-left, top-center, top-right, center-left, center-right, bottom-right, bottom-center, bottom-left). | +| chat_trigger_style | JSON | No | Styles the chat trigger button. | +| chat_window_style | JSON | No | Customizes the overall appearance of the chat window. | +| error_message_style | JSON | No | Sets the format for error messages within the chat window. | +| flow_id | String | Yes | Identifies the flow that the component is associated with. | +| height | Number | No | Sets the height of the chat window in pixels. | +| host_url | String | Yes | Specifies the URL of the host for chat component communication. | +| input_container_style | JSON | No | Applies styling to the container where chat messages are entered. | +| input_style | JSON | No | Sets the style for the chat input field. | +| online | Boolean | No | Toggles the online status of the chat component. | +| online_message | String | No | Sets a custom message to display when the chat component is online. | +| placeholder | String | No | Sets the placeholder text for the chat input field. | +| placeholder_sending | String | No | Sets the placeholder text to display while a message is being sent. | +| send_button_style | JSON | No | Sets the style for the send button in the chat window. | +| send_icon_style | JSON | No | Sets the style for the send icon in the chat window. | +| tweaks | JSON | No | Applies additional custom adjustments for the associated flow. | +| user_message_style | JSON | No | Determines the formatting for user messages in the chat window. | +| width | Number | No | Sets the width of the chat window in pixels. | +| window_title | String | No | Sets the title displayed in the chat window's header or title bar. | diff --git a/docs/docs/guidelines/components.mdx b/docs/docs/guidelines/components.mdx index ba2f5ff33..b7dadcfce 100644 --- a/docs/docs/guidelines/components.mdx +++ b/docs/docs/guidelines/components.mdx @@ -25,17 +25,14 @@ Components are the building blocks of the flows. They are made of inputs, output of that type is required. -
- -
+{" "} +
On the top right corner, you will find the component status icon 🔴. Make the diff --git a/docs/docs/guidelines/custom-component.mdx b/docs/docs/guidelines/custom-component.mdx new file mode 100644 index 000000000..07619f224 --- /dev/null +++ b/docs/docs/guidelines/custom-component.mdx @@ -0,0 +1,344 @@ +--- +description: Custom Components +hide_table_of_contents: true +--- + +import ZoomableImage from "/src/theme/ZoomableImage.js"; +import Admonition from "@theme/Admonition"; + +# Custom Components + +In Langflow, a Custom Component is a special component type that allows users to extend the functionality of the platform by creating their own reusable and configurable components. + +A Custom Component is created from a user-defined Python script that uses the _`CustomComponent`_ class provided by the Langflow library. These components can be as simple as a basic function that takes and returns a string or as complex as a combination of multiple sub-components and API calls. + +Let's take a look at the basic rules and features, then we'll go over an example. + +## TL;DR + +- Create a class that inherits from _`CustomComponent`_ and contains a _`build`_ method. +- Use arguments with [Type Annotations (or Type Hints)](https://docs.python.org/3/library/typing.html) of the _`build`_ method to create component fields. +- Use the _`build_config`_ method to customize these fields look and behave. + +Here is an example: + + + +```python +from langflow import CustomComponent +from langchain.schema import Document + +class DocumentProcessor(CustomComponent): + display_name = "Document Processor" + description = "This component processes a document" + + def build_config(self) -> dict: + options = ["Uppercase", "Lowercase", "Titlecase"] + return { + "function": {"options": options, + "value": options[0]}} + + def build(self, document: Document, function: str) -> Document: + page_content = document.page_content + if function == "Uppercase": + page_content = page_content.upper() + elif function == "Lowercase": + page_content = page_content.lower() + elif function == "Titlecase": + page_content = page_content.title() + return Document(page_content=page_content) +``` + + + + + Check out [FlowRunner Component](../examples/flow-runner) for a more powerful + example. + + +--- + +## Rules + +The Python script for every Custom Component should follow a set of rules. Let's go over them, one by one: + + + +### Rule 1 + +The script must contain a **single class** that inherits from _`CustomComponent`_. + +```python +from langflow import CustomComponent +from langchain.schema import Document + +class MyComponent(CustomComponent): + display_name = "Custom Component" + description = "This is a custom component" + + def build_config(self) -> dict: + ... + + def build(self, document: Document, function: str) -> Document: + ... +``` + +--- + +### Rule 2 + +This class requires a _`build`_ method, which is used to run the component and defines its fields. + +```python +from langflow import CustomComponent +from langchain.schema import Document + +class MyComponent(CustomComponent): + display_name = "Custom Component" + description = "This is a custom component" + + def build_config(self) -> dict: + ... + + # focus + # mark + def build(self) -> Document: + ... +``` + +--- + +The [Return Type Annotation](https://docs.python.org/3/library/typing.html) of the _`build`_ method defines the component type (e.g., Chain, BaseLLM or basic Python types). Check out all supported types in the [component reference](../components/custom). + +```python +from langflow import CustomComponent +from langchain.schema import Document + +class MyComponent(CustomComponent): + display_name = "Custom Component" + description = "This is a custom component" + + def build_config(self) -> dict: + ... + + # focus[20:31] + # mark + def build(self) -> Document: + ... +``` + +--- + +```python +from langflow import CustomComponent +from langchain.schema import Document + +class MyComponent(CustomComponent): + display_name = "Custom Component" + description = "This is a custom component" + + def build_config(self) -> dict: + ... + + def build(self) -> Document: + ... +``` + +### Rule 3 + +The class can have a [_`build_config`_](focus://8) method, which is used to define configuration fields for the component. The [_`build_config`_](focus://8) method should always return a dictionary with specific keys representing the field names and their corresponding configurations. It must follow the format described below: + +- Top-level keys are field names. +- Their values are also of type _`dict`_. They specify the behavior of the generated fields. + +Check out the [component reference](../components/custom) for more details on the available field configurations. + +--- + +```python +from langflow import CustomComponent +from langchain.schema import Document + +class MyComponent(CustomComponent): + display_name = "Custom Component" + description = "This is a custom component" + + def build_config(self) -> dict: + ... + + def build(self) -> Document: + ... +``` + +## Example + +Let's create a simple component that takes a document and a function name as input and returns a document with the page content processed by the selected function. + + + +If you were to do this using Langflow's native components, you would create a Tool and ask the agent to use it. + + + +--- + +### Pick a display name + +First, let's choose a name for our component by adding a _`display_name`_ attribute. This is the component name to be displayed in the canvas. +The name of the class is not important, but let's call it _`DocumentProcessor`_. + +```python +from langflow import CustomComponent +from langchain.schema import Document + +# focus +class DocumentProcessor(CustomComponent): + # focus + display_name = "Document Processor" + description = "This is a custom component" + + def build_config(self) -> dict: + ... + + def build(self) -> Document: + ... +``` + +--- + +### Write a description + +We can also write a description for it using the _`description`_ attribute. + +```python +from langflow import CustomComponent +from langchain.schema import Document + +class DocumentProcessor(CustomComponent): + display_name = "Document Processor" + description = "This component processes a document" + + def build_config(self) -> dict: + ... + + def build(self) -> Document: + ... +``` + +--- + +```python +from langflow import CustomComponent +from langchain.schema import Document + +class DocumentProcessor(CustomComponent): + display_name = "Document Processor" + description = "This component processes a document" + + def build_config(self) -> dict: + ... + + def build(self, document: Document, function: str) -> Document: + page_content = document.page_content + if function == "Uppercase": + page_content = page_content.upper() + elif function == "Lowercase": + page_content = page_content.lower() + elif function == "Titlecase": + page_content = page_content.title() + return Document(page_content=page_content) +``` + +### Add the build method + +The parameters used are: + +- _`document`_ is the document to be processed. +- _`function`_ is the name of the function to be applied to the document. + +The return type is _`Document`_. + +This method is called when the component is built (i.e. when you click the _Build_ button in the canvas). + + + One important aspect of the Type Hints is that generally base Python types add + different kinds of fields while other types such as Document add a + [handle](../guidelines/components) to the component. + + +--- + +### Customize the fields + +The _`build_config`_ method will be used to configure the fields of the component. + +- _`options`_ defines that the field will be a dropdown menu. The values must be _`str`_ and the type of the field should also be _`str`_. +- _`value`_ is the default value of the field. +- _`display_name`_ is the name of the field to be displayed in the canvas. + +This method is called when the code is processed (i.e. when you click _Check and Save_ in the code editor). + +```python +from langflow import CustomComponent +from langchain.schema import Document + +class DocumentProcessor(CustomComponent): + display_name = "Document Processor" + description = "This component processes a document" + + def build_config(self) -> dict: + options = ["Uppercase", "Lowercase", "Titlecase"] + return { + "function": {"options": options, + "value": options[0], + "display_name": "Function" + }, + "document": {"display_name": "Document"} + } + + def build(self, document: Document, function: str) -> Document: + page_content = document.page_content + if function == "Uppercase": + page_content = page_content.upper() + elif function == "Lowercase": + page_content = page_content.lower() + elif function == "Titlecase": + page_content = page_content.title() + return Document(page_content=page_content) +``` + + + +In Langflow, this is how our script looks like: + +{" "} + + + +And here is our brand new custom component: + +{" "} + + diff --git a/docs/docs/guidelines/features.mdx b/docs/docs/guidelines/features.mdx index cf8b09c6e..6235b68db 100644 --- a/docs/docs/guidelines/features.mdx +++ b/docs/docs/guidelines/features.mdx @@ -2,6 +2,7 @@ import ThemedImage from "@theme/ThemedImage"; import useBaseUrl from "@docusaurus/useBaseUrl"; import ZoomableImage from "/src/theme/ZoomableImage.js"; import ReactPlayer from "react-player"; +import Admonition from "@theme/Admonition"; # Features @@ -12,17 +13,14 @@ import ReactPlayer from "react-player"; below:
-
- -
+{" "} +
Further down, we will explain each of these options. @@ -34,9 +32,10 @@ import ReactPlayer from "react-player"; Flows can be exported and imported as JSON files. -:::caution + Watch out for API keys being stored in local files. -::: + + --- diff --git a/docs/docs/guidelines/prompt-customization.mdx b/docs/docs/guidelines/prompt-customization.mdx index 8e2f409f9..efb5b3928 100644 --- a/docs/docs/guidelines/prompt-customization.mdx +++ b/docs/docs/guidelines/prompt-customization.mdx @@ -7,80 +7,62 @@ import ReactPlayer from "react-player"; The prompt template allows users to create prompts and define variables that provide control over instructing the model. -
- -
+{" "} + Variables can be used to define instructions, questions, context, inputs, or examples for the model and can be created with any chosen name in curly brackets, e.g., `{variable_name}`. They act as placeholders for parts of the text that can be easily modified. -
- -
+{" "} + Once inserted, these variables are immediately recognized as new fields in the prompt component. Here, you can define their values within the component itself or leave a field empty to be adjusted over the chat interface. -
- -
+{" "} + + You can also use documents or output parsers as prompt variables. By plugging them into prompt handles, they’ll disable and feed that input field. -
- -
- +{" "} + With this, users can interact with documents, webpages, or any other type of content directly from the prompt, which allows for seamless integration of external resources with the language model. - - If working with an interactive (chat-like) flow, remember to keep one of the input variables empty to behave as the chat input. -
- -
- +{" "} + diff --git a/docs/docs/index.mdx b/docs/docs/index.mdx index 4ec4a300d..7be04549c 100644 --- a/docs/docs/index.mdx +++ b/docs/docs/index.mdx @@ -6,13 +6,11 @@ import ThemedImage from "@theme/ThemedImage"; import useBaseUrl from "@docusaurus/useBaseUrl"; import ZoomableImage from "/src/theme/ZoomableImage.js"; -
- -
+{" "} + diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 3ac152b5b..798c2e44a 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -1,127 +1,141 @@ const lightCodeTheme = require("prism-react-renderer/themes/github"); +const { remarkCodeHike } = require("@code-hike/mdx"); // With JSDoc @type annotations, IDEs can provide config autocompletion /** @type {import('@docusaurus/types').DocusaurusConfig} */ -( - module.exports = { - title: "Langflow Documentation", - tagline: "Langflow is a GUI for LangChain, designed with react-flow", - favicon: "img/favicon.ico", - url: "https://logspace-ai.github.io", - baseUrl: "/", - onBrokenLinks: "throw", - onBrokenMarkdownLinks: "warn", - organizationName: "logspace-ai", - projectName: "langflow", - trailingSlash: false, - customFields: { - mendableAnonKey: process.env.MENDABLE_ANON_KEY, - }, - i18n: { - defaultLocale: "en", - locales: ["en"], - }, - presets: [ - [ - "@docusaurus/preset-classic", - /** @type {import('@docusaurus/preset-classic').Options} */ - ({ - docs: { - routeBasePath: "/", - sidebarPath: require.resolve("./sidebars.js"), - path: "docs", - // sidebarPath: 'sidebars.js', - }, - theme: { - customCss: require.resolve("./src/css/custom.css"), - }, - }), - ], - ], - plugins: [ - ["docusaurus-node-polyfills", { excludeAliases: ["console"] }], - "docusaurus-plugin-image-zoom", - // .... - async function myPlugin(context, options) { - return { - name: "docusaurus-tailwindcss", - configurePostCss(postcssOptions) { - // Appends TailwindCSS and AutoPrefixer. - postcssOptions.plugins.push(require("tailwindcss")); - postcssOptions.plugins.push(require("autoprefixer")); - return postcssOptions; - }, - }; - }, - ], - themeConfig: - /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ +module.exports = { + title: "Langflow Documentation", + tagline: "Langflow is a GUI for LangChain, designed with react-flow", + favicon: "img/favicon.ico", + url: "https://logspace-ai.github.io", + baseUrl: "/", + onBrokenLinks: "throw", + onBrokenMarkdownLinks: "warn", + organizationName: "logspace-ai", + projectName: "langflow", + trailingSlash: false, + customFields: { + mendableAnonKey: process.env.MENDABLE_ANON_KEY, + }, + i18n: { + defaultLocale: "en", + locales: ["en"], + }, + presets: [ + [ + "@docusaurus/preset-classic", + /** @type {import('@docusaurus/preset-classic').Options} */ ({ - navbar: { - hideOnScroll: true, - title: "Langflow", - logo: { - alt: "Langflow", - src: "img/chain.png", - }, - items: [ - // right - { - position: "right", - href: "https://github.com/logspace-ai/langflow", - position: "right", - className: "header-github-link", - target: "_blank", - rel: null, - }, - { - position: "right", - href: "https://twitter.com/logspace_ai", - position: "right", - className: "header-twitter-link", - target: "_blank", - rel: null, - }, - { - position: "right", - href: "https://discord.gg/EqksyE2EX9", - position: "right", - className: "header-discord-link", - target: "_blank", - rel: null, - }, + docs: { + beforeDefaultRemarkPlugins: [ + [ + remarkCodeHike, + { theme: "monokai", showCopyButton: true, lineNumbers: true }, + ], + ], + routeBasePath: "/", + sidebarPath: require.resolve("./sidebars.js"), + path: "docs", + // sidebarPath: 'sidebars.js', + }, + theme: { + customCss: [ + require.resolve("@code-hike/mdx/styles.css"), + require.resolve("./src/css/custom.css"), ], }, - tableOfContents: { - minHeadingLevel: 2, - maxHeadingLevel: 5, - }, - colorMode: { - defaultMode: "light", - disableSwitch: true, - respectPrefersColorScheme: false, - }, - announcementBar: { - content: - '⭐️ If you like ⛓️Langflow, star it on GitHub! ⭐️', - backgroundColor: "#B53D38", //Mustard Yellow #D19900 #D4B20B - Salmon #E9967A - textColor: "#fff", - isCloseable: false, - }, - footer: { - links: [], - copyright: `Copyright © ${new Date().getFullYear()} Logspace.`, - }, - zoom: { - selector: ".markdown :not(a) > img:not(.no-zoom)", - background: { - light: "rgba(240, 240, 240, 0.9)", - }, - config: {}, - }, - prism: { - theme: lightCodeTheme, - }, }), - } -); + ], + ], + plugins: [ + ["docusaurus-node-polyfills", { excludeAliases: ["console"] }], + "docusaurus-plugin-image-zoom", + // .... + async function myPlugin(context, options) { + return { + name: "docusaurus-tailwindcss", + configurePostCss(postcssOptions) { + // Appends TailwindCSS and AutoPrefixer. + postcssOptions.plugins.push(require("tailwindcss")); + postcssOptions.plugins.push(require("autoprefixer")); + return postcssOptions; + }, + }; + }, + ], + themes: ["mdx-v2"], + themeConfig: + /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ + ({ + navbar: { + hideOnScroll: true, + title: "Langflow", + logo: { + alt: "Langflow", + src: "img/chain.png", + }, + items: [ + // right + { + position: "right", + href: "https://github.com/logspace-ai/langflow", + position: "right", + className: "header-github-link", + target: "_blank", + rel: null, + }, + { + position: "right", + href: "https://twitter.com/logspace_ai", + position: "right", + className: "header-twitter-link", + target: "_blank", + rel: null, + }, + { + position: "right", + href: "https://discord.gg/EqksyE2EX9", + position: "right", + className: "header-discord-link", + target: "_blank", + rel: null, + }, + ], + }, + tableOfContents: { + minHeadingLevel: 2, + maxHeadingLevel: 5, + }, + colorMode: { + defaultMode: "light", + disableSwitch: true, + respectPrefersColorScheme: false, + }, + announcementBar: { + content: + '⭐️ If you like ⛓️Langflow, star it on GitHub! ⭐️', + backgroundColor: "#B53D38", //Mustard Yellow #D19900 #D4B20B - Salmon #E9967A + textColor: "#fff", + isCloseable: false, + }, + footer: { + links: [], + copyright: `Copyright © ${new Date().getFullYear()} Logspace.`, + }, + zoom: { + selector: ".markdown :not(a) > img:not(.no-zoom)", + background: { + light: "rgba(240, 240, 240, 0.9)", + }, + config: {}, + }, + // prism: { + // theme: require("prism-react-renderer/themes/dracula"), + // }, + docs: { + sidebar: { + hideable: true, + }, + }, + }), +}; diff --git a/docs/package-lock.json b/docs/package-lock.json index 7db7f9376..ed79230c6 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -9,12 +9,13 @@ "version": "0.0.0", "dependencies": { "@babel/preset-react": "^7.22.3", + "@code-hike/mdx": "^0.9.0", "@docusaurus/core": "2.4.1", "@docusaurus/plugin-ideal-image": "^2.4.1", "@docusaurus/preset-classic": "2.4.1", "@docusaurus/theme-classic": "^2.4.1", "@docusaurus/theme-search-algolia": "^2.4.1", - "@mdx-js/react": "^1.6.22", + "@mdx-js/react": "^2.3.0", "@mendable/search": "^0.0.114", "@pbe/react-yandex-maps": "^1.2.4", "@prismicio/client": "^7.0.1", @@ -22,6 +23,7 @@ "autoprefixer": "^10.4.14", "clsx": "^1.2.1", "docusaurus-plugin-image-zoom": "^0.1.4", + "docusaurus-theme-mdx-v2": "^0.1.2", "jquery": "^3.7.0", "medium-zoom": "^1.0.8", "node-fetch": "^3.3.1", @@ -1986,6 +1988,49 @@ "node": ">=6.9.0" } }, + "node_modules/@code-hike/lighter": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@code-hike/lighter/-/lighter-0.7.0.tgz", + "integrity": "sha512-64O07rIORKQLB+5T/GKAmKcD9sC0N9yHFJXa0Hs+0Aee1G+I4bSXxTccuDFP6c/G/3h5Pk7yv7PoX9/SpzaeiQ==", + "funding": { + "url": "https://github.com/code-hike/lighter?sponsor=1" + } + }, + "node_modules/@code-hike/mdx": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@code-hike/mdx/-/mdx-0.9.0.tgz", + "integrity": "sha512-0wg68ZCjVWAkWT4gBUZJ8Mwktjen/XeWyqBQCrhA2IZSbZZnMYsEI6JJEFb/nZoNI3comB3JdxPLykZRq3qT2A==", + "dependencies": { + "@code-hike/lighter": "0.7.0", + "node-fetch": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/code-hike" + }, + "peerDependencies": { + "react": "^16.8.3 || ^17 || ^18" + } + }, + "node_modules/@code-hike/mdx/node_modules/node-fetch": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", + "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -2683,6 +2728,18 @@ "react-dom": "^16.8.4 || ^17.0.0" } }, + "node_modules/@docusaurus/theme-classic/node_modules/@mdx-js/react": { + "version": "1.6.22", + "resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-1.6.22.tgz", + "integrity": "sha512-TDoPum4SHdfPiGSAaRBw7ECyI8VaHpK8GJugbJIJuqyh6kzw9ZLJZW3HGL3NNrJGxcAixUvqROm+YuQOo5eXtg==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "react": "^16.13.1 || ^17.0.0" + } + }, "node_modules/@docusaurus/theme-common": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@docusaurus/theme-common/-/theme-common-2.4.1.tgz", @@ -3168,15 +3225,19 @@ } }, "node_modules/@mdx-js/react": { - "version": "1.6.22", - "resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-1.6.22.tgz", - "integrity": "sha512-TDoPum4SHdfPiGSAaRBw7ECyI8VaHpK8GJugbJIJuqyh6kzw9ZLJZW3HGL3NNrJGxcAixUvqROm+YuQOo5eXtg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-2.3.0.tgz", + "integrity": "sha512-zQH//gdOmuu7nt2oJR29vFhDv88oGPmVw6BggmrHeMI+xgEkp1B2dX9/bMBSYtK0dyLX/aOmesKS09g222K1/g==", + "dependencies": { + "@types/mdx": "^2.0.0", + "@types/react": ">=16" + }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" }, "peerDependencies": { - "react": "^16.13.1 || ^17.0.0" + "react": ">=16" } }, "node_modules/@mdx-js/util": { @@ -3665,6 +3726,14 @@ "node": ">=10.13.0" } }, + "node_modules/@types/acorn": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@types/acorn/-/acorn-4.0.6.tgz", + "integrity": "sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==", + "dependencies": { + "@types/estree": "*" + } + }, "node_modules/@types/body-parser": { "version": "1.19.2", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", @@ -3730,6 +3799,14 @@ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==" }, + "node_modules/@types/estree-jsx": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.0.tgz", + "integrity": "sha512-3qvGd0z8F2ENTGr/GG1yViqfiKmRfrXVx5sJyHGFu3z7m5g5utCQtGp/g29JnjflhtQJBv1WDQukHiT58xPcYQ==", + "dependencies": { + "@types/estree": "*" + } + }, "node_modules/@types/express": { "version": "4.17.17", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", @@ -3817,6 +3894,11 @@ "@types/unist": "^2" } }, + "node_modules/@types/mdx": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@types/mdx/-/mdx-2.0.5.tgz", + "integrity": "sha512-76CqzuD6Q7LC+AtbPqrvD9AqsN0k8bsYo2bM2J8pmNldP1aIPAbzUQ7QbobyXL4eLr1wK5x8FZFe8eF/ubRuBg==" + }, "node_modules/@types/mime": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", @@ -4198,6 +4280,14 @@ "acorn": "^8" } }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", @@ -4502,6 +4592,14 @@ "util": "^0.12.0" } }, + "node_modules/astring": { + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/astring/-/astring-1.8.6.tgz", + "integrity": "sha512-ISvCdHdlTDlH5IpxQJIex7BWBywFWgjJSVdwst+/iQCoEYnyOaQ95+X1JGshuBjGp6nxKUy1jMgE3zPqN7fQdg==", + "bin": { + "astring": "bin/astring" + } + }, "node_modules/async-foreach": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", @@ -5391,6 +5489,15 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/character-entities-legacy": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", @@ -6884,6 +6991,296 @@ "node": ">=6" } }, + "node_modules/docusaurus-mdx-loader-v2": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/docusaurus-mdx-loader-v2/-/docusaurus-mdx-loader-v2-0.1.2.tgz", + "integrity": "sha512-Dd/XieCKKoirnJDou4h33zRZPCmbtSqvXrZm0yMmhCpLDpeScu8CBvveFVHCqs7UB+x82IpzgZX5rHkoFlz2Bw==", + "dependencies": { + "@babel/parser": "^7.17.3", + "@babel/traverse": "^7.17.3", + "@docusaurus/logger": "2.0.0-beta.18", + "@docusaurus/utils": "2.0.0-beta.18", + "@mdx-js/mdx": "^2.1.0", + "escape-html": "^1.0.3", + "estree-util-value-to-estree": "^1.3.0", + "file-loader": "^6.2.0", + "fs-extra": "^10.0.1", + "image-size": "^1.0.1", + "lz-string": "^1.4.4", + "mdast-util-to-string": "^2.0.0", + "remark-admonitions": "^1.2.1", + "remark-emoji": "^2.1.0", + "remark-gfm": "1.0.0", + "stringify-object": "^3.3.0", + "tslib": "^2.3.1", + "unist-util-visit": "^2.0.2", + "url-loader": "^4.1.1", + "webpack": "^5.69.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "react": "^16.8.4 || ^17.0.0", + "react-dom": "^16.8.4 || ^17.0.0" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/@docusaurus/logger": { + "version": "2.0.0-beta.18", + "resolved": "https://registry.npmjs.org/@docusaurus/logger/-/logger-2.0.0-beta.18.tgz", + "integrity": "sha512-frNe5vhH3mbPmH980Lvzaz45+n1PQl3TkslzWYXQeJOkFX17zUd3e3U7F9kR1+DocmAqHkgAoWuXVcvEoN29fg==", + "dependencies": { + "chalk": "^4.1.2", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/@docusaurus/utils": { + "version": "2.0.0-beta.18", + "resolved": "https://registry.npmjs.org/@docusaurus/utils/-/utils-2.0.0-beta.18.tgz", + "integrity": "sha512-v2vBmH7xSbPwx3+GB90HgLSQdj+Rh5ELtZWy7M20w907k0ROzDmPQ/8Ke2DK3o5r4pZPGnCrsB3SaYI83AEmAA==", + "dependencies": { + "@docusaurus/logger": "2.0.0-beta.18", + "@svgr/webpack": "^6.2.1", + "file-loader": "^6.2.0", + "fs-extra": "^10.0.1", + "github-slugger": "^1.4.0", + "globby": "^11.1.0", + "gray-matter": "^4.0.3", + "js-yaml": "^4.1.0", + "lodash": "^4.17.21", + "micromatch": "^4.0.5", + "resolve-pathname": "^3.0.0", + "shelljs": "^0.8.5", + "tslib": "^2.3.1", + "url-loader": "^4.1.1", + "webpack": "^5.70.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/@mdx-js/mdx": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-2.3.0.tgz", + "integrity": "sha512-jLuwRlz8DQfQNiUCJR50Y09CGPq3fLtmtUQfVrj79E0JWu3dvsVcxVIcfhR5h0iXu+/z++zDrYeiJqifRynJkA==", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/mdx": "^2.0.0", + "estree-util-build-jsx": "^2.0.0", + "estree-util-is-identifier-name": "^2.0.0", + "estree-util-to-js": "^1.1.0", + "estree-walker": "^3.0.0", + "hast-util-to-estree": "^2.0.0", + "markdown-extensions": "^1.0.0", + "periscopic": "^3.0.0", + "remark-mdx": "^2.0.0", + "remark-parse": "^10.0.0", + "remark-rehype": "^10.0.0", + "unified": "^10.0.0", + "unist-util-position-from-estree": "^1.0.0", + "unist-util-stringify-position": "^3.0.0", + "unist-util-visit": "^4.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/@mdx-js/mdx/node_modules/unist-util-visit": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.1.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/remark-mdx": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-2.3.0.tgz", + "integrity": "sha512-g53hMkpM0I98MU266IzDFMrTD980gNF3BJnkyFcmN+dD873mQeD5rdMO3Y2X+x8umQfbSE0PcoEDl7ledSA+2g==", + "dependencies": { + "mdast-util-mdx": "^2.0.0", + "micromark-extension-mdxjs": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/trough": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.1.0.tgz", + "integrity": "sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", + "dependencies": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/docusaurus-mdx-loader-v2/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/docusaurus-node-polyfills": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/docusaurus-node-polyfills/-/docusaurus-node-polyfills-1.0.0.tgz", @@ -6906,6 +7303,18 @@ "medium-zoom": "^1.0.6" } }, + "node_modules/docusaurus-theme-mdx-v2": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/docusaurus-theme-mdx-v2/-/docusaurus-theme-mdx-v2-0.1.2.tgz", + "integrity": "sha512-n5L4nx0LV5coTkZYS+owXmM0ACXWCbd4ou7aDrWIMm3YH7XPusSNelJpYsUKJxHFER/+czitbmieboFe4I7lMQ==", + "dependencies": { + "@mdx-js/react": "^2.1.0", + "docusaurus-mdx-loader-v2": "0.1.2" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/dom-converter": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", @@ -7247,6 +7656,106 @@ "node": ">=4.0" } }, + "node_modules/estree-util-attach-comments": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/estree-util-attach-comments/-/estree-util-attach-comments-2.1.1.tgz", + "integrity": "sha512-+5Ba/xGGS6mnwFbXIuQiDPTbuTxuMCooq3arVv7gPZtYpjp+VXH/NkHAP35OOefPhNG/UGqU3vt/LTABwcHX0w==", + "dependencies": { + "@types/estree": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-build-jsx": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/estree-util-build-jsx/-/estree-util-build-jsx-2.2.2.tgz", + "integrity": "sha512-m56vOXcOBuaF+Igpb9OPAy7f9w9OIkb5yhjsZuaPm7HoGi4oTOQi0h2+yZ+AtKklYFZ+rPC4n0wYCJCEU1ONqg==", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "estree-util-is-identifier-name": "^2.0.0", + "estree-walker": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-is-identifier-name": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-2.1.0.tgz", + "integrity": "sha512-bEN9VHRyXAUOjkKVQVvArFym08BTWB0aJPppZZr0UNyAqWsLaVfAqP7hbaTJjzHifmB5ebnR8Wm7r7yGN/HonQ==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-to-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/estree-util-to-js/-/estree-util-to-js-1.2.0.tgz", + "integrity": "sha512-IzU74r1PK5IMMGZXUVZbmiu4A1uhiPgW5hm1GjcOfr4ZzHaMPpLNJjR7HjXiIOzi25nZDrgFTobHTkV5Q6ITjA==", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "astring": "^1.8.0", + "source-map": "^0.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-to-js/node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/estree-util-value-to-estree": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/estree-util-value-to-estree/-/estree-util-value-to-estree-1.3.0.tgz", + "integrity": "sha512-Y+ughcF9jSUJvncXwqRageavjrNPAI+1M/L3BI3PyLp1nmgYTGUXU6t5z1Y7OWuThoDdhPME07bQU+d5LxdJqw==", + "dependencies": { + "is-plain-obj": "^3.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/estree-util-value-to-estree/node_modules/is-plain-obj": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", + "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/estree-util-visit": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/estree-util-visit/-/estree-util-visit-1.2.1.tgz", + "integrity": "sha512-xbgqcrkIVbIG+lI/gzbvd9SGTJL4zqJKBFttUl5pP27KhAjtMKbX/mQXJ7qgyXpMgVy/zvpm0xoQQaGL8OloOw==", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -8606,6 +9115,88 @@ "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" }, + "node_modules/hast-util-to-estree": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/hast-util-to-estree/-/hast-util-to-estree-2.3.3.tgz", + "integrity": "sha512-ihhPIUPxN0v0w6M5+IiAZZrn0LH2uZomeWwhn7uP7avZC6TE7lIiEh2yBMPr5+zi1aUCXq6VoYRgs2Bw9xmycQ==", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^2.0.0", + "@types/unist": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "estree-util-attach-comments": "^2.0.0", + "estree-util-is-identifier-name": "^2.0.0", + "hast-util-whitespace": "^2.0.0", + "mdast-util-mdx-expression": "^1.0.0", + "mdast-util-mdxjs-esm": "^1.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-object": "^0.4.1", + "unist-util-position": "^4.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-estree/node_modules/comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/hast-util-to-estree/node_modules/property-information": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.2.0.tgz", + "integrity": "sha512-kma4U7AFCTwpqq5twzC1YVIDXSqg6qQK6JN0smOw8fgRy1OkMi0CYSzFmsy6dnqSenamAtj0CyXMUJ1Mf6oROg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/hast-util-to-estree/node_modules/space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/hast-util-to-estree/node_modules/style-to-object": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-0.4.1.tgz", + "integrity": "sha512-HFpbb5gr2ypci7Qw+IOhnP2zOU7e77b+rzM+wTzXzfi1PrtBCX0E7Pk4wL4iTLnhzZ+JgEGAhX81ebTg/aYjQw==", + "dependencies": { + "inline-style-parser": "0.1.1" + } + }, + "node_modules/hast-util-to-estree/node_modules/unist-util-position": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.4.tgz", + "integrity": "sha512-kUBE91efOWfIVBo8xzh/uZQ7p9ffYRtUbMRZBNFYwf0RK8koUMx6dGUfwylLOKmaT2cs4wSW96QoYUSXAyEtpg==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-estree/node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/hast-util-to-parse5": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-6.0.0.tgz", @@ -8622,6 +9213,15 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/hast-util-whitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz", + "integrity": "sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/hastscript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-6.0.0.tgz", @@ -9472,6 +10072,14 @@ "node": ">=0.10.0" } }, + "node_modules/is-reference": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.1.tgz", + "integrity": "sha512-baJJdQLiYaJdvFbJqXrcGv3WU3QCzBlUcI5QhbesIm6/xPsvmO+2CDoi/GMOFBQEQm+PXkwOPrp9KK5ozZsp2w==", + "dependencies": { + "@types/estree": "*" + } + }, "node_modules/is-regexp": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", @@ -9952,6 +10560,15 @@ "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==" }, + "node_modules/longest-streak": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-2.0.4.tgz", + "integrity": "sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -9987,6 +10604,14 @@ "yallist": "^3.0.2" } }, + "node_modules/lz-string": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", + "bin": { + "lz-string": "bin/bin.js" + } + }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -10058,6 +10683,26 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/markdown-extensions": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-1.1.1.tgz", + "integrity": "sha512-WWC0ZuMzCyDHYCasEGs4IPvLyTGftYwh6wIEOULOF0HXcqZlhwRzrK0w2VUlxWA98xnvb/jszw4ZSkJ6ADpM6Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/markdown-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", + "integrity": "sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==", + "dependencies": { + "repeat-string": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -10093,6 +10738,20 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-find-and-replace": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-1.1.1.tgz", + "integrity": "sha512-9cKl33Y21lyckGzpSmEQnIDjEfeeWelN5s1kUW1LwdB0Fkuq2u+4GdqcGEygYxJE8GVqCl0741bYXHgamfWAZA==", + "dependencies": { + "escape-string-regexp": "^4.0.0", + "unist-util-is": "^4.0.0", + "unist-util-visit-parents": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-from-markdown": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.3.1.tgz", @@ -10128,6 +10787,652 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-gfm": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-0.1.2.tgz", + "integrity": "sha512-NNkhDx/qYcuOWB7xHUGWZYVXvjPFFd6afg6/e2g+SV4r9q5XUcCbV4Wfa3DLYIiD+xAEZc6K4MGaE/m0KDcPwQ==", + "dependencies": { + "mdast-util-gfm-autolink-literal": "^0.1.0", + "mdast-util-gfm-strikethrough": "^0.2.0", + "mdast-util-gfm-table": "^0.1.0", + "mdast-util-gfm-task-list-item": "^0.1.0", + "mdast-util-to-markdown": "^0.6.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-autolink-literal": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.3.tgz", + "integrity": "sha512-GjmLjWrXg1wqMIO9+ZsRik/s7PLwTaeCHVB7vRxUwLntZc8mzmTsLVr6HW1yLokcnhfURsn5zmSVdi3/xWWu1A==", + "dependencies": { + "ccount": "^1.0.0", + "mdast-util-find-and-replace": "^1.1.0", + "micromark": "^2.11.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-autolink-literal/node_modules/micromark": { + "version": "2.11.4", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.4.tgz", + "integrity": "sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "debug": "^4.0.0", + "parse-entities": "^2.0.0" + } + }, + "node_modules/mdast-util-gfm-strikethrough": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-0.2.3.tgz", + "integrity": "sha512-5OQLXpt6qdbttcDG/UxYY7Yjj3e8P7X16LzvpX8pIQPYJ/C2Z1qFGMmcw+1PZMUM3Z8wt8NRfYTvCni93mgsgA==", + "dependencies": { + "mdast-util-to-markdown": "^0.6.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-table": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-0.1.6.tgz", + "integrity": "sha512-j4yDxQ66AJSBwGkbpFEp9uG/LS1tZV3P33fN1gkyRB2LoRL+RR3f76m0HPHaby6F4Z5xr9Fv1URmATlRRUIpRQ==", + "dependencies": { + "markdown-table": "^2.0.0", + "mdast-util-to-markdown": "~0.6.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-task-list-item": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-0.1.6.tgz", + "integrity": "sha512-/d51FFIfPsSmCIRNp7E6pozM9z1GYPIkSy1urQ8s/o4TC22BZ7DqfHFWiqBD23bc7J3vV1Fc9O4QIHBlfuit8A==", + "dependencies": { + "mdast-util-to-markdown": "~0.6.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-2.0.1.tgz", + "integrity": "sha512-38w5y+r8nyKlGvNjSEqWrhG0w5PmnRA+wnBvm+ulYCct7nsGYhFVb0lljS9bQav4psDAS1eGkP2LMVcZBi/aqw==", + "dependencies": { + "mdast-util-from-markdown": "^1.0.0", + "mdast-util-mdx-expression": "^1.0.0", + "mdast-util-mdx-jsx": "^2.0.0", + "mdast-util-mdxjs-esm": "^1.0.0", + "mdast-util-to-markdown": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-expression": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-1.3.2.tgz", + "integrity": "sha512-xIPmR5ReJDu/DHH1OoIT1HkuybIfRGYRywC+gJtI7qHjCJp/M9jrmBEJW22O8lskDWm562BX2W8TiAwRTb0rKA==", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^2.0.0", + "@types/mdast": "^3.0.0", + "mdast-util-from-markdown": "^1.0.0", + "mdast-util-to-markdown": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-expression/node_modules/longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-mdx-expression/node_modules/mdast-util-to-markdown": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-1.5.0.tgz", + "integrity": "sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==", + "dependencies": { + "@types/mdast": "^3.0.0", + "@types/unist": "^2.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^3.0.0", + "mdast-util-to-string": "^3.0.0", + "micromark-util-decode-string": "^1.0.0", + "unist-util-visit": "^4.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-expression/node_modules/mdast-util-to-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz", + "integrity": "sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==", + "dependencies": { + "@types/mdast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-expression/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-expression/node_modules/unist-util-visit": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.1.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-expression/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-expression/node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-mdx-jsx": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-2.1.4.tgz", + "integrity": "sha512-DtMn9CmVhVzZx3f+optVDF8yFgQVt7FghCRNdlIaS3X5Bnym3hZwPbg/XW86vdpKjlc1PVj26SpnLGeJBXD3JA==", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^2.0.0", + "@types/mdast": "^3.0.0", + "@types/unist": "^2.0.0", + "ccount": "^2.0.0", + "mdast-util-from-markdown": "^1.1.0", + "mdast-util-to-markdown": "^1.3.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-remove-position": "^4.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx/node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-mdx-jsx/node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-mdx-jsx/node_modules/character-reference-invalid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", + "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-mdx-jsx/node_modules/is-alphabetical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", + "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-mdx-jsx/node_modules/is-alphanumerical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", + "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-mdx-jsx/node_modules/is-decimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", + "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-mdx-jsx/node_modules/is-hexadecimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", + "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-mdx-jsx/node_modules/longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-mdx-jsx/node_modules/mdast-util-to-markdown": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-1.5.0.tgz", + "integrity": "sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==", + "dependencies": { + "@types/mdast": "^3.0.0", + "@types/unist": "^2.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^3.0.0", + "mdast-util-to-string": "^3.0.0", + "micromark-util-decode-string": "^1.0.0", + "unist-util-visit": "^4.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx/node_modules/mdast-util-to-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz", + "integrity": "sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==", + "dependencies": { + "@types/mdast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx/node_modules/parse-entities": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.1.tgz", + "integrity": "sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w==", + "dependencies": { + "@types/unist": "^2.0.0", + "character-entities": "^2.0.0", + "character-entities-legacy": "^3.0.0", + "character-reference-invalid": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0", + "is-hexadecimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-mdx-jsx/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx/node_modules/unist-util-remove-position": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-4.0.2.tgz", + "integrity": "sha512-TkBb0HABNmxzAcfLf4qsIbFbaPDvMO6wa3b3j4VcEzFVaw1LBKwnW4/sRJ/atSLSzoIg41JWEdnE7N6DIhGDGQ==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-visit": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx/node_modules/unist-util-visit": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.1.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx/node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-mdx/node_modules/longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-mdx/node_modules/mdast-util-to-markdown": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-1.5.0.tgz", + "integrity": "sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==", + "dependencies": { + "@types/mdast": "^3.0.0", + "@types/unist": "^2.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^3.0.0", + "mdast-util-to-string": "^3.0.0", + "micromark-util-decode-string": "^1.0.0", + "unist-util-visit": "^4.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx/node_modules/mdast-util-to-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz", + "integrity": "sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==", + "dependencies": { + "@types/mdast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx/node_modules/unist-util-visit": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.1.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx/node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-mdxjs-esm": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-1.3.1.tgz", + "integrity": "sha512-SXqglS0HrEvSdUEfoXFtcg7DRl7S2cwOXc7jkuusG472Mmjag34DUDeOJUZtl+BVnyeO1frIgVpHlNRWc2gk/w==", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^2.0.0", + "@types/mdast": "^3.0.0", + "mdast-util-from-markdown": "^1.0.0", + "mdast-util-to-markdown": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdxjs-esm/node_modules/longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-mdxjs-esm/node_modules/mdast-util-to-markdown": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-1.5.0.tgz", + "integrity": "sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==", + "dependencies": { + "@types/mdast": "^3.0.0", + "@types/unist": "^2.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^3.0.0", + "mdast-util-to-string": "^3.0.0", + "micromark-util-decode-string": "^1.0.0", + "unist-util-visit": "^4.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdxjs-esm/node_modules/mdast-util-to-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz", + "integrity": "sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==", + "dependencies": { + "@types/mdast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdxjs-esm/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdxjs-esm/node_modules/unist-util-visit": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.1.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdxjs-esm/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdxjs-esm/node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-phrasing": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-3.0.1.tgz", + "integrity": "sha512-WmI1gTXUBJo4/ZmSk79Wcb2HcjPJBzM1nlI/OUWA8yk2X9ik3ffNbBGsU+09BFmXaL1IBb9fiuvq6/KMiNycSg==", + "dependencies": { + "@types/mdast": "^3.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-phrasing/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-to-hast": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-10.0.1.tgz", @@ -10147,6 +11452,23 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-to-markdown": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.5.tgz", + "integrity": "sha512-XeV9sDE7ZlOQvs45C9UKMtfTcctcaj/pGwH8YLbMHoMOXNNCn2LsqVQOqrF1+/NU8lKDAqozme9SCXWyo9oAcQ==", + "dependencies": { + "@types/unist": "^2.0.0", + "longest-streak": "^2.0.0", + "mdast-util-to-string": "^2.0.0", + "parse-entities": "^2.0.0", + "repeat-string": "^1.0.0", + "zwitch": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-to-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz", @@ -10326,6 +11648,298 @@ "uvu": "^0.5.0" } }, + "node_modules/micromark-extension-gfm": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-0.3.3.tgz", + "integrity": "sha512-oVN4zv5/tAIA+l3GbMi7lWeYpJ14oQyJ3uEim20ktYFAcfX1x3LNlFGGlmrZHt7u9YlKExmyJdDGaTt6cMSR/A==", + "dependencies": { + "micromark": "~2.11.0", + "micromark-extension-gfm-autolink-literal": "~0.5.0", + "micromark-extension-gfm-strikethrough": "~0.6.5", + "micromark-extension-gfm-table": "~0.4.0", + "micromark-extension-gfm-tagfilter": "~0.3.0", + "micromark-extension-gfm-task-list-item": "~0.3.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-autolink-literal": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.7.tgz", + "integrity": "sha512-ePiDGH0/lhcngCe8FtH4ARFoxKTUelMp4L7Gg2pujYD5CSMb9PbblnyL+AAMud/SNMyusbS2XDSiPIRcQoNFAw==", + "dependencies": { + "micromark": "~2.11.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-autolink-literal/node_modules/micromark": { + "version": "2.11.4", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.4.tgz", + "integrity": "sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "debug": "^4.0.0", + "parse-entities": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-strikethrough": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.5.tgz", + "integrity": "sha512-PpOKlgokpQRwUesRwWEp+fHjGGkZEejj83k9gU5iXCbDG+XBA92BqnRKYJdfqfkrRcZRgGuPuXb7DaK/DmxOhw==", + "dependencies": { + "micromark": "~2.11.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-strikethrough/node_modules/micromark": { + "version": "2.11.4", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.4.tgz", + "integrity": "sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "debug": "^4.0.0", + "parse-entities": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-table": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.3.tgz", + "integrity": "sha512-hVGvESPq0fk6ALWtomcwmgLvH8ZSVpcPjzi0AjPclB9FsVRgMtGZkUcpE0zgjOCFAznKepF4z3hX8z6e3HODdA==", + "dependencies": { + "micromark": "~2.11.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-table/node_modules/micromark": { + "version": "2.11.4", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.4.tgz", + "integrity": "sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "debug": "^4.0.0", + "parse-entities": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-tagfilter": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-0.3.0.tgz", + "integrity": "sha512-9GU0xBatryXifL//FJH+tAZ6i240xQuFrSL7mYi8f4oZSbc+NvXjkrHemeYP0+L4ZUT+Ptz3b95zhUZnMtoi/Q==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-task-list-item": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-0.3.3.tgz", + "integrity": "sha512-0zvM5iSLKrc/NQl84pZSjGo66aTGd57C1idmlWmE87lkMcXrTxg1uXa/nXomxJytoje9trP0NDLvw4bZ/Z/XCQ==", + "dependencies": { + "micromark": "~2.11.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-task-list-item/node_modules/micromark": { + "version": "2.11.4", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.4.tgz", + "integrity": "sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "debug": "^4.0.0", + "parse-entities": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm/node_modules/micromark": { + "version": "2.11.4", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.4.tgz", + "integrity": "sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "debug": "^4.0.0", + "parse-entities": "^2.0.0" + } + }, + "node_modules/micromark-extension-mdx-expression": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-1.0.8.tgz", + "integrity": "sha512-zZpeQtc5wfWKdzDsHRBY003H2Smg+PUi2REhqgIhdzAa5xonhP03FcXxqFSerFiNUr5AWmHpaNPQTBVOS4lrXw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "@types/estree": "^1.0.0", + "micromark-factory-mdx-expression": "^1.0.0", + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-events-to-acorn": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + } + }, + "node_modules/micromark-extension-mdx-jsx": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-jsx/-/micromark-extension-mdx-jsx-1.0.5.tgz", + "integrity": "sha512-gPH+9ZdmDflbu19Xkb8+gheqEDqkSpdCEubQyxuz/Hn8DOXiXvrXeikOoBA71+e8Pfi0/UYmU3wW3H58kr7akA==", + "dependencies": { + "@types/acorn": "^4.0.0", + "@types/estree": "^1.0.0", + "estree-util-is-identifier-name": "^2.0.0", + "micromark-factory-mdx-expression": "^1.0.0", + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdx-jsx/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdx-md": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-md/-/micromark-extension-mdx-md-1.0.1.tgz", + "integrity": "sha512-7MSuj2S7xjOQXAjjkbjBsHkMtb+mDGVW6uI2dBL9snOBCbZmoNgDAeZ0nSn9j3T42UE/g2xVNMn18PJxZvkBEA==", + "dependencies": { + "micromark-util-types": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdxjs": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs/-/micromark-extension-mdxjs-1.0.1.tgz", + "integrity": "sha512-7YA7hF6i5eKOfFUzZ+0z6avRG52GpWR8DL+kN47y3f2KhxbBZMhmxe7auOeaTBrW2DenbbZTf1ea9tA2hDpC2Q==", + "dependencies": { + "acorn": "^8.0.0", + "acorn-jsx": "^5.0.0", + "micromark-extension-mdx-expression": "^1.0.0", + "micromark-extension-mdx-jsx": "^1.0.0", + "micromark-extension-mdx-md": "^1.0.0", + "micromark-extension-mdxjs-esm": "^1.0.0", + "micromark-util-combine-extensions": "^1.0.0", + "micromark-util-types": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdxjs-esm": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs-esm/-/micromark-extension-mdxjs-esm-1.0.5.tgz", + "integrity": "sha512-xNRBw4aoURcyz/S69B19WnZAkWJMxHMT5hE36GtDAyhoyn/8TuAeqjFJQlwk+MKQsUD7b3l7kFX+vlfVWgcX1w==", + "dependencies": { + "@types/estree": "^1.0.0", + "micromark-core-commonmark": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-events-to-acorn": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "unist-util-position-from-estree": "^1.1.0", + "uvu": "^0.5.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdxjs-esm/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/micromark-factory-destination": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.1.0.tgz", @@ -10367,6 +11981,44 @@ "uvu": "^0.5.0" } }, + "node_modules/micromark-factory-mdx-expression": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/micromark-factory-mdx-expression/-/micromark-factory-mdx-expression-1.0.9.tgz", + "integrity": "sha512-jGIWzSmNfdnkJq05c7b0+Wv0Kfz3NJ3N4cBjnbO4zjXIlxJr+f8lk+5ZmwFvqdAbUy2q6B5rCY//g0QAAaXDWA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "@types/estree": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-events-to-acorn": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "unist-util-position-from-estree": "^1.0.0", + "uvu": "^0.5.0", + "vfile-message": "^3.0.0" + } + }, + "node_modules/micromark-factory-mdx-expression/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/micromark-factory-space": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-1.1.0.tgz", @@ -10558,6 +12210,44 @@ } ] }, + "node_modules/micromark-util-events-to-acorn": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/micromark-util-events-to-acorn/-/micromark-util-events-to-acorn-1.2.3.tgz", + "integrity": "sha512-ij4X7Wuc4fED6UoLWkmo0xJQhsktfNh1J0m8g4PbIMPlx+ek/4YdW5mvbye8z/aZvAPUoxgXHrwVlXAPKMRp1w==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "@types/acorn": "^4.0.0", + "@types/estree": "^1.0.0", + "@types/unist": "^2.0.0", + "estree-util-visit": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0", + "vfile-message": "^3.0.0" + } + }, + "node_modules/micromark-util-events-to-acorn/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/micromark-util-html-tag-name": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.2.0.tgz", @@ -12117,6 +13807,16 @@ "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", "integrity": "sha512-YHk5ez1hmMR5LOkb9iJkLKqoBlL7WD5M8ljC75ZfzXriuBIVNuecaXuU7e+hOwyqf24Wxhh7Vxgt7Hnw9288Tg==" }, + "node_modules/periscopic": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz", + "integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^3.0.0", + "is-reference": "^3.0.0" + } + }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -13957,6 +15657,56 @@ "jsesc": "bin/jsesc" } }, + "node_modules/rehype-parse": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-6.0.2.tgz", + "integrity": "sha512-0S3CpvpTAgGmnz8kiCyFLGuW5yA4OQhyNTm/nwPopZ7+PI11WnGl1TTWTGv/2hPEe/g2jRLlhVVSsoDH8waRug==", + "dependencies": { + "hast-util-from-parse5": "^5.0.0", + "parse5": "^5.0.0", + "xtend": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-parse/node_modules/hast-util-from-parse5": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-5.0.3.tgz", + "integrity": "sha512-gOc8UB99F6eWVWFtM9jUikjN7QkWxB3nY0df5Z0Zq1/Nkwl5V4hAAsl0tmwlgWl/1shlTF8DnNYLO8X6wRV9pA==", + "dependencies": { + "ccount": "^1.0.3", + "hastscript": "^5.0.0", + "property-information": "^5.0.0", + "web-namespaces": "^1.1.2", + "xtend": "^4.0.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-parse/node_modules/hastscript": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-5.1.2.tgz", + "integrity": "sha512-WlztFuK+Lrvi3EggsqOkQ52rKbxkXL3RwB6t5lwoa8QLMemoWfBuL43eDrwOamJyR7uKQKdmKYaBH1NZBiIRrQ==", + "dependencies": { + "comma-separated-tokens": "^1.0.0", + "hast-util-parse-selector": "^2.0.0", + "property-information": "^5.0.0", + "space-separated-tokens": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-parse/node_modules/parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==" + }, "node_modules/relateurl": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", @@ -13965,6 +15715,40 @@ "node": ">= 0.10" } }, + "node_modules/remark-admonitions": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/remark-admonitions/-/remark-admonitions-1.2.1.tgz", + "integrity": "sha512-Ji6p68VDvD+H1oS95Fdx9Ar5WA2wcDA4kwrrhVU7fGctC6+d3uiMICu7w7/2Xld+lnU7/gi+432+rRbup5S8ow==", + "dependencies": { + "rehype-parse": "^6.0.2", + "unified": "^8.4.2", + "unist-util-visit": "^2.0.1" + } + }, + "node_modules/remark-admonitions/node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/remark-admonitions/node_modules/unified": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-8.4.2.tgz", + "integrity": "sha512-JCrmN13jI4+h9UAyKEoGcDZV+i1E7BLFuG7OsaDvTXI5P0qhHX+vZO/kOhz9jn8HGENDKbwSeB0nVOg4gVStGA==", + "dependencies": { + "bail": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^2.0.0", + "trough": "^1.0.0", + "vfile": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-emoji": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/remark-emoji/-/remark-emoji-2.2.0.tgz", @@ -13984,6 +15768,19 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-gfm": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-1.0.0.tgz", + "integrity": "sha512-KfexHJCiqvrdBZVbQ6RopMZGwaXz6wFJEfByIuEwGf0arvITHjiKKZ1dpXujjH9KZdm1//XJQwgfnJ3lmXaDPA==", + "dependencies": { + "mdast-util-gfm": "^0.1.0", + "micromark-extension-gfm": "^0.3.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-mdx": { "version": "1.6.22", "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-1.6.22.tgz", @@ -14206,6 +16003,189 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-rehype": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-10.1.0.tgz", + "integrity": "sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw==", + "dependencies": { + "@types/hast": "^2.0.0", + "@types/mdast": "^3.0.0", + "mdast-util-to-hast": "^12.1.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype/node_modules/bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-rehype/node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/remark-rehype/node_modules/mdast-util-definitions": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-5.1.2.tgz", + "integrity": "sha512-8SVPMuHqlPME/z3gqVwWY4zVXn8lqKv/pAhC57FuJ40ImXyBpmO5ukh98zB2v7Blql2FiHjHv9LVztSIqjY+MA==", + "dependencies": { + "@types/mdast": "^3.0.0", + "@types/unist": "^2.0.0", + "unist-util-visit": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype/node_modules/mdast-util-to-hast": { + "version": "12.3.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-12.3.0.tgz", + "integrity": "sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw==", + "dependencies": { + "@types/hast": "^2.0.0", + "@types/mdast": "^3.0.0", + "mdast-util-definitions": "^5.0.0", + "micromark-util-sanitize-uri": "^1.1.0", + "trim-lines": "^3.0.0", + "unist-util-generated": "^2.0.0", + "unist-util-position": "^4.0.0", + "unist-util-visit": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype/node_modules/trough": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.1.0.tgz", + "integrity": "sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-rehype/node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", + "dependencies": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype/node_modules/unist-util-generated": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-2.0.1.tgz", + "integrity": "sha512-qF72kLmPxAw0oN2fwpWIqbXAVyEqUzDHMsbtPvOudIlUzXYFIeQIuxXQCRCFh22B7cixvU0MG7m3MW8FTq/S+A==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype/node_modules/unist-util-position": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.4.tgz", + "integrity": "sha512-kUBE91efOWfIVBo8xzh/uZQ7p9ffYRtUbMRZBNFYwf0RK8koUMx6dGUfwylLOKmaT2cs4wSW96QoYUSXAyEtpg==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype/node_modules/unist-util-visit": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.1.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-squeeze-paragraphs": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/remark-squeeze-paragraphs/-/remark-squeeze-paragraphs-4.0.0.tgz", @@ -15445,6 +17425,28 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/stringify-entities": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.3.tgz", + "integrity": "sha512-BP9nNHMhhfcMbiuQKCqMjhDP5yBCAxsPu4pHFFzJ6Alo9dZgY4VLDPutXqIjpRiMoKdp7Av85Gr73Q5uH9k7+g==", + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/stringify-entities/node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/stringify-object": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", @@ -16033,6 +18035,15 @@ "integrity": "sha512-YzQV+TZg4AxpKxaTHK3c3D+kRDCGVEE7LemdlQZoQXn0iennk10RsIoY6ikzAqJTc9Xjl9C1/waHom/J86ziAQ==", "deprecated": "Use String.prototype.trim() instead" }, + "node_modules/trim-lines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/trim-newlines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", @@ -16441,6 +18452,18 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/unist-util-position-from-estree": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/unist-util-position-from-estree/-/unist-util-position-from-estree-1.1.2.tgz", + "integrity": "sha512-poZa0eXpS+/XpoQwGwl79UUdea4ol2ZuCYguVaJS4qzIOMDzbqz8a3erUCOmubSZkaOuGamb3tX790iwOIROww==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/unist-util-remove": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/unist-util-remove/-/unist-util-remove-2.1.0.tgz", diff --git a/docs/package.json b/docs/package.json index c7732b3dc..856e66ebe 100644 --- a/docs/package.json +++ b/docs/package.json @@ -15,12 +15,13 @@ }, "dependencies": { "@babel/preset-react": "^7.22.3", + "@code-hike/mdx": "^0.9.0", "@docusaurus/core": "2.4.1", "@docusaurus/plugin-ideal-image": "^2.4.1", "@docusaurus/preset-classic": "2.4.1", "@docusaurus/theme-classic": "^2.4.1", "@docusaurus/theme-search-algolia": "^2.4.1", - "@mdx-js/react": "^1.6.22", + "@mdx-js/react": "^2.3.0", "@mendable/search": "^0.0.114", "@pbe/react-yandex-maps": "^1.2.4", "@prismicio/client": "^7.0.1", @@ -28,6 +29,7 @@ "autoprefixer": "^10.4.14", "clsx": "^1.2.1", "docusaurus-plugin-image-zoom": "^0.1.4", + "docusaurus-theme-mdx-v2": "^0.1.2", "jquery": "^3.7.0", "medium-zoom": "^1.0.8", "node-fetch": "^3.3.1", @@ -67,4 +69,4 @@ "engines": { "node": ">=16.14" } -} \ No newline at end of file +} diff --git a/docs/sidebars.js b/docs/sidebars.js index 01a84cf33..ef98f042a 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -21,6 +21,8 @@ module.exports = { "guidelines/collection", "guidelines/prompt-customization", "guidelines/chat-interface", + "guidelines/chat-widget", + "guidelines/custom-component", ], }, { @@ -30,6 +32,7 @@ module.exports = { items: [ "components/agents", "components/chains", + "components/custom", "components/embeddings", "components/llms", "components/loaders", @@ -63,6 +66,7 @@ module.exports = { label: "Examples", collapsed: false, items: [ + "examples/flow-runner", "examples/conversation-chain", "examples/buffer-memory", "examples/midjourney-prompt-chain", diff --git a/docs/src/css/custom.css b/docs/src/css/custom.css index 2f6f992f3..b79c4df59 100644 --- a/docs/src/css/custom.css +++ b/docs/src/css/custom.css @@ -3,17 +3,19 @@ * bundles Infima by default. Infima is a CSS framework designed to * work well for content-centric websites. */ - :root { +:root { --ifm-background-color: var(--token-primary-bg-c); --ifm-navbar-link-hover-color: initial; --ifm-navbar-padding-vertical: 0; --ifm-navbar-item-padding-vertical: 0; - --ifm-font-family-base: -apple-system, BlinkMacSystemFont, Inter, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI emoji'; - --ifm-font-family-monospace: 'SFMono-Regular', 'Roboto Mono', Consolas, 'Liberation Mono', Menlo, Courier, monospace; + --ifm-font-family-base: -apple-system, BlinkMacSystemFont, Inter, Helvetica, + Arial, sans-serif, "Apple Color Emoji", "Segoe UI emoji"; + --ifm-font-family-monospace: "SFMono-Regular", "Roboto Mono", Consolas, + "Liberation Mono", Menlo, Courier, monospace; } .theme-doc-sidebar-item-category.menu__list-item:not(:first-child) { - margin-top: 1.5rem!important; + margin-top: 1.5rem !important; } .docusaurus-highlight-code-line { @@ -31,7 +33,7 @@ transform: skewY(6deg); } -[class^='announcementBar'] { +[class^="announcementBar"] { z-index: 10; } @@ -112,7 +114,7 @@ body { } .header-github-link:before { - content: ''; + content: ""; width: 24px; height: 24px; display: flex; @@ -126,7 +128,7 @@ body { } .header-twitter-link::before { - content: ''; + content: ""; width: 24px; height: 24px; display: flex; @@ -140,7 +142,7 @@ body { } .header-discord-link::before { - content: ''; + content: ""; width: 24px; height: 24px; display: flex; @@ -148,7 +150,6 @@ body { background-size: contain; } - /* Images */ .image-rendering-crisp { image-rendering: crisp-edges; @@ -164,7 +165,7 @@ body { .img-center { display: flex; justify-content: center; - width: 100%, + width: 100%; } .resized-image { @@ -188,4 +189,22 @@ body { .mendable-search { width: 140px; } -} \ No newline at end of file +} +/* +.ch-scrollycoding { + gap: 10rem !important; +} */ + +.ch-scrollycoding-content { + max-width: 55% !important; + min-width: 40% !important; +} + +.ch-scrollycoding-sticker { + max-width: 60% !important; + min-width: 45% !important; +} + +.ch-scrollycoding-step-content { + min-height: 70px; +} diff --git a/docs/src/theme/ZoomableImage.js b/docs/src/theme/ZoomableImage.js index 750066bb7..aeeb0454a 100644 --- a/docs/src/theme/ZoomableImage.js +++ b/docs/src/theme/ZoomableImage.js @@ -1,8 +1,9 @@ -import React, { useState, useEffect } from 'react'; -import ThemedImage from '@theme/ThemedImage'; -import useBaseUrl from '@docusaurus/useBaseUrl'; +import React, { useState, useEffect } from "react"; +import ThemedImage from "@theme/ThemedImage"; +import useBaseUrl from "@docusaurus/useBaseUrl"; -const ZoomableImage = ({ alt, sources }) => { +const ZoomableImage = ({ alt, sources, style }) => { + // add style here const [isFullscreen, setIsFullscreen] = useState(false); const toggleFullscreen = () => { @@ -10,27 +11,36 @@ const ZoomableImage = ({ alt, sources }) => { }; const handleKeyPress = (event) => { - if (event.key === 'Escape') { + if (event.key === "Escape") { setIsFullscreen(false); } }; useEffect(() => { if (isFullscreen) { - document.addEventListener('keydown', handleKeyPress); + document.addEventListener("keydown", handleKeyPress); } else { - document.removeEventListener('keydown', handleKeyPress); + document.removeEventListener("keydown", handleKeyPress); } return () => { - document.removeEventListener('keydown', handleKeyPress); + document.removeEventListener("keydown", handleKeyPress); }; }, [isFullscreen]); + // Default style + const defaultStyle = { + width: "50%", + margin: "0 auto", + display: "flex", + justifyContent: "center", + }; + return (
"] maintainers = [ + "Carlos Coelho ", "Cristhian Zanforlin ", "Gabriel Almeida ", "Gustavo Schaedler ", + "Igor Carvalho ", "Lucas Eduoli ", "Otávio Anovazzi ", + "Rodrigo Nader ", ] repository = "https://github.com/logspace-ai/langflow" license = "MIT" diff --git a/src/backend/langflow/__init__.py b/src/backend/langflow/__init__.py index d6c645486..5920369e2 100644 --- a/src/backend/langflow/__init__.py +++ b/src/backend/langflow/__init__.py @@ -1,7 +1,7 @@ from importlib import metadata from langflow.cache import cache_manager from langflow.processing.process import load_flow_from_json -from langflow.utils.types import Prompt +from langflow.interface.custom.custom_component import CustomComponent try: __version__ = metadata.version(__package__) @@ -10,4 +10,4 @@ except metadata.PackageNotFoundError: __version__ = "" del metadata # optional, avoids polluting the results of dir(__package__) -__all__ = ["load_flow_from_json", "cache_manager", "Prompt"] +__all__ = ["load_flow_from_json", "cache_manager", "CustomComponent"] diff --git a/src/backend/langflow/interface/custom/code_parser.py b/src/backend/langflow/interface/custom/code_parser.py index aa4191448..d42f82635 100644 --- a/src/backend/langflow/interface/custom/code_parser.py +++ b/src/backend/langflow/interface/custom/code_parser.py @@ -2,8 +2,9 @@ import ast import inspect import traceback -from typing import Dict, Any, Type, Union +from typing import Dict, Any, List, Type, Union from fastapi import HTTPException +from langflow.interface.custom.schema import CallableCodeDetails, ClassCodeDetails class CodeSyntaxError(HTTPException): @@ -54,13 +55,13 @@ class CodeParser: return tree - def parse_node(self, node: ast.AST) -> None: + def parse_node(self, node: Union[ast.stmt, ast.AST]) -> None: """ Parses an AST node and updates the data dictionary with the relevant information. """ - if handler := self.handlers.get(type(node)): - handler(node) + if handler := self.handlers.get(type(node)): # type: ignore + handler(node) # type: ignore def parse_imports(self, node: Union[ast.Import, ast.ImportFrom]) -> None: """ @@ -92,27 +93,73 @@ class CodeParser: """ Extracts details from a single function or method node. """ - func = { - "name": node.name, - "doc": ast.get_docstring(node), - "args": [], - "body": [], - "return_type": ast.unparse(node.returns) if node.returns else None, - } + func = CallableCodeDetails( + name=node.name, + doc=ast.get_docstring(node), + args=[], + body=[], + return_type=ast.unparse(node.returns) if node.returns else None, + ) - # Handle positional arguments with default values - defaults = [None] * (len(node.args.args) - len(node.args.defaults)) + [ - ast.unparse(default) if default else None for default in node.args.defaults + func.args = self.parse_function_args(node) + func.body = self.parse_function_body(node) + + return func.dict() + + def parse_function_args(self, node: ast.FunctionDef) -> List[Dict[str, Any]]: + """ + Parses the arguments of a function or method node. + """ + args = [] + + args += self.parse_positional_args(node) + args += self.parse_varargs(node) + args += self.parse_keyword_args(node) + args += self.parse_kwargs(node) + + return args + + def parse_positional_args(self, node: ast.FunctionDef) -> List[Dict[str, Any]]: + """ + Parses the positional arguments of a function or method node. + """ + num_args = len(node.args.args) + num_defaults = len(node.args.defaults) + num_missing_defaults = num_args - num_defaults + missing_defaults = [None] * num_missing_defaults + default_values = [ + ast.unparse(default).strip("'") if default else None + for default in node.args.defaults + ] + # Now check all default values to see if there + # are any "None" values in the middle + default_values = [ + None if value == "None" else value for value in default_values ] - for arg, default in zip(node.args.args, defaults): - func["args"].append(self.parse_arg(arg, default)) + defaults = missing_defaults + default_values + + args = [ + self.parse_arg(arg, default) + for arg, default in zip(node.args.args, defaults) + ] + return args + + def parse_varargs(self, node: ast.FunctionDef) -> List[Dict[str, Any]]: + """ + Parses the *args argument of a function or method node. + """ + args = [] - # Handle *args if node.args.vararg: - func["args"].append(self.parse_arg(node.args.vararg, None)) + args.append(self.parse_arg(node.args.vararg, None)) - # Handle keyword-only arguments with default values + return args + + def parse_keyword_args(self, node: ast.FunctionDef) -> List[Dict[str, Any]]: + """ + Parses the keyword-only arguments of a function or method node. + """ kw_defaults = [None] * ( len(node.args.kwonlyargs) - len(node.args.kw_defaults) ) + [ @@ -120,16 +167,28 @@ class CodeParser: for default in node.args.kw_defaults ] - for arg, default in zip(node.args.kwonlyargs, kw_defaults): - func["args"].append(self.parse_arg(arg, default)) + args = [ + self.parse_arg(arg, default) + for arg, default in zip(node.args.kwonlyargs, kw_defaults) + ] + return args + + def parse_kwargs(self, node: ast.FunctionDef) -> List[Dict[str, Any]]: + """ + Parses the **kwargs argument of a function or method node. + """ + args = [] - # Handle **kwargs if node.args.kwarg: - func["args"].append(self.parse_arg(node.args.kwarg, None)) + args.append(self.parse_arg(node.args.kwarg, None)) - for line in node.body: - func["body"].append(ast.unparse(line)) - return func + return args + + def parse_function_body(self, node: ast.FunctionDef) -> List[str]: + """ + Parses the body of a function or method node. + """ + return [ast.unparse(line) for line in node.body] def parse_assign(self, stmt): """ @@ -164,29 +223,31 @@ class CodeParser: """ Extracts "classes" from the code, including inheritance and init methods. """ - class_dict = { - "name": node.name, - "doc": ast.get_docstring(node), - "bases": [ast.unparse(base) for base in node.bases], - "attributes": [], - "methods": [], - } + + class_details = ClassCodeDetails( + name=node.name, + doc=ast.get_docstring(node), + bases=[ast.unparse(base) for base in node.bases], + attributes=[], + methods=[], + init=None, + ) for stmt in node.body: if isinstance(stmt, ast.Assign): if attr := self.parse_assign(stmt): - class_dict["attributes"].append(attr) + class_details.attributes.append(attr) elif isinstance(stmt, ast.AnnAssign): if attr := self.parse_ann_assign(stmt): - class_dict["attributes"].append(attr) + class_details.attributes.append(attr) elif isinstance(stmt, ast.FunctionDef): method, is_init = self.parse_function_def(stmt) if is_init: - class_dict["init"] = method + class_details.init = method else: - class_dict["methods"].append(method) + class_details.methods.append(method) - self.data["classes"].append(class_dict) + self.data["classes"].append(class_details.dict()) def parse_global_vars(self, node: ast.Assign) -> None: """ diff --git a/src/backend/langflow/interface/custom/component.py b/src/backend/langflow/interface/custom/component.py index 3db2a2516..a9dc0f323 100644 --- a/src/backend/langflow/interface/custom/component.py +++ b/src/backend/langflow/interface/custom/component.py @@ -1,4 +1,5 @@ import ast +from typing import Optional from pydantic import BaseModel from fastapi import HTTPException @@ -20,7 +21,7 @@ class Component(BaseModel): "The name of the entrypoint function must be provided." ) - code: str + code: Optional[str] function_entrypoint_name = "build" field_config: dict = {} diff --git a/src/backend/langflow/interface/custom/constants.py b/src/backend/langflow/interface/custom/constants.py index 0a5809d5d..8e5db39b8 100644 --- a/src/backend/langflow/interface/custom/constants.py +++ b/src/backend/langflow/interface/custom/constants.py @@ -20,13 +20,22 @@ LANGCHAIN_BASE_TYPES = { "VectorStore": VectorStore, "Embeddings": Embeddings, "BaseRetriever": BaseRetriever, +} + +# Langchain base types plus Python base types +CUSTOM_COMPONENT_SUPPORTED_TYPES = { + **LANGCHAIN_BASE_TYPES, "str": str, + "int": int, + "float": float, + "bool": bool, + "list": list, + "dict": dict, } DEFAULT_CUSTOM_COMPONENT_CODE = """ -from langflow import Prompt -from langflow.interface.custom.custom_component import CustomComponent +from langflow import CustomComponent from langchain.llms.base import BaseLLM from langchain.chains import LLMChain @@ -38,11 +47,12 @@ import requests class YourComponent(CustomComponent): display_name: str = "Your Component" description: str = "Your description" - field_config = { "url": { "multiline": True, "required": True } } - def build(self, url: str, llm: BaseLLM, template: Prompt) -> Document: + def build_config(self): + return { "url": { "multiline": True, "required": True } } + + def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document: response = requests.get(url) - prompt = PromptTemplate.from_template(template) chain = LLMChain(llm=llm, prompt=prompt) result = chain.run(response.text[:300]) return Document(page_content=str(result)) diff --git a/src/backend/langflow/interface/custom/custom_component.py b/src/backend/langflow/interface/custom/custom_component.py index 1cc0ca620..d71aa729c 100644 --- a/src/backend/langflow/interface/custom/custom_component.py +++ b/src/backend/langflow/interface/custom/custom_component.py @@ -1,11 +1,10 @@ -from typing import Callable, Optional +from typing import Any, Callable, List, Optional from fastapi import HTTPException -from langflow.interface.custom.constants import LANGCHAIN_BASE_TYPES +from langflow.interface.custom.constants import CUSTOM_COMPONENT_SUPPORTED_TYPES from langflow.interface.custom.component import Component from langflow.utils import validate -from uuid import UUID from langflow.database.base import session_getter from langflow.database.models.flow import Flow from pydantic import Extra @@ -17,14 +16,14 @@ class CustomComponent(Component, extra=Extra.allow): code_class_base_inheritance = "CustomComponent" function_entrypoint_name = "build" function: Optional[Callable] = None - return_type_valid_list = list(LANGCHAIN_BASE_TYPES.keys()) + return_type_valid_list = list(CUSTOM_COMPONENT_SUPPORTED_TYPES.keys()) repr_value: Optional[str] = "" def __init__(self, **data): super().__init__(**data) def custom_repr(self): - return self.repr_value + return str(self.repr_value) def build_config(self): return self.field_config @@ -44,13 +43,15 @@ class CustomComponent(Component, extra=Extra.allow): return True def is_check_valid(self) -> bool: - return self._class_template_validation(self.code) + return self._class_template_validation(self.code) if self.code else False def get_code_tree(self, code: str): return super().get_code_tree(code) @property def get_function_entrypoint_args(self) -> str: + if not self.code: + return "" tree = self.get_code_tree(self.code) component_classes = [ @@ -78,6 +79,8 @@ class CustomComponent(Component, extra=Extra.allow): @property def get_function_entrypoint_return_type(self) -> str: + if not self.code: + return "" tree = self.get_code_tree(self.code) component_classes = [ @@ -138,16 +141,19 @@ class CustomComponent(Component, extra=Extra.allow): def get_function(self): return validate.create_function(self.code, self.function_entrypoint_name) - def load_flow(self, flow_id: UUID = None): + def load_flow(self, flow_id: str, tweaks: Optional[dict] = None) -> Any: from langflow.processing.process import build_sorted_vertices_with_caching + from langflow.processing.process import process_tweaks with session_getter() as session: - data_graph = flow.data if (flow := session.get(Flow, flow_id)) else None - if not data_graph: + graph_data = flow.data if (flow := session.get(Flow, flow_id)) else None + if not graph_data: raise ValueError(f"Flow {flow_id} not found") - return build_sorted_vertices_with_caching(data_graph) + if tweaks: + graph_data = process_tweaks(graph_data=graph_data, tweaks=tweaks) + return build_sorted_vertices_with_caching(graph_data) - def list_flows(self): + def list_flows(self) -> List[Flow]: with session_getter() as session: flows = session.query(Flow).all() return flows diff --git a/src/backend/langflow/interface/custom/schema.py b/src/backend/langflow/interface/custom/schema.py new file mode 100644 index 000000000..80d65405f --- /dev/null +++ b/src/backend/langflow/interface/custom/schema.py @@ -0,0 +1,29 @@ +from pydantic import BaseModel, Field + + +from typing import Optional + + +class ClassCodeDetails(BaseModel): + """ + A dataclass for storing details about a class. + """ + + name: str + doc: Optional[str] + bases: list + attributes: list + methods: list + init: Optional[dict] = Field(default_factory=dict) + + +class CallableCodeDetails(BaseModel): + """ + A dataclass for storing details about a callable. + """ + + name: str + doc: Optional[str] + args: list + body: list + return_type: Optional[str] diff --git a/src/backend/langflow/interface/initialize/loading.py b/src/backend/langflow/interface/initialize/loading.py index c9d12f4b9..f6da0edc7 100644 --- a/src/backend/langflow/interface/initialize/loading.py +++ b/src/backend/langflow/interface/initialize/loading.py @@ -1,17 +1,15 @@ -import contextlib import json -from typing import Any, Callable, Dict, List, Sequence, Type +from typing import Any, Callable, Dict, Sequence, Type -from langchain.agents import ZeroShotAgent from langchain.agents import agent as agent_module from langchain.agents.agent import AgentExecutor from langchain.agents.agent_toolkits.base import BaseToolkit from langchain.agents.tools import BaseTool from langflow.interface.initialize.llm import initialize_vertexai +from langflow.interface.initialize.utils import handle_format_kwargs, handle_node_type from langflow.interface.initialize.vector_store import vecstore_initializer -from langchain.schema import Document, BaseOutputParser from pydantic import ValidationError from langflow.interface.importing.utils import ( @@ -212,68 +210,8 @@ def instantiate_agent(node_type, class_object: Type[agent_module.Agent], params: def instantiate_prompt(node_type, class_object, params: Dict): - if node_type == "ZeroShotPrompt": - if "tools" not in params: - params["tools"] = [] - return ZeroShotAgent.create_prompt(**params) - elif "MessagePromptTemplate" in node_type: - # Then we only need the template - from_template_params = { - "template": params.pop("prompt", params.pop("template", "")) - } - - if not from_template_params.get("template"): - raise ValueError("Prompt template is required") - prompt = class_object.from_template(**from_template_params) - - elif node_type == "ChatPromptTemplate": - prompt = class_object.from_messages(**params) - else: - prompt = class_object(**params) - - format_kwargs: Dict[str, Any] = {} - for input_variable in prompt.input_variables: - if input_variable in params: - variable = params[input_variable] - if isinstance(variable, str): - format_kwargs[input_variable] = variable - elif isinstance(variable, BaseOutputParser) and hasattr( - variable, "get_format_instructions" - ): - format_kwargs[input_variable] = variable.get_format_instructions() - elif isinstance(variable, List) and all( - isinstance(item, Document) for item in variable - ): - # Format document to contain page_content and metadata - # as one string separated by a newline - if len(variable) > 1: - content = "\n".join( - [item.page_content for item in variable if item.page_content] - ) - else: - content = variable[0].page_content - # content could be a json list of strings - with contextlib.suppress(json.JSONDecodeError): - content = json.loads(content) - if isinstance(content, list): - content = ",".join([str(item) for item in content]) - format_kwargs[input_variable] = content - # handle_keys will be a list but it does not exist yet - # so we need to create it - - if ( - isinstance(variable, List) - and all(isinstance(item, Document) for item in variable) - ) or ( - isinstance(variable, BaseOutputParser) - and hasattr(variable, "get_format_instructions") - ): - if "handle_keys" not in format_kwargs: - format_kwargs["handle_keys"] = [] - - # Add the handle_keys to the list - format_kwargs["handle_keys"].append(input_variable) - + params, prompt = handle_node_type(node_type, class_object, params) + format_kwargs = handle_format_kwargs(prompt, params) return prompt, format_kwargs diff --git a/src/backend/langflow/interface/initialize/utils.py b/src/backend/langflow/interface/initialize/utils.py new file mode 100644 index 000000000..31fbc6d8b --- /dev/null +++ b/src/backend/langflow/interface/initialize/utils.py @@ -0,0 +1,103 @@ +import contextlib +import json +from typing import Any, Dict, List + +from langchain.agents import ZeroShotAgent + + +from langchain.schema import Document, BaseOutputParser + + +def handle_node_type(node_type, class_object, params: Dict): + if node_type == "ZeroShotPrompt": + params = check_tools_in_params(params) + prompt = ZeroShotAgent.create_prompt(**params) + elif "MessagePromptTemplate" in node_type: + prompt = instantiate_from_template(class_object, params) + elif node_type == "ChatPromptTemplate": + prompt = class_object.from_messages(**params) + else: + prompt = class_object(**params) + return params, prompt + + +def check_tools_in_params(params: Dict): + if "tools" not in params: + params["tools"] = [] + return params + + +def instantiate_from_template(class_object, params: Dict): + from_template_params = { + "template": params.pop("prompt", params.pop("template", "")) + } + if not from_template_params.get("template"): + raise ValueError("Prompt template is required") + return class_object.from_template(**from_template_params) + + +def handle_format_kwargs(prompt, params: Dict): + format_kwargs: Dict[str, Any] = {} + for input_variable in prompt.input_variables: + if input_variable in params: + format_kwargs = handle_variable(params, input_variable, format_kwargs) + return format_kwargs + + +def handle_variable(params: Dict, input_variable: str, format_kwargs: Dict): + variable = params[input_variable] + if isinstance(variable, str): + format_kwargs[input_variable] = variable + elif isinstance(variable, BaseOutputParser) and hasattr( + variable, "get_format_instructions" + ): + format_kwargs[input_variable] = variable.get_format_instructions() + elif is_instance_of_list_or_document(variable): + format_kwargs = format_document(variable, input_variable, format_kwargs) + if needs_handle_keys(variable): + format_kwargs = add_handle_keys(input_variable, format_kwargs) + return format_kwargs + + +def is_instance_of_list_or_document(variable): + return ( + isinstance(variable, List) + and all(isinstance(item, Document) for item in variable) + or isinstance(variable, Document) + ) + + +def format_document(variable, input_variable: str, format_kwargs: Dict): + variable = variable if isinstance(variable, List) else [variable] + content = format_content(variable) + format_kwargs[input_variable] = content + return format_kwargs + + +def format_content(variable): + if len(variable) > 1: + return "\n".join([item.page_content for item in variable if item.page_content]) + content = variable[0].page_content + return try_to_load_json(content) + + +def try_to_load_json(content): + with contextlib.suppress(json.JSONDecodeError): + content = json.loads(content) + if isinstance(content, list): + content = ",".join([str(item) for item in content]) + return content + + +def needs_handle_keys(variable): + return is_instance_of_list_or_document(variable) or ( + isinstance(variable, BaseOutputParser) + and hasattr(variable, "get_format_instructions") + ) + + +def add_handle_keys(input_variable: str, format_kwargs: Dict): + if "handle_keys" not in format_kwargs: + format_kwargs["handle_keys"] = [] + format_kwargs["handle_keys"].append(input_variable) + return format_kwargs diff --git a/src/backend/langflow/interface/tools/base.py b/src/backend/langflow/interface/tools/base.py index 027224a3a..f8965134d 100644 --- a/src/backend/langflow/interface/tools/base.py +++ b/src/backend/langflow/interface/tools/base.py @@ -55,7 +55,7 @@ TOOL_INPUTS = { show=True, value="", suffixes=[".json", ".yaml", ".yml"], - fileTypes=["json", "yaml", "yml"], + file_types=["json", "yaml", "yml"], ), } diff --git a/src/backend/langflow/interface/tools/custom.py b/src/backend/langflow/interface/tools/custom.py index a0ed5d378..321298e34 100644 --- a/src/backend/langflow/interface/tools/custom.py +++ b/src/backend/langflow/interface/tools/custom.py @@ -48,29 +48,3 @@ class PythonFunctionTool(Function, Tool): class PythonFunction(Function): code: str - - -class CustomComponent_old(BaseModel): - code: str - function: Optional[Callable] = None - imports: Optional[str] = None - - # Eval code and store the class - def __init__(self, **data): - super().__init__(**data) - - # Validate the Class code - @validator("code") - def validate_func(cls, v): - try: - validate.eval_function(v) - except Exception as e: - raise e - - return v - - def get_function(self): - """Get the function""" - function_name = validate.extract_function_name(self.code) - - return validate.create_function(self.code, function_name) diff --git a/src/backend/langflow/interface/types.py b/src/backend/langflow/interface/types.py index 27cdaaa2f..56410348b 100644 --- a/src/backend/langflow/interface/types.py +++ b/src/backend/langflow/interface/types.py @@ -1,6 +1,6 @@ from langflow.interface.agents.base import agent_creator from langflow.interface.chains.base import chain_creator -from langflow.interface.custom.constants import LANGCHAIN_BASE_TYPES +from langflow.interface.custom.constants import CUSTOM_COMPONENT_SUPPORTED_TYPES from langflow.interface.document_loaders.base import documentloader_creator from langflow.interface.embeddings.base import embedding_creator from langflow.interface.importing.utils import get_function_custom @@ -98,6 +98,13 @@ def add_new_custom_field( display_name = field_config.pop("display_name", field_name) field_type = field_config.pop("field_type", field_type) field_type = process_type(field_type) + field_value = field_config.pop("value", field_value) + field_advanced = field_config.pop("advanced", False) + + # If options is a list, then it's a dropdown + # If options is None, then it's a list of strings + is_list = isinstance(field_config.get("options"), list) + field_config["is_list"] = is_list or field_config.get("is_list", False) if "name" in field_config: warnings.warn( @@ -114,7 +121,7 @@ def add_new_custom_field( value=field_value, show=True, required=required, - advanced=False, + advanced=field_advanced, placeholder=placeholder, display_name=display_name, **field_config, @@ -126,8 +133,9 @@ def add_new_custom_field( # TODO: Move to correct place -def add_code_field(template, raw_code): +def add_code_field(template, raw_code, field_config): # Field with the Python code to allow update + code_field = { "code": { "dynamic": True, @@ -138,7 +146,7 @@ def add_code_field(template, raw_code): "value": raw_code, "password": False, "name": "code", - "advanced": False, + "advanced": field_config.pop("advanced", False), "type": "code", "list": False, } @@ -183,22 +191,30 @@ def update_display_name_and_description(frontend_node, template_config): frontend_node["description"] = template_config["description"] -def build_field_config(custom_component): +def build_field_config(custom_component: CustomComponent): """Build the field configuration for a custom component""" + try: custom_class = get_function_custom(custom_component.code) - return custom_class().build_config() - except Exception as exc: - logger.error(f"Error while building field config: {exc}") + logger.error(f"Error while getting custom function: {str(exc)}") + return {} + + try: + return custom_class().build_config() + except Exception as exc: + logger.error(f"Error while building field config: {str(exc)}") return {} def add_extra_fields(frontend_node, field_config, function_args): """Add extra fields to the frontend node""" - if function_args is None: + if function_args is None or function_args == "": return + # sort function_args which is a list of dicts + function_args.sort(key=lambda x: x["name"]) + for extra_field in function_args: if "name" not in extra_field or extra_field["name"] == "self": continue @@ -232,19 +248,19 @@ def get_field_properties(extra_field): def add_base_classes(frontend_node, return_type): """Add base classes to the frontend node""" - if return_type not in LANGCHAIN_BASE_TYPES or return_type is None: + if return_type not in CUSTOM_COMPONENT_SUPPORTED_TYPES or return_type is None: raise HTTPException( status_code=400, detail={ "error": ( "Invalid return type should be one of: " - f"{list(LANGCHAIN_BASE_TYPES.keys())}" + f"{list(CUSTOM_COMPONENT_SUPPORTED_TYPES.keys())}" ), "traceback": traceback.format_exc(), }, ) - return_type_instance = LANGCHAIN_BASE_TYPES.get(return_type) + return_type_instance = CUSTOM_COMPONENT_SUPPORTED_TYPES.get(return_type) base_classes = get_base_classes(return_type_instance) for base_class in base_classes: @@ -268,7 +284,9 @@ def build_langchain_template_custom_component(custom_component: CustomComponent) frontend_node, field_config, custom_component.get_function_entrypoint_args ) - frontend_node = add_code_field(frontend_node, custom_component.code) + frontend_node = add_code_field( + frontend_node, custom_component.code, field_config.get("code", {}) + ) add_base_classes( frontend_node, custom_component.get_function_entrypoint_return_type @@ -287,8 +305,8 @@ def load_files_from_path(path: str): def build_and_validate_all_files(reader, file_list): """Build and validate all files""" data = reader.build_component_menu_list(file_list) - valid_components = reader.filter_loaded_components(data=data, with_errors=False) + valid_components = reader.filter_loaded_components(data=data, with_errors=False) invalid_components = reader.filter_loaded_components(data=data, with_errors=True) return valid_components, invalid_components @@ -341,12 +359,15 @@ def build_invalid_menu(invalid_components): .get(type(CustomComponent()).__name__) ) + component_template["error"] = component.get("error", None) component_template.get("template").get("code")["value"] = component_code invalid_menu[menu_name][component_name] = component_template except Exception as exc: - logger.error(f"Error while creating custom component: {exc}") + logger.error( + f"Error while creating custom component [{component_name}]: {str(exc)}" + ) return invalid_menu diff --git a/src/backend/langflow/template/frontend_node/agents.py b/src/backend/langflow/template/frontend_node/agents.py index 02aea78b9..63c8a4d5e 100644 --- a/src/backend/langflow/template/frontend_node/agents.py +++ b/src/backend/langflow/template/frontend_node/agents.py @@ -145,7 +145,7 @@ class CSVAgentNode(FrontendNode): name="path", value="", suffixes=[".csv"], - fileTypes=["csv"], + file_types=["csv"], ), TemplateField( field_type="BaseLanguageModel", diff --git a/src/backend/langflow/template/frontend_node/base.py b/src/backend/langflow/template/frontend_node/base.py index dcd9a58a0..fe19b5652 100644 --- a/src/backend/langflow/template/frontend_node/base.py +++ b/src/backend/langflow/template/frontend_node/base.py @@ -53,6 +53,7 @@ class FrontendNode(BaseModel): output_types: List[str] = [] field_formatters: FieldFormatters = Field(default_factory=FieldFormatters) beta: bool = False + error: Optional[str] = None # field formatters is an instance attribute but it is not used in the class # so we need to create a method to get it @@ -85,6 +86,7 @@ class FrontendNode(BaseModel): "output_types": self.output_types, "documentation": self.documentation, "beta": self.beta, + "error": self.error, }, } diff --git a/src/backend/langflow/template/frontend_node/constants.py b/src/backend/langflow/template/frontend_node/constants.py index 670fcb3fb..3cf5dfffd 100644 --- a/src/backend/langflow/template/frontend_node/constants.py +++ b/src/backend/langflow/template/frontend_node/constants.py @@ -8,6 +8,7 @@ FORCE_SHOW_FIELDS = [ "headers", "max_value_length", "max_tokens", + "google_cse_id", ] DEFAULT_PROMPT = """ diff --git a/src/backend/langflow/template/frontend_node/documentloaders.py b/src/backend/langflow/template/frontend_node/documentloaders.py index d775d8736..bb78d8855 100644 --- a/src/backend/langflow/template/frontend_node/documentloaders.py +++ b/src/backend/langflow/template/frontend_node/documentloaders.py @@ -14,7 +14,7 @@ def build_file_field( name=name, value="", suffixes=suffixes, - fileTypes=fileTypes, + file_types=fileTypes, ) diff --git a/src/backend/langflow/template/frontend_node/llms.py b/src/backend/langflow/template/frontend_node/llms.py index de0fa3c0b..a6a128cfe 100644 --- a/src/backend/langflow/template/frontend_node/llms.py +++ b/src/backend/langflow/template/frontend_node/llms.py @@ -19,7 +19,7 @@ class LLMFrontendNode(FrontendNode): name="credentials", value="", suffixes=[".json"], - fileTypes=["json"], + file_types=["json"], ) ) diff --git a/src/backend/langflow/utils/util.py b/src/backend/langflow/utils/util.py index ce5f03bdf..f68c9dbe2 100644 --- a/src/backend/langflow/utils/util.py +++ b/src/backend/langflow/utils/util.py @@ -9,7 +9,7 @@ from docstring_parser import parse # type: ignore from langflow.template.frontend_node.constants import FORCE_SHOW_FIELDS from langflow.utils import constants from langflow.utils.logger import logger -from multiprocess import cpu_count +from multiprocess import cpu_count # type: ignore def build_template_from_function( @@ -301,13 +301,15 @@ def get_type(value: Any) -> Union[str, type]: return _type if isinstance(_type, str) else _type.__name__ -def remove_optional_wrapper(_type: str) -> str: +def remove_optional_wrapper(_type: Union[str, type]) -> str: """ Removes the 'Optional' wrapper from the type string. Returns: The type string with the 'Optional' wrapper removed. """ + if isinstance(_type, type): + _type = str(_type) if "Optional" in _type: _type = _type.replace("Optional[", "")[:-1] diff --git a/src/frontend/package-lock.json b/src/frontend/package-lock.json index 7af2a6e04..ed3eacd4f 100644 --- a/src/frontend/package-lock.json +++ b/src/frontend/package-lock.json @@ -20,6 +20,7 @@ "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-menubar": "^1.0.3", + "@radix-ui/react-popover": "^1.0.6", "@radix-ui/react-progress": "^1.0.3", "@radix-ui/react-separator": "^1.0.3", "@radix-ui/react-slot": "^1.0.2", @@ -29,6 +30,7 @@ "@tabler/icons-react": "^2.18.0", "@tailwindcss/forms": "^0.5.3", "@tailwindcss/line-clamp": "^0.4.4", + "@types/axios": "^0.14.0", "accordion": "^3.0.2", "ace-builds": "^1.16.0", "add": "^2.0.6", @@ -143,6 +145,8 @@ }, "node_modules/@babel/compat-data": { "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.6.tgz", + "integrity": "sha512-29tfsWTq2Ftu7MXmimyC0C5FDZv5DYxOZkh3XD3+QW4V/BYuv/LyEsjj3c0hqedEaDt6DBfDvexMKU8YevdqFg==", "license": "MIT", "engines": { "node": ">=6.9.0" @@ -1460,6 +1464,43 @@ } } }, + "node_modules/@radix-ui/react-popover": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.0.6.tgz", + "integrity": "sha512-cZ4defGpkZ0qTRtlIBzJLSzL6ht7ofhhW4i1+pkemjV1IKXm0wgCRnee154qlV6r9Ttunmh2TNZhMfV2bavUyA==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.1", + "@radix-ui/react-compose-refs": "1.0.1", + "@radix-ui/react-context": "1.0.1", + "@radix-ui/react-dismissable-layer": "1.0.4", + "@radix-ui/react-focus-guards": "1.0.1", + "@radix-ui/react-focus-scope": "1.0.3", + "@radix-ui/react-id": "1.0.1", + "@radix-ui/react-popper": "1.1.2", + "@radix-ui/react-portal": "1.0.3", + "@radix-ui/react-presence": "1.0.1", + "@radix-ui/react-primitive": "1.0.3", + "@radix-ui/react-slot": "1.0.2", + "@radix-ui/react-use-controllable-state": "1.0.1", + "aria-hidden": "^1.1.1", + "react-remove-scroll": "2.5.5" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-popper": { "version": "1.1.2", "license": "MIT", @@ -2610,6 +2651,15 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/axios": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@types/axios/-/axios-0.14.0.tgz", + "integrity": "sha512-KqQnQbdYE54D7oa/UmYVMZKq7CO4l8DEENzOKc4aBRwxCXSlJXGz83flFx5L7AWrOQnmuN3kVsRdt+GZPPjiVQ==", + "deprecated": "This is a stub types definition for axios (https://github.com/mzabriskie/axios). axios provides its own type definitions, so you don't need @types/axios installed!", + "dependencies": { + "axios": "*" + } + }, "node_modules/@types/cacheable-request": { "version": "6.0.3", "dev": true, @@ -9533,8 +9583,9 @@ "license": "MIT" }, "node_modules/word-wrap": { - "version": "1.2.3", - "license": "MIT", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "engines": { "node": ">=0.10.0" } diff --git a/src/frontend/package.json b/src/frontend/package.json index 323a9a7be..e3814c1ad 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -15,6 +15,7 @@ "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-menubar": "^1.0.3", + "@radix-ui/react-popover": "^1.0.6", "@radix-ui/react-progress": "^1.0.3", "@radix-ui/react-separator": "^1.0.3", "@radix-ui/react-slot": "^1.0.2", @@ -24,6 +25,7 @@ "@tabler/icons-react": "^2.18.0", "@tailwindcss/forms": "^0.5.3", "@tailwindcss/line-clamp": "^0.4.4", + "@types/axios": "^0.14.0", "accordion": "^3.0.2", "ace-builds": "^1.16.0", "add": "^2.0.6", diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 95fd70a7e..d49544114 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -132,7 +132,7 @@ export default function GenericNode({ ) : (
- {validationStatus.params + {typeof validationStatus.params === "string" ? validationStatus.params .split("\n") .map((line, index) =>
{line}
) diff --git a/src/frontend/src/alerts/alertDropDown/index.tsx b/src/frontend/src/alerts/alertDropDown/index.tsx index a3f69d707..90838d693 100644 --- a/src/frontend/src/alerts/alertDropDown/index.tsx +++ b/src/frontend/src/alerts/alertDropDown/index.tsx @@ -1,66 +1,72 @@ -import { useContext, useRef } from "react"; +import { useContext, useState } from "react"; import IconComponent from "../../components/genericIconComponent"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "../../components/ui/popover"; import { alertContext } from "../../contexts/alertContext"; -import { PopUpContext } from "../../contexts/popUpContext"; import { AlertDropdownType } from "../../types/alerts"; -import { useOnClickOutside } from "../hooks/useOnClickOutside"; import SingleAlert from "./components/singleAlertComponent"; -export default function AlertDropdown({}: AlertDropdownType) { - const { closePopUp } = useContext(PopUpContext); - const componentRef = useRef(null); - - // Use the custom hook - useOnClickOutside(componentRef, () => { - closePopUp(); - }); - +export default function AlertDropdown({ children }: AlertDropdownType) { const { notificationList, clearNotificationList, removeFromNotificationList, + setNotificationCenter, } = useContext(alertContext); + const [open, setOpen] = useState(false); + return ( -
{ + setOpen(k); + if (k) setNotificationCenter(false); + }} > -
- Notifications -
- - -
-
-
- {notificationList.length !== 0 ? ( - notificationList.map((alertItem, index) => ( - - )) - ) : ( -
- No new notifications + {children} + +
+ Notifications +
+ +
- )} -
-
+
+
+ {notificationList.length !== 0 ? ( + notificationList.map((alertItem, index) => ( + + )) + ) : ( +
+ No new notifications +
+ )} +
+ + ); } diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index 58c058866..3cbe5bbf1 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -12,9 +12,8 @@ import { NodeType } from "../../types/flow"; export default function Chat({ flow }: ChatType) { const [open, setOpen] = useState(false); - const [isBuilt, setIsBuilt] = useState(false); const [canOpen, setCanOpen] = useState(false); - const { tabsState } = useContext(TabsContext); + const { tabsState, isBuilt, setIsBuilt } = useContext(TabsContext); useEffect(() => { const handleKeyDown = (event: KeyboardEvent) => { diff --git a/src/frontend/src/components/codeAreaComponent/index.tsx b/src/frontend/src/components/codeAreaComponent/index.tsx index 37f41e2d1..05e8127da 100644 --- a/src/frontend/src/components/codeAreaComponent/index.tsx +++ b/src/frontend/src/components/codeAreaComponent/index.tsx @@ -45,7 +45,7 @@ export default function CodeAreaComponent({ editNode ? "input-edit-node input-dialog" : (disabled ? " input-disable input-ring " : "") + - " input-primary text-muted-foreground " + " primary-input text-muted-foreground " } > {myValue !== "" ? myValue : "Type something..."} diff --git a/src/frontend/src/components/codeTabsComponent/index.tsx b/src/frontend/src/components/codeTabsComponent/index.tsx index 1357e0c79..9ccdb38e4 100644 --- a/src/frontend/src/components/codeTabsComponent/index.tsx +++ b/src/frontend/src/components/codeTabsComponent/index.tsx @@ -145,7 +145,7 @@ export default function CodeTabsComponent({ ))} - {Number(activeTab) < 3 && ( + {Number(activeTab) < 4 && (
- + +
+ {notificationCenter && ( +
+ )} +
+
diff --git a/src/frontend/src/components/inputComponent/index.tsx b/src/frontend/src/components/inputComponent/index.tsx index 682d5716c..78b06c411 100644 --- a/src/frontend/src/components/inputComponent/index.tsx +++ b/src/frontend/src/components/inputComponent/index.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from "react"; import { InputComponentType } from "../../types/components"; import { classNames } from "../../utils/utils"; +import { Input } from "../ui/input"; export default function InputComponent({ value, @@ -19,16 +20,15 @@ export default function InputComponent({ }, [disabled, onChange]); return ( -
- + { diff --git a/src/frontend/src/components/inputFileComponent/index.tsx b/src/frontend/src/components/inputFileComponent/index.tsx index 3f77734f3..c03de7c47 100644 --- a/src/frontend/src/components/inputFileComponent/index.tsx +++ b/src/frontend/src/components/inputFileComponent/index.tsx @@ -102,8 +102,8 @@ export default function InputFileComponent({ editNode ? "input-edit-node input-dialog text-muted-foreground" : disabled - ? "input-disable input-dialog input-primary" - : "input-dialog input-primary text-muted-foreground" + ? "input-disable input-dialog primary-input" + : "input-dialog primary-input text-muted-foreground" } > {myValue !== "" ? myValue : "No file"} diff --git a/src/frontend/src/components/inputListComponent/index.tsx b/src/frontend/src/components/inputListComponent/index.tsx index ed563b735..13f5f7cca 100644 --- a/src/frontend/src/components/inputListComponent/index.tsx +++ b/src/frontend/src/components/inputListComponent/index.tsx @@ -2,7 +2,9 @@ import { useEffect } from "react"; import { InputListComponentType } from "../../types/components"; import _ from "lodash"; +import { classNames } from "../../utils/utils"; import IconComponent from "../genericIconComponent"; +import { Input } from "../ui/input"; export default function InputListComponent({ value, @@ -18,23 +20,19 @@ export default function InputListComponent({ return (
1 && editNode ? "my-1" : "", "flex flex-col gap-3" - } + )} > {value.map((i, idx) => { return (
- { let newInputList = _.cloneDeep(value); diff --git a/src/frontend/src/components/intComponent/index.tsx b/src/frontend/src/components/intComponent/index.tsx index 24d28e4f5..c43055b47 100644 --- a/src/frontend/src/components/intComponent/index.tsx +++ b/src/frontend/src/components/intComponent/index.tsx @@ -1,5 +1,6 @@ import { useEffect } from "react"; import { FloatComponentType } from "../../types/components"; +import { Input } from "../ui/input"; export default function IntComponent({ value, @@ -17,13 +18,8 @@ export default function IntComponent({ }, [disabled, onChange]); return ( -
- + { if ( event.key !== "Backspace" && @@ -51,12 +47,8 @@ export default function IntComponent({ } }} value={value ?? ""} - className={ - "nopan nodrag noundo nocopy " + - (editNode - ? " input-edit-node " - : " input-primary " + (disabled ? " input-disable" : "")) - } + className={editNode ? "input-edit-node" : ""} + disabled={disabled} placeholder={editNode ? "Integer number" : "Type an integer number"} onChange={(e) => { onChange(e.target.value); diff --git a/src/frontend/src/components/promptComponent/index.tsx b/src/frontend/src/components/promptComponent/index.tsx index d212ec08d..82196658f 100644 --- a/src/frontend/src/components/promptComponent/index.tsx +++ b/src/frontend/src/components/promptComponent/index.tsx @@ -51,7 +51,7 @@ export default function PromptAreaComponent({ editNode ? "input-edit-node input-dialog" : (disabled ? " input-disable text-ring " : "") + - " input-primary text-muted-foreground " + " primary-input text-muted-foreground " } > {value !== "" ? value : "Type your prompt here..."} diff --git a/src/frontend/src/components/textAreaComponent/index.tsx b/src/frontend/src/components/textAreaComponent/index.tsx index 2bead9a2d..cd598f01e 100644 --- a/src/frontend/src/components/textAreaComponent/index.tsx +++ b/src/frontend/src/components/textAreaComponent/index.tsx @@ -3,6 +3,7 @@ import { TypeModal } from "../../constants/enums"; import GenericModal from "../../modals/genericModal"; import { TextAreaComponentType } from "../../types/components"; import IconComponent from "../genericIconComponent"; +import { Input } from "../ui/input"; export default function TextAreaComponent({ value, @@ -18,42 +19,36 @@ export default function TextAreaComponent({ }, [disabled]); return ( -
-
- + { + onChange(e.target.value); + }} + /> +
+ { - onChange(e.target.value); + setValue={(t: string) => { + onChange(t); }} - /> -
- { - onChange(t); - }} - > - {!editNode && ( - - )} - -
+ > + {!editNode && ( + + )} +
); diff --git a/src/frontend/src/components/ui/input.tsx b/src/frontend/src/components/ui/input.tsx index 0942a3930..b014a57b3 100644 --- a/src/frontend/src/components/ui/input.tsx +++ b/src/frontend/src/components/ui/input.tsx @@ -9,10 +9,7 @@ const Input = React.forwardRef( return ( diff --git a/src/frontend/src/components/ui/popover.tsx b/src/frontend/src/components/ui/popover.tsx new file mode 100644 index 000000000..63c80bb7e --- /dev/null +++ b/src/frontend/src/components/ui/popover.tsx @@ -0,0 +1,30 @@ +"use client"; + +import * as PopoverPrimitive from "@radix-ui/react-popover"; +import * as React from "react"; +import { cn } from "../../utils/utils"; + +const Popover = PopoverPrimitive.Root; + +const PopoverTrigger = PopoverPrimitive.Trigger; + +const PopoverContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, align = "center", sideOffset = 4, ...props }, ref) => ( + + + +)); +PopoverContent.displayName = PopoverPrimitive.Content.displayName; + +export { Popover, PopoverTrigger, PopoverContent }; diff --git a/src/frontend/src/components/ui/textarea.tsx b/src/frontend/src/components/ui/textarea.tsx index 64aec41a1..cfad1cf72 100644 --- a/src/frontend/src/components/ui/textarea.tsx +++ b/src/frontend/src/components/ui/textarea.tsx @@ -8,10 +8,7 @@ const Textarea = React.forwardRef( ({ className, ...props }, ref) => { return (