mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Add more events for sharing and refactor I/O, dialogs (#2443)
This commit is contained in:
parent
c43109a230
commit
66e5b18e4e
10 changed files with 87 additions and 75 deletions
|
@ -1,24 +1,21 @@
|
|||
import "./ExportDialog.scss";
|
||||
|
||||
import React, { useState, useEffect, useRef } from "react";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import { render, unmountComponentAtNode } from "react-dom";
|
||||
|
||||
import { ToolButton } from "./ToolButton";
|
||||
import { clipboard, exportFile, link } from "./icons";
|
||||
import { NonDeletedExcalidrawElement } from "../element/types";
|
||||
import { AppState } from "../types";
|
||||
import { exportToCanvas, getExportSize } from "../scene/export";
|
||||
import { ActionsManagerInterface } from "../actions/types";
|
||||
import Stack from "./Stack";
|
||||
import { t } from "../i18n";
|
||||
|
||||
import { EVENT_DIALOG, trackEvent } from "../analytics";
|
||||
import { probablySupportsClipboardBlob } from "../clipboard";
|
||||
import { getSelectedElements, isSomeElementSelected } from "../scene";
|
||||
import useIsMobile from "../is-mobile";
|
||||
import { Dialog } from "./Dialog";
|
||||
import { canvasToBlob } from "../data/blob";
|
||||
import { NonDeletedExcalidrawElement } from "../element/types";
|
||||
import { CanvasError } from "../errors";
|
||||
import { EVENT_ACTION, trackEvent } from "../analytics";
|
||||
import { t } from "../i18n";
|
||||
import useIsMobile from "../is-mobile";
|
||||
import { getSelectedElements, isSomeElementSelected } from "../scene";
|
||||
import { exportToCanvas, getExportSize } from "../scene/export";
|
||||
import { AppState } from "../types";
|
||||
import { Dialog } from "./Dialog";
|
||||
import "./ExportDialog.scss";
|
||||
import { clipboard, exportFile, link } from "./icons";
|
||||
import Stack from "./Stack";
|
||||
import { ToolButton } from "./ToolButton";
|
||||
|
||||
const scales = [1, 2, 3];
|
||||
const defaultScale = scales.includes(devicePixelRatio) ? devicePixelRatio : 1;
|
||||
|
@ -252,7 +249,7 @@ export const ExportDialog = ({
|
|||
<>
|
||||
<ToolButton
|
||||
onClick={() => {
|
||||
trackEvent(EVENT_ACTION, "export", "dialog");
|
||||
trackEvent(EVENT_DIALOG, "export");
|
||||
setModalIsShown(true);
|
||||
}}
|
||||
icon={exportFile}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue