massive refactor toDrop cascadeStudio and add CadQuery + OpenSCAD

resolves #400
This commit is contained in:
Kurt Hutten
2021-07-08 21:17:07 +10:00
parent 477a557eb8
commit 8e558d2342
158 changed files with 2335 additions and 2300 deletions

View File

@@ -3,15 +3,18 @@ import { useIdeContext } from 'src/helpers/hooks/useIdeContext'
import { makeCodeStoreKey, requestRender } from 'src/helpers/hooks/useIdeState'
import Editor, { useMonaco } from '@monaco-editor/react'
import { theme } from 'src/../tailwind.config'
import { useSaveCode } from 'src/components/IdeWrapper/useSaveCode'
const colors = theme.extend.colors
const IdeEditor = ({ Loading }) => {
const { state, thunkDispatch } = useIdeContext()
const [theme, setTheme] = useState('vs-dark')
const saveCode = useSaveCode()
const ideTypeToLanguageMap = {
cadQuery: 'python',
openScad: 'cpp',
cadquery: 'python',
openscad: 'cpp',
}
const monaco = useMonaco()
useEffect(() => {
@@ -49,6 +52,7 @@ const IdeEditor = ({ Loading }) => {
thunkDispatch((dispatch, getState) => {
const state = getState()
dispatch({ type: 'setLoading' })
saveCode({ code: state.code })
requestRender({
state,
dispatch,