From 557add5bf7dd1d682e5802e5a6289cdb895b1593 Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Wed, 6 Dec 2023 21:31:54 +0530 Subject: [PATCH] =?UTF-8?q?feat:=20Support=20Mermaid=20Class=20diagrams=20?= =?UTF-8?q?=F0=9F=A5=B3=20(#7381)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: support mermaid class diagrams * upgrade mermaid-to-excalidraw * upgrade mermaid-to-excalidraw * add sequence diagrams in supported chart types * upgrade mermaid-to-excalidraw * update i18n --- package.json | 2 +- src/components/TTDDialog/MermaidToExcalidraw.tsx | 3 +++ src/locales/en.json | 2 +- src/tests/__snapshots__/MermaidToExcalidraw.test.tsx.snap | 2 +- yarn.lock | 8 ++++---- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 78ab513b..872a0c51 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "dependencies": { "@braintree/sanitize-url": "6.0.2", "@excalidraw/laser-pointer": "1.2.0", - "@excalidraw/mermaid-to-excalidraw": "0.1.2", + "@excalidraw/mermaid-to-excalidraw": "0.2.0", "@excalidraw/random-username": "1.1.0", "@radix-ui/react-popover": "1.0.3", "@radix-ui/react-tabs": "1.0.2", diff --git a/src/components/TTDDialog/MermaidToExcalidraw.tsx b/src/components/TTDDialog/MermaidToExcalidraw.tsx index df9f4b8b..237cb260 100644 --- a/src/components/TTDDialog/MermaidToExcalidraw.tsx +++ b/src/components/TTDDialog/MermaidToExcalidraw.tsx @@ -88,6 +88,9 @@ const MermaidToExcalidraw = ({ {el} )} + classLink={(el) => ( + {el} + )} /> diff --git a/src/locales/en.json b/src/locales/en.json index 95c6eb2e..2f845bb1 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -518,7 +518,7 @@ "mermaid": { "title": "Mermaid to Excalidraw", "button": "Insert", - "description": "Currently only Flowcharts and Sequence Diagrams are supported. The other types will be rendered as image in Excalidraw.", + "description": "Currently only Flowchart, Sequence, and Class Diagrams are supported. The other types will be rendered as image in Excalidraw.", "syntax": "Mermaid Syntax", "preview": "Preview" } diff --git a/src/tests/__snapshots__/MermaidToExcalidraw.test.tsx.snap b/src/tests/__snapshots__/MermaidToExcalidraw.test.tsx.snap index c9338966..41388038 100644 --- a/src/tests/__snapshots__/MermaidToExcalidraw.test.tsx.snap +++ b/src/tests/__snapshots__/MermaidToExcalidraw.test.tsx.snap @@ -1,7 +1,7 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`Test > should open mermaid popup when active tool is mermaid 1`] = ` -"

Mermaid to Excalidraw

Currently only Flowcharts and Sequence Diagrams are supported. The other types will be rendered as image in Excalidraw.