CadQuery MVP integration #281

Merged
Irev-Dev merged 15 commits from kurt/274 into main 2021-04-27 11:53:52 +02:00
7 changed files with 69 additions and 30 deletions
Showing only changes of commit 0f4a9b07b4 - Show all commits

View File

@@ -1,17 +1,35 @@
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
import { useContext } from 'react'
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
import { useContext, useEffect } from 'react'
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
import { IdeContext } from 'src/components/IdeToolbarNew'
const IdeConsole = () => {
const { state } = useContext(IdeContext)
useEffect(() => {
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
const element = document.querySelector('.console-tile .mosaic-window-body')
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
if (element) {
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
element.scrollTop = element.scrollHeight - element.clientHeight
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
}
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
}, [state.consoleMessages])
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
const matchEditorVsDarkThemeBg = { backgroundColor: 'rgb(30,30,30)' }
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
const matchEditorVsDarkThemeText = { color: 'rgb(212,212,212)' }
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
Irev-Dev commented 2021-04-27 04:42:16 +02:00 (Migrated from github.com)
Review

This effect scrolls the console to the bottom whenever there is a new message. Users can still scroll up to look at history, it just snaps back down next message. We might want to add a checkbox to turn off/on this functionality, but I think this is a good default and unless someone complains about it, might as well stay as is.

This effect scrolls the console to the bottom whenever there is a new message. Users can still scroll up to look at history, it just snaps back down next message. We might want to add a checkbox to turn off/on this functionality, but I think this is a good default and unless someone complains about it, might as well stay as is.
franknoirot commented 2021-04-27 07:08:02 +02:00 (Migrated from github.com)
Review

Hey nice! So few lines of code. Yeah that should be configurable in future: that's one of those less-technical bits I can deal with for you coming up, so you don't have to waste time on it.

Hey nice! So few lines of code. Yeah that should be configurable in future: that's one of those less-technical bits I can deal with for you coming up, so you don't have to waste time on it.
const matchEditorVsDarkThemeTextBrown = { color: 'rgb(206,144,120)' }
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
return (
<div className="p-8 border-2 m-2 overflow-y-auto">
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
<div className="p-2 px-4 min-h-full" style={matchEditorVsDarkThemeBg}>
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
<div>
{state.consoleMessages?.map(({ type, message }, index) => (
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
{state.consoleMessages?.map(({ type, message, time }, index) => (
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
<pre
className={'font-mono ' + (type === 'error' ? 'text-red-500' : '')}
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
className="font-mono text-sm"
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
style={matchEditorVsDarkThemeText}
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
key={message + index}
>
{message}
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
<div
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
className="text-xs font-bold pt-2"
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
style={matchEditorVsDarkThemeTextBrown}
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
>
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
{time?.toLocaleString()}
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
</div>
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
<div className={(type === 'error' ? 'text-red-400' : '') + ' pl-4'}>
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
{message}
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
</div>
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
</pre>
))}
</div>
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.
Irev-Dev commented 2021-04-26 10:12:50 +02:00 (Migrated from github.com)
Review

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

I'm using "vs-dark" theme for the editor, only because I think a dark theme make sense since it's the general preference for most devs when it comes to editors at least, happy to load a nicer theme, but for now any dark theme will do. The following are some colors to match this theme for the console. Not crucial but also not hard to do.

View File

@@ -58,15 +58,22 @@ const IdeContainer = () => {
}, [])
return (
<div id="cadhub-ide" className="flex-auto h-full">
<div id="cadhub-ide" className="mosaic-toolbar-overrides flex-auto h-full">
<Mosaic
renderTile={(id, path) => {
const title = id === 'Editor' ? `${id} (${state.ideType})` : id
return (
<MosaicWindow
path={path}
title={title}
className={id.toLowerCase()}
renderToolbar={() => (
<div
className="text-xs text-gray-400 pl-4 w-full py-px font-bold leading-loose border-b border-gray-700"
style={{ backgroundColor: 'rgb(55,55,55)' }}
>
{id}
{id === 'Editor' && ` (${state.ideType})`}
</div>
)}
className={`${id.toLowerCase()} ${id.toLowerCase()}-tile`}
>
{id === 'Viewer' ? (
<div id="view-wrapper" className="h-full" ref={viewerDOM}>

View File

@@ -1,5 +1,4 @@
import { useContext, useEffect, Suspense, lazy } from 'react'
import { isBrowser } from '@redwoodjs/prerender/browserUtils'
import { useContext, Suspense, lazy } from 'react'
import { IdeContext } from 'src/components/IdeToolbarNew'
import { codeStorageKey } from 'src/helpers/hooks/useIdeState'
import { requestRender } from 'src/helpers/hooks/useIdeState'
@@ -34,15 +33,27 @@ const IdeEditor = () => {
localStorage.setItem(codeStorageKey, state.code)
}
}
const loading = (
<div
className="text-gray-700 font-ropa-sans relative"
style={{ backgroundColor: 'red' }}
>
<div className="absolute inset-0 text-center flex items-center w-32">
. . . loading
</div>
</div>
)
return (
<div // eslint-disable-line jsx-a11y/no-static-element-interactions
className="h-full"
franknoirot commented 2021-04-27 07:13:41 +02:00 (Migrated from github.com)
Review

I had missed you added this, what a great addition! And for it to be agnostic of the CAD package; this is the kind of unifying stuff that's gonna make it so nice to switch between packages.

I had missed you added this, what a great addition! And for it to be agnostic of the CAD package; this is the kind of unifying stuff that's gonna make it so nice to switch between packages.
onKeyDown={handleSaveHotkey}
>
<Suspense fallback={<div>. . . loading</div>}>
<Suspense fallback={loading}>
<Editor
defaultValue={state.code}
value={state.code}
theme="vs-dark"
loading={loading}
// TODO #247 cpp seems better than js for the time being
defaultLanguage={ideTypeToLanguageMap[state.ideType] || 'cpp'}
language={ideTypeToLanguageMap[state.ideType] || 'cpp'}

View File

@@ -24,7 +24,8 @@ export const render = async ({ code }) => {
status: 'error',
message: {
type: 'error',
message: addDateToLog(cleanedErrorMessage),
message: cleanedErrorMessage,
time: new Date(),
},
}
}
@@ -37,7 +38,8 @@ export const render = async ({ code }) => {
},
message: {
type: 'message',
message: addDateToLog(data.result),
message: data.result || 'Successful Render',
time: new Date(),
},
}
} catch (e) {
@@ -49,7 +51,8 @@ export const render = async ({ code }) => {
status: 'error',
message: {
type: 'error',
message: addDateToLog('network issue'),
message: 'network issue',
time: new Date(),
},
}
}
@@ -61,8 +64,3 @@ const openScad = {
}
export default openScad
function addDateToLog(message) {
return `-> ${new Date().toLocaleString()}
${message}`
}

View File

@@ -34,7 +34,8 @@ export const render = async ({ code, settings }) => {
status: 'error',
message: {
type: 'error',
message: addDateToLog(cleanedErrorMessage),
message: cleanedErrorMessage,
time: new Date(),
},
}
}
@@ -47,7 +48,8 @@ export const render = async ({ code, settings }) => {
},
message: {
type: 'message',
message: addDateToLog(data.result),
message: data.result,
time: new Date(),
},
}
} catch (e) {
@@ -59,7 +61,8 @@ export const render = async ({ code, settings }) => {
status: 'error',
message: {
type: 'error',
message: addDateToLog('network issue'),
message: 'network issue',
time: new Date(),
},
}
}
@@ -71,8 +74,3 @@ const openScad = {
}
export default openScad
function addDateToLog(message) {
return `-> ${new Date().toLocaleString()}
${message}`
}

View File

@@ -46,7 +46,9 @@ export const useIdeState = () => {
const code = localStorage.getItem(codeStorageKey) || initCodeMap.openscad
const initialState = {
ideType: 'INIT',
consoleMessages: [{ type: 'message', message: 'Initialising' }],
consoleMessages: [
{ type: 'message', message: 'Initialising', time: new Date() },
],
code,
objectData: {
type: 'stl',

View File

@@ -44,6 +44,11 @@
@apply list-disc;
}
.mosaic-toolbar-overrides .mosaic-window .mosaic-window-toolbar {
/* makes the height of the toolbar based off the content inside instead of hardcoded to 30px */
height: unset;
}
/* Used for LandingSection.js, if it's gone or these class isn't used there you can probably delete it */
.svg-shadow {
@@ -100,4 +105,4 @@ input.error, textarea.error {
/* used in IdeContainer component */
#cadhub-ide .mosaic-window.console .mosaic-window-body {
overflow-y: auto;
}
}