mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Add library events (#2448)
This commit is contained in:
parent
a2132c9bb7
commit
e392bebc40
7 changed files with 35 additions and 4 deletions
|
@ -7,6 +7,7 @@ import { loadFromBlob } from "./blob";
|
|||
import { Library } from "./library";
|
||||
import { MIME_TYPES } from "../constants";
|
||||
import { clearElementsForExport } from "../element";
|
||||
import { EVENT_LIBRARY, trackEvent } from "../analytics";
|
||||
|
||||
export const serializeAsJSON = (
|
||||
elements: readonly ExcalidrawElement[],
|
||||
|
@ -83,6 +84,7 @@ export const saveLibraryAsJSON = async () => {
|
|||
description: "Excalidraw library file",
|
||||
extensions: [".excalidrawlib"],
|
||||
});
|
||||
trackEvent(EVENT_LIBRARY, "save");
|
||||
};
|
||||
|
||||
export const importLibraryFromJSON = async () => {
|
||||
|
@ -91,5 +93,6 @@ export const importLibraryFromJSON = async () => {
|
|||
extensions: [".json", ".excalidrawlib"],
|
||||
mimeTypes: ["application/json"],
|
||||
});
|
||||
trackEvent(EVENT_LIBRARY, "load");
|
||||
Library.importLibrary(blob);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue