mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: support pasting file contents & always prefer system clip (#3257)
This commit is contained in:
parent
13d9374cde
commit
94ad8eaa19
7 changed files with 41 additions and 28 deletions
|
@ -1,5 +1,5 @@
|
|||
import { cleanAppStateForExport } from "../appState";
|
||||
import { MIME_TYPES } from "../constants";
|
||||
import { EXPORT_DATA_TYPES, MIME_TYPES } from "../constants";
|
||||
import { clearElementsForExport } from "../element";
|
||||
import { CanvasError } from "../errors";
|
||||
import { t } from "../i18n";
|
||||
|
@ -121,7 +121,7 @@ export const loadFromBlob = async (
|
|||
export const loadLibraryFromBlob = async (blob: Blob) => {
|
||||
const contents = await parseFileContents(blob);
|
||||
const data: LibraryData = JSON.parse(contents);
|
||||
if (data.type !== "excalidrawlib") {
|
||||
if (data.type !== EXPORT_DATA_TYPES.excalidrawLibrary) {
|
||||
throw new Error(t("alerts.couldNotLoadInvalidFile"));
|
||||
}
|
||||
return data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue