utopia-ui 3.0.32 → 3.0.33
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/Components/AppShell/AppShell.d.ts +1 -1
- package/dist/Components/AppShell/SetAppState.d.ts +1 -1
- package/dist/Components/AppShell/hooks/useAppState.d.ts +1 -1
- package/dist/Components/AppShell/hooks/useAssets.d.ts +1 -1
- package/dist/Components/Auth/useAuth.d.ts +2 -1
- package/dist/Components/Input/TextAreaInput.d.ts +2 -1
- package/dist/Components/Map/ItemForm.d.ts +1 -1
- package/dist/Components/Map/ItemView.d.ts +1 -1
- package/dist/Components/Map/Layer.d.ts +1 -1
- package/dist/Components/Map/Permissions.d.ts +2 -1
- package/dist/Components/Map/Subcomponents/ItemFormPopup.d.ts +1 -1
- package/dist/Components/Map/Subcomponents/ItemPopupComponents/HeaderView.d.ts +2 -1
- package/dist/Components/Map/Subcomponents/ItemPopupComponents/PopupButton.d.ts +1 -1
- package/dist/Components/Map/Subcomponents/ItemPopupComponents/PopupCheckboxInput.d.ts +1 -1
- package/dist/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.d.ts +1 -1
- package/dist/Components/Map/Subcomponents/ItemPopupComponents/PopupTextAreaInput.d.ts +1 -1
- package/dist/Components/Map/Subcomponents/ItemPopupComponents/PopupTextInput.d.ts +1 -1
- package/dist/Components/Map/Subcomponents/ItemPopupComponents/StartEndView.d.ts +1 -1
- package/dist/Components/Map/Subcomponents/ItemPopupComponents/TextView.d.ts +1 -1
- package/dist/Components/Map/Subcomponents/ItemViewPopup.d.ts +2 -1
- package/dist/Components/Map/Tags.d.ts +2 -1
- package/dist/Components/Map/UtopiaMap.d.ts +1 -1
- package/dist/Components/Map/UtopiaMapInner.d.ts +1 -1
- package/dist/Components/Map/hooks/useFilter.d.ts +2 -1
- package/dist/Components/Map/hooks/useItems.d.ts +2 -1
- package/dist/Components/Map/hooks/useLayers.d.ts +1 -1
- package/dist/Components/Map/hooks/useLeafletRefs.d.ts +2 -2
- package/dist/Components/Map/hooks/usePermissions.d.ts +5 -1
- package/dist/Components/Map/hooks/useSelectPosition.d.ts +4 -2
- package/dist/Components/Map/hooks/useTags.d.ts +3 -1
- package/dist/Components/Profile/ProfileView.d.ts +1 -1
- package/dist/Components/Profile/Subcomponents/ActionsButton.d.ts +1 -1
- package/dist/Components/Profile/Subcomponents/ContactInfoForm.d.ts +1 -1
- package/dist/Components/Profile/Subcomponents/ContactInfoView.d.ts +1 -1
- package/dist/Components/Profile/Subcomponents/GroupSubHeaderView.d.ts +1 -1
- package/dist/Components/Profile/Subcomponents/GroupSubheaderForm.d.ts +2 -1
- package/dist/Components/Profile/Subcomponents/LinkedItemsHeaderView.d.ts +1 -1
- package/dist/Components/Profile/Subcomponents/PlusButton.d.ts +1 -1
- package/dist/Components/Profile/Subcomponents/ProfileStartEndForm.d.ts +1 -1
- package/dist/Components/Profile/Subcomponents/ProfileStartEndView.d.ts +1 -1
- package/dist/Components/Profile/Subcomponents/ProfileTextForm.d.ts +3 -2
- package/dist/Components/Profile/Subcomponents/ProfileTextView.d.ts +1 -1
- package/dist/Components/Profile/Templates/FlexForm.d.ts +2 -1
- package/dist/Components/Profile/Templates/FlexView.d.ts +1 -1
- package/dist/Components/Profile/Templates/OnepagerForm.d.ts +2 -1
- package/dist/Components/Profile/Templates/OnepagerView.d.ts +1 -1
- package/dist/Components/Profile/Templates/SimpleView.d.ts +1 -1
- package/dist/Components/Profile/Templates/TabsView.d.ts +2 -1
- package/dist/Components/Templates/AttestationForm.d.ts +1 -1
- package/dist/Components/Templates/DateUserInfo.d.ts +1 -1
- package/dist/Components/Templates/ItemCard.d.ts +1 -1
- package/dist/Components/Templates/TagView.d.ts +1 -1
- package/dist/index.js +21 -29
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
@@ -6,7 +6,8 @@ declare type TextAreaProps = {
|
|
6
6
|
inputStyle?: string;
|
7
7
|
defaultValue: string;
|
8
8
|
placeholder?: string;
|
9
|
+
required?: boolean;
|
9
10
|
updateFormValue?: (value: string) => void;
|
10
11
|
};
|
11
|
-
export declare function TextAreaInput({ labelTitle, dataField, labelStyle, containerStyle, inputStyle, defaultValue, placeholder, updateFormValue, }: TextAreaProps): import("react/jsx-runtime").JSX.Element;
|
12
|
+
export declare function TextAreaInput({ labelTitle, dataField, labelStyle, containerStyle, inputStyle, defaultValue, placeholder, required, updateFormValue, }: TextAreaProps): import("react/jsx-runtime").JSX.Element;
|
12
13
|
export {};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { LayerProps } from '#
|
1
|
+
import type { LayerProps } from '#types/LayerProps';
|
2
2
|
export declare const Layer: ({ data, children, name, menuIcon, menuText, menuColor, markerIcon, markerShape, markerDefaultColor, markerDefaultColor2, api, itemType, itemNameField, itemSubnameField, itemTextField, itemAvatarField, itemColorField, itemOwnerField, itemLatitudeField, itemLongitudeField, itemTagsField, itemOffersField, itemNeedsField, onlyOnePerOwner, customEditLink, customEditParameter, public_edit_items, listed, setItemFormPopup, itemFormPopup, clusterRef, }: LayerProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { ItemsApi
|
1
|
+
import type { ItemsApi } from '#types/ItemsApi';
|
2
|
+
import type { Permission } from '#types/Permission';
|
2
3
|
export declare function Permissions({ data, api, adminRole, }: {
|
3
4
|
data?: Permission[];
|
4
5
|
api?: ItemsApi<Permission>;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { ItemFormPopupProps } from '#
|
1
|
+
import type { ItemFormPopupProps } from '#types/ItemFormPopupProps';
|
2
2
|
export declare function ItemFormPopup(props: ItemFormPopupProps): import("react/jsx-runtime").JSX.Element;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { Item
|
1
|
+
import type { Item } from '#types/Item';
|
2
|
+
import type { ItemsApi } from '#types/ItemsApi';
|
2
3
|
export declare function HeaderView({ item, api, editCallback, deleteCallback, setPositionCallback, itemNameField, itemSubnameField, itemAvatarField, loading, hideMenu, big, truncateSubname, hideSubname, showAddress, }: {
|
3
4
|
item: Item;
|
4
5
|
api?: ItemsApi<any>;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { Item
|
2
|
+
import type { Item } from '#types/Item';
|
3
|
+
import type { ItemFormPopupProps } from '#types/ItemFormPopupProps';
|
3
4
|
export interface ItemViewPopupProps {
|
4
5
|
item: Item;
|
5
6
|
children?: React.ReactNode;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { UtopiaMapProps } from '#
|
1
|
+
import type { UtopiaMapProps } from '#types/UtopiaMapProps';
|
2
2
|
import 'react-toastify/dist/ReactToastify.css';
|
3
3
|
declare function UtopiaMap(props: UtopiaMapProps): import("react/jsx-runtime").JSX.Element;
|
4
4
|
export { UtopiaMap };
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import 'leaflet/dist/leaflet.css';
|
2
|
-
import { UtopiaMapProps } from '#src/types';
|
3
2
|
import './UtopiaMap.css';
|
3
|
+
import type { UtopiaMapProps } from '#types/UtopiaMapProps';
|
4
4
|
export declare function UtopiaMapInner({ height, width, center, zoom, children, geo, showFilterControl, showGratitudeControl, showLayerControl, infoText, }: UtopiaMapProps): import("react/jsx-runtime").JSX.Element;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { LayerProps
|
2
|
+
import type { LayerProps } from '#types/LayerProps';
|
3
|
+
import type { Tag } from '#types/Tag';
|
3
4
|
declare type UseFilterManagerResult = ReturnType<typeof useFilterManager>;
|
4
5
|
declare function useFilterManager(initialTags: Tag[]): {
|
5
6
|
filterTags: Tag[];
|
@@ -1,5 +1,6 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { Item
|
2
|
+
import type { Item } from '#types/Item';
|
3
|
+
import type { LayerProps } from '#types/LayerProps';
|
3
4
|
declare type UseItemManagerResult = ReturnType<typeof useItemsManager>;
|
4
5
|
declare function useItemsManager(initialItems: Item[]): {
|
5
6
|
items: Item[];
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { LayerProps } from '#
|
2
|
+
import type { LayerProps } from '#types/LayerProps';
|
3
3
|
declare type UseItemManagerResult = ReturnType<typeof useLayerManager>;
|
4
4
|
declare function useLayerManager(initialLayers: LayerProps[]): {
|
5
5
|
layers: LayerProps[];
|
@@ -1,5 +1,9 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { Item
|
2
|
+
import type { Item } from '#types/Item';
|
3
|
+
import type { ItemsApi } from '#types/ItemsApi';
|
4
|
+
import type { LayerProps } from '#types/LayerProps';
|
5
|
+
import type { Permission } from '#types/Permission';
|
6
|
+
import type { PermissionAction } from '#types/PermissionAction';
|
3
7
|
declare type UsePermissionManagerResult = ReturnType<typeof usePermissionsManager>;
|
4
8
|
declare function usePermissionsManager(initialPermissions: Permission[]): {
|
5
9
|
permissions: Permission[];
|
@@ -1,6 +1,8 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import {
|
3
|
-
import {
|
2
|
+
import type { Item } from '#types/Item';
|
3
|
+
import type { ItemFormPopupProps } from '#types/ItemFormPopupProps';
|
4
|
+
import type { LayerProps } from '#types/LayerProps';
|
5
|
+
import type { LatLng } from 'leaflet';
|
4
6
|
interface PolygonClickedProps {
|
5
7
|
position: LatLng;
|
6
8
|
setItemFormPopup: React.Dispatch<React.SetStateAction<ItemFormPopupProps | null>>;
|
@@ -1,5 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { Item
|
2
|
+
import type { Item } from '#types/Item';
|
3
|
+
import type { ItemsApi } from '#types/ItemsApi';
|
4
|
+
import type { Tag } from '#types/Tag';
|
3
5
|
declare type UseTagManagerResult = ReturnType<typeof useTagsManager>;
|
4
6
|
declare function useTagsManager(initialTags: Tag[]): {
|
5
7
|
tags: Tag[];
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Item } from '#
|
1
|
+
import type { Item } from '#types/Item';
|
2
2
|
export declare function ActionButton({ item, triggerAddButton, triggerItemSelected, existingRelations, itemType, colorField, collection, customStyle, }: {
|
3
3
|
triggerAddButton?: any;
|
4
4
|
triggerItemSelected?: any;
|
@@ -1,9 +1,10 @@
|
|
1
|
-
import { FormState } from '#
|
2
|
-
export declare const ProfileTextForm: ({ state, setState, dataField, heading, size, hideInputLabel, }: {
|
1
|
+
import type { FormState } from '#types/FormState';
|
2
|
+
export declare const ProfileTextForm: ({ state, setState, dataField, heading, size, hideInputLabel, required, }: {
|
3
3
|
state: FormState;
|
4
4
|
setState: React.Dispatch<React.SetStateAction<any>>;
|
5
5
|
dataField?: string | undefined;
|
6
6
|
heading: string;
|
7
7
|
size: string;
|
8
8
|
hideInputLabel: boolean;
|
9
|
+
required?: boolean | undefined;
|
9
10
|
}) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import {
|
1
|
+
import type { FormState } from '#types/FormState';
|
2
|
+
import type { Item } from '#types/Item';
|
2
3
|
export declare const FlexForm: ({ item, state, setState, }: {
|
3
4
|
state: FormState;
|
4
5
|
setState: React.Dispatch<React.SetStateAction<any>>;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { FormState
|
1
|
+
import type { FormState } from '#types/FormState';
|
2
|
+
import type { Item } from '#types/Item';
|
2
3
|
export declare const OnepagerForm: ({ item, state, setState, }: {
|
3
4
|
state: FormState;
|
4
5
|
setState: React.Dispatch<React.SetStateAction<any>>;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { Item
|
1
|
+
import type { Item } from '#types/Item';
|
2
|
+
import type { Tag } from '#types/Tag';
|
2
3
|
export declare const TabsView: ({ attestations, item, offers, needs, relations, updatePermission, loading, linkItem, unlinkItem, }: {
|
3
4
|
attestations: any[];
|
4
5
|
item: Item;
|
package/dist/index.js
CHANGED
@@ -548,13 +548,11 @@ function useItemsManager(initialItems) {
|
|
548
548
|
})];
|
549
549
|
case 1:
|
550
550
|
result = _a.sent();
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
setallItemsLoaded(true);
|
557
|
-
}
|
551
|
+
result.map(function (item) {
|
552
|
+
dispatch({ type: 'ADD', item: __assign(__assign({}, item), { layer: layer }) });
|
553
|
+
return null;
|
554
|
+
});
|
555
|
+
setallItemsLoaded(true);
|
558
556
|
return [2 /*return*/];
|
559
557
|
}
|
560
558
|
});
|
@@ -760,7 +758,7 @@ var AuthProvider = function (_a) {
|
|
760
758
|
return [4 /*yield*/, userApi.login(credentials.email, credentials.password)];
|
761
759
|
case 2:
|
762
760
|
res = _a.sent();
|
763
|
-
setToken(res.access_token);
|
761
|
+
setToken(res === null || res === void 0 ? void 0 : res.access_token);
|
764
762
|
return [4 /*yield*/, loadUser()];
|
765
763
|
case 3: return [2 /*return*/, _a.sent()];
|
766
764
|
case 4:
|
@@ -931,12 +929,10 @@ function usePermissionsManager(initialPermissions) {
|
|
931
929
|
case 0: return [4 /*yield*/, api.getItems()];
|
932
930
|
case 1:
|
933
931
|
result = _a.sent();
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
});
|
939
|
-
}
|
932
|
+
result.map(function (permission) {
|
933
|
+
dispatch({ type: 'ADD', permission: permission });
|
934
|
+
return null;
|
935
|
+
});
|
940
936
|
return [2 /*return*/];
|
941
937
|
}
|
942
938
|
});
|
@@ -1011,14 +1007,6 @@ var useSetAdminRole = function () {
|
|
1011
1007
|
return setAdminRole;
|
1012
1008
|
};
|
1013
1009
|
|
1014
|
-
var Geometry = /** @class */ (function () {
|
1015
|
-
function Geometry(lng, lat) {
|
1016
|
-
this.coordinates = [lng, lat];
|
1017
|
-
this.type = 'Point';
|
1018
|
-
}
|
1019
|
-
return Geometry;
|
1020
|
-
}());
|
1021
|
-
|
1022
1010
|
var SelectPositionContext = createContext({
|
1023
1011
|
selectPosition: null,
|
1024
1012
|
setSelectPosition: function () { },
|
@@ -1052,7 +1040,11 @@ function useSelectPositionManager() {
|
|
1052
1040
|
setSelectPosition(null);
|
1053
1041
|
}
|
1054
1042
|
if ('text' in selectPosition) {
|
1055
|
-
var position = (mapClicked === null || mapClicked === void 0 ? void 0 : mapClicked.position.lng) &&
|
1043
|
+
var position = (mapClicked === null || mapClicked === void 0 ? void 0 : mapClicked.position.lng) &&
|
1044
|
+
{
|
1045
|
+
type: 'Point',
|
1046
|
+
coordinates: [mapClicked.position.lng, mapClicked.position.lat],
|
1047
|
+
};
|
1056
1048
|
position && itemUpdatePosition(__assign(__assign({}, selectPosition), { position: position }));
|
1057
1049
|
setSelectPosition(null);
|
1058
1050
|
}
|
@@ -3293,9 +3285,9 @@ var rgbToHex = function (r, g, b) {
|
|
3293
3285
|
};
|
3294
3286
|
|
3295
3287
|
function TextAreaInput(_a) {
|
3296
|
-
var labelTitle = _a.labelTitle, dataField = _a.dataField, labelStyle = _a.labelStyle, containerStyle = _a.containerStyle, inputStyle = _a.inputStyle, defaultValue = _a.defaultValue, placeholder = _a.placeholder, updateFormValue = _a.updateFormValue;
|
3288
|
+
var labelTitle = _a.labelTitle, dataField = _a.dataField, labelStyle = _a.labelStyle, containerStyle = _a.containerStyle, inputStyle = _a.inputStyle, defaultValue = _a.defaultValue, placeholder = _a.placeholder, _b = _a.required, required = _b === void 0 ? true : _b, updateFormValue = _a.updateFormValue;
|
3297
3289
|
var ref = useRef(null);
|
3298
|
-
var
|
3290
|
+
var _c = useState(defaultValue), inputValue = _c[0], setInputValue = _c[1];
|
3299
3291
|
// prevent react18 from calling useEffect twice
|
3300
3292
|
var init = useRef(false);
|
3301
3293
|
var tags = useTags();
|
@@ -3335,7 +3327,7 @@ function TextAreaInput(_a) {
|
|
3335
3327
|
updateFormValue(newValue);
|
3336
3328
|
}
|
3337
3329
|
};
|
3338
|
-
return (jsxs("div", __assign({ className: "tw-form-control tw-w-full ".concat(containerStyle || '') }, { children: [labelTitle ? (jsx("label", __assign({ className: 'tw-label' }, { children: jsx("span", __assign({ className: "tw-label-text tw-text-base-content ".concat(labelStyle) }, { children: labelTitle })) }))) : null, jsx("textarea", { required:
|
3330
|
+
return (jsxs("div", __assign({ className: "tw-form-control tw-w-full ".concat(containerStyle || '') }, { children: [labelTitle ? (jsx("label", __assign({ className: 'tw-label' }, { children: jsx("span", __assign({ className: "tw-label-text tw-text-base-content ".concat(labelStyle) }, { children: labelTitle })) }))) : null, jsx("textarea", { required: required, ref: ref, value: inputValue, name: dataField, className: "tw-textarea tw-textarea-bordered tw-w-full tw-leading-5 ".concat(inputStyle || ''), placeholder: placeholder || '', onChange: handleChange })] })));
|
3339
3331
|
}
|
3340
3332
|
|
3341
3333
|
function TextInput(_a) {
|
@@ -3380,7 +3372,7 @@ function ItemFormPopup(props) {
|
|
3380
3372
|
formItem[input.name] = input.value;
|
3381
3373
|
}
|
3382
3374
|
});
|
3383
|
-
formItem.position =
|
3375
|
+
formItem.position = { type: 'Point', coordinates: [props.position.lng, props.position.lat] };
|
3384
3376
|
evt.preventDefault();
|
3385
3377
|
setSpinner(true);
|
3386
3378
|
formItem.text &&
|
@@ -5636,7 +5628,7 @@ var MarkdownHint = function () {
|
|
5636
5628
|
};
|
5637
5629
|
|
5638
5630
|
var ProfileTextForm = function (_a) {
|
5639
|
-
var state = _a.state, setState = _a.setState, dataField = _a.dataField, heading = _a.heading, size = _a.size, hideInputLabel = _a.hideInputLabel;
|
5631
|
+
var state = _a.state, setState = _a.setState, dataField = _a.dataField, heading = _a.heading, size = _a.size, hideInputLabel = _a.hideInputLabel, required = _a.required;
|
5640
5632
|
var _b = useState(dataField || 'text'), field = _b[0], setField = _b[1];
|
5641
5633
|
useEffect(function () {
|
5642
5634
|
if (!dataField) {
|
@@ -5648,7 +5640,7 @@ var ProfileTextForm = function (_a) {
|
|
5648
5640
|
var _a;
|
5649
5641
|
return (__assign(__assign({}, prevState), (_a = {}, _a[field] = v, _a)));
|
5650
5642
|
});
|
5651
|
-
}, labelStyle: hideInputLabel ? 'tw-hidden' : '', containerStyle: size === 'full' ? 'tw-grow tw-h-full' : '', inputStyle: size === 'full' ? 'tw-h-full' : 'tw-h-24' })] })));
|
5643
|
+
}, labelStyle: hideInputLabel ? 'tw-hidden' : '', containerStyle: size === 'full' ? 'tw-grow tw-h-full' : '', inputStyle: size === 'full' ? 'tw-h-full' : 'tw-h-24', required: required })] })));
|
5652
5644
|
};
|
5653
5645
|
|
5654
5646
|
var componentMap = {
|