github TypeCellOS/BlockNote v0.43.0

8 hours ago

0.43.0 (2025-12-01)

Major Codebase Refactor

Currently, there is not much consistency in how the editor's feature set is extended, both internally and externally. Things like UI extensions (formatting toolbar, side menu, etc) are baked directly into the editor, while the trailing block extension gets added as a TipTap extension, and the placeholder extension is a ProseMirror Plugin.

The BlockNote extension API was somewhat haphazardly created out of the need for a unified API to add features to the editor, such as keyboard shortcuts, input rules, and exposing the ProseMirror plugin API for more advanced use cases. We migrated this in piecemeal, supporting ProseMirror plugins, TipTap extensions & a stripped down BlockNote extension API, but we need more!

Note that the changes presented in this PR are currently intended as internal code quality improvements. Additions to the API will be documented and released publicly at a later time.

BlockNote Extensions API Refactor

We've made big improvements to the BlockNote extension API, making extensions much more scalable. In addition to all previous functionality (like adding keyboard extensions), extensions can now:

  • Have a proper life cycle, i.e. initialise themselves, add event listeners, and cleanup.
  • Have a state that other parts of the app/UI can read from and write to.
  • Expose methods which other parts of the app/UI can call.
  • Be added & removed from the editor even after initialisation.
  • Be configured with different options.

Pretty much all existing editor features have been converted into BlockNote extensions, and use the same API to be created, as well as added to/removed from the editor. This is a great change to the codebase quality, as the editor is a lot more modular thanks to this change, and there is now a clear way to extend the editor's functionality.

UI Extension Refactor

Additionally, the UI extensions have been partially rewritten (currently includes the formatting toolbar, link toolbar, and file panel) to take advantage of the new extension functionality. The states they keep have been minimised as much as possible, and many of their responsibilities have been moved to the React layer. This massively cuts down on the overall code and makes them much more understandable.

Speaking of the React layer, alongside refactoring the UI extensions in the editor core, the React components and hooks have also been overhauled. FloatingUI now handles much of what was previously done by the extensions, including:

  • Positioning the element in the viewport.
  • Updating the element position from user interaction (scrolling, resizing the editor, etc).
  • Dismissing the element from user interaction (clicking outside the editor, pressing escape, etc).
  • Ensuring that the element transitions in/out correctly.

Alongside that, a bunch of helper components and hooks have been created to streamline the code.

In-Depth Changes

To see a detailed summary of the changes in this release, see PR #2143.

Breaking Changes

@blocknote/core

  • Existing extensions using the BlockNoteExtension class are no longer supported. Use the createExtension function instead.
  • Extension-specific imports have been moved from @blocknote/core to @blocknote/core/extensions.
  • Comment-specific imports have been moved from @blocknote/core to @blocknote/core/commnents.
  • Extensions are no longer listed as properties of BlockNoteEditor, e.g. editor.formattingToolbar. Use the getExtension method instead, e.g. editor.getExtension(FormattingToolbarExtension).
  • editor.openSuggestionMenu has been removed. Use editor.getExtension(SuggestionMenu).openSuggestionMenu instead.
  • editor.getForceSelectionVisible/editor.setForceSelectionVisible have been removed. Use editor.getExtension(ShowSelectionExtension).store.state.enabled/editor.getExtension(ShowSelectionExtension).showSelection instead.
  • editor.onCreate has been removed. Use editor.onMount instead.
  • insertOrUpdateBlock has been renamed to insertOrUpdateBlockForSlashMenu.
  • editor.updateCollaborationUserInfo has been removed.

@blocknote/react

  • useEditorContentOrSelectionChange has been removed. Use useEditorState instead.
  • useUIPluginState has been removed. Use useExtension or useExtensionState instead.
  • useUIElementPositioning has been removed. Use BlockPopover, PositionPopover, or GenericPopover instead.
  • useEditorForceUpdate has been removed.

@blocknote/xl-ai

  • BlockPositioner has been removed. Use BlockPopover instead.

Changelog

🚀 Features

  • Major Extensions & UI Refactor (#2143)

🩹 Fixes

  • allow configuring the email body's styles (#2182)
  • xl-docx-exporter: improve OOXML interoperability (#2206)

❤️ Thank You

Don't miss a new BlockNote release

NewReleases is sending notifications on new releases.