@arenarium/maps 1.0.38 → 1.0.40

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,7 +99,58 @@ declare const mapOptionsSchema: z.ZodObject<{
94
99
  background: string;
95
100
  text: string;
96
101
  };
102
+ url?: string | undefined;
97
103
  }>;
104
+ events: z.ZodOptional<z.ZodObject<{
105
+ onMapIdle: z.ZodOptional<z.ZodFunction<z.ZodTuple<[
106
+ ], z.ZodUnknown>, z.ZodVoid>>;
107
+ onMapMove: z.ZodOptional<z.ZodFunction<z.ZodTuple<[
108
+ z.ZodObject<{
109
+ lat: z.ZodNumber;
110
+ lng: z.ZodNumber;
111
+ zoom: z.ZodNumber;
112
+ }, "strip", z.ZodTypeAny, {
113
+ lat: number;
114
+ lng: number;
115
+ zoom: number;
116
+ }, {
117
+ lat: number;
118
+ lng: number;
119
+ zoom: number;
120
+ }>
121
+ ], z.ZodUnknown>, z.ZodVoid>>;
122
+ onMapClick: z.ZodOptional<z.ZodFunction<z.ZodTuple<[
123
+ ], z.ZodUnknown>, z.ZodVoid>>;
124
+ onPopupClick: z.ZodOptional<z.ZodFunction<z.ZodTuple<[
125
+ z.ZodString
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>>;
131
+ }, "strip", z.ZodTypeAny, {
132
+ onMapIdle?: ((...args: unknown[]) => void) | undefined;
133
+ onMapMove?: ((args_0: {
134
+ lat: number;
135
+ lng: number;
136
+ zoom: number;
137
+ }, ...args: unknown[]) => void) | undefined;
138
+ onMapClick?: ((...args: unknown[]) => void) | undefined;
139
+ onPopupClick?: ((args_0: string, ...args: unknown[]) => void) | undefined;
140
+ onLoadingStart?: ((...args: unknown[]) => void) | undefined;
141
+ onLoadingEnd?: ((...args: unknown[]) => void) | undefined;
142
+ }, {
143
+ onMapIdle?: ((...args: unknown[]) => void) | undefined;
144
+ onMapMove?: ((args_0: {
145
+ lat: number;
146
+ lng: number;
147
+ zoom: number;
148
+ }, ...args: unknown[]) => void) | undefined;
149
+ onMapClick?: ((...args: unknown[]) => void) | undefined;
150
+ onPopupClick?: ((args_0: string, ...args: unknown[]) => void) | undefined;
151
+ onLoadingStart?: ((...args: unknown[]) => void) | undefined;
152
+ onLoadingEnd?: ((...args: unknown[]) => void) | undefined;
153
+ }>>;
98
154
  }, "strip", z.ZodTypeAny, {
99
155
  container: string;
100
156
  position: {
@@ -104,14 +160,27 @@ declare const mapOptionsSchema: z.ZodObject<{
104
160
  };
105
161
  zoom: number;
106
162
  };
107
- theme: {
163
+ style: {
108
164
  name: "dark" | "light";
109
165
  colors: {
110
166
  primary: string;
111
167
  background: string;
112
168
  text: string;
113
169
  };
170
+ url?: string | undefined;
114
171
  };
172
+ events?: {
173
+ onMapIdle?: ((...args: unknown[]) => void) | undefined;
174
+ onMapMove?: ((args_0: {
175
+ lat: number;
176
+ lng: number;
177
+ zoom: number;
178
+ }, ...args: unknown[]) => void) | undefined;
179
+ onMapClick?: ((...args: unknown[]) => void) | undefined;
180
+ onPopupClick?: ((args_0: string, ...args: unknown[]) => void) | undefined;
181
+ onLoadingStart?: ((...args: unknown[]) => void) | undefined;
182
+ onLoadingEnd?: ((...args: unknown[]) => void) | undefined;
183
+ } | undefined;
115
184
  }, {
116
185
  container: string;
117
186
  position: {
@@ -121,14 +190,27 @@ declare const mapOptionsSchema: z.ZodObject<{
121
190
  };
122
191
  zoom: number;
123
192
  };
124
- theme: {
193
+ style: {
125
194
  name: "dark" | "light";
126
195
  colors: {
127
196
  primary: string;
128
197
  background: string;
129
198
  text: string;
130
199
  };
200
+ url?: string | undefined;
131
201
  };
202
+ events?: {
203
+ onMapIdle?: ((...args: unknown[]) => void) | undefined;
204
+ onMapMove?: ((args_0: {
205
+ lat: number;
206
+ lng: number;
207
+ zoom: number;
208
+ }, ...args: unknown[]) => void) | undefined;
209
+ onMapClick?: ((...args: unknown[]) => void) | undefined;
210
+ onPopupClick?: ((args_0: string, ...args: unknown[]) => void) | undefined;
211
+ onLoadingStart?: ((...args: unknown[]) => void) | undefined;
212
+ onLoadingEnd?: ((...args: unknown[]) => void) | undefined;
213
+ } | undefined;
132
214
  }>;
133
215
  declare const mapPopupSchema: z.ZodObject<{
134
216
  id: z.ZodString;
@@ -153,7 +235,7 @@ declare const mapPopupSchema: z.ZodObject<{
153
235
  height: number;
154
236
  }>;
155
237
  export type MapOptions = z.infer<typeof mapOptionsSchema>;
156
- export type MapTheme = z.infer<typeof mapThemeSchema>;
238
+ export type MapStyle = z.infer<typeof mapStyleSchema>;
157
239
  export type MapPopup = z.infer<typeof mapPopupSchema>;
158
240
  declare namespace Types {
159
241
  export interface Popup {
@@ -212,16 +294,18 @@ export declare namespace MapComponent {
212
294
  type SetPopupsFunction = (popups: Types.Popup[]) => void;
213
295
  }
214
296
  export interface MapComponent {
215
- zoomIn: () => void;
216
- zoomOut: () => void;
217
297
  getCenter: () => {
218
298
  lat: number;
219
299
  lng: number;
220
300
  };
221
- getBounds: () => MapComponent.Bounds;
301
+ setCenter: (lat: number, lng: number) => void;
222
302
  getZoom: () => number;
223
- getTheme: () => MapTheme;
224
- setTheme: (theme: MapTheme) => void;
303
+ setZoom: (zoom: number) => void;
304
+ getBounds: () => MapComponent.Bounds;
305
+ zoomIn: () => void;
306
+ zoomOut: () => void;
307
+ getStyle: () => MapStyle;
308
+ setStyle: (style: MapStyle) => void;
225
309
  setPopupsContentCallback: (callback: MapComponent.PopupContentCallback) => void;
226
310
  setPopups: (popups: Types.Popup[]) => void;
227
311
  }