react-mapbox-gl
Advanced tools
Comparing version 4.8.3 to 4.8.6
@@ -20,2 +20,5 @@ import * as React from 'react'; | ||
onClick?: MouseEvent; | ||
onTouchStart?: MouseEvent; | ||
onTouchEnd?: MouseEvent; | ||
onTouchCancel?: MouseEvent; | ||
} | ||
@@ -22,0 +25,0 @@ export interface LayerCommonProps { |
@@ -29,2 +29,5 @@ var __extends = (this && this.__extends) || (function () { | ||
var eventToHandler = { | ||
touchstart: 'onTouchStart', | ||
touchend: 'onTouchEnd', | ||
touchcancel: 'onTouchCancel', | ||
mousemove: 'onMouseMove', | ||
@@ -31,0 +34,0 @@ mouseenter: 'onMouseEnter', |
@@ -70,3 +70,5 @@ var __assign = (this && this.__assign) || function () { | ||
export var updateEvents = function (listeners, nextProps, map) { | ||
var toListenOff = Object.keys(events).filter(function (eventKey) { return listeners[eventKey] && typeof nextProps[eventKey] !== 'function'; }); | ||
var toListenOff = Object.keys(events).filter(function (eventKey) { | ||
return listeners[eventKey] && nextProps[eventKey] !== listeners[eventKey]; | ||
}); | ||
toListenOff.forEach(function (key) { | ||
@@ -77,3 +79,3 @@ map.off(events[key], listeners[key]); | ||
var toListenOn = Object.keys(events) | ||
.filter(function (key) { return !listeners[key] && typeof nextProps[key] === 'function'; }) | ||
.filter(function (key) { return typeof nextProps[key] === 'function'; }) | ||
.reduce(function (acc, next) { return ((acc[next] = events[next]), acc); }, {}); | ||
@@ -80,0 +82,0 @@ var newListeners = listenEvents(toListenOn, nextProps, map); |
@@ -20,2 +20,5 @@ import * as React from 'react'; | ||
onClick?: MouseEvent; | ||
onTouchStart?: MouseEvent; | ||
onTouchEnd?: MouseEvent; | ||
onTouchCancel?: MouseEvent; | ||
} | ||
@@ -22,0 +25,0 @@ export interface LayerCommonProps { |
@@ -41,2 +41,5 @@ "use strict"; | ||
var eventToHandler = { | ||
touchstart: 'onTouchStart', | ||
touchend: 'onTouchEnd', | ||
touchcancel: 'onTouchCancel', | ||
mousemove: 'onMouseMove', | ||
@@ -43,0 +46,0 @@ mouseenter: 'onMouseEnter', |
@@ -72,3 +72,5 @@ "use strict"; | ||
exports.updateEvents = function (listeners, nextProps, map) { | ||
var toListenOff = Object.keys(exports.events).filter(function (eventKey) { return listeners[eventKey] && typeof nextProps[eventKey] !== 'function'; }); | ||
var toListenOff = Object.keys(exports.events).filter(function (eventKey) { | ||
return listeners[eventKey] && nextProps[eventKey] !== listeners[eventKey]; | ||
}); | ||
toListenOff.forEach(function (key) { | ||
@@ -79,3 +81,3 @@ map.off(exports.events[key], listeners[key]); | ||
var toListenOn = Object.keys(exports.events) | ||
.filter(function (key) { return !listeners[key] && typeof nextProps[key] === 'function'; }) | ||
.filter(function (key) { return typeof nextProps[key] === 'function'; }) | ||
.reduce(function (acc, next) { return ((acc[next] = exports.events[next]), acc); }, {}); | ||
@@ -82,0 +84,0 @@ var newListeners = exports.listenEvents(toListenOn, nextProps, map); |
{ | ||
"name": "react-mapbox-gl", | ||
"version": "4.8.3", | ||
"version": "4.8.6", | ||
"description": "A React binding of mapbox-gl-js", | ||
@@ -22,3 +22,4 @@ "main": "lib/index.js", | ||
"precommit": "npm run prettify && cd example && node generateRaws.js", | ||
"prepush": "npm run build" | ||
"prepush": "npm run build", | ||
"prepare": "echo \"preparing\" && npm run build" | ||
}, | ||
@@ -75,3 +76,3 @@ "jest": { | ||
"peerDependencies": { | ||
"mapbox-gl": "^1.8.1", | ||
"mapbox-gl": "^1.10.1", | ||
"prop-types": "^15.6.2", | ||
@@ -88,3 +89,3 @@ "react": "^16.11.0", | ||
"@types/jest": "24.0.19", | ||
"@types/mapbox-gl": "^1.8.1", | ||
"@types/mapbox-gl": "^1.10.2", | ||
"@types/node": "8.0.29", | ||
@@ -100,3 +101,3 @@ "@types/prettier": "1.10.0", | ||
"jest": "24.9.0", | ||
"mapbox-gl": "^1.8.1", | ||
"mapbox-gl": "^1.10.1", | ||
"prettier": "1.10.2", | ||
@@ -103,0 +104,0 @@ "prop-types": "15.6.2", |
@@ -47,2 +47,5 @@ import * as React from 'react'; | ||
onClick?: MouseEvent; | ||
onTouchStart?: MouseEvent; | ||
onTouchEnd?: MouseEvent; | ||
onTouchCancel?: MouseEvent; | ||
} | ||
@@ -93,2 +96,5 @@ | ||
const eventToHandler: EventToHandlersType = { | ||
touchstart: 'onTouchStart', | ||
touchend: 'onTouchEnd', | ||
touchcancel: 'onTouchCancel', | ||
mousemove: 'onMouseMove', | ||
@@ -95,0 +101,0 @@ mouseenter: 'onMouseEnter', |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
488925
9546