utopia-ui 3.0.35 → 3.0.37

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/README.md CHANGED
@@ -26,103 +26,13 @@ It is the base of [Utopia Map](https://github.com/utopia-os/utopia-map) and [Uto
26
26
 
27
27
  ## Getting Started
28
28
 
29
- ### Basic Map
30
- In this tutorial we learn how we create a basic React app with a Map component using [utopia-ui](https://github.com/utopia-os/utopia-ui) library.
31
-
32
- For this tutorial we use Vite to create an empty React app called "utopia-static-map"
33
-
34
- ```shell
35
- npm create vite@latest utopia-static-map -- --template react
36
- ```
37
-
38
- We open our new app in the terminal and install the [utopia-ui](https://github.com/utopia-os/utopia-ui) package
39
-
40
- ```shell
41
- cd utopia-static-map
42
- npm install utopia-ui
43
- ```
44
-
45
- We open our `src/App.jsx` and we replace the content with
46
-
47
- ```jsx
48
- import { UtopiaMap } from "utopia-ui"
49
-
50
- function App() {
51
- return (
52
- <UtopiaMap center={[50.6, 9.5]} zoom={5} height='100dvh' width="100dvw">
53
- </UtopiaMap>
54
- )
55
- }
56
-
57
- export default App
58
-
59
- ```
60
-
61
- Then we start the development server to check out the result in our browser:
62
-
63
- ```shell
64
- npm run dev
65
- ```
66
-
67
- And can open our first map app in the browser 🙂
68
-
69
- ### Static Layers
70
-
71
- Now we add some static content in two layer.
72
-
73
- First we put some sample data in a new file called `src/sample-data.js`
74
-
75
- ```javascript
76
- export const places = [{
77
- "id": 51,
78
- "name": "Stadtgemüse",
79
- "text": "Stadtgemüse Fulda ist eine Gemüsegärtnerei in Maberzell, die es sich zur Aufgabe gemacht hat, die Stadt und seine Bewohner:innen mit regionalem, frischem und natürlich angebautem Gemüse mittels Gemüsekisten zu versorgen. Es gibt also jede Woche, von Frühjahr bis Herbst, angepasst an die Saison eine Kiste mit schmackhaftem und frischem Gemüse für euch, welche ihr direkt vor Ort abholen könnt. \r\n\r\nhttps://stadtgemuese-fulda.de",
80
- "position": { "type": "Point", "coordinates": [9.632435, 50.560342] },
81
- },
82
- {
83
- "id": 166,
84
- "name": "Weidendom",
85
- "text": "free camping",
86
- "position": { "type": "Point", "coordinates": [9.438793, 50.560112] },
87
- }];
88
-
89
- export const events = [
90
- {
91
- "id": 423,
92
- "name": "Hackathon",
93
- "text": "still in progress",
94
- "position": { "type": "Point", "coordinates": [10.5, 51.62] },
95
- "start": "2022-03-25T12:00:00",
96
- "end": "2022-05-12T12:00:00",
97
- }
98
- ]
99
- ```
100
-
101
- We want to create two Layers. One we want to call *Places* and the other *Events*
102
-
103
- we import our sample data to the `src/App.jsx`
104
-
105
- ```jsx
106
- import { events, places } from "./sample-data"
107
- ```
108
- and than we create our two `<Layer>` inside of our `<UtopiaMap>` component
109
- ```jsx
110
- <UtopiaMap center={[50.6, 15.5]} zoom={5} height='100dvh' width="100dvw">
111
- <Layer
112
- name='events'
113
- markerIcon='calendar'
114
- markerShape='square'
115
- markerDefaultColor='#700'
116
- data={events} />
117
- <Layer
118
- name='places'
119
- markerIcon='point'
120
- markerShape='circle'
121
- markerDefaultColor='#007'
122
- data={places} />
123
- </UtopiaMap>
124
-
125
- ```
29
+ 1. If you want to use **Utopia UI** in your project, check out [`/exampes`](/examples) to see how to use its components.
30
+
31
+ 2. If you like to contribute to our library, see the [Contribution Guide](/CONTRIBUTING.md) to see how to setup a development environment on your local machine.
32
+
33
+ ## Components
34
+
35
+ ![Utopia UI Components](Components.svg)
126
36
 
127
37
  ## Map Component
128
38
  The map shows various Layers (like places, events, profiles ...) of Items at their respective position whith nice and informative Popup and Profiles.
@@ -1,4 +1,4 @@
1
1
  import type { UtopiaMapProps } from '#types/UtopiaMapProps';
2
2
  import 'react-toastify/dist/ReactToastify.css';
3
- declare function UtopiaMap(props: UtopiaMapProps): import("react/jsx-runtime").JSX.Element;
3
+ declare function UtopiaMap({ height, width, center, zoom, children, geo, showFilterControl, showGratitudeControl, showLayerControl, infoText, }: UtopiaMapProps): import("react/jsx-runtime").JSX.Element;
4
4
  export { UtopiaMap };
@@ -1,4 +1,4 @@
1
1
  import 'leaflet/dist/leaflet.css';
2
2
  import './UtopiaMap.css';
3
3
  import type { UtopiaMapProps } from '#types/UtopiaMapProps';
4
- export declare function UtopiaMapInner({ height, width, center, zoom, children, geo, showFilterControl, showGratitudeControl, showLayerControl, infoText, }: UtopiaMapProps): import("react/jsx-runtime").JSX.Element;
4
+ export declare function UtopiaMapInner({ children, geo, showFilterControl, showGratitudeControl, showLayerControl, infoText, }: UtopiaMapProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import type { ItemsApi } from '#types/ItemsApi';
2
2
  export declare const AttestationForm: ({ api }: {
3
- api?: ItemsApi<any> | undefined;
3
+ api?: ItemsApi<unknown> | undefined;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,10 @@
1
- export declare const EmojiPicker: ({ selectedEmoji, selectedColor, selectedShape, setSelectedEmoji, setSelectedColor, setSelectedShape, }: {
2
- selectedEmoji: any;
3
- selectedColor: any;
4
- selectedShape: any;
5
- setSelectedEmoji: any;
6
- setSelectedColor: any;
7
- setSelectedShape: any;
8
- }) => import("react/jsx-runtime").JSX.Element;
1
+ interface Props {
2
+ selectedEmoji: string;
3
+ selectedColor: string;
4
+ selectedShape: string;
5
+ setSelectedEmoji: (emoji: string) => void;
6
+ setSelectedColor: (color: string) => void;
7
+ setSelectedShape: (shape: string) => void;
8
+ }
9
+ export declare const EmojiPicker: ({ selectedEmoji, selectedColor, selectedShape, setSelectedEmoji, setSelectedColor, setSelectedShape, }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1 @@
1
+ export declare function containsUUID(str: string): boolean;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import './index.css';
2
2
  export { UtopiaMap, Layer, Tags, Permissions, ItemForm, ItemView, PopupTextAreaInput, PopupStartEndInput, PopupTextInput, PopupButton, TextView, StartEndView, PopupCheckboxInput, } from './Components/Map';
3
3
  export { AppShell, Content, SideBar, Sitemap } from './Components/AppShell';
4
- export { AuthProvider, useAuth, LoginPage, SignupPage, RequestPasswordPage, SetNewPasswordPage, } from './Components/Auth';
4
+ export { AuthProvider, LoginPage, SignupPage, RequestPasswordPage, SetNewPasswordPage, } from './Components/Auth';
5
5
  export { UserSettings, ProfileView, ProfileForm } from './Components/Profile';
6
6
  export { Quests, Modal } from './Components/Gaming';
7
7
  export { TitleCard, CardPage, MapOverlayPage, OverlayItemsIndexPage, MoonCalendar, SelectUser, AttestationForm, MarketView, } from './Components/Templates';
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { DomEvent, divIcon, Point, control, marker, LatLng, LatLngBounds } from 'leaflet';
3
+ import { useMap, useMapEvents, TileLayer, GeoJSON, MapContainer, Popup, Marker, Tooltip } from 'react-leaflet';
2
4
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3
5
  import { createContext, useContext, useState, useCallback, useReducer, useEffect, createRef, useRef, memo, Children, isValidElement, cloneElement, forwardRef } from 'react';
4
6
  import { useNavigate, useLocation, BrowserRouter, Link, Outlet, NavLink } from 'react-router-dom';
5
7
  import { toast, ToastContainer } from 'react-toastify';
6
- import { DomEvent, divIcon, Point, control, marker, LatLng, LatLngBounds } from 'leaflet';
7
- import { useMap, useMapEvents, MapContainer, TileLayer, GeoJSON, Popup, Marker, Tooltip } from 'react-leaflet';
8
8
  import 'leaflet/dist/leaflet.css';
9
9
  import MarkerClusterGroup from 'react-leaflet-cluster';
10
10
  import axios from 'axios';
@@ -21,9 +21,9 @@ import { initTE, Sidenav } from 'tw-elements';
21
21
  import ChevronDownIcon from '@heroicons/react/24/outline/ChevronDownIcon';
22
22
  import { ChevronLeftIcon, ChevronRightIcon as ChevronRightIcon$1 } from '@heroicons/react/24/outline';
23
23
  import { startOfToday, format, parse, sub, add } from 'date-fns';
24
- import Lightbox from 'yet-another-react-lightbox';
25
- import 'yet-another-react-lightbox/styles.css';
26
24
  import { RowsPhotoAlbum } from 'react-photo-album';
25
+ import ReactLightbox from 'yet-another-react-lightbox';
26
+ import 'yet-another-react-lightbox/styles.css';
27
27
  import 'react-photo-album/rows.css';
28
28
  import { centerCrop, makeAspectCrop, ReactCrop } from 'react-image-crop';
29
29
  import 'react-image-crop/dist/ReactCrop.css';
@@ -1398,9 +1398,14 @@ var Wrappers = function (_a) {
1398
1398
  return (jsx(PermissionsProvider, __assign({ initialPermissions: [] }, { children: jsx(TagsProvider, __assign({ initialTags: [] }, { children: jsx(LayersProvider, __assign({ initialLayers: [] }, { children: jsx(FilterProvider, __assign({ initialTags: [] }, { children: jsx(ItemsProvider, __assign({ initialItems: [] }, { children: jsx(SelectPositionProvider, { children: jsx(LeafletRefsProvider, __assign({ initialLeafletRefs: {} }, { children: jsx(QueryClientProvider, __assign({ client: queryClient }, { children: jsx(AppStateProvider, { children: jsx(ClusterRefProvider, { children: jsxs(QuestsProvider, __assign({ initialOpen: true }, { children: [jsx(ToastContainer, { position: 'top-right', autoClose: 2000, hideProgressBar: true, newestOnTop: false, closeOnClick: true, rtl: false, pauseOnFocusLoss: true, draggable: true, pauseOnHover: true, theme: 'light' }), children] })) }) }) })) })) }) })) })) })) })) })));
1399
1399
  };
1400
1400
 
1401
- var css_248z$1 = ".leaflet-container {\n text-align: left;\n background-image: url(\"data:image/svg+xml,%3Csvg width='40' height='40' stroke='%23000' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_V8m1%7Btransform-origin:center;animation:spinner_zKoa 2s linear infinite%7D.spinner_V8m1 circle%7Bstroke-linecap:round;animation:spinner_YpZS 1.5s ease-out infinite%7D%40keyframes spinner_zKoa%7B100%25%7Btransform:rotate(360deg)%7D%7D%40keyframes spinner_YpZS%7B0%25%7Bstroke-dasharray:0 150;stroke-dashoffset:0%7D47.5%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-16%7D95%25%2C100%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-59%7D%7D%3C%2Fstyle%3E%3Cg class='spinner_V8m1'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3'%3E%3C%2Fcircle%3E%3C%2Fg%3E%3C%2Fsvg%3E\");\n background-repeat: no-repeat;\n background-attachment: fixed;\n background-position: 50% 80%; \n }\n \n input {\n box-sizing: border-box;\n }\n \n textarea {\n box-sizing: border-box;\n }\n \n .leaflet-control-attribution {\n display: none;\n }\n \n .leaflet-control-locate {\n display: none;\n }\n\n .leaflet-data-marker {\n \n background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAQCAYAAACcN8ZaAAAB3klEQVR42s3U4UdDURzG8czMXJnJ1Vwzc6VJZjaZJdlMlpQsKdmUFNOUspRSSqUolfQfr+fF98Vx5mwv9qbDx7LdznnO7/7Omej3+/+Ga0QMUYkhbvBgmhzCQxwxibIGrGEF8CQhU+LLtKQkQNqScUgjxRxTBIxbgfgD/BgnhM8kM5KTeclLQYqGkkMRBckzR8ic/mAgd5BAZplsUaqyIg2sDtHg2brUZJk5SmwopErJUWE8SpmTMhNvya60Zd/SNrR4bkeaskG4uiwRZk6yrJEYFibGAxn+scECHTmTnuVCzvmty3PHciB7bGKN6lQkzysPqIrHmpFhYbKUtckC1/Ioz4ZHuZdbuSLYiRxRpSZVWXZVxAzC0R4Ik5SQsu6w8yd5l2/5kg95I9SdXMoZQfYIUjeqEUrgOkXGPeN4TYRhxy8E+ZUf+eS7B7miIoeybVSjKDnm8u3+gH3pDTYwu1igATvs/pXqvBKiR4i2bNJfi1ZfUAnjgrOG8wY2quNzBKuU/ZS+uSFEl5O0xRGuUIlZCcw7xG5QPkeHYUSNV5WXGou2sC3rBC0LjenqCXGO0WEiTJa0Lr4KixdHBrDGuGGiRqCUpFk8pGIpQtCU7p4YPwxYxEMCk1aAMQZh8Ac8PfbIzYPJOwAAAABJRU5ErkJggg==') no-repeat;\n background-position: 6px 32px;\n }\n \n .crosshair-cursor-enabled {\n cursor: crosshair;\n }\n \n .leaflet-container {\n cursor: inherit;\n }\n \n .calendar-icon {\n position: relative;\n top: -35px;\n left: 10px;\n width: 13px;\n }\n \n .user-icon {\n position: relative;\n top: -36px;\n left: 10px;\n width: 13px;\n }\n\n .circle-icon {\n position: relative;\n top: -33px;\n left: 10px;\n width: 13px;\n }\n\n .fire-icon {\n position: relative;\n top: -36px;\n left: 10px;\n width: 13px;\n }\n\n .tree-icon {\n position: relative;\n top: -38px;\n left: 4px;\n width: 24px;\n }\n\n .music-icon {\n position: relative;\n top: -35px;\n left: 4px;\n width: 24px;\n }\n\n .quest-icon {\n position: relative;\n top: -34px;\n left: 4px;\n width: 24px;\n }\n\n .drum-icon {\n position: relative;\n top: -38px;\n left: 4px;\n width: 24px;\n }\n\n \n .compass-icon {\n position: relative;\n top: -36.5px;\n left: 4px;\n width: 24px;\n }\n\n .group-icon {\n position: relative;\n top: -37px;\n left: 4px;\n width: 24px;\n }\n\n .liebevoll-jetzt-icon{\n position: relative;\n top: -35px;\n left: 4px;\n width: 24px;\n }\n\n .staff-snake-icon {\n position: relative;\n top: -35px;\n left: 4px;\n width: 24px;\n }\n\n .flower-icon {\n position: relative;\n top: -35px;\n left: 4px;\n width: 24px;\n }\n \n .network-icon {\n position: relative;\n top: -35px;\n left: 4px;\n width: 24px;\n }\n \n .leaflet-popup-scrolled {\n overflow-x: hidden;\n }\n\n .leaflet-popup-content-wrapper, .leaflet-popup-tip{\n background-color: var(--fallback-b1,oklch(var(--b1)/1));\n color: var(--fallback-bc,oklch(var(--bc)/1));\n\n }\n\n .leaflet-tooltip {\n background-color: var(--fallback-b1,oklch(var(--b1)/1));\n color: var(--fallback-bc,oklch(var(--bc)/1));\n border-width: 0px;\n border-radius: 1em;\n transition: opacity 500ms;\n transition-delay: 50ms;\n }\n\n .leaflet-tooltip-top::before {\n border-top-color: var(--fallback-b1,oklch(var(--b1)/1));\n }\n\n .marker-cluster span {\n color: #000;\n }";
1401
+ var css_248z$1 = ".leaflet-container {\n text-align: left;\n background-image: url(\"data:image/svg+xml,%3Csvg width='40' height='40' stroke='%23000' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_V8m1%7Btransform-origin:center;animation:spinner_zKoa 2s linear infinite%7D.spinner_V8m1 circle%7Bstroke-linecap:round;animation:spinner_YpZS 1.5s ease-out infinite%7D%40keyframes spinner_zKoa%7B100%25%7Btransform:rotate(360deg)%7D%7D%40keyframes spinner_YpZS%7B0%25%7Bstroke-dasharray:0 150;stroke-dashoffset:0%7D47.5%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-16%7D95%25%2C100%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-59%7D%7D%3C%2Fstyle%3E%3Cg class='spinner_V8m1'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3'%3E%3C%2Fcircle%3E%3C%2Fg%3E%3C%2Fsvg%3E\");\n background-repeat: no-repeat;\n background-attachment: fixed;\n background-position: 50% 80%; \n }\n \n input {\n box-sizing: border-box;\n }\n \n textarea {\n box-sizing: border-box;\n }\n \n .leaflet-control-attribution {\n display: none;\n }\n \n .leaflet-control-locate {\n display: none;\n }\n\n .leaflet-data-marker {\n \n background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAQCAYAAACcN8ZaAAAB3klEQVR42s3U4UdDURzG8czMXJnJ1Vwzc6VJZjaZJdlMlpQsKdmUFNOUspRSSqUolfQfr+fF98Vx5mwv9qbDx7LdznnO7/7Omej3+/+Ga0QMUYkhbvBgmhzCQxwxibIGrGEF8CQhU+LLtKQkQNqScUgjxRxTBIxbgfgD/BgnhM8kM5KTeclLQYqGkkMRBckzR8ic/mAgd5BAZplsUaqyIg2sDtHg2brUZJk5SmwopErJUWE8SpmTMhNvya60Zd/SNrR4bkeaskG4uiwRZk6yrJEYFibGAxn+scECHTmTnuVCzvmty3PHciB7bGKN6lQkzysPqIrHmpFhYbKUtckC1/Ioz4ZHuZdbuSLYiRxRpSZVWXZVxAzC0R4Ik5SQsu6w8yd5l2/5kg95I9SdXMoZQfYIUjeqEUrgOkXGPeN4TYRhxy8E+ZUf+eS7B7miIoeybVSjKDnm8u3+gH3pDTYwu1igATvs/pXqvBKiR4i2bNJfi1ZfUAnjgrOG8wY2quNzBKuU/ZS+uSFEl5O0xRGuUIlZCcw7xG5QPkeHYUSNV5WXGou2sC3rBC0LjenqCXGO0WEiTJa0Lr4KixdHBrDGuGGiRqCUpFk8pGIpQtCU7p4YPwxYxEMCk1aAMQZh8Ac8PfbIzYPJOwAAAABJRU5ErkJggg==') no-repeat;\n background-position: 6px 32px;\n }\n \n .crosshair-cursor-enabled {\n cursor: crosshair;\n }\n \n .leaflet-container {\n cursor: inherit;\n }\n \n .calendar-icon {\n position: relative;\n top: -35px;\n left: 10px;\n width: 13px;\n }\n \n .user-icon {\n position: relative;\n top: -36px;\n left: 10px;\n width: 13px;\n }\n\n .circle-icon {\n position: relative;\n top: -33px;\n left: 10px;\n width: 13px;\n }\n\n .fire-icon {\n position: relative;\n top: -36px;\n left: 10px;\n width: 13px;\n }\n\n .tree-icon {\n position: relative;\n top: -38px;\n left: 4px;\n width: 24px;\n }\n\n .music-icon {\n position: relative;\n top: -35px;\n left: 4px;\n width: 24px;\n }\n\n .quest-icon {\n position: relative;\n top: -34px;\n left: 4px;\n width: 24px;\n }\n\n .drum-icon {\n position: relative;\n top: -38px;\n left: 4px;\n width: 24px;\n }\n\n \n .compass-icon {\n position: relative;\n top: -36.5px;\n left: 4px;\n width: 24px;\n }\n\n .group-icon {\n position: relative;\n top: -37px;\n left: 4px;\n width: 24px;\n }\n\n .liebevoll-jetzt-icon{\n position: relative;\n top: -35px;\n left: 4px;\n width: 24px;\n }\n\n .staff-snake-icon {\n position: relative;\n top: -35px;\n left: 4px;\n width: 24px;\n }\n\n .flower-icon {\n position: relative;\n top: -35px;\n left: 4px;\n width: 24px;\n }\n \n .network-icon {\n position: relative;\n top: -35px;\n left: 4px;\n width: 24px;\n }\n\n .shop-icon {\n position: relative;\n top: -34px;\n left: 4px;\n width: 24px;\n }\n\n .plant-icon {\n position: relative;\n top: -34px;\n left: 4px;\n width: 24px;\n }\n\n .circle-dot-icon {\n position: relative;\n top: -36px;\n left: 4px;\n width: 24px;\n }\n \n .leaflet-popup-scrolled {\n overflow-x: hidden;\n }\n\n .leaflet-popup-content-wrapper, .leaflet-popup-tip{\n background-color: var(--fallback-b1,oklch(var(--b1)/1));\n color: var(--fallback-bc,oklch(var(--bc)/1));\n\n }\n\n .leaflet-tooltip {\n background-color: var(--fallback-b1,oklch(var(--b1)/1));\n color: var(--fallback-bc,oklch(var(--bc)/1));\n border-width: 0px;\n border-radius: 1em;\n transition: opacity 500ms;\n transition-delay: 50ms;\n }\n\n .leaflet-tooltip-top::before {\n border-top-color: var(--fallback-b1,oklch(var(--b1)/1));\n }\n\n .marker-cluster span {\n color: #000;\n }";
1402
1402
  styleInject(css_248z$1);
1403
1403
 
1404
+ function containsUUID(str) {
1405
+ var uuidRegex = /[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i;
1406
+ return uuidRegex.test(str);
1407
+ }
1408
+
1404
1409
  function AddButton(_a) {
1405
1410
  var triggerAction = _a.triggerAction;
1406
1411
  var layers = useLayers();
@@ -1785,6 +1790,14 @@ var addIcon = function (icon) {
1785
1790
  return '<svg class="flower-icon" stroke="currentColor" fill="#fff" stroke-width="0" viewBox="0 0 256 256" height="1.5em" width="1.5em" xmlns="http://www.w3.org/2000/svg"><path d="M210.35,129.36c-.81-.47-1.7-.92-2.62-1.36.92-.44,1.81-.89,2.62-1.36a40,40,0,1,0-40-69.28c-.81.47-1.65,1-2.48,1.59.08-1,.13-2,.13-3a40,40,0,0,0-80,0c0,.94,0,1.94.13,3-.83-.57-1.67-1.12-2.48-1.59a40,40,0,1,0-40,69.28c.81.47,1.7.92,2.62,1.36-.92.44-1.81.89-2.62,1.36a40,40,0,1,0,40,69.28c.81-.47,1.65-1,2.48-1.59-.08,1-.13,2-.13,2.95a40,40,0,0,0,80,0c0-.94-.05-1.94-.13-2.95.83.57,1.67,1.12,2.48,1.59A39.79,39.79,0,0,0,190.29,204a40.43,40.43,0,0,0,10.42-1.38,40,40,0,0,0,9.64-73.28ZM104,128a24,24,0,1,1,24,24A24,24,0,0,1,104,128Zm74.35-56.79a24,24,0,1,1,24,41.57c-6.27,3.63-18.61,6.13-35.16,7.19A40,40,0,0,0,154.53,98.1C163.73,84.28,172.08,74.84,178.35,71.21ZM128,32a24,24,0,0,1,24,24c0,7.24-4,19.19-11.36,34.06a39.81,39.81,0,0,0-25.28,0C108,75.19,104,63.24,104,56A24,24,0,0,1,128,32ZM44.86,80a24,24,0,0,1,32.79-8.79c6.27,3.63,14.62,13.07,23.82,26.89A40,40,0,0,0,88.81,120c-16.55-1.06-28.89-3.56-35.16-7.18A24,24,0,0,1,44.86,80ZM77.65,184.79a24,24,0,1,1-24-41.57c6.27-3.63,18.61-6.13,35.16-7.19a40,40,0,0,0,12.66,21.87C92.27,171.72,83.92,181.16,77.65,184.79ZM128,224a24,24,0,0,1-24-24c0-7.24,4-19.19,11.36-34.06a39.81,39.81,0,0,0,25.28,0C148,180.81,152,192.76,152,200A24,24,0,0,1,128,224Zm83.14-48a24,24,0,0,1-32.79,8.79c-6.27-3.63-14.62-13.07-23.82-26.89A40,40,0,0,0,167.19,136c16.55,1.06,28.89,3.56,35.16,7.18A24,24,0,0,1,211.14,176Z"></path></svg>';
1786
1791
  case 'network':
1787
1792
  return '<svg class="network-icon" stroke="currentColor" fill="#fff" stroke-width="0" viewBox="0 0 256 256" height="1.5em" width="1.5em" xmlns="http://www.w3.org/2000/svg"><path d="M212,200a36,36,0,1,1-69.85-12.25l-53-34.05a36,36,0,1,1,0-51.4l53-34a36.09,36.09,0,1,1,8.67,13.45l-53,34.05a36,36,0,0,1,0,24.5l53,34.05A36,36,0,0,1,212,200Z"></path></svg>';
1793
+ case 'crosshair':
1794
+ return '<svg class="network-icon" stroke="currentColor" fill="#fff" stroke-width="0" viewBox="0 0 512 512" height="1.5em" width="1.5em" xmlns="http://www.w3.org/2000/svg"><path d="M256 0c17.7 0 32 14.3 32 32l0 10.4c93.7 13.9 167.7 88 181.6 181.6l10.4 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-10.4 0c-13.9 93.7-88 167.7-181.6 181.6l0 10.4c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-10.4C130.3 455.7 56.3 381.7 42.4 288L32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l10.4 0C56.3 130.3 130.3 56.3 224 42.4L224 32c0-17.7 14.3-32 32-32zM107.4 288c12.5 58.3 58.4 104.1 116.6 116.6l0-20.6c0-17.7 14.3-32 32-32s32 14.3 32 32l0 20.6c58.3-12.5 104.1-58.4 116.6-116.6L384 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l20.6 0C392.1 165.7 346.3 119.9 288 107.4l0 20.6c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-20.6C165.7 119.9 119.9 165.7 107.4 224l20.6 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-20.6 0zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"></path></svg>';
1795
+ case 'shop':
1796
+ return '<svg class="shop-icon" stroke="currentColor" fill="#fff" stroke-width="0" viewBox="0 0 640 512" height="1.25em" width="1.25em" xmlns="http://www.w3.org/2000/svg"><path d="M36.8 192l566.3 0c20.3 0 36.8-16.5 36.8-36.8c0-7.3-2.2-14.4-6.2-20.4L558.2 21.4C549.3 8 534.4 0 518.3 0L121.7 0c-16 0-31 8-39.9 21.4L6.2 134.7c-4 6.1-6.2 13.2-6.2 20.4C0 175.5 16.5 192 36.8 192zM64 224l0 160 0 80c0 26.5 21.5 48 48 48l224 0c26.5 0 48-21.5 48-48l0-80 0-160-64 0 0 160-192 0 0-160-64 0zm448 0l0 256c0 17.7 14.3 32 32 32s32-14.3 32-32l0-256-64 0z"></path></svg>';
1797
+ case 'plant':
1798
+ return '<svg class="plant-icon" stroke="currentColor" stroke-width="0" fill="#fff" viewBox="0 0 256 256" height="1.5em" width="1.5em" xmlns="http://www.w3.org/2000/svg"><path d="M205.41,159.07a60.9,60.9,0,0,1-31.83,8.86,71.71,71.71,0,0,1-27.36-5.66A55.55,55.55,0,0,0,136,194.51V224a8,8,0,0,1-8.53,8,8.18,8.18,0,0,1-7.47-8.25V211.31L81.38,172.69A52.5,52.5,0,0,1,63.44,176a45.82,45.82,0,0,1-23.92-6.67C17.73,156.09,6,125.62,8.27,87.79a8,8,0,0,1,7.52-7.52c37.83-2.23,68.3,9.46,81.5,31.25A46,46,0,0,1,103.74,140a4,4,0,0,1-6.89,2.43l-19.2-20.1a8,8,0,0,0-11.31,11.31l53.88,55.25c.06-.78.13-1.56.21-2.33a68.56,68.56,0,0,1,18.64-39.46l50.59-53.46a8,8,0,0,0-11.31-11.32l-49,51.82a4,4,0,0,1-6.78-1.74c-4.74-17.48-2.65-34.88,6.4-49.82,17.86-29.48,59.42-45.26,111.18-42.22a8,8,0,0,1,7.52,7.52C250.67,99.65,234.89,141.21,205.41,159.07Z"></path></svg>';
1799
+ case 'circle-dot':
1800
+ return '<svg class="circle-dot-icon" stroke="#fff" fill="transparent" stroke-width="2.5" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" height="1.55em" width="1.55em" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="1"></circle></svg>';
1788
1801
  default:
1789
1802
  return '';
1790
1803
  }
@@ -3153,18 +3166,19 @@ var SelectPosition = function (_a) {
3153
3166
  } }, { children: jsx("p", __assign({ className: 'tw-text-center ' }, { children: "\u2715" })) })), jsx("div", __assign({ className: 'tw-alert tw-bg-base-100 tw-text-base-content' }, { children: jsx("div", { children: jsx("span", __assign({ className: 'tw-text-lg' }, { children: "Select position on the map!" })) }) }))] })));
3154
3167
  };
