@react-google-maps/api
Advanced tools
Comparing version 1.2.3-alpha.11 to 1.2.3
# Changelog | ||
## 1.2.3 Added MarkerClusterer refactored to typescript. | ||
- Removed instans persistance feature due to bugs with google-maps-api. | ||
- UMD and ESM builds | ||
- Added new onMouseUp and onMouseDown props for `<GoogleMap />` component | ||
## 1.2.2 fix draggable type on Marker, export Types alongside with Components, useGoogleMap hook | ||
@@ -4,0 +12,0 @@ |
@@ -8,3 +8,2 @@ /// <reference types="googlemaps" /> | ||
id?: string; | ||
reuseSameInstance?: boolean; | ||
mapContainerStyle?: React.CSSProperties; | ||
@@ -11,0 +10,0 @@ mapContainerClassName?: string; |
@@ -15,26 +15,5 @@ "use strict"; | ||
})(); | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) | ||
t[p[i]] = s[p[i]]; | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var React = require("react"); | ||
var map_context_1 = require("./map-context"); | ||
var instance_persistance_1 = require("./utils/instance-persistance"); | ||
var helper_1 = require("./utils/helper"); | ||
@@ -49,2 +28,4 @@ var eventMap = { | ||
onMouseOver: "mouseover", | ||
onMouseDown: "mousedown", | ||
onMouseUp: "mouseup", | ||
onRightClick: "rightclick", | ||
@@ -104,7 +85,3 @@ onTilesLoaded: "tilesloaded", | ||
_this.getInstance = function () { | ||
var _a = _this.props, reuseSameInstance = _a.reuseSameInstance, id = _a.id, rest = __rest(_a, ["reuseSameInstance", "id"]); | ||
var instance = reuseSameInstance && instance_persistance_1.restoreInstance(__assign({}, rest, { id: id || "defaultMapId" })); | ||
return instance | ||
? instance | ||
: new google.maps.Map(_this.mapRef, _this.props.options); | ||
return new google.maps.Map(_this.mapRef, _this.props.options); | ||
}; | ||
@@ -153,5 +130,2 @@ _this.setMapCallback = function () { | ||
if (this.state.map !== null) { | ||
if (this.props.reuseSameInstance) { | ||
instance_persistance_1.saveInstance(this.props.id || "defaultMapId", this.state.map); | ||
} | ||
if (this.props.onUnmount) { | ||
@@ -158,0 +132,0 @@ this.props.onUnmount(this.state.map); |
{ | ||
"name": "@react-google-maps/api", | ||
"version": "1.2.3-alpha.11", | ||
"version": "1.2.3", | ||
"description": "React.js Google Maps API integration", | ||
@@ -28,4 +28,4 @@ "license": "MIT", | ||
"main": "lib/index.js", | ||
"browser": "lib/index.js", | ||
"module": "lib/index.js", | ||
"browser": "umd/index.js", | ||
"module": "esm/index.js", | ||
"types": "lib/index.d.ts", | ||
@@ -74,3 +74,6 @@ "files": [ | ||
"scripts": { | ||
"build": "rimraf ./lib && tsc", | ||
"build": "yarn build:commonjs && yarn build:esm && yarn build:umd", | ||
"build:commonjs": "rimraf ./lib && tsc -p ./tsconfig.json", | ||
"build:esm": "rimraf ./esm && tsc -p ./tsconfig-esm.json", | ||
"build:umd": "rimraf ./umd && tsc -p ./tsconfig-umd.json", | ||
"clean": "rimraf ./package-lock.json ./yarn.lock ./node_modules/ && yarn", | ||
@@ -81,4 +84,4 @@ "update": "yarn-check -u", | ||
"pub:next": "yarn build && npm publish . --tag next", | ||
"docs:dev": "npx styleguidist server", | ||
"docs:build": "npx styleguidist build", | ||
"docs:dev": "npx styleguidist server --config ./styleguide.config.js --verbose", | ||
"docs:build": "npx styleguidist build --config ./styleguide.config.js --verbose", | ||
"tc": "tsc -p ./tsconfig.json --noEmit --traceResolution", | ||
@@ -88,4 +91,4 @@ "test": "jest" | ||
"dependencies": { | ||
"@react-google-maps/marker-clusterer": "1.2.3-alpha.8", | ||
"@types/googlemaps": "3.30.19", | ||
"@react-google-maps/marker-clusterer": "1.2.3", | ||
"@types/googlemaps": "3.36.0", | ||
"invariant": "2.2.4" | ||
@@ -101,7 +104,7 @@ }, | ||
"@types/invariant": "2.2.29", | ||
"@types/jest": "24.0.12", | ||
"@types/react": "16.8.15", | ||
"@types/jest": "24.0.13", | ||
"@types/react": "16.8.18", | ||
"@types/react-dom": "16.8.4", | ||
"@typescript-eslint/eslint-plugin": "1.7.0", | ||
"@typescript-eslint/parser": "1.7.0", | ||
"@typescript-eslint/eslint-plugin": "1.9.0", | ||
"@typescript-eslint/parser": "1.9.0", | ||
"acorn": "6.1.1", | ||
@@ -117,29 +120,30 @@ "awesome-typescript-loader": "5.2.1", | ||
"eslint-plugin-filenames": "1.3.2", | ||
"eslint-plugin-html": "5.0.3", | ||
"eslint-plugin-import": "2.17.2", | ||
"eslint-plugin-html": "5.0.5", | ||
"eslint-plugin-import": "2.17.3", | ||
"eslint-plugin-json": "1.4.0", | ||
"eslint-plugin-jsx-a11y": "6.2.1", | ||
"eslint-plugin-no-inferred-method-name": "1.0.2", | ||
"eslint-plugin-node": "8.0.1", | ||
"eslint-plugin-node": "9.1.0", | ||
"eslint-plugin-optimize-regex": "1.1.6", | ||
"eslint-plugin-promise": "4.1.1", | ||
"eslint-plugin-react": "7.12.4", | ||
"eslint-plugin-react": "7.13.0", | ||
"eslint-plugin-react-functional-set-state": "1.2.1", | ||
"eslint-plugin-react-hooks": "1.6.0", | ||
"eslint-plugin-react-perf": "3.1.0", | ||
"eslint-plugin-standard": "4.0.0", | ||
"eslint-plugin-you-dont-need-lodash-underscore": "6.4.0", | ||
"husky": "2.2.0", | ||
"jest": "24.7.1", | ||
"jest-cli": "24.7.1", | ||
"eslint-plugin-you-dont-need-lodash-underscore": "6.5.0", | ||
"husky": "2.3.0", | ||
"jest": "24.8.0", | ||
"jest-cli": "24.8.0", | ||
"react": "16.8.6", | ||
"react-docgen-typescript": "1.12.4", | ||
"react-dom": "16.8.6", | ||
"react-styleguidist": "8.0.6", | ||
"react-testing-library": "7.0.0", | ||
"react-styleguidist": "9.1.2", | ||
"react-testing-library": "7.0.1", | ||
"rimraf": "2.6.3", | ||
"ts-jest": "24.0.2", | ||
"typescript": "3.4.5", | ||
"webpack": "4.30.0" | ||
"webpack": "4.32.2" | ||
}, | ||
"gitHead": "4c487da5fec5e5d9e86f8d445248353b1f532a59" | ||
} |
@@ -82,1 +82,5 @@ # @react-google-maps/api | ||
Since version 1.2.2 We added useGoogleMap hook, which is working only with React@16.8.1 and later versions. | ||
## Websites made with @react-google-maps-api | ||
[DriveFromTo.com](https://www.drivefromto.com/en) Transfer Booking service PWA. |
148
src/index.ts
@@ -1,20 +0,20 @@ | ||
export { | ||
default as GoogleMap, | ||
GoogleMapProps | ||
} from "./GoogleMap"; | ||
export { | ||
default as GoogleMap, | ||
GoogleMapProps | ||
} from "./GoogleMap" | ||
export { | ||
default as LoadScript, | ||
LoadScriptProps | ||
} from "./LoadScript"; | ||
export { | ||
default as LoadScript, | ||
LoadScriptProps | ||
} from "./LoadScript" | ||
export { | ||
default as TrafficLayer, | ||
TrafficLayerProps | ||
} from "./components/maps/TrafficLayer"; | ||
export { | ||
default as TrafficLayer, | ||
TrafficLayerProps | ||
} from "./components/maps/TrafficLayer" | ||
export { | ||
default as BicyclingLayer, | ||
BicyclingLayerProps | ||
} from "./components/maps/BicyclingLayer"; | ||
export { | ||
default as BicyclingLayer, | ||
BicyclingLayerProps | ||
} from "./components/maps/BicyclingLayer" | ||
@@ -24,8 +24,8 @@ export { | ||
DrawingManagerProps | ||
} from "./components/drawing/DrawingManager"; | ||
} from "./components/drawing/DrawingManager" | ||
export { | ||
default as Marker, | ||
MarkerProps | ||
} from "./components/drawing/Marker"; | ||
export { | ||
default as Marker, | ||
MarkerProps | ||
} from "./components/drawing/Marker" | ||
@@ -35,53 +35,53 @@ export { | ||
ClustererProps as MarkerClustererProps | ||
} from "./components/addons/MarkerClusterer"; | ||
} from "./components/addons/MarkerClusterer" | ||
export { | ||
default as InfoWindow, | ||
InfoWindowProps | ||
} from "./components/drawing/InfoWindow"; | ||
export { | ||
default as InfoWindow, | ||
InfoWindowProps | ||
} from "./components/drawing/InfoWindow" | ||
export { | ||
default as Polyline, | ||
PolylineProps | ||
} from "./components/drawing/Polyline"; | ||
export { | ||
default as Polyline, | ||
PolylineProps | ||
} from "./components/drawing/Polyline" | ||
export { | ||
default as Polygon, | ||
PolygonProps | ||
} from "./components/drawing/Polygon"; | ||
export { | ||
default as Polygon, | ||
PolygonProps | ||
} from "./components/drawing/Polygon" | ||
export { | ||
default as Rectangle, | ||
RectangleProps | ||
} from "./components/drawing/Rectangle"; | ||
export { | ||
default as Rectangle, | ||
RectangleProps | ||
} from "./components/drawing/Rectangle" | ||
export { | ||
default as Circle, | ||
CircleProps | ||
} from "./components/drawing/Circle"; | ||
export { | ||
default as Circle, | ||
CircleProps | ||
} from "./components/drawing/Circle" | ||
export { | ||
default as Data, | ||
DataProps | ||
} from "./components/drawing/Data"; | ||
export { | ||
default as Data, | ||
DataProps | ||
} from "./components/drawing/Data" | ||
export { | ||
default as KmlLayer, | ||
KmlLayerProps | ||
} from "./components/kml/KmlLayer"; | ||
export { | ||
default as KmlLayer, | ||
KmlLayerProps | ||
} from "./components/kml/KmlLayer" | ||
export { | ||
default as OverlayView, | ||
OverlayViewProps | ||
} from "./components/dom/OverlayView"; | ||
export { | ||
default as OverlayView, | ||
OverlayViewProps | ||
} from "./components/dom/OverlayView" | ||
export { | ||
default as GroundOverlay, | ||
GroundOverlayProps | ||
} from "./components/overlays/GroundOverlay"; | ||
export { | ||
default as GroundOverlay, | ||
GroundOverlayProps | ||
} from "./components/overlays/GroundOverlay" | ||
export { | ||
default as HeatmapLayer, | ||
HeatmapLayerProps | ||
} from "./components/heatmap/HeatmapLayer"; | ||
export { | ||
default as HeatmapLayer, | ||
HeatmapLayerProps | ||
} from "./components/heatmap/HeatmapLayer" | ||
@@ -91,3 +91,3 @@ export { | ||
StreetViewPanoramaProps | ||
} from "./components/streetview/StreetViewPanorama"; | ||
} from "./components/streetview/StreetViewPanorama" | ||
@@ -97,3 +97,3 @@ export { | ||
StreetViewServiceProps | ||
} from "./components/streetview/StreetViewService"; | ||
} from "./components/streetview/StreetViewService" | ||
@@ -103,3 +103,3 @@ export { | ||
DirectionsServiceProps | ||
} from "./components/directions/DirectionsService"; | ||
} from "./components/directions/DirectionsService" | ||
@@ -109,3 +109,3 @@ export { | ||
DirectionsRendererProps | ||
} from "./components/directions/DirectionsRenderer"; | ||
} from "./components/directions/DirectionsRenderer" | ||
@@ -115,11 +115,11 @@ export { | ||
StandaloneSearchBoxProps | ||
} from "./components/places/StandaloneSearchBox"; | ||
} from "./components/places/StandaloneSearchBox" | ||
export { | ||
default as Autocomplete, | ||
AutocompleteProps | ||
} from "./components/places/Autocomplete"; | ||
export { | ||
default as Autocomplete, | ||
AutocompleteProps | ||
} from "./components/places/Autocomplete" | ||
export { | ||
useGoogleMap | ||
} from './map-context' | ||
export { | ||
useGoogleMap | ||
} from './map-context' |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
86
359923
44
185
7818
+ Added@react-google-maps/marker-clusterer@1.2.3(transitive)
+ Added@types/googlemaps@3.36.0(transitive)
- Removed@react-google-maps/marker-clusterer@1.2.3-alpha.8(transitive)
- Removed@types/googlemaps@3.30.19(transitive)
Updated@types/googlemaps@3.36.0