utopia-ui 3.0.63 → 3.0.65

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,8 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { GeoJsonObject, Geometry, Point } from 'geojson';
3
- import { Key } from 'react';
3
+ export { Point } from 'geojson';
4
4
  import { LatLng } from 'leaflet';
5
5
  export { Popup } from 'leaflet';
6
+ import { Key } from 'react';
6
7
 
7
8
  /**
8
9
  * @category Types
@@ -46,24 +47,6 @@ interface ItemsApi<T> {
46
47
  collectionName?: string
47
48
  }
48
49
 
49
- interface ItemType {
50
- name: string
51
- show_name_input: boolean
52
- show_profile_button: boolean
53
- show_start_end: boolean
54
- show_start_end_input: boolean
55
- show_text: boolean
56
- show_text_input: boolean
57
- custom_text: string
58
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
59
- profileTemplate: { collection: string | number; id: Key | null | undefined; item: any }[]
60
- offers_and_needs: boolean
61
- icon_as_labels: unknown
62
- relations: boolean
63
- template: string
64
- questlog: boolean
65
- }
66
-
67
50
  interface Relation {
68
51
  related_items_id: string
69
52
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -90,6 +73,7 @@ interface UserItem {
90
73
  password?: string
91
74
  profile?: Profile
92
75
  first_name?: string
76
+ access_token?: string
93
77
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
94
78
  [key: string]: any
95
79
  }
@@ -139,7 +123,6 @@ interface Item {
139
123
  contact?: string
140
124
  telephone?: string
141
125
  next_appointment?: string
142
- type?: ItemType
143
126
  gallery?: GalleryItem[]
144
127
 
145
128
  // {
@@ -169,6 +152,24 @@ interface ItemFormPopupProps {
169
152
  setItemFormPopup?: React.Dispatch<React.SetStateAction<ItemFormPopupProps | null>>
170
153
  }
171
154
 
155
+ interface ItemType {
156
+ name: string
157
+ show_name_input: boolean
158
+ show_profile_button: boolean
159
+ show_start_end: boolean
160
+ show_start_end_input: boolean
161
+ show_text: boolean
162
+ show_text_input: boolean
163
+ custom_text: string
164
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
165
+ profileTemplate: { collection: string | number; id: Key | null | undefined; item: any }[]
166
+ offers_and_needs: boolean
167
+ icon_as_labels: unknown
168
+ relations: boolean
169
+ template: string
170
+ questlog: boolean
171
+ }
172
+
172
173
  /**
173
174
  * @category Types
174
175
  */
