@xyo-network/react-map 6.1.3 → 6.2.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,272 +1,6 @@
1
- import * as _xyo_network_react_map_model from '@xyo-network/react-map-model';
2
- import { MapSetting, AnimatedHeatMapColorProps, ColorGradientLegendProps, HeatMapColorProps, NetworkLocationHeatmapQuadkeyAnswerPayload } from '@xyo-network/react-map-model';
3
- import * as geojson from 'geojson';
4
- import { Feature, Polygon, Point, Geometry } from 'geojson';
5
- import React$1, { PropsWithChildren, ReactNode, Dispatch, SetStateAction, RefObject } from 'react';
6
- import { FlexBoxProps } from '@xylabs/react-flexbox';
7
- import { LayerBase } from '@xyo-network/sdk-geo';
8
- import * as mapbox_gl from 'mapbox-gl';
9
- import { FillLayerSpecification, LineLayerSpecification, SymbolLayerSpecification, CircleLayerSpecification, Layer, LayerSpecification, MapOptions, Map, LngLatBounds, GeolocateControl, MapEventOf, MapEventType, NavigationControl } from 'mapbox-gl';
10
- import { SwitchProps } from '@mui/material';
11
-
12
- interface AnimatedHeatMapProps {
13
- accessToken: string;
14
- animatedFeatureSets: Feature<Polygon>[][];
15
- defaultMapSettings?: MapSetting;
16
- heatMapColorProps: AnimatedHeatMapColorProps;
17
- staticFeatureSet: Feature<Polygon>[];
18
- }
19
- declare const AnimatedHeatMap: React$1.FC<PropsWithChildren<AnimatedHeatMapProps>>;
20
-
21
- interface AnimatedHeatMapLoadedProps extends FlexBoxProps {
22
- accessToken: string;
23
- archivistNameOrAddress: string;
24
- }
25
- declare const AnimatedHeatMapLoaded: React$1.FC<AnimatedHeatMapLoadedProps>;
26
-
27
- declare class FillLayerBuilder extends LayerBase<FillLayerSpecification> {
28
- FillLayerOptions: Partial<FillLayerSpecification>;
29
- type: 'fill';
30
- constructor(id: string, source: string, FillLayerOptions?: Partial<FillLayerSpecification>);
31
- buildLayer(): FillLayerSpecification;
32
- }
33
-
34
- declare class LineLayerBuilder extends LayerBase<LineLayerSpecification> {
35
- LineLayerOptions: Partial<LineLayerSpecification>;
36
- type: 'line';
37
- constructor(id: string, source: string, LineLayerOptions?: Partial<LineLayerSpecification>);
38
- buildLayer(): LineLayerSpecification;
39
- }
40
-
41
- declare class SymbolLayerBuilder extends LayerBase<SymbolLayerSpecification> {
42
- SymbolLayerOptions: Partial<SymbolLayerSpecification>;
43
- type: 'symbol';
44
- constructor(id: string, source: string, SymbolLayerOptions?: Partial<SymbolLayerSpecification>);
45
- buildLayer(): SymbolLayerSpecification;
46
- }
47
-
48
- declare const MapHeatConstants: {
49
- LocationDebugLayerId: string;
50
- LocationDebugLayerSource: string;
51
- LocationFillLayerId: string;
52
- LocationFillLayerSource: string;
53
- LocationLineLayerId: string;
54
- LocationLineLayerSource: string;
55
- };
56
- declare const LocationHeatMapLayerBuilder: (color: string, alternateColor?: string) => (FillLayerBuilder | LineLayerBuilder | SymbolLayerBuilder)[];
57
-
58
- declare const LocationHeatMapLayerBuilderAnimated: (color: string, index: number, type?: string) => FillLayerBuilder;
59
-
60
- declare class CircleLayerBuilder extends LayerBase<CircleLayerSpecification> {
61
- CircleLayerOptions: Partial<CircleLayerSpecification>;
62
- type: 'circle';
63
- constructor(id: string, source: string, CircleLayerOptions?: Partial<CircleLayerSpecification>);
64
- buildLayer(): CircleLayerSpecification;
65
- }
66
-
67
- declare const MapPointsConstants: {
68
- LocationDotsLayerId: string;
69
- LocationDotsLayerSource: string;
70
- };
71
- declare const LocationPointsMapLayerBuilder: (color: string, circleRadius?: number, circleOpacity?: number) => CircleLayerBuilder[];
72
-
73
- declare const HeatMapFillLayerConfig: (color: string) => Partial<FillLayerSpecification>;
74
-
75
- declare const HeatMapLineLayerConfig: (color: string) => Partial<LineLayerSpecification>;
76
-
77
- declare const HeatMapSymbolLayerConfig: (color: string) => Partial<SymbolLayerSpecification>;
78
-
79
- declare const LocationPointLayerConfig: (color: string, circleRadius: number, circleOpacity: number) => Partial<CircleLayerSpecification>;
80
-
81
- interface MapLayer extends Layer {
82
- update: LayerBase<LayerSpecification>['update'];
83
- }
84
-
85
- interface FeaturesToLayersMap {
86
- features: Feature<Polygon>[];
87
- layers: MapLayer[];
88
- }
89
-
90
- declare const HeatMapSettings: _xyo_network_react_map_model.MapSetting;
91
- //# sourceMappingURL=HeatMapSettings.d.ts.map
92
-
93
- interface MapboxFlexBoxProps extends FlexBoxProps {
94
- accessToken: string;
95
- developerMode?: boolean;
96
- disableControls?: boolean;
97
- disableFitToPoints?: boolean;
98
- features?: Feature[];
99
- fitToPointsPadding?: number;
100
- layers?: MapLayer[];
101
- legend?: ReactNode;
102
- mapBoxOptions?: Partial<MapOptions>;
103
- requestLocation?: boolean;
104
- zoom?: number;
105
- }
106
-
107
- interface LayerAnimatorProps {
108
- animateLayers?: boolean;
109
- layers: MapboxFlexBoxProps['layers'];
110
- layersInitialized: boolean;
111
- map: Map | undefined;
112
- }
113
- declare const LayerAnimator: React$1.FC<PropsWithChildren<LayerAnimatorProps>>;
114
-
115
- declare const AnimatedHeatMapLegend: React$1.FC<ColorGradientLegendProps>;
116
- //# sourceMappingURL=Legend.d.ts.map
117
-
118
- declare const ColorGradientLegend: React$1.FC<ColorGradientLegendProps>;
119
- //# sourceMappingURL=ColorGradient.d.ts.map
120
-
121
- interface MapBoxProps {
122
- accessToken: string;
123
- darkMode?: boolean;
124
- options?: Partial<MapOptions>;
125
- zoom?: number;
126
- }
127
- declare const MapBox: React$1.FC<MapBoxProps>;
128
-
129
- declare const MapboxHeatFlexBox: React$1.FC<MapboxFlexBoxProps>;
130
-
131
- interface MapboxPointsFlexBoxProps extends MapboxFlexBoxProps {
132
- accessToken: string;
133
- features?: Feature<Point>[];
134
- }
135
- declare const MapboxPointsFlexBox: React$1.FC<MapboxPointsFlexBoxProps>;
136
-
137
- interface MapSettingSwitchProps extends SwitchProps {
138
- developerMode?: boolean;
139
- field: string;
140
- }
141
- declare const MapSettingSwitch: React$1.FC<MapSettingSwitchProps>;
142
-
143
- interface MapSettingsBoxProps extends FlexBoxProps {
144
- developerMode?: boolean;
145
- }
146
- declare const MapSettingsBox: React$1.FC<MapSettingsBoxProps>;
147
-
148
- interface MapInitializerProviderProps {
149
- featureSets?: Feature<Polygon>[][];
150
- featureSetsLayers?: MapLayer[];
151
- features?: Feature<Polygon>[];
152
- fitToPadding?: number;
153
- heatMapColorProps: HeatMapColorProps | AnimatedHeatMapColorProps;
154
- layers?: MapLayer[];
155
- zoom?: number;
156
- }
157
- declare const HeatMapInitializerProvider: React$1.FC<PropsWithChildren<MapInitializerProviderProps>>;
158
-
159
- interface MapBaseConfig<T extends Geometry> {
160
- features: Feature<T>[];
161
- map: Map;
162
- requestLocation?: boolean;
163
- zoom?: number;
164
- }
165
- declare abstract class MapBase<T extends Geometry> {
166
- private _config;
167
- constructor(config: MapBaseConfig<T>);
168
- get isMapReady(): boolean;
169
- initializeMapSource(layer: MapLayer): this;
170
- }
171
-
172
- declare class MapHeat extends MapBase<Polygon> {
173
- static animationStarted: boolean;
174
- config: MapBaseConfig<Polygon>;
175
- constructor(config: MapBaseConfig<Polygon>);
176
- static initialMapPositioning(options: MapOptions['fitBoundsOptions'], map: Map, features?: Feature<Polygon>[], initialBounds?: LngLatBounds): typeof MapHeat | undefined;
177
- static initializeAnimatedHeatMapSource(layers: MapLayer[], featureSet: Feature<Polygon>[][], map: Map, startColor?: string, endColor?: string): Promise<void>;
178
- private static updateLayer;
179
- initializeHeatMapSource(layers: MapLayer[]): this;
180
- }
181
-
182
- interface MapPointsConfig extends MapBaseConfig<Point> {
183
- features: Feature<Point>[];
184
- }
185
- declare class MapPoints extends MapBase<Point> {
186
- private config;
187
- constructor(config: MapPointsConfig);
188
- initialMapPositioning(options: MapOptions['fitBoundsOptions'], initialBounds?: LngLatBounds): mapbox_gl.Map;
189
- }
190
-
191
- interface MapSettingsConfig {
192
- debugLayerName?: string;
193
- map: Map;
194
- requestLocation?: boolean;
195
- settings: MapSetting;
196
- zoom?: number;
197
- }
198
- /**
199
- * Utility class to handle changes in settings
200
- *
201
- * Methods are pure functions dedicated to map manipulation
202
- */
203
- declare class MapSettings {
204
- static geoLocateControl: GeolocateControl | undefined;
205
- static mapListeners: {
206
- logData: (ev?: MapEventOf<MapEventType>, map?: Map) => void;
207
- };
208
- static navControl: NavigationControl | undefined;
209
- static requestLocation: boolean | undefined;
210
- static toggleControls(value: boolean | undefined, map: Map, zoom?: number, requestLocation?: boolean): typeof MapSettings;
211
- static toggleDebugLayer(value: boolean | undefined, map: Map, layerName: string): typeof MapSettings;
212
- static toggleDebugLogging(value: boolean | undefined, map: Map): void;
213
- static toggleScrollToZoom(value: boolean | undefined, map: Map): typeof MapSettings;
214
- static updateSettings(config: MapSettingsConfig): void;
215
- private static addControls;
216
- private static removeControls;
217
- }
218
-
219
- interface HeatMapInitializerState {
220
- MapHeat?: MapHeat;
221
- heatMapColorProps?: HeatMapColorProps;
222
- }
223
-
224
- declare const useHeatMapInitializer: () => HeatMapInitializerState;
225
- //# sourceMappingURL=useHeatMapInitializer.d.ts.map
226
-
227
- declare const MapBoxInstanceProvider: React$1.FC<PropsWithChildren>;
228
-
229
- interface MapBoxInstanceState {
230
- map?: Map;
231
- mapInitialized?: boolean;
232
- setMapBoxInstance?: Dispatch<SetStateAction<Map | undefined>>;
233
- }
234
-
235
- declare const useMapBoxInstance: () => MapBoxInstanceState;
236
- //# sourceMappingURL=useMapBoxInstance.d.ts.map
237
-
238
- interface MapSettingsProviderProps {
239
- debugLayerName?: string;
240
- defaultMapSettings?: MapSetting;
241
- requestLocation?: boolean;
242
- zoom?: number;
243
- }
244
- declare const MapSettingsProvider: React$1.FC<PropsWithChildren<MapSettingsProviderProps>>;
245
-
246
- interface MapSettingsState {
247
- mapSettings?: MapSetting;
248
- setMapSettings?: Dispatch<React.SetStateAction<MapSetting>>;
249
- }
250
-
251
- declare const useMapSettings: () => MapSettingsState;
252
- //# sourceMappingURL=useMapSettings.d.ts.map
253
-
254
- /**
255
- * Inspired by - https://bl.ocks.org/danswick/fc56f37c10d40be62e4feac5984250d2
256
- */
257
- declare const useDynamicMapResize: (mapContainerRef: RefObject<HTMLDivElement | null>, mapCanvasRef: RefObject<HTMLCanvasElement | null>, mapInstance?: Map, active?: boolean) => void;
258
-
259
- declare const useDynamicPositioning: () => {
260
- options: Partial<MapOptions> | undefined;
261
- };
262
- //# sourceMappingURL=useDynamicPositioning.d.ts.map
263
-
264
- declare const useQuadKeyPayloadsToFeatures: (payloads?: NetworkLocationHeatmapQuadkeyAnswerPayload[] | NetworkLocationHeatmapQuadkeyAnswerPayload) => {
265
- error: Error | undefined;
266
- features: Feature<Geometry, geojson.GeoJsonProperties>[];
267
- multipleFeatureSets: Feature<Geometry, geojson.GeoJsonProperties>[][];
268
- };
269
- //# sourceMappingURL=useQuadKeyPayloadsToFeatures.d.ts.map
270
-
271
- export { AnimatedHeatMap, AnimatedHeatMapLegend, AnimatedHeatMapLoaded, CircleLayerBuilder, ColorGradientLegend, FillLayerBuilder, HeatMapFillLayerConfig, HeatMapInitializerProvider, HeatMapLineLayerConfig, HeatMapSettings, HeatMapSymbolLayerConfig, LayerAnimator, LineLayerBuilder, LocationHeatMapLayerBuilder, LocationHeatMapLayerBuilderAnimated, LocationPointLayerConfig, LocationPointsMapLayerBuilder, MapBase, MapBox, MapBoxInstanceProvider, MapHeat, MapHeatConstants, MapPoints, MapPointsConstants, MapSettingSwitch, MapSettings, MapSettingsBox, MapSettingsProvider, MapboxHeatFlexBox, MapboxPointsFlexBox, SymbolLayerBuilder, useDynamicMapResize, useDynamicPositioning, useHeatMapInitializer, useMapBoxInstance, useMapSettings, useQuadKeyPayloadsToFeatures };
272
- export type { AnimatedHeatMapLoadedProps, AnimatedHeatMapProps, FeaturesToLayersMap, HeatMapInitializerState, LayerAnimatorProps, MapBaseConfig, MapBoxInstanceState, MapBoxProps, MapInitializerProviderProps, MapLayer, MapPointsConfig, MapSettingSwitchProps, MapSettingsBoxProps, MapSettingsConfig, MapSettingsProviderProps, MapSettingsState, MapboxPointsFlexBoxProps };
1
+ export * from './Components/index.ts';
2
+ export * from './Contexts/index.ts';
3
+ export * from './hooks/index.ts';
4
+ export * from './Layers/index.ts';
5
+ export * from './MapBoxClasses/index.ts';
6
+ //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-map",
3
- "version": "6.1.3",
3
+ "version": "6.2.0",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -39,16 +39,16 @@
39
39
  "module": "dist/browser/index.mjs",
