@mapcomponents/react-maplibre 0.1.32 → 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.
- package/.babelrc +3 -0
- package/.github/workflows/storybook.yml +1 -1
- package/.storybook/.babelrc +26 -0
- package/.storybook/main.js +15 -1
- package/.storybook/mapcomponents_logo.png +0 -0
- package/CHANGELOG.md +10 -0
- package/config/env.js +106 -0
- package/config/getHttpsConfig.js +66 -0
- package/config/jest/babelTransform.js +29 -0
- package/config/jest/cssTransform.js +14 -0
- package/config/jest/fileTransform.js +40 -0
- package/config/modules.js +134 -0
- package/config/paths.js +75 -0
- package/config/pnpTs.js +35 -0
- package/config/webpack.config.js +757 -0
- package/config/webpackDevServer.config.js +130 -0
- package/coverage/clover.xml +822 -900
- package/coverage/coverage-final.json +23 -24
- package/coverage/lcov-report/index.html +135 -150
- package/coverage/lcov-report/src/components/MapLibreMap/{MapLibreMap.js.html → MapLibreMap.tsx.html} +77 -68
- package/coverage/lcov-report/src/components/MapLibreMap/index.html +6 -6
- package/coverage/lcov-report/src/components/MlCreatePdfButton/{MlCreatePdfButton.js.html → MlCreatePdfButton.tsx.html} +40 -43
- package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +10 -10
- package/coverage/lcov-report/src/components/MlFeatureEditor/{MlFeatureEditor.js.html → MlFeatureEditor.tsx.html} +145 -85
- package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +21 -21
- package/coverage/lcov-report/src/components/{MlImageMarkerLayer/MlImageMarkerLayer.js.html → MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html} +141 -111
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +20 -20
- package/coverage/lcov-report/src/components/MlFollowGps/{MlFollowGps.js.html → MlFollowGps.tsx.html} +177 -138
- package/coverage/lcov-report/src/components/MlFollowGps/index.html +15 -15
- package/coverage/lcov-report/src/components/MlGPXViewer/{MlGPXViewer.js.html → MlGPXViewer.tsx.html} +134 -80
- package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +1 -1
- package/coverage/lcov-report/src/components/MlGPXViewer/index.html +16 -16
- package/coverage/lcov-report/src/components/{MlLayer/MlLayer.js.html → MlGeoJsonLayer/MlGeoJsonLayer.tsx.html} +151 -154
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +19 -19
- package/coverage/lcov-report/src/components/{MlFillExtrusionLayer/MlFillExtrusionLayer.js.html → MlImageMarkerLayer/MlImageMarkerLayer.tsx.html} +151 -223
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +16 -16
- package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +229 -0
- package/coverage/lcov-report/src/components/MlLayer/index.html +21 -21
- package/coverage/lcov-report/src/components/MlLayerMagnify/{MlLayerMagnify.js.html → MlLayerMagnify.tsx.html} +134 -77
- package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +20 -20
- package/coverage/lcov-report/src/components/MlLayerSwipe/{MlLayerSwipe.js.html → MlLayerSwipe.tsx.html} +83 -41
- package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +2 -2
- package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +3 -15
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
- package/coverage/lcov-report/src/components/MlMarker/{MlMarker.js.html → MlMarker.tsx.html} +89 -137
- package/coverage/lcov-report/src/components/MlMarker/index.html +10 -10
- package/coverage/lcov-report/src/components/MlNavigationCompass/{MlNavigationCompass.js.html → MlNavigationCompass.tsx.html} +76 -25
- package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +17 -17
- package/coverage/lcov-report/src/components/MlNavigationTools/{MlNavigationTools.js.html → MlNavigationTools.tsx.html} +67 -52
- package/coverage/lcov-report/src/components/MlNavigationTools/index.html +10 -10
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlOsmLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlScaleReference/MlScaleReference.js.html +1 -1
- package/coverage/lcov-report/src/components/MlScaleReference/index.html +1 -1
- package/coverage/lcov-report/src/components/MlShareMapState/MlShareMapState.js.html +1 -1
- package/coverage/lcov-report/src/components/MlShareMapState/index.html +1 -1
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +3 -3
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
- package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +5 -5
- package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/{MlTransitionGeoJsonLayer.js.html → MlTransitionGeoJsonLayer.tsx.html} +127 -118
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +11 -11
- package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
- package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
- package/coverage/lcov-report/src/components/MlVectorTileLayer/{MlVectorTileLayer.js.html → MlVectorTileLayer.tsx.html} +59 -11
- package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +2 -2
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLayer/{MlWmsLayer.js.html → MlWmsLayer.tsx.html} +56 -11
- package/coverage/lcov-report/src/components/MlWmsLayer/index.html +2 -2
- package/coverage/lcov-report/src/components/MlWmsLoader/{MlWmsLoader.js.html → MlWmsLoader.tsx.html} +102 -78
- package/coverage/lcov-report/src/components/MlWmsLoader/index.html +8 -8
- package/coverage/lcov-report/src/hooks/index.html +44 -29
- package/coverage/lcov-report/src/{components/MlGeoJsonLayer/MlGeoJsonLayer.js.html → hooks/useLayer.ts.html} +328 -184
- package/coverage/lcov-report/src/hooks/{useMap.js.html → useMap.ts.html} +140 -50
- package/coverage/lcov-report/src/hooks/{useMapState.js.html → useMapState.ts.html} +166 -61
- package/coverage/lcov-report/src/hooks/useWms.js.html +1 -1
- package/coverage/lcov-report/src/index.html +15 -15
- package/coverage/lcov-report/src/{i18n.js.html → index.ts.html} +50 -32
- package/coverage/lcov.info +1540 -1669
- package/dist/index.esm.css +195 -0
- package/dist/index.esm.js +17304 -4936
- package/dist/index.esm.js.map +1 -1
- package/docs-build/0.d0c23b79.iframe.bundle.js +2 -0
- package/docs-build/0.d0c23b79.iframe.bundle.js.map +1 -0
- package/docs-build/0.fd1aa3ea21956d993519.manager.bundle.js +1 -0
- package/docs-build/1.34075652.iframe.bundle.js +10 -0
- package/docs-build/1.34075652.iframe.bundle.js.map +1 -0
- package/docs-build/16.ca488dae.iframe.bundle.js +2 -0
- package/docs-build/16.ca488dae.iframe.bundle.js.map +1 -0
- package/docs-build/17.e40eac7f.iframe.bundle.js +17 -0
- package/docs-build/17.e40eac7f.iframe.bundle.js.map +1 -0
- package/docs-build/18.62af0912.iframe.bundle.js +14 -0
- package/docs-build/18.62af0912.iframe.bundle.js.map +1 -0
- package/docs-build/19.0a217189.iframe.bundle.js +2 -0
- package/docs-build/19.0a217189.iframe.bundle.js.map +1 -0
- package/docs-build/2.f15ae19a.iframe.bundle.js +2 -0
- package/docs-build/2.f15ae19a.iframe.bundle.js.map +1 -0
- package/docs-build/20.4c43e27c.iframe.bundle.js +4 -0
- package/docs-build/20.4c43e27c.iframe.bundle.js.map +1 -0
- package/docs-build/21.19c21085.iframe.bundle.js +22 -0
- package/docs-build/21.19c21085.iframe.bundle.js.map +1 -0
- package/docs-build/3.5dd9e88b.iframe.bundle.js +2 -0
- package/docs-build/3.5dd9e88b.iframe.bundle.js.map +1 -0
- package/docs-build/4.f741dafe1833630ec8bf.manager.bundle.js +2 -0
- package/docs-build/4.f741dafe1833630ec8bf.manager.bundle.js.LICENSE.txt +8 -0
- package/docs-build/5.d4de191e7daeefb036ca.manager.bundle.js +1 -0
- package/docs-build/6.2b178c5444648ee5c0fa.manager.bundle.js +2 -0
- package/docs-build/6.2b178c5444648ee5c0fa.manager.bundle.js.LICENSE.txt +12 -0
- package/docs-build/7.7c16aea8ec7ea6e91994.manager.bundle.js +1 -0
- package/docs-build/8.52fa838fdf937b29676a.manager.bundle.js +1 -0
- package/docs-build/assets/dop.png +0 -0
- package/docs-build/assets/historic.png +0 -0
- package/docs-build/assets/marker.png +0 -0
- package/docs-build/assets/osm.png +0 -0
- package/docs-build/assets/sample.gpx +716 -0
- package/docs-build/{.gitkeep → catalogue/.gitkeep} +0 -0
- package/docs-build/catalogue/mc_meta.json +1 -0
- package/docs-build/favicon.ico +0 -0
- package/docs-build/iframe.html +348 -0
- package/docs-build/index.html +59 -0
- package/docs-build/logo.png +0 -0
- package/docs-build/main.8a7ec710ea1c16b5e13f.manager.bundle.js +1 -0
- package/docs-build/main~24120820.ba6665a8.iframe.bundle.js +2 -0
- package/docs-build/main~24120820.ba6665a8.iframe.bundle.js.map +1 -0
- package/docs-build/manifest.json +25 -0
- package/docs-build/robots.txt +3 -0
- package/docs-build/runtime~main.67aa1de2d72f40a81164.manager.bundle.js +1 -0
- package/docs-build/static/media/mapcomponents_logo.98b01a05.png +0 -0
- package/docs-build/static/media/wg-marker.bf3eeb2d.png +0 -0
- package/docs-build/stories.json +331 -0
- package/docs-build/thumbnails/MapLibreMap.png +0 -0
- package/docs-build/thumbnails/MlCameraFollowPath.png +0 -0
- package/docs-build/thumbnails/MlCreatePdfButton.png +0 -0
- package/docs-build/thumbnails/MlDeckGlLayer.png +0 -0
- package/docs-build/thumbnails/MlDeckGlTerrainLayer.png +0 -0
- package/docs-build/thumbnails/MlDemoDashboard.png +0 -0
- package/docs-build/thumbnails/MlFeatureEditor.png +0 -0
- package/docs-build/thumbnails/MlFillExtrusionLayer.png +0 -0
- package/docs-build/thumbnails/MlFollowGps.png +0 -0
- package/docs-build/thumbnails/MlGPXViewer.png +0 -0
- package/docs-build/thumbnails/MlGeoJsonLayer.png +0 -0
- package/docs-build/thumbnails/MlHillshadeLayer.png +0 -0
- package/docs-build/thumbnails/MlIconLayer.png +0 -0
- package/docs-build/thumbnails/MlLaermkarte.png +0 -0
- package/docs-build/thumbnails/MlLayerMagnify.png +0 -0
- package/docs-build/thumbnails/MlLayerSwipe.png +0 -0
- package/docs-build/thumbnails/MlMapDrawTools.png +0 -0
- package/docs-build/thumbnails/MlMobilerImker.png +0 -0
- package/docs-build/thumbnails/MlNavigationCompass.png +0 -0
- package/docs-build/thumbnails/MlNavigationTools.png +0 -0
- package/docs-build/thumbnails/MlOsmLayer.png +0 -0
- package/docs-build/thumbnails/MlScaleReference.png +0 -0
- package/docs-build/thumbnails/MlSpatialElevationProfile.png +0 -0
- package/docs-build/thumbnails/MlThreeJsLayer.png +0 -0
- package/docs-build/thumbnails/MlTransitionGeoJsonLayer.png +0 -0
- package/docs-build/thumbnails/MlVectorTileLayer.png +0 -0
- package/docs-build/thumbnails/MlWanderApp.png +0 -0
- package/docs-build/thumbnails/MlWmsLayer.png +0 -0
- package/docs-build/thumbnails/MlWmsLoader.png +0 -0
- package/docs-build/vendors~main.351900838c49e9200954.manager.bundle.js +2 -0
- package/docs-build/vendors~main.351900838c49e9200954.manager.bundle.js.LICENSE.txt +101 -0
- package/docs-build/vendors~main~0ad7406a.a6abfed7.iframe.bundle.js +8 -0
- package/docs-build/vendors~main~0ad7406a.a6abfed7.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~0f485567.1d7a15b7.iframe.bundle.js +2 -0
- package/docs-build/vendors~main~0f485567.1d7a15b7.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~41a6ab2c.525ecc56.iframe.bundle.js +2 -0
- package/docs-build/vendors~main~41a6ab2c.525ecc56.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~52589227.1d1558cd.iframe.bundle.js +8 -0
- package/docs-build/vendors~main~52589227.1d1558cd.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~73914085.227c6747.iframe.bundle.js +293 -0
- package/docs-build/vendors~main~73914085.227c6747.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~9c5b28f6.f02cc741.iframe.bundle.js +7 -0
- package/docs-build/vendors~main~9c5b28f6.f02cc741.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~b5906859.4083ac60.iframe.bundle.js +21 -0
- package/docs-build/vendors~main~b5906859.4083ac60.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~b8f44717.7a612c34.iframe.bundle.js +89 -0
- package/docs-build/vendors~main~b8f44717.7a612c34.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~b9cf3951.45da142d.iframe.bundle.js +68 -0
- package/docs-build/vendors~main~b9cf3951.45da142d.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~d939e436.92c27fbf.iframe.bundle.js +2 -0
- package/docs-build/vendors~main~d939e436.92c27fbf.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~dab50aa4.b0d58038.iframe.bundle.js +107 -0
- package/docs-build/vendors~main~dab50aa4.b0d58038.iframe.bundle.js.map +1 -0
- package/package.json +133 -117
- package/public/favicon.ico +0 -0
- package/public/logo.png +0 -0
- package/rollup.config.js +26 -3
- package/scripts/start.js +166 -0
- package/scripts/test.js +53 -0
- package/src/components/MapLibreMap/MapLibreMap.stories.js +14 -5
- package/src/components/MapLibreMap/MapLibreMap.test.js +1 -1
- package/src/components/MapLibreMap/{MapLibreMap.js → MapLibreMap.tsx} +40 -37
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.test.js +3 -3
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +636 -0
- package/src/components/MlComponentTemplate/MlComponentTemplate.stories.js +0 -2
- package/src/components/MlComponentTemplate/MlComponentTemplate.tsx +42 -0
- package/src/components/MlCreatePdfButton/MlCreatePdfButton.stories.js +0 -5
- package/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx +51 -0
- package/src/components/MlCreatePdfButton/lib/{createPdf.js → createPdf.ts} +26 -23
- package/src/components/MlCreatePdfButton/lib/{nominatimMap.js → nominatimMap.ts} +3 -3
- package/src/components/MlFeatureEditor/MlFeatureEditor.doc.en.md +1 -0
- package/src/components/MlFeatureEditor/MlFeatureEditor.tsx +139 -0
- package/src/components/MlFeatureEditor/custom-direct-select-mode.js +12 -8
- package/src/components/MlFeatureEditor/custom-polygon-mode.js +9 -5
- package/src/components/MlFeatureEditor/custom-select-mode.js +11 -7
- package/src/components/MlFeatureEditor/lib/LICENSE.md +18 -0
- package/src/components/MlFeatureEditor/lib/common_selectors.js +4 -0
- package/src/components/MlFeatureEditor/lib/constants.js +4 -0
- package/src/components/MlFeatureEditor/lib/constrain_feature_movement.js +4 -0
- package/src/components/MlFeatureEditor/lib/create_midpoint.js +4 -0
- package/src/components/MlFeatureEditor/lib/create_supplementary_points.js +4 -0
- package/src/components/MlFeatureEditor/lib/create_vertex.js +4 -0
- package/src/components/MlFeatureEditor/lib/double_click_zoom.js +4 -0
- package/src/components/MlFeatureEditor/lib/euclidean_distance.js +4 -0
- package/src/components/MlFeatureEditor/lib/features_at.js +4 -0
- package/src/components/MlFeatureEditor/lib/get_features_and_set_cursor.js +4 -0
- package/src/components/MlFeatureEditor/lib/is_click.js +4 -0
- package/src/components/MlFeatureEditor/lib/is_event_at_coordinates.js +4 -0
- package/src/components/MlFeatureEditor/lib/is_tap.js +4 -0
- package/src/components/MlFeatureEditor/lib/map_event_to_bounding_box.js +4 -0
- package/src/components/MlFeatureEditor/lib/mode_handler.js +4 -0
- package/src/components/MlFeatureEditor/lib/mouse_event_point.js +4 -0
- package/src/components/MlFeatureEditor/lib/move_features.js +4 -0
- package/src/components/MlFeatureEditor/lib/sort_features.js +4 -0
- package/src/components/MlFeatureEditor/lib/string_set.js +4 -0
- package/src/components/MlFeatureEditor/lib/string_sets_are_equal.js +4 -0
- package/src/components/MlFeatureEditor/lib/theme.js +4 -0
- package/src/components/MlFeatureEditor/lib/to_dense_array.js +4 -0
- package/src/components/MlFeatureEditor/lib/utils.js +4 -0
- package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.doc.en.md +1 -0
- package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.stories.js +6 -11
- package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx +85 -0
- package/src/components/MlFollowGps/MlFollowGps.doc.en.md +1 -0
- package/src/components/MlFollowGps/MlFollowGps.stories.js +0 -2
- package/src/components/MlFollowGps/{MlFollowGps.js → MlFollowGps.tsx} +99 -86
- package/src/components/MlGPXViewer/MlGPXViewer.doc.en.md +1 -0
- package/src/components/MlGPXViewer/{MlGPXViewer.js → MlGPXViewer.tsx} +68 -50
- package/src/components/MlGPXViewer/util/GeoJsonContext.ts +13 -0
- package/src/components/MlGPXViewer/util/{GeoJsonProvider.js → GeoJsonProvider.tsx} +3 -7
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.doc.en.md +1 -0
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.js +8 -3
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx +106 -0
- package/src/components/MlGeoJsonLayer/util/{getDefaultLayerTypeByGeometry.js → getDefaultLayerTypeByGeometry.ts} +6 -1
- package/src/components/MlGeoJsonLayer/util/{getDefaultPaintPropsByType.js → getDefaultPaintPropsByType.ts} +1 -1
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.js +1 -4
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx +129 -0
- package/src/components/MlLayer/MlLayer.stories.js +0 -2
- package/src/components/MlLayer/MlLayer.tsx +48 -0
- package/src/components/MlLayerMagnify/MlLayerMagnify.doc.en.md +1 -0
- package/src/components/MlLayerMagnify/MlLayerMagnify.stories.js +3 -3
- package/src/components/MlLayerMagnify/{MlLayerMagnify.js → MlLayerMagnify.tsx} +62 -43
- package/src/components/MlLayerSwipe/MlLayerSwipe.doc.en.md +1 -0
- package/src/components/MlLayerSwipe/MlLayerSwipe.stories.js +0 -2
- package/src/components/MlLayerSwipe/{MlLayerSwipe.js → MlLayerSwipe.tsx} +38 -24
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.js +0 -4
- package/src/components/MlMarker/MlMarker.tsx +140 -0
- package/src/components/MlNavigationCompass/MlNavigationCompass.doc.en.md +1 -0
- package/src/components/MlNavigationCompass/{MlNavigationCompass.js → MlNavigationCompass.tsx} +27 -10
- package/src/components/MlNavigationTools/MlNavigationTools.doc.en.md +1 -0
- package/src/components/MlNavigationTools/{MlNavigationTools.js → MlNavigationTools.tsx} +37 -32
- package/src/components/MlScaleReference/MlScaleReference.doc.en.md +1 -0
- package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.doc.en.md +1 -0
- package/src/components/MlThreeJsLayer/MlThreeJsLayer.doc.en.md +1 -0
- package/src/components/MlTransitionGeoJsonLayer/{MlTransitionGeoJsonLayer.js → MlTransitionGeoJsonLayer.tsx} +76 -73
- package/src/components/MlVectorTileLayer/MlVectorTileLayer.doc.en.md +1 -0
- package/src/components/MlVectorTileLayer/{MlVectorTileLayer.js → MlVectorTileLayer.tsx} +23 -7
- package/src/components/MlWmsLayer/{MlWmsLayer.js → MlWmsLayer.tsx} +22 -7
- package/src/components/MlWmsLoader/MlWmsLoader.doc.en.md +1 -0
- package/src/components/MlWmsLoader/{MlWmsLoader.js → MlWmsLoader.tsx} +55 -47
- package/src/custom.d.tsx +26 -0
- package/src/hooks/useLayer.ts +221 -0
- package/src/hooks/{useMap.js → useMap.ts} +48 -17
- package/src/hooks/{useMapState.js → useMapState.ts} +42 -7
- package/src/{index.js → index.ts} +15 -8
- package/tsconfig.json +18 -24
- package/.env +0 -1
- package/.storybook/main.bck.js +0 -56
- package/babel.config.json +0 -4
- package/coverage/lcov-report/src/translations/english.js.html +0 -94
- package/coverage/lcov-report/src/translations/german.js.html +0 -94
- package/coverage/lcov-report/src/translations/index.html +0 -131
- package/jest.config.json +0 -16
- package/jsdoc.json +0 -21
- package/public/assets/3D/posttower.gltf +0 -103
- package/public/assets/3D/posttower_simple.gltf +0 -103
- package/public/assets/3D/posttower_wh.gltf.glb +0 -0
- package/public/bee.png +0 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.js +0 -528
- package/src/components/MlComponentTemplate/MlComponentTemplate.js +0 -39
- package/src/components/MlCreatePdfButton/MlCreatePdfButton.js +0 -52
- package/src/components/MlFeatureEditor/MlFeatureEditor.js +0 -119
- package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.js +0 -153
- package/src/components/MlGPXViewer/util/GeoJsonContext.js +0 -6
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.js +0 -173
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.js +0 -75
- package/src/components/MlLayer/MlLayer.js +0 -107
- package/src/components/MlLayerMagnify/utils/compareMagnify.js +0 -173
- package/src/components/MlLayerSwipe/utils/swipeCompare.js +0 -220
- package/src/components/MlMarker/MlMarker.js +0 -156
- package/src/components/index.js +0 -6
- package/src/i18n.js +0 -28
- package/src/react-app-env.d.ts +0 -1
- package/src/stories/IntroductionCore.stories.mdx +0 -3
- package/src/stories/assets/code-brackets.svg +0 -1
- package/src/stories/assets/colors.svg +0 -1
- package/src/stories/assets/comments.svg +0 -1
- package/src/stories/assets/direction.svg +0 -1
- package/src/stories/assets/flow.svg +0 -1
- package/src/stories/assets/plugin.svg +0 -1
- package/src/stories/assets/repo.svg +0 -1
- package/src/stories/assets/stackalt.svg +0 -1
- package/src/stories/components/ComponentTeaser.js +0 -64
- package/src/translations/english.js +0 -4
- package/src/translations/german.js +0 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendors~main~dab50aa4.b0d58038.iframe.bundle.js","sources":["webpack:///vendors~main~dab50aa4.b0d58038.iframe.bundle.js"],"mappings":"AAAA;;;;;;;;;;AAuvRA;;;;;;;;AASA;;;;;;;;;;;;AAaA;;;;AAuBA;;;AAGA;AACA;AACA;;;AAGA;AACA;;;AAGA;;;;;;;;;AASA;;AAEA;AACA;AACA;;;AAGA;;;;;AAKA;;AAEA;;;;AAIA;;;;;;;;AAwoBA;;;;;;;;;;;;;;;AAgCA;AAqBA;AACA;AAiCA;AACA;;;;;AAwmBA","sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,55 +1,148 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapcomponents/react-maplibre",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.35",
|
|
4
|
+
"main": "index.js",
|
|
4
5
|
"license": "MIT",
|
|
5
|
-
"private": false,
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
7
|
-
"source": "src/index.
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
7
|
+
"source": "src/index.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "rollup -c",
|
|
10
|
+
"start": "start-storybook -p 6006 -s public",
|
|
11
|
+
"test": "node scripts/test.js --env=jest-environment-jsdom-sixteen --watchAll=false --coverage",
|
|
12
|
+
"test:noninteractive": "node scripts/test.js --env=jest-environment-jsdom-sixteen --verbose --watchAll=false --coverage",
|
|
13
|
+
"test:generate-output": "node scripts/test.js --env=jest-environment-jsdom-sixteen --watchAll=false --json --outputFile=./src/.jest-test-results.json || true",
|
|
14
|
+
"build-storybook": "build-storybook -o docs-build -s public",
|
|
15
|
+
"storybook-docs": "start-storybook --docs --no-manager-cache",
|
|
16
|
+
"build-catalogue-meta": "node scripts/build-catalogue-meta.js",
|
|
17
|
+
"build-catalogue-markdown-docs": "node scripts/build-catalogue-markdown-docs.js",
|
|
18
|
+
"create-component": "./scripts/create-map-component.sh"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@babel/preset-react": "^7.16.7",
|
|
23
|
+
"@emotion/css": "^11.7.1",
|
|
24
|
+
"@emotion/react": "^11.8.2",
|
|
25
|
+
"@emotion/styled": "^11.8.1",
|
|
26
|
+
"@mapbox/mapbox-gl-draw": "^1.3.0",
|
|
14
27
|
"@mapbox/mapbox-gl-sync-move": "^0.3.0",
|
|
15
28
|
"@mapcomponents/react-core": "^0.1.7",
|
|
16
|
-
"@mui/icons-material": "^5.
|
|
17
|
-
"@mui/material": "5.
|
|
18
|
-
"@mui/styles": "^5.3
|
|
29
|
+
"@mui/icons-material": "^5.5.1",
|
|
30
|
+
"@mui/material": "5.5.3",
|
|
31
|
+
"@mui/styles": "^5.5.3",
|
|
32
|
+
"@rollup/plugin-alias": "^3.1.9",
|
|
33
|
+
"@rollup/plugin-babel": "^5.3.1",
|
|
34
|
+
"@rollup/plugin-commonjs": "^21.0.3",
|
|
35
|
+
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
36
|
+
"@rollup/plugin-url": "^6.1.0",
|
|
37
|
+
"@storybook/addon-actions": "^6.4.19",
|
|
38
|
+
"@storybook/addon-docs": "^6.4.20",
|
|
39
|
+
"@storybook/addon-essentials": "^6.4.19",
|
|
40
|
+
"@storybook/addon-links": "^6.4.19",
|
|
41
|
+
"@storybook/addons": "^6.4.19",
|
|
42
|
+
"@storybook/node-logger": "^6.4.19",
|
|
43
|
+
"@storybook/react": "^6.4.19",
|
|
44
|
+
"@storybook/theming": "^6.4.19",
|
|
45
|
+
"@svgr/rollup": "^6.2.1",
|
|
46
|
+
"@testing-library/react": "^12.1.2",
|
|
19
47
|
"@turf/turf": "^6.5.0",
|
|
48
|
+
"@types/enzyme": "^3.10.11",
|
|
49
|
+
"@types/mapbox__mapbox-gl-draw": "^1.2.3",
|
|
50
|
+
"@types/mapbox__point-geometry": "^0.1.2",
|
|
51
|
+
"@types/mapbox__vector-tile": "^1.3.0",
|
|
52
|
+
"@types/react": "^17.0.43",
|
|
53
|
+
"@types/react-dom": "^17.0.14",
|
|
54
|
+
"@types/uuid": "^8.3.4",
|
|
55
|
+
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
|
|
56
|
+
"babel-jest": "^26.6.0",
|
|
57
|
+
"babel-plugin-inline-react-svg": "^2.0.1",
|
|
58
|
+
"babel-plugin-styled-components": "^2.0.6",
|
|
59
|
+
"babel-preset-react-app": "^10.0.1",
|
|
60
|
+
"docz": "^2.4.0",
|
|
61
|
+
"enzyme": "^3.11.0",
|
|
62
|
+
"glob": "^7.2.0",
|
|
63
|
+
"jest": "26.6.0",
|
|
64
|
+
"jest-circus": "26.6.0",
|
|
65
|
+
"jest-environment-jsdom-sixteen": "^2.0.0",
|
|
66
|
+
"jest-enzyme": "^7.1.2",
|
|
67
|
+
"jest-resolve": "26.6.0",
|
|
68
|
+
"jest-watch-typeahead": "0.6.1",
|
|
20
69
|
"jspdf": "^2.5.1",
|
|
21
|
-
"maplibre-gl": "^2.1.
|
|
22
|
-
"
|
|
23
|
-
"
|
|
70
|
+
"maplibre-gl": "^2.1.7",
|
|
71
|
+
"postcss": "^8.4.12",
|
|
72
|
+
"react": "^17.0.2",
|
|
73
|
+
"react-app-polyfill": "^3.0.0",
|
|
74
|
+
"react-dev-utils": "^12.0.0",
|
|
75
|
+
"react-dom": "^17.0.2",
|
|
76
|
+
"react-i18next": "^11.16.2",
|
|
77
|
+
"rollup": "^2.70.1",
|
|
78
|
+
"rollup-plugin-delete": "^2.0.0",
|
|
79
|
+
"rollup-plugin-import-css": "^3.0.3",
|
|
80
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
81
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
82
|
+
"rollup-plugin-typescript2": "^0.31.2",
|
|
83
|
+
"showdown": "^2.0.3",
|
|
84
|
+
"three": "^0.139.1",
|
|
85
|
+
"ts-jest": "^27.1.4",
|
|
86
|
+
"typedoc": "^0.22.13",
|
|
87
|
+
"typedoc-plugin-missing-exports": "^0.22.6",
|
|
88
|
+
"typedoc-twilio-theme": "^1.0.1",
|
|
89
|
+
"typescript": "^4.6.3",
|
|
24
90
|
"uuid": "^8.3.2",
|
|
25
91
|
"wms-capabilities": "^0.5.1",
|
|
26
92
|
"xmldom": "^0.6.0"
|
|
27
93
|
},
|
|
28
|
-
"dependenciesComment": {
|
|
29
|
-
"xmldom": "MlGPXLayer"
|
|
30
|
-
},
|
|
31
|
-
"browser": {
|
|
32
|
-
"fs": false,
|
|
33
|
-
"path": false,
|
|
34
|
-
"os": false
|
|
35
|
-
},
|
|
36
|
-
"scripts": {
|
|
37
|
-
"start": "start-storybook -p 6006 -s public",
|
|
38
|
-
"build": "rollup -c",
|
|
39
|
-
"test": "react-scripts test --env=jsdom --verbose --watchAll=true --coverage",
|
|
40
|
-
"test:noninteractive": "react-scripts test --verbose --watchAll=false --coverage",
|
|
41
|
-
"test:generate-output": "react-scripts test --watchAll=false --json --outputFile=./src/.jest-test-results.json || true",
|
|
42
|
-
"eject": "react-scripts eject",
|
|
43
|
-
"storybook": "start-storybook -p 6006 -s public",
|
|
44
|
-
"build-storybook": "build-storybook -o docs-build -s public",
|
|
45
|
-
"storybook-docs": "start-storybook --docs --no-manager-cache",
|
|
46
|
-
"build-catalogue-meta": "node scripts/build-catalogue-meta.js",
|
|
47
|
-
"build-catalogue-markdown-docs": "node scripts/build-catalogue-markdown-docs.js",
|
|
48
|
-
"create-component": "./scripts/create-map-component.sh",
|
|
49
|
-
"docs-create": "jsdoc -r -c ./jsdoc.json -d docs/jsdocs/react-map-components-maplibre/$npm_package_version",
|
|
50
|
-
"docs-serve": "http-server ./js-docs/react-map-components-maplibre/$npm_package_version -p 3001"
|
|
51
|
-
},
|
|
52
94
|
"jest": {
|
|
95
|
+
"roots": [
|
|
96
|
+
"<rootDir>/src"
|
|
97
|
+
],
|
|
98
|
+
"collectCoverageFrom": [
|
|
99
|
+
"src/**/*.{js,jsx,ts,tsx}",
|
|
100
|
+
"!src/**/*.d.ts"
|
|
101
|
+
],
|
|
102
|
+
"setupFiles": [
|
|
103
|
+
"react-app-polyfill/jsdom"
|
|
104
|
+
],
|
|
105
|
+
"setupFilesAfterEnv": [
|
|
106
|
+
"<rootDir>/src/setupTests.js"
|
|
107
|
+
],
|
|
108
|
+
"testMatch": [
|
|
109
|
+
"<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
|
|
110
|
+
"<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}"
|
|
111
|
+
],
|
|
112
|
+
"testEnvironment": "jsdom",
|
|
113
|
+
"testRunner": "./node_modules/jest-circus/runner.js",
|
|
114
|
+
"transform": {
|
|
115
|
+
"^.+\\.(js|jsx|mjs|cjs|ts|tsx)$": "<rootDir>/config/jest/babelTransform.js",
|
|
116
|
+
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
|
|
117
|
+
"^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
|
|
118
|
+
},
|
|
119
|
+
"transformIgnorePatterns": [
|
|
120
|
+
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$",
|
|
121
|
+
"^.+\\.module\\.(css|sass|scss)$"
|
|
122
|
+
],
|
|
123
|
+
"modulePaths": [],
|
|
124
|
+
"moduleNameMapper": {
|
|
125
|
+
"^react-native$": "react-native-web",
|
|
126
|
+
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy",
|
|
127
|
+
"^!maplibre-gl$": "<rootDir>/node_modules/maplibre-gl"
|
|
128
|
+
},
|
|
129
|
+
"moduleFileExtensions": [
|
|
130
|
+
"web.js",
|
|
131
|
+
"js",
|
|
132
|
+
"web.ts",
|
|
133
|
+
"ts",
|
|
134
|
+
"web.tsx",
|
|
135
|
+
"tsx",
|
|
136
|
+
"json",
|
|
137
|
+
"web.jsx",
|
|
138
|
+
"jsx",
|
|
139
|
+
"node"
|
|
140
|
+
],
|
|
141
|
+
"watchPlugins": [
|
|
142
|
+
"jest-watch-typeahead/filename",
|
|
143
|
+
"jest-watch-typeahead/testname"
|
|
144
|
+
],
|
|
145
|
+
"resetMocks": true,
|
|
53
146
|
"coveragePathIgnorePatterns": [
|
|
54
147
|
"/node_modules/",
|
|
55
148
|
"/src/decorators/",
|
|
@@ -73,87 +166,10 @@
|
|
|
73
166
|
".*/utils/.*",
|
|
74
167
|
".*/util/.*",
|
|
75
168
|
".*/assets/.*",
|
|
169
|
+
".*/custom.d.tsx",
|
|
76
170
|
"custom\\-.*\\-mode\\.js$",
|
|
77
171
|
"(.stories)\\.(ts|tsx|js)$",
|
|
78
172
|
"/distribution/.*\\.(ts|js)$"
|
|
79
|
-
],
|
|
80
|
-
"moduleNameMapper": {
|
|
81
|
-
"^!maplibre-gl$": "<rootDir>/node_modules/maplibre-gl"
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
"eslintConfig": {
|
|
85
|
-
"extends": [
|
|
86
|
-
"react-app",
|
|
87
|
-
"react-app/jest"
|
|
88
|
-
],
|
|
89
|
-
"rules": {
|
|
90
|
-
"import/no-webpack-loader-syntax": "off"
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
"browserslist": {
|
|
94
|
-
"production": [
|
|
95
|
-
">0.2%",
|
|
96
|
-
"not dead",
|
|
97
|
-
"not op_mini all"
|
|
98
|
-
],
|
|
99
|
-
"development": [
|
|
100
|
-
"last 1 chrome version",
|
|
101
|
-
"last 1 firefox version",
|
|
102
|
-
"last 1 safari version"
|
|
103
173
|
]
|
|
104
|
-
},
|
|
105
|
-
"prettier": {
|
|
106
|
-
"arrowParens": "always"
|
|
107
|
-
},
|
|
108
|
-
"peerDependencies": {},
|
|
109
|
-
"devDependencies": {
|
|
110
|
-
"@babel/cli": "^7.15.4",
|
|
111
|
-
"@babel/core": "^7.17.5",
|
|
112
|
-
"@babel/plugin-external-helpers": "^7.14.5",
|
|
113
|
-
"@babel/plugin-syntax-jsx": "^7.14.5",
|
|
114
|
-
"@babel/preset-env": "^7.13.9",
|
|
115
|
-
"@babel/preset-react": "^7.14.5",
|
|
116
|
-
"@emotion/babel-plugin": "^11.3.0",
|
|
117
|
-
"@rollup/plugin-babel": "^5.3.0",
|
|
118
|
-
"@rollup/plugin-json": "^4.1.0",
|
|
119
|
-
"@rollup/plugin-url": "^6.1.0",
|
|
120
|
-
"@storybook/addon-actions": "^6.3.12",
|
|
121
|
-
"@storybook/addon-docs": "^6.3.12",
|
|
122
|
-
"@storybook/addon-essentials": "^6.3.12",
|
|
123
|
-
"@storybook/addon-links": "^6.3.12",
|
|
124
|
-
"@storybook/addons": "^6.3.12",
|
|
125
|
-
"@storybook/node-logger": "^6.3.12",
|
|
126
|
-
"@storybook/preset-create-react-app": "^3.1.5",
|
|
127
|
-
"@storybook/react": "^6.3.12",
|
|
128
|
-
"@storybook/theming": "^6.3.12",
|
|
129
|
-
"@svgr/rollup": "^5.5.0",
|
|
130
|
-
"@testing-library/jest-dom": "^5.11.4",
|
|
131
|
-
"@testing-library/react": "^11.1.0",
|
|
132
|
-
"@testing-library/user-event": "^12.1.10",
|
|
133
|
-
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.3",
|
|
134
|
-
"babel-jest": "^27.5.1",
|
|
135
|
-
"better-docs": "^2.3.2",
|
|
136
|
-
"canvas": "^2.7.0",
|
|
137
|
-
"enzyme": "^3.11.0",
|
|
138
|
-
"glob": "^7.1.6",
|
|
139
|
-
"http-server": "^13.0.2",
|
|
140
|
-
"jest-enzyme": "^7.1.2",
|
|
141
|
-
"jest-webgl-canvas-mock": "^0.2.3",
|
|
142
|
-
"puppeteer": "^8.0.0",
|
|
143
|
-
"react": "^17.0.1",
|
|
144
|
-
"react-dom": "^17.0.1",
|
|
145
|
-
"react-scripts": "4.0.3",
|
|
146
|
-
"react-spinners": "^0.10.6",
|
|
147
|
-
"react-test-renderer": "^17.0.2",
|
|
148
|
-
"rollup-plugin-delete": "^2.0.0",
|
|
149
|
-
"rollup-plugin-import-css": "^3.0.2",
|
|
150
|
-
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
151
|
-
"sass": "^1.42.1",
|
|
152
|
-
"showdown": "^1.9.1",
|
|
153
|
-
"taffydb": "^2.7.3",
|
|
154
|
-
"ts-jest": "^26.5.3",
|
|
155
|
-
"typescript": "^4.4.2",
|
|
156
|
-
"web-vitals": "^0.2.4",
|
|
157
|
-
"webpack-merge": "^5.8.0"
|
|
158
174
|
}
|
|
159
175
|
}
|
package/public/favicon.ico
CHANGED
|
Binary file
|
package/public/logo.png
ADDED
|
Binary file
|
package/rollup.config.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
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";
|
|
5
|
+
|
|
1
6
|
import babel from "@rollup/plugin-babel";
|
|
2
7
|
import url from "@rollup/plugin-url";
|
|
3
8
|
import external from "rollup-plugin-peer-deps-external";
|
|
4
9
|
|
|
5
10
|
import css from "rollup-plugin-import-css";
|
|
6
11
|
import del from "rollup-plugin-delete";
|
|
7
|
-
import svgr from
|
|
12
|
+
import svgr from "@svgr/rollup";
|
|
13
|
+
|
|
8
14
|
import pkg from "./package.json";
|
|
9
15
|
|
|
10
16
|
const config = {
|
|
@@ -15,10 +21,18 @@ const config = {
|
|
|
15
21
|
svgo: false,
|
|
16
22
|
}),
|
|
17
23
|
url(),
|
|
18
|
-
external(),
|
|
19
24
|
babel({
|
|
20
25
|
exclude: "node_modules/**",
|
|
21
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",
|
|
22
36
|
}),
|
|
23
37
|
css(),
|
|
24
38
|
del({ targets: ["dist/*"] }),
|
|
@@ -28,7 +42,16 @@ const config = {
|
|
|
28
42
|
"d3",
|
|
29
43
|
"@emotion/react",
|
|
30
44
|
"@emotion/styled",
|
|
31
|
-
...Object.keys(pkg.peerDependencies ||
|
|
45
|
+
...Object.keys(pkg.peerDependencies || pkg.devDependencies),
|
|
32
46
|
],
|
|
47
|
+
inlineDynamicImports: true,
|
|
48
|
+
onwarn: function (warning, warn) {
|
|
49
|
+
if (
|
|
50
|
+
warning.code === "CIRCULAR_DEPENDENCY" ||
|
|
51
|
+
warning.code === "THIS_IS_UNDEFINED"
|
|
52
|
+
)
|
|
53
|
+
return;
|
|
54
|
+
warn(warning);
|
|
55
|
+
},
|
|
33
56
|
};
|
|
34
57
|
export default config;
|
package/scripts/start.js
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Do this as the first thing so that any code reading it knows the right env.
|
|
4
|
+
process.env.BABEL_ENV = 'development';
|
|
5
|
+
process.env.NODE_ENV = 'development';
|
|
6
|
+
|
|
7
|
+
// Makes the script crash on unhandled rejections instead of silently
|
|
8
|
+
// ignoring them. In the future, promise rejections that are not handled will
|
|
9
|
+
// terminate the Node.js process with a non-zero exit code.
|
|
10
|
+
process.on('unhandledRejection', err => {
|
|
11
|
+
throw err;
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
// Ensure environment variables are read.
|
|
15
|
+
require('../config/env');
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
const fs = require('fs');
|
|
19
|
+
const chalk = require('react-dev-utils/chalk');
|
|
20
|
+
const webpack = require('webpack');
|
|
21
|
+
const WebpackDevServer = require('webpack-dev-server');
|
|
22
|
+
const clearConsole = require('react-dev-utils/clearConsole');
|
|
23
|
+
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
|
|
24
|
+
const {
|
|
25
|
+
choosePort,
|
|
26
|
+
createCompiler,
|
|
27
|
+
prepareProxy,
|
|
28
|
+
prepareUrls,
|
|
29
|
+
} = require('react-dev-utils/WebpackDevServerUtils');
|
|
30
|
+
const openBrowser = require('react-dev-utils/openBrowser');
|
|
31
|
+
const semver = require('semver');
|
|
32
|
+
const paths = require('../config/paths');
|
|
33
|
+
const configFactory = require('../config/webpack.config');
|
|
34
|
+
const createDevServerConfig = require('../config/webpackDevServer.config');
|
|
35
|
+
const getClientEnvironment = require('../config/env');
|
|
36
|
+
const react = require(require.resolve('react', { paths: [paths.appPath] }));
|
|
37
|
+
|
|
38
|
+
const env = getClientEnvironment(paths.publicUrlOrPath.slice(0, -1));
|
|
39
|
+
const useYarn = fs.existsSync(paths.yarnLockFile);
|
|
40
|
+
const isInteractive = process.stdout.isTTY;
|
|
41
|
+
|
|
42
|
+
// Warn and crash if required files are missing
|
|
43
|
+
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Tools like Cloud9 rely on this.
|
|
48
|
+
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000;
|
|
49
|
+
const HOST = process.env.HOST || '0.0.0.0';
|
|
50
|
+
|
|
51
|
+
if (process.env.HOST) {
|
|
52
|
+
console.log(
|
|
53
|
+
chalk.cyan(
|
|
54
|
+
`Attempting to bind to HOST environment variable: ${chalk.yellow(
|
|
55
|
+
chalk.bold(process.env.HOST)
|
|
56
|
+
)}`
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
console.log(
|
|
60
|
+
`If this was unintentional, check that you haven't mistakenly set it in your shell.`
|
|
61
|
+
);
|
|
62
|
+
console.log(
|
|
63
|
+
`Learn more here: ${chalk.yellow('https://cra.link/advanced-config')}`
|
|
64
|
+
);
|
|
65
|
+
console.log();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// We require that you explicitly set browsers and do not fall back to
|
|
69
|
+
// browserslist defaults.
|
|
70
|
+
const { checkBrowsers } = require('react-dev-utils/browsersHelper');
|
|
71
|
+
checkBrowsers(paths.appPath, isInteractive)
|
|
72
|
+
.then(() => {
|
|
73
|
+
// We attempt to use the default port but if it is busy, we offer the user to
|
|
74
|
+
// run on a different port. `choosePort()` Promise resolves to the next free port.
|
|
75
|
+
return choosePort(HOST, DEFAULT_PORT);
|
|
76
|
+
})
|
|
77
|
+
.then(port => {
|
|
78
|
+
if (port == null) {
|
|
79
|
+
// We have not found a port.
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const config = configFactory('development');
|
|
84
|
+
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
|
|
85
|
+
const appName = require(paths.appPackageJson).name;
|
|
86
|
+
|
|
87
|
+
const useTypeScript = fs.existsSync(paths.appTsConfig);
|
|
88
|
+
const tscCompileOnError = process.env.TSC_COMPILE_ON_ERROR === 'true';
|
|
89
|
+
const urls = prepareUrls(
|
|
90
|
+
protocol,
|
|
91
|
+
HOST,
|
|
92
|
+
port,
|
|
93
|
+
paths.publicUrlOrPath.slice(0, -1)
|
|
94
|
+
);
|
|
95
|
+
const devSocket = {
|
|
96
|
+
warnings: warnings =>
|
|
97
|
+
devServer.sockWrite(devServer.sockets, 'warnings', warnings),
|
|
98
|
+
errors: errors =>
|
|
99
|
+
devServer.sockWrite(devServer.sockets, 'errors', errors),
|
|
100
|
+
};
|
|
101
|
+
// Create a webpack compiler that is configured with custom messages.
|
|
102
|
+
const compiler = createCompiler({
|
|
103
|
+
appName,
|
|
104
|
+
config,
|
|
105
|
+
devSocket,
|
|
106
|
+
urls,
|
|
107
|
+
useYarn,
|
|
108
|
+
useTypeScript,
|
|
109
|
+
tscCompileOnError,
|
|
110
|
+
webpack,
|
|
111
|
+
});
|
|
112
|
+
// Load proxy config
|
|
113
|
+
const proxySetting = require(paths.appPackageJson).proxy;
|
|
114
|
+
const proxyConfig = prepareProxy(
|
|
115
|
+
proxySetting,
|
|
116
|
+
paths.appPublic,
|
|
117
|
+
paths.publicUrlOrPath
|
|
118
|
+
);
|
|
119
|
+
// Serve webpack assets generated by the compiler over a web server.
|
|
120
|
+
const serverConfig = createDevServerConfig(
|
|
121
|
+
proxyConfig,
|
|
122
|
+
urls.lanUrlForConfig
|
|
123
|
+
);
|
|
124
|
+
const devServer = new WebpackDevServer(compiler, serverConfig);
|
|
125
|
+
// Launch WebpackDevServer.
|
|
126
|
+
devServer.listen(port, HOST, err => {
|
|
127
|
+
if (err) {
|
|
128
|
+
return console.log(err);
|
|
129
|
+
}
|
|
130
|
+
if (isInteractive) {
|
|
131
|
+
clearConsole();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (env.raw.FAST_REFRESH && semver.lt(react.version, '16.10.0')) {
|
|
135
|
+
console.log(
|
|
136
|
+
chalk.yellow(
|
|
137
|
+
`Fast Refresh requires React 16.10 or higher. You are using React ${react.version}.`
|
|
138
|
+
)
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
console.log(chalk.cyan('Starting the development server...\n'));
|
|
143
|
+
openBrowser(urls.localUrlForBrowser);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
['SIGINT', 'SIGTERM'].forEach(function (sig) {
|
|
147
|
+
process.on(sig, function () {
|
|
148
|
+
devServer.close();
|
|
149
|
+
process.exit();
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
if (process.env.CI !== 'true') {
|
|
154
|
+
// Gracefully exit when stdin ends
|
|
155
|
+
process.stdin.on('end', function () {
|
|
156
|
+
devServer.close();
|
|
157
|
+
process.exit();
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
})
|
|
161
|
+
.catch(err => {
|
|
162
|
+
if (err && err.message) {
|
|
163
|
+
console.log(err.message);
|
|
164
|
+
}
|
|
165
|
+
process.exit(1);
|
|
166
|
+
});
|
package/scripts/test.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Do this as the first thing so that any code reading it knows the right env.
|
|
4
|
+
process.env.BABEL_ENV = 'test';
|
|
5
|
+
process.env.NODE_ENV = 'test';
|
|
6
|
+
process.env.PUBLIC_URL = '';
|
|
7
|
+
|
|
8
|
+
// Makes the script crash on unhandled rejections instead of silently
|
|
9
|
+
// ignoring them. In the future, promise rejections that are not handled will
|
|
10
|
+
// terminate the Node.js process with a non-zero exit code.
|
|
11
|
+
process.on('unhandledRejection', err => {
|
|
12
|
+
throw err;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
// Ensure environment variables are read.
|
|
16
|
+
require('../config/env');
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
const jest = require('jest');
|
|
20
|
+
const execSync = require('child_process').execSync;
|
|
21
|
+
let argv = process.argv.slice(2);
|
|
22
|
+
|
|
23
|
+
function isInGitRepository() {
|
|
24
|
+
try {
|
|
25
|
+
execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' });
|
|
26
|
+
return true;
|
|
27
|
+
} catch (e) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function isInMercurialRepository() {
|
|
33
|
+
try {
|
|
34
|
+
execSync('hg --cwd . root', { stdio: 'ignore' });
|
|
35
|
+
return true;
|
|
36
|
+
} catch (e) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Watch unless on CI or explicitly running all tests
|
|
42
|
+
if (
|
|
43
|
+
!process.env.CI &&
|
|
44
|
+
argv.indexOf('--watchAll') === -1 &&
|
|
45
|
+
argv.indexOf('--watchAll=false') === -1
|
|
46
|
+
) {
|
|
47
|
+
// https://github.com/facebook/create-react-app/issues/5210
|
|
48
|
+
const hasSourceControl = isInGitRepository() || isInMercurialRepository();
|
|
49
|
+
argv.push(hasSourceControl ? '--watch' : '--watchAll');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
jest.run(argv);
|
|
@@ -18,7 +18,19 @@ export default storyoptions;
|
|
|
18
18
|
|
|
19
19
|
const Template = (args) => (
|
|
20
20
|
<MapComponentsProvider>
|
|
21
|
-
<MapLibreMap
|
|
21
|
+
<MapLibreMap
|
|
22
|
+
options={args.options}
|
|
23
|
+
style={{
|
|
24
|
+
position: "absolute",
|
|
25
|
+
height: "100vh",
|
|
26
|
+
width: "100vw",
|
|
27
|
+
top: 0,
|
|
28
|
+
right: 0,
|
|
29
|
+
left: 0,
|
|
30
|
+
bottom: 0,
|
|
31
|
+
zIndex: 100,
|
|
32
|
+
}}
|
|
33
|
+
/>
|
|
22
34
|
</MapComponentsProvider>
|
|
23
35
|
);
|
|
24
36
|
|
|
@@ -27,10 +39,7 @@ ExampleConfig.args = {
|
|
|
27
39
|
options: {
|
|
28
40
|
style: "https://wms.wheregroup.com/tileserver/style/osm-bright.json",
|
|
29
41
|
center: [8.607, 53.1409349],
|
|
30
|
-
|
|
31
|
-
[1.40625, 43.452919],
|
|
32
|
-
[17.797852, 55.973798],
|
|
33
|
-
],
|
|
42
|
+
zoom: 14
|
|
34
43
|
},
|
|
35
44
|
};
|
|
36
45
|
ExampleConfig.parameters = {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useContext, useState } from "react";
|
|
1
|
+
import React, { useContext, useEffect, useState } from "react";
|
|
2
2
|
import { mount, configure } from "enzyme";
|
|
3
3
|
import { waitFor } from "@testing-library/react";
|
|
4
4
|
import { MapContext, MapComponentsProvider } from "@mapcomponents/react-core";
|