From 63f43dcc402e78ba57219ecc843761463dce191f Mon Sep 17 00:00:00 2001 From: Michael Fix Date: Mon, 23 Oct 2017 18:29:54 -0700 Subject: [PATCH] Save and update query params based on editor state (#111) * Save and update query params based on editor state * Fix typo and asPath bug with new queryParams --- lib/react-codemirror.js | 2 +- lib/routing.js | 41 +++++++ package.json | 3 +- pages/editor.js | 60 +++++++---- yarn.lock | 229 +++++++++++++++++++++++++--------------- 5 files changed, 226 insertions(+), 109 deletions(-) create mode 100644 lib/routing.js diff --git a/lib/react-codemirror.js b/lib/react-codemirror.js index 1f05f6c..585ed54 100644 --- a/lib/react-codemirror.js +++ b/lib/react-codemirror.js @@ -1,6 +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 + CodeMirror = require('react-codemirror') } export default CodeMirror diff --git a/lib/routing.js b/lib/routing.js new file mode 100644 index 0000000..7546bad --- /dev/null +++ b/lib/routing.js @@ -0,0 +1,41 @@ +import Morph from 'morphmorph' + +let createHistory +let history +if (typeof window !== 'undefined') { + createHistory = require('history').createBrowserHistory + history = createHistory() +} + +const mapper = new Morph() + +const mappings = [ + 'bg:background', + 't:theme', + 'l:language', + 'ds:dropShadow', + 'wc:windowControls', + 'wa:widthAdjustment', + 'pv:paddingVertical', + 'ph:paddingHorizontal', + 'ln:lineNumbers', + 'code:code' +] + +const reverseMappings = mappings.map(field => + field + .split(':') + .reverse() + .join(':') +) + +const keysToQuery = keys => + `?${Object.keys(keys) + .map(key => `${key}=${keys[key]}`) + .join('&')}` + +export const getQueryStringState = query => mapper.map(mappings, query) +export const updateQueryString = state => + history.replace({ + search: keysToQuery(mapper.map(reverseMappings, state)) + }) diff --git a/package.json b/package.json index 4ae2ad5..3c5882c 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "express": "^4.15.3", "form-data": "^2.2.0", "highlight.js": "^9.12.0", + "history": "^4.7.2", "lodash.debounce": "^4.0.8", "morgan": "^1.8.2", "morphmorph": "^0.0.2", @@ -31,7 +32,7 @@ "next": "^3.2.2", "react": "^15.6.1", "react-click-outside": "^2.3.1", - "react-codemirror2": "^2.0.2", + "react-codemirror": "^1.0.0", "react-color": "^2.12.1", "react-dnd": "^2.4.0", "react-dnd-html5-backend": "^2.4.1", diff --git a/pages/editor.js b/pages/editor.js index a36214e..3f51c9b 100644 --- a/pages/editor.js +++ b/pages/editor.js @@ -25,38 +25,50 @@ import { COLORS, DEFAULT_CODE } from '../lib/constants' +import { getQueryStringState, updateQueryString } from '../lib/routing' import { getState, saveState } from '../lib/util' +const removeQueryString = str => { + const qI = str.indexOf('?') + return str.slice(0, qI) +} + class Editor extends React.Component { - /* pathname, asPath, err, req, res */ - static async getInitialProps({ asPath }) { + static async getInitialProps({ asPath, query }) { + const path = removeQueryString(asPath) + const queryParams = getQueryStringState(query) + const initialState = Object.keys(queryParams).length ? queryParams : null try { // TODO fix this hack - if (asPath.length >= 20 && asPath.indexOf('.') === -1) { - const content = await api.getGist(asPath) - return { content } + if (path.length >= 20 && path.indexOf('.') === -1) { + const content = await api.getGist(path) + return { content, initialState } } } catch (e) { console.log(e) } - return {} + return { initialState } } constructor(props) { super(props) - this.state = { - background: 'rgba(171, 184, 195, 1)', - theme: THEMES_HASH.seti.id, - language: DEFAULT_LANGUAGE, - dropShadow: true, - windowControls: true, - widthAdjustment: true, - lineNumbers: false, - paddingVertical: '48px', - paddingHorizontal: '32px', - uploading: false, - code: props.content - } + this.state = Object.assign( + { + background: 'rgba(171, 184, 195, 1)', + theme: THEMES_HASH.seti.id, + language: DEFAULT_LANGUAGE, + dropShadow: true, + windowControls: true, + widthAdjustment: true, + lineNumbers: false, + paddingVertical: '48px', + paddingHorizontal: '32px', + uploading: false, + code: props.content, + _initialState: this.props.initialState + }, + this.props.initialState + ) this.save = this.save.bind(this) this.upload = this.upload.bind(this) @@ -64,13 +76,17 @@ class Editor extends React.Component { } componentDidMount() { - const state = getState(localStorage) - if (state) { - this.setState(state) + // Load from localStorage instead of query params + if (!this.state._initialState) { + const state = getState(localStorage) + if (state) { + this.setState(state) + } } } componentDidUpdate() { + updateQueryString(this.state) const s = { ...this.state } delete s.code saveState(localStorage, s) diff --git a/yarn.lock b/yarn.lock index cf36563..3be3948 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,10 +3,10 @@ abbrev@1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f" + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" -accepts@~1.3.3: +accepts@~1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.4.tgz#86246758c7dd6d21a6474ff084a4740ec05eb21f" dependencies: @@ -936,7 +936,7 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" -body-parser@^1.17.2: +body-parser@1.18.2, body-parser@^1.17.2: version "1.18.2" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.2.tgz#87678a19d84b47d859b83199bd59bce222b10454" dependencies: @@ -1041,11 +1041,11 @@ browserify-zlib@^0.1.4: pako "~0.2.0" browserslist@^2.1.2: - version "2.4.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.4.0.tgz#693ee93d01e66468a6348da5498e011f578f87f8" + version "2.5.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.5.0.tgz#0ea00d22813a4dfae5786485225a9c584b3ef37c" dependencies: - caniuse-lite "^1.0.30000718" - electron-to-chromium "^1.3.18" + caniuse-lite "^1.0.30000744" + electron-to-chromium "^1.3.24" buffer-xor@^1.0.3: version "1.0.3" @@ -1083,9 +1083,9 @@ camelcase@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" -caniuse-lite@^1.0.30000718: - version "1.0.30000738" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000738.tgz#1820c3c9adb9a117e311a5bdca1d25bc34288eba" +caniuse-lite@^1.0.30000744: + version "1.0.30000744" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000744.tgz#860fa5c83ba34fe619397d607f30bb474821671b" case-sensitive-paths-webpack-plugin@2.1.1: version "2.1.1" @@ -1146,7 +1146,7 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" -classnames@^2.2.3: +classnames@^2.2.3, classnames@^2.2.5: version "2.2.5" resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.5.tgz#fb3801d453467649ef3603c7d61a02bd129bde6d" @@ -1207,7 +1207,7 @@ codemirror-mode-elixir@^1.1.1: dependencies: codemirror "^5.20.2" -codemirror@^5.13.4, codemirror@^5.20.2, codemirror@^5.26.0: +codemirror@^5.18.2, codemirror@^5.20.2, codemirror@^5.26.0: version "5.30.0" resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.30.0.tgz#86e57dd5ea5535acbcf9c720797b4cefe05b5a70" @@ -1257,7 +1257,7 @@ content-disposition@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" -content-type@~1.0.2, content-type@~1.0.4: +content-type@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" @@ -1329,7 +1329,7 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: safe-buffer "^5.0.1" sha.js "^2.4.8" -create-react-class@^15.6.0: +create-react-class@^15.5.1, create-react-class@^15.6.0: version "15.6.2" resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.2.tgz#cf1ed15f12aad7f14ef5f2dfe05e6c42f91ef02a" dependencies: @@ -1405,7 +1405,7 @@ date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" -debug@2.6.9, debug@^2.1.1, debug@^2.2.0, debug@^2.4.5, debug@^2.6.8: +debug@2.6.9, debug@^2.1.1, debug@^2.2.0, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: @@ -1494,9 +1494,9 @@ disposables@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/disposables/-/disposables-1.0.1.tgz#064727a25b54f502bd82b89aa2dfb8df9f1b39e3" -dnd-core@^2.5.3: - version "2.5.3" - resolved "https://registry.yarnpkg.com/dnd-core/-/dnd-core-2.5.3.tgz#a4163d59a01779860d2edbdadab5183ce321147c" +dnd-core@^2.5.4: + version "2.5.4" + resolved "https://registry.yarnpkg.com/dnd-core/-/dnd-core-2.5.4.tgz#0c70a8dcbb609c0b222e275fcae9fa83e5897397" dependencies: asap "^2.0.6" invariant "^2.0.0" @@ -1504,8 +1504,8 @@ dnd-core@^2.5.3: redux "^3.7.1" dom-to-image@^2.5.2: - version "2.5.2" - resolved "https://registry.yarnpkg.com/dom-to-image/-/dom-to-image-2.5.2.tgz#6476b9f43c27c00b76ce4f164d20e5eeab032497" + version "2.6.0" + resolved "https://registry.yarnpkg.com/dom-to-image/-/dom-to-image-2.6.0.tgz#8a503608088c87b1c22f9034ae032e1898955867" dom-walk@^0.1.0: version "0.1.1" @@ -1533,9 +1533,9 @@ ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" -electron-to-chromium@^1.3.18: - version "1.3.22" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.22.tgz#4322d52c151406e3eaef74ad02676883e8416418" +electron-to-chromium@^1.3.24: + version "1.3.24" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.24.tgz#9b7b88bb05ceb9fa016a177833cc2dde388f21b6" elegant-spinner@^1.0.1: version "1.0.1" @@ -1696,7 +1696,7 @@ etag@1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.0.tgz#6f631aef336d6c46362b51764044ce216be3c051" -etag@~1.8.0, etag@~1.8.1: +etag@~1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" @@ -1759,37 +1759,39 @@ expand-range@^1.8.1: fill-range "^2.1.0" express@^4.15.3: - version "4.15.5" - resolved "https://registry.yarnpkg.com/express/-/express-4.15.5.tgz#670235ca9598890a5ae8170b83db722b842ed927" + version "4.16.1" + resolved "https://registry.yarnpkg.com/express/-/express-4.16.1.tgz#6b33b560183c9b253b7b62144df33a4654ac9ed0" dependencies: - accepts "~1.3.3" + accepts "~1.3.4" array-flatten "1.1.1" + body-parser "1.18.2" content-disposition "0.5.2" - content-type "~1.0.2" + content-type "~1.0.4" cookie "0.3.1" cookie-signature "1.0.6" debug "2.6.9" depd "~1.1.1" encodeurl "~1.0.1" escape-html "~1.0.3" - etag "~1.8.0" - finalhandler "~1.0.6" + etag "~1.8.1" + finalhandler "1.1.0" fresh "0.5.2" merge-descriptors "1.0.1" methods "~1.1.2" on-finished "~2.3.0" - parseurl "~1.3.1" + parseurl "~1.3.2" path-to-regexp "0.1.7" - proxy-addr "~1.1.5" - qs "6.5.0" + proxy-addr "~2.0.2" + qs "6.5.1" range-parser "~1.2.0" - send "0.15.6" - serve-static "1.12.6" - setprototypeof "1.0.3" + safe-buffer "5.1.1" + send "0.16.1" + serve-static "1.13.1" + setprototypeof "1.1.0" statuses "~1.3.1" type-is "~1.6.15" - utils-merge "1.0.0" - vary "~1.1.1" + utils-merge "1.0.1" + vary "~1.1.2" extend@~3.0.0, extend@~3.0.1: version "3.0.1" @@ -1860,9 +1862,9 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" -finalhandler@~1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.0.6.tgz#007aea33d1a4d3e42017f624848ad58d212f814f" +finalhandler@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" dependencies: debug "2.6.9" encodeurl "~1.0.1" @@ -1901,10 +1903,10 @@ find-up@^2.0.0, find-up@^2.1.0: locate-path "^2.0.0" follow-redirects@^1.2.3: - version "1.2.4" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.2.4.tgz#355e8f4d16876b43f577b0d5ce2668b9723214ea" + version "1.2.5" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.2.5.tgz#ffd3e14cbdd5eaa72f61b6368c1f68516c2a26cc" dependencies: - debug "^2.4.5" + debug "^2.6.9" for-in@^1.0.1: version "1.0.2" @@ -1944,7 +1946,7 @@ form-data@~2.1.1: combined-stream "^1.0.5" mime-types "^2.1.12" -forwarded@~0.1.0: +forwarded@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" @@ -2189,6 +2191,16 @@ highlight.js@^9.10.0, highlight.js@^9.12.0: version "9.12.0" resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.12.0.tgz#e6d9dbe57cbefe60751f02af336195870c90c01e" +history@^4.7.2: + version "4.7.2" + resolved "https://registry.yarnpkg.com/history/-/history-4.7.2.tgz#22b5c7f31633c5b8021c7f4a8a954ac139ee8d5b" + dependencies: + invariant "^2.2.1" + loose-envify "^1.2.0" + resolve-pathname "^2.2.0" + value-equal "^0.4.0" + warning "^3.0.0" + hmac-drbg@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -2344,7 +2356,7 @@ interpret@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.4.tgz#820cdd588b868ffb191a809506d6c9c8f212b1b0" -invariant@^2.0.0, invariant@^2.1.0, invariant@^2.2.0, invariant@^2.2.2: +invariant@^2.0.0, invariant@^2.1.0, invariant@^2.2.0, invariant@^2.2.1, invariant@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" dependencies: @@ -2354,9 +2366,9 @@ invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" -ipaddr.js@1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.4.0.tgz#296aca878a821816e5b85d0a285a99bcff4582f0" +ipaddr.js@1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.5.2.tgz#d4b505bde9946987ccf0fc58d9010ff9607e3fa0" is-arrayish@^0.2.1: version "0.2.1" @@ -2756,6 +2768,10 @@ lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + lodash@^4.0.1, lodash@^4.11.2, lodash@^4.14.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.5.1, lodash@^4.6.1: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -2783,7 +2799,7 @@ longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" -loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" dependencies: @@ -2870,8 +2886,8 @@ micromatch@^2.1.5: regex-cache "^0.4.2" miller-rabin@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.0.tgz#4a62fb1d42933c05583982f4c716f6fb9e6c6d3d" + version "4.0.1" + resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" dependencies: bn.js "^4.0.0" brorand "^1.0.1" @@ -2886,10 +2902,14 @@ mime-types@^2.1.12, mime-types@~2.1.15, mime-types@~2.1.16, mime-types@~2.1.17, dependencies: mime-db "~1.30.0" -mime@1.3.4, mime@^1.3.4: +mime@1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53" +mime@1.4.1, mime@^1.3.4: + version "1.4.1" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" + mimic-fn@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" @@ -3306,7 +3326,7 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" -parseurl@~1.3.1, parseurl@~1.3.2: +parseurl@~1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" @@ -3424,8 +3444,8 @@ preserve@^0.2.0: resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" prettier@^1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.7.2.tgz#81371e64018aafc69cf1031956c70e029339f54e" + version "1.7.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.7.4.tgz#5e8624ae9363c80f95ec644584ecdf55d74f93fa" pretty-format@^21.2.1: version "21.2.1" @@ -3470,12 +3490,12 @@ prop-types@15.5.10, prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.8: fbjs "^0.8.9" loose-envify "^1.3.1" -proxy-addr@~1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-1.1.5.tgz#71c0ee3b102de3f202f3b64f608d173fcba1a918" +proxy-addr@~2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.2.tgz#6571504f47bb988ec8180253f85dd7e14952bdec" dependencies: - forwarded "~0.1.0" - ipaddr.js "1.4.0" + forwarded "~0.1.2" + ipaddr.js "1.5.2" prr@~0.0.0: version "0.0.0" @@ -3503,10 +3523,6 @@ punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" -qs@6.5.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.0.tgz#8d04954d364def3efc55b5a0793e1e2c8b1e6e49" - qs@6.5.1, qs@~6.5.1: version "6.5.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" @@ -3564,9 +3580,16 @@ react-click-outside@^2.3.1: dependencies: hoist-non-react-statics "^1.2.0" -react-codemirror2@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/react-codemirror2/-/react-codemirror2-2.0.2.tgz#68b2ae8923174a2b3d8b6fe905d0fd3c91d97d97" +react-codemirror@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/react-codemirror/-/react-codemirror-1.0.0.tgz#91467b53b1f5d80d916a2fd0b4c7adb85a9001ba" + dependencies: + classnames "^2.2.5" + codemirror "^5.18.2" + create-react-class "^15.5.1" + lodash.debounce "^4.0.8" + lodash.isequal "^4.5.0" + prop-types "^15.5.4" react-color@^2.12.1: version "2.13.8" @@ -3583,17 +3606,17 @@ react-deep-force-update@^2.0.1: resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-2.1.1.tgz#8ea4263cd6455a050b37445b3f08fd839d86e909" react-dnd-html5-backend@>=2.4, react-dnd-html5-backend@^2.4.1: - version "2.5.3" - resolved "https://registry.yarnpkg.com/react-dnd-html5-backend/-/react-dnd-html5-backend-2.5.3.tgz#1158112e8129dfe672d4c72222f266dd05321f03" + version "2.5.4" + resolved "https://registry.yarnpkg.com/react-dnd-html5-backend/-/react-dnd-html5-backend-2.5.4.tgz#974ad083f67b12d56977a5b171f5ffeb29d78352" dependencies: lodash "^4.2.0" react-dnd@>=2, react-dnd@^2.4.0: - version "2.5.3" - resolved "https://registry.yarnpkg.com/react-dnd/-/react-dnd-2.5.3.tgz#ee5357da19d4ebd0e0da0a070a862bbc133e3241" + version "2.5.4" + resolved "https://registry.yarnpkg.com/react-dnd/-/react-dnd-2.5.4.tgz#0b6dc5e9d0dfc2909f4f4fe736e5534f3afd1bd9" dependencies: disposables "^1.0.1" - dnd-core "^2.5.3" + dnd-core "^2.5.4" hoist-non-react-statics "^2.1.0" invariant "^2.1.0" lodash "^4.2.0" @@ -3872,6 +3895,10 @@ require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" +resolve-pathname@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-2.2.0.tgz#7e9ae21ed815fd63ab189adeee64dc831eefa879" + resolve@^1.3.2: version "1.4.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86" @@ -3947,7 +3974,25 @@ safe-buffer@5.1.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, s version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" -send@0.15.6, send@^0.15.3: +send@0.16.1: + version "0.16.1" + resolved "https://registry.yarnpkg.com/send/-/send-0.16.1.tgz#a70e1ca21d1382c11d0d9f6231deb281080d7ab3" + dependencies: + debug "2.6.9" + depd "~1.1.1" + destroy "~1.0.4" + encodeurl "~1.0.1" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "~1.6.2" + mime "1.4.1" + ms "2.0.0" + on-finished "~2.3.0" + range-parser "~1.2.0" + statuses "~1.3.1" + +send@^0.15.3: version "0.15.6" resolved "https://registry.yarnpkg.com/send/-/send-0.15.6.tgz#20f23a9c925b762ab82705fe2f9db252ace47e34" dependencies: @@ -3965,14 +4010,14 @@ send@0.15.6, send@^0.15.3: range-parser "~1.2.0" statuses "~1.3.1" -serve-static@1.12.6: - version "1.12.6" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.12.6.tgz#b973773f63449934da54e5beba5e31d9f4211577" +serve-static@1.13.1: + version "1.13.1" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.1.tgz#4c57d53404a761d8f2e7c1e8a18a47dbf278a719" dependencies: encodeurl "~1.0.1" escape-html "~1.0.3" parseurl "~1.3.2" - send "0.15.6" + send "0.16.1" set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" @@ -3990,6 +4035,10 @@ setprototypeof@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04" +setprototypeof@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" + sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.9" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.9.tgz#98f64880474b74f4a38b8da9d3c0f2d104633e7d" @@ -4368,8 +4417,8 @@ ua-parser-js@^0.7.9: resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.14.tgz#110d53fa4c3f326c121292bbeac904d2e03387ca" uglify-es@^3.0.21: - version "3.1.2" - resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.1.2.tgz#b22cfca950f0632092aff42bb46979d83b5ec6f5" + version "3.1.3" + resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.1.3.tgz#a21eeb149cb120a1f8302563689e19496550780b" dependencies: commander "~2.11.0" source-map "~0.5.1" @@ -4432,9 +4481,9 @@ util@0.10.3, util@^0.10.3: dependencies: inherits "2.0.1" -utils-merge@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8" +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" uuid@3.1.0, uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" @@ -4447,7 +4496,11 @@ validate-npm-package-license@^3.0.1: spdx-correct "~1.0.0" spdx-expression-parse "~1.0.0" -vary@~1.1.1: +value-equal@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.4.0.tgz#c5bdd2f54ee093c04839d71ce2e4758a6890abc7" + +vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" @@ -4471,6 +4524,12 @@ walk@^2.3.9: dependencies: foreachasync "^3.0.0" +warning@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/warning/-/warning-3.0.0.tgz#32e5377cb572de4ab04753bdf8821c01ed605b7c" + dependencies: + loose-envify "^1.0.0" + watchpack@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.4.0.tgz#4a1472bcbb952bd0a9bb4036801f954dfb39faac"