More export events (#2441)
This commit is contained in:
parent
abde1daba4
commit
0ef60dce2d
67
analytics.md
67
analytics.md
@ -1,31 +1,36 @@
|
|||||||
| Excalidraw | Name | Category | Label | Value |
|
| Excalidraw | Name | Category | Label | Value |
|
||||||
| ------------------ | ------ | ---------------------------------- | ----------------------- | --------- |
|
| -------------------- | ------ | ---------------------------------- | ------------------------ | --------- |
|
||||||
| Shape / Selection | shape | selection, rectangle, diamond, etc | `toolbar` or `shortcut` |
|
| Shape / Selection | shape | selection, rectangle, diamond, etc | `toolbar` or `shortcut` |
|
||||||
| Lock selection | shape | lock | `on` or `off` |
|
| Text on double click | shape | text | `double-click` |
|
||||||
| Load file | action | load | `MIME type` |
|
| Lock selection | shape | lock | `on` or `off` |
|
||||||
| Import from URL | action | import |
|
| Load file | action | load | `MIME type` |
|
||||||
| Save | action | save |
|
| Import from URL | action | import |
|
||||||
| Save as | action | save as |
|
| Save | action | save |
|
||||||
| Clear canvas | action | clear canvas |
|
| Save as | action | save as |
|
||||||
| Zoom in | action | zoom | in | `zoom` |
|
| Clear canvas | action | clear canvas |
|
||||||
| Zoom out | action | zoom | out | `zoom` |
|
| Zoom in | action | zoom | in | `zoom` |
|
||||||
| Zoom fit | action | zoom | fit | `zoom` |
|
| Zoom out | action | zoom | out | `zoom` |
|
||||||
| Zoom reset | action | zoom | reset | `zoom` |
|
| Zoom fit | action | zoom | fit | `zoom` |
|
||||||
| Open shortcut menu | action | keyboard shortcuts |
|
| Zoom reset | action | zoom | reset | `zoom` |
|
||||||
| Canvas color | change | canvas color | `color` |
|
| Export dialog | action | export | dialog |
|
||||||
| Background color | change | background color | `color` |
|
| Export to backend | action | export | backend |
|
||||||
| Stroke color | change | stroke color | `color` |
|
| Export as SVG | action | export | `svg` or `clipboard-svg` |
|
||||||
| Stroke width | change | stroke | width | `width` |
|
| Export to PNG | action | export | `png` or `clipboard-png` |
|
||||||
| Stroke sloppiness | change | stroke | sloppiness | `value` |
|
| Open shortcut menu | action | keyboard shortcuts |
|
||||||
| Fill | change | fill | `value` |
|
| Canvas color | change | canvas color | `color` |
|
||||||
| Edge | change | edge | `value` |
|
| Background color | change | background color | `color` |
|
||||||
| Opacity | change | opacity | value | `opacity` |
|
| Stroke color | change | stroke color | `color` |
|
||||||
| Project name | change | title |
|
| Stroke width | change | stroke | width | `width` |
|
||||||
| Theme | change | theme | `light` or `dark` |
|
| Stroke sloppiness | change | stroke | sloppiness | `value` |
|
||||||
| Change language | change | language | `language` |
|
| Fill | change | fill | `value` |
|
||||||
| Language on load | change | language on load | `language` |
|
| Edge | change | edge | `value` |
|
||||||
| E2EE shield | exit | e2ee shield |
|
| Opacity | change | opacity | value | `opacity` |
|
||||||
| GitHub corner | exit | github |
|
| Project name | change | title |
|
||||||
| Excalidraw blog | exit | blog |
|
| Theme | change | theme | `light` or `dark` |
|
||||||
| Excalidraw guides | exit | guides |
|
| Change language | change | language | `language` |
|
||||||
| File issues | exit | issues |
|
| Language on load | change | language on load | `language` |
|
||||||
|
| E2EE shield | exit | e2ee shield |
|
||||||
|
| GitHub corner | exit | github |
|
||||||
|
| Excalidraw blog | exit | blog |
|
||||||
|
| Excalidraw guides | exit | guides |
|
||||||
|
| File issues | exit | issues |
|
||||||
|
@ -2029,6 +2029,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||||||
resetCursor();
|
resetCursor();
|
||||||
|
|
||||||
if (!event[KEYS.CTRL_OR_CMD]) {
|
if (!event[KEYS.CTRL_OR_CMD]) {
|
||||||
|
trackEvent(EVENT_SHAPE, "text", "double-click");
|
||||||
this.startTextEditing({
|
this.startTextEditing({
|
||||||
sceneX,
|
sceneX,
|
||||||
sceneY,
|
sceneY,
|
||||||
|
@ -18,6 +18,7 @@ import useIsMobile from "../is-mobile";
|
|||||||
import { Dialog } from "./Dialog";
|
import { Dialog } from "./Dialog";
|
||||||
import { canvasToBlob } from "../data/blob";
|
import { canvasToBlob } from "../data/blob";
|
||||||
import { CanvasError } from "../errors";
|
import { CanvasError } from "../errors";
|
||||||
|
import { EVENT_ACTION, trackEvent } from "../analytics";
|
||||||
|
|
||||||
const scales = [1, 2, 3];
|
const scales = [1, 2, 3];
|
||||||
const defaultScale = scales.includes(devicePixelRatio) ? devicePixelRatio : 1;
|
const defaultScale = scales.includes(devicePixelRatio) ? devicePixelRatio : 1;
|
||||||
@ -250,7 +251,10 @@ export const ExportDialog = ({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ToolButton
|
<ToolButton
|
||||||
onClick={() => setModalIsShown(true)}
|
onClick={() => {
|
||||||
|
trackEvent(EVENT_ACTION, "export", "dialog");
|
||||||
|
setModalIsShown(true);
|
||||||
|
}}
|
||||||
icon={exportFile}
|
icon={exportFile}
|
||||||
type="button"
|
type="button"
|
||||||
aria-label={t("buttons.export")}
|
aria-label={t("buttons.export")}
|
||||||
|
@ -218,6 +218,7 @@ export const exportToBackend = async (
|
|||||||
url.hash = `json=${json.id},${exportedKey.k!}`;
|
url.hash = `json=${json.id},${exportedKey.k!}`;
|
||||||
const urlString = url.toString();
|
const urlString = url.toString();
|
||||||
window.prompt(`🔒${t("alerts.uploadedSecurly")}`, urlString);
|
window.prompt(`🔒${t("alerts.uploadedSecurly")}`, urlString);
|
||||||
|
trackEvent(EVENT_ACTION, "export", "backend");
|
||||||
} else if (json.error_class === "RequestTooLargeError") {
|
} else if (json.error_class === "RequestTooLargeError") {
|
||||||
window.alert(t("alerts.couldNotCreateShareableLinkTooBig"));
|
window.alert(t("alerts.couldNotCreateShareableLinkTooBig"));
|
||||||
} else {
|
} else {
|
||||||
@ -321,8 +322,10 @@ export const exportCanvas = async (
|
|||||||
fileName: `${name}.svg`,
|
fileName: `${name}.svg`,
|
||||||
extensions: [".svg"],
|
extensions: [".svg"],
|
||||||
});
|
});
|
||||||
|
trackEvent(EVENT_ACTION, "export", "svg");
|
||||||
return;
|
return;
|
||||||
} else if (type === "clipboard-svg") {
|
} else if (type === "clipboard-svg") {
|
||||||
|
trackEvent(EVENT_ACTION, "export", "clipboard-svg");
|
||||||
copyTextToSystemClipboard(tempSvg.outerHTML);
|
copyTextToSystemClipboard(tempSvg.outerHTML);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -354,9 +357,11 @@ export const exportCanvas = async (
|
|||||||
fileName,
|
fileName,
|
||||||
extensions: [".png"],
|
extensions: [".png"],
|
||||||
});
|
});
|
||||||
|
trackEvent(EVENT_ACTION, "export", "png");
|
||||||
} else if (type === "clipboard") {
|
} else if (type === "clipboard") {
|
||||||
try {
|
try {
|
||||||
await copyCanvasToClipboardAsPng(tempCanvas);
|
await copyCanvasToClipboardAsPng(tempCanvas);
|
||||||
|
trackEvent(EVENT_ACTION, "export", "clipboard-png");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.name === "CANVAS_POSSIBLY_TOO_BIG") {
|
if (error.name === "CANVAS_POSSIBLY_TOO_BIG") {
|
||||||
throw error;
|
throw error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user