@micromag/element-map 0.4.48 → 0.4.50

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.
Files changed (2) hide show
  1. package/es/index.js +55 -50
  2. package/package.json +3 -3
package/es/index.js CHANGED
@@ -3,6 +3,8 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
3
3
  import classNames from 'classnames';
4
4
  import React, { useState, useRef, useEffect, useCallback, useMemo } from 'react';
5
5
  import { useGoogleMapsClient } from '@micromag/core/contexts';
6
+ import { jsxs, jsx } from 'react/jsx-runtime';
7
+ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
6
8
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
7
9
  import { useDimensionObserver } from '@micromag/core/hooks';
8
10
  import isObject from 'lodash/isObject';
@@ -390,16 +392,18 @@ function Map$1(_ref) {
390
392
  }),
391
393
  map = _useGoogleMap.map,
392
394
  mapRef = _useGoogleMap.ref;
393
- return /*#__PURE__*/React.createElement("div", Object.assign({
395
+ return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
394
396
  className: classNames([styles$1.container, className, _defineProperty({}, styles$1.preventScroll, !draggable)])
395
- }, stopDragEventsPropagation), /*#__PURE__*/React.createElement("div", {
396
- ref: mapRef,
397
- className: styles$1.map,
398
- tabIndex: focusable ? '0' : '-1'
399
- }), React.Children.map(children, function (child) {
400
- return /*#__PURE__*/React.cloneElement(child, {
401
- map: map
402
- });
397
+ }, stopDragEventsPropagation), {}, {
398
+ children: [/*#__PURE__*/jsx("div", {
399
+ ref: mapRef,
400
+ className: styles$1.map,
401
+ tabIndex: focusable ? '0' : '-1'
402
+ }), React.Children.map(children, function (child) {
403
+ return /*#__PURE__*/React.cloneElement(child, {
404
+ map: map
405
+ });
406
+ })]
403
407
  }));
404
408
  }
405
409
 
@@ -601,47 +605,48 @@ function Map(_ref) {
601
605
  onTilesLoaded: onTilesLoaded
602
606
  };
603
607
  }, [onClick, onCenterChanged, onBoundsChanged, onDrag, onDragEnd, onTilesLoaded]);
604
- return /*#__PURE__*/React.createElement("div", {
605
- className: classNames([styles.container, className])
606
- }, /*#__PURE__*/React.createElement(Map$1, {
607
- center: center,
608
- zoom: zoom,
609
- withoutStyle: withoutStyle,
610
- bounds: bounds,
611
- draggable: draggable,
612
- events: events,
613
- fitBounds: fitBounds,
614
- zoomControl: zoomControl,
615
- mapTypeControl: mapTypeControl,
616
- scaleControl: scaleControl,
617
- streetViewControl: streetViewControl,
618
- rotateControl: rotateControl,
619
- fullscreenControl: fullscreenControl,
620
- focusable: focusable
621
- }, markers !== null ? markers.map(function (_ref4, index) {
622
- var _ref4$active = _ref4.active,
623
- active = _ref4$active === void 0 ? true : _ref4$active,
624
- _ref4$geoPosition = _ref4.geoPosition,
625
- geoPosition = _ref4$geoPosition === void 0 ? null : _ref4$geoPosition,
626
- _ref4$image = _ref4.image,
627
- image = _ref4$image === void 0 ? null : _ref4$image,
628
- _ref4$title = _ref4.title,
629
- title = _ref4$title === void 0 ? null : _ref4$title;
630
- return geoPosition !== null && (geoPosition.lat || null) !== null && (geoPosition.lng || null) !== null ? /*#__PURE__*/React.createElement(Marker, {
631
- key: "marker-".concat(index),
632
- active: active,
633
- title: title !== null && _typeof(title.body) ? title.body : null,
634
- image: image,
635
- position: geoPosition,
636
- events: {
637
- onClick: onClickMarker !== null ? function (e) {
638
- return onClickMarker(e, index);
639
- } : function () {
640
- return console.log(index);
641
- }
642
- }
643
- }) : /*#__PURE__*/React.createElement("div", null);
644
- }) : null));
608
+ return /*#__PURE__*/jsx("div", {
609
+ className: classNames([styles.container, className]),
610
+ children: /*#__PURE__*/jsx(Map$1, {
611
+ center: center,
612
+ zoom: zoom,
613
+ withoutStyle: withoutStyle,
614
+ bounds: bounds,
615
+ draggable: draggable,
616
+ events: events,
617
+ fitBounds: fitBounds,
618
+ zoomControl: zoomControl,
619
+ mapTypeControl: mapTypeControl,
620
+ scaleControl: scaleControl,
621
+ streetViewControl: streetViewControl,
622
+ rotateControl: rotateControl,
623
+ fullscreenControl: fullscreenControl,
624
+ focusable: focusable,
625
+ children: markers !== null ? markers.map(function (_ref4, index) {
626
+ var _ref4$active = _ref4.active,
627
+ active = _ref4$active === void 0 ? true : _ref4$active,
628
+ _ref4$geoPosition = _ref4.geoPosition,
629
+ geoPosition = _ref4$geoPosition === void 0 ? null : _ref4$geoPosition,
630
+ _ref4$image = _ref4.image,
631
+ image = _ref4$image === void 0 ? null : _ref4$image,
632
+ _ref4$title = _ref4.title,
633
+ title = _ref4$title === void 0 ? null : _ref4$title;
634
+ return geoPosition !== null && (geoPosition.lat || null) !== null && (geoPosition.lng || null) !== null ? /*#__PURE__*/jsx(Marker, {
635
+ active: active,
636
+ title: title !== null && _typeof(title.body) ? title.body : null,
637
+ image: image,
638
+ position: geoPosition,
639
+ events: {
640
+ onClick: onClickMarker !== null ? function (e) {
641
+ return onClickMarker(e, index);
642
+ } : function () {
643
+ return console.log(index);
644
+ }
645
+ }
646
+ }, "marker-".concat(index)) : /*#__PURE__*/jsx("div", {});
647
+ }) : null
648
+ })
649
+ });
645
650
  }
646
651
 
647
652
  export { Pin, Map as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-map",
3
- "version": "0.4.48",
3
+ "version": "0.4.50",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "@babel/runtime": "^7.28.6",
63
- "@micromag/core": "^0.4.48",
63
+ "@micromag/core": "^0.4.50",
64
64
  "classnames": "^2.2.6",
65
65
  "lodash": "^4.17.23",
66
66
  "react-intl": "^8.1.3 || ^10.0.0",
@@ -70,6 +70,6 @@
70
70
  "access": "public",
71
71
  "registry": "https://registry.npmjs.org/"
72
72
  },
73
- "gitHead": "d6772865be1ee3f2d19288ebfbf4b9b6860f4cd7",
73
+ "gitHead": "940d5ca98f8f448b79eaa3e2fa685c3ee95185b8",
74
74
  "types": "es/index.d.ts"
75
75
  }