import React, { useState } from "react"; import { NonDeletedExcalidrawElement } from "../element/types"; import { t } from "../i18n"; import { AppState, ExportOpts, BinaryFiles } from "../types"; import { Dialog } from "./Dialog"; import { ExportIcon, exportToFileIcon, LinkIcon } from "./icons"; import { ToolButton } from "./ToolButton"; import { actionSaveFileToDisk } from "../actions/actionExport"; import { Card } from "./Card"; import "./ExportDialog.scss"; import { nativeFileSystemSupported } from "../data/filesystem"; import { trackEvent } from "../analytics"; import { ActionManager } from "../actions/manager"; import { getFrame } from "../utils"; import MenuItem from "./MenuItem"; export type ExportCB = ( elements: readonly NonDeletedExcalidrawElement[], scale?: number, ) => void; const JSONExportModal = ({ elements, appState, files, actionManager, exportOpts, canvas, }: { appState: AppState; files: BinaryFiles; elements: readonly NonDeletedExcalidrawElement[]; actionManager: ActionManager; onCloseRequest: () => void; exportOpts: ExportOpts; canvas: HTMLCanvasElement | null; }) => { const { onExportToBackend } = exportOpts; return (