@mapcomponents/react-maplibre 0.1.34 → 0.1.35

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 (305) hide show
  1. package/.babelrc +3 -0
  2. package/.github/workflows/storybook.yml +1 -1
  3. package/.storybook/.babelrc +26 -0
  4. package/.storybook/main.js +15 -1
  5. package/.storybook/mapcomponents_logo.png +0 -0
  6. package/CHANGELOG.md +6 -1
  7. package/config/env.js +106 -0
  8. package/config/getHttpsConfig.js +66 -0
  9. package/config/jest/babelTransform.js +29 -0
  10. package/config/jest/cssTransform.js +14 -0
  11. package/config/jest/fileTransform.js +40 -0
  12. package/config/modules.js +134 -0
  13. package/config/paths.js +75 -0
  14. package/config/pnpTs.js +35 -0
  15. package/config/webpack.config.js +757 -0
  16. package/config/webpackDevServer.config.js +130 -0
  17. package/coverage/clover.xml +822 -900
  18. package/coverage/coverage-final.json +23 -24
  19. package/coverage/lcov-report/index.html +135 -150
  20. package/coverage/lcov-report/src/components/MapLibreMap/{MapLibreMap.js.html → MapLibreMap.tsx.html} +77 -68
  21. package/coverage/lcov-report/src/components/MapLibreMap/index.html +6 -6
  22. package/coverage/lcov-report/src/components/MlCreatePdfButton/{MlCreatePdfButton.js.html → MlCreatePdfButton.tsx.html} +40 -43
  23. package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +10 -10
  24. package/coverage/lcov-report/src/components/MlFeatureEditor/{MlFeatureEditor.js.html → MlFeatureEditor.tsx.html} +145 -85
  25. package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +21 -21
  26. package/coverage/lcov-report/src/components/{MlImageMarkerLayer/MlImageMarkerLayer.js.html → MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html} +141 -111
  27. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +20 -20
  28. package/coverage/lcov-report/src/components/MlFollowGps/{MlFollowGps.js.html → MlFollowGps.tsx.html} +177 -138
  29. package/coverage/lcov-report/src/components/MlFollowGps/index.html +15 -15
  30. package/coverage/lcov-report/src/components/MlGPXViewer/{MlGPXViewer.js.html → MlGPXViewer.tsx.html} +134 -80
  31. package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +1 -1
  32. package/coverage/lcov-report/src/components/MlGPXViewer/index.html +16 -16
  33. package/coverage/lcov-report/src/components/{MlLayer/MlLayer.js.html → MlGeoJsonLayer/MlGeoJsonLayer.tsx.html} +151 -154
  34. package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +19 -19
  35. package/coverage/lcov-report/src/components/{MlFillExtrusionLayer/MlFillExtrusionLayer.js.html → MlImageMarkerLayer/MlImageMarkerLayer.tsx.html} +151 -223
  36. package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +16 -16
  37. package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +229 -0
  38. package/coverage/lcov-report/src/components/MlLayer/index.html +21 -21
  39. package/coverage/lcov-report/src/components/MlLayerMagnify/{MlLayerMagnify.js.html → MlLayerMagnify.tsx.html} +134 -77
  40. package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +20 -20
  41. package/coverage/lcov-report/src/components/MlLayerSwipe/{MlLayerSwipe.js.html → MlLayerSwipe.tsx.html} +83 -41
  42. package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +2 -2
  43. package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +3 -15
  44. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +1 -1
  45. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
  46. package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
  47. package/coverage/lcov-report/src/components/MlMarker/{MlMarker.js.html → MlMarker.tsx.html} +89 -137
  48. package/coverage/lcov-report/src/components/MlMarker/index.html +10 -10
  49. package/coverage/lcov-report/src/components/MlNavigationCompass/{MlNavigationCompass.js.html → MlNavigationCompass.tsx.html} +76 -25
  50. package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +17 -17
  51. package/coverage/lcov-report/src/components/MlNavigationTools/{MlNavigationTools.js.html → MlNavigationTools.tsx.html} +67 -52
  52. package/coverage/lcov-report/src/components/MlNavigationTools/index.html +10 -10
  53. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
  54. package/coverage/lcov-report/src/components/MlOsmLayer/index.html +1 -1
  55. package/coverage/lcov-report/src/components/MlScaleReference/MlScaleReference.js.html +1 -1
  56. package/coverage/lcov-report/src/components/MlScaleReference/index.html +1 -1
  57. package/coverage/lcov-report/src/components/MlShareMapState/MlShareMapState.js.html +1 -1
  58. package/coverage/lcov-report/src/components/MlShareMapState/index.html +1 -1
  59. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +3 -3
  60. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
  61. package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +5 -5
  62. package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
  63. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/{MlTransitionGeoJsonLayer.js.html → MlTransitionGeoJsonLayer.tsx.html} +127 -118
  64. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +11 -11
  65. package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
  66. package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
  67. package/coverage/lcov-report/src/components/MlVectorTileLayer/{MlVectorTileLayer.js.html → MlVectorTileLayer.tsx.html} +59 -11
  68. package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +2 -2
  69. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +1 -1
  70. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +1 -1
  71. package/coverage/lcov-report/src/components/MlWmsLayer/{MlWmsLayer.js.html → MlWmsLayer.tsx.html} +56 -11
  72. package/coverage/lcov-report/src/components/MlWmsLayer/index.html +2 -2
  73. package/coverage/lcov-report/src/components/MlWmsLoader/{MlWmsLoader.js.html → MlWmsLoader.tsx.html} +102 -78
  74. package/coverage/lcov-report/src/components/MlWmsLoader/index.html +8 -8
  75. package/coverage/lcov-report/src/hooks/index.html +44 -29
  76. package/coverage/lcov-report/src/{components/MlGeoJsonLayer/MlGeoJsonLayer.js.html → hooks/useLayer.ts.html} +328 -184
  77. package/coverage/lcov-report/src/hooks/{useMap.js.html → useMap.ts.html} +140 -50
  78. package/coverage/lcov-report/src/hooks/{useMapState.js.html → useMapState.ts.html} +166 -61
  79. package/coverage/lcov-report/src/hooks/useWms.js.html +1 -1
  80. package/coverage/lcov-report/src/index.html +15 -15
  81. package/coverage/lcov-report/src/{i18n.js.html → index.ts.html} +50 -32
  82. package/coverage/lcov.info +1540 -1669
  83. package/dist/index.esm.css +195 -0
  84. package/dist/index.esm.js +17049 -4280
  85. package/dist/index.esm.js.map +1 -1
  86. package/docs-build/0.d0c23b79.iframe.bundle.js +2 -0
  87. package/docs-build/0.d0c23b79.iframe.bundle.js.map +1 -0
  88. package/docs-build/0.fd1aa3ea21956d993519.manager.bundle.js +1 -0
  89. package/docs-build/1.34075652.iframe.bundle.js +10 -0
  90. package/docs-build/1.34075652.iframe.bundle.js.map +1 -0
  91. package/docs-build/16.ca488dae.iframe.bundle.js +2 -0
  92. package/docs-build/16.ca488dae.iframe.bundle.js.map +1 -0
  93. package/docs-build/17.e40eac7f.iframe.bundle.js +17 -0
  94. package/docs-build/17.e40eac7f.iframe.bundle.js.map +1 -0
  95. package/docs-build/18.62af0912.iframe.bundle.js +14 -0
  96. package/docs-build/18.62af0912.iframe.bundle.js.map +1 -0
  97. package/docs-build/19.0a217189.iframe.bundle.js +2 -0
  98. package/docs-build/19.0a217189.iframe.bundle.js.map +1 -0
  99. package/docs-build/2.f15ae19a.iframe.bundle.js +2 -0
  100. package/docs-build/2.f15ae19a.iframe.bundle.js.map +1 -0
  101. package/docs-build/20.4c43e27c.iframe.bundle.js +4 -0
  102. package/docs-build/20.4c43e27c.iframe.bundle.js.map +1 -0
  103. package/docs-build/21.19c21085.iframe.bundle.js +22 -0
  104. package/docs-build/21.19c21085.iframe.bundle.js.map +1 -0
  105. package/docs-build/3.5dd9e88b.iframe.bundle.js +2 -0
  106. package/docs-build/3.5dd9e88b.iframe.bundle.js.map +1 -0
  107. package/docs-build/4.f741dafe1833630ec8bf.manager.bundle.js +2 -0
  108. package/docs-build/4.f741dafe1833630ec8bf.manager.bundle.js.LICENSE.txt +8 -0
  109. package/docs-build/5.d4de191e7daeefb036ca.manager.bundle.js +1 -0
  110. package/docs-build/6.2b178c5444648ee5c0fa.manager.bundle.js +2 -0
  111. package/docs-build/6.2b178c5444648ee5c0fa.manager.bundle.js.LICENSE.txt +12 -0
  112. package/docs-build/7.7c16aea8ec7ea6e91994.manager.bundle.js +1 -0
  113. package/docs-build/8.52fa838fdf937b29676a.manager.bundle.js +1 -0
  114. package/docs-build/assets/dop.png +0 -0
  115. package/docs-build/assets/historic.png +0 -0
  116. package/docs-build/assets/marker.png +0 -0
  117. package/docs-build/assets/osm.png +0 -0
  118. package/docs-build/assets/sample.gpx +716 -0
  119. package/docs-build/{.gitkeep → catalogue/.gitkeep} +0 -0
  120. package/docs-build/catalogue/mc_meta.json +1 -0
  121. package/docs-build/favicon.ico +0 -0
  122. package/docs-build/iframe.html +348 -0
  123. package/docs-build/index.html +59 -0
  124. package/docs-build/logo.png +0 -0
  125. package/docs-build/main.8a7ec710ea1c16b5e13f.manager.bundle.js +1 -0
  126. package/docs-build/main~24120820.ba6665a8.iframe.bundle.js +2 -0
  127. package/docs-build/main~24120820.ba6665a8.iframe.bundle.js.map +1 -0
  128. package/docs-build/manifest.json +25 -0
  129. package/docs-build/robots.txt +3 -0
  130. package/docs-build/runtime~main.67aa1de2d72f40a81164.manager.bundle.js +1 -0
  131. package/docs-build/static/media/mapcomponents_logo.98b01a05.png +0 -0
  132. package/docs-build/static/media/wg-marker.bf3eeb2d.png +0 -0
  133. package/docs-build/stories.json +331 -0
  134. package/docs-build/thumbnails/MapLibreMap.png +0 -0
  135. package/docs-build/thumbnails/MlCameraFollowPath.png +0 -0
  136. package/docs-build/thumbnails/MlCreatePdfButton.png +0 -0
  137. package/docs-build/thumbnails/MlDeckGlLayer.png +0 -0
  138. package/docs-build/thumbnails/MlDeckGlTerrainLayer.png +0 -0
  139. package/docs-build/thumbnails/MlDemoDashboard.png +0 -0
  140. package/docs-build/thumbnails/MlFeatureEditor.png +0 -0
  141. package/docs-build/thumbnails/MlFillExtrusionLayer.png +0 -0
  142. package/docs-build/thumbnails/MlFollowGps.png +0 -0
  143. package/docs-build/thumbnails/MlGPXViewer.png +0 -0
  144. package/docs-build/thumbnails/MlGeoJsonLayer.png +0 -0
  145. package/docs-build/thumbnails/MlHillshadeLayer.png +0 -0
  146. package/docs-build/thumbnails/MlIconLayer.png +0 -0
  147. package/docs-build/thumbnails/MlLaermkarte.png +0 -0
  148. package/docs-build/thumbnails/MlLayerMagnify.png +0 -0
  149. package/docs-build/thumbnails/MlLayerSwipe.png +0 -0
  150. package/docs-build/thumbnails/MlMapDrawTools.png +0 -0
  151. package/docs-build/thumbnails/MlMobilerImker.png +0 -0
  152. package/docs-build/thumbnails/MlNavigationCompass.png +0 -0
  153. package/docs-build/thumbnails/MlNavigationTools.png +0 -0
  154. package/docs-build/thumbnails/MlOsmLayer.png +0 -0
  155. package/docs-build/thumbnails/MlScaleReference.png +0 -0
  156. package/docs-build/thumbnails/MlSpatialElevationProfile.png +0 -0
  157. package/docs-build/thumbnails/MlThreeJsLayer.png +0 -0
  158. package/docs-build/thumbnails/MlTransitionGeoJsonLayer.png +0 -0
  159. package/docs-build/thumbnails/MlVectorTileLayer.png +0 -0
  160. package/docs-build/thumbnails/MlWanderApp.png +0 -0
  161. package/docs-build/thumbnails/MlWmsLayer.png +0 -0
  162. package/docs-build/thumbnails/MlWmsLoader.png +0 -0
  163. package/docs-build/vendors~main.351900838c49e9200954.manager.bundle.js +2 -0
  164. package/docs-build/vendors~main.351900838c49e9200954.manager.bundle.js.LICENSE.txt +101 -0
  165. package/docs-build/vendors~main~0ad7406a.a6abfed7.iframe.bundle.js +8 -0
  166. package/docs-build/vendors~main~0ad7406a.a6abfed7.iframe.bundle.js.map +1 -0
  167. package/docs-build/vendors~main~0f485567.1d7a15b7.iframe.bundle.js +2 -0
  168. package/docs-build/vendors~main~0f485567.1d7a15b7.iframe.bundle.js.map +1 -0
  169. package/docs-build/vendors~main~41a6ab2c.525ecc56.iframe.bundle.js +2 -0
  170. package/docs-build/vendors~main~41a6ab2c.525ecc56.iframe.bundle.js.map +1 -0
  171. package/docs-build/vendors~main~52589227.1d1558cd.iframe.bundle.js +8 -0
  172. package/docs-build/vendors~main~52589227.1d1558cd.iframe.bundle.js.map +1 -0
  173. package/docs-build/vendors~main~73914085.227c6747.iframe.bundle.js +293 -0
  174. package/docs-build/vendors~main~73914085.227c6747.iframe.bundle.js.map +1 -0
  175. package/docs-build/vendors~main~9c5b28f6.f02cc741.iframe.bundle.js +7 -0
  176. package/docs-build/vendors~main~9c5b28f6.f02cc741.iframe.bundle.js.map +1 -0
  177. package/docs-build/vendors~main~b5906859.4083ac60.iframe.bundle.js +21 -0
  178. package/docs-build/vendors~main~b5906859.4083ac60.iframe.bundle.js.map +1 -0
  179. package/docs-build/vendors~main~b8f44717.7a612c34.iframe.bundle.js +89 -0
  180. package/docs-build/vendors~main~b8f44717.7a612c34.iframe.bundle.js.map +1 -0
  181. package/docs-build/vendors~main~b9cf3951.45da142d.iframe.bundle.js +68 -0
  182. package/docs-build/vendors~main~b9cf3951.45da142d.iframe.bundle.js.map +1 -0
  183. package/docs-build/vendors~main~d939e436.92c27fbf.iframe.bundle.js +2 -0
  184. package/docs-build/vendors~main~d939e436.92c27fbf.iframe.bundle.js.map +1 -0
  185. package/docs-build/vendors~main~dab50aa4.b0d58038.iframe.bundle.js +107 -0
  186. package/docs-build/vendors~main~dab50aa4.b0d58038.iframe.bundle.js.map +1 -0
  187. package/package.json +132 -115
  188. package/public/favicon.ico +0 -0
  189. package/public/logo.png +0 -0
  190. package/rollup.config.js +26 -3
  191. package/scripts/start.js +166 -0
  192. package/scripts/test.js +53 -0
  193. package/src/components/MapLibreMap/MapLibreMap.stories.js +14 -5
  194. package/src/components/MapLibreMap/MapLibreMap.test.js +1 -1
  195. package/src/components/MapLibreMap/{MapLibreMap.js → MapLibreMap.tsx} +40 -37
  196. package/src/components/MapLibreMap/lib/MapLibreGlWrapper.test.js +3 -3
  197. package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +636 -0
  198. package/src/components/MlComponentTemplate/MlComponentTemplate.stories.js +0 -2
  199. package/src/components/MlComponentTemplate/MlComponentTemplate.tsx +42 -0
  200. package/src/components/MlCreatePdfButton/MlCreatePdfButton.stories.js +0 -5
  201. package/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx +51 -0
  202. package/src/components/MlCreatePdfButton/lib/{createPdf.js → createPdf.ts} +26 -23
  203. package/src/components/MlCreatePdfButton/lib/{nominatimMap.js → nominatimMap.ts} +3 -3
  204. package/src/components/MlFeatureEditor/MlFeatureEditor.tsx +139 -0
  205. package/src/components/MlFeatureEditor/custom-direct-select-mode.js +12 -8
  206. package/src/components/MlFeatureEditor/custom-polygon-mode.js +9 -5
  207. package/src/components/MlFeatureEditor/custom-select-mode.js +11 -7
  208. package/src/components/MlFeatureEditor/lib/LICENSE.md +18 -0
  209. package/src/components/MlFeatureEditor/lib/common_selectors.js +4 -0
  210. package/src/components/MlFeatureEditor/lib/constants.js +4 -0
  211. package/src/components/MlFeatureEditor/lib/constrain_feature_movement.js +4 -0
  212. package/src/components/MlFeatureEditor/lib/create_midpoint.js +4 -0
  213. package/src/components/MlFeatureEditor/lib/create_supplementary_points.js +4 -0
  214. package/src/components/MlFeatureEditor/lib/create_vertex.js +4 -0
  215. package/src/components/MlFeatureEditor/lib/double_click_zoom.js +4 -0
  216. package/src/components/MlFeatureEditor/lib/euclidean_distance.js +4 -0
  217. package/src/components/MlFeatureEditor/lib/features_at.js +4 -0
  218. package/src/components/MlFeatureEditor/lib/get_features_and_set_cursor.js +4 -0
  219. package/src/components/MlFeatureEditor/lib/is_click.js +4 -0
  220. package/src/components/MlFeatureEditor/lib/is_event_at_coordinates.js +4 -0
  221. package/src/components/MlFeatureEditor/lib/is_tap.js +4 -0
  222. package/src/components/MlFeatureEditor/lib/map_event_to_bounding_box.js +4 -0
  223. package/src/components/MlFeatureEditor/lib/mode_handler.js +4 -0
  224. package/src/components/MlFeatureEditor/lib/mouse_event_point.js +4 -0
  225. package/src/components/MlFeatureEditor/lib/move_features.js +4 -0
  226. package/src/components/MlFeatureEditor/lib/sort_features.js +4 -0
  227. package/src/components/MlFeatureEditor/lib/string_set.js +4 -0
  228. package/src/components/MlFeatureEditor/lib/string_sets_are_equal.js +4 -0
  229. package/src/components/MlFeatureEditor/lib/theme.js +4 -0
  230. package/src/components/MlFeatureEditor/lib/to_dense_array.js +4 -0
  231. package/src/components/MlFeatureEditor/lib/utils.js +4 -0
  232. package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.stories.js +6 -11
  233. package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx +85 -0
  234. package/src/components/MlFollowGps/MlFollowGps.stories.js +0 -2
  235. package/src/components/MlFollowGps/{MlFollowGps.js → MlFollowGps.tsx} +99 -86
  236. package/src/components/MlGPXViewer/{MlGPXViewer.js → MlGPXViewer.tsx} +68 -50
  237. package/src/components/MlGPXViewer/util/GeoJsonContext.ts +13 -0
  238. package/src/components/MlGPXViewer/util/{GeoJsonProvider.js → GeoJsonProvider.tsx} +3 -7
  239. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.js +8 -3
  240. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx +106 -0
  241. package/src/components/MlGeoJsonLayer/util/{getDefaultLayerTypeByGeometry.js → getDefaultLayerTypeByGeometry.ts} +6 -1
  242. package/src/components/MlGeoJsonLayer/util/{getDefaultPaintPropsByType.js → getDefaultPaintPropsByType.ts} +1 -1
  243. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.js +1 -4
  244. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx +129 -0
  245. package/src/components/MlLayer/MlLayer.stories.js +0 -2
  246. package/src/components/MlLayer/MlLayer.tsx +48 -0
  247. package/src/components/MlLayerMagnify/MlLayerMagnify.stories.js +3 -3
  248. package/src/components/MlLayerMagnify/{MlLayerMagnify.js → MlLayerMagnify.tsx} +62 -43
  249. package/src/components/MlLayerSwipe/MlLayerSwipe.stories.js +0 -2
  250. package/src/components/MlLayerSwipe/{MlLayerSwipe.js → MlLayerSwipe.tsx} +38 -24
  251. package/src/components/MlLayerSwitcher/MlLayerSwitcher.js +0 -4
  252. package/src/components/MlMarker/MlMarker.tsx +140 -0
  253. package/src/components/MlNavigationCompass/{MlNavigationCompass.js → MlNavigationCompass.tsx} +27 -10
  254. package/src/components/MlNavigationTools/{MlNavigationTools.js → MlNavigationTools.tsx} +37 -32
  255. package/src/components/MlTransitionGeoJsonLayer/{MlTransitionGeoJsonLayer.js → MlTransitionGeoJsonLayer.tsx} +76 -73
  256. package/src/components/MlVectorTileLayer/{MlVectorTileLayer.js → MlVectorTileLayer.tsx} +23 -7
  257. package/src/components/MlWmsLayer/{MlWmsLayer.js → MlWmsLayer.tsx} +22 -7
  258. package/src/components/MlWmsLoader/{MlWmsLoader.js → MlWmsLoader.tsx} +55 -47
  259. package/src/custom.d.tsx +26 -0
  260. package/src/hooks/useLayer.ts +221 -0
  261. package/src/hooks/{useMap.js → useMap.ts} +48 -17
  262. package/src/hooks/{useMapState.js → useMapState.ts} +42 -7
  263. package/src/{index.js → index.ts} +15 -8
  264. package/tsconfig.json +18 -24
  265. package/.env +0 -1
  266. package/.storybook/main.bck.js +0 -56
  267. package/babel.config.json +0 -4
  268. package/coverage/lcov-report/src/translations/english.js.html +0 -94
  269. package/coverage/lcov-report/src/translations/german.js.html +0 -94
  270. package/coverage/lcov-report/src/translations/index.html +0 -131
  271. package/jest.config.json +0 -16
  272. package/jsdoc.json +0 -21
  273. package/public/assets/3D/posttower.gltf +0 -103
  274. package/public/assets/3D/posttower_simple.gltf +0 -103
  275. package/public/assets/3D/posttower_wh.gltf.glb +0 -0
  276. package/public/bee.png +0 -0
  277. package/public/logo192.png +0 -0
  278. package/public/logo512.png +0 -0
  279. package/src/components/MapLibreMap/lib/MapLibreGlWrapper.js +0 -528
  280. package/src/components/MlComponentTemplate/MlComponentTemplate.js +0 -39
  281. package/src/components/MlCreatePdfButton/MlCreatePdfButton.js +0 -52
  282. package/src/components/MlFeatureEditor/MlFeatureEditor.js +0 -119
  283. package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.js +0 -153
  284. package/src/components/MlGPXViewer/util/GeoJsonContext.js +0 -6
  285. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.js +0 -173
  286. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.js +0 -75
  287. package/src/components/MlLayer/MlLayer.js +0 -107
  288. package/src/components/MlLayerMagnify/utils/compareMagnify.js +0 -173
  289. package/src/components/MlLayerSwipe/utils/swipeCompare.js +0 -220
  290. package/src/components/MlMarker/MlMarker.js +0 -156
  291. package/src/components/index.js +0 -6
  292. package/src/i18n.js +0 -28
  293. package/src/react-app-env.d.ts +0 -1
  294. package/src/stories/IntroductionCore.stories.mdx +0 -3
  295. package/src/stories/assets/code-brackets.svg +0 -1
  296. package/src/stories/assets/colors.svg +0 -1
  297. package/src/stories/assets/comments.svg +0 -1
  298. package/src/stories/assets/direction.svg +0 -1
  299. package/src/stories/assets/flow.svg +0 -1
  300. package/src/stories/assets/plugin.svg +0 -1
  301. package/src/stories/assets/repo.svg +0 -1
  302. package/src/stories/assets/stackalt.svg +0 -1
  303. package/src/stories/components/ComponentTeaser.js +0 -64
  304. package/src/translations/english.js +0 -4
  305. package/src/translations/german.js +0 -4
