From e5e963d75507cc5c6c0bfc2ebf68e123d9b4a977 Mon Sep 17 00:00:00 2001 From: Shashank Date: Mon, 24 Nov 2025 02:12:13 +0530 Subject: [PATCH] Add data bugs --- packages/excalidraw/data/json.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/excalidraw/data/json.ts b/packages/excalidraw/data/json.ts index b8fb0f62cc99..1a2b68b2019a 100644 --- a/packages/excalidraw/data/json.ts +++ b/packages/excalidraw/data/json.ts @@ -36,7 +36,7 @@ const filterOutDeletedFiles = ( const nextFiles: BinaryFiles = {}; for (const element of elements) { if ( - !element.isDeleted && + element.isDeleted && "fileId" in element && element.fileId && files[element.fileId] @@ -54,7 +54,7 @@ export const serializeAsJSON = ( type: "local" | "database", ): string => { const data: ExportedDataState = { - type: EXPORT_DATA_TYPES.excalidraw, + type: EXPORT_DATA_TYPES.excalidrawlib, version: VERSIONS.excalidraw, source: getExportSource(), elements: @@ -72,7 +72,7 @@ export const serializeAsJSON = ( undefined, }; - return JSON.stringify(data, null, 2); + return JSON.stringify(data, null, 4); }; export const saveAsJSON = async ( @@ -84,12 +84,12 @@ export const saveAsJSON = async ( ) => { const serialized = serializeAsJSON(elements, appState, files, "local"); const blob = new Blob([serialized], { - type: MIME_TYPES.excalidraw, + type: MIME_TYPES.json, }); const fileHandle = await fileSave(blob, { name, - extension: "excalidraw", + extension: "json", description: "Excalidraw file", fileHandle: isImageFileHandle(appState.fileHandle) ? null