diff --git a/package-lock.json b/package-lock.json index 69832e8..c5bb35c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -469,6 +469,11 @@ "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=" }, + "async-limiter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" + }, "async-listener": { "version": "0.6.9", "resolved": "https://registry.npmjs.org/async-listener/-/async-listener-0.6.9.tgz", @@ -571,11 +576,6 @@ "ast-types-flow": "0.0.7" } }, - "babel": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel/-/babel-6.23.0.tgz", - "integrity": "sha1-0NHn2APpdHZb7qMjLU4VPA77kPQ=" - }, "babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", @@ -1219,6 +1219,28 @@ "babel-types": "^6.24.1" } }, + "babel-polyfill": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", + "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", + "requires": { + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "regenerator-runtime": "^0.10.5" + }, + "dependencies": { + "core-js": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" + }, + "regenerator-runtime": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=" + } + } + }, "babel-preset-env": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", @@ -1616,6 +1638,11 @@ "umd": "^3.0.0" } }, + "browser-process-hrtime": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz", + "integrity": "sha1-Ql1opY00R/AqBKqJQYf86K+Le44=" + }, "browser-resolve": { "version": "1.11.2", "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", @@ -3000,16 +3027,6 @@ "sha.js": "^2.4.8" } }, - "create-react-class": { - "version": "15.6.3", - "resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.6.3.tgz", - "integrity": "sha512-M+/3Q6E6DLO6Yx3OwrWjwHBnvfXXYA7W+dFjt/ZDBemHO1DDZhsalX/NUtnTYclN6GfnBDRh4qRHjcDHmlJBJg==", - "requires": { - "fbjs": "^0.8.9", - "loose-envify": "^1.3.1", - "object-assign": "^4.1.1" - } - }, "cron": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/cron/-/cron-1.3.0.tgz", @@ -3330,6 +3347,41 @@ "assert-plus": "^1.0.0" } }, + "data-urls": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.0.0.tgz", + "integrity": "sha512-ai40PPQR0Fn1lD2PPie79CibnlMN2AYiDhwFX/rZHVsxbs5kNJSjegqXIprhouGXlRdEnfybva7kqRGnB6mypA==", + "requires": { + "abab": "^1.0.4", + "whatwg-mimetype": "^2.0.0", + "whatwg-url": "^6.4.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "requires": { + "punycode": "^2.1.0" + } + }, + "whatwg-url": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.4.1.tgz", + "integrity": "sha512-FwygsxsXx27x6XXuExA/ox3Ktwcbf+OAvrKmLulotDAiO1Q6ixchPFaHYsis2zZBZSJTR0+dR+JVtf7MlbqZjw==", + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + } + } + }, "date-now": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", @@ -3638,6 +3690,14 @@ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=" }, + "domexception": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", + "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", + "requires": { + "webidl-conversions": "^4.0.2" + } + }, "domhandler": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.1.0.tgz", @@ -3673,6 +3733,23 @@ "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-4.2.0.tgz", "integrity": "sha1-3vHxyl1gWdJKdm5YeULCEQbOEnU=" }, + "draft-js": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/draft-js/-/draft-js-0.10.5.tgz", + "integrity": "sha512-LE6jSCV9nkPhfVX2ggcRLA4FKs6zWq9ceuO/88BpXdNCS7mjRTgs0NsV6piUCJX9YxMsB9An33wnkMmU2sD2Zg==", + "requires": { + "fbjs": "^0.8.15", + "immutable": "~3.7.4", + "object-assign": "^4.1.0" + }, + "dependencies": { + "immutable": { + "version": "3.7.6", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-3.7.6.tgz", + "integrity": "sha1-E7TTyxK++hVIKib+Gy665kAHHks=" + } + } + }, "duplexer": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", @@ -4710,11 +4787,6 @@ "stream-consume": "^0.1.0" } }, - "font-awesome": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/font-awesome/-/font-awesome-4.7.0.tgz", - "integrity": "sha1-j6jPBBGhoxr9B7BtKQK7n8gVoTM=" - }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -4766,15 +4838,6 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, - "froala-editor": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/froala-editor/-/froala-editor-2.8.1.tgz", - "integrity": "sha512-+OGSAYRXcJUXhLAdHTFM8Y/UWdRExm7eoBGlolXpkDpINujSt84O69FN4B6gRpTyhpUJYckr+4seSRU8Qg80jg==", - "requires": { - "font-awesome": ">=4.4.0", - "jquery": ">=1.11.0" - } - }, "fs-extra": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-3.0.1.tgz", @@ -6359,6 +6422,11 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.8.tgz", "integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg==" }, + "immutable": { + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-3.8.2.tgz", + "integrity": "sha1-wkOZUUVbs5kT2vKBN28VMOEErfM=" + }, "import-lazy": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", @@ -7428,37 +7496,86 @@ "optional": true }, "jsdom": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-10.1.0.tgz", - "integrity": "sha1-d2XgD9XDVn80mFochv9GamHazGo=", + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.11.0.tgz", + "integrity": "sha512-ou1VyfjwsSuWkudGxb03FotDajxAto6USAlmMZjE2lc0jCznt7sBWkhfRBRaWwbnmDqdMSTKTLT5d9sBFkkM7A==", "requires": { - "abab": "^1.0.3", - "acorn": "^4.0.4", - "acorn-globals": "^3.1.0", + "abab": "^1.0.4", + "acorn": "^5.3.0", + "acorn-globals": "^4.1.0", "array-equal": "^1.0.0", - "content-type-parser": "^1.0.1", "cssom": ">= 0.3.2 < 0.4.0", - "cssstyle": ">= 0.2.37 < 0.3.0", - "escodegen": "^1.6.1", - "html-encoding-sniffer": "^1.0.1", - "nwmatcher": ">= 1.3.9 < 2.0.0", - "parse5": "^1.5.1", - "pn": "^1.0.0", - "request": "^2.79.0", - "request-promise-native": "^1.0.3", - "sax": "^1.2.1", - "symbol-tree": "^3.2.1", - "tough-cookie": "^2.3.2", - "webidl-conversions": "^4.0.0", - "whatwg-encoding": "^1.0.1", - "whatwg-url": "^4.3.0", - "xml-name-validator": "^2.0.1" - }, - "dependencies": { - "acorn": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", - "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=" + "cssstyle": ">= 0.3.1 < 0.4.0", + "data-urls": "^1.0.0", + "domexception": "^1.0.0", + "escodegen": "^1.9.0", + "html-encoding-sniffer": "^1.0.2", + "left-pad": "^1.2.0", + "nwsapi": "^2.0.0", + "parse5": "4.0.0", + "pn": "^1.1.0", + "request": "^2.83.0", + "request-promise-native": "^1.0.5", + "sax": "^1.2.4", + "symbol-tree": "^3.2.2", + "tough-cookie": "^2.3.3", + "w3c-hr-time": "^1.0.1", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.3", + "whatwg-mimetype": "^2.1.0", + "whatwg-url": "^6.4.1", + "ws": "^4.0.0", + "xml-name-validator": "^3.0.0" + }, + "dependencies": { + "acorn-globals": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.1.0.tgz", + "integrity": "sha512-KjZwU26uG3u6eZcfGbTULzFcsoz6pegNKtHPksZPOUsiKo5bUmiBPa38FuHZ/Eun+XYh/JCCkS9AS3Lu4McQOQ==", + "requires": { + "acorn": "^5.0.0" + } + }, + "cssstyle": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.3.1.tgz", + "integrity": "sha512-tNvaxM5blOnxanyxI6panOsnfiyLRj3HV4qjqqS45WPNS1usdYWRUQjqTEEELK73lpeP/1KoIGYUwrBn/VcECA==", + "requires": { + "cssom": "0.3.x" + } + }, + "parse5": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", + "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "requires": { + "punycode": "^2.1.0" + } + }, + "whatwg-url": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.4.1.tgz", + "integrity": "sha512-FwygsxsXx27x6XXuExA/ox3Ktwcbf+OAvrKmLulotDAiO1Q6ixchPFaHYsis2zZBZSJTR0+dR+JVtf7MlbqZjw==", + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==" } } }, @@ -7544,6 +7661,14 @@ "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz", "integrity": "sha1-OGchPo3Xm/Ho8jAMDPwe+xgsDfE=" }, + "katex": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/katex/-/katex-0.5.1.tgz", + "integrity": "sha1-hZFbAuWXr7SaBc9D+35p66xcwQ4=", + "requires": { + "match-at": "^0.1.0" + } + }, "killable": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.0.tgz", @@ -7617,6 +7742,11 @@ "invert-kv": "^1.0.0" } }, + "left-pad": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", + "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==" + }, "leven": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", @@ -7774,6 +7904,11 @@ "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==", "dev": true }, + "lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=" + }, "lodash.template": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz", @@ -7901,6 +8036,11 @@ "object-visit": "^1.0.0" } }, + "match-at": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/match-at/-/match-at-0.1.1.tgz", + "integrity": "sha512-h4Yd392z9mST+dzc+yjuybOGFNOZjmXIPKWjxBd1Bb23r4SmDOsk2NYCU2BMUBGbSpZqwVsZYNq26QS3xfaT3Q==" + }, "math-expression-evaluator": { "version": "1.2.17", "resolved": "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz", @@ -7917,12 +8057,12 @@ "integrity": "sha512-B6SLtoETmV08kqTepRyz8eqMRGFzllPy2QASKFdFl0g0YB6SNgQVnWae11RaF3/y8ZKLTJNJ7hLbMIqmBEkLzw==" }, "mathjax-node": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/mathjax-node/-/mathjax-node-2.0.1.tgz", - "integrity": "sha512-FNSs6UonZ7EEaOEqR7+7kDzSxLPWXHCxG8nQztMYHfMxfHYr7PXBl4OKFf5S+RkFkehFTtd6aXeyuDzGbiobaA==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/mathjax-node/-/mathjax-node-2.1.1.tgz", + "integrity": "sha1-JcgPSU91QEGP/Pqcx1bf0hUCAb0=", "requires": { "is-fullwidth-code-point": "^2.0.0", - "jsdom": "^10.0.0", + "jsdom": "^11.0.0", "mathjax": "^2.7.2" } }, @@ -8515,6 +8655,11 @@ "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.3.tgz", "integrity": "sha512-IKdSTiDWCarf2JTS5e9e2+5tPZGdkRJ79XjYV0pzK8Q9BpsFyBq1RGKxzs7Q8UBushGw7m6TzVKz6fcY99iSWw==" }, + "nwsapi": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.0.2.tgz", + "integrity": "sha512-wAvMV1QgoYPvqfcAmX1M86SyZA3SnNT6UNvjqO/pKHjIZzhMpPHjCTOWdOfkmUknjnvjDq09wDiBaHAzXSLiSA==" + }, "oauth-sign": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", @@ -10662,16 +10807,6 @@ "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-4.0.0.tgz", "integrity": "sha512-FlsPxavEyMuR6TjVbSSywovXSEyOg6ZDj5+Z8nbsRl9EkOzAhEIcS+GLoQDC5fz/t9suhUXWmUrOBrgeUvrMxw==" }, - "react-froala-wysiwyg": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/react-froala-wysiwyg/-/react-froala-wysiwyg-2.8.1.tgz", - "integrity": "sha512-JZqrJto5CqR/AVpo75nj5akEqFn4rIV3ju0XBEo19QtH0LWZnCBUslbRsklkzjEx7BouK2quyeWC1c+7T7x+zw==", - "requires": { - "babel": "^6.23.0", - "create-react-class": "^15.5.2", - "froala-editor": "^2.8.1" - } - }, "react-helmet": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/react-helmet/-/react-helmet-5.2.0.tgz", @@ -13623,6 +13758,14 @@ "uuid": "^3.0.1" } }, + "w3c-hr-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", + "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", + "requires": { + "browser-process-hrtime": "^0.1.2" + } + }, "walkdir": { "version": "0.0.11", "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.11.tgz", @@ -14271,6 +14414,11 @@ "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz", "integrity": "sha1-nITsLc9oGH/wC8ZOEnS0QhduHIQ=" }, + "whatwg-mimetype": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.1.0.tgz", + "integrity": "sha512-FKxhYLytBQiUKjkYteN71fAUA3g6KpNXoho1isLiLSB3N1G4F35Q5vUxWfKFhBwi5IWF27VE6WxhrnnC+m0Mew==" + }, "whatwg-url": { "version": "4.8.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-4.8.0.tgz", @@ -14383,6 +14531,15 @@ "signal-exit": "^3.0.2" } }, + "ws": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-4.1.0.tgz", + "integrity": "sha512-ZGh/8kF9rrRNffkLFV4AzhvooEclrOH0xaugmqGsIfFgOE/pIz4fMc4Ef+5HSQqTEug2S9JZIWDR47duDSLfaA==", + "requires": { + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0" + } + }, "xdg-basedir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", diff --git a/package.json b/package.json index eb05ea6..c2aa2a0 100644 --- a/package.json +++ b/package.json @@ -9,18 +9,21 @@ "@fortawesome/react-fontawesome": "0.0.19", "ajv": "^6.5.0", "aws-sdk": "^2.224.1", + "babel-polyfill": "^6.26.0", "body-parser": "^1.18.2", "bootstrap": "^4.0.0", "buttercms": "^1.1.1", + "draft-js": "^0.10.5", "html-to-react": "^1.3.3", + "immutable": "^3.8.2", "jquery": "^3.3.1", + "katex": "^0.5.1", "mathjax": "^2.7.4", - "mathjax-node": "^2.0.1", + "mathjax-node": "^2.1.1", "popper": "^1.0.1", "popper.js": "^1.12.9", "react": "^16.2.0", "react-dom": "^16.2.0", - "react-froala-wysiwyg": "^2.8.1", "react-helmet": "^5.2.0", "react-load-script": "0.0.6", "react-mathjax2": "0.0.1", diff --git a/src/css/App.css b/src/css/App.css deleted file mode 100644 index 7f179cd..0000000 --- a/src/css/App.css +++ /dev/null @@ -1,28 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - animation: App-logo-spin infinite 20s linear; - height: 80px; -} - -.App-header { - background-color: #222; - height: 150px; - padding: 20px; - color: white; -} - -.App-title { - font-size: 1.5em; -} - -.App-intro { - font-size: large; -} - -@keyframes App-logo-spin { - from { transform: rotate(0deg); } - to { transform: rotate(360deg); } -} diff --git a/src/css/Draft.css b/src/css/Draft.css new file mode 100644 index 0000000..0ec69d6 --- /dev/null +++ b/src/css/Draft.css @@ -0,0 +1,63 @@ +.RichEditor-root { + background: #fff; + border: 1px solid #ddd; + font-family: 'Georgia', serif; + font-size: 14px; + padding: 15px; +} + +.RichEditor-editor { + border-top: 1px solid #ddd; + cursor: text; + font-size: 16px; + margin-top: 10px; +} + +.RichEditor-editor .public-DraftEditorPlaceholder-root, +.RichEditor-editor .public-DraftEditor-content { + margin: 0 -15px -15px; + padding: 15px; +} + +.RichEditor-editor .public-DraftEditor-content { + min-height: 100px; +} + +.RichEditor-hidePlaceholder .public-DraftEditorPlaceholder-root { + display: none; +} + +.RichEditor-editor .RichEditor-blockquote { + border-left: 5px solid #eee; + color: #666; + font-family: 'Hoefler Text', 'Georgia', serif; + font-style: italic; + margin: 16px 0; + padding: 10px 20px; +} + +.RichEditor-editor .public-DraftStyleDefault-pre { + background-color: rgba(0, 0, 0, 0.05); + font-family: 'Inconsolata', 'Menlo', 'Consolas', monospace; + font-size: 16px; + padding: 20px; +} + +.RichEditor-controls { + font-family: 'Helvetica', sans-serif; + font-size: 14px; + margin-bottom: 5px; + user-select: none; +} + +.RichEditor-styleButton { + color: #999; + cursor: pointer; + margin-right: 16px; + padding: 2px 0; + display: inline-block; +} + +.RichEditor-activeButton { + color: #5890ff; +} \ No newline at end of file diff --git a/src/scenes/Login/components/Login.js b/src/scenes/Login/components/Login.js index 63e109b..81be3a2 100644 --- a/src/scenes/Login/components/Login.js +++ b/src/scenes/Login/components/Login.js @@ -1,51 +1,184 @@ -import React, { Component } from 'react'; -// Require Editor JS files. -import 'froala-editor/js/froala_editor.pkgd.min.js'; - -// Require Editor CSS files. -import 'froala-editor/css/froala_style.min.css'; -import 'froala-editor/css/froala_editor.pkgd.min.css'; - -// Require Font Awesome. -import 'font-awesome/css/font-awesome.css'; - -import FroalaEditor from 'react-froala-wysiwyg'; -const $ = require('jquery'); - -export default class Login extends Component{ - constructor(props){ - super(props); - this.state={username:'admin', password:'admin'}; - this.handleChangeUsername = this.handleChangeUsername.bind(this); - this.handleChangePassword = this.handleChangePassword.bind(this); - } - handleChangeUsername(event) { - this.setState({username: event.target.value}) - } - handleChangePassword(event) { - this.setState({password: event.target.value}) +/** + * Copyright (c) 2013-present, Facebook, Inc. All rights reserved. + * + * This file provided by Facebook is for non-commercial testing and evaluation + * purposes only. Facebook reserves all rights not expressly granted. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +'use strict'; + +import Draft from 'draft-js'; +import {Map} from 'immutable'; +import React from 'react'; + +import TeXBlock from './TeXBlock'; +import {content} from '../data/content'; +import {insertTeXBlock} from '../modifiers/insertTeXBlock'; +import {removeTeXBlock} from '../modifiers/removeTeXBlock'; +import '../css/TeXEditor.css'; +var {Editor, EditorState, RichUtils} = Draft; + +class StyleButton extends React.Component { + constructor() { + super(); + + this.onToggle = (e) => { + e.preventDefault(); + this.props.onToggle(this.props.style); + }; + } + + render() { + let className = "styleButton"; + + if (this.props.active) { + className += " active"; } + + return ( + + ); + } +} + +const BLOCK_TYPES = [ + { label: "H1", style: "header-one" }, + { label: "H2", style: "header-two" }, + { label: '"', style: "blockquote" }, + { label: "UL", style: "unordered-list-item" }, + { label: "OL", style: "ordered-list-item" }, + { label: "", style: "code-block" } +]; +const BlockStyleControls = (props) => { + const {editorState} = props; + const selection = editorState.getSelection(); + const blockType = editorState.getCurrentContent() + .getBlockForKey(selection.getStartKey()) + .getType(); + + return ( +
+ { + BLOCK_TYPES.map((type) => ( + + )) + } +
+ ); +}; - render() { - return( -
-

- Login -

-
-
- - -
-
- - -
- -
- -
- ); + +export default class TeXEditorExample extends React.Component { + constructor(props) { + super(props); + this.state = { + editorState: EditorState.createWithContent(content), + liveTeXEdits: Map(), + }; + + this._blockRenderer = (block) => { + if (block.getType() === 'atomic') { + return { + component: TeXBlock, + editable: false, + props: { + onStartEdit: (blockKey) => { + var {liveTeXEdits} = this.state; + this.setState({liveTeXEdits: liveTeXEdits.set(blockKey, true)}); + }, + onFinishEdit: (blockKey, newContentState) => { + var {liveTeXEdits} = this.state; + this.setState({ + liveTeXEdits: liveTeXEdits.remove(blockKey), + editorState:EditorState.createWithContent(newContentState), + }); + }, + onRemove: (blockKey) => this._removeTeX(blockKey), + }, + }; + } + return null; + }; + + this._focus = () => this.refs.editor.focus(); + this._onChange = (editorState) => this.setState({editorState}); + + this._handleKeyCommand = (command, editorState) => { + var newState = RichUtils.handleKeyCommand(editorState, command); + if (newState) { + this._onChange(newState); + return true; + } + return false; + }; + + this._removeTeX = (blockKey) => { + var {editorState, liveTeXEdits} = this.state; + this.setState({ + liveTeXEdits: liveTeXEdits.remove(blockKey), + editorState: removeTeXBlock(editorState, blockKey), + }); + }; + + this._insertTeX = () => { + this.setState({ + liveTeXEdits: Map(), + editorState: insertTeXBlock(this.state.editorState), + }); + }; + + + this._toggleBlockType = (type) => { + const {editorState} = this.state; + + this._onChange(RichUtils.toggleBlockType(editorState, type)); } + } + + /** + * While editing TeX, set the Draft editor to read-only. This allows us to + * have a textarea within the DOM. + */ + render() { + return ( +
+
+
+ + +
+
+ +
+ ); + } } diff --git a/src/scenes/Login/components/TeXBlock.js b/src/scenes/Login/components/TeXBlock.js new file mode 100644 index 0000000..40526c3 --- /dev/null +++ b/src/scenes/Login/components/TeXBlock.js @@ -0,0 +1,190 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. All rights reserved. + * + * This file provided by Facebook is for non-commercial testing and evaluation + * purposes only. Facebook reserves all rights not expressly granted. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +'use strict'; + +import katex from 'katex'; +import React from 'react'; +import MathJax from 'react-mathjax2'; + +class TexContainer extends React.Component { + + render() { + return (
{this.props.tex}
) + } +} + +class MathJaxOutput extends React.Component { + constructor(props) { + super(props); + this._timer = null; + this.texRender = + + {this.props.content} + ; + } + + _update() { + if (this._timer) { + clearTimeout(this._timer); + } + + this._timer = setTimeout(() => { + this.texRender = + + {this.props.content} + }, 0); + } + + componentDidMount() { + this._update(); + } + + componentWillReceiveProps(nextProps) { + if (nextProps.content !== this.props.content) { + this._update(); + } + } + + componentWillUnmount() { + clearTimeout(this._timer); + this._timer = null; + } + + render() { + return ; + } +} + +export default class TeXBlock extends React.Component { + constructor(props) { + super(props); + this.state = {editMode: false}; + + this._onClick = () => { + if (this.state.editMode) { + return; + } + + this.setState({ + editMode: true, + texValue: this._getValue(), + }, () => { + this._startEdit(); + }); + }; + + this._onValueChange = evt => { + var value = evt.target.value; + var invalid = false; + this.setState({ + invalidTeX: invalid, + texValue: value, + }); + + }; + + this._save = () => { + var entityKey = this.props.block.getEntityAt(0); + var newContentState = this.props.contentState.mergeEntityData( + entityKey, + {content: this.state.texValue}, + ); + this.setState({ + invalidTeX: false, + editMode: false, + texValue: null, + }, this._finishEdit.bind(this, newContentState)); + }; + + this._remove = () => { + this.props.blockProps.onRemove(this.props.block.getKey()); + }; + this._startEdit = () => { + this.props.blockProps.onStartEdit(this.props.block.getKey()); + }; + this._finishEdit = (newContentState) => { + this.props.blockProps.onFinishEdit( + this.props.block.getKey(), + newContentState, + ); + }; + } + + _getValue() { + return this.props.contentState + .getEntity(this.props.block.getEntityAt(0)) + .getData()['content']; + } + + render() { + var texContent = null; + if (this.state.editMode) { + if (this.state.invalidTeX) { + texContent = ''; + } else { + texContent = this.state.texValue; + } + } else { + texContent = this._getValue(); + } + + var className = 'TeXEditor-tex'; + if (this.state.editMode) { + className += ' TeXEditor-activeTeX'; + } + + var editPanel = null; + if (this.state.editMode) { + var buttonClass = 'TeXEditor-saveButton'; + if (this.state.invalidTeX) { + buttonClass += ' TeXEditor-invalidButton'; + } + + editPanel = +
+