Parse with canvasDocumentCodec and surface its actionable error instead of falling back to an internal product format.
Verify schema pixxl.canvas.document, version 1, at least one page, unique IDs, finite numeric fields, and JSON-serializable payloads.
Resolve page, element, connector, group/frame, image, data-source, selection, and active-element references.
Treat CanvasPage x/y as workspace coordinates and CanvasElement transform as page-local.
Do not add page position to an element before storing it; convert only at workspace/render boundaries.
Keep connector points page-local and anchor coordinates local to the referenced element.
Verify active page, viewport transform, and fit bounds are derived from the same document snapshot.
Use the controller for the element kind it owns; product controllers intentionally reject foreign edits and cross-product commands.
Do not remove a page containing foreign elements through one product controller.
Use Canvas Studio or an application-level coordinator when one operation spans multiple product engines.
Read canUndo/canRedo from the controller that executes history; remove any second UI history ledger.
Wrap one semantic user action in one outer transaction and do not run history control inside it.
After setDocument, expect history reset unless the call explicitly records the change.
Subscribe once, query current controller state after events, unsubscribe, and destroy on teardown.
Import @pixxl-tools/canvas/styles.css once in the host.
Give the canvas/workspace host a non-zero width and height before fitting content.
Pass controlled transform plus onTransformChange together.
Keep @pixxl-tools/canvas/react in browser/client surfaces; use root core APIs in React-free code.
Register the product renderer for every recognized element kind and preserve unknown namespaced elements even when not rendered.
Resolve referenced resources before final paint and invalidate caches when their source changes.
Profile representative fixtures before changing history, document shape, or React ownership.