Skip to content

resolveContainerAt

resolveContainerAt(containers, value, path): RegisteredContainer | RegisteredLeaf | undefined

Defined in: packages/editor/src/schema/resolve-container-at.ts:37

Walk the editor value following path and return the RegisteredContainer or RegisteredLeaf that applies at path’s target position.

Resolution rules at each step:

  1. Positional override. If the current parent declares the child’s _type in its of, the positional entry wins. Used to resolve same-_type registered under different parents with different field values.

  2. Global fallback. If the parent has no positional override, fall back to the top-level entry for _type in containers.

  3. Chain validity. If any ancestor along the path has no resolved container entry (unregistered or not reachable as a container at its position), return undefined.

Returns undefined when the target’s _type is not registered at this position. Returns a RegisteredLeaf when the target resolves to a leaf in a positional of (terminal node with no editable children).

Containers

readonly Node[]

Path

RegisteredContainer | RegisteredLeaf | undefined