Merge pull request #192 from orangemug/fix/update-deps

Updated dependencies
This commit is contained in:
Orange Mug 2017-11-16 13:04:56 +00:00 committed by GitHub
commit 7dcd6d5552
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 13376 additions and 176 deletions

View file

@ -1,4 +1,4 @@
{ {
"presets": ["es2015", "react"], "presets": ["env", "react"],
"plugins": ["transform-object-rest-spread", "transform-class-properties"] "plugins": ["transform-object-rest-spread", "transform-class-properties"]
} }

View file

@ -3,24 +3,24 @@ addons:
firefox: latest firefox: latest
matrix: matrix:
include: include:
- os: linux
node_js: "4"
- os: linux
env: CXX=g++-4.8
node_js: "5"
- os: linux - os: linux
node_js: "6" node_js: "6"
- os: linux - os: linux
env: CXX=g++-4.8 env: CXX=g++-4.8
node_js: "7" node_js: "7"
- os: osx - os: linux
node_js: "4" node_js: "8"
- os: osx - os: linux
node_js: "5" env: CXX=g++-4.8
node_js: "9"
- os: osx - os: osx
node_js: "6" node_js: "6"
- os: osx - os: osx
node_js: "7" node_js: "7"
- os: osx
node_js: "8"
- os: osx
node_js: "9"
before_install: before_install:
- export CHROME_BIN=chromium-browser - export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0 - export DISPLAY=:99.0

View file

@ -1,8 +1,9 @@
environment: environment:
matrix: matrix:
- nodejs_version: "4"
- nodejs_version: "6" - nodejs_version: "6"
- nodejs_version: "7" - nodejs_version: "7"
- nodejs_version: "8"
- nodejs_version: "9"
platform: platform:
- x86 - x86
- x64 - x64

View file

@ -1,6 +1,6 @@
var webpack = require("webpack"); var webpack = require("webpack");
var WebpackDevServer = require("webpack-dev-server"); var WebpackDevServer = require("webpack-dev-server");
var webpackConfig = require("./webpack.config"); var webpackConfig = require("./webpack.production.config");
var testConfig = require("../test/config/specs"); var testConfig = require("../test/config/specs");
@ -18,7 +18,7 @@ exports.config = {
browserName: 'firefox' browserName: 'firefox'
}], }],
sync: true, sync: true,
logLevel: 'silent', logLevel: 'verbose',
coloredLogs: true, coloredLogs: true,
bail: 0, bail: 0,
screenshotPath: './errorShots/', screenshotPath: './errorShots/',
@ -29,6 +29,9 @@ exports.config = {
services: ['phantomjs'], services: ['phantomjs'],
framework: 'mocha', framework: 'mocha',
reporters: ['spec'], reporters: ['spec'],
phantomjsOpts: {
webdriverLogfile: 'phantomjs.log'
},
mochaOpts: { mochaOpts: {
ui: 'bdd', ui: 'bdd',
// Because we don't know how long the initial build will take... // Because we don't know how long the initial build will take...
@ -36,9 +39,7 @@ exports.config = {
}, },
onPrepare: function (config, capabilities) { onPrepare: function (config, capabilities) {
var compiler = webpack(webpackConfig); var compiler = webpack(webpackConfig);
server = new WebpackDevServer(compiler, { server = new WebpackDevServer(compiler, {});
stats: "minimal"
});
server.listen(testConfig.port); server.listen(testConfig.port);
}, },
onComplete: function(exitCode) { onComplete: function(exitCode) {

View file

@ -20,7 +20,7 @@ module.exports = {
filename: 'bundle.js' filename: 'bundle.js'
}, },
resolve: { resolve: {
extensions: ['', '.js', '.jsx'] extensions: ['.js', '.jsx']
}, },
module: { module: {
noParse: [ noParse: [
@ -54,7 +54,7 @@ module.exports = {
} }
}, },
plugins: [ plugins: [
new webpack.NoErrorsPlugin(), new webpack.NoEmitOnErrorsPlugin(),
new webpack.HotModuleReplacementPlugin(), new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
title: 'Maputnik', title: 'Maputnik',

View file

@ -7,23 +7,23 @@ module.exports = [
{ {
test: /\.jsx?$/, test: /\.jsx?$/,
exclude: /(.*node_modules(?![\/\\]@mapbox[\/\\]mapbox-gl-style-spec)|bower_components|public)/, exclude: /(.*node_modules(?![\/\\]@mapbox[\/\\]mapbox-gl-style-spec)|bower_components|public)/,
loader: 'babel', loader: 'babel-loader',
query: { query: {
presets: ['es2015', 'react'], presets: ['env', 'react'],
plugins: ['transform-runtime', 'transform-decorators-legacy', 'transform-class-properties'], plugins: ['transform-runtime', 'transform-decorators-legacy', 'transform-class-properties'],
} }
}, },
{ {
test: /\.(eot|ttf|woff|woff2)$/, test: /\.(eot|ttf|woff|woff2)$/,
loader: 'file?name=fonts/[name].[ext]' loader: 'file-loader?name=fonts/[name].[ext]'
}, },
{ {
test: /\.ico$/, test: /\.ico$/,
loader: 'file?name=[name].[ext]' loader: 'file-loader?name=[name].[ext]'
}, },
{ {
test: /\.(svg|gif|jpg|png)$/, test: /\.(svg|gif|jpg|png)$/,
loader: 'file?name=img/[name].[ext]' loader: 'file-loader?name=img/[name].[ext]'
}, },
{ {
test: /\.json$/, test: /\.json$/,
@ -36,8 +36,8 @@ module.exports = [
{ {
test: /[\/\\](node_modules|global|src)[\/\\].*\.css$/, test: /[\/\\](node_modules|global|src)[\/\\].*\.css$/,
loaders: [ loaders: [
'style?sourceMap', 'style-loader?sourceMap',
'css' 'css-loader'
] ]
} }
]; ];

View file

@ -43,9 +43,13 @@ module.exports = {
chunkFilename: '[chunkhash].js' chunkFilename: '[chunkhash].js'
}, },
resolve: { resolve: {
extensions: ['', '.js', '.jsx'] extensions: ['.js', '.jsx']
}, },
module: { module: {
noParse: [
/mapbox-gl\/dist\/mapbox-gl.js/,
/openlayers\/dist\/ol.js/
],
loaders loaders
}, },
node: { node: {
@ -54,8 +58,8 @@ module.exports = {
tls: 'empty' tls: 'empty'
}, },
plugins: [ plugins: [
new webpack.NoErrorsPlugin(), new webpack.NoEmitOnErrorsPlugin(),
new webpack.optimize.CommonsChunkPlugin('vendor', '[chunkhash].vendor.js'), new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: '[chunkhash].vendor.js' }),
new WebpackCleanupPlugin(), new WebpackCleanupPlugin(),
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env': { 'process.env': {
@ -68,14 +72,12 @@ module.exports = {
screw_ie8: true, screw_ie8: true,
} }
}), }),
new webpack.optimize.OccurenceOrderPlugin(),
new ExtractTextPlugin('[contenthash].css', { new ExtractTextPlugin('[contenthash].css', {
allChunks: true allChunks: true
}), }),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: './src/template.html', template: './src/template.html',
title: 'Maputnik' title: 'Maputnik'
}), })
new webpack.optimize.DedupePlugin()
] ]
}; };

