-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Make code editor resizable and detachable #7
feat: Make code editor resizable and detachable #7
Conversation
The previous implementation meant that any events (i.e onClicks) weren't being surfaced to the main application window
package.json
Outdated
@@ -83,8 +84,10 @@ | |||
"webpack-merge": "^4.1.4" | |||
}, | |||
"devDependencies": { | |||
"@babel/plugin-transform-react-constant-elements": "^7.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this dependency still need to be here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@svgr/webpack lists it as an internal dependancy but without manually adding it I'm getting Error: Cannot find module '@babel/plugin-transform-react-constant-elements'
. I'll look into it
This PR implements both a resizable editor, and a detachable editor.
The resizing is implemented using
re-resizable
and the detachable editor is implemented with react portals. See here for external window/portal inspiration.Demo:
https://cl.ly/909106ad4a23
Limitations:
The new window needs to be focussed by the user before the code renders.
The window.open gets blocked by the browser, not sure if there are approaches here to avoid this.
Basic testing in latest Chrome/Safari/FF