Create Embed system
- Dominant language
- TypeScript
- Stars
- 384
- Forks
- 58
- PR merge metrics
- No merged PRs in 30d
Description
## Feature Description
Create a code snippet and supporting assets to be able to embed CadHub projects on other web sites/pages.
## Background Research
- CodePen has a [blog walkthrough post](https://blog.codepen.io/documentation/embedded-pens/) for users to explain how their embed editor works.
- CodeSandbox has an [even more thorough page](https://codesandbox.io/docs/embedding) dedicated to their embed.
## Requirements
Technically the IDE or Details pages, or any page for that matter, can be embedded elsewhere via an `iframe`. But the idea is to create an endpoint that displays the model with the optional addition of either the code or the project info in as small a package size as possible. In the future there should be URL parameters that allow for additional configurations. My initial thoughts are:
1. Remove Monaco, React, any Redwood dependencies. Keeping the "editor" styles might mean recreating them.
2. have STL pre-generated so that code evaluation can be removed
3. Have either vanilla JS or Preact / Alpine / Petite Vue for targeted interactivity, things like switch between tabs for example.
4. Remove any layout change features: code or details on left, viewer on right or full-width.
5. Add control to Share dialog to generate embed snippet, maybe allow user to adjust height of embed in advance with a slider or something?
Contributor guide
Assessment
This issue has not been assessed yet.