ReplaceBlock Op
The operation that sets the full state of one block, its id, type, text, link, annotations and attributes, where the newest replacement by op id wins.

Extends · closed

Generic over ⟨Block⟩ (default ). A type parameter that threads through the schema; bind it with args.
type
Operation tag, always `ReplaceBlock`.
ReplaceBlock
block
The complete new state of the block, with attributes inlined at the top level.
⟨Block⟩

ReplaceBlock is the only way content gets into a document. It carries a whole block, never a diff. The daemon keeps a register per block id, and the newest ReplaceBlock by op id is the block's state.

This page defines the change/op/replace-block operation inside a Change body. Its formal schema is attached as the schemaDefinition in this document's metadata, so the app can show it.

block is a block map: id, type, optional text, link and annotations. Any other keys are the block's attributes, inlined at the top level. Older encodings with a nested attributes map are still accepted. A block that is replaced but never positioned by MoveBlocks is a detached block. It is kept, returned by the API, and rendered by the apps outside the main tree, which is how custom navigation is stored. The API reports each block's revision, the CID of the Change whose ReplaceBlock currently defines it. The operation is generic over the block type, so a schema can pin a stricter block model. See Blocks for what goes inside a block.

See also

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime