@mapcomponents/react-maplibre 0.1.66 → 0.1.68

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 (287) hide show
  1. package/.github/workflows/node_version_test.yml +1 -1
  2. package/.storybook/main.js +37 -31
  3. package/.storybook/preview.js +21 -0
  4. package/CHANGELOG.md +13 -0
  5. package/coverage/clover.xml +545 -472
  6. package/coverage/coverage-final.json +18 -17
  7. package/coverage/lcov-report/index.html +80 -80
  8. package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +50 -26
  9. package/coverage/lcov-report/src/components/MapLibreMap/index.html +5 -5
  10. package/coverage/lcov-report/src/components/MlCenterPosition/MlCenterPosition.tsx.html +30 -51
  11. package/coverage/lcov-report/src/components/MlCenterPosition/index.html +3 -3
  12. package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +1 -1
  13. package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
  14. package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.cy.tsx.html +1 -1
  15. package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.tsx.html +1 -1
  16. package/coverage/lcov-report/src/components/MlCreatePdfForm/index.html +1 -1
  17. package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +1 -1
  18. package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +1 -1
  19. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html +1 -1
  20. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
  21. package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.tsx.html +48 -105
  22. package/coverage/lcov-report/src/components/MlFollowGps/index.html +15 -15
  23. package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx.html +2 -2
  24. package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
  25. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.js.html +1 -1
  26. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.js.html +1 -1
  27. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.tsx.html +1 -1
  28. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.tsx.html +1 -1
  29. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/index.html +1 -1
  30. package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.tsx.html +1 -1
  31. package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/index.html +1 -1
  32. package/coverage/lcov-report/src/components/MlGpxViewer/MlGpxViewer.tsx.html +1 -1
  33. package/coverage/lcov-report/src/components/MlGpxViewer/index.html +1 -1
  34. package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +1 -1
  35. package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +1 -1
  36. package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +1 -1
  37. package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
  38. package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.tsx.html +52 -40
  39. package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +10 -10
  40. package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.html +4 -4
  41. package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +1 -1
  42. package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +1 -1
  43. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +1 -1
  44. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
  45. package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
  46. package/coverage/lcov-report/src/components/MlMarker/MlMarker.tsx.html +1 -1
  47. package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
  48. package/coverage/lcov-report/src/components/MlMeasureTool/MlMeasureTool.tsx.html +1 -1
  49. package/coverage/lcov-report/src/components/MlMeasureTool/index.html +1 -1
  50. package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.tsx.html +1 -1
  51. package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
  52. package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.tsx.html +41 -113
  53. package/coverage/lcov-report/src/components/MlNavigationTools/index.html +15 -15
  54. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
  55. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.stories_.js.html +1 -1
  56. package/coverage/lcov-report/src/components/MlOsmLayer/index.html +1 -1
  57. package/coverage/lcov-report/src/components/MlScaleReference/{MlScaleReference.js.html → MlScaleReference.tsx.html} +57 -36
  58. package/coverage/lcov-report/src/components/MlScaleReference/index.html +2 -2
  59. package/coverage/lcov-report/src/components/MlShareMapState/{MlShareMapState.js.html → MlShareMapState.tsx.html} +192 -84
  60. package/coverage/lcov-report/src/components/MlShareMapState/index.html +20 -20
  61. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/ColorPicker.tsx.html +1 -1
  62. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerList.tsx.html +1 -1
  63. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerListItem.tsx.html +1 -1
  64. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx.html +2 -2
  65. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/index.html +1 -1
  66. package/coverage/lcov-report/src/components/MlSketchTool/MlSketchTool.tsx.html +2 -2
  67. package/coverage/lcov-report/src/components/MlSketchTool/index.html +1 -1
  68. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.tsx.html +1 -1
  69. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
  70. package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
  71. package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreejsLayer.tsx.html +769 -0
  72. package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +25 -10
  73. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +1 -1
  74. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +1 -1
  75. package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
  76. package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
  77. package/coverage/lcov-report/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx.html +22 -10
  78. package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +13 -13
  79. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +11 -11
  80. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +11 -11
  81. package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.tsx.html +1 -1
  82. package/coverage/lcov-report/src/components/MlWmsLayer/index.html +1 -1
  83. package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +27 -18
  84. package/coverage/lcov-report/src/components/MlWmsLoader/index.html +11 -11
  85. package/coverage/lcov-report/src/contexts/MapContext.tsx.html +72 -27
  86. package/coverage/lcov-report/src/contexts/SimpleDataContext.js.html +1 -1
  87. package/coverage/lcov-report/src/contexts/SimpleDataProvider.js.html +1 -1
  88. package/coverage/lcov-report/src/contexts/index.html +1 -1
  89. package/coverage/lcov-report/src/hooks/index.html +21 -21
  90. package/coverage/lcov-report/src/hooks/useCameraFollowPath/index.html +1 -1
  91. package/coverage/lcov-report/src/hooks/useCameraFollowPath/useCameraFollowPath.tsx.html +1 -1
  92. package/coverage/lcov-report/src/hooks/useExportMap/index.html +1 -1
  93. package/coverage/lcov-report/src/hooks/useExportMap/index.ts.html +1 -1
  94. package/coverage/lcov-report/src/hooks/useExportMap/lib.ts.html +2 -2
  95. package/coverage/lcov-report/src/hooks/useGpx/index.html +1 -1
  96. package/coverage/lcov-report/src/hooks/useGpx/useGpx.tsx.html +1 -1
  97. package/coverage/lcov-report/src/hooks/useLayer.ts.html +1 -1
  98. package/coverage/lcov-report/src/hooks/useLayerEvent.js.html +9 -9
  99. package/coverage/lcov-report/src/hooks/useLayerFilter/index.html +1 -1
  100. package/coverage/lcov-report/src/hooks/useLayerFilter/useLayerFilter.ts.html +1 -1
  101. package/coverage/lcov-report/src/hooks/useLayerHoverPopup/index.html +1 -1
  102. package/coverage/lcov-report/src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx.html +9 -6
  103. package/coverage/lcov-report/src/hooks/useMap.ts.html +2 -2
  104. package/coverage/lcov-report/src/hooks/useMapState.ts.html +8 -29
  105. package/coverage/lcov-report/src/hooks/useSource.ts.html +10 -10
  106. package/coverage/lcov-report/src/hooks/useWms.ts.html +1 -1
  107. package/coverage/lcov-report/src/index.html +1 -1
  108. package/coverage/lcov-report/src/index.ts.html +105 -12
  109. package/coverage/lcov.info +1038 -917
  110. package/dist/components/MapLibreMap/MapLibreMap.d.ts +3 -3
  111. package/dist/components/MapLibreMap/MapLibreMap.stories.d.ts +5 -0
  112. package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +17 -15
  113. package/dist/components/MlCenterPosition/MlCenterPosition.d.ts +2 -15
  114. package/dist/components/MlCenterPosition/MlCenterPosition.stories.d.ts +2 -15
  115. package/dist/components/MlComponentTemplate/MlComponentTemplate.d.ts +1 -0
  116. package/dist/components/MlComponentTemplate/MlComponentTemplate.stories.d.ts +2 -1
  117. package/dist/components/MlCreatePdfButton/MlCreatePdfButton.d.ts +1 -0
  118. package/dist/components/MlCreatePdfButton/MlCreatePdfButton.stories.d.ts +2 -1
  119. package/dist/components/MlCreatePdfForm/MlCreatePdfForm.d.ts +1 -0
  120. package/dist/components/MlCreatePdfForm/MlCreatePdfForm.stories.d.ts +2 -1
  121. package/dist/components/MlCreatePdfForm/lib/PdfForm.d.ts +1 -0
  122. package/dist/components/MlCreatePdfForm/lib/_PdfPreview.d.ts +1 -0
  123. package/dist/components/MlFeatureEditor/MlFeatureEditor.d.ts +1 -0
  124. package/dist/components/MlFeatureEditor/lib/create_supplementary_points.d.ts +1 -1
  125. package/dist/components/MlFeatureEditor/lib/create_vertex.d.ts +1 -1
  126. package/dist/components/MlFillExtrusionLayer/MlFillExtrusionLayer.d.ts +1 -0
  127. package/dist/components/MlFollowGps/MlFollowGps.d.ts +5 -23
  128. package/dist/components/MlFollowGps/MlFollowGps.stories.d.ts +2 -2
  129. package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +1 -0
  130. package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.d.ts +2 -1
  131. package/dist/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.d.ts +1 -0
  132. package/dist/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.d.ts +1 -0
  133. package/dist/components/MlGeoJsonLayer/util/getDefaultPaintPropsByType.d.ts +4 -1
  134. package/dist/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.d.ts +1 -0
  135. package/dist/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.stories.d.ts +2 -1
  136. package/dist/components/MlGpxViewer/MlGpxViewer.d.ts +1 -0
  137. package/dist/components/MlGpxViewer/MlGpxViewer.stories.d.ts +2 -1
  138. package/dist/components/MlGpxViewer/util/GeoJsonProvider.d.ts +1 -0
  139. package/dist/components/MlGpxViewer/util/MetadataDrawer.d.ts +1 -0
  140. package/dist/components/MlGpxViewer/util/MlGpxDemoLoader.d.ts +1 -0
  141. package/dist/components/MlGpxViewer/util/MlGpxViewerInstructions.d.ts +1 -0
  142. package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.d.ts +1 -0
  143. package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.d.ts +2 -1
  144. package/dist/components/MlLayer/MlLayer.d.ts +1 -0
  145. package/dist/components/MlLayerMagnify/MlLayerMagnify.stories.d.ts +2 -1
  146. package/dist/components/MlLayerSwipe/MlLayerSwipe.stories.d.ts +2 -1
  147. package/dist/components/MlMarker/MlMarker.d.ts +1 -0
  148. package/dist/components/MlMeasureTool/MlMeasureTool.d.ts +1 -0
  149. package/dist/components/MlNavigationCompass/MlNavigationCompass.d.ts +1 -0
  150. package/dist/components/MlNavigationTools/MlNavigationTools.d.ts +5 -0
  151. package/dist/components/MlScaleReference/MlScaleReference.d.ts +8 -1
  152. package/dist/components/MlShareMapState/MlShareMapState.d.ts +33 -13
  153. package/dist/components/MlShareMapState/MlShareMapState.stories.d.ts +16 -9
  154. package/dist/components/MlSketchTool/LayerList/ColorPicker.d.ts +1 -0
  155. package/dist/components/MlSketchTool/LayerList/LayerList.d.ts +1 -0
  156. package/dist/components/MlSketchTool/LayerList/LayerListItem.d.ts +1 -0
  157. package/dist/components/MlSketchTool/LayerList/LayerPropertyForm.d.ts +1 -0
  158. package/dist/components/MlSketchTool/MlSketchTool.d.ts +1 -0
  159. package/dist/components/MlSketchTool/MlSketchTool.stories.d.ts +2 -1
  160. package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.d.ts +1 -0
  161. package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.d.ts +2 -1
  162. package/dist/components/MlSpatialElevationProfile/util/getElevationData.d.ts +1 -1
  163. package/dist/components/MlThreeJsLayer/MlThreeJsLayer.stories.d.ts +2 -1
  164. package/dist/components/MlThreeJsLayer/MlThreejsLayer.d.ts +30 -0
  165. package/dist/components/MlThreeJsLayer/lib/GLTFLoader.d.ts +2 -1
  166. package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.d.ts +1 -0
  167. package/dist/components/MlVectorTileLayer/MlVectorTileLayer.d.ts +3 -2
  168. package/dist/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.stories.d.ts +2 -1
  169. package/dist/components/MlWmsLayer/MlWmsLayer.d.ts +1 -0
  170. package/dist/components/MlWmsLoader/MlWmsLoader.d.ts +1 -0
  171. package/dist/components/MlWmsLoader/MlWmsLoader.stories.d.ts +2 -1
  172. package/dist/components/MlWmsLoader/utils/MlWmsLoaderInstructions.d.ts +1 -0
  173. package/dist/components/MlWmsLoader/utils/WMSLinks.d.ts +1 -0
  174. package/dist/contexts/MapContext.d.ts +13 -2
  175. package/dist/decorators/EmptyMapDecorator.d.ts +2 -0
  176. package/dist/decorators/MapContextDecorator.d.ts +1 -1
  177. package/dist/decorators/MapContextDecoratorHooks.d.ts +1 -1
  178. package/dist/decorators/MultiMapContextDecorator.d.ts +1 -1
  179. package/dist/decorators/NoNavToolsDecorator.d.ts +1 -1
  180. package/dist/decorators/ThemeDecorator.d.ts +2 -0
  181. package/dist/hooks/useCameraFollowPath/useCameraFollowPath.stories.d.ts +2 -1
  182. package/dist/hooks/useExportMap/lib.d.ts +1 -1
  183. package/dist/hooks/useLayerFilter/useLayerFilter.stories.d.ts +2 -1
  184. package/dist/hooks/useLayerHoverPopup/useLayerHoverPopup.d.ts +1 -0
  185. package/dist/index.d.ts +25 -8
  186. package/dist/index.esm.css +0 -97
  187. package/dist/index.esm.js +2187 -9306
  188. package/dist/index.esm.js.map +1 -1
  189. package/dist/setupTests.d.ts +6 -6
  190. package/dist/ui_components/Dropzone.d.ts +1 -0
  191. package/dist/ui_components/ImageLoader.d.ts +1 -0
  192. package/dist/ui_components/LayerList/LayerList.d.ts +6 -0
  193. package/dist/ui_components/LayerList/LayerList.stories.d.ts +12 -0
  194. package/dist/ui_components/LayerList/LayerListFolder.d.ts +9 -0
  195. package/dist/ui_components/LayerList/LayerListItem.d.ts +18 -0
  196. package/dist/ui_components/LayerList/util/LayerListItemVectorLayer.d.ts +15 -0
  197. package/dist/ui_components/LayerList/util/LayerPropertyForm.d.ts +10 -0
  198. package/dist/ui_components/LayerList/util/input/ColorPicker.d.ts +10 -0
  199. package/dist/ui_components/LoadingOverlayContext.d.ts +0 -1
  200. package/dist/ui_components/MapcomponentsTheme.d.ts +7 -0
  201. package/dist/ui_components/Tooltip.d.ts +1 -0
  202. package/dist/ui_components/TopToolbar.d.ts +1 -0
  203. package/dist/ui_components/UploadButton.d.ts +1 -0
  204. package/dist/util/Instructions.d.ts +1 -0
  205. package/package.json +67 -67
  206. package/public/thumbnails/{MlGPXViewer.png → MlGpxViewer.png} +0 -0
  207. package/rollup.config.js +68 -50
  208. package/src/@types/assets/index.d.ts +20 -0
  209. package/src/App.css +0 -55
  210. package/src/components/MapLibreMap/MapLibreMap.stories.js +38 -32
  211. package/src/components/MapLibreMap/MapLibreMap.tsx +29 -21
  212. package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +50 -40
  213. package/src/components/MlCenterPosition/MlCenterPosition.tsx +22 -29
  214. package/src/components/MlCreatePdfForm/lib/PdfForm.tsx +6 -6
  215. package/src/components/MlFollowGps/MlFollowGps.stories.js +28 -10
  216. package/src/components/MlFollowGps/MlFollowGps.tsx +38 -57
  217. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx +1 -1
  218. package/src/components/MlGeoJsonLayer/util/getDefaultPaintPropsByType.ts +16 -10
  219. package/src/components/MlGpxViewer/MlGpxViewer.stories.tsx +4 -13
  220. package/src/components/MlGpxViewer/util/MlGpxDemoLoader.tsx +3 -1
  221. package/src/components/MlLayerMagnify/MlLayerMagnify.tsx +21 -17
  222. package/src/components/MlLayerSwipe/MlLayerSwipe.tsx +3 -3
  223. package/src/components/MlNavigationTools/MlNavigationTools.stories.js +4 -5
  224. package/src/components/MlNavigationTools/MlNavigationTools.tsx +30 -54
  225. package/src/components/MlScaleReference/{MlScaleReference.js → MlScaleReference.tsx} +38 -31
  226. package/src/components/MlShareMapState/MlShareMapState.stories.tsx +100 -0
  227. package/src/components/MlShareMapState/{MlShareMapState.js → MlShareMapState.tsx} +94 -58
  228. package/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx +1 -1
  229. package/src/components/MlSketchTool/MlSketchTool.tsx +1 -1
  230. package/src/components/MlThreeJsLayer/MlThreejsLayer.tsx +228 -0
  231. package/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx +7 -3
  232. package/src/components/MlWmsLoader/MlWmsLoader.stories.tsx +3 -11
  233. package/src/components/MlWmsLoader/MlWmsLoader.tsx +7 -4
  234. package/src/components/MlWmsLoader/utils/MlWmsLoaderInstructions.tsx +2 -2
  235. package/src/components/MlWmsLoader/utils/WMSLinks.tsx +1 -1
  236. package/src/contexts/MapContext.tsx +34 -20
  237. package/src/custom.d.ts +4 -0
  238. package/src/decorators/EmptyMapDecorator.js +38 -0
  239. package/src/decorators/MapContextDecorator.js +31 -26
  240. package/src/decorators/MapContextDecoratorHooks.js +29 -24
  241. package/src/decorators/MultiMapContextDecorator.js +71 -71
  242. package/src/decorators/NoNavToolsDecorator.js +25 -23
  243. package/src/decorators/ThemeDecorator.js +24 -0
  244. package/src/decorators/style.css +0 -2
  245. package/src/hooks/useCameraFollowPath/useCameraFollowPath.stories.tsx +13 -19
  246. package/src/hooks/useExportMap/lib.ts +1 -1
  247. package/src/hooks/useGpx/useGpx.stories.js +1 -1
  248. package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.stories.js +1 -1
  249. package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx +5 -4
  250. package/src/hooks/useMap.ts +1 -1
  251. package/src/hooks/useMapState.stories.js +1 -1
  252. package/src/hooks/useMapState.ts +6 -13
  253. package/src/hooks/useSource.ts +1 -1
  254. package/src/hooks/useSources.stories.js +1 -1
  255. package/src/index.ts +40 -8
  256. package/src/ui_components/LayerList/LayerList.stories.tsx +136 -0
  257. package/src/ui_components/LayerList/LayerList.tsx +12 -0
  258. package/src/ui_components/LayerList/LayerListFolder.tsx +82 -0
  259. package/src/ui_components/LayerList/LayerListItem.tsx +180 -0
  260. package/src/ui_components/LayerList/assets/sample_1.json +26 -0
  261. package/src/ui_components/LayerList/assets/sample_2.json +22 -0
  262. package/src/ui_components/LayerList/assets/sample_polygon_1.json +33 -0
  263. package/src/ui_components/LayerList/assets/style.json +2599 -0
  264. package/src/ui_components/LayerList/util/LayerListItemVectorLayer.tsx +92 -0
  265. package/src/ui_components/LayerList/util/LayerPropertyForm.tsx +125 -0
  266. package/src/ui_components/LayerList/util/input/ColorPicker.tsx +44 -0
  267. package/src/ui_components/MapcomponentsTheme.tsx +133 -0
  268. package/src/ui_components/Sidebar.tsx +16 -11
  269. package/src/ui_components/TopToolbar.tsx +1 -3
  270. package/src/util/BubbleForInstructions.js +14 -12
  271. package/tsconfig.json +3 -9
  272. package/dist/components/MlGPXViewer/MlGPXViewer.d.ts +0 -29
  273. package/dist/components/MlGPXViewer/MlGPXViewer.stories.d.ts +0 -16
  274. package/dist/components/MlGPXViewer/MlGPXViewer.test.d.ts +0 -1
  275. package/dist/components/MlGPXViewer/gpxConverter.d.ts +0 -11
  276. package/dist/components/MlGPXViewer/util/GeoJsonContext.d.ts +0 -10
  277. package/dist/components/MlGPXViewer/util/GeoJsonProvider.d.ts +0 -4
  278. package/dist/components/MlLayer/MlLayer.stories.d.ts +0 -10
  279. package/dist/custom.d.d.ts +0 -22
  280. package/dist/decorators/ThemeWrapper.d.ts +0 -3
  281. package/dist/hooks/exportMap/index.d.ts +0 -11
  282. package/dist/hooks/exportMap/lib.d.ts +0 -36
  283. package/dist/ui_components/Legend.d.ts +0 -1
  284. package/dist/ui_components/LoadingOverlay.d.ts +0 -2
  285. package/src/components/MlShareMapState/MlShareMapState.stories.js +0 -100
  286. package/src/custom.d.tsx +0 -26
  287. package/src/decorators/ThemeWrapper.tsx +0 -9
