Done in three steps, merged on master (19.0.0-SNAPSHOT) and backported to stable-18.10.x:
https://github.com/xwiki/xwiki-platform/pull/7463: a BlockNote editor instance is created from a single options object, EditorOptions, whose TSDoc describes where each option goes (top level or features.<id>) and which layer declares it. The options hold values; behavior is injected through the service container.
https://github.com/xwiki/xwiki-platform/pull/7470: the editor takes its services (LinkEditor, FileUploader, MacroEditor, the metadata handlers, etc.) from the Inversify service container. Each mounted editor gets an EditorInstance handle (editor, options, metadata, serviceContainer), passed as first argument to the stateless services, with a child container for the bindings specific to that instance.
https://github.com/xwiki/xwiki-platform/pull/7498: every editing feature is an EditorFeature bound under editorFeatureName, which contributes block types, inline content types and text styles to the schema, slash menu and formatting toolbar items, components, BlockNote extensions and BlockNote editor options. The editor merges the contributions and reports conflicts, without naming any feature. The generic features (file transfer, code blocks, text styles, images, links, macros) are bound by the ComponentInit of blocknote-react; xwikiRenderingFeature (definition lists, groups, raw blocks, verbatim and parameters styles) is exported and bound by the WebJar only. features.<id>: false disables a feature, and a feature contributes nothing when the syntax of the edited content can't save what it adds.
Cristal has to be adapted when it upgrades: call the ComponentInit of blocknote-react to get the generic features, and drop its conversion of the XWiki-specific block types it no longer gets.
Content holding a block type that no enabled feature adds currently makes BlockNote throw while the editor is created, without telling the user why (a known deviation, to be handled in a separate issue).
Marius Dumitru Florea on 19/Nov/26 06:12
Done in three steps, merged on master (19.0.0-SNAPSHOT) and backported to stable-18.10.x:
# [PR 7463| https://github.com/xwiki/xwiki-platform/pull/7463]: a BlockNote editor instance is created from a single options object, {{EditorOptions}}, whose TSDoc describes where each option goes (top level or {{features.<id>}}) and which layer declares it. The options hold values; behavior is injected through the service container. # [PR 7470| https://github.com/xwiki/xwiki-platform/pull/7470]: the editor takes its services ({{LinkEditor}}, {{FileUploader}}, {{MacroEditor}}, the metadata handlers, etc.) from the Inversify service container. Each mounted editor gets an {{EditorInstance}} handle ({{editor}}, {{options}}, {{metadata}}, {{serviceContainer}}), passed as first argument to the stateless services, with a child container for the bindings specific to that instance. # [PR 7498| https://github.com/xwiki/xwiki-platform/pull/7498]: every editing feature is an {{EditorFeature}} bound under {{editorFeatureName}}, which contributes block types, inline content types and text styles to the schema, slash menu and formatting toolbar items, components, BlockNote extensions and BlockNote editor options. The editor merges the contributions and reports conflicts, without naming any feature. The generic features (file transfer, code blocks, text styles, images, links, macros) are bound by the {{ComponentInit}} of blocknote-react; {{xwikiRenderingFeature}} (definition lists, groups, raw blocks, verbatim and parameters styles) is exported and bound by the WebJar only. {{features.<id>: false}} disables a feature, and a feature contributes nothing when the syntax of the edited content can't save what it adds.
The architecture the editor and its features follow, with its known deviations, is described in the README of blocknote-react: https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-node/src/main/node/editors/blocknote-react/README.md
Notes: * Cristal has to be adapted when it upgrades: call the {{ComponentInit}} of blocknote-react to get the generic features, and drop its conversion of the XWiki-specific block types it no longer gets. * Content holding a block type that no enabled feature adds currently makes BlockNote throw while the editor is created, without telling the user why (a known deviation, to be handled in a separate issue).
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.