2023-08-06 21:29:26 -04:00
|
|
|
import {
|
|
|
|
useRef,
|
|
|
|
useEffect,
|
|
|
|
useMemo,
|
|
|
|
useCallback,
|
|
|
|
MouseEventHandler,
|
|
|
|
} from 'react'
|
2023-07-21 16:53:06 +10:00
|
|
|
import { DebugPanel } from './components/DebugPanel'
|
2023-08-06 21:29:26 -04:00
|
|
|
import { v4 as uuidv4 } from 'uuid'
|
2023-02-21 14:50:22 +11:00
|
|
|
import { asyncLexer } from './lang/tokeniser'
|
2022-12-07 10:02:21 +11:00
|
|
|
import { abstractSyntaxTree } from './lang/abstractSyntaxTree'
|
2023-06-22 16:43:33 +10:00
|
|
|
import { _executor, ExtrudeGroup, SketchGroup } from './lang/executor'
|
2022-11-26 08:34:23 +11:00
|
|
|
import CodeMirror from '@uiw/react-codemirror'
|
2023-08-03 15:56:11 -05:00
|
|
|
import { linter, lintGutter, Diagnostic } from '@codemirror/lint'
|
2022-11-26 08:34:23 +11:00
|
|
|
import { javascript } from '@codemirror/lang-javascript'
|
|
|
|
import { ViewUpdate } from '@codemirror/view'
|
2022-11-26 05:13:07 +11:00
|
|
|
import {
|
|
|
|
lineHighlightField,
|
|
|
|
addLineHighlight,
|
2022-11-26 08:34:23 +11:00
|
|
|
} from './editor/highlightextension'
|
2023-08-06 21:29:26 -04:00
|
|
|
import { PaneType, Selections, useStore } from './useStore'
|
2023-07-26 14:10:30 -05:00
|
|
|
import { Logs, KCLErrors } from './components/Logs'
|
2023-08-06 21:29:26 -04:00
|
|
|
import { CollapsiblePanel } from './components/CollapsiblePanel'
|
2023-02-03 10:04:16 +11:00
|
|
|
import { MemoryPanel } from './components/MemoryPanel'
|
2023-02-21 10:28:34 +11:00
|
|
|
import { useHotKeyListener } from './hooks/useHotKeyListener'
|
2023-03-06 20:13:34 +11:00
|
|
|
import { Stream } from './components/Stream'
|
2023-03-07 15:45:59 +11:00
|
|
|
import ModalContainer from 'react-modal-promise'
|
2023-08-06 21:29:26 -04:00
|
|
|
import {
|
|
|
|
EngineCommand,
|
|
|
|
EngineCommandManager,
|
|
|
|
} from './lang/std/engineConnection'
|
|
|
|
import { isOverlap, throttle } from './lib/utils'
|
2023-07-13 07:22:08 -04:00
|
|
|
import { AppHeader } from './components/AppHeader'
|
2023-08-03 15:56:11 -05:00
|
|
|
import { KCLError, kclErrToDiagnostic } from './lang/errors'
|
2023-08-06 21:29:26 -04:00
|
|
|
import { Resizable } from 're-resizable'
|
|
|
|
import {
|
|
|
|
faCode,
|
|
|
|
faCodeCommit,
|
|
|
|
faSquareRootVariable,
|
|
|
|
} from '@fortawesome/free-solid-svg-icons'
|
|
|
|
import { useHotkeys } from 'react-hotkeys-hook'
|
2022-11-22 09:06:08 +11:00
|
|
|
|
2023-06-22 16:43:33 +10:00
|
|
|
export function App() {
|
2022-11-26 08:34:23 +11:00
|
|
|
const cam = useRef()
|
2023-02-21 10:28:34 +11:00
|
|
|
useHotKeyListener()
|
2022-11-27 14:06:33 +11:00
|
|
|
const {
|
|
|
|
editorView,
|
|
|
|
setEditorView,
|
2023-02-21 10:28:34 +11:00
|
|
|
setSelectionRanges,
|
2023-06-22 16:43:33 +10:00
|
|
|
selectionRanges,
|
2022-11-27 14:06:33 +11:00
|
|
|
addLog,
|
2023-07-26 14:10:30 -05:00
|
|
|
addKCLError,
|
2022-11-28 09:37:46 +11:00
|
|
|
code,
|
|
|
|
setCode,
|
|
|
|
setAst,
|
2022-12-06 05:40:05 +11:00
|
|
|
setError,
|
2023-01-04 01:28:26 +11:00
|
|
|
setProgramMemory,
|
2023-02-03 11:09:09 +11:00
|
|
|
resetLogs,
|
2023-07-26 18:16:20 -05:00
|
|
|
resetKCLErrors,
|
2023-04-03 16:05:25 +10:00
|
|
|
selectionRangeTypeMap,
|
2023-06-22 16:43:33 +10:00
|
|
|
setArtifactMap,
|
|
|
|
engineCommandManager: _engineCommandManager,
|
|
|
|
setEngineCommandManager,
|
|
|
|
setHighlightRange,
|
|
|
|
setCursor2,
|
|
|
|
sourceRangeMap,
|
|
|
|
setMediaStream,
|
2023-06-23 14:19:15 +10:00
|
|
|
setIsStreamReady,
|
|
|
|
isStreamReady,
|
2023-08-06 21:29:26 -04:00
|
|
|
isMouseDownInStream,
|
|
|
|
fileId,
|
|
|
|
cmdId,
|
|
|
|
setCmdId,
|
2023-07-11 20:34:09 +10:00
|
|
|
token,
|
2023-07-20 19:25:04 -04:00
|
|
|
formatCode,
|
2023-07-21 16:53:06 +10:00
|
|
|
debugPanel,
|
2023-07-31 06:33:10 -04:00
|
|
|
theme,
|
2023-08-06 21:29:26 -04:00
|
|
|
openPanes,
|
|
|
|
setOpenPanes,
|
|
|
|
onboardingStatus,
|
2022-11-27 14:06:33 +11:00
|
|
|
} = useStore((s) => ({
|
|
|
|
editorView: s.editorView,
|
|
|
|
setEditorView: s.setEditorView,
|
2023-02-21 10:28:34 +11:00
|
|
|
setSelectionRanges: s.setSelectionRanges,
|
|
|
|
selectionRanges: s.selectionRanges,
|
2022-11-27 14:06:33 +11:00
|
|
|
setGuiMode: s.setGuiMode,
|
|
|
|
addLog: s.addLog,
|
2022-11-28 09:37:46 +11:00
|
|
|
code: s.code,
|
|
|
|
setCode: s.setCode,
|
|
|
|
setAst: s.setAst,
|
2022-12-06 05:40:05 +11:00
|
|
|
setError: s.setError,
|
2023-01-04 01:28:26 +11:00
|
|
|
setProgramMemory: s.setProgramMemory,
|
2023-02-03 11:09:09 +11:00
|
|
|
resetLogs: s.resetLogs,
|
2023-07-26 18:16:20 -05:00
|
|
|
resetKCLErrors: s.resetKCLErrors,
|
2023-04-03 16:05:25 +10:00
|
|
|
selectionRangeTypeMap: s.selectionRangeTypeMap,
|
2023-06-22 16:43:33 +10:00
|
|
|
setArtifactMap: s.setArtifactNSourceRangeMaps,
|
|
|
|
engineCommandManager: s.engineCommandManager,
|
|
|
|
setEngineCommandManager: s.setEngineCommandManager,
|
|
|
|
setHighlightRange: s.setHighlightRange,
|
|
|
|
isShiftDown: s.isShiftDown,
|
|
|
|
setCursor: s.setCursor,
|
|
|
|
setCursor2: s.setCursor2,
|
|
|
|
sourceRangeMap: s.sourceRangeMap,
|
2023-06-23 14:19:15 +10:00
|
|
|
setMediaStream: s.setMediaStream,
|
|
|
|
isStreamReady: s.isStreamReady,
|
|
|
|
setIsStreamReady: s.setIsStreamReady,
|
2023-08-06 21:29:26 -04:00
|
|
|
isMouseDownInStream: s.isMouseDownInStream,
|
|
|
|
fileId: s.fileId,
|
|
|
|
cmdId: s.cmdId,
|
|
|
|
setCmdId: s.setCmdId,
|
2023-07-20 19:25:04 -04:00
|
|
|
token: s.token,
|
|
|
|
formatCode: s.formatCode,
|
2023-07-21 16:53:06 +10:00
|
|
|
debugPanel: s.debugPanel,
|
2023-07-26 14:10:30 -05:00
|
|
|
addKCLError: s.addKCLError,
|
2023-07-31 06:33:10 -04:00
|
|
|
theme: s.theme,
|
2023-08-06 21:29:26 -04:00
|
|
|
openPanes: s.openPanes,
|
|
|
|
setOpenPanes: s.setOpenPanes,
|
|
|
|
onboardingStatus: s.onboardingStatus,
|
2022-11-27 14:06:33 +11:00
|
|
|
}))
|
2023-08-06 21:29:26 -04:00
|
|
|
|
|
|
|
// Pane toggling keyboard shortcuts
|
|
|
|
const togglePane = useCallback(
|
|
|
|
(newPane: PaneType) =>
|
|
|
|
openPanes.includes(newPane)
|
|
|
|
? setOpenPanes(openPanes.filter((p) => p !== newPane))
|
|
|
|
: setOpenPanes([...openPanes, newPane]),
|
|
|
|
[openPanes, setOpenPanes]
|
|
|
|
)
|
|
|
|
useHotkeys('shift + c', () => togglePane('code'))
|
|
|
|
useHotkeys('shift + v', () => togglePane('variables'))
|
|
|
|
useHotkeys('shift + l', () => togglePane('logs'))
|
|
|
|
useHotkeys('shift + e', () => togglePane('kclErrors'))
|
|
|
|
useHotkeys('shift + d', () => togglePane('debug'))
|
|
|
|
|
2023-08-07 17:07:28 -04:00
|
|
|
const paneOpacity =
|
|
|
|
onboardingStatus === 'camera'
|
|
|
|
? 'opacity-20'
|
|
|
|
: isMouseDownInStream
|
|
|
|
? 'opacity-40'
|
|
|
|
: ''
|
2023-08-06 21:29:26 -04:00
|
|
|
|
2022-11-26 05:13:07 +11:00
|
|
|
// const onChange = React.useCallback((value: string, viewUpdate: ViewUpdate) => {
|
|
|
|
const onChange = (value: string, viewUpdate: ViewUpdate) => {
|
2022-11-26 08:34:23 +11:00
|
|
|
setCode(value)
|
2022-11-26 05:13:07 +11:00
|
|
|
if (editorView) {
|
2022-11-26 08:34:23 +11:00
|
|
|
editorView?.dispatch({ effects: addLineHighlight.of([0, 0]) })
|
2022-11-26 05:13:07 +11:00
|
|
|
}
|
2022-11-26 08:34:23 +11:00
|
|
|
} //, []);
|
2022-11-26 05:13:07 +11:00
|
|
|
const onUpdate = (viewUpdate: ViewUpdate) => {
|
|
|
|
if (!editorView) {
|
2022-11-26 08:34:23 +11:00
|
|
|
setEditorView(viewUpdate.view)
|
2022-11-26 05:13:07 +11:00
|
|
|
}
|
2023-02-21 10:28:34 +11:00
|
|
|
const ranges = viewUpdate.state.selection.ranges
|
|
|
|
|
|
|
|
const isChange =
|
2023-06-22 16:43:33 +10:00
|
|
|
ranges.length !== selectionRanges.codeBasedSelections.length ||
|
2023-02-21 10:28:34 +11:00
|
|
|
ranges.some(({ from, to }, i) => {
|
2023-04-03 16:05:25 +10:00
|
|
|
return (
|
2023-06-22 16:43:33 +10:00
|
|
|
from !== selectionRanges.codeBasedSelections[i].range[0] ||
|
|
|
|
to !== selectionRanges.codeBasedSelections[i].range[1]
|
2023-04-03 16:05:25 +10:00
|
|
|
)
|
2023-02-21 10:28:34 +11:00
|
|
|
})
|
|
|
|
|
|
|
|
if (!isChange) return
|
2023-06-22 16:43:33 +10:00
|
|
|
const codeBasedSelections: Selections['codeBasedSelections'] = ranges.map(
|
|
|
|
({ from, to }) => {
|
2023-04-03 16:05:25 +10:00
|
|
|
if (selectionRangeTypeMap[to]) {
|
|
|
|
return {
|
|
|
|
type: selectionRangeTypeMap[to],
|
|
|
|
range: [from, to],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
type: 'default',
|
|
|
|
range: [from, to],
|
|
|
|
}
|
2023-06-22 16:43:33 +10:00
|
|
|
}
|
|
|
|
)
|
|
|
|
const idBasedSelections = codeBasedSelections
|
|
|
|
.map(({ type, range }) => {
|
|
|
|
const hasOverlap = Object.entries(sourceRangeMap).filter(
|
|
|
|
([_, sourceRange]) => {
|
|
|
|
return isOverlap(sourceRange, range)
|
|
|
|
}
|
|
|
|
)
|
|
|
|
if (hasOverlap.length) {
|
|
|
|
return {
|
|
|
|
type,
|
|
|
|
id: hasOverlap[0][0],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.filter(Boolean) as any
|
|
|
|
|
|
|
|
_engineCommandManager?.cusorsSelected({
|
|
|
|
otherSelections: [],
|
|
|
|
idBasedSelections,
|
|
|
|
})
|
|
|
|
|
|
|
|
setSelectionRanges({
|
|
|
|
otherSelections: [],
|
|
|
|
codeBasedSelections,
|
2023-04-03 16:05:25 +10:00
|
|
|
})
|
2022-11-26 08:34:23 +11:00
|
|
|
}
|
2023-07-11 20:34:09 +10:00
|
|
|
const engineCommandManager = useMemo(() => {
|
|
|
|
return new EngineCommandManager({
|
|
|
|
setMediaStream,
|
|
|
|
setIsStreamReady,
|
|
|
|
token,
|
|
|
|
})
|
|
|
|
}, [token])
|
2023-06-23 09:56:37 +10:00
|
|
|
useEffect(() => {
|
|
|
|
return () => {
|
2023-07-11 20:34:09 +10:00
|
|
|
engineCommandManager?.tearDown()
|
2023-06-23 09:56:37 +10:00
|
|
|
}
|
2023-07-11 20:34:09 +10:00
|
|
|
}, [engineCommandManager])
|
2023-06-23 09:56:37 +10:00
|
|
|
|
2022-11-23 21:28:38 +11:00
|
|
|
useEffect(() => {
|
2023-06-23 14:19:15 +10:00
|
|
|
if (!isStreamReady) return
|
2023-02-21 14:50:22 +11:00
|
|
|
const asyncWrap = async () => {
|
|
|
|
try {
|
|
|
|
if (!code) {
|
|
|
|
setAst(null)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
const tokens = await asyncLexer(code)
|
|
|
|
const _ast = abstractSyntaxTree(tokens)
|
|
|
|
setAst(_ast)
|
|
|
|
resetLogs()
|
2023-07-26 18:16:20 -05:00
|
|
|
resetKCLErrors()
|
2023-06-22 16:43:33 +10:00
|
|
|
if (_engineCommandManager) {
|
|
|
|
_engineCommandManager.endSession()
|
|
|
|
}
|
|
|
|
engineCommandManager.startNewSession()
|
|
|
|
setEngineCommandManager(engineCommandManager)
|
|
|
|
_executor(
|
|
|
|
_ast,
|
|
|
|
{
|
|
|
|
root: {
|
|
|
|
log: {
|
|
|
|
type: 'userVal',
|
|
|
|
value: (a: any) => {
|
|
|
|
addLog(a)
|
2023-02-21 14:50:22 +11:00
|
|
|
},
|
2023-06-22 16:43:33 +10:00
|
|
|
__meta: [
|
|
|
|
{
|
|
|
|
pathToNode: [],
|
|
|
|
sourceRange: [0, 0],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
_0: {
|
|
|
|
type: 'userVal',
|
|
|
|
value: 0,
|
|
|
|
__meta: [],
|
|
|
|
},
|
|
|
|
_90: {
|
|
|
|
type: 'userVal',
|
|
|
|
value: 90,
|
|
|
|
__meta: [],
|
|
|
|
},
|
|
|
|
_180: {
|
|
|
|
type: 'userVal',
|
|
|
|
value: 180,
|
|
|
|
__meta: [],
|
|
|
|
},
|
|
|
|
_270: {
|
|
|
|
type: 'userVal',
|
|
|
|
value: 270,
|
|
|
|
__meta: [],
|
|
|
|
},
|
2023-04-01 21:25:00 +11:00
|
|
|
},
|
2023-06-22 16:43:33 +10:00
|
|
|
pendingMemory: {},
|
2022-11-27 14:06:33 +11:00
|
|
|
},
|
2023-06-22 16:43:33 +10:00
|
|
|
engineCommandManager,
|
|
|
|
{ bodyType: 'root' },
|
|
|
|
[]
|
|
|
|
).then(async (programMemory) => {
|
|
|
|
const { artifactMap, sourceRangeMap } =
|
|
|
|
await engineCommandManager.waitForAllCommands()
|
|
|
|
|
|
|
|
setArtifactMap({ artifactMap, sourceRangeMap })
|
|
|
|
engineCommandManager.onHover((id) => {
|
|
|
|
if (!id) {
|
|
|
|
setHighlightRange([0, 0])
|
|
|
|
} else {
|
|
|
|
const sourceRange = sourceRangeMap[id]
|
|
|
|
setHighlightRange(sourceRange)
|
2023-02-21 14:50:22 +11:00
|
|
|
}
|
|
|
|
})
|
2023-06-22 16:43:33 +10:00
|
|
|
engineCommandManager.onClick(({ id, type }) => {
|
|
|
|
setCursor2({ range: sourceRangeMap[id], type })
|
|
|
|
})
|
|
|
|
setProgramMemory(programMemory)
|
|
|
|
const geos = programMemory?.return
|
|
|
|
?.map(({ name }: { name: string }) => {
|
|
|
|
const artifact = programMemory?.root?.[name]
|
|
|
|
if (
|
|
|
|
artifact.type === 'extrudeGroup' ||
|
|
|
|
artifact.type === 'sketchGroup'
|
|
|
|
) {
|
|
|
|
return artifact
|
|
|
|
}
|
|
|
|
return null
|
|
|
|
})
|
|
|
|
.filter((a) => a) as (ExtrudeGroup | SketchGroup)[]
|
2023-01-08 16:37:31 +11:00
|
|
|
|
2023-06-22 16:43:33 +10:00
|
|
|
// console.log(programMemory)
|
|
|
|
setError()
|
|
|
|
})
|
2023-02-21 14:50:22 +11:00
|
|
|
} catch (e: any) {
|
2023-07-26 14:10:30 -05:00
|
|
|
if (e instanceof KCLError) {
|
|
|
|
addKCLError(e)
|
|
|
|
} else {
|
|
|
|
setError('problem')
|
|
|
|
console.log(e)
|
|
|
|
addLog(e)
|
|
|
|
}
|
2023-02-21 14:50:22 +11:00
|
|
|
}
|
2022-11-23 21:28:38 +11:00
|
|
|
}
|
2023-02-21 14:50:22 +11:00
|
|
|
asyncWrap()
|
2023-06-23 14:19:15 +10:00
|
|
|
}, [code, isStreamReady])
|
2023-07-31 06:33:10 -04:00
|
|
|
|
2023-08-06 21:29:26 -04:00
|
|
|
const debounceSocketSend = throttle<EngineCommand>((message) => {
|
|
|
|
engineCommandManager?.sendSceneCommand(message)
|
|
|
|
}, 16)
|
|
|
|
const handleMouseMove = useCallback<MouseEventHandler<HTMLDivElement>>(
|
|
|
|
({ clientX, clientY, ctrlKey, currentTarget }) => {
|
|
|
|
if (!cmdId) return
|
|
|
|
if (!isMouseDownInStream) return
|
|
|
|
|
|
|
|
const { left, top } = currentTarget.getBoundingClientRect()
|
|
|
|
const x = clientX - left
|
|
|
|
const y = clientY - top
|
|
|
|
const interaction = ctrlKey ? 'pan' : 'rotate'
|
|
|
|
|
|
|
|
const newCmdId = uuidv4()
|
|
|
|
setCmdId(newCmdId)
|
|
|
|
|
|
|
|
debounceSocketSend({
|
|
|
|
type: 'modeling_cmd_req',
|
|
|
|
cmd: {
|
|
|
|
type: 'camera_drag_move',
|
|
|
|
interaction,
|
|
|
|
window: { x, y },
|
|
|
|
},
|
|
|
|
cmd_id: newCmdId,
|
|
|
|
file_id: fileId,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
[debounceSocketSend, isMouseDownInStream, cmdId, fileId, setCmdId]
|
|
|
|
)
|
|
|
|
|
2022-11-12 13:11:54 +11:00
|
|
|
return (
|
2023-08-06 21:29:26 -04:00
|
|
|
<div
|
|
|
|
className="h-screen relative flex flex-col"
|
|
|
|
onMouseMove={handleMouseMove}
|
|
|
|
>
|
|
|
|
<AppHeader
|
|
|
|
className={
|
2023-08-07 17:07:28 -04:00
|
|
|
'transition-opacity transition-duration-75 ' +
|
|
|
|
paneOpacity +
|
|
|
|
(isMouseDownInStream ? ' pointer-events-none' : '')
|
2023-08-06 21:29:26 -04:00
|
|
|
}
|
|
|
|
/>
|
2023-03-07 15:45:59 +11:00
|
|
|
<ModalContainer />
|
2023-08-06 21:29:26 -04:00
|
|
|
<Resizable
|
|
|
|
className={
|
2023-08-07 17:07:28 -04:00
|
|
|
'z-10 my-5 ml-5 pr-1 flex flex-col flex-grow overflow-hidden transition-opacity transition-duration-75 ' +
|
2023-08-06 21:29:26 -04:00
|
|
|
(isMouseDownInStream || onboardingStatus === 'camera'
|
|
|
|
? ' pointer-events-none '
|
|
|
|
: ' ') +
|
|
|
|
paneOpacity
|
|
|
|
}
|
|
|
|
defaultSize={{
|
|
|
|
width: '400px',
|
|
|
|
height: 'auto',
|
|
|
|
}}
|
|
|
|
minWidth={200}
|
|
|
|
maxWidth={600}
|
|
|
|
minHeight={'auto'}
|
|
|
|
maxHeight={'auto'}
|
|
|
|
handleClasses={{
|
|
|
|
right:
|
|
|
|
'hover:bg-liquid-30/40 dark:hover:bg-liquid-10/40 bg-transparent transition-colors duration-100 transition-ease-out delay-100',
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<CollapsiblePanel
|
|
|
|
title="Code"
|
|
|
|
icon={faCode}
|
|
|
|
className="open:!mb-2"
|
|
|
|
open={openPanes.includes('code')}
|
|
|
|
>
|
|
|
|
<div className="px-2 py-1">
|
2023-07-20 19:25:04 -04:00
|
|
|
<button
|
|
|
|
// disabled={!shouldFormat}
|
2023-02-02 20:41:28 +11:00
|
|
|
onClick={formatCode}
|
2023-07-20 19:25:04 -04:00
|
|
|
// className={`${!shouldFormat && 'text-gray-300'}`}
|
2023-02-02 20:41:28 +11:00
|
|
|
>
|
|
|
|
format
|
2023-07-20 19:25:04 -04:00
|
|
|
</button>
|
2022-11-28 19:43:20 +11:00
|
|
|
</div>
|
2023-08-06 21:29:26 -04:00
|
|
|
<div id="code-mirror-override">
|
|
|
|
<CodeMirror
|
|
|
|
className="h-full"
|
|
|
|
value={code}
|
|
|
|
extensions={[
|
|
|
|
javascript({ jsx: true }),
|
|
|
|
lineHighlightField,
|
|
|
|
lintGutter(),
|
|
|
|
linter((_view) => {
|
|
|
|
return kclErrToDiagnostic(useStore.getState().kclErrors)
|
|
|
|
}),
|
|
|
|
]}
|
|
|
|
onChange={onChange}
|
|
|
|
onUpdate={onUpdate}
|
|
|
|
theme={theme}
|
|
|
|
onCreateEditor={(_editorView) => setEditorView(_editorView)}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</CollapsiblePanel>
|
|
|
|
<section className="flex flex-col mt-auto">
|
|
|
|
<MemoryPanel
|
|
|
|
theme={theme}
|
|
|
|
open={openPanes.includes('variables')}
|
|
|
|
title="Variables"
|
|
|
|
icon={faSquareRootVariable}
|
|
|
|
/>
|
|
|
|
<Logs
|
|
|
|
theme={theme}
|
|
|
|
open={openPanes.includes('logs')}
|
|
|
|
title="Logs"
|
|
|
|
icon={faCodeCommit}
|
|
|
|
/>
|
|
|
|
<KCLErrors
|
|
|
|
theme={theme}
|
|
|
|
open={openPanes.includes('kclErrors')}
|
|
|
|
title="KCL Errors"
|
|
|
|
iconClassNames={{ icon: 'group-open:text-destroy-30' }}
|
|
|
|
/>
|
|
|
|
</section>
|
|
|
|
</Resizable>
|
|
|
|
<Stream className="absolute inset-0 z-0" />
|
|
|
|
{debugPanel && (
|
|
|
|
<DebugPanel
|
|
|
|
title="Debug"
|
|
|
|
className={
|
2023-08-07 17:07:28 -04:00
|
|
|
'transition-opacity transition-duration-75 ' +
|
|
|
|
paneOpacity +
|
|
|
|
(isMouseDownInStream ? ' pointer-events-none' : '')
|
2023-08-06 21:29:26 -04:00
|
|
|
}
|
|
|
|
open={openPanes.includes('debug')}
|
|
|
|
/>
|
|
|
|
)}
|
2022-11-12 13:11:54 +11:00
|
|
|
</div>
|
2022-11-26 08:34:23 +11:00
|
|
|
)
|
2022-11-12 13:11:54 +11:00
|
|
|
}
|