@carto/ps-react-maps 0.0.1-alpha.9 → 0.0.1-beta.1
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/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/map-provider/index.d.ts +6 -0
- package/dist/types/{map.context.d.ts → src/map-provider/map-provider.context.d.ts} +3 -3
- package/dist/types/src/map-provider/map-provider.hook.d.ts +2 -0
- package/dist/types/src/map-provider/map-provider.hook.test.d.ts +1 -0
- package/dist/types/{map.provider.d.ts → src/map-provider/map-provider.provider.d.ts} +1 -1
- package/dist/types/{map.reducer.d.ts → src/map-provider/map-provider.reducer.d.ts} +1 -1
- package/dist/types/src/map-provider/map-provider.stories.d.ts +21 -0
- package/dist/types/{map.types.d.ts → src/map-provider/map-provider.types.d.ts} +20 -9
- package/dist/types/tests/utils/test-utils.d.ts +10 -0
- package/package.json +24 -10
- package/dist/types/index.d.ts +0 -6
- package/dist/types/map.hook.d.ts +0 -2
- package/dist/types/tmp.utils.d.ts +0 -1
- /package/dist/types/{map.const.d.ts → src/map-provider/map-provider.const.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: typeof MapWrapper;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
docs: {
|
|
8
|
+
page: null;
|
|
9
|
+
description: {
|
|
10
|
+
component: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
argTypes: {};
|
|
15
|
+
args: {};
|
|
16
|
+
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
export declare const Default: Story;
|
|
21
|
+
declare function MapWrapper(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
|
8
|
-
import {
|
|
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:
|
|
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
|
|
35
|
-
instanceRef?:
|
|
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;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type MapProviderProps } from '../../src/map-provider';
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
export type Wrapper = ({ children }: {
|
|
4
|
+
children: ReactElement;
|
|
5
|
+
}) => JSX.Element;
|
|
6
|
+
export declare const wrapper: ({ maps }: {
|
|
7
|
+
maps: MapProviderProps['maps'];
|
|
8
|
+
}) => Wrapper;
|
|
9
|
+
export * from '@testing-library/react';
|
|
10
|
+
export { default as userEvent } from '@testing-library/user-event';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carto/ps-react-maps",
|
|
3
|
-
"version": "0.0.1-
|
|
3
|
+
"version": "0.0.1-beta.1",
|
|
4
4
|
"description": "CARTO's Professional Service React Maps library",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -17,29 +17,43 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
+
"start": "npm run storybook:start",
|
|
20
21
|
"prebuild": "npm exec rimraf dist",
|
|
21
22
|
"build": "tsc && vite build",
|
|
22
23
|
"lint": "eslint './**/*.{ts,tsx}' --ignore-path ../../.gitignore",
|
|
23
24
|
"format": "prettier --write . --ignore-path ../../.gitignore",
|
|
24
25
|
"test:watch": "vitest",
|
|
25
26
|
"test:related": "vitest --run --passWithNoTests",
|
|
26
|
-
"test:coverage": "vitest run --coverage"
|
|
27
|
+
"test:coverage": "vitest run --coverage",
|
|
28
|
+
"storybook:start": "storybook dev --no-open -p 6006",
|
|
29
|
+
"storybook:build": "storybook build"
|
|
27
30
|
},
|
|
28
31
|
"dependencies": {
|
|
29
|
-
"@carto/react-redux": "2.2.
|
|
32
|
+
"@carto/react-redux": "2.2.14",
|
|
30
33
|
"react-redux": "8.1.3"
|
|
31
34
|
},
|
|
32
35
|
"devDependencies": {
|
|
33
|
-
"@
|
|
34
|
-
"@deck.gl/
|
|
35
|
-
"@deck.gl/
|
|
36
|
+
"@carto/react-basemaps": "2.2.14",
|
|
37
|
+
"@deck.gl/core": "8.9.32",
|
|
38
|
+
"@deck.gl/google-maps": "8.9.32",
|
|
39
|
+
"@deck.gl/react": "8.9.32",
|
|
40
|
+
"@react-google-maps/api": "2.19.2",
|
|
41
|
+
"@storybook/addon-actions": "7.5.2",
|
|
42
|
+
"@storybook/addon-essentials": "7.5.2",
|
|
43
|
+
"@storybook/addon-interactions": "7.5.2",
|
|
44
|
+
"@storybook/addon-links": "7.5.2",
|
|
45
|
+
"@storybook/blocks": "7.5.2",
|
|
46
|
+
"@storybook/builder-vite": "7.5.2",
|
|
47
|
+
"@storybook/react": "7.5.2",
|
|
48
|
+
"@storybook/react-vite": "7.5.2",
|
|
49
|
+
"@storybook/testing-library": "0.2.2",
|
|
36
50
|
"@testing-library/jest-dom": "6.1.4",
|
|
37
51
|
"@testing-library/react": "14.0.0",
|
|
38
52
|
"@testing-library/user-event": "14.5.1",
|
|
39
|
-
"@types/google.maps": "3.54.
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
53
|
+
"@types/google.maps": "3.54.6",
|
|
54
|
+
"maplibre-gl": "3.5.2",
|
|
55
|
+
"react-map-gl": "7.1.6",
|
|
56
|
+
"storybook": "7.5.2"
|
|
43
57
|
},
|
|
44
58
|
"peerDependencies": {
|
|
45
59
|
"@carto/react-redux": "1.x || 2.x",
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
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';
|
package/dist/types/map.hook.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const debounce: <F extends (...args: Parameters<F>) => void>(func: F, waitFor: number) => (...args: Parameters<F>) => ReturnType<F>;
|
|
File without changes
|