13131
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -20,41 +20,41 @@
"license": "MIT", "license": "MIT",
"homepage": "https://github.com/maputnik/editor#readme", "homepage": "https://github.com/maputnik/editor#readme",
"dependencies": { "dependencies": {
"@mapbox/mapbox-gl-rtl-text": "^0.1.0", "@mapbox/mapbox-gl-rtl-text": "^0.1.1",
"@mapbox/mapbox-gl-style-spec": "^9.0.1", "@mapbox/mapbox-gl-style-spec": "^10.0.1",
"classnames": "^2.2.5", "classnames": "^2.2.5",
"codemirror": "^5.18.2", "codemirror": "^5.31.0",
"color": "^1.0.3", "color": "^2.0.0",
"file-saver": "^1.3.2", "file-saver": "^1.3.3",
"github-api": "^3.0.0", "github-api": "^3.0.0",
"jsonlint": "josdejong/jsonlint#85a19d7", "jsonlint": "github:josdejong/jsonlint#85a19d7",
"lodash.capitalize": "^4.2.1", "lodash.capitalize": "^4.2.1",
"lodash.clonedeep": "^4.5.0", "lodash.clonedeep": "^4.5.0",
"lodash.isequal": "^4.4.0", "lodash.isequal": "^4.5.0",
"lodash.throttle": "^4.1.1", "lodash.throttle": "^4.1.1",
"mapbox-gl": "^0.40.1", "mapbox-gl": "^0.41.0",
"mapbox-gl-inspect": "^1.2.3", "mapbox-gl-inspect": "^1.2.4",
"maputnik-design": "github:maputnik/design", "maputnik-design": "github:maputnik/design",
"mousetrap": "^1.6.0", "mousetrap": "^1.6.1",
"ol-mapbox-style": "1.0.1", "ol-mapbox-style": "^1.0.1",
"openlayers": "^3.19.1", "openlayers": "^4.4.2",
"prop-types": "^15.6.0", "prop-types": "^15.6.0",
"react": "^15.4.0", "react": "16.0.0",
"react-addons-pure-render-mixin": "^15.4.0", "react-addons-pure-render-mixin": "^15.6.2",
"react-autocomplete": "^1.4.0", "react-autocomplete": "^1.7.2",
"react-codemirror": "^1.0.0", "react-codemirror": "^1.0.0",
"react-collapse": "^4.0.3", "react-collapse": "^4.0.3",
"react-color": "^2.10.0", "react-color": "^2.13.8",
"react-copy-to-clipboard": "^5.0.1", "react-copy-to-clipboard": "^5.0.1",
"react-dom": "^15.4.0", "react-dom": "16.0.0",
"react-file-reader-input": "^1.1.0", "react-file-reader-input": "^1.1.4",
"react-height": "^3.0.0", "react-height": "^3.0.0",
"react-icon-base": "^2.0.4", "react-icon-base": "^2.1.1",
"react-icons": "^2.2.1", "react-icons": "^2.2.7",
"react-motion": "^0.4.7", "react-motion": "^0.5.2",
"react-sortable-hoc": "^0.6.8", "react-sortable-hoc": "^0.6.8",
"reconnecting-websocket": "^3.0.3", "reconnecting-websocket": "^3.2.2",
"request": "^2.79.0", "request": "^2.83.0",
"url": "^0.11.0" "url": "^0.11.0"
}, },
"jshintConfig": { "jshintConfig": {
@ -67,7 +67,7 @@
"plugins": [ "plugins": [
"react" "react"
], ],
"extend": [ "extends": [
"plugin:react/recommended" "plugin:react/recommended"
], ],
"env": { "env": {
@ -87,45 +87,45 @@
} }
}, },
"devDependencies": { "devDependencies": {
"babel-core": "6.21.0", "babel-core": "^6.26.0",
"babel-eslint": "^7.1.1", "babel-eslint": "^8.0.2",
"babel-loader": "6.2.10", "babel-loader": "7.1.1",
"babel-plugin-transform-class-properties": "^6.11.5", "babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-flow-strip-types": "^6.21.0", "babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.8.0", "babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.15.0", "babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "6.18.0", "babel-preset-env": "^1.6.1",
"babel-preset-react": "6.16.0", "babel-preset-react": "^6.24.1",
"babel-runtime": "^6.11.6", "babel-runtime": "^6.26.0",
"base64-loader": "^1.0.0", "base64-loader": "^1.0.0",
"css-loader": "0.26.1", "css-loader": "^0.28.7",
"eslint": "^3.5.0", "eslint": "^4.10.0",
"eslint-plugin-react": "^6.2.0", "eslint-plugin-react": "^7.4.0",
"extract-text-webpack-plugin": "^1.0.1", "extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^0.11.1", "file-loader": "^1.1.5",
"html-webpack-plugin": "^2.22.0", "html-webpack-plugin": "^2.30.1",
"json-loader": "^0.5.4", "json-loader": "^0.5.7",
"karma": "^1.3.0", "karma": "^1.7.1",
"karma-chrome-launcher": "^2.0.0", "karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.0.0", "karma-firefox-launcher": "^1.0.1",
"karma-mocha": "^1.3.0", "karma-mocha": "^1.3.0",
"karma-webpack": "^2.0.1", "karma-webpack": "^2.0.5",
"mocha": "^3.1.2", "mocha": "^4.0.1",
"mocha-loader": "^1.0.0", "mocha-loader": "^1.1.1",
"node-sass": "^4.2.0", "node-sass": "^4.6.0",
"react-hot-loader": "^3.0.0-beta.6", "react-hot-loader": "^3.1.1",
"sass-loader": "^4.0.1", "sass-loader": "^6.0.6",
"style-loader": "0.13.1", "style-loader": "^0.19.0",
"stylelint": "^7.7.1", "stylelint": "^7.13.0",
"stylelint-config-standard": "^15.0.1", "stylelint-config-standard": "^15.0.1",
"transform-loader": "^0.2.3", "transform-loader": "^0.2.4",
"wdio-mocha-framework": "^0.5.9", "wdio-mocha-framework": "^0.5.11",
"wdio-phantomjs-service": "^0.2.2", "wdio-phantomjs-service": "^0.2.2",
"wdio-spec-reporter": "^0.1.0", "wdio-spec-reporter": "^0.1.2",
"webdriverio": "^4.6.2", "webdriverio": "^4.8.0",
"webpack": "1.14.0", "webpack": "^3.8.1",
"webpack-cleanup-plugin": "^0.4.1", "webpack-cleanup-plugin": "^0.5.1",
"webpack-dev-server": "1.16.2" "webpack-dev-server": "^2.9.4"
} }
} }

