@arenarium/maps 1.0.39 → 1.0.41

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
@@ -19,8 +19,15 @@
19
19
  center: { lat: 51.505, lng: -0.09 },
20
20
  zoom: 13
21
21
  },
22
- // The initial theme of the map
23
- theme: 'light'
22
+ // The initial style of the map
23
+ style: {
24
+ name: 'light',
25
+ colors: {
26
+ primary: '#007bff',
27
+ background: '#fff',
28
+ text: '#000'
29
+ }
30
+ }
24
31
  });
25
32
  </script>
26
33
  </body>
@@ -45,7 +52,14 @@ npm install @arenarium/maps
45
52
  center: { lat: 51.505, lng: -0.09 },
46
53
  zoom: 13
47
54
  },
48
- theme: 'light'
55
+ style: {
56
+ name: 'light',
57
+ colors: {
58
+ primary: '#007bff',
59
+ background: '#fff',
60
+ text: '#000'
61
+ }
62
+ }
49
63
  });
50
64
  });
51
65
  </script>
package/dist/index.d.ts CHANGED
@@ -2,11 +2,12 @@
2
2
 
3
3
  import { z } from 'zod';
4
4
 
5
- declare const mapThemeSchema: z.ZodObject<{
5
+ declare const mapStyleSchema: z.ZodObject<{
6
6
  name: z.ZodUnion<[
7
7
  z.ZodLiteral<"dark">,
8
8
  z.ZodLiteral<"light">
9
9
  ]>;
10
+ url: z.ZodOptional<z.ZodString>;
10
11
  colors: z.ZodObject<{
11
12
  primary: z.ZodString;
12
13
  background: z.ZodString;
@@ -27,6 +28,7 @@ declare const mapThemeSchema: z.ZodObject<{
27
28
  background: string;
28
29
  text: string;
29
30
  };
31
+ url?: string | undefined;
30
32
  }, {
31
33
  name: "dark" | "light";
32
34
  colors: {
@@ -34,6 +36,7 @@ declare const mapThemeSchema: z.ZodObject<{
34
36
  background: string;
35
37
  text: string;
36
38
  };
39
+ url?: string | undefined;
37
40
  }>;
38
41
  declare const mapOptionsSchema: z.ZodObject<{
39
42
  container: z.ZodString;
@@ -62,11 +65,12 @@ declare const mapOptionsSchema: z.ZodObject<{
62
65
  };
63
66
  zoom: number;
64
67
  }>;
65
- theme: z.ZodObject<{
68
+ style: z.ZodObject<{
66
69
  name: z.ZodUnion<[
67
70
  z.ZodLiteral<"dark">,
68
71
  z.ZodLiteral<"light">
69
72
  ]>;
73
+ url: z.ZodOptional<z.ZodString>;
70
74
  colors: z.ZodObject<{
71
75
  primary: z.ZodString;
72
76
  background: z.ZodString;
@@ -87,6 +91,7 @@ declare const mapOptionsSchema: z.ZodObject<{
87
91
  background: string;
88
92
  text: string;
89
93
  };
94
+ url?: string | undefined;
90
95
  }, {
91
96
  name: "dark" | "light";
92
97
  colors: {
@@ -94,12 +99,9 @@ declare const mapOptionsSchema: z.ZodObject<{
94
99
  background: string;
95
100
  text: string;
96
101
  };
102
+ url?: string | undefined;
97
103
  }>;
98
104
  events: z.ZodOptional<z.ZodObject<{
99
- onLoading: z.ZodOptional<z.ZodFunction<z.ZodTuple<[
100
- ], z.ZodUnknown>, z.ZodVoid>>;
101
- onLoaded: z.ZodOptional<z.ZodFunction<z.ZodTuple<[
102
- ], z.ZodUnknown>, z.ZodVoid>>;
103
105
  onMapIdle: z.ZodOptional<z.ZodFunction<z.ZodTuple<[
104
106
  ], z.ZodUnknown>, z.ZodVoid>>;
105
107
  onMapMove: z.ZodOptional<z.ZodFunction<z.ZodTuple<[
@@ -122,9 +124,11 @@ declare const mapOptionsSchema: z.ZodObject<{
122
124
  onPopupClick: z.ZodOptional<z.ZodFunction<z.ZodTuple<[
123
125
  z.ZodString
124
126
  ], z.ZodUnknown>, z.ZodVoid>>;
127
+ onLoadingStart: z.ZodOptional<z.ZodFunction<z.ZodTuple<[
128
+ ], z.ZodUnknown>, z.ZodVoid>>;
129
+ onLoadingEnd: z.ZodOptional<z.ZodFunction<z.ZodTuple<[
130
+ ], z.ZodUnknown>, z.ZodVoid>>;
125
131
  }, "strip", z.ZodTypeAny, {
126
- onLoading?: ((...args: unknown[]) => void) | undefined;
127
- onLoaded?: ((...args: unknown[]) => void) | undefined;
128
132
  onMapIdle?: ((...args: unknown[]) => void) | undefined;
129
133
  onMapMove?: ((args_0: {
130
134
  lat: number;
@@ -133,9 +137,9 @@ declare const mapOptionsSchema: z.ZodObject<{
133
137
  }, ...args: unknown[]) => void) | undefined;
134
138
  onMapClick?: ((...args: unknown[]) => void) | undefined;
135
139
  onPopupClick?: ((args_0: string, ...args: unknown[]) => void) | undefined;
140
+ onLoadingStart?: ((...args: unknown[]) => void) | undefined;
141
+ onLoadingEnd?: ((...args: unknown[]) => void) | undefined;
136
142
  }, {
137
- onLoading?: ((...args: unknown[]) => void) | undefined;
138
- onLoaded?: ((...args: unknown[]) => void) | undefined;
139
143
  onMapIdle?: ((...args: unknown[]) => void) | undefined;
140
144
  onMapMove?: ((args_0: {
141
145
  lat: number;
@@ -144,6 +148,8 @@ declare const mapOptionsSchema: z.ZodObject<{
144
148
  }, ...args: unknown[]) => void) | undefined;
145
149
  onMapClick?: ((...args: unknown[]) => void) | undefined;
146
150
  onPopupClick?: ((args_0: string, ...args: unknown[]) => void) | undefined;
151
+ onLoadingStart?: ((...args: unknown[]) => void) | undefined;
152
+ onLoadingEnd?: ((...args: unknown[]) => void) | undefined;
147
153
  }>>;
148
154
  }, "strip", z.ZodTypeAny, {
149
155
  container: string;
@@ -154,17 +160,16 @@ declare const mapOptionsSchema: z.ZodObject<{
154
160
  };
155
161
  zoom: number;
156
162
  };
157
- theme: {
163
+ style: {
158
164
  name: "dark" | "light";
159
165
  colors: {
160
166
  primary: string;
161
167
  background: string;
162
168
  text: string;
163
169
  };
170
+ url?: string | undefined;
164
171
  };
165
172
  events?: {
166
- onLoading?: ((...args: unknown[]) => void) | undefined;
167
- onLoaded?: ((...args: unknown[]) => void) | undefined;
168
173
  onMapIdle?: ((...args: unknown[]) => void) | undefined;
169
174
  onMapMove?: ((args_0: {
170
175
  lat: number;
@@ -173,6 +178,8 @@ declare const mapOptionsSchema: z.ZodObject<{
173
178
  }, ...args: unknown[]) => void) | undefined;
174
179
  onMapClick?: ((...args: unknown[]) => void) | undefined;
175
180
  onPopupClick?: ((args_0: string, ...args: unknown[]) => void) | undefined;
181
+ onLoadingStart?: ((...args: unknown[]) => void) | undefined;
182
+ onLoadingEnd?: ((...args: unknown[]) => void) | undefined;
176
183
  } | undefined;
177
184
  }, {
178
185
  container: string;
@@ -183,17 +190,16 @@ declare const mapOptionsSchema: z.ZodObject<{
183
190
  };
184
191
  zoom: number;
185
192
  };
186
- theme: {
193
+ style: {
187
194
  name: "dark" | "light";
188
195
  colors: {
189
196
  primary: string;
190
197
  background: string;
191
198
  text: string;
192
199
  };
200
+ url?: string | undefined;
193
201
  };
194
202
  events?: {
195
- onLoading?: ((...args: unknown[]) => void) | undefined;
196
- onLoaded?: ((...args: unknown[]) => void) | undefined;
197
203
  onMapIdle?: ((...args: unknown[]) => void) | undefined;
198
204
  onMapMove?: ((args_0: {
199
205
  lat: number;
@@ -202,6 +208,8 @@ declare const mapOptionsSchema: z.ZodObject<{
202
208
  }, ...args: unknown[]) => void) | undefined;
203
209
  onMapClick?: ((...args: unknown[]) => void) | undefined;
204
210
  onPopupClick?: ((args_0: string, ...args: unknown[]) => void) | undefined;
211
+ onLoadingStart?: ((...args: unknown[]) => void) | undefined;
212
+ onLoadingEnd?: ((...args: unknown[]) => void) | undefined;
205
213
  } | undefined;
206
214
  }>;
207
215
  declare const mapPopupSchema: z.ZodObject<{
@@ -227,7 +235,7 @@ declare const mapPopupSchema: z.ZodObject<{
227
235
  height: number;
228
236
  }>;
229
237
  export type MapOptions = z.infer<typeof mapOptionsSchema>;
230
- export type MapTheme = z.infer<typeof mapThemeSchema>;
238
+ export type MapStyle = z.infer<typeof mapStyleSchema>;
231
239
  export type MapPopup = z.infer<typeof mapPopupSchema>;
232
240
  declare namespace Types {
233
241
  export interface Popup {
@@ -296,8 +304,8 @@ export interface MapComponent {
296
304
  getBounds: () => MapComponent.Bounds;
297
305
  zoomIn: () => void;
298
306
  zoomOut: () => void;
299
- getTheme: () => MapTheme;
300
- setTheme: (theme: MapTheme) => void;
307
+ getStyle: () => MapStyle;
308
+ setStyle: (style: MapStyle) => void;
301
309
  setPopupsContentCallback: (callback: MapComponent.PopupContentCallback) => void;
302
310
  setPopups: (popups: Types.Popup[]) => void;
303
311
  }