github meta/lexical v0.54.0

latest releases: v0.54.1-nightly.20261204.0, v0.54.1-nightly.20261203.0
2 days ago

v0.54.0 is the monthly release and collects the work since v0.53.0. Its headline is @lexical/y, an experimental collaboration binding for Yjs 14 (@y/y) that ships to npm for the first time in this release, with headless, migration, offline and server entry points beside it. Around that, the release is a large correctness pass over Markdown export escaping, HTML import, text entities, tables and the reconciler; it adds block handles for showing a document to a model, mark flavors, QuoteContainerNode and $deepCopy; and it drops @experimental from the DOM import pipeline, named slots, compact JSON export and the $config serialization schema.

Upgrading from v0.53.0: one breaking change can affect you. The CJK-friendly Markdown punctuation default (#9735) is the only breaking entry outside @lexical/y. Every other one below is in @lexical/y, which did not exist in v0.53.0, so those apply only to apps that tracked it through nightly or pkg.pr.new builds.

Breaking Changes

Markdown — affects every app that imports or exports Markdown

  • @lexical/markdown, @lexical/mdast: emphasis beside CJK punctuation now reads as CJK writers mean it, following the CommonMark CJK-friendly amendment (#9735). **你好。**世界 imports as bold where CommonMark reads literal asterisks. Export still writes strict-CommonMark-safe Markdown by default.
    • The four @lexical/markdown entry points take an options object in the position that took shouldPreserveNewLines: punctuation is 'cjk-friendly' (import default) or 'strict-commonmark' (export default). MdastExtension takes importPunctuation and exportPunctuation.
    • Migration: Markdown stored by an earlier version with an emoji (@lexical/mdast only) or a text variation selector at the inner edge of a run beside a letter — Hello**🎉 launch**, **©︎**2024 — now imports with literal markers. Import it with punctuation: 'strict-commonmark' to keep the old reading.
    • Detect: calls to $convertFromMarkdownString / $generateNodesFromMarkdownString that read stored Markdown; in types, that parameter is now boolean | MarkdownImportOptions (TS2345/TS2322 on mocks and pass-throughs).
    • @lexical/mdast now needs micromark-core-commonmark 2.0.4 and mdast-util-to-markdown 2.2.1.

@lexical/y — new package; these apply only to nightly/preview users

The binding's stored layout moved twice in this release and the floor moved with it, so a room stored by an earlier preview opens read-only until its server migrates it.

  • Store format runs as paired runs (layout 3) — MIN_LAYOUT, LAYOUT_VERSION and SEED_LAYOUT are 3 (#9777).
  • Store NodeState values on text as paired runs (layout 4) — all three constants are 4 (#9884).
    • Migration for both: upgrade every client of a room together. A server migrates each room as it loads it, before serving it, with prepareYRoom (@lexical/y/server) or migrateYState (@lexical/y/migrate); the default steps now include 2to3 and 3to4, and a step list of your own must add them in that order (after 1to2 for a layout 1 room). Keep the generation fence (checkYSession) on every relay, and replace the incarnation of rooms not yet seeded (needsNewIncarnation(room, SEED_LAYOUT)): the seed layout changed. Clear an app UndoManager at the migration with onYMigrationEpoch(doc, fn, root?).
    • Detect: rooms recording lexical-y:1/:2/:3 but not :4; UNSUPPORTED_LAYOUT_WARNING with reason: 'older'.
  • clientIDRange and ClientIDRange are gone (#9884). Every client id is a 53-bit Yjs 14 id, so a server on yrs (y-crdt) needs yrs 0.28 or later — earlier versions truncate 53-bit ids and an author's content comes back duplicated on reconnect. Delete the option from every config and the 'range' case from writer-warning handlers.
  • The warning API is frozen with open codes (#9766). YWarningCode is any string, YWarning<C> is generic, and YWarningData<C> gains a permanent {reason: 'other'} fallback. Narrow with isYWarning(value, CODE) before reading data; comparing .code after isYWarning(value) leaves data unknown. LAYOUT_VERSION is typed number. Flow drops YWarningOf. Direct Yjs writes below the binding root are unsupported (RAW_YJS_WRITE_WARNING in development builds).
  • The choices an app must make are now required (#9925): YBindingOptions.onStatus, YCollabInput.onYStatus and YCollabInput.synced (a handler, or null); HeadlessYConfig.onWarn; migrateYState's options.pending ('return' or 'discard', and the result is a union on split); prepareYRoom's result is a union on changed with everything to store under write. configExtension(YCollabExtension, ...) without onYStatus compiles but throws at build — the new @lexical/y-collab-status ESLint rule, in the recommended config, catches it.
  • @lexical/y/offline reshaped (#9925, #9924): markSynced() moves onto serverEpoch()'s 'same' verdict; attachYOfflineSession requires loaded, stopSync and one offline value in place of stage/store/persistEdits/keep; replayUnsyncedEdits and recoverYOfflineEdits require leftovers and autoReplay, with wrapLeftoversAsQuote(label) as a ready wrapper; YOfflineError is a union by code; store.clear requires slots and captures.

New APIs & Features

  • @lexical/y — the experimental Yjs 14 binding itself (#9400), keeping concurrent typing through block splits, joins, retypes and link changes. Entry points: @lexical/y (binding and extension), /headless (seed, edit and read without an editor, #9437), /migrate (frozen layout steps, #9766), /offline (IndexedDB persistence and offline replay, #9899), /server (prepareYRoom, checkYSession, quarantine records). Also from it: LexicalWarning and DEFER_COMPOSITION_MERGE_TAG in lexical, and BlockIdExtension's repairTransforms option.
  • Block handles, for showing a document to a model (#9531): $getBlockHandle(node) gives a block the shortest unambiguous prefix of a hash of its id — about 3–4 o200k tokens against 14 for a 21-character id — with $getBlockHandles() and $resolveBlockHandle(handle, {read}), which returns found / not-found / ambiguous / invalid rather than throwing. BlockIdHTMLExtension gains a handles option.
  • lexical: editorState.toJSON({compact, editor}) exports with the editor active, so a node whose exportJSON calls $getEditor() needs no wrapping read (#9941); @lexical/file's serializedDocumentFromEditorState takes the same editor option.
  • lexical: $deepCopy(node) copies a node with its whole subtree, named slots and NodeState, for features such as "Duplicate block" (#9936).
  • @lexical/mark: mark flavors — defineMarkExtension makes one extension per kind of annotation (comments, suggestions, highlights), each on its own NodeState key, with registerMarkIDsListener and MarkBaseExtension (#9496); isMarkIDShown chooses which ids render, for hiding resolved threads while their ids stay in the document (#9489).
  • @lexical/rich-text (experimental): QuoteContainerNode, a <blockquote> that holds blocks and declares it, with QuoteContainerReplacementExtension, QUOTE_CONTAINER for Markdown and MdastQuoteContainerExtension (#9913).

No longer experimental

#9980 drops @experimental from APIs that have shipped unchanged for several releases: the DOM import pipeline (DOMImportExtension, defineImportRule, CoreImportExtension, the node packages' import rules and schemas, ClipboardImportExtension), DOMRenderExtension, the shadow DOM helpers, setDOMUnmanaged/isDOMUnmanaged, keyboard shortcuts, named slots ($setSlot, $getSlot, $dfsWithSlots, DOMSlot/$getDOMSlot), compact JSON export ($withCompactExport, $exportNodeJSON) and the $config serialization schema.

Behavior changes to check before upgrading

Markdown export escaping, reversing v0.53.0's over-escaping

  • A literal bracket is escaped only where it would start a link, image, link reference definition or check-list item, so [1], done [x] and array[0] export as typed again (#9600); < and & likewise, so <3, 1<2 and Tom & survive (#9770). Markdown written by v0.53.0 still imports unchanged.
  • Import and the typing shortcuts now follow CommonMark's Unicode punctuation and whitespace classes (#9430), so **“bar”**baz imports with literal asterisks and See –**[here](url)** imports as a bold link. Export writes character references where a round trip needs them. Check Markdown export snapshots.
  • Format markers stay balanced around a space whose formats differ from the text beside it (#9420), link titles and destinations round-trip (#9464), and @lexical/mdast writes the references cmark-gfm needs (#9983) and only links a bare URL where micromark finds one, as GitHub does (#9990).
  • JSON shape: a code block imported from Markdown now holds a LineBreakNode per line and a TabNode per tab instead of one TextNode with \n (#9911). Read codeNode.getTextContent(), not codeNode.getFirstChild().getTextContent(). States serialized by earlier versions load unchanged.
  • JSON shape: an inline element whose text sits in another element inside it no longer serializes textFormat/textStyle (#9601).

DOM and CSS

  • @lexical/list no longer writes value on every live list item, which made Enter near the top of a long list quadratic in Chromium (#9958). li[value] and attr(value) CSS no longer match, and li.value reads 0 — read ListItemNode.getValue() or export the DOM. Copied and exported HTML still writes value.
  • HTML import keeps the spaces around <strike>, <font>, <small>, <big>, <nobr>, <dfn>, <bdi>, <bdo> and <data>, so pasted is <strike>old</strike> now no longer becomes isoldnow (#9744); isInlineDomNode returns true for them.
  • $generateNodesFromDOM keeps the formatting of a <span> around another <span>, as Word for the web writes every run (#9919). Every tag's forChild now runs for same-tag nesting, so check any importDOM conversion whose forChild is not idempotent.
  • getTextDirection now returns what the browser gives dir="auto" (#9942); text starting with an emoji followed by Hebrew or Arabic is 'rtl', not 'ltr'.

Editor semantics

  • The editor stays active wherever Lexical reads a state from a listener, so $getEditor() works in text-content listeners, undo merging, markdown shortcuts, collaboration, HMR and toJSON() (#9941). editor.read(editorState, fn) is a new overload.
  • An update that throws is discarded even when onError rethrows, so the next update no longer commits its changes and tags (#9509).
  • RangeSelection.insertText keeps text inside an inline element that accepts it at its edge, as before v0.49.0 (#9863); return false from canInsertTextBefore/After to keep it outside.
  • With NodeStructureExtension, a class declaring children: 'block' is a block container: $insertList, $wrapNodes, insertNodes, insertParagraph, $insertNodeToNearestRoot and the Markdown block shortcuts stop at it instead of replacing or splitting it (#9590).
  • registerLexicalTextEntity keeps the NodeState of an entity that stops matching, and no longer loops forever when typing splits text between two differently formatted nodes (#9713).

Notable fixes

Tables — a ragged table no longer throws on selection, delete, copy or paste (#9749); a cell whose row span reaches past the last row is selectable (#9781); deleting a row keeps a merged cell changed earlier in the same update (#9851); plain text pasted into a right-to-left or upward selection starts at its top-left cell (#9774); a cell styled bold no longer strips the bold of <strong> inside it (#9916).

Large documents — $generateNodesFromDOM (#9957), Enter and $splitNode in a block of 130,000 children (#9883) and migrateYState (#9880) no longer throw RangeError: Maximum call stack size exceeded.

Reconciler — no DOMSlot.insertChild: before is not in element when a new element takes in the node it was created in front of (#9757); a node removed while its parent's DOM is rebuilt leaves the DOM map and gets destroyed (#9773); a slot value moved out of its slot no longer strips the DOM of the element it moved into (#9778).

Links, marks, code, input — $toggleLink(url) inside an autolink makes it a real link instead of losing the URL on the next edit (#9822); MarkStateExtension keeps comment ids across block-type and list changes (#9503) and through IME composition over a selection (#9540); the code highlighter keeps NodeState on re-tokenization (#9832, #9855, #9862); Enter in a code block keeps a plain line's indentation (#9923); on iOS, Return after a #+= symbol starts a paragraph (#9745); typing after a selected block decorator works in Firefox and WebKit (#9845).

@lexical/yjs — collaboration v2 no longer misplaces content or fails with "Lexical node does not exist" when a block or text equals another (#9584); the yjs peer dependency is optional, so @lexical/react without LexicalCollaborationPlugin no longer pulls it in (#9931).

Performance

A commit no longer computes the whole document's text with no text-content listener registered (#9548); reconciling a decorator host with named slots no longer forces a synchronous style recalculation in Chrome (#9743); strict Markdown export is much faster on long paragraphs (#9988); bundles drop unused mark flavors (#9496).


What's Changed

  • v0.53.0 by @zurfyx in #9480
  • [lexical-website] Documentation Update: Backfill breaking changes, behavior changes and deprecations into CHANGELOG.md for v0.23 to v0.52, add an Upgrading page by @zurfyx in #9359
  • [lexical][lexical-devtools][lexical-extension][lexical-list][lexical-website][lexical-y][lexical-yjs] Feature: @lexical/y, an experimental Yjs 14 collaboration binding by @zurfyx in #9400
  • [lexical-devtools][lexical-website][lexical-y] Feature: Experimental server-side editing API (@lexical/y/headless) by @zurfyx in #9437
  • [lexical-playground] Feature: Collab Y (@lexical/y) mode in the playground, with e2e specs by @zurfyx in #9438
  • [lexical-website][lexical-y] Feature: Store set-valued NodeState one format per member by @zurfyx in #9439
  • [lexical-devtools] Bug Fix: Drop the tabs permission so the Chrome Web Store accepts the extension by @zurfyx in #9500
  • [*] Chore: Point package repository links at meta/lexical after the org rename by @zurfyx in #9498
  • [*] Chore: Point CI, release tooling, docs and links at meta/lexical after the org rename by @zurfyx in #9497
  • [lexical-table][lexical-y] Bug Fix: Don't throw when a table exists before its DOM by @zurfyx in #9501
  • [lexical-markdown] Bug Fix: Don't pad an inline code span made only of spaces by @kevin9327 in #9488
  • [lexical][lexical-text][lexical-y] Feature: Record text entity grows and remakes as moves and retypes for @lexical/y by @zurfyx in #9483
  • [lexical] Bug Fix: Keep the deprecated unchecked node type arguments in the Flow declarations by @potatowagon in #9529
  • [lexical-markdown] Bug Fix: Round-trip link titles and destinations through Markdown by @clean99 in #9464
  • [lexical-mark][lexical-website] Feature: isMarkIDShown filter for MarkStateExtension by @zurfyx in #9489
  • [lexical-code-prism][lexical-code-shiki][lexical-mark][lexical-website][lexical-y] Bug Fix: Keep comment ids and NodeState when a block change moves or re-creates text by @zurfyx in #9503
  • [lexical][lexical-y] Bug Fix: Discard an update that throws when onError rethrows its error by @zurfyx in #9509
  • [lexical-y] Bug Fix: Write a local update made before an unread remote change on the document it was made on by @zurfyx in #9523
  • [lexical-compiler][lexical-mark][lexical-website] Feature: mark flavors, one MarkStateExtension per kind of annotation by @zurfyx in #9496
  • [lexical-y] Bug Fix: Keep a rewrite's unchanged characters next to a word that was a node of its own by @zurfyx in #9522
  • [lexical-website][lexical-y] Bug Fix: Stop a format, comment or link from spreading to the end of the document after an undo or delete races an edit inside it by @zurfyx in #9505
  • [lexical-y][lexical-website] Bug Fix: Keep $initialEditorState out of documents that have content by @zurfyx in #9508
  • [lexical-website][lexical-y] Bug Fix: Write a block reorder as a move of the block Lexical moved by @zurfyx in #9502
  • [lexical-website][lexical-y] Bug Fix: An older client keeps the fields and content it cannot read by @zurfyx in #9504
  • [lexical-website][lexical-y] Bug Fix: Keep the fields an older client does not know in a block it moves by @zurfyx in #9527
  • [lexical-playground][lexical-website][lexical-y] Bug Fix: Hold back remote changes to the line being composed until the composition ends by @zurfyx in #9507
  • [lexical-playground][lexical-website][lexical-y] Feature: Keep a bound editor showing what the document holds, and open documents a newer app version wrote read only by @zurfyx in #9510
  • [lexical][lexical-markdown][lexical-selection] Bug Fix: Keep Markdown export's format markers balanced around formatted whitespace, in linear time by @fixfon in #9420
  • [lexical-y] Bug Fix: Keep the text before the node being composed in a code token split by comment ids by @zurfyx in #9580
  • [lexical-website] Documentation Update: Show agent edits by block id on a server that check their targets and edit text in place by @zurfyx in #9545
  • [lexical-website][lexical-y] Documentation Update: Make the @lexical/y install steps work today, and say what a relay needs by @zurfyx in #9534
  • [lexical-yjs] Bug Fix: Map an equal subtree whole when collaboration v2 writes a local change by @zurfyx in #9584
  • [lexical][lexical-extension][lexical-html][lexical-website][lexical-y] Feature: Block handles, short ids to show blocks to a model by @zurfyx in #9531
  • [lexical-y] Chore: Run the fuzz seeds and composition cases whose known failures no longer happen by @zurfyx in #9574
  • [lexical-mark] Bug Fix: Give text an input method composes over a selection the ids all of the replaced text had by @zurfyx in #9540
  • [lexical-y] Bug Fix: Keep a node Lexical keeps apart what it is when it is written next to a collaborator's node that is undone by @zurfyx in #9578
  • [lexical-y] Bug Fix: Keep the characters next to a paste in a line a transform makes again by @zurfyx in #9585
  • [lexical-y] Bug Fix: Keep a composition going on after the composer's own text when a collaborator's text comes in before it by @zurfyx in #9555
  • [lexical-y] Chore: Cover the schema version gate's remaining paths, and update stale test comments by @zurfyx in #9537
  • [lexical-mdast][lexical-y] Chore: Give slow tests a timeout that holds under parallel load, and measure the follow-up check's cost against a smaller document by @zurfyx in #9576
  • [lexical-y] Documentation Update: Decision register and agent guide for @lexical/y by @zurfyx in #9594
  • [lexical-website][lexical-y] Documentation Update: Say which list conversions are moves, and add an undo race and a join race to the @lexical/y limits by @zurfyx in #9569
  • [lexical-y] Chore: Test contracts over catalogs of node shapes, block id formats and configurations by @zurfyx in #9588
  • [lexical-table][lexical-y] Bug Fix: Pad a table's rows again when an edit removes cells from some of them by @zurfyx in #9539
  • [lexical-y] Refactor: Name the three questions read only answers by @zurfyx in #9541
  • [lexical-website][lexical-y] Bug Fix: Say why and what to do in the messages of warnings that open a document read only by @zurfyx in #9543
  • [lexical] Bug Fix: Compute the document's text on commit only when a text content listener is registered by @zurfyx in #9548
  • [lexical-website] Documentation Update: Say that short pkg.pr.new URLs make npm ls report lexical invalid by @zurfyx in #9551
  • [lexical-y] Refactor: One module answers what a binding's editor sees of Yjs by @zurfyx in #9533
  • [lexical-y] Bug Fix: Declare LAYOUT_VERSION as 2 and export YWarningData in the Flow types by @zurfyx in #9538
  • [lexical-y] Bug Fix: Leave a line without a marker as it is under unrelated edits, and keep a caret on it by @zurfyx in #9544
  • [lexical-website] Documentation Update: Say which collaboration pages are about @lexical/yjs, and point to the @lexical/y equivalents by @zurfyx in #9547
  • [lexical-y] Refactor: One ordered lookup for where an item takes its group's fields by @zurfyx in #9554
  • [lexical-website] Documentation Update: Add the limit of text nodes made again with other text to the @lexical/y docs by @zurfyx in #9556
  • [lexical-y] Refactor: Split BlockIdSettler#$placeUnit by the kind of block it settles by @zurfyx in #9542
  • [lexical-y] Bug Fix: A read-only client keeps reading remote changes after it refuses a local update by @zurfyx in #9552
  • [lexical-y] Bug Fix: A read never drops a node the document still holds by @zurfyx in #9557
  • [lexical-y][lexical-website] Bug Fix: Two clients initializing a nested or emptied root write the initial content once by @zurfyx in #9559
  • [lexical-website] Documentation Update: Warn next to the @lexical/y setup that initial content must match, and show remote cursors and teardown by @zurfyx in #9546
  • [lexical-website][lexical-y] Bug Fix: Keep the common start and end of a line whose text nodes an update makes again with other text by @zurfyx in #9598
  • [lexical-y] Documentation Update: Add five open questions to the decision register and update the comment-spread row by @zurfyx in #9611
  • [lexical-y] Chore: Test that internal writes of node attributes go through Seen by @zurfyx in #9550
  • [lexical][lexical-mark] Bug Fix: Keep the textFormat and textStyle of elements a full reconcile does not change by @zurfyx in #9553
  • [lexical-y] Chore: Add undo run-end, own-run restore end and run-sequence cases, with the ones main fails as expected failures by @zurfyx in #9605
  • [lexical-y] Bug Fix: Keep a caret in an empty line at its start when a collaborator types there by @zurfyx in #9549
  • [lexical-y][lexical-website] Feature: Refuse to run against a Yjs other than the one @lexical/y supports by @zurfyx in #9607
  • [lexical][lexical-extension][lexical-list][lexical-markdown][lexical-mdast][lexical-selection][lexical-utils][lexical-website][lexical-y] Feature: Treat a node that declares children: 'block' as a block container for structural commands under NodeStructureExtension by @zurfyx in #9590
  • [lexical-y] Bug Fix: Keep a range selection when a collaborator's change splits or shortens its text node by @zurfyx in #9535
  • [lexical-mark][lexical-website] Documentation Update: Bring the collaboration docs up to date with merged @lexical/y by @zurfyx in #9536
  • [lexical-y] Chore: Vary the inline content of the paragraphs StructuralCommands acts on by @zurfyx in #9613
  • [lexical-y] Chore: Type SUPPORTED_YJS_VERSION as a string, and keep the playground's @y/y pin in step by @zurfyx in #9615
  • [lexical][lexical-extension][lexical-selection] Bug Fix: Fill an empty declared container in $setBlocksType whichever end of the range is in it by @zurfyx in #9616
  • [lexical-selection][lexical-y] Bug Fix: Keep nested inline elements and OverflowNode in the block $wrapNodes wraps by @zurfyx in #9618
  • [lexical-website][lexical-y] Bug Fix: Keep every unchanged word of a line whose text nodes an update makes again with several words changed by @zurfyx in #9625
  • [lexical-y] Chore: Add the tests of the parked keep-ends pull request, with main's failures as expected failures by @zurfyx in #9631
  • [lexical-y] Chore: Pin #9632 and the follow-up reply loops in regression tests by @zurfyx in #9642
  • [lexical-website][lexical-y] Bug Fix: Place an insertion or a deletion of text set without a caret at a word edge by @zurfyx in #9641
  • [lexical-y] Chore: Add exact restored-extent cases for undoing a value's removal, with the ones main fails as expected failures by @zurfyx in #9640
  • [lexical-markdown] Bug Fix: Escape a literal bracket only where it would start a link by @zurfyx in #9600
  • [lexical-website][lexical-y] Documentation Update: Say what the word edit cap of text made again counts, how repeated words are kept, and drop the 30 ms figure by @zurfyx in #9652
  • [lexical-html] Bug Fix: Keep the id of a list item that only wraps a nested list through an HTML round trip by @zurfyx in #9648
  • [lexical-website][lexical-y] Bug Fix: Place an edit of set text at a word edge when the caret is past it by @zurfyx in #9657
  • [lexical-y] Chore: Time the long remade line tests on the faster of two runs of each length by @zurfyx in #9659
  • [lexical][lexical-clipboard][lexical-website][lexical-y] Bug Fix: Keep a link a collaborator removes removed when another collaborator formats text covering it by @zurfyx in #9601
  • [lexical-selection] Bug Fix: Wrap a block leaf in an element that is not a block container on its own by @zurfyx in #9664
  • [lexical-website][lexical-y] Bug Fix: Keep every unchanged word between two changes of text set with setTextContent by @zurfyx in #9667
  • [lexical-y] Bug Fix: A delete keeps every format item it leaves (D86), and a client keeps its own format items from garbage collection while they are undoable (D88) by @zurfyx in #9679
  • [lexical-y] Chore: Point the known-failure tests at open issues by @zurfyx in #9684
  • [lexical-website][lexical-y] Documentation Update: Record the 10/31 decisions on undo presses, list numbering, overlapping formats, rewritten words and provider ordering by @zurfyx in #9685
  • [lexical-website][lexical-y] Documentation Update: Check an agent's edit on the current state, then apply it there by @zurfyx in #9688
  • [lexical-y] Chore: Pin the open undo-restore cases (#9689, #9690) and record the #9671/#9599 rules' trade (D95) by @zurfyx in #9691
  • [lexical-y] Bug Fix: A run ends in its own container, and no item is linked next to an item of another container by @zurfyx in #9693
  • [lexical-y] Bug Fix: An undo that ends a restored run links its null to the items the store holds by @zurfyx in #9696
  • [lexical-y] Bug Fix: A write recovered from after it failed part way does not repeat what it stored by @zurfyx in #9697
  • [lexical-y][lexical-website] Bug Fix: A binding releases the keeps it set again after a clear when it stops by @zurfyx in #9698
  • [lexical-text][lexical-playground] Bug Fix: Text entity transforms settle between text nodes of other formats by @zurfyx in #9686
  • [lexical-text][lexical-playground] Revert: Text entity transforms settle between text nodes of other formats (#9686) by @zurfyx in #9702
  • [lexical] Bug Fix: Keep the block cursor inside the DOMSlot before boundary by @mangeshraut712 in #9707
  • [lexical-playground] Bug Fix: Share history between the image caption and its parent editor by @mayrang in #9566
  • build(deps): Bump actions/setup-node from 6 to 7 in the github-actions group by @dependabot[bot] in #9709
  • [lexical-y][lexical-website] Bug Fix: Write text holding a lone surrogate like any other text, and never throw on it by @zurfyx in #9714
  • [lexical-website][lexical-y] Documentation Update: Record that a Yjs UndoManager destroyed without a clear keeps what its steps protected (D98) by @zurfyx in #9715
  • [lexical-y][lexical-website] Chore: Follow-ups to the lone surrogate fix and D98 (review items) by @zurfyx in #9718
  • [lexical-y] Bug Fix: A format removal that commits after a collaborator's undo arrived no longer spreads the format past the run by @zurfyx in #9720
  • build(deps): Bump follow-redirects from 1.16.1 to 1.16.2 by @dependabot[bot] in #9711
  • [lexical-text][lexical-playground] Bug Fix: Text entity transforms settle between text nodes of other formats (re-land of #9686) by @zurfyx in #9713
  • [lexical-website][lexical-y] Documentation Update: Record that an undo or redo restoring content inside a container keeps it from garbage collection until reload (D99) by @Monier-Ayman in #9723
  • [lexical-mark] Chore: Keep the isMarkIDShown Flow expectation on one line in every formatter by @zurfyx in #9729
  • [lexical-y][lexical-website] Documentation Update: Scope D99, decide D95, record #9589 and the #9725 text entity limit by @zurfyx in #9727
  • [lexical-markdown] Bug Fix: Follow CommonMark's Unicode punctuation and whitespace for emphasis flanking by @haripetrov-stack in #9430
  • [lexical-y] Bug Fix: The author re-reads adjacent token and segmented text it stores as one run, so its editor matches its document by @zurfyx in #9736
  • [lexical] Perf: Skip rewriting an unchanged contentEditable on slot containers by @emilyhorsman in #9743
  • [lexical-mdast] Bug Fix: Keep a line indented four spaces as text on Enter by @vjeux in #9741
  • [lexical][lexical-html][lexical-website] Bug Fix: Keep the spaces around inline tags such as <strike> and <font> on HTML import by @vjeux in #9744
  • [lexical] Bug Fix: Start a new paragraph on iOS Return after a symbol from the #+= keyboard plane by @vjeux in #9745
  • [lexical-mdast] Feature: Add a horizontal rule shortcut for ---, *** and ___ by @conghuydever in #9484
  • [lexical-mdast][lexical-website] Bug Fix: Give a new table cell the alignment of its column by @conghuydever in #9485
  • [lexical-playground] Bug Fix: A collapsible container's toggle event no longer throws after the container is removed by @zurfyx in #9761
  • [lexical-table] Bug Fix: A table selection in a ragged table no longer throws, and deleting or pasting it keeps the cells it does not hold by @zurfyx in #9749
  • [lexical][lexical-y] Bug Fix: The reconciler places a new element right when its children include a node moved out of the same parent by @zurfyx in #9757
  • [lexical-table] Chore: Give the rectangular table selection sweep a 30 s timeout by @zurfyx in #9769
  • [lexical-y] Bug Fix: A format bit a code highlight ignores no longer splits it in a read, so text typed into it matches a fresh read by @zurfyx in #9768
  • [lexical-mdast] Bug Fix: A block shortcut no longer strips the lines after its marker when the text holds a newline by @zurfyx in #9776
  • [lexical-y] Bug Fix: Keep a remote read's commit from running node transforms when its text merges under the caret by @zurfyx in #9779
  • [lexical-table] Bug Fix: Plain text pasted into a table selection made right to left or upwards starts at its top-left cell by @zurfyx in #9774
  • [lexical] Bug Fix: A node removed while the reconciler builds its parent's DOM anew leaves the DOM map and reports destroyed by @zurfyx in #9773
  • [lexical] Bug Fix: A named slot's value moved out of its slot no longer makes the reconciler remove the DOM of the element it moved into by @zurfyx in #9778
  • [lexical-table] Bug Fix: A table selection on a cell whose row span reaches past the last row no longer throws by @zurfyx in #9781
  • [lexical-website] Documentation Update: Describe type-signature breaks in CHANGELOG.md by the call shapes they break, and add the missing v0.48 list Backspace behavior change by @zurfyx in #9728
  • [lexical-markdown] Bug Fix: Escape a literal < or & only where it would start markup or a character reference by @zurfyx in #9770
  • [lexical-y] Bug Fix: A remote change applied during a local update no longer loses that update's edits by @zurfyx in #9784
  • [lexical-y][lexical-website] Bug Fix: Store an edit an app's code makes in the update of a remote change's read, and run no node transforms there by @zurfyx in #9788
  • [lexical-devtools][lexical-internal][lexical-markdown][lexical-mdast][lexical-react][lexical-table][lexical-website] Breaking change: CJK-friendly punctuation mode for Markdown import and export by @etrepum in #9735
  • [lexical-y] Feature: Layout migrations and the permanent upgrade API: @lexical/y/migrate, frozen steps, @lexical/y/server, a required layoutUpgrade, and the never-drop-a-reader policy by @zurfyx in #9766
  • [lexical-y] Breaking change: Pair each format run's end with its opener (layout 3) by @zurfyx in #9777
  • [lexical-y] Bug Fix: quiesce() called again returns the first call's draft, so a retried handoff keeps unwritten text by @zurfyx in #9792
  • [lexical-y] Bug Fix: Loading a document keeps text it showed after integrating an update across a missing one by @zurfyx in #9804
  • [lexical-y][lexical-website] Documentation Update: Narrow warnings with isYWarning(value, CODE); servers and relays create documents with createYDoc by @zurfyx in #9800
  • [lexical-y][lexical-website] Bug Fix: The load repair holds one pending set, not one per suffix by @zurfyx in #9811
  • [lexical-list] Bug Fix: After a click on a check mark, Space goes to the caret instead of toggling the item back by @vjeux in #9752
  • [lexical] Bug Fix: Keep the caret out of a scroll container's scroll-padding when scrolling it into view by @vjeux in #9753
  • [lexical-y] Bug Fix: A binding started again writes edits inside a container it had read by @zurfyx in #9810
  • [lexical-y] Refactor: Stop walking to the end of the container to tell whether the format pass's fold reaches a line's end by @zurfyx in #9806
  • [*] Documentation Update: Record that a Flow suppression's statement has to stay on one line for the www sync by @potatowagon in #9567
  • [lexical][lexical-y] Bug Fix: Store an edit an app's mutation listener makes once, as the editor shows it by @zurfyx in #9797
  • [lexical-y][lexical-website] Bug Fix: Read back what a local update leaves that the document does not store by @zurfyx in #9790
  • [lexical-y] Bug Fix: One redo restores what an undo removed when reading the undo wrote again by @zurfyx in #9817
  • [lexical-playground][lexical-y] Chore: Rewrite three polynomially backtracking regexes by @zurfyx in #9814
  • [lexical-devtools] Refactor: keep editor state in the page it came from, not in a store every tab shares by @potatowagon in #9824
  • [lexical-y] Bug Fix: The recovery of a failed write keeps a collaborator's character the update merged into its neighbour by @zurfyx in #9819
  • [lexical-y][lexical-website] Bug Fix: An app's move in a remote change's read keeps a collaborator's characters in the lines it passed by @zurfyx in #9827
  • [lexical-list] Bug Fix: A swipe that starts on a check mark no longer toggles the item by @vjeux in #9754
  • [lexical-y][lexical-website] Bug Fix: Never show less, or other view state, than a plain load or the maximal repair when loading by @zurfyx in #9818
  • [lexical-y] Bug Fix: Split items at what writes deleted again, so an edit beside an unread overlapping delete is stored where the editor shows it by @zurfyx in #9826
  • [lexical-website] Documentation Update: Seal a room before reseeding it, and hand off what clients still hold instead of dropping it by @zurfyx in #9831
  • [lexical-y][lexical-website] Bug Fix: Keep a new text node's explicit format when a collaborator's format change to the text composed in is held by @zurfyx in #9815
  • [lexical-website] Chore: Assign new production error codes only when asked to by @zurfyx in #9838
  • [lexical-website][lexical-y] Documentation Update: Old layouts may stop being read while @lexical/y is experimental by @zurfyx in #9839
  • [lexical-y] Chore: Nightly randomized lanes for the composition hold, checked on one tree by @zurfyx in #9844
  • [lexical-link] Bug Fix: $toggleLink inside an autolink makes it a link with the URL set by @zurfyx in #9822
  • [lexical-list] Bug Fix: A list item outside a check list loses a checked value once an update edits it by @zurfyx in #9823
  • [lexical-y] Bug Fix: Detect a @y/y that fixes the loader's encoding problem instead of refusing it by @zurfyx in #9842
  • [lexical][lexical-list][lexical-react][lexical-utils][lexical-yjs] Chore: Name function type parameters in Flow declarations by @SamChou19815 in #9841
  • [lexical-y][lexical-website] Bug Fix: A code highlighter's re-tokenization of a held code line is not written onto the block a collaborator made of it by @zurfyx in #9835
  • [lexical-y] Bug Fix: Store text written beside an inline element the editor does not show where the editor shows it by @zurfyx in #9852
  • [lexical-y] Chore: Pin deletes beside a left-out inline element, check its line's formats, and state main's defects in D116 by @zurfyx in #9853
  • [lexical-y][lexical-website] Chore: Guard the self-check's format comparison beside left-out elements; record the in-flight comment delete as an accepted limit by @zurfyx in #9854
  • [lexical-code-core][lexical-code-prism][lexical-code-shiki][lexical-y][lexical-website] Bug Fix: The code highlighter keeps the NodeState of text inside a code block when it tokenizes the block again by @zurfyx in #9832
  • [lexical][lexical-clipboard][lexical-code-prism][lexical-extension][lexical-html][lexical-selection][lexical-table][lexical-utils] Chore: Label dictionary keys in Flow declarations by @SamChou19815 in #9843
  • [lexical-code-core][lexical-code-prism][lexical-code-shiki] Bug Fix: A tab or line break in a code block keeps its NodeState when the block is tokenized again by @zurfyx in #9855
  • [lexical-y] Chore: Re-measure the randomized lanes' known-open rates on main by @zurfyx in #9859
  • [lexical-y] Bug Fix: A read recovered while a composition is held releases the format items the hold kept by @zurfyx in #9861
  • [lexical-code-core][lexical-code-prism][lexical-code-shiki] Bug Fix: The code highlighter writes an app tokenizer's token over an old token it adds to by @zurfyx in #9862
  • [lexical-markdown] Bug Fix: The markdown shortcuts look up the text node again when their update runs by @zurfyx in #9868
  • [lexical-y] Bug Fix: Keep a line marker with the line that continues the line it ended by @zurfyx in #9860
  • [lexical-code-prism] Chore: read the Prism core through its module namespace by @nbozidarevic in #9858
  • [lexical-rich-text] Bug Fix: Text typed after selecting a horizontal rule no longer jumps to the top of the document by @Electro-Jam in #9845
  • [lexical-y] Bug Fix: A read that runs before a remote change is read parses its lines as it reads them, so a collaborator's removal of a line being composed in holds by @zurfyx in #9872
  • [lexical-y] Bug Fix: The node being composed stays with its own line where a collaborator replaces that line and inserts another after it by @zurfyx in #9873
  • [lexical-code-prism] Bug Fix: Load the Prism core with a side-effect import again (revert #9858) by @zurfyx in #9877
  • [lexical-rich-text] Bug Fix: Text typed on a selected block decorator starts a paragraph of its own after it, instead of joining the block after it by @zurfyx in #9876
  • [lexical] Bug Fix: insertText respects canInsertTextBefore/After of inline parents by @james-atticus in #9863
  • [lexical-y] Bug Fix: Migrate a container of any size without a RangeError, and keep the error a step threw as its cause by @emilyhorsman in #9880
  • [lexical-table] Bug Fix: The plain text of a table selection holds the text of a nested table once by @sahiee-dev in #9869
  • [lexical-table] Bug Fix: Deleting a row no longer drops a merged cell changed earlier in the same update by @vishalhabib99 in #9851
  • [lexical-a11y][lexical-website] Bug Fix: FocusTrap passes over descendants that can't take focus by @mayrang in #9782
  • [lexical][lexical-y] Bug Fix: Blocks and containers past a call's argument limit: no content spread into a call, and a main-thread size gate by @zurfyx in #9883
  • [lexical-y] Refactor: One shown-items filter for the reader, the writer and the cursor by @zurfyx in #9887
  • [lexical-y] Refactor: One owner for Item.keep by @zurfyx in #9888
  • [lexical-y][lexical-website][lexical-devtools] Breaking change: Store NodeState on text as paired runs (layout 4), with the frozen 3to4 step by @zurfyx in #9884
  • [lexical-y][lexical-website] Documentation Update: The edge a redone format gives text typed next to it (D105) by @zurfyx in #9886
  • [lexical-y][lexical-website] Bug Fix: Write what a held line's transforms make in that line, in place, instead of only what agrees with the composer's update by @zurfyx in #9889
  • [lexical-y][lexical-playground][lexical-website] Feature: The binding's setup API from the layout 4 spec (section 11, with 11.8), beside the existing one by @zurfyx in #9891
  • [lexical-y] Documentation Update: The layout 4 changeset's migration path, and a stale comment in Binding by @zurfyx in #9893
  • [lexical-y] Bug Fix: A held line's transforms that move a text node past another, even of equal text, are not written in place by @zurfyx in #9897
  • [lexical-y][lexical-playground][lexical-website] Feature: Local persistence and edits that did not sync (@lexical/y/offline) by @zurfyx in #9899
  • [lexical-y] Bug Fix: No offline write runs while a moved epoch moves the document's rows into its capture by @zurfyx in #9902
  • [lexical-y] Bug Fix: An offline flush() started just before an epoch move resolves only once its edits are stored by @zurfyx in #9903
  • [lexical-y] Refactor: Write a seed once and relabel it to its derived client id by @emilyhorsman in #9909
  • [lexical][lexical-y] Bug Fix: The revert of recorded DOM changes runs no transforms when it joins an update made with skipTransforms, so a collaborator's read no longer pads a table in one editor by @emilyhorsman in #9907
  • [lexical-y] Chore: Test concurrent split, join and typing in every block type the catalog builds by @emilyhorsman in #9905
  • [lexical-markdown][lexical-mdast] Bug Fix: A code block imported from Markdown holds LineBreakNodes and TabNodes, not one TextNode with line feeds by @zurfyx in #9911
  • [lexical-y][lexical-website] Bug Fix: A stored line that a node replacement builds as a class that cannot be stored as a line opens the document read only instead of losing edits silently by @zurfyx in #9912
  • [lexical-rich-text][lexical-markdown][lexical-mdast][lexical-y][lexical-yjs][lexical-playground][lexical-website] Feature: QuoteContainerNode, a quote that holds blocks and is stored as a container (experimental) by @zurfyx in #9913
  • [lexical-y][lexical-playground][lexical-website] Breaking change: replayUnsyncedEdits and recoverYOfflineEdits take a required leftovers and autoReplay, and write the blocks that are not replayed into the document by @zurfyx in #9924
  • [lexical-y] Chore: Keep the load-sensitive tests from failing on a loaded machine by @zurfyx in #9928
  • [lexical-y][lexical-eslint-plugin][lexical-playground][lexical-website] Breaking change: No silent-loss API in @lexical/y (required choices, union results) by @zurfyx in #9925
  • [lexical-playground] Bug Fix: Write data-lexical-datetime as an ISO string and update it when the date changes by @mayrang in #9927
  • [lexical] Bug Fix: Keep the composed word when Bold interrupts an iOS composition by @vjeux in #9917
  • [lexical][lexical-rich-text] Bug Fix: Keep the caret in text the shadow root transform wraps in a paragraph by @vjeux in #9918
  • [lexical-html] Bug Fix: Keep the formats of a around another in $generateNodesFromDOM by @vjeux in #9919
  • [lexical-mdast] Bug Fix: Leave asterisks typed in the middle of a word as text by @vjeux in #9920
  • [lexical-mdast] Bug Fix: Leave a typed init as text instead of a bold word by @vjeux in #9921
  • [lexical-markdown] Chore: Test the utils.ts cases that mutants survived by @mayrang in #9926
  • [lexical-code-core] Bug Fix: Keep a code line's indentation on Enter when the line holds plain text nodes by @vjeux in #9923
  • [lexical-playground] Bug Fix: Keep all-day dates on the same day in every time zone by @mayrang in #9930
  • [lexical-table] Bug Fix: Pasting a styled table cell no longer removes a format its text already has by @0z5a in #9916
  • [lexical-list][lexical-mdast] Bug Fix: Keep GFM task items in bullet and number lists by @conghuydever in #9475
  • [lexical] Bug Fix: Clamp committed selection points when a text node is shrunk by @Rohan-Dedhia in #9793
  • [lexical-playground] Bug Fix: Keep a chip's time when a day is picked by @zurfyx in #9933
  • [lexical-html][examples] Documentation Update: Fix dead lexical.dev doc links by @farisbasha in #9937
  • [lexical-yjs] Bug Fix: Mark the yjs peer optional, as @lexical/react already does by @xiezhenjia-meta in #9931
  • [*] Refactor: Use explicit active editor when reading or serializing an editor state from listeners by @etrepum in #9941
  • [lexical-mdast] Chore: Test the cjkFriendly.ts cases that mutants survived by @mayrang in #9946
  • [lexical][lexical-selection] Bug Fix: A style left open at the end no longer swallows the next $patchStyleText by @mayrang in #9783
  • [lexical-mdast] Bug Fix: Read U+0000 beyond a run as U+FFFD in CJK-friendly export by @mayrang in #9947
  • [lexical-mdast] Bug Fix: Write characters as typed beside GFM syntax punctuation in CJK-friendly export by @mayrang in #9950
  • [lexical-playground] Bug Fix: Paste Google Docs date chips as all-day dates by @mayrang in #9932
  • [lexical][lexical-code] Bug Fix: Make getTextDirection match the browser's dir="auto" by @fantactuka in #9942
  • [lexical][lexical-extension][lexical-yjs][lexical-website] Feature: Add $deepCopy to the public API by @vishisht31 in #9936
  • [lexical-playground] Bug Fix: Target clicked one-character links by @thorn0 in #9881
  • [lexical-mdast] Bug Fix: Keep edits to imported autolink literals by @clean99 in #9669
  • [lexical-html] Documentation Update: fix dead lexical.dev docs links by @farisbasha in #9935
  • [lexical-playground][*] Bug Fix: Build the playground from a checkout whose path needs percent-decoding by @aashish254 in #9415
  • [lexical-mdast] Bug Fix: Escape the dot of www. so the characters after it import as typed by @mayrang in #9956
  • [lexical-playground] Bug Fix: Keep the link URL input's selection when a drag leaves it by @vishisht31 in #9960
  • [lexical-mdast] Bug Fix: Write an autolink literal in resource or autolink form when what is beside it would change how it reads back by @mayrang in #9965
  • [lexical-markdown] Chore: Cover backslash emphasis imports and formatted text round trips by @ZedingZhang in #9414
  • [lexical-website] Documentation Update: Add NodeState application identity example by @mpicken3 in #9174
  • [lexical-react][lexical-playground] Bug Fix: DraggableBlockPlugin drops in the wrong position when the window is scrolled by @vishisht31 in #9959
  • [lexical-react] Bug Fix: Route the time-travel read-only toggle through setEditable by @aashish254 in #9417
  • [lexical-a11y] Bug Fix: Match a roving item by its composed focus target by @aashish254 in #9416
  • [lexical-playground] Bug Fix: recognize spaced and longer thematic breaks by @tarun5004 in #9786
  • [lexical-playground] Bug Fix: Safe clipboard permission query in ContextMenuPlugin by @vishalrajofficial in #9910
  • [lexical-list] Bug Fix: Write li.value only where the browser's count differs, so Enter near the top of a long list is not quadratic by @emilyhorsman in #9958
  • [lexical-mdast] Bug Fix: Keep a symbol-keyed property of export rule output when grouping text by @mayrang in #9972
  • [lexical][lexical-code-core][lexical-eslint-plugin-internal][lexical-y] Chore: Lint against comparing a node's getType() with a constant by @etrepum in #9975
  • [lexical][lexical-html] Bug Fix: Import HTML with more nodes in one block than a call takes as arguments by @mayrang in #9957
  • [lexical] Bug Fix: Scroll a caret in a named slot or another editable island into view by @rinarakaki in #9284
  • [*] Documentation Update: Promote stable experimental APIs by @etrepum in #9980
  • [lexical] Refactor: Give slot relationships their own CommonAncestorAcrossSlotsResult variants by @etrepum in #9982
  • [lexical-mdast] Bug Fix: Join touching strikethrough and write the character references cmark-gfm needs in Markdown export by @mayrang in #9983
  • [lexical-mdast][lexical-website] Bug Fix: Write only the literals from the first one that would read back differently in another form by @mayrang in #9970
  • [lexical-rich-text] Bug Fix: preserve typing after selected block decorators in Firefox and WebKit by @thorn0 in #9904
  • [lexical] Bug Fix: Put the caret back after a collaboration update when it is in a named slot or another editable island by @rinarakaki in #9978
  • [lexical-mdast] Bug Fix: Keep the strict export fast on long paragraphs by @mayrang in #9988
  • [lexical-mdast] Chore: Test the text grouping cases of the mdast export that mutants survived by @mayrang in #9977
  • [lexical-mdast][lexical-website] Bug Fix: Read literal autolinks on import as GitHub comments do by @mayrang in #9990
  • build(deps): bump fast-uri from 3.1.8 to 3.1.9 by @dependabot[bot] in #9993
  • build(deps): bump qs from 6.15.3 to 6.17.1 by @dependabot[bot] in #9994
  • build(deps): bump serialize-javascript from 7.0.7 to 7.1.4 by @dependabot[bot] in #9995
  • build(deps): bump dompurify from 3.4.16 to 3.5.0 by @dependabot[bot] in #9997
  • [lexical-playground] Chore: Pick a day that has a button in the date picker tests by @mayrang in #10001

New Contributors

Full Changelog: v0.53.0...v0.54.0

Don't miss a new lexical release

NewReleases is sending notifications on new releases.