mobility-toolbox-js 1.6.4 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/routing/RoutingAPI.test.js +1 -2
- package/api/trajserv/TrajservAPI.js +2 -6
- package/api/trajserv/TrajservAPI.test.js +5 -10
- package/api/tralis/TralisAPI.js +20 -29
- package/api/tralis/WebSocketConnector.js +21 -25
- package/common/Tracker.js +1 -3
- package/common/api/api.js +17 -16
- package/common/controls/Control.js +2 -6
- package/common/layers/Layer.js +4 -10
- package/common/layers/Layer.test.js +12 -16
- package/common/mixins/TrackerLayerMixin.js +31 -22
- package/common/mixins/TrajservLayerMixin.js +1 -3
- package/common/mixins/TralisLayerMixin.js +3 -4
- package/common/trackerConfig.js +4 -23
- package/common/utils/removeDuplicate.js +3 -3
- package/common/utils/simpleTrackerStyle.js +1 -3
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/ol/controls/CopyrightControl.test.js +2 -3
- package/ol/controls/RoutingControl.js +4 -12
- package/ol/layers/MapboxLayer.test.js +8 -15
- package/ol/layers/MapboxStyleLayer.js +12 -16
- package/ol/layers/MapboxStyleLayer.test.js +33 -51
- package/ol/layers/TrackerLayer.js +6 -10
- package/ol/layers/TrajservLayer.js +1 -3
- package/ol/layers/TralisLayer.test.js +43 -0
- package/package.json +60 -68
|
@@ -29,13 +29,12 @@ const getOLTileLayer = () => {
|
|
|
29
29
|
return layer;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
const getLayer = (copyrights, visible = true) =>
|
|
33
|
-
|
|
32
|
+
const getLayer = (copyrights, visible = true) =>
|
|
33
|
+
new Layer({
|
|
34
34
|
visible,
|
|
35
35
|
copyrights,
|
|
36
36
|
olLayer: getOLTileLayer(),
|
|
37
37
|
});
|
|
38
|
-
};
|
|
39
38
|
|
|
40
39
|
describe('CopyrightControl', () => {
|
|
41
40
|
let map;
|
|
@@ -51,9 +51,7 @@ class RoutingControl extends Control {
|
|
|
51
51
|
|
|
52
52
|
Object.defineProperties(this, {
|
|
53
53
|
mot: {
|
|
54
|
-
get: () =>
|
|
55
|
-
return this.get('mot');
|
|
56
|
-
},
|
|
54
|
+
get: () => this.get('mot'),
|
|
57
55
|
set: (newMot) => {
|
|
58
56
|
if (newMot) {
|
|
59
57
|
this.set('mot', newMot);
|
|
@@ -64,17 +62,13 @@ class RoutingControl extends Control {
|
|
|
64
62
|
},
|
|
65
63
|
},
|
|
66
64
|
loading: {
|
|
67
|
-
get: () =>
|
|
68
|
-
return this.get('loading');
|
|
69
|
-
},
|
|
65
|
+
get: () => this.get('loading'),
|
|
70
66
|
set: (newLoading) => {
|
|
71
67
|
this.set('loading', newLoading);
|
|
72
68
|
},
|
|
73
69
|
},
|
|
74
70
|
modify: {
|
|
75
|
-
get: () =>
|
|
76
|
-
return this.get('modify');
|
|
77
|
-
},
|
|
71
|
+
get: () => this.get('modify'),
|
|
78
72
|
set: (modify) => {
|
|
79
73
|
this.set('modify', modify);
|
|
80
74
|
},
|
|
@@ -267,9 +261,7 @@ class RoutingControl extends Control {
|
|
|
267
261
|
this.routingLayer.olLayer.getSource().clear();
|
|
268
262
|
|
|
269
263
|
// Create point features for the viaPoints
|
|
270
|
-
this.viaPoints.forEach((viaPoint, idx) =>
|
|
271
|
-
return this.drawViaPoint(viaPoint, idx);
|
|
272
|
-
});
|
|
264
|
+
this.viaPoints.forEach((viaPoint, idx) => this.drawViaPoint(viaPoint, idx));
|
|
273
265
|
|
|
274
266
|
return Promise.all(
|
|
275
267
|
this.graphs.map(([graph], index) => {
|
|
@@ -112,12 +112,8 @@ describe('MapboxLayer', () => {
|
|
|
112
112
|
apiKeyName: 'apiKey',
|
|
113
113
|
});
|
|
114
114
|
layer1.init(map);
|
|
115
|
-
layer1.mbMap.isStyleLoaded = jest.fn(() =>
|
|
116
|
-
|
|
117
|
-
});
|
|
118
|
-
layer1.mbMap.getSource = jest.fn(() => {
|
|
119
|
-
return true;
|
|
120
|
-
});
|
|
115
|
+
layer1.mbMap.isStyleLoaded = jest.fn(() => true);
|
|
116
|
+
layer1.mbMap.getSource = jest.fn(() => true);
|
|
121
117
|
});
|
|
122
118
|
|
|
123
119
|
afterEach(() => {
|
|
@@ -135,12 +131,8 @@ describe('MapboxLayer', () => {
|
|
|
135
131
|
source: 'barr',
|
|
136
132
|
sourceLayer: 'fooo',
|
|
137
133
|
};
|
|
138
|
-
layer1.mbMap.project = jest.fn((coord) => {
|
|
139
|
-
|
|
140
|
-
});
|
|
141
|
-
layer1.mbMap.queryRenderedFeatures = jest.fn(() => {
|
|
142
|
-
return [mapboxFeature];
|
|
143
|
-
});
|
|
134
|
+
layer1.mbMap.project = jest.fn((coord) => ({ x: coord[0], y: coord[1] }));
|
|
135
|
+
layer1.mbMap.queryRenderedFeatures = jest.fn(() => [mapboxFeature]);
|
|
144
136
|
layer1.getFeatureInfoAtCoordinate([0, 0], {}).then((featureInfo) => {
|
|
145
137
|
expect(featureInfo.features[0].get('mapboxFeature')).toBe(
|
|
146
138
|
mapboxFeature,
|
|
@@ -152,9 +144,10 @@ describe('MapboxLayer', () => {
|
|
|
152
144
|
});
|
|
153
145
|
describe('should use hitTolerance property', () => {
|
|
154
146
|
beforeEach(() => {
|
|
155
|
-
layer1.mbMap.project = jest.fn((coord) => {
|
|
156
|
-
|
|
157
|
-
|
|
147
|
+
layer1.mbMap.project = jest.fn((coord) => ({
|
|
148
|
+
x: coord[0],
|
|
149
|
+
y: coord[1],
|
|
150
|
+
}));
|
|
158
151
|
});
|
|
159
152
|
|
|
160
153
|
afterEach(() => {
|
|
@@ -110,9 +110,7 @@ class MapboxStyleLayer extends Layer {
|
|
|
110
110
|
|
|
111
111
|
if (!this.styleLayersFilter && this.styleLayers) {
|
|
112
112
|
const ids = this.styleLayers.map((s) => s.id);
|
|
113
|
-
this.styleLayersFilter = (styleLayer) =>
|
|
114
|
-
return ids.includes(styleLayer.id);
|
|
115
|
-
};
|
|
113
|
+
this.styleLayersFilter = (styleLayer) => ids.includes(styleLayer.id);
|
|
116
114
|
}
|
|
117
115
|
}
|
|
118
116
|
|
|
@@ -265,12 +263,9 @@ class MapboxStyleLayer extends Layer {
|
|
|
265
263
|
validate: false,
|
|
266
264
|
})
|
|
267
265
|
.then((featureInfo) => {
|
|
268
|
-
const features = featureInfo.features.filter((feature) =>
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
this.map.getView().getResolution(),
|
|
272
|
-
);
|
|
273
|
-
});
|
|
266
|
+
const features = featureInfo.features.filter((feature) =>
|
|
267
|
+
this.featureInfoFilter(feature, this.map.getView().getResolution()),
|
|
268
|
+
);
|
|
274
269
|
this.highlight(features);
|
|
275
270
|
return { ...featureInfo, features, layer: this };
|
|
276
271
|
});
|
|
@@ -300,10 +295,10 @@ class MapboxStyleLayer extends Layer {
|
|
|
300
295
|
* @param {boolean} state Is the feature hovered
|
|
301
296
|
* @private
|
|
302
297
|
*/
|
|
303
|
-
setHoverState(features
|
|
298
|
+
setHoverState(features, state) {
|
|
304
299
|
const { mbMap } = this.mapboxLayer;
|
|
305
300
|
|
|
306
|
-
if (!mbMap) {
|
|
301
|
+
if (!features || !mbMap) {
|
|
307
302
|
return;
|
|
308
303
|
}
|
|
309
304
|
|
|
@@ -350,11 +345,12 @@ class MapboxStyleLayer extends Layer {
|
|
|
350
345
|
*/
|
|
351
346
|
highlight(features = []) {
|
|
352
347
|
// Filter out selected features
|
|
353
|
-
const filtered = this.highlightedFeatures.filter(
|
|
354
|
-
|
|
355
|
-
.
|
|
356
|
-
|
|
357
|
-
|
|
348
|
+
const filtered = this.highlightedFeatures.filter(
|
|
349
|
+
(feature) =>
|
|
350
|
+
!this.selectedFeatures
|
|
351
|
+
.map((feat) => feat.getId())
|
|
352
|
+
.includes(feature.getId()),
|
|
353
|
+
);
|
|
358
354
|
|
|
359
355
|
// Remove previous highlight
|
|
360
356
|
this.setHoverState(filtered, false);
|
|
@@ -110,12 +110,8 @@ describe('MapboxStyleLayer', () => {
|
|
|
110
110
|
describe('#getFeatureInfoAtCoordinate()', () => {
|
|
111
111
|
beforeEach(() => {
|
|
112
112
|
source.init(map);
|
|
113
|
-
source.mbMap.isStyleLoaded = jest.fn(() =>
|
|
114
|
-
|
|
115
|
-
});
|
|
116
|
-
source.mbMap.getSource = jest.fn(() => {
|
|
117
|
-
return true;
|
|
118
|
-
});
|
|
113
|
+
source.mbMap.isStyleLoaded = jest.fn(() => true);
|
|
114
|
+
source.mbMap.getSource = jest.fn(() => true);
|
|
119
115
|
});
|
|
120
116
|
afterEach(() => {
|
|
121
117
|
source.mbMap.getSource.mockRestore();
|
|
@@ -123,45 +119,37 @@ describe('MapboxStyleLayer', () => {
|
|
|
123
119
|
});
|
|
124
120
|
|
|
125
121
|
test('should request features on layers ids from styleLayers property', () => {
|
|
126
|
-
source.mbMap.getStyle = jest.fn(() => {
|
|
127
|
-
|
|
128
|
-
});
|
|
122
|
+
source.mbMap.getStyle = jest.fn(() => ({
|
|
123
|
+
layers: [{ id: 'foo' }, { id: 'layer' }, { id: 'bar' }],
|
|
124
|
+
}));
|
|
129
125
|
layer.init(map);
|
|
130
|
-
layer.mapboxLayer.getFeatureInfoAtCoordinate = jest.fn(() =>
|
|
131
|
-
|
|
132
|
-
|
|
126
|
+
layer.mapboxLayer.getFeatureInfoAtCoordinate = jest.fn(() =>
|
|
127
|
+
Promise.resolve({ features: [] }),
|
|
128
|
+
);
|
|
133
129
|
layer.getFeatureInfoAtCoordinate([0, 0]).then(() => {});
|
|
134
|
-
expect(
|
|
135
|
-
|
|
136
|
-
|
|
130
|
+
expect(layer.mapboxLayer.getFeatureInfoAtCoordinate).toHaveBeenCalledWith(
|
|
131
|
+
[0, 0],
|
|
132
|
+
{ layers: ['layer'], validate: false },
|
|
133
|
+
);
|
|
137
134
|
layer.mapboxLayer.getFeatureInfoAtCoordinate.mockRestore();
|
|
138
135
|
source.mbMap.getStyle.mockRestore();
|
|
139
136
|
});
|
|
140
137
|
|
|
141
138
|
test('should request features on layers ids from styleLayersFilter property', () => {
|
|
142
|
-
source.mbMap.getStyle = jest.fn(() => {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
{ id: 'foo' },
|
|
146
|
-
{ id: 'layer' },
|
|
147
|
-
{ id: 'bar' },
|
|
148
|
-
{ id: 'foo2' },
|
|
149
|
-
],
|
|
150
|
-
};
|
|
151
|
-
});
|
|
139
|
+
source.mbMap.getStyle = jest.fn(() => ({
|
|
140
|
+
layers: [{ id: 'foo' }, { id: 'layer' }, { id: 'bar' }, { id: 'foo2' }],
|
|
141
|
+
}));
|
|
152
142
|
const layer2 = new MapboxStyleLayer({
|
|
153
143
|
name: 'mapbox layer',
|
|
154
144
|
visible: true,
|
|
155
145
|
mapboxLayer: source,
|
|
156
146
|
styleLayer,
|
|
157
|
-
styleLayersFilter: ({ id }) =>
|
|
158
|
-
return /foo/.test(id);
|
|
159
|
-
},
|
|
147
|
+
styleLayersFilter: ({ id }) => /foo/.test(id),
|
|
160
148
|
});
|
|
161
149
|
layer2.init(map);
|
|
162
|
-
layer2.mapboxLayer.getFeatureInfoAtCoordinate = jest.fn(() =>
|
|
163
|
-
|
|
164
|
-
|
|
150
|
+
layer2.mapboxLayer.getFeatureInfoAtCoordinate = jest.fn(() =>
|
|
151
|
+
Promise.resolve({ features: [] }),
|
|
152
|
+
);
|
|
165
153
|
layer2.getFeatureInfoAtCoordinate([0, 0]).then(() => {});
|
|
166
154
|
expect(
|
|
167
155
|
layer2.mapboxLayer.getFeatureInfoAtCoordinate,
|
|
@@ -174,33 +162,27 @@ describe('MapboxStyleLayer', () => {
|
|
|
174
162
|
});
|
|
175
163
|
|
|
176
164
|
test('should request features on layers ids from queryRenderedLayersFilter property', () => {
|
|
177
|
-
source.mbMap.getStyle = jest.fn(() => {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
};
|
|
187
|
-
});
|
|
165
|
+
source.mbMap.getStyle = jest.fn(() => ({
|
|
166
|
+
layers: [
|
|
167
|
+
{ id: 'foo' },
|
|
168
|
+
{ id: 'bar2' },
|
|
169
|
+
{ id: 'layer' },
|
|
170
|
+
{ id: 'bar' },
|
|
171
|
+
{ id: 'foo2' },
|
|
172
|
+
],
|
|
173
|
+
}));
|
|
188
174
|
const layer2 = new MapboxStyleLayer({
|
|
189
175
|
name: 'mapbox layer',
|
|
190
176
|
visible: true,
|
|
191
177
|
mapboxLayer: source,
|
|
192
178
|
styleLayer,
|
|
193
|
-
styleLayersFilter: ({ id }) =>
|
|
194
|
-
|
|
195
|
-
},
|
|
196
|
-
queryRenderedLayersFilter: ({ id }) => {
|
|
197
|
-
return /bar/.test(id);
|
|
198
|
-
},
|
|
179
|
+
styleLayersFilter: ({ id }) => /foo/.test(id),
|
|
180
|
+
queryRenderedLayersFilter: ({ id }) => /bar/.test(id),
|
|
199
181
|
});
|
|
200
182
|
layer2.init(map);
|
|
201
|
-
layer2.mapboxLayer.getFeatureInfoAtCoordinate = jest.fn(() =>
|
|
202
|
-
|
|
203
|
-
|
|
183
|
+
layer2.mapboxLayer.getFeatureInfoAtCoordinate = jest.fn(() =>
|
|
184
|
+
Promise.resolve({ features: [] }),
|
|
185
|
+
);
|
|
204
186
|
layer2.getFeatureInfoAtCoordinate([0, 0]).then(() => {});
|
|
205
187
|
expect(
|
|
206
188
|
layer2.mapboxLayer.getFeatureInfoAtCoordinate,
|
|
@@ -35,14 +35,11 @@ class TrackerLayer extends mixin(Layer) {
|
|
|
35
35
|
*/
|
|
36
36
|
this.renderWhenInteracting =
|
|
37
37
|
options.renderWhenInteracting ||
|
|
38
|
-
(() =>
|
|
38
|
+
(() =>
|
|
39
39
|
// Render trajectories on each render frame when the number of trajectories is small.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
this.tracker.renderedTrajectories.length <= 200
|
|
44
|
-
);
|
|
45
|
-
});
|
|
40
|
+
this.tracker &&
|
|
41
|
+
this.tracker.renderedTrajectories &&
|
|
42
|
+
this.tracker.renderedTrajectories.length <= 200);
|
|
46
43
|
|
|
47
44
|
/** @ignore */
|
|
48
45
|
this.olLayer =
|
|
@@ -95,9 +92,8 @@ class TrackerLayer extends mixin(Layer) {
|
|
|
95
92
|
// Avoid having really big points when zooming fast.
|
|
96
93
|
this.tracker.clear();
|
|
97
94
|
} else {
|
|
98
|
-
const pixelCenterRendered =
|
|
99
|
-
renderedCenter
|
|
100
|
-
);
|
|
95
|
+
const pixelCenterRendered =
|
|
96
|
+
this.map.getPixelFromCoordinate(renderedCenter);
|
|
101
97
|
const pixelCenter = this.map.getPixelFromCoordinate(center);
|
|
102
98
|
this.transformContainer.style.transform = composeCssTransform(
|
|
103
99
|
pixelCenterRendered[0] - pixelCenter[0],
|
|
@@ -103,9 +103,7 @@ class TrajservLayer extends mixin(TrackerLayer) {
|
|
|
103
103
|
// Add station points
|
|
104
104
|
if (stationsCoords) {
|
|
105
105
|
const geometry = new MultiPoint(
|
|
106
|
-
stationsCoords.map((coords) =>
|
|
107
|
-
return fromLonLat(coords);
|
|
108
|
-
}),
|
|
106
|
+
stationsCoords.map((coords) => fromLonLat(coords)),
|
|
109
107
|
);
|
|
110
108
|
const aboveStationsFeature = new Feature(geometry);
|
|
111
109
|
aboveStationsFeature.setStyle(
|
|
@@ -60,4 +60,47 @@ describe('TrajservLayer', () => {
|
|
|
60
60
|
expect(clone.name).toBe('clone');
|
|
61
61
|
expect(clone).toBeInstanceOf(TralisLayer);
|
|
62
62
|
});
|
|
63
|
+
|
|
64
|
+
test('should set a default sort function if useDelayStyle is used.', () => {
|
|
65
|
+
const laye = new TralisLayer({
|
|
66
|
+
url: 'ws://localhost:1234',
|
|
67
|
+
apiKey: 'apiKey',
|
|
68
|
+
useDelayStyle: true,
|
|
69
|
+
});
|
|
70
|
+
expect(laye).toBeInstanceOf(TralisLayer);
|
|
71
|
+
expect(laye.useDelayStyle).toBe(true);
|
|
72
|
+
expect(laye.sort).toBeDefined();
|
|
73
|
+
const red = { delay: 1000000 };
|
|
74
|
+
const yellow = { delay: 180000 };
|
|
75
|
+
const green2 = { delay: 178990 };
|
|
76
|
+
const green = { delay: 0 };
|
|
77
|
+
const gray = { delay: null };
|
|
78
|
+
const cancelled = { cancelled: true, delay: 3000000 };
|
|
79
|
+
|
|
80
|
+
const trajectories = [gray, green, yellow, red, green2, cancelled];
|
|
81
|
+
trajectories.sort(laye.sort);
|
|
82
|
+
expect(trajectories).toEqual([red, yellow, cancelled, green2, green, gray]);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test('should override the defaulrt sort function when useDelayStyle is used.', () => {
|
|
86
|
+
const laye = new TralisLayer({
|
|
87
|
+
url: 'ws://localhost:1234',
|
|
88
|
+
apiKey: 'apiKey',
|
|
89
|
+
useDelayStyle: true,
|
|
90
|
+
sort: () => -1, // reverse the array
|
|
91
|
+
});
|
|
92
|
+
expect(laye).toBeInstanceOf(TralisLayer);
|
|
93
|
+
expect(laye.useDelayStyle).toBe(true);
|
|
94
|
+
expect(laye.sort).toBeDefined();
|
|
95
|
+
const red = { delay: 1000000 };
|
|
96
|
+
const yellow = { delay: 180000 };
|
|
97
|
+
const green2 = { delay: 178990 };
|
|
98
|
+
const green = { delay: 0 };
|
|
99
|
+
const gray = { delay: null };
|
|
100
|
+
const cancelled = { cancelled: true, delay: 3000000 };
|
|
101
|
+
|
|
102
|
+
const trajectories = [gray, green, yellow, red, green2, cancelled];
|
|
103
|
+
trajectories.sort(laye.sort);
|
|
104
|
+
expect(trajectories).toEqual([cancelled, green2, red, yellow, green, gray]);
|
|
105
|
+
});
|
|
63
106
|
});
|
package/package.json
CHANGED
|
@@ -2,91 +2,91 @@
|
|
|
2
2
|
"name": "mobility-toolbox-js",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"description": "Toolbox for JavaScript applications in the domains of mobility and logistics.",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.7.0",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"module": "module.js",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@geops/geops-ui": "0.1.
|
|
10
|
-
"@material-ui/core": "
|
|
11
|
-
"@material-ui/icons": "
|
|
12
|
-
"@material-ui/styles": "
|
|
9
|
+
"@geops/geops-ui": "0.1.13",
|
|
10
|
+
"@material-ui/core": "4.12.3",
|
|
11
|
+
"@material-ui/icons": "4.11.2",
|
|
12
|
+
"@material-ui/styles": "4.11.4",
|
|
13
13
|
"@turf/helpers": "^6.5.0",
|
|
14
14
|
"@turf/transform-rotate": "^6.5.0",
|
|
15
|
-
"codesandbox": "
|
|
16
|
-
"es6-mixin": "^0.3.0",
|
|
15
|
+
"codesandbox": "2.2.3",
|
|
17
16
|
"path": "^0.12.7",
|
|
18
|
-
"prop-types": "
|
|
19
|
-
"query-string": "
|
|
20
|
-
"react": "
|
|
17
|
+
"prop-types": "15.8.1",
|
|
18
|
+
"query-string": "7.1.0",
|
|
19
|
+
"react": "17.0.2",
|
|
21
20
|
"react-app-polyfill": "^1.0.6",
|
|
22
|
-
"react-dom": "
|
|
23
|
-
"react-icons": "
|
|
24
|
-
"react-markdown": "
|
|
25
|
-
"react-router": "
|
|
26
|
-
"react-
|
|
27
|
-
"react-
|
|
28
|
-
"react-syntax-highlighter": "^15.4.1",
|
|
21
|
+
"react-dom": "17.0.2",
|
|
22
|
+
"react-icons": "4.3.1",
|
|
23
|
+
"react-markdown": "8.0.0",
|
|
24
|
+
"react-router-dom": "6",
|
|
25
|
+
"react-scrollchor": "7.0.1",
|
|
26
|
+
"react-syntax-highlighter": "15.4.5",
|
|
29
27
|
"taffydb": "^2.7.3",
|
|
30
28
|
"turf": "^3.0.14",
|
|
31
29
|
"typeface-lato": "^0.0.75",
|
|
32
|
-
"uuid": "
|
|
33
|
-
"worker-loader": "2.0.0"
|
|
30
|
+
"uuid": "8.3.2"
|
|
34
31
|
},
|
|
35
32
|
"peerDependencies": {
|
|
36
33
|
"mapbox-gl": "^1",
|
|
37
34
|
"ol": "^6"
|
|
38
35
|
},
|
|
39
36
|
"devDependencies": {
|
|
40
|
-
"@babel/
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"@
|
|
45
|
-
"@neutrinojs/
|
|
46
|
-
"@neutrinojs/
|
|
47
|
-
"@neutrinojs/
|
|
48
|
-
"
|
|
37
|
+
"@babel/core": "7.16.12",
|
|
38
|
+
"@babel/eslint-parser": "7.16.5",
|
|
39
|
+
"@babel/plugin-transform-runtime": "7.16.10",
|
|
40
|
+
"@babel/preset-env": "^7.16.11",
|
|
41
|
+
"@babel/preset-react": "7.16.7",
|
|
42
|
+
"@neutrinojs/copy": "9.5.0",
|
|
43
|
+
"@neutrinojs/jest": "^9.5.0",
|
|
44
|
+
"@neutrinojs/library": "9.5.0",
|
|
45
|
+
"@neutrinojs/react": "9.5.0",
|
|
46
|
+
"autoprefixer": "9.7.6",
|
|
47
|
+
"cypress": "9.4.1",
|
|
49
48
|
"deepmerge": "4.2.2",
|
|
50
49
|
"esdoc": "1.1.0",
|
|
51
50
|
"esdoc-ecmascript-proposal-plugin": "1.0.0",
|
|
52
51
|
"esdoc-publish-html-plugin": "1.1.2",
|
|
53
52
|
"esdoc-standard-plugin": "1.0.0",
|
|
54
|
-
"eslint": "
|
|
55
|
-
"eslint-config-airbnb": "
|
|
56
|
-
"eslint-config-prettier": "
|
|
57
|
-
"eslint-import-resolver-webpack": "0.13.
|
|
58
|
-
"eslint-plugin-cypress": "2.
|
|
59
|
-
"eslint-plugin-import": "2.
|
|
60
|
-
"eslint-plugin-jsx-a11y": "6.
|
|
61
|
-
"eslint-plugin-prettier": "
|
|
62
|
-
"eslint-plugin-react": "7.
|
|
63
|
-
"eslint-plugin-react-hooks": "4.0
|
|
53
|
+
"eslint": "8.8.0",
|
|
54
|
+
"eslint-config-airbnb": "19.0.4",
|
|
55
|
+
"eslint-config-prettier": "8.3.0",
|
|
56
|
+
"eslint-import-resolver-webpack": "0.13.2",
|
|
57
|
+
"eslint-plugin-cypress": "2.12.1",
|
|
58
|
+
"eslint-plugin-import": "2.25.4",
|
|
59
|
+
"eslint-plugin-jsx-a11y": "6.5.1",
|
|
60
|
+
"eslint-plugin-prettier": "4.0.0",
|
|
61
|
+
"eslint-plugin-react": "7.28.0",
|
|
62
|
+
"eslint-plugin-react-hooks": "4.3.0",
|
|
64
63
|
"fixpack": "3.0.6",
|
|
65
|
-
"husky": "
|
|
66
|
-
"jest": "
|
|
67
|
-
"jest-canvas-mock": "2.
|
|
64
|
+
"husky": "7.0.4",
|
|
65
|
+
"jest": "26.6.3",
|
|
66
|
+
"jest-canvas-mock": "2.3.1",
|
|
68
67
|
"jest-fetch-mock": "3.0.3",
|
|
69
|
-
"jest-serializer-html": "7.
|
|
70
|
-
"jest-websocket-mock": "
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"neutrino": "9.1.0",
|
|
68
|
+
"jest-serializer-html": "7.1.0",
|
|
69
|
+
"jest-websocket-mock": "2.3.0",
|
|
70
|
+
"lint-staged": "12.3.3",
|
|
71
|
+
"mapbox-gl": "1.13.2",
|
|
72
|
+
"mock-socket": "9.1.2",
|
|
73
|
+
"neutrino": "9.5.0",
|
|
76
74
|
"node-sass": "4.14.1",
|
|
77
|
-
"ol": "
|
|
75
|
+
"ol": "6.12.0",
|
|
76
|
+
"postcss": "8.3.3",
|
|
78
77
|
"postcss-loader": "3.0.0",
|
|
79
|
-
"prettier": "2.
|
|
78
|
+
"prettier": "2.5.1",
|
|
80
79
|
"sass-loader": "8.0.2",
|
|
81
80
|
"sort-json": "2.0.0",
|
|
82
|
-
"start-server-and-test": "1.
|
|
83
|
-
"stylelint": "
|
|
84
|
-
"stylelint-config-recommended-scss": "
|
|
85
|
-
"stylelint-config-standard": "
|
|
86
|
-
"stylelint-scss": "
|
|
81
|
+
"start-server-and-test": "1.14.0",
|
|
82
|
+
"stylelint": "14.3.0",
|
|
83
|
+
"stylelint-config-recommended-scss": "5.0.2",
|
|
84
|
+
"stylelint-config-standard": "24.0.0",
|
|
85
|
+
"stylelint-scss": "4.1.0",
|
|
87
86
|
"webpack": "4.43.0",
|
|
88
87
|
"webpack-cli": "3.3.11",
|
|
89
|
-
"webpack-dev-server": "3.11.0"
|
|
88
|
+
"webpack-dev-server": "3.11.0",
|
|
89
|
+
"worker-loader": "3.0.8"
|
|
90
90
|
},
|
|
91
91
|
"scripts": {
|
|
92
92
|
"apidoc": "esdoc",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"publish:public": "yarn version && git push origin HEAD && yarn build && cd build && yarn publish",
|
|
107
107
|
"start": "yarn doc && webpack-dev-server --mode development --open",
|
|
108
108
|
"start:examples": "webpack-dev-server --mode development --open",
|
|
109
|
-
"test": "REACT_APP_LIB_MODE=1 jest
|
|
109
|
+
"test": "REACT_APP_LIB_MODE=1 jest",
|
|
110
110
|
"test:watch": "yarn test --watchAll"
|
|
111
111
|
},
|
|
112
112
|
"browserslist": {
|
|
@@ -130,18 +130,18 @@
|
|
|
130
130
|
"es6": true,
|
|
131
131
|
"jest": true
|
|
132
132
|
},
|
|
133
|
-
"parser": "babel-
|
|
133
|
+
"parser": "@babel/eslint-parser",
|
|
134
134
|
"extends": [
|
|
135
135
|
"airbnb",
|
|
136
136
|
"airbnb/hooks",
|
|
137
|
-
"prettier"
|
|
138
|
-
"prettier/react"
|
|
137
|
+
"prettier"
|
|
139
138
|
],
|
|
140
139
|
"plugins": [
|
|
141
140
|
"cypress",
|
|
142
141
|
"prettier"
|
|
143
142
|
],
|
|
144
143
|
"rules": {
|
|
144
|
+
"arrow-body-style": 0,
|
|
145
145
|
"react/jsx-filename-extension": [
|
|
146
146
|
1,
|
|
147
147
|
{
|
|
@@ -169,14 +169,6 @@
|
|
|
169
169
|
"./mapbox": "./mapbox/index.js",
|
|
170
170
|
"./ol": "./ol/index.js"
|
|
171
171
|
},
|
|
172
|
-
"husky": {
|
|
173
|
-
"hooks": {
|
|
174
|
-
"post-checkout": "yarn install --frozen-lockfile",
|
|
175
|
-
"post-merge": "yarn install --frozen-lockfile",
|
|
176
|
-
"post-rebase": "yarn install --frozen-lockfile",
|
|
177
|
-
"pre-commit": "CI=true lint-staged "
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
172
|
"keywords": [
|
|
181
173
|
"mobility",
|
|
182
174
|
"toolbox"
|