mobility-toolbox-js 2.0.0-beta.3 → 2.0.0-beta.6
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/.babelrc +6 -0
- package/.esdoc.json +17 -0
- package/.eslintignore +1 -0
- package/.github/workflows/conventional-pr-title.yml +21 -0
- package/.github/workflows/cypress.yml +29 -0
- package/.github/workflows/nodejs.yml +28 -0
- package/.husky/commit-msg +4 -0
- package/.husky/post-checkout +4 -0
- package/.husky/post-merge +4 -0
- package/.husky/post-rebase +4 -0
- package/.husky/pre-commit +4 -0
- package/.neutrinorc.js +176 -0
- package/.nvmrc +1 -0
- package/CHANGELOG.md +10 -0
- package/LICENSE +21 -0
- package/Layer.js +2 -0
- package/Layer.js.map +7 -0
- package/README.md +4 -1
- package/__mocks__/mapbox-gl.js +81 -0
- package/__mocks__/maplibre-gl.js +81 -0
- package/commitlint.config.js +1 -0
- package/cypress/fixtures/example.json +5 -0
- package/cypress/integration/examples/api.spec.js +7 -0
- package/cypress/integration/examples/examples.spec.js +7 -0
- package/cypress/integration/examples/navigation.spec.js +29 -0
- package/cypress/plugins/index.js +21 -0
- package/cypress/support/commands.js +25 -0
- package/cypress/support/index.js +20 -0
- package/cypress.json +4 -0
- package/data/fetchRoute.json +292 -0
- package/data/fetchTrajectories.json +18 -0
- package/data/fetchTrajectoryById.json +3 -0
- package/data/fetchTrajectoryStations.json +18 -0
- package/data/stopsSearch.json +15 -0
- package/documentation.yml +4 -0
- package/esdoc/README.md +27 -0
- package/esdoc/plugins/MyPlugin.js +69 -0
- package/esdoc/plugins/dynamic-property-plugin/Plugin.js +50 -0
- package/esdoc/plugins/externals-plugin/Plugin.js +45 -0
- package/esdoc/plugins/externals-plugin/externals.js +96 -0
- package/global-setup.js +3 -0
- package/{ol/README.md → index.html} +0 -0
- package/indexweb.html +49 -0
- package/jest.config.js +5 -0
- package/package.json +29 -9
- package/pull_request_template.md +17 -0
- package/renovate.json +4 -0
- package/scripts/read-pkg-json.js +22 -0
- package/{api → src/api}/index.js +0 -0
- package/{api → src/api}/routing/RoutingAPI.js +0 -0
- package/{api → src/api}/routing/RoutingAPI.test.js +0 -0
- package/{api → src/api}/stops/StopsAPI.js +0 -0
- package/{api → src/api}/stops/StopsAPI.test.js +0 -0
- package/{api → src/api}/tralis/TralisAPI.js +0 -0
- package/{api → src/api}/tralis/TralisAPI.test.js +0 -0
- package/{api → src/api}/tralis/TralisAPIUtils.js +0 -0
- package/{api → src/api}/tralis/WebSocketConnector.js +0 -0
- package/{api → src/api}/tralis/WebSocketConnector.test.js +0 -0
- package/{api → src/api}/tralis/typedefs.js +0 -0
- package/src/assets/Lato-Black.ttf +0 -0
- package/src/assets/Lato-BlackItalic.ttf +0 -0
- package/src/assets/Lato-Bold.ttf +0 -0
- package/src/assets/Lato-BoldItalic.ttf +0 -0
- package/src/assets/Lato-Italic.ttf +0 -0
- package/src/assets/Lato-Light.ttf +0 -0
- package/src/assets/Lato-LightItalic.ttf +0 -0
- package/src/assets/Lato-Regular.ttf +0 -0
- package/src/assets/Lato-Thin.ttf +0 -0
- package/src/assets/Lato-ThinItalic.ttf +0 -0
- package/src/assets/OFL.txt +93 -0
- package/{common → src/common}/Tracker.js +0 -0
- package/{common → src/common}/api/api.js +0 -0
- package/{common → src/common}/api/api.test.js +0 -0
- package/{common → src/common}/controls/Control.js +0 -0
- package/{common → src/common}/controls/Control.test.js +0 -0
- package/{common → src/common}/layers/Layer.js +0 -0
- package/{common → src/common}/layers/Layer.test.js +0 -0
- package/{common → src/common}/mixins/CopyrightMixin.js +0 -0
- package/{common → src/common}/mixins/SearchMixin.js +0 -0
- package/{common → src/common}/mixins/TralisLayerMixin.js +0 -0
- package/{common → src/common}/styles/index.js +0 -0
- package/{common → src/common}/styles/trackerDefaultStyle.js +8 -8
- package/{common → src/common}/styles/trackerDelayStyle.js +0 -0
- package/{common → src/common}/styles/trackerSimpleStyle.js +0 -0
- package/{common → src/common}/trackerConfig.js +0 -0
- package/{common → src/common}/trackerConfig.test.js +0 -0
- package/{common → src/common}/typedefs.js +0 -0
- package/{common → src/common}/utils/createTrackerFilters.js +0 -0
- package/{common → src/common}/utils/createTrackerFilters.test.js +0 -0
- package/{common → src/common}/utils/getMapboxMapCopyrights.js +0 -0
- package/{common → src/common}/utils/getMapboxMapCopyrights.test.js +0 -0
- package/{common → src/common}/utils/getMapboxStyleUrl.js +0 -0
- package/{common → src/common}/utils/getVehiclePosition.js +0 -0
- package/{common → src/common}/utils/index.js +0 -0
- package/{common → src/common}/utils/removeDuplicate.js +0 -0
- package/{common → src/common}/utils/removeDuplicate.test.js +0 -0
- package/{common → src/common}/utils/sortByDelay.js +0 -0
- package/{common → src/common}/utils/timeUtils.js +0 -0
- package/{common → src/common}/utils/timeUtils.test.js +0 -0
- package/src/doc/App.js +116 -0
- package/src/doc/App.scss +51 -0
- package/src/doc/_redirects +2 -0
- package/src/doc/components/CodeSandboxButton.js +103 -0
- package/src/doc/components/Documentation.js +40 -0
- package/src/doc/components/Esdoc/Anchor.js +57 -0
- package/src/doc/components/Esdoc/ClassDoc.js +272 -0
- package/src/doc/components/Esdoc/DeprecatedHTML.js +16 -0
- package/src/doc/components/Esdoc/DetailDocs.js +281 -0
- package/src/doc/components/Esdoc/DetailHTML.js +33 -0
- package/src/doc/components/Esdoc/DirectSubclassHTML.js +30 -0
- package/src/doc/components/Esdoc/DocBuilderUtils.js +694 -0
- package/src/doc/components/Esdoc/DocLinkHTML.js +62 -0
- package/src/doc/components/Esdoc/DocsLinkHTML.js +38 -0
- package/src/doc/components/Esdoc/Esdoc.js +63 -0
- package/src/doc/components/Esdoc/EsdocContent.js +51 -0
- package/src/doc/components/Esdoc/EsdocNavigation.js +13 -0
- package/src/doc/components/Esdoc/EsdocSearch.js +81 -0
- package/src/doc/components/Esdoc/ExperimentalHTML.js +17 -0
- package/src/doc/components/Esdoc/ExtendsChainHTML.js +32 -0
- package/src/doc/components/Esdoc/FileDocLinkHTML.js +60 -0
- package/src/doc/components/Esdoc/IdentifiersDoc.js +113 -0
- package/src/doc/components/Esdoc/IndirectSubclassHTML.js +30 -0
- package/src/doc/components/Esdoc/InheritedSummaryDoc.js +70 -0
- package/src/doc/components/Esdoc/InheritedSummaryHTML.js +38 -0
- package/src/doc/components/Esdoc/MixinClassesHTML.js +29 -0
- package/src/doc/components/Esdoc/NavDoc.js +112 -0
- package/src/doc/components/Esdoc/OverrideMethod.js +44 -0
- package/src/doc/components/Esdoc/OverrideMethodDescription.js +35 -0
- package/src/doc/components/Esdoc/Properties.js +89 -0
- package/src/doc/components/Esdoc/README.md +45 -0
- package/src/doc/components/Esdoc/SignatureHTML.js +123 -0
- package/src/doc/components/Esdoc/SingleDoc.js +31 -0
- package/src/doc/components/Esdoc/SummaryDoc.js +160 -0
- package/src/doc/components/Esdoc/SummaryHTML.js +96 -0
- package/src/doc/components/Esdoc/TypeDocLinkHTML.js +249 -0
- package/src/doc/components/Esdoc/css/identifiers.css +38 -0
- package/src/doc/components/Esdoc/css/search.css +76 -0
- package/src/doc/components/Esdoc/css/style.css +603 -0
- package/src/doc/components/Esdoc/index.js +7 -0
- package/src/doc/components/Example.js +153 -0
- package/src/doc/components/Examples.js +183 -0
- package/src/doc/components/Home.js +106 -0
- package/src/doc/components/TrackerExample.js +38 -0
- package/src/doc/components/esm.min.js +2 -0
- package/src/doc/components/examples/assets/tralis-live-map/index.js +11 -0
- package/src/doc/components/examples/assets/tralis-live-map/s1kreis.svg +105 -0
- package/src/doc/components/examples/assets/tralis-live-map/s20kreis.svg +101 -0
- package/src/doc/components/examples/assets/tralis-live-map/s2kreis.svg +95 -0
- package/src/doc/components/examples/assets/tralis-live-map/s3kreis.svg +95 -0
- package/src/doc/components/examples/assets/tralis-live-map/s4kreis.svg +95 -0
- package/src/doc/components/examples/assets/tralis-live-map/s6kreis.svg +95 -0
- package/src/doc/components/examples/assets/tralis-live-map/s7kreis.svg +95 -0
- package/src/doc/components/examples/assets/tralis-live-map/s8kreis.svg +93 -0
- package/src/doc/components/examples/assets/tralis-live-map/unknown.svg +107 -0
- package/src/doc/components/examples/mb-copyright.html +26 -0
- package/src/doc/components/examples/mb-copyright.js +37 -0
- package/src/doc/components/examples/mb-tracker.html +1 -0
- package/src/doc/components/examples/mb-tracker.js +39 -0
- package/src/doc/components/examples/mb-tracker.md +1 -0
- package/src/doc/components/examples/mb-tralis.html +1 -0
- package/src/doc/components/examples/mb-tralis.js +34 -0
- package/src/doc/components/examples/ol-copyright.html +26 -0
- package/src/doc/components/examples/ol-copyright.js +43 -0
- package/src/doc/components/examples/ol-mapbox-layer.html +1 -0
- package/src/doc/components/examples/ol-mapbox-layer.js +28 -0
- package/src/doc/components/examples/ol-mapbox-layer.md +0 -0
- package/src/doc/components/examples/ol-mapbox-style-layer.html +12 -0
- package/src/doc/components/examples/ol-mapbox-style-layer.js +44 -0
- package/src/doc/components/examples/ol-query.html +32 -0
- package/src/doc/components/examples/ol-query.js +83 -0
- package/src/doc/components/examples/ol-routing.html +26 -0
- package/src/doc/components/examples/ol-routing.js +59 -0
- package/src/doc/components/examples/ol-routing.md +1 -0
- package/src/doc/components/examples/ol-stop-finder.html +15 -0
- package/src/doc/components/examples/ol-stop-finder.js +31 -0
- package/src/doc/components/examples/ol-stop-finder.md +1 -0
- package/src/doc/components/examples/ol-tracker.html +1 -0
- package/src/doc/components/examples/ol-tracker.js +44 -0
- package/src/doc/components/examples/ol-tracker.md +1 -0
- package/src/doc/components/examples/ol-tralis.html +5 -0
- package/src/doc/components/examples/ol-tralis.js +57 -0
- package/src/doc/components/examples/tralis-live-map.html +1 -0
- package/src/doc/components/examples/tralis-live-map.js +51 -0
- package/src/doc/components/examples/tralis-live-map.md +3 -0
- package/src/doc/examples/assets/tralis-live-map/index.js +11 -0
- package/src/doc/examples/assets/tralis-live-map/s1kreis.svg +105 -0
- package/src/doc/examples/assets/tralis-live-map/s20kreis.svg +101 -0
- package/src/doc/examples/assets/tralis-live-map/s2kreis.svg +95 -0
- package/src/doc/examples/assets/tralis-live-map/s3kreis.svg +95 -0
- package/src/doc/examples/assets/tralis-live-map/s4kreis.svg +95 -0
- package/src/doc/examples/assets/tralis-live-map/s6kreis.svg +95 -0
- package/src/doc/examples/assets/tralis-live-map/s7kreis.svg +95 -0
- package/src/doc/examples/assets/tralis-live-map/s8kreis.svg +93 -0
- package/src/doc/examples/assets/tralis-live-map/unknown.svg +107 -0
- package/src/doc/examples/mb-copyright.html +26 -0
- package/src/doc/examples/mb-copyright.js +37 -0
- package/src/doc/examples/mb-tracker.html +1 -0
- package/src/doc/examples/mb-tracker.js +39 -0
- package/src/doc/examples/mb-tracker.md +1 -0
- package/src/doc/examples/mb-tralis.html +1 -0
- package/src/doc/examples/mb-tralis.js +34 -0
- package/src/doc/examples/ol-copyright.html +26 -0
- package/src/doc/examples/ol-copyright.js +43 -0
- package/src/doc/examples/ol-mapbox-layer.html +1 -0
- package/src/doc/examples/ol-mapbox-layer.js +28 -0
- package/src/doc/examples/ol-mapbox-layer.md +0 -0
- package/src/doc/examples/ol-mapbox-style-layer.html +12 -0
- package/src/doc/examples/ol-mapbox-style-layer.js +44 -0
- package/src/doc/examples/ol-query.html +32 -0
- package/src/doc/examples/ol-query.js +83 -0
- package/src/doc/examples/ol-routing.html +26 -0
- package/src/doc/examples/ol-routing.js +59 -0
- package/src/doc/examples/ol-routing.md +1 -0
- package/src/doc/examples/ol-stop-finder.html +15 -0
- package/src/doc/examples/ol-stop-finder.js +31 -0
- package/src/doc/examples/ol-stop-finder.md +1 -0
- package/src/doc/examples/ol-tracker.html +1 -0
- package/src/doc/examples/ol-tracker.js +44 -0
- package/src/doc/examples/ol-tracker.md +1 -0
- package/src/doc/examples/ol-tralis.html +5 -0
- package/src/doc/examples/ol-tralis.js +57 -0
- package/src/doc/examples/tralis-live-map.html +1 -0
- package/src/doc/examples/tralis-live-map.js +51 -0
- package/src/doc/examples/tralis-live-map.md +3 -0
- package/src/doc/examples.js +107 -0
- package/src/doc/img/examples/live_tracker_mb.jpg +0 -0
- package/src/doc/img/examples/live_tracker_munich.jpg +0 -0
- package/src/doc/img/examples/live_tracker_ol.jpg +0 -0
- package/src/doc/img/examples/mapbox.jpg +0 -0
- package/src/doc/img/examples/mapbox_style.jpg +0 -0
- package/src/doc/img/examples/ol-copyright.png +0 -0
- package/src/doc/img/examples/query_objects.jpg +0 -0
- package/src/doc/img/examples/routing.jpg +0 -0
- package/src/doc/img/examples/simple_map.jpg +0 -0
- package/src/doc/img/examples/stops.jpg +0 -0
- package/src/doc/img/favico.ico +0 -0
- package/src/doc/index.js +21 -0
- package/src/iife.js +7 -0
- package/{module.js → src/index.js} +2 -0
- package/{mapbox → src/mapbox}/controls/CopyrightControl.js +0 -0
- package/{mapbox → src/mapbox}/index.js +0 -0
- package/{mapbox → src/mapbox}/layers/Layer.js +0 -0
- package/{mapbox → src/mapbox}/layers/Layer.test.js +0 -0
- package/{mapbox → src/mapbox}/layers/TralisLayer.js +0 -0
- package/{mapbox → src/mapbox}/layers/TralisLayer.test.js +0 -0
- package/{mapbox → src/mapbox}/utils.js +0 -0
- package/src/ol/README.md +0 -0
- package/{ol → src/ol}/controls/CopyrightControl.js +0 -0
- package/{ol → src/ol}/controls/CopyrightControl.test.js +0 -0
- package/{ol → src/ol}/controls/RoutingControl.js +0 -0
- package/{ol → src/ol}/controls/RoutingControl.test.js +0 -0
- package/{ol → src/ol}/controls/StopFinderControl.js +0 -0
- package/{ol → src/ol}/controls/StopFinderControl.test.js +0 -0
- package/{ol → src/ol}/controls/snapshots/RoutingControlRouteGen10.json +0 -0
- package/{ol → src/ol}/controls/snapshots/RoutingControlRouteGen100.json +0 -0
- package/{ol → src/ol}/controls/snapshots/RoutingControlRouteGen30.json +0 -0
- package/{ol → src/ol}/controls/snapshots/RoutingControlRouteGen5.json +0 -0
- package/{ol → src/ol}/controls/snapshots/RoutingControlRouteOSM.json +0 -0
- package/{ol → src/ol}/controls/snapshots/RoutingControlStation1.json +0 -0
- package/{ol → src/ol}/controls/snapshots/RoutingControlStation2.json +0 -0
- package/{ol → src/ol}/index.js +0 -0
- package/{ol → src/ol}/layers/Layer.js +0 -0
- package/{ol → src/ol}/layers/Layer.test.js +0 -0
- package/{ol → src/ol}/layers/MapboxLayer.js +0 -0
- package/{ol → src/ol}/layers/MapboxLayer.test.js +0 -0
- package/{ol → src/ol}/layers/MapboxStyleLayer.js +0 -0
- package/{ol → src/ol}/layers/MapboxStyleLayer.test.js +0 -0
- package/{ol → src/ol}/layers/MaplibreLayer.js +0 -0
- package/{ol → src/ol}/layers/RoutingLayer.js +0 -0
- package/{ol → src/ol}/layers/RoutingLayer.test.js +0 -0
- package/{ol → src/ol}/layers/TralisLayer.js +0 -0
- package/{ol → src/ol}/layers/TralisLayer.test.js +0 -0
- package/{ol → src/ol}/layers/VectorLayer.js +0 -0
- package/{ol → src/ol}/layers/VectorLayer.test.js +0 -0
- package/{ol → src/ol}/layers/WMSLayer.js +0 -0
- package/{ol → src/ol}/layers/WMSLayer.test.js +0 -0
- package/{ol → src/ol}/styles/fullTrajectoryDelayStyle.js +0 -0
- package/{ol → src/ol}/styles/fullTrajectoryStyle.js +0 -0
- package/{ol → src/ol}/styles/index.js +0 -0
- package/src/setupTests.js +15 -0
- package/webpack.config.js +6 -0
- package/index.js +0 -2
- package/index.js.map +0 -1
package/indexweb.html
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>Parcel Sandbox</title>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link
|
|
6
|
+
rel="stylesheet"
|
|
7
|
+
href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.14.1/css/ol.css"
|
|
8
|
+
type="text/css"
|
|
9
|
+
/>
|
|
10
|
+
<script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.14.1/build/ol.js"></script>
|
|
11
|
+
<script src="./build/mbt.js"></script>
|
|
12
|
+
</head>
|
|
13
|
+
|
|
14
|
+
<body>
|
|
15
|
+
<div id="app">
|
|
16
|
+
<div id="map" style="width: 600px; height: 600px"></div>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
const map = new ol.Map({
|
|
21
|
+
target: 'map',
|
|
22
|
+
view: new ol.View({
|
|
23
|
+
center: [831634, 5933959],
|
|
24
|
+
zoom: 13,
|
|
25
|
+
}),
|
|
26
|
+
controls: [],
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const layer = new mbt.ol.MaplibreLayer({
|
|
30
|
+
url: 'https://maps.geops.io/styles/travic_v2/style.json',
|
|
31
|
+
apiKey: '5cc87b12d7c5370001c1d6554840ecb89d2743d2b0aad0588b8ba7eb',
|
|
32
|
+
});
|
|
33
|
+
layer.init(map);
|
|
34
|
+
|
|
35
|
+
const tracker = new mbt.ol.TralisLayer({
|
|
36
|
+
url: 'wss://api.geops.io/tracker-ws/v1/',
|
|
37
|
+
apiKey: '5cc87b12d7c5370001c1d6554840ecb89d2743d2b0aad0588b8ba7eb',
|
|
38
|
+
});
|
|
39
|
+
tracker.init(map);
|
|
40
|
+
|
|
41
|
+
tracker.onClick(([feature]) => {
|
|
42
|
+
if (feature) {
|
|
43
|
+
// eslint-disable-next-line no-console
|
|
44
|
+
console.log(feature.getProperties());
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
48
|
+
</body>
|
|
49
|
+
</html>
|
package/jest.config.js
ADDED
package/package.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
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": "2.0.0-beta.
|
|
5
|
+
"version": "2.0.0-beta.6",
|
|
6
6
|
"main": "index.js",
|
|
7
|
-
"module": "
|
|
7
|
+
"module": "esm.js",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@geops/geops-ui": "0.1.13",
|
|
10
10
|
"@material-ui/core": "4.12.3",
|
|
@@ -42,6 +42,8 @@
|
|
|
42
42
|
"@babel/plugin-transform-runtime": "7.16.10",
|
|
43
43
|
"@babel/preset-env": "^7.16.11",
|
|
44
44
|
"@babel/preset-react": "7.16.7",
|
|
45
|
+
"@commitlint/cli": "17.0.2",
|
|
46
|
+
"@commitlint/config-conventional": "17.0.2",
|
|
45
47
|
"@neutrinojs/copy": "9.5.0",
|
|
46
48
|
"@neutrinojs/jest": "^9.5.0",
|
|
47
49
|
"@neutrinojs/library": "9.5.0",
|
|
@@ -49,6 +51,7 @@
|
|
|
49
51
|
"autoprefixer": "9.7.6",
|
|
50
52
|
"cypress": "9.4.1",
|
|
51
53
|
"deepmerge": "4.2.2",
|
|
54
|
+
"esbuild": "^0.14.47",
|
|
52
55
|
"esdoc": "1.1.0",
|
|
53
56
|
"esdoc-ecmascript-proposal-plugin": "1.0.0",
|
|
54
57
|
"esdoc-publish-html-plugin": "1.1.2",
|
|
@@ -64,7 +67,7 @@
|
|
|
64
67
|
"eslint-plugin-react": "7.28.0",
|
|
65
68
|
"eslint-plugin-react-hooks": "4.3.0",
|
|
66
69
|
"fixpack": "3.0.6",
|
|
67
|
-
"husky": "
|
|
70
|
+
"husky": "8.0.1",
|
|
68
71
|
"jest": "26.6.3",
|
|
69
72
|
"jest-canvas-mock": "2.3.1",
|
|
70
73
|
"jest-fetch-mock": "3.0.3",
|
|
@@ -82,6 +85,7 @@
|
|
|
82
85
|
"sass": "1.52.2",
|
|
83
86
|
"sass-loader": "8.0.2",
|
|
84
87
|
"sort-json": "2.0.0",
|
|
88
|
+
"standard-version": "9.5.0",
|
|
85
89
|
"start-server-and-test": "1.14.0",
|
|
86
90
|
"stylelint": "14.3.0",
|
|
87
91
|
"stylelint-config-recommended-scss": "5.0.2",
|
|
@@ -106,11 +110,30 @@
|
|
|
106
110
|
"lib:dev": "REACT_APP_LIB_MODE=1 webpack --mode development",
|
|
107
111
|
"link2": "cmdToAdd=$(node ./scripts/read-pkg-json.js add) && $cmdToAdd && yarn build && cmdToRemove=$(node ./scripts/read-pkg-json.js remove) && $cmdToRemove && cd build && yarn link",
|
|
108
112
|
"lint": "eslint 'src/**/*.js' && stylelint 'src/**/*.css' 'src/**/*.scss'",
|
|
109
|
-
"publish:beta": "HUSKY=0 yarn
|
|
113
|
+
"publish:beta": "HUSKY=0 yarn release -- --prerelease beta --skip.changelog && git push origin HEAD && yarn run esbuild && cd build && git push --tags && HUSKY=0 yarn publish --tag beta",
|
|
114
|
+
"publish:beta:dryrun": "yarn release -- --prerelease beta --dry-run --skip.changelog",
|
|
115
|
+
"publish:public": "yarn release && git push origin HEAD && yarn run esbuild && cd build && git push --tags && yarn publish",
|
|
116
|
+
"publish:public:dryrun": "yarn release --dry-run",
|
|
117
|
+
"release": "standard-version",
|
|
110
118
|
"start": "yarn doc && webpack-dev-server --mode development --open",
|
|
111
119
|
"start:examples": "webpack-dev-server --mode development --open",
|
|
112
120
|
"test": "REACT_APP_LIB_MODE=1 jest",
|
|
113
|
-
"test:watch": "yarn test --watchAll"
|
|
121
|
+
"test:watch": "yarn test --watchAll",
|
|
122
|
+
"esbuild": "yarn esbuild:all && yarn esbuild:esm && yarn esbuild:iife",
|
|
123
|
+
"esbuild:all": "esbuild src/index.js src/**/*.js src/**/**/*.js --target=chrome100 --outdir=build/ --loader:.js=jsx",
|
|
124
|
+
"esbuild:esm": "yarn esbuild:esm:unminify && yarn esbuild:esm:minify",
|
|
125
|
+
"esbuild:esm:base": "esbuild src/index.js --bundle --sourcemap --target=chrome100 --format=esm --external:mapbox-gl --external:ol --external:maplibre-gl",
|
|
126
|
+
"esbuild:esm:unminify": "yarn esbuild:esm:base --outfile=build/esm.js",
|
|
127
|
+
"esbuild:esm:minify": "yarn esbuild:esm:base --minify --outfile=build/esm.min.js ",
|
|
128
|
+
"esbuild:esm:ol": "yarn esbuild:esm:ol:unminify && yarn esbuild:esm:ol:minify",
|
|
129
|
+
"esbuild:esm:ol:base": "esbuild src/ol/index.js --bundle --sourcemap --target=chrome100 --format=esm --external:mapbox-gl --external:ol --external:maplibre-gl",
|
|
130
|
+
"esbuild:esm:ol:unminify": "yarn esbuild:esm:ol:base --outfile=build/esm-ol.js",
|
|
131
|
+
"esbuild:esm:ol:minify": "yarn esbuild:esm:ol:base --minify --outfile=build/esm-ol.min.js ",
|
|
132
|
+
"esbuild:iife": "yarn esbuild:iife:unminify && yarn esbuild:iife:minify",
|
|
133
|
+
"esbuild:iife:base": "esbuild src/iife.js --bundle --sourcemap --target=chrome100",
|
|
134
|
+
"esbuild:iife:minify": "yarn esbuild:iife:base --minify --outfile=build/mbt.min.js",
|
|
135
|
+
"esbuild:iife:unminify": "yarn esbuild:iife:base --outfile=build/mbt.js",
|
|
136
|
+
"esbuild:file": "npx esbuild src/**/*.js src/**/**/*.js --target=chrome100 --outdir=build/ --loader:.js=jsx"
|
|
114
137
|
},
|
|
115
138
|
"browserslist": {
|
|
116
139
|
"production": [
|
|
@@ -165,10 +188,7 @@
|
|
|
165
188
|
},
|
|
166
189
|
"exports": {
|
|
167
190
|
".": "./index.js",
|
|
168
|
-
"./module": "./module.js",
|
|
169
191
|
"./api": "./api/index.js",
|
|
170
|
-
"./common/trackerConfig": "./common/trackerConfig.js",
|
|
171
|
-
"./utils": "./common/utils/index.js",
|
|
172
192
|
"./mapbox": "./mapbox/index.js",
|
|
173
193
|
"./ol": "./ol/index.js"
|
|
174
194
|
},
|
|
@@ -184,7 +204,7 @@
|
|
|
184
204
|
"yarn test --bail --findRelatedTests"
|
|
185
205
|
],
|
|
186
206
|
"package.json": [
|
|
187
|
-
"fixpack --sortToTop name --sortToTop license --sortToTop description --sortToTop version --sortToTop author --sortToTop main --sortToTop module --sortToTop files --sortToTop proxy --sortToTop dependencies --sortToTop peerDependencies --sortToTop devDependencies --sortToTop resolutions --sortToTop scripts"
|
|
207
|
+
"fixpack --sortToTop name --sortToTop license --sortToTop description --sortToTop version --sortToTop author --sortToTop main --sortToTop module --sortToTop files --sortToTop exports --sortToTop proxy --sortToTop dependencies --sortToTop peerDependencies --sortToTop devDependencies --sortToTop resolutions --sortToTop scripts"
|
|
188
208
|
],
|
|
189
209
|
"src/**/*.{css,scss}": [
|
|
190
210
|
"stylelint --fix"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# How to
|
|
2
|
+
|
|
3
|
+
<!-- Please provide a test link and quick description how to see the change -->
|
|
4
|
+
|
|
5
|
+
# Others
|
|
6
|
+
|
|
7
|
+
<!-- Thanks for the PR! Feel free to add or remove items if there are not necessary. -->
|
|
8
|
+
|
|
9
|
+
- [ ] It's not a hack or at least an unauthorized hack :).
|
|
10
|
+
- [ ] The images added are optimized.
|
|
11
|
+
- [ ] Everything in ticket description has been fixed.
|
|
12
|
+
- [ ] The author of the MR has made its own review before assigning the reviewer.
|
|
13
|
+
- [ ] The title means something for a human being and follows the [conventional commits](https://www.conventionalcommits.org/) specification.
|
|
14
|
+
- [ ] The title contains [WIP] if it's necessary.
|
|
15
|
+
- [ ] Labels applied. if it's a release? a hotfix?
|
|
16
|
+
- [ ] The new class' members & methods are well documented
|
|
17
|
+
- [ ] Tests added.
|
package/renovate.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
const pjson = require('../package.json');
|
|
3
|
+
|
|
4
|
+
const { peerDependencies } = pjson;
|
|
5
|
+
|
|
6
|
+
const packageKeys = Object.keys(peerDependencies);
|
|
7
|
+
|
|
8
|
+
const arg = process.argv[2];
|
|
9
|
+
|
|
10
|
+
if (arg === 'add') {
|
|
11
|
+
console.log(
|
|
12
|
+
`yarn add ${packageKeys
|
|
13
|
+
.map((p) => `${p}@${peerDependencies[p]}`)
|
|
14
|
+
.join(' ')}`,
|
|
15
|
+
);
|
|
16
|
+
} else if (arg === 'remove') {
|
|
17
|
+
console.log(
|
|
18
|
+
`rm -rf ${packageKeys.map((p) => `node_modules/${p}`).join(' ')}`,
|
|
19
|
+
);
|
|
20
|
+
} else {
|
|
21
|
+
console.log('echo "wrong argument."');
|
|
22
|
+
}
|
package/{api → src/api}/index.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright (c) 2010-2014 by tyPoland Lukasz Dziedzic (team@latofonts.com) with Reserved Font Name "Lato"
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -158,24 +158,24 @@ const style = (trajectory, viewState, options) => {
|
|
|
158
158
|
} = options;
|
|
159
159
|
|
|
160
160
|
const { zoom, pixelRatio } = viewState;
|
|
161
|
-
let {
|
|
161
|
+
let { type, cancelled } = trajectory.properties;
|
|
162
162
|
const {
|
|
163
163
|
train_id: id,
|
|
164
|
+
line,
|
|
164
165
|
delay,
|
|
165
|
-
|
|
166
|
+
state,
|
|
166
167
|
operator_provides_realtime_journey: operatorProvidesRealtime,
|
|
167
168
|
} = trajectory.properties;
|
|
169
|
+
let { name, text_color: textColor, color } = line || {};
|
|
170
|
+
|
|
171
|
+
// In the future, the cancelled property will be removed we still managed it
|
|
172
|
+
// until the backend change is on prod.
|
|
173
|
+
cancelled = cancelled === true || state === 'JOURNEY_CANCELLED';
|
|
168
174
|
|
|
169
175
|
if (!type) {
|
|
170
176
|
type = 'Rail';
|
|
171
177
|
}
|
|
172
178
|
|
|
173
|
-
if (!line) {
|
|
174
|
-
line = {};
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
let { name, text_color: textColor, color } = line;
|
|
178
|
-
|
|
179
179
|
if (!name) {
|
|
180
180
|
name = 'I';
|
|
181
181
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/doc/App.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ThemeProvider, makeStyles } from '@material-ui/core/styles';
|
|
3
|
+
import Container from '@material-ui/core/Container';
|
|
4
|
+
import { Outlet, Routes, Route, Navigate, Link } from 'react-router-dom';
|
|
5
|
+
import { geopsTheme, Header, Footer } from '@geops/geops-ui';
|
|
6
|
+
import Examples from './components/Examples';
|
|
7
|
+
import Example from './components/Example';
|
|
8
|
+
import Documentation from './components/Documentation';
|
|
9
|
+
import Home from './components/Home';
|
|
10
|
+
|
|
11
|
+
import 'typeface-lato';
|
|
12
|
+
import './App.scss';
|
|
13
|
+
|
|
14
|
+
const useStyles = makeStyles({
|
|
15
|
+
content: {
|
|
16
|
+
flexGrow: 1,
|
|
17
|
+
overflowY: 'auto',
|
|
18
|
+
paddingBottom: 115,
|
|
19
|
+
margin: 'auto',
|
|
20
|
+
marginTop: 30,
|
|
21
|
+
},
|
|
22
|
+
documentation: {
|
|
23
|
+
flexGrow: 1,
|
|
24
|
+
overflowY: 'auto',
|
|
25
|
+
padding: 0,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const tabs = [
|
|
30
|
+
{
|
|
31
|
+
label: 'Home',
|
|
32
|
+
component: Link,
|
|
33
|
+
to: '/home',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: 'API',
|
|
37
|
+
component: Link,
|
|
38
|
+
to: '/api',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: 'Examples',
|
|
42
|
+
component: Link,
|
|
43
|
+
to: '/examples',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: 'Code',
|
|
47
|
+
href: 'https://github.com/geops/mobility-toolbox-js',
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
function Main() {
|
|
52
|
+
return (
|
|
53
|
+
<ThemeProvider theme={geopsTheme}>
|
|
54
|
+
<Header title="mobility-toolbox-js" tabs={tabs} />
|
|
55
|
+
<Outlet />
|
|
56
|
+
<Footer />
|
|
57
|
+
</ThemeProvider>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function App() {
|
|
62
|
+
const classes = useStyles();
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<Routes>
|
|
66
|
+
<Route path="/" element={<Main />}>
|
|
67
|
+
<Route index element={<Navigate to="/home" />} />
|
|
68
|
+
<Route
|
|
69
|
+
index
|
|
70
|
+
path="/home"
|
|
71
|
+
element={
|
|
72
|
+
<Container className={classes.content}>
|
|
73
|
+
<Home />
|
|
74
|
+
</Container>
|
|
75
|
+
}
|
|
76
|
+
/>
|
|
77
|
+
<Route
|
|
78
|
+
path="/examples"
|
|
79
|
+
element={
|
|
80
|
+
<Container className={classes.content}>
|
|
81
|
+
<Examples />
|
|
82
|
+
</Container>
|
|
83
|
+
}
|
|
84
|
+
/>
|
|
85
|
+
<Route
|
|
86
|
+
path="/example/:exampleKey"
|
|
87
|
+
element={
|
|
88
|
+
<Container className={classes.content}>
|
|
89
|
+
<Example />
|
|
90
|
+
</Container>
|
|
91
|
+
}
|
|
92
|
+
/>
|
|
93
|
+
<Route path="/api">
|
|
94
|
+
<Route
|
|
95
|
+
index
|
|
96
|
+
element={
|
|
97
|
+
<Container className={classes.documentation} maxWidth={false}>
|
|
98
|
+
<Documentation />
|
|
99
|
+
</Container>
|
|
100
|
+
}
|
|
101
|
+
/>
|
|
102
|
+
<Route
|
|
103
|
+
path="*"
|
|
104
|
+
element={
|
|
105
|
+
<Container className={classes.documentation} maxWidth={false}>
|
|
106
|
+
<Documentation />
|
|
107
|
+
</Container>
|
|
108
|
+
}
|
|
109
|
+
/>
|
|
110
|
+
</Route>
|
|
111
|
+
</Route>
|
|
112
|
+
</Routes>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export default App;
|
package/src/doc/App.scss
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
html {
|
|
2
|
+
height: 100%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
body {
|
|
6
|
+
margin: 0;
|
|
7
|
+
font-family: Lato, Arial, sans-serif;
|
|
8
|
+
color: #353535;
|
|
9
|
+
position: relative;
|
|
10
|
+
min-height: 100%;
|
|
11
|
+
overflow-y: scroll;
|
|
12
|
+
font-size: 18px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
a {
|
|
16
|
+
text-decoration: none;
|
|
17
|
+
color: #76b833;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
#map a {
|
|
21
|
+
color: initial;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* geops ui css */
|
|
25
|
+
button.geops-ui {
|
|
26
|
+
color: #fff;
|
|
27
|
+
padding: 5px 15px;
|
|
28
|
+
font-size: 18px;
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
transition:
|
|
31
|
+
background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
|
|
32
|
+
box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
|
|
33
|
+
border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
34
|
+
font-weight: 700;
|
|
35
|
+
line-height: 24px;
|
|
36
|
+
border-radius: 5px;
|
|
37
|
+
text-transform: none;
|
|
38
|
+
background-color: #76b833;
|
|
39
|
+
border: 0;
|
|
40
|
+
outline: none;
|
|
41
|
+
|
|
42
|
+
&:not([disabled]) {
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:hover {
|
|
47
|
+
box-shadow: 0 5px 16px #35353540;
|
|
48
|
+
text-decoration: none;
|
|
49
|
+
background-color: #76b833;
|
|
50
|
+
}
|
|
51
|
+
}
|