@carto/ps-react-maps 0.0.1-alpha.8 → 0.0.1-beta.0

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,6 +1 @@
1
- export * from './map.const';
2
- export * from './map.types';
3
- export { INITIAL_STATE, MapContext, MapActionsContext } from './map.context';
4
- export { reducer } from './map.reducer';
5
- export { useMap, useMapActions } from './map.hook';
6
- export { MapProvider } from './map.provider';
1
+ export * from './map-provider';
@@ -0,0 +1,6 @@
1
+ export * from './map-provider.const';
2
+ export * from './map-provider.types';
3
+ export { INITIAL_STATE, MapContext, MapActionsContext, } from './map-provider.context';
4
+ export { reducer } from './map-provider.reducer';
5
+ export { useMap, useMapActions } from './map-provider.hook';
6
+ export { MapProvider } from './map-provider.provider';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { MapContextInterface } from './map.types';
2
+ import type { MapContextInterface } from './map-provider.types';
3
3
  export declare const INITIAL_STATE: MapContextInterface;
4
- export declare const MapContext: import("react").Context<import("./map.types").MapState>;
5
- export declare const MapActionsContext: import("react").Context<import("./map.types").MapActionsState>;
4
+ export declare const MapContext: import("react").Context<import("./map-provider.types").MapState>;
5
+ export declare const MapActionsContext: import("react").Context<import("./map-provider.types").MapActionsState>;
@@ -0,0 +1,2 @@
1
+ export declare function useMap(): import("./map-provider.types").MapState;
2
+ export declare function useMapActions(): import("./map-provider.types").MapActionsState;
@@ -1,2 +1,2 @@
1
- import type { MapProviderProps } from './map.types';
1
+ import type { MapProviderProps } from './map-provider.types';
2
2
  export declare function MapProvider({ children, maps }: MapProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { MapsProps, MapState } from './map.types';
1
+ import type { MapsProps, MapState } from './map-provider.types';
2
2
  export declare enum Actions {
3
3
  SetViewState = "SetViewState",
4
4
  SetBasemap = "SetBasemap",
@@ -1,15 +1,19 @@
1
1
  /// <reference types="google.maps" />
2
- import { type MapViewState } from '@deck.gl/core/typed';
3
- import { type GoogleMapsOverlay, type GoogleMapsOverlayProps } from '@deck.gl/google-maps/typed';
4
- import { type DeckGLProps, type DeckGLRef } from '@deck.gl/react/typed';
2
+ import type { PickingInfo, MapViewState } from '@deck.gl/core/typed';
3
+ import type { GoogleMapsOverlay, GoogleMapsOverlayProps } from '@deck.gl/google-maps/typed';
4
+ import type { DeckGLProps, DeckGLRef } from '@deck.gl/react/typed';
5
5
  import type { StyleSpecification } from 'maplibre-gl';
6
6
  import type { Properties } from 'csstype';
7
- import type { MutableRefObject, ReactNode, RefObject } from 'react';
8
- import { type MapRef } from 'react-map-gl';
9
- import { CartoBasemapsNames, GMapsBasemap } from './map.const';
7
+ import type { MutableRefObject, ReactNode } from 'react';
8
+ import type { MapRef } from 'react-map-gl';
9
+ import { CartoBasemapsNames, GMapsBasemap } from './map-provider.const';
10
10
  export type MapProviderProps = {
11
11
  children: ReactNode;
12
- maps: MapsProps[];
12
+ maps: {
13
+ id: MapsProps['id'];
14
+ basemap: MapsProps['basemap'];
15
+ viewState: MapsProps['viewState'];
16
+ }[];
13
17
  };
14
18
  export type MapState = {
15
19
  maps: Record<MapsProps['id'], MapsProps>;
@@ -31,8 +35,8 @@ export type MapContextInterface = {
31
35
  export type Basemap = (typeof GMapsBasemap)[keyof typeof GMapsBasemap] | (typeof CartoBasemapsNames)[keyof typeof CartoBasemapsNames] | string | StyleSpecification;
32
36
  export type CommonProps = {
33
37
  id: string;
34
- basemap?: Basemap;
35
- instanceRef?: RefObject<InstanceMapRef>;
38
+ basemap: Basemap;
39
+ instanceRef?: MutableRefObject<InstanceMapRef>;
36
40
  overlayRef?: MutableRefObject<OverlayMapRef>;
37
41
  } & DeckGLProps;
38
42
  export type MapsProps = DeckGLMapsProps & GoogleMapsProps;
@@ -43,8 +47,15 @@ export type GoogleMapsProps = {
43
47
  apiKey?: string;
44
48
  height?: string | undefined;
45
49
  language?: string;
50
+ mapId?: string;
46
51
  mapOptions?: Record<string, number | string>;
47
52
  style?: Properties;
48
53
  version?: string;
49
54
  width?: string | undefined;
50
55
  } & CommonProps & GoogleMapsOverlayProps;
56
+ export type Tooltip = {
57
+ text?: string | undefined;
58
+ html?: string | undefined;
59
+ className?: string | undefined;
60
+ style?: Partial<CSSStyleDeclaration> | undefined;
61
+ } & PickingInfo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carto/ps-react-maps",
3
- "version": "0.0.1-alpha.8",
3
+ "version": "0.0.1-beta.0",
4
4
  "description": "CARTO's Professional Service React Maps library",
5
5
  "files": [
6
6
  "dist"
@@ -26,10 +26,10 @@
26
26
  "test:coverage": "vitest run --coverage"
27
27
  },
28
28
  "dependencies": {
29
+ "@carto/react-redux": "2.2.13",
29
30
  "react-redux": "8.1.3"
30
31
  },
31
32
  "devDependencies": {
32
- "@carto/react-redux": "2.2.13",
33
33
  "@deck.gl/core": "8.9.31",
34
34
  "@deck.gl/google-maps": "8.9.31",
35
35
  "@deck.gl/react": "8.9.31",
@@ -1,2 +0,0 @@
1
- export declare function useMap(): import("./map.types").MapState;
2
- export declare function useMapActions(): import("./map.types").MapActionsState;
@@ -1 +0,0 @@
1
- export declare const debounce: <F extends (...args: Parameters<F>) => void>(func: F, waitFor: number) => (...args: Parameters<F>) => ReturnType<F>;