Replies: 1 comment 1 reply
-
|
We already do the same with document methods being exposed via EditorJSModel. One more layer (+types in SDK) sounds really complicated. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem statment
Currently model is strictly internal with two exceptions: Adapter and Collaboration Manager. The reason is simple: we don't want external plugins to mess with a model as it's the source of truth for the document state.
However, that brings two problems:
Proposed solution
I propose to add API methods which would update the model (e.g. insertText/removeText/etc.). We already have BlocksAPI and SelectionAPI which in a nutshell do exactly this — update the model.
We still won't expose the model itself, each method should be implemented in the API and have safeguards if required so the document state remains stable.
Advantages of this approach are:
There are disadvantages as well:
Please share your thoughts and comments if you have any questions/concerns. Leave a comment if you support the proposal as well
Beta Was this translation helpful? Give feedback.
All reactions