excalidraw/src/actions/actionSelectAll.ts

14 lines
354 B
TypeScript
Raw Normal View History

import { Action } from "./types";
2020-01-19 13:21:33 -08:00
import { KEYS } from "../keys";
export const actionSelectAll: Action = {
name: "selectAll",
perform: elements => {
return {
elements: elements.map(elem => ({ ...elem, isSelected: true }))
};
},
contextItemLabel: "labels.selectAll",
2020-01-19 13:21:33 -08:00
keyTest: event => event[KEYS.META] && event.code === "KeyA"
};