This issue has been created
There are 2 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-ac9c35f4-c9cf-461d-9dce-53205b7c84b4 XWIKI-25769 Open

Refactor how BlockNote editor instance and its features are configured

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-7511e310-3c54-4ccf-8470-7ee4ef646512 Marius Dumitru Florea created this issue on 16/Nov/26 11:23
 
Summary: Refactor how BlockNote editor instance and its features are configured
Issue Type: cid:jira-generated-image-avatar-ac9c35f4-c9cf-461d-9dce-53205b7c84b4 Improvement
Affects Versions: 17.10.0
Assignee: Unassigned
Components: BlockNote
Created: 16/Nov/26 11:23
Priority: cid:jira-generated-image-static-major-18252935-106b-4c84-93dc-739aeb2979aa Major
Reporter: Marius Dumitru Florea
Description:

The configuration of the BlockNote editor is spread inconsistently over its three layers (the BlockNote WebJar, blocknote-headless and blocknote-react), which makes it hard to integrate the editor correctly and leaves no room for extensions to add their own features:

  • the same information is passed several times, through different channels: the edited document, for instance, reaches the editor as a serialized reference, as the link context, and captured in several callbacks, each with its own fallback when it's missing
  • some options are passed directly while others go through a generic editorProps object, and some are raw BlockNote options, so there is no rule for where a new option belongs
  • generic services, that could be shared by all the editor instances on the page, are wrapped in callbacks and passed to each instance (e.g. the macro and image wizards), instead of being injected from the component container

This leads to bugs, e.g. two BlockNote fields of the same document edited in realtime are bound to the same shared content, because the name of the editor instance is never passed.

Proposal

  • configure an editor instance with a single options object, defined once by the lowest layer that uses it: instance-wide options (name, edited document, syntax, language, label, ...) at the top level, and the options of each feature (links, images, macros, ...) grouped under that feature
  • inject the services from the component container, passing only the options that change how they are used, and give them access to the editor instance they act on
  • introduce an extension point that lets a feature (built-in or contributed by an extension) contribute to the editor (blocks, menus, toolbars) and read its own per-instance options
 
 

2 updates

 
cid:jira-generated-image-avatar-7511e310-3c54-4ccf-8470-7ee4ef646512 Changes by Marius Dumitru Florea on 16/Nov/26 11:23
 
Fix Version: 18.10.0-rc-1
Assignee: Marius Dumitru Florea