feat: add editor options and wrapping component prop #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
👋 I'm considering using this plugin in a design system storybook and there were two missing features I thought I'd implement and ask for feedback.
The first feature is for the
<Playground>
to accept an optionaleditorOptions
prop of typeMonaco.editor.IEditorOptions
so that the editor's options can be defined at init time rather than after the fact via themodifyEditor
function prop. The minimap (on by default) is not useful for snippets that require little or no scrolling so it would be useful to be able to turn that off, and the current way of dealing with this feels suboptimal:The second feature is to pass in a wrapping component that wraps the rendered code so that it can be distinguished from the rest of the page. For instance, if the component rendered by the snippet has the same background color as the rest of the page but has some other visually defining feature (e.g. a border radius) then it is indistinguishable from the rest of the page unless a wrapping element is added, but I don't want that to be a part of the code sample.
I'm happy to split these into separate PRs if that helps.
Getting correct syntax highlighting on JSX is another item on the wishlist, but that seems like it's much harder than it should be 😅