@evergis/react 2.0.80 → 2.0.83

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.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare type MailValueProps = {
3
2
  mail: string;
4
3
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare type PhoneValueProps = {
3
2
  phone: string;
4
3
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare type UrlValueProps = {
3
2
  url: string;
4
3
  };
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const Fullscreen: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const Measure: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const Search: () => JSX.Element;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  /** No operation element */
3
2
  export declare const Noop: () => JSX.Element;
@@ -10,6 +10,7 @@ export * from './useFeatureLayer';
10
10
  export * from './useLayerOrder';
11
11
  export * from './useLayerVisibility';
12
12
  export * from './useMapBboxChange';
13
+ export * from './useMapResize';
13
14
  export * from './useMapPick';
14
15
  export * from './useMapState';
15
16
  export * from './useMapView';
@@ -0,0 +1 @@
1
+ export declare function useMapResize(onResize?: (size: number[]) => void): void;
@@ -3293,6 +3293,21 @@ function getMapState(map) {
3293
3293
  };
3294
3294
  }
3295
3295
 
3296
+ function useMapResize(onResize) {
3297
+ const {
3298
+ painter
3299
+ } = useMapContext();
3300
+ const handleMapResize = React.useCallback(() => {
3301
+ onResize && onResize([painter.width, painter.height]); // eslint-disable-next-line react-hooks/exhaustive-deps
3302
+ }, [onResize, painter]);
3303
+ React.useEffect(() => {
3304
+ painter.on(DomPainter.MapResize.type, handleMapResize);
3305
+ return () => {
3306
+ painter.off(DomPainter.MapResize.type, handleMapResize);
3307
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
3308
+ }, [handleMapResize]);
3309
+ }
3310
+
3296
3311
  const useMapPick = () => {
3297
3312
  const {
3298
3313
  map,
@@ -5514,6 +5529,7 @@ exports.useMapContext = useMapContext;
5514
5529
  exports.useMapLegend = useMapLegend;
5515
5530
  exports.useMapLevel = useMapLevel;
5516
5531
  exports.useMapPick = useMapPick;
5532
+ exports.useMapResize = useMapResize;
5517
5533
  exports.useMapState = useMapState;
5518
5534
  exports.useMapView = useMapView;
5519
5535
  exports.useMapViewActions = useMapViewActions;