-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Add support for Monaco Editor #239
Conversation
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.
Thank you for the PR! Can you add a Monaco editor to the demo page on the demo/testing page?
https://ghosttext.fregante.com/test/
The "edit" link is at the bottom
|
Refer to https://github.com/fregante/GhostText/blob/main/contributing.md#adding-support-for-more-editors for more information if you haven't. Linting is still failing here as well and it should pass for this PR to be merged |
You marked some of my comments as resolved but you did not address them. Please review again |
const monaco = field.closest('.monaco-editor'); | ||
if (monaco) { | ||
const visualElement = monaco.querySelector('.monaco-editor-background'); | ||
return new AdvancedTextWrapper(monaco, visualElement); |
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.
Fixed:
Not fixed:
|
@ryan-efendy are you able to finish this soon? I'd love to include it in this week’s release, otherwise it'll have to wait longer |
This pull request adds support for the Monaco Editor. This resolves issue #140, which requested the ability to use GhostText with the Monaco Editor.
The changes include a new condition in the
unsafe-messenger.js
file that checks for the existence of themonaco
object, and a new functionmonacoEditor(target)
that handles the events and value transfer for the Monaco Editor.This has been tested and confirmed to work with the Monaco Editor, and should not affect the existing support for CodeMirror and Ace.
Here's a demo of the update:
vehLTicnh4.mp4