Format project

This commit is contained in:
Kurt Hutten
2021-11-30 15:23:16 +11:00
parent 172e19165f
commit fac1968a74
9 changed files with 28 additions and 19 deletions

View File

@@ -69,7 +69,8 @@ export const makeStlDownloadHandler =
} else {
thunkDispatch((dispatch, getState) => {
const state = getState()
const specialCadProcess = (ideType === 'openscad' || ideType === 'curv') && 'stl'
const specialCadProcess =
(ideType === 'openscad' || ideType === 'curv') && 'stl'
dispatch({ type: 'setLoading' })
requestRender({
state,

View File

@@ -351,7 +351,7 @@ function ChooseYourCharacter() {
{
cadPackage: 'curv',
desc: "Curv is a programming language for creating art using mathematics. It's a 2D and 3D geometric modelling tool.",
}
},
].map(
({
cadPackage,

View File

@@ -25,7 +25,12 @@ const IdeViewer = ({
})
thunkDispatch((dispatch, getState) => {
const state = getState()
if (['png', 'INIT'].includes(state?.objectData?.type) && (ideType === 'openscad' || state?.objectData?.type === 'INIT' || !state?.objectData?.type)) {
if (
['png', 'INIT'].includes(state?.objectData?.type) &&
(ideType === 'openscad' ||
state?.objectData?.type === 'INIT' ||
!state?.objectData?.type)
) {
dispatch({ type: 'setLoading' })
requestRender({
state,

View File

@@ -169,7 +169,7 @@ export function PureIdeViewer({
isMinimal = false,
scadRatio = 1,
camera,
ideType
ideType,
}: {
dataType: 'INIT' | ArtifactTypes
artifact: any
@@ -218,9 +218,9 @@ export function PureIdeViewer({
)}
<div // eslint-disable-line jsx-a11y/no-static-element-interactions
className={`opacity-0 absolute inset-0 transition-opacity duration-500 ${
ideType === 'curv' && dataType === 'png' ? // TODO hide axes while curve doesn't have a controllable camera
'opacity-0' :
!(isDragging || dataType !== 'png')
ideType === 'curv' && dataType === 'png' // TODO hide axes while curve doesn't have a controllable camera
? 'opacity-0'
: !(isDragging || dataType !== 'png')
? 'hover:opacity-50'
: 'opacity-100'
}`}
@@ -230,7 +230,10 @@ export function PureIdeViewer({
<Controls
onDragStart={() => setIsDragging(true)}
onInit={onInit}
onCameraChange={(...args) => {onCameraChange(...args); setIsDragging(false)}}
onCameraChange={(...args) => {
onCameraChange(...args)
setIsDragging(false)
}}
controlsRef={controlsRef}
camera={camera}
/>

View File

@@ -38,8 +38,7 @@ export const render = async ({ code, settings }: RenderArgs) => {
}
const blob = await response.blob()
const text = await new Response(blob).text()
const { consoleMessage, type } =
splitGziped(text)
const { consoleMessage, type } = splitGziped(text)
return createHealthyResponse({
type: type !== 'stl' ? 'png' : 'geometry',
data: