Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
[Enhancement] Refactored modal dialog to be more responsive (#501)
Giuseppe Macrìc96302ad5953
diff --git a/README.md b/README.mdindex c001cac5a..5eebd9b71 100644--- a/README.md+++ b/README.md@@ -82,9 +82,10 @@ You need to add `taskMiddleware` of `react-palm` to your store too. We are activ`react-palm` will not be required, however it is still a very lightweight side effects management tool that is easier to test than react-thunk.```js-import keplerGlReducer from 'kepler.gl/reducers';import {createStore, combineReducers, applyMiddleware, compose} from 'redux';-import {taskMiddleware} from 'react-palm/tasks';+import keplerGlReducer from 'kepler.gl/reducers';+import {enhanceReduxMiddleware} from 'kepler.gl/middleware';+const initialState = {};const reducers = combineReducers({@@ -96,7 +97,7 @@ const reducers = combineReducers({});// using createStore-export default createStore(reducer, initialState, applyMiddleware(taskMiddleware));+export default createStore(reducer, initialState, applyMiddleware(enhanceReduxMiddleware([/* Add other middlewares here */])));```@@ -104,7 +105,9 @@ Or if use enhancer:```js// using enhancersconst initialState = {};-const middlewares = [taskMiddleware];+const middlewares = enhanceReduxMiddleware([+ // Add other middlewares here+]);const enhancers = [applyMiddleware(...middlewares)];diff --git a/docs/user-guides/k-save-and-export.md b/docs/user-guides/k-save-and-export.mdindex 649d019ee..c86742175 100644--- a/docs/user-guides/k-save-and-export.md+++ b/docs/user-guides/k-save-and-export.md@@ -56,7 +56,7 @@ In order to edit the mapbox token in your html file you simply need to perform t```### <a href="#export-json-map">Export Map as JSON</a>-+You can export the current map as a `json` file. This is useful when you are running your own kepler.gl application and want to load your map programmatticaly.The JSON file includes:diff --git a/examples/custom-reducer/src/store.js b/examples/custom-reducer/src/store.jsindex 175add6d3..e909bf13c 100644--- a/examples/custom-reducer/src/store.js+++ b/examples/custom-reducer/src/store.js@@ -20,8 +20,8 @@import {createStore, combineReducers, applyMiddleware, compose} from 'redux';import keplerGlReducer from 'kepler.gl/reducers';+import {enhanceReduxMiddleware} from 'kepler.gl/middleware';import appReducer from './app-reducer';-import {taskMiddleware} from 'react-palm/tasks';import window from 'global/window';const customizedKeplerGlReducer = keplerGlReducer@@ -64,7 +64,7 @@ const reducers = combineReducers({app: appReducer});-const middlewares = [taskMiddleware];+const middlewares = enhanceReduxMiddleware([]);const enhancers = [applyMiddleware(...middlewares)];const initialState = {};diff --git a/examples/custom-theme/src/store.js b/examples/custom-theme/src/store.jsindex 45348e5d3..a29d307f6 100644--- a/examples/custom-theme/src/store.js+++ b/examples/custom-theme/src/store.js@@ -18,10 +18,9 @@// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN// THE SOFTWARE.-import {combineReducers, createStore, applyMiddleware, compose} from 'redux';-import window from 'global/window';-import {taskMiddleware} from 'react-palm/tasks';+import {combineReducers, createStore, applyMiddleware, compose} from 'redux';+import {enhanceReduxMiddleware} from 'kepler.gl/middleware';import demoReducer from './reducers/index';@@ -29,9 +28,7 @@ const reducers = combineReducers({demo: demoReducer});-export const middlewares = [- taskMiddleware-];+const middlewares = enhanceReduxMiddleware([]);export const enhancers = [applyMiddleware(...middlewares)];diff --git a/examples/demo-app/package.json b/examples/demo-app/package.jsonindex fa769d2ef..1b1c23dc8 100644--- a/examples/demo-app/package.json+++ b/examples/demo-app/package.json@@ -15,7 +15,7 @@"react-copy-to-clipboard": "^5.0.1","react-dom": "^16.8.4","react-palm": "^1.1.2",- "react-redux": "^4.4.5",+ "react-redux": "^5.1.1","react-router": "^3.0.5","react-router-redux": "^4.0.8","react-virtualized": "^9.21.0",diff --git a/examples/demo-app/src/components/load-data-modal/load-data-modal.js b/examples/demo-app/src/components/load-data-modal/load-data-modal.jsindex 582b2f1bb..48299a844 100644--- a/examples/demo-app/src/components/load-data-modal/load-data-modal.js+++ b/examples/demo-app/src/components/load-data-modal/load-data-modal.js@@ -23,7 +23,7 @@ import classnames from 'classnames';import styled, {ThemeProvider} from 'styled-components';import PropTypes from 'prop-types';import {FileUpload, LoadingSpinner, Icons} from 'kepler.gl/components';-import {themeLT} from 'kepler.gl/styles';+import {media, themeLT} from 'kepler.gl/styles';import {LOADING_METHODS, ASSETS_URL, LOADING_METHODS_NAMES} from '../../constants/default-settings';@@ -53,30 +53,40 @@ const ModalTab = styled.div`.load-data-modal__tab__inner {display: flex;}- .load-data-modal__tab__item {- border-bottom: 3px solid transparent;- cursor: pointer;- margin-left: 32px;- padding: 16px 0;- font-size: 14px;- font-weight: 400;- color: ${props => props.theme.subtextColorLT};-- :first-child {- margin-left: 0;- padding-left: 0;- }-- :hover {- color: ${props => props.theme.textColorLT};- }- }.load-data-modal__tab__item.active {color: ${props => props.theme.textColorLT};border-bottom: 3px solid ${props => props.theme.textColorLT};font-weight: 500;}++ ${media.portable`+ font-size: 12px;+ `};+`;++const StyledLoadDataModalTabItem = styled.div`+ border-bottom: 3px solid transparent;+ cursor: pointer;+ margin-left: 32px;+ padding: 16px 0;+ font-size: 14px;+ font-weight: 400;+ color: ${props => props.theme.subtextColorLT};++ ${media.portable`+ margin-left: 16px;+ font-size: 12px;+ `};++ :first-child {+ margin-left: 0;+ padding-left: 0;+ }++ :hover {+ color: ${props => props.theme.textColorLT};+ }`;const StyledMapIcon = styled.div`@@ -86,6 +96,11 @@ const StyledMapIcon = styled.div`width: 64px;height: 48px;border-radius: 2px;++ ${media.portable`+ width: 48px;+ height: 32px;+ `};`;const StyledTrySampleData = styled.div`@@ -102,6 +117,10 @@ const StyledTrySampleData = styled.div`.demo-map-label {font-size: 11px;color: ${props => props.theme.labelColorLT};++ ${media.portable`+ font-size: 10px;+ `};}.demo-map-action {@@ -111,6 +130,10 @@ const StyledTrySampleData = styled.div`color: ${props => props.theme.titleColorLT};cursor: pointer;+ ${media.portable`+ font-size: 12px;+ `};+:hover {font-weight: 500;}@@ -187,7 +210,7 @@ const Tabs = ({method, toggleMethod}) => ({LOADING_METHODS.map(({id, label}) =>id !== 'sample' ? (- <div+ <StyledLoadDataModalTabItemclassName={classnames('load-data-modal__tab__item', {active: method && id === method})}@@ -195,7 +218,7 @@ const Tabs = ({method, toggleMethod}) => (onClick={() => toggleMethod(id)}><div>{label}</div>- </div>+ </StyledLoadDataModalTabItem>) : null)}</div>diff --git a/examples/demo-app/src/components/sharing/cloud-tile.js b/examples/demo-app/src/components/sharing/cloud-tile.jsindex 767b92bc2..efa76c693 100644--- a/examples/demo-app/src/components/sharing/cloud-tile.js+++ b/examples/demo-app/src/components/sharing/cloud-tile.js@@ -65,10 +65,10 @@ const TileButton = styled.button`const CloudTile = ({token, onExport, onLogin, Icon}) => {return (- <StyledTileWrapper>+ <StyledTileWrapper onClick={token ? onExport : onLogin}><StyledTile><div>- <TileButton onClick={token ? onExport : onLogin}>+ <TileButton><Icon height="64px" /><StyledLabel>{token ? 'Upload' : 'Login'}</StyledLabel></TileButton>diff --git a/examples/demo-app/src/store.js b/examples/demo-app/src/store.jsindex 3526b0b79..ca1fd544a 100644--- a/examples/demo-app/src/store.js+++ b/examples/demo-app/src/store.js@@ -21,10 +21,9 @@import {combineReducers, createStore, applyMiddleware, compose} from 'redux';import {routerReducer, routerMiddleware} from 'react-router-redux';import {browserHistory} from 'react-router';-+import {enhanceReduxMiddleware} from 'kepler.gl/middleware';import thunk from 'redux-thunk';import window from 'global/window';-import {taskMiddleware} from 'react-palm/tasks';import demoReducer from './reducers/index';@@ -33,11 +32,10 @@ const reducers = combineReducers({routing: routerReducer});-export const middlewares = [- taskMiddleware,+export const middlewares = enhanceReduxMiddleware([thunk,routerMiddleware(browserHistory)-];+]);export const enhancers = [applyMiddleware(...middlewares)];diff --git a/examples/open-modal/src/store.js b/examples/open-modal/src/store.jsindex 591dd9f01..90f195d65 100644--- a/examples/open-modal/src/store.js+++ b/examples/open-modal/src/store.js@@ -20,8 +20,9 @@import {createStore, combineReducers, applyMiddleware, compose} from 'redux';import keplerGlReducer from 'kepler.gl/reducers';+import {enhanceReduxMiddleware} from 'kepler.gl/middleware';+import appReducer from './app-reducer';-import {taskMiddleware} from 'react-palm/tasks';import window from 'global/window';const reducers = combineReducers({@@ -29,7 +30,7 @@ const reducers = combineReducers({app: appReducer});-const middlewares = [taskMiddleware];+const middlewares = enhanceReduxMiddleware([]);const enhancers = [applyMiddleware(...middlewares)];const initialState = {};diff --git a/examples/replace-component/src/store.js b/examples/replace-component/src/store.jsindex 8743e7e0a..009e3b443 100644--- a/examples/replace-component/src/store.js+++ b/examples/replace-component/src/store.js@@ -20,8 +20,8 @@import {createStore, combineReducers, applyMiddleware, compose} from 'redux';import keplerGlReducer from 'kepler.gl/reducers';+import {enhanceReduxMiddleware} from 'kepler.gl/middleware';import appReducer from './app-reducer';-import {taskMiddleware} from 'react-palm/tasks';const customizedKeplerGlReducer = keplerGlReducer.initialState({@@ -38,7 +38,7 @@ const reducers = combineReducers({app: appReducer});-const middlewares = [taskMiddleware];+const middlewares = enhanceReduxMiddleware([]);const enhancers = [applyMiddleware(...middlewares)];export default createStore(diff --git a/examples/umd-client/index.html b/examples/umd-client/index.htmlindex 6bf903de2..9a877e245 100644--- a/examples/umd-client/index.html+++ b/examples/umd-client/index.html@@ -14,7 +14,7 @@<script src="https://unpkg.com/[email protected]/umd/react.production.min.js" crossorigin></script><script src="https://unpkg.com/[email protected]/umd/react-dom.production.min.js" crossorigin></script><script src="https://unpkg.com/[email protected]/dist/redux.js" crossorigin></script>- <script src="https://unpkg.com/[email protected]/dist/react-redux.min.js" crossorigin></script>+ <script src="https://unpkg.com/[email protected]/dist/react-redux.min.js" crossorigin></script><script src="https://unpkg.com/[email protected]/dist/styled-components.min.js" crossorigin></script><!-- Load Kepler.gl-->diff --git a/package.json b/package.jsonindex 9582910ec..731ea27e1 100644--- a/package.json+++ b/package.json@@ -105,10 +105,10 @@"react-json-pretty": "^1.7.9","react-map-gl": "^4.0.14","react-markdown": "^4.0.6",- "react-modal": "^3.1.10",+ "react-modal": "^3.8.1","react-onclickoutside": "^6.7.1",- "react-palm": "^1.1.2",- "react-redux": "^4.0.0",+ "react-palm": "^2.0.0",+ "react-redux": "^5.1.1","react-sortable-hoc": "^1.8.3","react-tooltip": "^3.10.0","react-vis": "^1.8.0",@@ -171,7 +171,6 @@"eslint-plugin-prettier": "^3.0.1","eslint-plugin-react": "~7.12.4","gl": "^4.2.2",- "immutable": "^4.0.0-rc.12","jsdom": "^11.1.0","json-loader": "^0.5.4","nyc": "^11.4.1",diff --git a/src/components/common/file-uploader/file-upload.js b/src/components/common/file-uploader/file-upload.jsindex e57b62e22..afd397658 100644--- a/src/components/common/file-uploader/file-upload.js+++ b/src/components/common/file-uploader/file-upload.js@@ -26,6 +26,8 @@ import UploadButton from './upload-button';import {FileType, DragNDrop} from 'components/common/icons';import LoadingSpinner from 'components/common/loading-spinner';import {isChrome} from 'utils/utils';+// Breakpoints+import {media} from 'styles/media-breakpoints';const FileDrop =typeof document !== 'undefined' ? require('react-file-drop') : null;@@ -54,6 +56,16 @@ const CONFIG_UPLOAD_MESSAGE = 'Upload data files or upload a saved map via previconst fileIconColor = '#D3D8E0';+const StyledUploadMessage = styled.div`+ color: ${props => props.theme.textColorLT};+ font-size: 14px;+ margin-bottom: 12px;++ ${media.portable`+ font-size: 12px;+ `}+`;+const WarningMsg = styled.span`margin-top: 10px;color: ${props => props.theme.errorColor};@@ -69,15 +81,18 @@ const StyledFileDrop = styled.div`border-style: dashed;border-width: 1px;border-color: ${props => props.theme.subtextColorLT};- height: 414px;- padding-top: 60px;text-align: center;width: 100%;+ padding: 48px 8px 0;.file-upload-or {color: ${props => props.theme.linkBtnColor};padding-right: 4px;}++ ${media.portable`+ padding: 16px 4px 0;+ `};`;const MsgWrapper = styled.div`@@ -88,11 +103,24 @@ const MsgWrapper = styled.div`const StyledDragNDropIcon = styled.div`color: ${fileIconColor};- margin-bottom: 60px;+ margin-bottom: 48px;++ ${media.portable`+ margin-bottom: 16px;+ `};+ ${media.palm`+ margin-bottom: 8px;+ `};+`;- .file-type-row {- margin-bottom: 26px;- }+const StyledFileTypeFow = styled.div`+ margin-bottom: 24px;+ ${media.portable`+ margin-bottom: 16px;+ `};+ ${media.palm`+ margin-bottom: 8px;+ `};`;const StyledFileUpload = styled.div`@@ -105,12 +133,6 @@ const StyledFileUpload = styled.div`.file-drop {position: relative;}-- .file-upload__message {- color: ${props => props.theme.textColorLT};- font-size: 14px;- margin-bottom: 12px;- }`;const StyledMessage = styled.div`@@ -119,10 +141,18 @@ const StyledMessage = styled.div`align-items: center;`;+const StyledDragFileWrapper = styled.div`+ margin-bottom: 32px;+ ${media.portable`+ margin-bottom: 24px;+ `};+ ${media.portable`+ margin-bottom: 16px;+ `}+`;+const StyledDisclaimer = styled(StyledMessage)`- position: absolute;- bottom: 0;- padding: 10px 30px;+ margin: 0 auto;`;export default class FileUpload extends Component {@@ -222,26 +252,28 @@ export default class FileUpload extends Component {onDragLeave={() => this._toggleDragState(false)}onDrop={this._handleFileInput}>- <div className="file-upload__message">{CONFIG_UPLOAD_MESSAGE}</div>+ <StyledUploadMessage className="file-upload__message">{CONFIG_UPLOAD_MESSAGE}</StyledUploadMessage><StyledFileDrop dragOver={dragOver}><div style={{opacity: dragOver ? 0.5 : 1}}><StyledDragNDropIcon>- <div className="file-type-row">+ <StyledFileTypeFow className="file-type-row">{validFileExt.map(ext => (<FileType key={ext} ext={ext} height="50px" fontSize="9px"/>))}- </div>+ </StyledFileTypeFow><DragNDrop height="44px" /></StyledDragNDropIcon><div>{this._renderMessage()}</div></div>- {!files.length ? <div>- <MsgWrapper>{MESSAGE}</MsgWrapper>- <span className="file-upload-or">or</span>- <UploadButton onUpload={this._handleFileInput}>- browse your files- </UploadButton>- </div> : null}+ {!files.length ? (+ <StyledDragFileWrapper>+ <MsgWrapper>{MESSAGE}</MsgWrapper>+ <span className="file-upload-or">or</span>+ <UploadButton onUpload={this._handleFileInput}>+ browse your files+ </UploadButton>+ </StyledDragFileWrapper>+ ) : null}<StyledDisclaimer>{DISCLAIMER}</StyledDisclaimer></StyledFileDrop></FileDrop>diff --git a/src/components/common/modal.js b/src/components/common/modal.jsindex e86bfd701..93b478a53 100644--- a/src/components/common/modal.js+++ b/src/components/common/modal.js@@ -25,37 +25,33 @@ import styled from 'styled-components';import Modal from 'react-modal';import {Delete} from 'components/common/icons';import {Button} from 'components/common/styled-components';+import {media} from 'styles/media-breakpoints';const ModalContentWrapper = styled.div`- width: 60%;+ overflow-y: scroll;max-width: 960px;- padding: 24px 24px 40px;- position: absolute;+ max-height: 70vh;+ padding: 24px 72px 40px;+ position: relative;top: 92px;left: 0;right: 0;- margin-left: auto;+ margin: 0 auto;background-color: #ffffff;border-radius: 4px;transition: ${props => props.theme.transition};- min-width: 600px;- overflow: hidden;box-sizing: border-box;- margin-right: auto;font-size: 12px;color: ${props => props.theme.labelColorLT};${props => props.cssStyle || ''};+ ${media.portable`+ padding: 12px 36px 24px;+ `}`;-const CloseButton = styled.div`- color: ${props => props.theme.titleColorLT};- display: flex;- justify-content: flex-end;- z-index: 10005;-- :hover {- cursor: pointer;- }+const ModalContent = styled.div`+ position: relative;+ z-index: 10002;`;export const ModalTitle = styled.div`@@ -73,13 +69,29 @@ const StyledModalFooter = styled.div`display: flex;flex-direction: column;justify-content: flex-end;- padding-top: 36px;+ padding-top: 24px;+ ${media.portable`+ padding-top: 24px;+ `};++ ${media.palm`+ padding-top: 16px;+ `};z-index: 10001;`;-const ModalContent = styled.div`- position: relative;- z-index: 10002;+const CloseButton = styled.div`+ color: ${props => props.theme.titleColorLT};+ display: flex;+ justify-content: flex-end;+ z-index: 10005;+ position: absolute;+ top: 24px;+ right: 24px;++ :hover {+ cursor: pointer;+ }`;const FooterActionWrapper = styled.div`@@ -148,21 +160,20 @@ class ModalDialog extends Component {const {props} = this;return (<Modal+ className={this.props.className}{...props}ariaHideApp={false}style={{overlay: {backgroundColor: 'rgba(0, 0, 0, 0.5)',zIndex: 10000,- overflowY: 'auto',- position: 'absolute',// in case we want to override the modal dialog style...props.style}}}><ModalContentWrapper- className="modal--content"+ className="modal--wrapper"cssStyle={props.cssStyle}footer={props.footer}>@@ -171,11 +182,11 @@ class ModalDialog extends Component {<Delete height="14px" /></CloseButton>)}- <div style={{padding: '0px 72px'}}>+ <div>{props.title && (<ModalTitle className="modal--title">{props.title}</ModalTitle>)}- <ModalContent className="content">{props.children}</ModalContent>+ <ModalContent className="modal--body">{props.children}</ModalContent>{props.footer && (<ModalFootercancel={props.close}@@ -193,12 +204,22 @@ class ModalDialog extends Component {}const StyledModal = styled(ModalDialog)`- width: 100%;- height: 100%;top: 0;left: 0;z-index: 10000;transition: ${props => props.theme.transition};+ padding-left: 40px;+ padding-right: 40px;++ ${media.portable`+ padding-left: 24px;+ padding-right: 24px;+ `};++ ${media.palm`+ padding-left: 0;+ padding-right: 0;+ `};:focus {outline: 0diff --git a/src/components/common/styled-components.js b/src/components/common/styled-components.jsindex e9505db5d..f1a805c4e 100644--- a/src/components/common/styled-components.js+++ b/src/components/common/styled-components.js@@ -20,6 +20,7 @@import styled from 'styled-components';import ReactTooltip from 'react-tooltip';+import {media} from 'styles/media-breakpoints';export const SelectText = styled.span`color: ${props => props.theme.labelColor};@@ -345,9 +346,14 @@ export const StyledModalContent = styled.div`display: flex;flex-direction: row;font-size: 10px;- margin: 0 -96px;- padding: 30px 96px;+ padding: 24px ${props => props.theme.modalLateralPadding};+ margin: 0 -${props => props.theme.modalLateralPadding};justify-content: space-between;+ ${media.portable`+ flex-direction: column;+ padding: 16px ${props => props.theme.modalPortableLateralPadding};+ margin: 0 -${props => props.theme.modalPortableLateralPadding};+ `};`;/**diff --git a/src/components/modal-container.js b/src/components/modal-container.jsindex e00e7a330..da9bd9ad4 100644--- a/src/components/modal-container.js+++ b/src/components/modal-container.js@@ -37,6 +37,9 @@ import ExportDataModalFactory from './modals/export-data-modal';import ExportMapModalFactory from './modals/export-map-modal';import AddMapStyleModalFactory from './modals/add-map-style-modal';+// Breakpoints+import {media} from 'styles/media-breakpoints';+// Templateimport {exportMapToHTML} from 'templates/export-map';import {@@ -58,6 +61,11 @@ const DataTableModalStyle = css`top: 80px;padding: 32px 0 0 0;max-width: unset;+ ${media.palm`+ width: 100vw;+ padding: 0;+ margin: 0;+ `}`;const DeleteDatasetModalStyled = css`diff --git a/src/components/modals/add-map-style-modal.js b/src/components/modals/add-map-style-modal.jsindex de6bd9d41..2c6824ce7 100644--- a/src/components/modals/add-map-style-modal.js+++ b/src/components/modals/add-map-style-modal.js@@ -25,6 +25,7 @@ import styled from 'styled-components';import MapboxGLMap from 'react-map-gl';import {findDOMNode} from 'react-dom';import {StyledModalContent, InputLight, StyledMapContainer} from 'components/common/styled-components';+import {media} from 'styles/media-breakpoints';// Utilsimport {transformRequest} from 'utils/map-style-utils/mapbox-utils';@@ -40,29 +41,39 @@ const InstructionPanel = styled.div`flex-direction: column;justify-content: space-around;font-size: 12px;- .modal-section {- margin-bottom: 32px;- }+.modal-section:first-child {margin-top: 24px;+ ${media.palm`+ margin-top: 0;+ `};}- .modal-section {- .modal-section-title {- font-weight: 500;- }- .modal-section-subtitle {- color: ${props => props.theme.subtextColorLT};- }-- input {- margin-top: 8px;- }+ input {+ margin-right: 8px;}+`;++const StyledModalSection = styled.div`+ margin-bottom: 32px;+ .modal-section-title {+ font-weight: 500;+ }+ .modal-section-subtitle {+ color: ${props => props.theme.subtextColorLT};+ }+input {- margin-right: 8px;+ margin-top: 8px;}++ ${media.portable`+ margin-bottom: 24px;+ `};+ ${media.palm`+ margin-bottom: 16px;+ `};`;const PreviewMap = styled.div`@@ -72,7 +83,6 @@ const PreviewMap = styled.div`justify-content: center;margin-left: 116px;flex-shrink: 0;- width: ${MapW}px;.preview-title {font-weight: 500;@@ -83,16 +93,27 @@ const PreviewMap = styled.div`.preview-title.error {color: ${props => props.theme.errorColor};}++ ${media.portable`+ margin-left: 32px;+ `};++ ${media.palm`+ margin-left: unset;+ .preview-title {+ margin-top: 0px;+ }+ `};+`;- .preview-image {- background: ${props => props.theme.modalImagePlaceHolder};- border-radius: 4px;- box-shadow: 0 8px 16px 0 rgba(0,0,0,0.18);- width: ${MapW}px;- height: ${MapH}px;- position: relative;- }-+const StyledPreviewImage = styled.div`+ background: ${props => props.theme.modalImagePlaceHolder};+ border-radius: 4px;+ box-shadow: 0 8px 16px 0 rgba(0,0,0,0.18);+ width: ${MapW}px;+ height: ${MapH}px;+ position: relative;+.preview-image-placeholder {position: absolute;top: 0;@@ -191,7 +212,7 @@ class AddMapStyleModal extends Component {<div className="add-map-style-modal"><StyledModalContent><InstructionPanel>- <div className="modal-section">+ <StyledModalSection className="modal-section"><div className="modal-section-title">1. Publish your style at mapbox or provide access token</div><div className="modal-section-subtitle">You can create your own map style at@@ -208,8 +229,8 @@ class AddMapStyleModal extends Component {onChange={({target: {value}}) => this.props.inputMapStyle({...inputStyle, accessToken: value})}placeholder="e.g. pk.abcdefg.xxxxxx"/>- </div>- <div className="modal-section">+ </StyledModalSection>+ <StyledModalSection className="modal-section"><div className="modal-section-title">2. Paste style url</div><div className="modal-section-subtitle">What is a@@ -221,21 +242,21 @@ class AddMapStyleModal extends Component {onChange={({target: {value}}) => this.props.inputMapStyle({...inputStyle, url: value})}placeholder="e.g. mapbox://styles/uberdataviz/abcdefghijklmnopq"/>- </div>- <div className="modal-section">+ </StyledModalSection>+ <StyledModalSection className="modal-section"><div className="modal-section-title">3. Name your style</div><InputLighttype="text"value={inputStyle.label || ''}onChange={({target: {value}}) => this.props.inputMapStyle({...inputStyle, label: value})}/>- </div>+ </StyledModalSection></InstructionPanel><PreviewMap><div className={classnames('preview-title', {error: inputStyle.error})}>{inputStyle.error ? ErrorMsg.styleError :(inputStyle.style && inputStyle.style.name) || ''}</div>- <div className="preview-image">+ <StyledPreviewImage className="preview-image">{!inputStyle.isValid ?<div className="preview-image-spinner"/> :<StyledMapContainer>@@ -250,7 +271,7 @@ class AddMapStyleModal extends Component {mapStyle={inputStyle.url}/></StyledMapContainer>}- </div>+ </StyledPreviewImage></PreviewMap></StyledModalContent></div>diff --git a/src/components/modals/data-table-modal.js b/src/components/modals/data-table-modal.jsindex 0897ab5b2..bb0a9c6d2 100644--- a/src/components/modals/data-table-modal.js+++ b/src/components/modals/data-table-modal.js@@ -26,6 +26,10 @@ import {ALL_FIELD_TYPES} from 'constants/default-settings';import FieldToken from 'components/common/field-token';import DatasetLabel from 'components/common/dataset-label';import {Clock} from 'components/common/icons/index';++// Breakpoints+import {media} from 'styles/media-breakpoints';+const ReactDataGrid = window.navigator ? require('react-data-grid/dist/react-data-grid.min') : null;let shouldPreventScrollBack = false;@@ -83,11 +87,30 @@ const DataGridWrapper = styled.div`.react-grid-Canvas {${props => props.theme.modalScrollBar};}++ ${media.palm`+ .react-grid-Container {+ /* TODO: replace data-grid component with react-window */+ /* We need to use important in this case to override data-grid styling */+ width: 100vw !important;+ }+ `};++`;+const StyledModal = styled.div`+ ${media.palm`+ margin: 0 -36px;+ `}`;-const BooleanFormatter = ({value}) => <span>{String(value)}</span>;export class DataTableModal extends Component {++ constructor(props) {+ super(props);+ this._root = React.createRef();+ }+_onMouseWheel = e => {// Prevent futile scroll, which would trigger the Back/Next page event// https://github.com/micho/jQuery.preventMacBackScroll@@ -129,7 +152,7 @@ export class DataTableModal extends Component {.filter(({name}) => name !== '_geojson');return (- <div ref={ref => {this._root = ref}} className="dataset-modal" style={{overflow: 'scroll'}}>+ <StyledModal ref={this._root} className="dataset-modal" style={{overflow: 'scroll'}}><DatasetTabsactiveDataset={activeDataset}datasets={datasets}@@ -138,7 +161,7 @@ export class DataTableModal extends Component {<DataGridWrapperonWheel={shouldPreventScrollBack ? this._onMouseWheel : null}>- {ReactDataGrid ? (+ {ReactDataGrid && (<ReactDataGridheaderRowHeight={72}columns={columns}@@ -149,9 +172,9 @@ export class DataTableModal extends Component {rowHeight={48}rowsCount={rows.length}/>- ) : null}+ )}</DataGridWrapper>- </div>+ </StyledModal>);}}diff --git a/src/components/side-panel/layer-panel/layer-configurator.js b/src/components/side-panel/layer-panel/layer-configurator.jsindex d62111534..c9cb6366d 100644--- a/src/components/side-panel/layer-panel/layer-configurator.js+++ b/src/components/side-panel/layer-panel/layer-configurator.js@@ -17,6 +17,7 @@// 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.+/* eslint-disable complexity */import React, {Component} from 'react';import PropTypes from 'prop-types';diff --git a/src/styles/base.js b/src/styles/base.jsindex 6aecb5dd1..6634e7cf9 100644--- a/src/styles/base.js+++ b/src/styles/base.js@@ -183,9 +183,12 @@ export const tooltipColor = '#333334';// Modalexport const modalTitleColor = '#3A414C';export const modalTitleFontSize = '24px';+export const modalTitleFontSizeSmaller = '18px';export const modalFooterBgd = '#F8F8F9';export const modalImagePlaceHolder = '#DDDFE3';export const modalPadding = '10px 0';+export const modalLateralPadding = '72px';+export const modalPortableLateralPadding = '36px';// Modal Dialog (Dark)export const modalDialogBgd = '#3A414C';@@ -228,6 +231,12 @@ export const textTruncate = {wordWrap: 'normal'};+// This breakpoints are used for responsive design+export const breakPoints = {+ palm: 588,+ desk: 768+};+// theme is passed to kepler.gl when it's mounted,// it is used by styled-components to pass along to// all child components@@ -849,6 +858,7 @@ export const theme = {// ModalmodalTitleColor,modalTitleFontSize,+ modalTitleFontSizeSmaller,modalFooterBgd,modalImagePlaceHolder,modalPadding,@@ -856,6 +866,9 @@ export const theme = {modalDialogBgd,modalDialogColor,+ modalLateralPadding,+ modalPortableLateralPadding,+// Side PanelsidePanelBg,@@ -913,7 +926,10 @@ export const theme = {notificationColors,notificationPanelWidth,notificationPanelItemWidth,- notificationPanelItemHeight+ notificationPanelItemHeight,++ // Breakpoints+ breakPoints};export const themeLT = {diff --git a/src/styles/index.js b/src/styles/index.jsindex f5fd8b22b..eb75961a8 100644--- a/src/styles/index.js+++ b/src/styles/index.js@@ -19,3 +19,4 @@// THE SOFTWARE.export * from './base';+export * from './media-breakpoints';diff --git a/src/styles/media-breakpoints.js b/src/styles/media-breakpoints.jsnew file mode 100644index 000000000..66fa47fb7--- /dev/null+++ b/src/styles/media-breakpoints.js@@ -0,0 +1,47 @@+// Copyright (c) 2019 Uber Technologies, Inc.+//+// Permission is hereby granted, free of charge, to any person obtaining a copy+// of this software and associated documentation files (the "Software"), to deal+// in the Software without restriction, including without limitation the rights+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+// copies of the Software, and to permit persons to whom the Software is+// furnished to do so, subject to the following conditions:+//+// The above copyright notice and this permission notice shall be included in+// all copies or substantial portions of the Software.+//+// 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 THE+// AUTHORS OR COPYRIGHT HOLDERS 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.++import {css} from 'styled-components';++// These are useful for test or when theme doesn't define them+const breakPoints = {+ palm: 588,+ desk: 768+};++export const media = {+ palm: (...args) => css`+ @media (max-width: ${props => (props.theme.breakPoints || breakPoints).palm}px) {+ ${css(...args)};+ }+ `,++ portable: (...args) => css`+ @media (max-width: ${props => (props.theme.breakPoints || breakPoints).desk}px) {+ ${css(...args)};+ }+ `,++ desk: (...args) => css`+ @media (min-width: ${props => (props.theme.breakPoints || breakPoints).desk + 1}px) {+ ${css(...args)};+ }+ `+};diff --git a/src/templates/export-map.js b/src/templates/export-map.jsindex 8934ac8d9..d2e8f0511 100644--- a/src/templates/export-map.js+++ b/src/templates/export-map.js@@ -46,7 +46,7 @@ export const exportMapToHTML = (options, version = KEPLER_GL_VERSION) => {<script src="https://unpkg.com/[email protected]/umd/react.production.min.js" crossorigin></script><script src="https://unpkg.com/[email protected]/umd/react-dom.production.min.js" crossorigin></script><script src="https://unpkg.com/[email protected]/dist/redux.js" crossorigin></script>- <script src="https://unpkg.com/[email protected]/dist/react-redux.min.js" crossorigin></script>+ <script src="https://unpkg.com/[email protected]/dist/react-redux.min.js" crossorigin></script><script src="https://unpkg.com/[email protected]/dist/styled-components.min.js" crossorigin></script><script src="https://unpkg.com/[email protected]/dist/umd/react-virtualized.js" crossorigin></script>diff --git a/test/helpers/mock-state.js b/test/helpers/mock-state.jsindex cd5db35f1..4e8a2cf10 100644--- a/test/helpers/mock-state.js+++ b/test/helpers/mock-state.js@@ -18,7 +18,6 @@// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN// THE SOFTWARE.-import Immutable from 'immutable';import cloneDeep from 'lodash.clonedeep';import {VizColorPalette} from 'constants/custom-color-ranges';import {getInitialInputStyle} from 'reducers/map-style-updaters';@@ -60,23 +59,14 @@ export function applyActions(reducer, initialState, actions) {);}-/**- * Mock Initial App Sate- * @returns {Immutable} appState- */-export function mockInitialState() {- const initialState = keplerGlReducer(undefined, {});- return Immutable.fromJS(initialState);-}--export const InitialState = mockInitialState();+export const InitialState = keplerGlReducer(undefined, {});/*** Mock app state with uploaded geojson and csv file* @returns {Immutable} appState*/function mockStateWithFileUpload() {- const initialState = InitialState.toJS();+ const initialState = cloneDeep(InitialState);// load csv and geojsonconst updatedState = applyActions(keplerGlReducer, initialState, [@@ -103,12 +93,11 @@ function mockStateWithFileUpload() {}});- return Immutable.fromJS(updatedState);+ return updatedState;}function mockStateWithFilters(state) {- const initialState =- (state && state.toJS()) || mockStateWithFileUpload().toJS();+ const initialState = state || mockStateWithFileUpload();const prepareState = applyActions(keplerGlReducer, initialState, [// add filter@@ -138,12 +127,11 @@ function mockStateWithFilters(state) {f.id = `${f.name}-${i}`;});- return Immutable.fromJS(prepareState);+ return prepareState;}function mockStateWithLayerDimensions(state) {- const initialState =- (state && state.toJS()) || mockStateWithFileUpload().toJS();+ const initialState = state || mockStateWithFileUpload();const layer0 = initialState.visState.layers.find(l => l.config.dataId === '190vdll3di' && l.type === 'point'@@ -176,7 +164,8 @@ function mockStateWithLayerDimensions(state) {anchor: 'start'}}- ]+ ];+// layers = [ 'point', 'geojson', 'hexagon' ]const reorderPayload = [[2, 0, 1]];@@ -230,11 +219,11 @@ function mockStateWithLayerDimensions(state) {{action: VisStateActions.reorderLayer, payload: reorderPayload}]);- return Immutable.fromJS(resultState);+ return resultState;}-function mockStateWithCustomMapStyle(state) {- const initialState = InitialState.toJS();+function mockStateWithCustomMapStyle() {+ const initialState = cloneDeep(InitialState);const testCustomMapStyle = {...getInitialInputStyle(),accessToken: 'secret_token',@@ -270,7 +259,7 @@ function mockStateWithCustomMapStyle(state) {}]);- return Immutable.fromJS(updatedState);+ return updatedState;}export const StateWFiles = mockStateWithFileUpload();diff --git a/test/node/reducers/map-style-test.js b/test/node/reducers/map-style-test.jsindex 951826f97..fe0a6c5c7 100644--- a/test/node/reducers/map-style-test.js+++ b/test/node/reducers/map-style-test.js@@ -22,7 +22,7 @@ import test from 'tape';import {drainTasksForTesting, succeedTaskWithValues} from 'react-palm/tasks';import reducer from 'reducers/map-style';-import {INITIAL_MAP_STYLE, getMapStyles} from 'reducers/map-style-updaters';+import {INITIAL_MAP_STYLE} from 'reducers/map-style-updaters';import {keplerGlInit, receiveMapConfig} from 'actions/actions';import SchemaManager from 'schemas';import {DEFAULT_MAP_STYLES} from 'constants/default-settings';@@ -72,7 +72,7 @@ test('#mapStyleReducer -> RECEIVE_MAP_CONFIG', t => {keplerGlInit({mapboxApiAccessToken: 'smoothies_secret_token'}));- const stateToSave = StateWCustomMapStyle.toJS();+ const stateToSave = StateWCustomMapStyle;// save stateconst savedState = SchemaManager.getConfigToSave(stateToSave);diff --git a/test/node/reducers/vis-state-merger-test.js b/test/node/reducers/vis-state-merger-test.jsindex ef5190b9c..56775563e 100644--- a/test/node/reducers/vis-state-merger-test.js+++ b/test/node/reducers/vis-state-merger-test.js@@ -87,7 +87,7 @@ import {test('VisStateMerger.v0 -> mergeFilters -> toEmptyState', t => {const savedConfig = cloneDeep(savedStateV0);- const oldState = InitialState.toJS();+ const oldState = cloneDeep(InitialState);const oldVisState = oldState.visState;const parsedConfig = SchemaManager.parseSavedConfig(@@ -126,7 +126,7 @@ test('VisStateMerger.v0 -> mergeFilters -> toEmptyState', t => {test('VisStateMerger.v1 -> mergeFilters -> toEmptyState', t => {const savedConfig = cloneDeep(savedStateV1);- const oldState = InitialState.toJS();+ const oldState = cloneDeep(InitialState);const oldVisState = oldState.visState;const parsedConfig = SchemaManager.parseSavedConfig(@@ -165,7 +165,7 @@ test('VisStateMerger.v1 -> mergeFilters -> toEmptyState', t => {test('VisStateMerger.v0 -> mergeFilters -> toWorkingState', t => {const savedConfig = cloneDeep(savedStateV0);- const oldState = StateWFilters.toJS();+ const oldState = cloneDeep(StateWFilters);const oldVisState = oldState.visState;const oldFilters = [...oldState.visState.filters];@@ -213,7 +213,7 @@ test('VisStateMerger.v0 -> mergeFilters -> toWorkingState', t => {test('VisStateMerger.v1 -> mergeFilters -> toWorkingState', t => {const savedConfig = cloneDeep(savedStateV1);- const oldState = StateWFilters.toJS();+ const oldState = cloneDeep(StateWFilters);const oldVisState = oldState.visState;const oldFilters = [...oldState.visState.filters];@@ -260,12 +260,12 @@ test('VisStateMerger.v1 -> mergeFilters -> toWorkingState', t => {});test('VisStateMerger.current -> mergeLayers -> toEmptyState', t => {- const stateToSave = StateWFilesFiltersLayerColor.toJS();+ const stateToSave = cloneDeep(StateWFilesFiltersLayerColor);const appStateToSave = SchemaManager.save(stateToSave);const configToSave = appStateToSave.config;const configParsed = SchemaManager.parseSavedConfig(configToSave);- const oldState = InitialState.toJS();+ const oldState = cloneDeep(InitialState);const oldVisState = oldState.visState;const parsedLayers = configParsed.visState.layers;@@ -306,7 +306,7 @@ test('VisStateMerger.v1 -> mergeLayers -> toEmptyState', t => {const savedConfig = cloneDeep(savedStateV1);const parsedConfig = SchemaManager.parseSavedConfig(savedConfig.config);- const oldState = InitialState.toJS();+ const oldState = cloneDeep(InitialState);const oldVisState = oldState.visState;const parsedLayers = parsedConfig.visState.layers;@@ -343,7 +343,7 @@ test('VisStateMerger.v1.label -> mergeLayers -> toEmptyState', t => {const savedConfig = cloneDeep(savedStateV1Label);const parsedConfig = SchemaManager.parseSavedConfig(savedConfig.config);- const oldState = InitialState.toJS();+ const oldState = cloneDeep(InitialState);const oldVisState = oldState.visState;const parsedLayers = parsedConfig.visState.layers;@@ -380,7 +380,8 @@ test('VisStateMerger.v1.split -> mergeLayers -> toEmptyState', t => {const savedConfig = cloneDeep(savedStateV1Split);const parsedConfig = SchemaManager.parseSavedConfig(savedConfig.config);const expectedConfig = mergedSplitMapsV1;- const oldState = InitialState.toJS();+ const oldState = cloneDeep(InitialState);+const oldVisState = oldState.visState;const parsedLayers = parsedConfig.visState.layers;@@ -441,7 +442,7 @@ test('VisStateMerger.v0 -> mergeLayers -> toWorkingState', t => {savedConfig.config);- const oldState = StateWFilesFiltersLayerColor.toJS();+ const oldState = cloneDeep(StateWFilesFiltersLayerColor);const oldVisState = oldState.visState;const oldLayers = [...oldVisState.layers];@@ -495,7 +496,7 @@ test('VisStateMerger.v1 -> mergeLayers -> toWorkingState', t => {savedConfig.config);- const oldState = StateWFilesFiltersLayerColor.toJS();+ const oldState = cloneDeep(StateWFilesFiltersLayerColor);const oldVisState = oldState.visState;const oldLayers = [...oldVisState.layers];@@ -545,7 +546,7 @@ test('VisStateMerger.v1 -> mergeLayers -> toWorkingState', t => {test('VisStateMerger.v0 -> mergeInteractions -> toEmptyState', t => {const savedConfig = cloneDeep(savedStateV0);- const oldState = InitialState.toJS();+ const oldState = cloneDeep(InitialState);const oldVisState = oldState.visState;const parsedConfig = SchemaManager.parseSavedConfig(@@ -623,7 +624,7 @@ test('VisStateMerger.v0 -> mergeInteractions -> toEmptyState', t => {test('VisStateMerger.v0 -> mergeInteractions -> toWorkingState', t => {const savedConfig = cloneDeep(savedStateV0);- const oldState = StateWFilesFiltersLayerColor.toJS();+ const oldState = cloneDeep(StateWFilesFiltersLayerColor);const oldVisState = oldState.visState;// add random items to interactionToBeMerged@@ -718,7 +719,7 @@ test('VisStateMerger.v0 -> mergeInteractions -> toWorkingState', t => {test('VisStateMerger.v1 -> mergeInteractions -> toEmptyState', t => {const savedConfig = cloneDeep(savedStateV1);- const oldState = InitialState.toJS();+ const oldState = cloneDeep(InitialState);const oldVisState = oldState.visState;const parsedConfig = SchemaManager.parseSavedConfig(@@ -795,7 +796,7 @@ test('VisStateMerger.v1 -> mergeInteractions -> toEmptyState', t => {test('VisStateMerger.v1 -> mergeInteractions -> toWorkingState', t => {const savedConfig = cloneDeep(savedStateV1);- const oldState = StateWFilesFiltersLayerColor.toJS();+ const oldState = cloneDeep(StateWFilesFiltersLayerColor);const oldVisState = oldState.visState;// add random items to interactionToBeMergeddiff --git a/test/node/schemas/map-state-schema-test.js b/test/node/schemas/map-state-schema-test.jsindex 3fd1e2b24..b67851686 100644--- a/test/node/schemas/map-state-schema-test.js+++ b/test/node/schemas/map-state-schema-test.js@@ -19,11 +19,12 @@// THE SOFTWARE.import test from 'tape';+import cloneDeep from 'lodash.clonedeep';import SchemaManager from 'schemas';import {InitialState} from 'test/helpers/mock-state';test('#mapStateSchema -> v1 -> save load mapState', t => {- const initialState = InitialState.toJS();+ const initialState = cloneDeep(InitialState);const savedState = SchemaManager.getConfigToSave(initialState);// save statediff --git a/test/node/schemas/map-style-schema-test.js b/test/node/schemas/map-style-schema-test.jsindex 43800808e..d87035936 100644--- a/test/node/schemas/map-style-schema-test.js+++ b/test/node/schemas/map-style-schema-test.js@@ -19,12 +19,12 @@// THE SOFTWARE.import test from 'tape';-+import cloneDeep from 'lodash.clonedeep';import SchemaManager from 'schemas';import {InitialState, StateWCustomMapStyle} from 'test/helpers/mock-state';test('#mapStyleSchema -> v1 -> save load mapStyle', t => {- const initialState = InitialState.toJS();+ const initialState = cloneDeep(InitialState);const savedState = SchemaManager.getConfigToSave(initialState);// save state@@ -46,7 +46,7 @@ test('#mapStyleSchema -> v1 -> save load mapStyle', t => {styleType: 'dark',topLayerGroups: {},visibleLayerGroups: {}- }+ };t.deepEqual(msToSave, expectedSaved, 'saved mapStyle should be current');t.deepEqual(msLoaded, expectedLoaded, 'loaded mapStyle should be current');@@ -54,7 +54,7 @@ test('#mapStyleSchema -> v1 -> save load mapStyle', t => {});test('#mapStyleSchema -> v1 -> save load mapStyle with custom style', t => {- const initialState = StateWCustomMapStyle.toJS();+ const initialState = cloneDeep(StateWCustomMapStyle);const savedState = SchemaManager.getConfigToSave(initialState);// save statediff --git a/test/node/schemas/vis-state-schema-test.js b/test/node/schemas/vis-state-schema-test.jsindex a4ec05313..0b3aa42f3 100644--- a/test/node/schemas/vis-state-schema-test.js+++ b/test/node/schemas/vis-state-schema-test.js@@ -19,7 +19,7 @@// THE SOFTWARE.import test from 'tape';-+import cloneDeep from 'lodash.clonedeep';import {cmpFilters, cmpSavedLayers} from 'test/helpers/comparison-utils';import SchemaManager from 'schemas';@@ -33,7 +33,7 @@ import {StateWFilesFiltersLayerColor,} from 'test/helpers/mock-state';test('#visStateSchema -> v1 -> save layers', t => {- const initialState = StateWFilesFiltersLayerColor.toJS();+ const initialState = cloneDeep(StateWFilesFiltersLayerColor);// save stateconst vsToSave = SchemaManager.getConfigToSave(initialState).config.visState;@@ -55,7 +55,7 @@ test('#visStateSchema -> v1 -> save layers', t => {});test('#visStateSchema -> v1 -> load layers', t => {- const initialState = StateWFilesFiltersLayerColor.toJS();+ const initialState = cloneDeep(StateWFilesFiltersLayerColor);// save stateconst savedState = SchemaManager.getConfigToSave(initialState);@@ -78,7 +78,7 @@ test('#visStateSchema -> v1 -> load layers', t => {});test('#visStateSchema -> v1 -> save load filters', t => {- const initialState = StateWFilesFiltersLayerColor.toJS();+ const initialState = cloneDeep(StateWFilesFiltersLayerColor);const savedState = SchemaManager.getConfigToSave(initialState);// save state@@ -116,7 +116,7 @@ test('#visStateSchema -> v1 -> save load filters', t => {});test('#visStateSchema -> v1 -> save load interaction', t => {- const initialState = StateWFilesFiltersLayerColor.toJS();+ const initialState = cloneDeep(StateWFilesFiltersLayerColor);const savedState = SchemaManager.getConfigToSave(initialState);// save state@@ -150,7 +150,7 @@ test('#visStateSchema -> v1 -> save load interaction', t => {});test('#visStateSchema -> v1 -> save load layerBlending', t => {- const initialState = StateWFilesFiltersLayerColor.toJS();+ const initialState = cloneDeep(StateWFilesFiltersLayerColor);const savedState = SchemaManager.getConfigToSave(initialState);// save statediff --git a/website/src/static/index.html b/website/src/static/index.htmlindex 04b0badc4..78e7249cb 100644--- a/website/src/static/index.html+++ b/website/src/static/index.html@@ -6,9 +6,9 @@<meta name="description" content="Kepler.gl is a data agnostic, WebGL empowered, high-performance web application for geospatial analytic visualizations."><title>kepler.gl</title><link rel="shortcut icon" href="/favicon.png">- <link rel="stylesheet" href="//d1a3f4spazzrp4.cloudfront.net/kepler.gl/uber-fonts/4.0.0/superfine.css">+ <link rel="stylesheet" href="https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/uber-fonts/4.0.0/superfine.css">- <link href="//api.tiles.mapbox.com/mapbox-gl-js/v0.42.0/mapbox-gl.css" rel="stylesheet">+ <link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.42.0/mapbox-gl.css" rel="stylesheet"><!-— facebook open graph tags --><meta property="og:url" content="https://uber.github.io/kepler.gl/" />diff --git a/yarn.lock b/yarn.lockindex 693fd7702..a5a28d362 100644--- a/yarn.lock+++ b/yarn.lock@@ -839,7 +839,7 @@pirates "^4.0.0"source-map-support "^0.5.9"-"@babel/runtime@^7.0.0", "@babel/runtime@^7.2.0":+"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.2.0":version "7.4.4"resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.4.tgz#dc2e34982eb236803aa27a07fea6857af1b9171d"dependencies:@@ -1032,8 +1032,8 @@resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d""@types/node@*":- version "12.0.1"- resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.1.tgz#3dde31f8da274dfeb90e96abf55038fef46285f0"+ version "12.0.2"+ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.2.tgz#3452a24edf9fea138b48fad4a0a028a683da1e40""@webassemblyjs/[email protected]":version "1.8.5"@@ -1964,12 +1964,12 @@ browserify@^16.1.0:xtend "^4.0.0"browserslist@^4.5.2, browserslist@^4.5.4:- version "4.5.6"- resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.5.6.tgz#ea42e8581ca2513fa7f371d4dd66da763938163d"+ version "4.6.0"+ resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.0.tgz#5274028c26f4d933d5b1323307c1d1da5084c9ff"dependencies:- caniuse-lite "^1.0.30000963"- electron-to-chromium "^1.3.127"- node-releases "^1.1.17"+ caniuse-lite "^1.0.30000967"+ electron-to-chromium "^1.3.133"+ node-releases "^1.1.19"buffer-alloc-unsafe@^1.1.0:version "1.1.0"@@ -2033,7 +2033,7 @@ [email protected]:version "3.0.0"resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"-cacache@^11.0.2:+cacache@^11.3.2:version "11.3.2"resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.3.2.tgz#2d81e308e3d258ca38125b676b98b2ac9ce69bfa"dependencies:@@ -2098,7 +2098,7 @@ camelize@^1.0.0:version "1.0.0"resolved "https://registry.yarnpkg.com/camelize/-/camelize-1.0.0.tgz#164a5483e630fa4321e5af07020e531831b2609b"-caniuse-lite@^1.0.30000963:+caniuse-lite@^1.0.30000967:version "1.0.30000967"resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000967.tgz#a5039577806fccee80a04aaafb2c0890b1ee2f73"@@ -2175,8 +2175,8 @@ cheerio@^1.0.0-rc.2:parse5 "^3.0.1"chokidar@^2.0.2, chokidar@^2.0.4, chokidar@^2.1.1, chokidar@^2.1.5:- version "2.1.5"- resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.5.tgz#0ae8434d962281a5f56c72869e79cb6d9d86ad4d"+ version "2.1.6"+ resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.6.tgz#b6cad653a929e244ce8a834244164d241fa954c5"dependencies:anymatch "^2.0.0"async-each "^1.0.1"@@ -2309,8 +2309,8 @@ combined-stream@^1.0.6, combined-stream@~1.0.6:delayed-stream "~1.0.0"comma-separated-tokens@^1.0.1:- version "1.0.6"- resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.6.tgz#3cd3d8adc725ab473843db338bcdfd4a7bb087bf"+ version "1.0.7"+ resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.7.tgz#419cd7fb3258b1ed838dc0953167a25e152f5b59"commander@2, commander@^2.18.0, commander@^2.19.0, commander@^2.8.1, commander@~2.20.0:version "2.20.0"@@ -2503,7 +2503,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.5.1, create-react-class@^15.5.2:+create-react-class@^15.5.2:version "15.6.3"resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.3.tgz#2d73237fb3f970ae6ebe011a9e66f46dbca80036"dependencies:@@ -3181,9 +3181,9 @@ ejs@^2.6.1:version "2.6.1"resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.6.1.tgz#498ec0d495655abc6f23cd61868d926464071aa0"-electron-to-chromium@^1.3.127:- version "1.3.133"- resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.133.tgz#c47639c19b91feee3e22fad69f5556142007008c"+electron-to-chromium@^1.3.133:+ version "1.3.134"+ resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.134.tgz#550222bddac43c6bd6c445c3543a0fe8a615021d"elliptic@^6.0.0:version "6.4.1"@@ -3249,7 +3249,7 @@ enzyme-adapter-react-16@^1.10.0:react-test-renderer "^16.0.0-0"semver "^5.6.0"-enzyme-adapter-utils@^1.12.0, enzyme-adapter-utils@^1.5.0:+enzyme-adapter-utils@^1.12.0:version "1.12.0"resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.12.0.tgz#96e3730d76b872f593e54ce1c51fa3a451422d93"dependencies:@@ -3260,7 +3260,7 @@ enzyme-adapter-utils@^1.12.0, enzyme-adapter-utils@^1.5.0:prop-types "^15.7.2"semver "^5.6.0"-enzyme@^3.4.4, enzyme@^3.9.0:+enzyme@^3.9.0:version "3.9.0"resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.9.0.tgz#2b491f06ca966eb56b6510068c7894a7e0be3909"dependencies:@@ -3948,8 +3948,8 @@ fs-constants@^1.0.0:resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad"fs-minipass@^1.2.5:- version "1.2.5"- resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d"+ version "1.2.6"+ resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.6.tgz#2c5cc30ded81282bfe8a0d7c7c1853ddeb102c07"dependencies:minipass "^2.2.1"@@ -3984,9 +3984,9 @@ fsevents@^1.2.7:nan "^2.12.1"node-pre-gyp "^0.12.0"-fstream@^1.0.0, fstream@^1.0.2:- version "1.0.11"- resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171"+fstream@^1.0.0, fstream@^1.0.12:+ version "1.0.12"+ resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.12.tgz#4e8ba8ee2d48be4f7d0de505455548eae5932045"dependencies:graceful-fs "^4.1.2"inherits "~2.0.0"@@ -4412,7 +4412,7 @@ [email protected]:version "4.2.1"resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb"-hoist-non-react-statics@^3.3.0:+hoist-non-react-statics@^3.1.0:version "3.3.0"resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz#b09178f0122184fb95acf525daaecb4d8f45958b"dependencies:@@ -4562,10 +4562,6 @@ ignore@^4.0.6:version "4.0.6"resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc"-immutable@^4.0.0-rc.12:- version "4.0.0-rc.12"- resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.0.0-rc.12.tgz#ca59a7e4c19ae8d9bf74a97bdf0f6e2f2a5d0217"-import-fresh@^3.0.0:version "3.0.0"resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390"@@ -4657,7 +4653,7 @@ interpret@^1.1.0:version "1.2.0"resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296"-invariant@^2.0.0, invariant@^2.2.2, invariant@^2.2.4:+invariant@^2.2.2, invariant@^2.2.4:version "2.2.4"resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"dependencies:@@ -5745,9 +5741,9 @@ [email protected]:version "1.4.1"resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6"-mime@^2.2.0, mime@^2.3.1:- version "2.4.2"- resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.2.tgz#ce5229a5e99ffc313abac806b482c10e7ba6ac78"+mime@^2.2.0, mime@^2.4.2:+ version "2.4.3"+ resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.3.tgz#229687331e86f68924e6cb59e1cdd937f18275fe"mimic-fn@^1.0.0:version "1.2.0"@@ -5973,10 +5969,10 @@ nearley@^2.7.10:semver "^5.4.1"needle@^2.2.1:- version "2.3.1"- resolved "https://registry.yarnpkg.com/needle/-/needle-2.3.1.tgz#d272f2f4034afb9c4c9ab1379aabc17fc85c9388"+ version "2.4.0"+ resolved "https://registry.yarnpkg.com/needle/-/needle-2.4.0.tgz#6833e74975c444642590e15a750288c5f939b57c"dependencies:- debug "^4.1.0"+ debug "^3.2.6"iconv-lite "^0.4.4"sax "^1.2.4"@@ -6073,7 +6069,7 @@ node-pre-gyp@^0.12.0:semver "^5.3.0"tar "^4"-node-releases@^1.1.17:+node-releases@^1.1.19:version "1.1.19"resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.19.tgz#c492d1e381fea0350b338b646c27867e88e91b3d"dependencies:@@ -6501,8 +6497,8 @@ parse-asn1@^5.0.0:safe-buffer "^5.1.1"parse-entities@^1.0.2, parse-entities@^1.1.0:- version "1.2.1"- resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.2.1.tgz#2c761ced065ba7dc68148580b5a225e4918cdd69"+ version "1.2.2"+ resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.2.2.tgz#c31bf0f653b6661354f8973559cb86dd1d5edf50"dependencies:character-entities "^1.0.0"character-entities-legacy "^1.0.0"@@ -6889,7 +6885,7 @@ prop-types-exact@^1.2.0:object.assign "^4.1.0"reflect.ownkeys "^0.2.0"-prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2:+prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:version "15.7.2"resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"dependencies:@@ -7055,7 +7051,7 @@ randomfill@^1.0.3:randombytes "^2.0.5"safe-buffer "^5.1.0"-range-parser@^1.0.3, range-parser@~1.2.0:+range-parser@^1.2.1, range-parser@~1.2.0:version "1.2.1"resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031"@@ -7159,7 +7155,7 @@ react-markdown@^4.0.6:unist-util-visit "^1.3.0"xtend "^4.0.1"-react-modal@^3.1.10:+react-modal@^3.8.1:version "3.8.1"resolved "https://registry.yarnpkg.com/react-modal/-/react-modal-3.8.1.tgz#7300f94a6f92a2e17994de0be6ccb61734464c9e"dependencies:@@ -7180,13 +7176,11 @@ react-onclickoutside@^6.7.1:version "6.8.0"resolved "https://registry.yarnpkg.com/react-onclickoutside/-/react-onclickoutside-6.8.0.tgz#9f91b5b3ed59f4d9e43fd71620dc200773a4d569"-react-palm@^1.1.2:- version "1.3.1"- resolved "https://registry.yarnpkg.com/react-palm/-/react-palm-1.3.1.tgz#68b6848b73a9d99797f2992da6bcb7d01d9e847e"+react-palm@^2.0.0:+ version "2.0.0"+ resolved "https://registry.yarnpkg.com/react-palm/-/react-palm-2.0.0.tgz#03be811ced642e9f1ca0fb437e99b8f55419413b"dependencies:babel-plugin-transform-object-rest-spread "^6.26.0"- enzyme "^3.4.4"- enzyme-adapter-utils "^1.5.0"function.prototype.name "^1.1.0"react-dom "^16.4.2"react-reconciler "^0.12.0"@@ -7207,16 +7201,17 @@ react-reconciler@^0.12.0:object-assign "^4.1.1"prop-types "^15.6.0"-react-redux@^4.0.0:- version "4.4.10"- resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-4.4.10.tgz#ad57bd1db00c2d0aa7db992b360ce63dd0b80ec5"+react-redux@^5.1.1:+ version "5.1.1"+ resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-5.1.1.tgz#88e368682c7fa80e34e055cd7ac56f5936b0f52f"dependencies:- create-react-class "^15.5.1"- hoist-non-react-statics "^3.3.0"- invariant "^2.0.0"- lodash "^4.17.11"- loose-envify "^1.4.0"- prop-types "^15.7.2"+ "@babel/runtime" "^7.1.2"+ hoist-non-react-statics "^3.1.0"+ invariant "^2.2.4"+ loose-envify "^1.1.0"+ prop-types "^15.6.1"+ react-is "^16.6.0"+ react-lifecycles-compat "^3.0.0"react-sortable-hoc@^1.8.3:version "1.9.1"@@ -7898,7 +7893,7 @@ [email protected]:range-parser "~1.2.0"statuses "~1.4.0"-serialize-javascript@^1.4.0:+serialize-javascript@^1.7.0:version "1.7.0"resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.7.0.tgz#d6e0dfb2a3832a8c94468e6eb1db97e55a192a65"@@ -8141,8 +8136,8 @@ sourcemapped-stacktrace@^1.1.6:source-map "0.5.6"space-separated-tokens@^1.0.0:- version "1.1.3"- resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.3.tgz#bc6500e116d13285a94b59b58c44c7f045fe6124"+ version "1.1.4"+ resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.4.tgz#27910835ae00d0adfcdbd0ad7e611fb9544351fa"spawn-wrap@^1.4.2:version "1.4.2"@@ -8574,11 +8569,11 @@ tar-stream@^1.1.2:xtend "^4.0.0"tar@^2.0.0:- version "2.2.1"- resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1"+ version "2.2.2"+ resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.2.tgz#0ca8848562c7299b8b446ff6a4d60cdbb23edc40"dependencies:block-stream "*"- fstream "^1.0.2"+ fstream "^1.0.12"inherits "2"tar@^4:@@ -8594,19 +8589,20 @@ tar@^4:yallist "^3.0.2"terser-webpack-plugin@^1.1.0:- version "1.2.3"- resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.2.3.tgz#3f98bc902fac3e5d0de730869f50668561262ec8"+ version "1.2.4"+ resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.2.4.tgz#56f87540c28dd5265753431009388f473b5abba3"dependencies:- cacache "^11.0.2"+ cacache "^11.3.2"find-cache-dir "^2.0.0"+ is-wsl "^1.1.0"schema-utils "^1.0.0"- serialize-javascript "^1.4.0"+ serialize-javascript "^1.7.0"source-map "^0.6.1"- terser "^3.16.1"- webpack-sources "^1.1.0"- worker-farm "^1.5.2"+ terser "^3.17.0"+ webpack-sources "^1.3.0"+ worker-farm "^1.7.0"-terser@^3.16.1:+terser@^3.17.0:version "3.17.0"resolved "https://registry.yarnpkg.com/terser/-/terser-3.17.0.tgz#f88ffbeda0deb5637f9d24b0da66f4e15ab10cb2"dependencies:@@ -8815,8 +8811,8 @@ [email protected]:resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd"trough@^1.0.0:- version "1.0.3"- resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.3.tgz#e29bd1614c6458d44869fc28b255ab7857ef7c24"+ version "1.0.4"+ resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.4.tgz#3b52b1f13924f460c3fbfd0df69b587dbcbc762e"tryer@^1.0.0:version "1.0.1"@@ -9005,8 +9001,8 @@ [email protected]:resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-1.1.2.tgz#f6e3afee8bdbf961c0e6f028ea3c0480028c3d06"unist-util-visit-parents@^2.0.0:- version "2.0.1"- resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-2.0.1.tgz#63fffc8929027bee04bfef7d2cce474f71cb6217"+ version "2.1.0"+ resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-2.1.0.tgz#e45cad0d7e5ac683362088b329bc80abd1cfc5fb"dependencies:unist-util-is "^2.1.2"@@ -9361,12 +9357,12 @@ webpack-cli@^3.2.1:yargs "^12.0.5"webpack-dev-middleware@^3.5.1, webpack-dev-middleware@^3.6.2:- version "3.6.2"- resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.6.2.tgz#f37a27ad7c09cd7dc67cd97655413abaa1f55942"+ version "3.7.0"+ resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.7.0.tgz#ef751d25f4e9a5c8a35da600c5fda3582b5c6cff"dependencies:memory-fs "^0.4.1"- mime "^2.3.1"- range-parser "^1.0.3"+ mime "^2.4.2"+ range-parser "^1.2.1"webpack-log "^2.0.0"webpack-dev-server@^3.1.14:@@ -9405,8 +9401,8 @@ webpack-dev-server@^3.1.14:yargs "12.0.5"webpack-hot-middleware@^2.24.3:- version "2.24.4"- resolved "https://registry.yarnpkg.com/webpack-hot-middleware/-/webpack-hot-middleware-2.24.4.tgz#0ae1eeca000c6ffdcb22eb574d0e6d7717672b0f"+ version "2.25.0"+ resolved "https://registry.yarnpkg.com/webpack-hot-middleware/-/webpack-hot-middleware-2.25.0.tgz#4528a0a63ec37f8f8ef565cf9e534d57d09fe706"dependencies:ansi-html "0.0.7"html-entities "^1.2.0"@@ -9420,7 +9416,7 @@ webpack-log@^2.0.0:ansi-colors "^3.0.0"uuid "^3.3.2"-webpack-sources@^1.1.0, webpack-sources@^1.3.0:+webpack-sources@^1.3.0:version "1.3.0"resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85"dependencies:@@ -9546,7 +9542,7 @@ wordwrap@~1.0.0:version "1.0.0"resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"-worker-farm@^1.5.2:+worker-farm@^1.7.0:version "1.7.0"resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8"dependencies: