type, its request req, and its response res.value. A dash means none.
Camera
fly-to-rect’s zoom is the maximum zoom; the camera fits the rect. get-viewport-rect returns the visible canvas area in canvas coordinates.
Scene: elements
- When updating,
metais merged into the element’s existing meta; every other property is set as given. SeeUpdateableProperties. query-combined-rectreturns the union of the elements’ bounding rects, ornullwhen none of the ids exist.- The properties you pass to
get-drawdy-elementsandquery-rectselect which fields come back on eachSubscribedDrawdyElement.
Scene: preview elements
Preview elements are ephemeral: they render but are not committed to the scene.Scene: preview transforms
A separate lifecycle for animating existing elements without touching undo history or collaboration until you commit.begin-preview snapshots each element’s rest geometry and moves it onto the animation layer; preview-transforms bakes per-tick deltas from that rest pose into real local geometry silently (nothing syncs, enters undo, or echoes as a scene event — but hit-testing and selection follow); end-preview restores non-committed elements, optionally baking final deltas as one undo step and one sync.
beganis the subset of ids that entered preview. Grouped elements are rejected — their rotation pivot is the group center.- In
end-preview, elements listed incommitsare baked as one undo step; elements absent are restored.dRotationis radians about the element’s bounding-box center.
PreviewTransform.
Scene: text editing
update-text-edit replaces the text of the active text edit in place, keeping the editor open so the user can keep typing. updated is false when no text edit is in progress.
Tools
ToolId, StyleableToolId, and ToolStyleState.
Context menus
subscription:context-menu:clicked to know when a menu item is chosen.
DOM
Drawdy exposes a handful of host-DOM primitives for buttons, floating panels, and window geometry.create-action-buttoncurrently acceptssvgonly; other formats may come later.create-floating-element’spositionis a fixed position in the DOM. WhenbarrierDismissibleis true, clicking outside dismisses it (same effect asdom:remove-element); the driver is not notified — polldom:element-rectif you need to know. Defaults to false.enter-fullscreenreturnsentered: falsewhen the browser refused or doesn’t support it;exit-fullscreenreturnsexited: falsewhen the document wasn’t fullscreen.
Webviews
A webview is an isolated HTML document Drawdy hosts for you. Two-way messaging goes through the webview API.- When
keepStateWhenClosedis true, closing the webview only hides it — it stays active and dies with the tab, at the cost of resources. Prefer stateless webviews. post-messagereturnsposted: falsewhen the webview doesn’t exist or isn’t connected yet.- Receive messages from the webview by subscribing to
subscription:webview:message.
Storage
Two key/value stores scoped to your driver.kv-storage is plain; secure-storage is for secrets.
History
Subscription management
subscriptionId you received when you set the subscription up. See Subscriptions.