Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

feat: TextToDiagram v2 (#10530)

Tamas La0b98a944f1d
diff --git a/.env.development b/.env.development
index bf641c34c8..5e2d3dfe36 100644
--- a/.env.development
+++ b/.env.development
@@ -12,7 +12,7 @@ VITE_APP_WS_SERVER_URL=http://localhost:3002
VITE_APP_PLUS_LP=https://plus.excalidraw.com
VITE_APP_PLUS_APP=http://localhost:3000
-VITE_APP_AI_BACKEND=http://localhost:3015
+VITE_APP_AI_BACKEND=http://localhost:3016
VITE_APP_FIREBASE_CONFIG='{"apiKey":"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8","authDomain":"excalidraw-oss-dev.firebaseapp.com","projectId":"excalidraw-oss-dev","storageBucket":"excalidraw-oss-dev.appspot.com","messagingSenderId":"664559512677","appId":"1:664559512677:web:a385181f2928d328a7aa8c"}'
@@ -27,7 +27,7 @@ VITE_APP_ENABLE_TRACKING=true
FAST_REFRESH=false
# The port the run the dev server
-VITE_APP_PORT=3000
+VITE_APP_PORT=3001
#Debug flags
diff --git a/.github/workflows/test-coverage-pr.yml b/.github/workflows/test-coverage-pr.yml
index 7ff40ad5d2..227991a7bc 100644
--- a/.github/workflows/test-coverage-pr.yml
+++ b/.github/workflows/test-coverage-pr.yml
@@ -14,7 +14,7 @@ jobs:
- name: "Install Node"
uses: actions/setup-node@v2
with:
- node-version: "18.x"
+ node-version: "20.x"
- name: "Install Deps"
run: yarn install
- name: "Test Coverage"
diff --git a/excalidraw-app/components/AI.tsx b/excalidraw-app/components/AI.tsx
index 9a222a968e..e45773f8b4 100644
--- a/excalidraw-app/components/AI.tsx
+++ b/excalidraw-app/components/AI.tsx
@@ -4,6 +4,7 @@ import {
getTextFromElements,
MIME_TYPES,
TTDDialog,
+ TTDStreamFetch,
} from "@excalidraw/excalidraw";
import { getDataURL } from "@excalidraw/excalidraw/data/blob";
import { safelyParseJSON } from "@excalidraw/common";
@@ -99,60 +100,21 @@ export const AIComponents = ({
/>
<TTDDialog
- onTextSubmit={async (input) => {
- try {
- const response = await fetch(
- `${
- import.meta.env.VITE_APP_AI_BACKEND
- }/v1/ai/text-to-diagram/generate`,
- {
- method: "POST",
- headers: {
- Accept: "application/json",
- "Content-Type": "application/json",
- },
- body: JSON.stringify({ prompt: input }),
- },
- );
-
- const rateLimit = response.headers.has("X-Ratelimit-Limit")
- ? parseInt(response.headers.get("X-Ratelimit-Limit") || "0", 10)
- : undefined;
-
- const rateLimitRemaining = response.headers.has(
- "X-Ratelimit-Remaining",
- )
- ? parseInt(
- response.headers.get("X-Ratelimit-Remaining") || "0",
- 10,
- )
- : undefined;
-
- const json = await response.json();
-
- if (!response.ok) {
- if (response.status === 429) {
- return {
- rateLimit,
- rateLimitRemaining,
- error: new Error(
- "Too many requests today, please try again tomorrow!",
- ),
- };
- }
+ onTextSubmit={async (props) => {
+ const { onChunk, onStreamCreated, signal, messages } = props;
- throw new Error(json.message || "Generation failed...");
- }
-
- const generatedResponse = json.generatedResponse;
- if (!generatedResponse) {
- throw new Error("Generation failed...");
- }
+ const result = await TTDStreamFetch({
+ url: `${
+ import.meta.env.VITE_APP_AI_BACKEND
+ }/v1/ai/text-to-diagram/chat-streaming`,
+ messages,
+ onChunk,
+ onStreamCreated,
+ extractRateLimits: true,
+ signal,
+ });
- return { generatedResponse, rateLimit, rateLimitRemaining };
- } catch (err: any) {
- throw new Error("Request failed");
- }
+ return result;
}}
/>
</>
diff --git a/excalidraw-app/vite.config.mts b/excalidraw-app/vite.config.mts
index 29e5c04300..a24d0939a6 100644
--- a/excalidraw-app/vite.config.mts
+++ b/excalidraw-app/vite.config.mts
@@ -102,6 +102,10 @@ export default defineConfig(({ mode }) => {
// Taking the substring after "locales/"
return `locales/${id.substring(index + 8)}`;
}
+
+ if (id.includes("@excalidraw/mermaid-to-excalidraw")) {
+ return "mermaid-to-excalidraw";
+ }
},
},
},
@@ -196,6 +200,7 @@ export default defineConfig(({ mode }) => {
},
},
],
+ maximumFileSizeToCacheInBytes: 2.3 * 1024 ** 2, // 2.3MB
},
manifest: {
short_name: "Excalidraw",
diff --git a/packages/excalidraw/components/CommandPalette/CommandPalette.tsx b/packages/excalidraw/components/CommandPalette/CommandPalette.tsx
index 0840dd803d..ed3d85be8b 100644
--- a/packages/excalidraw/components/CommandPalette/CommandPalette.tsx
+++ b/packages/excalidraw/components/CommandPalette/CommandPalette.tsx
@@ -44,7 +44,6 @@ import { getSelectedElements } from "../../scene";
import {
LockedIcon,
UnlockedIcon,
- clockIcon,
searchIcon,
boltIcon,
bucketFillIcon,
@@ -52,6 +51,7 @@ import {
mermaidLogoIcon,
brainIconThin,
LibraryIcon,
+ historyCommandIcon,
} from "../icons";
import { SHAPES } from "../shapes";
@@ -928,7 +928,7 @@ function CommandPaletteInner({
marginLeft: "6px",
}}
>
- {clockIcon}
+ {historyCommandIcon}
</div>
</div>
<CommandItem
diff --git a/packages/excalidraw/components/FilledButton.scss b/packages/excalidraw/components/FilledButton.scss
index 44f24f3b0f..431a46a63b 100644
--- a/packages/excalidraw/components/FilledButton.scss
+++ b/packages/excalidraw/components/FilledButton.scss
@@ -60,7 +60,19 @@
}
&[disabled] {
- pointer-events: none;
+ cursor: not-allowed;
+
+ &.ExcButton--variant-filled,
+ &:hover {
+ --back-color: var(--color-surface-low) !important;
+ --text-color: var(--color-on-surface-variant) !important;
+ }
+
+ &.ExcButton--variant-outlined,
+ &.ExcButton--variant-icon {
+ --text-color: var(--color-on-surface-variant);
+ --border-color: var(--color-surface-high);
+ }
}
&,
diff --git a/packages/excalidraw/components/FilledButton.tsx b/packages/excalidraw/components/FilledButton.tsx
index 7d5c4ccfd1..fd34c04077 100644
--- a/packages/excalidraw/components/FilledButton.tsx
+++ b/packages/excalidraw/components/FilledButton.tsx
@@ -33,6 +33,7 @@ export type FilledButtonProps = {
fullWidth?: boolean;
icon?: React.ReactNode;
+ disabled?: boolean;
};
export const FilledButton = forwardRef<HTMLButtonElement, FilledButtonProps>(
@@ -48,6 +49,7 @@ export const FilledButton = forwardRef<HTMLButtonElement, FilledButtonProps>(
fullWidth,
className,
status,
+ disabled,
},
ref,
) => {
@@ -94,7 +96,7 @@ export const FilledButton = forwardRef<HTMLButtonElement, FilledButtonProps>(
type="button"
aria-label={label}
ref={ref}
- disabled={_status === "loading" || _status === "success"}
+ disabled={disabled || _status === "loading" || _status === "success"}
>
<div className="ExcButton__contents">
{_status === "loading" ? (
diff --git a/packages/excalidraw/components/Modal.tsx b/packages/excalidraw/components/Modal.tsx
index 32f42986fa..5281768b1f 100644
--- a/packages/excalidraw/components/Modal.tsx
+++ b/packages/excalidraw/components/Modal.tsx
@@ -49,7 +49,6 @@ export const Modal: React.FC<{
aria-modal="true"
onKeyDown={handleKeydown}
aria-labelledby={props.labelledBy}
- data-prevent-outside-click
>
<div
className="Modal__background"
diff --git a/packages/excalidraw/components/TTDDialog/Chat/Chat.scss b/packages/excalidraw/components/TTDDialog/Chat/Chat.scss
new file mode 100644
index 0000000000..3eb706097d
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/Chat/Chat.scss
@@ -0,0 +1,386 @@
+@import "../../../css/variables.module.scss";
+
+$verticalBreakpoint: 861px;
+
+.excalidraw {
+ &.theme--dark {
+ .chat-message {
+ &--assistant {
+ .chat-message__content {
+ background: var(--color-surface-lowest);
+ }
+ }
+
+ &--system {
+ .chat-message__content {
+ color: var(--color-surface-low);
+ }
+ }
+ }
+ }
+
+ .chat-interface {
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ min-height: 0;
+ position: relative;
+
+ @media screen and (max-width: $verticalBreakpoint) {
+ min-height: 200px;
+ }
+
+ &__messages {
+ flex: 1 1 0;
+ overflow-y: auto;
+ margin-bottom: 0.5rem;
+ padding: 1rem 0.5rem 0 0.5rem;
+ display: flex;
+ flex-direction: column;
+ gap: 2rem;
+ min-height: 0;
+ border-top-left-radius: var(--border-radius-lg);
+ border-top-right-radius: var(--border-radius-lg);
+
+ @media screen and (max-width: $verticalBreakpoint) {
+ min-height: 100px;
+ padding: 0.75rem;
+ }
+ }
+
+ &__empty-state {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ height: 100%;
+ min-height: 200px;
+
+ &-content {
+ text-align: center;
+
+ h3 {
+ margin: 0 0 0.5rem 0;
+ font-size: 1.25rem;
+ font-weight: 600;
+ }
+
+ p {
+ margin: 0 0 0.2rem 0;
+ font-size: 0.875rem;
+ color: var(--color-on-surface);
+ }
+ }
+
+ @media screen and (max-width: $verticalBreakpoint) {
+ min-height: 100px;
+ }
+ }
+
+ &__input-outer {
+ position: relative;
+ min-height: 71px;
+ }
+
+ &__input-container {
+ display: flex;
+ flex-direction: column;
+ justify-content: flex-end;
+ }
+
+ &__input-wrapper {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+
+ display: flex;
+ align-items: flex-end;
+ gap: 0.5rem;
+
+ border: 1px solid var(--dialog-border-color);
+ border-radius: var(--border-radius-lg);
+
+ padding: 0.75rem;
+ background: var(--color-surface-lowest);
+ transition: border-color 0.2s ease;
+
+ &:focus-within {
+ border-color: var(--color-primary);
+ }
+
+ @media screen and (max-width: $verticalBreakpoint) {
+ padding: 0.5rem 0.75rem;
+ }
+ }
+
+ &__input {
+ flex: 1;
+ border: none;
+ outline: none;
+ font-size: 0.875rem;
+ line-height: 1.5;
+ min-height: 24px;
+ max-height: 120px;
+ overflow-x: hidden;
+ border: none !important;
+ background: transparent !important;
+ color: var(--color-on-surface);
+
+ &::placeholder {
+ color: var(--color-gray-40);
+ }
+
+ @media screen and (max-width: $verticalBreakpoint) {
+ line-height: 1.4;
+ min-height: 20px;
+ max-height: 100px;
+ resize: none;
+ padding: 0;
+
+ &::placeholder {
+ opacity: 0.6;
+ }
+ }
+ }
+
+ &__send-button {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 32px;
+ height: 32px;
+ border: none;
+ border-radius: 50%;
+ background: var(--color-primary);
+ color: var(--color-surface-lowest);
+ cursor: pointer;
+ margin-bottom: 8px;
+
+ &:disabled {
+ opacity: 0.5;
+ cursor: not-allowed;
+ transform: none;
+ }
+
+ &:hover {
+ background-color: var(--color-primary-darker);
+ }
+
+ svg {
+ transform: rotate(-90deg);
+ }
+ }
+ }
+
+ .chat-message {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+
+ &--user {
+ justify-content: flex-end;
+
+ .chat-message__content {
+ background: var(--color-primary-light);
+ color: var(--text-primary-color);
+ border-radius: var(--border-radius-md);
+ min-width: 6rem;
+ }
+ }
+
+ &--assistant {
+ flex-direction: column;
+ justify-content: flex-start;
+ align-items: flex-start;
+
+ .chat-message__content {
+ background: var(--color-surface-low);
+ color: var(--color-on-surface);
+ border-radius: var(--border-radius-md);
+ min-width: 6rem;
+
+ .chat-message__body {
+ font-family: monospace;
+ }
+ }
+ }
+
+ &--system {
+ justify-content: flex-start;
+ margin-bottom: 0;
+
+ .chat-message__content {
+ background: var(--color-warning);
+ color: var(--color-on-surface);
+ border-radius: var(--border-radius-md);
+ min-width: 6rem;
+
+ .chat-message__body {
+ font-family: monospace;
+ }
+ }
+ }
+
+ &__content {
+ max-width: 80%;
+ padding: 0.75rem 1rem;
+ box-shadow: var(--chat-msg-shadow);
+ }
+
+ &__header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ gap: 1rem;
+ margin-bottom: 0.5rem;
+ font-size: 0.75rem;
+ }
+
+ &__role {
+ font-weight: 600;
+ }
+
+ &__timestamp {
+ font-size: 0.625rem;
+ }
+
+ &__actions {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ }
+
+ &__action {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ background: none;
+ border: none;
+ cursor: pointer;
+ padding: 0.25rem 0;
+ color: var(--color-gray-60);
+ transition: color 0.2s ease;
+ flex-shrink: 0;
+
+ &.invisible {
+ visibility: hidden;
+ pointer-events: none;
+ }
+
+ &:hover {
+ color: var(--color-primary);
+ }
+
+ svg {
+ width: 14px;
+ height: 14px;
+ }
+ }
+
+ &__action--danger {
+ &:hover {
+ color: var(--color-danger);
+ }
+ }
+
+ &__body {
+ line-height: 1.5;
+ }
+
+ &__text {
+ white-space: pre-wrap;
+ word-wrap: break-word;
+ }
+
+ &__cursor {
+ display: inline-block;
+ margin-left: 2px;
+ color: currentColor;
+ animation: blink 1s infinite;
+ }
+
+ &__loading {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ }
+
+ &__typing-indicator {
+ display: flex;
+ gap: 0.25rem;
+
+ span {
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ background: currentColor;
+ opacity: 0.4;
+ animation: typing 1.4s infinite ease-in-out;
+
+ &:nth-child(1) {
+ animation-delay: -0.32s;
+ }
+ &:nth-child(2) {
+ animation-delay: -0.16s;
+ }
+ &:nth-child(3) {
+ animation-delay: 0s;
+ }
+ }
+ }
+
+ &__error {
+ color: var(--color-danger);
+ font-weight: 500;
+ white-space: pre-wrap;
+ word-wrap: break-word;
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+ }
+
+ &__error-link {
+ display: flex;
+ align-items: center;
+ background: none;
+ border: none;
+ color: var(--color-primary);
+ cursor: pointer;
+ font-size: 0.875rem;
+ font-weight: 500;
+ padding: 0;
+ margin-top: 1rem;
+ text-decoration: underline;
+ font-family: inherit;
+
+ &:disabled {
+ cursor: not-allowed;
+ text-decoration: none;
+ }
+ }
+ }
+
+ @keyframes typing {
+ 0%,
+ 80%,
+ 100% {
+ transform: scale(0.8);
+ opacity: 0.4;
+ }
+ 40% {
+ transform: scale(1);
+ opacity: 1;
+ }
+ }
+
+ @keyframes blink {
+ 0%,
+ 50% {
+ opacity: 1;
+ }
+ 51%,
+ 100% {
+ opacity: 0;
+ }
+ }
+}
diff --git a/packages/excalidraw/components/TTDDialog/Chat/ChatHistoryMenu.tsx b/packages/excalidraw/components/TTDDialog/Chat/ChatHistoryMenu.tsx
new file mode 100644
index 0000000000..ef20374c7c
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/Chat/ChatHistoryMenu.tsx
@@ -0,0 +1,92 @@
+import clsx from "clsx";
+
+import { t } from "../../../i18n";
+import { historyIcon, TrashIcon } from "../../icons";
+import DropdownMenu from "../../dropdownMenu/DropdownMenu";
+
+import { FilledButton } from "../../FilledButton";
+
+import type { SavedChat } from "../types";
+
+interface ChatHistoryMenuProps {
+ isOpen: boolean;
+ onToggle: () => void;
+ onClose: () => void;
+ onNewChat: () => void;
+ onRestoreChat: (chat: SavedChat) => void;
+ onDeleteChat: (chatId: string, event: React.MouseEvent) => void;
+ savedChats: SavedChat[];
+ activeSessionId: string;
+ disabled?: boolean;
+ isNewChatBtnVisible?: boolean;
+}
+
+export const ChatHistoryMenu = ({
+ isOpen,
+ onToggle,
+ onClose,
+ onNewChat,
+ onRestoreChat,
+ onDeleteChat,
+ isNewChatBtnVisible,
+ savedChats,
+ activeSessionId,
+ disabled,
+}: ChatHistoryMenuProps) => {
+ return (
+ <div className="ttd-chat-history-menu">
+ {isNewChatBtnVisible && (
+ <FilledButton onClick={onNewChat} disabled={disabled}>
+ {t("chat.newChat")}
+ </FilledButton>
+ )}
+ {savedChats.length > 0 && (
+ <div className="ttd-dialog-panel__menu-wrapper">
+ <DropdownMenu open={isOpen}>
+ <DropdownMenu.Trigger
+ onToggle={onToggle}
+ className="ttd-dialog-menu-trigger"
+ disabled={disabled}
+ title={t("chat.menu")}
+ aria-label={t("chat.menu")}
+ >
+ {historyIcon}
+ </DropdownMenu.Trigger>
+ <DropdownMenu.Content
+ onClickOutside={onClose}
+ onSelect={onClose}
+ placement="bottom"
+ >
+ <>
+ {savedChats.map((chat) => (
+ <DropdownMenu.ItemCustom
+ key={chat.id}
+ className={clsx("ttd-chat-menu-item", {
+ "ttd-chat-menu-item--active": chat.id === activeSessionId,
+ })}
+ onClick={() => {
+ onRestoreChat(chat);
+ }}
+ >
+ <span className="ttd-chat-menu-item__title">
+ {chat.title}
+ </span>
+ <button
+ className="ttd-chat-menu-item__delete"
+ onClick={(e) => onDeleteChat(chat.id, e)}
+ title={t("chat.deleteChat")}
+ aria-label={t("chat.deleteChat")}
+ type="button"
+ >
+ {TrashIcon}
+ </button>
+ </DropdownMenu.ItemCustom>
+ ))}
+ </>
+ </DropdownMenu.Content>
+ </DropdownMenu>
+ </div>
+ )}
+ </div>
+ );
+};
diff --git a/packages/excalidraw/components/TTDDialog/Chat/ChatInterface.tsx b/packages/excalidraw/components/TTDDialog/Chat/ChatInterface.tsx
new file mode 100644
index 0000000000..64cfdded0b
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/Chat/ChatInterface.tsx
@@ -0,0 +1,178 @@
+import React, { useRef, useEffect } from "react";
+import { KEYS } from "@excalidraw/common";
+
+import { ArrowRightIcon, stop as StopIcon } from "../../icons";
+import { InlineIcon } from "../../InlineIcon";
+
+import { t } from "../../../i18n";
+
+import { ChatMessage } from "./ChatMessage";
+
+import type { TChat, TTTDDialog } from "../types";
+
+import type { FormEventHandler } from "react";
+
+export const ChatInterface = ({
+ chatId,
+ messages,
+ currentPrompt,
+ onPromptChange,
+ onSendMessage,
+ isGenerating,
+ rateLimits,
+ placeholder,
+ onAbort,
+ onMermaidTabClick,
+ onAiRepairClick,
+ onDeleteMessage,
+ onInsertMessage,
+ onRetry,
+ renderWarning,
+}: {
+ chatId: string;
+ messages: TChat.ChatMessage[];
+ currentPrompt: string;
+ onPromptChange: (prompt: string) => void;
+ onSendMessage: (message: string) => void;
+ isGenerating: boolean;
+ rateLimits?: {
+ rateLimit: number;
+ rateLimitRemaining: number;
+ } | null;
+ onViewAsMermaid?: () => void;
+ generatedResponse?: string | null;
+ placeholder: {
+ title: string;
+ description: string;
+ hint: string;
+ };
+ onAbort?: () => void;
+ onMermaidTabClick?: (message: TChat.ChatMessage) => void;
+ onAiRepairClick?: (message: TChat.ChatMessage) => void;
+ onDeleteMessage?: (messageId: string) => void;
+ onInsertMessage?: (message: TChat.ChatMessage) => void;
+ onRetry?: (message: TChat.ChatMessage) => void;
+ renderWarning?: TTTDDialog.renderWarning;
+}) => {
+ const messagesEndRef = useRef<HTMLDivElement>(null);
+ const textareaRef = useRef<HTMLTextAreaElement>(null);
+
+ useEffect(() => {
+ messagesEndRef.current?.scrollIntoView();
+ }, [messages]);
+
+ useEffect(() => {
+ if (textareaRef.current) {
+ textareaRef.current.focus();
+ }
+ }, [chatId]);
+
+ const handleInputChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {
+ const value = event.target.value;
+ onPromptChange(value);
+ };
+
+ const handleSubmit = () => {
+ if (isGenerating && onAbort) {
+ onAbort();
+ return;
+ }
+
+ const trimmedPrompt = currentPrompt.trim();
+ if (!trimmedPrompt) {
+ return;
+ }
+
+ onSendMessage(trimmedPrompt);
+ onPromptChange("");
+ };
+
+ const handleKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {
+ if (event.key === KEYS.ENTER && !event.shiftKey) {
+ event.preventDefault();
+ handleSubmit();
+ }
+ };
+
+ const canSend =
+ currentPrompt.trim().length > 3 &&
+ !isGenerating &&
+ (rateLimits?.rateLimitRemaining ?? 1) > 0;
+
+ const canStop = isGenerating && !!onAbort;
+
+ const onInput: FormEventHandler<HTMLTextAreaElement> = (ev) => {
+ const target = ev.target as HTMLTextAreaElement;
+ target.style.height = "auto";
+ target.style.height = `${Math.min(target.scrollHeight, 120)}px`;
+ };
+
+ return (
+ <div className="chat-interface">
+ <div className="chat-interface__messages">
+ {messages.length === 0 ? (
+ <div className="chat-interface__empty-state">
+ <div className="chat-interface__empty-state-content">
+ <h3>{placeholder.title}</h3>
+ <p>{placeholder.description}</p>
+ <p>{placeholder.hint}</p>
+ </div>
+ </div>
+ ) : (
+ messages.map((message, index) => (
+ <ChatMessage
+ key={message.id}
+ message={message}
+ onMermaidTabClick={onMermaidTabClick}
+ onAiRepairClick={onAiRepairClick}
+ onDeleteMessage={onDeleteMessage}
+ onInsertMessage={onInsertMessage}
+ onRetry={onRetry}
+ rateLimitRemaining={rateLimits?.rateLimitRemaining}
+ isLastMessage={index === messages.length - 1}
+ renderWarning={renderWarning}
+ />
+ ))
+ )}
+ <div ref={messagesEndRef} />
+ </div>
+
+ <div className="chat-interface__input-container">
+ <div className="chat-interface__input-outer">
+ <div className="chat-interface__input-wrapper">
+ <textarea
+ ref={textareaRef}
+ autoFocus
+ className="chat-interface__input"
+ value={currentPrompt}
+ onChange={handleInputChange}
+ onKeyDown={handleKeyDown}
+ placeholder={
+ rateLimits?.rateLimitRemaining === 0
+ ? t("chat.rateLimit.messageLimitInputPlaceholder")
+ : messages.length > 0
+ ? t("chat.inputPlaceholderWithMessages")
+ : t("chat.inputPlaceholder", { shortcut: "Shift + Enter" })
+ }
+ disabled={isGenerating || rateLimits?.rateLimitRemaining === 0}
+ rows={1}
+ cols={30}
+ onInput={onInput}
+ />
+ <button
+ className="chat-interface__send-button"
+ onClick={handleSubmit}
+ disabled={!canSend && !canStop}
+ type="button"
+ >
+ <InlineIcon
+ size="1.5em"
+ icon={isGenerating ? StopIcon : ArrowRightIcon}
+ />
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+};
diff --git a/packages/excalidraw/components/TTDDialog/Chat/ChatMessage.tsx b/packages/excalidraw/components/TTDDialog/Chat/ChatMessage.tsx
new file mode 100644
index 0000000000..07bc7a1e12
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/Chat/ChatMessage.tsx
@@ -0,0 +1,212 @@
+import clsx from "clsx";
+import React, { useState, useEffect } from "react";
+
+import { t } from "../../../i18n";
+import { FilledButton } from "../../FilledButton";
+import { TrashIcon, codeIcon, stackPushIcon, RetryIcon } from "../../icons";
+
+import type { TChat, TTTDDialog } from "../types";
+
+export const ChatMessage: React.FC<{
+ message: TChat.ChatMessage;
+ onMermaidTabClick?: (message: TChat.ChatMessage) => void;
+ onAiRepairClick?: (message: TChat.ChatMessage) => void;
+ onDeleteMessage?: (messageId: string) => void;
+ onInsertMessage?: (message: TChat.ChatMessage) => void;
+ onRetry?: (message: TChat.ChatMessage) => void;
+ rateLimitRemaining?: number;
+ isLastMessage?: boolean;
+ renderWarning?: TTTDDialog.renderWarning;
+}> = ({
+ message,
+ onMermaidTabClick,
+ onAiRepairClick,
+ onDeleteMessage,
+ onInsertMessage,
+ onRetry,
+ rateLimitRemaining,
+ isLastMessage,
+ renderWarning,
+}) => {
+ const [canRetry, setCanRetry] = useState(false);
+
+ useEffect(() => {
+ if (!message.error || !isLastMessage) {
+ return;
+ }
+
+ if (message.error && !message.lastAttemptAt) {
+ setCanRetry(true);
+ return;
+ }
+
+ const timeSinceLastAttempt = Date.now() - message.lastAttemptAt!;
+ const remainingTime = Math.max(0, 5000 - timeSinceLastAttempt);
+
+ if (remainingTime === 0) {
+ setCanRetry(true);
+ return;
+ }
+
+ setCanRetry(false);
+ const timer = setTimeout(() => {
+ setCanRetry(true);
+ }, remainingTime);
+
+ return () => clearTimeout(timer);
+ }, [message.error, message.lastAttemptAt, isLastMessage]);
+
+ const formatTime = (date: Date) => {
+ return date.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
+ };
+
+ if (message.type === "warning") {
+ const customOverride = renderWarning?.(message);
+ return (
+ <div className="chat-message chat-message--system">
+ <div className="chat-message__content">
+ <div className="chat-message__header">
+ <span className="chat-message__role">{t("chat.role.system")}</span>
+ <span className="chat-message__timestamp">
+ {formatTime(message.timestamp)}
+ </span>
+ </div>
+ <div className="chat-message__body">
+ <div className="chat-message__text">
+ {customOverride ? (
+ customOverride
+ ) : message.warningType === "messageLimitExceeded" ? (
+ <>
+ {t("chat.rateLimit.messageLimit")}
+ <div style={{ marginTop: "10px" }}>
+ <FilledButton
+ onClick={() => {
+ window.open(
+ `${
+ import.meta.env.VITE_APP_PLUS_LP
+ }/plus?utm_source=excalidraw&utm_medium=app&utm_content=ttdChatBanner#excalidraw-redirect`,
+ "_blank",
+ "noopener",
+ );
+ }}
+ >
+ {t("chat.upsellBtnLabel")}
+ </FilledButton>
+ </div>
+ </>
+ ) : (
+ t("chat.rateLimit.generalRateLimit")
+ )}
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+ }
+
+ return (
+ <div className={`chat-message chat-message--${message.type}`}>
+ <div className="chat-message__content">
+ <div className="chat-message__header">
+ <span className="chat-message__role">
+ {message.type === "user"
+ ? t("chat.role.user")
+ : t("chat.role.assistant")}
+ </span>
+ <span className="chat-message__timestamp">
+ {formatTime(message.timestamp)}
+ </span>
+ </div>
+ <div className="chat-message__body">
+ {message.error ? (
+ <div className="chat-message__error">
+ {message.content}
+ <div>{message.error}</div>
+ {message.errorType === "parse" && (
+ <>
+ <p>{t("chat.errors.invalidDiagram")}</p>
+ <div className="chat-message__error-actions">
+ {onMermaidTabClick && (
+ <button
+ className="chat-message__error-link"
+ onClick={() => onMermaidTabClick(message)}
+ type="button"
+ >
+ {t("chat.errors.fixInMermaid")}
+ </button>
+ )}
+ {onAiRepairClick && (
+ <button
+ className="chat-message__error-link"
+ onClick={() => onAiRepairClick(message)}
+ disabled={rateLimitRemaining === 0}
+ type="button"
+ >
+ {t("chat.errors.aiRepair")}
+ </button>
+ )}
+ </div>
+ </>
+ )}
+ </div>
+ ) : (
+ <div className="chat-message__text">
+ {message.content}
+ {message.isGenerating && (
+ <span className="chat-message__cursor">▋</span>
+ )}
+ </div>
+ )}
+ </div>
+ </div>
+ {message.type === "assistant" && !message.isGenerating && (
+ <div className="chat-message__actions">
+ {!message.error && onInsertMessage && (
+ <button
+ className="chat-message__action"
+ onClick={() => onInsertMessage(message)}
+ type="button"
+ aria-label={t("chat.insert")}
+ title={t("chat.insert")}
+ >
+ {stackPushIcon}
+ </button>
+ )}
+ {onMermaidTabClick && message.content && (
+ <button
+ className="chat-message__action"
+ onClick={() => onMermaidTabClick(message)}
+ type="button"
+ aria-label={t("chat.viewAsMermaid")}
+ title={t("chat.viewAsMermaid")}
+ >
+ {codeIcon}
+ </button>
+ )}
+ {onDeleteMessage && message.errorType !== "network" && (
+ <button
+ className="chat-message__action chat-message__action--danger"
+ onClick={() => onDeleteMessage(message.id)}
+ type="button"
+ aria-label={t("chat.deleteMessage")}
+ title={t("chat.deleteMessage")}
+ >
+ {TrashIcon}
+ </button>
+ )}
+ {message.errorType === "network" && onRetry && isLastMessage && (
+ <button
+ className={clsx("chat-message__action", { invisible: !canRetry })}
+ onClick={() => onRetry(message)}
+ type="button"
+ aria-label={t("chat.retry")}
+ title={t("chat.retry")}
+ >
+ {RetryIcon}
+ </button>
+ )}
+ </div>
+ )}
+ </div>
+ );
+};
diff --git a/packages/excalidraw/components/TTDDialog/Chat/TTDChatPanel.tsx b/packages/excalidraw/components/TTDDialog/Chat/TTDChatPanel.tsx
new file mode 100644
index 0000000000..31d28574e4
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/Chat/TTDChatPanel.tsx
@@ -0,0 +1,163 @@
+import { t } from "../../../i18n";
+import { ArrowRightIcon } from "../../icons";
+
+import { InlineIcon } from "../../InlineIcon";
+
+import { TTDDialogPanel } from "../TTDDialogPanel";
+
+import { useAtom } from "../../../editor-jotai";
+
+import { rateLimitsAtom } from "../TTDContext";
+
+import { ChatHistoryMenu } from "./ChatHistoryMenu";
+
+import { ChatInterface } from ".";
+
+import type { TTDPanelAction } from "../TTDDialogPanel";
+
+import type { SavedChat, TChat, TTTDDialog } from "../types";
+
+export const TTDChatPanel = ({
+ chatId,
+ messages,
+ currentPrompt,
+ onPromptChange,
+ onSendMessage,
+ isGenerating,
+ generatedResponse,
+ isMenuOpen,
+ onMenuToggle,
+ onMenuClose,
+ onNewChat,
+ onRestoreChat,
+ onDeleteChat,
+ savedChats,
+ activeSessionId,
+ onAbort,
+ onMermaidTabClick,
+ onAiRepairClick,
+ onDeleteMessage,
+ onInsertMessage,
+ onRetry,
+ onViewAsMermaid,
+ renderWarning,
+}: {
+ chatId: string;
+ messages: TChat.ChatMessage[];
+ currentPrompt: string;
+ onPromptChange: (prompt: string) => void;
+ onSendMessage: (message: string, isRepairFlow?: boolean) => void;
+ isGenerating: boolean;
+ generatedResponse: string | null | undefined;
+
+ isMenuOpen: boolean;
+ onMenuToggle: () => void;
+ onMenuClose: () => void;
+ onNewChat: () => void;
+ onRestoreChat: (chat: SavedChat) => void;
+ onDeleteChat: (chatId: string, event: React.MouseEvent) => void;
+ savedChats: SavedChat[];
+ activeSessionId: string;
+
+ onAbort: () => void;
+ onMermaidTabClick: (message: TChat.ChatMessage) => void;
+ onAiRepairClick: (message: TChat.ChatMessage) => void;
+ onDeleteMessage: (messageId: string) => void;
+ onInsertMessage: (message: TChat.ChatMessage) => void;
+ onRetry?: (message: TChat.ChatMessage) => void;
+
+ onViewAsMermaid: () => void;
+
+ renderWarning?: TTTDDialog.renderWarning;
+}) => {
+ const [rateLimits] = useAtom(rateLimitsAtom);
+
+ const getPanelActions = () => {
+ const actions: TTDPanelAction[] = [];
+ if (rateLimits) {
+ actions.push({
+ label: t("chat.rateLimitRemaining", {
+ count: rateLimits.rateLimitRemaining,
+ }),
+ variant: "rateLimit",
+ className:
+ rateLimits.rateLimitRemaining < 5
+ ? "ttd-dialog-panel__rate-limit--danger"
+ : "",
+ });
+ }
+
+ if (generatedResponse) {
+ actions.push({
+ action: onViewAsMermaid,
+ label: t("chat.viewAsMermaid"),
+ icon: <InlineIcon icon={ArrowRightIcon} />,
+ variant: "link",
+ });
+ }
+
+ return actions;
+ };
+ const actions = getPanelActions();
+
+ const getPanelActionFlexProp = () => {
+ if (actions.length === 2) {
+ return "space-between";
+ }
+ if (actions.length === 1 && actions[0].variant === "rateLimit") {
+ return "flex-start";
+ }
+
+ return "flex-end";
+ };
+
+ return (
+ <TTDDialogPanel
+ label={
+ <div className="ttd-dialog-panel__label-wrapper">
+ <div className="ttd-dialog-panel__label-group"></div>
+ <div className="ttd-dialog-panel__header-right">
+ <ChatHistoryMenu
+ isNewChatBtnVisible={!!messages.length}
+ isOpen={isMenuOpen}
+ onToggle={onMenuToggle}
+ onClose={onMenuClose}
+ onNewChat={onNewChat}
+ onRestoreChat={onRestoreChat}
+ onDeleteChat={onDeleteChat}
+ savedChats={savedChats}
+ activeSessionId={activeSessionId}
+ disabled={isGenerating}
+ />
+ </div>
+ </div>
+ }
+ className="ttd-dialog-chat-panel"
+ panelActionJustifyContent={getPanelActionFlexProp()}
+ panelActions={actions}
+ >
+ <ChatInterface
+ chatId={chatId}
+ messages={messages}
+ currentPrompt={currentPrompt}
+ onPromptChange={onPromptChange}
+ onSendMessage={onSendMessage}
+ isGenerating={isGenerating}
+ generatedResponse={generatedResponse}
+ onAbort={onAbort}
+ onMermaidTabClick={onMermaidTabClick}
+ onAiRepairClick={onAiRepairClick}
+ onDeleteMessage={onDeleteMessage}
+ onInsertMessage={onInsertMessage}
+ onRetry={onRetry}
+ rateLimits={rateLimits}
+ placeholder={{
+ title: t("chat.placeholder.title"),
+ description: t("chat.placeholder.description"),
+ hint: t("chat.placeholder.hint"),
+ }}
+ renderWarning={renderWarning}
+ />
+ </TTDDialogPanel>
+ );
+};
diff --git a/packages/excalidraw/components/TTDDialog/Chat/index.ts b/packages/excalidraw/components/TTDDialog/Chat/index.ts
new file mode 100644
index 0000000000..27074530ad
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/Chat/index.ts
@@ -0,0 +1,3 @@
+export { ChatInterface } from "./ChatInterface";
+export { ChatMessage } from "./ChatMessage";
+export { useChatAgent } from "./useChatAgent";
diff --git a/packages/excalidraw/components/TTDDialog/Chat/useChatAgent.ts b/packages/excalidraw/components/TTDDialog/Chat/useChatAgent.ts
new file mode 100644
index 0000000000..607b749e16
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/Chat/useChatAgent.ts
@@ -0,0 +1,76 @@
+import { useAtom } from "../../../editor-jotai";
+import { chatHistoryAtom } from "../../TTDDialog/TTDContext";
+import {
+ addMessages,
+ updateAssistantContent,
+} from "../../TTDDialog/utils/chat";
+
+export const useChatAgent = () => {
+ const [chatHistory, setChatHistory] = useAtom(chatHistoryAtom);
+
+ const addUserMessage = (content: string) => {
+ setChatHistory((prev) =>
+ addMessages(prev, [
+ {
+ type: "user",
+ content,
+ },
+ ]),
+ );
+ };
+
+ const addAssistantMessage = () => {
+ setChatHistory((prev) =>
+ addMessages(prev, [
+ {
+ type: "assistant",
+ content: "",
+ isGenerating: true,
+ },
+ ]),
+ );
+ };
+
+ const setLastRetryAttempt = () => {
+ setChatHistory((prev) =>
+ updateAssistantContent(prev, {
+ lastAttemptAt: Date.now(),
+ }),
+ );
+ };
+
+ const setAssistantError = (
+ errorMessage: string,
+ errorType: "parse" | "network" | "other" = "other",
+ errorDetails?: Error | unknown,
+ ) => {
+ const serializedErrorDetails = errorDetails
+ ? JSON.stringify({
+ name: errorDetails instanceof Error ? errorDetails.name : "Error",
+ message:
+ errorDetails instanceof Error
+ ? errorDetails.message
+ : String(errorDetails),
+ stack: errorDetails instanceof Error ? errorDetails.stack : undefined,
+ })
+ : undefined;
+
+ setChatHistory((prev) =>
+ updateAssistantContent(prev, {
+ isGenerating: false,
+ error: errorMessage,
+ errorType,
+ errorDetails: serializedErrorDetails,
+ }),
+ );
+ };
+
+ return {
+ addUserMessage,
+ addAssistantMessage,
+ setAssistantError,
+ chatHistory,
+ setChatHistory,
+ setLastRetryAttempt,
+ };
+};
diff --git a/packages/excalidraw/components/TTDDialog/MermaidToExcalidraw.tsx b/packages/excalidraw/components/TTDDialog/MermaidToExcalidraw.tsx
index 8a4f92840b..baa1298026 100644
--- a/packages/excalidraw/components/TTDDialog/MermaidToExcalidraw.tsx
+++ b/packages/excalidraw/components/TTDDialog/MermaidToExcalidraw.tsx
@@ -10,6 +10,8 @@ import { EditorLocalStorage } from "../../data/EditorLocalStorage";
import { t } from "../../i18n";
import Trans from "../Trans";
+import { useUIAppState } from "../../context/ui-appState";
+
import { TTDDialogInput } from "./TTDDialogInput";
import { TTDDialogOutput } from "./TTDDialogOutput";
import { TTDDialogPanel } from "./TTDDialogPanel";
@@ -19,12 +21,13 @@ import {
convertMermaidToExcalidraw,
insertToEditor,
saveMermaidDataToStorage,
+ resetPreview,
} from "./common";
import "./MermaidToExcalidraw.scss";
import type { BinaryFiles } from "../../types";
-import type { MermaidToExcalidrawLibProps } from "./common";
+import type { MermaidToExcalidrawLibProps } from "./types";
const MERMAID_EXAMPLE =
"flowchart TD\n A[Christmas] -->|Get money| B(Go shopping)\n B --> C{Let me think}\n C -->|One| D[Laptop]\n C -->|Two| E[iPhone]\n C -->|Three| F[Car]";
@@ -33,8 +36,10 @@ const debouncedSaveMermaidDefinition = debounce(saveMermaidDataToStorage, 300);
const MermaidToExcalidraw = ({
mermaidToExcalidrawLib,
+ isActive,
}: {
mermaidToExcalidrawLib: MermaidToExcalidrawLibProps;
+ isActive?: boolean;
}) => {
const [text, setText] = useState(
() =>
@@ -51,22 +56,40 @@ const MermaidToExcalidraw = ({
}>({ elements: [], files: null });
const app = useApp();
+ const { theme } = useUIAppState();
useEffect(() => {
- convertMermaidToExcalidraw({
- canvasRef,
- data,
- mermaidToExcalidrawLib,
- setError,
- mermaidDefinition: deferredText,
- }).catch((err) => {
- if (isDevEnv()) {
- console.error("Failed to parse mermaid definition", err);
+ const doRender = async () => {
+ try {
+ if (!deferredText) {
+ resetPreview({ canvasRef, setError });
+ return;
+ }
+ const result = await convertMermaidToExcalidraw({
+ canvasRef,
+ data,
+ mermaidToExcalidrawLib,
+ setError,
+ mermaidDefinition: deferredText,
+ theme,
+ });
+
+ if (!result.success) {
+ const err = result.error ?? new Error("Invalid mermaid definition");
+ setError(err);
+ }
+ } catch (err) {
+ if (isDevEnv()) {
+ console.error("Failed to parse mermaid definition", err);
+ }
}
- });
+ };
- debouncedSaveMermaidDefinition(deferredText);
- }, [deferredText, mermaidToExcalidrawLib]);
+ if (isActive) {
+ doRender();
+ debouncedSaveMermaidDefinition(deferredText);
+ }
+ }, [deferredText, mermaidToExcalidrawLib, isActive, theme]);
useEffect(
() => () => {
@@ -103,10 +126,10 @@ const MermaidToExcalidraw = ({
/>
</div>
<TTDDialogPanels>
- <TTDDialogPanel label={t("mermaid.syntax")}>
+ <TTDDialogPanel>
<TTDDialogInput
input={text}
- placeholder={"Write Mermaid diagram defintion here..."}
+ placeholder={t("mermaid.inputPlaceholder")}
onChange={(event) => setText(event.target.value)}
onKeyboardSubmit={() => {
onInsertToEditor();
@@ -114,14 +137,16 @@ const MermaidToExcalidraw = ({
/>
</TTDDialogPanel>
<TTDDialogPanel
- label={t("mermaid.preview")}
- panelAction={{
- action: () => {
- onInsertToEditor();
+ panelActions={[
+ {
+ action: () => {
+ onInsertToEditor();
+ },
+ label: t("mermaid.button"),
+ icon: ArrowRightIcon,
+ variant: "button",
},
- label: t("mermaid.button"),
- icon: ArrowRightIcon,
- }}
+ ]}
renderSubmitShortcut={() => <TTDDialogSubmitShortcut />}
>
<TTDDialogOutput
diff --git a/packages/excalidraw/components/TTDDialog/TTDContext.tsx b/packages/excalidraw/components/TTDDialog/TTDContext.tsx
new file mode 100644
index 0000000000..1bf2e13419
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/TTDContext.tsx
@@ -0,0 +1,17 @@
+import { randomId } from "@excalidraw/common";
+
+import { atom } from "../../editor-jotai";
+
+import type { RateLimits, TChat } from "./types";
+
+export const rateLimitsAtom = atom<RateLimits | null>(null);
+
+export const showPreviewAtom = atom<boolean>(false);
+
+export const errorAtom = atom<Error | null>(null);
+
+export const chatHistoryAtom = atom<TChat.ChatHistory>({
+ id: randomId(),
+ messages: [],
+ currentPrompt: "",
+});
diff --git a/packages/excalidraw/components/TTDDialog/TTDDialog.scss b/packages/excalidraw/components/TTDDialog/TTDDialog.scss
index b92c7f6d3c..3d133c5baf 100644
--- a/packages/excalidraw/components/TTDDialog/TTDDialog.scss
+++ b/packages/excalidraw/components/TTDDialog/TTDDialog.scss
@@ -1,6 +1,8 @@
-@use "../../css/variables.module" as *;
+@use "../../css/variables.module.scss" as *;
+@use "./Chat/Chat.scss";
$verticalBreakpoint: 861px;
+$fullScreenModalBreakpoint: 600px;
.excalidraw {
.Modal.Dialog.ttd-dialog {
@@ -16,21 +18,26 @@ $verticalBreakpoint: 861px;
display: flex;
flex-direction: column;
flex: 1 1 auto;
- box-shadow: none;
}
.Modal__content {
- height: auto;
max-height: 100%;
+ min-height: 95vh;
+ height: 100%;
@media screen and (min-width: $verticalBreakpoint) {
- max-height: 750px;
+ max-height: min(950px, calc(100vh - 4rem));
height: 100%;
+ min-height: unset;
}
}
.Dialog__content {
flex: 1 1 auto;
+
+ @media screen and (max-width: $verticalBreakpoint) {
+ margin-top: 0 !important;
+ }
}
}
@@ -38,7 +45,7 @@ $verticalBreakpoint: 861px;
font-size: 15px;
font-style: italic;
font-weight: 500;
- margin-bottom: 1.5rem;
+ margin: 0.5rem 0 1.5rem 0;
}
.ttd-dialog-tabs-root {
@@ -63,12 +70,33 @@ $verticalBreakpoint: 861px;
&[data-state="active"] {
border-bottom: 2px solid var(--color-primary);
}
+
+ &__content {
+ display: flex;
+ align-items: center;
+ }
+
+ &__badge {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 1px 6px;
+ margin-left: 10px;
+ font-size: 10px;
+ border-radius: 12px;
+ background: var(--color-promo);
+ color: var(--color-surface-lowest);
+ }
}
.ttd-dialog-triggers {
border-bottom: 1px solid var(--color-surface-high);
- margin-bottom: 1.5rem;
+ margin-bottom: 1rem;
padding-inline: 2.5rem;
+
+ @media screen and (max-width: $verticalBreakpoint) {
+ margin-bottom: 1rem;
+ }
}
.ttd-dialog-content {
@@ -76,10 +104,102 @@ $verticalBreakpoint: 861px;
height: 100%;
display: flex;
flex-direction: column;
+ overflow: visible;
+ outline: none;
&[hidden] {
display: none;
}
+
+ @media screen and (max-width: $verticalBreakpoint) {
+ padding-inline: 1rem;
+ flex-grow: 1;
+ }
+ }
+
+ .ttd-dialog-panel__header .dropdown-menu {
+ z-index: 2;
+ margin: 0;
+ right: 0;
+ left: auto;
+ min-width: 280px;
+
+ .dropdown-menu-container.dropdown-menu-container {
+ padding-inline: 0.5rem !important;
+ padding-top: 0.5rem;
+ padding-bottom: 0.5rem;
+ max-height: min(400px, 70vh);
+ height: fit-content;
+ overflow-y: auto;
+ box-shadow: var(--shadow-island);
+ border-radius: var(--border-radius-lg);
+ background-color: var(--island-bg-color-alt);
+ }
+ }
+
+ .ttd-dialog-layout {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ height: 100%;
+
+ &--split {
+ gap: 2rem;
+ min-width: 0;
+
+ @media screen and (max-width: $verticalBreakpoint) {
+ grid-template-columns: 1fr;
+ grid-template-rows: 1fr auto;
+ grid-row-gap: 0;
+ }
+
+ .ttd-dialog-chat-panel {
+ min-width: 0;
+
+ @media screen and (max-width: $verticalBreakpoint) {
+ width: 100%;
+ flex: 0 0 auto;
+ height: auto;
+ min-height: 250px;
+ }
+ }
+
+ .ttd-dialog-preview-panel {
+ min-width: 0;
+ overflow: hidden;
+
+ @media screen and (max-width: $verticalBreakpoint) {
+ width: 100%;
+ flex: 0 0 auto;
+ max-width: 100%;
+ min-height: 280px;
+ height: unset;
+ }
+ }
+ }
+
+ &--chat-only {
+ grid-template-columns: 1fr;
+
+ .invisible {
+ display: none;
+ }
+
+ .ttd-dialog-chat-panel {
+ @media screen and (max-width: $verticalBreakpoint) {
+ height: unset;
+ }
+ }
+
+ @media screen and (max-width: $verticalBreakpoint) {
+ .chat-interface {
+ max-height: 100%;
+
+ &__messages {
+ max-height: unset;
+ }
+ }
+ }
+ }
}
.ttd-dialog-input {
@@ -101,12 +221,15 @@ $verticalBreakpoint: 861px;
.ttd-dialog-output-wrapper {
display: flex;
+ flex-direction: column;
align-items: center;
justify-content: center;
- padding: 0.85rem;
box-sizing: border-box;
flex-grow: 1;
position: relative;
+ overflow: hidden;
+ max-width: 100%;
+ max-height: 100%;
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==")
left center;
@@ -115,16 +238,29 @@ $verticalBreakpoint: 861px;
height: 400px;
width: auto;
+ max-width: 100%;
- @media screen and (min-width: $verticalBreakpoint) {
- width: 100%;
- // acts as min-height
+ @media screen and (max-width: $fullScreenModalBreakpoint) {
height: 200px;
}
+ @media screen and (max-width: $verticalBreakpoint) {
+ width: 100%;
+ max-width: 100%;
+ }
+
+ &--error {
+ background: none;
+ border: 1px solid var(--dialog-border-color);
+ border-radius: var(--border-radius-lg);
+ }
+
canvas {
max-width: 100%;
max-height: 100%;
+ width: auto;
+ height: auto;
+ object-fit: contain;
}
}
@@ -135,28 +271,74 @@ $verticalBreakpoint: 861px;
align-items: center;
justify-content: center;
flex-grow: 1;
+ position: relative;
+ user-select: none;
+
+ &.invisible {
+ visibility: hidden;
+ pointer-events: none;
+ }
}
- .ttd-dialog-output-error {
- color: red;
- font-weight: 700;
- font-size: 30px;
- word-break: break-word;
- overflow: auto;
- max-height: 100%;
- height: 100%;
+ .ttd-dialog-output-canvas-content {
+ display: flex;
width: 100%;
- text-align: center;
+ height: 100%;
+ align-items: center;
+ justify-content: center;
+ flex-grow: 1;
+
+ canvas {
+ image-rendering: auto;
+ }
+ }
+
+ .ttd-dialog-output-error {
position: absolute;
z-index: 10;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 2rem;
- p {
- font-weight: 500;
- font-family: Cascadia;
+ .ttd-dialog-output-error-content {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 1rem;
+ padding: 2.5rem 2rem;
+ background: var(--color-surface-primary);
+ }
+
+ .ttd-dialog-output-error-icon {
+ color: var(--color-danger);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ svg {
+ width: 52px;
+ height: 52px;
+ stroke-width: 1.5;
+ }
+ }
+
+ .ttd-dialog-output-error-title {
+ font-size: 1.25rem;
+ font-weight: 600;
+ color: var(--color-danger);
+ text-align: center;
+ margin-top: 0.25rem;
+ }
+
+ .ttd-dialog-output-error-message {
text-align: left;
+ font-weight: 400;
+ color: var(--color-gray-50);
+ word-break: break-word;
white-space: pre-wrap;
- font-size: 0.875rem;
- padding: 0 10px;
+ max-width: 100%;
+ font-family: monospace;
}
}
@@ -166,37 +348,86 @@ $verticalBreakpoint: 861px;
@media screen and (min-width: $verticalBreakpoint) {
display: grid;
grid-template-columns: 1fr 1fr;
- gap: 4rem;
+ gap: 2rem;
}
}
+ .ttd-dialog-chat-panel,
+ .ttd-dialog-preview-panel {
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ height: 100%;
+ min-width: 0;
+ align-items: stretch;
+ }
+
.ttd-dialog-panel {
display: flex;
flex-direction: column;
width: 100%;
+ height: 100%;
+
+ @media screen and (max-width: $verticalBreakpoint) {
+ height: 50%;
+ }
&__header {
display: flex;
- margin: 0px 4px 4px 4px;
align-items: center;
- gap: 1rem;
+ gap: 0.3rem;
+ height: 36px;
+ margin-top: 0.2rem;
+ margin-bottom: 0.5rem;
+ flex-shrink: 0;
label {
font-size: 14px;
+ line-height: 22px;
font-style: normal;
font-weight: 600;
}
}
- &:first-child {
- .ttd-dialog-panel-button-container:not(.invisible) {
- margin-bottom: 4rem;
+ &__label-wrapper {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ width: 100%;
+ }
+
+ &__label-group {
+ display: flex;
+ gap: 5px;
+ }
+
+ &__header-right {
+ display: flex;
+ align-items: center;
+ gap: 0.75rem;
+ }
+
+ &__rate-limit {
+ font-size: 0.75rem;
+ font-weight: 500;
+ white-space: nowrap;
+
+ &--danger {
+ color: var(--color-danger);
}
}
- @media screen and (min-width: $verticalBreakpoint) {
- .ttd-dialog-panel-button-container:not(.invisible) {
- margin-bottom: 0.5rem !important;
+ &__menu-wrapper {
+ position: relative;
+
+ .ttd-dialog-menu-trigger {
+ height: 40px;
+ width: 40px;
+ }
+
+ .dropdown-menu {
+ margin-top: 0.375rem;
+ right: 0;
}
}
@@ -213,23 +444,28 @@ $verticalBreakpoint: 861px;
@media screen and (max-width: $verticalBreakpoint) {
width: auto;
- height: 10rem;
}
}
}
.ttd-dialog-panel-button-container {
+ display: flex;
+ align-items: center;
+ flex-grow: 0;
+ height: 40px;
+ flex-shrink: 0;
margin-top: 1rem;
margin-bottom: 0.5rem;
+ @media screen and (max-width: $verticalBreakpoint) {
+ margin-top: 0.5rem;
+ }
+
&.invisible {
- .ttd-dialog-panel-button {
- display: none;
+ visibility: hidden;
- @media screen and (min-width: $verticalBreakpoint) {
- display: block;
- visibility: hidden;
- }
+ @media screen and (max-width: $verticalBreakpoint) {
+ display: none;
}
}
}
@@ -314,4 +550,109 @@ $verticalBreakpoint: 861px;
border-radius: 4px;
}
}
+
+ .ttd-dialog-panel-action-link {
+ display: flex;
+ align-items: center;
+ gap: 0.25rem;
+ background: none;
+ border: none;
+ color: var(--color-primary);
+ font-weight: 500;
+ font-family: inherit;
+ height: 40px;
+
+ &__icon {
+ display: inline-flex;
+ align-items: center;
+
+ svg {
+ width: 12px;
+ height: 12px;
+ }
+ }
+
+ @media screen and (max-width: $verticalBreakpoint) {
+ height: unset;
+ }
+ }
+
+ .dropdown-menu-item-custom.ttd-chat-menu-item {
+ display: flex;
+ width: unset;
+ align-items: center;
+ justify-content: space-between;
+ padding: 0.25rem 0.5rem;
+ cursor: pointer;
+ position: relative;
+ border: 1px solid transparent;
+ border-radius: var(--border-radius-md);
+ margin-top: 1px;
+
+ &:hover {
+ background-color: var(--button-hover-bg);
+ }
+
+ &:active {
+ border: 1px solid var(--button-active-border);
+ }
+
+ &--active {
+ background-color: var(--color-surface-primary-container);
+ }
+
+ .ttd-chat-menu-item__title {
+ flex: 1;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ &:hover {
+ .ttd-chat-menu-item__delete {
+ visibility: visible;
+ }
+ }
+
+ .ttd-chat-menu-item__delete {
+ border: none;
+ padding: 0.25rem;
+ cursor: pointer;
+ flex-shrink: 0;
+ margin-left: 0.5rem;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: transparent;
+ visibility: hidden;
+
+ &:hover {
+ color: var(--color-danger);
+ }
+
+ @at-root .excalidraw.theme--dark#{&} {
+ svg {
+ color: var(--color-on-surface);
+ }
+ &:hover svg {
+ color: var(--color-danger);
+ }
+ }
+
+ svg {
+ width: 16px;
+ height: 16px;
+ }
+ }
+ }
+
+ .ttd-dialog-preview-panel--hidden {
+ display: none;
+ }
+
+ .ttd-chat-history-menu {
+ display: flex;
+ gap: 1rem;
+ align-items: center;
+ }
}
diff --git a/packages/excalidraw/components/TTDDialog/TTDDialog.tsx b/packages/excalidraw/components/TTDDialog/TTDDialog.tsx
index 68d230d245..a6263f2374 100644
--- a/packages/excalidraw/components/TTDDialog/TTDDialog.tsx
+++ b/packages/excalidraw/components/TTDDialog/TTDDialog.tsx
@@ -1,71 +1,27 @@
-import { useEffect, useRef, useState } from "react";
+import { useEffect, useState } from "react";
-import { isFiniteNumber } from "@excalidraw/math";
-
-import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
-
-import { trackEvent } from "../../analytics";
import { useUIAppState } from "../../context/ui-appState";
-import { atom, useAtom } from "../../editor-jotai";
import { t } from "../../i18n";
-import { useApp, useExcalidrawSetAppState } from "../App";
+import { useApp } from "../App";
import { Dialog } from "../Dialog";
-import { InlineIcon } from "../InlineIcon";
import { withInternalFallback } from "../hoc/withInternalFallback";
-import { ArrowRightIcon } from "../icons";
import MermaidToExcalidraw from "./MermaidToExcalidraw";
+import TextToDiagram from "./TextToDiagram";
import TTDDialogTabs from "./TTDDialogTabs";
import { TTDDialogTabTriggers } from "./TTDDialogTabTriggers";
import { TTDDialogTabTrigger } from "./TTDDialogTabTrigger";
import { TTDDialogTab } from "./TTDDialogTab";
-import { TTDDialogInput } from "./TTDDialogInput";
-import { TTDDialogOutput } from "./TTDDialogOutput";
-import { TTDDialogPanel } from "./TTDDialogPanel";
-import { TTDDialogPanels } from "./TTDDialogPanels";
-
-import {
- convertMermaidToExcalidraw,
- insertToEditor,
- saveMermaidDataToStorage,
-} from "./common";
-import { TTDDialogSubmitShortcut } from "./TTDDialogSubmitShortcut";
import "./TTDDialog.scss";
-import type { ChangeEventHandler } from "react";
-import type { MermaidToExcalidrawLibProps } from "./common";
-
-import type { BinaryFiles } from "../../types";
-
-const MIN_PROMPT_LENGTH = 3;
-const MAX_PROMPT_LENGTH = 1000;
-
-const rateLimitsAtom = atom<{
- rateLimit: number;
- rateLimitRemaining: number;
-} | null>(null);
-
-const ttdGenerationAtom = atom<{
- generatedResponse: string | null;
- prompt: string | null;
-} | null>(null);
-
-type OnTestSubmitRetValue = {
- rateLimit?: number | null;
- rateLimitRemaining?: number | null;
-} & (
- | { generatedResponse: string | undefined; error?: null | undefined }
- | {
- error: Error;
- generatedResponse?: null | undefined;
- }
-);
+import type { MermaidToExcalidrawLibProps, TTTDDialog } from "./types";
export const TTDDialog = (
props:
| {
- onTextSubmit(value: string): Promise<OnTestSubmitRetValue>;
+ onTextSubmit: TTTDDialog.onTextSubmit;
+ renderWarning?: TTTDDialog.renderWarning;
}
| { __fallback: true },
) => {
@@ -81,7 +37,7 @@ export const TTDDialog = (
/**
* Text to diagram (TTD) dialog
*/
-export const TTDDialogBase = withInternalFallback(
+const TTDDialogBase = withInternalFallback(
"TTDDialogBase",
({
tab,
@@ -90,127 +46,14 @@ export const TTDDialogBase = withInternalFallback(
tab: "text-to-diagram" | "mermaid";
} & (
| {
- onTextSubmit(value: string): Promise<OnTestSubmitRetValue>;
+ onTextSubmit(
+ props: TTTDDialog.OnTextSubmitProps,
+ ): Promise<TTTDDialog.OnTextSubmitRetValue>;
+ renderWarning?: TTTDDialog.renderWarning;
}
| { __fallback: true }
)) => {
const app = useApp();
- const setAppState = useExcalidrawSetAppState();
-
- const someRandomDivRef = useRef<HTMLDivElement>(null);
-
- const [ttdGeneration, setTtdGeneration] = useAtom(ttdGenerationAtom);
-
- const [text, setText] = useState(ttdGeneration?.prompt ?? "");
-
- const prompt = text.trim();
-
- const handleTextChange: ChangeEventHandler<HTMLTextAreaElement> = (
- event,
- ) => {
- setText(event.target.value);
- setTtdGeneration((s) => ({
- generatedResponse: s?.generatedResponse ?? null,
- prompt: event.target.value,
- }));
- };
-
- const [onTextSubmitInProgess, setOnTextSubmitInProgess] = useState(false);
- const [rateLimits, setRateLimits] = useAtom(rateLimitsAtom);
-
- const onGenerate = async () => {
- if (
- prompt.length > MAX_PROMPT_LENGTH ||
- prompt.length < MIN_PROMPT_LENGTH ||
- onTextSubmitInProgess ||
- rateLimits?.rateLimitRemaining === 0 ||
- // means this is not a text-to-diagram dialog (needed for TS only)
- "__fallback" in rest
- ) {
- if (prompt.length < MIN_PROMPT_LENGTH) {
- setError(
- new Error(
- `Prompt is too short (min ${MIN_PROMPT_LENGTH} characters)`,
- ),
- );
- }
- if (prompt.length > MAX_PROMPT_LENGTH) {
- setError(
- new Error(
- `Prompt is too long (max ${MAX_PROMPT_LENGTH} characters)`,
- ),
- );
- }
-
- return;
- }
-
- try {
- setOnTextSubmitInProgess(true);
-
- trackEvent("ai", "generate", "ttd");
-
- const { generatedResponse, error, rateLimit, rateLimitRemaining } =
- await rest.onTextSubmit(prompt);
-
- if (typeof generatedResponse === "string") {
- setTtdGeneration((s) => ({
- generatedResponse,
- prompt: s?.prompt ?? null,
- }));
- }
-
- if (isFiniteNumber(rateLimit) && isFiniteNumber(rateLimitRemaining)) {
- setRateLimits({ rateLimit, rateLimitRemaining });
- }
-
- if (error) {
- setError(error);
- return;
- }
- if (!generatedResponse) {
- setError(new Error("Generation failed"));
- return;
- }
-
- try {
- await convertMermaidToExcalidraw({
- canvasRef: someRandomDivRef,
- data,
- mermaidToExcalidrawLib,
- setError,
- mermaidDefinition: generatedResponse,
- });
- trackEvent("ai", "mermaid parse success", "ttd");
- } catch (error: any) {
- console.info(
- `%cTTD mermaid render errror: ${error.message}`,
- "color: red",
- );
- console.info(
- `>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\nTTD mermaid definition render errror: ${error.message}`,
- "color: yellow",
- );
- trackEvent("ai", "mermaid parse failed", "ttd");
- setError(
- new Error(
- "Generated an invalid diagram :(. You may also try a different prompt.",
- ),
- );
- }
- } catch (error: any) {
- let message: string | undefined = error.message;
- if (!message || message === "Failed to fetch") {
- message = "Request failed";
- }
- setError(new Error(message));
- } finally {
- setOnTextSubmitInProgess(false);
- }
- };
-
- const refOnGenerate = useRef(onGenerate);
- refOnGenerate.current = onGenerate;
const [mermaidToExcalidrawLib, setMermaidToExcalidrawLib] =
useState<MermaidToExcalidrawLibProps>({
@@ -226,20 +69,13 @@ export const TTDDialogBase = withInternalFallback(
fn();
}, [mermaidToExcalidrawLib.api]);
- const data = useRef<{
- elements: readonly NonDeletedExcalidrawElement[];
- files: BinaryFiles | null;
- }>({ elements: [], files: null });
-
- const [error, setError] = useState<Error | null>(null);
-
return (
<Dialog
className="ttd-dialog"
onCloseRequest={() => {
app.setOpenDialog(null);
}}
- size={1200}
+ size={1520}
title={false}
{...rest}
autofocus={false}
@@ -250,150 +86,34 @@ export const TTDDialogBase = withInternalFallback(
) : (
<TTDDialogTabTriggers>
<TTDDialogTabTrigger tab="text-to-diagram">
- <div style={{ display: "flex", alignItems: "center" }}>
+ <div className="ttd-dialog-tab-trigger__content">
{t("labels.textToDiagram")}
- <div
- style={{
- display: "flex",
- alignItems: "center",
- justifyContent: "center",
- padding: "1px 6px",
- marginLeft: "10px",
- fontSize: 10,
- borderRadius: "12px",
- background: "var(--color-promo)",
- color: "var(--color-surface-lowest)",
- }}
- >
- AI Beta
+ <div className="ttd-dialog-tab-trigger__badge">
+ {t("chat.aiBeta")}
</div>
</div>
</TTDDialogTabTrigger>
- <TTDDialogTabTrigger tab="mermaid">Mermaid</TTDDialogTabTrigger>
+ <TTDDialogTabTrigger tab="mermaid">
+ {t("mermaid.label")}
+ </TTDDialogTabTrigger>
</TTDDialogTabTriggers>
)}
+ {!("__fallback" in rest) && (
+ <TTDDialogTab className="ttd-dialog-content" tab="text-to-diagram">
+ <TextToDiagram
+ mermaidToExcalidrawLib={mermaidToExcalidrawLib}
+ onTextSubmit={rest.onTextSubmit}
+ renderWarning={rest.renderWarning}
+ />
+ </TTDDialogTab>
+ )}
<TTDDialogTab className="ttd-dialog-content" tab="mermaid">
<MermaidToExcalidraw
mermaidToExcalidrawLib={mermaidToExcalidrawLib}
+ isActive={tab === "mermaid"}
/>
</TTDDialogTab>
- {!("__fallback" in rest) && (
- <TTDDialogTab className="ttd-dialog-content" tab="text-to-diagram">
- <div className="ttd-dialog-desc">
- Currently we use Mermaid as a middle step, so you'll get best
- results if you describe a diagram, workflow, flow chart, and
- similar.
- </div>
- <TTDDialogPanels>
- <TTDDialogPanel
- label={t("labels.prompt")}
- panelAction={{
- action: onGenerate,
- label: "Generate",
- icon: ArrowRightIcon,
- }}
- onTextSubmitInProgess={onTextSubmitInProgess}
- panelActionDisabled={
- prompt.length > MAX_PROMPT_LENGTH ||
- rateLimits?.rateLimitRemaining === 0
- }
- renderTopRight={() => {
- if (!rateLimits) {
- return null;
- }
-
- return (
- <div
- className="ttd-dialog-rate-limit"
- style={{
- fontSize: 12,
- marginLeft: "auto",
- color:
- rateLimits.rateLimitRemaining === 0
- ? "var(--color-danger)"
- : undefined,
- }}
- >
- {rateLimits.rateLimitRemaining} requests left today
- </div>
- );
- }}
- renderSubmitShortcut={() => <TTDDialogSubmitShortcut />}
- renderBottomRight={() => {
- if (typeof ttdGeneration?.generatedResponse === "string") {
- return (
- <div
- className="excalidraw-link"
- style={{ marginLeft: "auto", fontSize: 14 }}
- onClick={() => {
- if (
- typeof ttdGeneration?.generatedResponse ===
- "string"
- ) {
- saveMermaidDataToStorage(
- ttdGeneration.generatedResponse,
- );
- setAppState({
- openDialog: { name: "ttd", tab: "mermaid" },
- });
- }
- }}
- >
- View as Mermaid
- <InlineIcon icon={ArrowRightIcon} />
- </div>
- );
- }
- const ratio = prompt.length / MAX_PROMPT_LENGTH;
- if (ratio > 0.8) {
- return (
- <div
- style={{
- marginLeft: "auto",
- fontSize: 12,
- fontFamily: "monospace",
- color:
- ratio > 1 ? "var(--color-danger)" : undefined,
- }}
- >
- Length: {prompt.length}/{MAX_PROMPT_LENGTH}
- </div>
- );
- }
-
- return null;
- }}
- >
- <TTDDialogInput
- onChange={handleTextChange}
- input={text}
- placeholder={"Describe what you want to see..."}
- onKeyboardSubmit={() => {
- refOnGenerate.current();
- }}
- />
- </TTDDialogPanel>
- <TTDDialogPanel
- label="Preview"
- panelAction={{
- action: () => {
- console.info("Panel action clicked");
- insertToEditor({ app, data });
- },
- label: "Insert",
- icon: ArrowRightIcon,
- }}
- >
- <TTDDialogOutput
- canvasRef={someRandomDivRef}
- error={error}
- loaded={mermaidToExcalidrawLib.loaded}
- />
- </TTDDialogPanel>
- </TTDDialogPanels>
- </TTDDialogTab>
- )}
</TTDDialogTabs>
</Dialog>
);
diff --git a/packages/excalidraw/components/TTDDialog/TTDDialogOutput.tsx b/packages/excalidraw/components/TTDDialog/TTDDialogOutput.tsx
index 084a67f4f9..f19d459633 100644
--- a/packages/excalidraw/components/TTDDialog/TTDDialogOutput.tsx
+++ b/packages/excalidraw/components/TTDDialog/TTDDialogOutput.tsx
@@ -1,36 +1,56 @@
-import Spinner from "../Spinner";
+import clsx from "clsx";
-const ErrorComp = ({ error }: { error: string }) => {
- return (
- <div
- data-testid="ttd-dialog-output-error"
- className="ttd-dialog-output-error"
- >
- Error! <p>{error}</p>
- </div>
- );
-};
+import Spinner from "../Spinner";
+import { t } from "../../i18n";
+import { alertTriangleIcon } from "../icons";
interface TTDDialogOutputProps {
error: Error | null;
canvasRef: React.RefObject<HTMLDivElement | null>;
loaded: boolean;
+ hideErrorDetails?: boolean;
}
export const TTDDialogOutput = ({
error,
canvasRef,
loaded,
+ hideErrorDetails,
}: TTDDialogOutputProps) => {
return (
- <div className="ttd-dialog-output-wrapper">
- {error && <ErrorComp error={error.message} />}
+ <div
+ className={`ttd-dialog-output-wrapper ${
+ error ? "ttd-dialog-output-wrapper--error" : ""
+ }`}
+ >
+ {error && (
+ <div
+ key="error"
+ data-testid="ttd-dialog-output-error"
+ className="ttd-dialog-output-error"
+ >
+ <div className="ttd-dialog-output-error-content">
+ <div className="ttd-dialog-output-error-icon">
+ {alertTriangleIcon}
+ </div>
+ <div className="ttd-dialog-output-error-title">
+ {t("ttd.error")}
+ </div>
+ <div className="ttd-dialog-output-error-message">
+ {hideErrorDetails ? t("ttd.errorMermaidSyntax") : error.message}
+ </div>
+ </div>
+ </div>
+ )}
{loaded ? (
<div
- ref={canvasRef}
- style={{ opacity: error ? "0.15" : 1 }}
- className="ttd-dialog-output-canvas-container"
- />
+ key="canvas"
+ className={clsx("ttd-dialog-output-canvas-container", {
+ invisible: !!error,
+ })}
+ >
+ <div ref={canvasRef} className="ttd-dialog-output-canvas-content" />
+ </div>
) : (
<Spinner size="2rem" />
)}
diff --git a/packages/excalidraw/components/TTDDialog/TTDDialogPanel.tsx b/packages/excalidraw/components/TTDDialog/TTDDialogPanel.tsx
index 82aede8ae9..f5f6a15fac 100644
--- a/packages/excalidraw/components/TTDDialog/TTDDialogPanel.tsx
+++ b/packages/excalidraw/components/TTDDialog/TTDDialogPanel.tsx
@@ -1,53 +1,76 @@
import clsx from "clsx";
+import { Fragment } from "react";
+
import { Button } from "../Button";
import Spinner from "../Spinner";
import type { ReactNode } from "react";
-interface TTDDialogPanelProps {
+export type TTDPanelAction = {
label: string;
+ action?: () => void;
+ icon?: ReactNode;
+ variant: "button" | "link" | "rateLimit";
+ disabled?: boolean;
+ className?: string;
+};
+
+interface TTDDialogPanelProps {
+ label?: string | ReactNode;
children: ReactNode;
- panelAction?: {
- label: string;
- action: () => void;
- icon?: ReactNode;
- };
- panelActionDisabled?: boolean;
+ panelActions?: TTDPanelAction[];
onTextSubmitInProgess?: boolean;
renderTopRight?: () => ReactNode;
renderSubmitShortcut?: () => ReactNode;
- renderBottomRight?: () => ReactNode;
+ className?: string;
+ panelActionJustifyContent?:
+ | "flex-start"
+ | "flex-end"
+ | "center"
+ | "space-between"
+ | "space-around"
+ | "space-evenly";
}
export const TTDDialogPanel = ({
label,
children,
- panelAction,
- panelActionDisabled = false,
+ panelActions = [],
onTextSubmitInProgess,
renderTopRight,
renderSubmitShortcut,
- renderBottomRight,
+ className,
+ panelActionJustifyContent = "flex-start",
}: TTDDialogPanelProps) => {
- return (
- <div className="ttd-dialog-panel">
- <div className="ttd-dialog-panel__header">
- <label>{label}</label>
- {renderTopRight?.()}
- </div>
+ const renderPanelAction = (panelAction: TTDPanelAction) => {
+ if (panelAction?.variant === "link") {
+ return (
+ <button
+ className={clsx(
+ "ttd-dialog-panel-action-link",
+ panelAction.className,
+ )}
+ onClick={panelAction.action}
+ disabled={panelAction?.disabled || onTextSubmitInProgess}
+ type="button"
+ >
+ {panelAction.label}
+ {panelAction.icon && (
+ <span className="ttd-dialog-panel-action-link__icon">
+ {panelAction.icon}
+ </span>
+ )}
+ </button>
+ );
+ }
- {children}
- <div
- className={clsx("ttd-dialog-panel-button-container", {
- invisible: !panelAction,
- })}
- style={{ display: "flex", alignItems: "center" }}
- >
+ if (panelAction?.variant === "button") {
+ return (
<Button
- className="ttd-dialog-panel-button"
- onSelect={panelAction ? panelAction.action : () => {}}
- disabled={panelActionDisabled || onTextSubmitInProgess}
+ className={clsx("ttd-dialog-panel-button", panelAction.className)}
+ onSelect={panelAction.action ? panelAction.action : () => {}}
+ disabled={panelAction?.disabled || onTextSubmitInProgess}
>
<div className={clsx({ invisible: onTextSubmitInProgess })}>
{panelAction?.label}
@@ -55,10 +78,46 @@ export const TTDDialogPanel = ({
</div>
{onTextSubmitInProgess && <Spinner />}
</Button>
- {!panelActionDisabled &&
- !onTextSubmitInProgess &&
- renderSubmitShortcut?.()}
- {renderBottomRight?.()}
+ );
+ }
+
+ if (panelAction?.variant === "rateLimit") {
+ return (
+ <div
+ className={clsx(
+ "ttd-dialog-panel__rate-limit",
+ panelAction.className,
+ )}
+ >
+ {panelAction.label}
+ </div>
+ );
+ }
+ };
+
+ return (
+ <div className={clsx("ttd-dialog-panel", className)}>
+ {(label || renderTopRight) && (
+ <div className="ttd-dialog-panel__header">
+ {typeof label === "string" ? <label>{label}</label> : label}
+ {renderTopRight?.()}
+ </div>
+ )}
+ {children}
+ <div
+ className={clsx("ttd-dialog-panel-button-container", {
+ invisible: !panelActions.length,
+ })}
+ style={{
+ justifyContent: panelActionJustifyContent,
+ }}
+ >
+ {panelActions.filter(Boolean).map((panelAction) => (
+ <Fragment key={panelAction.label}>
+ {renderPanelAction(panelAction)}
+ </Fragment>
+ ))}
+ {!onTextSubmitInProgess && renderSubmitShortcut?.()}
</div>
</div>
);
diff --git a/packages/excalidraw/components/TTDDialog/TTDPreviewPanel.tsx b/packages/excalidraw/components/TTDDialog/TTDPreviewPanel.tsx
new file mode 100644
index 0000000000..84bebb4c7f
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/TTDPreviewPanel.tsx
@@ -0,0 +1,47 @@
+import { t } from "../../i18n";
+import { ArrowRightIcon } from "../icons";
+
+import { TTDDialogPanel } from "./TTDDialogPanel";
+import { TTDDialogOutput } from "./TTDDialogOutput";
+
+import type { TTDPanelAction } from "./TTDDialogPanel";
+
+interface TTDPreviewPanelProps {
+ canvasRef: React.RefObject<HTMLDivElement | null>;
+ error: Error | null;
+ loaded: boolean;
+ onInsert: () => void;
+ hideErrorDetails?: boolean;
+}
+
+export const TTDPreviewPanel = ({
+ canvasRef,
+ error,
+ loaded,
+ onInsert,
+ hideErrorDetails,
+}: TTDPreviewPanelProps) => {
+ const actions: TTDPanelAction[] = [
+ {
+ action: onInsert,
+ label: t("chat.insert"),
+ icon: ArrowRightIcon,
+ variant: "button",
+ },
+ ];
+
+ return (
+ <TTDDialogPanel
+ panelActionJustifyContent="flex-end"
+ panelActions={actions}
+ className="ttd-dialog-preview-panel"
+ >
+ <TTDDialogOutput
+ canvasRef={canvasRef}
+ error={error}
+ loaded={loaded}
+ hideErrorDetails={hideErrorDetails}
+ />
+ </TTDDialogPanel>
+ );
+};
diff --git a/packages/excalidraw/components/TTDDialog/TextToDiagram.tsx b/packages/excalidraw/components/TTDDialog/TextToDiagram.tsx
new file mode 100644
index 0000000000..390f2f00fb
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/TextToDiagram.tsx
@@ -0,0 +1,244 @@
+import { useRef } from "react";
+
+import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
+
+import { useAtom, useAtomValue } from "../../editor-jotai";
+
+import { useApp, useExcalidrawSetAppState } from "../App";
+
+import { useChatAgent } from "./Chat";
+
+import {
+ convertMermaidToExcalidraw,
+ insertToEditor,
+ saveMermaidDataToStorage,
+} from "./common";
+import { errorAtom, chatHistoryAtom, showPreviewAtom } from "./TTDContext";
+
+import { useTTDChatStorage } from "./useTTDChatStorage";
+import { useMermaidRenderer } from "./hooks/useMermaidRenderer";
+import { useTextGeneration } from "./hooks/useTextGeneration";
+import { useChatManagement } from "./hooks/useChatManagement";
+import { TTDChatPanel } from "./Chat/TTDChatPanel";
+import { TTDPreviewPanel } from "./TTDPreviewPanel";
+
+import { getLastAssistantMessage } from "./utils/chat";
+
+import type { BinaryFiles } from "../../types";
+import type { MermaidToExcalidrawLibProps, TChat, TTTDDialog } from "./types";
+
+const TextToDiagramContent = ({
+ mermaidToExcalidrawLib,
+ onTextSubmit,
+ renderWarning,
+}: {
+ mermaidToExcalidrawLib: MermaidToExcalidrawLibProps;
+ onTextSubmit: (
+ props: TTTDDialog.OnTextSubmitProps,
+ ) => Promise<TTTDDialog.OnTextSubmitRetValue>;
+ renderWarning?: TTTDDialog.renderWarning;
+}) => {
+ const app = useApp();
+ const setAppState = useExcalidrawSetAppState();
+
+ const canvasRef = useRef<HTMLDivElement | null>(null);
+ const [error, setError] = useAtom(errorAtom);
+ const [chatHistory, setChatHistory] = useAtom(chatHistoryAtom);
+ const showPreview = useAtomValue(showPreviewAtom);
+
+ const { savedChats } = useTTDChatStorage();
+
+ const lastAssistantMessage = getLastAssistantMessage(chatHistory);
+
+ const { setLastRetryAttempt } = useChatAgent();
+
+ const { data } = useMermaidRenderer({
+ canvasRef,
+ mermaidToExcalidrawLib,
+ });
+
+ const { onGenerate, handleAbort } = useTextGeneration({
+ onTextSubmit,
+ });
+
+ const {
+ isMenuOpen,
+ onRestoreChat,
+ handleDeleteChat,
+ handleNewChat,
+ handleMenuToggle,
+ handleMenuClose,
+ } = useChatManagement();
+
+ const onViewAsMermaid = () => {
+ if (typeof lastAssistantMessage?.content === "string") {
+ saveMermaidDataToStorage(lastAssistantMessage.content);
+ setAppState({
+ openDialog: { name: "ttd", tab: "mermaid" },
+ });
+ }
+ };
+
+ const handleMermaidTabClick = (message: TChat.ChatMessage) => {
+ const mermaidContent = message.content || "";
+ if (mermaidContent) {
+ saveMermaidDataToStorage(mermaidContent);
+ setAppState({
+ openDialog: { name: "ttd", tab: "mermaid" },
+ });
+ }
+ };
+
+ const handleInsertMessage = async (message: TChat.ChatMessage) => {
+ const mermaidContent = message.content || "";
+ if (!mermaidContent.trim() || !mermaidToExcalidrawLib.loaded) {
+ return;
+ }
+
+ const tempDataRef = {
+ current: {
+ elements: [] as readonly NonDeletedExcalidrawElement[],
+ files: null as BinaryFiles | null,
+ },
+ };
+
+ const result = await convertMermaidToExcalidraw({
+ canvasRef,
+ data: tempDataRef,
+ mermaidToExcalidrawLib,
+ setError,
+ mermaidDefinition: mermaidContent,
+ theme: app.state.theme,
+ });
+
+ if (result.success) {
+ insertToEditor({
+ app,
+ data: tempDataRef,
+ text: mermaidContent,
+ shouldSaveMermaidDataToStorage: true,
+ });
+ }
+ };
+
+ const handleAiRepairClick = async (message: TChat.ChatMessage) => {
+ const mermaidContent = message.content || "";
+ const errorMessage = message.error || "";
+
+ if (!mermaidContent) {
+ return;
+ }
+
+ const repairPrompt = `Fix the error in this Mermaid diagram. The diagram is:\n\n\`\`\`mermaid\n${mermaidContent}\n\`\`\`\n\nThe exception/error is: ${errorMessage}\n\nPlease fix the Mermaid syntax and regenerate a valid diagram.`;
+
+ await onGenerate(repairPrompt, true);
+ };
+
+ const handleRetry = async (message: TChat.ChatMessage) => {
+ const messageIndex = chatHistory.messages.findIndex(
+ (msg) => msg.id === message.id,
+ );
+
+ if (messageIndex > 0) {
+ const previousMessage = chatHistory.messages[messageIndex - 1];
+ if (previousMessage.type === "user" && previousMessage.content) {
+ setLastRetryAttempt();
+ await onGenerate(previousMessage.content, true);
+ }
+ }
+ };
+
+ const handleInsertToEditor = () => {
+ insertToEditor({ app, data });
+ };
+
+ const handleDeleteMessage = (messageId: string) => {
+ const assistantMessageIndex = chatHistory.messages.findIndex(
+ (msg) => msg.id === messageId && msg.type === "assistant",
+ );
+
+ const remainingMessages = chatHistory.messages.slice(
+ 0,
+ assistantMessageIndex - 1,
+ );
+
+ setChatHistory({
+ ...chatHistory,
+ messages: remainingMessages,
+ });
+ };
+
+ const handlePromptChange = (newPrompt: string) => {
+ setChatHistory((prev) => ({
+ ...prev,
+ currentPrompt: newPrompt,
+ }));
+ };
+
+ return (
+ <div
+ className={`ttd-dialog-layout ${
+ showPreview
+ ? "ttd-dialog-layout--split"
+ : "ttd-dialog-layout--chat-only"
+ }`}
+ >
+ <TTDChatPanel
+ chatId={chatHistory.id}
+ messages={chatHistory.messages}
+ currentPrompt={chatHistory.currentPrompt}
+ onPromptChange={handlePromptChange}
+ onSendMessage={onGenerate}
+ isGenerating={lastAssistantMessage?.isGenerating ?? false}
+ generatedResponse={lastAssistantMessage?.content}
+ isMenuOpen={isMenuOpen}
+ onMenuToggle={handleMenuToggle}
+ onMenuClose={handleMenuClose}
+ onNewChat={handleNewChat}
+ onRestoreChat={onRestoreChat}
+ onDeleteChat={handleDeleteChat}
+ savedChats={savedChats}
+ activeSessionId={chatHistory.id}
+ onAbort={handleAbort}
+ onMermaidTabClick={handleMermaidTabClick}
+ onAiRepairClick={handleAiRepairClick}
+ onDeleteMessage={handleDeleteMessage}
+ onInsertMessage={handleInsertMessage}
+ onRetry={handleRetry}
+ onViewAsMermaid={onViewAsMermaid}
+ renderWarning={renderWarning}
+ />
+ {showPreview && (
+ <TTDPreviewPanel
+ canvasRef={canvasRef}
+ hideErrorDetails={lastAssistantMessage?.errorType === "parse"}
+ error={error}
+ loaded={mermaidToExcalidrawLib.loaded}
+ onInsert={handleInsertToEditor}
+ />
+ )}
+ </div>
+ );
+};
+
+export const TextToDiagram = ({
+ mermaidToExcalidrawLib,
+ onTextSubmit,
+ renderWarning,
+}: {
+ mermaidToExcalidrawLib: MermaidToExcalidrawLibProps;
+ onTextSubmit(
+ props: TTTDDialog.OnTextSubmitProps,
+ ): Promise<TTTDDialog.OnTextSubmitRetValue>;
+ renderWarning?: TTTDDialog.renderWarning;
+}) => {
+ return (
+ <TextToDiagramContent
+ mermaidToExcalidrawLib={mermaidToExcalidrawLib}
+ onTextSubmit={onTextSubmit}
+ renderWarning={renderWarning}
+ />
+ );
+};
+
+export default TextToDiagram;
diff --git a/packages/excalidraw/components/TTDDialog/common.ts b/packages/excalidraw/components/TTDDialog/common.ts
index 998de10fb5..f00f409132 100644
--- a/packages/excalidraw/components/TTDDialog/common.ts
+++ b/packages/excalidraw/components/TTDDialog/common.ts
@@ -1,18 +1,22 @@
import { DEFAULT_EXPORT_PADDING, EDITOR_LS_KEYS } from "@excalidraw/common";
-import type { MermaidConfig } from "@excalidraw/mermaid-to-excalidraw";
-import type { MermaidToExcalidrawResult } from "@excalidraw/mermaid-to-excalidraw/dist/interfaces";
-
-import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
+import type {
+ NonDeletedExcalidrawElement,
+ Theme,
+} from "@excalidraw/element/types";
import { EditorLocalStorage } from "../../data/EditorLocalStorage";
-import { canvasToBlob } from "../../data/blob";
-import { t } from "../../i18n";
-import { convertToExcalidrawElements, exportToCanvas } from "../../index";
+import {
+ convertToExcalidrawElements,
+ exportToCanvas,
+ THEME,
+} from "../../index";
+
+import type { MermaidToExcalidrawLibProps } from "./types";
import type { AppClassProperties, BinaryFiles } from "../../types";
-const resetPreview = ({
+export const resetPreview = ({
canvasRef,
setError,
}: {
@@ -33,17 +37,14 @@ const resetPreview = ({
canvasNode.replaceChildren();
};
-export interface MermaidToExcalidrawLibProps {
- loaded: boolean;
- api: Promise<{
- parseMermaidToExcalidraw: (
- definition: string,
- config?: MermaidConfig,
- ) => Promise<MermaidToExcalidrawResult>;
- }>;
-}
-
-interface ConvertMermaidToExcalidrawFormatProps {
+export const convertMermaidToExcalidraw = async ({
+ canvasRef,
+ mermaidToExcalidrawLib,
+ mermaidDefinition,
+ setError,
+ data,
+ theme,
+}: {
canvasRef: React.RefObject<HTMLDivElement | null>;
mermaidToExcalidrawLib: MermaidToExcalidrawLibProps;
mermaidDefinition: string;
@@ -52,38 +53,36 @@ interface ConvertMermaidToExcalidrawFormatProps {
elements: readonly NonDeletedExcalidrawElement[];
files: BinaryFiles | null;
}>;
-}
-
-export const convertMermaidToExcalidraw = async ({
- canvasRef,
- mermaidToExcalidrawLib,
- mermaidDefinition,
- setError,
- data,
-}: ConvertMermaidToExcalidrawFormatProps) => {
+ theme: Theme;
+}): Promise<{ success: true } | { success: false; error?: Error }> => {
const canvasNode = canvasRef.current;
const parent = canvasNode?.parentElement;
if (!canvasNode || !parent) {
- return;
+ return { success: false };
}
if (!mermaidDefinition) {
resetPreview({ canvasRef, setError });
- return;
+ return { success: false };
}
+ let ret;
try {
const api = await mermaidToExcalidrawLib.api;
- let ret;
try {
- ret = await api.parseMermaidToExcalidraw(mermaidDefinition);
- } catch (err: any) {
- ret = await api.parseMermaidToExcalidraw(
- mermaidDefinition.replace(/"/g, "'"),
- );
+ try {
+ ret = await api.parseMermaidToExcalidraw(mermaidDefinition);
+ } catch (err: unknown) {
+ ret = await api.parseMermaidToExcalidraw(
+ mermaidDefinition.replace(/"/g, "'"),
+ );
+ }
+ } catch (err: unknown) {
+ return { success: false, error: err as Error };
}
+
const { elements, files } = ret;
setError(null);
@@ -102,34 +101,23 @@ export const convertMermaidToExcalidraw = async ({
Math.max(parent.offsetWidth, parent.offsetHeight) *
window.devicePixelRatio,
appState: {
- // TODO hack (will be refactored in TTD v2)
- exportWithDarkMode: document
- .querySelector(".excalidraw-container")
- ?.classList.contains("theme--dark"),
+ exportWithDarkMode: theme === THEME.DARK,
},
});
- // if converting to blob fails, there's some problem that will
- // likely prevent preview and export (e.g. canvas too big)
- try {
- await canvasToBlob(canvas);
- } catch (e: any) {
- if (e.name === "CANVAS_POSSIBLY_TOO_BIG") {
- throw new Error(t("canvasError.canvasTooBig"));
- }
- throw e;
- }
+
parent.style.background = "var(--default-bg-color)";
canvasNode.replaceChildren(canvas);
+ return { success: true };
} catch (err: any) {
parent.style.background = "var(--default-bg-color)";
if (mermaidDefinition) {
setError(err);
}
- throw err;
+ // Return error so caller can display meaningful error message
+ return { success: false, error: err };
}
};
-
export const saveMermaidDataToStorage = (mermaidDefinition: string) => {
EditorLocalStorage.set(
EDITOR_LS_KEYS.MERMAID_TO_EXCALIDRAW,
diff --git a/packages/excalidraw/components/TTDDialog/hooks/useChatManagement.ts b/packages/excalidraw/components/TTDDialog/hooks/useChatManagement.ts
new file mode 100644
index 0000000000..fb563ce2b2
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/hooks/useChatManagement.ts
@@ -0,0 +1,95 @@
+import { useState } from "react";
+
+import { useAtom, useSetAtom } from "../../../editor-jotai";
+
+import { errorAtom, chatHistoryAtom } from "../TTDContext";
+
+import { useTTDChatStorage } from "../useTTDChatStorage";
+
+import { getLastAssistantMessage } from "../utils/chat";
+
+import type { SavedChat } from "../types";
+
+export const useChatManagement = () => {
+ const setError = useSetAtom(errorAtom);
+ const [chatHistory, setChatHistory] = useAtom(chatHistoryAtom);
+ const [isMenuOpen, setIsMenuOpen] = useState(false);
+
+ const { restoreChat, deleteChat, createNewChatId } = useTTDChatStorage();
+
+ const resetChatState = () => {
+ const newSessionId = createNewChatId();
+ setChatHistory({
+ id: newSessionId,
+ messages: [],
+ currentPrompt: "",
+ });
+ setError(null);
+ };
+
+ const applyChatToState = (chat: SavedChat) => {
+ const restoredMessages = chat.messages.map((msg) => ({
+ ...msg,
+ timestamp:
+ msg.timestamp instanceof Date ? msg.timestamp : new Date(msg.timestamp),
+ }));
+
+ const history = {
+ id: chat.id,
+ messages: restoredMessages,
+ currentPrompt: "",
+ };
+
+ const lastAssistantMsg = getLastAssistantMessage(history);
+
+ setError(
+ lastAssistantMsg?.error ? new Error(lastAssistantMsg?.error) : null,
+ );
+ setChatHistory(history);
+ };
+
+ const onRestoreChat = (chat: SavedChat) => {
+ const restoredChat = restoreChat(chat);
+ applyChatToState(restoredChat);
+
+ setIsMenuOpen(false);
+ };
+
+ const handleDeleteChat = (chatId: string, event: React.MouseEvent) => {
+ event.stopPropagation();
+
+ const isDeletingActiveChat = chatId === chatHistory.id;
+ const updatedChats = deleteChat(chatId);
+
+ if (isDeletingActiveChat) {
+ if (updatedChats.length > 0) {
+ const nextChat = updatedChats[0];
+ applyChatToState(nextChat);
+ } else {
+ resetChatState();
+ }
+ }
+ };
+
+ const handleNewChat = () => {
+ resetChatState();
+ setIsMenuOpen(false);
+ };
+
+ const handleMenuToggle = () => {
+ setIsMenuOpen((prev) => !prev);
+ };
+
+ const handleMenuClose = () => {
+ setIsMenuOpen(false);
+ };
+
+ return {
+ isMenuOpen,
+ onRestoreChat,
+ handleDeleteChat,
+ handleNewChat,
+ handleMenuToggle,
+ handleMenuClose,
+ };
+};
diff --git a/packages/excalidraw/components/TTDDialog/hooks/useMermaidRenderer.ts b/packages/excalidraw/components/TTDDialog/hooks/useMermaidRenderer.ts
new file mode 100644
index 0000000000..a554a5b257
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/hooks/useMermaidRenderer.ts
@@ -0,0 +1,218 @@
+import { useCallback, useEffect, useMemo, useRef } from "react";
+
+import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
+
+import { useAtom } from "../../../editor-jotai";
+
+import { chatHistoryAtom, errorAtom, showPreviewAtom } from "../TTDContext";
+import { convertMermaidToExcalidraw } from "../common";
+import { isValidMermaidSyntax } from "../utils/mermaidValidation";
+
+import { getLastAssistantMessage } from "../utils/chat";
+
+import { useUIAppState } from "../../../context/ui-appState";
+
+import type { BinaryFiles } from "../../../types";
+import type { MermaidToExcalidrawLibProps } from "../types";
+
+const FAST_THROTTLE_DELAY = 300;
+const SLOW_THROTTLE_DELAY = 3000;
+const RENDER_SPEED_THRESHOLD = 100;
+const PARSE_FAIL_DELAY = 100;
+
+interface UseMermaidRendererProps {
+ mermaidToExcalidrawLib: MermaidToExcalidrawLibProps;
+ canvasRef: React.RefObject<HTMLDivElement | null>;
+}
+
+export const useMermaidRenderer = ({
+ mermaidToExcalidrawLib,
+ canvasRef,
+}: UseMermaidRendererProps) => {
+ const [chatHistory] = useAtom(chatHistoryAtom);
+ const [, setError] = useAtom(errorAtom);
+
+ const [showPreview, setShowPreview] = useAtom(showPreviewAtom);
+ const isRenderingRef = useRef(false);
+
+ const lastAssistantMessage = useMemo(
+ () => getLastAssistantMessage(chatHistory),
+ [chatHistory],
+ );
+
+ // Keeping lastAssistantMesssage in ref, so I can access it in useEffect hooks
+ const lastAssistantMessageRef = useRef(lastAssistantMessage);
+ useEffect(() => {
+ lastAssistantMessageRef.current = lastAssistantMessage;
+ }, [lastAssistantMessage]);
+
+ const data = useRef<{
+ elements: readonly NonDeletedExcalidrawElement[];
+ files: BinaryFiles | null;
+ }>({
+ elements: [],
+ files: null,
+ });
+
+ const lastRenderTimeRef = useRef(0);
+ const pendingContentRef = useRef<string | null>(null);
+ const hasErrorOffsetRef = useRef(false);
+ const currentThrottleDelayRef = useRef(FAST_THROTTLE_DELAY);
+
+ const { theme } = useUIAppState();
+
+ const renderMermaid = useCallback(
+ async (mermaidDefinition: string): Promise<boolean> => {
+ if (!mermaidDefinition.trim() || !mermaidToExcalidrawLib.loaded) {
+ return false;
+ }
+
+ if (isRenderingRef.current) {
+ return false;
+ }
+
+ isRenderingRef.current = true;
+
+ const renderStartTime = performance.now();
+
+ const result = await convertMermaidToExcalidraw({
+ canvasRef,
+ data,
+ mermaidToExcalidrawLib,
+ setError,
+ mermaidDefinition,
+ theme,
+ });
+
+ const renderDuration = performance.now() - renderStartTime;
+
+ if (renderDuration < RENDER_SPEED_THRESHOLD) {
+ currentThrottleDelayRef.current = FAST_THROTTLE_DELAY;
+ } else {
+ currentThrottleDelayRef.current = SLOW_THROTTLE_DELAY;
+ }
+
+ isRenderingRef.current = false;
+ return result.success;
+ },
+ [canvasRef, mermaidToExcalidrawLib, setError, theme],
+ );
+
+ const throttledRenderMermaid = useMemo(() => {
+ const fn = async (content: string) => {
+ const now = Date.now();
+ const timeSinceLastRender = now - lastRenderTimeRef.current;
+ const throttleDelay = currentThrottleDelayRef.current;
+
+ if (!isValidMermaidSyntax(content)) {
+ if (!hasErrorOffsetRef.current) {
+ lastRenderTimeRef.current = Math.max(
+ lastRenderTimeRef.current,
+ now - throttleDelay + PARSE_FAIL_DELAY,
+ );
+ hasErrorOffsetRef.current = true;
+ }
+ pendingContentRef.current = content;
+ return;
+ }
+
+ hasErrorOffsetRef.current = false;
+
+ if (timeSinceLastRender < throttleDelay) {
+ pendingContentRef.current = content;
+ return;
+ }
+
+ pendingContentRef.current = null;
+ const success = await renderMermaid(content);
+ lastRenderTimeRef.current = Date.now();
+
+ if (!success) {
+ lastRenderTimeRef.current =
+ lastRenderTimeRef.current - throttleDelay + PARSE_FAIL_DELAY;
+ hasErrorOffsetRef.current = true;
+ }
+ };
+
+ fn.flush = async () => {
+ if (pendingContentRef.current) {
+ const content = pendingContentRef.current;
+ pendingContentRef.current = null;
+ await renderMermaid(content);
+ lastRenderTimeRef.current = Date.now();
+ }
+ };
+
+ fn.cancel = () => {
+ pendingContentRef.current = null;
+ };
+
+ return fn;
+ }, [renderMermaid]);
+
+ const resetThrottleState = useCallback(() => {
+ lastRenderTimeRef.current = 0;
+ pendingContentRef.current = null;
+ hasErrorOffsetRef.current = false;
+ currentThrottleDelayRef.current = FAST_THROTTLE_DELAY;
+ }, []);
+
+ // this hook is responsible for keep rendering during streaming
+ useEffect(() => {
+ if (lastAssistantMessage?.content && lastAssistantMessage?.isGenerating) {
+ throttledRenderMermaid(lastAssistantMessage.content);
+ }
+ }, [
+ throttledRenderMermaid,
+ lastAssistantMessage?.isGenerating,
+ lastAssistantMessage?.content,
+ ]);
+
+ // make sure the last bits are rendered once the streaming is completed
+ useEffect(() => {
+ if (!lastAssistantMessage?.isGenerating) {
+ throttledRenderMermaid.flush();
+ resetThrottleState();
+ }
+ }, [
+ resetThrottleState,
+ throttledRenderMermaid,
+ lastAssistantMessage?.isGenerating,
+ ]);
+
+ // render the last message if the user navigates between the existing chats
+ useEffect(() => {
+ const msg = lastAssistantMessageRef.current;
+ if (!msg?.content || msg.error) {
+ return;
+ }
+
+ if (!showPreview) {
+ return;
+ }
+
+ renderMermaid(msg.content);
+ }, [chatHistory?.id, renderMermaid, showPreview]);
+
+ useEffect(() => {
+ if (
+ !chatHistory.messages?.filter((msg) => msg.type === "assistant").length
+ ) {
+ const canvasNode = canvasRef.current;
+ if (canvasNode) {
+ const parent = canvasNode.parentElement;
+ if (parent) {
+ parent.style.background = "";
+ canvasNode.replaceChildren();
+ }
+ }
+ setShowPreview(false);
+ } else if (!showPreview) {
+ setShowPreview(true);
+ }
+ }, [chatHistory.messages, setShowPreview, canvasRef, showPreview]);
+
+ return {
+ data,
+ };
+};
diff --git a/packages/excalidraw/components/TTDDialog/hooks/useTextGeneration.ts b/packages/excalidraw/components/TTDDialog/hooks/useTextGeneration.ts
new file mode 100644
index 0000000000..e7b1acd21c
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/hooks/useTextGeneration.ts
@@ -0,0 +1,252 @@
+import { useRef } from "react";
+import { parseMermaidToExcalidraw } from "@excalidraw/mermaid-to-excalidraw";
+import { isFiniteNumber } from "@excalidraw/math";
+
+import { useAtom } from "../../../editor-jotai";
+
+import { trackEvent } from "../../../analytics";
+import { t } from "../../../i18n";
+
+import { errorAtom, rateLimitsAtom, chatHistoryAtom } from "../TTDContext";
+import { useChatAgent } from "../Chat";
+
+import {
+ addMessages,
+ getLastAssistantMessage,
+ getMessagesForLLM,
+ removeLastAssistantMessage,
+ updateAssistantContent,
+} from "../utils/chat";
+
+import type { TTTDDialog } from "../types";
+
+const MIN_PROMPT_LENGTH = 3;
+const MAX_PROMPT_LENGTH = 10000;
+
+export const useTextGeneration = ({
+ onTextSubmit,
+}: {
+ onTextSubmit: (
+ props: TTTDDialog.OnTextSubmitProps,
+ ) => Promise<TTTDDialog.OnTextSubmitRetValue>;
+}) => {
+ const [, setError] = useAtom(errorAtom);
+ const [rateLimits, setRateLimits] = useAtom(rateLimitsAtom);
+ const [chatHistory, setChatHistory] = useAtom(chatHistoryAtom);
+
+ const { addUserMessage, addAssistantMessage, setAssistantError } =
+ useChatAgent();
+
+ const streamingAbortControllerRef = useRef<AbortController | null>(null);
+
+ const validatePrompt = (prompt: string): boolean => {
+ if (
+ prompt.length > MAX_PROMPT_LENGTH ||
+ prompt.length < MIN_PROMPT_LENGTH ||
+ rateLimits?.rateLimitRemaining === 0
+ ) {
+ if (prompt.length < MIN_PROMPT_LENGTH) {
+ setError(
+ new Error(
+ t("chat.errors.promptTooShort", { min: MIN_PROMPT_LENGTH }),
+ ),
+ );
+ }
+ if (prompt.length > MAX_PROMPT_LENGTH) {
+ setError(
+ new Error(t("chat.errors.promptTooLong", { max: MAX_PROMPT_LENGTH })),
+ );
+ }
+
+ return false;
+ }
+ return true;
+ };
+
+ const getReadableErrorMsg = (msg: string) => {
+ try {
+ const content = JSON.parse(msg);
+
+ const innerMessages = JSON.parse(content.message);
+
+ return innerMessages
+ .map((oneMsg: { message: string }) => oneMsg.message)
+ .join("\n");
+ } catch (err) {
+ return msg;
+ }
+ };
+
+ const handleError = (error: Error, errorType: "parse" | "network") => {
+ if (errorType === "parse") {
+ trackEvent("ai", "mermaid parse failed", "ttd");
+ }
+
+ const msg = getReadableErrorMsg(error.message);
+
+ setAssistantError(msg, errorType);
+ setError(error);
+ };
+
+ const onGenerate = async (
+ promptWithContext: string,
+ isRepairFlow = false,
+ ) => {
+ if (!validatePrompt(promptWithContext)) {
+ return;
+ }
+
+ if (streamingAbortControllerRef.current) {
+ streamingAbortControllerRef.current.abort();
+ }
+
+ setError(null);
+
+ const abortController = new AbortController();
+ streamingAbortControllerRef.current = abortController;
+
+ if (!isRepairFlow) {
+ addUserMessage(promptWithContext);
+ addAssistantMessage();
+ } else {
+ const lastAsisstantMessage = getLastAssistantMessage(chatHistory);
+
+ if (lastAsisstantMessage?.errorType === "network") {
+ setChatHistory((prev) =>
+ updateAssistantContent(prev, {
+ isGenerating: true,
+ error: undefined,
+ errorType: undefined,
+ errorDetails: undefined,
+ }),
+ );
+ }
+ }
+
+ try {
+ trackEvent("ai", "generate", "ttd");
+
+ const previousMessages = getMessagesForLLM(chatHistory);
+
+ const { generatedResponse, error, rateLimit, rateLimitRemaining } =
+ await onTextSubmit({
+ messages: [
+ ...previousMessages.slice(-3),
+ { role: "user", content: promptWithContext },
+ ],
+ onStreamCreated: () => {
+ if (isRepairFlow) {
+ setChatHistory((prev) =>
+ updateAssistantContent(prev, {
+ content: "",
+ error: "",
+ isGenerating: true,
+ }),
+ );
+ }
+ },
+ onChunk: (chunk: string) => {
+ setChatHistory((prev) => {
+ const lastAssistantMessage = getLastAssistantMessage(prev);
+ return updateAssistantContent(prev, {
+ content: lastAssistantMessage.content + chunk,
+ });
+ });
+ },
+ signal: abortController.signal,
+ });
+
+ setChatHistory((prev) =>
+ updateAssistantContent(prev, {
+ isGenerating: false,
+ }),
+ );
+
+ if (isFiniteNumber(rateLimit) && isFiniteNumber(rateLimitRemaining)) {
+ setRateLimits({ rateLimit, rateLimitRemaining });
+ }
+
+ if (error) {
+ const isAborted =
+ error.name === "AbortError" ||
+ error.message === "Aborted" ||
+ abortController.signal.aborted;
+
+ // do nothing if the request was aborted by the user
+ if (isAborted) {
+ return;
+ }
+
+ if (error.status === 429) {
+ setChatHistory((prev) => {
+ const chatHistory = removeLastAssistantMessage(prev);
+
+ return {
+ ...chatHistory,
+ messages: chatHistory.messages.filter(
+ (msg) =>
+ msg.type !== "warning" ||
+ msg.warningType === "rateLimitExceeded" ||
+ msg.warningType === "messageLimitExceeded",
+ ),
+ };
+ });
+
+ setChatHistory((chatHistory) => {
+ return addMessages(chatHistory, [
+ {
+ type: "warning",
+ warningType:
+ rateLimitRemaining === 0
+ ? "messageLimitExceeded"
+ : "rateLimitExceeded",
+ },
+ ]);
+ });
+
+ return;
+ } else if (rateLimitRemaining === 0) {
+ setChatHistory((chatHistory) => {
+ chatHistory = {
+ ...chatHistory,
+ messages: chatHistory.messages.filter(
+ (msg) =>
+ msg.type !== "warning" ||
+ msg.warningType === "rateLimitExceeded" ||
+ msg.warningType === "messageLimitExceeded",
+ ),
+ };
+ return addMessages(chatHistory, [
+ {
+ type: "warning",
+ warningType: "messageLimitExceeded",
+ },
+ ]);
+ });
+ }
+
+ handleError(error as Error, "network");
+ return;
+ }
+
+ await parseMermaidToExcalidraw(generatedResponse ?? "");
+
+ trackEvent("ai", "mermaid parse success", "ttd");
+ } catch (error: unknown) {
+ handleError(error as Error, "parse");
+ } finally {
+ streamingAbortControllerRef.current = null;
+ }
+ };
+
+ const handleAbort = () => {
+ if (streamingAbortControllerRef.current) {
+ streamingAbortControllerRef.current.abort();
+ }
+ };
+
+ return {
+ onGenerate,
+ handleAbort,
+ };
+};
diff --git a/packages/excalidraw/components/TTDDialog/types.ts b/packages/excalidraw/components/TTDDialog/types.ts
new file mode 100644
index 0000000000..3913eb1708
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/types.ts
@@ -0,0 +1,96 @@
+import type { RequestError } from "@excalidraw/excalidraw/errors";
+
+import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
+
+import type { MermaidConfig } from "@excalidraw/mermaid-to-excalidraw";
+
+import type { MermaidToExcalidrawResult } from "@excalidraw/mermaid-to-excalidraw/dist/interfaces";
+
+import type { BinaryFiles } from "../../types";
+
+export type LLMMessage = {
+ role: "user" | "assistant";
+ content: string;
+};
+
+export type MermaidData = {
+ elements: readonly NonDeletedExcalidrawElement[];
+ files: BinaryFiles | null;
+};
+
+export interface RateLimits {
+ rateLimit: number;
+ rateLimitRemaining: number;
+}
+
+export namespace TChat {
+ export type ChatMessage = {
+ id: string;
+ timestamp: Date;
+ isGenerating?: boolean;
+ error?: string;
+ errorDetails?: string;
+ errorType?: "parse" | "network" | "other";
+ lastAttemptAt?: number;
+ type: "user" | "assistant" | "warning";
+ warningType?: /* daily rate limit */
+ "messageLimitExceeded" | /* general 429 */ "rateLimitExceeded";
+ content?: string;
+ };
+
+ export type ChatHistory = {
+ id: string;
+ messages: ChatMessage[];
+ currentPrompt: string;
+ };
+}
+
+export interface SavedChat {
+ id: string;
+ title: string;
+ messages: TChat.ChatMessage[];
+ currentPrompt: string;
+ timestamp: number;
+}
+
+export interface MermaidToExcalidrawLibProps {
+ loaded: boolean;
+ api: Promise<{
+ parseMermaidToExcalidraw: (
+ definition: string,
+ config?: MermaidConfig,
+ ) => Promise<MermaidToExcalidrawResult>;
+ }>;
+}
+
+export namespace TTTDDialog {
+ export type OnTextSubmitProps = {
+ messages: LLMMessage[];
+ onChunk?: (chunk: string) => void;
+ onStreamCreated?: () => void;
+ signal?: AbortSignal;
+ };
+
+ export type OnTextSubmitRetValue = {
+ rateLimit?: number | null;
+ rateLimitRemaining?: number | null;
+ } & (
+ | { generatedResponse: string; error: null }
+ | {
+ error: RequestError;
+ generatedResponse?: null;
+ }
+ );
+
+ // TTDDialog props
+ export type onTextSubmit = (
+ props: OnTextSubmitProps,
+ ) => Promise<OnTextSubmitRetValue>;
+
+ /**
+ * return undefined to use default rendering
+ */
+ export type renderWarning = (
+ chatMessage: TChat.ChatMessage,
+ ) => React.ReactNode | undefined;
+}
diff --git a/packages/excalidraw/components/TTDDialog/useTTDChatStorage.ts b/packages/excalidraw/components/TTDDialog/useTTDChatStorage.ts
new file mode 100644
index 0000000000..772e697a3c
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/useTTDChatStorage.ts
@@ -0,0 +1,153 @@
+import { useEffect } from "react";
+import { randomId } from "@excalidraw/common";
+
+import { atom, useAtom } from "../../editor-jotai";
+
+import { chatHistoryAtom } from "./TTDContext";
+
+import type { SavedChat } from "./types";
+
+const TTD_CHATS_STORAGE_KEY = "excalidraw-ttd-chats";
+
+interface UseTTDChatStorageReturn {
+ savedChats: SavedChats;
+ saveCurrentChat: () => void;
+ deleteChat: (chatId: string) => SavedChats;
+ restoreChat: (chat: SavedChat) => SavedChat;
+ createNewChatId: () => string;
+}
+
+type SavedChats = SavedChat[];
+
+const saveChatsToStorage = (chats: SavedChats) => {
+ try {
+ window.localStorage.setItem(TTD_CHATS_STORAGE_KEY, JSON.stringify(chats));
+ } catch (error: any) {
+ console.warn(`Failed to save chats to localStorage: ${error.message}`);
+ }
+};
+
+const loadChatsFromStorage = (): SavedChats => {
+ try {
+ const data = window.localStorage.getItem(TTD_CHATS_STORAGE_KEY);
+ if (data) {
+ return JSON.parse(data) as SavedChats;
+ }
+ } catch (error: any) {
+ console.warn(`Failed to load chats from localStorage: ${error.message}`);
+ }
+ return [];
+};
+
+const generateChatTitle = (firstMessage: string): string => {
+ const trimmed = firstMessage.trim();
+ if (trimmed.length <= 50) {
+ return trimmed;
+ }
+ return `${trimmed.substring(0, 47)}...`;
+};
+
+// Shared atom for saved chats - initialized once from localStorage
+export const savedChatsAtom = atom<SavedChats>(loadChatsFromStorage());
+
+export const useTTDChatStorage = (): UseTTDChatStorageReturn => {
+ const [chatHistory] = useAtom(chatHistoryAtom);
+ const [savedChats, setSavedChats] = useAtom(savedChatsAtom);
+
+ const lastMessageInHistory =
+ chatHistory?.messages[chatHistory?.messages.length - 1];
+
+ const saveCurrentChat = () => {
+ if (chatHistory.messages.length === 0) {
+ return;
+ }
+
+ const firstUserMessage = chatHistory.messages.find(
+ (msg) => msg.type === "user",
+ );
+ if (!firstUserMessage || !firstUserMessage.content) {
+ return;
+ }
+
+ const title = generateChatTitle(firstUserMessage.content);
+
+ const currentSavedChats = loadChatsFromStorage();
+ const existingChat = currentSavedChats.find(
+ (chat) => chat.id === chatHistory.id,
+ );
+
+ const messagesChanged =
+ !existingChat ||
+ existingChat.messages.length !== chatHistory.messages.length ||
+ existingChat.messages.some(
+ (msg, i) =>
+ msg.id !== chatHistory.messages[i]?.id ||
+ msg.content !== chatHistory.messages[i]?.content,
+ );
+
+ const chatToSave: SavedChat = {
+ id: chatHistory.id,
+ title,
+ messages: chatHistory.messages
+ .filter((msg) => msg.type === "user" || msg.type === "assistant")
+ .map((msg) => ({
+ ...msg,
+ timestamp:
+ msg.timestamp instanceof Date
+ ? msg.timestamp
+ : new Date(msg.timestamp),
+ })),
+ currentPrompt: chatHistory.currentPrompt,
+ timestamp: messagesChanged
+ ? Date.now()
+ : existingChat?.timestamp ?? Date.now(),
+ };
+
+ const updatedChats = [
+ ...currentSavedChats.filter((chat) => chat.id !== chatHistory.id),
+ chatToSave,
+ ]
+ .sort((a, b) => b.timestamp - a.timestamp)
+ .slice(0, 10);
+
+ setSavedChats(updatedChats);
+ saveChatsToStorage(updatedChats);
+ };
+
+ useEffect(() => {
+ if (!lastMessageInHistory?.isGenerating) {
+ saveCurrentChat();
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [
+ chatHistory.messages?.length,
+ lastMessageInHistory?.id,
+ lastMessageInHistory?.isGenerating,
+ ]);
+
+ const deleteChat = (chatId: string): SavedChats => {
+ const updatedChats = savedChats.filter((chat) => chat.id !== chatId);
+ setSavedChats(updatedChats);
+ saveChatsToStorage(updatedChats);
+
+ return updatedChats;
+ };
+
+ const restoreChat = (chat: SavedChat): SavedChat => {
+ saveCurrentChat();
+ return chat;
+ };
+
+ const createNewChatId = (): string => {
+ saveCurrentChat();
+ return randomId();
+ };
+
+ return {
+ savedChats,
+ saveCurrentChat,
+ deleteChat,
+ restoreChat,
+ createNewChatId,
+ };
+};
diff --git a/packages/excalidraw/components/TTDDialog/utils/TTDStreamFetch.ts b/packages/excalidraw/components/TTDDialog/utils/TTDStreamFetch.ts
new file mode 100644
index 0000000000..3e3d92741e
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/utils/TTDStreamFetch.ts
@@ -0,0 +1,228 @@
+import { RequestError } from "@excalidraw/excalidraw/errors";
+
+import type {
+ LLMMessage,
+ TTTDDialog,
+} from "@excalidraw/excalidraw/components/TTDDialog/types";
+
+interface RateLimitInfo {
+ rateLimit?: number;
+ rateLimitRemaining?: number;
+}
+
+interface StreamingOptions {
+ url: string;
+ messages: readonly LLMMessage[];
+ onChunk?: (chunk: string) => void;
+ extractRateLimits?: boolean;
+ signal?: AbortSignal;
+ onStreamCreated?: () => void;
+}
+
+export type StreamChunk =
+ | {
+ type: "content";
+ delta: string;
+ }
+ | {
+ type: "done";
+ finishReason: "stop" | "length" | "content_filter" | "tool_calls" | null;
+ }
+ | {
+ type: "error";
+ error: {
+ message: string;
+ code?: string;
+ };
+ };
+
+function extractRateLimitHeaders(headers: Headers): RateLimitInfo {
+ const rateLimit = headers.get("X-Ratelimit-Limit");
+ const rateLimitRemaining = headers.get("X-Ratelimit-Remaining");
+
+ return {
+ rateLimit: rateLimit ? parseInt(rateLimit, 10) : undefined,
+ rateLimitRemaining: rateLimitRemaining
+ ? parseInt(rateLimitRemaining, 10)
+ : undefined,
+ };
+}
+
+async function* parseSSEStream(
+ reader: ReadableStreamDefaultReader<Uint8Array>,
+): AsyncGenerator<string, void, unknown> {
+ const decoder = new TextDecoder();
+ let buffer = "";
+
+ try {
+ while (true) {
+ const { done, value } = await reader.read();
+
+ if (done) {
+ break;
+ }
+
+ buffer += decoder.decode(value, { stream: true });
+
+ const lines = buffer.split("\n");
+ buffer = lines.pop() || "";
+
+ for (const line of lines) {
+ const trimmedLine = line.trim();
+ if (!trimmedLine) {
+ continue;
+ }
+
+ if (trimmedLine.startsWith("data: ")) {
+ const data = trimmedLine.slice(6);
+ yield data;
+ }
+ }
+ }
+ } finally {
+ reader.releaseLock();
+ }
+}
+
+export async function TTDStreamFetch(
+ options: StreamingOptions,
+): Promise<TTTDDialog.OnTextSubmitRetValue> {
+ const {
+ url,
+ messages,
+ onChunk,
+ onStreamCreated,
+ extractRateLimits = true,
+ signal,
+ } = options;
+
+ try {
+ let fullResponse = "";
+ let rateLimitInfo: RateLimitInfo = {};
+ let error: RequestError | null = null;
+
+ const response = await fetch(url, {
+ method: "POST",
+ headers: {
+ Accept: "text/event-stream",
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({ messages }),
+ signal,
+ });
+
+ if (extractRateLimits) {
+ rateLimitInfo = extractRateLimitHeaders(response.headers);
+ }
+
+ if (!response.ok) {
+ if (response.status === 429) {
+ return {
+ ...rateLimitInfo,
+ error: new RequestError({
+ message: "Rate limit exceeded",
+ status: 429,
+ }),
+ };
+ }
+
+ const text = await response.text();
+ throw new RequestError({
+ message: text || "Generation failed...",
+ status: response.status,
+ });
+ }
+
+ const reader = response.body?.getReader();
+
+ if (!reader) {
+ throw new RequestError({
+ message: "Couldn't get reader from response body",
+ status: 500,
+ });
+ }
+
+ onStreamCreated?.();
+
+ try {
+ for await (const data of parseSSEStream(reader)) {
+ if (data === "[DONE]") {
+ break;
+ }
+
+ try {
+ const chunk: StreamChunk = JSON.parse(data);
+
+ if (chunk === null) {
+ break;
+ }
+
+ switch (chunk.type) {
+ case "content": {
+ const delta = chunk.delta;
+ if (delta) {
+ fullResponse += delta;
+ onChunk?.(delta);
+ }
+ break;
+ }
+ case "error":
+ error = new RequestError({
+ message: chunk.error.message,
+ status: 500,
+ });
+ break;
+ case "done":
+ break;
+ }
+ } catch (e) {
+ console.warn("Failed to parse SSE data:", data, e);
+ }
+ }
+ } catch (streamError: any) {
+ if (streamError.name === "AbortError") {
+ error = new RequestError({ message: "Request aborted", status: 499 });
+ } else {
+ error = new RequestError({
+ message: streamError.message || "Streaming error",
+ status: 500,
+ });
+ }
+ }
+
+ if (error) {
+ return {
+ ...rateLimitInfo,
+ error,
+ };
+ }
+
+ if (!fullResponse) {
+ return {
+ ...rateLimitInfo,
+ error: new RequestError({
+ message: "Generation failed...",
+ status: response.status,
+ }),
+ };
+ }
+
+ return {
+ generatedResponse: fullResponse,
+ error: null,
+ ...rateLimitInfo,
+ };
+ } catch (err: any) {
+ if (err.name === "AbortError") {
+ return {
+ error: new RequestError({ message: "Request aborted", status: 499 }),
+ };
+ }
+ return {
+ error: new RequestError({
+ message: err.message || "Request failed",
+ status: 500,
+ }),
+ };
+ }
+}
diff --git a/packages/excalidraw/components/TTDDialog/utils/TTDstreamFetch.test.ts b/packages/excalidraw/components/TTDDialog/utils/TTDstreamFetch.test.ts
new file mode 100644
index 0000000000..5ea01b1a3e
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/utils/TTDstreamFetch.test.ts
@@ -0,0 +1,497 @@
+import { vi, describe, it, expect, beforeEach, afterEach } from "vitest";
+
+import { TTDStreamFetch } from "./TTDStreamFetch";
+
+import type { StreamChunk } from "./TTDStreamFetch";
+
+function createMockStream(chunks: string[]): ReadableStream<Uint8Array> {
+ const encoder = new TextEncoder();
+ let index = 0;
+
+ return new ReadableStream({
+ async pull(controller) {
+ if (index < chunks.length) {
+ controller.enqueue(encoder.encode(chunks[index]));
+ index++;
+ } else {
+ controller.close();
+ }
+ },
+ });
+}
+
+const createContentChunkData = (delta: string): string => {
+ const data: StreamChunk & { type: "content" } = { type: "content", delta };
+ return JSON.stringify(data);
+};
+
+const createContentChunk = (delta: string): string => {
+ return `data: ${createContentChunkData(delta)}\n\n`;
+};
+
+const createDataChunk = (data: string): string => {
+ return `data: ${data}\n\n`;
+};
+
+const DONE_CHUNK = "data: [DONE]\n\n";
+
+describe("TTDStreamFetch", () => {
+ let originalFetch: typeof global.fetch;
+
+ beforeEach(() => {
+ originalFetch = global.fetch;
+ });
+
+ afterEach(() => {
+ global.fetch = originalFetch;
+ vi.restoreAllMocks();
+ });
+
+ describe("successful streaming", () => {
+ it("should stream data chunks and return full response", async () => {
+ const chunks: string[] = [];
+ const mockChunks = [
+ createContentChunk("Hello "),
+ createContentChunk("world"),
+ DONE_CHUNK,
+ ];
+
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: true,
+ headers: new Headers(),
+ body: createMockStream(mockChunks),
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ onChunk: (chunk) => chunks.push(chunk),
+ });
+
+ expect(result.generatedResponse).toBe("Hello world");
+ expect(chunks).toEqual(["Hello ", "world"]);
+ expect(result.error).toBeNull();
+ });
+
+ it("should handle multi-line chunks", async () => {
+ const mockChunks = [
+ createContentChunk("Line 1\n"),
+ createContentChunk("Line 2"),
+ DONE_CHUNK,
+ ];
+
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: true,
+ headers: new Headers(),
+ body: createMockStream(mockChunks),
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ });
+
+ expect(result.generatedResponse).toBe("Line 1\nLine 2");
+ });
+
+ it("should call onStreamCreated callback", async () => {
+ const onStreamCreated = vi.fn();
+ const mockChunks = [createContentChunk("test"), DONE_CHUNK];
+
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: true,
+ headers: new Headers(),
+ body: createMockStream(mockChunks),
+ });
+
+ await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ onStreamCreated,
+ });
+
+ expect(onStreamCreated).toHaveBeenCalledTimes(1);
+ });
+
+ it("should handle empty chunks gracefully", async () => {
+ const mockChunks = [
+ createContentChunk(""),
+ createContentChunk("valid"),
+ DONE_CHUNK,
+ ];
+
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: true,
+ headers: new Headers(),
+ body: createMockStream(mockChunks),
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ });
+
+ expect(result.generatedResponse).toBe("valid");
+ });
+
+ it("should handle null chunk as stream termination", async () => {
+ const mockChunks = [
+ createContentChunk("before null"),
+ createDataChunk("null"),
+ createContentChunk("after null"),
+ ];
+
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: true,
+ headers: new Headers(),
+ body: createMockStream(mockChunks),
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ });
+
+ expect(result.generatedResponse).toBe("before null");
+ });
+ });
+
+ describe("rate limit handling", () => {
+ it("should extract rate limit headers when enabled", async () => {
+ const mockChunks = [createContentChunk("test"), DONE_CHUNK];
+
+ const headers = new Headers();
+ headers.set("X-Ratelimit-Limit", "100");
+ headers.set("X-Ratelimit-Remaining", "95");
+
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: true,
+ headers,
+ body: createMockStream(mockChunks),
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ extractRateLimits: true,
+ });
+
+ expect(result.rateLimit).toBe(100);
+ expect(result.rateLimitRemaining).toBe(95);
+ });
+
+ it("should not extract rate limits when disabled", async () => {
+ const mockChunks = [createContentChunk("test"), DONE_CHUNK];
+
+ const headers = new Headers();
+ headers.set("X-Ratelimit-Limit", "100");
+ headers.set("X-Ratelimit-Remaining", "95");
+
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: true,
+ headers,
+ body: createMockStream(mockChunks),
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ extractRateLimits: false,
+ });
+
+ expect(result.rateLimit).toBeUndefined();
+ expect(result.rateLimitRemaining).toBeUndefined();
+ });
+
+ it("should handle missing rate limit headers", async () => {
+ const mockChunks = [createContentChunk("test"), DONE_CHUNK];
+
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: true,
+ headers: new Headers(),
+ body: createMockStream(mockChunks),
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ extractRateLimits: true,
+ });
+
+ expect(result.rateLimit).toBeUndefined();
+ expect(result.rateLimitRemaining).toBeUndefined();
+ });
+
+ it("should return specific error for 429 rate limit", async () => {
+ const headers = new Headers();
+ headers.set("X-Ratelimit-Limit", "100");
+ headers.set("X-Ratelimit-Remaining", "0");
+
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: false,
+ status: 429,
+ headers,
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ });
+
+ expect(result.error).toBeDefined();
+ expect(result.error?.message).toBe("Rate limit exceeded");
+ expect(result.rateLimit).toBe(100);
+ expect(result.rateLimitRemaining).toBe(0);
+ });
+ });
+
+ describe("error handling", () => {
+ it("should handle non-ok response with text", async () => {
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: false,
+ status: 500,
+ headers: new Headers(),
+ text: async () => "Server error occurred",
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ });
+
+ expect(result.error).toBeDefined();
+ expect(result.error?.message).toBe("Server error occurred");
+ });
+
+ it("should handle non-ok response without text", async () => {
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: false,
+ status: 500,
+ headers: new Headers(),
+ text: async () => "",
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ });
+
+ expect(result.error).toBeDefined();
+ expect(result.error?.message).toBe("Generation failed...");
+ });
+
+ it("should handle missing response body", async () => {
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: true,
+ headers: new Headers(),
+ body: null,
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ });
+
+ expect(result.error).toBeDefined();
+ expect(result.error?.message).toBe(
+ "Couldn't get reader from response body",
+ );
+ });
+
+ it("should handle empty response", async () => {
+ const mockChunks = [DONE_CHUNK];
+
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: true,
+ headers: new Headers(),
+ body: createMockStream(mockChunks),
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ });
+
+ expect(result.error).toBeDefined();
+ expect(result.error?.message).toBe("Generation failed...");
+ });
+
+ it("should handle network errors", async () => {
+ global.fetch = vi
+ .fn()
+ .mockRejectedValue(new Error("Network connection failed"));
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ });
+
+ expect(result.error).toBeDefined();
+ expect(result.error?.message).toBe("Network connection failed");
+ });
+
+ it("should handle invalid JSON in stream", async () => {
+ const consoleWarnSpy = vi
+ .spyOn(console, "warn")
+ .mockImplementation(() => {});
+
+ const mockChunks = [
+ createDataChunk("invalid"),
+ createContentChunk("valid"),
+ DONE_CHUNK,
+ ];
+
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: true,
+ headers: new Headers(),
+ body: createMockStream(mockChunks),
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ });
+
+ expect(result.generatedResponse).toBe("valid");
+ expect(consoleWarnSpy).toHaveBeenCalled();
+
+ consoleWarnSpy.mockRestore();
+ });
+ });
+
+ describe("abort handling", () => {
+ it("should handle abort signal during fetch", async () => {
+ const abortController = new AbortController();
+
+ global.fetch = vi.fn().mockImplementation(() => {
+ abortController.abort();
+ const error = new Error("The operation was aborted");
+ error.name = "AbortError";
+ return Promise.reject(error);
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ signal: abortController.signal,
+ });
+
+ expect(result.error).toBeDefined();
+ expect(result.error?.message).toBe("Request aborted");
+ });
+
+ it("should handle abort error thrown during streaming", async () => {
+ // Create a stream that throws an AbortError
+ const stream = new ReadableStream({
+ async pull() {
+ const error = new Error("The operation was aborted");
+ error.name = "AbortError";
+ throw error;
+ },
+ });
+
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: true,
+ headers: new Headers(),
+ body: stream,
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ });
+
+ expect(result.error).toBeDefined();
+ expect(result.error?.message).toBe("Request aborted");
+ });
+ });
+
+ describe("SSE parsing", () => {
+ it("should handle lines without data prefix", async () => {
+ const mockChunks = [
+ ": comment line\n",
+ createContentChunk("valid"),
+ DONE_CHUNK,
+ ];
+
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: true,
+ headers: new Headers(),
+ body: createMockStream(mockChunks),
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ });
+
+ expect(result.generatedResponse).toBe("valid");
+ });
+
+ it("should handle empty lines in stream", async () => {
+ const mockChunks = [
+ createContentChunk("first"),
+ "\n\n",
+ createContentChunk("second"),
+ DONE_CHUNK,
+ ];
+
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: true,
+ headers: new Headers(),
+ body: createMockStream(mockChunks),
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ });
+
+ expect(result.generatedResponse).toBe("firstsecond");
+ });
+
+ it("should handle partial chunks across reads", async () => {
+ // Split an SSE message across multiple chunks
+ const mockChunks = [
+ "data: ",
+ createContentChunkData("partial"),
+ "\n\n",
+ DONE_CHUNK,
+ ];
+
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: true,
+ headers: new Headers(),
+ body: createMockStream(mockChunks),
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ });
+
+ expect(result.generatedResponse).toBe("partial");
+ });
+
+ it("should handle [DONE] marker to terminate stream", async () => {
+ const mockChunks = [
+ createContentChunk("content"),
+ DONE_CHUNK,
+ createContentChunk("should not appear"),
+ ];
+
+ global.fetch = vi.fn().mockResolvedValue({
+ ok: true,
+ headers: new Headers(),
+ body: createMockStream(mockChunks),
+ });
+
+ const result = await TTDStreamFetch({
+ url: "https://api.example.com/stream",
+ messages: [],
+ });
+
+ expect(result.generatedResponse).toBe("content");
+ });
+ });
+});
diff --git a/packages/excalidraw/components/TTDDialog/utils/chat.test.ts b/packages/excalidraw/components/TTDDialog/utils/chat.test.ts
new file mode 100644
index 0000000000..3d0231c6a8
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/utils/chat.test.ts
@@ -0,0 +1,658 @@
+import {
+ addMessages,
+ getLastAssistantMessage,
+ getMessagesForLLM,
+ removeLastAssistantMessage,
+ updateAssistantContent,
+} from "./chat";
+
+import type { TChat } from "../types";
+
+describe("chat utils", () => {
+ describe("updateAssistantContent", () => {
+ it("should update the last assistant message with new payload", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "user",
+ content: "Hello",
+ timestamp: new Date("2024-01-01"),
+ },
+ {
+ id: "2",
+ type: "assistant",
+ content: "Hi there",
+ timestamp: new Date("2024-01-01"),
+ },
+ ],
+ };
+
+ const result = updateAssistantContent(chatHistory, {
+ content: "Hi there, how can I help?",
+ });
+
+ expect(result.messages[1].content).toBe("Hi there, how can I help?");
+ expect(result.messages[1].id).toBe("2"); // ID should remain the same
+ });
+
+ it("should update only the last assistant message when multiple exist", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "assistant",
+ content: "First assistant message",
+ timestamp: new Date("2024-01-01"),
+ },
+ {
+ id: "2",
+ type: "user",
+ content: "User message",
+ timestamp: new Date("2024-01-01"),
+ },
+ {
+ id: "3",
+ type: "assistant",
+ content: "Second assistant message",
+ timestamp: new Date("2024-01-01"),
+ },
+ ],
+ };
+
+ const result = updateAssistantContent(chatHistory, {
+ content: "Updated second message",
+ });
+
+ expect(result.messages[0].content).toBe("First assistant message");
+ expect(result.messages[2].content).toBe("Updated second message");
+ });
+
+ it("should update isGenerating flag", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "assistant",
+ content: "Message",
+ timestamp: new Date("2024-01-01"),
+ isGenerating: false,
+ },
+ ],
+ };
+
+ const result = updateAssistantContent(chatHistory, {
+ isGenerating: true,
+ });
+
+ expect(result.messages[0].isGenerating).toBe(true);
+ });
+
+ it("should update error information", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "assistant",
+ content: "Message",
+ timestamp: new Date("2024-01-01"),
+ },
+ ],
+ };
+
+ const result = updateAssistantContent(chatHistory, {
+ error: "Something went wrong",
+ errorType: "network",
+ });
+
+ expect(result.messages[0].error).toBe("Something went wrong");
+ expect(result.messages[0].errorType).toBe("network");
+ });
+
+ it("should return unchanged chatHistory if no assistant message exists", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "user",
+ content: "Hello",
+ timestamp: new Date("2024-01-01"),
+ },
+ ],
+ };
+
+ const result = updateAssistantContent(chatHistory, {
+ content: "New content",
+ });
+
+ expect(result).toEqual(chatHistory);
+ });
+
+ it("should not mutate original chatHistory", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "assistant",
+ content: "Original",
+ timestamp: new Date("2024-01-01"),
+ },
+ ],
+ };
+
+ const result = updateAssistantContent(chatHistory, {
+ content: "Updated",
+ });
+
+ expect(chatHistory.messages[0].content).toBe("Original");
+ expect(result.messages[0].content).toBe("Updated");
+ });
+ });
+
+ describe("getLastAssistantMessage", () => {
+ it("should return the last assistant message", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "user",
+ content: "Hello",
+ timestamp: new Date("2024-01-01"),
+ },
+ {
+ id: "2",
+ type: "assistant",
+ content: "Hi there",
+ timestamp: new Date("2024-01-01"),
+ },
+ ],
+ };
+
+ const result = getLastAssistantMessage(chatHistory);
+
+ expect(result).toEqual({
+ id: "2",
+ type: "assistant",
+ content: "Hi there",
+ timestamp: new Date("2024-01-01"),
+ });
+ });
+
+ it("should return the last assistant message when multiple exist", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "assistant",
+ content: "First",
+ timestamp: new Date("2024-01-01"),
+ },
+ {
+ id: "2",
+ type: "user",
+ content: "User",
+ timestamp: new Date("2024-01-01"),
+ },
+ {
+ id: "3",
+ type: "assistant",
+ content: "Second",
+ timestamp: new Date("2024-01-01"),
+ },
+ ],
+ };
+
+ const result = getLastAssistantMessage(chatHistory);
+
+ expect(result.id).toBe("3");
+ expect(result.content).toBe("Second");
+ });
+
+ it("should return undefined if no assistant message exists", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "user",
+ content: "Hello",
+ timestamp: new Date("2024-01-01"),
+ },
+ ],
+ };
+
+ const result = getLastAssistantMessage(chatHistory);
+
+ expect(result).toBeUndefined();
+ });
+
+ it("should return undefined for empty messages array", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [],
+ };
+
+ const result = getLastAssistantMessage(chatHistory);
+
+ expect(result).toBeUndefined();
+ });
+ });
+
+ describe("addMessages", () => {
+ it("should add a single message with id and timestamp", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [],
+ };
+
+ const result = addMessages(chatHistory, [
+ {
+ type: "user",
+ content: "Hello",
+ },
+ ]);
+
+ expect(result.messages).toHaveLength(1);
+ expect(result.messages[0]).toMatchObject({
+ type: "user",
+ content: "Hello",
+ });
+ expect(result.messages[0].id).toBeDefined();
+ expect(result.messages[0].timestamp).toBeInstanceOf(Date);
+ });
+
+ it("should add multiple messages", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [],
+ };
+
+ const result = addMessages(chatHistory, [
+ {
+ type: "user",
+ content: "Hello",
+ },
+ {
+ type: "assistant",
+ content: "Hi there",
+ },
+ ]);
+
+ expect(result.messages).toHaveLength(2);
+ expect(result.messages[0].type).toBe("user");
+ expect(result.messages[1].type).toBe("assistant");
+ });
+
+ it("should append to existing messages", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "user",
+ content: "Existing",
+ timestamp: new Date("2024-01-01"),
+ },
+ ],
+ };
+
+ const result = addMessages(chatHistory, [
+ {
+ type: "assistant",
+ content: "New message",
+ },
+ ]);
+
+ expect(result.messages).toHaveLength(2);
+ expect(result.messages[0].content).toBe("Existing");
+ expect(result.messages[1].content).toBe("New message");
+ });
+
+ it("should add warning messages", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [],
+ };
+
+ const result = addMessages(chatHistory, [
+ {
+ type: "warning",
+ },
+ ]);
+
+ expect(result.messages).toHaveLength(1);
+ expect(result.messages[0].type).toBe("warning");
+ });
+
+ it("should preserve additional message properties", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [],
+ };
+
+ const result = addMessages(chatHistory, [
+ {
+ type: "assistant",
+ content: "Message",
+ isGenerating: true,
+ error: "Error text",
+ errorType: "parse",
+ },
+ ]);
+
+ expect(result.messages[0].isGenerating).toBe(true);
+ expect(result.messages[0].error).toBe("Error text");
+ expect(result.messages[0].errorType).toBe("parse");
+ });
+
+ it("should not mutate original chatHistory", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [],
+ };
+
+ const result = addMessages(chatHistory, [
+ {
+ type: "user",
+ content: "Hello",
+ },
+ ]);
+
+ expect(chatHistory.messages).toHaveLength(0);
+ expect(result.messages).toHaveLength(1);
+ });
+
+ it("should generate unique IDs for each message", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [],
+ };
+
+ const result = addMessages(chatHistory, [
+ {
+ type: "user",
+ content: "Message 1",
+ },
+ {
+ type: "assistant",
+ content: "Message 2",
+ },
+ ]);
+
+ expect(result.messages[0].id).not.toBe(result.messages[1].id);
+ });
+ });
+
+ describe("removeLastAssistantMessage", () => {
+ it("should remove the last assistant message", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "user",
+ content: "Hello",
+ timestamp: new Date("2024-01-01"),
+ },
+ {
+ id: "2",
+ type: "assistant",
+ content: "Hi there",
+ timestamp: new Date("2024-01-01"),
+ },
+ {
+ id: "3",
+ type: "user",
+ content: "How are you?",
+ timestamp: new Date("2024-01-01"),
+ },
+ ],
+ };
+
+ const result = removeLastAssistantMessage(chatHistory);
+
+ expect(result.messages).toHaveLength(2);
+ expect(result.messages[0].id).toBe("1");
+ expect(result.messages[1].id).toBe("3");
+ });
+
+ it("should remove only the last assistant message when multiple exist", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "assistant",
+ content: "First",
+ timestamp: new Date("2024-01-01"),
+ },
+ {
+ id: "2",
+ type: "user",
+ content: "User",
+ timestamp: new Date("2024-01-01"),
+ },
+ {
+ id: "3",
+ type: "assistant",
+ content: "Second",
+ timestamp: new Date("2024-01-01"),
+ },
+ ],
+ };
+
+ const result = removeLastAssistantMessage(chatHistory);
+
+ expect(result.messages).toHaveLength(2);
+ expect(result.messages[0].id).toBe("1");
+ expect(result.messages[1].id).toBe("2");
+ });
+
+ it("should return unchanged chatHistory if no assistant message exists", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "user",
+ content: "Hello",
+ timestamp: new Date("2024-01-01"),
+ },
+ ],
+ };
+
+ const result = removeLastAssistantMessage(chatHistory);
+
+ expect(result).toEqual(chatHistory);
+ });
+
+ it("should handle empty messages array", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [],
+ };
+
+ const result = removeLastAssistantMessage(chatHistory);
+
+ expect(result).toEqual(chatHistory);
+ });
+
+ it("should not mutate original chatHistory", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "assistant",
+ content: "Message",
+ timestamp: new Date("2024-01-01"),
+ },
+ ],
+ };
+
+ const result = removeLastAssistantMessage(chatHistory);
+
+ expect(chatHistory.messages).toHaveLength(1);
+ expect(result.messages).toHaveLength(0);
+ });
+ });
+
+ describe("getMessagesForApi", () => {
+ it("should filter out messages with empty content", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "user",
+ content: "",
+ timestamp: new Date("2024-01-01"),
+ },
+ {
+ id: "2",
+ type: "user",
+ content: "Valid question",
+ timestamp: new Date("2024-01-01"),
+ },
+ {
+ id: "3",
+ type: "assistant",
+ content: "",
+ timestamp: new Date("2024-01-01"),
+ },
+ {
+ id: "4",
+ type: "assistant",
+ content: "Valid answer",
+ timestamp: new Date("2024-01-01"),
+ },
+ ],
+ };
+
+ const result = getMessagesForLLM(chatHistory);
+
+ expect(result).toHaveLength(2);
+ expect(result[0].content).toBe("Valid question");
+ expect(result[1].content).toBe("Valid answer");
+ });
+
+ it("should return only user message if no assistant messages", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "user",
+ content: "Question",
+ timestamp: new Date("2024-01-01"),
+ },
+ ],
+ };
+
+ const result = getMessagesForLLM(chatHistory);
+
+ expect(result).toHaveLength(1);
+ expect(result[0]).toEqual({
+ role: "user",
+ content: "Question",
+ });
+ });
+
+ it("should return only assistant messages if no user message", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "assistant",
+ content: "Answer",
+ timestamp: new Date("2024-01-01"),
+ },
+ ],
+ };
+
+ const result = getMessagesForLLM(chatHistory);
+
+ expect(result).toHaveLength(1);
+ expect(result[0]).toEqual({
+ role: "assistant",
+ content: "Answer",
+ });
+ });
+
+ it("should return empty array for empty messages", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [],
+ };
+
+ const result = getMessagesForLLM(chatHistory);
+
+ expect(result).toEqual([]);
+ });
+
+ it("should filter out warning messages", () => {
+ const chatHistory: TChat.ChatHistory = {
+ id: "chat-1",
+ currentPrompt: "",
+ messages: [
+ {
+ id: "1",
+ type: "user",
+ content: "Question",
+ timestamp: new Date("2024-01-01"),
+ },
+ {
+ id: "2",
+ type: "warning",
+ content: "warning",
+ timestamp: new Date("2024-01-01"),
+ },
+ ],
+ };
+
+ const result = getMessagesForLLM(chatHistory);
+
+ expect(result).toHaveLength(1);
+ expect(result[0]).toEqual(
+ expect.objectContaining({
+ role: "user",
+ }),
+ );
+ });
+ });
+});
diff --git a/packages/excalidraw/components/TTDDialog/utils/chat.ts b/packages/excalidraw/components/TTDDialog/utils/chat.ts
new file mode 100644
index 0000000000..5d2c643f92
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/utils/chat.ts
@@ -0,0 +1,91 @@
+import { findLastIndex, randomId } from "@excalidraw/common";
+
+import type { LLMMessage, TChat } from "../types";
+
+export const updateAssistantContent = (
+ chatHistory: TChat.ChatHistory,
+ payload: Partial<TChat.ChatMessage>,
+) => {
+ const { messages } = chatHistory;
+
+ const lastAssistantIndex = findLastIndex(
+ messages,
+ (msg) => msg.type === "assistant",
+ );
+
+ if (lastAssistantIndex === -1) {
+ return chatHistory;
+ }
+
+ const lastMessage = messages[lastAssistantIndex];
+
+ const updatedMessages = messages.slice();
+
+ updatedMessages[lastAssistantIndex] = {
+ ...lastMessage,
+ ...payload,
+ };
+
+ return {
+ ...chatHistory,
+ messages: updatedMessages,
+ };
+};
+
+export const getLastAssistantMessage = (chatHistory: TChat.ChatHistory) => {
+ const { messages } = chatHistory;
+
+ const lastAssistantIndex = findLastIndex(
+ messages,
+ (msg) => msg.type === "assistant",
+ );
+
+ return messages[lastAssistantIndex];
+};
+
+export const addMessages = (
+ chatHistory: TChat.ChatHistory,
+ messages: Array<Omit<TChat.ChatMessage, "id" | "timestamp">>,
+) => {
+ const newMessages: Array<TChat.ChatMessage> = messages.map((message) => ({
+ ...message,
+ id: randomId(),
+ timestamp: new Date(),
+ }));
+
+ return {
+ ...chatHistory,
+ messages: [...chatHistory.messages, ...newMessages],
+ };
+};
+
+export const removeLastAssistantMessage = (chatHistory: TChat.ChatHistory) => {
+ const lastMsgIdx = (chatHistory.messages ?? []).findLastIndex(
+ (msg) => msg.type === "assistant",
+ );
+
+ if (lastMsgIdx !== -1) {
+ return {
+ ...chatHistory,
+ messages: chatHistory.messages.filter((_, idx) => idx !== lastMsgIdx),
+ };
+ }
+ return chatHistory;
+};
+
+export const getMessagesForLLM = (
+ chatHistory: TChat.ChatHistory,
+): LLMMessage[] => {
+ const messages: LLMMessage[] = [];
+
+ for (const msg of chatHistory.messages) {
+ if (msg.content && (msg.type === "user" || msg.type === "assistant")) {
+ messages.push({
+ role: msg.type,
+ content: msg.content,
+ });
+ }
+ }
+
+ return messages;
+};
diff --git a/packages/excalidraw/components/TTDDialog/utils/mermaidValidation.test.ts b/packages/excalidraw/components/TTDDialog/utils/mermaidValidation.test.ts
new file mode 100644
index 0000000000..d9bf8f1e02
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/utils/mermaidValidation.test.ts
@@ -0,0 +1,214 @@
+import { isValidMermaidSyntax } from "./mermaidValidation";
+
+describe("isValidMermaidSyntax", () => {
+ describe("empty and whitespace content", () => {
+ it("should return false for empty string", () => {
+ expect(isValidMermaidSyntax("")).toBe(false);
+ });
+
+ it("should return false for whitespace-only content", () => {
+ expect(isValidMermaidSyntax(" ")).toBe(false);
+ expect(isValidMermaidSyntax("\n\n")).toBe(false);
+ expect(isValidMermaidSyntax("\t\t")).toBe(false);
+ });
+ });
+
+ describe("balanced brackets, braces, and parentheses", () => {
+ it("should return true for content with balanced brackets", () => {
+ expect(isValidMermaidSyntax("flowchart LR\nA[Start]")).toBe(true);
+ expect(isValidMermaidSyntax("A[Node] --> B[End]")).toBe(true);
+ expect(isValidMermaidSyntax("[[nested]]")).toBe(true);
+ });
+
+ it("should return true for content with balanced braces", () => {
+ expect(isValidMermaidSyntax("graph TD\nA{Decision}")).toBe(true);
+ expect(isValidMermaidSyntax("{{nested}}")).toBe(true);
+ });
+
+ it("should return true for content with balanced parentheses", () => {
+ expect(isValidMermaidSyntax("flowchart LR\nA(Round)")).toBe(true);
+ expect(isValidMermaidSyntax("((nested))")).toBe(true);
+ });
+
+ it("should return true for content with multiple balanced delimiters", () => {
+ expect(isValidMermaidSyntax("A[Node] --> B{Decision} --> C(End)")).toBe(
+ true,
+ );
+ expect(
+ isValidMermaidSyntax("flowchart\nA[Start] --> B{Check} --> C(Done)"),
+ ).toBe(true);
+ });
+ });
+
+ describe("unbalanced brackets", () => {
+ it("should return false for single unclosed bracket", () => {
+ expect(isValidMermaidSyntax("flowchart LR\nA[Start")).toBe(false);
+ expect(isValidMermaidSyntax("A[Node")).toBe(false);
+ });
+
+ it("should return false for multiple unclosed brackets", () => {
+ expect(isValidMermaidSyntax("A[Node\nB[Another")).toBe(false);
+ expect(isValidMermaidSyntax("[[[text")).toBe(false);
+ });
+
+ it("should return false when closing brackets outnumber opening brackets", () => {
+ expect(isValidMermaidSyntax("A]")).toBe(false);
+ expect(isValidMermaidSyntax("text]]]")).toBe(false);
+ });
+ });
+
+ describe("unbalanced braces", () => {
+ it("should return false for single unclosed brace", () => {
+ expect(isValidMermaidSyntax("graph TD\nA{Decision")).toBe(false);
+ expect(isValidMermaidSyntax("A{Node")).toBe(false);
+ });
+
+ it("should return false for multiple unclosed braces", () => {
+ expect(isValidMermaidSyntax("A{Node\nB{Another")).toBe(false);
+ expect(isValidMermaidSyntax("{{{text")).toBe(false);
+ });
+
+ it("should return false when closing braces outnumber opening braces", () => {
+ expect(isValidMermaidSyntax("A}")).toBe(false);
+ expect(isValidMermaidSyntax("text}}}")).toBe(false);
+ });
+ });
+
+ describe("unbalanced parentheses", () => {
+ it("should return false for single unclosed parenthesis", () => {
+ expect(isValidMermaidSyntax("flowchart LR\nA(Round")).toBe(false);
+ expect(isValidMermaidSyntax("A(Node")).toBe(false);
+ });
+
+ it("should return false for multiple unclosed parentheses", () => {
+ expect(isValidMermaidSyntax("A(Node\nB(Another")).toBe(false);
+ expect(isValidMermaidSyntax("(((text")).toBe(false);
+ });
+
+ it("should return false when closing parentheses outnumber opening parentheses", () => {
+ expect(isValidMermaidSyntax("A)")).toBe(false);
+ expect(isValidMermaidSyntax("text)))")).toBe(false);
+ });
+ });
+
+ describe("incomplete patterns at end of line", () => {
+ it("should return false for arrow patterns", () => {
+ expect(isValidMermaidSyntax("A -->")).toBe(false);
+ expect(isValidMermaidSyntax("flowchart LR\nA --")).toBe(false);
+ expect(isValidMermaidSyntax("B --.")).toBe(false);
+ expect(isValidMermaidSyntax("C ==>")).toBe(false);
+ expect(isValidMermaidSyntax("D ==")).toBe(false);
+ expect(isValidMermaidSyntax("E ~~")).toBe(false);
+ });
+
+ it("should return false for colon patterns", () => {
+ expect(isValidMermaidSyntax("A::")).toBe(false);
+ expect(isValidMermaidSyntax("B:")).toBe(false);
+ });
+
+ it("should return false for pipe and ampersand patterns", () => {
+ expect(isValidMermaidSyntax("A|")).toBe(false);
+ expect(isValidMermaidSyntax("B&")).toBe(false);
+ });
+
+ it("should return true when incomplete patterns are not at the end", () => {
+ expect(isValidMermaidSyntax("A --> B")).toBe(true);
+ expect(isValidMermaidSyntax("A -- text --> B")).toBe(true);
+ expect(isValidMermaidSyntax("A: complete")).toBe(true);
+ expect(isValidMermaidSyntax("A & B")).toBe(true);
+ expect(isValidMermaidSyntax("A | B")).toBe(true);
+ });
+
+ it("should only check the last line for incomplete patterns", () => {
+ expect(isValidMermaidSyntax("A -->\nB --> C")).toBe(true);
+ expect(isValidMermaidSyntax("A:\nB --> C")).toBe(true);
+ });
+ });
+
+ describe("complex real-world scenarios", () => {
+ it("should return true for valid flowchart", () => {
+ const mermaid = `flowchart TD
+ Start[Start] --> Decision{Is it?}
+ Decision -->|Yes| End1[End 1]
+ Decision -->|No| End2[End 2]`;
+ expect(isValidMermaidSyntax(mermaid)).toBe(true);
+ });
+
+ it("should return true for valid sequence diagram", () => {
+ const mermaid = `sequenceDiagram
+ Alice->>John: Hello John
+ John-->>Alice: Great!`;
+ expect(isValidMermaidSyntax(mermaid)).toBe(true);
+ });
+
+ it("should return false for incomplete flowchart (unclosed bracket)", () => {
+ const mermaid = `flowchart TD
+ Start[Start --> Decision{Is it?}
+ Decision -->|Yes| End[End]`;
+ expect(isValidMermaidSyntax(mermaid)).toBe(false);
+ });
+
+ it("should return false for flowchart with incomplete arrow at end", () => {
+ const mermaid = `flowchart TD
+ Start[Start] --> Decision{Is it?}
+ Decision -->`;
+ expect(isValidMermaidSyntax(mermaid)).toBe(false);
+ });
+
+ it("should return true for diagram with multiple node types", () => {
+ const mermaid = `graph LR
+ A[Square] --> B(Round)
+ B --> C{Diamond}
+ C --> D[Square]`;
+ expect(isValidMermaidSyntax(mermaid)).toBe(true);
+ });
+
+ it("should return false for streaming content that is incomplete", () => {
+ // Simulates partial AI-generated content during streaming
+ expect(isValidMermaidSyntax("flowchart LR\nA[Start] --")).toBe(false);
+ expect(isValidMermaidSyntax("flowchart LR\nA[Start")).toBe(false);
+ expect(isValidMermaidSyntax("graph TD\nA{Decision")).toBe(false);
+ });
+
+ it("should return true for complete multi-line diagram", () => {
+ const mermaid = `graph TB
+ subgraph one
+ a1[First]
+ end
+ subgraph two
+ a2[Second]
+ end
+ a1 --> a2`;
+ expect(isValidMermaidSyntax(mermaid)).toBe(true);
+ });
+ });
+
+ describe("edge cases", () => {
+ it("should handle content with only delimiters", () => {
+ expect(isValidMermaidSyntax("[]")).toBe(true);
+ expect(isValidMermaidSyntax("{}")).toBe(true);
+ expect(isValidMermaidSyntax("()")).toBe(true);
+ expect(isValidMermaidSyntax("[")).toBe(false);
+ expect(isValidMermaidSyntax("{")).toBe(false);
+ expect(isValidMermaidSyntax("(")).toBe(false);
+ });
+
+ it("should handle mixed valid and invalid scenarios", () => {
+ expect(isValidMermaidSyntax("A[B] -->")).toBe(false);
+ expect(isValidMermaidSyntax("A[B --")).toBe(false);
+ expect(isValidMermaidSyntax("A{B:")).toBe(false);
+ });
+
+ it("should handle strings with special characters", () => {
+ expect(isValidMermaidSyntax("A[Node with spaces]")).toBe(true);
+ expect(
+ isValidMermaidSyntax("A[Node with 'quotes' and numbers 123]"),
+ ).toBe(true);
+ });
+
+ it("should trim content before validation", () => {
+ expect(isValidMermaidSyntax(" A[Node] \n")).toBe(true);
+ expect(isValidMermaidSyntax("\n\nA[Node]\n\n")).toBe(true);
+ });
+ });
+});
diff --git a/packages/excalidraw/components/TTDDialog/utils/mermaidValidation.ts b/packages/excalidraw/components/TTDDialog/utils/mermaidValidation.ts
new file mode 100644
index 0000000000..f42fbea580
--- /dev/null
+++ b/packages/excalidraw/components/TTDDialog/utils/mermaidValidation.ts
@@ -0,0 +1,41 @@
+export const isValidMermaidSyntax = (content: string): boolean => {
+ const trimmed = content.trim();
+ if (!trimmed) {
+ return false;
+ }
+
+ const openBrackets = (trimmed.match(/\[/g) || []).length;
+ const closeBrackets = (trimmed.match(/\]/g) || []).length;
+ const openBraces = (trimmed.match(/\{/g) || []).length;
+ const closeBraces = (trimmed.match(/\}/g) || []).length;
+ const openParens = (trimmed.match(/\(/g) || []).length;
+ const closeParens = (trimmed.match(/\)/g) || []).length;
+
+ if (
+ openBrackets !== closeBrackets ||
+ openBraces !== closeBraces ||
+ openParens !== closeParens
+ ) {
+ return false;
+ }
+
+ const lastLine = trimmed.split("\n").pop()?.trim() || "";
+ const incompletePatterns = [
+ /-->$/,
+ /--$/,
+ /-\.$/,
+ /==>$/,
+ /==$/,
+ /~~$/,
+ /::$/,
+ /:$/,
+ /\|$/,
+ /&$/,
+ ];
+
+ if (incompletePatterns.some((pattern) => pattern.test(lastLine))) {
+ return false;
+ }
+
+ return true;
+};
diff --git a/packages/excalidraw/components/dropdownMenu/DropdownMenu.scss b/packages/excalidraw/components/dropdownMenu/DropdownMenu.scss
index 85cab103a7..5d0be65461 100644
--- a/packages/excalidraw/components/dropdownMenu/DropdownMenu.scss
+++ b/packages/excalidraw/components/dropdownMenu/DropdownMenu.scss
@@ -226,6 +226,25 @@
border-color: var(--color-primary);
}
+ &[disabled] {
+ cursor: not-allowed;
+
+ &:hover {
+ --background: var(--color-surface-mid);
+ background-color: var(--background);
+ }
+
+ &:active {
+ border-color: transparent;
+ }
+
+ @at-root .excalidraw.theme--dark#{&} {
+ &:hover {
+ --background: var(--color-surface-high);
+ }
+ }
+ }
+
svg {
width: var(--lg-icon-size);
height: var(--lg-icon-size);
diff --git a/packages/excalidraw/components/icons.tsx b/packages/excalidraw/components/icons.tsx
index 848583d188..8caf6cc163 100644
--- a/packages/excalidraw/components/icons.tsx
+++ b/packages/excalidraw/components/icons.tsx
@@ -1594,26 +1594,18 @@ export const FontFamilyNormalIcon = createIcon(
modifiedTablerIconProps,
);
-export const FontFamilyCodeIcon = createIcon(
- <>
- <g
- clipPath="url(#a)"
- stroke="currentColor"
- strokeWidth="1.25"
- strokeLinecap="round"
- strokeLinejoin="round"
- >
- <path d="M5.833 6.667 2.5 10l3.333 3.333M14.167 6.667 17.5 10l-3.333 3.333M11.667 3.333 8.333 16.667" />
- </g>
- <defs>
- <clipPath id="a">
- <path fill="#fff" d="M0 0h20v20H0z" />
- </clipPath>
- </defs>
- </>,
- modifiedTablerIconProps,
+export const codeIcon = createIcon(
+ <g strokeWidth="1.5">
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path d="M7 8l-4 4l4 4" />
+ <path d="M17 8l4 4l-4 4" />
+ <path d="M14 4l-4 16" />
+ </g>,
+ tablerIconProps,
);
+export const FontFamilyCodeIcon = codeIcon;
+
export const TextAlignLeftIcon = createIcon(
<g
stroke="currentColor"
@@ -1865,6 +1857,27 @@ export const mermaidLogoIcon = createIcon(
/>,
);
+// tabler-icons: refresh
+export const RetryIcon = createIcon(
+ <g strokeWidth="1.5">
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path d="M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4" />
+ <path d="M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4" />
+ </g>,
+ tablerIconProps,
+);
+
+export const stackPushIcon = createIcon(
+ <g>
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path d="M6 10l-2 1l8 4l8 -4l-2 -1" />
+ <path d="M4 15l8 4l8 -4" />
+ <path d="M12 4v7" />
+ <path d="M15 8l-3 3l-3 -3" />
+ </g>,
+ tablerIconProps,
+);
+
export const ArrowRightIcon = createIcon(
<g strokeWidth="1.25">
<path d="M4.16602 10H15.8327" />
@@ -1993,7 +2006,8 @@ export const searchIcon = createIcon(
tablerIconProps,
);
-export const clockIcon = createIcon(
+// clock-bolt
+export const historyCommandIcon = createIcon(
<g strokeWidth={1.5}>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M20.984 12.53a9 9 0 1 0 -7.552 8.355" />
@@ -2003,6 +2017,16 @@ export const clockIcon = createIcon(
tablerIconProps,
);
+// history
+export const historyIcon = createIcon(
+ <g strokeWidth={1.5}>
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path d="M12 8l0 4l2 2" />
+ <path d="M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5" />
+ </g>,
+ tablerIconProps,
+);
+
export const microphoneIcon = createIcon(
<g strokeWidth={1.5}>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
diff --git a/packages/excalidraw/css/theme.scss b/packages/excalidraw/css/theme.scss
index 2dc3164ba2..0ff89bc5b1 100644
--- a/packages/excalidraw/css/theme.scss
+++ b/packages/excalidraw/css/theme.scss
@@ -23,6 +23,7 @@
--input-hover-bg-color: #{$color-gray-1};
--input-label-color: #{$color-gray-7};
--island-bg-color: #ffffff;
+ --island-bg-color-alt: #fff;
--keybinding-color: var(--color-gray-40);
--link-color: #{$color-blue-7};
--overlay-bg-color: #{color.adjust(#fff, $alpha: -0.12)};
@@ -71,6 +72,7 @@
--library-dropdown-shadow: 0px 15px 6px rgba(0, 0, 0, 0.01),
0px 8px 5px rgba(0, 0, 0, 0.05), 0px 4px 4px rgba(0, 0, 0, 0.09),
0px 1px 2px rgba(0, 0, 0, 0.1), 0px 0px 0px rgba(0, 0, 0, 0.1);
+ --chat-msg-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
--space-factor: 0.25rem;
--text-primary-color: var(--color-on-surface);
@@ -198,6 +200,7 @@
--input-hover-bg-color: #181818;
--input-label-color: #{$color-gray-2};
--island-bg-color: #232329;
+ --island-bg-color-alt: hsl(240, 12%, 12%);
--keybinding-color: var(--color-gray-60);
--link-color: #{$color-blue-4};
--overlay-bg-color: #{color.adjust($color-gray-8, $alpha: -0.88)};
diff --git a/packages/excalidraw/errors.ts b/packages/excalidraw/errors.ts
index 20fe694cd2..bb95e25acc 100644
--- a/packages/excalidraw/errors.ts
+++ b/packages/excalidraw/errors.ts
@@ -69,3 +69,22 @@ export class ExcalidrawError extends Error {
this.name = "ExcalidrawError";
}
}
+
+export class RequestError extends Error {
+ public status: number;
+ public data: any;
+ toObject() {
+ return { name: this.name, status: this.status, message: this.message };
+ }
+ constructor({
+ message = "Something went wrong",
+ status = 500,
+ data,
+ }: { message?: string; status?: number; data?: any } = {}) {
+ super();
+ this.name = "RequestError";
+ this.message = message;
+ this.status = status;
+ this.data = data;
+ }
+}
diff --git a/packages/excalidraw/index.tsx b/packages/excalidraw/index.tsx
index 5cd70e661b..19e855f97e 100644
--- a/packages/excalidraw/index.tsx
+++ b/packages/excalidraw/index.tsx
@@ -289,6 +289,7 @@ export { Stats } from "./components/Stats";
export { DefaultSidebar } from "./components/DefaultSidebar";
export { TTDDialog } from "./components/TTDDialog/TTDDialog";
export { TTDDialogTrigger } from "./components/TTDDialog/TTDDialogTrigger";
+export { TTDStreamFetch } from "./components/TTDDialog/utils/TTDStreamFetch";
export { zoomToFitBounds } from "./actions/actionCanvas";
export {
diff --git a/packages/excalidraw/locales/en.json b/packages/excalidraw/locales/en.json
index 233dcfa7a6..d003aaca19 100644
--- a/packages/excalidraw/locales/en.json
+++ b/packages/excalidraw/locales/en.json
@@ -612,7 +612,54 @@
"button": "Insert",
"description": "Currently only <flowchartLink>Flowchart</flowchartLink>,<sequenceLink> Sequence, </sequenceLink> and <classLink>Class </classLink>Diagrams are supported. The other types will be rendered as image in Excalidraw.",
"syntax": "Mermaid Syntax",
- "preview": "Preview"
+ "preview": "Preview",
+ "label": "Mermaid",
+ "inputPlaceholder": "Write Mermaid diagram defintion here..."
+ },
+ "ttd": {
+ "error": "Error!",
+ "errorMermaidSyntax": "Mermaid syntax error"
+ },
+ "chat": {
+ "inputPlaceholder": "Start typing your diagram idea here... ({{shortcut}} for new line)",
+ "inputPlaceholderWithMessages": "Continue refining your diagram...",
+ "rateLimitRemaining": "{{count}} requests left today",
+ "role": {
+ "user": "You",
+ "assistant": "AI Assistant",
+ "system": "System"
+ },
+ "aiBeta": "AI Beta",
+ "label": "Chat",
+ "menu": "Menu",
+ "newChat": "New Chat",
+ "deleteChat": "Delete chat",
+ "deleteMessage": "Delete message",
+ "viewAsMermaid": "View as Mermaid",
+ "placeholder": {
+ "title": "Let's design your diagram",
+ "description": "Describe the diagram you want to create, and we'll generate it for you.",
+ "hint": "At the moment we know Flowchart, Sequence, and Class diagrams."
+ },
+ "preview": "Preview",
+ "insert": "Insert",
+ "retry": "Retry",
+ "errors": {
+ "promptTooShort": "Prompt is too short (min {{min}} characters)",
+ "promptTooLong": "Prompt is too long (max {{max}} characters)",
+ "generationFailed": "Generation failed",
+ "invalidDiagram": "Generated an invalid diagram :(. You may also try a different prompt.",
+ "fixInMermaid": "Edit Mermaid manually →",
+ "aiRepair": "Regenerate (auto-fix) →",
+ "requestAborted": "Request aborted",
+ "requestFailed": "Request failed"
+ },
+ "rateLimit": {
+ "messageLimit": "You've hit your AI limit on the free plan. Try out Excalidraw+ for more or come back tomorrow.",
+ "generalRateLimit": "Hold your horses, you're too fast for us! Please wait a moment before trying again.",
+ "messageLimitInputPlaceholder": "You've reached your message limit"
+ },
+ "upsellBtnLabel": "Upgrade to Plus"
},
"quickSearch": {
"placeholder": "Quick search"
diff --git a/packages/excalidraw/package.json b/packages/excalidraw/package.json
index 87a403e93c..2249ac72cb 100644
--- a/packages/excalidraw/package.json
+++ b/packages/excalidraw/package.json
@@ -83,7 +83,7 @@
"@excalidraw/element": "0.18.0",
"@excalidraw/laser-pointer": "1.3.1",
"@excalidraw/math": "0.18.0",
- "@excalidraw/mermaid-to-excalidraw": "1.1.3",
+ "@excalidraw/mermaid-to-excalidraw": "2.0.0-test2",
"@excalidraw/random-username": "1.1.0",
"@radix-ui/react-popover": "1.1.6",
"@radix-ui/react-tabs": "1.1.3",
diff --git a/packages/excalidraw/tests/__snapshots__/MermaidToExcalidraw.test.tsx.snap b/packages/excalidraw/tests/__snapshots__/MermaidToExcalidraw.test.tsx.snap
index 2943aeee71..1d92ee37e0 100644
--- a/packages/excalidraw/tests/__snapshots__/MermaidToExcalidraw.test.tsx.snap
+++ b/packages/excalidraw/tests/__snapshots__/MermaidToExcalidraw.test.tsx.snap
@@ -1,12 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`Test <MermaidToExcalidraw/> > should open mermaid popup when active tool is mermaid 1`] = `
-"<div class="Modal Dialog ttd-dialog" role="dialog" aria-modal="true" aria-labelledby="dialog-title" data-prevent-outside-click="true"><div class="Modal__background"></div><div class="Modal__content" style="--max-width: 1200px;" tabindex="0"><div class="Island"><div class="Dialog__content"><div dir="ltr" data-orientation="horizontal" class="ttd-dialog-tabs-root"><p class="dialog-mermaid-title">Mermaid to Excalidraw</p><div data-state="active" data-orientation="horizontal" role="tabpanel" aria-labelledby="radix-:r0:-trigger-mermaid" id="radix-:r0:-content-mermaid" tabindex="0" class="ttd-dialog-content" style=""><div class="ttd-dialog-desc">Currently only <a href="https://mermaid.js.org/syntax/flowchart.html">Flowchart</a>,<a href="https://mermaid.js.org/syntax/sequenceDiagram.html"> Sequence, </a> and <a href="https://mermaid.js.org/syntax/classDiagram.html">Class </a>Diagrams are supported. The other types will be rendered as image in Excalidraw.</div><div class="ttd-dialog-panels"><div class="ttd-dialog-panel"><div class="ttd-dialog-panel__header"><label>Mermaid Syntax</label></div><textarea class="ttd-dialog-input" placeholder="Write Mermaid diagram defintion here...">flowchart TD
+"<div class="Modal Dialog ttd-dialog" role="dialog" aria-modal="true" aria-labelledby="dialog-title"><div class="Modal__background"></div><div class="Modal__content" style="--max-width: 1520px;" tabindex="0"><div class="Island"><div class="Dialog__content"><div dir="ltr" data-orientation="horizontal" class="ttd-dialog-tabs-root"><p class="dialog-mermaid-title">Mermaid to Excalidraw</p><div data-state="active" data-orientation="horizontal" role="tabpanel" aria-labelledby="radix-:r0:-trigger-mermaid" id="radix-:r0:-content-mermaid" tabindex="0" class="ttd-dialog-content" style=""><div class="ttd-dialog-desc">Currently only <a href="https://mermaid.js.org/syntax/flowchart.html">Flowchart</a>,<a href="https://mermaid.js.org/syntax/sequenceDiagram.html"> Sequence, </a> and <a href="https://mermaid.js.org/syntax/classDiagram.html">Class </a>Diagrams are supported. The other types will be rendered as image in Excalidraw.</div><div class="ttd-dialog-panels"><div class="ttd-dialog-panel"><textarea class="ttd-dialog-input" placeholder="Write Mermaid diagram defintion here...">flowchart TD
A[Christmas] --&gt;|Get money| B(Go shopping)
B --&gt; C{Let me think}
C --&gt;|One| D[Laptop]
C --&gt;|Two| E[iPhone]
- C --&gt;|Three| F[Car]</textarea><div class="ttd-dialog-panel-button-container invisible" style="display: flex; align-items: center;"><button type="button" class="excalidraw-button ttd-dialog-panel-button"><div class=""></div></button></div></div><div class="ttd-dialog-panel"><div class="ttd-dialog-panel__header"><label>Preview</label></div><div class="ttd-dialog-output-wrapper"><div style="opacity: 1;" class="ttd-dialog-output-canvas-container"><canvas width="89" height="158" dir="ltr"></canvas></div></div><div class="ttd-dialog-panel-button-container" style="display: flex; align-items: center;"><button type="button" class="excalidraw-button ttd-dialog-panel-button"><div class="">Insert<span><svg aria-hidden="true" focusable="false" role="img" viewBox="0 0 20 20" class="" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><g stroke-width="1.25"><path d="M4.16602 10H15.8327"></path><path d="M12.5 13.3333L15.8333 10"></path><path d="M12.5 6.66666L15.8333 9.99999"></path></g></svg></span></div></button><div class="ttd-dialog-submit-shortcut"><div class="ttd-dialog-submit-shortcut__key">Ctrl</div><div class="ttd-dialog-submit-shortcut__key">Enter</div></div></div></div></div></div></div></div></div></div></div>"
+ C --&gt;|Three| F[Car]</textarea><div class="ttd-dialog-panel-button-container invisible" style="justify-content: flex-start;"></div></div><div class="ttd-dialog-panel"><div class="ttd-dialog-output-wrapper "><div class="ttd-dialog-output-canvas-container"><div class="ttd-dialog-output-canvas-content"><canvas width="89" height="158" dir="ltr"></canvas></div></div></div><div class="ttd-dialog-panel-button-container" style="justify-content: flex-start;"><button type="button" class="excalidraw-button ttd-dialog-panel-button"><div class="">Insert<span><svg aria-hidden="true" focusable="false" role="img" viewBox="0 0 20 20" class="" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><g stroke-width="1.25"><path d="M4.16602 10H15.8327"></path><path d="M12.5 13.3333L15.8333 10"></path><path d="M12.5 6.66666L15.8333 9.99999"></path></g></svg></span></div></button><div class="ttd-dialog-submit-shortcut"><div class="ttd-dialog-submit-shortcut__key">Ctrl</div><div class="ttd-dialog-submit-shortcut__key">Enter</div></div></div></div></div></div></div></div></div></div></div>"
`;
exports[`Test <MermaidToExcalidraw/> > should show error in preview when mermaid library throws error 1`] = `
diff --git a/packages/excalidraw/tests/__snapshots__/export.test.tsx.snap b/packages/excalidraw/tests/__snapshots__/export.test.tsx.snap
index f03bea54d3..48cc148196 100644
--- a/packages/excalidraw/tests/__snapshots__/export.test.tsx.snap
+++ b/packages/excalidraw/tests/__snapshots__/export.test.tsx.snap
@@ -7,5 +7,5 @@ exports[`export > export svg-embedded scene > svg-embdedded scene export output
exports[`export > exporting svg containing transformed images > svg export output 1`] = `
"<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 201.06601717798213 261.4213562373095" width="201.06601717798213" height="261.4213562373095"><!-- svg-source:excalidraw --><metadata></metadata><defs><symbol id="image-file_A"><image href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAT4AAAFPCAYAAADURqJUAAAAAXNSR0IArs4c6QAAIABJREFUeF7tnXeYFUXWxl9yzpIkOOSgJF1UEFFEUQHzmhUVEyZEV7/dNQAiuooBMWBARcREEjAgriJZFBMgeWDIMOSBIcfvOcO96wxzQ3dV9b1dt996Hh74o86pU79T96W6q7qqAFhIgARIIGAECgSsv+wuCZAACYDCx0FAAiQQOAIUvsClnB0mARKg8HEMkAAJBI4AhS9wKWeHSYAEKHwcAyRAAoEjQOELXMrZYRIgAQofxwAJkEDgCFD4ApdydpgESIDCxzFAAiQQOAIUvsClnB0mARKg8HEMkAAJBI4AhS9wKWeHSYAEKHwcAyRAAoEjQOELXMrZYRIgAQofxwAJkEDgCFD4ApdydpgESIDCxzFAAiQQOAIUvsClnB0mARKg8HEMkAAJBI4AhS9wKWeHSYAEKHwcAyRAAoEjQOELXMrZYRIgAQofxwAJkEDgCFD4ApdydpgESIDCxzFAAiQQOAIUvsClnB0mARKg8HEMkAAJBI4AhS9wKWeHSYAEKHwcAyRAAoEjQOELXMrZYRIgAQofxwAJkEDgCFD4ApdydpgESIDCxzFAAiQQOAIUvsClnB0mARKg8HEMkAAJBI4AhS9wKWeHSYAEKHwcAyRAAoEjQOELXMrZYRIgAQofxwAJkEDgCFD4ApdydpgESIDCxzFAAiQQOAIUvsClnB0mARKg8HEMkAAJBI4AhS9wKWeHSYAEKHzJHQNNAbQF0A5AIwCVAVQCUB7AFgCbAawHMAvAD6G/9zkMuQuAZgBOBlAXQNWQ/7Ihn+J7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AEQIUPiMY6YQESMAmAhQ+m7LFWEmABIwQoPAZwUgnJEACNhGg8NmULcZKAiRghACFzwhGOiEBErCJAIXPpmwxVhIgASMEKHxGMNIJCZCATQQofDZli7GSAAkYIUDhM4KRTkiABGwiQOGzKVuMlQRIwAgBCp8RjHRCAiRgEwEKn03ZYqwkQAJGCFD4jGCkExIgAZsIUPhsyhZjJQESMEKAwmcEI52QAAnYRIDCZ1O2GCsJkIARAhQ+IxjphARIwCYCFD6bssVYSYAEjBCg8BnBSCckQAI2EaDw2ZQtxkoCJGCEAIXPCEY6IQESsIkAhc+mbDFWEiABIwQofEYw0gkJkIBNBCh8NmWLsZIACRghQOEzgpFOSIAEbCJA4bMpW4yVBEjACAEKnxGMdEICJGATAQqfTdlirCRAAkYIUPiMYKQTEiABmwhQ+GzKFmMlARIwQoDCZwQjnZAACdhEgMJnU7YYKwmQgBECFD4jGOmEBEjAJgIUPpuyxVhJgASMEKDwGcFIJyRAAjYRoPDZlC3GSgIkYIQAhc8IRjohARKwiQCFz6ZsMVYSIAEjBCh8RjDSCQmQgE0EKHw2ZYuxkgAJGCFA4TOCkU5IgARsIkDhsylbjJUESMAIAQqfEYx0QgIkYBMBCp9N2WKsJEACRgj8P/9qkjFpAoX4AAAAAElFTkSuQmCC" preserveAspectRatio="none" width="100%" height="100%"></image></symbol><style class="style-fonts">
- </style></defs><g transform="translate(30.710678118654755 30.710678118654755) rotate(315 50 50)" data-id="id11"><use href="#image-file_A" width="100" height="100" opacity="1"></use></g><g transform="translate(130.71067811865476 30.710678118654755) rotate(45 25 25)" data-id="id12"><use href="#image-file_A" width="50" height="50" opacity="1" transform="translate(25 25) scale(-1 1) translate(-25 -25)"></use></g><g transform="translate(30.710678118654755 130.71067811865476) rotate(45 50 50)" data-id="id13"><use href="#image-file_A" width="100" height="100" opacity="1" transform="translate(50 50) scale(1 -1) translate(-50 -50)"></use></g><g transform="translate(130.71067811865476 130.71067811865476) rotate(315 25 25)" data-id="id14"><use href="#image-file_A" width="50" height="50" opacity="1" transform="translate(25 25) scale(-1 -1) translate(-25 -25)"></use></g></svg>"
+ </style></defs><g transform="translate(30.710678118654755 30.710678118654755) rotate(315 50 50)" data-id="id12"><use href="#image-file_A" width="100" height="100" opacity="1"></use></g><g transform="translate(130.71067811865476 30.710678118654755) rotate(45 25 25)" data-id="id13"><use href="#image-file_A" width="50" height="50" opacity="1" transform="translate(25 25) scale(-1 1) translate(-25 -25)"></use></g><g transform="translate(30.710678118654755 130.71067811865476) rotate(45 50 50)" data-id="id14"><use href="#image-file_A" width="100" height="100" opacity="1" transform="translate(50 50) scale(1 -1) translate(-50 -50)"></use></g><g transform="translate(130.71067811865476 130.71067811865476) rotate(315 25 25)" data-id="id15"><use href="#image-file_A" width="50" height="50" opacity="1" transform="translate(25 25) scale(-1 -1) translate(-25 -25)"></use></g></svg>"
`;
diff --git a/yarn.lock b/yarn.lock
index 76ecf628ac..190c8c7d0e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -15,6 +15,14 @@
"@jridgewell/gen-mapping" "^0.3.5"
"@jridgewell/trace-mapping" "^0.3.24"
+"@antfu/install-pkg@^1.1.0":
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/@antfu/install-pkg/-/install-pkg-1.1.0.tgz#78fa036be1a6081b5a77a5cf59f50c7752b6ba26"
+ integrity sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ==
+ dependencies:
+ package-manager-detector "^1.3.0"
+ tinyexec "^1.0.1"
+
"@apideck/better-ajv-errors@^0.3.1":
version "0.3.6"
resolved "https://registry.yarnpkg.com/@apideck/better-ajv-errors/-/better-ajv-errors-0.3.6.tgz#957d4c28e886a64a8141f7522783be65733ff097"
@@ -1050,10 +1058,42 @@
resolved "https://registry.yarnpkg.com/@braintree/sanitize-url/-/sanitize-url-6.0.2.tgz#6110f918d273fe2af8ea1c4398a88774bb9fc12f"
integrity sha512-Tbsj02wXCbqGmzdnXNk0SOF19ChhRU70BsroIi4Pm6Ehp56in6vch94mfbdQ17DozxkL3BAVjbZ4Qc1a0HFRAg==
-"@braintree/sanitize-url@^6.0.1":
- version "6.0.4"
- resolved "https://registry.yarnpkg.com/@braintree/sanitize-url/-/sanitize-url-6.0.4.tgz#923ca57e173c6b232bbbb07347b1be982f03e783"
- integrity sha512-s3jaWicZd0pkP0jf5ysyHUI/RE7MHos6qlToFcGWXVp+ykHOy77OUMrfbgJ9it2C5bow7OIQwYYaHjk9XlBQ2A==
+"@braintree/sanitize-url@^7.1.1":
+ version "7.1.1"
+ resolved "https://registry.yarnpkg.com/@braintree/sanitize-url/-/sanitize-url-7.1.1.tgz#15e19737d946559289b915e5dad3b4c28407735e"
+ integrity sha512-i1L7noDNxtFyL5DmZafWy1wRVhGehQmzZaz1HiN5e7iylJMSZR7ekOV7NsIqa5qBldlLrsKv4HbgFUVlQrz8Mw==
+
+"@chevrotain/[email protected]":
+ version "11.0.3"
+ resolved "https://registry.yarnpkg.com/@chevrotain/cst-dts-gen/-/cst-dts-gen-11.0.3.tgz#5e0863cc57dc45e204ccfee6303225d15d9d4783"
+ integrity sha512-BvIKpRLeS/8UbfxXxgC33xOumsacaeCKAjAeLyOn7Pcp95HiRbrpl14S+9vaZLolnbssPIUuiUd8IvgkRyt6NQ==
+ dependencies:
+ "@chevrotain/gast" "11.0.3"
+ "@chevrotain/types" "11.0.3"
+ lodash-es "4.17.21"
+
+"@chevrotain/[email protected]":
+ version "11.0.3"
+ resolved "https://registry.yarnpkg.com/@chevrotain/gast/-/gast-11.0.3.tgz#e84d8880323fe8cbe792ef69ce3ffd43a936e818"
+ integrity sha512-+qNfcoNk70PyS/uxmj3li5NiECO+2YKZZQMbmjTqRI3Qchu8Hig/Q9vgkHpI3alNjr7M+a2St5pw5w5F6NL5/Q==
+ dependencies:
+ "@chevrotain/types" "11.0.3"
+ lodash-es "4.17.21"
+
+"@chevrotain/[email protected]":
+ version "11.0.3"
+ resolved "https://registry.yarnpkg.com/@chevrotain/regexp-to-ast/-/regexp-to-ast-11.0.3.tgz#11429a81c74a8e6a829271ce02fc66166d56dcdb"
+ integrity sha512-1fMHaBZxLFvWI067AVbGJav1eRY7N8DDvYCTwGBiE/ytKBgP8azTdgyrKyWZ9Mfh09eHWb5PgTSO8wi7U824RA==
+
+"@chevrotain/[email protected]":
+ version "11.0.3"
+ resolved "https://registry.yarnpkg.com/@chevrotain/types/-/types-11.0.3.tgz#f8a03914f7b937f594f56eb89312b3b8f1c91848"
+ integrity sha512-gsiM3G8b58kZC2HaWR50gu6Y1440cHiJ+i3JUvcp/35JchYejb2+5MVeJK0iKThYpAa/P2PYFV4hoi44HD+aHQ==
+
+"@chevrotain/[email protected]":
+ version "11.0.3"
+ resolved "https://registry.yarnpkg.com/@chevrotain/utils/-/utils-11.0.3.tgz#e39999307b102cff3645ec4f5b3665f5297a2224"
+ integrity sha512-YslZMgtJUyuMbZ+aKvfF3x1f5liK4mWNxghFRv7jqRR9C3R3fAOGTTKvxXDa2Y1s9zSbcpuO0cAxDYsc9SrXoQ==
"@esbuild/[email protected]":
version "0.19.10"
@@ -1452,15 +1492,15 @@
resolved "https://registry.yarnpkg.com/@excalidraw/markdown-to-text/-/markdown-to-text-0.1.2.tgz#1703705e7da608cf478f17bfe96fb295f55a23eb"
integrity sha512-1nDXBNAojfi3oSFwJswKREkFm5wrSjqay81QlyRv2pkITG/XYB5v+oChENVBQLcxQwX4IUATWvXM5BcaNhPiIg==
-"@excalidraw/[email protected]":
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/@excalidraw/mermaid-to-excalidraw/-/mermaid-to-excalidraw-1.1.3.tgz#3204642c99f3d49c2ad41108217a5d493ef7fd09"
- integrity sha512-/50GUWlGotc+FCMX7nM1P1kWm9vNd3fuq38v7upBp9IHqlw6Zmfyj79eG/0vz1heifuYrSW9yzzv0q9jVALzxg==
+"@excalidraw/[email protected]":
+ version "2.0.0-test2"
+ resolved "https://registry.yarnpkg.com/@excalidraw/mermaid-to-excalidraw/-/mermaid-to-excalidraw-2.0.0-test2.tgz#8779c483efd1cd0098e3c234fe81dc1db13bbeb1"
+ integrity sha512-uPGRdYjUzfbpgfKENHXXvDtigj4BXd/7CIQB4hT3LY3wDKlg5G4r5ncCW53eRdCGvesp9gK+0rkwtIToxGPOKQ==
dependencies:
"@excalidraw/markdown-to-text" "0.1.2"
- mermaid "10.9.4"
+ "@mermaid-js/parser" "^0.6.3"
+ mermaid "^11.12.1"
nanoid "4.0.2"
- react-split "^2.0.14"
"@excalidraw/[email protected]":
version "1.0.2"
@@ -1927,6 +1967,20 @@
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
+"@iconify/types@^2.0.0":
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/@iconify/types/-/types-2.0.0.tgz#ab0e9ea681d6c8a1214f30cd741fe3a20cc57f57"
+ integrity sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==
+
+"@iconify/utils@^3.0.1":
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/@iconify/utils/-/utils-3.1.0.tgz#fb41882915f97fee6f91a2fbb8263e8772ca0438"
+ integrity sha512-Zlzem1ZXhI1iHeeERabLNzBHdOa4VhQbqAcOQaMKuTuyZCpwKbC2R4Dd0Zo3g9EAc+Y4fiarO8HIHRAth7+skw==
+ dependencies:
+ "@antfu/install-pkg" "^1.1.0"
+ "@iconify/types" "^2.0.0"
+ mlly "^1.8.0"
+
"@isaacs/cliui@^8.0.2":
version "8.0.2"
resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550"
@@ -1991,6 +2045,13 @@
"@jridgewell/resolve-uri" "^3.1.0"
"@jridgewell/sourcemap-codec" "^1.4.14"
+"@mermaid-js/parser@^0.6.3":
+ version "0.6.3"
+ resolved "https://registry.yarnpkg.com/@mermaid-js/parser/-/parser-0.6.3.tgz#3ce92dad2c5d696d29e11e21109c66a7886c824e"
+ integrity sha512-lnjOhe7zyHjc+If7yT4zoedx2vo4sHaTmtkl1+or8BRTnCtDmcTpAjpzDSfCZrshM5bCoz0GyidzadJAH1xobA==
+ dependencies:
+ langium "3.3.1"
+
version "14.1.4"
resolved "https://registry.yarnpkg.com/@next/env/-/env-14.1.4.tgz#432e80651733fbd67230bf262aee28be65252674"
@@ -2840,29 +2901,215 @@
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.0.tgz#23509ebc1fa32f1b4d50d6a66c4032d5b8eaabdc"
integrity sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==
-"@types/d3-scale-chromatic@^3.0.0":
+"@types/d3-array@*":
+ version "3.2.2"
+ resolved "https://registry.yarnpkg.com/@types/d3-array/-/d3-array-3.2.2.tgz#e02151464d02d4a1b44646d0fcdb93faf88fde8c"
+ integrity sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==
+
+"@types/d3-axis@*":
+ version "3.0.6"
+ resolved "https://registry.yarnpkg.com/@types/d3-axis/-/d3-axis-3.0.6.tgz#e760e5765b8188b1defa32bc8bb6062f81e4c795"
+ integrity sha512-pYeijfZuBd87T0hGn0FO1vQ/cgLk6E1ALJjfkC0oJ8cbwkZl3TpgS8bVBLZN+2jjGgg38epgxb2zmoGtSfvgMw==
+ dependencies:
+ "@types/d3-selection" "*"
+
+"@types/d3-brush@*":
+ version "3.0.6"
+ resolved "https://registry.yarnpkg.com/@types/d3-brush/-/d3-brush-3.0.6.tgz#c2f4362b045d472e1b186cdbec329ba52bdaee6c"
+ integrity sha512-nH60IZNNxEcrh6L1ZSMNA28rj27ut/2ZmI3r96Zd+1jrZD++zD3LsMIjWlvg4AYrHn/Pqz4CF3veCxGjtbqt7A==
+ dependencies:
+ "@types/d3-selection" "*"
+
+"@types/d3-chord@*":
+ version "3.0.6"
+ resolved "https://registry.yarnpkg.com/@types/d3-chord/-/d3-chord-3.0.6.tgz#1706ca40cf7ea59a0add8f4456efff8f8775793d"
+ integrity sha512-LFYWWd8nwfwEmTZG9PfQxd17HbNPksHBiJHaKuY1XeqscXacsS2tyoo6OdRsjf+NQYeB6XrNL3a25E3gH69lcg==
+
+"@types/d3-color@*":
+ version "3.1.3"
+ resolved "https://registry.yarnpkg.com/@types/d3-color/-/d3-color-3.1.3.tgz#368c961a18de721da8200e80bf3943fb53136af2"
+ integrity sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==
+
+"@types/d3-contour@*":
+ version "3.0.6"
+ resolved "https://registry.yarnpkg.com/@types/d3-contour/-/d3-contour-3.0.6.tgz#9ada3fa9c4d00e3a5093fed0356c7ab929604231"
+ integrity sha512-BjzLgXGnCWjUSYGfH1cpdo41/hgdWETu4YxpezoztawmqsvCeep+8QGfiY6YbDvfgHz/DkjeIkkZVJavB4a3rg==
+ dependencies:
+ "@types/d3-array" "*"
+ "@types/geojson" "*"
+
+"@types/d3-delaunay@*":
+ version "6.0.4"
+ resolved "https://registry.yarnpkg.com/@types/d3-delaunay/-/d3-delaunay-6.0.4.tgz#185c1a80cc807fdda2a3fe960f7c11c4a27952e1"
+ integrity sha512-ZMaSKu4THYCU6sV64Lhg6qjf1orxBthaC161plr5KuPHo3CNm8DTHiLw/5Eq2b6TsNP0W0iJrUOFscY6Q450Hw==
+
+"@types/d3-dispatch@*":
+ version "3.0.7"
+ resolved "https://registry.yarnpkg.com/@types/d3-dispatch/-/d3-dispatch-3.0.7.tgz#ef004d8a128046cfce434d17182f834e44ef95b2"
+ integrity sha512-5o9OIAdKkhN1QItV2oqaE5KMIiXAvDWBDPrD85e58Qlz1c1kI/J0NcqbEG88CoTwJrYe7ntUCVfeUl2UJKbWgA==
+
+"@types/d3-drag@*":
+ version "3.0.7"
+ resolved "https://registry.yarnpkg.com/@types/d3-drag/-/d3-drag-3.0.7.tgz#b13aba8b2442b4068c9a9e6d1d82f8bcea77fc02"
+ integrity sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ==
+ dependencies:
+ "@types/d3-selection" "*"
+
+"@types/d3-dsv@*":
+ version "3.0.7"
+ resolved "https://registry.yarnpkg.com/@types/d3-dsv/-/d3-dsv-3.0.7.tgz#0a351f996dc99b37f4fa58b492c2d1c04e3dac17"
+ integrity sha512-n6QBF9/+XASqcKK6waudgL0pf/S5XHPPI8APyMLLUHd8NqouBGLsU8MgtO7NINGtPBtk9Kko/W4ea0oAspwh9g==
+
+"@types/d3-ease@*":
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/@types/d3-ease/-/d3-ease-3.0.2.tgz#e28db1bfbfa617076f7770dd1d9a48eaa3b6c51b"
+ integrity sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==
+
+"@types/d3-fetch@*":
+ version "3.0.7"
+ resolved "https://registry.yarnpkg.com/@types/d3-fetch/-/d3-fetch-3.0.7.tgz#c04a2b4f23181aa376f30af0283dbc7b3b569980"
+ integrity sha512-fTAfNmxSb9SOWNB9IoG5c8Hg6R+AzUHDRlsXsDZsNp6sxAEOP0tkP3gKkNSO/qmHPoBFTxNrjDprVHDQDvo5aA==
+ dependencies:
+ "@types/d3-dsv" "*"
+
+"@types/d3-force@*":
+ version "3.0.10"
+ resolved "https://registry.yarnpkg.com/@types/d3-force/-/d3-force-3.0.10.tgz#6dc8fc6e1f35704f3b057090beeeb7ac674bff1a"
+ integrity sha512-ZYeSaCF3p73RdOKcjj+swRlZfnYpK1EbaDiYICEEp5Q6sUiqFaFQ9qgoshp5CzIyyb/yD09kD9o2zEltCexlgw==
+
+"@types/d3-format@*":
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/@types/d3-format/-/d3-format-3.0.4.tgz#b1e4465644ddb3fdf3a263febb240a6cd616de90"
+ integrity sha512-fALi2aI6shfg7vM5KiR1wNJnZ7r6UuggVqtDA+xiEdPZQwy/trcQaHnwShLuLdta2rTymCNpxYTiMZX/e09F4g==
+
+"@types/d3-geo@*":
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/@types/d3-geo/-/d3-geo-3.1.0.tgz#b9e56a079449174f0a2c8684a9a4df3f60522440"
+ integrity sha512-856sckF0oP/diXtS4jNsiQw/UuK5fQG8l/a9VVLeSouf1/PPbBE1i1W852zVwKwYCBkFJJB7nCFTbk6UMEXBOQ==
+ dependencies:
+ "@types/geojson" "*"
+
+"@types/d3-hierarchy@*":
+ version "3.1.7"
+ resolved "https://registry.yarnpkg.com/@types/d3-hierarchy/-/d3-hierarchy-3.1.7.tgz#6023fb3b2d463229f2d680f9ac4b47466f71f17b"
+ integrity sha512-tJFtNoYBtRtkNysX1Xq4sxtjK8YgoWUNpIiUee0/jHGRwqvzYxkq0hGVbbOGSz+JgFxxRu4K8nb3YpG3CMARtg==
+
+"@types/d3-interpolate@*":
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz#412b90e84870285f2ff8a846c6eb60344f12a41c"
+ integrity sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==
+ dependencies:
+ "@types/d3-color" "*"
+
+"@types/d3-path@*":
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/@types/d3-path/-/d3-path-3.1.1.tgz#f632b380c3aca1dba8e34aa049bcd6a4af23df8a"
+ integrity sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==
+
+"@types/d3-polygon@*":
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/@types/d3-polygon/-/d3-polygon-3.0.2.tgz#dfae54a6d35d19e76ac9565bcb32a8e54693189c"
+ integrity sha512-ZuWOtMaHCkN9xoeEMr1ubW2nGWsp4nIql+OPQRstu4ypeZ+zk3YKqQT0CXVe/PYqrKpZAi+J9mTs05TKwjXSRA==
+
+"@types/d3-quadtree@*":
+ version "3.0.6"
+ resolved "https://registry.yarnpkg.com/@types/d3-quadtree/-/d3-quadtree-3.0.6.tgz#d4740b0fe35b1c58b66e1488f4e7ed02952f570f"
+ integrity sha512-oUzyO1/Zm6rsxKRHA1vH0NEDG58HrT5icx/azi9MF1TWdtttWl0UIUsjEQBBh+SIkrpd21ZjEv7ptxWys1ncsg==
+
+"@types/d3-random@*":
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/@types/d3-random/-/d3-random-3.0.3.tgz#ed995c71ecb15e0cd31e22d9d5d23942e3300cfb"
+ integrity sha512-Imagg1vJ3y76Y2ea0871wpabqp613+8/r0mCLEBfdtqC7xMSfj9idOnmBYyMoULfHePJyxMAw3nWhJxzc+LFwQ==
+
+"@types/d3-scale-chromatic@*":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@types/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz#dc6d4f9a98376f18ea50bad6c39537f1b5463c39"
integrity sha512-iWMJgwkK7yTRmWqRB5plb1kadXyQ5Sj8V/zYlFGMUBbIPKQScw+Dku9cAAMgJG+z5GYDoMjWGLVOvjghDEFnKQ==
-"@types/d3-scale@^4.0.3":
+"@types/d3-scale@*":
version "4.0.9"
resolved "https://registry.yarnpkg.com/@types/d3-scale/-/d3-scale-4.0.9.tgz#57a2f707242e6fe1de81ad7bfcccaaf606179afb"
integrity sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==
dependencies:
"@types/d3-time" "*"
+"@types/d3-selection@*":
+ version "3.0.11"
+ resolved "https://registry.yarnpkg.com/@types/d3-selection/-/d3-selection-3.0.11.tgz#bd7a45fc0a8c3167a631675e61bc2ca2b058d4a3"
+ integrity sha512-bhAXu23DJWsrI45xafYpkQ4NtcKMwWnAC/vKrd2l+nxMFuvOT3XMYTIj2opv8vq8AO5Yh7Qac/nSeP/3zjTK0w==
+
+"@types/d3-shape@*":
+ version "3.1.7"
+ resolved "https://registry.yarnpkg.com/@types/d3-shape/-/d3-shape-3.1.7.tgz#2b7b423dc2dfe69c8c93596e673e37443348c555"
+ integrity sha512-VLvUQ33C+3J+8p+Daf+nYSOsjB4GXp19/S/aGo60m9h1v6XaxjiT82lKVWJCfzhtuZ3yD7i/TPeC/fuKLLOSmg==
+ dependencies:
+ "@types/d3-path" "*"
+
+"@types/d3-time-format@*":
+ version "4.0.3"
+ resolved "https://registry.yarnpkg.com/@types/d3-time-format/-/d3-time-format-4.0.3.tgz#d6bc1e6b6a7db69cccfbbdd4c34b70632d9e9db2"
+ integrity sha512-5xg9rC+wWL8kdDj153qZcsJ0FWiFt0J5RB6LYUNZjwSnesfblqrI/bJ1wBdJ8OQfncgbJG5+2F+qfqnqyzYxyg==
+
"@types/d3-time@*":
version "3.0.4"
resolved "https://registry.yarnpkg.com/@types/d3-time/-/d3-time-3.0.4.tgz#8472feecd639691450dd8000eb33edd444e1323f"
integrity sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==
-"@types/debug@^4.0.0":
- version "4.1.12"
- resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.12.tgz#a155f21690871953410df4b6b6f53187f0500917"
- integrity sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==
- dependencies:
- "@types/ms" "*"
+"@types/d3-timer@*":
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/@types/d3-timer/-/d3-timer-3.0.2.tgz#70bbda77dc23aa727413e22e214afa3f0e852f70"
+ integrity sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==
+
+"@types/d3-transition@*":
+ version "3.0.9"
+ resolved "https://registry.yarnpkg.com/@types/d3-transition/-/d3-transition-3.0.9.tgz#1136bc57e9ddb3c390dccc9b5ff3b7d2b8d94706"
+ integrity sha512-uZS5shfxzO3rGlu0cC3bjmMFKsXv+SmZZcgp0KD22ts4uGXp5EVYGzu/0YdwZeKmddhcAccYtREJKkPfXkZuCg==
+ dependencies:
+ "@types/d3-selection" "*"
+
+"@types/d3-zoom@*":
+ version "3.0.8"
+ resolved "https://registry.yarnpkg.com/@types/d3-zoom/-/d3-zoom-3.0.8.tgz#dccb32d1c56b1e1c6e0f1180d994896f038bc40b"
+ integrity sha512-iqMC4/YlFCSlO8+2Ii1GGGliCAY4XdeG748w5vQUbevlbDu0zSjH/+jojorQVBK/se0j6DUFNPBGSqD3YWYnDw==
+ dependencies:
+ "@types/d3-interpolate" "*"
+ "@types/d3-selection" "*"
+
+"@types/d3@^7.4.3":
+ version "7.4.3"
+ resolved "https://registry.yarnpkg.com/@types/d3/-/d3-7.4.3.tgz#d4550a85d08f4978faf0a4c36b848c61eaac07e2"
+ integrity sha512-lZXZ9ckh5R8uiFVt8ogUNf+pIrK4EsWrx2Np75WvF/eTpJ0FMHNhjXk8CKEx/+gpHbNQyJWehbFaTvqmHWB3ww==
+ dependencies:
+ "@types/d3-array" "*"
+ "@types/d3-axis" "*"
+ "@types/d3-brush" "*"
+ "@types/d3-chord" "*"
+ "@types/d3-color" "*"
+ "@types/d3-contour" "*"
+ "@types/d3-delaunay" "*"
+ "@types/d3-dispatch" "*"
+ "@types/d3-drag" "*"
+ "@types/d3-dsv" "*"
+ "@types/d3-ease" "*"
+ "@types/d3-fetch" "*"
+ "@types/d3-force" "*"
+ "@types/d3-format" "*"
+ "@types/d3-geo" "*"
+ "@types/d3-hierarchy" "*"
+ "@types/d3-interpolate" "*"
+ "@types/d3-path" "*"
+ "@types/d3-polygon" "*"
+ "@types/d3-quadtree" "*"
+ "@types/d3-random" "*"
+ "@types/d3-scale" "*"
+ "@types/d3-scale-chromatic" "*"
+ "@types/d3-selection" "*"
+ "@types/d3-shape" "*"
+ "@types/d3-time" "*"
+ "@types/d3-time-format" "*"
+ "@types/d3-timer" "*"
+ "@types/d3-transition" "*"
+ "@types/d3-zoom" "*"
"@types/eslint-scope@^3.7.7":
version "3.7.7"
@@ -2890,6 +3137,11 @@
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
+"@types/geojson@*":
+ version "7946.0.16"
+ resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.16.tgz#8ebe53d69efada7044454e3305c19017d97ced2a"
+ integrity sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==
+
version "27.4.0"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.4.0.tgz#037ab8b872067cae842a320841693080f9cb84ed"
@@ -2927,18 +3179,6 @@
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.16.tgz#94ae78fab4a38d73086e962d0b65c30d816bfb0a"
integrity sha512-HX7Em5NYQAXKW+1T+FiuG27NGwzJfCX3s1GjOa7ujxZa52kjJLOr4FUxT+giF6Tgxv1e+/czV/iTtBw27WTU9g==
-"@types/mdast@^3.0.0":
- version "3.0.15"
- resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.15.tgz#49c524a263f30ffa28b71ae282f813ed000ab9f5"
- integrity sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==
- dependencies:
- "@types/unist" "^2"
-
-"@types/ms@*":
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/@types/ms/-/ms-2.1.0.tgz#052aa67a48eccc4309d7f0191b7e41434b90bb78"
- integrity sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==
-
"@types/node@*":
version "22.13.10"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.13.10.tgz#df9ea358c5ed991266becc3109dc2dc9125d77e4"
@@ -3014,16 +3254,11 @@
resolved "https://registry.yarnpkg.com/@types/tinycolor2/-/tinycolor2-1.4.6.tgz#670cbc0caf4e58dd61d1e3a6f26386e473087f06"
integrity sha512-iEN8J0BoMnsWBqjVbWH/c0G0Hh7O21lpR2/+PrvAVgWdzL7eexIFm4JN/Wn10PTcmNdtS6U67r499mlWMXOxNw==
-"@types/trusted-types@^2.0.2":
+"@types/trusted-types@^2.0.2", "@types/trusted-types@^2.0.7":
version "2.0.7"
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.7.tgz#baccb07a970b91707df3a3e8ba6896c57ead2d11"
integrity sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==
-"@types/unist@^2", "@types/unist@^2.0.0":
- version "2.0.11"
- resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.11.tgz#11af57b127e32487774841f7a4e54eab166d03c4"
- integrity sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==
-
"@types/yauzl@^2.9.1":
version "2.10.3"
resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.10.3.tgz#e9b2808b4f109504a03cda958259876f61017999"
@@ -3403,6 +3638,11 @@ acorn@^8.14.0:
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.1.tgz#721d5dc10f7d5b5609a891773d47731796935dfb"
integrity sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==
+acorn@^8.15.0:
+ version "8.15.0"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.15.0.tgz#a360898bc415edaac46c8241f6383975b930b816"
+ integrity sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==
+
acorn@^8.8.2:
version "8.14.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0"
@@ -4006,11 +4246,6 @@ chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2:
ansi-styles "^4.1.0"
supports-color "^7.1.0"
-character-entities@^2.0.0:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-2.0.2.tgz#2d09c2e72cd9523076ccb21157dff66ad43fcc22"
- integrity sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==
-
check-error@^1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.3.tgz#a6502e4312a7ee969f646e83bb3ddd56281bd694"
@@ -4023,6 +4258,25 @@ check-error@^2.1.1:
resolved "https://registry.yarnpkg.com/check-error/-/check-error-2.1.1.tgz#87eb876ae71ee388fa0471fe423f494be1d96ccc"
integrity sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==
+chevrotain-allstar@~0.3.0:
+ version "0.3.1"
+ resolved "https://registry.yarnpkg.com/chevrotain-allstar/-/chevrotain-allstar-0.3.1.tgz#b7412755f5d83cc139ab65810cdb00d8db40e6ca"
+ integrity sha512-b7g+y9A0v4mxCW1qUhf3BSVPg+/NvGErk/dOkrDaHA0nQIQGAtrOjlX//9OQtRlSCy+x9rfB5N8yC71lH1nvMw==
+ dependencies:
+ lodash-es "^4.17.21"
+
+chevrotain@~11.0.3:
+ version "11.0.3"
+ resolved "https://registry.yarnpkg.com/chevrotain/-/chevrotain-11.0.3.tgz#88ffc1fb4b5739c715807eaeedbbf200e202fc1b"
+ integrity sha512-ci2iJH6LeIkvP9eJW6gpueU8cnZhv85ELY8w8WiFtNjMHA5ad6pQLaJo9mEly/9qUyCpvqX8/POVUTf18/HFdw==
+ dependencies:
+ "@chevrotain/cst-dts-gen" "11.0.3"
+ "@chevrotain/gast" "11.0.3"
+ "@chevrotain/regexp-to-ast" "11.0.3"
+ "@chevrotain/types" "11.0.3"
+ "@chevrotain/utils" "11.0.3"
+ lodash-es "4.17.21"
+
"chokidar@>=3.0.0 <4.0.0", chokidar@^3.5.1, chokidar@^3.5.3:
version "3.6.0"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b"
@@ -4175,6 +4429,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
+confbox@^0.1.8:
+ version "0.1.8"
+ resolved "https://registry.yarnpkg.com/confbox/-/confbox-0.1.8.tgz#820d73d3b3c82d9bd910652c5d4d599ef8ff8b06"
+ integrity sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==
+
confusing-browser-globals@^1.0.11:
version "1.0.11"
resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81"
@@ -4219,6 +4478,13 @@ cose-base@^1.0.0:
dependencies:
layout-base "^1.0.0"
+cose-base@^2.2.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/cose-base/-/cose-base-2.2.0.tgz#1c395c35b6e10bb83f9769ca8b817d614add5c01"
+ integrity sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g==
+ dependencies:
+ layout-base "^2.0.0"
+
cosmiconfig@^7.0.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.1.0.tgz#1443b9afa596b670082ea46cbd8f6a62b84635f6"
@@ -4318,10 +4584,17 @@ cytoscape-cose-bilkent@^4.1.0:
dependencies:
cose-base "^1.0.0"
-cytoscape@^3.28.1:
- version "3.31.1"
- resolved "https://registry.yarnpkg.com/cytoscape/-/cytoscape-3.31.1.tgz#29b12cac715fbb2aacc50cdf5cf1467aadde9c00"
- integrity sha512-Hx5Mtb1+hnmAKaZZ/7zL1Y5HTFYOjdDswZy/jD+1WINRU8KVi1B7+vlHdsTwY+VCFucTreoyu1RDzQJ9u0d2Hw==
+cytoscape-fcose@^2.2.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/cytoscape-fcose/-/cytoscape-fcose-2.2.0.tgz#e4d6f6490df4fab58ae9cea9e5c3ab8d7472f471"
+ integrity sha512-ki1/VuRIHFCzxWNrsshHYPs6L7TvLu3DL+TyIGEsRcvVERmxokbf5Gdk7mFxZnTdiGtnA4cfSmjZJMviqSuZrQ==
+ dependencies:
+ cose-base "^2.2.0"
+
+cytoscape@^3.29.3:
+ version "3.33.1"
+ resolved "https://registry.yarnpkg.com/cytoscape/-/cytoscape-3.33.1.tgz#449e05d104b760af2912ab76482d24c01cdd4c97"
+ integrity sha512-iJc4TwyANnOGR1OmWhsS9ayRS3s+XQ185FmuHObThD+5AeJCakAAbWv8KimMTt08xCCLNgneQwFp+JRJOr9qGQ==
"d3-array@1 - 2":
version "2.12.1"
@@ -4558,7 +4831,7 @@ d3-zoom@3:
d3-selection "2 - 3"
d3-transition "2 - 3"
-d3@^7.4.0, d3@^7.8.2:
+d3@^7.9.0:
version "7.9.0"
resolved "https://registry.yarnpkg.com/d3/-/d3-7.9.0.tgz#579e7acb3d749caf8860bd1741ae8d371070cd5d"
integrity sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==
@@ -4594,12 +4867,12 @@ d3@^7.4.0, d3@^7.8.2:
d3-transition "3"
d3-zoom "3"
- version "7.0.10"
- resolved "https://registry.yarnpkg.com/dagre-d3-es/-/dagre-d3-es-7.0.10.tgz#19800d4be674379a3cd8c86a8216a2ac6827cadc"
- integrity sha512-qTCQmEhcynucuaZgY5/+ti3X/rnszKZhEQH/ZdWdtP1tA/y3VoHJzcVrO9pjjJCNpigfscAtoUB5ONcd2wNn0A==
+ version "7.0.13"
+ resolved "https://registry.yarnpkg.com/dagre-d3-es/-/dagre-d3-es-7.0.13.tgz#acfb4b449f6dcdd48d8ea8081a6d8c59bc8128c3"
+ integrity sha512-efEhnxpSuwpYOKRm/L5KbqoZmNNukHa/Flty4Wp62JRvgH2ojwVgPgdYyr4twpieZnyRDdIH7PY2mopX26+j2Q==
dependencies:
- d3 "^7.8.2"
+ d3 "^7.9.0"
lodash-es "^4.17.21"
damerau-levenshtein@^1.0.8:
@@ -4643,12 +4916,12 @@ data-view-byte-offset@^1.0.1:
es-errors "^1.3.0"
is-data-view "^1.0.1"
-dayjs@^1.11.7:
- version "1.11.13"
- resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.13.tgz#92430b0139055c3ebb60150aa13e860a4b5a366c"
- integrity sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==
+dayjs@^1.11.18:
+ version "1.11.19"
+ resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.19.tgz#15dc98e854bb43917f12021806af897c58ae2938"
+ integrity sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==
-debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3, debug@^4.3.4, debug@^4.3.6, debug@^4.4.0:
+debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3, debug@^4.3.4, debug@^4.3.6, debug@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a"
integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==
@@ -4681,13 +4954,6 @@ decimal.js@^10.4.3:
resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.5.0.tgz#0f371c7cf6c4898ce0afb09836db73cd82010f22"
integrity sha512-8vDa8Qxvr/+d94hSh5P3IJwI5t8/c0KsMp+g8bNw9cY2icONa5aPfvKeieW1WlG0WQYwwhJ7mjui2xtiePQSXw==
-decode-named-character-reference@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/decode-named-character-reference/-/decode-named-character-reference-1.1.0.tgz#5d6ce68792808901210dac42a8e9853511e2b8bf"
- integrity sha512-Wy+JTSbFThEOXQIR2L6mxJvEs+veIzpmqD7ynWxMXGpnk3smkHQOp6forLdHsKpAMW9iJpaBBIxz285t1n1C3w==
- dependencies:
- character-entities "^2.0.0"
-
deep-eql@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df"
@@ -4740,7 +5006,7 @@ delayed-stream@~1.0.0:
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==
-dequal@^2.0.0, dequal@^2.0.3:
+dequal@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be"
integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==
@@ -4770,11 +5036,6 @@ diff-sequences@^29.6.3:
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921"
integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==
-diff@^5.0.0:
- version "5.2.0"
- resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531"
- integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==
-
dir-glob@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
@@ -4841,10 +5102,12 @@ domhandler@^4.2.0, domhandler@^4.3.1:
dependencies:
domelementtype "^2.2.0"
-"dompurify@^3.0.5 <3.1.7":
- version "3.1.6"
- resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.1.6.tgz#43c714a94c6a7b8801850f82e756685300a027e2"
- integrity sha512-cTOAhc36AalkjtBpfG6O8JimdTMWNXjiePT2xQH/ppBGi/4uIpmj8eKyIkMJErXWARyINV/sB38yf8JCLF5pbQ==
+dompurify@^3.2.5:
+ version "3.3.1"
+ resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.3.1.tgz#c7e1ddebfe3301eacd6c0c12a4af284936dbbb86"
+ integrity sha512-qkdCKzLNtrgPFP1Vo+98FRzJnBRGe4ffyCea9IwHB1fyxPOeNTHpLKYGd4Uk9xvNoH0ZoOjwZxNptyMwqrId1Q==
+ optionalDependencies:
+ "@types/trusted-types" "^2.0.7"
domutils@^2.8.0:
version "2.8.0"
@@ -4904,11 +5167,6 @@ electron-to-chromium@^1.5.73:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.109.tgz#905a573d2b4cbb31412a2de6267fb22cf45e097e"
integrity sha512-AidaH9JETVRr9DIPGfp1kAarm/W6hRJTPuCnkF+2MqhF4KaAgRIcBc8nvjk+YMXZhwfISof/7WG29eS4iGxQLQ==
-elkjs@^0.9.0:
- version "0.9.3"
- resolved "https://registry.yarnpkg.com/elkjs/-/elkjs-0.9.3.tgz#16711f8ceb09f1b12b99e971b138a8384a529161"
- integrity sha512-f/ZeWvW/BCXbhGEf1Ujp29EASo/lk1FDnETgNKwJrsVvGZhUWCZyg3xLJjAsxfOmt8KjswHmI5EwCQcPMpOYhQ==
-
emoji-regex@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
@@ -6766,10 +7024,10 @@ jsonpointer@^5.0.0:
object.assign "^4.1.4"
object.values "^1.1.6"
-katex@^0.16.9:
- version "0.16.21"
- resolved "https://registry.yarnpkg.com/katex/-/katex-0.16.21.tgz#8f63c659e931b210139691f2cc7bb35166b792a3"
- integrity sha512-XvqR7FgOHtWupfMiigNzmh+MgUVmDGU2kXZm899ZkPfcuoPuFxyHmXsgATDpFZDAXCI8tvinaVcDo8PIIJSo4A==
+katex@^0.16.22:
+ version "0.16.27"
+ resolved "https://registry.yarnpkg.com/katex/-/katex-0.16.27.tgz#4ecf6f620e0ca1c1a5de722e85fcdcec49086a48"
+ integrity sha512-aeQoDkuRWSqQN6nSvVCEFvfXdqo1OQiCmmW1kc9xSdjutPv7BGO7pqY9sQRJpMOGrEdfDgF2TfRXe5eUAD2Waw==
dependencies:
commander "^8.3.0"
@@ -6780,15 +7038,21 @@ keyv@^4.5.3:
dependencies:
json-buffer "3.0.1"
-khroma@^2.0.0:
+khroma@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/khroma/-/khroma-2.1.0.tgz#45f2ce94ce231a437cf5b63c2e886e6eb42bbbb1"
integrity sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw==
-kleur@^4.0.3:
- version "4.1.5"
- resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.5.tgz#95106101795f7050c6c650f350c683febddb1780"
- integrity sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==
+ version "3.3.1"
+ resolved "https://registry.yarnpkg.com/langium/-/langium-3.3.1.tgz#da745a40d5ad8ee565090fed52eaee643be4e591"
+ integrity sha512-QJv/h939gDpvT+9SiLVlY7tZC3xB2qK57v0J04Sh9wpMb6MP1q8gB21L3WIo8T5P1MSMg3Ep14L7KkDCFG3y4w==
+ dependencies:
+ chevrotain "~11.0.3"
+ chevrotain-allstar "~0.3.0"
+ vscode-languageserver "~9.0.1"
+ vscode-languageserver-textdocument "~1.0.11"
+ vscode-uri "~3.0.8"
language-subtag-registry@^0.3.20:
version "0.3.23"
@@ -6807,6 +7071,11 @@ layout-base@^1.0.0:
resolved "https://registry.yarnpkg.com/layout-base/-/layout-base-1.0.2.tgz#1291e296883c322a9dd4c5dd82063721b53e26e2"
integrity sha512-8h2oVEZNktL4BH2JCOI90iD1yXwL6iNW7KcCKT2QZgQJR2vbqDsldCTPRU9NifTCqHZci57XvQQ15YTu+sTYPg==
+layout-base@^2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/layout-base/-/layout-base-2.0.1.tgz#d0337913586c90f9c2c075292069f5c2da5dd285"
+ integrity sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg==
+
leven@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2"
@@ -6881,7 +7150,7 @@ locate-path@^5.0.0:
dependencies:
p-locate "^4.1.0"
-lodash-es@^4.17.21:
[email protected], lodash-es@^4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee"
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==
@@ -7023,36 +7292,16 @@ make-dir@^4.0.0:
dependencies:
semver "^7.5.3"
+marked@^16.2.1:
+ version "16.4.2"
+ resolved "https://registry.yarnpkg.com/marked/-/marked-16.4.2.tgz#4959a64be6c486f0db7467ead7ce288de54290a3"
+ integrity sha512-TI3V8YYWvkVf3KJe1dRkpnjs68JUPyEa5vjKrp1XEEJUAOaQc+Qj+L1qWbPd0SJuAdQkFU0h73sXXqwDYxsiDA==
+
math-intrinsics@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9"
integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==
-mdast-util-from-markdown@^1.3.0:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-1.3.1.tgz#9421a5a247f10d31d2faed2a30df5ec89ceafcf0"
- integrity sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==
- dependencies:
- "@types/mdast" "^3.0.0"
- "@types/unist" "^2.0.0"
- decode-named-character-reference "^1.0.0"
- mdast-util-to-string "^3.1.0"
- micromark "^3.0.0"
- micromark-util-decode-numeric-character-reference "^1.0.0"
- micromark-util-decode-string "^1.0.0"
- micromark-util-normalize-identifier "^1.0.0"
- micromark-util-symbol "^1.0.0"
- micromark-util-types "^1.0.0"
- unist-util-stringify-position "^3.0.0"
- uvu "^0.5.0"
-
-mdast-util-to-string@^3.1.0:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz#66f7bb6324756741c5f47a53557f0cbf16b6f789"
- integrity sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==
- dependencies:
- "@types/mdast" "^3.0.0"
-
merge-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
@@ -7063,225 +7312,31 @@ merge2@^1.3.0, merge2@^1.4.1:
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
- version "10.9.4"
- resolved "https://registry.yarnpkg.com/mermaid/-/mermaid-10.9.4.tgz#985fd4b6d73ae795b87f0b32f620a56d3d6bf1f8"
- integrity sha512-VIG2B0R9ydvkS+wShA8sXqkzfpYglM2Qwj7VyUeqzNVqSGPoP/tcaUr3ub4ESykv8eqQJn3p99bHNvYdg3gCHQ==
+mermaid@^11.12.1:
+ version "11.12.2"
+ resolved "https://registry.yarnpkg.com/mermaid/-/mermaid-11.12.2.tgz#48bbdb9f724bc2191e2128e1403bf964fff2bc3d"
+ integrity sha512-n34QPDPEKmaeCG4WDMGy0OT6PSyxKCfy2pJgShP+Qow2KLrvWjclwbc3yXfSIf4BanqWEhQEpngWwNp/XhZt6w==
dependencies:
- "@braintree/sanitize-url" "^6.0.1"
- "@types/d3-scale" "^4.0.3"
- "@types/d3-scale-chromatic" "^3.0.0"
- cytoscape "^3.28.1"
+ "@braintree/sanitize-url" "^7.1.1"
+ "@iconify/utils" "^3.0.1"
+ "@mermaid-js/parser" "^0.6.3"
+ "@types/d3" "^7.4.3"
+ cytoscape "^3.29.3"
cytoscape-cose-bilkent "^4.1.0"
- d3 "^7.4.0"
+ cytoscape-fcose "^2.2.0"
+ d3 "^7.9.0"
d3-sankey "^0.12.3"
- dagre-d3-es "7.0.10"
- dayjs "^1.11.7"
- dompurify "^3.0.5 <3.1.7"
- elkjs "^0.9.0"
- katex "^0.16.9"
- khroma "^2.0.0"
+ dagre-d3-es "7.0.13"
+ dayjs "^1.11.18"
+ dompurify "^3.2.5"
+ katex "^0.16.22"
+ khroma "^2.1.0"
lodash-es "^4.17.21"
- mdast-util-from-markdown "^1.3.0"
- non-layered-tidy-tree-layout "^2.0.2"
- stylis "^4.1.3"
+ marked "^16.2.1"
+ roughjs "^4.6.6"
+ stylis "^4.3.6"
ts-dedent "^2.2.0"
- uuid "^9.0.0"
- web-worker "^1.2.0"
-
-micromark-core-commonmark@^1.0.1:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz#1386628df59946b2d39fb2edfd10f3e8e0a75bb8"
- integrity sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==
- dependencies:
- decode-named-character-reference "^1.0.0"
- micromark-factory-destination "^1.0.0"
- micromark-factory-label "^1.0.0"
- micromark-factory-space "^1.0.0"
- micromark-factory-title "^1.0.0"
- micromark-factory-whitespace "^1.0.0"
- micromark-util-character "^1.0.0"
- micromark-util-chunked "^1.0.0"
- micromark-util-classify-character "^1.0.0"
- micromark-util-html-tag-name "^1.0.0"
- micromark-util-normalize-identifier "^1.0.0"
- micromark-util-resolve-all "^1.0.0"
- micromark-util-subtokenize "^1.0.0"
- micromark-util-symbol "^1.0.0"
- micromark-util-types "^1.0.1"
- uvu "^0.5.0"
-
-micromark-factory-destination@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/micromark-factory-destination/-/micromark-factory-destination-1.1.0.tgz#eb815957d83e6d44479b3df640f010edad667b9f"
- integrity sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==
- dependencies:
- micromark-util-character "^1.0.0"
- micromark-util-symbol "^1.0.0"
- micromark-util-types "^1.0.0"
-
-micromark-factory-label@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/micromark-factory-label/-/micromark-factory-label-1.1.0.tgz#cc95d5478269085cfa2a7282b3de26eb2e2dec68"
- integrity sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==
- dependencies:
- micromark-util-character "^1.0.0"
- micromark-util-symbol "^1.0.0"
- micromark-util-types "^1.0.0"
- uvu "^0.5.0"
-
-micromark-factory-space@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/micromark-factory-space/-/micromark-factory-space-1.1.0.tgz#c8f40b0640a0150751d3345ed885a080b0d15faf"
- integrity sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==
- dependencies:
- micromark-util-character "^1.0.0"
- micromark-util-types "^1.0.0"
-
-micromark-factory-title@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/micromark-factory-title/-/micromark-factory-title-1.1.0.tgz#dd0fe951d7a0ac71bdc5ee13e5d1465ad7f50ea1"
- integrity sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ==
- dependencies:
- micromark-factory-space "^1.0.0"
- micromark-util-character "^1.0.0"
- micromark-util-symbol "^1.0.0"
- micromark-util-types "^1.0.0"
-
-micromark-factory-whitespace@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/micromark-factory-whitespace/-/micromark-factory-whitespace-1.1.0.tgz#798fb7489f4c8abafa7ca77eed6b5745853c9705"
- integrity sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ==
- dependencies:
- micromark-factory-space "^1.0.0"
- micromark-util-character "^1.0.0"
- micromark-util-symbol "^1.0.0"
- micromark-util-types "^1.0.0"
-
-micromark-util-character@^1.0.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/micromark-util-character/-/micromark-util-character-1.2.0.tgz#4fedaa3646db249bc58caeb000eb3549a8ca5dcc"
- integrity sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==
- dependencies:
- micromark-util-symbol "^1.0.0"
- micromark-util-types "^1.0.0"
-
-micromark-util-chunked@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/micromark-util-chunked/-/micromark-util-chunked-1.1.0.tgz#37a24d33333c8c69a74ba12a14651fd9ea8a368b"
- integrity sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==
- dependencies:
- micromark-util-symbol "^1.0.0"
-
-micromark-util-classify-character@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/micromark-util-classify-character/-/micromark-util-classify-character-1.1.0.tgz#6a7f8c8838e8a120c8e3c4f2ae97a2bff9190e9d"
- integrity sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw==
- dependencies:
- micromark-util-character "^1.0.0"
- micromark-util-symbol "^1.0.0"
- micromark-util-types "^1.0.0"
-
-micromark-util-combine-extensions@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.1.0.tgz#192e2b3d6567660a85f735e54d8ea6e3952dbe84"
- integrity sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA==
- dependencies:
- micromark-util-chunked "^1.0.0"
- micromark-util-types "^1.0.0"
-
-micromark-util-decode-numeric-character-reference@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.1.0.tgz#b1e6e17009b1f20bc652a521309c5f22c85eb1c6"
- integrity sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw==
- dependencies:
- micromark-util-symbol "^1.0.0"
-
-micromark-util-decode-string@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/micromark-util-decode-string/-/micromark-util-decode-string-1.1.0.tgz#dc12b078cba7a3ff690d0203f95b5d5537f2809c"
- integrity sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ==
- dependencies:
- decode-named-character-reference "^1.0.0"
- micromark-util-character "^1.0.0"
- micromark-util-decode-numeric-character-reference "^1.0.0"
- micromark-util-symbol "^1.0.0"
-
-micromark-util-encode@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/micromark-util-encode/-/micromark-util-encode-1.1.0.tgz#92e4f565fd4ccb19e0dcae1afab9a173bbeb19a5"
- integrity sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==
-
-micromark-util-html-tag-name@^1.0.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.2.0.tgz#48fd7a25826f29d2f71479d3b4e83e94829b3588"
- integrity sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q==
-
-micromark-util-normalize-identifier@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.1.0.tgz#7a73f824eb9f10d442b4d7f120fecb9b38ebf8b7"
- integrity sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q==
- dependencies:
- micromark-util-symbol "^1.0.0"
-
-micromark-util-resolve-all@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/micromark-util-resolve-all/-/micromark-util-resolve-all-1.1.0.tgz#4652a591ee8c8fa06714c9b54cd6c8e693671188"
- integrity sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA==
- dependencies:
- micromark-util-types "^1.0.0"
-
-micromark-util-sanitize-uri@^1.0.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.2.0.tgz#613f738e4400c6eedbc53590c67b197e30d7f90d"
- integrity sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A==
- dependencies:
- micromark-util-character "^1.0.0"
- micromark-util-encode "^1.0.0"
- micromark-util-symbol "^1.0.0"
-
-micromark-util-subtokenize@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/micromark-util-subtokenize/-/micromark-util-subtokenize-1.1.0.tgz#941c74f93a93eaf687b9054aeb94642b0e92edb1"
- integrity sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==
- dependencies:
- micromark-util-chunked "^1.0.0"
- micromark-util-symbol "^1.0.0"
- micromark-util-types "^1.0.0"
- uvu "^0.5.0"
-
-micromark-util-symbol@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/micromark-util-symbol/-/micromark-util-symbol-1.1.0.tgz#813cd17837bdb912d069a12ebe3a44b6f7063142"
- integrity sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==
-
-micromark-util-types@^1.0.0, micromark-util-types@^1.0.1:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/micromark-util-types/-/micromark-util-types-1.1.0.tgz#e6676a8cae0bb86a2171c498167971886cb7e283"
- integrity sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==
-
-micromark@^3.0.0:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/micromark/-/micromark-3.2.0.tgz#1af9fef3f995ea1ea4ac9c7e2f19c48fd5c006e9"
- integrity sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==
- dependencies:
- "@types/debug" "^4.0.0"
- debug "^4.0.0"
- decode-named-character-reference "^1.0.0"
- micromark-core-commonmark "^1.0.1"
- micromark-factory-space "^1.0.0"
- micromark-util-character "^1.0.0"
- micromark-util-chunked "^1.0.0"
- micromark-util-combine-extensions "^1.0.0"
- micromark-util-decode-numeric-character-reference "^1.0.0"
- micromark-util-encode "^1.0.0"
- micromark-util-normalize-identifier "^1.0.0"
- micromark-util-resolve-all "^1.0.0"
- micromark-util-sanitize-uri "^1.0.0"
- micromark-util-subtokenize "^1.0.0"
- micromark-util-symbol "^1.0.0"
- micromark-util-types "^1.0.1"
- uvu "^0.5.0"
+ uuid "^11.1.0"
micromatch@^4.0.4, micromatch@^4.0.5, micromatch@^4.0.8:
version "4.0.8"
@@ -7361,6 +7416,16 @@ mkdirp@^0.5.6:
dependencies:
minimist "^1.2.6"
+mlly@^1.7.4, mlly@^1.8.0:
+ version "1.8.0"
+ resolved "https://registry.yarnpkg.com/mlly/-/mlly-1.8.0.tgz#e074612b938af8eba1eaf43299cbc89cb72d824e"
+ integrity sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==
+ dependencies:
+ acorn "^8.15.0"
+ pathe "^2.0.3"
+ pkg-types "^1.3.1"
+ ufo "^1.6.1"
+
moo-color@^1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/moo-color/-/moo-color-1.0.3.tgz#d56435f8359c8284d83ac58016df7427febece74"
@@ -7368,11 +7433,6 @@ moo-color@^1.0.2:
dependencies:
color-name "^1.1.4"
-mri@^1.1.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b"
- integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==
-
mrmime@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-2.0.1.tgz#bc3e87f7987853a54c9850eeb1f1078cd44adddc"
@@ -7494,11 +7554,6 @@ node-releases@^2.0.19:
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314"
integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==
-non-layered-tidy-tree-layout@^2.0.2:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/non-layered-tidy-tree-layout/-/non-layered-tidy-tree-layout-2.0.2.tgz#57d35d13c356643fc296a55fb11ac15e74da7804"
- integrity sha512-gkXMxRzUH+PB0ax9dUN0yYF0S25BqeAYqhgMaLUFmpXLEk7Fcu8f4emJuOAY0V8kjDICxROIKsTAKsV/v355xw==
-
normalize-path@^3.0.0, normalize-path@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
@@ -7673,6 +7728,11 @@ package-json-from-dist@^1.0.0:
resolved "https://registry.yarnpkg.com/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz#4f1471a010827a86f94cfd9b0727e36d267de505"
integrity sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==
+package-manager-detector@^1.3.0:
+ version "1.6.0"
+ resolved "https://registry.yarnpkg.com/package-manager-detector/-/package-manager-detector-1.6.0.tgz#70d0cf0aa02c877eeaf66c4d984ede0be9130734"
+ integrity sha512-61A5ThoTiDG/C8s8UMZwSorAGwMJ0ERVGj2OjoW5pAalsNOg15+iQiPzrLJ4jhZ1HJzmC2PIHT2oEiH3R5fzNA==
+
version "2.0.3"
resolved "https://registry.yarnpkg.com/pako/-/pako-2.0.3.tgz#cdf475e31b678565251406de9e759196a0ea7a43"
@@ -7771,7 +7831,7 @@ pathe@^1.1.2:
resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.2.tgz#6c4cb47a945692e48a1ddd6e4094d170516437ec"
integrity sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==
-pathe@^2.0.3:
+pathe@^2.0.1, pathe@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/pathe/-/pathe-2.0.3.tgz#3ecbec55421685b70a9da872b2cff3e1cbed1716"
integrity sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==
@@ -7839,6 +7899,15 @@ [email protected]:
dependencies:
find-up "^4.0.0"
+pkg-types@^1.3.1:
+ version "1.3.1"
+ resolved "https://registry.yarnpkg.com/pkg-types/-/pkg-types-1.3.1.tgz#bd7cc70881192777eef5326c19deb46e890917df"
+ integrity sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==
+ dependencies:
+ confbox "^0.1.8"
+ mlly "^1.7.4"
+ pathe "^2.0.1"
+
version "1.0.0"
resolved "https://registry.yarnpkg.com/png-chunk-text/-/png-chunk-text-1.0.0.tgz#1c6006d8e34ba471d38e1c9c54b3f53e1085e18f"
@@ -7964,7 +8033,7 @@ [email protected], progress@^2.0.0:
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
-prop-types@^15.5.7, prop-types@^15.8.1:
+prop-types@^15.8.1:
version "15.8.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
@@ -8109,14 +8178,6 @@ react-remove-scroll@^2.6.3:
use-callback-ref "^1.3.3"
use-sidecar "^1.1.3"
-react-split@^2.0.14:
- version "2.0.14"
- resolved "https://registry.yarnpkg.com/react-split/-/react-split-2.0.14.tgz#ef198259bf43264d605f792fb3384f15f5b34432"
- integrity sha512-bKWydgMgaKTg/2JGQnaJPg51T6dmumTWZppFgEbbY0Fbme0F5TuatAScCLaqommbGQQf/ZT1zaejuPDriscISA==
- dependencies:
- prop-types "^15.5.7"
- split.js "^1.6.0"
-
react-style-singleton@^2.2.2, react-style-singleton@^2.2.3:
version "2.2.3"
resolved "https://registry.yarnpkg.com/react-style-singleton/-/react-style-singleton-2.2.3.tgz#4265608be69a4d70cfe3047f2c6c88b2c3ace388"
@@ -8380,6 +8441,16 @@ [email protected]:
points-on-curve "^0.2.0"
points-on-path "^0.2.1"
+roughjs@^4.6.6:
+ version "4.6.6"
+ resolved "https://registry.yarnpkg.com/roughjs/-/roughjs-4.6.6.tgz#1059f49a5e0c80dee541a005b20cc322b222158b"
+ integrity sha512-ZUz/69+SYpFN/g/lUlo2FXcIjRkSu3nDarreVdGGndHEBJ6cXPdKguS8JGxwj5HA5xIbVKSmLgr5b3AWxtRfvQ==
+ dependencies:
+ hachure-fill "^0.5.2"
+ path-data-parser "^0.1.0"
+ points-on-curve "^0.2.0"
+ points-on-path "^0.2.1"
+
rrweb-cssom@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz#ed298055b97cbddcdeb278f904857629dec5e0e1"
@@ -8404,13 +8475,6 @@ rxjs@^7.5.5:
dependencies:
tslib "^2.1.0"
-sade@^1.7.3:
- version "1.8.1"
- resolved "https://registry.yarnpkg.com/sade/-/sade-1.8.1.tgz#0a78e81d658d394887be57d2a409bf703a3b2701"
- integrity sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==
- dependencies:
- mri "^1.1.0"
-
safari-14-idb-fix@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/safari-14-idb-fix/-/safari-14-idb-fix-3.0.0.tgz#450fc049b996ec7f3fd9ca2f89d32e0761583440"
@@ -8756,11 +8820,6 @@ sourcemap-codec@^1.4.8:
resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4"
integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==
-split.js@^1.6.0:
- version "1.6.5"
- resolved "https://registry.yarnpkg.com/split.js/-/split.js-1.6.5.tgz#f7f61da1044c9984cb42947df4de4fadb5a3f300"
- integrity sha512-mPTnGCiS/RiuTNsVhCm9De9cCAUsrNFFviRbADdKiiV+Kk8HKp/0fWu7Kr8pi3/yBmsqLFHuXGT9UUZ+CNLwFw==
-
sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
@@ -8950,7 +9009,7 @@ [email protected]:
dependencies:
client-only "0.0.1"
-stylis@^4.1.3:
+stylis@^4.3.6:
version "4.3.6"
resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.3.6.tgz#7c7b97191cb4f195f03ecab7d52f7902ed378320"
integrity sha512-yQ3rwFWRfwNUY7H5vpU0wfdkNSnvnJinhF9830Swlaxl03zsOjCfmX0ugac+3LtK0lYSgwL/KXc8oYL3mG4YFQ==
@@ -9108,6 +9167,11 @@ tinyexec@^0.3.2:
resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-0.3.2.tgz#941794e657a85e496577995c6eef66f53f42b3d2"
integrity sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==
+tinyexec@^1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-1.0.2.tgz#bdd2737fe2ba40bd6f918ae26642f264b99ca251"
+ integrity sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==
+
tinyglobby@^0.2.10:
version "0.2.12"
resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.12.tgz#ac941a42e0c5773bd0b5d08f32de82e74a1a61b5"
@@ -9319,6 +9383,11 @@ typeson@^6.0.0, typeson@^6.1.0:
resolved "https://registry.yarnpkg.com/typeson/-/typeson-6.1.0.tgz#5b2a53705a5f58ff4d6f82f965917cabd0d7448b"
integrity sha512-6FTtyGr8ldU0pfbvW/eOZrEtEkczHRUtduBnA90Jh9kMPCiFNnXIon3vF41N0S4tV1HHQt4Hk1j4srpESziCaA==
+ufo@^1.6.1:
+ version "1.6.1"
+ resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.6.1.tgz#ac2db1d54614d1b22c1d603e3aef44a85d8f146b"
+ integrity sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==
+
unbox-primitive@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.1.0.tgz#8d9d2c9edeea8460c7f35033a88867944934d1e2"
@@ -9384,13 +9453,6 @@ unique-string@^2.0.0:
dependencies:
crypto-random-string "^2.0.0"
-unist-util-stringify-position@^3.0.0:
- version "3.0.3"
- resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz#03ad3348210c2d930772d64b489580c13a7db39d"
- integrity sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==
- dependencies:
- "@types/unist" "^2.0.0"
-
universalify@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0"
@@ -9464,20 +9526,10 @@ util-deprecate@^1.0.1:
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==
-uuid@^9.0.0:
- version "9.0.1"
- resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30"
- integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==
-
-uvu@^0.5.0:
- version "0.5.6"
- resolved "https://registry.yarnpkg.com/uvu/-/uvu-0.5.6.tgz#2754ca20bcb0bb59b64e9985e84d2e81058502df"
- integrity sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==
- dependencies:
- dequal "^2.0.0"
- diff "^5.0.0"
- kleur "^4.0.3"
- sade "^1.7.3"
+uuid@^11.1.0:
+ version "11.1.0"
+ resolved "https://registry.yarnpkg.com/uuid/-/uuid-11.1.0.tgz#9549028be1753bb934fc96e2bca09bb4105ae912"
+ integrity sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==
v8-compile-cache@^2.0.3:
version "2.4.0"
@@ -9625,6 +9677,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz#108bdb09b4400705176b957ceca9e0880e9b6d4e"
integrity sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==
+ version "8.2.0"
+ resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz#f43dfa35fb51e763d17cd94dcca0c9458f35abf9"
+ integrity sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==
+
vscode-languageclient@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-7.0.0.tgz#b505c22c21ffcf96e167799757fca07a6bad0fb2"
@@ -9642,7 +9699,15 @@ [email protected]:
vscode-jsonrpc "6.0.0"
vscode-languageserver-types "3.16.0"
-vscode-languageserver-textdocument@^1.0.1:
+ version "3.17.5"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz#864a8b8f390835572f4e13bd9f8313d0e3ac4bea"
+ integrity sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==
+ dependencies:
+ vscode-jsonrpc "8.2.0"
+ vscode-languageserver-types "3.17.5"
+
+vscode-languageserver-textdocument@^1.0.1, vscode-languageserver-textdocument@~1.0.11:
version "1.0.12"
resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz#457ee04271ab38998a093c68c2342f53f6e4a631"
integrity sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==
@@ -9652,6 +9717,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz#ecf393fc121ec6974b2da3efb3155644c514e247"
integrity sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==
+ version "3.17.5"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz#3273676f0cf2eab40b3f44d085acbb7f08a39d8a"
+ integrity sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==
+
vscode-languageserver@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-7.0.0.tgz#49b068c87cfcca93a356969d20f5d9bdd501c6b0"
@@ -9659,11 +9729,23 @@ vscode-languageserver@^7.0.0:
dependencies:
vscode-languageserver-protocol "3.16.0"
+vscode-languageserver@~9.0.1:
+ version "9.0.1"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz#500aef82097eb94df90d008678b0b6b5f474015b"
+ integrity sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==
+ dependencies:
+ vscode-languageserver-protocol "3.17.5"
+
vscode-uri@^3.0.2:
version "3.1.0"
resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.1.0.tgz#dd09ec5a66a38b5c3fffc774015713496d14e09c"
integrity sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==
+vscode-uri@~3.0.8:
+ version "3.0.8"
+ resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f"
+ integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==
+
w3c-xmlserializer@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz#aebdc84920d806222936e3cdce408e32488a3073"
@@ -9691,11 +9773,6 @@ web-vitals@^4.2.4:
resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-4.2.4.tgz#1d20bc8590a37769bd0902b289550936069184b7"
integrity sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw==
-web-worker@^1.2.0:
- version "1.5.0"
- resolved "https://registry.yarnpkg.com/web-worker/-/web-worker-1.5.0.tgz#71b2b0fbcc4293e8f0aa4f6b8a3ffebff733dcc5"
- integrity sha512-RiMReJrTAiA+mBjGONMnjVDP2u3p9R1vkcGz6gDIrOMT3oGuYwX2WRMYI9ipkphSuE5XKEhydbhNEJh4NY9mlw==
-
webidl-conversions@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"