excalidraw/src/actions/actionSelectAll.ts

14 lines
359 B
TypeScript
Raw Normal View History

2020-01-19 13:21:33 -08:00
import { KEYS } from "../keys";
import { register } from "./register";
export const actionSelectAll = register({
name: "selectAll",
perform: elements => {
return {
2020-01-24 12:04:54 +02:00
elements: elements.map(elem => ({ ...elem, isSelected: true })),
};
},
contextItemLabel: "labels.selectAll",
keyTest: event => event[KEYS.META] && event.key === "a",
});