Merge pull request #207 from orangemug/fix/update-codemirror

Update to react-codemirror2
This commit is contained in:
Orange Mug 2017-11-30 09:14:54 +00:00 committed by GitHub
commit 4479473b37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 34 deletions

37
package-lock.json generated
View file

@ -2238,9 +2238,9 @@
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
},
"codemirror": {
"version": "5.31.0",
"resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.31.0.tgz",
"integrity": "sha512-LKbMZKoAz7pMmWuSEl253G6yyloSulj1kXfvYv+3n3I8wMiI7QwnCHwKM3Zw5S9ItNV28Layq0/ihQXWmn9T9w=="
"version": "5.32.0",
"resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.32.0.tgz",
"integrity": "sha512-95OxAlYiigW0g4n4ixFdavG07clJGILp3MvHh2pKR3FvyrTuHHvqtKSVbrV3/Jz6o0YqGvyCDLDTbH4h6ciaSw=="
},
"color": {
"version": "2.0.1",
@ -2672,16 +2672,6 @@
"sha.js": "2.4.9"
}
},
"create-react-class": {
"version": "15.6.2",
"resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.6.2.tgz",
"integrity": "sha1-zx7RXxKq1/FO9fLf4F5sQvke8Co=",
"requires": {
"fbjs": "0.8.16",
"loose-envify": "1.3.1",
"object-assign": "4.1.1"
}
},
"cross-spawn": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
@ -6762,11 +6752,6 @@
"lodash._isiterateecall": "3.0.9"
}
},
"lodash.debounce": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
"integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168="
},
"lodash.deburr": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/lodash.deburr/-/lodash.deburr-3.2.0.tgz",
@ -9334,18 +9319,10 @@
"prop-types": "15.6.0"
}
},
"react-codemirror": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/react-codemirror/-/react-codemirror-1.0.0.tgz",
"integrity": "sha1-kUZ7U7H12A2Rai/QtMetuFqQAbo=",
"requires": {
"classnames": "2.2.5",
"codemirror": "5.31.0",
"create-react-class": "15.6.2",
"lodash.debounce": "4.0.8",
"lodash.isequal": "4.5.0",
"prop-types": "15.6.0"
}
"react-codemirror2": {
"version": "3.0.7",
"resolved": "https://registry.npmjs.org/react-codemirror2/-/react-codemirror2-3.0.7.tgz",
"integrity": "sha512-l0iUmKZxKmMAtr9x/6lcHgAMmUZIVufRd0YdTKIe6Y/4Fv4z+0nvaInPituRep/hpeG5WUoEVaZoIV7qEltfDg=="
},
"react-collapse": {
"version": "4.0.3",

View file

@ -23,7 +23,7 @@
"@mapbox/mapbox-gl-rtl-text": "^0.1.1",
"@mapbox/mapbox-gl-style-spec": "^10.0.1",
"classnames": "^2.2.5",
"codemirror": "^5.31.0",
"codemirror": "^5.32.0",
"color": "^2.0.0",
"file-saver": "^1.3.3",
"github-api": "^3.0.0",
@ -42,7 +42,7 @@
"react": "16.0.0",
"react-addons-pure-render-mixin": "^15.6.2",
"react-autocomplete": "^1.7.2",
"react-codemirror": "^1.0.0",
"react-codemirror2": "^3.0.7",
"react-collapse": "^4.0.3",
"react-color": "^2.13.8",
"react-copy-to-clipboard": "^5.0.1",

View file

@ -1,7 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import CodeMirror from 'react-codemirror'
import {Controlled as CodeMirror} from 'react-codemirror2'
import InputBlock from '../inputs/InputBlock'
import StringInput from '../inputs/StringInput'
import SelectInput from '../inputs/SelectInput'
@ -81,7 +81,7 @@ class JSONEditor extends React.Component {
return <CodeMirror
value={this.state.code}
onChange={this.onCodeUpdate.bind(this)}
onBeforeChange={(editor, data, value) => this.onCodeUpdate(value)}
onFocusChange={focused => focused ? true : this.resetValue()}
options={codeMirrorOptions}
/>