v0.30.0
facebook/lexicalv0.30.0Apr 7, 2025by etrepum
AI Summary
Lexical v0.30.0 introduces several breaking changes related to listener behavior, markdown import/export handling, and improved editor synchronization. This release focuses on bug fixes across core, rich text, collaboration, markdown, list, and table modules, while adding new features like text-transform CSS support, image links via NodeSelection, and table pasting improvements.
Key Highlights
- Listeners now always called with the editor they were registered to, affecting nested editor event delegation
- Fixed right/up arrow key navigation with decorator nodes and forward line deletion with control+K
- Added text-transform styles to exported HTML for CSS property support
- Enhanced table pasting logic and renamed/deprecated some table utilities
- Added support for image links via NodeSelection in the link module
Breaking Changes
- Listeners are now always called with the editor they were registered to - nested editors delegate events differently (#7378)
- Markdown import preserves paragraph separation after block elements when shouldPreserveNewlines is true (#7386)
- Markdown encoding now uses HTML entities for leading/trailing whitespace in formatted strings (#7400)
New Features
- Add text-transform styles to exported HTML (#7438)
- Export registerCheckList from lexical-list module (#7429)
- Add option to disable first item auto-selection in menus (#7404)
- Improve logic for pasting table into table (#7408)
- Rename and deprecate some table utils (#7415)
- Clear block ElementNode formatting along with TextNode in playground (#7384)
- Clear formatting should also clear any indent/outdent if applied (#7417)
- Add support for image links via NodeSelection (#7366)
- Enforce strict list indentation (#7420)
- Prevent indentation from becoming negative in rich text (#7411)
- Prevent Markdown shortcuts from applying to code-formatted text (#7395)
Full Release Notes
## Breaking Changes ### Listeners are now always called with the editor they were registered to #7378 changed the internal `updateEditorSync` implementation to always use the correct active editor when triggering a listener. This only affects how nested editors delegate their events to listeners attached to a parent editor. If you have listeners attached to the parent editor that expect to be called with the context of the nested editor then you'll have to either also attach the listener to the nested editor, or change the behavior to check the editor argument of the command listener to see which editor the command was originally dispatched to. ### Import of markdown blocks preserves separation with shouldPreserveNewLines #7386 changed the behavior of the markdown import's paragraph merging logic to align with GitHub's markdown editor behavior for list and common markdown formatting expectations when `shouldPreserveNewlines` is true. ### Markdown encoding uses HTML entities to represent leading and trailing whitespace #7400 changed the markdown encoder to replace leading or trailing whitespace of formatted strings with the corresponding HTML entities ## Highlights Core * ✅ #7378 Ensure updateEditorSync is always synchronous and use it when triggering listeners * ✅ #7393 Fix right and up arrow key navigation with decorator nodes * ✅ #7401 Clone the selection and use $setSelection instead of assigning dirty to true directly * ✅ #7397 Change `$getTextNodeOffset` invariant to warn in prod (error in `__DEV__`) * ✅ #7412 Fix forward line deletion when using control+K * 🆕 #7438 Add text-transform styles to exported HTML Rich Text * ✅ #7411 Prevent indentation from becoming negative Collab * ✅ #7330 Don't sync ElementNode `__dir` property * ✅ #7398 Fix scroll position getting changed when someone else makes a change in collab Markdown * ✅ #7386 Preserve paragraph separation after block elements * ✅ #7395 Prevent Markdown shortcuts from applying to code-formatted text * ✅ #7400 Replace whitespace with code point when the string has leading and trailing whitespaces List * ✅ #7380 Empty list item type change * ✅ #7420 Enforce strict list indentation * 🆕 #7429 Export `registerCheckList` Link * ✅ #7366 Add support for image links via NodeSelection Devtools * ✅ #7403 Update debug view to show KEY_ESCAPE_COMMAND immediately React * 🆕 #7404 Add option to disable first item auto-selection in menus Table * 🆕 #7408 Improve logic for pasting table into table * 🆕 #7415 Rename and deprecate some table utils Playground * 🆕 #7384 Clear block ElementNode formatting along with TextNode * 🆕 #7417 Clear formatting should also clear any indent/outdent if applied * ✅ #7368 Remove shared imports from playground for easier re-use * ✅ #7388 Use natural dimensions for inherited image size * ✅ #7405 Fix floating toolbar position for end-aligned text * ✅ #7431 Fix immediate broken image display on load failure ## What's Changed * v0.29.0 by @lilshady in https://github.com/facebook/lexical/pull/7375 * [__tests__] Update next version by @lilshady in https://github.com/facebook/lexical/pull/7374 * [lexical-playground] Chore: Remove shared imports from playground by @etrepum in https://github.com/facebook/lexical/pull/7368 * [lexical-list] Bug Fix: empty list item type change by @fantactuka in https://github.com/facebook/lexical/pull/7380 * [Breaking Change][lexical] Bug Fix: Ensure updateEditorSync is always synchronous and use it when triggering listeners by @etrepum in https://github.com/facebook/lexical/pull/7378 * Update dependencies: vite,@babel/runtime,prismjs,@babel/helpers by @lilshady in https://github.com/facebook/lexical/pull/7381 * update codeowners by @potatowagon in https://github.com/facebook/lexical/pull/7389 * [lexical-playground] Feature: clear blockelement formatting along with textNode by @harshmetkel24 in https://github.com/facebook/lexical/pull/7384 * [lexical-playground] Bug Fix: Use natural dimensions for inherited image size by @kirandash in https://github.com/facebook/lexical/pull/7388 * [Breaking Change][lexical-markdown] Bug Fix: Preserve paragraph separation after block elements by @kirandash in https://github.com/facebook/lexical/pull/7386 * [lexical-link][lexical-playground] Feature: Add support for image links via NodeSelection by @kirandash in https://github.com/facebook/lexical/pull/7366 * [lexical-yjs] Bug Fix: don't sync ElementNode __dir property by @james-atticus in https://github.com/facebook/lexical/pull/7330 * [lexical-rich-text] Bug Fix: Fix right and up arrow key navigation with decorator nodes by @kirandash in https://github.com/facebook/lexical/pull/7393 * [lexical-markdown] Bug Fix: Prevent Markdown shortcuts from applying to code-formatted text by @takuyakanbr in https://github.com/facebook/lexical/pull/7395 * [lexical-yjs] Bug Fix: Fix scroll position getting changed when someone else makes a change in collab by @amanharwara in https://github.com/facebook/lexical/pull/7398 * [RFC][lexical-markdown] Replace whitespace with code point when the string has leading and trailing whitespaces by @lilshady in https://github.com/facebook/lexical/pull/7400 * [Bug Fix] Clone a node and use `$setSelection` instead of assigning dirty to true directly. by @lilshady in https://github.com/facebook/lexical/pull/7401 * [lexical-devtools-core] Bug Fix: Update debug view to show KEY_ESCAPE_COMMAND immediately by @kirandash in https://github.com/facebook/lexical/pull/7403 * [lexical-react] Feature: Add option to disable first item auto-selection in menus by @kirandash in https://github.com/facebook/lexical/pull/7404 * [lexical] Chore: Change $getTextNodeOffset invariant to warn in prod (error in __DEV__) by @etrepum in https://github.com/facebook/lexical/pull/7397 * [lexical-playground] Bug Fix: Floating toolbar position for end-aligned text by @kirandash in https://github.com/facebook/lexical/pull/7405 * [lexical] Bug Fix: Fix forward line deletion when using control+K by @takuyakanbr in https://github.com/facebook/lexical/pull/7412 * [lexical-rich-text] Bug Fix: Prevent indentation from becoming negative by @takuyakanbr in https://github.com/facebook/lexical/pull/7411 * [lexical-table] Feature: Improve logic for pasting table into table by @takuyakanbr in https://github.com/facebook/lexical/pull/7408 * [lexical-table] Refactor: Rename and deprecate some table utils by @takuyakanbr in https://github.com/facebook/lexical/pull/7415 * [lexical-playground] Bug: clear formatting should also clear any indent/outdent if applied by @harshmetkel24 in https://github.com/facebook/lexical/pull/7417 * [lexical-list] Feature: Enforce strict list indentation by @dineug in https://github.com/facebook/lexical/pull/7420 * [lexical-playground] Bug Fix: Immediate broken image display on load failure by @kirandash in https://github.com/facebook/lexical/pull/7431 * Chore: Improve spelling consistency across codebase by @kirandash in https://github.com/facebook/lexical/pull/7437 * [lexical] Feature: Add text-transform styles to exported HTML by @kirandash in https://github.com/facebook/lexical/pull/7438 * [lexical-list] Feature: export registerCheckList by @atsjo in https://github.com/facebook/lexical/pull/7429 ## New Contributors * @harshmetkel24 made their first contribution in https://github.com/facebook/lexical/pull/7384 * @takuyakanbr made their first contribution in https://github.com/facebook/lexical/pull/7395 * @atsjo made their first contribution in https://github.com/facebook/lexical/pull/7429 **Full Changelog**: https://github.com/facebook/lexical/compare/v0.29.0...v0.30.0