@@ -18,7 +18,7 @@ import { CoreApp, FeatureState, QueryEditorProps, SelectableValue } from '@grafa
18
18
import { DataSource } from '../datasource' ;
19
19
import { MongoDataSourceOptions , MongoQuery , QueryLanguage , QueryType , DEFAULT_QUERY } from '../types' ;
20
20
import { parseJsQuery , parseJsQueryLegacy , validateJsonQueryText , validatePositiveNumber } from '../utils' ;
21
- import * as monacoType from 'monaco-editor/esm/vs/editor/editor.api ' ;
21
+ import { editor } from 'monaco-editor' ;
22
22
import './QueryEditor.css' ;
23
23
24
24
type Props = QueryEditorProps < DataSource , MongoQuery , MongoDataSourceOptions > ;
@@ -43,7 +43,7 @@ const languageOptions: Array<SelectableValue<string>> = [
43
43
] ;
44
44
45
45
export function QueryEditor ( { query, onChange, app } : Props ) {
46
- const codeEditorRef = useRef < monacoType . editor . IStandaloneCodeEditor | null > ( null ) ;
46
+ const codeEditorRef = useRef < editor . IStandaloneCodeEditor | null > ( null ) ;
47
47
const [ queryTextError , setQueryTextError ] = useState < string | null > ( null ) ;
48
48
const [ isOpen , setIsOpen ] = useState ( false ) ;
49
49
@@ -129,7 +129,7 @@ export function QueryEditor({ query, onChange, app }: Props) {
129
129
onChange ( { ...query , aggregateComment : event . target . value } ) ;
130
130
} ;
131
131
132
- const onCodeEditorDidMount = ( e : monacoType . editor . IStandaloneCodeEditor ) => {
132
+ const onCodeEditorDidMount = ( e : editor . IStandaloneCodeEditor ) => {
133
133
codeEditorRef . current = e ;
134
134
} ;
135
135
0 commit comments