-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let plugins extend State
schema
#709
Comments
My additional, it would be nice, if this state were personalized by plugin for excluding intersections of their state (like personal name spacing) 😊 |
What kinds of use cases are you thinking about? |
For example, we have plugin like hovering menu and we want to add a link functionality. It could be a button in hovering menu. When an user click on the button, then a link popover will be opened. |
The main goal of this, I think, to find way to have communication between events in the plugin and |
Gotcha, I think that makes sense to me! I'd be open for a pull request that adds a |
Perfect! 😊 |
This would be great! Another usecase that I was thinking of would be using it as a central list/repository of things (like links, mentions, languages, font, etc) that are like metadata for the document. (I'm assuming it will be part of the raw JSON that is serialized/deserialized). Thanks @AlbertHilb for suggesting this! |
Any progress on this @AlbertHilb? This kind of behavior would be very useful for something I'm working on too... |
@AlbertHilb I'm not sure your current direction of how this state would exist but I wanted to throw out an idea for you to consider. We could extend the state's data to be an object like: stateData: {
document: { ... },
paragraphNode: { ... },
headingNode: { ... }
} and any change in |
Plugins add new functionalities to the editor. Editor
State
, therefore, should be able to keep also data related to these new functionalities.To this aim, maybe, it suffices to add a new field to
State
, an ImmutableMap
, which can be used by plugins to store their own data.What do you think?
The text was updated successfully, but these errors were encountered: