feat(editor): mermaid code editor & improve parsing (#10897)

This commit is contained in:
David Luzar
2026-03-05 18:52:41 +01:00
committed by GitHub
parent 47c254216b
commit c1dbbdf678
19 changed files with 1490 additions and 45 deletions
@@ -1,5 +1,4 @@
import React from "react";
import { expect } from "vitest";
import { expect, vi } from "vitest";
import { Excalidraw } from "../index";
@@ -7,6 +6,13 @@ import { mockMermaidToExcalidraw } from "./helpers/mocks";
import { getTextEditor, updateTextEditor } from "./queries/dom";
import { render, waitFor } from "./test-utils";
// Mock CodeMirror deps so the dynamic import of CodeMirrorEditor fails,
// causing TTDDialogInput to fall back to <textarea> in tests.
vi.mock("@codemirror/view", () => ({}));
vi.mock("@codemirror/state", () => ({}));
vi.mock("@codemirror/language", () => ({}));
vi.mock("@lezer/highlight", () => ({}));
mockMermaidToExcalidraw({
mockRef: true,
parseMermaidToExcalidraw: async (definition) => {