EmbeddableMarkdownEditorComponentConstructorParams
The parameters of the EmbeddableMarkdownEditorComponent constructor.
Import:
import type { EmbeddableMarkdownEditorComponentConstructorParams } from '@mnaoumov/obsidian-lib/components/embeddable-markdown-editor-component';Signature:
export interface EmbeddableMarkdownEditorComponentConstructorParamsProperties
| Property | Type | Description |
|---|---|---|
| app | App | The Obsidian app instance. |
| cls? | string | A CSS class added to the editor element. |
| containerEl | HTMLElement | The element the editor is mounted in. The editor appends its own element to it and removes only that element when it unloads. |
| cursorLocation? | EmbeddableMarkdownEditorComponentSelection | The initial selection, as document offsets. The cursor starts at the beginning of the document otherwise. |
| onBlur? | (component: EmbeddableMarkdownEditorComponent) => void | Called when the editor loses focus, while the component is still loaded. |
| onChange? | (update: ViewUpdate, component: EmbeddableMarkdownEditorComponent) => void | Called after every change to the document. |
| onEnter? | (params: EmbeddableMarkdownEditorComponentEnterParams) => boolean | Called on Enter, Shift+Enter, Mod+Enter and Mod+Shift+Enter.When given, Mod+Enter no longer runs the Obsidian hotkey bound to it (by default, opening the link under the cursor in a new tab) while the editor has the focus, so a form can use it to submit. |
| onEscape? | (component: EmbeddableMarkdownEditorComponent) => void | Called on Escape. When given, the key goes no further. |
| onPaste? | ($event: ClipboardEvent, component: EmbeddableMarkdownEditorComponent) => void | Called on a paste into the editor, before the editor handles it. |
| placeholder? | string | The text shown while the document is empty. |
| value? | string | The initial document. |