Add modal typing back in, and clean up old constraints code (#865)
* Revert "Revert "Improve Prop Typings for Modals. Remove instances of `any`. (… (#813)"
This reverts commit 9822576077
.
* tsc
* refactor all buttons
* add parallel constraint
* typegen?
* add constraint removal constraint
* add perpendicular distance constraint
* state diagram layout
* fmt
* improve modal typing for setAngleLength
This commit is contained in:
@ -41,6 +41,7 @@ import {
|
||||
setCodeMirrorCursor,
|
||||
useStore,
|
||||
} from 'useStore'
|
||||
import { applyConstraintIntersect } from './Toolbar/Intersect'
|
||||
|
||||
type MachineContext<T extends AnyStateMachine> = {
|
||||
state: StateFrom<T>
|
||||
@ -372,6 +373,22 @@ export const ModelingMachineProvider = ({
|
||||
),
|
||||
}
|
||||
},
|
||||
'Get perpendicular distance info': async ({
|
||||
selectionRanges,
|
||||
}): Promise<SetSelections> => {
|
||||
const { modifiedAst, pathToNodeMap } = await applyConstraintIntersect({
|
||||
selectionRanges,
|
||||
})
|
||||
await kclManager.updateAst(modifiedAst, true)
|
||||
return {
|
||||
selectionType: 'completeSelection',
|
||||
selection: pathMapToSelections(
|
||||
kclManager.ast,
|
||||
selectionRanges,
|
||||
pathToNodeMap
|
||||
),
|
||||
}
|
||||
},
|
||||
},
|
||||
devTools: true,
|
||||
})
|
||||
|
Reference in New Issue
Block a user