3155
3168
 
3156
- var mapDivRef = createRef();
3157
3169
  function UtopiaMapInner(_a) {
3158
- var _b = _a.height, height = _b === void 0 ? '500px' : _b, _c = _a.width, width = _c === void 0 ? '100%' : _c, _d = _a.center, center = _d === void 0 ? [50.6, 9.5] : _d, _e = _a.zoom, zoom = _e === void 0 ? 10 : _e, children = _a.children, geo = _a.geo, _f = _a.showFilterControl, showFilterControl = _f === void 0 ? false : _f, _g = _a.showGratitudeControl, showGratitudeControl = _g === void 0 ? false : _g, _h = _a.showLayerControl, showLayerControl = _h === void 0 ? true : _h, infoText = _a.infoText;
3159
- // Hooks that rely on contexts, called after ContextWrapper is provided
3170
+ var children = _a.children, geo = _a.geo, _b = _a.showFilterControl, showFilterControl = _b === void 0 ? false : _b, _c = _a.showGratitudeControl, showGratitudeControl = _c === void 0 ? false : _c, _d = _a.showLayerControl, showLayerControl = _d === void 0 ? true : _d, infoText = _a.infoText;
3160
3171
  var selectNewItemPosition = useSelectPosition();
3161
3172
  var setSelectNewItemPosition = useSetSelectPosition();
3162
3173
  var setClusterRef = useSetClusterRef();
3163
3174
  var clusterRef = useClusterRef();
3164
3175
  var setMapClicked = useSetMapClicked();
3165
- var _j = useState(null), itemFormPopup = _j[0], setItemFormPopup = _j[1];
3176
+ var _e = useState(null), itemFormPopup = _e[0], setItemFormPopup = _e[1];
3166
3177
  var layers = useLayers();
3167
3178
  var addVisibleLayer = useAddVisibleLayer();
3179
+ var leafletRefs = useLeafletRefs();
3180
+ var location = useLocation();
3181
+ var map = useMap();
3168
3182
  useEffect(function () {
3169
3183
  layers.forEach(function (layer) { return addVisibleLayer(layer); });
3170
3184
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -3194,10 +3208,62 @@ function UtopiaMapInner(_a) {
3194
3208
  });
3195
3209
  return null;
3196
3210
  }
3211
+ useMapEvents({
3212
+ popupopen: function (e) {
3213
+ var _a, _b;
3214
+ var item = (_a = Object.entries(leafletRefs).find(function (r) { return r[1].popup === e.popup; })) === null || _a === void 0 ? void 0 : _a[1].item;
3215
+ if (window.location.pathname.split('/')[1] !== (item === null || item === void 0 ? void 0 : item.id)) {
3216
+ var params = new URLSearchParams(window.location.search);
3217
+ if (!location.pathname.includes('/item/')) {
3218
+ window.history.pushState({}, '', "/".concat(item === null || item === void 0 ? void 0 : item.id) + "".concat(params.toString() !== '' ? "?".concat(params) : ''));
3219
+ }
3220
+ var title = '';
3221
+ if (item === null || item === void 0 ? void 0 : item.name)
3222
+ title = item.name;
3223
+ else if ((_b = item === null || item === void 0 ? void 0 : item.layer) === null || _b === void 0 ? void 0 : _b.itemNameField)
3224
+ title = getValue(item, item.layer.itemNameField);
3225
+ document.title = "".concat(document.title.split('-')[0], " - ").concat(title);
3226
+ }
3227
+ },
3228
+ });
3229
+ var openPopup = function () {
3230
+ var _a, _b, _c;
3231
+ if (!containsUUID(window.location.pathname)) {
3232
+ map.closePopup();
3233
+ }
3234
+ else {
3235
+ if (window.location.pathname.split('/')[1]) {
3236
+ var id = window.location.pathname.split('/')[1];
3237
+ // eslint-disable-next-line security/detect-object-injection
3238
+ var ref_1 = leafletRefs[id];
3239
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
3240
+ if (ref_1) {
3241
+ clusterRef.hasLayer(ref_1.marker) &&
3242
+ (clusterRef === null || clusterRef === void 0 ? void 0 : clusterRef.zoomToShowLayer(ref_1.marker, function () {
3243
+ ref_1.marker.openPopup();
3244
+ }));
3245
+ var title = '';
3246
+ if (ref_1.item.name)
3247
+ title = ref_1.item.name;
3248
+ else if ((_a = ref_1.item.layer) === null || _a === void 0 ? void 0 : _a.itemNameField)
3249
+ title = getValue(ref_1.item.name, ref_1.item.layer.itemNameField);
3250
+ document.title = "".concat(document.title.split('-')[0], " - ").concat(title);
3251
+ (_b = document
3252
+ .querySelector('meta[property="og:title"]')) === null || _b === void 0 ? void 0 : _b.setAttribute('content', ref_1.item.name);
3253
+ (_c = document
3254
+ .querySelector('meta[property="og:description"]')) === null || _c === void 0 ? void 0 : _c.setAttribute('content', ref_1.item.text);
3255
+ }
3256
+ }
3257
+ }
3258
+ };
3259
+ useEffect(function () {
3260
+ openPopup();
3261
+ // eslint-disable-next-line react-hooks/exhaustive-deps
3262
+ }, [leafletRefs, location]);
3197
3263
  var resetMetaTags = function () {
3198
3264
  var _a, _b, _c;
3199
3265
  var params = new URLSearchParams(window.location.search);
3200
- if (!window.location.pathname.includes('/item/')) {
3266
+ if (!containsUUID(window.location.pathname)) {
3201
3267
  window.history.pushState({}, '', '/' + "".concat(params.toString() !== '' ? "?".concat(params) : ''));
3202
3268
  }
3203
3269
  document.title = document.title.split('-')[0];
@@ -3210,22 +3276,23 @@ function UtopiaMapInner(_a) {
3210
3276
  layer.bindPopup(feature.properties.name);
3211
3277
  }
3212
3278
  };
3213
- return (jsxs("div", __assign({ className: "tw-h-full ".concat(selectNewItemPosition != null ? 'crosshair-cursor-enabled' : undefined) }, { children: [jsxs(MapContainer, __assign({ ref: mapDivRef, style: { height: height, width: width }, center: new LatLng(center[0], center[1]), zoom: zoom, zoomControl: false, maxZoom: 19 }, { children: [jsx(Outlet, {}), jsxs(Control, __assign({ position: 'topLeft', zIndex: '1000', absolute: true }, { children: [jsx(SearchControl, {}), jsx(TagsControl, {})] })), jsxs(Control, __assign({ position: 'bottomLeft', zIndex: '999', absolute: true }, { children: [showFilterControl && jsx(FilterControl, {}), showLayerControl && jsx(LayerControl, {}), showGratitudeControl && jsx(GratitudeControl, {})] })), jsx(TileLayer, { maxZoom: 19, attribution: '\u00A9 <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', url: 'https://tile.osmand.net/hd/{z}/{x}/{y}.png' }), jsx(MarkerClusterGroup, __assign({ ref: function (r) { return setClusterRef(r); }, showCoverageOnHover: true, chunkedLoading: true, maxClusterRadius: 50, removeOutsideVisibleBounds: false }, { children: Children.toArray(children).map(function (child) {
3214
- return isValidElement(child)
3215
- ? cloneElement(child, { setItemFormPopup: setItemFormPopup, itemFormPopup: itemFormPopup, clusterRef: clusterRef })
3216
- : child;
3217
- }) })), geo && (jsx(GeoJSON, { data: geo, onEachFeature: onEachFeature, eventHandlers: {
3218
- click: function (e) {
3219
- if (selectNewItemPosition) {
3220
- e.layer.closePopup();
3221
- setMapClicked({ position: e.latlng, setItemFormPopup: setItemFormPopup });
3222
- }
3223
- },
3224
- } })), jsx(MapEventListener, {})] })), jsx(AddButton, { triggerAction: setSelectNewItemPosition }), selectNewItemPosition != null && (jsx(SelectPosition, { setSelectNewItemPosition: setSelectNewItemPosition }))] })));
3279
+ return (jsxs("div", __assign({ className: "tw-h-full ".concat(selectNewItemPosition != null ? 'crosshair-cursor-enabled' : undefined) }, { children: [jsx(Outlet, {}), jsxs(Control, __assign({ position: 'topLeft', zIndex: '1000', absolute: true }, { children: [jsx(SearchControl, {}), jsx(TagsControl, {})] })), jsxs(Control, __assign({ position: 'bottomLeft', zIndex: '999', absolute: true }, { children: [showFilterControl && jsx(FilterControl, {}), showLayerControl && jsx(LayerControl, {}), showGratitudeControl && jsx(GratitudeControl, {})] })), jsx(TileLayer, { maxZoom: 19, attribution: '\u00A9 <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', url: 'https://tile.osmand.net/hd/{z}/{x}/{y}.png' }), jsx(MarkerClusterGroup, __assign({ ref: function (r) { return setClusterRef(r); }, showCoverageOnHover: true, chunkedLoading: true, maxClusterRadius: 50, removeOutsideVisibleBounds: false }, { children: Children.toArray(children).map(function (child) {
3280
+ return isValidElement(child)
3281
+ ? cloneElement(child, { setItemFormPopup: setItemFormPopup, itemFormPopup: itemFormPopup, clusterRef: clusterRef })
3282
+ : child;
3283
+ }) })), geo && (jsx(GeoJSON, { data: geo, onEachFeature: onEachFeature, eventHandlers: {
3284
+ click: function (e) {
3285
+ if (selectNewItemPosition) {
3286
+ e.layer.closePopup();
3287
+ setMapClicked({ position: e.latlng, setItemFormPopup: setItemFormPopup });
3288
+ }
3289
+ },
3290
+ } })), jsx(MapEventListener, {}), jsx(AddButton, { triggerAction: setSelectNewItemPosition }), selectNewItemPosition != null && (jsx(SelectPosition, { setSelectNewItemPosition: setSelectNewItemPosition }))] })));
3225
3291
  }
3226
3292
 
3227
- function UtopiaMap(props) {
3228
- return (jsx(ContextWrapper, { children: jsx(UtopiaMapInner, __assign({}, props)) }));
3293
+ function UtopiaMap(_a) {
3294
+ var _b = _a.height, height = _b === void 0 ? '500px' : _b, _c = _a.width, width = _c === void 0 ? '100%' : _c, _d = _a.center, center = _d === void 0 ? [50.6, 9.5] : _d, _e = _a.zoom, zoom = _e === void 0 ? 10 : _e, children = _a.children, geo = _a.geo, _f = _a.showFilterControl, showFilterControl = _f === void 0 ? false : _f, _g = _a.showGratitudeControl, showGratitudeControl = _g === void 0 ? false : _g, _h = _a.showLayerControl, showLayerControl = _h === void 0 ? true : _h, infoText = _a.infoText;
3295
+ return (jsx(ContextWrapper, { children: jsx(MapContainer, __assign({ style: { height: height, width: width }, center: new LatLng(center[0], center[1]), zoom: zoom, zoomControl: false, maxZoom: 19 }, { children: jsx(UtopiaMapInner, __assign({ geo: geo, showFilterControl: showFilterControl, showGratitudeControl: showGratitudeControl, showLayerControl: showLayerControl, infoText: infoText }, { children: children })) })) }));
3229
3296
  }
3230
3297
 
3231
3298
  /* eslint-disable @typescript-eslint/restrict-template-expressions */
@@ -3695,7 +3762,6 @@ var Layer = function (_a) {
3695
3762
  var addMarker = useAddMarker();
3696
3763
  var addPopup = useAddPopup();
3697
3764
  var leafletRefs = useLeafletRefs();
3698
- var location = useLocation();
3699
3765
  var allTagsLoaded = useAllTagsLoaded();
3700
3766
  var allItemsLoaded = useAllItemsLoaded();
3701
3767
  var setMarkerClicked = useSetMarkerClicked();
@@ -3704,7 +3770,6 @@ var Layer = function (_a) {
3704
3770
  var addTag = useAddTag();
3705
3771
  var _r = useState([]), newTagsToAdd = _r[0], setNewTagsToAdd = _r[1];
3706
3772
  var _s = useState(false), tagsReady = _s[0], setTagsReady = _s[1];
3707
- var map = useMap();
3708
3773
  var isLayerVisible = useIsLayerVisible();
3709
3774
  var isGroupTypeVisible = useIsGroupTypeVisible();
3710
3775
  var visibleGroupTypes = useVisibleGroupType();
@@ -3777,59 +3842,6 @@ var Layer = function (_a) {
3777
3842
  });
3778
3843
  // eslint-disable-next-line react-hooks/exhaustive-deps
3779
3844
  }, [data, api]);
3780
- useMapEvents({
3781
- popupopen: function (e) {
3782
- var _a, _b;
3783
- var item = (_a = Object.entries(leafletRefs).find(function (r) { return r[1].popup === e.popup; })) === null || _a === void 0 ? void 0 : _a[1].item;
3784
- if (((_b = item === null || item === void 0 ? void 0 : item.layer) === null || _b === void 0 ? void 0 : _b.name) === name && window.location.pathname.split('/')[1] !== item.id) {
3785
- var params = new URLSearchParams(window.location.search);
3786
- if (!location.pathname.includes('/item/')) {
3787
- window.history.pushState({}, '', "/".concat(item.id) + "".concat(params.toString() !== '' ? "?".concat(params) : ''));
3788
- }
3789
- var title = '';
3790
- if (item.name)
3791
- title = item.name;
3792
- else if (item.layer.itemNameField)
3793
- title = getValue(item, item.layer.itemNameField);
3794
- document.title = "".concat(document.title.split('-')[0], " - ").concat(title);
3795
- }
3796
- },
3797
- });
3798
- var openPopup = function () {
3799
- var _a, _b, _c;
3800
- if (window.location.pathname.split('/').length <= 1 ||
3801
- window.location.pathname.split('/')[1] === '') {
3802
- map.closePopup();
3803
- }
3804
- else {
3805
- if (window.location.pathname.split('/')[1]) {
3806
- var id = window.location.pathname.split('/')[1];
3807
- // eslint-disable-next-line security/detect-object-injection
3808
- var ref_1 = leafletRefs[id];
3809
- if ((ref_1 === null || ref_1 === void 0 ? void 0 : ref_1.marker) && ((_a = ref_1.item.layer) === null || _a === void 0 ? void 0 : _a.name) === name) {
3810
- ref_1.marker &&
3811
- clusterRef.hasLayer(ref_1.marker) &&
3812
- (clusterRef === null || clusterRef === void 0 ? void 0 : clusterRef.zoomToShowLayer(ref_1.marker, function () {
3813
- ref_1.marker.openPopup();
3814
- }));
3815
- var title = '';
3816
- if (ref_1.item.name)
3817
- title = ref_1.item.name;
3818
- else if (ref_1.item.layer.itemNameField)
3819
- title = getValue(ref_1.item.name, ref_1.item.layer.itemNameField);
3820
- document.title = "".concat(document.title.split('-')[0], " - ").concat(title);
3821
- (_b = document
3822
- .querySelector('meta[property="og:title"]')) === null || _b === void 0 ? void 0 : _b.setAttribute('content', ref_1.item.name);
3823
- (_c = document
3824
- .querySelector('meta[property="og:description"]')) === null || _c === void 0 ? void 0 : _c.setAttribute('content', ref_1.item.text);
3825
- }
3826
- }
3827
- }
3828
- };
3829
- useEffect(function () {
3830
- openPopup();
3831
- // eslint-disable-next-line react-hooks/exhaustive-deps
3832
- }, [leafletRefs, location]);
3833
3845
  useEffect(function () {
3834
3846
  if (tagsReady) {
3835
3847
  var processedTags_1 = {};
@@ -4523,19 +4535,7 @@ var OverlayItemsIndexPage = function (_a) {
4523
4535
  };
4524
4536
 
4525
4537
  var EmojiPicker = function (_a) {
4526
- var
4527
- // eslint-disable-next-line react/prop-types
4528
- selectedEmoji = _a.selectedEmoji,
4529
- // eslint-disable-next-line react/prop-types
4530
- selectedColor = _a.selectedColor,
4531
- // eslint-disable-next-line react/prop-types
4532
- selectedShape = _a.selectedShape,
4533
- // eslint-disable-next-line react/prop-types
4534
- setSelectedEmoji = _a.setSelectedEmoji,
4535
- // eslint-disable-next-line react/prop-types
4536
- setSelectedColor = _a.setSelectedColor,
4537
- // eslint-disable-next-line react/prop-types
4538
- setSelectedShape = _a.setSelectedShape;
4538
+ var selectedEmoji = _a.selectedEmoji, selectedColor = _a.selectedColor, selectedShape = _a.selectedShape, setSelectedEmoji = _a.setSelectedEmoji, setSelectedColor = _a.setSelectedColor, setSelectedShape = _a.setSelectedShape;
4539
4539
  var _b = useState(false), isOpen = _b[0], setIsOpen = _b[1];
4540
4540
  var emojis = [
4541
4541
  '❤️',
@@ -4631,47 +4631,48 @@ var AttestationForm = function (_a) {
4631
4631
  var handleChange = function (event) {
4632
4632
  setInputValue(event.target.value);
4633
4633
  };
4634
- var sendAttestation = function () { return __awaiter(void 0, void 0, void 0, function () {
4635
- var to;
4636
- return __generator(this, function (_a) {
4637
- to = [];
4638
- users === null || users === void 0 ? void 0 : users.map(function (u) { var _a; return to.push({ directus_users_id: (_a = u.user_created) === null || _a === void 0 ? void 0 : _a.id }); });
4639
- (api === null || api === void 0 ? void 0 : api.createItem) &&
4640
- toast
4641
- .promise(api.createItem({
4642
- text: inputValue,
4643
- emoji: selectedEmoji,
4644
- color: selectedColor,
4645
- shape: selectedShape,
4646
- to: to,
4647
- }), {
4648
- pending: 'creating attestation ...',
4649
- success: 'Attestation created',
4650
- error: {
4651
- render: function (_a) {
4652
- var data = _a.data;
4653
- return "".concat(data);
4654
- },
4634
+ var sendAttestation = function () {
4635
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4636
+ var to = [];
4637
+ users === null || users === void 0 ? void 0 : users.map(function (u) { var _a; return to.push({ directus_users_id: (_a = u.user_created) === null || _a === void 0 ? void 0 : _a.id }); });
4638
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
4639
+ (api === null || api === void 0 ? void 0 : api.createItem) &&
4640
+ toast
4641
+ .promise(api.createItem({
4642
+ text: inputValue,
4643
+ emoji: selectedEmoji,
4644
+ color: selectedColor,
4645
+ shape: selectedShape,
4646
+ to: to,
4647
+ }), {
4648
+ pending: 'creating attestation ...',
4649
+ success: 'Attestation created',
4650
+ error: {
4651
+ render: function (_a) {
4652
+ var data = _a.data;
4653
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
4654
+ return "".concat(data);
4655
4655
  },
4656
- })
4657
- .then(function () {
4658
- var _a;
4659
- return navigate('/item/' +
4660
- ((_a = items.find(function (i) {
4661
- var _a, _b;
4662
- return ((_a = i.user_created) === null || _a === void 0 ? void 0 : _a.id) === to[0].directus_users_id &&
4663
- ((_b = i.layer) === null || _b === void 0 ? void 0 : _b.itemType.name) === 'player';
4664
- })) === null || _a === void 0 ? void 0 : _a.id) +
4665
- '?tab=2');
4666
- });
4667
- return [2 /*return*/];
4668
- });
4669
- }); };
4656
+ },
4657
+ })
4658
+ .then(function () {
4659
+ var _a;
4660
+ return navigate('/item/' +
4661
+ (
4662
+ // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
4663
+ (_a = items.find(function (i) {
4664
+ var _a, _b;
4665
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
4666
+ return ((_a = i.user_created) === null || _a === void 0 ? void 0 : _a.id) === to[0].directus_users_id &&
4667
+ ((_b = i.layer) === null || _b === void 0 ? void 0 : _b.itemType.name) === 'player';
4668
+ })) === null || _a === void 0 ? void 0 : _a.id) +
4669
+ '?tab=2');
4670
+ });
4671
+ };
4670
4672
  var _d = useState('select badge'), selectedEmoji = _d[0], setSelectedEmoji = _d[1];
4671
4673
  var _e = useState('circle'), selectedShape = _e[0], setSelectedShape = _e[1];
4672
4674
  var _f = useState('#fff0d6'), selectedColor = _f[0], setSelectedColor = _f[1];
4673
- return (jsxs(MapOverlayPage, __assign({ backdrop: true, className: 'tw-h-fit tw-min-h-56 tw-w-96' }, { children: [jsx("div", __assign({ className: 'tw-text-center tw-text-xl tw-font-bold' }, { children: "Gratitude" })), jsx("div", __assign({ className: 'tw-text-center tw-text-base tw-text-gray-400' }, { children: "to" })), jsx("div", __assign({ className: 'tw-flex tw-flex-row tw-justify-center tw-items-center tw-flex-wrap' }, { children: users &&
4674
- users.map(function (u, k) { return (jsxs("div", __assign({ className: 'tw-flex tw-items-center tw-space-x-3 tw-mx-2 tw-my-1' }, { children: [u.image ? (jsx("div", __assign({ className: 'tw-avatar' }, { children: jsx("div", __assign({ className: 'tw-mask tw-mask-circle tw-w-8 tw-h-8' }, { children: jsx("img", { src: appState.assetsApi.url + u.image + '?width=40&heigth=40', alt: 'Avatar' }) })) }))) : (jsx("div", { className: 'tw-mask tw-mask-circle tw-text-xl md:tw-text-2xl tw-bg-slate-200 tw-rounded-full tw-w-8 tw-h-8' })), jsx("div", { children: jsx("div", __assign({ className: 'tw-font-bold' }, { children: u.name })) })] }), k)); }, ', ') })), jsxs("div", __assign({ className: 'tw-w-full' }, { children: [jsx("div", __assign({ className: 'tw-flex tw-justify-center tw-items-center' }, { children: jsx("div", __assign({ className: ' tw-flex tw-justify-center tw-items-center tw-w-28 tw-h-28 tw-m-4' }, { children: jsx(EmojiPicker, { selectedEmoji: selectedEmoji, selectedColor: selectedColor, selectedShape: selectedShape, setSelectedEmoji: setSelectedEmoji, setSelectedColor: setSelectedColor, setSelectedShape: setSelectedShape }) })) })), jsx("div", __assign({ className: 'tw-flex tw-justify-center tw-items-center' }, { children: jsx("input", { ref: inputRef, value: inputValue, onChange: handleChange, type: 'text', placeholder: '... and say some words', className: 'tw-input tw-min-w-0 tw-w-fit tw-resize-none tw-overflow-hidden tw-text-center ' }) }))] })), jsx("div", __assign({ className: 'tw-w-full tw-grid tw-mt-4' }, { children: jsx("button", __assign({ onClick: sendAttestation, className: 'tw-btn tw-place-self-center tw-px-8' }, { children: "Next" })) }))] })));
4675
+ return (jsxs(MapOverlayPage, __assign({ backdrop: true, className: 'tw-h-fit tw-min-h-56 tw-w-96' }, { children: [jsx("div", __assign({ className: 'tw-text-center tw-text-xl tw-font-bold' }, { children: "Gratitude" })), jsx("div", __assign({ className: 'tw-text-center tw-text-base tw-text-gray-400' }, { children: "to" })), jsx("div", __assign({ className: 'tw-flex tw-flex-row tw-justify-center tw-items-center tw-flex-wrap' }, { children: users === null || users === void 0 ? void 0 : users.map(function (u, k) { return (jsxs("div", __assign({ className: 'tw-flex tw-items-center tw-space-x-3 tw-mx-2 tw-my-1' }, { children: [u.image ? (jsx("div", __assign({ className: 'tw-avatar' }, { children: jsx("div", __assign({ className: 'tw-mask tw-mask-circle tw-w-8 tw-h-8' }, { children: jsx("img", { src: appState.assetsApi.url + u.image + '?width=40&heigth=40', alt: 'Avatar' }) })) }))) : (jsx("div", { className: 'tw-mask tw-mask-circle tw-text-xl md:tw-text-2xl tw-bg-slate-200 tw-rounded-full tw-w-8 tw-h-8' })), jsx("div", { children: jsx("div", __assign({ className: 'tw-font-bold' }, { children: u.name })) })] }), k)); }, ', ') })), jsxs("div", __assign({ className: 'tw-w-full' }, { children: [jsx("div", __assign({ className: 'tw-flex tw-justify-center tw-items-center' }, { children: jsx("div", __assign({ className: ' tw-flex tw-justify-center tw-items-center tw-w-28 tw-h-28 tw-m-4' }, { children: jsx(EmojiPicker, { selectedEmoji: selectedEmoji, selectedColor: selectedColor, selectedShape: selectedShape, setSelectedEmoji: setSelectedEmoji, setSelectedColor: setSelectedColor, setSelectedShape: setSelectedShape }) })) })), jsx("div", __assign({ className: 'tw-flex tw-justify-center tw-items-center' }, { children: jsx("input", { ref: inputRef, value: inputValue, onChange: handleChange, type: 'text', placeholder: '... and say some words', className: 'tw-input tw-min-w-0 tw-w-fit tw-resize-none tw-overflow-hidden tw-text-center ' }) }))] })), jsx("div", __assign({ className: 'tw-w-full tw-grid tw-mt-4' }, { children: jsx("button", __assign({ onClick: sendAttestation, className: 'tw-btn tw-place-self-center tw-px-8' }, { children: "Next" })) }))] })));
4675
4676
  };
4676
4677
 
4677
4678
  var TagView = function (_a) {
@@ -5030,7 +5031,7 @@ var GalleryView = function (_a) {
5030
5031
  return (jsxs("div", __assign({ className: 'tw-mx-6 tw-mb-6' }, { children: [jsx(RowsPhotoAlbum, { photos: images, targetRowHeight: 150, onClick: function (_a) {
5031
5032
  var current = _a.index;
5032
5033
  return setIndex(current);
5033
- } }), jsx(Lightbox, { index: index, slides: images, open: index >= 0, close: function () { return setIndex(-1); } })] })));
5034
+ } }), jsx(ReactLightbox, { index: index, slides: images, open: index >= 0, close: function () { return setIndex(-1); } })] })));
5034
5035
  };
