Module for consumption in Netlify CMS #12
Draft
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 experimenting in enriching the Netlify CMS (if you don't know it, look it up, I think it is awesome 馃槃). It offers some basic Markdown editing, but no rich table editing support (just editableContent).
I saw your repo and it looked a lot like the awesome tables in Notion, so I thought I could give it a go. After finding the fork of @jeff-r-koyaltech I fiddled a bit more to be able to include it from NextJS & Netlify CMS, and to be able to read the updated state from it.
Notably, it was a hell of a lot of work to be able to include the styles. The only way to get the stylesheet to not interfere with the rest of the CMS was to use a shadowroot via https://github.com/Wildhoney/ReactShadow, but this didn't really play nice with the style system. So I opted for outputting a
<style>
element with the actual styles (which then get scoped by ReactShadow). There may be better ways, but I didn't get it working otherwise 馃槄Proof:
Snippet required:
and how I hooked it up to Netlify CMS: