Clean up vite build warnings (#1332)
* WIP Clean up vite build warnings Fixes #1014 * Fix lint * Fix React Hooks dependencies Clean up, use void when await not straightforward * Clean up * Fix missing deconstruction
This commit is contained in:
@ -83,7 +83,7 @@ export function App() {
|
|||||||
useEngineConnectionSubscriptions()
|
useEngineConnectionSubscriptions()
|
||||||
|
|
||||||
const debounceSocketSend = throttle<EngineCommand>((message) => {
|
const debounceSocketSend = throttle<EngineCommand>((message) => {
|
||||||
engineCommandManager.sendSceneCommand(message)
|
void engineCommandManager.sendSceneCommand(message)
|
||||||
}, 16)
|
}, 16)
|
||||||
const handleMouseMove: MouseEventHandler<HTMLDivElement> = (e) => {
|
const handleMouseMove: MouseEventHandler<HTMLDivElement> = (e) => {
|
||||||
e.nativeEvent.preventDefault()
|
e.nativeEvent.preventDefault()
|
||||||
|
@ -138,14 +138,14 @@ export function useCalc({
|
|||||||
}, [kclManager.ast, kclManager.programMemory, selectionRange])
|
}, [kclManager.ast, kclManager.programMemory, selectionRange])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
try {
|
const execAstAndSetResult = async () => {
|
||||||
const code = `const __result__ = ${value}`
|
const code = `const __result__ = ${value}`
|
||||||
const ast = parse(code)
|
const ast = parse(code)
|
||||||
const _programMem: any = { root: {}, return: null }
|
const _programMem: any = { root: {}, return: null }
|
||||||
availableVarInfo.variables.forEach(({ key, value }) => {
|
availableVarInfo.variables.forEach(({ key, value }) => {
|
||||||
_programMem.root[key] = { type: 'userVal', value, __meta: [] }
|
_programMem.root[key] = { type: 'userVal', value, __meta: [] }
|
||||||
})
|
})
|
||||||
executeAst({
|
const { programMemory } = await executeAst({
|
||||||
ast,
|
ast,
|
||||||
engineCommandManager,
|
engineCommandManager,
|
||||||
defaultPlanes: kclManager.defaultPlanes,
|
defaultPlanes: kclManager.defaultPlanes,
|
||||||
@ -153,23 +153,23 @@ export function useCalc({
|
|||||||
programMemoryOverride: JSON.parse(
|
programMemoryOverride: JSON.parse(
|
||||||
JSON.stringify(kclManager.programMemory)
|
JSON.stringify(kclManager.programMemory)
|
||||||
),
|
),
|
||||||
}).then(({ programMemory }) => {
|
|
||||||
const resultDeclaration = ast.body.find(
|
|
||||||
(a) =>
|
|
||||||
a.type === 'VariableDeclaration' &&
|
|
||||||
a.declarations?.[0]?.id?.name === '__result__'
|
|
||||||
)
|
|
||||||
const init =
|
|
||||||
resultDeclaration?.type === 'VariableDeclaration' &&
|
|
||||||
resultDeclaration?.declarations?.[0]?.init
|
|
||||||
const result = programMemory?.root?.__result__?.value
|
|
||||||
setCalcResult(typeof result === 'number' ? String(result) : 'NAN')
|
|
||||||
init && setValueNode(init)
|
|
||||||
})
|
})
|
||||||
} catch (e) {
|
const resultDeclaration = ast.body.find(
|
||||||
|
(a) =>
|
||||||
|
a.type === 'VariableDeclaration' &&
|
||||||
|
a.declarations?.[0]?.id?.name === '__result__'
|
||||||
|
)
|
||||||
|
const init =
|
||||||
|
resultDeclaration?.type === 'VariableDeclaration' &&
|
||||||
|
resultDeclaration?.declarations?.[0]?.init
|
||||||
|
const result = programMemory?.root?.__result__?.value
|
||||||
|
setCalcResult(typeof result === 'number' ? String(result) : 'NAN')
|
||||||
|
init && setValueNode(init)
|
||||||
|
}
|
||||||
|
execAstAndSetResult().catch(() => {
|
||||||
setCalcResult('NAN')
|
setCalcResult('NAN')
|
||||||
setValueNode(null)
|
setValueNode(null)
|
||||||
}
|
})
|
||||||
}, [value, availableVarInfo])
|
}, [value, availableVarInfo])
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -93,7 +93,7 @@ export const ExportButton = ({ children, className }: ExportButtonProps) => {
|
|||||||
if (values.type === 'ply' || values.type === 'stl') {
|
if (values.type === 'ply' || values.type === 'stl') {
|
||||||
values.selection = { type: 'default_scene' }
|
values.selection = { type: 'default_scene' }
|
||||||
}
|
}
|
||||||
engineCommandManager.sendSceneCommand({
|
void engineCommandManager.sendSceneCommand({
|
||||||
type: 'modeling_cmd_req',
|
type: 'modeling_cmd_req',
|
||||||
cmd: {
|
cmd: {
|
||||||
type: 'export',
|
type: 'export',
|
||||||
|
@ -101,7 +101,7 @@ export const GlobalStateProvider = ({
|
|||||||
goToSignInPage: () => {
|
goToSignInPage: () => {
|
||||||
navigate(paths.SIGN_IN)
|
navigate(paths.SIGN_IN)
|
||||||
|
|
||||||
logout()
|
void logout()
|
||||||
},
|
},
|
||||||
goToIndexPage: () => {
|
goToIndexPage: () => {
|
||||||
if (window.location.pathname.includes(paths.SIGN_IN)) {
|
if (window.location.pathname.includes(paths.SIGN_IN)) {
|
||||||
|
@ -97,19 +97,19 @@ export const ModelingMachineProvider = ({
|
|||||||
'Modify AST': () => {},
|
'Modify AST': () => {},
|
||||||
'Update code selection cursors': () => {},
|
'Update code selection cursors': () => {},
|
||||||
'show default planes': () => {
|
'show default planes': () => {
|
||||||
kclManager.showPlanes()
|
void kclManager.showPlanes()
|
||||||
},
|
},
|
||||||
'create path': assign({
|
'create path': assign({
|
||||||
sketchEnginePathId: () => {
|
sketchEnginePathId: () => {
|
||||||
const sketchUuid = uuidv4()
|
const sketchUuid = uuidv4()
|
||||||
engineCommandManager.sendSceneCommand({
|
void engineCommandManager.sendSceneCommand({
|
||||||
type: 'modeling_cmd_req',
|
type: 'modeling_cmd_req',
|
||||||
cmd_id: sketchUuid,
|
cmd_id: sketchUuid,
|
||||||
cmd: {
|
cmd: {
|
||||||
type: 'start_path',
|
type: 'start_path',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
engineCommandManager.sendSceneCommand({
|
void engineCommandManager.sendSceneCommand({
|
||||||
type: 'modeling_cmd_req',
|
type: 'modeling_cmd_req',
|
||||||
cmd_id: uuidv4(),
|
cmd_id: uuidv4(),
|
||||||
cmd: {
|
cmd: {
|
||||||
@ -177,7 +177,7 @@ export const ModelingMachineProvider = ({
|
|||||||
raw: {} as any,
|
raw: {} as any,
|
||||||
}
|
}
|
||||||
|
|
||||||
kclManager.executeAstMock(astWithUpdatedSource, true)
|
void kclManager.executeAstMock(astWithUpdatedSource, true)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
sketchPathToNode: _pathToNode,
|
sketchPathToNode: _pathToNode,
|
||||||
@ -228,7 +228,7 @@ export const ModelingMachineProvider = ({
|
|||||||
pathToNode: sketchPathToNode,
|
pathToNode: sketchPathToNode,
|
||||||
})
|
})
|
||||||
const _modifiedAst = newSketchLn.modifiedAst
|
const _modifiedAst = newSketchLn.modifiedAst
|
||||||
kclManager.executeAstMock(_modifiedAst, true).then(() => {
|
void kclManager.executeAstMock(_modifiedAst, true).then(() => {
|
||||||
const lineCallExp = getNodeFromPath<CallExpression>(
|
const lineCallExp = getNodeFromPath<CallExpression>(
|
||||||
kclManager.ast,
|
kclManager.ast,
|
||||||
newSketchLn.pathToNode
|
newSketchLn.pathToNode
|
||||||
@ -249,22 +249,22 @@ export const ModelingMachineProvider = ({
|
|||||||
programMemory: kclManager.programMemory,
|
programMemory: kclManager.programMemory,
|
||||||
pathToNode: sketchPathToNode,
|
pathToNode: sketchPathToNode,
|
||||||
})
|
})
|
||||||
engineCommandManager.sendSceneCommand({
|
void engineCommandManager.sendSceneCommand({
|
||||||
type: 'modeling_cmd_req',
|
type: 'modeling_cmd_req',
|
||||||
cmd_id: uuidv4(),
|
cmd_id: uuidv4(),
|
||||||
cmd: { type: 'edit_mode_exit' },
|
cmd: { type: 'edit_mode_exit' },
|
||||||
})
|
})
|
||||||
engineCommandManager.sendSceneCommand({
|
void engineCommandManager.sendSceneCommand({
|
||||||
type: 'modeling_cmd_req',
|
type: 'modeling_cmd_req',
|
||||||
cmd_id: uuidv4(),
|
cmd_id: uuidv4(),
|
||||||
cmd: { type: 'default_camera_disable_sketch_mode' },
|
cmd: { type: 'default_camera_disable_sketch_mode' },
|
||||||
})
|
})
|
||||||
kclManager.executeAstMock(_modifiedAst, true)
|
void kclManager.executeAstMock(_modifiedAst, true)
|
||||||
// updateAst(_modifiedAst, true)
|
// updateAst(_modifiedAst, true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'sketch exit execute': () => {
|
'sketch exit execute': () => {
|
||||||
kclManager.executeAst()
|
void kclManager.executeAst()
|
||||||
},
|
},
|
||||||
'set tool': () => {}, // TODO
|
'set tool': () => {}, // TODO
|
||||||
'Set selection': assign(({ selectionRanges }, event) => {
|
'Set selection': assign(({ selectionRanges }, event) => {
|
||||||
|
@ -91,7 +91,7 @@ export const Stream = ({ className = '' }) => {
|
|||||||
) {
|
) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
engineCommandManager.sendSceneCommand({
|
void engineCommandManager.sendSceneCommand({
|
||||||
type: 'modeling_cmd_req',
|
type: 'modeling_cmd_req',
|
||||||
cmd: {
|
cmd: {
|
||||||
type: 'handle_mouse_drag_start',
|
type: 'handle_mouse_drag_start',
|
||||||
@ -100,7 +100,7 @@ export const Stream = ({ className = '' }) => {
|
|||||||
cmd_id: newId,
|
cmd_id: newId,
|
||||||
})
|
})
|
||||||
} else if (!state.matches('Sketch.Line Tool')) {
|
} else if (!state.matches('Sketch.Line Tool')) {
|
||||||
engineCommandManager.sendSceneCommand({
|
void engineCommandManager.sendSceneCommand({
|
||||||
type: 'modeling_cmd_req',
|
type: 'modeling_cmd_req',
|
||||||
cmd: {
|
cmd: {
|
||||||
type: 'camera_drag_start',
|
type: 'camera_drag_start',
|
||||||
@ -118,7 +118,7 @@ export const Stream = ({ className = '' }) => {
|
|||||||
const fps = 60
|
const fps = 60
|
||||||
const handleScroll: WheelEventHandler<HTMLVideoElement> = throttle((e) => {
|
const handleScroll: WheelEventHandler<HTMLVideoElement> = throttle((e) => {
|
||||||
if (!cameraMouseDragGuards[cameraControls].zoom.scrollCallback(e)) return
|
if (!cameraMouseDragGuards[cameraControls].zoom.scrollCallback(e)) return
|
||||||
engineCommandManager.sendSceneCommand({
|
void engineCommandManager.sendSceneCommand({
|
||||||
type: 'modeling_cmd_req',
|
type: 'modeling_cmd_req',
|
||||||
cmd: {
|
cmd: {
|
||||||
type: 'default_camera_zoom',
|
type: 'default_camera_zoom',
|
||||||
@ -161,13 +161,13 @@ export const Stream = ({ className = '' }) => {
|
|||||||
selection_type: 'add',
|
selection_type: 'add',
|
||||||
selected_at_window: { x, y },
|
selected_at_window: { x, y },
|
||||||
}
|
}
|
||||||
engineCommandManager.sendSceneCommand(command)
|
void engineCommandManager.sendSceneCommand(command)
|
||||||
} else if (!didDragInStream && state.matches('Sketch.Line Tool')) {
|
} else if (!didDragInStream && state.matches('Sketch.Line Tool')) {
|
||||||
command.cmd = {
|
command.cmd = {
|
||||||
type: 'mouse_click',
|
type: 'mouse_click',
|
||||||
window: { x, y },
|
window: { x, y },
|
||||||
}
|
}
|
||||||
engineCommandManager.sendSceneCommand(command).then(async (resp) => {
|
void engineCommandManager.sendSceneCommand(command).then(async (resp) => {
|
||||||
const entities_modified = resp?.data?.data?.entities_modified
|
const entities_modified = resp?.data?.data?.entities_modified
|
||||||
if (!entities_modified) return
|
if (!entities_modified) return
|
||||||
if (state.matches('Sketch.Line Tool.No Points')) {
|
if (state.matches('Sketch.Line Tool.No Points')) {
|
||||||
@ -251,20 +251,20 @@ export const Stream = ({ className = '' }) => {
|
|||||||
selection_type: 'add',
|
selection_type: 'add',
|
||||||
}
|
}
|
||||||
|
|
||||||
engineCommandManager.sendSceneCommand(command)
|
void engineCommandManager.sendSceneCommand(command)
|
||||||
} else if (!didDragInStream && state.matches('Sketch.Move Tool')) {
|
} else if (!didDragInStream && state.matches('Sketch.Move Tool')) {
|
||||||
command.cmd = {
|
command.cmd = {
|
||||||
type: 'select_with_point',
|
type: 'select_with_point',
|
||||||
selected_at_window: { x, y },
|
selected_at_window: { x, y },
|
||||||
selection_type: 'add',
|
selection_type: 'add',
|
||||||
}
|
}
|
||||||
engineCommandManager.sendSceneCommand(command)
|
void engineCommandManager.sendSceneCommand(command)
|
||||||
} else if (didDragInStream && state.matches('Sketch.Move Tool')) {
|
} else if (didDragInStream && state.matches('Sketch.Move Tool')) {
|
||||||
command.cmd = {
|
command.cmd = {
|
||||||
type: 'handle_mouse_drag_end',
|
type: 'handle_mouse_drag_end',
|
||||||
window: { x, y },
|
window: { x, y },
|
||||||
}
|
}
|
||||||
engineCommandManager.sendSceneCommand(command).then(async () => {
|
void engineCommandManager.sendSceneCommand(command).then(async () => {
|
||||||
if (!context.sketchPathToNode) return
|
if (!context.sketchPathToNode) return
|
||||||
getNodeFromPath<VariableDeclarator>(
|
getNodeFromPath<VariableDeclarator>(
|
||||||
kclManager.ast,
|
kclManager.ast,
|
||||||
@ -353,10 +353,10 @@ export const Stream = ({ className = '' }) => {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
kclManager.executeAstMock(modifiedAst, true)
|
void kclManager.executeAstMock(modifiedAst, true)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
engineCommandManager.sendSceneCommand(command)
|
void engineCommandManager.sendSceneCommand(command)
|
||||||
}
|
}
|
||||||
|
|
||||||
setDidDragInStream(false)
|
setDidDragInStream(false)
|
||||||
|
@ -76,10 +76,12 @@ export const TextEditor = ({
|
|||||||
const fromServer: FromServer = FromServer.create()
|
const fromServer: FromServer = FromServer.create()
|
||||||
const client = new Client(fromServer, intoServer)
|
const client = new Client(fromServer, intoServer)
|
||||||
if (!TEST) {
|
if (!TEST) {
|
||||||
Server.initialize(intoServer, fromServer).then((lspServer) => {
|
Server.initialize(intoServer, fromServer)
|
||||||
lspServer.start()
|
.then((lspServer) => {
|
||||||
setIsLSPServerReady(true)
|
void lspServer.start()
|
||||||
})
|
setIsLSPServerReady(true)
|
||||||
|
})
|
||||||
|
.catch((e) => console.log(e))
|
||||||
}
|
}
|
||||||
|
|
||||||
const lspClient = new LanguageServerClient({ client })
|
const lspClient = new LanguageServerClient({ client })
|
||||||
@ -151,7 +153,7 @@ export const TextEditor = ({
|
|||||||
key: editorShortcutMeta.convertToVariable.codeMirror,
|
key: editorShortcutMeta.convertToVariable.codeMirror,
|
||||||
run: () => {
|
run: () => {
|
||||||
if (convertEnabled) {
|
if (convertEnabled) {
|
||||||
convertCallback()
|
void convertCallback()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
@ -67,7 +67,7 @@ export class LanguageServerClient {
|
|||||||
|
|
||||||
async initialize() {
|
async initialize() {
|
||||||
// Start the client in the background.
|
// Start the client in the background.
|
||||||
this.client.start()
|
await this.client.start()
|
||||||
|
|
||||||
this.ready = true
|
this.ready = true
|
||||||
}
|
}
|
||||||
@ -81,12 +81,12 @@ export class LanguageServerClient {
|
|||||||
textDocumentDidOpen(params: LSP.DidOpenTextDocumentParams) {
|
textDocumentDidOpen(params: LSP.DidOpenTextDocumentParams) {
|
||||||
this.notify('textDocument/didOpen', params)
|
this.notify('textDocument/didOpen', params)
|
||||||
|
|
||||||
this.updateSemanticTokens(params.textDocument.uri)
|
void this.updateSemanticTokens(params.textDocument.uri)
|
||||||
}
|
}
|
||||||
|
|
||||||
textDocumentDidChange(params: LSP.DidChangeTextDocumentParams) {
|
textDocumentDidChange(params: LSP.DidChangeTextDocumentParams) {
|
||||||
this.notify('textDocument/didChange', params)
|
this.notify('textDocument/didChange', params)
|
||||||
this.updateSemanticTokens(params.textDocument.uri)
|
void this.updateSemanticTokens(params.textDocument.uri)
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateSemanticTokens(uri: string) {
|
async updateSemanticTokens(uri: string) {
|
||||||
|
@ -62,7 +62,7 @@ export class LanguageServerPlugin implements PluginValue {
|
|||||||
|
|
||||||
this.client.attachPlugin(this)
|
this.client.attachPlugin(this)
|
||||||
|
|
||||||
this.initialize({
|
void this.initialize({
|
||||||
documentText: this.view.state.doc.toString(),
|
documentText: this.view.state.doc.toString(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ export class LanguageServerPlugin implements PluginValue {
|
|||||||
update({ docChanged }: ViewUpdate) {
|
update({ docChanged }: ViewUpdate) {
|
||||||
if (!docChanged) return
|
if (!docChanged) return
|
||||||
|
|
||||||
this.sendChange({
|
void this.sendChange({
|
||||||
documentText: this.view.state.doc.toString(),
|
documentText: this.view.state.doc.toString(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -127,7 +127,7 @@ export class LanguageServerPlugin implements PluginValue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
requestDiagnostics(view: EditorView) {
|
requestDiagnostics(view: EditorView) {
|
||||||
this.sendChange({ documentText: view.state.doc.toString() })
|
void this.sendChange({ documentText: view.state.doc.toString() })
|
||||||
}
|
}
|
||||||
|
|
||||||
async requestHoverTooltip(
|
async requestHoverTooltip(
|
||||||
@ -140,7 +140,7 @@ export class LanguageServerPlugin implements PluginValue {
|
|||||||
)
|
)
|
||||||
return null
|
return null
|
||||||
|
|
||||||
this.sendChange({ documentText: view.state.doc.toString() })
|
await this.sendChange({ documentText: view.state.doc.toString() })
|
||||||
const result = await this.client.textDocumentHover({
|
const result = await this.client.textDocumentHover({
|
||||||
textDocument: { uri: this.documentUri },
|
textDocument: { uri: this.documentUri },
|
||||||
position: { line, character },
|
position: { line, character },
|
||||||
@ -178,7 +178,7 @@ export class LanguageServerPlugin implements PluginValue {
|
|||||||
)
|
)
|
||||||
return null
|
return null
|
||||||
|
|
||||||
this.sendChange({
|
await this.sendChange({
|
||||||
documentText: context.state.doc.toString(),
|
documentText: context.state.doc.toString(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ export function useConvertToVariable() {
|
|||||||
variableName
|
variableName
|
||||||
)
|
)
|
||||||
|
|
||||||
kclManager.updateAst(_modifiedAst, true)
|
void kclManager.updateAst(_modifiedAst, true)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('error', e)
|
console.log('error', e)
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ class KclManager {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
}
|
}
|
||||||
this.executeAst(ast)
|
void this.executeAst(ast)
|
||||||
}, 600)
|
}, 600)
|
||||||
|
|
||||||
private _isExecutingCallback: (arg: boolean) => void = () => {}
|
private _isExecutingCallback: (arg: boolean) => void = () => {}
|
||||||
@ -376,15 +376,15 @@ class KclManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
showPlanes() {
|
showPlanes() {
|
||||||
this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xy, false)
|
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xy, false)
|
||||||
this.engineCommandManager.setPlaneHidden(this.defaultPlanes.yz, false)
|
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.yz, false)
|
||||||
this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xz, false)
|
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xz, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
hidePlanes() {
|
hidePlanes() {
|
||||||
this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xy, true)
|
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xy, true)
|
||||||
this.engineCommandManager.setPlaneHidden(this.defaultPlanes.yz, true)
|
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.yz, true)
|
||||||
this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xz, true)
|
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xz, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,11 +10,7 @@ import {
|
|||||||
import { assign, createMachine } from 'xstate'
|
import { assign, createMachine } from 'xstate'
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import { isCursorInSketchCommandRange } from 'lang/util'
|
import { isCursorInSketchCommandRange } from 'lang/util'
|
||||||
import {
|
import { getNodePathFromSourceRange } from 'lang/queryAst'
|
||||||
doesPipeHaveCallExp,
|
|
||||||
getNodePathFromSourceRange,
|
|
||||||
hasExtrudeSketchGroup,
|
|
||||||
} from 'lang/queryAst'
|
|
||||||
import { kclManager } from 'lang/KclSinglton'
|
import { kclManager } from 'lang/KclSinglton'
|
||||||
import {
|
import {
|
||||||
horzVertInfo,
|
horzVertInfo,
|
||||||
@ -817,7 +813,7 @@ export const modelingMachine = createMachine(
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
'sketch mode enabled': ({ sketchPlaneId }) => {
|
'sketch mode enabled': ({ sketchPlaneId }) => {
|
||||||
engineCommandManager.sendSceneCommand({
|
void engineCommandManager.sendSceneCommand({
|
||||||
type: 'modeling_cmd_req',
|
type: 'modeling_cmd_req',
|
||||||
cmd_id: uuidv4(),
|
cmd_id: uuidv4(),
|
||||||
cmd: {
|
cmd: {
|
||||||
@ -838,7 +834,7 @@ export const modelingMachine = createMachine(
|
|||||||
selectionRanges
|
selectionRanges
|
||||||
)
|
)
|
||||||
pathId &&
|
pathId &&
|
||||||
engineCommandManager.sendSceneCommand({
|
void engineCommandManager.sendSceneCommand({
|
||||||
type: 'modeling_cmd_req',
|
type: 'modeling_cmd_req',
|
||||||
cmd_id: uuidv4(),
|
cmd_id: uuidv4(),
|
||||||
cmd: {
|
cmd: {
|
||||||
@ -848,7 +844,7 @@ export const modelingMachine = createMachine(
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
'hide default planes': () => {
|
'hide default planes': () => {
|
||||||
kclManager.hidePlanes()
|
void kclManager.hidePlanes()
|
||||||
},
|
},
|
||||||
edit_mode_exit: () =>
|
edit_mode_exit: () =>
|
||||||
engineCommandManager.sendSceneCommand({
|
engineCommandManager.sendSceneCommand({
|
||||||
@ -914,7 +910,7 @@ export const modelingMachine = createMachine(
|
|||||||
kclManager.ast,
|
kclManager.ast,
|
||||||
kclManager.programMemory
|
kclManager.programMemory
|
||||||
)
|
)
|
||||||
kclManager.updateAst(modifiedAst, true)
|
void kclManager.updateAst(modifiedAst, true)
|
||||||
},
|
},
|
||||||
'Make selection vertical': ({ selectionRanges }) => {
|
'Make selection vertical': ({ selectionRanges }) => {
|
||||||
const { modifiedAst } = applyConstraintHorzVert(
|
const { modifiedAst } = applyConstraintHorzVert(
|
||||||
@ -923,53 +919,53 @@ export const modelingMachine = createMachine(
|
|||||||
kclManager.ast,
|
kclManager.ast,
|
||||||
kclManager.programMemory
|
kclManager.programMemory
|
||||||
)
|
)
|
||||||
kclManager.updateAst(modifiedAst, true)
|
void kclManager.updateAst(modifiedAst, true)
|
||||||
},
|
},
|
||||||
'Constrain horizontally align': ({ selectionRanges }) => {
|
'Constrain horizontally align': ({ selectionRanges }) => {
|
||||||
const { modifiedAst } = applyConstraintHorzVertAlign({
|
const { modifiedAst } = applyConstraintHorzVertAlign({
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
constraint: 'setVertDistance',
|
constraint: 'setVertDistance',
|
||||||
})
|
})
|
||||||
kclManager.updateAst(modifiedAst, true)
|
void kclManager.updateAst(modifiedAst, true)
|
||||||
},
|
},
|
||||||
'Constrain vertically align': ({ selectionRanges }) => {
|
'Constrain vertically align': ({ selectionRanges }) => {
|
||||||
const { modifiedAst } = applyConstraintHorzVertAlign({
|
const { modifiedAst } = applyConstraintHorzVertAlign({
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
constraint: 'setHorzDistance',
|
constraint: 'setHorzDistance',
|
||||||
})
|
})
|
||||||
kclManager.updateAst(modifiedAst, true)
|
void kclManager.updateAst(modifiedAst, true)
|
||||||
},
|
},
|
||||||
'Constrain snap to X': ({ selectionRanges }) => {
|
'Constrain snap to X': ({ selectionRanges }) => {
|
||||||
const { modifiedAst } = applyConstraintAxisAlign({
|
const { modifiedAst } = applyConstraintAxisAlign({
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
constraint: 'snapToXAxis',
|
constraint: 'snapToXAxis',
|
||||||
})
|
})
|
||||||
kclManager.updateAst(modifiedAst, true)
|
void kclManager.updateAst(modifiedAst, true)
|
||||||
},
|
},
|
||||||
'Constrain snap to Y': ({ selectionRanges }) => {
|
'Constrain snap to Y': ({ selectionRanges }) => {
|
||||||
const { modifiedAst } = applyConstraintAxisAlign({
|
const { modifiedAst } = applyConstraintAxisAlign({
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
constraint: 'snapToYAxis',
|
constraint: 'snapToYAxis',
|
||||||
})
|
})
|
||||||
kclManager.updateAst(modifiedAst, true)
|
void kclManager.updateAst(modifiedAst, true)
|
||||||
},
|
},
|
||||||
'Constrain equal length': ({ selectionRanges }) => {
|
'Constrain equal length': ({ selectionRanges }) => {
|
||||||
const { modifiedAst } = applyConstraintEqualLength({
|
const { modifiedAst } = applyConstraintEqualLength({
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
})
|
})
|
||||||
kclManager.updateAst(modifiedAst, true)
|
void kclManager.updateAst(modifiedAst, true)
|
||||||
},
|
},
|
||||||
'Constrain parallel': ({ selectionRanges }) => {
|
'Constrain parallel': ({ selectionRanges }) => {
|
||||||
const { modifiedAst } = applyConstraintEqualAngle({
|
const { modifiedAst } = applyConstraintEqualAngle({
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
})
|
})
|
||||||
kclManager.updateAst(modifiedAst, true)
|
void kclManager.updateAst(modifiedAst, true)
|
||||||
},
|
},
|
||||||
'Constrain remove constraints': ({ selectionRanges }) => {
|
'Constrain remove constraints': ({ selectionRanges }) => {
|
||||||
const { modifiedAst } = applyRemoveConstrainingValues({
|
const { modifiedAst } = applyRemoveConstrainingValues({
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
})
|
})
|
||||||
kclManager.updateAst(modifiedAst, true)
|
void kclManager.updateAst(modifiedAst, true)
|
||||||
},
|
},
|
||||||
'AST extrude': (_, event) => {
|
'AST extrude': (_, event) => {
|
||||||
if (!event.data) return
|
if (!event.data) return
|
||||||
@ -985,7 +981,7 @@ export const modelingMachine = createMachine(
|
|||||||
distance
|
distance
|
||||||
)
|
)
|
||||||
// TODO not handling focusPath correctly I think
|
// TODO not handling focusPath correctly I think
|
||||||
kclManager.updateAst(modifiedAst, true, {
|
void kclManager.updateAst(modifiedAst, true, {
|
||||||
focusPath: pathToExtrudeArg,
|
focusPath: pathToExtrudeArg,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -2,13 +2,15 @@ import { ReportHandler } from 'web-vitals'
|
|||||||
|
|
||||||
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
|
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
|
||||||
if (onPerfEntry && onPerfEntry instanceof Function) {
|
if (onPerfEntry && onPerfEntry instanceof Function) {
|
||||||
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
import('web-vitals')
|
||||||
getCLS(onPerfEntry)
|
.then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
||||||
getFID(onPerfEntry)
|
getCLS(onPerfEntry)
|
||||||
getFCP(onPerfEntry)
|
getFID(onPerfEntry)
|
||||||
getLCP(onPerfEntry)
|
getFCP(onPerfEntry)
|
||||||
getTTFB(onPerfEntry)
|
getLCP(onPerfEntry)
|
||||||
})
|
getTTFB(onPerfEntry)
|
||||||
|
})
|
||||||
|
.catch((e) => console.log(e))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ export const Settings = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function restartOnboarding() {
|
async function restartOnboarding() {
|
||||||
send({
|
send({
|
||||||
type: 'Set Onboarding Status',
|
type: 'Set Onboarding Status',
|
||||||
data: { onboardingStatus: '' },
|
data: { onboardingStatus: '' },
|
||||||
@ -79,7 +79,7 @@ export const Settings = () => {
|
|||||||
if (isFileSettings) {
|
if (isFileSettings) {
|
||||||
navigate(dotDotSlash(1) + paths.ONBOARDING.INDEX)
|
navigate(dotDotSlash(1) + paths.ONBOARDING.INDEX)
|
||||||
} else {
|
} else {
|
||||||
createAndOpenNewProject()
|
await createAndOpenNewProject()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@ const SignIn = () => {
|
|||||||
},
|
},
|
||||||
} = useGlobalStateContext()
|
} = useGlobalStateContext()
|
||||||
|
|
||||||
const appliedTheme = theme === Themes.System ? getSystemTheme() : theme
|
|
||||||
const signInTauri = async () => {
|
const signInTauri = async () => {
|
||||||
// We want to invoke our command to login via device auth.
|
// We want to invoke our command to login via device auth.
|
||||||
try {
|
try {
|
||||||
|
13
yarn.lock
13
yarn.lock
@ -3292,15 +3292,10 @@ camelcase@^6.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"
|
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"
|
||||||
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
|
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
|
||||||
|
|
||||||
caniuse-lite@^1.0.30001464, caniuse-lite@^1.0.30001517:
|
caniuse-lite@^1.0.30001464, caniuse-lite@^1.0.30001517, caniuse-lite@^1.0.30001541:
|
||||||
version "1.0.30001518"
|
version "1.0.30001581"
|
||||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001518.tgz#b3ca93904cb4699c01218246c4d77a71dbe97150"
|
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001581.tgz"
|
||||||
integrity sha512-rup09/e3I0BKjncL+FesTayKtPrdwKhUufQFd3riFw1hHg8JmIFoInYfB102cFcY/pPgGmdyl/iy+jgiDi2vdA==
|
integrity sha512-whlTkwhqV2tUmP3oYhtNfaWGYHDdS3JYFQBKXxcUR9qqPWsRhFHhoISO2Xnl/g0xyKzht9mI1LZpiNWfMzHixQ==
|
||||||
|
|
||||||
caniuse-lite@^1.0.30001541:
|
|
||||||
version "1.0.30001561"
|
|
||||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001561.tgz#752f21f56f96f1b1a52e97aae98c57c562d5d9da"
|
|
||||||
integrity sha512-NTt0DNoKe958Q0BE0j0c1V9jbUzhBxHIEJy7asmGrpE0yG63KTV7PLHPnK2E1O9RsQrQ081I3NLuXGS6zht3cw==
|
|
||||||
|
|
||||||
chai@^4.3.10:
|
chai@^4.3.10:
|
||||||
version "4.3.10"
|
version "4.3.10"
|
||||||
|
Reference in New Issue
Block a user