Skip to content

API reference / @docmentis/udoc-editor

@docmentis/udoc-editor ​

Embeddable document editor with rich editing and real-time collaboration for the web.

Also exports everything in Common.

Classes ​

ClassDescription
UDocEditorThe document editor — construct it with UDocEditor.create and drive it with open / close / destroy.

Interfaces ​

InterfaceDescription
MessagesEvery string the editor's chrome shows, by key: udoc-ui's, and the ones edit mode adds — the shape of the translations option. As in udoc-ui's, a {name} in a string is a value the editor fills in.
PageActionsCallbacksThe page-structure verbs the per-page pill dispatches.
PageInsertsOptionsOptions for the insert-between-pages affordance.
PageSizeInfoA page's current size and orientation, as the "more" button hands it to the settings dialog. width/height are the page's media-box size in document points (rotation-independent — the intrinsic page rectangle); rotation is the display rotation in quarter turns clockwise (0–3).
UDocEditorEventsThe editor's event map: the common events, and edit mode's. Subscribe with UDocEditor.on.
UDocEditorOptionsOptions for UDocEditor.create: the common ones, and edit mode's. Every field is optional; each says its default.

Type Aliases ​

Type AliasDescription
EditorModeThe editor's top-level mode — what the user is doing to the document. Mode scopes which commands the toolbar offers and how the pointer behaves; it is usually fixed by the host before the editor is shown.
I18nThe editor's words: udoc-ui's I18n over Messages.
MessageKeyA key into Messages.

Functions ​

FunctionDescription
createI18nThe I18n for locale — the browser's language when absent — with translations replacing the pack's strings key by key.
pageActionsThe per-page control rail (udoc:page-actions): a vertical column — move up, move down, rotate, more, delete — beside each visible page's right edge, top-aligned with the page. "More" opens the shared page-settings dialog (size + rotation). Constant CSS size — pair with px page spacing, whose screen-fixed side padding gives the rail room at every zoom.
pageInsertsThe insert affordance (udoc:page-insert): an invisible strip filling each inter-page gap (plus above the first and below the last page) that reveals a divider line and a centered "+" button on hover. The strip at index i inserts before page i, dissolving the before/after question spatially.