5035
5036
 
5036
5037
  var platformConfigs = {
@@ -6030,5 +6031,5 @@ function Quests() {
6030
6031
  return (jsx(Fragment, { children: questsOpen ? (jsx("div", __assign({ className: 'tw-card tw-w-48 tw-bg-base-100 tw-shadow-xl tw-absolute tw-bottom-4 tw-left-4 tw-z-[2000]' }, { children: jsxs("div", __assign({ className: 'tw-card-body tw-p-4 tw-pt-0' }, { children: [jsx("div", __assign({ className: 'tw-card-actions tw-justify-end' }, { children: jsx("label", __assign({ className: 'tw-btn tw-btn-sm tw-btn-circle tw-btn-ghost tw-absolute tw-right-1 tw-top-1', onClick: function () { return setQuestsOpen(false); } }, { children: "\u2715" })) })), jsxs("h2", __assign({ className: 'tw-card-title tw-m-auto ' }, { children: ["Level 1", jsx("svg", __assign({ xmlns: 'http://www.w3.org/2000/svg', fill: 'none', viewBox: '0 0 24 24', strokeWidth: 1.5, stroke: '#aaa', className: 'tw-w-5 tw-h-5 tw-cursor-pointer' }, { children: jsx("path", { strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z' }) }))] })), jsxs("ul", __assign({ className: 'tw-flex-row' }, { children: [jsx("li", { children: jsxs("label", __assign({ className: 'tw-label tw-justify-normal tw-pt-1 tw-pb-0' }, { children: [jsx("input", { type: 'checkbox', readOnly: true, className: 'tw-checkbox tw-checkbox-xs tw-checkbox-success', checked: isAuthenticated || false }), jsx("span", __assign({ className: 'tw-text-sm tw-label-text tw-mx-2' }, { children: "Sign Up" }))] })) }), jsx("li", { children: jsxs("label", __assign({ className: 'tw-label tw-justify-normal tw-pt-1 tw-pb-0' }, { children: [jsx("input", { type: 'checkbox', readOnly: true, className: 'tw-checkbox tw-checkbox-xs tw-checkbox-success', checked: !!(profile === null || profile === void 0 ? void 0 : profile.text) }), jsx("span", __assign({ className: 'tw-text-sm tw-label-text tw-mx-2' }, { children: "Fill Profile" }))] })) }), jsx("li", { children: jsxs("label", __assign({ className: 'tw-label tw-justify-normal tw-pt-1 tw-pb-0' }, { children: [jsx("input", { type: 'checkbox', readOnly: true, className: 'tw-checkbox tw-checkbox-xs tw-checkbox-success', checked: !!(profile === null || profile === void 0 ? void 0 : profile.image) }), jsx("span", __assign({ className: 'tw-text-sm tw-label-text tw-mx-2' }, { children: "Upload Avatar" }))] })) })] })), ' '] })) }))) : ('') }));
6031
6032
  }
6032
6033
 
6033
- export { AppShell, AttestationForm, AuthProvider, CardPage, Content, ItemForm, ItemView, Layer, LoginPage, MapOverlayPage, MarketView, Modal, MoonCalendar, OverlayItemsIndexPage, Permissions, PopupButton, PopupCheckboxInput, PopupStartEndInput, PopupTextAreaInput, PopupTextInput, ProfileForm, ProfileView, Quests, RequestPasswordPage, SelectBox, SelectUser, SetNewPasswordPage, SideBar, SignupPage, Sitemap, StartEndView, Tags, TextAreaInput, TextInput, TextView, TitleCard, UserSettings, UtopiaMap, useAuth };
6034
+ export { AppShell, AttestationForm, AuthProvider, CardPage, Content, ItemForm, ItemView, Layer, LoginPage, MapOverlayPage, MarketView, Modal, MoonCalendar, OverlayItemsIndexPage, Permissions, PopupButton, PopupCheckboxInput, PopupStartEndInput, PopupTextAreaInput, PopupTextInput, ProfileForm, ProfileView, Quests, RequestPasswordPage, SelectBox, SelectUser, SetNewPasswordPage, SideBar, SignupPage, Sitemap, StartEndView, Tags, TextAreaInput, TextInput, TextView, TitleCard, UserSettings, UtopiaMap };
6034
6035
  //# sourceMappingURL=index.js.map