0.2.0 • Published 21 days ago
@snack-uikit/code-editor v0.2.0
Code Editor
Installation
npm i @snack-uikit/code-editor
CodeEditor
Props
name | type | default value | description |
---|---|---|---|
themeClassName | string | - | Класснейм подключенной темы (из хука useThemeConfig() или ThemeProvider) По дефолту берется значение из useTheme внутри |
hasBackground | boolean | true | Включение/отключение псевдобекграунда |
defaultValue | string | - | Default value of the current model |
defaultLanguage | string | - | Default language of the current model |
defaultPath | string | - | Default path of the current model Will be passed as the third argument to .createModel method monaco.editor.createModel(..., ..., monaco.Uri.parse(defaultPath)) |
value | string | - | Value of the current model |
language | string | - | Language of the current model |
path | string | - | Path of the current model Will be passed as the third argument to .createModel method monaco.editor.createModel(..., ..., monaco.Uri.parse(defaultPath)) |
theme | string | "light" | The theme for the monaco Available options "vs-dark" | "light" Define new themes by monaco.editor.defineTheme |
line | number | - | The line to jump on it |
loading | ReactNode | "Loading..." | The loading screen before the editor will be mounted |
options | IStandaloneEditorConstructionOptions | - | IStandaloneEditorConstructionOptions |
overrideServices | IEditorOverrideServices | - | IEditorOverrideServices |
saveViewState | boolean | - | Indicator whether to save the models' view states between model changes or not Defaults to true |
keepCurrentModel | boolean | false | Indicator whether to dispose the current model when the Editor is unmounted or not |
width | string \| number | "100%" | Width of the editor wrapper |
height | string \| number | "100%" | Height of the editor wrapper |
className | string | - | Class name for the editor container |
wrapperProps | object | - | Props applied to the wrapper element |
beforeMount | BeforeMount | - | Signature: function(monaco: Monaco) => void An event is emitted before the editor is mounted It gets the monaco instance as a first argument Defaults to "noop" |
onMount | OnMount | - | Signature: function(editor: monaco.editor.IStandaloneCodeEditor, monaco: Monaco) => void An event is emitted when the editor is mounted It gets the editor instance as a first argument and the monaco instance as a second Defaults to "noop" |
onChange | OnChange | - | Signature: function(value: string | undefined, ev: monaco.editor.IModelContentChangedEvent) => void An event is emitted when the content of the current model is changed |
onValidate | OnValidate | - | Signature: function(markers: monaco.editor.IMarker[]) => void An event is emitted when the content of the current model is changed and the current model markers are ready Defaults to "noop" |
0.2.0
21 days ago
0.1.3-preview-c01bf388.0
22 days ago
0.1.2
25 days ago
0.1.2-preview-cb79db34.0
26 days ago
0.1.2-preview-5b75040d.0
1 month ago
0.1.2-preview-7a18c2ee.0
1 month ago
0.1.2-preview-08779a44.0
1 month ago
0.1.2-preview-80576138.0
1 month ago
0.1.2-preview-69abc1d3.0
1 month ago
0.1.2-preview-82ef7975.0
1 month ago
0.1.2-preview-2855fb42.0
1 month ago
0.1.2-preview-0a44b2fc.0
1 month ago
0.1.1
5 months ago
0.1.0
5 months ago