@lexical/extension/NodeStructureExtension
Interfaces
NodeStructureConfig
Defined in: packages/lexical-extension/src/NodeStructureExtension.ts:22
Properties
disabled
disabled:
boolean
Defined in: packages/lexical-extension/src/NodeStructureExtension.ts:23
Variables
NodeStructureExtension
constNodeStructureExtension:LexicalExtension<NodeStructureConfig,"@lexical/NodeStructure",NamedSignalsOutput<NodeStructureConfig>,unknown>
Defined in: packages/lexical-extension/src/NodeStructureExtension.ts:74
Experimental
node-structure
Enforces the structure node classes declare in $config(): children
(a block lifted out of a node that holds inline content, inline content
wrapped in a paragraph in a node that holds blocks, a disallowed child
wrapped in the first listed class) and mergeAdjacent (equal adjacent
siblings merged). It runs as a transform on every dirty element of a
class that declares either, in the same update, and only moves content.
Opt-in: without it, the declarations change nothing at runtime.
Collaboration bindings that derive storage from the declarations
(@lexical/y) depend on it, so that every peer holds the same
normalized tree.
Functions
registerNodeStructure()
registerNodeStructure(
editor): () =>void
Defined in: packages/lexical-extension/src/NodeStructureExtension.ts:38
Experimental
node-structure
Registers the normalization NodeStructureExtension runs, as a
transform on every registered element class that declares children or
mergeAdjacent. Idempotent (one shared transform per class). For code
that builds an editor without extensions, such as a collaboration binding.
Parameters
editor
Returns
A function that removes the transforms it added
() => void