NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm, #4968 most downloaded on npm
This package contains misc utilities for Lexical.
Latest stable
0.53.0
Last release 12 days ago
10 Nov 2026
Ships on a steady schedule
a new release about every 8 days
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
724 releases · first in 2022
Drag across the ruler to compare, or tap a release to open it.
Nothing published for this version
[Breaking Change][lexical] Bug Fix: Only select RootNode on removal of last child if there was an existing selection by @etrepum in https://github.com…
https://github.com/facebook/lexical/pull/7351 : Only select RootNode on removal of last child if there was an existing selection https://github.com/facebook/lexical/pull/7353: Support escaping markdown characters https://github.com/facebook/lexical/pull/7357: Refactor: LexicalNestedComposer add skipEditableListener prop and deprecate initialNodes prop and implicit namespace setting https://github.com/facebook/lexical/pull/7372: Set tableFrozenColumn and tableFrozenRow classes only on the scrollable table wrapper
React: 🆕 https://github.com/facebook/lexical/pull/7357: LexicalNestedComposer add skipEditableListener prop and deprecate initialNodes prop and implicit namespace setting
Table: ✅https://github.com/facebook/lexical/pull/7372: Set tableFrozenColumn and tableFrozenRow classes only on the scrollable table wrapper ✅https://github.com/facebook/lexical/pull/7316: Add fallback selection to InsertTableCommand
Core editor: ✅https://github.com/facebook/lexical/pull/7351: Only select RootNode on removal of last child if there was an existing selection ✅https://github.com/facebook/lexical/pull/7354: Ignore input event from inside decorators
Markdown: 🆕 https://github.com/facebook/lexical/pull/7353: Feature: Support escaping markdown characters
Playground: 🆕 https://github.com/facebook/lexical/pull/7352 : Chore: Improve accessibility of DraggableBlockPlugin add block button ✅https://github.com/facebook/lexical/pull/7334: Table action menu visibility with cell overflow ✅https://github.com/facebook/lexical/pull/7362: Fix equation rendering in Safari 🆕 https://github.com/facebook/lexical/pull/7371: Chore: Update excalidraw to v0.18.0 Doc: ✅https://github.com/facebook/lexical/pull/7365: Update react.md, fix typo
Full Changelog: https://github.com/facebook/lexical/compare/v0.28.0...v0.29.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
@lexical/react: LexicalNestedComposer no longer sets the nested editor's namespace (#7357)
The nested editor's namespace is no longer inherited implicitly, and the new skipEditableListener prop controls whether editable state follows the parent. (The initialNodes prop is deprecated at the same time; see Deprecations.)
Detect: nested editors created with createEditor() without a namespace.
Migration:
// Before
<LexicalNestedComposer initialEditor={caption} initialNodes={[ImageNode]}>
// After: configure the nested editor when it is created
this.__caption = caption || createEditor({namespace: 'MyCaption', nodes: [ImageNode]});
<LexicalNestedComposer initialEditor={caption}>
lexical: RootNode selected on removal of last child only if there was a selection (#7351)
Removing the last child of the root only creates a selection on
the RootNode if a selection already existed.
Detect: code that clears the editor and expects a selection afterwards.
Migration: set the selection explicitly if needed.
Verify: clearing the editor while it is not focused.
@lexical/markdown: Markdown escaping on import and export (#7353)
Import strips the backslash from escaped characters (\*
becomes *); export escapes markdown characters in plain text (** becomes
\*\*).
Detect: $convertFromMarkdownString / $convertToMarkdownString users
with stored markdown or snapshot tests.
Migration: update fixtures; re-check custom transformers.
Verify: markdown round trips.
@lexical/table: Frozen row/column classes move to the table wrapper (#7372)
The tableFrozenColumn and tableFrozenRow theme classes are
set on the scrollable wrapper, not on the <table>.
Detect: CSS such as table.<frozen class> or .<frozen class> > tr.
Migration: retarget those selectors to the wrapper element that
contains the <table>.
Verify: frozen header rows/columns visually.
@lexical/react: LexicalNestedComposer initialNodes prop deprecated (#7357)
Replacement: pass nodes (and namespace) to the nested createEditor() call.
Removal: not scheduled.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
[Breaking Change][lexical][lexical-table] Bug Fix: Scrollable TableNode updateDOM fixes and getDOMSlot type refactoring by @etrepum in https://github.…
Ad-hoc minor release with important bug fixes and some enabling features. The most important fix is in #7341 - where under certain conditions nodes may not be updated in the DOM at all (this bug is rarely triggered and has been around for 3+ years).
If you have any $onDelete handlers copied from the playground for KEY_DELETE_COMMAND and KEY_BACKSPACE_COMMAND, you can delete them all now. If you leave them in, it will have similar bugs as prior to this PR.
The default KEY_DELETE_COMMAND and KEY_BACKSPACE_COMMAND handlers now event.preventDefault() and call DELETE_CHARACTER_COMMAND for NodeSelection (in addition to the existing RangeSelection behavior).
The DELETE_CHARACTER_COMMAND handler now handles NodeSelection by calling the new NodeSelection.deleteNodes() method which places a new RangeSelection where the first selected node was (if any, and if it was the current selection) and then removes all of the selected nodes.
This PR moves the incorrectly overridden append methods for RootNode and ListNode and moves it to the ElementNode's primitive splice method. For RootNode this means that the exception you'd get for appending a leaf node to the root will be thrown in all situations when that node is inserted, rather than just append. For ListNode this means that the automatic ListItemNode wrapping applies in all situations when children are inserted into the node, not just append.
Previously $insertNodeToNearestRoot could create empty ElementNode when splitting the current node, now it respects canBeEmpty() and will not split in those cases (e.g. ListNode).
The approach used in #7024 (since v0.26.0) to have a ListItemNode bullet inherit the style of the first text node was too broad, the inline style on the ListItemNode cascades to all of its children. The only way around this is to change the approach.
To retain this feature, you need to add CSS to your theme to specifically style the marker pseudo-element based on these new custom properties. Here's an example from the playground css:
.PlaygroundEditorTheme__listItem::marker {
color: var(--listitem-marker-color);
background-color: var(--listitem-marker-background-color);
font-family: var(--listitem-marker-font-family);
font-size: var(--listitem-marker-font-size);
}
The importDOM implementation for TableCellNode has been corrected to behave as other Lexical roots do with regard to converting <br> tags to LineBreakNode and wrapping runs of top-level inline nodes (including inline decorators) with ParagraphNode. If you have any specific workarounds accounting for the previous behavior, you can remove them. The one difference from other import paths is that a solitary <br> (e.g. <td><br></td>) is converted to an empty ParagraphNode rather than a ParagraphNode containing a LineBreakNode.
If you're using the undocumented internal getDOMSlot API, you may need to change your types. There is now a type parameter for ElementDOMSlot so that the element property can be specialized.
Core:
mutatedNodes to UpdateListener payloadNodeSelection - this allowed a lot of boilerplate code to be deleted, and all of the existing implementations were subtly brokencanBeEmpty() in $splitNodesRootNode transforms lastList:
ListItemNode text style inheritance to CSS custom propertiesTables:
React:
onElementChanged callback to DraggableBlockPluginPlayground:
Utils:
objectKlassEqualsA mutatedNodes property is now present in the UpdateListener payload. This was done to accommodate the use case when you want to have a MutationListener that listens to all nodes (this is useful in combination with NodeState). Note that this property is only calculated when at least one MutationListener is registered (e.g. editor.registerMutationListener(RootNode, () => {}) is sufficient to compute mutatedNodes for all nodes).
NodeSelection.deleteNodes() was added to support the default delete handler
There is now an ordering guarantee that RootNode node transforms are called last, and documentation about the special case that RootNode is always considered intentionally dirty when any other node is dirty
An onElementChanged prop was added to make it possible to implement the "+" button in the playground
Full Changelog: https://github.com/facebook/lexical/compare/v0.27.2...v0.28.0
lexical: Default delete handler for NodeSelection (#7323)
The default KEY_DELETE_COMMAND / KEY_BACKSPACE_COMMAND
handlers call DELETE_CHARACTER_COMMAND for a NodeSelection, which calls
the new NodeSelection.deleteNodes().
Detect: $onDelete-style handlers for KEY_DELETE_COMMAND /
KEY_BACKSPACE_COMMAND copied from the playground into decorator
components.
Migration: delete those handlers; leaving them in keeps their old bugs.
lexical, @lexical/list: RootNode and ListNode child rules enforced in splice (#7341)
The RootNode check that throws for leaf children, and the
ListNode automatic ListItemNode wrapping, apply to every insertion
(splice), not just append.
Detect: code that inserts text or inline nodes directly into the root,
or non-ListItemNode children into a ListNode, via insertBefore,
insertAfter, replace, or splice.
Migration: insert valid children (wrap in a ParagraphNode /
ListItemNode).
Verify: paths that build the tree programmatically.
@lexical/list: ListItemNode marker styling uses CSS custom properties (#7325)
The text style of a list item is no longer set inline on the
<li>; it is exposed as --listitem-marker-<property> custom properties.
Detect: list markers that should match the item's text color, font, or size.
Migration: add CSS for your list item theme class:
.my-theme__listItem::marker {
color: var(--listitem-marker-color);
background-color: var(--listitem-marker-background-color);
font-family: var(--listitem-marker-font-family);
font-size: var(--listitem-marker-font-size);
}
lexical: ElementDOMSlot has a type parameter (#7336)
The internal getDOMSlot API's ElementDOMSlot gained a type
parameter for its element property.
Detect: overrides of getDOMSlot or uses of ElementDOMSlot in types.
Migration: add or adjust the type argument.
lexical, @lexical/utils: $insertNodeToNearestRoot / $splitNodes respect canBeEmpty() (#7342)
Splitting no longer creates an empty ElementNode whose
canBeEmpty() returns false (for example ListNode).
Detect: calls to $insertNodeToNearestRoot or $splitNodes that expect
an empty split-off node.
Migration: None, unless code depended on the empty node.
Verify: inserting block decorators inside lists.
@lexical/table: TableCellNode.importDOM handles <br> and inline runs like other roots (#7318)
<br> in pasted cells becomes LineBreakNode, top-level inline
runs are wrapped in ParagraphNode, and a lone <td><br></td> becomes an
empty paragraph.
Detect: workarounds for table cell HTML import.
Migration: remove those workarounds.
Verify: pasting HTML tables.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
v0.27.2 is an ad-hoc patch release to address the prismjs CVE (#7313). The way Lexical uses prismjs should not trigger that issue even in previous ver
v0.27.2 is an ad-hoc patch release to address the prismjs CVE (#7313). The way Lexical uses prismjs should not trigger that issue even in previous versions as it doesn't insert user generated HTML with "id" tags or use the autoloader plug-in, but it's good practice to keep up with security updates either way.
Code:
Collab:
Table:
Playground:
Full Changelog: https://github.com/facebook/lexical/compare/v0.27.1...v0.27.2
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
v0.27.1 is an ad-hoc patch release to address the regression introduced in v0.26.0 with LexicalNode.getCommonAncestor which occurs when calling node.g
v0.27.1 is an ad-hoc patch release to address the regression introduced in v0.26.0 with LexicalNode.getCommonAncestor which occurs when calling node.getCommonAncestor(node) when !$isElementNode(node) (#7287).
Core:
Core + List:
Table:
Full Changelog: https://github.com/facebook/lexical/compare/v0.27.0...v0.27.1
Nothing published for this version
[Breaking Changes][lexical] Bug Fix: Address deleteLine regression in #7248 by @etrepum in https://github.com/facebook/lexical/pull/7270
v0.27.0 ad-hoc release to address v0.26.0 regressions.
Core:
Core:
Playground:
Utils:
Collab/Table:
Full Changelog: https://github.com/facebook/lexical/compare/v0.26.0...v0.27.0
lexical, @lexical/table: Lexical handles more arrow-key navigation across element boundaries (#7270)
Arrow key movement of a RangeSelection across element
boundaries is handled by Lexical in more cases instead of by the browser.
Detect: custom table-like ElementNode implementations, or
KEY_ARROW_*_COMMAND handlers that work around browser caret movement.
Migration: None. Workarounds may now be removable.
Verify: arrow keys into and out of tables and custom container nodes.
Nothing published for this version
[Breaking Change][lexical/react] Chore: Remove deprecated default exports by @kirandash in https://github.com/facebook/lexical/pull/7219
v0.26.0 is a monthly release packed with bug fixes and a major new experimental feature, the NodeState API (#7117).
Core:
#7248 As a follow-up to https://github.com/facebook/lexical/pull/7180 the collapseAtStart logic now continues through both inline and non-inline nodes so long as there are no previous siblings, roots, or shadow roots encountered. This is because nodes such as CollapsibleTitleNode had a collapseAtStart that returns true but contain nodes that are not inline and have a collapseAtStart that returns false (e.g. ParagraphNode).
In order to fix an inconsistency for how nested !isInline elements behave, CollapsibleContainerNode is now a shadowRoot. The CollapsibleContentNode was already a shadowRoot. This is now similar to the situation for tables where both TableNode and TableCellNode are both shadowRoot. The fix here also moved collapseAtStart from CollapsibleTitleNode to CollapsibleContainerNode which makes a bit more sense since the whole container gets collapsed, not just the title. The title is still the only location that you can initiate this collapse from, since it is always the first child.
React:
@lexical/react that had been deprecated since v0.16.0 (June 2024) have been removed:
@lexical/react/LexicalTableOfContents was moved to @lexical/react/LexicalTableOfContentsPluginCore:
Collab:
List:
Mark:
<mark> as an inline elementPlayground:
npm run monorepo:dev command which runs the examples with the version of lexical in the repository (useful for developing examples based on unreleased features, or debugging situations that are difficult to create in the playground)Table:
React:
ListNodeTagType by @DaniGuardiola in https://github.com/facebook/lexical/pull/7228isInline function to TextNode by @mrdivyansh in https://github.com/facebook/lexical/pull/7226Full Changelog: https://github.com/facebook/lexical/compare/v0.25.0...v0.26.0
@lexical/react: @lexical/react default exports removed (#7219)
Default exports deprecated since v0.16.0 are removed; use the named exports.
Detect: default imports from @lexical/react/LexicalClickableLinkPlugin,
@lexical/react/LexicalErrorBoundary, @lexical/react/useLexicalEditable,
@lexical/react/useLexicalSubscription.
Migration:
// Before
import ClickableLinkPlugin from '@lexical/react/LexicalClickableLinkPlugin';
import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary';
import useLexicalEditable from '@lexical/react/useLexicalEditable';
import useLexicalSubscription from '@lexical/react/useLexicalSubscription';
// After
import {ClickableLinkPlugin} from '@lexical/react/LexicalClickableLinkPlugin';
import {LexicalErrorBoundary} from '@lexical/react/LexicalErrorBoundary';
import {useLexicalEditable} from '@lexical/react/useLexicalEditable';
import {useLexicalSubscription} from '@lexical/react/useLexicalSubscription';
@lexical/react: LexicalTableOfContents renamed to LexicalTableOfContentsPlugin (#7219)
The module @lexical/react/LexicalTableOfContents is removed.
Detect: imports from '@lexical/react/LexicalTableOfContents'.
Migration:
// Before
import TableOfContentsPlugin from '@lexical/react/LexicalTableOfContents';
// After
import {TableOfContentsPlugin} from '@lexical/react/LexicalTableOfContentsPlugin';
lexical, @lexical/list: collapseAtStart continues through non-inline ancestors (#7248)
collapseAtStart propagation continues through inline and
non-inline ancestors while there are no previous siblings, roots, or shadow
roots. In the playground, CollapsibleContainerNode became a shadow root and
owns collapseAtStart.
Detect: custom ElementNode subclasses overriding collapseAtStart or
isShadowRoot; code copied from the playground's collapsible nodes.
Migration: None for most apps. If you copied the playground collapsible
nodes, make CollapsibleContainerNode a shadow root and move
collapseAtStart from the title node to the container node.
Verify: Backspace at the start of nested lists and collapsible sections.
@lexical/code: getFirstCodeNodeOfLine, getLastCodeNodeOfLine, getStartOfCodeInLine, getEndOfCodeInLine deprecated (#7135)
Replacement: the $-prefixed functions of the same names ($getFirstCodeNodeOfLine, ...).
Removal: not scheduled.
lexical: LexicalNode.getCommonAncestor deprecated (#7135)
Replacement: $getCommonAncestor.
Removal: v0.52.0 (#9238).
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
[Breaking Change][lexical][lexical-link] Bug Fix: Collapse through inline elements in deleteCharacter by @etrepum in https://github.com/facebook/lexic…
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).
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:
Core:
Tables:
Code:
React:
Playground:
placeholder examples to ContentEditable by @RobHannay in https://github.com/facebook/lexical/pull/7193Full Changelog: https://github.com/facebook/lexical/compare/v0.24.0...v0.25.0
lexical, @lexical/link: collapseAtStart is also called on ancestors (#7180)
ElementNode.collapseAtStart(range) may be called on parents of
the anchor's direct parent, so an inline element such as LinkNode no
longer prevents a ListItemNode from collapsing.
Detect: custom ElementNode subclasses that override collapseAtStart.
Migration: None, unless the override assumed it was only called for the direct parent.
Verify: Backspace at the start of blocks containing links or other inline elements.
lexical: deleteCharacter traverses the node tree (#7155)
RangeSelection.deleteCharacter merges blocks and deletes
decorators by walking the node tree instead of using browser selection
APIs.
See also #7204.
Detect: custom handling of DELETE_CHARACTER_COMMAND or
KEY_BACKSPACE_COMMAND / KEY_DELETE_COMMAND around decorators or shadow
roots.
Migration: None. Remove workarounds that are no longer needed.
Verify: Backspace/Delete next to decorators, tables, and collapsible sections.
@lexical/table: Nested tables are blocked by default (#7192)
Normal UI actions (insert, paste) no longer create a table inside a table cell.
Detect: features that insert or paste tables into table cells.
Migration: None. From v0.39.0 the hasNestedTables option of
TablePlugin / registerTablePlugin opts back in (behavior is still
incomplete).
Verify: inserting or pasting a table inside a cell.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
[Breaking Change][lexical][lexical-selection][lexical-list] Bug Fix: Fix infinite loop when splitting invalid ListItemNode by @etrepum in https://gith…
Build:
Core editor:
editor.focus() now happens synchronously when called from inside of an update, as if it was implemented with a command dispatch. Previously it would defer which is confusing behavior because the expected side-effect is to change the selection which you really do want to happen synchronously.Lexical List:
insertList and removeList are now deprecated, use $insertList and $removeList insteadINSERT_CHECK_LIST_COMMAND, INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND and REMOVE_LIST_COMMAND now update synchronously when dispatched from inside an update, rather than deferring a nested update (this is the expected behavior for commands)Core editor:
Collab:
syncCursorPositions function to collab hook #7053List:
Mark:
Markdown:
Playground:
React:
JSX type from React to prevent "Cannot find namespace 'JSX'"-error when type-checking with React 19 #7080Table:
Utils:
Build:
syncCursorPositions function to collab hook by @amanharwara in https://github.com/facebook/lexical/pull/7053JSX type from React to prevent "Cannot find namespace 'JSX'"-error when type-checking with React 19 by @Svish in https://github.com/facebook/lexical/pull/7080React$Context with React.Context by @SamChou19815 in https://github.com/facebook/lexical/pull/7137Full Changelog: https://github.com/facebook/lexical/compare/v0.23.1...v0.24.0
lexical: editor.focus() is synchronous inside an update (#7037)
Calling editor.focus() from inside an update changes the
selection synchronously instead of deferring.
Detect: editor.focus( called inside editor.update(...), a command
listener, or a transform.
Migration: None, unless code relied on the deferred selection change.
Verify: selection right after focus() inside updates.
@lexical/list: List commands update synchronously inside an update (#7037)
INSERT_CHECK_LIST_COMMAND, INSERT_ORDERED_LIST_COMMAND,
INSERT_UNORDERED_LIST_COMMAND and REMOVE_LIST_COMMAND apply synchronously
when dispatched from inside an update instead of scheduling a nested update.
Detect: dispatches of those commands inside editor.update(...) or
command listeners, followed by code that reads the tree.
Migration: None, unless code relied on the deferred update.
Verify: list toggling from toolbars and shortcuts.
all packages: CommonJS production builds are minified with terser (#7047)
Production CommonJS builds use terser instead of Closure Compiler.
Detect: code that depends on the exact shape of minified Lexical output.
Verify: a production build of your app.
@lexical/list: insertList and removeList deprecated (#7037)
Replacement: $insertList / $removeList, called from an update or a command listener.
Removal: v0.46.0 (#8704).
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.