typograph-editor-documentation
    Preparing search index...

    Class ToolbarPopup

    Icon-only toolbar trigger that opens an anchored flyout panel of grouped controls. The panel is populated by a caller-supplied build() callback and, on open, its data-pb-component children are run through the EditorUI config (gEditorUI._apply_pb_components) so the host can hide/disable individual controls under keys like ${key}.${component}.

    Only one ToolbarPopup is open at a time. Closes on outside mousedown / Escape. Modeled on the anchoring used by SwatchPanel (src/swatchpanel.ts) and the dismiss behaviour of the library's SpellSuggestionPopup.

    Index
    • Parameters

      • key: string

        EditorUI key prefix for the palette, e.g. 'toolbar.stroke'.

      • trigger: HTMLElement

        The toolbar icon element the panel anchors to.

      • build: (panel: HTMLElement) => void

        Populates the panel; rows should set dataset.pbComponent.

      Returns ToolbarPopup

    • Register a callback fired with the open/closed state (for trigger icon swap).

      Parameters

      • cb: (open: boolean) => void

      Returns void

    • Close whichever palette is currently open (if any).

      Returns void