mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Pass file extensions with leading dot after API change (#2149)
This commit is contained in:
parent
aaddde5dd9
commit
48c2a13c7a
4 changed files with 10 additions and 10 deletions
|
@ -313,7 +313,7 @@ export const exportCanvas = async (
|
|||
if (type === "svg") {
|
||||
await fileSave(new Blob([tempSvg.outerHTML], { type: "image/svg+xml" }), {
|
||||
fileName: `${name}.svg`,
|
||||
extensions: ["svg"],
|
||||
extensions: [".svg"],
|
||||
});
|
||||
return;
|
||||
} else if (type === "clipboard-svg") {
|
||||
|
@ -338,7 +338,7 @@ export const exportCanvas = async (
|
|||
if (blob) {
|
||||
await fileSave(blob, {
|
||||
fileName: fileName,
|
||||
extensions: ["png"],
|
||||
extensions: [".png"],
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -38,7 +38,7 @@ export const saveAsJSON = async (
|
|||
{
|
||||
fileName: name,
|
||||
description: "Excalidraw file",
|
||||
extensions: ["excalidraw"],
|
||||
extensions: [".excalidraw"],
|
||||
},
|
||||
fileHandle || null,
|
||||
);
|
||||
|
@ -47,7 +47,7 @@ export const saveAsJSON = async (
|
|||
export const loadFromJSON = async (appState: AppState) => {
|
||||
const blob = await fileOpen({
|
||||
description: "Excalidraw files",
|
||||
extensions: ["json", "excalidraw"],
|
||||
extensions: [".json", ".excalidraw"],
|
||||
mimeTypes: ["application/json"],
|
||||
});
|
||||
return loadFromBlob(blob, appState);
|
||||
|
@ -71,14 +71,14 @@ export const saveLibraryAsJSON = async () => {
|
|||
await fileSave(blob, {
|
||||
fileName,
|
||||
description: "Excalidraw library file",
|
||||
extensions: ["excalidrawlib"],
|
||||
extensions: [".excalidrawlib"],
|
||||
});
|
||||
};
|
||||
|
||||
export const importLibraryFromJSON = async () => {
|
||||
const blob = await fileOpen({
|
||||
description: "Excalidraw library files",
|
||||
extensions: ["json", "excalidrawlib"],
|
||||
extensions: [".json", ".excalidrawlib"],
|
||||
mimeTypes: ["application/json"],
|
||||
});
|
||||
Library.importLibrary(blob);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue