@lexical/mark
This package contains helpers and nodes for wrapping content in marks for Lexical.
It offers two ways to mark text, such as the ranges comments are on:
MarkStateExtension(experimental) stores mark ids as NodeState on the text itself, with no wrapper node:$addMarkID,$removeMarkID,$getMarkIDsAtSelectionand$getNodeMarkIDs. ItsisMarkIDShownoption chooses which ids are rendered (to hide resolved threads, for example), andregisterMarkIDsListenerreports the ids that appear in or disappear from the document.defineMarkExtensionmakes one such extension per kind of annotation (comments, suggestions, highlights), each on its own NodeState key: a mark flavor, which the$functions take as an optional first argument. Prefer it in collaborative editors: with@lexical/y, concurrent changes to different ids on the same text merge.MarkNodewraps the marked text in an element node ($wrapSelectionInMarkNode,$unwrapMarkNode,$getMarkIDs).
See Comments and Annotations
for usage, moving from MarkNode, resolving comments and limits.