Fix CascadeStudio integration #99
Reference in New Issue
Block a user
Delete Branch "kurt/issue-95"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Resolves #19
I'm sure there are bugs but at lease it's working now. Sorry that this PR is so big. Up to you if you want to look through it or not @Yash-R.
Theres a preview here
Basically there's some UI for the tool bar to work and logic for saving the code in the editor/IDE,

and than there are many hacks to get a code in the sudmodule to work. Not really sustainable from a maintenance perspective but good enough for a proof of concept. I'm think I'm just about ready to reach out to the folks at cascade Studio and see if they want to collaborate at all.
@@ -11,1 +11,3 @@"move-ts-defs": "cp ./node_modules/opencascade.js/dist/opencascade.d.ts ./web/public && cp ./node_modules/three/src/Three.d.ts ./web/public && cp ./web/src/cascade/js/StandardLibraryIntellisense.ts ./web/public""move-ts-defs": "cp ./web/src/cascade/js/StandardLibraryIntellisense.ts ./web/public","move-cad-worker": "rm -r web/public/CADWorker || true && mkdir web/public/CADWorker && mkdir web/public/CADWorker/node_modules && cp -r ./web/src/cascade/js/CADWorker ./web/public && cp -r ./web/src/cascade/node_modules ./web/public/CADWorker && cp -r ./web/src/cascade/fonts ./web/public/CADWorker","move-statics": "yarn move-ts-defs && yarn move-cad-worker"This is just copying a bunch of js worker files from the git submodule and putting them in the public folder (so they can be accessed from the browser),
which reminds me I need to update the read me to add a
yarn move-cad-workerstep to the instructions.clean up
@@ -0,0 +10,4 @@const [code, setCode] = useState(part.code)const { currentUser } = useAuth()const canEdit = currentUser?.sub === part?.user?.iduseEffect(() => {Add a description to this useEffect, something along the lines of.
Cascade studio attatches to a div outside the react app, and so we are "opening" and "closing" it for the ide part of the app by displaying none or block. Which is why this useEffect returns a clean up function that hides the div again.
delete this nav element. I added hidden class but intended to remove it entirely.
Likewise has a hidden class. This div should be removed.
remove commented code.
Clean up this file, what a mess
Oh Great, i'm sure you will collaborate with them @Irev-Dev