@davi-ai/retorik-map 3.0.2 → 4.0.1

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,144 +1,102 @@
1
- import { LatLngExpression } from "leaflet";
2
- export enum POIType {
3
- restaurant = "restaurant",
4
- afaire = "afaire",
5
- avoir = "avoir",
6
- hebergement = "hebergement",
7
- produit = "produit",
8
- service = "service"
9
- }
10
- /**
11
- * @param {string | undefined} iconUrl path to the icon that will appear on the button and the pin on the map
12
- * @param {string | undefined} label label on the button, use this if the same label is used in every language
13
- * @param {Record<string, string> | undefined} localizedLabel use this if there are different labels for different languages. Each tuple must be set as <locale>: <label> (for example: "fr-FR": "bonjour")
14
- */
15
- interface FilterData {
16
- iconUrl?: string;
17
- label?: string;
18
- localizedLabel?: Record<string, string>;
19
- }
20
- /**
21
- * Used to create a new category to filter POI
22
- * @param {string} name category name, used in graphql / elasticsearch generic queries to get corresponding POI
23
- * @param {string | undefined} color color set on filter button and pin icons on the map
24
- * @param {FilterData} filter data used on the filter button and the pin icon on the map
25
- */
26
- interface CustomCategory {
27
- name: string;
28
- color?: string;
29
- filter?: FilterData;
30
- }
31
- /**
32
- * Used to modify basic hospitality categories
33
- * @param {boolean} display false to prevent this category from being displayed
34
- * @param {string | undefined} label category's label, use this if the same label is used in every language
35
- * @param {Record<string, string> | undefined} localizedLabel this if there are different labels for different languages. Each tuple must be set as <locale>: <label> (for example: "fr-FR": "bonjour")
36
- * @param {string | undefined} color use this to change the color of the button and the pin on the map for this category
37
- */
38
- interface HospitalityCategory {
39
- display: boolean;
40
- label?: string;
41
- localizedLabel?: Record<string, string>;
42
- color?: string;
43
- }
44
- /**
45
- * Category settings
46
- * @param {Array<CustomCategory> | undefined} categories use this to display POI from categories outside of the hospitality field
47
- * @param hospitalityCategories use this to change the data (label / color) of the hospitality categories
48
- * @param {Array<HospitalityPOIType>} showFilter can't be used with hospitalityCategories. Use this to tell which basic hospitality categories you want to display
49
- */
50
- export interface MapSettings {
51
- categories?: Array<CustomCategory>;
52
- hospitalityCategories?: {
53
- restaurant?: HospitalityCategory;
54
- afaire?: HospitalityCategory;
55
- avoir?: HospitalityCategory;
56
- hebergement?: HospitalityCategory;
57
- produit?: HospitalityCategory;
58
- service?: HospitalityCategory;
59
- };
60
- showFilter?: Array<POIType>;
61
- }
62
- /**
63
- * @deprecated not used anymore since v2.0.1, see the settings field instead
64
- */
65
- export interface MapLabel {
66
- title: string;
67
- afaire: string;
68
- restaurant: string;
69
- hebergement: string;
70
- avoir: string;
71
- produit: string;
72
- service: string;
73
- }
74
- export interface Tenant {
75
- name: string;
76
- retorikName: string;
77
- areaLocation: Array<Array<LatLngExpression>>;
78
- aroundMeDistance?: number;
79
- }
80
- export const MapIcon: () => JSX.Element;
81
- export const labels: {
82
- 'ar-EG': string;
83
- 'ar-SA': string;
84
- 'ca-ES': string;
85
- 'cs-CZ': string;
86
- 'da-DK': string;
87
- 'de-AT': string;
88
- 'de-CH': string;
89
- 'de-DE': string;
90
- 'en-CA': string;
91
- 'en-GB': string;
92
- 'en-HK': string;
93
- 'en-IE': string;
94
- 'en-IN': string;
95
- 'en-US': string;
96
- 'es-ES': string;
97
- 'es-MX': string;
98
- 'fi-FI': string;
99
- 'fr-BE': string;
100
- 'fr-CA': string;
101
- 'fr-CH': string;
102
- 'fr-FR': string;
103
- 'hi-IN': string;
104
- 'hu-HU': string;
105
- 'id-ID': string;
106
- 'it-IT': string;
107
- 'ja-JP': string;
108
- 'ko-KR': string;
109
- 'nb-NO': string;
110
- 'nl-BE': string;
111
- 'nl-NL': string;
112
- 'pl-PL': string;
113
- 'pt-BR': string;
114
- 'pt-PT': string;
115
- 'ru-RU': string;
116
- 'sv-SE': string;
117
- 'th-TH': string;
118
- 'tr-TR': string;
119
- 'zh-CN': string;
120
- 'zh-HK': string;
121
- 'zh-TW': string;
122
- };
123
- /**
124
- * Interactive map's props
125
- * @param {string | undefined} activeTenant the key of the active tenant defined in tenantList
126
- * @param {boolean | undefined} isDevTenant using a dev tenant ?
127
- * @param {Record<string, Tenant>} tenantList list of the tenants with their data that can be used in this instance of interactive map
128
- * @param {LatLngExpression | undefined} userLocation position of the user
129
- * @param {LatLngExpression | undefined} mapCenter position of the center of the map
130
- * @param {number | undefined} limitAroundCenter limit the map around the center, default 200km. Min zoom will be set depending on this number with 3 breakpoints : 0->199 / 200->599 / 599->?
131
- * @param {MapSettings | undefined} settings categogy settings
132
- */
133
- interface MapProps {
134
- activeTenant?: string;
135
- isDevTenant?: boolean;
136
- tenantList: Record<string, Tenant>;
137
- userLocation?: LatLngExpression;
138
- mapCenter?: LatLngExpression;
139
- limitAroundCenter?: number;
140
- settings?: MapSettings;
141
- }
142
- export const Map: ({ activeTenant, isDevTenant, tenantList, userLocation, mapCenter, limitAroundCenter, settings }: MapProps) => JSX.Element;
143
-
144
- //# sourceMappingURL=index.d.ts.map
1
+ /// <reference types="react" />
2
+
3
+ import { LatLngExpression } from 'leaflet';
4
+
5
+ /**
6
+ * Used to create a new category to filter POI
7
+ * @param {string} name category name, used in graphql / elasticsearch generic queries to get corresponding POI
8
+ * @param {string | undefined} color color set on filter button and pin icons on the map
9
+ * @param {FilterData} filter data used on the filter button and the pin icon on the map
10
+ */
11
+ declare interface CustomCategory {
12
+ name: string;
13
+ color?: string;
14
+ filter?: FilterData;
15
+ }
16
+
17
+ /**
18
+ * @param {string | undefined} iconUrl path to the icon that will appear on the button and the pin on the map
19
+ * @param {string | undefined} label label on the button, use this if the same label is used in every language
20
+ * @param {Record<string, string> | undefined} localizedLabel use this if there are different labels for different languages. Each tuple must be set as <locale>: <label> (for example: "fr-FR": "bonjour")
21
+ */
22
+ declare interface FilterData {
23
+ iconUrl?: string;
24
+ label?: string;
25
+ localizedLabel?: Record<string, string>;
26
+ }
27
+
28
+ /**
29
+ * Used to modify basic hospitality categories
30
+ * @param {boolean} display false to prevent this category from being displayed
31
+ * @param {string | undefined} label category's label, use this if the same label is used in every language
32
+ * @param {Record<string, string> | undefined} localizedLabel this if there are different labels for different languages. Each tuple must be set as <locale>: <label> (for example: "fr-FR": "bonjour")
33
+ * @param {string | undefined} color use this to change the color of the button and the pin on the map for this category
34
+ */
35
+ declare interface HospitalityCategory {
36
+ display: boolean;
37
+ label?: string;
38
+ localizedLabel?: Record<string, string>;
39
+ color?: string;
40
+ }
41
+
42
+ declare const Map_2: ({ tenantAddress, userLocation, mapCenter, limitAroundCenter, settings, locale, isWidget, isUsedOnBorne, setModalFullscreenContent, sendMessage }: MapProps) => JSX.Element;
43
+ export { Map_2 as Map }
44
+
45
+ export declare const MapIcon: () => JSX.Element;
46
+
47
+ /**
48
+ * Interactive map's props
49
+ * @param tenantAddress full address of the tenant on Retorik Studio (ex: https://studio.retorik.ai/asklea_lesbertranges)
50
+ * @param userLocation position of the user
51
+ * @param mapCenter position of the center of the map
52
+ * @param limitAroundCenter limit the map around the center, default 200km. Min zoom will be set depending on this number with 3 breakpoints : 0->199 / 200->599 / 599->?
53
+ * @param settings category settings
54
+ * @param locale current locale used
55
+ * @param isWidget using widget mode ?
56
+ * @param isUsedOnBorne used on a borne ? (no external link, QR-codes instead)
57
+ * @param detailedAttachmentOpened has the map been used to open a detailed attachment ?
58
+ * @param setModalFullscreenContent method to insert the loader inside a component
59
+ * @param sendMessage method used to send a message activity in directline
60
+ */
61
+ declare interface MapProps {
62
+ tenantAddress: string;
63
+ userLocation?: LatLngExpression;
64
+ mapCenter?: LatLngExpression;
65
+ limitAroundCenter?: number;
66
+ settings?: MapSettings;
67
+ locale: string;
68
+ isWidget: boolean;
69
+ isUsedOnBorne: boolean;
70
+ setModalFullscreenContent: (value: JSX.Element | null) => void;
71
+ sendMessage: (text: string | undefined, value: Record<string, string>) => void;
72
+ }
73
+
74
+ /**
75
+ * Category settings
76
+ * @param {Array<CustomCategory> | undefined} categories use this to display POI from categories outside of the hospitality field
77
+ * @param hospitalityCategories use this to change the data (label / color) of the hospitality categories
78
+ * @param {Array<HospitalityPOIType>} showFilter can't be used with hospitalityCategories. Use this to tell which basic hospitality categories you want to display
79
+ */
80
+ export declare interface MapSettings {
81
+ categories?: Array<CustomCategory>;
82
+ hospitalityCategories?: {
83
+ restaurant?: HospitalityCategory;
84
+ afaire?: HospitalityCategory;
85
+ avoir?: HospitalityCategory;
86
+ hebergement?: HospitalityCategory;
87
+ produit?: HospitalityCategory;
88
+ service?: HospitalityCategory;
89
+ };
90
+ showFilter?: Array<POIType>;
91
+ }
92
+
93
+ export declare enum POIType {
94
+ restaurant = "restaurant",
95
+ afaire = "afaire",
96
+ avoir = "avoir",
97
+ hebergement = "hebergement",
98
+ produit = "produit",
99
+ service = "service"
100
+ }
101
+
102
+ export { }