npm @lexical/react 0.35.0
v0.35.0

latest release: 0.35.1-nightly.20250905.0
20 hours ago

v0.35.0 is a monthly release with much improved RTL bidirectional text support (#7727) and several bug fixes

Breaking Changes

All of the breaking changes in this release are related to the improved RTL bidirectional text support in #7727

ltr and rtl theme CSS classes removed

ltr and rtl theme CSS classes are no longer added to DOM elements. If you have custom CSS to set text-align (or any other properties) for bidirectional text, this can be removed. You can target elements that have customized their dir by targeting the attr in CSS, for example:

[dir=rtl] { text-align: right; }

$isParentElementRTL requires an active editor

$isParentElementRTL now relies on accessing the DOM to determine element direction, meaning there must be an active editor when calling the function. If you have code that calls $isParentElementRTL inside editorState.read(), you will need to pass in an editor argument. For example:

const isRTL = editorState.read(
  () => {
    const selection = $getSelection();
    return $isRangeSelection(selection) && $isParentElementRTL(selection);
  },
  {editor}
);

__dir property is synced to/from Yjs (again)

Prior to #7330, the text direction of nodes (as determined by the reconciler) was synced to Yjs, even though this value was ignored on other clients. This property is now used for any manually-set direction attribute on ElementNode.

If you have documents that were created prior to v0.30.0, the previously-reconciled direction will now be read and applied to nodes in the editor. This may lead to unexpected behaviour if, for example, your document contains a paragraph that contained RTL text but content changed to LTR in >= v0.30.0.

Highlights

Core:

  • ๐Ÿ†• #7727 Allow ElementNode direction to be overridden (RTL)
  • โœ… #7772 Correct exit direction from decorator nodes in RTL
  • โœ… #7794 Fix insert into existing paragraph node if selection is on parent element

Markdown:

  • โœ… #7769 Formatted textmatch fix
  • ๐Ÿ†• #7735 Allow any characters in markdown link text

React:

  • โœ… #7757 Add $config $transform inheritance to LexicalNestedComposer
  • โœ… #7778 Fix the context menu event listener element

Internal:

  • ๐Ÿงน #7770 Update flow suppressions to use error code
  • ๐Ÿงน #7785 flow-bin updated to 0.280.0
  • ๐Ÿงน #7796 Replace jest with vitest for unit tests

What's Changed

  • v0.34.0 monthly release by @etrepum in #7746
  • Update examples for v0.34.0 by @etrepum in #7747
  • [lexical-playground][examples] Refactor: remove redundant fragment by @noritaka1166 in #7755
  • [lexical-react] Bug Fix: Add $config $transform inheritance to LexicalNestedComposer by @etrepum in #7757
  • [lexical-playground] Refactor: remove unnecessary await in e2e test by @noritaka1166 in #7759
  • [lexical-code-shiki] Refactor: remove unnecessary assertion by @noritaka1166 in #7762
  • [lexical-playground][lexical-react][lexical-table] Refactor: remove unnecessary assertion by @noritaka1166 in #7761
  • [lexical][lexical-code] Refactor: remove unnecessary assertion by @noritaka1166 in #7760
  • [lexical] Feature: allow ElementNode direction to be overridden by @james-atticus in #7727
  • [lexical-markdown] Formatted textmatch fix by @MarekKuncik in #7769
  • [Chore] Update flow suppressions to use error code by @SamChou19815 in #7770
  • [lexical-react] Fix the context menu event listener element by @ivailop7 in #7778
  • [lexical] Bug Fix: Correct exit direction from decorator nodes in RTL by @noamzaks in #7772
  • [lexical] Chore: Update flow-bin to 0.280.0 by @takuyakanbr in #7785
  • [lexical] Fix: insert into existing paragraph node if selection is on parent element by @james-atticus in #7794
  • [lexical-markdown] Bug Fix: Allow any characters in markdown link text by @lytion in #7735
  • [lexical-history] Add Missing Argument for DispatchCommand in Undo/Redo Docs Example by @lithika-damnod in #7795
  • [*] Chore: Replace jest with vitest for unit tests by @etrepum in #7796

New Contributors

Full Changelog: v0.34.0...v0.35.0

Don't miss a new react release

NewReleases is sending notifications on new releases.