@geops/rvf-mobility-web-component 0.1.59 → 0.1.61
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/CHANGELOG.md +46 -0
- package/README.md +16 -123
- package/docutils.js +1 -1
- package/index.html +4 -0
- package/index.js +154 -151
- package/package.json +1 -1
- package/src/ExportMenu/ExportMenu.tsx +7 -5
- package/src/ExportMenuButton/ExportMenuButton.tsx +8 -1
- package/src/GeolocationButton/GeolocationButton.tsx +9 -3
- package/src/LayerTree/TreeItem/TreeItem.tsx +3 -1
- package/src/LayerTreeButton/LayerTreeButton.tsx +10 -4
- package/src/LayerTreeMenu/LayerTreeMenu.tsx +15 -5
- package/src/LinesNetworkPlanLayer/LinesNetworkPlanLayer.tsx +5 -2
- package/src/MapDispatchEvents/MapDispatchEvents.tsx +7 -0
- package/src/MapLayout/MapLayout.tsx +176 -0
- package/src/MapLayout/index.tsx +1 -0
- package/src/MobilityMap/MobilityMap.tsx +25 -139
- package/src/MobilityMap/MobilityMapAttributes.ts +15 -3
- package/src/NotificationDetails/NotificationDetails.tsx +23 -8
- package/src/OverlayContent/OverlayContent.tsx +5 -3
- package/src/OverlayDetails/OverlayDetails.tsx +29 -11
- package/src/OverlayDetailsHeader/OverlayDetailsHeader.tsx +11 -14
- package/src/Permalink/Permalink.tsx +5 -5
- package/src/PermalinkInput/PermalinkInput.tsx +6 -4
- package/src/RealtimeLayer/RealtimeLayer.tsx +10 -9
- package/src/RouteScheduleFooter/RouteScheduleFooter.tsx +1 -1
- package/src/RvfFeatureDetails/RvfNotificationDetails/RvfNotificationDetails.tsx +23 -8
- package/src/RvfMobilityMap/RvfMobilityMap.tsx +44 -41
- package/src/RvfSellingPointsLayer/RvfSellingPointsLayer.tsx +6 -6
- package/src/RvfSharedMobilityLayerGroup/RvfSharedMobilityLayerGroup.tsx +76 -58
- package/src/Search/Search.tsx +1 -1
- package/src/SearchButton/SearchButton.tsx +10 -4
- package/src/ShareMenu/ShareMenu.tsx +4 -2
- package/src/ShareMenuButton/ShareMenuButton.tsx +10 -3
- package/src/StationsLayer/StationsLayer.tsx +4 -1
- package/src/ZoomButtons/ZoomButtons.tsx +12 -2
- package/src/index.tsx +13 -5
- package/src/utils/constants.ts +20 -40
- package/src/utils/getPermalinkParameters.ts +12 -4
- package/src/utils/hooks/useInitialPermalink.tsx +83 -0
- package/src/utils/hooks/useLayerConfig.tsx +1 -3
- package/src/utils/hooks/useLayersConfig.tsx +2 -2
- package/src/utils/i18n.ts +0 -10
- package/src/utils/translations.ts +165 -0
- package/src/RvfFeatureDetailsFooter/RvfFeatureDetailsFooter.tsx +0 -43
- package/src/RvfFeatureDetailsFooter/index.tsx +0 -1
- package/src/RvfFeatureDetailsTitle/RvfFeatureDetailsTitle.tsx +0 -81
- package/src/RvfFeatureDetailsTitle/index.tsx +0 -1
- package/src/RvfLayerTree/RvfLayerTree.tsx +0 -40
- package/src/RvfLayerTree/TreeItem/TreeItem.tsx +0 -145
- package/src/RvfLayerTree/TreeItem/index.tsx +0 -1
- package/src/RvfLayerTree/index.tsx +0 -1
- package/src/RvfLayerTree/layersTreeContext.ts +0 -4
- package/src/RvfLayerTree/layersTreeReducer.ts +0 -158
- package/src/RvfOverlayContent/RvfOverlayContent.tsx +0 -128
- package/src/RvfOverlayContent/index.ts +0 -0
- package/src/utils/hooks/useUpdatePermalink.tsx +0 -76
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,52 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.1.61](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.60...v0.1.61) (2025-10-07)
|
|
6
|
+
|
|
7
|
+
### [0.1.60](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.59...v0.1.60) (2025-10-07)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* add permalingtemplate attribute ([0c28884](https://github.com/geops/rvf-mobility-web-component/commit/0c28884b059b7b56ba7814a689e908440a8b4f7d))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* ad a default visible layers list ([3664a90](https://github.com/geops/rvf-mobility-web-component/commit/3664a90188d548e7a10076d58cbae78681ed85de))
|
|
18
|
+
* add more translations ([ea1dff7](https://github.com/geops/rvf-mobility-web-component/commit/ea1dff7cc8f905f9a3a1f762fecd06bb2a30b3f7))
|
|
19
|
+
* add more translations ([6d49d2b](https://github.com/geops/rvf-mobility-web-component/commit/6d49d2bf9a42b09bb34da71ffbd076f554e522f2))
|
|
20
|
+
* add more translations ([6dfa067](https://github.com/geops/rvf-mobility-web-component/commit/6dfa0672face8ed76a1948ea6e9d44d84cb27a6a))
|
|
21
|
+
* add more translations ([9f99968](https://github.com/geops/rvf-mobility-web-component/commit/9f9996878006a1ece409fb3ba411a1267ecd9076))
|
|
22
|
+
* add realod attr ([bdcadb8](https://github.com/geops/rvf-mobility-web-component/commit/bdcadb840e39ad26a19c8b7025e5c45b2fd7534b))
|
|
23
|
+
* add realod attr ([5946f78](https://github.com/geops/rvf-mobility-web-component/commit/5946f78310bf1a7112043cd2708a4c5f456cb85a))
|
|
24
|
+
* add realod attr ([ed1205c](https://github.com/geops/rvf-mobility-web-component/commit/ed1205c7865e94377e5cc4880b836c02d0abdcbb))
|
|
25
|
+
* add translations ([5588a7e](https://github.com/geops/rvf-mobility-web-component/commit/5588a7ec19b26b83c18942145f9b479a353727b4))
|
|
26
|
+
* add translations ([d37c94d](https://github.com/geops/rvf-mobility-web-component/commit/d37c94dd50078cbb7cb23a744d5f13c822a20369))
|
|
27
|
+
* display custom html inline ([10cb2ba](https://github.com/geops/rvf-mobility-web-component/commit/10cb2bac233a61164662b57e19c20a89825b9f86))
|
|
28
|
+
* do not center on the train clicked ([a8a24f5](https://github.com/geops/rvf-mobility-web-component/commit/a8a24f5471d09b61c382b52d472f1cc46c1b4739))
|
|
29
|
+
* do not center on the train clicked ([d4ddb03](https://github.com/geops/rvf-mobility-web-component/commit/d4ddb033194cd32adcbfdb838e271be662cf746e))
|
|
30
|
+
* fix css issue with serach when the browser is zoomed ([dc252e7](https://github.com/geops/rvf-mobility-web-component/commit/dc252e7b3ae78379b81f5340226cc2bc1402de9c))
|
|
31
|
+
* fix css issue with serach when the browser is zoomed ([1201059](https://github.com/geops/rvf-mobility-web-component/commit/1201059c110960c9f74a6e89d8a72cbd9ca5c881))
|
|
32
|
+
* fix search css when browser page is zoomed ([60dae1d](https://github.com/geops/rvf-mobility-web-component/commit/60dae1dbc0a415cdb401db13b3a3c438652b2f9a))
|
|
33
|
+
* handle when selected Feature is a cluster and make overlay bigger ([255caa5](https://github.com/geops/rvf-mobility-web-component/commit/255caa5efef33741f566cca0610734135025f9c4))
|
|
34
|
+
* increase overlay size ([da8ccf9](https://github.com/geops/rvf-mobility-web-component/commit/da8ccf911dbde93518944878a3944c545fc1bcfd))
|
|
35
|
+
* merge upstream ([3232885](https://github.com/geops/rvf-mobility-web-component/commit/32328856b770fa95f5d3f3857d4681f9ad1d4677))
|
|
36
|
+
* move up reading Permalink ([fbf3af4](https://github.com/geops/rvf-mobility-web-component/commit/fbf3af4f74e9ed2d16e555024fa80cab486ca5a7))
|
|
37
|
+
* move up reading Permalink ([978df5b](https://github.com/geops/rvf-mobility-web-component/commit/978df5bc88355176f70b560a9e5a2daff9c5a9d2))
|
|
38
|
+
* remove css file ([6ef6b1e](https://github.com/geops/rvf-mobility-web-component/commit/6ef6b1eedbf9da3b4cb8dde6564cb3183e9cbd00))
|
|
39
|
+
* separate map layout from main component adn add lang attributes ([213c252](https://github.com/geops/rvf-mobility-web-component/commit/213c2528ab7d2b2910a41d5b55399066e3b145df))
|
|
40
|
+
* set default value to read permalink template ([9aba6e9](https://github.com/geops/rvf-mobility-web-component/commit/9aba6e9023e0382cb7b2fa8b7eb64766d015bb26))
|
|
41
|
+
* set icons size to 24 by default ([eef7342](https://github.com/geops/rvf-mobility-web-component/commit/eef734213a4b26d921e20cd8b6296cca0b2606b6))
|
|
42
|
+
* use 320px for overlay width ([f75394e](https://github.com/geops/rvf-mobility-web-component/commit/f75394ebf84eff9f43dfbfa7127ae31f9a29f1bf))
|
|
43
|
+
* use also default prop when available ([6c0e850](https://github.com/geops/rvf-mobility-web-component/commit/6c0e8508a1024abb600d2595bc6d02a22482d81c))
|
|
44
|
+
* use good layer 's name in overlay ([023513c](https://github.com/geops/rvf-mobility-web-component/commit/023513c4c6538c5eb4ededdf60f3d9cb5469d22b))
|
|
45
|
+
* use good layer 's name in overlay ([b2a3f95](https://github.com/geops/rvf-mobility-web-component/commit/b2a3f956915fe869d0860a947405d4f71924e019))
|
|
46
|
+
* use good layer 's name in overlay ([46034e8](https://github.com/geops/rvf-mobility-web-component/commit/46034e8d405c5611799eb36c2ce44c72d605fcc5))
|
|
47
|
+
* use proper template ([2e06883](https://github.com/geops/rvf-mobility-web-component/commit/2e068836c8a6faf7f3e66f3213c920aa4ad1c6b8))
|
|
48
|
+
* use smaller font for copyright ([064733c](https://github.com/geops/rvf-mobility-web-component/commit/064733c482eba836cfb25449470aebb7bafaaf85))
|
|
49
|
+
* use smaller font for copyrights ([93cea58](https://github.com/geops/rvf-mobility-web-component/commit/93cea589d03b9e0232527df8ac48abf2a305bfae))
|
|
50
|
+
|
|
5
51
|
### [0.1.59](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.58...v0.1.59) (2025-10-01)
|
|
6
52
|
|
|
7
53
|
### [0.1.58](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.57...v0.1.58) (2025-10-01)
|
package/README.md
CHANGED
|
@@ -15,7 +15,8 @@ Most components in RVF are mostly very generic and could be migrate to the main
|
|
|
15
15
|
## Links
|
|
16
16
|
|
|
17
17
|
- [Vercel app](https://rvf-mobility-web-component-geops.vercel.app/)
|
|
18
|
-
|
|
18
|
+
- [NPM package](https://www.npmjs.com/package/@geops/rvf-mobility-web-component)
|
|
19
|
+
- [RVF design system](https://www.rvf.de/muster#c4523)
|
|
19
20
|
- [Sketch file design system](https://www.sketch.com/s/71e4d120-f65f-4451-80c8-0a7e60e22265/p/22207D12-0F28-49D1-BCA4-1EDEF8B8BFE9/canvas)
|
|
20
21
|
- [Sketch file design website](https://www.sketch.com/s/25c65997-d5d5-426f-b86c-a68c2de03524)
|
|
21
22
|
- [VAG colors](https://www.vag-freiburg.de/fahrplan/linien-fahrplaene)
|
|
@@ -29,136 +30,26 @@ Most components in RVF are mostly very generic and could be migrate to the main
|
|
|
29
30
|
|
|
30
31
|
This project contains a set of web components allowing to use easily the [geOps APIs](https://developer.geops.io/):
|
|
31
32
|
|
|
32
|
-
-
|
|
33
|
-
-
|
|
33
|
+
- `<geops-mobility>`: a web component used to display a map using different [geOps APIs](https://developer.geops.io/).
|
|
34
|
+
- `<geops-mobility-search>`: a search input to search stops using the [geOps Stops API](https://developer.geops.io/apis/stops).
|
|
34
35
|
|
|
36
|
+
## Demo
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
You can see the web components in action using the [demo app](https://rvf-mobility-web-component.geops.io/).
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
The map displays realtime vehicles, and allow to click on them to display their schedule plan.
|
|
41
|
-
You can also display MOCO notifications.
|
|
42
|
-
|
|
43
|
-
### Demo
|
|
44
|
-
|
|
45
|
-
You can see the web component in action using the [demo app](https://rvf-mobility-web-component-geops.vercel.app/).
|
|
46
|
-
|
|
47
|
-
### Usage Example
|
|
48
|
-
|
|
49
|
-
```html
|
|
50
|
-
<html>
|
|
51
|
-
<body>
|
|
52
|
-
<script type="module" src="https://www.unpkg.com/@geops/rvf-mobility-web-component)"></script>
|
|
53
|
-
<geops-mobility apikey="YOUR_GEOPS_API_KEY" style="display: block;width: 400px;height: 800px;"></geops-mobility>
|
|
54
|
-
</body>
|
|
55
|
-
</html>
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### Attributes
|
|
59
|
-
|
|
60
|
-
Here an exhaustive list of the `<geops-mobility>` web component attributes available to customize easily the map.
|
|
61
|
-
|
|
62
|
-
- [`apikey="YOUR_API_KEY"`](https://mobility-web-component.geops.io/?apikey=YOUR_API_KEY): your [geOps API key](https://developer.geops.io/).
|
|
63
|
-
- [`baselayer="travic_v2"`](https://mobility-web-component.geops.io/?baselayer=travic_v2): the style's name from the [geOps Maps API](https://developer.geops.io/apis/maps) (base_dark_v2, base_bright_v2, ...). Default to `travic_v2`.
|
|
64
|
-
- [`center="831634,5933959"`](https://mobility-web-component.geops.io/?center=831634,5933959): the center of the map in EPSG:3857 coordinates. Default to `831634,5933959` (Bern).
|
|
65
|
-
- [`extent="830634,5923959,831634,5933959"`](https://mobility-web-component.geops.io/?extent=830634,5923959,831634,5933959): the extent of the map of the map in EPSG:3857 coordinates. It has the priority over `center` and `zoom` attributes.
|
|
66
|
-
- [`geolocation="false"`](https://mobility-web-component.geops.io/?geolocation=false): display the geolocation button or not (true or false). Default to true.
|
|
67
|
-
- [`mapsurl="https://maps.geops.io"`](https://mobility-web-component.geops.io/?mapsurl=https://maps.geops.io): the [geOps Maps API](https://developer.geops.io/apis/maps) url to use.Default to `https://maps.geops.io`.
|
|
68
|
-
- [`maxextent="830634,5923959,831634,5933959"`](https://mobility-web-component.geops.io/?extent=830634,5923959,831634,5933959): constraint the map in a specific extent in EPSG:3857 coordinates, the user can not navigate outside this extent.
|
|
69
|
-
- [`maxzoom="14"`](https://mobility-web-component.geops.io/?maxzoom=14): define the max zoom level of the map.
|
|
70
|
-
- [`minzoom="2"`](https://mobility-web-component.geops.io/?minzoom=2): define the min zoom level of the map.
|
|
71
|
-
- [`mots="rail,bus"`](https://mobility-web-component.geops.io/?mots=rail,bus): list of commas separated mots to display on the Realtime layer ( rail, bus, coach, foot, tram, subway, gondola, funicular, ferry, car).
|
|
72
|
-
- [`notification="false"`](https://mobility-web-component.geops.io/?notification=true): display the notification layer or not (true or false). Default to true.
|
|
73
|
-
- [`notificationat="2025-01-01T12:00:00Z"`](https://mobility-web-component.geops.io/?notificationat=2025-01-01T12:00:00Z): a ISO date string used to display active notification at this date in the notification layer.
|
|
74
|
-
- [`notificationtenant=`](https://mobility-web-component.geops.io/?notificationtenant=): the MOCO notification tenant to get the notifications from.
|
|
75
|
-
- [`notificationurl=`](https://mobility-web-component.geops.io/?notificationurl=): the MOCO notification url to get the notifications from.
|
|
76
|
-
- [`permalink="true"`](https://mobility-web-component.geops.io/?permalink=true): add automatically an `x`,`y` an `z` URL parameters to the URL to allow to share the current map view. Default to false.
|
|
77
|
-
- [`realtime="false"`](https://mobility-web-component.geops.io/?realtime=false): display the realtime layer or not (true or false). Default to true.
|
|
78
|
-
- [`realtimeurl="wss://api.geops.io/tracker-ws/v1/ws"`](https://mobility-web-component.geops.io/?realtimeurl=wss://api.geops.io/tracker-ws/v1/ws): the [geOps Realtime API](https://developer.geops.io/apis/realtime) url to use. Default to `wss://api.geops.io/tracker-ws/v1/ws`.
|
|
79
|
-
- [`search="false"`](https://mobility-web-component.geops.io/?search=false): display the search stops input or not (true or false). Default to true.
|
|
80
|
-
- [`stopsurl="https://api.geops.io/stops/v1/"`](https://mobility-web-component.geops.io/?stopsurl=https://api.geops.io/stops/v1/): the [geOps Stops API](https://developer.geops.io/apis/stops) url to use. Default to `https://api.geops.io/stops/v1/`.
|
|
81
|
-
- [`tenant="sbb"`](https://mobility-web-component.geops.io/?tenant=sbb): the tenant name to use to filter the Realtime vehicles available.
|
|
82
|
-
- [`zoom="13"`](https://mobility-web-component.geops.io/?zoom=13): the zoom level of the map. Default to 13.
|
|
83
|
-
|
|
84
|
-
### URL parameters
|
|
85
|
-
|
|
86
|
-
You can specify all the web component attributes as url parameters to the demo app to customize easily the map.
|
|
87
|
-
|
|
88
|
-
- [`/?apikey=YOUR_API_KEY`](https://mobility-web-component.geops.io/?apikey=YOUR_API_KEY)
|
|
89
|
-
- [`/?baselayer=travic_v2`](https://mobility-web-component.geops.io/?baselayer=travic_v2)
|
|
90
|
-
- [`/?center=831634,5933959`](https://mobility-web-component.geops.io/?center=831634,5933959)
|
|
91
|
-
- [`/?geolocation=false`](https://mobility-web-component.geops.io/?geolocation=false)
|
|
92
|
-
- [`/?mapsurl=https://maps.geops.io`](https://mobility-web-component.geops.io/?mapsurl=https://maps.geops.io)
|
|
93
|
-
- [`/?maxzoom=14`](https://mobility-web-component.geops.io/?maxzoom=14)
|
|
94
|
-
- [`/?minzoom=2`](https://mobility-web-component.geops.io/?minzoom=2)
|
|
95
|
-
- [`/?mots=rail,bus`](https://mobility-web-component.geops.io/?mots=rail,bus)
|
|
96
|
-
- [`/?notification=false`](https://mobility-web-component.geops.io/?notification=true)
|
|
97
|
-
- [`/?notificationat=2025-01-01T12:00:00Z`](https://mobility-web-component.geops.io/?notificationat=2025-01-01T12:00:00Z)
|
|
98
|
-
- [`/?notificationbeforelayerid=`](https://mobility-web-component.geops.io/?notificationbeforelayerid=)
|
|
99
|
-
- [`/?notificationurl=`](https://mobility-web-component.geops.io/?notificationurl=)
|
|
100
|
-
- [`/?permalink=true`](https://mobility-web-component.geops.io/?permalink=true)
|
|
101
|
-
- [`/?realtime=false`](https://mobility-web-component.geops.io/?realtime=false)
|
|
102
|
-
- [`/?realtimeurl=wss://api.geops.io/tracker-ws/v1/ws`](https://mobility-web-component.geops.io/?realtimeurl=wss://api.geops.io/tracker-ws/v1/ws)
|
|
103
|
-
- [`/?search=false`](https://mobility-web-component.geops.io/?search=false)
|
|
104
|
-
- [`/?stopsurl=https://api.geops.io/stops/v1/`](https://mobility-web-component.geops.io/?stopsurl=https://api.geops.io/stops/v1/)
|
|
105
|
-
- [`/?tenant=sbb`](https://mobility-web-component.geops.io/?tenant=sbb)
|
|
106
|
-
- [`/?zoom=13`](https://mobility-web-component.geops.io/?zoom=13)
|
|
107
|
-
|
|
108
|
-
Another url parameter is used to get a full screen map instead of the documentation:
|
|
109
|
-
|
|
110
|
-
- [`/?fullscreen=true`](https://mobility-web-component.geops.io/?fullscreen=true): display the web component in full screen mode.
|
|
111
|
-
|
|
112
|
-
## `<geops-mobility-search>` web component
|
|
113
|
-
|
|
114
|
-
A search input to search stops using the [geOps Stops API](https://developer.geops.io/apis/stops).
|
|
115
|
-
|
|
116
|
-
### Demo
|
|
117
|
-
|
|
118
|
-
You can see the web component in action using the [demo app](https://mobility-web-component.geops.io/search.html).
|
|
119
|
-
|
|
120
|
-
### Usage Example
|
|
121
|
-
|
|
122
|
-
```html
|
|
123
|
-
<html>
|
|
124
|
-
<body>
|
|
125
|
-
<script type="module" src="https://www.unpkg.com/@geops/mobility-web-component)"></script>
|
|
126
|
-
<geops-mobility-search
|
|
127
|
-
apikey="YOUR_GEOPS_API_KEY"
|
|
128
|
-
limit="5"
|
|
129
|
-
mots="rail,bus"
|
|
130
|
-
style="display: block;width: 800px;height: 800px;">
|
|
131
|
-
</geops-mobility>
|
|
132
|
-
</body>
|
|
133
|
-
</html>
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### Attributes
|
|
137
|
-
|
|
138
|
-
Every parameters of the [geOps Stops API](https://developer.geops.io/apis/stops) can be passed as a string attribute of the web component.
|
|
139
|
-
|
|
140
|
-
The list of parameters of the [geOps Stops API](https://developer.geops.io/apis/stops) can be found
|
|
141
|
-
[here](https://developer.geops.io/apis/stops#parameters).
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
### URL parameters
|
|
145
|
-
|
|
146
|
-
All the web component attributes can be specified as url parameters to the demo app to customize easily the search.
|
|
147
|
-
|
|
148
|
-
Another url parameter is used to get a full screen map instead of the documentation:
|
|
149
|
-
|
|
150
|
-
- [`/?fullscreen=true`](https://mobility-web-component.geops.io/search.html?fullscreen=true): display the web component in full screen mode.
|
|
40
|
+
If supported, you can see the web-component in fullscreen mode using the URL parameter `fullscreen=true`:
|
|
151
41
|
|
|
152
42
|
## Development
|
|
153
43
|
|
|
154
44
|
If you want only the basic HTML, faster development process.
|
|
45
|
+
|
|
155
46
|
```bash
|
|
156
47
|
corepack enable
|
|
157
48
|
yarn install
|
|
158
49
|
yarn start
|
|
159
50
|
```
|
|
160
51
|
|
|
161
|
-
If you want the documentation website:
|
|
52
|
+
If you want the NextJS documentation website:
|
|
162
53
|
|
|
163
54
|
```bash
|
|
164
55
|
corepack enable
|
|
@@ -166,15 +57,17 @@ yarn install && cd doc && yarn install
|
|
|
166
57
|
yarn doc
|
|
167
58
|
```
|
|
168
59
|
|
|
169
|
-
|
|
170
60
|
## Deployment
|
|
171
61
|
|
|
172
|
-
The
|
|
62
|
+
The NextJS documentation website is deployed automatically after a merge on master using Vercel, on
|
|
173
63
|
[https://mobility-web-component.geops.io/](https://mobility-web-component.geops.io/).
|
|
174
64
|
|
|
65
|
+
For forked project, the static index.html file is enough as documentation for the client. No need to provide the NextJS documentation website.
|
|
66
|
+
Just set it up properly in vercel. See [RVF configuration](https://vercel.com/geops/rvf-mobility-web-component) for an example.
|
|
67
|
+
|
|
175
68
|
## Guidelines
|
|
176
69
|
|
|
177
|
-
- every new components must have a new folder `MyComponent` with an `index.tsx` that contains only an export and a `MyNewComponent.tsx` file. The reason is too
|
|
70
|
+
- every new components must have a new folder `MyComponent` with an `index.tsx` that contains only an export and a `MyNewComponent.tsx` file. The reason is too simplify the override in forked project.
|
|
178
71
|
|
|
179
72
|
## Client specific code
|
|
180
73
|
|
|
@@ -185,7 +78,7 @@ Never add custom client specific stuff in this repository, instead:
|
|
|
185
78
|
- change the package name in `package.json` to `@geops/trenord-mobility-web-component`.
|
|
186
79
|
- change the `README` and `index.html` titles.
|
|
187
80
|
- create a new `MobilityMap` component in `src/` called `TrenordMobilityMap`. In this component you can copy the content of `MobilityMap` or just use the `MobilityMap` component with default values. It depends of your use case.
|
|
188
|
-
- change the `MobilityMap` import to `TrenordMobilityMap` in `src/index.tsx`.
|
|
81
|
+
- change the `MobilityMap` import to `TrenordMobilityMap` in `src/MobilityMap/index.tsx`.
|
|
189
82
|
- create a new npm package on `npmjs.com` from this repository, and call it `@geops/trenord-mobility-web-component`.
|
|
190
83
|
- publish a beta version to test the publishing with `ỳarn publish:beta`
|
|
191
84
|
|
|
@@ -205,5 +98,5 @@ When you use a fork you can merge the upstream repository using:
|
|
|
205
98
|
// Set up the upstream remote, to do only once
|
|
206
99
|
git remote add upstream git@github.com:geops/mobility-web-component.git
|
|
207
100
|
|
|
208
|
-
|
|
101
|
+
yarn upstream
|
|
209
102
|
```
|
package/docutils.js
CHANGED
|
@@ -105,7 +105,7 @@ function generateAttributesTable(
|
|
|
105
105
|
class="border"
|
|
106
106
|
name="${key}"
|
|
107
107
|
${checked ? "checked" : ""}
|
|
108
|
-
onchange="document.querySelector('${wc.localName}').setAttribute('${key}', this.checked);onAttributeUpdate(document.querySelector('${wc.localName}'),this.name, this.checked, '${reloadAttrs.join(",")}');"
|
|
108
|
+
onchange="document.querySelector('${wc.localName}').setAttribute('${key}', this.checked);onAttributeUpdate(document.querySelector('${wc.localName}'),this.name, this.checked, '${reloadAttrs.join(",")}');"
|
|
109
109
|
/>`
|
|
110
110
|
: `
|
|
111
111
|
<input
|
package/index.html
CHANGED
|
@@ -37,6 +37,8 @@
|
|
|
37
37
|
class="absolute inset-0 flex h-full w-full table-auto gap-4 flex-col border bg-black p-0 px-4 py-2 pt-2 text-white hover:bg-gray-700"
|
|
38
38
|
style="display: none"
|
|
39
39
|
></div>
|
|
40
|
+
</script>
|
|
41
|
+
<button onclick="document.getElementById('map').setAttribute('center', '877430.64,6118377.18');document.getElementById('map').setAttribute('zoom','17.02');">Center and zoom to Denzligen</button>
|
|
40
42
|
<div class="pt-2" style="display: none"></div>
|
|
41
43
|
<div id="doc" style="display: none" class="mx-auto max-w-3xl space-y-4">
|
|
42
44
|
<h1 class="flex gap-4"><img src="./Logo.svg">Mobility Web Component</h1>
|
|
@@ -48,7 +50,9 @@
|
|
|
48
50
|
></pre>
|
|
49
51
|
|
|
50
52
|
<geops-mobility
|
|
53
|
+
id="map"
|
|
51
54
|
class="block h-128 w-full resize overflow-hidden rounded-2xl border"
|
|
55
|
+
zoom="20"
|
|
52
56
|
></geops-mobility>
|
|
53
57
|
|
|
54
58
|
<br />
|