@tpzdsp/next-toolkit 1.2.8 → 1.2.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tpzdsp/next-toolkit",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "description": "A reusable React component library for Next.js applications",
5
5
  "type": "module",
6
6
  "private": false,
@@ -12,7 +12,7 @@ import { LayerSwitcherControl } from './LayerSwitcherControl';
12
12
  import { useMap } from './MapContext';
13
13
  import { Popup } from './Popup';
14
14
  import { getPopupPositionClass } from './utils';
15
- import type { MapConfig, PopupDirection } from '../types/map';
15
+ import type { PopupDirection } from '../types/map';
16
16
 
17
17
  export type MapComponentProps = {
18
18
  osMapsApiKey?: string;
@@ -63,8 +63,6 @@ export const MapComponent = ({
63
63
  mapRef,
64
64
  mapConfig: { center, zoom },
65
65
  setMap,
66
- setMapConfig,
67
- map,
68
66
  isDrawing,
69
67
  } = useMap();
70
68
 
@@ -159,42 +157,11 @@ export const MapComponent = ({
159
157
  });
160
158
  });
161
159
 
162
- if (!map) {
163
- setMap(newMap);
164
- }
160
+ setMap(newMap);
165
161
 
166
- return () => {
167
- newMap?.setTarget();
168
- };
169
162
  // eslint-disable-next-line react-hooks/exhaustive-deps
170
163
  }, []); // This is a rare case where we want to run this only once.
171
164
 
172
- // Update map config when map is moved
173
- useEffect(() => {
174
- if (!map) {
175
- return;
176
- }
177
-
178
- const view = map.getView();
179
- const moveHandler = () => {
180
- const center = view.getCenter();
181
-
182
- if (center) {
183
- setMapConfig((prev: MapConfig) => ({
184
- ...prev,
185
- center,
186
- zoom: view.getZoom()!,
187
- }));
188
- }
189
- };
190
-
191
- map.on('moveend', moveHandler);
192
-
193
- return () => {
194
- map.un('moveend', moveHandler);
195
- };
196
- }, [map, setMapConfig]);
197
-
198
165
  const closePopup = () => {
199
166
  setPopupFeatures([]);
200
167
  setPopupCoordinate(null);
package/src/utils/http.ts CHANGED
@@ -6,6 +6,7 @@ export const MimeTypes = {
6
6
  GeoJson: 'application/geo+json',
7
7
  Png: 'image/png',
8
8
  XJsonLines: 'application/x-jsonlines',
9
+ Csv: 'text/csv',
9
10
  } as const;
10
11
 
11
12
  export const Http = {
@@ -1,4 +1,3 @@
1
1
  export * from './utils';
2
2
  export * from './auth';
3
3
  export * from './constants';
4
- export * from './http';