Skip to main content
v20

API Reference

CatbeeMonacoEditorComponent: Single editor​

Properties​

PropertyDescriptionTypeDefault
[height]Height of Monaco Editorstring300px
[width]Width of Monaco Editorstring100%
[disabled]Disabled of monaco editorbooleanfalse
[placeholder]Placeholder of monaco editor, Can change the style via defining the .monaco-editor-placeholder CSS.string-
[placeholderColor]Color of the placeholder textstringrgba(128, 128, 128, 0.6)
[showPlaceholderOnWhiteSpace]Show placeholder when editor is empty but contains whitespace charactersbooleanfalse
[autoFormat]Whether to automatically format the documentbooleantrue
[options]Default options when creating editorsMonacoEditorOptions-
[initDelay]Delay initializing monaco editor in msnumber0
[model]Model of monaco editorCatbeeMonacoEditorModel-
[reInitOnOptionsChange]Whether to re-initialize the editor instance when options change. By default, the editor will re-initialize only if the language option changes. Note: Some options (like language) may require re-initialization to take effect.booleanfalse

Events​

EventDescriptionType
(init)Event emitted when the editor is initializedEventEmitter<MonacoEditor>
(reInit)Event emitted when the editor is re-initializedEventEmitter<MonacoEditor>
(initError)Event emitted when the editor initialization failsEventEmitter<unknown>
(editorResize)Event emitted when the editor is resizedEventEmitter<{ width: number; height: number }>
(optionsChange)Event emitted when the editor options are changedEventEmitter<MonacoEditorOptions>
(editorFocus)Event emitted when the text inside this editor gained focusEventEmitter<void>
(editorBlur)Event emitted when the text inside this editor lost focusEventEmitter<void>
(editorScroll)Event emitted when the scroll in the editor has changedEventEmitter<MonacoEditorScrollEvent>
(editorCursorPositionChange)Event emitted when the cursor position has changedEventEmitter<MonacoEditorCursorPositionChangedEvent>
(editorCursorSelectionChange)Event emitted when the cursor selection has changedEventEmitter<MonacoEditorCursorSelectionChangedEvent>
(editorContextmenu)Event emitted when a context menu is triggered in the editorEventEmitter<MonacoEditorMouseEvent>
(editorPaste)Event emitted when a paste event occurs in the editorEventEmitter<MonacoEditorPasteEvent>
(editorKeyDown)Event emitted when a key is pressed down in the editorEventEmitter<MonacoEditorKeyboardEvent>
(editorKeyUp)Event emitted when a key is released in the editorEventEmitter<MonacoEditorKeyboardEvent>
(editorMouseDown)Event emitted when the mouse button is pressed down in the editorEventEmitter<MonacoEditorMouseEvent>
(editorMouseUp)Event emitted when the mouse button is released in the editorEventEmitter<MonacoEditorMouseEvent>
(editorMouseMove)Event emitted when the mouse is moved in the editorEventEmitter<MonacoEditorMouseEvent>
(editorMouseLeave)Event emitted when the mouse leaves the editorEventEmitter<MonacoEditorPartialMouseEvent>
(editorModelContentChange)Event emitted when the content of the current model has changedEventEmitter<MonacoModelContentChangedEvent>

CatbeeMonacoDiffEditorComponent: Diff editor​

Properties​

PropertyDescriptionTypeDefault
[height]Height of Monaco Editorstring300px
[width]Width of Monaco Editorstring100%
[disabled]Disables Modified Editorbooleanfalse
[options]Default options when creating editorsMonacoDiffEditorOptions-
[language]Language of both original and modified modelsstringplaintext
[initDelay]Delay initializing monaco editor in msnumber0
[model]Model of monaco editorCatbeeMonacoEditorModel-

| | [originalEditable] | Whether the original editor is editable | boolean | false | | [reInitOnOptionsChange] | Whether to re-initialize the editor instance when options change. By default, the editor will re-initialize only if the language option changes. Note: Some options (like language) may require re-initialization to take effect. | boolean | false |

Events​

EventDescriptionType
(init)Event emitted when the editor is initializedEventEmitter<MonacoEditor>
(reInit)Event emitted when the editor is re-initializedEventEmitter<MonacoEditor>
(initError)Event emitted when the editor initialization failsEventEmitter<unknown>
(editorResize)Event emitted when the editor is resizedEventEmitter<{ width: number; height: number }>
(optionsChange)Event emitted when the editor options are changedEventEmitter<MonacoEditorOptions>
(editorDiffUpdate)Event emitted when the diff information computed by this diff editor has been updatedEventEmitter<CatbeeMonacoDiffEditorEvent>