View file

@ -10,7 +10,7 @@ import AppLayout from './AppLayout'
import MessagePanel from './MessagePanel' import MessagePanel from './MessagePanel'
import { downloadGlyphsMetadata, downloadSpriteMetadata } from '../libs/metadata' import { downloadGlyphsMetadata, downloadSpriteMetadata } from '../libs/metadata'
import styleSpec from '@mapbox/mapbox-gl-style-spec' import styleSpec from '@mapbox/mapbox-gl-style-spec/style-spec'
import style from '../libs/style.js' import style from '../libs/style.js'
import { initialStyleUrl, loadStyleUrl } from '../libs/urlopen' import { initialStyleUrl, loadStyleUrl } from '../libs/urlopen'
import { undoMessages, redoMessages } from '../libs/diffmessage' import { undoMessages, redoMessages } from '../libs/diffmessage'

View file

@ -7,6 +7,7 @@ class Button extends React.Component {
onClick: PropTypes.func, onClick: PropTypes.func,
style: PropTypes.object, style: PropTypes.object,
className: PropTypes.string, className: PropTypes.string,
children: PropTypes.node
} }
render() { render() {

View file

@ -9,11 +9,11 @@ class MessagePanel extends React.Component {
render() { render() {
const errors = this.props.errors.map((m, i) => { const errors = this.props.errors.map((m, i) => {
return <p className="maputnik-message-panel-error">{m}</p> return <p key={"error-"+i} className="maputnik-message-panel-error">{m}</p>
}) })
const infos = this.props.infos.map((m, i) => { const infos = this.props.infos.map((m, i) => {
return <p key={i}>{m}</p> return <p key={"info-"+i}>{m}</p>
}) })
return <div className="maputnik-message-panel"> return <div className="maputnik-message-panel">

View file

@ -1,9 +1,16 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types'
const ScrollContainer = (props) => { class ScrollContainer extends React.Component {
static propTypes = {
children: PropTypes.node
}
render() {
return <div className="maputnik-scroll-container"> return <div className="maputnik-scroll-container">
{props.children} {this.props.children}
</div> </div>
}
} }
export default ScrollContainer export default ScrollContainer

View file

@ -25,28 +25,49 @@ import OpenModal from './modals/OpenModal'
import style from '../libs/style' import style from '../libs/style'
function IconText(props) { class IconText extends React.Component {
return <span className="maputnik-icon-text">{props.children}</span> static propTypes = {
children: PropTypes.node,
}
render() {
return <span className="maputnik-icon-text">{this.props.children}</span>
}
} }
function ToolbarLink(props) { class ToolbarLink extends React.Component {
static propTypes = {
className: PropTypes.string,
children: PropTypes.node,
href: PropTypes.string,
}
render() {
return <a return <a
className={classnames('maputnik-toolbar-link', props.className)} className={classnames('maputnik-toolbar-link', this.props.className)}
href={props.href} href={this.props.href}
rel="noopener noreferrer" rel="noopener noreferrer"
target="_blank" target="_blank"
> >
{props.children} {this.props.children}
</a> </a>
}
} }
function ToolbarAction(props) { class ToolbarAction extends React.Component {
static propTypes = {
children: PropTypes.node,
onClick: PropTypes.func
}
render() {
return <a return <a
className='maputnik-toolbar-action' className='maputnik-toolbar-action'
onClick={props.onClick} onClick={this.props.onClick}
> >
{props.children} {this.props.children}
</a> </a>
}
} }
export default class Toolbar extends React.Component { export default class Toolbar extends React.Component {
@ -58,7 +79,8 @@ export default class Toolbar extends React.Component {
onStyleOpen: PropTypes.func.isRequired, onStyleOpen: PropTypes.func.isRequired,
// A dict of source id's and the available source layers // A dict of source id's and the available source layers
sources: PropTypes.object.isRequired, sources: PropTypes.object.isRequired,
onInspectModeToggle: PropTypes.func.isRequired onInspectModeToggle: PropTypes.func.isRequired,
children: PropTypes.node
} }
constructor(props) { constructor(props) {

View file

@ -30,7 +30,7 @@ class ColorField extends React.Component {
//but I am too stupid to get it to work together with fixed position //but I am too stupid to get it to work together with fixed position
//and scrollbars so I have to fallback to JavaScript //and scrollbars so I have to fallback to JavaScript
calcPickerOffset() { calcPickerOffset() {
const elem = this.refs.colorInput const elem = this.colorInput
if(elem) { if(elem) {
const pos = elem.getBoundingClientRect() const pos = elem.getBoundingClientRect()
return { return {
@ -99,7 +99,7 @@ class ColorField extends React.Component {
<div className="maputnik-color-swatch" style={swatchStyle}></div> <div className="maputnik-color-swatch" style={swatchStyle}></div>
<input <input
className="maputnik-color" className="maputnik-color"
ref="colorInput" ref={(input) => this.colorInput = input}
onClick={this.togglePicker.bind(this)} onClick={this.togglePicker.bind(this)}
style={this.props.style} style={this.props.style}
name={this.props.name} name={this.props.name}

View file

@ -315,12 +315,19 @@ export default class FunctionSpecProperty extends React.Component {
} }
} }
function MakeFunctionButtons(props) { class MakeFunctionButtons extends React.Component {
static propTypes = {
fieldSpec: PropTypes.object,
onZoomClick: PropTypes.func,
onDataClick: PropTypes.func,
}
render() {
let makeZoomButton, makeDataButton let makeZoomButton, makeDataButton
if (props.fieldSpec['zoom-function']) { if (this.props.fieldSpec['zoom-function']) {
makeZoomButton = <Button makeZoomButton = <Button
className="maputnik-make-zoom-function" className="maputnik-make-zoom-function"
onClick={props.onZoomClick} onClick={this.props.onZoomClick}
> >
<DocLabel <DocLabel
label={<FunctionIcon />} label={<FunctionIcon />}
@ -329,10 +336,10 @@ function MakeFunctionButtons(props) {
/> />
</Button> </Button>
if (props.fieldSpec['property-function'] && ['piecewise-constant', 'interpolated'].indexOf(props.fieldSpec['function']) !== -1) { if (this.props.fieldSpec['property-function'] && ['piecewise-constant', 'interpolated'].indexOf(this.props.fieldSpec['function']) !== -1) {
makeDataButton = <Button makeDataButton = <Button
className="maputnik-make-data-function" className="maputnik-make-data-function"
onClick={props.onDataClick} onClick={this.props.onDataClick}
> >
<DocLabel <DocLabel
label={<MdInsertChart />} label={<MdInsertChart />}
@ -346,18 +353,25 @@ function MakeFunctionButtons(props) {
else { else {
return null return null
} }
}
} }
function DeleteStopButton(props) { class DeleteStopButton extends React.Component {
static propTypes = {
onClick: PropTypes.func,
}
render() {
return <Button return <Button
className="maputnik-delete-stop" className="maputnik-delete-stop"
onClick={props.onClick} onClick={this.props.onClick}
> >
<DocLabel <DocLabel
label={<DeleteIcon />} label={<DeleteIcon />}
doc={"Remove zoom level stop."} doc={"Remove zoom level stop."}
/> />
</Button> </Button>
}
} }
function labelFromFieldName(fieldName) { function labelFromFieldName(fieldName) {

View file

@ -2,7 +2,7 @@ import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { combiningFilterOps } from '../../libs/filterops.js' import { combiningFilterOps } from '../../libs/filterops.js'
import styleSpec from '@mapbox/mapbox-gl-style-spec' import styleSpec from '@mapbox/mapbox-gl-style-spec/style-spec'
import DocLabel from '../fields/DocLabel' import DocLabel from '../fields/DocLabel'
import SelectInput from '../inputs/SelectInput' import SelectInput from '../inputs/SelectInput'
import SingleFilterEditor from './SingleFilterEditor' import SingleFilterEditor from './SingleFilterEditor'

View file

@ -17,7 +17,7 @@ class AutocompleteInput extends React.Component {
} }
render() { render() {
const AutocompleteMenu = (items, value, style) => <div className={"maputnik-autocomplete-menu"} children={items} /> const AutocompleteMenu = (items, value, style) => <div className={"maputnik-autocomplete-menu"}>{items}</div>
return <Autocomplete return <Autocomplete
wrapperProps={{ wrapperProps={{

View file

@ -13,6 +13,7 @@ class DynamicArrayInput extends React.Component {
type: PropTypes.string, type: PropTypes.string,
default: PropTypes.array, default: PropTypes.array,
onChange: PropTypes.func, onChange: PropTypes.func,
style: PropTypes.object,
} }
changeValue(idx, newValue) { changeValue(idx, newValue) {
@ -84,10 +85,15 @@ class DynamicArrayInput extends React.Component {
} }
} }
function DeleteValueButton(props) { class DeleteValueButton extends React.Component {
static propTypes = {
onClick: PropTypes.func,
}
render() {
return <Button return <Button
className="maputnik-delete-stop" className="maputnik-delete-stop"
onClick={props.onClick} onClick={this.props.onClick}
> >
<DocLabel <DocLabel
label={<DeleteIcon />} label={<DeleteIcon />}
@ -95,5 +101,6 @@ function DeleteValueButton(props) {
/> />
</Button> </Button>
} }
}
export default DynamicArrayInput export default DynamicArrayInput

View file

@ -5,6 +5,7 @@ import AutocompleteInput from './AutocompleteInput'
class FontInput extends React.Component { class FontInput extends React.Component {
static propTypes = { static propTypes = {
value: PropTypes.array.isRequired, value: PropTypes.array.isRequired,
default: PropTypes.array,
fonts: PropTypes.array, fonts: PropTypes.array,
style: PropTypes.object, style: PropTypes.object,
onChange: PropTypes.func.isRequired, onChange: PropTypes.func.isRequired,

View file

@ -14,6 +14,7 @@ class InputBlock extends React.Component {
action: PropTypes.element, action: PropTypes.element,
children: PropTypes.element.isRequired, children: PropTypes.element.isRequired,
style: PropTypes.object, style: PropTypes.object,
onChange: PropTypes.func,
} }
onChange(e) { onChange(e) {

View file

@ -7,6 +7,7 @@ class StringInput extends React.Component {
style: PropTypes.object, style: PropTypes.object,
default: PropTypes.string, default: PropTypes.string,
onChange: PropTypes.func, onChange: PropTypes.func,
multi: PropTypes.bool,
} }
constructor(props) { constructor(props) {

View file

@ -1,7 +1,7 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import styleSpec from '@mapbox/mapbox-gl-style-spec' import styleSpec from '@mapbox/mapbox-gl-style-spec/style-spec'
import InputBlock from '../inputs/InputBlock' import InputBlock from '../inputs/InputBlock'
import StringInput from '../inputs/StringInput' import StringInput from '../inputs/StringInput'

View file

@ -1,7 +1,7 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import styleSpec from '@mapbox/mapbox-gl-style-spec' import styleSpec from '@mapbox/mapbox-gl-style-spec/style-spec'
import InputBlock from '../inputs/InputBlock' import InputBlock from '../inputs/InputBlock'
import StringInput from '../inputs/StringInput' import StringInput from '../inputs/StringInput'
import SelectInput from '../inputs/SelectInput' import SelectInput from '../inputs/SelectInput'

View file

@ -1,7 +1,7 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import styleSpec from '@mapbox/mapbox-gl-style-spec' import styleSpec from '@mapbox/mapbox-gl-style-spec/style-spec'
import InputBlock from '../inputs/InputBlock' import InputBlock from '../inputs/InputBlock'
import StringInput from '../inputs/StringInput' import StringInput from '../inputs/StringInput'
import SelectInput from '../inputs/SelectInput' import SelectInput from '../inputs/SelectInput'

View file

@ -1,7 +1,7 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import styleSpec from '@mapbox/mapbox-gl-style-spec' import styleSpec from '@mapbox/mapbox-gl-style-spec/style-spec'
import InputBlock from '../inputs/InputBlock' import InputBlock from '../inputs/InputBlock'
import SelectInput from '../inputs/SelectInput' import SelectInput from '../inputs/SelectInput'

View file

@ -1,7 +1,7 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import styleSpec from '@mapbox/mapbox-gl-style-spec' import styleSpec from '@mapbox/mapbox-gl-style-spec/style-spec'
import InputBlock from '../inputs/InputBlock' import InputBlock from '../inputs/InputBlock'
import NumberInput from '../inputs/NumberInput' import NumberInput from '../inputs/NumberInput'

View file

@ -1,7 +1,7 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import styleSpec from '@mapbox/mapbox-gl-style-spec' import styleSpec from '@mapbox/mapbox-gl-style-spec/style-spec'
import InputBlock from '../inputs/InputBlock' import InputBlock from '../inputs/InputBlock'
import NumberInput from '../inputs/NumberInput' import NumberInput from '../inputs/NumberInput'

View file

@ -1,4 +1,5 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types'
import InputBlock from '../inputs/InputBlock' import InputBlock from '../inputs/InputBlock'
import StringInput from '../inputs/StringInput' import StringInput from '../inputs/StringInput'
import LayerIcon from '../icons/LayerIcon' import LayerIcon from '../icons/LayerIcon'
@ -14,6 +15,10 @@ function groupFeaturesBySourceLayer(features) {
} }
class FeatureLayerPopup extends React.Component { class FeatureLayerPopup extends React.Component {
static propTypes = {
features: PropTypes.array
}
render() { render() {
const sources = groupFeaturesBySourceLayer(this.props.features) const sources = groupFeaturesBySourceLayer(this.props.features)

View file

@ -1,4 +1,5 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types'
import InputBlock from '../inputs/InputBlock' import InputBlock from '../inputs/InputBlock'
import StringInput from '../inputs/StringInput' import StringInput from '../inputs/StringInput'
@ -31,6 +32,9 @@ function renderFeature(feature) {
} }
class FeaturePropertyPopup extends React.Component { class FeaturePropertyPopup extends React.Component {
static propTypes = {
features: PropTypes.array
}
render() { render() {
const features = this.props.features const features = this.props.features

View file

@ -69,6 +69,7 @@ class OpenLayers3Map extends React.Component {
onDataChange: PropTypes.func, onDataChange: PropTypes.func,
mapStyle: PropTypes.object.isRequired, mapStyle: PropTypes.object.isRequired,
accessToken: PropTypes.string, accessToken: PropTypes.string,
style: PropTypes.object,
} }
static defaultProps = { static defaultProps = {

View file

@ -2,7 +2,7 @@ import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { saveAs } from 'file-saver' import { saveAs } from 'file-saver'
import styleSpec from '@mapbox/mapbox-gl-style-spec' import styleSpec from '@mapbox/mapbox-gl-style-spec/style-spec'
import InputBlock from '../inputs/InputBlock' import InputBlock from '../inputs/InputBlock'
import StringInput from '../inputs/StringInput' import StringInput from '../inputs/StringInput'
import SelectInput from '../inputs/SelectInput' import SelectInput from '../inputs/SelectInput'

View file

@ -8,6 +8,7 @@ class Modal extends React.Component {
isOpen: PropTypes.bool.isRequired, isOpen: PropTypes.bool.isRequired,
title: PropTypes.string.isRequired, title: PropTypes.string.isRequired,
onOpenToggle: PropTypes.func.isRequired, onOpenToggle: PropTypes.func.isRequired,
children: PropTypes.node,
} }
render() { render() {

View file

@ -77,7 +77,7 @@ class OpenModal extends React.Component {
} }
onOpenUrl() { onOpenUrl() {
const url = this.refs.styleUrl.value; const url = this.styleUrlElement.value;
this.onStyleSelect(url); this.onStyleSelect(url);
} }
@ -151,7 +151,7 @@ class OpenModal extends React.Component {
<p> <p>
Load from a URL. Note that the URL must have <a href="https://enable-cors.org" target="_blank" rel="noopener noreferrer">CORS enabled</a>. Load from a URL. Note that the URL must have <a href="https://enable-cors.org" target="_blank" rel="noopener noreferrer">CORS enabled</a>.
</p> </p>
<input type="text" ref="styleUrl" className="maputnik-input" placeholder="Enter URL..."/> <input type="text" ref={(input) => this.styleUrlElement = input} className="maputnik-input" placeholder="Enter URL..."/>
<div> <div>
<Button className="maputnik-big-button" onClick={this.onOpenUrl.bind(this)}>Open URL</Button> <Button className="maputnik-big-button" onClick={this.onOpenUrl.bind(this)}>Open URL</Button>
</div> </div>

View file

@ -1,7 +1,7 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import styleSpec from '@mapbox/mapbox-gl-style-spec' import styleSpec from '@mapbox/mapbox-gl-style-spec/style-spec'
import InputBlock from '../inputs/InputBlock' import InputBlock from '../inputs/InputBlock'
import StringInput from '../inputs/StringInput' import StringInput from '../inputs/StringInput'
import SelectInput from '../inputs/SelectInput' import SelectInput from '../inputs/SelectInput'

View file

@ -1,6 +1,6 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import styleSpec from '@mapbox/mapbox-gl-style-spec' import styleSpec from '@mapbox/mapbox-gl-style-spec/style-spec'
import Modal from './Modal' import Modal from './Modal'
import Button from '../Button' import Button from '../Button'
import InputBlock from '../inputs/InputBlock' import InputBlock from '../inputs/InputBlock'
@ -139,7 +139,7 @@ class AddSource extends React.Component {
onChange={v => this.setState({ sourceId: v})} onChange={v => this.setState({ sourceId: v})}
/> />
</InputBlock> </InputBlock>
<InputBlock label={"Source Type"} doc={styleSpec.latest.source_tile.type.doc}> <InputBlock label={"Source Type"} doc={styleSpec.latest.source_vector.type.doc}>
<SelectInput <SelectInput
options={[ options={[
['geojson', 'GeoJSON'], ['geojson', 'GeoJSON'],

View file

@ -1,6 +1,6 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import styleSpec from '@mapbox/mapbox-gl-style-spec' import styleSpec from '@mapbox/mapbox-gl-style-spec/style-spec'
import InputBlock from '../inputs/InputBlock' import InputBlock from '../inputs/InputBlock'
import StringInput from '../inputs/StringInput' import StringInput from '../inputs/StringInput'
import NumberInput from '../inputs/NumberInput' import NumberInput from '../inputs/NumberInput'
@ -12,7 +12,7 @@ class TileJSONSourceEditor extends React.Component {
} }
render() { render() {
return <InputBlock label={"TileJSON URL"} doc={styleSpec.latest.source_tile.url.doc}> return <InputBlock label={"TileJSON URL"} doc={styleSpec.latest.source_vector.url.doc}>
<StringInput <StringInput
value={this.props.source.url} value={this.props.source.url}
onChange={url => this.props.onChange({ onChange={url => this.props.onChange({
@ -43,7 +43,7 @@ class TileURLSourceEditor extends React.Component {
const prefix = ['1st', '2nd', '3rd', '4th', '5th', '6th', '7th'] const prefix = ['1st', '2nd', '3rd', '4th', '5th', '6th', '7th']
const tiles = this.props.source.tiles || [] const tiles = this.props.source.tiles || []
return tiles.map((tileUrl, tileIndex) => { return tiles.map((tileUrl, tileIndex) => {
return <InputBlock key={tileIndex} label={prefix[tileIndex] + " Tile URL"} doc={styleSpec.latest.source_tile.tiles.doc}> return <InputBlock key={tileIndex} label={prefix[tileIndex] + " Tile URL"} doc={styleSpec.latest.source_vector.tiles.doc}>
<StringInput <StringInput
value={tileUrl} value={tileUrl}
onChange={this.changeTileUrl.bind(this, tileIndex)} onChange={this.changeTileUrl.bind(this, tileIndex)}
@ -55,7 +55,7 @@ class TileURLSourceEditor extends React.Component {
render() { render() {
return <div> return <div>
{this.renderTileUrls()} {this.renderTileUrls()}
<InputBlock label={"Min Zoom"} doc={styleSpec.latest.source_tile.minzoom.doc}> <InputBlock label={"Min Zoom"} doc={styleSpec.latest.source_vector.minzoom.doc}>
<NumberInput <NumberInput
value={this.props.source.minzoom || 0} value={this.props.source.minzoom || 0}
onChange={minzoom => this.props.onChange({ onChange={minzoom => this.props.onChange({
@ -64,7 +64,7 @@ class TileURLSourceEditor extends React.Component {
})} })}
/> />
</InputBlock> </InputBlock>
<InputBlock label={"Max Zoom"} doc={styleSpec.latest.source_tile.maxzoom.doc}> <InputBlock label={"Max Zoom"} doc={styleSpec.latest.source_vector.maxzoom.doc}>
<NumberInput <NumberInput
value={this.props.source.maxzoom || 22} value={this.props.source.maxzoom || 22}
onChange={maxzoom => this.props.onChange({ onChange={maxzoom => this.props.onChange({

View file

@ -1,4 +1,4 @@
import styleSpec from '@mapbox/mapbox-gl-style-spec' import styleSpec from '@mapbox/mapbox-gl-style-spec/style-spec'
export function diffMessages(beforeStyle, afterStyle) { export function diffMessages(beforeStyle, afterStyle) {
const changes = styleSpec.diff(beforeStyle, afterStyle) const changes = styleSpec.diff(beforeStyle, afterStyle)

View file

@ -1,4 +1,4 @@
import styleSpec from '@mapbox/mapbox-gl-style-spec' import styleSpec from '@mapbox/mapbox-gl-style-spec/style-spec'
export const combiningFilterOps = ['all', 'any', 'none'] export const combiningFilterOps = ['all', 'any', 'none']
export const setFilterOps = ['in', '!in'] export const setFilterOps = ['in', '!in']
export const otherFilterOps = Object export const otherFilterOps = Object

View file

@ -1,4 +1,4 @@
import styleSpec from '@mapbox/mapbox-gl-style-spec' import styleSpec from '@mapbox/mapbox-gl-style-spec/style-spec'
export function changeType(layer, newType) { export function changeType(layer, newType) {
const changedPaintProps = { ...layer.paint } const changedPaintProps = { ...layer.paint }

View file

@ -1,7 +1,7 @@
import MapboxGl from 'mapbox-gl/dist/mapbox-gl.js' import MapboxGl from 'mapbox-gl/dist/mapbox-gl.js'
// Load mapbox-gl-rtl-text using object urls without needing http://localhost for AJAX. // Load mapbox-gl-rtl-text using object urls without needing http://localhost for AJAX.
const data = require("base64?mimetype=text/javascript!@mapbox/mapbox-gl-rtl-text/mapbox-gl-rtl-text.js"); const data = require("base64-loader?mimetype=text/javascript!@mapbox/mapbox-gl-rtl-text/mapbox-gl-rtl-text.js");
const blob = new window.Blob([window.atob(data)]); const blob = new window.Blob([window.atob(data)]);
const objectUrl = window.URL.createObjectURL(blob, { const objectUrl = window.URL.createObjectURL(blob, {