@mocanvas/editor · interface

TLUiOverrideHelpers

interface TLUiOverrideHelpers

Editor-side helpers handed to an override callback, so it can build items that do the things the default chrome does without reaching for the DOM.

SEMANTICS-ASSUMED: the consumer's overrides never read this argument (both of its override functions take it and ignore it), so its exact membership is not pinned by any call site. It is kept to the two things an item genuinely cannot do for itself — resolve a UI string, and run the editor's own file picker — rather than guessed at more widely.


Methods · 2

insertMedia(): void

Open the editor's file picker and put the chosen files onto the current page. Uses the editor's own container document, so it works in an iframe or a popped-out window.

msg(id: string): string

Resolve a UI string id to its display text, through TLUiOverrides.translations for the editor's current locale. An id with no entry passes through unchanged, so a localized literal is always safe to use as a label.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.