contentful / field-editors

React components and extensions for building Contentful entry editor
https://contentful-field-editors.netlify.app/
MIT License
150 stars 118 forks source link

Is it possible to use Contentful Rich Text Editor separately #1325

Closed IvanKuzyshyn closed 1 year ago

IvanKuzyshyn commented 1 year ago

Context

I have an app that allows users to create content. Content is stored in Contentful and my app is communicating with Contentful via REST API JavaScript SDK. My app provides the ability to add rich text and in order to do that I have a Slate editor right now. I see that Contentful has its own editor in a public package and I would like to use it instead of keeping Slate. I hope it will reduce friction and will make it easier to maintain.

Problem

I've cloned this repo to try out Rich Text Editor locally, but it's not running and has an error of:

Cannot use ui-extension-sdk outside of Contentful
In order for the ui-extension-sdk to function correctly, your app needs to be run in an iframe in the Contentful Web App.

Finally, I've found that this editor is designed to be used only inside the Contentful environment as a part of the extension app or similar.

Question:

Is there any solution on how can I use it in my app as a separate Rich Text Editor? The main goal is to use the onChange handler and once the field is changed use an API to send data from my app to Contentful.

IvanKuzyshyn commented 1 year ago

Additionally, I've found this in action example, but it doesn't seem to be a good way to go.

github-actions[bot] commented 1 year ago

Marking issue as stale since there was no activity for 30 days

IvanKuzyshyn commented 1 year ago

Closing this issue as I've resolved my task using Plate plugins and writing custom Plate to Contentful adapters.