@carto/ps-react-maps 3.6.2 → 3.7.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/index.js +1659 -1583
- package/dist/index.js.map +1 -1
- package/dist/types/models/categories.d.ts +1 -1
- package/dist/types/models/features.d.ts +1 -1
- package/dist/types/models/formula.d.ts +1 -1
- package/dist/types/models/histogram.d.ts +1 -1
- package/dist/types/models/range.d.ts +1 -1
- package/dist/types/models/scatter.d.ts +1 -1
- package/dist/types/models/table.d.ts +1 -1
- package/dist/types/models/time-series.d.ts +1 -1
- package/dist/types/models/types.d.ts +2 -0
- package/dist/types/models/use-filters-merged.d.ts +2 -0
- package/dist/types/providers/map/types.d.ts +7 -1
- package/dist/types/stats/use-stats.d.ts +1 -1
- package/dist/types/use-spatial-filter.d.ts +4 -0
- package/package.json +8 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { CategoryRequestOptions, CategoryResponse } from '@carto/api-client';
|
|
3
3
|
import { ModelProps } from './types';
|
|
4
|
-
export declare function useCategories({ accessToken, sourceId, widgetProps, useQueryProps: { enabled, ...useQueryProps }, }: ModelProps<CategoryRequestOptions, CategoryResponse>): UseQueryResult<CategoryResponse, Error>;
|
|
4
|
+
export declare function useCategories({ accessToken, sourceId, widgetProps, additionalFilter, useQueryProps: { enabled, ...useQueryProps }, }: ModelProps<CategoryRequestOptions, CategoryResponse>): UseQueryResult<CategoryResponse, Error>;
|
|
5
5
|
export declare function CategoriesModel({ children, ...modelProps }: ModelProps<CategoryRequestOptions, CategoryResponse> & {
|
|
6
6
|
children: (props: UseQueryResult<CategoryResponse, Error>) => React.ReactNode;
|
|
7
7
|
}): import('react').ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { FeaturesRequestOptions, FeaturesResponse } from '@carto/api-client';
|
|
3
3
|
import { ModelProps } from './types';
|
|
4
|
-
export declare function useFeatures({ accessToken, sourceId, widgetProps, useQueryProps: { enabled, ...useQueryProps }, }: ModelProps<FeaturesRequestOptions, FeaturesResponse>): UseQueryResult<FeaturesResponse, Error>;
|
|
4
|
+
export declare function useFeatures({ accessToken, sourceId, widgetProps, additionalFilter, useQueryProps: { enabled, ...useQueryProps }, }: ModelProps<FeaturesRequestOptions, FeaturesResponse>): UseQueryResult<FeaturesResponse, Error>;
|
|
5
5
|
export declare function FeaturesModel({ children, ...modelProps }: ModelProps<FeaturesRequestOptions, FeaturesResponse> & {
|
|
6
6
|
children: (props: UseQueryResult<FeaturesResponse, Error>) => React.ReactNode;
|
|
7
7
|
}): import('react').ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { FormulaRequestOptions, FormulaResponse } from '@carto/api-client';
|
|
3
3
|
import { ModelProps } from './types';
|
|
4
|
-
export declare function useFormula({ accessToken, sourceId, widgetProps, useQueryProps: { enabled, ...useQueryProps }, }: ModelProps<FormulaRequestOptions, FormulaResponse>): UseQueryResult<FormulaResponse, Error>;
|
|
4
|
+
export declare function useFormula({ accessToken, sourceId, widgetProps, additionalFilter, useQueryProps: { enabled, ...useQueryProps }, }: ModelProps<FormulaRequestOptions, FormulaResponse>): UseQueryResult<FormulaResponse, Error>;
|
|
5
5
|
export declare function FormulaModel({ children, ...modelProps }: ModelProps<FormulaRequestOptions, FormulaResponse> & {
|
|
6
6
|
children: (props: UseQueryResult<FormulaResponse, Error>) => React.ReactNode;
|
|
7
7
|
}): import('react').ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { HistogramRequestOptions, HistogramResponse } from '@carto/api-client';
|
|
3
3
|
import { ModelProps } from './types';
|
|
4
|
-
export declare function useHistogram({ accessToken, sourceId, widgetProps, useQueryProps: { enabled, ...useQueryProps }, }: ModelProps<HistogramRequestOptions, HistogramResponse>): UseQueryResult<HistogramResponse, Error>;
|
|
4
|
+
export declare function useHistogram({ accessToken, sourceId, widgetProps, additionalFilter, useQueryProps: { enabled, ...useQueryProps }, }: ModelProps<HistogramRequestOptions, HistogramResponse>): UseQueryResult<HistogramResponse, Error>;
|
|
5
5
|
export declare function HistogramModel({ children, ...modelProps }: ModelProps<HistogramRequestOptions, HistogramResponse> & {
|
|
6
6
|
children: (props: UseQueryResult<HistogramResponse, Error>) => React.ReactNode;
|
|
7
7
|
}): import('react').ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { RangeRequestOptions, RangeResponse } from '@carto/api-client';
|
|
3
3
|
import { ModelProps } from './types';
|
|
4
|
-
export declare function useRange({ accessToken, sourceId, widgetProps, useQueryProps: { enabled, ...useQueryProps }, }: ModelProps<RangeRequestOptions, RangeResponse>): UseQueryResult<RangeResponse, Error>;
|
|
4
|
+
export declare function useRange({ accessToken, sourceId, widgetProps, additionalFilter, useQueryProps: { enabled, ...useQueryProps }, }: ModelProps<RangeRequestOptions, RangeResponse>): UseQueryResult<RangeResponse, Error>;
|
|
5
5
|
export declare function RangeModel({ children, ...modelProps }: ModelProps<RangeRequestOptions, RangeResponse> & {
|
|
6
6
|
children: (props: UseQueryResult<RangeResponse, Error>) => React.ReactNode;
|
|
7
7
|
}): import('react').ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { ScatterRequestOptions, ScatterResponse } from '@carto/api-client';
|
|
3
3
|
import { ModelProps } from './types';
|
|
4
|
-
export declare function useScatter({ accessToken, sourceId, widgetProps, useQueryProps: { enabled, ...useQueryProps }, }: ModelProps<ScatterRequestOptions, ScatterResponse>): UseQueryResult<ScatterResponse, Error>;
|
|
4
|
+
export declare function useScatter({ accessToken, sourceId, widgetProps, additionalFilter, useQueryProps: { enabled, ...useQueryProps }, }: ModelProps<ScatterRequestOptions, ScatterResponse>): UseQueryResult<ScatterResponse, Error>;
|
|
5
5
|
export declare function ScatterModel({ children, ...modelProps }: ModelProps<ScatterRequestOptions, ScatterResponse> & {
|
|
6
6
|
children: (props: UseQueryResult<ScatterResponse, Error>) => React.ReactNode;
|
|
7
7
|
}): import('react').ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { TableRequestOptions, TableResponse } from '@carto/api-client';
|
|
3
3
|
import { ModelProps } from './types';
|
|
4
|
-
export declare function useTable({ accessToken, sourceId, widgetProps, useQueryProps: { enabled, ...useQueryProps }, }: ModelProps<TableRequestOptions, TableResponse>): UseQueryResult<TableResponse, Error>;
|
|
4
|
+
export declare function useTable({ accessToken, sourceId, widgetProps, additionalFilter, useQueryProps: { enabled, ...useQueryProps }, }: ModelProps<TableRequestOptions, TableResponse>): UseQueryResult<TableResponse, Error>;
|
|
5
5
|
export declare function TableModel({ children, ...modelProps }: ModelProps<TableRequestOptions, TableResponse> & {
|
|
6
6
|
children: (props: UseQueryResult<TableResponse, Error>) => React.ReactNode;
|
|
7
7
|
}): import('react').ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { TimeSeriesRequestOptions, TimeSeriesResponse } from '@carto/api-client';
|
|
3
3
|
import { ModelProps } from './types';
|
|
4
|
-
export declare function useTimeSeries({ accessToken, sourceId, widgetProps, useQueryProps: { enabled, ...useQueryProps }, }: ModelProps<TimeSeriesRequestOptions, TimeSeriesResponse>): UseQueryResult<TimeSeriesResponse, Error>;
|
|
4
|
+
export declare function useTimeSeries({ accessToken, sourceId, widgetProps, additionalFilter, useQueryProps: { enabled, ...useQueryProps }, }: ModelProps<TimeSeriesRequestOptions, TimeSeriesResponse>): UseQueryResult<TimeSeriesResponse, Error>;
|
|
5
5
|
export declare function TimeSeriesModel({ children, ...modelProps }: ModelProps<TimeSeriesRequestOptions, TimeSeriesResponse> & {
|
|
6
6
|
children: (props: UseQueryResult<TimeSeriesResponse, Error>) => React.ReactNode;
|
|
7
7
|
}): import('react').ReactNode;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { AddFilterOptions } from '@carto/api-client';
|
|
1
2
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
3
|
export interface ModelProps<T, R> {
|
|
3
4
|
accessToken: string;
|
|
4
5
|
sourceId: string;
|
|
5
6
|
widgetProps: Omit<T, 'filters'>;
|
|
7
|
+
additionalFilter?: AddFilterOptions[];
|
|
6
8
|
useQueryProps?: Omit<UseQueryOptions<unknown, Error, R>, 'queryKey' | 'queryFn'>;
|
|
7
9
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { MapViewState, WebMercatorViewport } from '@deck.gl/core';
|
|
2
2
|
import { InstanceRef, MapComponentProps, OverlayRef } from '../../types';
|
|
3
|
+
import { SpatialFilter } from '@carto/api-client';
|
|
3
4
|
interface ValueProps {
|
|
4
5
|
id: MapComponentProps['id'];
|
|
5
6
|
viewState: MapComponentProps['viewState'];
|
|
6
7
|
isLoaded: boolean;
|
|
7
8
|
basemap: NonNullable<MapComponentProps['basemap']>;
|
|
8
9
|
layers?: string[];
|
|
10
|
+
spatialFilter?: Record<string, SpatialFilter | null>;
|
|
9
11
|
}
|
|
10
12
|
export interface MapProviderProps {
|
|
11
13
|
values: Omit<ValueProps, 'isLoaded'>[];
|
|
@@ -53,7 +55,11 @@ export interface CommonSlice {
|
|
|
53
55
|
viewStateOptions?: Omit<MapViewState, 'latitude' | 'longitude' | 'zoom'>;
|
|
54
56
|
}) => void;
|
|
55
57
|
}
|
|
56
|
-
export
|
|
58
|
+
export interface SpatialFilterSlice {
|
|
59
|
+
spatialFilter: Record<ValueProps['id'], Record<string, SpatialFilter | null>>;
|
|
60
|
+
setSpatialFilter: (mapId: ValueProps['id'], id: string, value?: SpatialFilter | null) => void;
|
|
61
|
+
}
|
|
62
|
+
export type MapStore = MapSlice & ViewStateSlice & CommonSlice & AreLayerLoadedSlice & SpatialFilterSlice;
|
|
57
63
|
export interface ViewportRect {
|
|
58
64
|
x: number;
|
|
59
65
|
y: number;
|
|
@@ -8,4 +8,4 @@ export declare function useStats<Attribute extends string | number>({ source, at
|
|
|
8
8
|
params?: Stats['params'];
|
|
9
9
|
fetcherOptions?: Stats['fetcherOptions'];
|
|
10
10
|
useQueryProps?: Omit<UseQueryOptions<StatsResponse<Attribute>, Error>, 'queryKey' | 'queryFn'>;
|
|
11
|
-
}): import('@tanstack/react-query').UseQueryResult<StatsResponse<Attribute
|
|
11
|
+
}): import('@tanstack/react-query').UseQueryResult<import('@tanstack/react-query').NoInfer<StatsResponse<Attribute>>, Error>;
|
|
@@ -4,6 +4,7 @@ export declare function useSpatialFilter({ mapId, }: {
|
|
|
4
4
|
mapId: MapComponentProps['id'];
|
|
5
5
|
}): {
|
|
6
6
|
spatialFilter: SpatialFilter | undefined;
|
|
7
|
+
staticSpatialFilter: SpatialFilter | undefined;
|
|
7
8
|
lassoToolsSpatialFilter: SpatialFilter | undefined;
|
|
8
9
|
viewportSpatialFilter: SpatialFilter | undefined;
|
|
9
10
|
};
|
|
@@ -13,3 +14,6 @@ export declare function useViewportSpatialFilter({ mapId, }: {
|
|
|
13
14
|
export declare function useLassoToolsSpatialFilter({ mapId, }: {
|
|
14
15
|
mapId: MapComponentProps['id'];
|
|
15
16
|
}): import('geojson').MultiPolygon | undefined;
|
|
17
|
+
export declare function useStaticSpatialFilter({ mapId, }: {
|
|
18
|
+
mapId: MapComponentProps['id'];
|
|
19
|
+
}): SpatialFilter | undefined;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carto/ps-react-maps",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.1",
|
|
4
4
|
"description": "CARTO's Professional Service React DeckGL library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {},
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"@tanstack/react-query": "5.
|
|
9
|
-
"@carto/api-client": "0.5.
|
|
8
|
+
"@tanstack/react-query": "5.76.1",
|
|
9
|
+
"@carto/api-client": "0.5.4",
|
|
10
10
|
"@deck.gl-community/editable-layers": "9.0.3",
|
|
11
11
|
"@deck.gl/aggregation-layers": "9.0.41",
|
|
12
12
|
"@deck.gl/carto": "9.0.41",
|
|
@@ -17,22 +17,21 @@
|
|
|
17
17
|
"@deck.gl/layers": "9.0.41",
|
|
18
18
|
"@deck.gl/mesh-layers": "9.0.41",
|
|
19
19
|
"@deck.gl/react": "9.0.41",
|
|
20
|
-
"@turf/helpers": "7.2.0",
|
|
21
20
|
"@turf/turf": "7.2.0",
|
|
22
21
|
"@types/geojson": "7946.0.16",
|
|
23
|
-
"@vis.gl/react-google-maps": "1.5.
|
|
22
|
+
"@vis.gl/react-google-maps": "1.5.2",
|
|
24
23
|
"convert-units": "3.0.0-beta.7",
|
|
25
24
|
"html2canvas": "1.4.1",
|
|
26
|
-
"maplibre-gl": "5.
|
|
25
|
+
"maplibre-gl": "5.5.0",
|
|
27
26
|
"mjolnir.js": "2.7.3",
|
|
28
27
|
"react-map-gl": "8.0.4",
|
|
29
|
-
"zustand": "5.0.
|
|
28
|
+
"zustand": "5.0.4",
|
|
30
29
|
"@carto/ps-utils": "2.0.0",
|
|
31
|
-
"@carto/ps-services": "2.
|
|
30
|
+
"@carto/ps-services": "2.5.0"
|
|
32
31
|
},
|
|
33
32
|
"peerDependencies": {
|
|
34
33
|
"@tanstack/react-query": "^5.0.0",
|
|
35
|
-
"@carto/api-client": "0.5.
|
|
34
|
+
"@carto/api-client": "^0.5.4",
|
|
36
35
|
"@deck.gl-community/editable-layers": "^9.0.3",
|
|
37
36
|
"@deck.gl/aggregation-layers": "^9.0.0",
|
|
38
37
|
"@deck.gl/carto": "^9.0.0",
|
|
@@ -43,7 +42,6 @@
|
|
|
43
42
|
"@deck.gl/layers": "^9.0.0",
|
|
44
43
|
"@deck.gl/mesh-layers": "^9.0.0",
|
|
45
44
|
"@deck.gl/react": "^9.0.0",
|
|
46
|
-
"@turf/helpers": "^7.2.0",
|
|
47
45
|
"@turf/turf": "^7.2.0",
|
|
48
46
|
"@vis.gl/react-google-maps": "^1.0.0",
|
|
49
47
|
"convert-units": "3.0.0-beta.7",
|