v0.30.0
#7378 changed the internal updateEditorSync
implementation to always use the correct active editor when triggering a listener. This only affects how nested editors delegate their events to listeners attached to a parent editor. If you have listeners attached to the parent editor that expect to be called with the context of the nested editor then you'll have to either also attach the listener to the nested editor, or change the behavior to check the editor argument of the command listener to see which editor the command was originally dispatched to.
#7386 changed the behavior of the markdown import's paragraph merging logic to align with GitHub's markdown editor behavior for list and common markdown formatting expectations when shouldPreserveNewlines
is true.
#7400 changed the markdown encoder to replace leading or trailing whitespace of formatted strings with the corresponding HTML entities
Core
- ✅ #7378 Ensure updateEditorSync is always synchronous and use it when triggering listeners
- ✅ #7393 Fix right and up arrow key navigation with decorator nodes
- ✅ #7401 Clone the selection and use $setSelection instead of assigning dirty to true directly
- ✅ #7397 Change
$getTextNodeOffset
invariant to warn in prod (error in__DEV__
) - ✅ #7412 Fix forward line deletion when using control+K
- 🆕 #7438 Add text-transform styles to exported HTML
Rich Text
- ✅ #7411 Prevent indentation from becoming negative
Collab
- ✅ #7330 Don't sync ElementNode
__dir
property - ✅ #7398 Fix scroll position getting changed when someone else makes a change in collab
Markdown
- ✅ #7386 Preserve paragraph separation after block elements
- ✅ #7395 Prevent Markdown shortcuts from applying to code-formatted text
- ✅ #7400 Replace whitespace with code point when the string has leading and trailing whitespaces
List
- ✅ #7380 Empty list item type change
- ✅ #7420 Enforce strict list indentation
- 🆕 #7429 Export
registerCheckList
Link
- ✅ #7366 Add support for image links via NodeSelection
Devtools
- ✅ #7403 Update debug view to show KEY_ESCAPE_COMMAND immediately
React
- 🆕 #7404 Add option to disable first item auto-selection in menus
Table
- 🆕 #7408 Improve logic for pasting table into table
- 🆕 #7415 Rename and deprecate some table utils
Playground
- 🆕 #7384 Clear block ElementNode formatting along with TextNode
- 🆕 #7417 Clear formatting should also clear any indent/outdent if applied
- ✅ #7368 Remove shared imports from playground for easier re-use
- ✅ #7388 Use natural dimensions for inherited image size
- ✅ #7405 Fix floating toolbar position for end-aligned text
- ✅ #7431 Fix immediate broken image display on load failure
- v0.29.0 by @lilshady in https://github.com/facebook/lexical/pull/7375
- [tests] Update next version by @lilshady in https://github.com/facebook/lexical/pull/7374
- [lexical-playground] Chore: Remove shared imports from playground by @etrepum in https://github.com/facebook/lexical/pull/7368
- [lexical-list] Bug Fix: empty list item type change by @fantactuka in https://github.com/facebook/lexical/pull/7380
- [Breaking Change][lexical] Bug Fix: Ensure updateEditorSync is always synchronous and use it when triggering listeners by @etrepum in https://github.com/facebook/lexical/pull/7378
- Update dependencies: vite,@babel/runtime,prismjs,@babel/helpers by @lilshady in https://github.com/facebook/lexical/pull/7381
- update codeowners by @potatowagon in https://github.com/facebook/lexical/pull/7389
- [lexical-playground] Feature: clear blockelement formatting along with textNode by @harshmetkel24 in https://github.com/facebook/lexical/pull/7384
- [lexical-playground] Bug Fix: Use natural dimensions for inherited image size by @kirandash in https://github.com/facebook/lexical/pull/7388
- [Breaking Change][lexical-markdown] Bug Fix: Preserve paragraph separation after block elements by @kirandash in https://github.com/facebook/lexical/pull/7386
- [lexical-link][lexical-playground] Feature: Add support for image links via NodeSelection by @kirandash in https://github.com/facebook/lexical/pull/7366
- [lexical-yjs] Bug Fix: don't sync ElementNode __dir property by @james-atticus in https://github.com/facebook/lexical/pull/7330
- [lexical-rich-text] Bug Fix: Fix right and up arrow key navigation with decorator nodes by @kirandash in https://github.com/facebook/lexical/pull/7393
- [lexical-markdown] Bug Fix: Prevent Markdown shortcuts from applying to code-formatted text by @takuyakanbr in https://github.com/facebook/lexical/pull/7395
- [lexical-yjs] Bug Fix: Fix scroll position getting changed when someone else makes a change in collab by @amanharwara in https://github.com/facebook/lexical/pull/7398
- [RFC][lexical-markdown] Replace whitespace with code point when the string has leading and trailing whitespaces by @lilshady in https://github.com/facebook/lexical/pull/7400
- [Bug Fix] Clone a node and use
$setSelection
instead of assigning dirty to true directly. by @lilshady in https://github.com/facebook/lexical/pull/7401 - [lexical-devtools-core] Bug Fix: Update debug view to show KEY_ESCAPE_COMMAND immediately by @kirandash in https://github.com/facebook/lexical/pull/7403
- [lexical-react] Feature: Add option to disable first item auto-selection in menus by @kirandash in https://github.com/facebook/lexical/pull/7404
- [lexical] Chore: Change $getTextNodeOffset invariant to warn in prod (error in DEV) by @etrepum in https://github.com/facebook/lexical/pull/7397
- [lexical-playground] Bug Fix: Floating toolbar position for end-aligned text by @kirandash in https://github.com/facebook/lexical/pull/7405
- [lexical] Bug Fix: Fix forward line deletion when using control+K by @takuyakanbr in https://github.com/facebook/lexical/pull/7412
- [lexical-rich-text] Bug Fix: Prevent indentation from becoming negative by @takuyakanbr in https://github.com/facebook/lexical/pull/7411
- [lexical-table] Feature: Improve logic for pasting table into table by @takuyakanbr in https://github.com/facebook/lexical/pull/7408
- [lexical-table] Refactor: Rename and deprecate some table utils by @takuyakanbr in https://github.com/facebook/lexical/pull/7415
- [lexical-playground] Bug: clear formatting should also clear any indent/outdent if applied by @harshmetkel24 in https://github.com/facebook/lexical/pull/7417
- [lexical-list] Feature: Enforce strict list indentation by @dineug in https://github.com/facebook/lexical/pull/7420
- [lexical-playground] Bug Fix: Immediate broken image display on load failure by @kirandash in https://github.com/facebook/lexical/pull/7431
- Chore: Improve spelling consistency across codebase by @kirandash in https://github.com/facebook/lexical/pull/7437
- [lexical] Feature: Add text-transform styles to exported HTML by @kirandash in https://github.com/facebook/lexical/pull/7438
- [lexical-list] Feature: export registerCheckList by @atsjo in https://github.com/facebook/lexical/pull/7429
- @harshmetkel24 made their first contribution in https://github.com/facebook/lexical/pull/7384
- @takuyakanbr made their first contribution in https://github.com/facebook/lexical/pull/7395
- @atsjo made their first contribution in https://github.com/facebook/lexical/pull/7429
Full Changelog: https://github.com/facebook/lexical/compare/v0.29.0...v0.30.0
v0.29.0
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
- v0.28.0 by @etrepum in https://github.com/facebook/lexical/pull/7348
- [lexical-playground] Chore: Improve accessibility of DraggableBlockPlugin add block button by @etrepum in https://github.com/facebook/lexical/pull/7352
- [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/facebook/lexical/pull/7351
- [lexical-playground] Bug Fix: Table action menu visibility with cell overflow by @kirandash in https://github.com/facebook/lexical/pull/7334
- [Breaking Change][lexical-markdown] Feature: Support escaping markdown characters by @AlessioGr in https://github.com/facebook/lexical/pull/7353
- [lexical-table] Bug Fix: Add fallback selection to InsertTableCommand by @patrick-atticus in https://github.com/facebook/lexical/pull/7316
- Update react.md, fix typo by @bohdanbirdie in https://github.com/facebook/lexical/pull/7365
- [lexical-playground] Bug Fix: Fix equation rendering in Safari by @kirandash in https://github.com/facebook/lexical/pull/7362
- [Breaking Change][lexical-react] Refactor: LexicalNestedComposer add skipEditableListener prop and deprecate initialNodes prop and implicit namespace setting by @etrepum in https://github.com/facebook/lexical/pull/7357
- [lexical] Bug Fix: Ignore input event from inside decorators by @etrepum in https://github.com/facebook/lexical/pull/7354
- [Breaking Change][lexical-table][lexical-playground] Bug Fix: Set tableFrozenColumn and tableFrozenRow classes only on the scrollable table wrapper by @etrepum in https://github.com/facebook/lexical/pull/7372
- [lexical-playground] Chore: Update excalidraw to v0.18.0 by @etrepum in https://github.com/facebook/lexical/pull/7371
- @bohdanbirdie made their first contribution in https://github.com/facebook/lexical/pull/7365
Full Changelog: https://github.com/facebook/lexical/compare/v0.28.0...v0.29.0
v0.28.0
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:
- 🆕 #7321 Add
mutatedNodes
toUpdateListener
payload - 🆕 #7323 Add a default delete handler for
NodeSelection
- this allowed a lot of boilerplate code to be deleted, and all of the existing implementations were subtly broken - ✅ #7341 Fix bug in transformer loop that would cause nodes not to get reconciled
- ✅ #7342 Handle
canBeEmpty()
in$splitNodes
- 🆕 #7344 Apply
RootNode
transforms last
List:
- ✅ #7325 Move
ListItemNode
text style inheritance to CSS custom properties
Tables:
- ✅ #7336 Fix updateDOM for scrollable TableNode
- ✅ #7318 Fix table cell line breaks
React:
- ✅ #7315 Remove unused direct dependencies
- 🆕 #7338 Add
onElementChanged
callback to DraggableBlockPlugin
Playground:
- ✅ #7337 Table actions should clear selection instead of moving it to the beginning
- 🆕 #7338 Add "+" button to DraggableBlockPlugin
Utils:
- 🆕 #7340 Add a type predicate to
objectKlassEquals
A 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
- v0.27.2 by @etrepum in https://github.com/facebook/lexical/pull/7314
- [lexical-react]: Chore: remove unused dependencies from @lexical/react by @AlessioGr in https://github.com/facebook/lexical/pull/7315
- [lexical-editor][Bug fix] Add LexicalEditor.hasNode to flow typing to match typescript by @Zhangerr in https://github.com/facebook/lexical/pull/7320
- [Breaking Change][lexical][lexical-table] Bug Fix: Scrollable TableNode updateDOM fixes and getDOMSlot type refactoring by @etrepum in https://github.com/facebook/lexical/pull/7336
- [lexical] Feature: Add mutatedNodes to UpdateListener payload by @etrepum in https://github.com/facebook/lexical/pull/7321
- [Breaking Change][lexical-list] Bug Fix: Move ListItemNode text style inheritance to custom properties and CSS by @etrepum in https://github.com/facebook/lexical/pull/7325
- [Breaking Change][lexical][lexical-playground] Feature: Add a default delete handler for NodeSelection by @etrepum in https://github.com/facebook/lexical/pull/7323
- [lexical-playground] Table actions should clear selection instead of moving it to the beginning by @etrepum in https://github.com/facebook/lexical/pull/7337
- [lexical-utils] Feature: Add type predicate to objectKlassEquals by @2wheeh in https://github.com/facebook/lexical/pull/7340
- [Breaking Change][lexical] Bug Fix: Fix bug in transformer loop that would cause nodes not to get reconciled by @etrepum in https://github.com/facebook/lexical/pull/7341
- [Breaking Change][lexical-table] Bug Fix: Table cell line breaks behave differently from the intended HTML behavior. by @dineug in https://github.com/facebook/lexical/pull/7318
- [Breaking Change][lexical][lexical-utils]: Bug Fix: Handle canBeEmpty in $splitNodes by @etrepum in https://github.com/facebook/lexical/pull/7342
- [lexical-playground][lexical-react] Feature: Push Draggable Element to Parent by @sescandell in https://github.com/facebook/lexical/pull/7338
- [lexical-website] Docs: Fix broken links to React Rich Collab Example by @etrepum in https://github.com/facebook/lexical/pull/7347
- [lexical] Feature: Apply RootNode transforms last by @etrepum in https://github.com/facebook/lexical/pull/7344
- @Zhangerr made their first contribution in https://github.com/facebook/lexical/pull/7320
- @dineug made their first contribution in https://github.com/facebook/lexical/pull/7318
- @sescandell made their first contribution in https://github.com/facebook/lexical/pull/7338
Full Changelog: https://github.com/facebook/lexical/compare/v0.27.2...v0.28.0
v0.27.2
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:
- ✅ #7313 Update prismjs dependency to 1.30.0
Collab:
- ✅ #7295 Prevent collab element nodes from removing other nodes from node map
Table:
- 🆕 #7297 Add table cell selection handler for touch devices
- ✅ #7309 Fix unintended touch table cell selection when scrolling
Playground:
- 🆕 #7299 Add touch support for TableCellResizer
- ✅ #7305 Fix row height resizing for merged cells
- v0.27.1 by @etrepum in https://github.com/facebook/lexical/pull/7288
- [lexical-website] Bug Fix: Fix vite.config.ts for gallery examples by @etrepum in https://github.com/facebook/lexical/pull/7290
- [lexical-yjs] Bug Fix: prevent collab element nodes from removing other nodes from node map by @james-atticus in https://github.com/facebook/lexical/pull/7295
- [lexical-playground] Feature: Add touch support for TableCellResizer by @ibastawisi in https://github.com/facebook/lexical/pull/7299
- [lexical-table] Add table cell selection handler for touch devices by @ibastawisi in https://github.com/facebook/lexical/pull/7297
- [lexical-playground] Bug Fix: row height resizing for merged cells by @kirandash in https://github.com/facebook/lexical/pull/7305
- [lexical-table] Bug Fix: Fix unintended touch table cell selection when scrolling by @ibastawisi in https://github.com/facebook/lexical/pull/7309
- [lexical-code] Chore: Update prismjs dependency to 1.30.0 by @etrepum in https://github.com/facebook/lexical/pull/7313
Full Changelog: https://github.com/facebook/lexical/compare/v0.27.1...v0.27.2
v0.27.1
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:
- ✅ #7271 Fix non-ElementNode regression in getCommonAncestor
Core + List:
- ✅ #7282 Add RTL direction support in output HTML for ElementNode and ListItemNode (previously this was only on ParagraphNode)
Table:
- ✅ #7283 Fix click and drag table selection in Firefox
- v0.27.0 by @etrepum in https://github.com/facebook/lexical/pull/7281
- [lexical-list][lexical] Bug Fix: Add RTL direction support for list items in output HTML by @kirandash in https://github.com/facebook/lexical/pull/7282
- [lexical-table] Bug Fix: Click and drag table selection in Firefox by @etrepum in https://github.com/facebook/lexical/pull/7283
- [CI] Feature: Add a fixer for the no-imports-from-self lint by @etrepum in https://github.com/facebook/lexical/pull/7284
- [lexical] Bug Fix: Fix non-ElementNode regression in getCommonAncestor by @etrepum in https://github.com/facebook/lexical/pull/7287
Full Changelog: https://github.com/facebook/lexical/compare/v0.27.0...v0.27.1
v0.27.0
v0.27.0 ad-hoc release to address v0.26.0 regressions.
Core:
- #7270 - To handle platform differences and avoid piercing shadow roots, arrow key navigation for RangeSelection is now handled by lexical in more scenarios when crossing the boundaries of elements. This should only affect "exotic" custom element nodes such as TableNode. All code in @lexical/table has been updated accordingly, but if you have something like a custom table implementation then it may require additional updates (probably in the direction of removing workarounds rather than adding them).
Core:
- ✅ #7271 Fix invalid import from self
- ✅ #7270 Address deleteLine regression in #7248
Playground:
- ✅ #7273 Apply correct column headers when column contains vertically merged cells
- 🆕 #7279 Add HR theme config for selected state
Utils:
- ✅ #7275 Don't include parent's siblings when starting $dfs at last child
Collab/Table:
- ✅ #7277 TableCellNode vertical align not syncing
- v0.26.0 by @etrepum in https://github.com/facebook/lexical/pull/7265
- [lexical] Bug Fix: invalid import from self by @AlessioGr in https://github.com/facebook/lexical/pull/7271
- [Breaking Changes][lexical] Bug Fix: Address deleteLine regression in #7248 by @etrepum in https://github.com/facebook/lexical/pull/7270
- [*] Chore: Refactor shared/invariant for easier dev debugging by @etrepum in https://github.com/facebook/lexical/pull/7269
- [lexical-playground] Bug Fix: apply correct column headers when column contains vertically merged cells by @rilrom in https://github.com/facebook/lexical/pull/7273
- [ci] Chore: Remove unused GITHUB_TOKEN secrets from workflows by @etrepum in https://github.com/facebook/lexical/pull/7209
- chore: add no-imports-from-self eslint rule to monorepo by @AlessioGr in https://github.com/facebook/lexical/pull/7272
- [lexical-utils] Bug Fix: don't include parent's siblings when starting $dfs at last child by @james-atticus in https://github.com/facebook/lexical/pull/7275
- [lexical-table] Bug Fix: TableCellNode vertical align not syncing by @anhle1476 in https://github.com/facebook/lexical/pull/7277
- [lexical-playground][lexical-react] Feature: add HR theme config for selected state by @RobHannay in https://github.com/facebook/lexical/pull/7279
- @anhle1476 made their first contribution in https://github.com/facebook/lexical/pull/7277
Full Changelog: https://github.com/facebook/lexical/compare/v0.26.0...v0.27.0
v0.26.0
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:
- #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
Core:
- 🆕 #7117 Experimental Node State: Add a generic state property to all nodes. More documentation and examples to come in the next few weeks. New APIs:
- 🆕 #7135 Refactor RangeSelection.getNodes() to use NodeCaret APIs. Introduces new APIs with a total ordering for PointCaret and getting common ancestors.
- ✅ #7225 deleteCharacter through ListNode->ListItemNode (applies to nested !isInline elements in general)
- ✅ #7256 Point.isBefore could return incorrect result due to normalization
- ✅ #7239 Fix selection shifting when deleting paragraphs on Android Chrome
- ✅ #7226 Added isInline implementations to TextNode and LineBreakNode
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
- 2024 recap shortcut by @zurfyx in https://github.com/facebook/lexical/pull/7223
- v0.25.0 by @etrepum in https://github.com/facebook/lexical/pull/7221
- [Breaking Change][lexical/react] Chore: Remove deprecated default exports by @kirandash in https://github.com/facebook/lexical/pull/7219
- [lexical-yjs] Bug Fix: Normalize multiple adjacent merge conflicts in one block by @james-atticus in https://github.com/facebook/lexical/pull/7217
- [lexical-table] Docs: Fix @lexical/table README.md by @etrepum in https://github.com/facebook/lexical/pull/7224
- [@lexical/list] Feature: export
ListNodeTagType
by @DaniGuardiola in https://github.com/facebook/lexical/pull/7228 - [lexical-list] Bug Fix: retain selection styling when exiting nested list by @mrdivyansh in https://github.com/facebook/lexical/pull/7225
- [lexical-playground] fix: hard coded theme classes for table hover actions by @umaranis in https://github.com/facebook/lexical/pull/7182
- [*] Feature: Add linter to check that flow types are consistent with typescript types by @etrepum in https://github.com/facebook/lexical/pull/7230
- [lexical-playground] Refactor: Image component rerenders on every editor update by @jvithlani in https://github.com/facebook/lexical/pull/7233
- [lexical][lexical-code] Refactor: Use NodeCaret to implement RangeSelection.getNodes() by @etrepum in https://github.com/facebook/lexical/pull/7135
- [lexical-list] Bullet item color matches text color by @ivailop7 in https://github.com/facebook/lexical/pull/7024
- [lexical-table] Bug Fix: Prevent adjacent cell selection on triple-click by @kirandash in https://github.com/facebook/lexical/pull/7213
- [lexical-react] fix: ensure attributes are set immediately on menu by @sodenn in https://github.com/facebook/lexical/pull/7237
- [Update] Upgrade docusaurus version by @lilshady in https://github.com/facebook/lexical/pull/7244
- [Breaking Changes][lexical][lexical-list][lexical-playground] Bug Fix: deleteCharacter through ListNode->ListItemNode by @etrepum in https://github.com/facebook/lexical/pull/7248
- [lexical] fix typo in Caret error msg by @potatowagon in https://github.com/facebook/lexical/pull/7249
- [fix] Add missing flow types for node event plugin by @fantactuka in https://github.com/facebook/lexical/pull/7252
- [lexical-playground] Bug Fix Table Action Menu dropdown positioning by @umaranis in https://github.com/facebook/lexical/pull/7229
- [lexical][lexical-utils] Chore: Add some missing flow types for NodeCaret and table related functionality by @etrepum in https://github.com/facebook/lexical/pull/7253
- [lexical-playground][examples/*] Refactor: Unify vite dev/prod/example configurations by @etrepum in https://github.com/facebook/lexical/pull/7208
- [lexical][lexical-mark] Bug Fix: Identify as inline element by @PeterDekkers in https://github.com/facebook/lexical/pull/7255
- [lexical] Feature: add a generic state property to all nodes by @GermanJablo in https://github.com/facebook/lexical/pull/7117
- [lexical] Bug Fix: Point.isBefore could return incorrect result due to normalization by @etrepum in https://github.com/facebook/lexical/pull/7256
- [@lexical/react] Bug Fix: anchor element not cleanup when component unmount by @yuanyan in https://github.com/facebook/lexical/pull/7264
- Fix selection shifting when deleting paragraphs on android by @waynetee in https://github.com/facebook/lexical/pull/7239
- [lexical] Chore: Added missing
isInline
function to TextNode by @mrdivyansh in https://github.com/facebook/lexical/pull/7226
- @DaniGuardiola made their first contribution in https://github.com/facebook/lexical/pull/7228
- @jvithlani made their first contribution in https://github.com/facebook/lexical/pull/7233
- @sodenn made their first contribution in https://github.com/facebook/lexical/pull/7237
- @lilshady made their first contribution in https://github.com/facebook/lexical/pull/7244
- @PeterDekkers made their first contribution in https://github.com/facebook/lexical/pull/7255
- @yuanyan made their first contribution in https://github.com/facebook/lexical/pull/7264
Full Changelog: https://github.com/facebook/lexical/compare/v0.25.0...v0.26.0
v0.25.0
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 aLinkNode
would prevent aListItemNode
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.
Core:
- 🆕 #7046 New NodeCaret API 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
- 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 toContentEditable
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
- @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
v0.24.0
Build:
- 🆕 #7047 All commonjs prod builds are now optimized with terser instead of the unmaintained closure compiler
Core editor:
- ✅ #7037
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:
- 🆕 #7037
insertList
andremoveList
are now deprecated, use$insertList
and$removeList
instead - ✅ #7037
INSERT_CHECK_LIST_COMMAND
,INSERT_ORDERED_LIST_COMMAND
,INSERT_UNORDERED_LIST_COMMAND
andREMOVE_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:
- ✅ Fix: Infinite loop when splitting invalid ListItemNode #7037
- ✅ Fix: Handle MutationObserver/input event re-ordering when using contentEditable inside of an iframe #7045
- ✅ Fix: Normalize selection after applyDOMRange to account for Firefox differences #7050
- ✅ Fix: triple click around inline elements (links) #7055
- ✅ Fix: iOS Autocorrect strips formatting by reporting wrong dataType #5789
- ✅ Fix: In the Safari browser, during the compositing event process, the delete key exhibits unexpected behavior #7061
- ✅ Fix: Chrome on android deletion bugs #7122
Collab:
- 🆕 Feature: Allow passing in custom
syncCursorPositions
function to collab hook #7053 - ✅ Fix: handle text node being split by Yjs redo #7098
List:
- ✅ Fix: Prevent error when calling formatList when selection is at root by #6994
- ✅ Fix: ListItemNode serialization throws #7116
Mark:
- 🆕 Feature: include inline decorator nodes in marks #7086
- ✅ Fix: $wrapSelectionInMarkNode with element points #7132
Markdown:
- ✅ Fix: support link and inline code text formats #7004
Playground:
- ✅ Fix: Columns Layout Item Overflow #7066
- 🆕 Feature: TableOfContents Scroll smooth behaviour #7069
- ✅ Fix: prevent growing whitespaces in markdown table toggle #7041
- ✅ Fix: Ensure Delete Node handles all node types #7096
React:
- ✅ Fix: Import
JSX
type from React to prevent "Cannot find namespace 'JSX'"-error when type-checking with React 19 #7080
Table:
- 🆕 Feature: Support table alignment #7044
- ✅ Fix: Prevent error if pasted table has empty row #7057
Utils:
- 🆕 Feature: Add reverse dfs iterator #7107 #7112
Build:
- 🆕 All commonjs prod builds are now optimized with terser instead of the unmaintained closure compiler #7047
- ✅ Change fork modules to use production only when NODE_ENV explicitly set to production #7065
- v0.23.1 by @etrepum in https://github.com/facebook/lexical/pull/7035
- [Breaking Change][lexical][lexical-selection][lexical-list] Bug Fix: Fix infinite loop when splitting invalid ListItemNode by @etrepum in https://github.com/facebook/lexical/pull/7037
- Clean up nested editor update by @ivailop7 in https://github.com/facebook/lexical/pull/7039
- [lexical] Bug Fix: Handle MutationObserver/input event re-ordering when using contentEditable inside of an iframe by @etrepum in https://github.com/facebook/lexical/pull/7045
- [Breaking Change][*] Chore: Use terser for optimizing cjs prod build by @etrepum in https://github.com/facebook/lexical/pull/7047
- [*] Bug Fix: Use GITHUB_OUTPUT instead of GITHUB_ENV for size-limit action by @etrepum in https://github.com/facebook/lexical/pull/7051
- [lexical] Bug Fix: Normalize selection after applyDOMRange to account for Firefox differences by @etrepum in https://github.com/facebook/lexical/pull/7050
- Revert [Breaking Change][lexical] Bug Fix: Commit updates on editorSetRootElement(null) (#7023) by @potatowagon in https://github.com/facebook/lexical/pull/7052
- [lexical-table] Support table alignment by @ivailop7 in https://github.com/facebook/lexical/pull/7044
- fix: triple click around inline elements (links) by @fantactuka in https://github.com/facebook/lexical/pull/7055
- [lexical-yjs] Feature: Allow passing in custom
syncCursorPositions
function to collab hook by @amanharwara in https://github.com/facebook/lexical/pull/7053 - fix: iOS Autocorrect strips formatting by reporting wrong dataType by @redstar504 in https://github.com/facebook/lexical/pull/5789
- [lexical-list] Bug Fix: Prevent error when calling formatList when selection is at root by @amanharwara in https://github.com/facebook/lexical/pull/6994
- [lexical-table] Bug Fix: Prevent error if pasted table has empty row by @amanharwara in https://github.com/facebook/lexical/pull/7057
- docs: Change "here" link to more descriptive text by @6TELOIV in https://github.com/facebook/lexical/pull/7058
- [lexical] Bug Fix: In the Safari browser, during the compositing event process, the delete key exhibits unexpected behavior. by @EruditionTu in https://github.com/facebook/lexical/pull/7061
- Change fork modules to use production only when NODE_ENV explicitly set to production by @etrepum in https://github.com/facebook/lexical/pull/7065
- [lexical-playground] Fix Columns Layout Item Overflow by @ivailop7 in https://github.com/facebook/lexical/pull/7066
- [lexical-playground] plugins TableOfContent Scroll smooth behaviour A… by @mshaheerz in https://github.com/facebook/lexical/pull/7069
- Unrevert [Breaking Change][lexical] Bug Fix: Commit updates on editor.setRootElement(null) #7023 by @potatowagon in https://github.com/facebook/lexical/pull/7068
- [playground] Bug fix: prevent growing whitespaces in markdown table toggle by @potatowagon in https://github.com/facebook/lexical/pull/7041
- Fix: Use already defined RegisteredNodes type by @hellovuki in https://github.com/facebook/lexical/pull/7085
- [lexical] Chore: Rename variable and add comments for Safari compositing workaround by @EruditionTu in https://github.com/facebook/lexical/pull/7092
- [lexical-react] Bug Fix: Import
JSX
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/7080 - [lexical-yjs] Bug Fix: handle text node being split by Yjs redo by @james-atticus in https://github.com/facebook/lexical/pull/7098
- Lexical Docs: 2 updates to spelling README.md by @DocAdam in https://github.com/facebook/lexical/pull/7102
- Selection | Lexical: 1 Spelling Update Update selection.md by @DocAdam in https://github.com/facebook/lexical/pull/7103
- Creating a React Plugin: 1 Grammar Update - Update create_plugin.md by @DocAdam in https://github.com/facebook/lexical/pull/7104
- Working with DOM Events: 2 Spelling and Grammar Updates Update dom-ev… by @DocAdam in https://github.com/facebook/lexical/pull/7105
- Listeners Lexical: 3 updates to spelling and grammar - Update listeners.md by @DocAdam in https://github.com/facebook/lexical/pull/7100
- [lexical-playground] Bug Fix: Ensure Delete Node handles all node types by @mshaheerz in https://github.com/facebook/lexical/pull/7096
- [lexical-utils] Feature: add reverse dfs iterator by @nigelgutzmann in https://github.com/facebook/lexical/pull/7107
- [lexical-utils] Fix: Modify $reverseDfs to be a right-to-left variant of $dfs by @etrepum in https://github.com/facebook/lexical/pull/7112
- [lexical-mark] Feature: include inline decorator nodes in marks by @james-atticus in https://github.com/facebook/lexical/pull/7086
- Fix ListItemNode serialization throws by @zurfyx in https://github.com/facebook/lexical/pull/7116
- [workflow] disable size-limit job by @potatowagon in https://github.com/facebook/lexical/pull/7125
- [workflow] Delete size limit report by @potatowagon in https://github.com/facebook/lexical/pull/7128
- cleanup size-limit by @potatowagon in https://github.com/facebook/lexical/pull/7129
- [lexical-playground] Fix: Replace icon with Twitter with X by @awjae in https://github.com/facebook/lexical/pull/7127
- [lexical][lexical-mark] Bug Fix: $wrapSelectionInMarkNode with element points by @etrepum in https://github.com/facebook/lexical/pull/7132
- [lexical-react] Refactor: Replace
React$Context
withReact.Context
by @SamChou19815 in https://github.com/facebook/lexical/pull/7137 - [lexical-markdown] Bug Fix: support link and inline code text formats by @AlessioGr in https://github.com/facebook/lexical/pull/7004
- [lexical] Bug Fix: Fix Chrome on android deletion bugs by @waynetee in https://github.com/facebook/lexical/pull/7122
- [bugfix] Fix flow typedef for links plugin to include attributes by @fantactuka in https://github.com/facebook/lexical/pull/7145
- [ci] Chore: Remove SSH_KEY secret by @etrepum in https://github.com/facebook/lexical/pull/7143
- [ci] Bug Fix: Force tag update so create release branch can be run multiple times by @etrepum in https://github.com/facebook/lexical/pull/7146
- @redstar504 made their first contribution in https://github.com/facebook/lexical/pull/5789
- @6TELOIV made their first contribution in https://github.com/facebook/lexical/pull/7058
- @EruditionTu made their first contribution in https://github.com/facebook/lexical/pull/7061
- @mshaheerz made their first contribution in https://github.com/facebook/lexical/pull/7069
- @hellovuki made their first contribution in https://github.com/facebook/lexical/pull/7085
- @Svish made their first contribution in https://github.com/facebook/lexical/pull/7080
- @nigelgutzmann made their first contribution in https://github.com/facebook/lexical/pull/7107
- @awjae made their first contribution in https://github.com/facebook/lexical/pull/7127
- @waynetee made their first contribution in https://github.com/facebook/lexical/pull/7122
Full Changelog: https://github.com/facebook/lexical/compare/v0.23.1...v0.24.0
v0.23.1
The only breaking change in this release is minor (#7023) and should not affect any correct code. However, if you are counting the number of times your update listener is called during editor.setRootElement(null)
then you will have to change that expectation.
Highlights since v0.23.0
Core Editor:
- ✅ Fix: Updates are committed on
editor.setRootElement(null)
#7023 - ✅ Fix: TabNode deserialization regression from v0.23.0 #7031
Mark:
- ✅ Fix: MarkNode.addID regression https://github.com/facebook/lexical/pull/7020
React:
- 🆕 Feature: Merge TabIndentionPlugin and ListMaxIndentLevelPlugin plugins, previously the ListMaxIndentLevelPlugin functionality was only in the playground https://github.com/facebook/lexical/pull/7018
- v0.23.0 by @etrepum in https://github.com/facebook/lexical/pull/7017
- [lexical-mark] Bug Fix: reverse ternary in MarkNode.addID by @james-atticus in https://github.com/facebook/lexical/pull/7020
- [lexical-react] Feature: Merge TabIndentionPlugin and ListMaxIndentLevelPlugin plugins by @fantactuka in https://github.com/facebook/lexical/pull/7018
- [lexical] Fix TabNode deserialization regression by @etrepum in https://github.com/facebook/lexical/pull/7031
- [Breaking Change][lexical] Bug Fix: Commit updates on editor.setRootElement(null) by @etrepum in https://github.com/facebook/lexical/pull/7023
- @james-atticus made their first contribution in https://github.com/facebook/lexical/pull/7020
Full Changelog: https://github.com/facebook/lexical/compare/v0.23.0...v0.23.1