From 8f0863d33532c1b3a9f727d90d1d1526e8254a24 Mon Sep 17 00:00:00 2001 From: Achille Lacoin Date: Fri, 22 Apr 2022 18:31:31 +0200 Subject: [PATCH] add a prefix to the extension for image embbedding sceneData (#5079) --- src/constants.ts | 2 ++ src/data/filesystem.ts | 2 ++ src/data/index.ts | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index 78e70f65..8d2ae346 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -94,7 +94,9 @@ export const MIME_TYPES = { excalidrawlib: "application/vnd.excalidrawlib+json", json: "application/json", svg: "image/svg+xml", + "excalidraw.svg": "image/svg+xml", png: "image/png", + "excalidraw.png": "image/png", jpg: "image/jpeg", gif: "image/gif", binary: "application/octet-stream", diff --git a/src/data/filesystem.ts b/src/data/filesystem.ts index 55f41171..8db365c6 100644 --- a/src/data/filesystem.ts +++ b/src/data/filesystem.ts @@ -13,7 +13,9 @@ type FILE_EXTENSION = | "gif" | "jpg" | "png" + | "excalidraw.png" | "svg" + | "excalidraw.svg" | "json" | "excalidraw" | "excalidrawlib"; diff --git a/src/data/index.ts b/src/data/index.ts index 5cfaaa97..8ea90adf 100644 --- a/src/data/index.ts +++ b/src/data/index.ts @@ -56,7 +56,7 @@ export const exportCanvas = async ( { description: "Export to SVG", name, - extension: "svg", + extension: appState.exportEmbedScene ? "excalidraw.svg" : "svg", fileHandle, }, ); @@ -89,7 +89,7 @@ export const exportCanvas = async ( return await fileSave(blob, { description: "Export to PNG", name, - extension: "png", + extension: appState.exportEmbedScene ? "excalidraw.png" : "png", fileHandle, }); } else if (type === "clipboard") {