@@ -184,10 +185,9 @@ interface LayerProps {
184
185
  markerShape: string
185
186
  markerDefaultColor: string
186
187
  markerDefaultColor2?: string
187
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
188
- api?: ItemsApi<any>
188
+ api?: ItemsApi<Item>
189
189
  itemType: ItemType
190
- onlyOnePerOwner?: boolean
190
+ userProfileLayer?: boolean
191
191
  customEditLink?: string
192
192
  customEditParameter?: string
193
193
  public_edit_items?: boolean
@@ -202,7 +202,7 @@ interface LayerProps {
202
202
  /**
203
203
  * @category Map
204
204
  */
205
- declare const Layer: ({ data, children, name, menuIcon, menuText, menuColor, markerIcon, markerShape, markerDefaultColor, markerDefaultColor2, api, itemType, onlyOnePerOwner, customEditLink, customEditParameter, public_edit_items, listed, setItemFormPopup, itemFormPopup, clusterRef, }: LayerProps) => react_jsx_runtime.JSX.Element;
205
+ 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;
206
206
 
207
207
  /**
208
208
  * @category Map
@@ -355,31 +355,31 @@ interface AssetsApi {
355
355
  /**
356
356
  * @category AppShell
357
357
  */
358
- declare function AppShell({ appName, children, assetsApi, userType, }: {
358
+ declare function AppShell({ appName, children, assetsApi, }: {
359
359
  appName: string;
360
360
  children: React.ReactNode;
361
361
  assetsApi: AssetsApi;
362
362
  userType: string;
363
363
  }): react_jsx_runtime.JSX.Element;
364
364
 
365
- type route = {
365
+ interface Route {
366
366
  path: string;
367
367
  icon: JSX.Element;
368
368
  name: string;
369
- submenu?: route;
369
+ submenu?: Route[];
370
370
  blank?: boolean;
371
- };
371
+ }
372
372
  /**
373
373
  * @category AppShell
374
374
  */
375
375
  declare function SideBar({ routes, bottomRoutes }: {
376
- routes: route[];
377
- bottomRoutes?: route[];
376
+ routes: Route[];
377
+ bottomRoutes?: Route[];
378
378
  }): react_jsx_runtime.JSX.Element;
379
379
 
380
- type ContentProps = {
380
+ interface ContentProps {
381
381
  children?: React.ReactNode;
382
- };
382
+ }
383
383
  /**
384
384
  * @category AppShell
385
385
  */
@@ -400,8 +400,8 @@ interface UserApi {
400
400
  login(email: string, password: string): Promise<UserItem | undefined>
401
401
  logout(): Promise<void>
402
402
  getUser(): Promise<UserItem>
403
- getToken(): Promise<string | null>
404
- updateUser(user: UserItem): Promise<void>
403
+ getToken(): Promise<string | undefined>
404
+ updateUser(user: UserItem): Promise<UserItem>
405
405
  requestPasswordReset(email: string, reset_url?: string)
406
406
  passwordReset(token: string, new_password: string)
407
407
  }
@@ -410,28 +410,10 @@ interface AuthProviderProps {
410
410
  userApi: UserApi;
411
411
  children?: React.ReactNode;
412
412
  }
413
- interface AuthCredentials {
414
- email: string;
415
- password: string;
416
- otp?: string | undefined;
417
- }
418
- interface AuthContextProps {
419
- isAuthenticated: boolean;
420
- user: UserItem | null;
421
- login: (credentials: AuthCredentials) => Promise<UserItem | undefined>;
422
- register: (credentials: AuthCredentials, userName: string) => Promise<UserItem | undefined>;
423
- loading: boolean;
424
- logout: () => Promise<any>;
425
- updateUser: (user: UserItem) => any;
426
- token: string | null;
427
- requestPasswordReset: (email: string, reset_url: string) => Promise<any>;
428
- passwordReset: (token: string, new_password: string) => Promise<any>;
429
- }
430
413
  /**
431
414
  * @category Auth
432
415
  */
433
416
  declare const AuthProvider: ({ userApi, children }: AuthProviderProps) => react_jsx_runtime.JSX.Element;
434
- declare const useAuth: () => AuthContextProps;
435
417
 
436
418
  /**
437
419
  * @category Auth
@@ -447,7 +429,7 @@ declare function SignupPage(): react_jsx_runtime.JSX.Element;
447
429
  * @category Auth
448
430
  */
449
431
  declare function RequestPasswordPage({ resetUrl }: {
450
- resetUrl: any;
432
+ resetUrl: string;
451
433
  }): react_jsx_runtime.JSX.Element;
452
434
 
453
435
  /**
@@ -460,13 +442,6 @@ declare function SetNewPasswordPage(): react_jsx_runtime.JSX.Element;
460
442
  */
461
443
  declare function UserSettings(): react_jsx_runtime.JSX.Element;
462
444
 
463
- declare function PlusButton({ layer, triggerAction, color, collection, }: {
464
- layer?: LayerProps;
465
- triggerAction: any;
466
- color: string;
467
- collection?: string;
468
- }): react_jsx_runtime.JSX.Element;
469
-
470
445
  /**
471
446
  * @category Profile
472
447
  */
@@ -560,7 +535,7 @@ declare const AttestationForm: ({ api }: {
560
535
  */
561
536
  declare const MarketView: () => react_jsx_runtime.JSX.Element;
562
537
 
563
- type TextAreaProps = {
538
+ interface TextAreaProps {
564
539
  labelTitle?: string;
565
540
  labelStyle?: string;
566
541
  containerStyle?: string;
@@ -570,13 +545,13 @@ type TextAreaProps = {
570
545
  placeholder?: string;
571
546
  required?: boolean;
572
547
  updateFormValue?: (value: string) => void;
573
- };
548
+ }
574
549
  /**
575
550
  * @category Input
576
551
  */
577
552
  declare function TextAreaInput({ labelTitle, dataField, labelStyle, containerStyle, inputStyle, defaultValue, placeholder, required, updateFormValue, }: TextAreaProps): react_jsx_runtime.JSX.Element;
578
553
 
579
- type InputTextProps = {
554
+ interface InputTextProps {
580
555
  labelTitle?: string;
581
556
  labelStyle?: string;
582
557
  type?: string;
@@ -589,13 +564,13 @@ type InputTextProps = {
589
564
  pattern?: string;
590
565
  required?: boolean;
591
566
  updateFormValue?: (value: string) => void;
592
- };
567
+ }
593
568
  /**
594
569
  * @category Input
595
570
  */
596
571
  declare function TextInput({ labelTitle, labelStyle, type, dataField, containerStyle, inputStyle, defaultValue, placeholder, autocomplete, pattern, required, updateFormValue, }: InputTextProps): react_jsx_runtime.JSX.Element;
597
572
 
598
- type SelectBoxProps = {
573
+ interface SelectBoxProps {
599
574
  labelTitle?: string;
600
575
  labelStyle?: string;
601
576
  type?: string;
@@ -608,7 +583,7 @@ type SelectBoxProps = {
608
583
  value: string;
609
584
  }[];
610
585
  labelDescription?: string;
611
- };
586
+ }
612
587
  /**
613
588
  * @category Input
614
589
  */
@@ -622,4 +597,4 @@ declare global {
622
597
  }
623
598
  }
624
599
 
625
- export { AppShell, type AssetsApi, AttestationForm, AuthProvider, CardPage, Content, type Item, ItemForm, ItemView, type ItemsApi, Layer, type LayerProps, LoginPage, MapOverlayPage, MarketView, Modal, MoonCalendar, OverlayItemsIndexPage, type Permission, Permissions, type PermissionsProps, PlusButton, PopupButton, PopupCheckboxInput, PopupStartEndInput, PopupTextAreaInput, PopupTextInput, ProfileForm, ProfileView, Quests, RequestPasswordPage, SelectBox, SelectUser, SetNewPasswordPage, SideBar, SignupPage, Sitemap, StartEndView, type Tag, Tags, TextAreaInput, TextInput, TextView, TitleCard, type UserApi, type UserItem, UserSettings, UtopiaMap, useAuth };
600
+ export { AppShell, type AssetsApi, AttestationForm, AuthProvider, CardPage, Content, type Item, ItemForm, ItemView, type ItemsApi, Layer, type LayerProps, LoginPage, MapOverlayPage, MarketView, Modal, MoonCalendar, OverlayItemsIndexPage, type Permission, Permissions, type PermissionsProps, PopupButton, PopupCheckboxInput, PopupStartEndInput, PopupTextAreaInput, PopupTextInput, ProfileForm, ProfileView, Quests, RequestPasswordPage, SelectBox, SelectUser, SetNewPasswordPage, SideBar, SignupPage, Sitemap, StartEndView, type Tag, Tags, TextAreaInput, TextInput, TextView, TitleCard, type UserApi, type UserItem, UserSettings, UtopiaMap };