react-bkoi-gl 1.0.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/README.md +96 -0
- package/bkoi-gl/package.json +6 -0
- package/dist/components/attribution-control.d.ts +11 -0
- package/dist/components/attribution-control.js +19 -0
- package/dist/components/attribution-control.js.map +1 -0
- package/dist/components/fullscreen-control.d.ts +14 -0
- package/dist/components/fullscreen-control.js +21 -0
- package/dist/components/fullscreen-control.js.map +1 -0
- package/dist/components/geolocate-control.d.ts +37 -0
- package/dist/components/geolocate-control.js +51 -0
- package/dist/components/geolocate-control.js.map +1 -0
- package/dist/components/layer.d.ts +17 -0
- package/dist/components/layer.js +99 -0
- package/dist/components/layer.js.map +1 -0
- package/dist/components/map.d.ts +23 -0
- package/dist/components/map.js +102 -0
- package/dist/components/map.js.map +1 -0
- package/dist/components/marker.d.ts +41 -0
- package/dist/components/marker.js +102 -0
- package/dist/components/marker.js.map +1 -0
- package/dist/components/navigation-control.d.ts +11 -0
- package/dist/components/navigation-control.js +19 -0
- package/dist/components/navigation-control.js.map +1 -0
- package/dist/components/popup.d.ts +33 -0
- package/dist/components/popup.js +81 -0
- package/dist/components/popup.js.map +1 -0
- package/dist/components/scale-control.d.ts +13 -0
- package/dist/components/scale-control.js +31 -0
- package/dist/components/scale-control.js.map +1 -0
- package/dist/components/source.d.ts +7 -0
- package/dist/components/source.js +98 -0
- package/dist/components/source.js.map +1 -0
- package/dist/components/use-control.d.ts +9 -0
- package/dist/components/use-control.js +31 -0
- package/dist/components/use-control.js.map +1 -0
- package/dist/components/use-map.d.ts +20 -0
- package/dist/components/use-map.js +55 -0
- package/dist/components/use-map.js.map +1 -0
- package/dist/exports-bkoi-gl.cjs +1512 -0
- package/dist/exports-bkoi-gl.d.ts +89 -0
- package/dist/exports-bkoi-gl.js +36 -0
- package/dist/exports-bkoi-gl.js.map +1 -0
- package/dist/exports-mapbox.d.ts +139 -0
- package/dist/exports-mapbox.js +36 -0
- package/dist/exports-mapbox.js.map +1 -0
- package/dist/index.cjs +1514 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/mapbox/create-ref.d.ts +9 -0
- package/dist/mapbox/create-ref.js +64 -0
- package/dist/mapbox/create-ref.js.map +1 -0
- package/dist/mapbox/mapbox.d.ts +81 -0
- package/dist/mapbox/mapbox.js +477 -0
- package/dist/mapbox/mapbox.js.map +1 -0
- package/dist/styles/react-bkoi-gl.css +1 -0
- package/dist/types/common.d.ts +78 -0
- package/dist/types/common.js +2 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/events-bkoi-gl.d.ts +49 -0
- package/dist/types/events-bkoi-gl.js +2 -0
- package/dist/types/events-bkoi-gl.js.map +1 -0
- package/dist/types/events-mapbox.d.ts +49 -0
- package/dist/types/events-mapbox.js +2 -0
- package/dist/types/events-mapbox.js.map +1 -0
- package/dist/types/events.d.ts +39 -0
- package/dist/types/events.js +2 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/index.d.ts +70 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/lib.d.ts +224 -0
- package/dist/types/lib.js +2 -0
- package/dist/types/lib.js.map +1 -0
- package/dist/types/public.d.ts +2 -0
- package/dist/types/public.js +2 -0
- package/dist/types/public.js.map +1 -0
- package/dist/types/style-spec-bkoi-gl.d.ts +9 -0
- package/dist/types/style-spec-bkoi-gl.js +2 -0
- package/dist/types/style-spec-bkoi-gl.js.map +1 -0
- package/dist/types/style-spec-mapbox.d.ts +7 -0
- package/dist/types/style-spec-mapbox.js +2 -0
- package/dist/types/style-spec-mapbox.js.map +1 -0
- package/dist/utils/apply-react-style.d.ts +2 -0
- package/dist/utils/apply-react-style.js +16 -0
- package/dist/utils/apply-react-style.js.map +1 -0
- package/dist/utils/assert.d.ts +1 -0
- package/dist/utils/assert.js +6 -0
- package/dist/utils/assert.js.map +1 -0
- package/dist/utils/deep-equal.d.ts +15 -0
- package/dist/utils/deep-equal.js +46 -0
- package/dist/utils/deep-equal.js.map +1 -0
- package/dist/utils/set-globals.d.ts +22 -0
- package/dist/utils/set-globals.js +19 -0
- package/dist/utils/set-globals.js.map +1 -0
- package/dist/utils/style-utils.d.ts +2 -0
- package/dist/utils/style-utils.js +42 -0
- package/dist/utils/style-utils.js.map +1 -0
- package/dist/utils/transform.d.ts +26 -0
- package/dist/utils/transform.js +56 -0
- package/dist/utils/transform.js.map +1 -0
- package/dist/utils/use-isomorphic-layout-effect.d.ts +3 -0
- package/dist/utils/use-isomorphic-layout-effect.js +4 -0
- package/dist/utils/use-isomorphic-layout-effect.js.map +1 -0
- package/package.json +78 -0
- package/src/components/attribution-control.ts +32 -0
- package/src/components/fullscreen-control.tsx +37 -0
- package/src/components/geolocate-control.ts +90 -0
- package/src/components/layer.ts +133 -0
- package/src/components/map.tsx +155 -0
- package/src/components/marker.ts +137 -0
- package/src/components/navigation-control.ts +29 -0
- package/src/components/popup.ts +116 -0
- package/src/components/scale-control.ts +46 -0
- package/src/components/source.ts +158 -0
- package/src/components/use-control.ts +64 -0
- package/src/components/use-map.tsx +69 -0
- package/src/exports-bkoi-gl.ts +156 -0
- package/src/exports-mapbox.ts +159 -0
- package/src/index.ts +2 -0
- package/src/mapbox/create-ref.ts +118 -0
- package/src/mapbox/mapbox.ts +742 -0
- package/src/types/common.ts +94 -0
- package/src/types/events-bkoi-gl.ts +78 -0
- package/src/types/events-mapbox.ts +76 -0
- package/src/types/events.ts +73 -0
- package/src/types/index.ts +93 -0
- package/src/types/lib.ts +279 -0
- package/src/types/public.ts +9 -0
- package/src/types/style-spec-bkoi-gl.ts +81 -0
- package/src/types/style-spec-mapbox.ts +80 -0
- package/src/utils/apply-react-style.ts +20 -0
- package/src/utils/assert.ts +5 -0
- package/src/utils/deep-equal.ts +61 -0
- package/src/utils/set-globals.ts +57 -0
- package/src/utils/style-utils.ts +59 -0
- package/src/utils/transform.ts +86 -0
- package/src/utils/use-isomorphic-layout-effect.ts +7 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import type { PaddingOptions, LngLat, Point, LngLatLike, PointLike, ControlPosition } from './common';
|
|
2
|
+
export interface IControl<MapT extends MapInstance = MapInstance> {
|
|
3
|
+
onAdd(map: MapT): HTMLElement;
|
|
4
|
+
onRemove(map: MapT): void;
|
|
5
|
+
getDefaultPosition?: (() => string) | undefined;
|
|
6
|
+
}
|
|
7
|
+
declare type Listener = (event?: any) => any;
|
|
8
|
+
export interface Evented {
|
|
9
|
+
on(type: string, listener: Listener): any;
|
|
10
|
+
off(type?: string | any, listener?: Listener): any;
|
|
11
|
+
once(type: string, listener: Listener): any;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A user-facing type that represents the minimal intersection between Mapbox.Map and Maplibre.Map
|
|
15
|
+
* User provided `mapLib.Map` is supposed to implement this interface
|
|
16
|
+
* Only losely typed for compatibility
|
|
17
|
+
*/
|
|
18
|
+
export interface MapInstance extends Evented {
|
|
19
|
+
fire(type: string, properties?: {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}): any;
|
|
22
|
+
addControl(control: IControl<this>, position?: ControlPosition): any;
|
|
23
|
+
removeControl(control: IControl<this>): any;
|
|
24
|
+
hasControl(control: IControl<this>): boolean;
|
|
25
|
+
resize(): this;
|
|
26
|
+
queryRenderedFeatures(geometry?: any, options?: any): any[];
|
|
27
|
+
setStyle(style: any, options?: any): any;
|
|
28
|
+
isMoving(): boolean;
|
|
29
|
+
getStyle(): any;
|
|
30
|
+
isStyleLoaded(): boolean | void;
|
|
31
|
+
addSource(id: string, source: any): any;
|
|
32
|
+
removeSource(id: string): this;
|
|
33
|
+
getSource(id: string): any;
|
|
34
|
+
addLayer(layer: any, before?: string): any;
|
|
35
|
+
moveLayer(id: string, beforeId?: string): any;
|
|
36
|
+
removeLayer(id: string): any;
|
|
37
|
+
getLayer(id: string): any;
|
|
38
|
+
setFilter(layer: string, filter?: any[] | boolean | null): any;
|
|
39
|
+
setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): any;
|
|
40
|
+
setPaintProperty(layer: string, name: string, value: any): any;
|
|
41
|
+
setLayoutProperty(layer: string, name: string, value: any): any;
|
|
42
|
+
project(lnglat: any): Point;
|
|
43
|
+
unproject(point: any): LngLat;
|
|
44
|
+
queryTerrainElevation?(lngLat: any, options?: any): number | null;
|
|
45
|
+
getContainer(): HTMLElement;
|
|
46
|
+
getCanvas(): HTMLCanvasElement;
|
|
47
|
+
remove(): void;
|
|
48
|
+
triggerRepaint(): void;
|
|
49
|
+
setPadding(padding: PaddingOptions): any;
|
|
50
|
+
fitBounds(bounds: any, options?: any): any;
|
|
51
|
+
setFog?(fog: any): any;
|
|
52
|
+
setLight?(options: any, lightOptions?: any): any;
|
|
53
|
+
setTerrain?(terrain?: any): any;
|
|
54
|
+
}
|
|
55
|
+
export interface MarkerInstance extends Evented {
|
|
56
|
+
addTo(map: MapInstance): this;
|
|
57
|
+
remove(): this;
|
|
58
|
+
getLngLat(): LngLat;
|
|
59
|
+
setLngLat(lngLat: LngLatLike): this;
|
|
60
|
+
getElement(): HTMLElement;
|
|
61
|
+
setPopup(popup?: any): this;
|
|
62
|
+
getPopup(): any;
|
|
63
|
+
getOffset(): PointLike;
|
|
64
|
+
setOffset(offset: PointLike): this;
|
|
65
|
+
setDraggable(value: boolean): this;
|
|
66
|
+
isDraggable(): boolean;
|
|
67
|
+
getRotation(): number;
|
|
68
|
+
setRotation(rotation: number): this;
|
|
69
|
+
getRotationAlignment(): any;
|
|
70
|
+
setRotationAlignment(alignment: any): this;
|
|
71
|
+
getPitchAlignment(): any;
|
|
72
|
+
setPitchAlignment(alignment: any): this;
|
|
73
|
+
}
|
|
74
|
+
export interface PopupInstance extends Evented {
|
|
75
|
+
options?: any;
|
|
76
|
+
addTo(map: MapInstance): this;
|
|
77
|
+
remove(): this;
|
|
78
|
+
isOpen(): boolean;
|
|
79
|
+
getLngLat(): LngLat;
|
|
80
|
+
setLngLat(lnglat: LngLatLike): this;
|
|
81
|
+
getElement(): HTMLElement;
|
|
82
|
+
setDOMContent(htmlNode: any): this;
|
|
83
|
+
getMaxWidth(): any;
|
|
84
|
+
setMaxWidth(maxWidth: any): this;
|
|
85
|
+
addClassName(className: string): void;
|
|
86
|
+
removeClassName(className: string): void;
|
|
87
|
+
setOffset(offset?: any): this;
|
|
88
|
+
}
|
|
89
|
+
export interface AttributionControlInstance extends IControl {
|
|
90
|
+
_container?: HTMLElement;
|
|
91
|
+
}
|
|
92
|
+
export interface FullscreenControlInstance extends IControl {
|
|
93
|
+
_controlContainer?: HTMLElement;
|
|
94
|
+
}
|
|
95
|
+
export interface GeolocateControlInstance extends IControl, Evented {
|
|
96
|
+
_container?: HTMLElement;
|
|
97
|
+
trigger(): any;
|
|
98
|
+
}
|
|
99
|
+
export interface NavigationControlInstance extends IControl {
|
|
100
|
+
_container?: HTMLElement;
|
|
101
|
+
}
|
|
102
|
+
export interface ScaleControlInstance extends IControl {
|
|
103
|
+
_container?: HTMLElement;
|
|
104
|
+
options?: any;
|
|
105
|
+
setUnit(unit: any): void;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* A user-facing type that represents the minimal intersection between Mapbox and Maplibre
|
|
109
|
+
* User provided `mapLib` is supposed to implement this interface
|
|
110
|
+
* Only losely typed for compatibility
|
|
111
|
+
*/
|
|
112
|
+
export interface MapLib<MapT extends MapInstance> {
|
|
113
|
+
supported?: (options: any) => boolean;
|
|
114
|
+
Map: {
|
|
115
|
+
new (options: any): MapT;
|
|
116
|
+
};
|
|
117
|
+
Marker: {
|
|
118
|
+
new (...options: any[]): MarkerInstance;
|
|
119
|
+
};
|
|
120
|
+
Popup: {
|
|
121
|
+
new (options: any): PopupInstance;
|
|
122
|
+
};
|
|
123
|
+
AttributionControl: {
|
|
124
|
+
new (options: any): AttributionControlInstance;
|
|
125
|
+
};
|
|
126
|
+
FullscreenControl: {
|
|
127
|
+
new (options: any): FullscreenControlInstance;
|
|
128
|
+
};
|
|
129
|
+
GeolocateControl: {
|
|
130
|
+
new (options: any): GeolocateControlInstance;
|
|
131
|
+
};
|
|
132
|
+
NavigationControl: {
|
|
133
|
+
new (options: any): NavigationControlInstance;
|
|
134
|
+
};
|
|
135
|
+
ScaleControl: {
|
|
136
|
+
new (options: any): ScaleControlInstance;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Stub for mapbox's Transform class
|
|
141
|
+
* https://github.com/mapbox/mapbox-gl-js/blob/main/src/geo/transform.js
|
|
142
|
+
*/
|
|
143
|
+
export declare type Transform = {
|
|
144
|
+
width: number;
|
|
145
|
+
height: number;
|
|
146
|
+
center: LngLat;
|
|
147
|
+
zoom: number;
|
|
148
|
+
bearing: number;
|
|
149
|
+
pitch: number;
|
|
150
|
+
padding: PaddingOptions;
|
|
151
|
+
elevation: any;
|
|
152
|
+
pixelsToGLUnits: [number, number];
|
|
153
|
+
cameraElevationReference: 'ground' | 'sea';
|
|
154
|
+
clone: () => Transform;
|
|
155
|
+
resize: (width: number, height: number) => void;
|
|
156
|
+
isPaddingEqual: (value: PaddingOptions) => boolean;
|
|
157
|
+
getBounds: () => any;
|
|
158
|
+
locationPoint: (lngLat: LngLat) => Point;
|
|
159
|
+
pointLocation: (p: Point) => LngLat;
|
|
160
|
+
getProjection?: () => any;
|
|
161
|
+
setProjection?: (projection: any) => void;
|
|
162
|
+
};
|
|
163
|
+
export declare type MapInstanceInternal<MapT extends MapInstance> = MapT & {
|
|
164
|
+
transform: Transform;
|
|
165
|
+
_render: Function;
|
|
166
|
+
_renderTaskQueue: {
|
|
167
|
+
run: Function;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
export interface CustomLayerInterface {
|
|
171
|
+
id: string;
|
|
172
|
+
type: 'custom';
|
|
173
|
+
renderingMode?: '2d' | '3d';
|
|
174
|
+
onRemove?(map: MapInstance, gl: WebGLRenderingContext): void;
|
|
175
|
+
onAdd?(map: MapInstance, gl: WebGLRenderingContext): void;
|
|
176
|
+
prerender?(gl: WebGLRenderingContext, matrix: number[]): void;
|
|
177
|
+
render(gl: WebGLRenderingContext, matrix: number[]): void;
|
|
178
|
+
}
|
|
179
|
+
export interface CustomSourceImplementation<TileDataT> {
|
|
180
|
+
id: string;
|
|
181
|
+
type: 'custom';
|
|
182
|
+
dataType: 'raster';
|
|
183
|
+
minzoom?: number;
|
|
184
|
+
maxzoom?: number;
|
|
185
|
+
scheme?: string;
|
|
186
|
+
tileSize?: number;
|
|
187
|
+
attribution?: string;
|
|
188
|
+
bounds?: [number, number, number, number];
|
|
189
|
+
hasTile?: (tileID: {
|
|
190
|
+
z: number;
|
|
191
|
+
x: number;
|
|
192
|
+
y: number;
|
|
193
|
+
}) => boolean;
|
|
194
|
+
loadTile: (tileID: {
|
|
195
|
+
z: number;
|
|
196
|
+
x: number;
|
|
197
|
+
y: number;
|
|
198
|
+
}, options: {
|
|
199
|
+
signal: AbortSignal;
|
|
200
|
+
}) => Promise<TileDataT>;
|
|
201
|
+
prepareTile?: (tileID: {
|
|
202
|
+
z: number;
|
|
203
|
+
x: number;
|
|
204
|
+
y: number;
|
|
205
|
+
}) => TileDataT | undefined;
|
|
206
|
+
unloadTile?: (tileID: {
|
|
207
|
+
z: number;
|
|
208
|
+
x: number;
|
|
209
|
+
y: number;
|
|
210
|
+
}) => void;
|
|
211
|
+
onAdd?: (map: MapInstance) => void;
|
|
212
|
+
onRemove?: (map: MapInstance) => void;
|
|
213
|
+
}
|
|
214
|
+
export interface CustomSource<TileDataT = unknown> {
|
|
215
|
+
id: string;
|
|
216
|
+
type: 'custom';
|
|
217
|
+
scheme: string;
|
|
218
|
+
minzoom: number;
|
|
219
|
+
maxzoom: number;
|
|
220
|
+
tileSize: number;
|
|
221
|
+
attribution: string;
|
|
222
|
+
_implementation: CustomSourceImplementation<TileDataT>;
|
|
223
|
+
}
|
|
224
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib.js","names":[],"sources":["../../src/types/lib.ts"],"sourcesContent":["import type {PaddingOptions, LngLat, Point, LngLatLike, PointLike, ControlPosition} from './common';\n\nexport interface IControl<MapT extends MapInstance = MapInstance> {\n onAdd(map: MapT): HTMLElement;\n\n onRemove(map: MapT): void;\n\n getDefaultPosition?: (() => string) | undefined;\n}\n\ntype Listener = (event?: any) => any;\n\nexport interface Evented {\n on(type: string, listener: Listener);\n\n off(type?: string | any, listener?: Listener);\n\n once(type: string, listener: Listener);\n}\n\n/**\n * A user-facing type that represents the minimal intersection between Mapbox.Map and Maplibre.Map\n * User provided `mapLib.Map` is supposed to implement this interface\n * Only losely typed for compatibility\n */\nexport interface MapInstance extends Evented {\n // https://github.com/mapbox/mapbox-gl-js/issues/6522\n fire(type: string, properties?: {[key: string]: any});\n\n addControl(control: IControl<this>, position?: ControlPosition);\n\n removeControl(control: IControl<this>);\n\n hasControl(control: IControl<this>): boolean;\n\n resize(): this;\n\n queryRenderedFeatures(geometry?: any, options?: any): any[];\n\n setStyle(style: any, options?: any);\n\n isMoving(): boolean;\n\n getStyle(): any;\n\n isStyleLoaded(): boolean | void;\n\n addSource(id: string, source: any);\n\n removeSource(id: string): this;\n\n getSource(id: string): any;\n\n addLayer(layer: any, before?: string);\n\n moveLayer(id: string, beforeId?: string);\n\n removeLayer(id: string);\n\n getLayer(id: string): any;\n\n setFilter(layer: string, filter?: any[] | boolean | null);\n\n setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number);\n\n setPaintProperty(layer: string, name: string, value: any);\n\n setLayoutProperty(layer: string, name: string, value: any);\n\n project(lnglat: any): Point;\n\n unproject(point: any): LngLat;\n\n queryTerrainElevation?(lngLat: any, options?: any): number | null;\n\n getContainer(): HTMLElement;\n\n getCanvas(): HTMLCanvasElement;\n\n remove(): void;\n\n triggerRepaint(): void;\n\n setPadding(padding: PaddingOptions);\n\n fitBounds(bounds: any, options?: any);\n\n setFog?(fog: any);\n\n setLight?(options: any, lightOptions?: any);\n\n setTerrain?(terrain?: any);\n}\n\nexport interface MarkerInstance extends Evented {\n addTo(map: MapInstance): this;\n remove(): this;\n\n getLngLat(): LngLat;\n setLngLat(lngLat: LngLatLike): this;\n\n getElement(): HTMLElement;\n\n setPopup(popup?: any): this;\n getPopup(): any;\n\n getOffset(): PointLike;\n setOffset(offset: PointLike): this;\n\n setDraggable(value: boolean): this;\n isDraggable(): boolean;\n\n getRotation(): number;\n setRotation(rotation: number): this;\n\n getRotationAlignment(): any;\n setRotationAlignment(alignment: any): this;\n\n getPitchAlignment(): any;\n setPitchAlignment(alignment: any): this;\n}\n\nexport interface PopupInstance extends Evented {\n options?: any;\n\n addTo(map: MapInstance): this;\n remove(): this;\n\n isOpen(): boolean;\n\n getLngLat(): LngLat;\n setLngLat(lnglat: LngLatLike): this;\n\n getElement(): HTMLElement;\n\n setDOMContent(htmlNode: any): this;\n\n getMaxWidth(): any;\n setMaxWidth(maxWidth: any): this;\n\n addClassName(className: string): void;\n removeClassName(className: string): void;\n\n setOffset(offset?: any): this;\n}\n\nexport interface AttributionControlInstance extends IControl {\n _container?: HTMLElement;\n}\n\nexport interface FullscreenControlInstance extends IControl {\n _controlContainer?: HTMLElement;\n}\n\nexport interface GeolocateControlInstance extends IControl, Evented {\n _container?: HTMLElement;\n trigger();\n}\n\nexport interface NavigationControlInstance extends IControl {\n _container?: HTMLElement;\n}\n\nexport interface ScaleControlInstance extends IControl {\n _container?: HTMLElement;\n options?: any;\n setUnit(unit: any): void;\n}\n\n/**\n * A user-facing type that represents the minimal intersection between Mapbox and Maplibre\n * User provided `mapLib` is supposed to implement this interface\n * Only losely typed for compatibility\n */\nexport interface MapLib<MapT extends MapInstance> {\n supported?: (options: any) => boolean;\n\n Map: {new (options: any): MapT};\n\n Marker: {new (...options: any[]): MarkerInstance};\n\n Popup: {new (options: any): PopupInstance};\n\n AttributionControl: {new (options: any): AttributionControlInstance};\n\n FullscreenControl: {new (options: any): FullscreenControlInstance};\n\n GeolocateControl: {new (options: any): GeolocateControlInstance};\n\n NavigationControl: {new (options: any): NavigationControlInstance};\n\n ScaleControl: {new (options: any): ScaleControlInstance};\n}\n\n/**\n * Stub for mapbox's Transform class\n * https://github.com/mapbox/mapbox-gl-js/blob/main/src/geo/transform.js\n */\nexport type Transform = {\n width: number;\n height: number;\n center: LngLat;\n zoom: number;\n bearing: number;\n pitch: number;\n padding: PaddingOptions;\n elevation: any;\n pixelsToGLUnits: [number, number];\n cameraElevationReference: 'ground' | 'sea';\n\n clone: () => Transform;\n resize: (width: number, height: number) => void;\n isPaddingEqual: (value: PaddingOptions) => boolean;\n getBounds: () => any;\n locationPoint: (lngLat: LngLat) => Point;\n pointLocation: (p: Point) => LngLat;\n\n // Mapbox only\n getProjection?: () => any;\n setProjection?: (projection: any) => void;\n};\n\nexport type MapInstanceInternal<MapT extends MapInstance> = MapT & {\n transform: Transform;\n\n _render: Function;\n\n _renderTaskQueue: {\n run: Function;\n };\n};\n\n// Custom layer\nexport interface CustomLayerInterface {\n id: string;\n type: 'custom';\n renderingMode?: '2d' | '3d';\n\n onRemove?(map: MapInstance, gl: WebGLRenderingContext): void;\n onAdd?(map: MapInstance, gl: WebGLRenderingContext): void;\n\n prerender?(gl: WebGLRenderingContext, matrix: number[]): void;\n render(gl: WebGLRenderingContext, matrix: number[]): void;\n}\n\n// Custom source\n\nexport interface CustomSourceImplementation<TileDataT> {\n id: string;\n type: 'custom';\n dataType: 'raster';\n minzoom?: number;\n maxzoom?: number;\n scheme?: string;\n tileSize?: number;\n attribution?: string;\n bounds?: [number, number, number, number];\n hasTile?: (tileID: {z: number; x: number; y: number}) => boolean;\n loadTile: (\n tileID: {z: number; x: number; y: number},\n options: {signal: AbortSignal}\n ) => Promise<TileDataT>;\n prepareTile?: (tileID: {z: number; x: number; y: number}) => TileDataT | undefined;\n unloadTile?: (tileID: {z: number; x: number; y: number}) => void;\n onAdd?: (map: MapInstance) => void;\n onRemove?: (map: MapInstance) => void;\n}\n\nexport interface CustomSource<TileDataT = unknown> {\n id: string;\n type: 'custom';\n scheme: string;\n minzoom: number;\n maxzoom: number;\n tileSize: number;\n attribution: string;\n\n _implementation: CustomSourceImplementation<TileDataT>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","names":[],"sources":["../../src/types/public.ts"],"sourcesContent":["export type {ViewState, ControlPosition} from './common';\nexport type {\n IControl,\n MapInstance,\n MapLib,\n CustomLayerInterface,\n CustomSource,\n CustomSourceImplementation\n} from './lib';\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BackgroundLayerSpecification as BackgroundLayer, CircleLayerSpecification as CircleLayer, FillLayerSpecification as FillLayer, FillExtrusionLayerSpecification as FillExtrusionLayer, HeatmapLayerSpecification as HeatmapLayer, HillshadeLayerSpecification as HillshadeLayer, LineLayerSpecification as LineLayer, RasterLayerSpecification as RasterLayer, SymbolLayerSpecification as SymbolLayer, GeoJSONSourceSpecification as GeoJSONSourceRaw, VideoSourceSpecification as VideoSourceRaw, ImageSourceSpecification as ImageSourceRaw, VectorSourceSpecification as VectorSourceRaw, RasterSourceSpecification as RasterSource, RasterDEMSourceSpecification as RasterDemSource } from '@maplibre/maplibre-gl-style-spec';
|
|
2
|
+
import { CanvasSourceSpecification as CanvasSourceRaw } from 'bkoi-gl';
|
|
3
|
+
export type { BackgroundLayer, CircleLayer, FillLayer, FillExtrusionLayer, HeatmapLayer, HillshadeLayer, LineLayer, RasterLayer, SymbolLayer };
|
|
4
|
+
export declare type AnyLayer = BackgroundLayer | CircleLayer | FillLayer | FillExtrusionLayer | HeatmapLayer | HillshadeLayer | LineLayer | RasterLayer | SymbolLayer;
|
|
5
|
+
export type { GeoJSONSourceRaw, VideoSourceRaw, ImageSourceRaw, CanvasSourceRaw, VectorSourceRaw, RasterSource, RasterDemSource };
|
|
6
|
+
export declare type AnySource = GeoJSONSourceRaw | VideoSourceRaw | ImageSourceRaw | CanvasSourceRaw | VectorSourceRaw | RasterSource | RasterDemSource;
|
|
7
|
+
export type { StyleSpecification as MapStyle, LightSpecification as Light, TerrainSpecification as Terrain } from '@maplibre/maplibre-gl-style-spec';
|
|
8
|
+
export declare type Fog = never;
|
|
9
|
+
export declare type Projection = never;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-spec-bkoi-gl.js","names":[],"sources":["../../src/types/style-spec-bkoi-gl.ts"],"sourcesContent":["/*\n * Maplibre Style Specification types\n * Type names are aligned with mapbox\n */\nimport type {\n BackgroundLayerSpecification as BackgroundLayer,\n CircleLayerSpecification as CircleLayer,\n FillLayerSpecification as FillLayer,\n FillExtrusionLayerSpecification as FillExtrusionLayer,\n HeatmapLayerSpecification as HeatmapLayer,\n HillshadeLayerSpecification as HillshadeLayer,\n LineLayerSpecification as LineLayer,\n RasterLayerSpecification as RasterLayer,\n SymbolLayerSpecification as SymbolLayer,\n GeoJSONSourceSpecification as GeoJSONSourceRaw,\n VideoSourceSpecification as VideoSourceRaw,\n ImageSourceSpecification as ImageSourceRaw,\n VectorSourceSpecification as VectorSourceRaw,\n RasterSourceSpecification as RasterSource,\n RasterDEMSourceSpecification as RasterDemSource\n} from '@maplibre/maplibre-gl-style-spec';\n\n// @ts-ignore\n// eslint-disable-next-line import/no-unresolved\nimport {CanvasSourceSpecification as CanvasSourceRaw} from 'bkoi-gl';\n\n// Layers\nexport type {\n BackgroundLayer,\n CircleLayer,\n FillLayer,\n FillExtrusionLayer,\n HeatmapLayer,\n HillshadeLayer,\n LineLayer,\n RasterLayer,\n SymbolLayer\n};\n\nexport type AnyLayer =\n | BackgroundLayer\n | CircleLayer\n | FillLayer\n | FillExtrusionLayer\n | HeatmapLayer\n | HillshadeLayer\n | LineLayer\n | RasterLayer\n | SymbolLayer;\n\n// Sources\nexport type {\n GeoJSONSourceRaw,\n VideoSourceRaw,\n ImageSourceRaw,\n CanvasSourceRaw,\n VectorSourceRaw,\n RasterSource,\n RasterDemSource\n};\n\nexport type AnySource =\n | GeoJSONSourceRaw\n | VideoSourceRaw\n | ImageSourceRaw\n | CanvasSourceRaw\n | VectorSourceRaw\n | RasterSource\n | RasterDemSource;\n\n// Other style types\n\nexport type {\n StyleSpecification as MapStyle,\n LightSpecification as Light,\n TerrainSpecification as Terrain\n} from '@maplibre/maplibre-gl-style-spec';\n\n// The following types are not yet supported by maplibre\nexport type Fog = never;\nexport type Projection = never;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BackgroundLayer, SkyLayer, CircleLayer, FillLayer, FillExtrusionLayer, HeatmapLayer, HillshadeLayer, LineLayer, RasterLayer, SymbolLayer } from 'mapbox-gl';
|
|
2
|
+
export declare type AnyLayer = BackgroundLayer | CircleLayer | FillExtrusionLayer | FillLayer | HeatmapLayer | HillshadeLayer | LineLayer | RasterLayer | SymbolLayer | SkyLayer;
|
|
3
|
+
export type { BackgroundLayer, SkyLayer, CircleLayer, FillLayer, FillExtrusionLayer, HeatmapLayer, HillshadeLayer, LineLayer, RasterLayer, SymbolLayer };
|
|
4
|
+
import type { GeoJSONSourceRaw, VideoSourceRaw, ImageSourceRaw, VectorSource as VectorSourceRaw, RasterSource, CanvasSourceRaw, RasterDemSource } from 'mapbox-gl';
|
|
5
|
+
export declare type AnySource = GeoJSONSourceRaw | VideoSourceRaw | ImageSourceRaw | CanvasSourceRaw | VectorSourceRaw | RasterSource | RasterDemSource;
|
|
6
|
+
export type { GeoJSONSourceRaw, VideoSourceRaw, ImageSourceRaw, CanvasSourceRaw, VectorSourceRaw, RasterSource, RasterDemSource };
|
|
7
|
+
export type { Style as MapStyle, Light, Fog, TerrainSpecification as Terrain, Projection } from 'mapbox-gl';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-spec-mapbox.js","names":[],"sources":["../../src/types/style-spec-mapbox.ts"],"sourcesContent":["/*\n * Mapbox Style Specification types\n */\n// Layers\nimport type {\n BackgroundLayer,\n SkyLayer,\n CircleLayer,\n FillLayer,\n FillExtrusionLayer,\n HeatmapLayer,\n HillshadeLayer,\n LineLayer,\n RasterLayer,\n SymbolLayer\n} from 'mapbox-gl';\n\nexport type AnyLayer =\n | BackgroundLayer\n | CircleLayer\n | FillExtrusionLayer\n | FillLayer\n | HeatmapLayer\n | HillshadeLayer\n | LineLayer\n | RasterLayer\n | SymbolLayer\n | SkyLayer;\n\nexport type {\n BackgroundLayer,\n SkyLayer,\n CircleLayer,\n FillLayer,\n FillExtrusionLayer,\n HeatmapLayer,\n HillshadeLayer,\n LineLayer,\n RasterLayer,\n SymbolLayer\n};\n\n// Sources\nimport type {\n GeoJSONSourceRaw,\n VideoSourceRaw,\n ImageSourceRaw,\n VectorSource as VectorSourceRaw,\n RasterSource,\n CanvasSourceRaw,\n RasterDemSource\n} from 'mapbox-gl';\n\nexport type AnySource =\n | GeoJSONSourceRaw\n | VideoSourceRaw\n | ImageSourceRaw\n | CanvasSourceRaw\n | VectorSourceRaw\n | RasterSource\n | RasterDemSource;\n\nexport type {\n GeoJSONSourceRaw,\n VideoSourceRaw,\n ImageSourceRaw,\n CanvasSourceRaw,\n VectorSourceRaw,\n RasterSource,\n RasterDemSource\n};\n\n// Other\nexport type {\n Style as MapStyle,\n Light,\n Fog,\n TerrainSpecification as Terrain,\n Projection\n} from 'mapbox-gl';\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const unitlessNumber = /box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;
|
|
2
|
+
export function applyReactStyle(element, styles) {
|
|
3
|
+
if (!element || !styles) {
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
const style = element.style;
|
|
7
|
+
for (const key in styles) {
|
|
8
|
+
const value = styles[key];
|
|
9
|
+
if (Number.isFinite(value) && !unitlessNumber.test(key)) {
|
|
10
|
+
style[key] = `${value}px`;
|
|
11
|
+
} else {
|
|
12
|
+
style[key] = value;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=apply-react-style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-react-style.js","names":["unitlessNumber","applyReactStyle","element","styles","style","key","value","Number","isFinite","test"],"sources":["../../src/utils/apply-react-style.ts"],"sourcesContent":["import * as React from 'react';\n// This is a simplified version of\n// https://github.com/facebook/react/blob/4131af3e4bf52f3a003537ec95a1655147c81270/src/renderers/dom/shared/CSSPropertyOperations.js#L62\nconst unitlessNumber = /box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;\n\nexport function applyReactStyle(element: HTMLElement, styles: React.CSSProperties) {\n if (!element || !styles) {\n return;\n }\n const style = element.style;\n\n for (const key in styles) {\n const value = styles[key];\n if (Number.isFinite(value) && !unitlessNumber.test(key)) {\n style[key] = `${value}px`;\n } else {\n style[key] = value;\n }\n }\n}\n"],"mappings":"AAGA,MAAMA,cAAc,GAAG,yEAAyE;AAEhG,OAAO,SAASC,eAAeA,CAACC,OAAoB,EAAEC,MAA2B,EAAE;EACjF,IAAI,CAACD,OAAO,IAAI,CAACC,MAAM,EAAE;IACvB;EACF;EACA,MAAMC,KAAK,GAAGF,OAAO,CAACE,KAAK;EAE3B,KAAK,MAAMC,GAAG,IAAIF,MAAM,EAAE;IACxB,MAAMG,KAAK,GAAGH,MAAM,CAACE,GAAG,CAAC;IACzB,IAAIE,MAAM,CAACC,QAAQ,CAACF,KAAK,CAAC,IAAI,CAACN,cAAc,CAACS,IAAI,CAACJ,GAAG,CAAC,EAAE;MACvDD,KAAK,CAACC,GAAG,CAAC,GAAG,GAAGC,KAAK,IAAI;IAC3B,CAAC,MAAM;MACLF,KAAK,CAACC,GAAG,CAAC,GAAGC,KAAK;IACpB;EACF;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function assert(condition: any, message: string): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert.js","names":["assert","condition","message","Error"],"sources":["../../src/utils/assert.ts"],"sourcesContent":["export default function assert(condition: any, message: string) {\n if (!condition) {\n throw new Error(message);\n }\n}\n"],"mappings":"AAAA,eAAe,SAASA,MAAMA,CAACC,SAAc,EAAEC,OAAe,EAAE;EAC9D,IAAI,CAACD,SAAS,EAAE;IACd,MAAM,IAAIE,KAAK,CAACD,OAAO,CAAC;EAC1B;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PointLike } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Compare two points
|
|
4
|
+
* @param a
|
|
5
|
+
* @param b
|
|
6
|
+
* @returns true if the points are equal
|
|
7
|
+
*/
|
|
8
|
+
export declare function arePointsEqual(a?: PointLike, b?: PointLike): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Compare any two objects
|
|
11
|
+
* @param a
|
|
12
|
+
* @param b
|
|
13
|
+
* @returns true if the objects are deep equal
|
|
14
|
+
*/
|
|
15
|
+
export declare function deepEqual(a: any, b: any): boolean;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export function arePointsEqual(a, b) {
|
|
2
|
+
const ax = Array.isArray(a) ? a[0] : a ? a.x : 0;
|
|
3
|
+
const ay = Array.isArray(a) ? a[1] : a ? a.y : 0;
|
|
4
|
+
const bx = Array.isArray(b) ? b[0] : b ? b.x : 0;
|
|
5
|
+
const by = Array.isArray(b) ? b[1] : b ? b.y : 0;
|
|
6
|
+
return ax === bx && ay === by;
|
|
7
|
+
}
|
|
8
|
+
export function deepEqual(a, b) {
|
|
9
|
+
if (a === b) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
if (!a || !b) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
if (Array.isArray(a)) {
|
|
16
|
+
if (!Array.isArray(b) || a.length !== b.length) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
for (let i = 0; i < a.length; i++) {
|
|
20
|
+
if (!deepEqual(a[i], b[i])) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return true;
|
|
25
|
+
} else if (Array.isArray(b)) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
if (typeof a === 'object' && typeof b === 'object') {
|
|
29
|
+
const aKeys = Object.keys(a);
|
|
30
|
+
const bKeys = Object.keys(b);
|
|
31
|
+
if (aKeys.length !== bKeys.length) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
for (const key of aKeys) {
|
|
35
|
+
if (!b.hasOwnProperty(key)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if (!deepEqual(a[key], b[key])) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=deep-equal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deep-equal.js","names":["arePointsEqual","a","b","ax","Array","isArray","x","ay","y","bx","by","deepEqual","length","i","aKeys","Object","keys","bKeys","key","hasOwnProperty"],"sources":["../../src/utils/deep-equal.ts"],"sourcesContent":["import type {PointLike} from '../types';\n\n/**\n * Compare two points\n * @param a\n * @param b\n * @returns true if the points are equal\n */\nexport function arePointsEqual(a?: PointLike, b?: PointLike): boolean {\n const ax = Array.isArray(a) ? a[0] : a ? a.x : 0;\n const ay = Array.isArray(a) ? a[1] : a ? a.y : 0;\n const bx = Array.isArray(b) ? b[0] : b ? b.x : 0;\n const by = Array.isArray(b) ? b[1] : b ? b.y : 0;\n return ax === bx && ay === by;\n}\n\n/* eslint-disable complexity */\n/**\n * Compare any two objects\n * @param a\n * @param b\n * @returns true if the objects are deep equal\n */\nexport function deepEqual(a: any, b: any): boolean {\n if (a === b) {\n return true;\n }\n if (!a || !b) {\n return false;\n }\n if (Array.isArray(a)) {\n if (!Array.isArray(b) || a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (!deepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n } else if (Array.isArray(b)) {\n return false;\n }\n if (typeof a === 'object' && typeof b === 'object') {\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n for (const key of aKeys) {\n if (!b.hasOwnProperty(key)) {\n return false;\n }\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n return false;\n}\n"],"mappings":"AAQA,OAAO,SAASA,cAAcA,CAACC,CAAa,EAAEC,CAAa,EAAW;EACpE,MAAMC,EAAE,GAAGC,KAAK,CAACC,OAAO,CAACJ,CAAC,CAAC,GAAGA,CAAC,CAAC,CAAC,CAAC,GAAGA,CAAC,GAAGA,CAAC,CAACK,CAAC,GAAG,CAAC;EAChD,MAAMC,EAAE,GAAGH,KAAK,CAACC,OAAO,CAACJ,CAAC,CAAC,GAAGA,CAAC,CAAC,CAAC,CAAC,GAAGA,CAAC,GAAGA,CAAC,CAACO,CAAC,GAAG,CAAC;EAChD,MAAMC,EAAE,GAAGL,KAAK,CAACC,OAAO,CAACH,CAAC,CAAC,GAAGA,CAAC,CAAC,CAAC,CAAC,GAAGA,CAAC,GAAGA,CAAC,CAACI,CAAC,GAAG,CAAC;EAChD,MAAMI,EAAE,GAAGN,KAAK,CAACC,OAAO,CAACH,CAAC,CAAC,GAAGA,CAAC,CAAC,CAAC,CAAC,GAAGA,CAAC,GAAGA,CAAC,CAACM,CAAC,GAAG,CAAC;EAChD,OAAOL,EAAE,KAAKM,EAAE,IAAIF,EAAE,KAAKG,EAAE;AAC/B;AASA,OAAO,SAASC,SAASA,CAACV,CAAM,EAAEC,CAAM,EAAW;EACjD,IAAID,CAAC,KAAKC,CAAC,EAAE;IACX,OAAO,IAAI;EACb;EACA,IAAI,CAACD,CAAC,IAAI,CAACC,CAAC,EAAE;IACZ,OAAO,KAAK;EACd;EACA,IAAIE,KAAK,CAACC,OAAO,CAACJ,CAAC,CAAC,EAAE;IACpB,IAAI,CAACG,KAAK,CAACC,OAAO,CAACH,CAAC,CAAC,IAAID,CAAC,CAACW,MAAM,KAAKV,CAAC,CAACU,MAAM,EAAE;MAC9C,OAAO,KAAK;IACd;IACA,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGZ,CAAC,CAACW,MAAM,EAAEC,CAAC,EAAE,EAAE;MACjC,IAAI,CAACF,SAAS,CAACV,CAAC,CAACY,CAAC,CAAC,EAAEX,CAAC,CAACW,CAAC,CAAC,CAAC,EAAE;QAC1B,OAAO,KAAK;MACd;IACF;IACA,OAAO,IAAI;EACb,CAAC,MAAM,IAAIT,KAAK,CAACC,OAAO,CAACH,CAAC,CAAC,EAAE;IAC3B,OAAO,KAAK;EACd;EACA,IAAI,OAAOD,CAAC,KAAK,QAAQ,IAAI,OAAOC,CAAC,KAAK,QAAQ,EAAE;IAClD,MAAMY,KAAK,GAAGC,MAAM,CAACC,IAAI,CAACf,CAAC,CAAC;IAC5B,MAAMgB,KAAK,GAAGF,MAAM,CAACC,IAAI,CAACd,CAAC,CAAC;IAC5B,IAAIY,KAAK,CAACF,MAAM,KAAKK,KAAK,CAACL,MAAM,EAAE;MACjC,OAAO,KAAK;IACd;IACA,KAAK,MAAMM,GAAG,IAAIJ,KAAK,EAAE;MACvB,IAAI,CAACZ,CAAC,CAACiB,cAAc,CAACD,GAAG,CAAC,EAAE;QAC1B,OAAO,KAAK;MACd;MACA,IAAI,CAACP,SAAS,CAACV,CAAC,CAACiB,GAAG,CAAC,EAAEhB,CAAC,CAACgB,GAAG,CAAC,CAAC,EAAE;QAC9B,OAAO,KAAK;MACd;IACF;IACA,OAAO,IAAI;EACb;EACA,OAAO,KAAK;AACd","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare type GlobalSettings = {
|
|
2
|
+
/** The map's default API URL for requesting tiles, styles, sprites, and glyphs. */
|
|
3
|
+
baseApiUrl?: string;
|
|
4
|
+
/** The maximum number of images (raster tiles, sprites, icons) to load in parallel.
|
|
5
|
+
* @default 16
|
|
6
|
+
*/
|
|
7
|
+
maxParallelImageRequests?: number;
|
|
8
|
+
/** The map's RTL text plugin. Necessary for supporting the Arabic and Hebrew languages, which are written right-to-left. */
|
|
9
|
+
RTLTextPlugin?: string | false;
|
|
10
|
+
/** Provides an interface for external module bundlers such as Webpack or Rollup to package mapbox-gl's WebWorker into a separate class and integrate it with the library.
|
|
11
|
+
Takes precedence over `workerUrl`. */
|
|
12
|
+
workerClass?: any;
|
|
13
|
+
/** The number of web workers instantiated on a page with mapbox-gl maps.
|
|
14
|
+
* @default 2
|
|
15
|
+
*/
|
|
16
|
+
workerCount?: number;
|
|
17
|
+
/** Provides an interface for loading mapbox-gl's WebWorker bundle from a self-hosted URL.
|
|
18
|
+
* This is useful if your site needs to operate in a strict CSP (Content Security Policy) environment
|
|
19
|
+
* wherein you are not allowed to load JavaScript code from a Blob URL, which is default behavior. */
|
|
20
|
+
workerUrl?: string;
|
|
21
|
+
};
|
|
22
|
+
export default function setGlobals(mapLib: any, props: GlobalSettings): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const globalSettings = ['baseApiUrl', 'maxParallelImageRequests', 'workerClass', 'workerCount', 'workerUrl'];
|
|
2
|
+
export default function setGlobals(mapLib, props) {
|
|
3
|
+
for (const key of globalSettings) {
|
|
4
|
+
if (key in props) {
|
|
5
|
+
mapLib[key] = props[key];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
const {
|
|
9
|
+
RTLTextPlugin = 'https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js'
|
|
10
|
+
} = props;
|
|
11
|
+
if (RTLTextPlugin && mapLib.getRTLTextPluginStatus && mapLib.getRTLTextPluginStatus() === 'unavailable') {
|
|
12
|
+
mapLib.setRTLTextPlugin(RTLTextPlugin, error => {
|
|
13
|
+
if (error) {
|
|
14
|
+
console.error(error);
|
|
15
|
+
}
|
|
16
|
+
}, true);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=set-globals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-globals.js","names":["globalSettings","setGlobals","mapLib","props","key","RTLTextPlugin","getRTLTextPluginStatus","setRTLTextPlugin","error","console"],"sources":["../../src/utils/set-globals.ts"],"sourcesContent":["export type GlobalSettings = {\n /** The map's default API URL for requesting tiles, styles, sprites, and glyphs. */\n baseApiUrl?: string;\n /** The maximum number of images (raster tiles, sprites, icons) to load in parallel.\n * @default 16\n */\n maxParallelImageRequests?: number;\n /** The map's RTL text plugin. Necessary for supporting the Arabic and Hebrew languages, which are written right-to-left. */\n RTLTextPlugin?: string | false;\n /** Provides an interface for external module bundlers such as Webpack or Rollup to package mapbox-gl's WebWorker into a separate class and integrate it with the library.\nTakes precedence over `workerUrl`. */\n workerClass?: any;\n /** The number of web workers instantiated on a page with mapbox-gl maps.\n * @default 2\n */\n workerCount?: number;\n /** Provides an interface for loading mapbox-gl's WebWorker bundle from a self-hosted URL.\n * This is useful if your site needs to operate in a strict CSP (Content Security Policy) environment\n * wherein you are not allowed to load JavaScript code from a Blob URL, which is default behavior. */\n workerUrl?: string;\n};\n\nconst globalSettings = [\n 'baseApiUrl',\n 'maxParallelImageRequests',\n 'workerClass',\n 'workerCount',\n 'workerUrl'\n] as const;\n\nexport default function setGlobals(mapLib: any, props: GlobalSettings) {\n for (const key of globalSettings) {\n if (key in props) {\n mapLib[key] = props[key];\n }\n }\n\n const {\n RTLTextPlugin = 'https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js'\n } = props;\n if (\n RTLTextPlugin &&\n mapLib.getRTLTextPluginStatus &&\n mapLib.getRTLTextPluginStatus() === 'unavailable'\n ) {\n mapLib.setRTLTextPlugin(\n RTLTextPlugin,\n (error?: Error) => {\n if (error) {\n // eslint-disable-next-line\n console.error(error);\n }\n },\n true\n );\n }\n}\n"],"mappings":"AAsBA,MAAMA,cAAc,GAAG,CACrB,YAAY,EACZ,0BAA0B,EAC1B,aAAa,EACb,aAAa,EACb,WAAW,CACH;AAEV,eAAe,SAASC,UAAUA,CAACC,MAAW,EAAEC,KAAqB,EAAE;EACrE,KAAK,MAAMC,GAAG,IAAIJ,cAAc,EAAE;IAChC,IAAII,GAAG,IAAID,KAAK,EAAE;MAChBD,MAAM,CAACE,GAAG,CAAC,GAAGD,KAAK,CAACC,GAAG,CAAC;IAC1B;EACF;EAEA,MAAM;IACJC,aAAa,GAAG;EAClB,CAAC,GAAGF,KAAK;EACT,IACEE,aAAa,IACbH,MAAM,CAACI,sBAAsB,IAC7BJ,MAAM,CAACI,sBAAsB,CAAC,CAAC,KAAK,aAAa,EACjD;IACAJ,MAAM,CAACK,gBAAgB,CACrBF,aAAa,EACZG,KAAa,IAAK;MACjB,IAAIA,KAAK,EAAE;QAETC,OAAO,CAACD,KAAK,CAACA,KAAK,CAAC;MACtB;IACF,CAAC,EACD,IACF,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const refProps = ['type', 'source', 'source-layer', 'minzoom', 'maxzoom', 'filter', 'layout'];
|
|
2
|
+
export function normalizeStyle(style) {
|
|
3
|
+
if (!style) {
|
|
4
|
+
return null;
|
|
5
|
+
}
|
|
6
|
+
if (typeof style === 'string') {
|
|
7
|
+
return style;
|
|
8
|
+
}
|
|
9
|
+
if ('toJS' in style) {
|
|
10
|
+
style = style.toJS();
|
|
11
|
+
}
|
|
12
|
+
if (!style.layers) {
|
|
13
|
+
return style;
|
|
14
|
+
}
|
|
15
|
+
const layerIndex = {};
|
|
16
|
+
for (const layer of style.layers) {
|
|
17
|
+
layerIndex[layer.id] = layer;
|
|
18
|
+
}
|
|
19
|
+
const layers = style.layers.map(layer => {
|
|
20
|
+
let normalizedLayer = null;
|
|
21
|
+
if ('interactive' in layer) {
|
|
22
|
+
normalizedLayer = Object.assign({}, layer);
|
|
23
|
+
delete normalizedLayer.interactive;
|
|
24
|
+
}
|
|
25
|
+
const layerRef = layerIndex[layer.ref];
|
|
26
|
+
if (layerRef) {
|
|
27
|
+
normalizedLayer = normalizedLayer || Object.assign({}, layer);
|
|
28
|
+
delete normalizedLayer.ref;
|
|
29
|
+
for (const propName of refProps) {
|
|
30
|
+
if (propName in layerRef) {
|
|
31
|
+
normalizedLayer[propName] = layerRef[propName];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return normalizedLayer || layer;
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
...style,
|
|
39
|
+
layers
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=style-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-utils.js","names":["refProps","normalizeStyle","style","toJS","layers","layerIndex","layer","id","map","normalizedLayer","Object","assign","interactive","layerRef","ref","propName"],"sources":["../../src/utils/style-utils.ts"],"sourcesContent":["import {ImmutableLike, MapStyle} from '../types';\n\nconst refProps = ['type', 'source', 'source-layer', 'minzoom', 'maxzoom', 'filter', 'layout'];\n\n// Prepare a map style object for diffing\n// If immutable - convert to plain object\n// Work around some issues in older styles that would fail Mapbox's diffing\nexport function normalizeStyle(\n style: string | MapStyle | ImmutableLike<MapStyle>\n): string | MapStyle {\n if (!style) {\n return null;\n }\n if (typeof style === 'string') {\n return style;\n }\n if ('toJS' in style) {\n style = style.toJS();\n }\n if (!style.layers) {\n return style;\n }\n const layerIndex = {};\n\n for (const layer of style.layers) {\n layerIndex[layer.id] = layer;\n }\n\n const layers = style.layers.map(layer => {\n let normalizedLayer: typeof layer = null;\n\n if ('interactive' in layer) {\n normalizedLayer = Object.assign({}, layer);\n // Breaks style diffing :(\n // @ts-ignore legacy field not typed\n delete normalizedLayer.interactive;\n }\n\n // Style diffing doesn't work with refs so expand them out manually before diffing.\n // @ts-ignore legacy field not typed\n const layerRef = layerIndex[layer.ref];\n if (layerRef) {\n normalizedLayer = normalizedLayer || Object.assign({}, layer);\n // @ts-ignore\n delete normalizedLayer.ref;\n // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/deref.js\n for (const propName of refProps) {\n if (propName in layerRef) {\n normalizedLayer[propName] = layerRef[propName];\n }\n }\n }\n\n return normalizedLayer || layer;\n });\n\n // Do not mutate the style object provided by the user\n return {...style, layers};\n}\n"],"mappings":"AAEA,MAAMA,QAAQ,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC;AAK7F,OAAO,SAASC,cAAcA,CAC5BC,KAAkD,EAC/B;EACnB,IAAI,CAACA,KAAK,EAAE;IACV,OAAO,IAAI;EACb;EACA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOA,KAAK;EACd;EACA,IAAI,MAAM,IAAIA,KAAK,EAAE;IACnBA,KAAK,GAAGA,KAAK,CAACC,IAAI,CAAC,CAAC;EACtB;EACA,IAAI,CAACD,KAAK,CAACE,MAAM,EAAE;IACjB,OAAOF,KAAK;EACd;EACA,MAAMG,UAAU,GAAG,CAAC,CAAC;EAErB,KAAK,MAAMC,KAAK,IAAIJ,KAAK,CAACE,MAAM,EAAE;IAChCC,UAAU,CAACC,KAAK,CAACC,EAAE,CAAC,GAAGD,KAAK;EAC9B;EAEA,MAAMF,MAAM,GAAGF,KAAK,CAACE,MAAM,CAACI,GAAG,CAACF,KAAK,IAAI;IACvC,IAAIG,eAA6B,GAAG,IAAI;IAExC,IAAI,aAAa,IAAIH,KAAK,EAAE;MAC1BG,eAAe,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEL,KAAK,CAAC;MAG1C,OAAOG,eAAe,CAACG,WAAW;IACpC;IAIA,MAAMC,QAAQ,GAAGR,UAAU,CAACC,KAAK,CAACQ,GAAG,CAAC;IACtC,IAAID,QAAQ,EAAE;MACZJ,eAAe,GAAGA,eAAe,IAAIC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEL,KAAK,CAAC;MAE7D,OAAOG,eAAe,CAACK,GAAG;MAE1B,KAAK,MAAMC,QAAQ,IAAIf,QAAQ,EAAE;QAC/B,IAAIe,QAAQ,IAAIF,QAAQ,EAAE;UACxBJ,eAAe,CAACM,QAAQ,CAAC,GAAGF,QAAQ,CAACE,QAAQ,CAAC;QAChD;MACF;IACF;IAEA,OAAON,eAAe,IAAIH,KAAK;EACjC,CAAC,CAAC;EAGF,OAAO;IAAC,GAAGJ,KAAK;IAAEE;EAAM,CAAC;AAC3B","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { MapboxProps } from '../mapbox/mapbox';
|
|
2
|
+
import type { Transform, ViewState } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Make a copy of a transform
|
|
5
|
+
* @param tr
|
|
6
|
+
*/
|
|
7
|
+
export declare function cloneTransform(tr: Transform): Transform;
|
|
8
|
+
/**
|
|
9
|
+
* Copy projection from one transform to another. This only applies to mapbox-gl transforms
|
|
10
|
+
* @param src the transform to copy projection settings from
|
|
11
|
+
* @param dest to transform to copy projection settings to
|
|
12
|
+
*/
|
|
13
|
+
export declare function syncProjection(src: Transform, dest: Transform): void;
|
|
14
|
+
/**
|
|
15
|
+
* Capture a transform's current state
|
|
16
|
+
* @param transform
|
|
17
|
+
* @returns descriptor of the view state
|
|
18
|
+
*/
|
|
19
|
+
export declare function transformToViewState(tr: Transform): ViewState;
|
|
20
|
+
/**
|
|
21
|
+
* Mutate a transform to match the given view state
|
|
22
|
+
* @param transform
|
|
23
|
+
* @param viewState
|
|
24
|
+
* @returns true if the transform has changed
|
|
25
|
+
*/
|
|
26
|
+
export declare function applyViewStateToTransform(tr: Transform, props: MapboxProps): boolean;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { deepEqual } from "./deep-equal.js";
|
|
2
|
+
export function cloneTransform(tr) {
|
|
3
|
+
const newTransform = tr.clone();
|
|
4
|
+
newTransform.pixelsToGLUnits = tr.pixelsToGLUnits;
|
|
5
|
+
return newTransform;
|
|
6
|
+
}
|
|
7
|
+
export function syncProjection(src, dest) {
|
|
8
|
+
if (!src.getProjection) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const srcProjection = src.getProjection();
|
|
12
|
+
const destProjection = dest.getProjection();
|
|
13
|
+
if (!deepEqual(srcProjection, destProjection)) {
|
|
14
|
+
dest.setProjection(srcProjection);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export function transformToViewState(tr) {
|
|
18
|
+
return {
|
|
19
|
+
longitude: tr.center.lng,
|
|
20
|
+
latitude: tr.center.lat,
|
|
21
|
+
zoom: tr.zoom,
|
|
22
|
+
pitch: tr.pitch,
|
|
23
|
+
bearing: tr.bearing,
|
|
24
|
+
padding: tr.padding
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export function applyViewStateToTransform(tr, props) {
|
|
28
|
+
const v = props.viewState || props;
|
|
29
|
+
let changed = false;
|
|
30
|
+
if ('zoom' in v) {
|
|
31
|
+
const zoom = tr.zoom;
|
|
32
|
+
tr.zoom = v.zoom;
|
|
33
|
+
changed = changed || zoom !== tr.zoom;
|
|
34
|
+
}
|
|
35
|
+
if ('bearing' in v) {
|
|
36
|
+
const bearing = tr.bearing;
|
|
37
|
+
tr.bearing = v.bearing;
|
|
38
|
+
changed = changed || bearing !== tr.bearing;
|
|
39
|
+
}
|
|
40
|
+
if ('pitch' in v) {
|
|
41
|
+
const pitch = tr.pitch;
|
|
42
|
+
tr.pitch = v.pitch;
|
|
43
|
+
changed = changed || pitch !== tr.pitch;
|
|
44
|
+
}
|
|
45
|
+
if (v.padding && !tr.isPaddingEqual(v.padding)) {
|
|
46
|
+
changed = true;
|
|
47
|
+
tr.padding = v.padding;
|
|
48
|
+
}
|
|
49
|
+
if ('longitude' in v && 'latitude' in v) {
|
|
50
|
+
const center = tr.center;
|
|
51
|
+
tr.center = new center.constructor(v.longitude, v.latitude);
|
|
52
|
+
changed = changed || center !== tr.center;
|
|
53
|
+
}
|
|
54
|
+
return changed;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.js","names":["deepEqual","cloneTransform","tr","newTransform","clone","pixelsToGLUnits","syncProjection","src","dest","getProjection","srcProjection","destProjection","setProjection","transformToViewState","longitude","center","lng","latitude","lat","zoom","pitch","bearing","padding","applyViewStateToTransform","props","v","viewState","changed","isPaddingEqual","constructor"],"sources":["../../src/utils/transform.ts"],"sourcesContent":["import type {MapboxProps} from '../mapbox/mapbox';\nimport type {Transform, ViewState} from '../types';\nimport {deepEqual} from './deep-equal';\n\n/**\n * Make a copy of a transform\n * @param tr\n */\nexport function cloneTransform(tr: Transform): Transform {\n const newTransform = tr.clone();\n // Work around mapbox bug - this value is not assigned in clone(), only in resize()\n newTransform.pixelsToGLUnits = tr.pixelsToGLUnits;\n return newTransform;\n}\n\n/**\n * Copy projection from one transform to another. This only applies to mapbox-gl transforms\n * @param src the transform to copy projection settings from\n * @param dest to transform to copy projection settings to\n */\nexport function syncProjection(src: Transform, dest: Transform): void {\n if (!src.getProjection) {\n return;\n }\n const srcProjection = src.getProjection();\n const destProjection = dest.getProjection();\n\n if (!deepEqual(srcProjection, destProjection)) {\n dest.setProjection(srcProjection);\n }\n}\n\n/**\n * Capture a transform's current state\n * @param transform\n * @returns descriptor of the view state\n */\nexport function transformToViewState(tr: Transform): ViewState {\n return {\n longitude: tr.center.lng,\n latitude: tr.center.lat,\n zoom: tr.zoom,\n pitch: tr.pitch,\n bearing: tr.bearing,\n padding: tr.padding\n };\n}\n\n/* eslint-disable complexity */\n/**\n * Mutate a transform to match the given view state\n * @param transform\n * @param viewState\n * @returns true if the transform has changed\n */\nexport function applyViewStateToTransform(tr: Transform, props: MapboxProps): boolean {\n const v: Partial<ViewState> = props.viewState || props;\n let changed = false;\n\n if ('zoom' in v) {\n const zoom = tr.zoom;\n tr.zoom = v.zoom;\n changed = changed || zoom !== tr.zoom;\n }\n if ('bearing' in v) {\n const bearing = tr.bearing;\n tr.bearing = v.bearing;\n changed = changed || bearing !== tr.bearing;\n }\n if ('pitch' in v) {\n const pitch = tr.pitch;\n tr.pitch = v.pitch;\n changed = changed || pitch !== tr.pitch;\n }\n if (v.padding && !tr.isPaddingEqual(v.padding)) {\n changed = true;\n tr.padding = v.padding;\n }\n if ('longitude' in v && 'latitude' in v) {\n const center = tr.center;\n // @ts-ignore\n tr.center = new center.constructor(v.longitude, v.latitude);\n changed = changed || center !== tr.center;\n }\n return changed;\n}\n"],"mappings":"SAEQA,SAAS;AAMjB,OAAO,SAASC,cAAcA,CAACC,EAAa,EAAa;EACvD,MAAMC,YAAY,GAAGD,EAAE,CAACE,KAAK,CAAC,CAAC;EAE/BD,YAAY,CAACE,eAAe,GAAGH,EAAE,CAACG,eAAe;EACjD,OAAOF,YAAY;AACrB;AAOA,OAAO,SAASG,cAAcA,CAACC,GAAc,EAAEC,IAAe,EAAQ;EACpE,IAAI,CAACD,GAAG,CAACE,aAAa,EAAE;IACtB;EACF;EACA,MAAMC,aAAa,GAAGH,GAAG,CAACE,aAAa,CAAC,CAAC;EACzC,MAAME,cAAc,GAAGH,IAAI,CAACC,aAAa,CAAC,CAAC;EAE3C,IAAI,CAACT,SAAS,CAACU,aAAa,EAAEC,cAAc,CAAC,EAAE;IAC7CH,IAAI,CAACI,aAAa,CAACF,aAAa,CAAC;EACnC;AACF;AAOA,OAAO,SAASG,oBAAoBA,CAACX,EAAa,EAAa;EAC7D,OAAO;IACLY,SAAS,EAAEZ,EAAE,CAACa,MAAM,CAACC,GAAG;IACxBC,QAAQ,EAAEf,EAAE,CAACa,MAAM,CAACG,GAAG;IACvBC,IAAI,EAAEjB,EAAE,CAACiB,IAAI;IACbC,KAAK,EAAElB,EAAE,CAACkB,KAAK;IACfC,OAAO,EAAEnB,EAAE,CAACmB,OAAO;IACnBC,OAAO,EAAEpB,EAAE,CAACoB;EACd,CAAC;AACH;AASA,OAAO,SAASC,yBAAyBA,CAACrB,EAAa,EAAEsB,KAAkB,EAAW;EACpF,MAAMC,CAAqB,GAAGD,KAAK,CAACE,SAAS,IAAIF,KAAK;EACtD,IAAIG,OAAO,GAAG,KAAK;EAEnB,IAAI,MAAM,IAAIF,CAAC,EAAE;IACf,MAAMN,IAAI,GAAGjB,EAAE,CAACiB,IAAI;IACpBjB,EAAE,CAACiB,IAAI,GAAGM,CAAC,CAACN,IAAI;IAChBQ,OAAO,GAAGA,OAAO,IAAIR,IAAI,KAAKjB,EAAE,CAACiB,IAAI;EACvC;EACA,IAAI,SAAS,IAAIM,CAAC,EAAE;IAClB,MAAMJ,OAAO,GAAGnB,EAAE,CAACmB,OAAO;IAC1BnB,EAAE,CAACmB,OAAO,GAAGI,CAAC,CAACJ,OAAO;IACtBM,OAAO,GAAGA,OAAO,IAAIN,OAAO,KAAKnB,EAAE,CAACmB,OAAO;EAC7C;EACA,IAAI,OAAO,IAAII,CAAC,EAAE;IAChB,MAAML,KAAK,GAAGlB,EAAE,CAACkB,KAAK;IACtBlB,EAAE,CAACkB,KAAK,GAAGK,CAAC,CAACL,KAAK;IAClBO,OAAO,GAAGA,OAAO,IAAIP,KAAK,KAAKlB,EAAE,CAACkB,KAAK;EACzC;EACA,IAAIK,CAAC,CAACH,OAAO,IAAI,CAACpB,EAAE,CAAC0B,cAAc,CAACH,CAAC,CAACH,OAAO,CAAC,EAAE;IAC9CK,OAAO,GAAG,IAAI;IACdzB,EAAE,CAACoB,OAAO,GAAGG,CAAC,CAACH,OAAO;EACxB;EACA,IAAI,WAAW,IAAIG,CAAC,IAAI,UAAU,IAAIA,CAAC,EAAE;IACvC,MAAMV,MAAM,GAAGb,EAAE,CAACa,MAAM;IAExBb,EAAE,CAACa,MAAM,GAAG,IAAIA,MAAM,CAACc,WAAW,CAACJ,CAAC,CAACX,SAAS,EAAEW,CAAC,CAACR,QAAQ,CAAC;IAC3DU,OAAO,GAAGA,OAAO,IAAIZ,MAAM,KAAKb,EAAE,CAACa,MAAM;EAC3C;EACA,OAAOY,OAAO;AAChB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-isomorphic-layout-effect.js","names":["useEffect","useLayoutEffect","useIsomorphicLayoutEffect","document"],"sources":["../../src/utils/use-isomorphic-layout-effect.ts"],"sourcesContent":["// From https://github.com/streamich/react-use/blob/master/src/useIsomorphicLayoutEffect.ts\n// useLayoutEffect but does not trigger warning in server-side rendering\nimport {useEffect, useLayoutEffect} from 'react';\n\nconst useIsomorphicLayoutEffect = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\n\nexport default useIsomorphicLayoutEffect;\n"],"mappings":"AAEA,SAAQA,SAAS,EAAEC,eAAe,QAAO,OAAO;AAEhD,MAAMC,yBAAyB,GAAG,OAAOC,QAAQ,KAAK,WAAW,GAAGF,eAAe,GAAGD,SAAS;AAE/F,eAAeE,yBAAyB","ignoreList":[]}
|