collective / volto-hydra

A volto addon to let you edit content in realtime when you have many frontends written in any framework
1 stars 2 forks source link

formatting can result in removing text in slate (+other problems) #147

Open djay opened 2 months ago

djay commented 2 months ago

Problem

The rich text editor needs to use transforms in slate package more directly so that the editor does the right thing when formatting text.

How to reproduce

  1. Selected the word Test.
  2. Clicked bold
  3. rest of the parapraph got removed

Other bugs

... TODO

Context

Image Image

djay commented 1 month ago

as discussed in the meeting. probably the best way to deal with it is use the slate package installed on the adminUI side. send over the selection and action, make a transformation and then send that updated state to both the slateblock on the admin side and back over the bridge as an update to be rerendered. Don't try to use the SlateBlock code directly. Still keep the formatting UI on the frontend side.

djay commented 2 weeks ago

So looking at the code

slate should in theory work without react but there doesn't seem to be much documentation on that

So haven't found an implementation without a framework.

Another option is to fake events to the react slate in the sidebar. doesn't seem like a good idea though