package/.babelrc ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "presets": ["@babel/preset-env", "@babel/preset-typescript"]
3
+ }
@@ -1,4 +1,4 @@
1
- name: Build and deploy storybook
1
+ name: Build and deploy storybook
2
2
  on:
3
3
  push:
4
4
  branches:
@@ -0,0 +1,26 @@
1
+ {
2
+ "plugins": [
3
+ "@babel/plugin-transform-typescript",
4
+ "babel-plugin-styled-components",
5
+ [
6
+ "inline-react-svg",
7
+ {
8
+ "svgo": {
9
+ "plugins": [
10
+ {
11
+ "name": "preset-default",
12
+ "params": {
13
+ "overrides": { "mergePaths": false }
14
+ }
15
+ }
16
+ ]
17
+ }
18
+ }
19
+ ]
20
+ ],
21
+ "presets": [
22
+ "@babel/preset-env",
23
+ "@babel/preset-typescript",
24
+ "@babel/preset-react"
25
+ ]
26
+ }
@@ -3,7 +3,12 @@ module.exports = {
3
3
  addons: [
4
4
  "@storybook/addon-links",
5
5
  "@storybook/addon-essentials",
6
- "@storybook/preset-create-react-app",
6
+ {
7
+ name: "@storybook/addon-docs",
8
+ options: {
9
+ configureJSX: true,
10
+ },
11
+ },
7
12
  ],
8
13
  webpackFinal: async (config, { configType }) => {
9
14
  // split into more chunks
@@ -17,4 +22,13 @@ module.exports = {
17
22
 
18
23
  return config;
19
24
  },
25
+ typescript: {
26
+ check: false,
27
+ checkOptions: {},
28
+ reactDocgen: 'react-docgen-typescript',
29
+ reactDocgenTypescriptOptions: {
30
+ shouldExtractLiteralValuesFromEnum: true,
31
+ propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
32
+ },
33
+ }
20
34
  };
Binary file
package/CHANGELOG.md CHANGED
@@ -1,8 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ## [v0.1.34] - 2022-03-24
4
+
5
+ ### Fixed
6
+ - 0ced5c1: revert to webpack inline transpilation exclusion as there is no effect on codesandbox installation issues
7
+
3
8
  ## [v0.1.33] - 2022-03-24
4
9
 
5
- ### Fixe5b80cac: remove webpack inline transpilation exclusion to fix codesandbox installation issues …d
10
+ ### Fixed
6
11
  - 5b80cac: remove webpack inline transpilation exclusion to fix codesandbox installation issues
7
12
 
8
13
  ## [v0.1.32] - 2022-03-15
package/config/env.js ADDED
@@ -0,0 +1,106 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const paths = require('./paths');
6
+
7
+ // Make sure that including paths.js after env.js will read .env variables.
8
+ delete require.cache[require.resolve('./paths')];
9
+
10
+ const NODE_ENV = process.env.NODE_ENV;
11
+ if (!NODE_ENV) {
12
+ throw new Error(
13
+ 'The NODE_ENV environment variable is required but was not specified.'
14
+ );
15
+ }
16
+
17
+ // https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
18
+ const dotenvFiles = [
19
+ `${paths.dotenv}.${NODE_ENV}.local`,
20
+ // Don't include `.env.local` for `test` environment
21
+ // since normally you expect tests to produce the same
22
+ // results for everyone
23
+ NODE_ENV !== 'test' && `${paths.dotenv}.local`,
24
+ `${paths.dotenv}.${NODE_ENV}`,
25
+ paths.dotenv,
26
+ ].filter(Boolean);
27
+
28
+ // Load environment variables from .env* files. Suppress warnings using silent
29
+ // if this file is missing. dotenv will never modify any environment variables
30
+ // that have already been set. Variable expansion is supported in .env files.
31
+ // https://github.com/motdotla/dotenv
32
+ // https://github.com/motdotla/dotenv-expand
33
+ dotenvFiles.forEach(dotenvFile => {
34
+ if (fs.existsSync(dotenvFile)) {
35
+ require('dotenv-expand')(
36
+ require('dotenv').config({
37
+ path: dotenvFile,
38
+ })
39
+ );
40
+ }
41
+ });
42
+
43
+ // We support resolving modules according to `NODE_PATH`.
44
+ // This lets you use absolute paths in imports inside large monorepos:
45
+ // https://github.com/facebook/create-react-app/issues/253.
46
+ // It works similar to `NODE_PATH` in Node itself:
47
+ // https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
48
+ // Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
49
+ // Otherwise, we risk importing Node.js core modules into an app instead of webpack shims.
50
+ // https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
51
+ // We also resolve them to make sure all tools using them work consistently.
52
+ const appDirectory = fs.realpathSync(process.cwd());
53
+ process.env.NODE_PATH = (process.env.NODE_PATH || '')
54
+ .split(path.delimiter)
55
+ .filter(folder => folder && !path.isAbsolute(folder))
56
+ .map(folder => path.resolve(appDirectory, folder))
57
+ .join(path.delimiter);
58
+
59
+ // Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
60
+ // injected into the application via DefinePlugin in webpack configuration.
61
+ const REACT_APP = /^REACT_APP_/i;
62
+
63
+ function getClientEnvironment(publicUrl) {
64
+ const raw = Object.keys(process.env)
65
+ .filter(key => REACT_APP.test(key))
66
+ .reduce(
67
+ (env, key) => {
68
+ env[key] = process.env[key];
69
+ return env;
70
+ },
71
+ {
72
+ // Useful for determining whether we’re running in production mode.
73
+ // Most importantly, it switches React into the correct mode.
74
+ NODE_ENV: process.env.NODE_ENV || 'development',
75
+ // Useful for resolving the correct path to static assets in `public`.
76
+ // For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
77
+ // This should only be used as an escape hatch. Normally you would put
78
+ // images into the `src` and `import` them in code to get their paths.
79
+ PUBLIC_URL: publicUrl,
80
+ // We support configuring the sockjs pathname during development.
81
+ // These settings let a developer run multiple simultaneous projects.
82
+ // They are used as the connection `hostname`, `pathname` and `port`
83
+ // in webpackHotDevClient. They are used as the `sockHost`, `sockPath`
84
+ // and `sockPort` options in webpack-dev-server.
85
+ WDS_SOCKET_HOST: process.env.WDS_SOCKET_HOST,
86
+ WDS_SOCKET_PATH: process.env.WDS_SOCKET_PATH,
87
+ WDS_SOCKET_PORT: process.env.WDS_SOCKET_PORT,
88
+ // Whether or not react-refresh is enabled.
89
+ // react-refresh is not 100% stable at this time,
90
+ // which is why it's disabled by default.
91
+ // It is defined here so it is available in the webpackHotDevClient.
92
+ FAST_REFRESH: process.env.FAST_REFRESH !== 'false',
93
+ }
94
+ );
95
+ // Stringify all values so we can feed into webpack DefinePlugin
96
+ const stringified = {
97
+ 'process.env': Object.keys(raw).reduce((env, key) => {
98
+ env[key] = JSON.stringify(raw[key]);
99
+ return env;
100
+ }, {}),
101
+ };
102
+
103
+ return { raw, stringified };
104
+ }
105
+
106
+ module.exports = getClientEnvironment;
@@ -0,0 +1,66 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const crypto = require('crypto');
6
+ const chalk = require('react-dev-utils/chalk');
7
+ const paths = require('./paths');
8
+
9
+ // Ensure the certificate and key provided are valid and if not
10
+ // throw an easy to debug error
11
+ function validateKeyAndCerts({ cert, key, keyFile, crtFile }) {
12
+ let encrypted;
13
+ try {
14
+ // publicEncrypt will throw an error with an invalid cert
15
+ encrypted = crypto.publicEncrypt(cert, Buffer.from('test'));
16
+ } catch (err) {
17
+ throw new Error(
18
+ `The certificate "${chalk.yellow(crtFile)}" is invalid.\n${err.message}`
19
+ );
20
+ }
21
+
22
+ try {
23
+ // privateDecrypt will throw an error with an invalid key
24
+ crypto.privateDecrypt(key, encrypted);
25
+ } catch (err) {
26
+ throw new Error(
27
+ `The certificate key "${chalk.yellow(keyFile)}" is invalid.\n${
28
+ err.message
29
+ }`
30
+ );
31
+ }
32
+ }
33
+
34
+ // Read file and throw an error if it doesn't exist
35
+ function readEnvFile(file, type) {
36
+ if (!fs.existsSync(file)) {
37
+ throw new Error(
38
+ `You specified ${chalk.cyan(
39
+ type
40
+ )} in your env, but the file "${chalk.yellow(file)}" can't be found.`
41
+ );
42
+ }
43
+ return fs.readFileSync(file);
44
+ }
45
+
46
+ // Get the https config
47
+ // Return cert files if provided in env, otherwise just true or false
48
+ function getHttpsConfig() {
49
+ const { SSL_CRT_FILE, SSL_KEY_FILE, HTTPS } = process.env;
50
+ const isHttps = HTTPS === 'true';
51
+
52
+ if (isHttps && SSL_CRT_FILE && SSL_KEY_FILE) {
53
+ const crtFile = path.resolve(paths.appPath, SSL_CRT_FILE);
54
+ const keyFile = path.resolve(paths.appPath, SSL_KEY_FILE);
55
+ const config = {
56
+ cert: readEnvFile(crtFile, 'SSL_CRT_FILE'),
57
+ key: readEnvFile(keyFile, 'SSL_KEY_FILE'),
58
+ };
59
+
60
+ validateKeyAndCerts({ ...config, keyFile, crtFile });
61
+ return config;
62
+ }
63
+ return isHttps;
64
+ }
65
+
66
+ module.exports = getHttpsConfig;
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ const babelJest = require('babel-jest');
4
+
5
+ const hasJsxRuntime = (() => {
6
+ if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
7
+ return false;
8
+ }
9
+
10
+ try {
11
+ require.resolve('react/jsx-runtime');
12
+ return true;
13
+ } catch (e) {
14
+ return false;
15
+ }
16
+ })();
17
+
18
+ module.exports = babelJest.createTransformer({
19
+ presets: [
20
+ [
21
+ require.resolve('babel-preset-react-app'),
22
+ {
23
+ runtime: hasJsxRuntime ? 'automatic' : 'classic',
24
+ },
25
+ ],
26
+ ],
27
+ babelrc: false,
28
+ configFile: false,
29
+ });
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ // This is a custom Jest transformer turning style imports into empty objects.
4
+ // http://facebook.github.io/jest/docs/en/webpack.html
5
+
6
+ module.exports = {
7
+ process() {
8
+ return 'module.exports = {};';
9
+ },
10
+ getCacheKey() {
11
+ // The output is always the same.
12
+ return 'cssTransform';
13
+ },
14
+ };
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+ const camelcase = require('camelcase');
5
+
6
+ // This is a custom Jest transformer turning file imports into filenames.
7
+ // http://facebook.github.io/jest/docs/en/webpack.html
8
+
9
+ module.exports = {
10
+ process(src, filename) {
11
+ const assetFilename = JSON.stringify(path.basename(filename));
12
+
13
+ if (filename.match(/\.svg$/)) {
14
+ // Based on how SVGR generates a component name:
15
+ // https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6
16
+ const pascalCaseFilename = camelcase(path.parse(filename).name, {
17
+ pascalCase: true,
18
+ });
19
+ const componentName = `Svg${pascalCaseFilename}`;
20
+ return `const React = require('react');
21
+ module.exports = {
22
+ __esModule: true,
23
+ default: ${assetFilename},
24
+ ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
25
+ return {
26
+ $$typeof: Symbol.for('react.element'),
27
+ type: 'svg',
28
+ ref: ref,
29
+ key: null,
30
+ props: Object.assign({}, props, {
31
+ children: ${assetFilename}
32
+ })
33
+ };
34
+ }),
35
+ };`;
36
+ }
37
+
38
+ return `module.exports = ${assetFilename};`;
39
+ },
40
+ };
@@ -0,0 +1,134 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const paths = require('./paths');
6
+ const chalk = require('react-dev-utils/chalk');
7
+ const resolve = require('resolve');
8
+
9
+ /**
10
+ * Get additional module paths based on the baseUrl of a compilerOptions object.
11
+ *
12
+ * @param {Object} options
13
+ */
14
+ function getAdditionalModulePaths(options = {}) {
15
+ const baseUrl = options.baseUrl;
16
+
17
+ if (!baseUrl) {
18
+ return '';
19
+ }
20
+
21
+ const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
22
+
23
+ // We don't need to do anything if `baseUrl` is set to `node_modules`. This is
24
+ // the default behavior.
25
+ if (path.relative(paths.appNodeModules, baseUrlResolved) === '') {
26
+ return null;
27
+ }
28
+
29
+ // Allow the user set the `baseUrl` to `appSrc`.
30
+ if (path.relative(paths.appSrc, baseUrlResolved) === '') {
31
+ return [paths.appSrc];
32
+ }
33
+
34
+ // If the path is equal to the root directory we ignore it here.
35
+ // We don't want to allow importing from the root directly as source files are
36
+ // not transpiled outside of `src`. We do allow importing them with the
37
+ // absolute path (e.g. `src/Components/Button.js`) but we set that up with
38
+ // an alias.
39
+ if (path.relative(paths.appPath, baseUrlResolved) === '') {
40
+ return null;
41
+ }
42
+
43
+ // Otherwise, throw an error.
44
+ throw new Error(
45
+ chalk.red.bold(
46
+ "Your project's `baseUrl` can only be set to `src` or `node_modules`." +
47
+ ' Create React App does not support other values at this time.'
48
+ )
49
+ );
50
+ }
51
+
52
+ /**
53
+ * Get webpack aliases based on the baseUrl of a compilerOptions object.
54
+ *
55
+ * @param {*} options
56
+ */
57
+ function getWebpackAliases(options = {}) {
58
+ const baseUrl = options.baseUrl;
59
+
60
+ if (!baseUrl) {
61
+ return {};
62
+ }
63
+
64
+ const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
65
+
66
+ if (path.relative(paths.appPath, baseUrlResolved) === '') {
67
+ return {
68
+ src: paths.appSrc,
69
+ };
70
+ }
71
+ }
72
+
73
+ /**
74
+ * Get jest aliases based on the baseUrl of a compilerOptions object.
75
+ *
76
+ * @param {*} options
77
+ */
78
+ function getJestAliases(options = {}) {
79
+ const baseUrl = options.baseUrl;
80
+
81
+ if (!baseUrl) {
82
+ return {};
83
+ }
84
+
85
+ const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
86
+
87
+ if (path.relative(paths.appPath, baseUrlResolved) === '') {
88
+ return {
89
+ '^src/(.*)$': '<rootDir>/src/$1',
90
+ };
91
+ }
92
+ }
93
+
94
+ function getModules() {
95
+ // Check if TypeScript is setup
96
+ const hasTsConfig = fs.existsSync(paths.appTsConfig);
97
+ const hasJsConfig = fs.existsSync(paths.appJsConfig);
98
+
99
+ if (hasTsConfig && hasJsConfig) {
100
+ throw new Error(
101
+ 'You have both a tsconfig.json and a jsconfig.json. If you are using TypeScript please remove your jsconfig.json file.'
102
+ );
103
+ }
104
+
105
+ let config;
106
+
107
+ // If there's a tsconfig.json we assume it's a
108
+ // TypeScript project and set up the config
109
+ // based on tsconfig.json
110
+ if (hasTsConfig) {
111
+ const ts = require(resolve.sync('typescript', {
112
+ basedir: paths.appNodeModules,
113
+ }));
114
+ config = ts.readConfigFile(paths.appTsConfig, ts.sys.readFile).config;
115
+ // Otherwise we'll check if there is jsconfig.json
116
+ // for non TS projects.
117
+ } else if (hasJsConfig) {
118
+ config = require(paths.appJsConfig);
119
+ }
120
+
121
+ config = config || {};
122
+ const options = config.compilerOptions || {};
123
+
124
+ const additionalModulePaths = getAdditionalModulePaths(options);
125
+
126
+ return {
127
+ additionalModulePaths: additionalModulePaths,
128
+ webpackAliases: getWebpackAliases(options),
129
+ jestAliases: getJestAliases(options),
130
+ hasTsConfig,
131
+ };
132
+ }
133
+
134
+ module.exports = getModules();
@@ -0,0 +1,75 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+ const fs = require('fs');
5
+ const getPublicUrlOrPath = require('react-dev-utils/getPublicUrlOrPath');
6
+
7
+ // Make sure any symlinks in the project folder are resolved:
8
+ // https://github.com/facebook/create-react-app/issues/637
9
+ const appDirectory = fs.realpathSync(process.cwd());
10
+ const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
11
+
12
+ // We use `PUBLIC_URL` environment variable or "homepage" field to infer
13
+ // "public path" at which the app is served.
14
+ // webpack needs to know it to put the right <script> hrefs into HTML even in
15
+ // single-page apps that may serve index.html for nested URLs like /todos/42.
16
+ // We can't use a relative path in HTML because we don't want to load something
17
+ // like /todos/42/static/js/bundle.7289d.js. We have to know the root.
18
+ const publicUrlOrPath = getPublicUrlOrPath(
19
+ process.env.NODE_ENV === 'development',
20
+ require(resolveApp('package.json')).homepage,
21
+ process.env.PUBLIC_URL
22
+ );
23
+
24
+ const buildPath = process.env.BUILD_PATH || 'build';
25
+
26
+ const moduleFileExtensions = [
27
+ 'web.mjs',
28
+ 'mjs',
29
+ 'web.js',
30
+ 'js',
31
+ 'web.ts',
32
+ 'ts',
33
+ 'web.tsx',
34
+ 'tsx',
35
+ 'json',
36
+ 'web.jsx',
37
+ 'jsx',
38
+ ];
39
+
40
+ // Resolve file paths in the same order as webpack
41
+ const resolveModule = (resolveFn, filePath) => {
42
+ const extension = moduleFileExtensions.find(extension =>
43
+ fs.existsSync(resolveFn(`${filePath}.${extension}`))
44
+ );
45
+
46
+ if (extension) {
47
+ return resolveFn(`${filePath}.${extension}`);
48
+ }
49
+
50
+ return resolveFn(`${filePath}.js`);
51
+ };
52
+
53
+ // config after eject: we're in ./config/
54
+ module.exports = {
55
+ dotenv: resolveApp('.env'),
56
+ appPath: resolveApp('.'),
57
+ appBuild: resolveApp(buildPath),
58
+ appPublic: resolveApp('public'),
59
+ appHtml: resolveApp('public/index.html'),
60
+ appIndexJs: resolveModule(resolveApp, 'src/index'),
61
+ appPackageJson: resolveApp('package.json'),
62
+ appSrc: resolveApp('src'),
63
+ appTsConfig: resolveApp('tsconfig.json'),
64
+ appJsConfig: resolveApp('jsconfig.json'),
65
+ yarnLockFile: resolveApp('yarn.lock'),
66
+ testsSetup: resolveModule(resolveApp, 'src/setupTests'),
67
+ proxySetup: resolveApp('src/setupProxy.js'),
68
+ appNodeModules: resolveApp('node_modules'),
69
+ swSrc: resolveModule(resolveApp, 'src/service-worker'),
70
+ publicUrlOrPath,
71
+ };
72
+
73
+
74
+
75
+ module.exports.moduleFileExtensions = moduleFileExtensions;
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+
3
+ const { resolveModuleName } = require('ts-pnp');
4
+
5
+ exports.resolveModuleName = (
6
+ typescript,
7
+ moduleName,
8
+ containingFile,
9
+ compilerOptions,
10
+ resolutionHost
11
+ ) => {
12
+ return resolveModuleName(
13
+ moduleName,
14
+ containingFile,
15
+ compilerOptions,
16
+ resolutionHost,
17
+ typescript.resolveModuleName
18
+ );
19
+ };
20
+
21
+ exports.resolveTypeReferenceDirective = (
22
+ typescript,
23
+ moduleName,
24
+ containingFile,
25
+ compilerOptions,
26
+ resolutionHost
27
+ ) => {
28
+ return resolveModuleName(
29
+ moduleName,
30
+ containingFile,
31
+ compilerOptions,
32
+ resolutionHost,
33
+ typescript.resolveTypeReferenceDirective
34
+ );
35
+ };