|
@@ -17,6 +17,7 @@ import { ExcalidrawElement } from "../element/types";
|
|
import { AppState } from "../types";
|
|
import { AppState } from "../types";
|
|
import { alignElements, Alignment } from "../align";
|
|
import { alignElements, Alignment } from "../align";
|
|
import { getShortcutKey } from "../utils";
|
|
import { getShortcutKey } from "../utils";
|
|
|
|
+import { trackEvent, EVENT_ALIGN } from "../analytics";
|
|
|
|
|
|
const enableActionGroup = (
|
|
const enableActionGroup = (
|
|
elements: readonly ExcalidrawElement[],
|
|
elements: readonly ExcalidrawElement[],
|
|
@@ -43,6 +44,7 @@ const alignSelectedElements = (
|
|
export const actionAlignTop = register({
|
|
export const actionAlignTop = register({
|
|
name: "alignTop",
|
|
name: "alignTop",
|
|
perform: (elements, appState) => {
|
|
perform: (elements, appState) => {
|
|
|
|
+ trackEvent(EVENT_ALIGN, "align", "top");
|
|
return {
|
|
return {
|
|
appState,
|
|
appState,
|
|
elements: alignSelectedElements(elements, appState, {
|
|
elements: alignSelectedElements(elements, appState, {
|
|
@@ -72,6 +74,7 @@ export const actionAlignTop = register({
|
|
export const actionAlignBottom = register({
|
|
export const actionAlignBottom = register({
|
|
name: "alignBottom",
|
|
name: "alignBottom",
|
|
perform: (elements, appState) => {
|
|
perform: (elements, appState) => {
|
|
|
|
+ trackEvent(EVENT_ALIGN, "align", "bottom");
|
|
return {
|
|
return {
|
|
appState,
|
|
appState,
|
|
elements: alignSelectedElements(elements, appState, {
|
|
elements: alignSelectedElements(elements, appState, {
|
|
@@ -101,6 +104,7 @@ export const actionAlignBottom = register({
|
|
export const actionAlignLeft = register({
|
|
export const actionAlignLeft = register({
|
|
name: "alignLeft",
|
|
name: "alignLeft",
|
|
perform: (elements, appState) => {
|
|
perform: (elements, appState) => {
|
|
|
|
+ trackEvent(EVENT_ALIGN, "align", "left");
|
|
return {
|
|
return {
|
|
appState,
|
|
appState,
|
|
elements: alignSelectedElements(elements, appState, {
|
|
elements: alignSelectedElements(elements, appState, {
|
|
@@ -130,6 +134,7 @@ export const actionAlignLeft = register({
|
|
export const actionAlignRight = register({
|
|
export const actionAlignRight = register({
|
|
name: "alignRight",
|
|
name: "alignRight",
|
|
perform: (elements, appState) => {
|
|
perform: (elements, appState) => {
|
|
|
|
+ trackEvent(EVENT_ALIGN, "align", "right");
|
|
return {
|
|
return {
|
|
appState,
|
|
appState,
|
|
elements: alignSelectedElements(elements, appState, {
|
|
elements: alignSelectedElements(elements, appState, {
|
|
@@ -159,6 +164,7 @@ export const actionAlignRight = register({
|
|
export const actionAlignVerticallyCentered = register({
|
|
export const actionAlignVerticallyCentered = register({
|
|
name: "alignVerticallyCentered",
|
|
name: "alignVerticallyCentered",
|
|
perform: (elements, appState) => {
|
|
perform: (elements, appState) => {
|
|
|
|
+ trackEvent(EVENT_ALIGN, "vertically", "center");
|
|
return {
|
|
return {
|
|
appState,
|
|
appState,
|
|
elements: alignSelectedElements(elements, appState, {
|
|
elements: alignSelectedElements(elements, appState, {
|
|
@@ -184,6 +190,7 @@ export const actionAlignVerticallyCentered = register({
|
|
export const actionAlignHorizontallyCentered = register({
|
|
export const actionAlignHorizontallyCentered = register({
|
|
name: "alignHorizontallyCentered",
|
|
name: "alignHorizontallyCentered",
|
|
perform: (elements, appState) => {
|
|
perform: (elements, appState) => {
|
|
|
|
+ trackEvent(EVENT_ALIGN, "horizontally", "center");
|
|
return {
|
|
return {
|
|
appState,
|
|
appState,
|
|
elements: alignSelectedElements(elements, appState, {
|
|
elements: alignSelectedElements(elements, appState, {
|