Member Junction
    Preparing search index...

    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:

    • One deadline per call, measured from enqueue. Queue wait, mount, the ready handshake and the operation all count, so a call never outlives WHITEBOARD_WIDGET_DEADLINES_MS for its op.
    • Per-widget serialization. Commands to one widget run one at a time, in order; different widgets run in parallel.
    • Generations. A widget's document can reload in place (a new srcdoc keeps 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.
    • Missed-ready recovery. A mounted frame that never reported ready gets one hello.
    • Agent window. While an agent command runs, and for WHITEBOARD_WIDGET_AGENT_WINDOW_MS after, IsAgentWindowOpen is true; the board uses it as the host-side gate on agent tags the frame reports.
    Index

    Constructors

    Methods

    • 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.

      Returns void

    • 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.

      Parameters

      • itemId: string

      Returns boolean

    • True when the widget's helper has reported ready and nothing has invalidated it since.

      Parameters

      • itemId: string

      Returns boolean

    • The item's HTML is being replaced; its document will reload.

      Parameters

      • itemId: string

      Returns void

    • 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.

      Parameters

      Returns boolean

    • The frame for itemId was removed from the DOM.

      Parameters

      • itemId: string

      Returns void