@geops/rvf-mobility-web-component 0.1.60 → 0.1.62

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.
Files changed (73) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +1 -0
  3. package/docutils.js +103 -4
  4. package/fonts/source-sans-3/source-sans-3-v15-latin-500.ttf +0 -0
  5. package/fonts/source-sans-3/source-sans-3-v15-latin-500.woff2 +0 -0
  6. package/fonts/source-sans-3/source-sans-3-v15-latin-600.ttf +0 -0
  7. package/fonts/source-sans-3/source-sans-3-v15-latin-600.woff2 +0 -0
  8. package/fonts/source-sans-3/source-sans-3-v15-latin-700.ttf +0 -0
  9. package/fonts/source-sans-3/source-sans-3-v15-latin-700.woff2 +0 -0
  10. package/fonts/source-sans-3/source-sans-3-v15-latin-regular.ttf +0 -0
  11. package/fonts/source-sans-3/source-sans-3-v15-latin-regular.woff2 +0 -0
  12. package/index.html +28 -94
  13. package/index.js +235 -224
  14. package/notifications.html +144 -0
  15. package/package.json +2 -2
  16. package/search.html +24 -65
  17. package/src/FeatureDetails/FeatureDetails.tsx +20 -6
  18. package/src/FeaturesInfosListener/FeaturesInfosListener.tsx +2 -0
  19. package/src/LayerTree/TreeItem/TreeItem.tsx +2 -2
  20. package/src/LayerTreeMenu/LayerTreeMenu.tsx +19 -3
  21. package/src/LayoutState/LayoutState.tsx +17 -0
  22. package/src/LinesNetworkPlanDetails/LinesNetworkPlanDetails.tsx +34 -21
  23. package/src/LinesNetworkPlanLayer/LinesNetworkPlanLayer.tsx +3 -6
  24. package/src/LinesNetworkPlanLayerHighlight/LinesNetworkPlanLayerHighlight.tsx +88 -0
  25. package/src/LinesNetworkPlanLayerHighlight/index.tsx +1 -0
  26. package/src/MapDispatchEvents/MapDispatchEvents.tsx +6 -4
  27. package/src/MapLayout/MapLayout.tsx +2 -2
  28. package/src/MapsetLayer/MapsetLayer.tsx +116 -0
  29. package/src/MapsetLayer/index.tsx +1 -0
  30. package/src/MobilityMap/MobilityMap.tsx +27 -5
  31. package/src/MobilityMap/MobilityMapAttributes.test.ts +38 -0
  32. package/src/MobilityMap/MobilityMapAttributes.ts +99 -22
  33. package/src/MobilityMap/MobilityMapEvents.ts +53 -0
  34. package/src/MobilityNotifications/MobilityNotifications.tsx +93 -0
  35. package/src/MobilityNotifications/MobilityNotificationsAttributes.test.ts +21 -0
  36. package/src/MobilityNotifications/MobilityNotificationsAttributes.ts +46 -0
  37. package/src/MobilityNotifications/index.ts +2 -0
  38. package/src/MobilitySearch/MobilitySearchEvents.ts +21 -0
  39. package/src/NotificationDetails/NotificationDetails.tsx +74 -251
  40. package/src/OverlayContent/OverlayContent.tsx +1 -1
  41. package/src/OverlayDetails/OverlayDetails.tsx +4 -2
  42. package/src/OverlayFooter/OverlayFooter.tsx +3 -2
  43. package/src/RealtimeLayer/RealtimeLayer.tsx +36 -7
  44. package/src/RouteScheduleFooter/RouteScheduleFooter.tsx +1 -2
  45. package/src/RvfFeatureDetails/RvfFeatureDetails.tsx +2 -2
  46. package/src/RvfFeatureDetails/RvfLineNetworkDetails/RvfLineNetworkDetails.tsx +2 -0
  47. package/src/RvfFeatureDetails/RvfNotificationDetails/RvfNotificationDetails.tsx +12 -453
  48. package/src/RvfFeatureDetails/RvfSellingPointDetails/RvfSellingPointDetails.tsx +20 -17
  49. package/src/RvfFeatureDetails/RvfSharedMobilityDetail/RvfSharedMobilityDetails.tsx +93 -36
  50. package/src/RvfLink/RvfLink.tsx +5 -2
  51. package/src/RvfMobilityMap/RvfMobilityMap.tsx +28 -11
  52. package/src/RvfSelectedFeatureHighlightLayer/RvfSelectedFeatureHighlightLayer.tsx +9 -5
  53. package/src/RvfSingleClickListener/RvfSingleClickListener.tsx +3 -1
  54. package/src/SituationDetails/SituationDetails.tsx +324 -0
  55. package/src/SituationDetails/index.ts +1 -0
  56. package/src/index.tsx +16 -0
  57. package/src/indexDoc.ts +25 -3
  58. package/src/ui/Checkbox/Checkbox.tsx +2 -2
  59. package/src/ui/Link/Link.tsx +49 -0
  60. package/src/ui/Link/index.tsx +1 -0
  61. package/src/ui/Select/Select.tsx +2 -2
  62. package/src/utils/constants.ts +37 -0
  63. package/src/utils/exportPdf.ts +3 -1
  64. package/src/utils/highlightLinesNetworkPlan.ts +25 -0
  65. package/src/utils/hooks/useI18n.tsx +6 -4
  66. package/src/utils/hooks/useInitialPermalink.tsx +9 -2
  67. package/src/utils/hooks/useMapContext.tsx +9 -0
  68. package/src/utils/sharingGraphqlUtils.ts +1 -1
  69. package/src/utils/translations.ts +12 -1
  70. package/tailwind.config.mjs +3 -1
  71. package/src/ShareMenu/PermalinkButton/PermalinkButton.tsx +0 -62
  72. package/src/ShareMenu/PermalinkButton/index.tsx +0 -1
  73. package/src/icons/Geolocation/airport-14-svgrepo-com.svg +0 -41
