v0.23.0

facebook/lexicalv0.23.0Jan 5, 2025by etrepum

AI Summary

A release introducing textFormat/textStyle properties to ElementNode and exposing new collab utilities.

Key Highlights

  • Added `updateFromJSON` method and moved textFormat/textStyle to ElementNode.
  • Exposed `forEachSelectedTextNode` utility.
  • Exposed function to get anchor and focus nodes in Yjs collab.

Breaking Changes

  • Added optional textFormat and textStyle properties to SerializedElementNode, which may clash with existing custom properties.

New Features

  • updateFromJSON functionality.
  • Collab anchor/focus node exposure.
  • Table hover actions button positioning fix.

Full Release Notes

# Breaking Changes

- 🆕 Feature: Add updateFromJSON and move more textFormat/textStyle to ElementNode
   This change adds optional textFormat and textStyle properties to SerializedElementNode. If you have existing classes with those properties it could create a namespace clash that you will have to resolve one way or another.

  TextNode and ElementNode subclasses should be updated to call the updateFromJSON(serializedNode) method from their static importJSON methods. If they don't, they won't support this new functionality, and will have to continue copy and pasting the super implementation of importJSON for correct behavior if the base class ever changes in the future.

  You should consider dropping usage of the version field.

# Highlights

Highlights since [v0.22.0](https://github.com/facebook/lexical/releases/tag/v0.22.0)

Core Editor:

* 🆕 Feature: Add updateFromJSON and move more textFormat/textStyle to ElementNode https://github.com/facebook/lexical/pull/6970
* ✅ Fix: getNodes over-selection https://github.com/facebook/lexical/pull/7006
* ✅ Fix: registerNodeTransform regression https://github.com/facebook/lexical/pull/7016

Playground:
* ✅ Fix: table hover actions button position https://github.com/facebook/lexical/pull/7011

Yjs:

* 🆕 Feature: Expose function to get anchor and focus nodes for given user awareness state https://github.com/facebook/lexical/pull/6942

## What's Changed
* v0.22.0 by @potatowagon in https://github.com/facebook/lexical/pull/6993
* [lexical] Bug Fix: Flow is missing some variables and functions by @lytion in https://github.com/facebook/lexical/pull/6977
* [__tests__] npm upgrade next by @potatowagon in https://github.com/facebook/lexical/pull/6996
* Documentation: Fix typo "nest nest"->"nest" in README.md by @christianhg in https://github.com/facebook/lexical/pull/7000
* [__test__] npm upgrade astro by @potatowagon in https://github.com/facebook/lexical/pull/7001
* [lexical] Bug Fix: Fix getNodes over-selection by @etrepum in https://github.com/facebook/lexical/pull/7006
* [Breaking Change][lexical] Feature: Add updateFromJSON and move more textFormat/textStyle to ElementNode by @etrepum in https://github.com/facebook/lexical/pull/6970
* [lexical-playground] Refactor: switch headings test file names by @christianhg in https://github.com/facebook/lexical/pull/7008
* [lexical] Bug Fix: Fix registerNodeTransform regression introduced in #6894 by @etrepum in https://github.com/facebook/lexical/pull/7016
* [lexical-playground] Fix table hover actions button position by @ivailop7 in https://github.com/facebook/lexical/pull/7011
* [lexical-yjs] Feature: Expose function to get anchor and focus nodes for given user awareness state by @amanharwara in https://github.com/facebook/lexical/pull/6942

## New Contributors
* @christianhg made their first contribution in https://github.com/facebook/lexical/pull/7000

**Full Changelog**: https://github.com/facebook/lexical/compare/v0.22.0...v0.23.0