Fail everything pending and stop accepting work. Call from the board's ngOnDestroy.
Every live command settles now with widget_unmounted: posted ones through their
pending entry, ones waiting for ready when they are woken here, queued ones as they
reach the front of their (now fast-draining) queue.
The actions a widget currently offers (empty when unknown or not ready).
True while an agent command for this widget is running, or ended within the agent
window. The board accepts a frame's agent tag only while this holds.
True when the widget's helper has reported ready and nothing has invalidated it since.
A validated actions message arrived. Reported to the host only when the list changed.
The item's HTML is being replaced; its document will reload.
A frame for itemId was rendered (or replaced by a new frame).
A validated ready message arrived from target.
A validated reply arrived from target. Returns whether it matched a pending command
(same window, pending id, current generation); anything else is ignored.
A validated state message arrived. Accepted only after the widget's restore was
delivered, so a widget that writes defaults at load can't clobber saved state. When the
message names its document (documentToken), it must be the widget's CURRENT document:
a save from a document that has since reloaded (or is reloading) is dropped. Returns
whether it was accepted.
OptionaldocumentToken: stringThe frame for itemId was removed from the DOM.
Run one command against a widget. Always resolves (never rejects): either the widget's result or a failure with a WhiteboardWidgetErrorCode and a message the model can act on.
LIVE WHITEBOARD — the host-side REQUEST/REPLY broker for sandboxed HTML widgets.
Angular-free. The board component feeds it what it observes (frames mounting and unmounting, validated ready / actions / state / reply messages, content reloads) and supplies a WhiteboardWidgetBrokerHost for the few things only the board can do (mount or reveal an item). Callers ask for work with WhiteboardWidgetBroker.Send and always get an outcome back, never an exception.
Guarantees:
srcdockeeps the same window object), so every ready carries a per-document token. A new token, a content reload or an unmount fails the in-flight command with a specific code, and a reply is only accepted from the window it was sent to, for its pending id, in the generation it was sent in.hello.agenttags the frame reports.