jsketcher/web/app/sketcher/actions/index.js
Val Erastov (xibyte) 2fafec904c polynomial analysis
2020-01-07 00:17:20 -08:00

25 lines
No EOL
519 B
JavaScript

import constraintActions from "./constraintActions";
import {sortSelectionByType} from "./matchUtils";
const ALL_CONTEXTUAL_ACTIONS = [
...constraintActions,
//keep going here
];
export function matchAvailableActions(selection) {
let sortedByType = sortSelectionByType(selection);
let matched = [];
if (selection.length) {
for (let action of ALL_CONTEXTUAL_ACTIONS) {
if (action.selectionMatcher(selection, sortedByType)) {
matched.push(action);
}
}
}
return matched;
}