v0.12.3
facebook/lexicalv0.12.3Nov 17, 2023by zurfyx
AI Summary
This minor release focuses on significant improvements to HTML serialization, a complete rewrite of the `$insertNodes` function to improve complexity and clipboard behavior, and extensive bug fixes for tables.
Key Highlights
- Overriding HTML serialization behavior from the editor config
- Complete rewrite of `$insertNodes` for improved complexity and clipboard behavior
- Significant reliability improvements for tables (closed 70%+ of open table issues)
- Enhanced support for nested tables and column layouts in the Typeahead menu
New Features
- Added `LexicalClickableLinkPlugin` support for ctrl click mode
- Embed Twitter support (x.com) in the Playground
- Added `commandPriority` option to `LexicalMenu` and dependent components
- Playwright integration and reporting added to the project
Full Release Notes
# v0.12.3 (2023-11-17)
This minor release is not so minor! New stuff and a scroll of bugfixes.
### Overriding HTML serialization from the editor config (https://github.com/facebook/lexical/pull/4254)
Some months ago we introduced Node Overrides as a way to fully customize your Node. While this feature gives you the most flexibility, we realized (based on Discord's feedback) that most overrides are fairly simple and move around HTML. For this reason, we're bringing this closer to you and without the need to introduce new Nodes.
```
html: {
export: new Map([[TextNode, () => ({ element: document.createElement('figure') })]]),
import: { 'figure': () => ({ conversion: () => ({ node: $createTextNode('yolo') }), priority: 4 }) }
},
```
### $insertNodes rewrite (https://github.com/facebook/lexical/pull/5002)
`$insertNodes` is arguably the most complex function in the Lexical codebase. Or at least it was until @GermanJablo succesfully rewrote it from scratch!

For those of you who haven't had a chance to play with `$insertNodes` yet, it places one or multiple Nodes at your selection, and is responsible for intelligently determining the end hiearchy (i.e. merged together or moved up to tree).
@GermanJablo's rewrite not only resolves some immediate issues but also the reduced complexity now enables us to perfect this function (and indirectly the clipboard paste behavior), previously blocked by its complexity.
### Tables reliability
We closed more than 70% of the open tables issues since the last release. Kudos to @icrosil for being the main driver behind this effort!
## What's Changed
* fix(lexical/html): missing @lexical/utils dependency by @liuweiGL in https://github.com/facebook/lexical/pull/4984
* Fix comment plugin selection rect top position by @vonsa in https://github.com/facebook/lexical/pull/4988
* Remove capital letter mentions by @acywatson in https://github.com/facebook/lexical/pull/4991
* Add nodes replacement support for nested composer by @fantactuka in https://github.com/facebook/lexical/pull/4992
* Add highlight to format types by @zurfyx in https://github.com/facebook/lexical/pull/5001
* Fix getTableSelectionFromTableElement flow by @zurfyx in https://github.com/facebook/lexical/pull/5005
* Fix TextNode override in 'Serialization & Deserialization' doc by @giacomoran in https://github.com/facebook/lexical/pull/5006
* Allow overriding HTML serialization behavior from the editor config. by @acywatson in https://github.com/facebook/lexical/pull/4254
* fix: LinkNode.importDOM should support all node content by @k-rajat19 in https://github.com/facebook/lexical/pull/5010
* Fix event handler removal in useDynamicPositioning, remove dupe code by @thorn0 in https://github.com/facebook/lexical/pull/5024
* Fix: pasting text that ends with an empty paragraph is ignored when the MaxLengthPlugin is enabled by @khsily in https://github.com/facebook/lexical/pull/5020
* Update setFloatingElemPosition.ts by @dirheimerb in https://github.com/facebook/lexical/pull/5027
* Update setFloatingElemPositionForLinkEditor.ts by @dirheimerb in https://github.com/facebook/lexical/pull/5028
* chore: fix typo in lexical-utils docs by @bbonamin in https://github.com/facebook/lexical/pull/5022
* fix(Playground): CMD +K improvements by @k-rajat19 in https://github.com/facebook/lexical/pull/5013
* feat: LexicalClickableLinkPlugin should support ctrl click mode #4565 by @sathishsridhar in https://github.com/facebook/lexical/pull/4839
* Nit: Floating toolbar by @zurfyx in https://github.com/facebook/lexical/pull/5038
* Transpile optional catch binding by @zurfyx in https://github.com/facebook/lexical/pull/5048
* Playground: refactor component picker plugin by @thorn0 in https://github.com/facebook/lexical/pull/4836
* Port List e2e test to unit tests by @acywatson in https://github.com/facebook/lexical/pull/5030
* Playground: embed twitter support x.com by @suhaotian in https://github.com/facebook/lexical/pull/5060
* MaxLength handle empty ElementNode by @zurfyx in https://github.com/facebook/lexical/pull/5029
* Allow LexicalTypeaheadMenuPlugin to work when inside an iframe by @lestertay in https://github.com/facebook/lexical/pull/5044
* fix : Add column shortcut gets hidden when mouse leave the table #4857 by @sathishsridhar in https://github.com/facebook/lexical/pull/5058
* Fix/floating formatter #5021 by @shubham168 in https://github.com/facebook/lexical/pull/5041
* Fix: ToolbarPlugin paste error with start, end format by @khsily in https://github.com/facebook/lexical/pull/5019
* fix(playground-text-format-toolbar): don't hide toolbar if current node is a paragraph by @mathieumetral in https://github.com/facebook/lexical/pull/4850
* Fix integrity by @zurfyx in https://github.com/facebook/lexical/pull/5068
* chore: fix typo by @AlessioGr in https://github.com/facebook/lexical/pull/5074
* Set up GA4 for website by @zpao in https://github.com/facebook/lexical/pull/5078
* Fix getting style via $getSelectionStyleValueForProperty when selection is collapsed by @Piliuta in https://github.com/facebook/lexical/pull/5082
* Fix tab replacement composition crash by @zurfyx in https://github.com/facebook/lexical/pull/5066
* chore: add typedefs for collab nodes and remove unused members by @zignis in https://github.com/facebook/lexical/pull/5071
* Revert Fix $transferStartingElementPointToTextPoint() #4756 by @thegreatercurve in https://github.com/facebook/lexical/pull/5094
* Fix insertNodes insert position at start of inline ElementNode by @zurfyx in https://github.com/facebook/lexical/pull/5110
* docs: fix typo in decorators.md by @CanRau in https://github.com/facebook/lexical/pull/5113
* fix(lexical-rich-text): correct comment typo by @jason89521 in https://github.com/facebook/lexical/pull/5116
* fix: fix android backspace bug by @cristopher-iov in https://github.com/facebook/lexical/pull/5077
* Fix: right click select images by @bencarletonn in https://github.com/facebook/lexical/pull/5056
* Consolidate docs across the repo by @ivailop7 in https://github.com/facebook/lexical/pull/5121
* chore(deps): bump @excalidraw/excalidraw from 0.14.2 to 0.15.3 by @dependabot in https://github.com/facebook/lexical/pull/5135
* Update anchor selection if split by patching style by @Piliuta in https://github.com/facebook/lexical/pull/5087
* Updated cell calculation based on cellspans by @icrosil in https://github.com/facebook/lexical/pull/5141
* Add Columns Layout to Typeahead menu by @ivailop7 in https://github.com/facebook/lexical/pull/5136
* Updated $insertTableColumn with batching by @icrosil in https://github.com/facebook/lexical/pull/5145
* chore(deps): bump @babel/traverse from 7.18.6 to 7.23.2 by @dependabot in https://github.com/facebook/lexical/pull/5155
* Add `commandPriority` option to `LexicalMenu` and dependent components by @huw in https://github.com/facebook/lexical/pull/5123
* Update index.tsx by @dirheimerb in https://github.com/facebook/lexical/pull/5165
* Fix formatting selected table cells by @tahir606 in https://github.com/facebook/lexical/pull/5168
* Updated package-lock.json versions with 'npm audit fix'. by @Sparky338 in https://github.com/facebook/lexical/pull/5125
* Table resize fix by @AlexanderReznik in https://github.com/facebook/lexical/pull/5169
* Add Optional Chaining to `isNodePre` Method by @nickjmoss in https://github.com/facebook/lexical/pull/5157
* Fix `insertNodes` and `insertParagraph` by @GermanJablo in https://github.com/facebook/lexical/pull/5002
* Range utils by @zurfyx in https://github.com/facebook/lexical/pull/5153
* Fix insertNodes after selection swap by @zurfyx in https://github.com/facebook/lexical/pull/5175
* Add playwright-report to gitignore by @GermanJablo in https://github.com/facebook/lexical/pull/5173
* Fix insertNodes when anchor point is blank TextNode by @zurfyx in https://github.com/facebook/lexical/pull/5179
* Fix at() transpilation by @zurfyx in https://github.com/facebook/lexical/pull/5180
* fixed issue 5181 where link address is not shown if comment is set in… by @btezzxxt in https://github.com/facebook/lexical/pull/5188
* Improved LexicalMenu positioning relative to text by @9larsons in https://github.com/facebook/lexical/pull/5187
* Link title is correctly applied through the command by @petyosi in https://github.com/facebook/lexical/pull/5191
* fix Heading.insertNewAfter by @GermanJablo in https://github.com/facebook/lexical/pull/5198
* Update Modal.tsx by @dirheimerb in https://github.com/facebook/lexical/pull/5203
* Add conditional format setting, if the node is link fetch the parent paragraph node by @tahir606 in https://github.com/facebook/lexical/pull/5209
* Fix lexical-link typo s/_rel/__rel/ by @etrepum in https://github.com/facebook/lexical/pull/5221
* Fix "touple" typo to make it correctly "tuple" by @Jufrench in https://github.com/facebook/lexical/pull/5229
* fix: Make autolinks working for formatted text by @Constantiner in https://github.com/facebook/lexical/pull/5214
* refactor(playground): dry settings by @agriffis in https://github.com/facebook/lexical/pull/5225
* Fix iconRTL for center alignment by @ivailop7 in https://github.com/facebook/lexical/pull/5227
* Bug: Align list item do not change the export DOM by @trinhvinhtruong96 in https://github.com/facebook/lexical/pull/5160
* Fixes grid selection to be aware of nested tables by @icrosil in https://github.com/facebook/lexical/pull/5166
* chore(deps-dev): bump vite from 2.9.13 to 2.9.16 by @dependabot in https://github.com/facebook/lexical/pull/5133
* chore(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 by @dependabot in https://github.com/facebook/lexical/pull/5129
* chore(deps): bump postcss from 8.4.27 to 8.4.31 by @dependabot in https://github.com/facebook/lexical/pull/5130
* chore(deps-dev): bump semver from 5.7.1 to 5.7.2 by @dependabot in https://github.com/facebook/lexical/pull/5131
* chore(deps): bump @sideway/formula from 3.0.0 to 3.0.1 by @dependabot in https://github.com/facebook/lexical/pull/5132
* chore(deps-dev): bump tough-cookie from 4.1.2 to 4.1.3 by @dependabot in https://github.com/facebook/lexical/pull/5134
* Remove unnecessary link from README.md by @thegreatercurve in https://github.com/facebook/lexical/pull/5232
* Select original cell if empty by @icrosil in https://github.com/facebook/lexical/pull/5231
* Fixed delete removing link node text when on linebreak by @9larsons in https://github.com/facebook/lexical/pull/5146
* Remove codeowners to prevent unnecessary pings by @thegreatercurve in https://github.com/facebook/lexical/pull/5236
* Fixed column header on merged cells by @icrosil in https://github.com/facebook/lexical/pull/5230
* It's a journey by @acywatson in https://github.com/facebook/lexical/pull/5242
* keep on keeping on by @acywatson in https://github.com/facebook/lexical/pull/5243
## New Contributors
* @liuweiGL made their first contribution in https://github.com/facebook/lexical/pull/4984
* @vonsa made their first contribution in https://github.com/facebook/lexical/pull/4988
* @dirheimerb made their first contribution in https://github.com/facebook/lexical/pull/5027
* @bbonamin made their first contribution in https://github.com/facebook/lexical/pull/5022
* @sathishsridhar made their first contribution in https://github.com/facebook/lexical/pull/4839
* @suhaotian made their first contribution in https://github.com/facebook/lexical/pull/5060
* @lestertay made their first contribution in https://github.com/facebook/lexical/pull/5044
* @shubham168 made their first contribution in https://github.com/facebook/lexical/pull/5041
* @zpao made their first contribution in https://github.com/facebook/lexical/pull/5078
* @CanRau made their first contribution in https://github.com/facebook/lexical/pull/5113
* @jason89521 made their first contribution in https://github.com/facebook/lexical/pull/5116
* @cristopher-iov made their first contribution in https://github.com/facebook/lexical/pull/5077
* @icrosil made their first contribution in https://github.com/facebook/lexical/pull/5141
* @huw made their first contribution in https://github.com/facebook/lexical/pull/5123
* @Sparky338 made their first contribution in https://github.com/facebook/lexical/pull/5125
* @AlexanderReznik made their first contribution in https://github.com/facebook/lexical/pull/5169
* @nickjmoss made their first contribution in https://github.com/facebook/lexical/pull/5157
* @petyosi made their first contribution in https://github.com/facebook/lexical/pull/5191
* @etrepum made their first contribution in https://github.com/facebook/lexical/pull/5221
* @Jufrench made their first contribution in https://github.com/facebook/lexical/pull/5229
* @Constantiner made their first contribution in https://github.com/facebook/lexical/pull/5214
* @agriffis made their first contribution in https://github.com/facebook/lexical/pull/5225
* @trinhvinhtruong96 made their first contribution in https://github.com/facebook/lexical/pull/5160
**Full Changelog**: https://github.com/facebook/lexical/compare/v.0.12.2...v0.12.3