@geops/rvf-mobility-web-component 0.1.55 → 0.1.57

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 (124) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/docutils.js +21 -6
  3. package/global.d.ts +1 -0
  4. package/iframe.html +15 -0
  5. package/index.html +2 -1
  6. package/index.js +295 -335
  7. package/package.json +16 -17
  8. package/src/{RvfExportMenu/RvfExportMenu.tsx → ExportMenu/ExportMenu.tsx} +12 -12
  9. package/src/ExportMenu/index.tsx +1 -0
  10. package/src/{RvfExportMenuButton/RvfExportMenuButton.tsx → ExportMenuButton/ExportMenuButton.tsx} +5 -5
  11. package/src/ExportMenuButton/index.tsx +1 -0
  12. package/src/FeatureDetails/FeatureDetails.tsx +57 -0
  13. package/src/FeatureDetails/index.ts +1 -0
  14. package/src/FeaturesInfosListener/FeaturesInfosListener.tsx +73 -0
  15. package/src/FeaturesInfosListener/index.tsx +1 -0
  16. package/src/GeolocationButton/GeolocationButton.tsx +0 -1
  17. package/src/LayerTree/LayerTree.tsx +58 -0
  18. package/src/LayerTree/TreeItem/TreeItem.tsx +151 -0
  19. package/src/LayerTree/TreeItem/index.tsx +1 -0
  20. package/src/LayerTree/index.tsx +1 -0
  21. package/src/LayerTree/layersTreeContext.ts +4 -0
  22. package/src/LayerTree/layersTreeReducer.ts +158 -0
  23. package/src/{RvfLayerTreeButton/RvfLayerTreeButton.tsx → LayerTreeButton/LayerTreeButton.tsx} +5 -5
  24. package/src/LayerTreeButton/index.tsx +1 -0
  25. package/src/{RvfTopics/RvfTopics.tsx → LayerTreeMenu/LayerTreeMenu.tsx} +17 -13
  26. package/src/LayerTreeMenu/index.tsx +1 -0
  27. package/src/LayoutState/LayoutState.tsx +277 -0
  28. package/src/LayoutState/index.tsx +1 -0
  29. package/src/LinesNetworkPlanDetails/LinesNetworkPlanDetails.tsx +292 -0
  30. package/src/LinesNetworkPlanDetails/index.tsx +1 -0
  31. package/src/{RvfLineNetworkPlanLayer/RvfLineNetworkPlanLayer.tsx → LinesNetworkPlanLayer/LinesNetworkPlanLayer.tsx} +7 -9
  32. package/src/LinesNetworkPlanLayer/index.tsx +1 -0
  33. package/src/MobilityMap/MobilityMap.tsx +274 -60
  34. package/src/MobilityMap/MobilityMapAttributes.ts +46 -50
  35. package/src/NotificationDetails/NotificationDetails.tsx +468 -0
  36. package/src/NotificationDetails/index.ts +1 -0
  37. package/src/{NotificationLayer/NotificationLayer.tsx → NotificationsLayer/NotificationsLayer.tsx} +9 -4
  38. package/src/NotificationsLayer/index.tsx +1 -0
  39. package/src/Overlay/Overlay.tsx +1 -6
  40. package/src/OverlayContent/OverlayContent.tsx +87 -0
  41. package/src/OverlayContent/index.ts +1 -0
  42. package/src/OverlayDetails/OverlayDetails.tsx +47 -0
  43. package/src/OverlayDetails/index.ts +1 -0
  44. package/src/OverlayDetailsFooter/OverlayDetailsFooter.tsx +51 -0
  45. package/src/OverlayDetailsFooter/index.tsx +1 -0
  46. package/src/OverlayDetailsHeader/OverlayDetailsHeader.tsx +35 -0
  47. package/src/OverlayDetailsHeader/index.ts +1 -0
  48. package/src/OverlayFooter/OverlayFooter.tsx +41 -0
  49. package/src/OverlayFooter/index.tsx +1 -0
  50. package/src/OverlayHeader/OverlayHeader.tsx +44 -0
  51. package/src/OverlayHeader/index.tsx +1 -0
  52. package/src/PermalinkInput/PermalinkInput.tsx +28 -0
  53. package/src/PermalinkInput/index.tsx +1 -0
  54. package/src/RouteSchedule/RouteSchedule.tsx +22 -18
  55. package/src/RvfFeatureDetails/RvfFeatureDetails.tsx +22 -50
  56. package/src/RvfFeatureDetails/RvfLineNetworkDetails/RvfLineNetworkDetails.tsx +108 -104
  57. package/src/RvfFeatureDetails/RvfNotificationDetails/RvfNotificationDetails.tsx +189 -154
  58. package/src/RvfFeatureDetails/RvfSharedMobilityDetail/RvfSharedMobilityDetails.tsx +12 -14
  59. package/src/RvfFeatureDetailsTitle/RvfFeatureDetailsTitle.tsx +5 -5
  60. package/src/RvfMainLinkButton/RvfMainLinkButton.tsx +65 -0
  61. package/src/RvfMainLinkButton/index.tsx +1 -0
  62. package/src/RvfMobilityMap/RvfMobilityMap.tsx +183 -395
  63. package/src/RvfOverlayContent/RvfOverlayContent.tsx +2 -2
  64. package/src/RvfPoisLayer/RvfPoisLayer.tsx +2 -2
  65. package/src/RvfSearch/RvfSearch.tsx +1 -1
  66. package/src/RvfSellingPointsLayer/RvfSellingPointsLayer.tsx +2 -2
  67. package/src/RvfSharedMobilityLayerGroup/RvfSharedMobilityLayerGroup.tsx +23 -23
  68. package/src/RvfTarifZonenLayer/RvfTarifZonenLayer.tsx +2 -2
  69. package/src/Search/Search.tsx +11 -2
  70. package/src/{RvfSearchButton/RvfSearchButton.tsx → SearchButton/SearchButton.tsx} +5 -5
  71. package/src/SearchButton/index.tsx +1 -0
  72. package/src/ShadowOverflow/ShadowOverflow.tsx +20 -0
  73. package/src/ShadowOverflow/index.tsx +1 -0
  74. package/src/{RvfShare/RvfPermalinkButton/RvfPermalinkButton.tsx → ShareMenu/PermalinkButton/PermalinkButton.tsx} +4 -4
  75. package/src/ShareMenu/PermalinkButton/index.tsx +1 -0
  76. package/src/{RvfShare/RvfShare.tsx → ShareMenu/ShareMenu.tsx} +9 -11
  77. package/src/ShareMenu/index.tsx +1 -0
  78. package/src/{RvfShareMenuButton/RvfShareMenuButton.tsx → ShareMenuButton/ShareMenuButton.tsx} +6 -6
  79. package/src/ShareMenuButton/index.tsx +1 -0
  80. package/src/SingleClickListener/SingleClickListener.tsx +55 -113
  81. package/src/SingleClickListener/index.tsx +1 -1
  82. package/src/Station/Station.tsx +10 -3
  83. package/src/StationsLayer/StationsLayer.tsx +0 -1
  84. package/src/StopsSearch/StopsSearch.tsx +3 -4
  85. package/src/StopsSearch/index.tsx +2 -1
  86. package/src/WindowMessageListener/WindowMessageListener.tsx +7 -1
  87. package/src/{RvfZoomButtons/RvfZoomButtons.tsx → ZoomButtons/ZoomButtons.tsx} +9 -12
  88. package/src/ZoomButtons/index.tsx +1 -0
  89. package/src/icons/Geolocation/airport-14-svgrepo-com.svg +41 -0
  90. package/src/ui/Button/Button.tsx +9 -2
  91. package/src/ui/Checkbox/Checkbox.tsx +32 -0
  92. package/src/ui/Checkbox/index.tsx +1 -0
  93. package/src/ui/IconButton/IconButton.tsx +24 -4
  94. package/src/ui/Input/Input.tsx +17 -0
  95. package/src/ui/Input/index.tsx +1 -0
  96. package/src/ui/InputCopy/InputCopy.tsx +86 -0
  97. package/src/ui/InputCopy/index.tsx +1 -0
  98. package/src/ui/Select/Select.tsx +24 -0
  99. package/src/ui/Select/index.tsx +1 -0
  100. package/src/utils/constants.ts +43 -42
  101. package/src/utils/exportPdf.ts +3 -5
  102. package/src/utils/hooks/useInitialLayersVisiblity.tsx +1 -1
  103. package/src/utils/hooks/useLayerConfig.tsx +2 -2
  104. package/src/utils/hooks/useLayersConfig.tsx +3 -3
  105. package/src/utils/hooks/useMapContext.tsx +67 -8
  106. package/src/utils/hooks/useRvfContext.tsx +0 -44
  107. package/src/NotificationLayer/index.tsx +0 -1
  108. package/src/RvfEmbedNavigation/DragPanWarning.ts +0 -124
  109. package/src/RvfEmbedNavigation/RvfEmbedNavigation.tsx +0 -51
  110. package/src/RvfEmbedNavigation/index.js +0 -1
  111. package/src/RvfExportMenu/index.tsx +0 -1
  112. package/src/RvfExportMenuButton/index.tsx +0 -1
  113. package/src/RvfFloatingMenu/RvfFloatingMenu.tsx +0 -44
  114. package/src/RvfFloatingMenu/index.tsx +0 -1
  115. package/src/RvfLayerTreeButton/index.tsx +0 -1
  116. package/src/RvfLineNetworkPlanLayer/index.tsx +0 -1
  117. package/src/RvfPermalink/RvfPermalink.tsx +0 -18
  118. package/src/RvfPermalink/index.tsx +0 -1
  119. package/src/RvfSearchButton/index.tsx +0 -1
  120. package/src/RvfShare/RvfPermalinkButton/index.tsx +0 -1
  121. package/src/RvfShare/index.tsx +0 -1
  122. package/src/RvfShareMenuButton/index.tsx +0 -1
  123. package/src/RvfTopics/index.tsx +0 -1
  124. package/src/RvfZoomButtons/index.tsx +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,37 @@
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.57](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.56...v0.1.57) (2025-10-01)
6
+
7
+
8
+ ### Features
9
+
10
+ * add layer tree, share, print, and new toolbar ([#26](https://github.com/geops/rvf-mobility-web-component/issues/26)) ([475c202](https://github.com/geops/rvf-mobility-web-component/commit/475c202b4eceffb8a4fe83b3e12ac01fb3ad2f03))
11
+ * add ui components ([69f79a2](https://github.com/geops/rvf-mobility-web-component/commit/69f79a269e9bc4057379dbe90f413d7cad64985d))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * add icons for search ([a7dc19d](https://github.com/geops/rvf-mobility-web-component/commit/a7dc19d57be0f2e953e4eaf4444162946a659fac))
17
+ * add NoRealtimeIcon ([3a4441f](https://github.com/geops/rvf-mobility-web-component/commit/3a4441faf8b5c1d508a06c7451411d0370fefc43))
18
+ * display no realtime icon ([5a6c886](https://github.com/geops/rvf-mobility-web-component/commit/5a6c88620566134a30a9d224db32c51f8d07929e))
19
+ * do not load all notifications when there is preview notifications ([8716766](https://github.com/geops/rvf-mobility-web-component/commit/8716766fdf26a9db04cc2923c899d8aa0dbd0114))
20
+ * fix tailwindcss 4 variables defs ([c063b72](https://github.com/geops/rvf-mobility-web-component/commit/c063b72597ecf4391e34bddf6f0003aeeda4b243))
21
+ * generate better documentation and split code in components to make it more reusable ([#23](https://github.com/geops/rvf-mobility-web-component/issues/23)) ([7ee2c3c](https://github.com/geops/rvf-mobility-web-component/commit/7ee2c3cbcbc928c77ceb608b83d98d134170be51))
22
+ * make search by default ([eca606f](https://github.com/geops/rvf-mobility-web-component/commit/eca606fc84692d415ba95d780cbf88e59e94f170))
23
+ * merge upstream ([a45bcd7](https://github.com/geops/rvf-mobility-web-component/commit/a45bcd78e4bd801f0faa39edf6c55beaea4fec15))
24
+ * remove obsolete code ([8b4cb08](https://github.com/geops/rvf-mobility-web-component/commit/8b4cb08c9e8d2f1f6b668c8d84d3332073a312f8))
25
+ * update libs ([641549c](https://github.com/geops/rvf-mobility-web-component/commit/641549c7048b7bcc15dd898bff2139fa048d736e))
26
+ * use scrollTo instead of scrollIntoView ([f26aa16](https://github.com/geops/rvf-mobility-web-component/commit/f26aa16cfa513f445f40aac46ba0e020702c3c61))
27
+
28
+ ### [0.1.56](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.55...v0.1.56) (2025-09-30)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * improve doc ([cd1e470](https://github.com/geops/rvf-mobility-web-component/commit/cd1e47080c0fc05f3c702d56110ec96ff7a5bf37))
34
+ * set notification true by default ([e0f8311](https://github.com/geops/rvf-mobility-web-component/commit/e0f83114dfab729cd508c597ef00553fdd9efebc))
35
+
5
36
  ### [0.1.55](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.54...v0.1.55) (2025-09-26)
6
37
 
7
38
 
package/docutils.js CHANGED
@@ -66,6 +66,7 @@ function generateAttributesTable(
66
66
  booleanTrueByDefault = [],
67
67
  descriptionByAttr = {},
68
68
  defaultValueByAttr = {},
69
+ reloadAttrs = [],
69
70
  ) {
70
71
  let innerHMTL = `<table class="table-auto w-full" >
71
72
  <thead>
@@ -104,7 +105,7 @@ function generateAttributesTable(
104
105
  class="border"
105
106
  name="${key}"
106
107
  ${checked ? "checked" : ""}
107
- onchange="document.querySelector('${wc.localName}').setAttribute('${key}', this.checked);onAttributeUpdate(document.querySelector('${wc.localName}'),this.name, this.checked);"
108
+ onchange="document.querySelector('${wc.localName}').setAttribute('${key}', this.checked);onAttributeUpdate(document.querySelector('${wc.localName}'),this.name, this.checked, '${reloadAttrs.join(",")}');"
108
109
  />`
109
110
  : `
110
111
  <input
@@ -114,7 +115,7 @@ function generateAttributesTable(
114
115
  value="${wc.getAttribute(key) || ""}"
115
116
  placeholder="${defaultValueByAttr[key] || ""}"
116
117
  />
117
- <button class="border p-2 bg-black hover:bg-gray-700 text-white" onclick="document.querySelector('${wc.localName}').setAttribute('${key}', this.previousElementSibling.value);onAttributeUpdate(document.querySelector('${wc.localName}'),this.previousElementSibling.name, this.previousElementSibling.value);">Update</button>`
118
+ <button class="border p-2 bg-black hover:bg-gray-700 text-white" onclick="document.querySelector('${wc.localName}').setAttribute('${key}', this.previousElementSibling.value);onAttributeUpdate(document.querySelector('${wc.localName}'),this.previousElementSibling.name, this.previousElementSibling.value, '${reloadAttrs.join(",")}');">Update</button>`
118
119
  }
119
120
  </div>
120
121
  ${descriptionByAttr[key] ? `<div class="pt-2">${descriptionByAttr[key]}</div>` : ``}
@@ -151,7 +152,12 @@ function generateCodeText(
151
152
  (attributeValue === "true" && inputValue === true) ||
152
153
  (attributeValue === "false" && inputValue === false))
153
154
  ) {
154
- codeText += `\n\t${[key, '"' + wc.getAttribute(key) + '"'].join("=")}`;
155
+ let separator = '"';
156
+ const value = wc.getAttribute(key);
157
+ if (value.includes(separator)) {
158
+ separator = "'"; // for json stringify value
159
+ }
160
+ codeText += `\n\t${[key, separator + value + separator].join("=")}`;
155
161
  }
156
162
  });
157
163
 
@@ -221,9 +227,18 @@ function generateEventsTable(wc, events, descriptionByEvent = {}) {
221
227
  }
222
228
 
223
229
  // Update url on attributes update via inputs
224
- function onAttributeUpdate(wc, key, value) {
230
+ function onAttributeUpdate(wc, key, value, reloadAttrs) {
225
231
  const params = new URLSearchParams(window.location.search);
226
232
  params.set(key, value);
227
- wc.setAttribute(key, value);
228
- window.history.replaceState({}, "", `${window.location.pathname}?${params}`);
233
+ if (reloadAttrs.split(",").includes(key)) {
234
+ window.history.pushState({}, "", `${window.location.pathname}?${params}`);
235
+ window.location.reload();
236
+ } else {
237
+ wc.setAttribute(key, value);
238
+ window.history.replaceState(
239
+ {},
240
+ "",
241
+ `${window.location.pathname}?${params}`,
242
+ );
243
+ }
229
244
  }
package/global.d.ts CHANGED
@@ -2,6 +2,7 @@ declare module "*.png" {
2
2
  const src: string;
3
3
  export default src;
4
4
  }
5
+
5
6
  declare module "*.svg" {
6
7
  const src: string;
7
8
  export default src;
package/iframe.html CHANGED
@@ -215,4 +215,19 @@
215
215
  });
216
216
  </script>
217
217
  </body>
218
+ <<<<<<< HEAD
219
+ =======
220
+ <script type="module">
221
+ // import testNotification from "./testNotification.json";
222
+ // const iframe = document.getElementById("iframe");
223
+ // iframe.addEventListener("load", function () {
224
+ // setTimeout(() => {
225
+ // this.contentWindow.postMessage({ notification: testNotification }, "*");
226
+ // }, 500);
227
+ // });
228
+ window.addEventListener("message", (event) => {
229
+ console.log(`parent received ${event.data.type} message:`, event.data.data);
230
+ });
231
+ </script>
232
+ >>>>>>> upstream/main
218
233
  </html>
package/index.html CHANGED
@@ -48,7 +48,7 @@
48
48
  ></pre>
49
49
 
50
50
  <geops-mobility
51
- class="block h-96 w-full resize overflow-hidden rounded-2xl border"
51
+ class="block h-128 w-full resize overflow-hidden rounded-2xl border"
52
52
  ></geops-mobility>
53
53
 
54
54
  <br />
@@ -85,6 +85,7 @@ document.getElementById('map').addEventListener('mwc:attribute', (event) => {
85
85
  description: `Load the page in fullscreen mode.`,
86
86
  reload: true,
87
87
  };
88
+
88
89
  window.MobilityMapAttributes.debug = {
89
90
  type: "boolean",
90
91
  defaultValue: "false",