@fc-components/monaco-editor 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/monaco-editor.cjs.development.js +11 -1
- package/dist/monaco-editor.cjs.development.js.map +1 -1
- package/dist/monaco-editor.cjs.production.min.js +1 -1
- package/dist/monaco-editor.cjs.production.min.js.map +1 -1
- package/dist/monaco-editor.esm.js +12 -2
- package/dist/monaco-editor.esm.js.map +1 -1
- package/dist/promql/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/promql/index.tsx +23 -1
|
@@ -2001,6 +2001,8 @@ function PromQLEditor(props) {
|
|
|
2001
2001
|
interpolateString = props.interpolateString,
|
|
2002
2002
|
_props$enableAutocomp = props.enableAutocomplete,
|
|
2003
2003
|
enableAutocomplete = _props$enableAutocomp === void 0 ? true : _props$enableAutocomp,
|
|
2004
|
+
_props$readOnly = props.readOnly,
|
|
2005
|
+
readOnly = _props$readOnly === void 0 ? false : _props$readOnly,
|
|
2004
2006
|
onChange = props.onChange,
|
|
2005
2007
|
onShiftEnter = props.onShiftEnter,
|
|
2006
2008
|
onBlur = props.onBlur,
|
|
@@ -2026,6 +2028,12 @@ function PromQLEditor(props) {
|
|
|
2026
2028
|
editor.onDidBlurEditorWidget(function () {
|
|
2027
2029
|
isEditorFocused.set(false);
|
|
2028
2030
|
onBlur == null || onBlur(editor.getValue());
|
|
2031
|
+
// reset the selection to the current position
|
|
2032
|
+
var position = editor.getPosition();
|
|
2033
|
+
if (position) {
|
|
2034
|
+
var newSelection = new monaco.Selection(position.lineNumber, position.column, position.lineNumber, position.column);
|
|
2035
|
+
editor.setSelection(newSelection);
|
|
2036
|
+
}
|
|
2029
2037
|
});
|
|
2030
2038
|
editor.onDidFocusEditorText(function () {
|
|
2031
2039
|
isEditorFocused.set(true);
|
|
@@ -2173,6 +2181,7 @@ function PromQLEditor(props) {
|
|
|
2173
2181
|
onChange: onChange,
|
|
2174
2182
|
editorDidMount: handleEditorDidMount,
|
|
2175
2183
|
options: {
|
|
2184
|
+
readOnly: readOnly,
|
|
2176
2185
|
codeLens: false,
|
|
2177
2186
|
contextmenu: false,
|
|
2178
2187
|
fixedOverflowWidgets: true,
|
|
@@ -2203,7 +2212,8 @@ function PromQLEditor(props) {
|
|
|
2203
2212
|
},
|
|
2204
2213
|
suggestFontSize: 12,
|
|
2205
2214
|
wordWrap: 'on',
|
|
2206
|
-
automaticLayout: true
|
|
2215
|
+
automaticLayout: true,
|
|
2216
|
+
occurrencesHighlight: 'off'
|
|
2207
2217
|
}
|
|
2208
2218
|
})));
|
|
2209
2219
|
}
|