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
| Class | Description |
|---|---|
| UDocEditor | The document editor — construct it with UDocEditor.create and drive it with open / close / destroy. |
Interfaces
| Interface | Description |
|---|---|
| Messages | Every 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. |
| PageActionsCallbacks | The page-structure verbs the per-page pill dispatches. |
| PageInsertsOptions | Options for the insert-between-pages affordance. |
| PageSizeInfo | A 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). |
| UDocEditorEvents | The editor's event map: the common events, and edit mode's. Subscribe with UDocEditor.on. |
| UDocEditorOptions | Options for UDocEditor.create: the common ones, and edit mode's. Every field is optional; each says its default. |
Type Aliases
| Type Alias | Description |
|---|---|
| EditorMode | The 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. |
| I18n | The editor's words: udoc-ui's I18n over Messages. |
| MessageKey | A key into Messages. |
Functions
| Function | Description |
|---|---|
| createI18n | The I18n for locale — the browser's language when absent — with translations replacing the pack's strings key by key. |
| pageActions | The 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. |
| pageInserts | The 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. |