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 +11 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -15
- package/dist/index.esm.js +11 -21
- package/dist/index.esm.js.map +1 -1
- package/dist/types/src/Components/Map/ItemForm.d.ts +1 -7
- package/dist/types/src/Components/Map/ItemView.d.ts +1 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -9,7 +9,6 @@ import { Tag } from './types/Tag.js';
|
|
9
9
|
export { Tag } from './types/Tag.js';
|
10
10
|
import { Permission } from './types/Permission.js';
|
11
11
|
export { Permission } from './types/Permission.js';
|
12
|
-
import * as prop_types from '/home/fritz/workspace/utopia-os/utopia-ui/node_modules/@types/prop-types/index.d.ts';
|
13
12
|
import { Item } from './types/Item.js';
|
14
13
|
export { Item } from './types/Item.js';
|
15
14
|
import { AssetsApi } from './types/AssetsApi.js';
|
@@ -40,13 +39,7 @@ declare const ItemForm: {
|
|
40
39
|
title?: string;
|
41
40
|
setPopupTitle?: React.Dispatch<React.SetStateAction<string>>;
|
42
41
|
}): react_jsx_runtime.JSX.Element;
|
43
|
-
|
44
|
-
children: prop_types.Requireable<prop_types.ReactNodeLike>;
|
45
|
-
__TYPE: prop_types.Requireable<string>;
|
46
|
-
};
|
47
|
-
defaultProps: {
|
48
|
-
__TYPE: string;
|
49
|
-
};
|
42
|
+
__TYPE: string;
|
50
43
|
};
|
51
44
|
|
52
45
|
declare const ItemView: {
|
@@ -54,13 +47,7 @@ declare const ItemView: {
|
|
54
47
|
children?: React.ReactNode;
|
55
48
|
item?: Item;
|
56
49
|
}): react_jsx_runtime.JSX.Element;
|
57
|
-
|
58
|
-
children: prop_types.Requireable<prop_types.ReactNodeLike>;
|
59
|
-
__TYPE: prop_types.Requireable<string>;
|
60
|
-
};
|
61
|
-
defaultProps: {
|
62
|
-
__TYPE: string;
|
63
|
-
};
|
50
|
+
__TYPE: string;
|
64
51
|
};
|
65
52
|
|
66
53
|
declare const PopupTextAreaInput: ({ dataField, placeholder, style, item, }: {
|
package/dist/index.esm.js
CHANGED
@@ -12,7 +12,6 @@ import 'leaflet.locatecontrol/dist/L.Control.Locate.css';
|
|
12
12
|
import Markdown from 'react-markdown';
|
13
13
|
import remarkBreaks from 'remark-breaks';
|
14
14
|
import 'react-toastify/dist/ReactToastify.css';
|
15
|
-
import { string, node } from 'prop-types';
|
16
15
|
import InformationCircleIcon from '@heroicons/react/24/outline/InformationCircleIcon';
|
17
16
|
import QuestionMarkIcon from '@heroicons/react/24/outline/QuestionMarkCircleIcon';
|
18
17
|
import ChevronRightIcon from '@heroicons/react/24/outline/ChevronRightIcon';
|
@@ -2813,7 +2812,7 @@ function UtopiaMapInner({ children, geo, showFilterControl = false, showGratitud
|
|
2813
2812
|
donationWidget &&
|
2814
2813
|
setTimeout(() => {
|
2815
2814
|
toast(jsxs(Fragment, { children: [jsx(TextView, { rawText: '## Do you like this Map?' }), jsxs("div", { children: [jsx(TextView, { rawText: 'Support us building free opensource maps and help us grow 🌱☀️' }), jsx(PopupButton, { url: 'https://opencollective.com/utopia-project', text: 'Donate' })] })] }), { autoClose: false });
|
2816
|
-
},
|
2815
|
+
}, 600000);
|
2817
2816
|
init.current = true;
|
2818
2817
|
}
|
2819
2818
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
@@ -3466,11 +3465,11 @@ public_edit_items, listed = true, setItemFormPopup, itemFormPopup, clusterRef, }
|
|
3466
3465
|
selectPosition && setMarkerClicked(item);
|
3467
3466
|
},
|
3468
3467
|
}, icon: MarkerIconFactory(markerShape, color1, color2, item.markerIcon ? item.markerIcon : markerIcon), position: [latitude, longitude], children: [children &&
|
3469
|
-
Children.toArray(children).some((child) =>
|
3468
|
+
Children.toArray(children).some((child) => isComponentWithType(child) && child.type.__TYPE === 'ItemView') ? (Children.toArray(children).map((child) => isComponentWithType(child) && child.type.__TYPE === 'ItemView' ? (jsx(ItemViewPopup, { ref: (r) => {
|
3470
3469
|
if (!(item.id in leafletRefs && leafletRefs[item.id].popup === r)) {
|
3471
3470
|
r && addPopup(item, r);
|
3472
3471
|
}
|
3473
|
-
}, item: item, setItemFormPopup: setItemFormPopup, children: child }, item.id + item.name)) :
|
3472
|
+
}, item: item, setItemFormPopup: setItemFormPopup, children: child }, item.id + item.name)) : null)) : (jsx(Fragment, { children: jsx(ItemViewPopup, { ref: (r) => {
|
3474
3473
|
if (!(item.id in leafletRefs && leafletRefs[item.id].popup === r)) {
|
3475
3474
|
r && addPopup(item, r);
|
3476
3475
|
}
|
@@ -3481,8 +3480,11 @@ public_edit_items, listed = true, setItemFormPopup, itemFormPopup, clusterRef, }
|
|
3481
3480
|
}), itemFormPopup &&
|
3482
3481
|
itemFormPopup.layer.name === name &&
|
3483
3482
|
(children &&
|
3484
|
-
Children.toArray(children).some((child) =>
|
3483
|
+
Children.toArray(children).some((child) => isComponentWithType(child) && child.type.__TYPE === 'ItemForm') ? (Children.toArray(children).map((child) => isComponentWithType(child) && child.type.__TYPE === 'ItemForm' ? (jsx(ItemFormPopup, { position: itemFormPopup.position, layer: itemFormPopup.layer, setItemFormPopup: setItemFormPopup, item: itemFormPopup.item, children: child }, setItemFormPopup?.name)) : (''))) : (jsx(Fragment, { children: jsx(ItemFormPopup, { position: itemFormPopup.position, layer: itemFormPopup.layer, setItemFormPopup: setItemFormPopup, item: itemFormPopup.item }) })))] }));
|
3485
3484
|
};
|
3485
|
+
function isComponentWithType(node) {
|
3486
|
+
return isValidElement(node) && typeof node.type !== 'string' && '__TYPE' in node.type;
|
3487
|
+
}
|
3486
3488
|
|
3487
3489
|
function Tags({ data, api }) {
|
3488
3490
|
const setTagData = useSetTagData();
|
@@ -3541,26 +3543,14 @@ const ItemForm = ({ children, item, title, setPopupTitle, }) => {
|
|
3541
3543
|
: '')
|
3542
3544
|
: '' }));
|
3543
3545
|
};
|
3544
|
-
ItemForm.
|
3545
|
-
children: node,
|
3546
|
-
__TYPE: string,
|
3547
|
-
};
|
3548
|
-
ItemForm.defaultProps = {
|
3549
|
-
__TYPE: 'ItemForm',
|
3550
|
-
};
|
3546
|
+
ItemForm.__TYPE = 'ItemForm';
|
3551
3547
|
|
3552
3548
|
const ItemView = ({ children, item }) => {
|
3553
3549
|
return (jsx("div", { children: children
|
3554
|
-
? Children.toArray(children).map((child) => isValidElement(child) ? cloneElement(child, { item }) :
|
3555
|
-
:
|
3556
|
-
};
|
3557
|
-
ItemView.propTypes = {
|
3558
|
-
children: node,
|
3559
|
-
__TYPE: string,
|
3560
|
-
};
|
3561
|
-
ItemView.defaultProps = {
|
3562
|
-
__TYPE: 'ItemView',
|
3550
|
+
? Children.toArray(children).map((child) => isValidElement(child) ? cloneElement(child, { item }) : null)
|
3551
|
+
: null }));
|
3563
3552
|
};
|
3553
|
+
ItemView.__TYPE = 'ItemView';
|
3564
3554
|
|
3565
3555
|
function SelectBox(props) {
|
3566
3556
|
const { labelTitle, labelDescription, defaultValue, containerStyle, placeholder, labelStyle, options, updateFormValue, } = props;
|