v0.25.0
facebook/lexicalv0.25.0Feb 21, 2025by etrepum
AI Summary
A release targeting an Android Chrome input regression, introducing the NodeCaret API and several new table features.
Key Highlights
- New NodeCaret API for traversing the document tree.
- TableCell support for vertical alignment.
- TableNode support for freezing first column and row.
- Removed Android Chrome workaround.
Breaking Changes
- Refactored `ElementNode.collapseAtStart` and `RangeSelection.deleteCharacter` heuristics.
- Nested tables are no longer possible via normal UI actions.
New Features
- Vertical alignment support for table cells.
- Frozen column and row support.
- Style attribute support for TableNode.
Full Release Notes
v0.25.0 is an ad-hoc release targeted at addressing an input regression with Android Chrome (#7218) , but includes many other fixes (particularly around deleteCharacter) and several new features (such as the NodeCaret API). ## Breaking Changes Core: * #7180 `ElementNode.collapseAtStart(range)` would previously only be called on the direct parent of the anchor's node, so the presence of anything like a `LinkNode` would prevent a `ListItemNode` from collapsing. Now it will also be called on parents under certain conditions. * #7155 #7204 The heuristic used in RangeSelection.deleteCharacter to handle merging blocks and deleting decorators from a collapsed selection has been refactored for consistency. It now traverses the node tree directly instead of attempting to use browser selection APIs. Tables: * #7192 It's no longer possible to create nested tables with normal UI actions. It's likely that this will change in the future when nested tables work correctly with the rest of the table infrastructure. ## Highlights Core: * 🆕 #7046 New [NodeCaret API](https://lexical.dev/docs/concepts/traversals) for traversal of the document tree * ✅ #7180 Collapse through inline elements in deleteCharacter * ✅ #7186 Highlight formatting now supported by TextNode importDOM (plus toolbar support in the playground) * ✅ #7175 Workaround for delete character with emoji grapheme customers that do not include non-BMP code points * ✅ #7155 Improve character deletion around shadow roots and decorators * ✅ #7218 Remove Android Chrome workaround Tables: * 🆕 #7077 TableCell support for verticalAlign * 🆕 #7134 #7190 TableNode support for freezing the first column and row * ✅ #7161 Ensure rectangular table cell merge behavior * ✅ #7192 Nested tables are disabled * 🆕 #7205 TableNode support for style attribute Code: * ✅ #7187 Fix selection boundaries in code block React: * ✅ #7185 Typeahead menu now respects read-only mode Playground: * ✅ #7194 Optimize table cell resizer event listeners * ✅ #7215 Remove redundant Suspense from node decorators ## What's Changed * v0.24.0 by @etrepum in https://github.com/facebook/lexical/pull/7147 * [lexical][lexical-utils][lexical-selection][lexical-table] Feature: NodeCaret abstraction for traversals and ranges by @etrepum in https://github.com/facebook/lexical/pull/7046 * [lexical-table] Feature: TableCellNode add verticalAlign attribute by @liuweiGL in https://github.com/facebook/lexical/pull/7077 * [lexical] Bug fix: Fixes infinite loop in sibling traversal by @iSuslov in https://github.com/facebook/lexical/pull/7157 * [lexical-website] Documentation Update: CaretType has sibling and child. by @hastebrot in https://github.com/facebook/lexical/pull/7159 * fix: Replace Twitter with X by @AaronDewes in https://github.com/facebook/lexical/pull/7118 * [lexical] Chore: Add more tests for RangeSelection.getNodes() by @etrepum in https://github.com/facebook/lexical/pull/7152 * [scripts] add @noEnforceES3 to build script by @potatowagon in https://github.com/facebook/lexical/pull/7162 * Update WWW build flag by @zurfyx in https://github.com/facebook/lexical/pull/7169 * [lexical-table] Support first column freeze by @ivailop7 in https://github.com/facebook/lexical/pull/7134 * [fix] $dfs traversal from the middle of the tree leaves by @fantactuka in https://github.com/facebook/lexical/pull/7174 * [lexical-table] Bug Fix: Ensure rectangular table cell merge behavior (#7161) by @kirandash in https://github.com/facebook/lexical/pull/7170 * [lexical-react] positionMenu on rendering typeahead mentions menu by @potatowagon in https://github.com/facebook/lexical/pull/7164 * No forward slash in template by @zurfyx in https://github.com/facebook/lexical/pull/7178 * [fix] DFS depths when starting from inline node by @fantactuka in https://github.com/facebook/lexical/pull/7179 * [Breaking Change][lexical][lexical-link] Bug Fix: Collapse through inline elements in deleteCharacter by @etrepum in https://github.com/facebook/lexical/pull/7180 * [lexical] Bug Fix: add missing flow type for getNearestEditorFromDOMNode by @kirandash in https://github.com/facebook/lexical/pull/7183 * [lexical][lexical-devtools-core][lexical-playground] Bug Fix: fix TextNode importDom highlight formatting by @kirandash in https://github.com/facebook/lexical/pull/7186 * [lexical-react] Bug Fix: Make typeahead menu respect read-only mode by @kirandash in https://github.com/facebook/lexical/pull/7185 * [lexical-code][lexical-playground] Bug Fix: Fix selection boundaries in code block by @kirandash in https://github.com/facebook/lexical/pull/7187 * Position menu immediately by @zurfyx in https://github.com/facebook/lexical/pull/7181 * Documentation Update: move `placeholder` examples to `ContentEditable` by @RobHannay in https://github.com/facebook/lexical/pull/7193 * [lexical-table] Freeze top row using pure CSS by @ivailop7 in https://github.com/facebook/lexical/pull/7190 * [Breaking Change][lexical-table] Bug Fix: Prevent nested tables by @kirandash in https://github.com/facebook/lexical/pull/7192 * Replace substr with substring by @ivailop7 in https://github.com/facebook/lexical/pull/7188 * [lexical] Bug Fix: catch setTimeout wrapped setBaseAndExtent call by @StormVanDerPol in https://github.com/facebook/lexical/pull/7202 * [lexical] Bug Fix: Workaround for delete character with emoji grapheme customers that do not include non-BMP code points by @etrepum in https://github.com/facebook/lexical/pull/7175 * [Breaking Change][lexical][lexical-playground] Bug Fix: Improve character deletion around shadow roots and decorators by @etrepum in https://github.com/facebook/lexical/pull/7155 * [ci] Chore: Upgrade astro to fix mysterious integration test failure by @etrepum in https://github.com/facebook/lexical/pull/7196 * [lexical-table] Feature: Support TableNode.__style in createDOM and updateDOM by @etrepum in https://github.com/facebook/lexical/pull/7205 * [Breaking Change][lexical-playground]: Refactor: Remove special case for collapsible forward deletion by @etrepum in https://github.com/facebook/lexical/pull/7204 * [lexical-playground] Chore: Remove insertNodes workaround in ToolbarPlugin by @etrepum in https://github.com/facebook/lexical/pull/7206 * [lexical-playground] Bug Fix: Optimize table cell resizer event listeners by @kirandash in https://github.com/facebook/lexical/pull/7194 * [lexical-playground] Refactor: Remove redundant Suspense from node decorators by @kirandash in https://github.com/facebook/lexical/pull/7215 * Remove Android Chrome workaround from #7122 by @etrepum in https://github.com/facebook/lexical/pull/7218 ## New Contributors * @iSuslov made their first contribution in https://github.com/facebook/lexical/pull/7157 * @hastebrot made their first contribution in https://github.com/facebook/lexical/pull/7159 * @AaronDewes made their first contribution in https://github.com/facebook/lexical/pull/7118 * @RobHannay made their first contribution in https://github.com/facebook/lexical/pull/7193 * @StormVanDerPol made their first contribution in https://github.com/facebook/lexical/pull/7202 **Full Changelog**: https://github.com/facebook/lexical/compare/v0.24.0...v0.25.0