@@ -9,15 +9,17 @@ import {
9
9
 
10
10
  // import type { LayersConfig } from "../utils/hooks/useLayerConfig";
11
11
 
12
- // const geopsApiLink = `<a href="https://developer.geops.io/">geOps API key</a>`;
13
- // const geopsMapsApiLink = `<a href="https://developer.geops.io/apis/maps">geOps Maps API</a>`;
14
- // const geopsStopsApiLink = `<a href="https://developer.geops.io/apis/stops">geOps Stops API</a>`;
12
+ const geopsApiLink = `<a href="https://developer.geops.io/">geOps API key</a>`;
13
+ const geopsMapsApiLink = `<a href="https://developer.geops.io/apis/maps">geOps Maps API</a>`;
14
+ const geopsStopsApiLink = `<a href="https://developer.geops.io/apis/stops">geOps Stops API</a>`;
15
15
  const geopsMocoApiLink = `<a href="https://geops.com/en/solution/disruption-information">geOps MOCO API</a>`;
16
- // const geopsRealtimeApiLink = `<a href="https://developer.geops.io/apis/realtime">geOps Realtime API</a>`;
16
+ const geopsMapsetApiLink = `<a href="https://geops.com/en/solution/mapset">geOps Mapset API</a>`;
17
+ const geopsRealtimeApiLink = `<a href="https://developer.geops.io/apis/realtime">geOps Realtime API</a>`;
17
18
 
18
19
  export interface WebComponentAttributeDoc {
19
20
  defaultValue?: string;
20
21
  description: string;
22
+ public?: boolean;
21
23
  type?: "boolean" | undefined;
22
24
  }
23
25
 
@@ -33,9 +35,15 @@ export type MobilityMapAttributeName =
33
35
  | "layers"
34
36
  | "layersconfig"
35
37
  | "layertree"
38
+ | "lines"
36
39
  | "lnp"
37
40
  | "mainlink"
38
41
  | "mainlinktitle"
42
+ | "mapset"
43
+ | "mapsetbbox"
44
+ | "mapsetplanid"
45
+ | "mapsettenants"
46
+ | "mapseturl"
39
47
  | "mapsurl"
40
48
  | "maxextent"
41
49
  | "maxzoom"
@@ -69,46 +77,55 @@ export type MobilityMapAttributes = Record<
69
77
  const attrs: MobilityMapAttributes = {
70
78
  apikey: {
71
79
  defaultValue: "5cc87b12d7c5370001c1d655820abcc37dfd4d968d7bab5b2a74a935",
72
- description: null, //`Your ${geopsApiLink}`,
80
+ description: `Your ${geopsApiLink}`,
81
+ public: false,
73
82
  },
74
83
  baselayer: {
75
84
  defaultValue: "de.rvf_moco",
76
- description: null, //`The style's name from the ${geopsMapsApiLink}. <br/>Ex: base_dark_v2, base_bright_v2, ...`,
85
+ description: `The style's name from the ${geopsMapsApiLink}. <br/>Ex: base_dark_v2, base_bright_v2, ...`,
86
+ public: false,
77
87
  },
78
88
  center: {
79
89
  description:
80
90
  "The center of the map in EPSG:3857 coordinates.<br/>Parameter required if extent is not set.",
91
+ public: true,
81
92
  },
82
93
  details: {
83
94
  defaultValue: "true",
84
95
  description:
85
96
  "When a feature of a queryable layer is clicked, it displays informations about it.",
97
+ public: true,
86
98
  type: "boolean",
87
99
  },
88
100
  embed: {
89
101
  defaultValue: "false",
90
102
  description:
91
103
  "Toggle the embedded navigation mode.<br/>In this mode zooming with mouse wheel is deactivated and, on touch device, you can only navigate with two finger, a warning message is displayed to warn the user.",
104
+ public: true,
92
105
  type: "boolean",
93
106
  },
94
107
  extent: {
95
108
  defaultValue: MAX_EXTENT.join(","),
96
109
  description:
97
110
  "The map's extent in EPSG:3857 coordinates.<br/>Ex: 831634,5933959,940649,6173660 .<br/>Parameter required if center and zoom are not set.",
111
+ public: true,
98
112
  },
99
113
  geolocation: {
100
114
  defaultValue: "true",
101
115
  description: "Toggle the display of the geolocation button or not.",
116
+ public: true,
102
117
  type: "boolean",
103
118
  },
104
119
  lang: {
105
120
  defaultValue: "de",
106
- description: null,
107
- // "The language to use for the map. Supported languages are : de, en, fr, it.",
121
+ description:
122
+ "The language to use for the map. Supported languages are : de, en, fr, it.",
123
+ public: false,
108
124
  },
109
125
  layers: {
110
126
  defaultValue: null,
111
127
  description: `A comma separated list of layers's name to make visible on load, others are hidden. If empty, all layers will be hidden except the baselayer.<br/>Layers available are ${Object.values(LAYERS_NAMES).join(", ")}.`,
128
+ public: true,
112
129
  },
113
130
  layersconfig: {
114
131
  description: `A JSON string to configure the layers and other components associated to it.<br/>
@@ -135,15 +152,22 @@ where:
135
152
  </ul>
136
153
  <li><i>title</i> is the title of the layer used in the details view header and in the layer tree, if not defined the layer name will be used.</li>
137
154
  </ul>`,
155
+ public: true,
138
156
  },
139
157
  layertree: {
140
158
  defaultValue: "true",
141
159
  description: "Show/hide the layers tree button in the toolbar.",
160
+ public: true,
142
161
  type: "boolean",
143
162
  },
163
+ lines: {
164
+ description: `A comma separated list of line ids to highlight on the linesnetworkplan layer. The line ids are the original_line_id property of the lines in the network plan.<br/>Ex: S1,RE10,RE1.`,
165
+ public: false,
166
+ },
144
167
  lnp: {
145
168
  defaultValue: "true",
146
- description: null,
169
+ description: `Add the linesnetworkplans layer to the map. This layer will display lines network plans on the map.`,
170
+ public: false,
147
171
  type: "boolean",
148
172
  },
149
173
  mainlink: {
@@ -153,45 +177,83 @@ where:
153
177
  mainlinktitle: {
154
178
  description: "A title for the mainlink, used as tooltip.",
155
179
  },
180
+ mapset: {
181
+ defaultValue: "false",
182
+ description: `Add the mapset layer to the map. This layer will display mapset plans on the map.`,
183
+ public: true,
184
+ type: "boolean",
185
+ },
186
+ mapsetbbox: {
187
+ description:
188
+ "The BBOX to constrain the boundary of the mapset layer in EPSG:3857 coordinates. Mandatory for mapset layer. <br/>Ex: 831634,5933959,940649,6173660 .",
189
+ public: false,
190
+ },
191
+ mapsetplanid: {
192
+ description: "The id of the mapset plan to display.",
193
+ public: false,
194
+ },
195
+ mapsettenants: {
196
+ defaultValue: "geopstest",
197
+ description: `The ${geopsMapsetApiLink} tenant to get the mapset from.`,
198
+ public: true,
199
+ },
200
+ mapseturl: {
201
+ defaultValue: "https://editor.mapset.io/api/v1",
202
+ description: `The ${geopsMapsetApiLink} url to use.`,
203
+ public: true,
204
+ },
156
205
  mapsurl: {
157
206
  defaultValue: "https://maps.geops.io",
158
- description: null,
207
+ description: `The ${geopsMapsApiLink} url to use.`,
208
+ public: false,
159
209
  },
160
210
  maxextent: {
161
211
  defaultValue: MAX_EXTENT.join(","),
162
212
  description:
163
213
  "The maximum extent of the map in EPSG:3857 coordinates.<br/>Ex: 831634,5933959,940649,6173660 .",
214
+ public: true,
164
215
  },
165
216
  maxzoom: {
166
217
  defaultValue: "20",
167
218
  description: "The maximal zoom level of the map.",
219
+ public: true,
168
220
  },
169
221
  minzoom: {
170
222
  description: "The minimal zoom level of the map.",
223
+ public: true,
171
224
  },
172
225
  mots: {
173
- description: null,
226
+ description:
227
+ "Commas separated list of mots to display on the Realtime layer.<br/>Ex: rail,bus,coach,foot,tram,subway,gondola,funicular,ferry,car .",
228
+ public: false,
174
229
  },
175
230
  notification: {
176
231
  defaultValue: "true",
177
232
  description: `Add the notification layer to the map. This layer will display informations about disruptions on the network. Data comes from
178
233
  our ${geopsMocoApiLink} .`,
234
+ public: true,
179
235
  type: "boolean",
180
236
  },
181
237
  notificationat: {
182
- description: null,
238
+ description:
239
+ "An ISO date string used to display active notification at this date in the notification layer. If not defined the current date will be used.<br/>Ex: 2025-08-01T00:00:00Z .",
240
+ public: false,
183
241
  },
184
242
  notificationtenant: {
185
243
  defaultValue: "rvf",
186
- description: null,
244
+ description: `The ${geopsMocoApiLink} tenant to get the notification from.`,
245
+ public: false,
187
246
  },
188
247
  notificationurl: {
189
248
  defaultValue: "https://moco.geops.io/api/v2/",
190
- description: null,
249
+ description: `The ${geopsMocoApiLink} url to use.`,
250
+ public: false,
191
251
  },
192
252
  permalink: {
193
253
  defaultValue: "false",
194
- description: null, //"Update some url parameters x,y,z,layers to the current window location. These parameters are used to store the current state of the map. They will be used on page load to configure the web-component.",
254
+ description:
255
+ "Update some url parameters x,y,z,layers to the current window location. These parameters are used to store the current state of the map. They will be used on page load to configure the web-component.",
256
+ public: false,
195
257
  type: "boolean",
196
258
  },
197
259
  permalinktemplate: {
@@ -199,63 +261,78 @@ where:
199
261
  description: `A template string to read the current browser url. Hash (starting with #) and URL search parameters (starting with ?) are supported.<br/>
200
262
  The template supports {{x}}, {{y}}, {{z}} variables.<br/>
201
263
  Ex: "?x={{x}}&y={{y}}&z={{z}}" or "#map/{{x}}/{{y}}/{{z}}" .`,
264
+ public: true,
202
265
  },
203
266
  print: {
204
267
  defaultValue: "true",
205
268
  description: "Show/hide the print button in the toolbar.",
269
+ public: true,
206
270
  type: "boolean",
207
271
  },
208
272
  queryablelayers: {
209
273
  defaultValue: DEFAULT_QUERYABLE_LAYERS.toString(),
210
274
  description: `A comma separated list of layers's name. The data of these layers will be queryable by click on the map (see selectedfeature event). If empty, all layers will not be queryable.<br/>
211
- Layers available are ${Object.values(LAYERS_NAMES).join(", ")}`,
275
+ Layers available are ${Object.values(LAYERS_NAMES).join(", ")}`,
276
+ public: true,
212
277
  },
213
278
  realtime: {
214
279
  defaultValue: "true",
215
- description: null,
280
+ description: `Add the realtime layer to the map. Data comes from the ${geopsRealtimeApiLink} .`,
281
+ public: false,
216
282
  type: "boolean",
217
283
  },
218
284
  realtimebboxparameters: {
219
285
  defaultValue: "line_tags=RVF",
220
- description: null,
286
+ description:
287
+ "A space separated list of parameters to add to the realtime BBOX request to define custom behavior.<br/>Ex: graph=XXX line_tags=XXX.",
288
+ public: false,
221
289
  },
222
290
  realtimetenant: {
223
- description: null,
291
+ description: `The ${geopsRealtimeApiLink} tenant to get the realtime data from.`,
292
+ public: false,
224
293
  },
225
294
  realtimeurl: {
226
295
  defaultValue: "wss://api.geops.io/tracker-ws/v1/ws",
227
- description: null,
296
+ description: `The ${geopsRealtimeApiLink} url to use.`,
297
+ public: false,
228
298
  },
229
299
  runs: {
230
300
  defaultValue: "false",
231
301
  description:
232
302
  "Shows the number of trips on a line in the sidebar, use only for debugging.",
303
+ public: true,
233
304
  type: "boolean",
234
305
  },
235
306
  search: {
236
307
  defaultValue: "false",
237
308
  description: "Toggle the search stops input.",
309
+ public: true,
238
310
  type: "boolean",
239
311
  },
240
312
  share: {
241
313
  defaultValue: "true",
242
314
  description: "Show/hide the share button in the toolbar.",
315
+ public: true,
243
316
  type: "boolean",
244
317
  },
245
318
  stopsurl: {
246
319
  defaultValue: "https://api.geops.io/stops/v1/",
247
- description: null,
320
+ description: `The ${geopsStopsApiLink} to use.`,
321
+ public: false,
248
322
  },
249
323
  tenant: {
250
- description: null,
324
+ description: `The tenant to use by default for all geOps APIs (Stops, Realtime, MOCO ...). Can be override for each API by other XXXXtenant parameters.`,
325
+ public: false,
251
326
  },
252
327
  toolbar: {
253
328
  defaultValue: "true",
254
329
  description: "Show/hide the toolbar on the top left.",
330
+ public: true,
255
331
  type: "boolean",
256
332
  },
257
333
  zoom: {
258
334
  description: "The zoom level of the map.",
335
+ public: true,
259
336
  },
260
337
  };
261
338
 
@@ -0,0 +1,53 @@
1
+ export interface WebComponentEventDoc {
2
+ description: string;
3
+ public?: boolean;
4
+ }
5
+
6
+ export type MobilityMapEventName =
7
+ | "mwc:attribute"
8
+ | "mwc:messageready"
9
+ | "mwc:permalink"
10
+ | "mwc:selectedfeature"
11
+ | "mwc:singleclick"
12
+ | "mwc:stopssearchselect";
13
+
14
+ export type MobilityMapEvents = Record<
15
+ MobilityMapEventName,
16
+ WebComponentEventDoc
17
+ >;
18
+
19
+ const attrs: MobilityMapEvents = {
20
+ "mwc:attribute": {
21
+ description:
22
+ "Event fired when an web component's attribute is changed. The event data contains the list of all attributes and their values.",
23
+ public: false,
24
+ },
25
+ "mwc:messageready": {
26
+ description:
27
+ "Only if the web-component is embedded in an iframe. Message event fired when the web component is ready to receive messages from parent window.",
28
+
29
+ public: false,
30
+ },
31
+ "mwc:permalink": {
32
+ description:
33
+ "Event fired when the map's state changes. The event data contains the permalink URL search parameters as string.",
34
+ public: false,
35
+ },
36
+ "mwc:selectedfeature": {
37
+ description:
38
+ "Event fired when a feature is selected on the map. The event data contains the selected feature in GeoJSON format.",
39
+ public: true,
40
+ },
41
+ "mwc:singleclick": {
42
+ description:
43
+ "Event fired when the map is clicked. The event data contains the map coordinates in EPSG:3857 and the pixel coordinates.",
44
+ public: false,
45
+ },
46
+ "mwc:stopssearchselect": {
47
+ description:
48
+ "Only when search attribute is 'true'. Event fired when a stop is selected in the stops search results. The event data contains the selected stop.",
49
+ public: false,
50
+ },
51
+ };
52
+
53
+ export default attrs;
@@ -0,0 +1,93 @@
1
+ import { MocoAPI } from "mobility-toolbox-js/ol";
2
+ import { memo, useEffect, useState } from "preact/compat";
3
+
4
+ import SituationDetails from "../SituationDetails";
5
+ import { I18nContext } from "../utils/hooks/useI18n";
6
+ import i18n from "../utils/i18n";
7
+
8
+ import MobilityNotificationsAttributes from "./MobilityNotificationsAttributes";
9
+
10
+ // @ts-expect-error tailwind must be added for the search web component
11
+ import tailwind from "../style.css";
12
+
13
+ import type { SituationType } from "mobility-toolbox-js/types";
14
+
15
+ import type { MobilityNotificationsAttributeName } from "./MobilityNotificationsAttributes";
16
+
17
+ export type MobilityNotificationsProps = Record<
18
+ MobilityNotificationsAttributeName,
19
+ null | string | undefined
20
+ >;
21
+
22
+ function MobilityNotifications({
23
+ apikey,
24
+ lang,
25
+ notificationtenant,
26
+ notificationurl,
27
+ }: MobilityNotificationsProps) {
28
+ const [situations, setSituations] = useState<SituationType[]>([]);
29
+
30
+ useEffect(() => {
31
+ new MocoAPI({
32
+ apiKey: apikey || undefined,
33
+ tenant: notificationtenant,
34
+ url: notificationurl,
35
+ })
36
+ .export({
37
+ contentMedium: true,
38
+ graph:
39
+ "np_topo4,np_topo5,np_topo6,np_topo7,np_topo8,np_topo9,np_topo10,np_topo11,np_topo12,np_topo13,np_topo14,np_topo15,osm",
40
+ hasGeoms: true,
41
+ publicAt: "2025-10-10T10:03:31.650Z",
42
+ })
43
+ .then((data) => {
44
+ if (data?.paginatedSituations?.results) {
45
+ setSituations(data.paginatedSituations.results);
46
+ }
47
+ })
48
+ .catch((e) => {
49
+ // eslint-disable-next-line no-console
50
+ console.error(e);
51
+ });
52
+ }, [apikey, notificationurl, notificationtenant]);
53
+
54
+ useEffect(() => {
55
+ i18n.locale(lang);
56
+ }, [lang]);
57
+
58
+ return (
59
+ <I18nContext.Provider value={i18n}>
60
+ <style>{tailwind}</style>
61
+ <div className="flex w-full flex-col gap-6">
62
+ {situations?.map((situation) => {
63
+ return (
64
+ <SituationDetails
65
+ canToggle={true}
66
+ headerClassName="text-rvf-h3 font-semibold"
67
+ iconClassName="w-8 h-8 text-red"
68
+ key={situation.id}
69
+ reasonClassName="hidden"
70
+ situation={situation}
71
+ timeIntervalClassName="pl-1 text-base py-3 font-semibold text-balance"
72
+ useShortMonth={false}
73
+ ></SituationDetails>
74
+ );
75
+ })}
76
+ </div>
77
+ </I18nContext.Provider>
78
+ );
79
+ }
80
+
81
+ // We creates a wrapper to inject the default props values from MobilityMapAttributes.
82
+ const defaultProps = {};
83
+ Object.entries(MobilityNotificationsAttributes).forEach(([key]) => {
84
+ defaultProps[key] = MobilityNotificationsAttributes[key].defaultValue || null;
85
+ });
86
+
87
+ function MobilityNotificationsWithDefaultProps(
88
+ props: MobilityNotificationsProps,
89
+ ) {
90
+ return <MobilityNotifications {...defaultProps} {...props} />;
91
+ }
92
+
93
+ export default memo(MobilityNotificationsWithDefaultProps);
@@ -0,0 +1,21 @@
1
+ import attributes from "./MobilityNotificationsAttributes";
2
+
3
+ describe("MobilityMapAttributes", () => {
4
+ Object.entries(attributes).forEach(([key, value]) => {
5
+ test(`${key} has a description`, () => {
6
+ expect(value.description).toBeDefined();
7
+ });
8
+
9
+ if (value.type === "boolean") {
10
+ test(`${key} has a defaultValue for boolean`, () => {
11
+ expect(value.defaultValue).toMatch(/^(true|false)$/);
12
+ });
13
+ }
14
+
15
+ if (value.defaultValue === "true" || value.defaultValue === "false") {
16
+ test(`${key} is boolean when defaultValue is true or false`, () => {
17
+ expect(value.type).toBe("boolean");
18
+ });
19
+ }
20
+ });
21
+ });
@@ -0,0 +1,46 @@
1
+ import type { WebComponentAttributeDoc } from "../MobilityMap/MobilityMapAttributes";
2
+
3
+ const geopsApiLink = `<a href="https://developer.geops.io/">geOps API key</a>`;
4
+ const geopsMocoApiLink = `<a href="https://geops.com/en/solution/disruption-information">geOps MOCO API</a>`;
5
+
6
+ export type MobilityNotificationsAttributeName =
7
+ | "apikey"
8
+ | "lang"
9
+ | "notificationat"
10
+ | "notificationtenant"
11
+ | "notificationurl";
12
+
13
+ export type MobilityNotificationsAttributes = Record<
14
+ MobilityNotificationsAttributeName,
15
+ WebComponentAttributeDoc
16
+ >;
17
+
18
+ const attrs: MobilityNotificationsAttributes = {
19
+ apikey: {
20
+ defaultValue: "5cc87b12d7c5370001c1d655820abcc37dfd4d968d7bab5b2a74a935",
21
+ description: `Your ${geopsApiLink}`,
22
+ public: false,
23
+ },
24
+ lang: {
25
+ defaultValue: "de",
26
+ description: "The language to use for the notifications.",
27
+ public: false,
28
+ },
29
+ notificationat: {
30
+ description:
31
+ "An ISO date string used to display active notification at this date in the notification layer. If not defined the current date will be used.<br/>Ex: 2025-08-01T00:00:00Z .",
32
+ public: false,
33
+ },
34
+ notificationtenant: {
35
+ defaultValue: "rvf",
36
+ description: `The ${geopsMocoApiLink} tenant to get the notification from.`,
37
+ public: false,
38
+ },
39
+ notificationurl: {
40
+ defaultValue: "https://moco.geops.io/api/v2/",
41
+ description: `The ${geopsMocoApiLink} url to use.`,
42
+ public: false,
43
+ },
44
+ };
45
+
46
+ export default attrs;
@@ -0,0 +1,2 @@
1
+ export { default } from "./MobilityNotifications";
2
+ export { default as MobilityNotificationsAttributes } from "./MobilityNotificationsAttributes";
@@ -0,0 +1,21 @@
1
+ import MobilityMapEvents from "../MobilityMap/MobilityMapEvents";
2
+
3
+ import type { WebComponentEventDoc } from "../MobilityMap/MobilityMapEvents";
4
+
5
+ export type MobilitySearchEventName = "mwc:attribute" | "mwc:stopssearchselect";
6
+
7
+ export type MobilitySearchAttributes = Record<
8
+ MobilitySearchEventName,
9
+ WebComponentEventDoc
10
+ >;
11
+
12
+ const attrs: MobilitySearchAttributes = {
13
+ "mwc:attribute": MobilityMapEvents["mwc:attribute"],
14
+ "mwc:stopssearchselect": {
15
+ description:
16
+ "Event fired when a stop is selected in the stops search results. The event data contains the selected stop.",
17
+ public: true,
18
+ },
19
+ };
20
+
21
+ export default attrs;