diff --git a/package-lock.json b/package-lock.json index 0549276..f5ba0cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@types/node": "^12.20.16", "@types/react": "^17.0.14", "@types/react-dom": "^17.0.9", - "@uiw/react-codemirror": "^3.0.15", + "@uiw/react-codemirror": "^3.1.0", "react": "^17.0.2", "react-dom": "^17.0.2", "typescript": "^4.3.5" @@ -1068,9 +1068,9 @@ } }, "node_modules/@uiw/react-codemirror": { - "version": "3.0.15", - "resolved": "https://registry.npmjs.org/@uiw/react-codemirror/-/react-codemirror-3.0.15.tgz", - "integrity": "sha512-9/IlXrw6vPtNy+FNvXOQxBTHQDMmUOTNFfbG9+s2f7MxFGJIc/8XCT1pi2Hf1mzbcYY6egE0+frbgblRqq8T1w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@uiw/react-codemirror/-/react-codemirror-3.1.0.tgz", + "integrity": "sha512-y4fhf2cSybphYA/nr6zN5kQKTpfN25Ox/ELlvaYZEVviG1K3oD0niTTyoEZlBx0pulQjdESBhPoLH0AZ8WWsHg==", "dependencies": { "@babel/runtime": "7.14.8", "codemirror": "5.62.2" @@ -12863,9 +12863,9 @@ } }, "@uiw/react-codemirror": { - "version": "3.0.15", - "resolved": "https://registry.npmjs.org/@uiw/react-codemirror/-/react-codemirror-3.0.15.tgz", - "integrity": "sha512-9/IlXrw6vPtNy+FNvXOQxBTHQDMmUOTNFfbG9+s2f7MxFGJIc/8XCT1pi2Hf1mzbcYY6egE0+frbgblRqq8T1w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@uiw/react-codemirror/-/react-codemirror-3.1.0.tgz", + "integrity": "sha512-y4fhf2cSybphYA/nr6zN5kQKTpfN25Ox/ELlvaYZEVviG1K3oD0niTTyoEZlBx0pulQjdESBhPoLH0AZ8WWsHg==", "requires": { "@babel/runtime": "7.14.8", "codemirror": "5.62.2" diff --git a/package.json b/package.json index 2cf33a6..8614980 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "@types/node": "^12.20.16", "@types/react": "^17.0.14", "@types/react-dom": "^17.0.9", - "@uiw/react-codemirror": "^3.0.15", + "@uiw/react-codemirror": "^3.1.0", "react": "^17.0.2", "react-dom": "^17.0.2", "typescript": "^4.3.5" diff --git a/src/components/CodeRegion.tsx b/src/components/CodeRegion.tsx index 7d969bb..09fce16 100644 --- a/src/components/CodeRegion.tsx +++ b/src/components/CodeRegion.tsx @@ -2,6 +2,7 @@ import { ReactElement, useState } from 'react'; import CodeMirror from '@uiw/react-codemirror'; import 'codemirror/keymap/sublime'; +import 'codemirror/mode/javascript/javascript'; // TODO currently for catching errors I'm just wrapping the whole thing // in a try catch. This can be escaped by a user if they wanted @@ -55,6 +56,7 @@ export const CodeRegion = (props: Props):ReactElement => { value={ props.code } onChange={ (editor) => setCodeMirrorProgram(editor.getValue()) } height={ props.codeHeight || '12em' } + lazyLoadMode={ false } options={{ theme: 'nicks-theme', keyMap: 'sublime',