github facebook/lexical v0.26.0

19 hours ago

v0.26.0 is a monthly release packed with bug fixes and a major new experimental feature, the NodeState API (#7117).

Breaking Changes

Core:

  • #7248 As a follow-up to #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:

  • #7219 Exports from @lexical/react that had been deprecated since v0.16.0 (June 2024) have been removed:
    • All default exports were removed, each module has a named export
    • The inconsistently named @lexical/react/LexicalTableOfContents was moved to @lexical/react/LexicalTableOfContentsPlugin

Highlights

Core:

Collab:

  • #7217 Normalize multiple adjacent merge conflicts in one block

List:

  • #7225 Retain selection styling when exiting nested list
  • 🆕 #7024 Bullet item style matches text style

Mark:

  • #7255 Identify <mark> as an inline element

Playground:

  • #7233 Image component rerenders on every editor update
  • #7229 Table action menu dropdown positioning
  • 🆕 #7208 Playground dev/prod vite configs have been unified and example vite configurations have been refactored to allow for 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:

  • #7213 Prevent adjacent cell selection on triple-click

React:

  • #7237 Ensure attributes are set immediately on menu
  • #7264 Menu element not cleaned up on unmount
  • ✂️ #7219 Remove deprecated default exports

What's Changed

  • 2024 recap shortcut by @zurfyx in #7223
  • v0.25.0 by @etrepum in #7221
  • [Breaking Change][lexical/react] Chore: Remove deprecated default exports by @kirandash in #7219
  • [lexical-yjs] Bug Fix: Normalize multiple adjacent merge conflicts in one block by @james-atticus in #7217
  • [lexical-table] Docs: Fix @lexical/table README.md by @etrepum in #7224
  • [@lexical/list] Feature: export ListNodeTagType by @DaniGuardiola in #7228
  • [lexical-list] Bug Fix: retain selection styling when exiting nested list by @mrdivyansh in #7225
  • [lexical-playground] fix: hard coded theme classes for table hover actions by @umaranis in #7182
  • [*] Feature: Add linter to check that flow types are consistent with typescript types by @etrepum in #7230
  • [lexical-playground] Refactor: Image component rerenders on every editor update by @jvithlani in #7233
  • [lexical][lexical-code] Refactor: Use NodeCaret to implement RangeSelection.getNodes() by @etrepum in #7135
  • [lexical-list] Bullet item color matches text color by @ivailop7 in #7024
  • [lexical-table] Bug Fix: Prevent adjacent cell selection on triple-click by @kirandash in #7213
  • [lexical-react] fix: ensure attributes are set immediately on menu by @sodenn in #7237
  • [Update] Upgrade docusaurus version by @lilshady in #7244
  • [Breaking Changes][lexical][lexical-list][lexical-playground] Bug Fix: deleteCharacter through ListNode->ListItemNode by @etrepum in #7248
  • [lexical] fix typo in Caret error msg by @potatowagon in #7249
  • [fix] Add missing flow types for node event plugin by @fantactuka in #7252
  • [lexical-playground] Bug Fix Table Action Menu dropdown positioning by @umaranis in #7229
  • [lexical][lexical-utils] Chore: Add some missing flow types for NodeCaret and table related functionality by @etrepum in #7253
  • [lexical-playground][examples/*] Refactor: Unify vite dev/prod/example configurations by @etrepum in #7208
  • [lexical][lexical-mark] Bug Fix: Identify as inline element by @PeterDekkers in #7255
  • [lexical] Feature: add a generic state property to all nodes by @GermanJablo in #7117
  • [lexical] Bug Fix: Point.isBefore could return incorrect result due to normalization by @etrepum in #7256
  • [@lexical/react] Bug Fix: anchor element not cleanup when component unmount by @yuanyan in #7264
  • Fix selection shifting when deleting paragraphs on android by @waynetee in #7239
  • [lexical] Chore: Added missing isInline function to TextNode by @mrdivyansh in #7226

New Contributors

Full Changelog: v0.25.0...v0.26.0

Don't miss a new lexical release

NewReleases is sending notifications on new releases.