Replies: 2 comments 1 reply
-
@osaxma I saw that you are very knowledgeable about SuperEditor and have been very helpful in this repo. Do you have any initial pointers on how I could approach the above issue? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi @jhlabs - what you're looking to do is probably not feasible in super_editor right now. However, once the undo/redo work is figured out, it shouldn't be difficult. There are some other customers who need similar behavior. We won't get to the undo/redo work until we're done integrating mobile support, which we're currently working on in conjunction with the Flutter team. The mobile integration requires some changes in Flutter. Once that process is complete, we can focus on undo/redo and figure out how to report event-based changes to the document. |
Beta Was this translation helpful? Give feedback.
-
First of all, thanks for creating SuperEditor! From the little exposure, I have had so far it is a very well-architected project with a great community.
As part of a project I am working on, I want to create a typical block editor. But similar to editors like Notion or Roam, I want to store each individual block in a database (in my case Firestore), instead of saving the entire
Document
provided by SuperEditor. The reason is that a block can be part of several documents.Now I am stuck on how I would persist changes made in the editor to the database. I would need to know from SuperEditor not only if it changed, but also which block changed.
For example, if I add a new paragraph node inside of the editor I would need to tell my state management (I use the bloc library with Flutter) and in extension my backend 2 things:
If I then continue typing in the same paragraph, I would only send an event to update the current block I am in the database.
How do I get this information with SuperEditor? I have used another block editor library for Javascript called SlateJS before (https://docs.slatejs.org/). This library exposes a few so-called
Operations
that expose the core changes that can be made to the document (https://github.com/ianstormtaylor/slate/blob/main/packages/slate/src/interfaces/operation.ts). Does SuperEditor expose a similar set that can be used to inform a state management library of the changes occurring to the document? And has anyone else faced this issue of saving individual blocks instead of an entire document?Thanks in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions