Update Frame Children
update_frame_childrenSet the full list of elements a frame owns (shapes, connectors, notes, text) while optionally resizing the frame to fit its new contents; returns unresolved ids.
Instructions
Replace a frame block's contents wholesale. Accepts ids of surface elements (shapes/connectors/groups) AND edgeless blocks (notes/frames/edgeless-text) — all go into BlockSuite's prop:childElementIds map, matching what the editor writes when you drag members into a frame. Dragging the frame drags every owned member. Ids that don't resolve come back under 'missing'. By default the frame is resized to fit its new contents (plus padding + title band); set resizeToFit=false to leave xywh untouched. Pass [] to clear ownership (resize is skipped in that case).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| docId | Yes | Document ID | |
| blockId | Yes | Frame block id (flavour affine:frame). | |
| padding | No | Padding (px) used when resizeToFit is true (default 40). Ignored when resizeToFit=false. | |
| resizeToFit | No | If true (default), recompute xywh from the union of resolvable child bounds + padding + title band. Set to false to preserve the frame's current box (useful when you want ownership-only edits or manual positioning). | |
| workspaceId | No | Workspace ID (optional if default set) | |
| childElementIds | Yes | Full list of ids the frame should own/contain. Replaces any existing ownership. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xywh | No | ||
| blockId | No | ||
| flavour | No | ||
| missing | No | ||
| resized | No | ||
| updated | No | ||
| ownedIds | No |