@@ -1,11 +1,11 @@
1
1
  export var uuid_regex: string;
2
2
  export namespace mockMapLibreMethods {
3
- const on: jest.Mock<any, any>;
4
- const off: jest.Mock<any, any>;
5
- const addControl: jest.Mock<any, any>;
6
- const removeControl: jest.Mock<any, any>;
7
- const fitBounds: jest.Mock<any, any>;
8
- const hasControl: jest.Mock<boolean, []>;
3
+ const on: jest.Mock<any, any, any>;
4
+ const off: jest.Mock<any, any, any>;
5
+ const addControl: jest.Mock<any, any, any>;
6
+ const removeControl: jest.Mock<any, any, any>;
7
+ const fitBounds: jest.Mock<any, any, any>;
8
+ const hasControl: jest.Mock<boolean, [], any>;
9
9
  function getCanvas(): HTMLCanvasElement;
10
10
  function getContainer(): {
11
11
  style: {};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  type Props = {
2
3
  setData: (data: string) => void;
3
4
  };
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { SxProps } from '@mui/material';
2
3
  interface ImageLoaderProps {
3
4
  src: string;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ type Props = {
3
+ children: JSX.Element | JSX.Element[];
4
+ };
5
+ declare function LayerList({ children }: Props): JSX.Element;
6
+ export default LayerList;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import LayerList from './LayerList';
3
+ declare const storyoptions: {
4
+ title: string;
5
+ component: typeof LayerList;
6
+ argTypes: {};
7
+ decorators: ((Story: any, context: any) => JSX.Element)[];
8
+ };
9
+ export default storyoptions;
10
+ export declare const ExampleConfig: any;
11
+ export declare const FolderExample: any;
12
+ export declare const VectortileExample: any;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ type Props = {
3
+ visible: boolean;
4
+ name?: string;
5
+ children: JSX.Element | JSX.Element[];
6
+ setVisible?: (visible: boolean | ((val: unknown) => boolean)) => void;
7
+ };
8
+ export default function LayerListFolder({ visible, name, children, setVisible }: Props): JSX.Element;
9
+ export {};
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ type Props = {
3
+ layerComponent: JSX.Element;
4
+ visible: boolean;
5
+ configurable: boolean;
6
+ type?: 'background' | 'background-labels' | 'layer' | 'wms-layer' | 'vector-tile-layer';
7
+ name: string;
8
+ description?: string;
9
+ setLayerState?: (state: unknown) => void;
10
+ };
11
+ declare function LayerListItem({ layerComponent, visible, type, name, description, configurable, setLayerState, }: Props): JSX.Element;
12
+ declare namespace LayerListItem {
13
+ var defaultProps: {
14
+ type: string;
15
+ visible: boolean;
16
+ };
17
+ }
18
+ export default LayerListItem;
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import { MlVectorTileLayerProps } from '../../../components/MlVectorTileLayer/MlVectorTileLayer';
3
+ type Props = {
4
+ id: string;
5
+ configurable?: boolean;
6
+ vtProps: MlVectorTileLayerProps;
7
+ setVtProps: ((state: unknown) => void) | undefined;
8
+ };
9
+ declare function LayerListItemVectorLayer({ configurable, vtProps, setVtProps, id }: Props): JSX.Element;
10
+ declare namespace LayerListItemVectorLayer {
11
+ var defaultProps: {
12
+ configurable: boolean;
13
+ };
14
+ }
15
+ export default LayerListItemVectorLayer;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { CircleLayerSpecification, FillLayerSpecification, LineLayerSpecification } from 'maplibre-gl';
3
+ export type paintPropsType = CircleLayerSpecification['paint'] | FillLayerSpecification['paint'] | LineLayerSpecification['paint'];
4
+ type Props = {
5
+ paintProps: paintPropsType;
6
+ setPaintProps: (paintProps: paintPropsType | ((current: paintPropsType) => paintPropsType)) => void;
7
+ layerType: string;
8
+ };
9
+ export default function LayerPropertyForm({ paintProps, setPaintProps }: Props): JSX.Element;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { paintPropsType } from '../LayerPropertyForm';
3
+ type Props = {
4
+ key: string;
5
+ value: string;
6
+ propKey: string;
7
+ setPaintProps: (paintProps: paintPropsType | ((current: paintPropsType) => paintPropsType)) => void;
8
+ };
9
+ export default function PaintPropsColorPicker({ propKey, value, setPaintProps }: Props): JSX.Element;
10
+ export {};
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { JsxChildren } from 'typedoc/dist/lib/utils/jsx.elements';
4
3
  declare const LoadingOverlayContext: React.Context<{}>;
5
4
  declare const LoadingOverlayProvider: {
6
5
  (children: JsxChildren): JSX.Element;
@@ -0,0 +1,7 @@
1
+ declare module '@mui/material/Button' {
2
+ interface ButtonPropsVariantOverrides {
3
+ navtools: true;
4
+ }
5
+ }
6
+ declare const getTheme: (mode: 'light' | 'dark') => import("@mui/material/styles").Theme;
7
+ export default getTheme;
@@ -1 +1,2 @@
1
+ /// <reference types="react" />
1
2
  export default function Legend(): JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { AppBarProps, ToolbarProps, SxProps } from '@mui/material';
2
3
  interface TopToolbarProps extends AppBarProps {
3
4
  toolbarProps?: ToolbarProps;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  type Props = {
2
3
  setData: (data: string) => void;
3
4
  buttonComponent: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { SxProps } from '@mui/material';
2
3
  interface StepObject {
3
4
  duration: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapcomponents/react-maplibre",
3
- "version": "0.1.66",
3
+ "version": "0.1.68",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.esm.js",
@@ -19,98 +19,98 @@
19
19
  "build-catalogue-markdown-docs": "node scripts/build-catalogue-markdown-docs.js",
20
20
  "create-component": "./scripts/create-map-component.sh"
21
21
  },
22
- "dependencies": {
22
+ "dependencies": {},
23
+ "peerDependencies": {},
24
+ "devDependencies": {
25
+ "@babel/preset-react": "^7.18.6",
26
+ "@bahmutov/cy-rollup": "^2.0.0",
27
+ "@cypress/react": "^7.0.2",
28
+ "@cypress/webpack-preprocessor": "^5.16.1",
23
29
  "@emotion/css": "11.10.5",
24
30
  "@emotion/react": "11.10.5",
25
31
  "@emotion/styled": "11.10.5",
32
+ "@fontsource/material-icons": "^4.5.4",
33
+ "@fontsource/roboto": "^4.5.8",
26
34
  "@mapbox/mapbox-gl-draw": "^1.3.0",
27
35
  "@mapbox/mapbox-gl-sync-move": "0.3.0",
28
36
  "@mui/icons-material": "5.11.0",
29
- "@mui/material": "5.11.0",
30
- "@mui/styles": "5.11.0",
31
- "@turf/turf": "^6.5.0",
32
- "d3": "^7.7.0",
33
- "jspdf": "^2.5.1",
34
- "maplibre-gl": "^2.4.0",
35
- "mui-color": "^2.0.0-beta.2",
36
- "react-draggable": "^4.4.5",
37
- "react-i18next": "^11.14.3",
38
- "react-moveable": "^0.45.1",
39
- "three": "^0.147.0",
40
- "uuid": "^9.0.0",
41
- "wms-capabilities": "^0.6.0",
42
- "xmldom": "^0.6.0"
43
- },
44
- "peerDependencies": {},
45
- "devDependencies": {
46
- "@babel/preset-react": "^7.16.7",
47
- "@bahmutov/cy-rollup": "^2.0.0",
48
- "@cypress/react": "^6.2.0",
49
- "@cypress/webpack-preprocessor": "^5.14.0",
50
- "@rollup/plugin-alias": "^3.1.9",
51
- "@rollup/plugin-babel": "^5.3.1",
52
- "@rollup/plugin-commonjs": "^21.0.3",
53
- "@rollup/plugin-node-resolve": "^13.1.3",
54
- "@rollup/plugin-url": "^6.1.0",
55
- "@storybook/addon-actions": "^6.4.19",
56
- "@storybook/addon-docs": "^6.4.20",
57
- "@storybook/addon-essentials": "^6.4.19",
58
- "@storybook/addon-links": "^6.4.19",
59
- "@storybook/addons": "^6.4.19",
60
- "@storybook/node-logger": "^6.4.19",
61
- "@storybook/react": "^6.4.19",
37
+ "@mui/material": "5.11.6",
38
+ "@mui/styles": "5.11.2",
39
+ "@rollup/plugin-babel": "^6.0.3",
40
+ "@rollup/plugin-commonjs": "^24.0.1",
41
+ "@rollup/plugin-url": "^8.0.1",
42
+ "@storybook/addon-actions": "^6.5.16",
43
+ "@storybook/addon-docs": "^6.5.16",
44
+ "@storybook/addon-essentials": "^6.5.16",
45
+ "@storybook/addon-links": "^6.5.16",
46
+ "@storybook/addon-storysource": "^6.5.16",
47
+ "@storybook/addons": "^6.5.16",
48
+ "@storybook/builder-webpack5": "^6.5.16",
49
+ "@storybook/manager-webpack5": "^6.5.16",
50
+ "@storybook/node-logger": "^6.5.16",
51
+ "@storybook/react": "^6.5.16",
62
52
  "@storybook/testing-react": "^1.3.0",
63
- "@storybook/theming": "^6.4.19",
64
- "@svgr/rollup": "^6.2.1",
65
- "@testing-library/react": "^12.1.2",
66
- "@types/enzyme": "^3.10.11",
53
+ "@storybook/theming": "^6.5.16",
54
+ "@svgr/rollup": "^6.5.1",
55
+ "@testing-library/react": "^13.4.0",
56
+ "@turf/turf": "^6.5.0",
57
+ "@types/enzyme": "^3.10.12",
67
58
  "@types/expect": "^24.3.0",
68
- "@types/jest": "^29.2.5",
69
- "@types/mapbox__mapbox-gl-draw": "^1.2.3",
59
+ "@types/jest": "^29.4.0",
60
+ "@types/mapbox__mapbox-gl-draw": "^1.3.3",
70
61
  "@types/mapbox__point-geometry": "^0.1.2",
71
62
  "@types/mapbox__vector-tile": "^1.3.0",
72
- "@types/react": "^17.0.43",
73
- "@types/react-dom": "^17.0.14",
74
- "@types/uuid": "^8.3.4",
75
- "@typescript-eslint/eslint-plugin": "^5.36.1",
76
- "@typescript-eslint/parser": "^5.36.1",
77
- "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
63
+ "@types/react": "^18.0.27",
64
+ "@types/react-dom": "^18.0.10",
65
+ "@types/three": "^0.148.1",
66
+ "@types/uuid": "^9.0.0",
67
+ "@typescript-eslint/eslint-plugin": "^5.49.0",
68
+ "@typescript-eslint/parser": "^5.49.0",
69
+ "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
78
70
  "avj": "^0.0.0",
79
71
  "babel-jest": "^26.6.0",
80
72
  "babel-plugin-inline-react-svg": "^2.0.1",
81
- "babel-plugin-styled-components": "^2.0.6",
73
+ "babel-plugin-styled-components": "^2.0.7",
82
74
  "babel-preset-react-app": "^10.0.1",
83
- "cypress": "^10.9.0",
75
+ "cypress": "^12.4.1",
76
+ "d3": "^7.8.2",
84
77
  "enzyme": "^3.11.0",
85
- "eslint": "^8.23.0",
86
- "eslint-config-prettier": "^8.5.0",
87
- "eslint-plugin-react": "^7.31.1",
88
- "glob": "^7.2.0",
78
+ "eslint": "^8.32.0",
79
+ "eslint-config-prettier": "^8.6.0",
80
+ "eslint-plugin-react": "^7.32.1",
81
+ "glob": "^8.1.0",
89
82
  "jest": "26.6.0",
90
83
  "jest-circus": "26.6.0",
91
84
  "jest-environment-jsdom-sixteen": "^2.0.0",
92
85
  "jest-enzyme": "^7.1.2",
93
86
  "jest-resolve": "26.6.0",
94
87
  "jest-watch-typeahead": "0.6.1",
88
+ "jspdf": "^2.5.1",
89
+ "maplibre-gl": "^2.4.0",
90
+ "mui-color": "^2.0.0-beta.2",
95
91
  "node-fetch": "^3.3.0",
96
- "postcss": "^8.4.12",
97
- "prettier": "2.7.1",
98
- "react": "^17.0.2",
92
+ "postcss": "^8.4.21",
93
+ "prettier": "2.8.3",
94
+ "react": "^18.2.0",
99
95
  "react-app-polyfill": "^3.0.0",
100
- "react-dev-utils": "^12.0.0",
101
- "react-dom": "^17.0.2",
96
+ "react-dev-utils": "^12.0.1",
97
+ "react-dom": "^18.2.0",
98
+ "react-draggable": "^4.4.5",
99
+ "react-i18next": "^12.1.4",
100
+ "react-moveable": "^0.45.1",
102
101
  "rollup": "^2.70.1",
103
102
  "rollup-plugin-delete": "^2.0.0",
104
103
  "rollup-plugin-import-css": "^3.0.3",
105
- "rollup-plugin-peer-deps-external": "^2.2.4",
106
- "rollup-plugin-postcss": "^4.0.2",
104
+ "rollup-plugin-node-externals": "^5.1.2",
107
105
  "rollup-plugin-typescript2": "^0.31.2",
108
- "showdown": "^2.0.3",
109
- "ts-jest": "^27.1.4",
110
- "typedoc": "^0.22.13",
111
- "typedoc-plugin-missing-exports": "^0.22.6",
112
- "typedoc-twilio-theme": "^1.0.1",
113
- "typescript": "^4.6.3"
106
+ "showdown": "^2.1.0",
107
+ "storybook-source-link": "^2.0.4",
108
+ "three": "^0.149.0",
109
+ "ts-jest": "^29.0.5",
110
+ "typescript": "^4.9.4",
111
+ "uuid": "^9.0.0",
112
+ "wms-capabilities": "^0.6.0",
113
+ "xmldom": "^0.6.0"
114
114
  },
115
115
  "jest": {
116
116
  "roots": [
@@ -145,7 +145,7 @@
145
145
  "moduleNameMapper": {
146
146
  "^react-native$": "react-native-web",
147
147
  "^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy",
148
- "^!maplibre-gl$": "<rootDir>/node_modules/maplibre-gl",
148
+ "^maplibre-gl/dist/maplibre-gl$": "<rootDir>/node_modules/maplibre-gl",
149
149
  "d3": "<rootDir>/node_modules/d3/dist/d3.min.js"
150
150
  },
151
151
  "moduleFileExtensions": [
package/rollup.config.js CHANGED
@@ -1,56 +1,74 @@
1
- import peerDepsExternal from "rollup-plugin-peer-deps-external";
2
- import resolve from "@rollup/plugin-node-resolve";
3
- import commonjs from "@rollup/plugin-commonjs";
4
- import typescript from "rollup-plugin-typescript2";
1
+ import commonjs from '@rollup/plugin-commonjs';
2
+ import typescript from 'rollup-plugin-typescript2';
3
+ import { defineConfig } from 'rollup';
5
4
 
6
- import babel from "@rollup/plugin-babel";
7
- import url from "@rollup/plugin-url";
8
- import external from "rollup-plugin-peer-deps-external";
5
+ import babel from '@rollup/plugin-babel';
6
+ import url from '@rollup/plugin-url';
7
+ import externals from 'rollup-plugin-node-externals';
9
8
 
10
- import css from "rollup-plugin-import-css";
11
- import del from "rollup-plugin-delete";
12
- import svgr from "@svgr/rollup";
9
+ import css from 'rollup-plugin-import-css';
10
+ import del from 'rollup-plugin-delete';
11
+ import svgr from '@svgr/rollup';
13
12
 
14
- import pkg from "./package.json";
13
+ import pkg from './package.json';
15
14
 
16
- const config = {
17
- input: pkg.source,
18
- output: [{ file: pkg.module, format: "esm", sourcemap: true }],
19
- plugins: [
20
- svgr({
21
- svgo: false,
22
- }),
23
- url(),
24
- babel({
25
- exclude: "node_modules/**",
26
- babelHelpers: "bundled",
27
- presets: ["@babel/preset-react"],
28
- }),
29
- external(),
30
- peerDepsExternal(),
31
- resolve(),
32
- commonjs(),
33
- typescript({
34
- useTsconfigDeclarationDir: true,
35
- tsconfig: "tsconfig.json",
36
- }),
37
- css(),
38
- del({ targets: ["build/*"] }),
39
- ],
40
- external: [
41
- "prop-types",
42
- "d3",
43
- "@emotion/react",
44
- "@emotion/styled",
45
- "@babel/helpers",
46
- "jspdf",
47
- ...Object.keys(pkg.dependencies),
48
- ...Object.keys(pkg.peerDependencies),
49
- ...Object.keys(pkg.devDependencies),
50
- ],
51
- inlineDynamicImports: true,
52
- onwarn: function (warning, warn) {
53
- warn(warning);
54
- },
15
+ const externalsConfig = {
16
+ deps: true,
17
+ devDeps: true,
18
+ exclude:['react', 'react-dom']
55
19
  };
20
+
21
+ const config = defineConfig([
22
+ // CJS config
23
+ //{
24
+ // input: ['src/index.ts'],
25
+ // output: {
26
+ // file: 'dist/index.js',
27
+ // format: 'cjs',
28
+ // sourcemap: true,
29
+ // },
30
+ // plugins: [
31
+ // svgr({
32
+ // svgo: false,
33
+ // }),
34
+ // url(),
35
+ // babel(),
36
+ // externals(externalsConfig),
37
+ // typescript({ declarationDir: 'dist/types', sourceMap: true }),
38
+ // css(),
39
+ // del({ targets: ['dist/*'] }),
40
+ // ],
41
+ //},
42
+ // ESM config
43
+ {
44
+ input: ['src/index.ts'],
45
+ output: {
46
+ file: 'dist/index.esm.js',
47
+ format: 'cjs',
48
+ sourcemap: true,
49
+ },
50
+ plugins: [
51
+ svgr({
52
+ svgo: false,
53
+ }),
54
+ url(),
55
+ babel({
56
+ presets: ['@babel/preset-react'],
57
+ }),
58
+ externals(externalsConfig),
59
+ commonjs(),
60
+ typescript({ declarationDir: 'dist/types', sourceMap: true }),
61
+ css(),
62
+ del({ targets: ['dist/*'] }),
63
+ ],
64
+ external: [
65
+ 'react',
66
+ 'react-dom',
67
+ 'd3',
68
+ ...Object.keys(pkg.dependencies),
69
+ ...Object.keys(pkg.peerDependencies),
70
+ ...Object.keys(pkg.devDependencies),
71
+ ],
72
+ },
73
+ ]);
56
74
  export default config;
@@ -0,0 +1,20 @@
1
+ declare module "*.svg" {
2
+ import React = require('react');
3
+ export const ReactComponent: React.FC<React.SVGProps<SVGSVGElement>>;
4
+ const src: string;
5
+ export default src;
6
+ }
7
+ declare module "*.jpg" {
8
+ const content: string;
9
+ export default content;
10
+ }
11
+
12
+ declare module "*.png" {
13
+ const content: string;
14
+ export default content;
15
+ }
16
+
17
+ declare module "*.json" {
18
+ const content: string;
19
+ export default content;
20
+ }
package/src/App.css CHANGED
@@ -1,55 +0,0 @@
1
- /**
2
- * #root {
3
- background-color: #000;
4
- position: absolute;
5
- min-height: 400px;
6
- top: 0;
7
- bottom: 0;
8
- left: 0;
9
- right: 0;
10
- }
11
- .docs-story {
12
- min-height: 400px;
13
- display: flex;
14
- align-items: stretch;
15
- }
16
- .docs-story > div:first-child {
17
- width: 100%;
18
- }
19
- .MuiToolbar-root .MuiButtonBase-root {
20
- margin-right: 8px;
21
- }
22
-
23
- .App {
24
- position: absolute;
25
- top: 0;
26
- right: 0;
27
- bottom: 0;
28
- left: 0;
29
- }
30
- .mapContainer {
31
- position: absolute;
32
- height: 100vh;
33
- width: 100vw;
34
- top: 0;
35
- right: 0;
36
- left: 0;
37
- bottom: 0;
38
- z-index: 100;
39
- }
40
-
41
- .overlay {
42
- width: 100%;
43
- display: inline-flex;
44
- position: fixed;
45
- top: 0;
46
- left: 0;
47
- background-color: transparent;
48
- z-index: 1 !important;
49
- padding-top: 1rem;
50
- padding-left: 1rem;
51
- }
52
- .MuiToolbar-root .MuiButtonBase-root {
53
- margin-right: 8px;
54
- }
55
- */