@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.css +1 -1160
- package/dist/index.d.ts +102 -144
- package/dist/index.js +14442 -2112
- package/package.json +10 -58
- package/dist/index.css.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.modern.css +0 -1160
- package/dist/index.modern.css.map +0 -1
- package/dist/index.modern.js +0 -2186
- package/dist/index.modern.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,144 +1,102 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
*
|
|
33
|
-
* @param {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
*
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
export
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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 { }
|