@tmlmobilidade/ui 20250403.1817.10 → 20250403.2152.43
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.css.map +1 -1
- package/dist/index.d.ts +30 -5
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/attribution-control.js +15 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/attribution-control.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/fullscreen-control.js +17 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/fullscreen-control.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/geolocate-control.js +45 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/geolocate-control.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/layer.js +102 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/layer.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/logo-control.js +13 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/logo-control.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/map.js +91 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/map.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/marker.js +93 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/marker.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/navigation-control.js +17 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/navigation-control.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/popup.js +67 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/popup.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/scale-control.js +27 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/scale-control.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/source.js +117 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/source.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/terrain-control.js +15 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/terrain-control.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/use-control.js +32 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/use-control.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/use-map.js +45 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/components/use-map.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/maplibre/create-ref.js +58 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/maplibre/create-ref.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/maplibre/maplibre.js +456 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/maplibre/maplibre.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/utils/apply-react-style.js +21 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/utils/apply-react-style.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/utils/assert.js +8 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/utils/assert.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/utils/compare-class-names.js +26 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/utils/compare-class-names.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/utils/deep-equal.js +62 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/utils/deep-equal.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/utils/set-globals.js +26 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/utils/set-globals.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/utils/style-utils.js +51 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/utils/style-utils.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/utils/transform.js +53 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/utils/transform.js.map +1 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/utils/use-isomorphic-layout-effect.js +8 -0
- package/dist/node_modules/@vis.gl/react-maplibre/dist/utils/use-isomorphic-layout-effect.js.map +1 -0
- package/dist/src/components/AppProvider/index.js +12 -1
- package/dist/src/components/AppProvider/index.js.map +1 -1
- package/dist/src/components/common/AppLogos/index.js +0 -1
- package/dist/src/components/common/AppLogos/index.js.map +1 -1
- package/dist/src/components/map/MapView/index.js +11 -1
- package/dist/src/components/map/MapView/index.js.map +1 -1
- package/dist/src/components/map/MapViewStyleActiveStops/index.js +14 -1
- package/dist/src/components/map/MapViewStyleActiveStops/index.js.map +1 -1
- package/dist/src/components/map/MapViewStylePath/index.js +14 -1
- package/dist/src/components/map/MapViewStylePath/index.js.map +1 -1
- package/dist/src/components/map/MapViewStyleStops/index.js +14 -1
- package/dist/src/components/map/MapViewStyleStops/index.js.map +1 -1
- package/dist/src/components/map/MapViewStyleVehicles/index.js +14 -1
- package/dist/src/components/map/MapViewStyleVehicles/index.js.map +1 -1
- package/dist/src/components/theme/ThemeSwitcher/index.js +3 -20
- package/dist/src/components/theme/ThemeSwitcher/index.js.map +1 -1
- package/dist/src/contexts/Theme.context.js +9 -2
- package/dist/src/contexts/Theme.context.js.map +1 -1
- package/dist/src/styles/theme.js.map +1 -1
- package/dist/styles-no-reset.css +246 -191
- package/dist/styles.css +245 -197
- package/package.json +5 -9
- package/dist/src/components/theme/ThemeSwitcher/styles.module.css.js +0 -4
- package/dist/src/components/theme/ThemeSwitcher/styles.module.css.js.map +0 -1
@@ -0,0 +1,456 @@
|
|
1
|
+
import { transformToViewState, applyViewStateToTransform } from '../utils/transform.js';
|
2
|
+
import { normalizeStyle } from '../utils/style-utils.js';
|
3
|
+
import { deepEqual } from '../utils/deep-equal.js';
|
4
|
+
|
5
|
+
const DEFAULT_STYLE = { version: 8, sources: {}, layers: [] };
|
6
|
+
const pointerEvents = {
|
7
|
+
mousedown: 'onMouseDown',
|
8
|
+
mouseup: 'onMouseUp',
|
9
|
+
mouseover: 'onMouseOver',
|
10
|
+
mousemove: 'onMouseMove',
|
11
|
+
click: 'onClick',
|
12
|
+
dblclick: 'onDblClick',
|
13
|
+
mouseenter: 'onMouseEnter',
|
14
|
+
mouseleave: 'onMouseLeave',
|
15
|
+
mouseout: 'onMouseOut',
|
16
|
+
contextmenu: 'onContextMenu',
|
17
|
+
touchstart: 'onTouchStart',
|
18
|
+
touchend: 'onTouchEnd',
|
19
|
+
touchmove: 'onTouchMove',
|
20
|
+
touchcancel: 'onTouchCancel'
|
21
|
+
};
|
22
|
+
const cameraEvents = {
|
23
|
+
movestart: 'onMoveStart',
|
24
|
+
move: 'onMove',
|
25
|
+
moveend: 'onMoveEnd',
|
26
|
+
dragstart: 'onDragStart',
|
27
|
+
drag: 'onDrag',
|
28
|
+
dragend: 'onDragEnd',
|
29
|
+
zoomstart: 'onZoomStart',
|
30
|
+
zoom: 'onZoom',
|
31
|
+
zoomend: 'onZoomEnd',
|
32
|
+
rotatestart: 'onRotateStart',
|
33
|
+
rotate: 'onRotate',
|
34
|
+
rotateend: 'onRotateEnd',
|
35
|
+
pitchstart: 'onPitchStart',
|
36
|
+
pitch: 'onPitch',
|
37
|
+
pitchend: 'onPitchEnd'
|
38
|
+
};
|
39
|
+
const otherEvents = {
|
40
|
+
wheel: 'onWheel',
|
41
|
+
boxzoomstart: 'onBoxZoomStart',
|
42
|
+
boxzoomend: 'onBoxZoomEnd',
|
43
|
+
boxzoomcancel: 'onBoxZoomCancel',
|
44
|
+
resize: 'onResize',
|
45
|
+
load: 'onLoad',
|
46
|
+
render: 'onRender',
|
47
|
+
idle: 'onIdle',
|
48
|
+
remove: 'onRemove',
|
49
|
+
data: 'onData',
|
50
|
+
styledata: 'onStyleData',
|
51
|
+
sourcedata: 'onSourceData',
|
52
|
+
error: 'onError'
|
53
|
+
};
|
54
|
+
const settingNames = [
|
55
|
+
'minZoom',
|
56
|
+
'maxZoom',
|
57
|
+
'minPitch',
|
58
|
+
'maxPitch',
|
59
|
+
'maxBounds',
|
60
|
+
'projection',
|
61
|
+
'renderWorldCopies'
|
62
|
+
];
|
63
|
+
const handlerNames = [
|
64
|
+
'scrollZoom',
|
65
|
+
'boxZoom',
|
66
|
+
'dragRotate',
|
67
|
+
'dragPan',
|
68
|
+
'keyboard',
|
69
|
+
'doubleClickZoom',
|
70
|
+
'touchZoomRotate',
|
71
|
+
'touchPitch'
|
72
|
+
];
|
73
|
+
/**
|
74
|
+
* A wrapper for mapbox-gl's Map class
|
75
|
+
*/
|
76
|
+
class Maplibre {
|
77
|
+
constructor(MapClass, props, container) {
|
78
|
+
// mapboxgl.Map instance
|
79
|
+
this._map = null;
|
80
|
+
// Internal states
|
81
|
+
this._internalUpdate = false;
|
82
|
+
this._hoveredFeatures = null;
|
83
|
+
this._propsedCameraUpdate = null;
|
84
|
+
this._styleComponents = {};
|
85
|
+
this._onEvent = (e) => {
|
86
|
+
// @ts-ignore
|
87
|
+
const cb = this.props[otherEvents[e.type]];
|
88
|
+
if (cb) {
|
89
|
+
cb(e);
|
90
|
+
}
|
91
|
+
else if (e.type === 'error') {
|
92
|
+
console.error(e.error); // eslint-disable-line
|
93
|
+
}
|
94
|
+
};
|
95
|
+
this._onCameraEvent = (e) => {
|
96
|
+
if (this._internalUpdate) {
|
97
|
+
return;
|
98
|
+
}
|
99
|
+
e.viewState = this._propsedCameraUpdate || transformToViewState(this._map.transform);
|
100
|
+
// @ts-ignore
|
101
|
+
const cb = this.props[cameraEvents[e.type]];
|
102
|
+
if (cb) {
|
103
|
+
cb(e);
|
104
|
+
}
|
105
|
+
};
|
106
|
+
this._onCameraUpdate = (tr) => {
|
107
|
+
if (this._internalUpdate) {
|
108
|
+
return tr;
|
109
|
+
}
|
110
|
+
this._propsedCameraUpdate = transformToViewState(tr);
|
111
|
+
return applyViewStateToTransform(tr, this.props);
|
112
|
+
};
|
113
|
+
this._onPointerEvent = (e) => {
|
114
|
+
if (e.type === 'mousemove' || e.type === 'mouseout') {
|
115
|
+
this._updateHover(e);
|
116
|
+
}
|
117
|
+
// @ts-ignore
|
118
|
+
const cb = this.props[pointerEvents[e.type]];
|
119
|
+
if (cb) {
|
120
|
+
if (this.props.interactiveLayerIds && e.type !== 'mouseover' && e.type !== 'mouseout') {
|
121
|
+
e.features = this._hoveredFeatures || this._queryRenderedFeatures(e.point);
|
122
|
+
}
|
123
|
+
cb(e);
|
124
|
+
delete e.features;
|
125
|
+
}
|
126
|
+
};
|
127
|
+
this._MapClass = MapClass;
|
128
|
+
this.props = props;
|
129
|
+
this._initialize(container);
|
130
|
+
}
|
131
|
+
get map() {
|
132
|
+
return this._map;
|
133
|
+
}
|
134
|
+
setProps(props) {
|
135
|
+
const oldProps = this.props;
|
136
|
+
this.props = props;
|
137
|
+
const settingsChanged = this._updateSettings(props, oldProps);
|
138
|
+
const sizeChanged = this._updateSize(props);
|
139
|
+
const viewStateChanged = this._updateViewState(props);
|
140
|
+
this._updateStyle(props, oldProps);
|
141
|
+
this._updateStyleComponents(props);
|
142
|
+
this._updateHandlers(props, oldProps);
|
143
|
+
// If 1) view state has changed to match props and
|
144
|
+
// 2) the props change is not triggered by map events,
|
145
|
+
// it's driven by an external state change. Redraw immediately
|
146
|
+
if (settingsChanged || sizeChanged || (viewStateChanged && !this._map.isMoving())) {
|
147
|
+
this.redraw();
|
148
|
+
}
|
149
|
+
}
|
150
|
+
static reuse(props, container) {
|
151
|
+
const that = Maplibre.savedMaps.pop();
|
152
|
+
if (!that) {
|
153
|
+
return null;
|
154
|
+
}
|
155
|
+
const map = that.map;
|
156
|
+
// When reusing the saved map, we need to reparent the map(canvas) and other child nodes
|
157
|
+
// intoto the new container from the props.
|
158
|
+
// Step 1: reparenting child nodes from old container to new container
|
159
|
+
const oldContainer = map.getContainer();
|
160
|
+
container.className = oldContainer.className;
|
161
|
+
while (oldContainer.childNodes.length > 0) {
|
162
|
+
container.appendChild(oldContainer.childNodes[0]);
|
163
|
+
}
|
164
|
+
// Step 2: replace the internal container with new container from the react component
|
165
|
+
// @ts-ignore
|
166
|
+
map._container = container;
|
167
|
+
// With maplibre-gl as mapLib, map uses ResizeObserver to observe when its container resizes.
|
168
|
+
// When reusing the saved map, we need to disconnect the observer and observe the new container.
|
169
|
+
// Step 3: telling the ResizeObserver to disconnect and observe the new container
|
170
|
+
// @ts-ignore
|
171
|
+
const resizeObserver = map._resizeObserver;
|
172
|
+
if (resizeObserver) {
|
173
|
+
resizeObserver.disconnect();
|
174
|
+
resizeObserver.observe(container);
|
175
|
+
}
|
176
|
+
// Step 4: apply new props
|
177
|
+
that.setProps({ ...props, styleDiffing: false });
|
178
|
+
map.resize();
|
179
|
+
const { initialViewState } = props;
|
180
|
+
if (initialViewState) {
|
181
|
+
if (initialViewState.bounds) {
|
182
|
+
map.fitBounds(initialViewState.bounds, { ...initialViewState.fitBoundsOptions, duration: 0 });
|
183
|
+
}
|
184
|
+
else {
|
185
|
+
that._updateViewState(initialViewState);
|
186
|
+
}
|
187
|
+
}
|
188
|
+
// Simulate load event
|
189
|
+
if (map.isStyleLoaded()) {
|
190
|
+
map.fire('load');
|
191
|
+
}
|
192
|
+
else {
|
193
|
+
map.once('style.load', () => map.fire('load'));
|
194
|
+
}
|
195
|
+
// Force reload
|
196
|
+
// @ts-ignore
|
197
|
+
map._update();
|
198
|
+
return that;
|
199
|
+
}
|
200
|
+
/* eslint-disable complexity,max-statements */
|
201
|
+
_initialize(container) {
|
202
|
+
const { props } = this;
|
203
|
+
const { mapStyle = DEFAULT_STYLE } = props;
|
204
|
+
const mapOptions = {
|
205
|
+
...props,
|
206
|
+
...props.initialViewState,
|
207
|
+
container,
|
208
|
+
style: normalizeStyle(mapStyle)
|
209
|
+
};
|
210
|
+
const viewState = mapOptions.initialViewState || mapOptions.viewState || mapOptions;
|
211
|
+
Object.assign(mapOptions, {
|
212
|
+
center: [viewState.longitude || 0, viewState.latitude || 0],
|
213
|
+
zoom: viewState.zoom || 0,
|
214
|
+
pitch: viewState.pitch || 0,
|
215
|
+
bearing: viewState.bearing || 0
|
216
|
+
});
|
217
|
+
if (props.gl) {
|
218
|
+
// eslint-disable-next-line
|
219
|
+
const getContext = HTMLCanvasElement.prototype.getContext;
|
220
|
+
// Hijack canvas.getContext to return our own WebGLContext
|
221
|
+
// This will be called inside the mapboxgl.Map constructor
|
222
|
+
// @ts-expect-error
|
223
|
+
HTMLCanvasElement.prototype.getContext = () => {
|
224
|
+
// Unhijack immediately
|
225
|
+
HTMLCanvasElement.prototype.getContext = getContext;
|
226
|
+
return props.gl;
|
227
|
+
};
|
228
|
+
}
|
229
|
+
const map = new this._MapClass(mapOptions);
|
230
|
+
// Props that are not part of constructor options
|
231
|
+
if (viewState.padding) {
|
232
|
+
map.setPadding(viewState.padding);
|
233
|
+
}
|
234
|
+
if (props.cursor) {
|
235
|
+
map.getCanvas().style.cursor = props.cursor;
|
236
|
+
}
|
237
|
+
// add listeners
|
238
|
+
map.transformCameraUpdate = this._onCameraUpdate;
|
239
|
+
map.on('style.load', () => {
|
240
|
+
// Map style has changed, this would have wiped out all settings from props
|
241
|
+
this._styleComponents = {
|
242
|
+
light: map.getLight(),
|
243
|
+
sky: map.getSky(),
|
244
|
+
// @ts-ignore getProjection() does not exist in v4
|
245
|
+
projection: map.getProjection?.(),
|
246
|
+
terrain: map.getTerrain()
|
247
|
+
};
|
248
|
+
this._updateStyleComponents(this.props);
|
249
|
+
});
|
250
|
+
map.on('sourcedata', () => {
|
251
|
+
// Some sources have loaded, we may need them to attach terrain
|
252
|
+
this._updateStyleComponents(this.props);
|
253
|
+
});
|
254
|
+
for (const eventName in pointerEvents) {
|
255
|
+
map.on(eventName, this._onPointerEvent);
|
256
|
+
}
|
257
|
+
for (const eventName in cameraEvents) {
|
258
|
+
map.on(eventName, this._onCameraEvent);
|
259
|
+
}
|
260
|
+
for (const eventName in otherEvents) {
|
261
|
+
map.on(eventName, this._onEvent);
|
262
|
+
}
|
263
|
+
this._map = map;
|
264
|
+
}
|
265
|
+
/* eslint-enable complexity,max-statements */
|
266
|
+
recycle() {
|
267
|
+
// Clean up unnecessary elements before storing for reuse.
|
268
|
+
const container = this.map.getContainer();
|
269
|
+
const children = container.querySelector('[mapboxgl-children]');
|
270
|
+
children?.remove();
|
271
|
+
Maplibre.savedMaps.push(this);
|
272
|
+
}
|
273
|
+
destroy() {
|
274
|
+
this._map.remove();
|
275
|
+
}
|
276
|
+
// Force redraw the map now. Typically resize() and jumpTo() is reflected in the next
|
277
|
+
// render cycle, which is managed by Mapbox's animation loop.
|
278
|
+
// This removes the synchronization issue caused by requestAnimationFrame.
|
279
|
+
redraw() {
|
280
|
+
const map = this._map;
|
281
|
+
// map._render will throw error if style does not exist
|
282
|
+
// https://github.com/mapbox/mapbox-gl-js/blob/fb9fc316da14e99ff4368f3e4faa3888fb43c513
|
283
|
+
// /src/ui/map.js#L1834
|
284
|
+
if (map.style) {
|
285
|
+
// cancel the scheduled update
|
286
|
+
if (map._frame) {
|
287
|
+
map._frame.cancel();
|
288
|
+
map._frame = null;
|
289
|
+
}
|
290
|
+
// the order is important - render() may schedule another update
|
291
|
+
map._render();
|
292
|
+
}
|
293
|
+
}
|
294
|
+
/* Trigger map resize if size is controlled
|
295
|
+
@param {object} nextProps
|
296
|
+
@returns {bool} true if size has changed
|
297
|
+
*/
|
298
|
+
_updateSize(nextProps) {
|
299
|
+
// Check if size is controlled
|
300
|
+
const { viewState } = nextProps;
|
301
|
+
if (viewState) {
|
302
|
+
const map = this._map;
|
303
|
+
if (viewState.width !== map.transform.width || viewState.height !== map.transform.height) {
|
304
|
+
map.resize();
|
305
|
+
return true;
|
306
|
+
}
|
307
|
+
}
|
308
|
+
return false;
|
309
|
+
}
|
310
|
+
// Adapted from map.jumpTo
|
311
|
+
/* Update camera to match props
|
312
|
+
@param {object} nextProps
|
313
|
+
@param {bool} triggerEvents - should fire camera events
|
314
|
+
@returns {bool} true if anything is changed
|
315
|
+
*/
|
316
|
+
_updateViewState(nextProps) {
|
317
|
+
const map = this._map;
|
318
|
+
const tr = map.transform;
|
319
|
+
const isMoving = map.isMoving();
|
320
|
+
// Avoid manipulating the real transform when interaction/animation is ongoing
|
321
|
+
// as it would interfere with Mapbox's handlers
|
322
|
+
if (!isMoving) {
|
323
|
+
const changes = applyViewStateToTransform(tr, nextProps);
|
324
|
+
if (Object.keys(changes).length > 0) {
|
325
|
+
this._internalUpdate = true;
|
326
|
+
map.jumpTo(changes);
|
327
|
+
this._internalUpdate = false;
|
328
|
+
return true;
|
329
|
+
}
|
330
|
+
}
|
331
|
+
return false;
|
332
|
+
}
|
333
|
+
/* Update camera constraints and projection settings to match props
|
334
|
+
@param {object} nextProps
|
335
|
+
@param {object} currProps
|
336
|
+
@returns {bool} true if anything is changed
|
337
|
+
*/
|
338
|
+
_updateSettings(nextProps, currProps) {
|
339
|
+
const map = this._map;
|
340
|
+
let changed = false;
|
341
|
+
for (const propName of settingNames) {
|
342
|
+
if (propName in nextProps && !deepEqual(nextProps[propName], currProps[propName])) {
|
343
|
+
changed = true;
|
344
|
+
const setter = map[`set${propName[0].toUpperCase()}${propName.slice(1)}`];
|
345
|
+
setter?.call(map, nextProps[propName]);
|
346
|
+
}
|
347
|
+
}
|
348
|
+
return changed;
|
349
|
+
}
|
350
|
+
/* Update map style to match props */
|
351
|
+
_updateStyle(nextProps, currProps) {
|
352
|
+
if (nextProps.cursor !== currProps.cursor) {
|
353
|
+
this._map.getCanvas().style.cursor = nextProps.cursor || '';
|
354
|
+
}
|
355
|
+
if (nextProps.mapStyle !== currProps.mapStyle) {
|
356
|
+
const { mapStyle = DEFAULT_STYLE, styleDiffing = true } = nextProps;
|
357
|
+
const options = {
|
358
|
+
diff: styleDiffing
|
359
|
+
};
|
360
|
+
if ('localIdeographFontFamily' in nextProps) {
|
361
|
+
// @ts-ignore Mapbox specific prop
|
362
|
+
options.localIdeographFontFamily = nextProps.localIdeographFontFamily;
|
363
|
+
}
|
364
|
+
this._map.setStyle(normalizeStyle(mapStyle), options);
|
365
|
+
}
|
366
|
+
}
|
367
|
+
/* Update fog, light, projection and terrain to match props
|
368
|
+
* These props are special because
|
369
|
+
* 1. They can not be applied right away. Certain conditions (style loaded, source loaded, etc.) must be met
|
370
|
+
* 2. They can be overwritten by mapStyle
|
371
|
+
*/
|
372
|
+
_updateStyleComponents({ light, projection, sky, terrain }) {
|
373
|
+
const map = this._map;
|
374
|
+
const currProps = this._styleComponents;
|
375
|
+
// We can safely manipulate map style once it's loaded
|
376
|
+
if (map.style._loaded) {
|
377
|
+
if (light && !deepEqual(light, currProps.light)) {
|
378
|
+
currProps.light = light;
|
379
|
+
map.setLight(light);
|
380
|
+
}
|
381
|
+
if (projection &&
|
382
|
+
!deepEqual(projection, currProps.projection) &&
|
383
|
+
projection !== currProps.projection?.type) {
|
384
|
+
currProps.projection = typeof projection === 'string' ? { type: projection } : projection;
|
385
|
+
// @ts-ignore setProjection does not exist in v4
|
386
|
+
map.setProjection?.(currProps.projection);
|
387
|
+
}
|
388
|
+
if (sky && !deepEqual(sky, currProps.sky)) {
|
389
|
+
currProps.sky = sky;
|
390
|
+
map.setSky(sky);
|
391
|
+
}
|
392
|
+
if (terrain !== undefined && !deepEqual(terrain, currProps.terrain)) {
|
393
|
+
if (!terrain || map.getSource(terrain.source)) {
|
394
|
+
currProps.terrain = terrain;
|
395
|
+
map.setTerrain(terrain);
|
396
|
+
}
|
397
|
+
}
|
398
|
+
}
|
399
|
+
}
|
400
|
+
/* Update interaction handlers to match props */
|
401
|
+
_updateHandlers(nextProps, currProps) {
|
402
|
+
const map = this._map;
|
403
|
+
for (const propName of handlerNames) {
|
404
|
+
const newValue = nextProps[propName] ?? true;
|
405
|
+
const oldValue = currProps[propName] ?? true;
|
406
|
+
if (!deepEqual(newValue, oldValue)) {
|
407
|
+
if (newValue) {
|
408
|
+
map[propName].enable(newValue);
|
409
|
+
}
|
410
|
+
else {
|
411
|
+
map[propName].disable();
|
412
|
+
}
|
413
|
+
}
|
414
|
+
}
|
415
|
+
}
|
416
|
+
_queryRenderedFeatures(point) {
|
417
|
+
const map = this._map;
|
418
|
+
const { interactiveLayerIds = [] } = this.props;
|
419
|
+
try {
|
420
|
+
return map.queryRenderedFeatures(point, {
|
421
|
+
layers: interactiveLayerIds.filter(map.getLayer.bind(map))
|
422
|
+
});
|
423
|
+
}
|
424
|
+
catch {
|
425
|
+
// May fail if style is not loaded
|
426
|
+
return [];
|
427
|
+
}
|
428
|
+
}
|
429
|
+
_updateHover(e) {
|
430
|
+
const { props } = this;
|
431
|
+
const shouldTrackHoveredFeatures = props.interactiveLayerIds && (props.onMouseMove || props.onMouseEnter || props.onMouseLeave);
|
432
|
+
if (shouldTrackHoveredFeatures) {
|
433
|
+
const eventType = e.type;
|
434
|
+
const wasHovering = this._hoveredFeatures?.length > 0;
|
435
|
+
const features = this._queryRenderedFeatures(e.point);
|
436
|
+
const isHovering = features.length > 0;
|
437
|
+
if (!isHovering && wasHovering) {
|
438
|
+
e.type = 'mouseleave';
|
439
|
+
this._onPointerEvent(e);
|
440
|
+
}
|
441
|
+
this._hoveredFeatures = features;
|
442
|
+
if (isHovering && !wasHovering) {
|
443
|
+
e.type = 'mouseenter';
|
444
|
+
this._onPointerEvent(e);
|
445
|
+
}
|
446
|
+
e.type = eventType;
|
447
|
+
}
|
448
|
+
else {
|
449
|
+
this._hoveredFeatures = null;
|
450
|
+
}
|
451
|
+
}
|
452
|
+
}
|
453
|
+
Maplibre.savedMaps = [];
|
454
|
+
|
455
|
+
export { Maplibre as default };
|
456
|
+
//# sourceMappingURL=maplibre.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"maplibre.js","sources":["../../../../../../../../node_modules/@vis.gl/react-maplibre/dist/maplibre/maplibre.js"],"sourcesContent":["import { transformToViewState, applyViewStateToTransform } from \"../utils/transform.js\";\nimport { normalizeStyle } from \"../utils/style-utils.js\";\nimport { deepEqual } from \"../utils/deep-equal.js\";\nconst DEFAULT_STYLE = { version: 8, sources: {}, layers: [] };\nconst pointerEvents = {\n mousedown: 'onMouseDown',\n mouseup: 'onMouseUp',\n mouseover: 'onMouseOver',\n mousemove: 'onMouseMove',\n click: 'onClick',\n dblclick: 'onDblClick',\n mouseenter: 'onMouseEnter',\n mouseleave: 'onMouseLeave',\n mouseout: 'onMouseOut',\n contextmenu: 'onContextMenu',\n touchstart: 'onTouchStart',\n touchend: 'onTouchEnd',\n touchmove: 'onTouchMove',\n touchcancel: 'onTouchCancel'\n};\nconst cameraEvents = {\n movestart: 'onMoveStart',\n move: 'onMove',\n moveend: 'onMoveEnd',\n dragstart: 'onDragStart',\n drag: 'onDrag',\n dragend: 'onDragEnd',\n zoomstart: 'onZoomStart',\n zoom: 'onZoom',\n zoomend: 'onZoomEnd',\n rotatestart: 'onRotateStart',\n rotate: 'onRotate',\n rotateend: 'onRotateEnd',\n pitchstart: 'onPitchStart',\n pitch: 'onPitch',\n pitchend: 'onPitchEnd'\n};\nconst otherEvents = {\n wheel: 'onWheel',\n boxzoomstart: 'onBoxZoomStart',\n boxzoomend: 'onBoxZoomEnd',\n boxzoomcancel: 'onBoxZoomCancel',\n resize: 'onResize',\n load: 'onLoad',\n render: 'onRender',\n idle: 'onIdle',\n remove: 'onRemove',\n data: 'onData',\n styledata: 'onStyleData',\n sourcedata: 'onSourceData',\n error: 'onError'\n};\nconst settingNames = [\n 'minZoom',\n 'maxZoom',\n 'minPitch',\n 'maxPitch',\n 'maxBounds',\n 'projection',\n 'renderWorldCopies'\n];\nconst handlerNames = [\n 'scrollZoom',\n 'boxZoom',\n 'dragRotate',\n 'dragPan',\n 'keyboard',\n 'doubleClickZoom',\n 'touchZoomRotate',\n 'touchPitch'\n];\n/**\n * A wrapper for mapbox-gl's Map class\n */\nclass Maplibre {\n constructor(MapClass, props, container) {\n // mapboxgl.Map instance\n this._map = null;\n // Internal states\n this._internalUpdate = false;\n this._hoveredFeatures = null;\n this._propsedCameraUpdate = null;\n this._styleComponents = {};\n this._onEvent = (e) => {\n // @ts-ignore\n const cb = this.props[otherEvents[e.type]];\n if (cb) {\n cb(e);\n }\n else if (e.type === 'error') {\n console.error(e.error); // eslint-disable-line\n }\n };\n this._onCameraEvent = (e) => {\n if (this._internalUpdate) {\n return;\n }\n e.viewState = this._propsedCameraUpdate || transformToViewState(this._map.transform);\n // @ts-ignore\n const cb = this.props[cameraEvents[e.type]];\n if (cb) {\n cb(e);\n }\n };\n this._onCameraUpdate = (tr) => {\n if (this._internalUpdate) {\n return tr;\n }\n this._propsedCameraUpdate = transformToViewState(tr);\n return applyViewStateToTransform(tr, this.props);\n };\n this._onPointerEvent = (e) => {\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n this._updateHover(e);\n }\n // @ts-ignore\n const cb = this.props[pointerEvents[e.type]];\n if (cb) {\n if (this.props.interactiveLayerIds && e.type !== 'mouseover' && e.type !== 'mouseout') {\n e.features = this._hoveredFeatures || this._queryRenderedFeatures(e.point);\n }\n cb(e);\n delete e.features;\n }\n };\n this._MapClass = MapClass;\n this.props = props;\n this._initialize(container);\n }\n get map() {\n return this._map;\n }\n setProps(props) {\n const oldProps = this.props;\n this.props = props;\n const settingsChanged = this._updateSettings(props, oldProps);\n const sizeChanged = this._updateSize(props);\n const viewStateChanged = this._updateViewState(props);\n this._updateStyle(props, oldProps);\n this._updateStyleComponents(props);\n this._updateHandlers(props, oldProps);\n // If 1) view state has changed to match props and\n // 2) the props change is not triggered by map events,\n // it's driven by an external state change. Redraw immediately\n if (settingsChanged || sizeChanged || (viewStateChanged && !this._map.isMoving())) {\n this.redraw();\n }\n }\n static reuse(props, container) {\n const that = Maplibre.savedMaps.pop();\n if (!that) {\n return null;\n }\n const map = that.map;\n // When reusing the saved map, we need to reparent the map(canvas) and other child nodes\n // intoto the new container from the props.\n // Step 1: reparenting child nodes from old container to new container\n const oldContainer = map.getContainer();\n container.className = oldContainer.className;\n while (oldContainer.childNodes.length > 0) {\n container.appendChild(oldContainer.childNodes[0]);\n }\n // Step 2: replace the internal container with new container from the react component\n // @ts-ignore\n map._container = container;\n // With maplibre-gl as mapLib, map uses ResizeObserver to observe when its container resizes.\n // When reusing the saved map, we need to disconnect the observer and observe the new container.\n // Step 3: telling the ResizeObserver to disconnect and observe the new container\n // @ts-ignore\n const resizeObserver = map._resizeObserver;\n if (resizeObserver) {\n resizeObserver.disconnect();\n resizeObserver.observe(container);\n }\n // Step 4: apply new props\n that.setProps({ ...props, styleDiffing: false });\n map.resize();\n const { initialViewState } = props;\n if (initialViewState) {\n if (initialViewState.bounds) {\n map.fitBounds(initialViewState.bounds, { ...initialViewState.fitBoundsOptions, duration: 0 });\n }\n else {\n that._updateViewState(initialViewState);\n }\n }\n // Simulate load event\n if (map.isStyleLoaded()) {\n map.fire('load');\n }\n else {\n map.once('style.load', () => map.fire('load'));\n }\n // Force reload\n // @ts-ignore\n map._update();\n return that;\n }\n /* eslint-disable complexity,max-statements */\n _initialize(container) {\n const { props } = this;\n const { mapStyle = DEFAULT_STYLE } = props;\n const mapOptions = {\n ...props,\n ...props.initialViewState,\n container,\n style: normalizeStyle(mapStyle)\n };\n const viewState = mapOptions.initialViewState || mapOptions.viewState || mapOptions;\n Object.assign(mapOptions, {\n center: [viewState.longitude || 0, viewState.latitude || 0],\n zoom: viewState.zoom || 0,\n pitch: viewState.pitch || 0,\n bearing: viewState.bearing || 0\n });\n if (props.gl) {\n // eslint-disable-next-line\n const getContext = HTMLCanvasElement.prototype.getContext;\n // Hijack canvas.getContext to return our own WebGLContext\n // This will be called inside the mapboxgl.Map constructor\n // @ts-expect-error\n HTMLCanvasElement.prototype.getContext = () => {\n // Unhijack immediately\n HTMLCanvasElement.prototype.getContext = getContext;\n return props.gl;\n };\n }\n const map = new this._MapClass(mapOptions);\n // Props that are not part of constructor options\n if (viewState.padding) {\n map.setPadding(viewState.padding);\n }\n if (props.cursor) {\n map.getCanvas().style.cursor = props.cursor;\n }\n // add listeners\n map.transformCameraUpdate = this._onCameraUpdate;\n map.on('style.load', () => {\n // Map style has changed, this would have wiped out all settings from props\n this._styleComponents = {\n light: map.getLight(),\n sky: map.getSky(),\n // @ts-ignore getProjection() does not exist in v4\n projection: map.getProjection?.(),\n terrain: map.getTerrain()\n };\n this._updateStyleComponents(this.props);\n });\n map.on('sourcedata', () => {\n // Some sources have loaded, we may need them to attach terrain\n this._updateStyleComponents(this.props);\n });\n for (const eventName in pointerEvents) {\n map.on(eventName, this._onPointerEvent);\n }\n for (const eventName in cameraEvents) {\n map.on(eventName, this._onCameraEvent);\n }\n for (const eventName in otherEvents) {\n map.on(eventName, this._onEvent);\n }\n this._map = map;\n }\n /* eslint-enable complexity,max-statements */\n recycle() {\n // Clean up unnecessary elements before storing for reuse.\n const container = this.map.getContainer();\n const children = container.querySelector('[mapboxgl-children]');\n children?.remove();\n Maplibre.savedMaps.push(this);\n }\n destroy() {\n this._map.remove();\n }\n // Force redraw the map now. Typically resize() and jumpTo() is reflected in the next\n // render cycle, which is managed by Mapbox's animation loop.\n // This removes the synchronization issue caused by requestAnimationFrame.\n redraw() {\n const map = this._map;\n // map._render will throw error if style does not exist\n // https://github.com/mapbox/mapbox-gl-js/blob/fb9fc316da14e99ff4368f3e4faa3888fb43c513\n // /src/ui/map.js#L1834\n if (map.style) {\n // cancel the scheduled update\n if (map._frame) {\n map._frame.cancel();\n map._frame = null;\n }\n // the order is important - render() may schedule another update\n map._render();\n }\n }\n /* Trigger map resize if size is controlled\n @param {object} nextProps\n @returns {bool} true if size has changed\n */\n _updateSize(nextProps) {\n // Check if size is controlled\n const { viewState } = nextProps;\n if (viewState) {\n const map = this._map;\n if (viewState.width !== map.transform.width || viewState.height !== map.transform.height) {\n map.resize();\n return true;\n }\n }\n return false;\n }\n // Adapted from map.jumpTo\n /* Update camera to match props\n @param {object} nextProps\n @param {bool} triggerEvents - should fire camera events\n @returns {bool} true if anything is changed\n */\n _updateViewState(nextProps) {\n const map = this._map;\n const tr = map.transform;\n const isMoving = map.isMoving();\n // Avoid manipulating the real transform when interaction/animation is ongoing\n // as it would interfere with Mapbox's handlers\n if (!isMoving) {\n const changes = applyViewStateToTransform(tr, nextProps);\n if (Object.keys(changes).length > 0) {\n this._internalUpdate = true;\n map.jumpTo(changes);\n this._internalUpdate = false;\n return true;\n }\n }\n return false;\n }\n /* Update camera constraints and projection settings to match props\n @param {object} nextProps\n @param {object} currProps\n @returns {bool} true if anything is changed\n */\n _updateSettings(nextProps, currProps) {\n const map = this._map;\n let changed = false;\n for (const propName of settingNames) {\n if (propName in nextProps && !deepEqual(nextProps[propName], currProps[propName])) {\n changed = true;\n const setter = map[`set${propName[0].toUpperCase()}${propName.slice(1)}`];\n setter?.call(map, nextProps[propName]);\n }\n }\n return changed;\n }\n /* Update map style to match props */\n _updateStyle(nextProps, currProps) {\n if (nextProps.cursor !== currProps.cursor) {\n this._map.getCanvas().style.cursor = nextProps.cursor || '';\n }\n if (nextProps.mapStyle !== currProps.mapStyle) {\n const { mapStyle = DEFAULT_STYLE, styleDiffing = true } = nextProps;\n const options = {\n diff: styleDiffing\n };\n if ('localIdeographFontFamily' in nextProps) {\n // @ts-ignore Mapbox specific prop\n options.localIdeographFontFamily = nextProps.localIdeographFontFamily;\n }\n this._map.setStyle(normalizeStyle(mapStyle), options);\n }\n }\n /* Update fog, light, projection and terrain to match props\n * These props are special because\n * 1. They can not be applied right away. Certain conditions (style loaded, source loaded, etc.) must be met\n * 2. They can be overwritten by mapStyle\n */\n _updateStyleComponents({ light, projection, sky, terrain }) {\n const map = this._map;\n const currProps = this._styleComponents;\n // We can safely manipulate map style once it's loaded\n if (map.style._loaded) {\n if (light && !deepEqual(light, currProps.light)) {\n currProps.light = light;\n map.setLight(light);\n }\n if (projection &&\n !deepEqual(projection, currProps.projection) &&\n projection !== currProps.projection?.type) {\n currProps.projection = typeof projection === 'string' ? { type: projection } : projection;\n // @ts-ignore setProjection does not exist in v4\n map.setProjection?.(currProps.projection);\n }\n if (sky && !deepEqual(sky, currProps.sky)) {\n currProps.sky = sky;\n map.setSky(sky);\n }\n if (terrain !== undefined && !deepEqual(terrain, currProps.terrain)) {\n if (!terrain || map.getSource(terrain.source)) {\n currProps.terrain = terrain;\n map.setTerrain(terrain);\n }\n }\n }\n }\n /* Update interaction handlers to match props */\n _updateHandlers(nextProps, currProps) {\n const map = this._map;\n for (const propName of handlerNames) {\n const newValue = nextProps[propName] ?? true;\n const oldValue = currProps[propName] ?? true;\n if (!deepEqual(newValue, oldValue)) {\n if (newValue) {\n map[propName].enable(newValue);\n }\n else {\n map[propName].disable();\n }\n }\n }\n }\n _queryRenderedFeatures(point) {\n const map = this._map;\n const { interactiveLayerIds = [] } = this.props;\n try {\n return map.queryRenderedFeatures(point, {\n layers: interactiveLayerIds.filter(map.getLayer.bind(map))\n });\n }\n catch {\n // May fail if style is not loaded\n return [];\n }\n }\n _updateHover(e) {\n const { props } = this;\n const shouldTrackHoveredFeatures = props.interactiveLayerIds && (props.onMouseMove || props.onMouseEnter || props.onMouseLeave);\n if (shouldTrackHoveredFeatures) {\n const eventType = e.type;\n const wasHovering = this._hoveredFeatures?.length > 0;\n const features = this._queryRenderedFeatures(e.point);\n const isHovering = features.length > 0;\n if (!isHovering && wasHovering) {\n e.type = 'mouseleave';\n this._onPointerEvent(e);\n }\n this._hoveredFeatures = features;\n if (isHovering && !wasHovering) {\n e.type = 'mouseenter';\n this._onPointerEvent(e);\n }\n e.type = eventType;\n }\n else {\n this._hoveredFeatures = null;\n }\n }\n}\nMaplibre.savedMaps = [];\nexport default Maplibre;\n//# sourceMappingURL=maplibre.js.map"],"names":[],"mappings":";;;;AAGA,MAAM,aAAa,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;AAC7D,MAAM,aAAa,GAAG;AACtB,IAAI,SAAS,EAAE,aAAa;AAC5B,IAAI,OAAO,EAAE,WAAW;AACxB,IAAI,SAAS,EAAE,aAAa;AAC5B,IAAI,SAAS,EAAE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C,CAAC;AACvC;AACA,YAAY,CAAC,CAAC,IAAI,GAAG,SAAS;AAC9B;AACA,aAAa;AACb,YAAY,IAAI,CAAC,gBAAgB,GAAG,IAAI;AACxC;AACA;AACA;AACA,QAAQ,CAAC,SAAS,GAAG,EAAE;;;;","x_google_ignoreList":[0]}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
// This is a simplified version of
|
2
|
+
// https://github.com/facebook/react/blob/4131af3e4bf52f3a003537ec95a1655147c81270/src/renderers/dom/shared/CSSPropertyOperations.js#L62
|
3
|
+
const unitlessNumber = /box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;
|
4
|
+
function applyReactStyle(element, styles) {
|
5
|
+
if (!element || !styles) {
|
6
|
+
return;
|
7
|
+
}
|
8
|
+
const style = element.style;
|
9
|
+
for (const key in styles) {
|
10
|
+
const value = styles[key];
|
11
|
+
if (Number.isFinite(value) && !unitlessNumber.test(key)) {
|
12
|
+
style[key] = `${value}px`;
|
13
|
+
}
|
14
|
+
else {
|
15
|
+
style[key] = value;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
export { applyReactStyle };
|
21
|
+
//# sourceMappingURL=apply-react-style.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"apply-react-style.js","sources":["../../../../../../../../node_modules/@vis.gl/react-maplibre/dist/utils/apply-react-style.js"],"sourcesContent":["// 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/;\nexport function applyReactStyle(element, styles) {\n if (!element || !styles) {\n return;\n }\n const style = element.style;\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 }\n else {\n style[key] = value;\n }\n }\n}\n//# sourceMappingURL=apply-react-style.js.map"],"names":[],"mappings":"AAAA;AACA;AACA,MAAM,cAAc,GAAG,yEAAyE;AACzF,SAAS,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE;AACjD,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM,EAAE;AAC7B,QAAQ;AACR;AACA,IAAI,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;AAC/B,IAAI,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;AAC9B,QAAQ,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC;AACjC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;AACjE,YAAY,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;AACrC;AACA,aAAa;AACb,YAAY,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK;AAC9B;AACA;AACA;;;;","x_google_ignoreList":[0]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"assert.js","sources":["../../../../../../../../node_modules/@vis.gl/react-maplibre/dist/utils/assert.js"],"sourcesContent":["export default function assert(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\n//# sourceMappingURL=assert.js.map"],"names":[],"mappings":"AAAe,SAAS,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE;AACnD,IAAI,IAAI,CAAC,SAAS,EAAE;AACpB,QAAQ,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC;AAChC;AACA;;;;","x_google_ignoreList":[0]}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
/** Compare two classNames string and return the difference */
|
2
|
+
function compareClassNames(prevClassName, nextClassName) {
|
3
|
+
if (prevClassName === nextClassName) {
|
4
|
+
return null;
|
5
|
+
}
|
6
|
+
const prevClassList = getClassList(prevClassName);
|
7
|
+
const nextClassList = getClassList(nextClassName);
|
8
|
+
const diff = [];
|
9
|
+
for (const c of nextClassList) {
|
10
|
+
if (!prevClassList.has(c)) {
|
11
|
+
diff.push(c);
|
12
|
+
}
|
13
|
+
}
|
14
|
+
for (const c of prevClassList) {
|
15
|
+
if (!nextClassList.has(c)) {
|
16
|
+
diff.push(c);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
return diff.length === 0 ? null : diff;
|
20
|
+
}
|
21
|
+
function getClassList(className) {
|
22
|
+
return new Set(className ? className.trim().split(/\s+/) : []);
|
23
|
+
}
|
24
|
+
|
25
|
+
export { compareClassNames };
|
26
|
+
//# sourceMappingURL=compare-class-names.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"compare-class-names.js","sources":["../../../../../../../../node_modules/@vis.gl/react-maplibre/dist/utils/compare-class-names.js"],"sourcesContent":["/** Compare two classNames string and return the difference */\nexport function compareClassNames(prevClassName, nextClassName) {\n if (prevClassName === nextClassName) {\n return null;\n }\n const prevClassList = getClassList(prevClassName);\n const nextClassList = getClassList(nextClassName);\n const diff = [];\n for (const c of nextClassList) {\n if (!prevClassList.has(c)) {\n diff.push(c);\n }\n }\n for (const c of prevClassList) {\n if (!nextClassList.has(c)) {\n diff.push(c);\n }\n }\n return diff.length === 0 ? null : diff;\n}\nfunction getClassList(className) {\n return new Set(className ? className.trim().split(/\\s+/) : []);\n}\n//# sourceMappingURL=compare-class-names.js.map"],"names":[],"mappings":"AAAA;AACO,SAAS,iBAAiB,CAAC,aAAa,EAAE,aAAa,EAAE;AAChE,IAAI,IAAI,aAAa,KAAK,aAAa,EAAE;AACzC,QAAQ,OAAO,IAAI;AACnB;AACA,IAAI,MAAM,aAAa,GAAG,YAAY,CAAC,aAAa,CAAC;AACrD,IAAI,MAAM,aAAa,GAAG,YAAY,CAAC,aAAa,CAAC;AACrD,IAAI,MAAM,IAAI,GAAG,EAAE;AACnB,IAAI,KAAK,MAAM,CAAC,IAAI,aAAa,EAAE;AACnC,QAAQ,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;AACnC,YAAY,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACxB;AACA;AACA,IAAI,KAAK,MAAM,CAAC,IAAI,aAAa,EAAE;AACnC,QAAQ,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;AACnC,YAAY,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACxB;AACA;AACA,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,GAAG,IAAI,GAAG,IAAI;AAC1C;AACA,SAAS,YAAY,CAAC,SAAS,EAAE;AACjC,IAAI,OAAO,IAAI,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAClE;;;;","x_google_ignoreList":[0]}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
/**
|
2
|
+
* Compare two points
|
3
|
+
* @param a
|
4
|
+
* @param b
|
5
|
+
* @returns true if the points are equal
|
6
|
+
*/
|
7
|
+
function arePointsEqual(a, b) {
|
8
|
+
const ax = Array.isArray(a) ? a[0] : a ? a.x : 0;
|
9
|
+
const ay = Array.isArray(a) ? a[1] : a ? a.y : 0;
|
10
|
+
const bx = Array.isArray(b) ? b[0] : b ? b.x : 0;
|
11
|
+
const by = Array.isArray(b) ? b[1] : b ? b.y : 0;
|
12
|
+
return ax === bx && ay === by;
|
13
|
+
}
|
14
|
+
/* eslint-disable complexity */
|
15
|
+
/**
|
16
|
+
* Compare any two objects
|
17
|
+
* @param a
|
18
|
+
* @param b
|
19
|
+
* @returns true if the objects are deep equal
|
20
|
+
*/
|
21
|
+
function deepEqual(a, b) {
|
22
|
+
if (a === b) {
|
23
|
+
return true;
|
24
|
+
}
|
25
|
+
if (!a || !b) {
|
26
|
+
return false;
|
27
|
+
}
|
28
|
+
if (Array.isArray(a)) {
|
29
|
+
if (!Array.isArray(b) || a.length !== b.length) {
|
30
|
+
return false;
|
31
|
+
}
|
32
|
+
for (let i = 0; i < a.length; i++) {
|
33
|
+
if (!deepEqual(a[i], b[i])) {
|
34
|
+
return false;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
return true;
|
38
|
+
}
|
39
|
+
else if (Array.isArray(b)) {
|
40
|
+
return false;
|
41
|
+
}
|
42
|
+
if (typeof a === 'object' && typeof b === 'object') {
|
43
|
+
const aKeys = Object.keys(a);
|
44
|
+
const bKeys = Object.keys(b);
|
45
|
+
if (aKeys.length !== bKeys.length) {
|
46
|
+
return false;
|
47
|
+
}
|
48
|
+
for (const key of aKeys) {
|
49
|
+
if (!b.hasOwnProperty(key)) {
|
50
|
+
return false;
|
51
|
+
}
|
52
|
+
if (!deepEqual(a[key], b[key])) {
|
53
|
+
return false;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
return true;
|
57
|
+
}
|
58
|
+
return false;
|
59
|
+
}
|
60
|
+
|
61
|
+
export { arePointsEqual, deepEqual };
|
62
|
+
//# sourceMappingURL=deep-equal.js.map
|