diff --git a/packages/@sanity/vision/package.json b/packages/@sanity/vision/package.json index 86640abfa8e..4f94288e962 100644 --- a/packages/@sanity/vision/package.json +++ b/packages/@sanity/vision/package.json @@ -60,6 +60,7 @@ "@codemirror/lang-javascript": "^6.0.2", "@codemirror/language": "^6.2.1", "@codemirror/search": "^6.0.1", + "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.1.1", "@juggle/resize-observer": "^3.3.1", "@lezer/highlight": "^1.0.0", diff --git a/packages/@sanity/vision/src/codemirror/extensions.ts b/packages/@sanity/vision/src/codemirror/extensions.ts index 0b69f72995b..7cb17b2876b 100644 --- a/packages/@sanity/vision/src/codemirror/extensions.ts +++ b/packages/@sanity/vision/src/codemirror/extensions.ts @@ -8,6 +8,7 @@ import { syntaxHighlighting, } from '@codemirror/language' import {highlightSelectionMatches} from '@codemirror/search' +import {Extension} from '@codemirror/state' import { drawSelection, highlightActiveLine, @@ -17,7 +18,7 @@ import { lineNumbers, } from '@codemirror/view' -export const codemirrorExtensions = [ +export const codemirrorExtensions: Extension[] = [ [javascriptLanguage], lineNumbers(), highlightActiveLine(), diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5e8ccee2f0e..3ac5dbabf82 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1244,6 +1244,9 @@ importers: '@codemirror/search': specifier: ^6.0.1 version: 6.5.5 + '@codemirror/state': + specifier: ^6.0.0 + version: 6.4.0 '@codemirror/view': specifier: ^6.1.1 version: 6.23.0