@micromag/element-map 0.3.423 → 0.3.429

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/index.js CHANGED
@@ -384,7 +384,6 @@ var defaultProps$2 = {
384
384
  focusable: true
385
385
  };
386
386
  var Map$1 = function Map(_ref) {
387
- var _ref2;
388
387
  var center = _ref.center,
389
388
  zoom = _ref.zoom,
390
389
  maxZoom = _ref.maxZoom,
@@ -421,7 +420,7 @@ var Map$1 = function Map(_ref) {
421
420
  map = _useGoogleMap.map,
422
421
  mapRef = _useGoogleMap.ref;
423
422
  return /*#__PURE__*/React.createElement("div", Object.assign({
424
- className: classNames([styles$1.container, (_ref2 = {}, _defineProperty(_ref2, className, className !== null), _defineProperty(_ref2, styles$1.preventScroll, !draggable), _ref2)])
423
+ className: classNames([styles$1.container, _defineProperty(_defineProperty({}, className, className !== null), styles$1.preventScroll, !draggable)])
425
424
  }, stopDragEventsPropagation), /*#__PURE__*/React.createElement("div", {
426
425
  ref: mapRef,
427
426
  className: styles$1.map,
package/lib/index.js CHANGED
@@ -13,16 +13,6 @@ var hooks = require('@micromag/core/hooks');
13
13
  var core = require('@micromag/core');
14
14
  var isObject = require('lodash/isObject');
15
15
 
16
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
17
-
18
- var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
19
- var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
20
- var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
21
- var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
22
- var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
23
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
- var isObject__default = /*#__PURE__*/_interopDefaultLegacy(isObject);
25
-
26
16
  var styles$2 = [{
27
17
  elementType: 'geometry',
28
18
  stylers: [{
@@ -228,7 +218,7 @@ function useGoogleMap(_ref) {
228
218
  fullscreenControl = _ref.fullscreenControl;
229
219
  var client = contexts.useGoogleMapsClient();
230
220
  var _useState = React.useState(false),
231
- _useState2 = _slicedToArray__default["default"](_useState, 2),
221
+ _useState2 = _slicedToArray(_useState, 2),
232
222
  ready = _useState2[0],
233
223
  setReady = _useState2[1];
234
224
  var containerRef = React.useRef(null);
@@ -354,29 +344,29 @@ var stopDragEventsPropagation = {
354
344
  }
355
345
  };
356
346
  var propTypes$2 = {
357
- center: PropTypes__default["default"].shape({
358
- lat: PropTypes__default["default"].number,
359
- lng: PropTypes__default["default"].number
347
+ center: PropTypes.shape({
348
+ lat: PropTypes.number,
349
+ lng: PropTypes.number
360
350
  }),
361
- zoom: PropTypes__default["default"].number,
362
- maxZoom: PropTypes__default["default"].number,
363
- bounds: PropTypes__default["default"].object,
351
+ zoom: PropTypes.number,
352
+ maxZoom: PropTypes.number,
353
+ bounds: PropTypes.object,
364
354
  // eslint-disable-line
365
- draggable: PropTypes__default["default"].bool,
366
- withoutStyle: PropTypes__default["default"].bool,
355
+ draggable: PropTypes.bool,
356
+ withoutStyle: PropTypes.bool,
367
357
  // Global maps events
368
- events: PropTypes__default["default"].object,
358
+ events: PropTypes.object,
369
359
  // eslint-disable-line
370
- fitBounds: PropTypes__default["default"].bool,
371
- zoomControl: PropTypes__default["default"].bool,
372
- mapTypeControl: PropTypes__default["default"].bool,
373
- scaleControl: PropTypes__default["default"].bool,
374
- streetViewControl: PropTypes__default["default"].bool,
375
- rotateControl: PropTypes__default["default"].bool,
376
- fullscreenControl: PropTypes__default["default"].bool,
377
- className: PropTypes__default["default"].string,
378
- children: PropTypes__default["default"].node,
379
- focusable: PropTypes__default["default"].bool
360
+ fitBounds: PropTypes.bool,
361
+ zoomControl: PropTypes.bool,
362
+ mapTypeControl: PropTypes.bool,
363
+ scaleControl: PropTypes.bool,
364
+ streetViewControl: PropTypes.bool,
365
+ rotateControl: PropTypes.bool,
366
+ fullscreenControl: PropTypes.bool,
367
+ className: PropTypes.string,
368
+ children: PropTypes.node,
369
+ focusable: PropTypes.bool
380
370
  };
381
371
  var defaultProps$2 = {
382
372
  center: null,
@@ -398,7 +388,6 @@ var defaultProps$2 = {
398
388
  focusable: true
399
389
  };
400
390
  var Map$1 = function Map(_ref) {
401
- var _ref2;
402
391
  var center = _ref.center,
403
392
  zoom = _ref.zoom,
404
393
  maxZoom = _ref.maxZoom,
@@ -434,14 +423,14 @@ var Map$1 = function Map(_ref) {
434
423
  }),
435
424
  map = _useGoogleMap.map,
436
425
  mapRef = _useGoogleMap.ref;
437
- return /*#__PURE__*/React__default["default"].createElement("div", Object.assign({
438
- className: classNames__default["default"]([styles$1.container, (_ref2 = {}, _defineProperty__default["default"](_ref2, className, className !== null), _defineProperty__default["default"](_ref2, styles$1.preventScroll, !draggable), _ref2)])
439
- }, stopDragEventsPropagation), /*#__PURE__*/React__default["default"].createElement("div", {
426
+ return /*#__PURE__*/React.createElement("div", Object.assign({
427
+ className: classNames([styles$1.container, _defineProperty(_defineProperty({}, className, className !== null), styles$1.preventScroll, !draggable)])
428
+ }, stopDragEventsPropagation), /*#__PURE__*/React.createElement("div", {
440
429
  ref: mapRef,
441
430
  className: styles$1.map,
442
431
  tabIndex: focusable ? '0' : '-1'
443
- }), React__default["default"].Children.map(children, function (child) {
444
- return /*#__PURE__*/React__default["default"].cloneElement(child, {
432
+ }), React.Children.map(children, function (child) {
433
+ return /*#__PURE__*/React.cloneElement(child, {
445
434
  map: map
446
435
  });
447
436
  }));
@@ -475,7 +464,7 @@ function useGoogleMapMarker(map) {
475
464
  if (client === null) {
476
465
  return;
477
466
  }
478
- if (isObject__default["default"](newIcon)) {
467
+ if (isObject(newIcon)) {
479
468
  var _ref2 = newIcon || {},
480
469
  _ref2$url = _ref2.url,
481
470
  iconUrl = _ref2$url === void 0 ? null : _ref2$url;
@@ -522,22 +511,22 @@ var PinInactive = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAArCAYAAAC
522
511
 
523
512
  var propTypes$1 = {
524
513
  // map: PropTypes.object.isRequired, // eslint-disable-line
525
- map: PropTypes__default["default"].object,
514
+ map: PropTypes.object,
526
515
  // eslint-disable-line
527
- position: PropTypes__default["default"].shape({
528
- lat: PropTypes__default["default"].number,
529
- lng: PropTypes__default["default"].number
516
+ position: PropTypes.shape({
517
+ lat: PropTypes.number,
518
+ lng: PropTypes.number
530
519
  }).isRequired,
531
- type: PropTypes__default["default"].string,
520
+ type: PropTypes.string,
532
521
  // .isRequired,
533
- events: PropTypes__default["default"].object,
522
+ events: PropTypes.object,
534
523
  // eslint-disable-line
535
- active: PropTypes__default["default"].bool,
536
- title: PropTypes__default["default"].string,
524
+ active: PropTypes.bool,
525
+ title: PropTypes.string,
537
526
  image: core.PropTypes.imageMedia,
538
- iconSize: PropTypes__default["default"].shape({
539
- width: PropTypes__default["default"].number,
540
- height: PropTypes__default["default"].number
527
+ iconSize: PropTypes.shape({
528
+ width: PropTypes.number,
529
+ height: PropTypes.number
541
530
  })
542
531
  };
543
532
  var defaultProps$1 = {
@@ -575,49 +564,49 @@ Marker.defaultProps = defaultProps$1;
575
564
 
576
565
  // import { useEffect } from 'react';
577
566
  ({
578
- map: PropTypes__default["default"].object,
567
+ map: PropTypes.object,
579
568
  // eslint-disable-line
580
- coords: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
581
- lat: PropTypes__default["default"].number,
582
- lng: PropTypes__default["default"].number
569
+ coords: PropTypes.arrayOf(PropTypes.shape({
570
+ lat: PropTypes.number,
571
+ lng: PropTypes.number
583
572
  })).isRequired,
584
- events: PropTypes__default["default"].object // eslint-disable-line
573
+ events: PropTypes.object // eslint-disable-line
585
574
  });
586
575
 
587
576
  ({
588
- map: PropTypes__default["default"].object,
577
+ map: PropTypes.object,
589
578
  // eslint-disable-line
590
- enabled: PropTypes__default["default"].bool
579
+ enabled: PropTypes.bool
591
580
  });
592
581
 
593
582
  var styles = {"container":"micromag-element-map-container"};
594
583
 
595
584
  var propTypes = {
596
- center: PropTypes__default["default"].shape({
597
- lat: PropTypes__default["default"].number,
598
- lng: PropTypes__default["default"].number
585
+ center: PropTypes.shape({
586
+ lat: PropTypes.number,
587
+ lng: PropTypes.number
599
588
  }),
600
- zoom: PropTypes__default["default"].number,
601
- draggable: PropTypes__default["default"].bool,
602
- markers: PropTypes__default["default"].arrayOf(PropTypes__default["default"].object),
589
+ zoom: PropTypes.number,
590
+ draggable: PropTypes.bool,
591
+ markers: PropTypes.arrayOf(PropTypes.object),
603
592
  // eslint-disable-line react/forbid-prop-types
604
- onClickMap: PropTypes__default["default"].func,
605
- onClickMarker: PropTypes__default["default"].func,
606
- className: PropTypes__default["default"].string,
607
- onReady: PropTypes__default["default"].func,
608
- onCenterChanged: PropTypes__default["default"].func,
609
- onBoundsChanged: PropTypes__default["default"].func,
610
- onDrag: PropTypes__default["default"].func,
611
- onDragEnd: PropTypes__default["default"].func,
612
- withoutStyle: PropTypes__default["default"].bool,
613
- fitBounds: PropTypes__default["default"].bool,
614
- zoomControl: PropTypes__default["default"].bool,
615
- mapTypeControl: PropTypes__default["default"].bool,
616
- scaleControl: PropTypes__default["default"].bool,
617
- streetViewControl: PropTypes__default["default"].bool,
618
- rotateControl: PropTypes__default["default"].bool,
619
- fullscreenControl: PropTypes__default["default"].bool,
620
- focusable: PropTypes__default["default"].bool
593
+ onClickMap: PropTypes.func,
594
+ onClickMarker: PropTypes.func,
595
+ className: PropTypes.string,
596
+ onReady: PropTypes.func,
597
+ onCenterChanged: PropTypes.func,
598
+ onBoundsChanged: PropTypes.func,
599
+ onDrag: PropTypes.func,
600
+ onDragEnd: PropTypes.func,
601
+ withoutStyle: PropTypes.bool,
602
+ fitBounds: PropTypes.bool,
603
+ zoomControl: PropTypes.bool,
604
+ mapTypeControl: PropTypes.bool,
605
+ scaleControl: PropTypes.bool,
606
+ streetViewControl: PropTypes.bool,
607
+ rotateControl: PropTypes.bool,
608
+ fullscreenControl: PropTypes.bool,
609
+ focusable: PropTypes.bool
621
610
  };
622
611
  var defaultProps = {
623
612
  center: null,
@@ -693,7 +682,7 @@ var Map = function Map(_ref) {
693
682
  return markersBounds;
694
683
  }, [client, markers]);
695
684
  var _useState = React.useState(false),
696
- _useState2 = _slicedToArray__default["default"](_useState, 2),
685
+ _useState2 = _slicedToArray(_useState, 2),
697
686
  loaded = _useState2[0],
698
687
  setLoaded = _useState2[1];
699
688
  React.useEffect(function () {
@@ -716,9 +705,9 @@ var Map = function Map(_ref) {
716
705
  onTilesLoaded: onTilesLoaded
717
706
  };
718
707
  }, [onClick, onCenterChanged, onBoundsChanged, onDrag, onDragEnd, onTilesLoaded]);
719
- return /*#__PURE__*/React__default["default"].createElement("div", {
720
- className: classNames__default["default"]([styles.container, _defineProperty__default["default"]({}, className, className !== null)])
721
- }, /*#__PURE__*/React__default["default"].createElement(Map$1, {
708
+ return /*#__PURE__*/React.createElement("div", {
709
+ className: classNames([styles.container, _defineProperty({}, className, className !== null)])
710
+ }, /*#__PURE__*/React.createElement(Map$1, {
722
711
  center: center,
723
712
  zoom: zoom,
724
713
  withoutStyle: withoutStyle,
@@ -742,10 +731,10 @@ var Map = function Map(_ref) {
742
731
  image = _ref5$image === void 0 ? null : _ref5$image,
743
732
  _ref5$title = _ref5.title,
744
733
  title = _ref5$title === void 0 ? null : _ref5$title;
745
- return geoPosition !== null && (geoPosition.lat || null) !== null && (geoPosition.lng || null) !== null ? /*#__PURE__*/React__default["default"].createElement(Marker, {
734
+ return geoPosition !== null && (geoPosition.lat || null) !== null && (geoPosition.lng || null) !== null ? /*#__PURE__*/React.createElement(Marker, {
746
735
  key: "marker-".concat(index),
747
736
  active: active,
748
- title: title !== null && _typeof__default["default"](title.body) ? title.body : null,
737
+ title: title !== null && _typeof(title.body) ? title.body : null,
749
738
  image: image,
750
739
  position: geoPosition,
751
740
  events: {
@@ -755,11 +744,11 @@ var Map = function Map(_ref) {
755
744
  return console.log(index);
756
745
  } // eslint-disable-line no-console
757
746
  }
758
- }) : /*#__PURE__*/React__default["default"].createElement("div", null);
747
+ }) : /*#__PURE__*/React.createElement("div", null);
759
748
  }) : null));
760
749
  };
761
750
  Map.propTypes = propTypes;
762
751
  Map.defaultProps = defaultProps;
763
752
 
764
753
  exports.Pin = Pin;
765
- exports["default"] = Map;
754
+ exports.default = Map;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-map",
3
- "version": "0.3.423",
3
+ "version": "0.3.429",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -32,6 +32,12 @@
32
32
  "license": "ISC",
33
33
  "main": "lib/index.js",
34
34
  "module": "es/index.js",
35
+ "exports": {
36
+ ".": {
37
+ "require": "./lib/index.js",
38
+ "import": "./es/index.js"
39
+ }
40
+ },
35
41
  "files": [
36
42
  "lib",
37
43
  "es",
@@ -50,7 +56,7 @@
50
56
  },
51
57
  "dependencies": {
52
58
  "@babel/runtime": "^7.13.10",
53
- "@micromag/core": "^0.3.423",
59
+ "@micromag/core": "^0.3.429",
54
60
  "classnames": "^2.2.6",
55
61
  "lodash": "^4.17.21",
56
62
  "prop-types": "^15.7.2",
@@ -61,5 +67,5 @@
61
67
  "access": "public",
62
68
  "registry": "https://registry.npmjs.org/"
63
69
  },
64
- "gitHead": "c02e69c23fd099d5684bc0b69e02f19825cecfd2"
70
+ "gitHead": "f15e72b88ecfda4c54b87626513149b58572c52b"
65
71
  }