Skip to main content

Function: fromPuckData()

fromPuckData(data, prior, mintId?, blockSlots?): DocumentVersion

Defined in: fromPuckData.ts:15

A Nubbin draft rebuilt from Puck's Data: content becomes roots in order, every nested component is flattened back into elements, and slot-typed props become Node.slots id arrays. Identity fields carry over from prior — this is the same edit setNodeProp or addNode would have made, so it bumps nothing. mintId names ids for nodes Puck created; the default mints the way addNode's callers do, since core deliberately ships no generator of its own. blockSlots — each block's declared slot names, from toSlotNamesByBlock — makes slot detection schema-driven; without it the structural reading stands. A Data whose legacy zones holds content is refused outright.

Parameters​

data​

PuckData

prior​

DocumentVersion

mintId?​

() => string

blockSlots?​

Record<string, readonly string[]>

Returns​

DocumentVersion