utopia-ui 3.0.59 → 3.0.60

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/dist/index.cjs CHANGED
@@ -14,7 +14,6 @@ require('leaflet.locatecontrol/dist/L.Control.Locate.css');
14
14
  var Markdown = require('react-markdown');
15
15
  var remarkBreaks = require('remark-breaks');
16
16
  require('react-toastify/dist/ReactToastify.css');
17
- var propTypes = require('prop-types');
18
17
  var InformationCircleIcon = require('@heroicons/react/24/outline/InformationCircleIcon');
19
18
  var QuestionMarkIcon = require('@heroicons/react/24/outline/QuestionMarkCircleIcon');
20
19
  var ChevronRightIcon = require('@heroicons/react/24/outline/ChevronRightIcon');
@@ -2815,7 +2814,7 @@ function UtopiaMapInner({ children, geo, showFilterControl = false, showGratitud
2815
2814
  donationWidget &&
2816
2815
  setTimeout(() => {
2817
2816
  reactToastify.toast(jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(TextView, { rawText: '## Do you like this Map?' }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(TextView, { rawText: 'Support us building free opensource maps and help us grow 🌱☀️' }), jsxRuntime.jsx(PopupButton, { url: 'https://opencollective.com/utopia-project', text: 'Donate' })] })] }), { autoClose: false });
2818
- }, 10000);
2817
+ }, 600000);
2819
2818
  init.current = true;
2820
2819
  }
2821
2820
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -3468,11 +3467,11 @@ public_edit_items, listed = true, setItemFormPopup, itemFormPopup, clusterRef, }
3468
3467
  selectPosition && setMarkerClicked(item);
3469
3468
  },
3470
3469
  }, icon: MarkerIconFactory(markerShape, color1, color2, item.markerIcon ? item.markerIcon : markerIcon), position: [latitude, longitude], children: [children &&
3471
- react.Children.toArray(children).some((child) => react.isValidElement(child) && child.props.__TYPE === 'ItemView') ? (react.Children.toArray(children).map((child) => react.isValidElement(child) && child.props.__TYPE === 'ItemView' ? (jsxRuntime.jsx(ItemViewPopup, { ref: (r) => {
3470
+ react.Children.toArray(children).some((child) => isComponentWithType(child) && child.type.__TYPE === 'ItemView') ? (react.Children.toArray(children).map((child) => isComponentWithType(child) && child.type.__TYPE === 'ItemView' ? (jsxRuntime.jsx(ItemViewPopup, { ref: (r) => {
3472
3471
  if (!(item.id in leafletRefs && leafletRefs[item.id].popup === r)) {
3473
3472
  r && addPopup(item, r);
3474
3473
  }
3475
- }, item: item, setItemFormPopup: setItemFormPopup, children: child }, item.id + item.name)) : (''))) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(ItemViewPopup, { ref: (r) => {
3474
+ }, item: item, setItemFormPopup: setItemFormPopup, children: child }, item.id + item.name)) : null)) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(ItemViewPopup, { ref: (r) => {
3476
3475
  if (!(item.id in leafletRefs && leafletRefs[item.id].popup === r)) {
3477
3476
  r && addPopup(item, r);
3478
3477
  }
@@ -3483,8 +3482,11 @@ public_edit_items, listed = true, setItemFormPopup, itemFormPopup, clusterRef, }
3483
3482
  }), itemFormPopup &&
3484
3483
  itemFormPopup.layer.name === name &&
3485
3484
  (children &&
3486
- react.Children.toArray(children).some((child) => react.isValidElement(child) && child.props.__TYPE === 'ItemForm') ? (react.Children.toArray(children).map((child) => react.isValidElement(child) && child.props.__TYPE === 'ItemForm' ? (jsxRuntime.jsx(ItemFormPopup, { position: itemFormPopup.position, layer: itemFormPopup.layer, setItemFormPopup: setItemFormPopup, item: itemFormPopup.item, children: child }, setItemFormPopup?.name)) : (''))) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(ItemFormPopup, { position: itemFormPopup.position, layer: itemFormPopup.layer, setItemFormPopup: setItemFormPopup, item: itemFormPopup.item }) })))] }));
3485
+ react.Children.toArray(children).some((child) => isComponentWithType(child) && child.type.__TYPE === 'ItemForm') ? (react.Children.toArray(children).map((child) => isComponentWithType(child) && child.type.__TYPE === 'ItemForm' ? (jsxRuntime.jsx(ItemFormPopup, { position: itemFormPopup.position, layer: itemFormPopup.layer, setItemFormPopup: setItemFormPopup, item: itemFormPopup.item, children: child }, setItemFormPopup?.name)) : (''))) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(ItemFormPopup, { position: itemFormPopup.position, layer: itemFormPopup.layer, setItemFormPopup: setItemFormPopup, item: itemFormPopup.item }) })))] }));
3487
3486
  };
3487
+ function isComponentWithType(node) {
3488
+ return react.isValidElement(node) && typeof node.type !== 'string' && '__TYPE' in node.type;
3489
+ }
3488
3490
 
3489
3491
  function Tags({ data, api }) {
3490
3492
  const setTagData = useSetTagData();
@@ -3543,26 +3545,14 @@ const ItemForm = ({ children, item, title, setPopupTitle, }) => {
3543
3545
  : '')
3544
3546
  : '' }));
3545
3547
  };
3546
- ItemForm.propTypes = {
3547
- children: propTypes.node,
3548
- __TYPE: propTypes.string,
3549
- };
3550
- ItemForm.defaultProps = {
3551
- __TYPE: 'ItemForm',
3552
- };
3548
+ ItemForm.__TYPE = 'ItemForm';
3553
3549
 
3554
3550
  const ItemView = ({ children, item }) => {
3555
3551
  return (jsxRuntime.jsx("div", { children: children
3556
- ? react.Children.toArray(children).map((child) => react.isValidElement(child) ? react.cloneElement(child, { item }) : '')
3557
- : '' }));
3558
- };
3559
- ItemView.propTypes = {
3560
- children: propTypes.node,
3561
- __TYPE: propTypes.string,
3562
- };
3563
- ItemView.defaultProps = {
3564
- __TYPE: 'ItemView',
3552
+ ? react.Children.toArray(children).map((child) => react.isValidElement(child) ? react.cloneElement(child, { item }) : null)
3553
+ : null }));
3565
3554
  };
3555
+ ItemView.__TYPE = 'ItemView';
3566
3556
 
3567
3557
  function SelectBox(props) {
3568
3558
  const { labelTitle, labelDescription, defaultValue, containerStyle, placeholder, labelStyle, options, updateFormValue, } = props;