React-codemirror -> react-codemirror2

- Closes #64
main
Mike Fix 7 years ago committed by Michael Fix
parent bcb17ec421
commit 598ca88b98

@ -2,10 +2,10 @@ import { EOL } from 'os'
import * as hljs from 'highlight.js' import * as hljs from 'highlight.js'
import React from 'react' import React from 'react'
import domtoimage from 'dom-to-image' import domtoimage from 'dom-to-image'
import CodeMirror from 'react-codemirror'
import Spinner from 'react-spinner' import Spinner from 'react-spinner'
import toHash from 'tohash' import toHash from 'tohash'
import WindowControls from '../components/WindowControls' import WindowControls from '../components/WindowControls'
import CodeMirror from '../lib/react-codemirror'
import { COLORS, DEFAULT_LANGUAGE, LANGUAGES } from '../lib/constants' import { COLORS, DEFAULT_LANGUAGE, LANGUAGES } from '../lib/constants'
const LANGUAGE_MODE_HASH = toHash(LANGUAGES, 'mode') const LANGUAGE_MODE_HASH = toHash(LANGUAGES, 'mode')

@ -0,0 +1,6 @@
// For SSR, CodeMirror will throw an error, so return a div instead
let CodeMirror = 'div'
if (typeof window !== 'undefined' && typeof window.navigator !== 'undefined') {
CodeMirror = require('react-codemirror2').default
}
export default CodeMirror

@ -28,7 +28,7 @@
"next": "^3.2.2", "next": "^3.2.2",
"react": "^15.6.1", "react": "^15.6.1",
"react-click-outside": "^2.3.1", "react-click-outside": "^2.3.1",
"react-codemirror": "0.2.6", "react-codemirror2": "^2.0.2",
"react-color": "^2.12.1", "react-color": "^2.12.1",
"react-dnd": "^2.4.0", "react-dnd": "^2.4.0",
"react-dnd-html5-backend": "^2.4.1", "react-dnd-html5-backend": "^2.4.1",

@ -1176,7 +1176,7 @@ code-point-at@^1.0.0:
version "1.1.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
codemirror@^5.13.4, codemirror@^5.26.0: codemirror@^5.26.0:
version "5.30.0" version "5.30.0"
resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.30.0.tgz#86e57dd5ea5535acbcf9c720797b4cefe05b5a70" resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.30.0.tgz#86e57dd5ea5535acbcf9c720797b4cefe05b5a70"
@ -1778,7 +1778,7 @@ fast-deep-equal@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff"
fbjs@^0.8.16, fbjs@^0.8.9: fbjs@^0.8.9:
version "0.8.16" version "0.8.16"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db"
dependencies: dependencies:
@ -2680,7 +2680,7 @@ lodash-es@^4.2.1:
version "4.17.4" version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.4.tgz#dcc1d7552e150a0640073ba9cb31d70f032950e7" resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.4.tgz#dcc1d7552e150a0640073ba9cb31d70f032950e7"
lodash.debounce@^4.0.4, lodash.debounce@^4.0.8: lodash.debounce@^4.0.8:
version "4.0.8" version "4.0.8"
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
@ -3381,21 +3381,13 @@ prop-types-exact@^1.1.1:
has "^1.0.1" has "^1.0.1"
object.assign "^4.0.4" object.assign "^4.0.4"
prop-types@15.5.10: prop-types@15.5.10, prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.8:
version "15.5.10" version "15.5.10"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154"
dependencies: dependencies:
fbjs "^0.8.9" fbjs "^0.8.9"
loose-envify "^1.3.1" loose-envify "^1.3.1"
prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.8:
version "15.6.0"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.3.1"
object-assign "^4.1.1"
proxy-addr@~1.1.5: proxy-addr@~1.1.5:
version "1.1.5" version "1.1.5"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-1.1.5.tgz#71c0ee3b102de3f202f3b64f608d173fcba1a918" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-1.1.5.tgz#71c0ee3b102de3f202f3b64f608d173fcba1a918"
@ -3421,11 +3413,11 @@ public-encrypt@^4.0.0:
parse-asn1 "^5.0.0" parse-asn1 "^5.0.0"
randombytes "^2.0.1" randombytes "^2.0.1"
punycode@1.3.2: punycode@1.3.2, punycode@^1.2.4:
version "1.3.2" version "1.3.2"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d"
punycode@^1.2.4, punycode@^1.4.1: punycode@^1.4.1:
version "1.4.1" version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
@ -3490,13 +3482,9 @@ react-click-outside@^2.3.1:
dependencies: dependencies:
hoist-non-react-statics "^1.2.0" hoist-non-react-statics "^1.2.0"
react-codemirror@0.2.6: react-codemirror2@^2.0.2:
version "0.2.6" version "2.0.2"
resolved "https://registry.yarnpkg.com/react-codemirror/-/react-codemirror-0.2.6.tgz#e71e35717ce6effae68df1dbf2b5a75b84a44f84" resolved "https://registry.yarnpkg.com/react-codemirror2/-/react-codemirror2-2.0.2.tgz#68b2ae8923174a2b3d8b6fe905d0fd3c91d97d97"
dependencies:
classnames "^2.2.3"
codemirror "^5.13.4"
lodash.debounce "^4.0.4"
react-color@^2.12.1: react-color@^2.12.1:
version "2.13.8" version "2.13.8"

Loading…
Cancel
Save