typograph-editor-documentation
    Preparing search index...

    Class EditorUI

    Index
    • Apply content-bar tab config. Called on init and whenever apply() fires.

      Returns void

    • Apply config for data-pb-component wrappers inside a parameter-bar panel.

      Parameters

      • prefix: string

        Key prefix, e.g. 'parameterbar.position_size' or 'parameterbar.page.bleed'

      • root: Document | HTMLElement = document

        Root element to search inside (defaults to document)

      Returns void

    • Apply toolbar config after every set_active_object() rebuild.

      Parameters

      • container: HTMLElement

        The #tools HTMLElement

      Returns void

    • Re-apply config to all currently-live DOM (content bar + registered pb panels). Toolbar is re-applied automatically on every set_active_object() rebuild.

      Returns void

    • Parameters

      • fn: () => void

      Returns void

    • Whether pins are on screen right now, mode included — not the raw toggle.

      Returns boolean

    • Why editing is withheld: someone else edits or the latest version loads ('others'), this window's token only lets the person view ('view_only'), or the room seats as many people as it may and this window waits for a seat ('room_full', TYP-1605). Meaningful while get_editing_held().

      Returns editing_hold_reason

    • The uuids currently hidden, sorted.

      Returns string[]

    • The language the editor shows its texts in: 'en' (the default) or 'nl'. Chosen by the host before the editor loads, with the Editor's locale option or data-typograph-locale on

      (TYP-1287); see Embedding.md.

      Returns "en" | "nl"

    • How many people the full room seats, while held for 'room_full'; null when unknown.

      Returns number

    • Parameters

      • key: string
      • Optionaloptions: HideOptions

      Returns this

    • Hide swatches from every swatch palette and picker, by uuid (TYP-820). The swatches stay in the document: an element that already uses one keeps it, draws and prints with it. A setting of this editor session — nothing is saved. Unknown uuids are kept and simply match nothing, so a host may hide a swatch before the document that has it is opened. Takes effect the next time a palette opens.

      Parameters

      • uuids: string[]

      Returns this

    • Withhold editing while someone else edits the same template (TYP-918). Edits are not combined yet, so two people editing at once would overwrite each other's work: whoever started first keeps the pen, and everyone else may comment (when the host offers it) or look. Releasing it puts the user back in the mode they were in, unless they picked another one while it was held.

      The collaboration module drives this; a host only reads it, through get_editing_held() and typograph_mode_changed.

      Parameters

      Returns this

    • Parameters

      • key: string

      Returns boolean

    • Parameters

      • key: string

      Returns boolean

    • Re-read the host's comments, for when the host knows something changed elsewhere.

      Returns this

    • Register the live root element for a parameter-bar panel so that hide()/show()/disable()/enable() calls update it immediately. Call this every time the panel rebuilds its DOM.

      Parameters

      • prefix: string
      • root: HTMLElement
      • slot: string = ''

        A second root under the same prefix — e.g. the title card, which holds parameterbar.position_size.name outside the Position & size block.

      Returns void

    • False when the host said it will draw the mode control itself.

      Returns boolean

    • Open a thread by id, for a host landing a reader on the comment a notification named.

      Parameters

      • id: string

      Returns this

    • Which modes this host offers. Defaults to ['editing'], so an embedder that knows nothing about commenting sees no switcher and no change in behaviour.

      A commenter is given ['commenting'] alone and a read-only reader ['viewing']: the switcher then renders as a locked label rather than a menu, which is what tells them on screen why the tools are inert.

      Parameters

      • modes: editor_mode[]
      • options: { render?: boolean } = {}

      Returns this

    • Show the pins while editing. Ignored in the other modes: commenting always draws them — it is the mode for placing them — and viewing never does.

      Parameters

      • visible: boolean

      Returns this

    • Register the host's comment backend. The widget never fetches anything itself: it holds no URL and no token, and that is deliberate (see CLAUDE.md, TYP-583).

      Parameters

      • source: comment_source

      Returns this

    • Open or close the thread rail. It starts closed: pins are the ambient signal that a page carries feedback, and 320px of canvas is too much to spend before anyone asks for it.

      Parameters

      • open: boolean

      Returns this

    • Who is looking. Decides which comments offer edit and delete.

      Parameters

      • user: comment_user

      Returns this

    • Set the keyword list available for insertion via Cmd+K in rich text mode. REPLACES the entire existing list (including the CAM/Spronk defaults) — it does not merge. Keywords are sorted alphabetically. Pass [] to disable the popup.

      Parameters

      • keywords: string[]

      Returns this

    • Commenting and viewing mute canvas interaction through the switch TYP-597 added, and hide the authoring controls through the same keys a host would use. Neither is a new enforcement mechanism, and neither is a security boundary — the host still enforces permission server-side.

      Parameters

      • mode: editor_mode

      Returns this

    • Controls how the Save command serialises spreads: 'spreads' (default, as authored) or 'single_pages' (each spread split into single pages). Does not mutate the document — only the serialised output is affected.

      Parameters

      Returns this

    • Light (default) or dark chrome, or 'system' to follow the OS. Writes data-typograph-theme on , which switches the stylesheet's tokens; dialogs and popups mount outside the editor, so the switch has to sit on the root. Only the chrome changes: the document and its colours never do.

      Parameters

      Returns this

    • Offer swatches hidden with hide_swatches() again.

      Parameters

      • uuids: string[]

      Returns this