40
40
  "types": "dist/browser/index.d.ts",
41
41
  "dependencies": {
42
- "@xylabs/assert": "^4.13.21",
43
- "@xylabs/delay": "^4.13.21",
44
- "@xylabs/exists": "^4.13.21",
45
- "@xylabs/forget": "^4.13.21",
46
- "@xylabs/react-app-settings": "^6.3.13",
47
- "@xylabs/react-flexbox": "^6.3.13",
48
- "@xylabs/react-shared": "^6.3.13",
49
- "@xylabs/react-theme": "^6.3.13",
50
- "@xyo-network/react-archivist": "^6.1.3",
51
- "@xyo-network/react-map-model": "^6.1.3",
42
+ "@xylabs/assert": "^4.15.0",
43
+ "@xylabs/delay": "^4.15.0",
44
+ "@xylabs/exists": "^4.15.0",
45
+ "@xylabs/forget": "^4.15.0",
46
+ "@xylabs/react-app-settings": "^6.4.0",
47
+ "@xylabs/react-flexbox": "^6.4.0",
48
+ "@xylabs/react-shared": "^6.4.0",
49
+ "@xylabs/react-theme": "^6.4.0",
50
+ "@xyo-network/react-archivist": "^6.2.0",
51
+ "@xyo-network/react-map-model": "^6.2.0",
52
52
  "@xyo-network/sdk-geo": "^3.0.3",
53
53
  "geojson": "^0.5.0",
54
54
  "mapbox-gl": "^3.13.0"
@@ -56,16 +56,16 @@
56
56
  "devDependencies": {
57
57
  "@mui/icons-material": "^7.2.0",
58
58
  "@mui/material": "^7.2.0",
59
- "@storybook/react-vite": "^9.0.17",
59
+ "@storybook/react-vite": "^9.0.18",
60
60
  "@types/geojson": "7946.0.16",
61
61
  "@types/react": "^19.1.8",
62
- "@xylabs/ts-scripts-yarn3": "next",
63
- "@xylabs/tsconfig-react": "next",
64
- "react": "^19.1.0",
65
- "react-dom": "^19.1.0",
66
- "storybook": "^9.0.17",
62
+ "@xylabs/ts-scripts-yarn3": "^7.0.1",
63
+ "@xylabs/tsconfig-react": "^7.0.1",
64
+ "react": "^19.1.1",
65
+ "react-dom": "^19.1.1",
66
+ "storybook": "^9.0.18",
67
67
  "typescript": "^5.8.3",
68
- "vite": "^7.0.5"
68
+ "vite": "^7.0.6"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "@mui/icons-material": ">=6 <8",
package/src/global.d.ts CHANGED
@@ -1 +1 @@
1
- import type {} from '@mui/material/themeCssVarsAugmentation'
1
+ import '@mui/material/themeCssVarsAugmentation'