mirror of
				https://github.com/excalidraw/excalidraw.git
				synced 2025-11-04 12:54:23 +01:00 
			
		
		
		
	feat: upgrade mermaid-to-excalidraw to v1.1.0 (#8226)
* feat: upgrade mermaid-to-excalidraw to v1.1.0 * fixes * upgrade and remove config as its redundant * lint * upgrade to v1.1.0
This commit is contained in:
		@@ -49,7 +49,6 @@ import {
 | 
			
		||||
import type { PastedMixedContent } from "../clipboard";
 | 
			
		||||
import { copyTextToSystemClipboard, parseClipboard } from "../clipboard";
 | 
			
		||||
import type { EXPORT_IMAGE_TYPES } from "../constants";
 | 
			
		||||
import { DEFAULT_FONT_SIZE } from "../constants";
 | 
			
		||||
import {
 | 
			
		||||
  APP_NAME,
 | 
			
		||||
  CURSOR_TYPE,
 | 
			
		||||
@@ -3055,9 +3054,7 @@ class App extends React.Component<AppProps, AppState> {
 | 
			
		||||
 | 
			
		||||
          try {
 | 
			
		||||
            const { elements: skeletonElements, files } =
 | 
			
		||||
              await api.parseMermaidToExcalidraw(data.text, {
 | 
			
		||||
                fontSize: DEFAULT_FONT_SIZE,
 | 
			
		||||
              });
 | 
			
		||||
              await api.parseMermaidToExcalidraw(data.text);
 | 
			
		||||
 | 
			
		||||
            const elements = convertToExcalidrawElements(skeletonElements, {
 | 
			
		||||
              regenerateIds: true,
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,6 @@
 | 
			
		||||
import type { MermaidOptions } from "@excalidraw/mermaid-to-excalidraw";
 | 
			
		||||
import type { MermaidConfig } from "@excalidraw/mermaid-to-excalidraw";
 | 
			
		||||
import type { MermaidToExcalidrawResult } from "@excalidraw/mermaid-to-excalidraw/dist/interfaces";
 | 
			
		||||
import {
 | 
			
		||||
  DEFAULT_EXPORT_PADDING,
 | 
			
		||||
  DEFAULT_FONT_SIZE,
 | 
			
		||||
  EDITOR_LS_KEYS,
 | 
			
		||||
} from "../../constants";
 | 
			
		||||
import { DEFAULT_EXPORT_PADDING, EDITOR_LS_KEYS } from "../../constants";
 | 
			
		||||
import { convertToExcalidrawElements, exportToCanvas } from "../../index";
 | 
			
		||||
import type { NonDeletedExcalidrawElement } from "../../element/types";
 | 
			
		||||
import type { AppClassProperties, BinaryFiles } from "../../types";
 | 
			
		||||
@@ -38,7 +34,7 @@ export interface MermaidToExcalidrawLibProps {
 | 
			
		||||
  api: Promise<{
 | 
			
		||||
    parseMermaidToExcalidraw: (
 | 
			
		||||
      definition: string,
 | 
			
		||||
      options: MermaidOptions,
 | 
			
		||||
      config?: MermaidConfig,
 | 
			
		||||
    ) => Promise<MermaidToExcalidrawResult>;
 | 
			
		||||
  }>;
 | 
			
		||||
}
 | 
			
		||||
@@ -78,15 +74,10 @@ export const convertMermaidToExcalidraw = async ({
 | 
			
		||||
 | 
			
		||||
    let ret;
 | 
			
		||||
    try {
 | 
			
		||||
      ret = await api.parseMermaidToExcalidraw(mermaidDefinition, {
 | 
			
		||||
        fontSize: DEFAULT_FONT_SIZE,
 | 
			
		||||
      });
 | 
			
		||||
      ret = await api.parseMermaidToExcalidraw(mermaidDefinition);
 | 
			
		||||
    } catch (err: any) {
 | 
			
		||||
      ret = await api.parseMermaidToExcalidraw(
 | 
			
		||||
        mermaidDefinition.replace(/"/g, "'"),
 | 
			
		||||
        {
 | 
			
		||||
          fontSize: DEFAULT_FONT_SIZE,
 | 
			
		||||
        },
 | 
			
		||||
      );
 | 
			
		||||
    }
 | 
			
		||||
    const { elements, files } = ret;
 | 
			
		||||
 
 | 
			
		||||
@@ -58,7 +58,7 @@
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "@braintree/sanitize-url": "6.0.2",
 | 
			
		||||
    "@excalidraw/laser-pointer": "1.3.1",
 | 
			
		||||
    "@excalidraw/mermaid-to-excalidraw": "1.0.0",
 | 
			
		||||
    "@excalidraw/mermaid-to-excalidraw": "1.1.0",
 | 
			
		||||
    "@excalidraw/random-username": "1.1.0",
 | 
			
		||||
    "@radix-ui/react-popover": "1.0.3",
 | 
			
		||||
    "@radix-ui/react-tabs": "1.0.2",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user