@mapcomponents/react-maplibre 0.1.63 → 0.1.64
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/.editorconfig +1 -1
- package/.eslintrc.js +9 -6
- package/.github/workflows/check-catalogue-metadata-schema.yml +19 -0
- package/CHANGELOG.md +27 -2
- package/coverage/clover.xml +671 -1032
- package/coverage/coverage-final.json +24 -21
- package/coverage/lcov-report/index.html +112 -82
- package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +24 -24
- package/coverage/lcov-report/src/components/MapLibreMap/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCenterPosition/MlCenterPosition.tsx.html +5 -5
- package/coverage/lcov-report/src/components/MlCenterPosition/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +2 -2
- package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.cy.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfForm/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +2 -5
- package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlFollowGps/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx.html +40 -19
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.js.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.js.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.tsx.html +112 -0
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.tsx.html +115 -0
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/index.html +34 -4
- package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGpxViewer/MlGpxViewer.tsx.html +394 -0
- package/coverage/lcov-report/src/components/{MlGPXViewer → MlGpxViewer}/index.html +23 -38
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +63 -285
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +21 -21
- package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.tsx.html +58 -76
- package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.html +58 -61
- package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +11 -11
- package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +30 -21
- 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.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
- package/coverage/lcov-report/src/components/MlMeasureTool/MlMeasureTool.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlMeasureTool/index.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationTools/index.html +1 -1
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.stories_.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/MlSketchTool/LayerList/ColorPicker.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerList.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerListItem.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/index.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/MlSketchTool.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/index.html +1 -1
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.tsx.html +514 -0
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +21 -21
- package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +20 -206
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +1 -1
- 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.tsx.html +10 -7
- package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +5 -5
- 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.tsx.html +111 -57
- package/coverage/lcov-report/src/components/MlWmsLayer/index.html +19 -19
- package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +201 -144
- package/coverage/lcov-report/src/components/MlWmsLoader/index.html +9 -9
- package/coverage/lcov-report/src/contexts/MapContext.tsx.html +23 -23
- package/coverage/lcov-report/src/contexts/SimpleDataContext.js.html +1 -1
- package/coverage/lcov-report/src/contexts/SimpleDataProvider.js.html +1 -1
- package/coverage/lcov-report/src/contexts/index.html +1 -1
- package/coverage/lcov-report/src/hooks/index.html +50 -50
- package/coverage/lcov-report/src/hooks/useCameraFollowPath/index.html +1 -1
- package/coverage/lcov-report/src/hooks/useCameraFollowPath/useCameraFollowPath.tsx.html +1 -1
- package/coverage/lcov-report/src/hooks/useExportMap/index.html +1 -1
- package/coverage/lcov-report/src/hooks/useExportMap/index.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useExportMap/lib.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useGpx/index.html +116 -0
- package/coverage/lcov-report/src/hooks/useGpx/useGpx.tsx.html +295 -0
- package/coverage/lcov-report/src/hooks/useLayer.ts.html +132 -66
- package/coverage/lcov-report/src/hooks/useLayerEvent.js.html +1 -1
- package/coverage/lcov-report/src/hooks/useLayerHoverPopup/index.html +116 -0
- package/coverage/lcov-report/src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx.html +331 -0
- package/coverage/lcov-report/src/hooks/useMap.ts.html +47 -47
- package/coverage/lcov-report/src/hooks/useMapState.ts.html +54 -54
- package/coverage/lcov-report/src/hooks/useSource.ts.html +57 -57
- package/coverage/lcov-report/src/hooks/{useWms.js.html → useWms.ts.html} +54 -15
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/index.ts.html +6 -6
- package/coverage/lcov.info +1284 -1959
- package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +51 -25
- package/dist/components/MlCenterPosition/MlCenterPosition.d.ts +3 -2
- package/dist/components/MlCenterPosition/MlCenterPosition.stories.d.ts +35 -16
- package/dist/components/MlComponentTemplate/MlComponentTemplate.d.ts +1 -1
- package/dist/components/MlComponentTemplate/MlComponentTemplate.stories.d.ts +12 -9
- package/dist/components/MlCreatePdfButton/MlCreatePdfButton.d.ts +1 -1
- package/dist/components/MlCreatePdfButton/MlCreatePdfButton.stories.d.ts +12 -9
- package/dist/components/MlGPXViewer/util/GeoJsonContext.d.ts +1 -1
- package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +22 -11
- package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.d.ts +4 -95
- package/dist/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.d.ts +3 -0
- package/dist/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.d.ts +3 -0
- package/dist/components/MlGpxViewer/MlGpxViewer.d.ts +30 -0
- package/dist/components/MlGpxViewer/MlGpxViewer.stories.d.ts +17 -0
- package/dist/components/MlGpxViewer/MlGpxViewer.test.d.ts +1 -0
- package/dist/components/MlGpxViewer/util/GeoJsonContext.d.ts +10 -0
- package/dist/components/MlGpxViewer/util/GeoJsonProvider.d.ts +4 -0
- package/dist/components/MlGpxViewer/util/MetadataDrawer.d.ts +7 -0
- package/dist/components/MlGpxViewer/util/MlGpxDemoLoader.d.ts +10 -0
- package/dist/components/MlGpxViewer/util/MlGpxViewerInstructions.d.ts +3 -0
- package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.d.ts +11 -2
- package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.d.ts +7 -9
- package/dist/components/MlLayerMagnify/MlLayerMagnify.d.ts +8 -2
- package/dist/components/MlLayerMagnify/MlLayerMagnify.stories.d.ts +13 -9
- package/dist/components/MlLayerSwipe/MlLayerSwipe.d.ts +13 -3
- package/dist/components/MlLayerSwipe/MlLayerSwipe.stories.d.ts +12 -10
- package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.d.ts +33 -14
- package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.d.ts +18 -15
- package/dist/components/MlSpatialElevationProfile/util/getElevationData.d.ts +14 -0
- package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.d.ts +3 -67
- package/dist/components/MlWmsLayer/MlWmsLayer.d.ts +7 -4
- package/dist/components/MlWmsLoader/MlWmsLoader.d.ts +17 -10
- package/dist/components/MlWmsLoader/MlWmsLoader.stories.d.ts +23 -12
- package/dist/components/MlWmsLoader/utils/MlWmsLoaderInstructions.d.ts +3 -0
- package/dist/components/MlWmsLoader/utils/WMSLinks.d.ts +6 -0
- package/dist/decorators/ThemeWrapper.d.ts +3 -1
- package/dist/hooks/useGpx/lib/gpxConverter.d.ts +11 -0
- package/dist/hooks/useGpx/useGpx.d.ts +26 -0
- package/dist/hooks/useGpx/useGpx.stories.d.ts +10 -0
- package/dist/hooks/useLayer.d.ts +13 -7
- package/dist/hooks/useLayerHoverPopup/useLayerHoverPopup.d.ts +23 -0
- package/dist/hooks/useLayerHoverPopup/useLayerHoverPopup.stories.d.ts +10 -0
- package/dist/hooks/useMap.d.ts +1 -1
- package/dist/hooks/useMap.test.d.ts +1 -0
- package/dist/hooks/useSource.d.ts +2 -2
- package/dist/hooks/useWms.d.ts +24 -16
- package/dist/index.d.ts +5 -5
- package/dist/index.esm.js +9310 -14006
- package/dist/index.esm.js.map +1 -1
- package/dist/setupTests.d.ts +6 -5
- package/dist/ui_components/Dropzone.d.ts +5 -0
- package/dist/ui_components/ImageLoader.d.ts +8 -1
- package/dist/ui_components/LoadingOverlayContext.d.ts +11 -11
- package/dist/ui_components/Sidebar.d.ts +7 -6
- package/dist/ui_components/Tooltip.d.ts +1 -1
- package/dist/ui_components/TopToolbar.d.ts +4 -3
- package/dist/ui_components/UploadButton.d.ts +6 -0
- package/dist/util/BubbleForInstructions.d.ts +2 -0
- package/dist/util/Instructions.d.ts +13 -0
- package/package.json +195 -191
- package/{src/components/MlImageMarkerLayer → public}/assets/wg-marker.png +0 -0
- package/scripts/build-catalogue-meta.js +35 -11
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +230 -188
- package/src/components/MlCenterPosition/MlCenterPosition.meta_.json +1 -2
- package/src/components/MlCenterPosition/MlCenterPosition.stories.tsx +20 -0
- package/src/components/MlCenterPosition/MlCenterPosition.tsx +4 -4
- package/src/components/MlComponentTemplate/MlComponentTemplate.meta_.json +1 -2
- package/src/components/MlComponentTemplate/{MlComponentTemplate.stories.js → MlComponentTemplate.stories.tsx} +2 -2
- package/src/components/MlComponentTemplate/MlComponentTemplate.tsx +1 -1
- package/src/components/MlCreatePdfButton/MlCreatePdfButton.meta_.json +1 -2
- package/src/components/MlCreatePdfButton/{MlCreatePdfButton.stories.js → MlCreatePdfButton.stories.tsx} +1 -1
- package/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx +1 -1
- package/src/components/MlCreatePdfForm/MlCreatePdfForm.meta.json +1 -2
- package/src/components/MlCreatePdfForm/lib/PdfForm.tsx +25 -2
- package/src/components/MlFeatureEditor/MlFeatureEditor.meta.json +1 -2
- package/src/components/MlFeatureEditor/MlFeatureEditor.tsx +0 -1
- package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.meta.json +1 -2
- package/src/components/MlFollowGps/MlFollowGps.meta.json +1 -2
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.meta.json +1 -2
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.tsx +89 -0
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx +24 -17
- package/src/components/MlGeoJsonLayer/assets/earthquake.json +109937 -0
- package/src/components/MlGeoJsonLayer/assets/wg_locations.json +65 -0
- package/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.tsx +9 -0
- package/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.tsx +10 -0
- package/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.meta_.json +1 -2
- package/src/components/{MlGPXViewer/MlGPXViewer.doc.de.md → MlGpxViewer/MlGpxViewer.doc.de.md} +0 -0
- package/src/components/{MlGPXViewer/MlGPXViewer.doc.en.md → MlGpxViewer/MlGpxViewer.doc.en.md} +0 -0
- package/src/components/{MlGPXViewer/MlGPXViewer.meta.json → MlGpxViewer/MlGpxViewer.meta.json} +2 -3
- package/src/components/MlGpxViewer/MlGpxViewer.stories.tsx +109 -0
- package/src/components/MlGpxViewer/MlGpxViewer.test.js +53 -0
- package/src/components/MlGpxViewer/MlGpxViewer.tsx +103 -0
- package/src/components/{MlGPXViewer → MlGpxViewer}/util/GeoJsonContext.ts +0 -0
- package/src/components/{MlGPXViewer → MlGpxViewer}/util/GeoJsonProvider.tsx +0 -0
- package/src/components/MlGpxViewer/util/MetadataDrawer.tsx +38 -0
- package/src/components/MlGpxViewer/util/MlGpxDemoLoader.tsx +128 -0
- package/src/components/MlGpxViewer/util/MlGpxViewerInstructions.tsx +68 -0
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.meta_.json +1 -2
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.tsx +41 -0
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.test.js +27 -8
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx +41 -115
- package/src/components/MlLayer/MlLayer.meta_.json +1 -2
- package/src/components/MlLayerMagnify/MlLayerMagnify.meta.json +1 -2
- package/src/components/MlLayerMagnify/MlLayerMagnify.stories.tsx +44 -0
- package/src/components/MlLayerMagnify/{MlLayerMagnify.test.js → MlLayerMagnify.test.tsx} +15 -18
- package/src/components/MlLayerMagnify/MlLayerMagnify.tsx +55 -61
- package/src/components/MlLayerSwipe/MlLayerSwipe.meta.json +1 -2
- package/src/components/MlLayerSwipe/{MlLayerSwipe.stories.js → MlLayerSwipe.stories.tsx} +9 -11
- package/src/components/MlLayerSwipe/MlLayerSwipe.tsx +47 -48
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.meta_.json +1 -2
- package/src/components/MlLayerSwitcher/components/LayerBox.js +22 -19
- package/src/components/MlMarker/MlMarker.meta_.json +1 -2
- package/src/components/MlMeasureTool/MlMeasureTool.meta.json +1 -2
- package/src/components/MlNavigationCompass/MlNavigationCompass.meta.json +1 -2
- package/src/components/MlNavigationTools/MlNavigationTools.meta.json +1 -2
- package/src/components/MlScaleReference/MlScaleReference.meta.json +1 -2
- package/src/components/MlShareMapState/MlShareMapState.meta_.json +1 -2
- package/src/components/MlSketchTool/MlSketchTool.meta.json +1 -2
- package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.meta.json +1 -2
- package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.tsx +121 -0
- package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.test.js +30 -1
- package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.tsx +143 -0
- package/src/components/MlSpatialElevationProfile/util/getElevationData.tsx +103 -0
- package/src/components/MlThreeJsLayer/MlThreeJsLayer.meta.json +1 -2
- package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.meta.json +1 -2
- package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.stories.js +2 -3
- package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx +17 -79
- package/src/components/MlUseMapDebugger/MlUseMapDebugger.meta_.json +1 -2
- package/src/components/MlVectorTileLayer/MlVectorTileLayer.meta.json +1 -2
- package/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx +3 -2
- package/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.meta_.json +1 -2
- package/src/components/MlWmsLayer/MlWmsLayer.tsx +59 -41
- package/src/components/MlWmsLoader/MlWmsLoader.meta.json +1 -2
- package/src/components/MlWmsLoader/MlWmsLoader.stories.tsx +89 -0
- package/src/components/MlWmsLoader/MlWmsLoader.tsx +141 -122
- package/src/components/MlWmsLoader/utils/MlWmsLoaderInstructions.tsx +50 -0
- package/src/components/MlWmsLoader/utils/WMSLinks.tsx +128 -0
- package/src/decorators/MapContextDecorator.js +1 -1
- package/src/decorators/MapContextDecoratorHooks.js +1 -1
- package/src/decorators/ThemeWrapper.tsx +9 -0
- package/src/hooks/useCameraFollowPath/useCameraFollowPath.meta.json +1 -2
- package/src/{components/MlGPXViewer → hooks/useGpx/lib}/gpxConverter.js +1 -0
- package/src/hooks/useGpx/useGpx.doc.de.md +3 -0
- package/src/hooks/useGpx/useGpx.meta_.json +15 -0
- package/src/{components/MlCenterPosition/MlCenterPosition.stories.js → hooks/useGpx/useGpx.stories.js} +4 -5
- package/src/hooks/useGpx/useGpx.tsx +70 -0
- package/src/hooks/useLayer.ts +32 -10
- package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.doc.de.md +3 -0
- package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.meta_.json +15 -0
- package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.stories.js +20 -0
- package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx +82 -0
- package/src/hooks/useMap.test.tsx +48 -0
- package/src/hooks/useMap.ts +8 -8
- package/src/hooks/useSource.ts +4 -4
- package/src/hooks/{useWms.js → useWms.ts} +24 -11
- package/src/index.ts +5 -5
- package/src/setupTests.js +18 -15
- package/src/ui_components/Dropzone.tsx +104 -0
- package/src/ui_components/{ImageLoader.js → ImageLoader.tsx} +30 -25
- package/src/ui_components/{LoadingOverlayContext.js → LoadingOverlayContext.tsx} +12 -15
- package/src/ui_components/Sidebar.tsx +12 -10
- package/src/ui_components/Tooltip.tsx +17 -0
- package/src/ui_components/TopToolbar.tsx +5 -3
- package/src/ui_components/UploadButton.tsx +57 -0
- package/src/util/BubbleForInstructions.js +46 -0
- package/src/util/Instructions.tsx +60 -0
- package/tsconfig.json +1 -1
- package/coverage/lcov-report/src/components/MlGPXViewer/MlGPXViewer.tsx.html +0 -1222
- package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +0 -1645
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +0 -757
- package/dist/components/MlGPXViewer/util/MlGPXViewerInstructions.d.ts +0 -1
- package/dist/components/MlGPXViewer/util/SampleLayer.d.ts +0 -0
- package/dist/components/MlGPXViewer/util/demoViewer.d.ts +0 -5
- package/src/components/MlGPXViewer/MlGPXViewer.stories.js +0 -91
- package/src/components/MlGPXViewer/MlGPXViewer.test.js +0 -28
- package/src/components/MlGPXViewer/MlGPXViewer.tsx +0 -379
- package/src/components/MlGPXViewer/util/MlGPXViewerInstructions.js +0 -145
- package/src/components/MlGPXViewer/util/SampleLayer.js +0 -2
- package/src/components/MlGPXViewer/util/demoViewer.js +0 -254
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.js +0 -45
- package/src/components/MlLayerMagnify/MlLayerMagnify.stories.js +0 -41
- package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js +0 -224
- package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.js +0 -57
- package/src/components/MlWmsLoader/MlWmsLoader.stories.js +0 -47
- package/src/decorators/ThemeWrapper.jsx +0 -9
- package/src/ui_components/Legend.js +0 -44
- package/src/ui_components/LoadingOverlay.js +0 -41
- package/src/ui_components/Tooltip.js +0 -21
package/dist/setupTests.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export var uuid_regex: string;
|
|
2
2
|
export namespace mockMapLibreMethods {
|
|
3
|
-
const on: any
|
|
4
|
-
const off: any
|
|
5
|
-
const addControl: any
|
|
6
|
-
const removeControl: any
|
|
7
|
-
const
|
|
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, []>;
|
|
8
9
|
function getCanvas(): HTMLCanvasElement;
|
|
9
10
|
function getContainer(): {
|
|
10
11
|
style: {};
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
import { SxProps } from '@mui/material';
|
|
2
|
+
interface ImageLoaderProps {
|
|
3
|
+
src: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
sx?: SxProps;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const ImageLoader: (props: ImageLoaderProps) => JSX.Element;
|
|
1
9
|
export default ImageLoader;
|
|
2
|
-
declare function ImageLoader(props: any): JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { JsxChildren } from 'typedoc/dist/lib/utils/jsx.elements';
|
|
4
|
+
declare const LoadingOverlayContext: React.Context<{}>;
|
|
5
|
+
declare const LoadingOverlayProvider: {
|
|
6
|
+
(children: JsxChildren): JSX.Element;
|
|
7
|
+
propTypes: {
|
|
8
|
+
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export { LoadingOverlayContext, LoadingOverlayProvider };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PaperProps, SxProps, DrawerProps } from '@mui/material';
|
|
3
3
|
interface SidebarProps {
|
|
4
|
-
drawerPaperProps
|
|
5
|
-
drawerHeaderProps
|
|
6
|
-
|
|
4
|
+
drawerPaperProps?: PaperProps;
|
|
5
|
+
drawerHeaderProps?: Headers;
|
|
6
|
+
drawerButtonStyle?: SxProps | undefined;
|
|
7
|
+
children?: React.ReactNode;
|
|
7
8
|
}
|
|
8
|
-
export default function Sidebar({ drawerPaperProps, drawerHeaderProps, ...props }: SidebarProps): JSX.Element;
|
|
9
|
+
export default function Sidebar({ drawerPaperProps, drawerHeaderProps, drawerButtonStyle, ...props }: SidebarProps & DrawerProps): JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function Legend(
|
|
1
|
+
export default function Legend(): JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { AppBarProps, ToolbarProps } from '@mui/material';
|
|
1
|
+
import { AppBarProps, ToolbarProps, SxProps } from '@mui/material';
|
|
2
2
|
interface TopToolbarProps extends AppBarProps {
|
|
3
|
-
toolbarProps
|
|
3
|
+
toolbarProps?: ToolbarProps;
|
|
4
|
+
appBarStyle?: SxProps;
|
|
4
5
|
}
|
|
5
|
-
export default function TopToolbar({ toolbarProps, ...props }: TopToolbarProps): JSX.Element;
|
|
6
|
+
export default function TopToolbar({ toolbarProps, appBarStyle, ...props }: TopToolbarProps): JSX.Element;
|
|
6
7
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SxProps } from '@mui/material';
|
|
2
|
+
interface StepObject {
|
|
3
|
+
duration: number;
|
|
4
|
+
props: SxProps;
|
|
5
|
+
content: JSX.Element;
|
|
6
|
+
}
|
|
7
|
+
interface InstructionProps {
|
|
8
|
+
steps: Array<StepObject>;
|
|
9
|
+
open: boolean;
|
|
10
|
+
callback?: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare const Instructions: (props: InstructionProps) => JSX.Element;
|
|
13
|
+
export default Instructions;
|
package/package.json
CHANGED
|
@@ -1,193 +1,197 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
2
|
+
"name": "@mapcomponents/react-maplibre",
|
|
3
|
+
"version": "0.1.64",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"source": "src/index.ts",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "rollup -c",
|
|
11
|
+
"start": "start-storybook -p 6006 -s public",
|
|
12
|
+
"cypress-test": "npx cypress run --component",
|
|
13
|
+
"test": "node scripts/test.js --env=jest-environment-jsdom-sixteen --watchAll=false --coverage",
|
|
14
|
+
"test:noninteractive": "node scripts/test.js --env=jest-environment-jsdom-sixteen --verbose --watchAll=false --coverage",
|
|
15
|
+
"test:generate-output": "node scripts/test.js --env=jest-environment-jsdom-sixteen --watchAll=false --json --outputFile=./src/.jest-test-results.json || true",
|
|
16
|
+
"build-storybook": "build-storybook -o docs-build -s public",
|
|
17
|
+
"storybook-docs": "start-storybook --docs --no-manager-cache",
|
|
18
|
+
"build-catalogue-meta": "node scripts/build-catalogue-meta.js",
|
|
19
|
+
"build-catalogue-markdown-docs": "node scripts/build-catalogue-markdown-docs.js",
|
|
20
|
+
"create-component": "./scripts/create-map-component.sh"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@emotion/css": "11.10.5",
|
|
24
|
+
"@emotion/react": "11.10.5",
|
|
25
|
+
"@emotion/styled": "11.10.5",
|
|
26
|
+
"@mapbox/mapbox-gl-draw": "^1.3.0",
|
|
27
|
+
"@mapbox/mapbox-gl-sync-move": "0.3.0",
|
|
28
|
+
"@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",
|
|
62
|
+
"@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",
|
|
67
|
+
"@types/expect": "^24.3.0",
|
|
68
|
+
"@types/jest": "^29.2.5",
|
|
69
|
+
"@types/mapbox__mapbox-gl-draw": "^1.2.3",
|
|
70
|
+
"@types/mapbox__point-geometry": "^0.1.2",
|
|
71
|
+
"@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",
|
|
78
|
+
"avj": "^0.0.0",
|
|
79
|
+
"babel-jest": "^26.6.0",
|
|
80
|
+
"babel-plugin-inline-react-svg": "^2.0.1",
|
|
81
|
+
"babel-plugin-styled-components": "^2.0.6",
|
|
82
|
+
"babel-preset-react-app": "^10.0.1",
|
|
83
|
+
"cypress": "^10.9.0",
|
|
84
|
+
"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",
|
|
89
|
+
"jest": "26.6.0",
|
|
90
|
+
"jest-circus": "26.6.0",
|
|
91
|
+
"jest-environment-jsdom-sixteen": "^2.0.0",
|
|
92
|
+
"jest-enzyme": "^7.1.2",
|
|
93
|
+
"jest-resolve": "26.6.0",
|
|
94
|
+
"jest-watch-typeahead": "0.6.1",
|
|
95
|
+
"node-fetch": "^3.3.0",
|
|
96
|
+
"postcss": "^8.4.12",
|
|
97
|
+
"prettier": "2.7.1",
|
|
98
|
+
"react": "^17.0.2",
|
|
99
|
+
"react-app-polyfill": "^3.0.0",
|
|
100
|
+
"react-dev-utils": "^12.0.0",
|
|
101
|
+
"react-dom": "^17.0.2",
|
|
102
|
+
"rollup": "^2.70.1",
|
|
103
|
+
"rollup-plugin-delete": "^2.0.0",
|
|
104
|
+
"rollup-plugin-import-css": "^3.0.3",
|
|
105
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
106
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
107
|
+
"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"
|
|
114
|
+
},
|
|
115
|
+
"jest": {
|
|
116
|
+
"roots": [
|
|
117
|
+
"<rootDir>/src"
|
|
118
|
+
],
|
|
119
|
+
"collectCoverageFrom": [
|
|
120
|
+
"src/**/*.{js,jsx,ts,tsx}",
|
|
121
|
+
"!src/**/*.d.ts"
|
|
122
|
+
],
|
|
123
|
+
"setupFiles": [
|
|
124
|
+
"react-app-polyfill/jsdom"
|
|
125
|
+
],
|
|
126
|
+
"setupFilesAfterEnv": [
|
|
127
|
+
"<rootDir>/src/setupTests.js"
|
|
128
|
+
],
|
|
129
|
+
"testMatch": [
|
|
130
|
+
"<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
|
|
131
|
+
"<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}"
|
|
132
|
+
],
|
|
133
|
+
"testEnvironment": "jsdom",
|
|
134
|
+
"testRunner": "./node_modules/jest-circus/runner.js",
|
|
135
|
+
"transform": {
|
|
136
|
+
"^.+\\.(js|jsx|mjs|cjs|ts|tsx)$": "<rootDir>/config/jest/babelTransform.js",
|
|
137
|
+
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
|
|
138
|
+
"^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
|
|
139
|
+
},
|
|
140
|
+
"transformIgnorePatterns": [
|
|
141
|
+
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$",
|
|
142
|
+
"^.+\\.module\\.(css|sass|scss)$"
|
|
143
|
+
],
|
|
144
|
+
"modulePaths": [],
|
|
145
|
+
"moduleNameMapper": {
|
|
146
|
+
"^react-native$": "react-native-web",
|
|
147
|
+
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy",
|
|
148
|
+
"^!maplibre-gl$": "<rootDir>/node_modules/maplibre-gl",
|
|
149
|
+
"d3": "<rootDir>/node_modules/d3/dist/d3.min.js"
|
|
150
|
+
},
|
|
151
|
+
"moduleFileExtensions": [
|
|
152
|
+
"web.js",
|
|
153
|
+
"js",
|
|
154
|
+
"web.ts",
|
|
155
|
+
"ts",
|
|
156
|
+
"web.tsx",
|
|
157
|
+
"tsx",
|
|
158
|
+
"json",
|
|
159
|
+
"web.jsx",
|
|
160
|
+
"jsx",
|
|
161
|
+
"node"
|
|
162
|
+
],
|
|
163
|
+
"watchPlugins": [
|
|
164
|
+
"jest-watch-typeahead/filename",
|
|
165
|
+
"jest-watch-typeahead/testname"
|
|
166
|
+
],
|
|
167
|
+
"resetMocks": true,
|
|
168
|
+
"coveragePathIgnorePatterns": [
|
|
169
|
+
"/node_modules/",
|
|
170
|
+
"/src/decorators/",
|
|
171
|
+
"/src/lab/",
|
|
172
|
+
"/src/stories/",
|
|
173
|
+
"/src/ui_components/",
|
|
174
|
+
"/src/deckgl_components/",
|
|
175
|
+
"/src/components/MlBasicComponent",
|
|
176
|
+
"/src/components/MlMapDrawTools",
|
|
177
|
+
"/src/components/MlComponentTemplate/",
|
|
178
|
+
"/src/components/MlAerialPhotograph/",
|
|
179
|
+
"/src/components/MapLibreMapDebug/",
|
|
180
|
+
"/src/components/MlDemoDashboard/",
|
|
181
|
+
"/src/components/MlLaufwettbewerbApp/",
|
|
182
|
+
"/src/components/MlLaermkarte/",
|
|
183
|
+
"/src/components/MlMobilerImker/",
|
|
184
|
+
"/src/components/MlWanderApp/",
|
|
185
|
+
"(.test)\\.(ts|tsx|js)$",
|
|
186
|
+
"index\\.js$",
|
|
187
|
+
".*/lib/.*",
|
|
188
|
+
".*/utils/.*",
|
|
189
|
+
".*/util/.*",
|
|
190
|
+
".*/assets/.*",
|
|
191
|
+
".*/custom.d.tsx",
|
|
192
|
+
"custom\\-.*\\-mode\\.js$",
|
|
193
|
+
"(.stories)\\.(ts|tsx|js)$",
|
|
194
|
+
"/distribution/.*\\.(ts|js)$"
|
|
195
|
+
]
|
|
196
|
+
}
|
|
193
197
|
}
|
|
File without changes
|
|
@@ -1,18 +1,42 @@
|
|
|
1
|
-
const glob = require(
|
|
2
|
-
const
|
|
1
|
+
const glob = require('glob');
|
|
2
|
+
const fetch = (...args) => import('node-fetch').then(({ default: fetch }) => fetch(...args));
|
|
3
|
+
const Ajv = require('ajv');
|
|
4
|
+
const ajv = new Ajv();
|
|
5
|
+
const fs = require('fs');
|
|
3
6
|
|
|
4
7
|
let options = {};
|
|
5
8
|
let mc_meta = {};
|
|
6
9
|
|
|
7
|
-
glob(
|
|
8
|
-
|
|
10
|
+
glob('src/**/**/*.meta.json', options, function (er, files) {
|
|
11
|
+
console.log(files);
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
for (var i = 0, len = files.length; i < len; i++) {
|
|
14
|
+
let rawdata = fs.readFileSync(files[i]);
|
|
15
|
+
let metaObj = JSON.parse(rawdata);
|
|
16
|
+
mc_meta[metaObj.name] = metaObj;
|
|
17
|
+
}
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
fetch('https://catalogue.mapcomponents.org/schema/metadata.schema.json', {
|
|
20
|
+
method: 'GET',
|
|
21
|
+
headers: {
|
|
22
|
+
Accept: 'application/json',
|
|
23
|
+
'Content-Type': 'application/json',
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
.then((res) => {
|
|
27
|
+
if (!res.ok) {
|
|
28
|
+
return false;
|
|
29
|
+
} else {
|
|
30
|
+
return res.json();
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
.then((schema) => {
|
|
34
|
+
const validate = ajv.compile(schema);
|
|
35
|
+
const valid = validate(mc_meta);
|
|
36
|
+
if (!valid) throw new Error(JSON.stringify(validate.errors));
|
|
37
|
+
//if (!valid) console.log(validate.errors);
|
|
38
|
+
|
|
39
|
+
let data = JSON.stringify(mc_meta);
|
|
40
|
+
fs.writeFileSync('public/catalogue/mc_meta.json', data);
|
|
41
|
+
});
|
|
18
42
|
});
|