Plugins outside of the editor - editor context #5891
Labels
type:feature
This issue reports a feature request (an idea for a new functionality or a missing option).
Milestone
The time has come when some of our plugins evolved so much that they can be used outside of the editor. Such plugins have to stay compatible with the editor (like it was before) but also have to be ready to be used without the editor, or even with multiple editors at once.
After some researches and discussions, we decided to introduce a
Context
class, that's gonna be an environment for the plugins used outside of the editor. Also, a new type of plugin, aContextPlugin
will be introduced to represents plugins compatible with the context and the editor. The currentPlugin
class will be compatible only with the editor like it was before.Context API will be similar to the editor API but will be limited only to some properties:
Scenarios
Single editor usage
For the single editor, not much change. Editor, when created, initialize additional property
editor.context
, with an empty context used only by this editor. There are no changes in the editor API for basic usage.Shared editor usage
Assume that the
Comments
plugin requires theSidebar
plugin.If the
context
property is passed to the editor it means that:context.plugins
(instances) should be added to the editor plugins,editor.config
should be extended by thecontext.config
,editor.locale
should usecontext.locale
.Note, that this way, both editors will share the same
Sidebar
plugin. When any of these editors useeditor.plugins.get( 'Sidebar' )
they will get the same instance.When it comes to dependencies:
The text was updated successfully, but these errors were encountered: