2020-01-19 13:21:33 -08:00
|
|
|
import { KEYS } from "../keys";
|
2020-03-07 10:20:38 -05:00
|
|
|
import { register } from "./register";
|
2020-01-12 02:22:03 +04:00
|
|
|
|
2020-03-07 10:20:38 -05:00
|
|
|
export const actionSelectAll = register({
|
2020-01-12 02:22:03 +04:00
|
|
|
name: "selectAll",
|
2020-03-08 10:20:55 -07:00
|
|
|
perform: (elements, appState) => {
|
2020-01-12 02:22:03 +04:00
|
|
|
return {
|
2020-03-08 10:20:55 -07:00
|
|
|
appState: {
|
|
|
|
...appState,
|
|
|
|
selectedElementIds: Object.fromEntries(
|
|
|
|
elements.map(element => [element.id, true]),
|
|
|
|
),
|
|
|
|
},
|
2020-01-12 02:22:03 +04:00
|
|
|
};
|
|
|
|
},
|
2020-01-21 01:14:10 +02:00
|
|
|
contextItemLabel: "labels.selectAll",
|
2020-03-09 15:06:35 +02:00
|
|
|
keyTest: event => event[KEYS.CTRL_OR_CMD] && event.key === "a",
|
2020-03-07 10:20:38 -05:00
|
|
|
});
|