utopia-ui 3.0.84 → 3.0.85

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.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { GeoJsonObject, Geometry, Point } from 'geojson';
3
3
  export { Point } from 'geojson';
4
- import * as react from 'react';
4
+ import { LatLng } from 'leaflet';
5
+ export { Popup } from 'leaflet';
5
6
  import { Key } from 'react';
6
7
  export { default as SVG } from 'react-inlinesvg';
7
- export { Popup } from 'leaflet';
8
8
 
9
9
  /**
10
10
  * This component creates the map.
@@ -177,6 +177,14 @@ interface Item {
177
177
  } */
178
178
  }
179
179
 
180
+ interface ItemFormPopupProps {
181
+ position: LatLng
182
+ layer: LayerProps
183
+ item?: Item
184
+ children?: React.ReactNode
185
+ setItemFormPopup?: React.Dispatch<React.SetStateAction<ItemFormPopupProps | null>>
186
+ }
187
+
180
188
  interface ItemType {
181
189
  name: string
182
190
  show_name_input: boolean
@@ -218,6 +226,10 @@ interface LayerProps {
218
226
  public_edit_items?: boolean
219
227
  listed?: boolean
220
228
  item_presets?: Record<string, unknown>
229
+ setItemFormPopup?: React.Dispatch<React.SetStateAction<ItemFormPopupProps | null>>
230
+ itemFormPopup?: ItemFormPopupProps | null
231
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
232
+ clusterRef?: any
221
233
  }
222
234
 
223
235
  /**
@@ -264,7 +276,7 @@ interface Tag {
264
276
  /**
265
277
  * @category Map
266
278
  */
267
- declare const Layer: ({ data, children, name, menuIcon, menuText, menuColor, markerIcon, markerShape, markerDefaultColor, markerDefaultColor2, api, itemType, userProfileLayer, customEditLink, customEditParameter, public_edit_items, listed, }: LayerProps) => react_jsx_runtime.JSX.Element;
279
+ declare const Layer: ({ data, children, name, menuIcon, menuText, menuColor, markerIcon, markerShape, markerDefaultColor, markerDefaultColor2, api, itemType, userProfileLayer, customEditLink, customEditParameter, public_edit_items, listed, setItemFormPopup, itemFormPopup, clusterRef, }: LayerProps) => react_jsx_runtime.JSX.Element;
268
280
 
269
281
  /**
270
282
  * This Components injects Tags comming from an {@link ItemsApi | `API`}
@@ -355,6 +367,99 @@ declare function Permissions({ data, api, adminRole, }: {
355
367
  adminRole?: string;
356
368
  }): react_jsx_runtime.JSX.Element;
357
369
 
370
+ /**
371
+ * @category Map
372
+ */
373
+ declare const ItemForm: {
374
+ ({ children, item, title, setPopupTitle, }: {
375
+ children?: React.ReactNode;
376
+ item?: Item;
377
+ title?: string;
378
+ setPopupTitle?: React.Dispatch<React.SetStateAction<string>>;
379
+ }): react_jsx_runtime.JSX.Element;
380
+ __TYPE: string;
381
+ };
382
+
383
+ /**
384
+ * @category Map
385
+ */
386
+ declare const ItemView: {
387
+ ({ children, item }: {
388
+ children?: React.ReactNode;
389
+ item?: Item;
390
+ }): react_jsx_runtime.JSX.Element;
391
+ __TYPE: string;
392
+ };
393
+
394
+ /**
395
+ * @category Map
396
+ */
397
+ declare const PopupTextAreaInput: ({ dataField, placeholder, style, item, }: {
398
+ dataField: string;
399
+ placeholder: string;
400
+ style?: string;
401
+ item?: Item;
402
+ }) => react_jsx_runtime.JSX.Element;
403
+
404
+ interface StartEndInputProps {
405
+ item?: Item;
406
+ showLabels?: boolean;
407
+ updateStartValue?: (value: string) => void;
408
+ updateEndValue?: (value: string) => void;
409
+ }
410
+ /**
411
+ * @category Map
412
+ */
413
+ declare const PopupStartEndInput: ({ item, showLabels, updateStartValue, updateEndValue, }: StartEndInputProps) => react_jsx_runtime.JSX.Element;
414
+
415
+ /**
416
+ * @category Map
417
+ */
418
+ declare const PopupTextInput: ({ dataField, placeholder, style, item, }: {
419
+ dataField: string;
420
+ placeholder: string;
421
+ style?: string;
422
+ item?: Item;
423
+ }) => react_jsx_runtime.JSX.Element;
424
+
425
+ /**
426
+ * @category Map
427
+ */
428
+ declare const PopupCheckboxInput: ({ dataField, label, item, }: {
429
+ dataField: string;
430
+ label: string;
431
+ item?: Item;
432
+ }) => react_jsx_runtime.JSX.Element;
433
+
434
+ /**
435
+ * @category Map
436
+ */
437
+ declare const TextView: ({ item, itemId, text, truncate, rawText, itemTextField, }: {
438
+ item?: Item;
439
+ itemId?: string;
440
+ text?: string;
441
+ truncate?: boolean;
442
+ rawText?: string;
443
+ itemTextField?: string;
444
+ }) => react_jsx_runtime.JSX.Element;
445
+
446
+ /**
447
+ * @category Map
448
+ */
449
+ declare const StartEndView: ({ item }: {
450
+ item?: Item;
451
+ }) => react_jsx_runtime.JSX.Element;
452
+
453
+ /**
454
+ * @category Map
455
+ */
456
+ declare const PopupButton: ({ url, parameterField, text, item, }: {
457
+ url: string;
458
+ parameterField?: string;
459
+ text: string;
460
+ item?: Item;
461
+ }) => react_jsx_runtime.JSX.Element;
462
+
358
463
  /**
359
464
  * @category Types
360
465
  */
@@ -570,63 +675,6 @@ interface InputTextProps {
570
675
  */
571
676
  declare function TextInput({ labelTitle, labelStyle, type, dataField, containerStyle, inputStyle, defaultValue, placeholder, autocomplete, pattern, required, updateFormValue, }: InputTextProps): react_jsx_runtime.JSX.Element;
572
677
 
573
- interface StartEndInputProps {
574
- item?: Item;
575
- showLabels?: boolean;
576
- updateStartValue?: (value: string) => void;
577
- updateEndValue?: (value: string) => void;
578
- }
579
-
580
- /**
581
- * @category Item
582
- */
583
- declare const PopupForm: ({ children }: {
584
- children?: React.ReactNode;
585
- }) => react_jsx_runtime.JSX.Element;
586
-
587
- /**
588
- * @category Item
589
- */
590
- declare const PopupView: ({ children }: {
591
- children?: React.ReactNode;
592
- }) => (react_jsx_runtime.JSX.Element | null)[];
593
-
594
- declare const TextView: react.ComponentType<Omit<{
595
- item?: Item;
596
- itemId?: string;
597
- text?: string;
598
- truncate?: boolean;
599
- rawText?: string;
600
- itemTextField?: string;
601
- }, "item">>;
602
- declare const StartEndView: react.ComponentType<Omit<{
603
- item?: Item;
604
- }, "item">>;
605
- declare const PopupTextInput: react.ComponentType<Omit<{
606
- dataField: string;
607
- placeholder: string;
608
- style?: string;
609
- item?: Item;
610
- }, "item">>;
611
- declare const PopupButton: react.ComponentType<Omit<{
612
- url: string;
613
- parameterField?: string;
614
- text: string;
615
- item?: Item;
616
- }, "item">>;
617
- declare const PopupCheckboxInput: react.ComponentType<Omit<{
618
- dataField: string;
619
- label: string;
620
- item?: Item;
621
- }, "item">>;
622
- declare const PopupTextAreaInput: react.ComponentType<Omit<{
623
- dataField: string;
624
- placeholder: string;
625
- style?: string;
626
- item?: Item;
627
- }, "item">>;
628
- declare const PopupStartEndInput: react.ComponentType<Omit<StartEndInputProps, "item">>;
629
-
630
678
  declare global {
631
679
  interface Window {
632
680
  my_modal_3: {
@@ -635,4 +683,4 @@ declare global {
635
683
  }
636
684
  }
637
685
 
638
- export { AppShell, type AssetsApi, AttestationForm, AuthProvider, CardPage, Content, type Item, type ItemsApi, Layer, type LayerProps, LoginPage, MapOverlayPage, MarketView, Modal, OverlayItemsIndexPage, type Permission, Permissions, PopupButton, PopupCheckboxInput, PopupForm, PopupStartEndInput, PopupTextAreaInput, PopupTextInput, PopupView, ProfileForm, ProfileView, Quests, RequestPasswordPage, SelectUser, SetNewPasswordPage, SideBar, SignupPage, StartEndView, type Tag, Tags, TextAreaInput, TextInput, TextView, TitleCard, type UserApi, type UserItem, UserSettings, UtopiaMap };
686
+ export { AppShell, type AssetsApi, AttestationForm, AuthProvider, CardPage, Content, type Item, ItemForm, ItemView, type ItemsApi, Layer, type LayerProps, LoginPage, MapOverlayPage, MarketView, Modal, OverlayItemsIndexPage, type Permission, Permissions, PopupButton, PopupCheckboxInput, PopupStartEndInput, PopupTextAreaInput, PopupTextInput, ProfileForm, ProfileView, Quests, RequestPasswordPage, SelectUser, SetNewPasswordPage, SideBar, SignupPage, StartEndView, type Tag, Tags, TextAreaInput, TextInput, TextView, TitleCard, type UserApi, type UserItem, UserSettings, UtopiaMap };
package/dist/index.esm.js CHANGED
@@ -75,7 +75,7 @@ styleInject(css_248z$3);
75
75
  var css_248z$2 = ".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.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.steps-icon {\n position: relative;\n top: -34px;\n left: 4px;\n width: 24px;\n}";
76
76
  styleInject(css_248z$2);
77
77
 
78
- var css_248z$1 = ".leaflet-control-attribution {\n display: none;\n}\n\n.leaflet-control-locate {\n display: none;\n}\n\n.leaflet-data-marker {\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.leaflet-container {\n cursor: inherit;\n}\n\n.leaflet-popup-scrolled {\n overflow-x: hidden;\n}\n\n.leaflet-popup-content-wrapper, .leaflet-popup-tip{\n background-color: var(--color-base-100);\n color: var(--color-base-content);\n border-radius: var(--radius-box);\n}\n\n.leaflet-tooltip {\n background-color: var(--color-base-100);\n color: var(--color-base-content);\n border-width: 0px;\n}\n\n.leaflet-tooltip {\n border-radius: var(--radius-box);\n transition: opacity 500ms;\n transition-delay: 50ms;\n}\n\n.leaflet-tooltip::before {\n border-top-color: var(--color-base-100);\n}\n\n.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.leaflet-popup-close-button span {\n color: var(--color-base-content);\n opacity: 50%;\n}";
78
+ var css_248z$1 = ".leaflet-control-attribution {\n display: none;\n}\n\n.leaflet-control-locate {\n display: none;\n}\n\n.leaflet-data-marker {\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.leaflet-container {\n cursor: inherit;\n}\n\n.leaflet-popup-scrolled {\n overflow-x: hidden;\n}\n\n.leaflet-popup-content-wrapper, .leaflet-popup-tip{\n background-color: var(--color-base-100);\n color: var(--color-base-content);\n border-radius: var(--radius-box);\n}\n\n.leaflet-popup-tip-container, .leaflet-popup-tip{\n border-radius: 0;\n}\n\n.leaflet-tooltip {\n background-color: var(--color-base-100);\n color: var(--color-base-content);\n border-width: 0px;\n}\n\n.leaflet-tooltip {\n border-radius: var(--radius-box);\n transition: opacity 500ms;\n transition-delay: 50ms;\n}\n\n.leaflet-tooltip::before {\n border-top-color: var(--color-base-100);\n}\n\n.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.leaflet-popup-close-button span {\n color: var(--color-base-content);\n opacity: 50%;\n}";
79
79
  styleInject(css_248z$1);
80
80
 
81
81
  var css_248z = ".picker {\n position: relative;\n}\n\n.swatch {\n width: 28px;\n height: 28px;\n border-radius: 8px;\n border: 3px solid #fff;\n box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.1);\n cursor: pointer;\n}\n\n.popover {\n position: absolute;\n top: 0;\n left: 36px;\n border-radius: 9px;\n box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);\n}";
@@ -4825,17 +4825,16 @@ const CrowdfundingView = ({ item }) => {
4825
4825
  const GalleryView = ({ item }) => {
4826
4826
  const [index, setIndex] = useState(-1);
4827
4827
  const appState = useAppState();
4828
- const images = item.gallery?.map((i, j) => {
4829
- return {
4830
- src: appState.assetsApi.url + `${i.directus_files_id.id}.jpg`,
4831
- width: i.directus_files_id.width,
4832
- height: i.directus_files_id.height,
4833
- index: j,
4834
- };
4835
- });
4836
- if (!images)
4837
- throw new Error('GalleryView: images is undefined');
4838
- return (jsxs("div", { className: 'tw:mx-6 tw:mb-6', children: [jsx(RowsPhotoAlbum, { photos: images, targetRowHeight: 150, onClick: ({ index: current }) => setIndex(current) }), jsx(ReactLightbox, { index: index, slides: images, open: index >= 0, close: () => setIndex(-1) })] }));
4828
+ const images = item.gallery?.map((i, j) => ({
4829
+ src: appState.assetsApi.url + `${i.directus_files_id.id}.jpg`,
4830
+ width: i.directus_files_id.width,
4831
+ height: i.directus_files_id.height,
4832
+ index: j,
4833
+ })) ?? [];
4834
+ if (images.length > 0)
4835
+ return (jsxs("div", { className: 'tw:mx-6 tw:mb-6', children: [jsx(RowsPhotoAlbum, { photos: images, targetRowHeight: 150, onClick: ({ index: current }) => setIndex(current) }), jsx(ReactLightbox, { index: index, slides: images, open: index >= 0, close: () => setIndex(-1) })] }));
4836
+ else
4837
+ return jsx(Fragment, {});
4839
4838
  };
4840
4839
 
4841
4840
  var ChevronSVG = 'data:image/svg+xml;base64,PHN2ZwogICAgICAgICAgICB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnCiAgICAgICAgICAgIHZpZXdCb3g9JzAgMCAyNCAyNCcKICAgICAgICAgICAgZmlsbD0nd2hpdGUnCiAgICAgICAgICAgIGNsYXNzTmFtZT0naC00IHctNCcKICAgICAgICAgID4KICAgICAgICAgICAgPHBhdGggZD0nTTIwIDRINGMtMS4xIDAtMS45OS45LTEuOTkgMkwyIDE4YzAgMS4xLjkgMiAyIDJoMTZjMS4xIDAgMi0uOSAyLTJWNmMwLTEuMS0uOS0yLTItMnptMCA0bC04IDUtOC01VjZsOCA1IDgtNXYyeicgLz4KICAgICAgICAgIDwvc3ZnPg==';