@mapcomponents/react-maplibre 1.3.3 → 1.5.0-2

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 (172) hide show
  1. package/CHANGELOG.md +163 -38
  2. package/CODE_OF_CONDUCT.md +70 -70
  3. package/CONTRIBUTING.md +157 -149
  4. package/README.md +1 -1
  5. package/docs_md/anatomy_of_a_mapcomponent.md +34 -37
  6. package/eslint.config.cjs +3 -0
  7. package/package.json +193 -224
  8. package/project.json +21 -0
  9. package/tsconfig.lib.json +29 -0
  10. package/vite.config.ts +61 -0
  11. package/.eslintrc.cjs +0 -33
  12. package/dist/assets/index.cjs-Iqz0mZaU.css +0 -98
  13. package/dist/assets/index.esm-Iqz0mZaU.css +0 -98
  14. package/dist/index.cjs.js +0 -22120
  15. package/dist/index.cjs.js.map +0 -1
  16. package/dist/index.esm.js +0 -22000
  17. package/dist/index.esm.js.map +0 -1
  18. package/dist/src/components/MapLibreMap/MapLibreMap.d.ts +0 -34
  19. package/dist/src/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +0 -120
  20. package/dist/src/components/MlCenterPosition/MlCenterPosition.d.ts +0 -36
  21. package/dist/src/components/MlClientSearch/MlClientSearch.d.ts +0 -30
  22. package/dist/src/components/MlClientSearch/lib/SearchContext.d.ts +0 -13
  23. package/dist/src/components/MlClientSearch/lib/SearchForm.d.ts +0 -2
  24. package/dist/src/components/MlClientSearch/lib/createGeojsonFeature.d.ts +0 -4
  25. package/dist/src/components/MlComponentTemplate/MlComponentTemplate.d.ts +0 -18
  26. package/dist/src/components/MlComponentTemplate/MlComponentTemplate.stories_.d.ts +0 -14
  27. package/dist/src/components/MlCreatePdfButton/MlCreatePdfButton.d.ts +0 -22
  28. package/dist/src/components/MlCreatePdfForm/MlCreatePdfForm.d.ts +0 -13
  29. package/dist/src/components/MlCreatePdfForm/lib/PdfContext.d.ts +0 -8
  30. package/dist/src/components/MlCreatePdfForm/lib/PdfForm.d.ts +0 -25
  31. package/dist/src/components/MlCreatePdfForm/lib/PdfPreview.d.ts +0 -26
  32. package/dist/src/components/MlCreatePdfForm/lib/pdf.templates.d.ts +0 -11
  33. package/dist/src/components/MlCreatePngButton/MlCreatePngButton.d.ts +0 -22
  34. package/dist/src/components/MlFeatureEditor/MlFeatureEditor.d.ts +0 -5
  35. package/dist/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.d.ts +0 -62
  36. package/dist/src/components/MlFollowGps/MlFollowGps.d.ts +0 -81
  37. package/dist/src/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +0 -98
  38. package/dist/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.d.ts +0 -9
  39. package/dist/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.d.ts +0 -9
  40. package/dist/src/components/MlGeoJsonLayer/util/getDefaultLayerTypeByGeometry.d.ts +0 -4
  41. package/dist/src/components/MlGeoJsonLayer/util/getDefaultPaintPropsByType.d.ts +0 -5
  42. package/dist/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.d.ts +0 -23
  43. package/dist/src/components/MlGlobeButton/MlGlobeButton.d.ts +0 -28
  44. package/dist/src/components/MlGpxViewer/MlGpxViewer.d.ts +0 -31
  45. package/dist/src/components/MlGpxViewer/util/GeoJsonContext.d.ts +0 -10
  46. package/dist/src/components/MlGpxViewer/util/GeoJsonProvider.d.ts +0 -5
  47. package/dist/src/components/MlGpxViewer/util/Metadata.d.ts +0 -7
  48. package/dist/src/components/MlGpxViewer/util/MlGpxDemoLoader.d.ts +0 -11
  49. package/dist/src/components/MlGpxViewer/util/MlGpxViewerInstructions.d.ts +0 -4
  50. package/dist/src/components/MlImageMarkerLayer/MlImageMarkerLayer.d.ts +0 -39
  51. package/dist/src/components/MlLayer/MlLayer.d.ts +0 -33
  52. package/dist/src/components/MlLayerMagnify/MlLayerMagnify.d.ts +0 -33
  53. package/dist/src/components/MlLayerSwipe/MlLayerSwipe.d.ts +0 -26
  54. package/dist/src/components/MlLayerSwipe/assets/SwipeIcon.d.ts +0 -10
  55. package/dist/src/components/MlLayerSwitcher/MlLayerSwitcher.d.ts +0 -29
  56. package/dist/src/components/MlLayerSwitcher/components/LayerBox.d.ts +0 -10
  57. package/dist/src/components/MlMarker/MlMarker.d.ts +0 -29
  58. package/dist/src/components/MlMeasureTool/MlMeasureTool.d.ts +0 -37
  59. package/dist/src/components/MlMultiMeasureTool/MlMultiMeasureTool.d.ts +0 -55
  60. package/dist/src/components/MlNavigationCompass/MlNavigationCompass.d.ts +0 -33
  61. package/dist/src/components/MlNavigationCompass/assets/CompassBackground.d.ts +0 -9
  62. package/dist/src/components/MlNavigationCompass/assets/CompassNeedle.d.ts +0 -9
  63. package/dist/src/components/MlNavigationTools/MlNavigationTools.d.ts +0 -60
  64. package/dist/src/components/MlOgcApiFeatures/MlOgcApiFeatures.d.ts +0 -45
  65. package/dist/src/components/MlOrderLayers/MlOrderLayers.d.ts +0 -21
  66. package/dist/src/components/MlScaleReference/MlScaleReference.d.ts +0 -9
  67. package/dist/src/components/MlShareMapState/MlShareMapState.d.ts +0 -35
  68. package/dist/src/components/MlSketchTool/MlSketchTool.d.ts +0 -50
  69. package/dist/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.d.ts +0 -40
  70. package/dist/src/components/MlSpatialElevationProfile/util/getElevationData.d.ts +0 -13
  71. package/dist/src/components/MlTemporalController/MlTemporalController.d.ts +0 -181
  72. package/dist/src/components/MlTemporalController/utils/MlTemporalControllerLabels.d.ts +0 -20
  73. package/dist/src/components/MlTemporalController/utils/TemporalControllerPlayer.d.ts +0 -22
  74. package/dist/src/components/MlTemporalController/utils/paintPicker.d.ts +0 -59
  75. package/dist/src/components/MlTemporalController/utils/useFilterData.d.ts +0 -14
  76. package/dist/src/components/MlTerrainLayer/MlTerrainLayer.d.ts +0 -28
  77. package/dist/src/components/MlThreeJsLayer/MlThreeJsLayer.d.ts +0 -13
  78. package/dist/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.d.ts +0 -12
  79. package/dist/src/components/MlUseMapDebugger/MlUseMapDebugger.d.ts +0 -21
  80. package/dist/src/components/MlVectorTileLayer/MlVectorTileLayer.d.ts +0 -22
  81. package/dist/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.d.ts +0 -22
  82. package/dist/src/components/MlWmsLayer/MlWmsLayer.d.ts +0 -58
  83. package/dist/src/components/MlWmsLoader/MlWmsLoader.d.ts +0 -125
  84. package/dist/src/components/MlWmsLoader/utils/MlWmsLoaderInstructions.d.ts +0 -4
  85. package/dist/src/components/MlWmsLoader/utils/WMSLinks.d.ts +0 -8
  86. package/dist/src/contexts/LayerContext.d.ts +0 -59
  87. package/dist/src/contexts/MapContext.d.ts +0 -26
  88. package/dist/src/contexts/SimpleDataContext.d.ts +0 -4
  89. package/dist/src/contexts/SimpleDataProvider.d.ts +0 -12
  90. package/dist/src/decorators/EmptyMapDecorator.d.ts +0 -4
  91. package/dist/src/decorators/GeoJsonMapDecorator.d.ts +0 -4
  92. package/dist/src/decorators/LowZoomDecorator.d.ts +0 -4
  93. package/dist/src/decorators/MapContextDecorator.d.ts +0 -7
  94. package/dist/src/decorators/MapContextDecoratorHooks.d.ts +0 -4
  95. package/dist/src/decorators/MapContextReduxStoreDecorator.d.ts +0 -7
  96. package/dist/src/decorators/MultiMapContextDecorator.d.ts +0 -4
  97. package/dist/src/decorators/NoNavToolsDecorator.d.ts +0 -4
  98. package/dist/src/decorators/ThemeDecorator.d.ts +0 -5
  99. package/dist/src/hooks/useAddImage/useAddImage.d.ts +0 -20
  100. package/dist/src/hooks/useAddProtocol/useAddProtocol.d.ts +0 -23
  101. package/dist/src/hooks/useCameraFollowPath/useCameraFollowPath.d.ts +0 -35
  102. package/dist/src/hooks/useExportMap/index.d.ts +0 -11
  103. package/dist/src/hooks/useExportMap/lib.d.ts +0 -52
  104. package/dist/src/hooks/useFeatureEditor/useFeatureEditor.d.ts +0 -46
  105. package/dist/src/hooks/useFeatureEditor/utils/FeatureEditorStyle.d.ts +0 -116
  106. package/dist/src/hooks/useFitLayerBounds.d.ts +0 -8
  107. package/dist/src/hooks/useGpx/useGpx.d.ts +0 -26
  108. package/dist/src/hooks/useLayer.d.ts +0 -36
  109. package/dist/src/hooks/useLayerContext.d.ts +0 -2
  110. package/dist/src/hooks/useLayerFilter/useLayerFilter.d.ts +0 -8
  111. package/dist/src/hooks/useLayerHoverPopup/LayerHoverPopup.d.ts +0 -24
  112. package/dist/src/hooks/useMap.d.ts +0 -14
  113. package/dist/src/hooks/useMapState.d.ts +0 -37
  114. package/dist/src/hooks/useSource.d.ts +0 -17
  115. package/dist/src/hooks/useWms.d.ts +0 -26
  116. package/dist/src/index.d.ts +0 -126
  117. package/dist/src/omt_styles/bright.d.ts +0 -2495
  118. package/dist/src/omt_styles/config.d.ts +0 -7
  119. package/dist/src/omt_styles/gruvbox.d.ts +0 -2420
  120. package/dist/src/omt_styles/medieval_kingdom.d.ts +0 -2420
  121. package/dist/src/omt_styles/monokai.d.ts +0 -2420
  122. package/dist/src/omt_styles/oceanic_next.d.ts +0 -2420
  123. package/dist/src/omt_styles/solarized.d.ts +0 -2420
  124. package/dist/src/protocol_handlers/csv.d.ts +0 -8
  125. package/dist/src/protocol_handlers/mbtiles.d.ts +0 -74
  126. package/dist/src/protocol_handlers/osm.d.ts +0 -10
  127. package/dist/src/protocol_handlers/topojson.d.ts +0 -9
  128. package/dist/src/protocol_handlers/utils/getProtocolData.d.ts +0 -1
  129. package/dist/src/protocol_handlers/utils/protocolPathParser.d.ts +0 -7
  130. package/dist/src/protocol_handlers/xml.d.ts +0 -10
  131. package/dist/src/stores/map.store.d.ts +0 -105
  132. package/dist/src/ui_components/AddLayerButton/AddLayerButton.d.ts +0 -17
  133. package/dist/src/ui_components/AddLayerButton/AddLayerPopup.d.ts +0 -15
  134. package/dist/src/ui_components/AddLayerButton/LayerConfigForms/GeoJsonLayerForm.d.ts +0 -8
  135. package/dist/src/ui_components/AddLayerButton/LayerConfigForms/LayerTypeForm.d.ts +0 -10
  136. package/dist/src/ui_components/AddLayerButton/LayerConfigForms/MbtilesLayerForm.d.ts +0 -13
  137. package/dist/src/ui_components/AddLayerButton/LayerConfigForms/ProtocolHandlerLayerForm.d.ts +0 -10
  138. package/dist/src/ui_components/AddLayerButton/LayerConfigForms/WmsLayerForm.d.ts +0 -10
  139. package/dist/src/ui_components/AddLayerButton/LayerConfigForms/utils/CSVOptionsFomular.d.ts +0 -6
  140. package/dist/src/ui_components/AddLayerButton/LayerConfigForms/utils/MbtilesLayerPropFormular.d.ts +0 -7
  141. package/dist/src/ui_components/AddLayerButton/LayerConfigForms/utils/OsmOptionsFomular.d.ts +0 -6
  142. package/dist/src/ui_components/ColorPicker/ColorPicker.d.ts +0 -15
  143. package/dist/src/ui_components/ColorPicker/transformers.d.ts +0 -10
  144. package/dist/src/ui_components/ConfirmDialog.d.ts +0 -16
  145. package/dist/src/ui_components/DemoDescriptions.d.ts +0 -12
  146. package/dist/src/ui_components/Dropzone.d.ts +0 -6
  147. package/dist/src/ui_components/ImageLoader.d.ts +0 -10
  148. package/dist/src/ui_components/LayerList/LayerList.d.ts +0 -7
  149. package/dist/src/ui_components/LayerList/LayerListFolder.d.ts +0 -9
  150. package/dist/src/ui_components/LayerList/LayerListItem.d.ts +0 -26
  151. package/dist/src/ui_components/LayerList/LayerListItemFactory.d.ts +0 -18
  152. package/dist/src/ui_components/LayerList/util/LayerListItemVectorLayer.d.ts +0 -19
  153. package/dist/src/ui_components/LayerList/util/LayerPropertyForm.d.ts +0 -10
  154. package/dist/src/ui_components/LayerList/util/SortableContainer.d.ts +0 -7
  155. package/dist/src/ui_components/LayerList/util/input/ColorPicker.d.ts +0 -10
  156. package/dist/src/ui_components/LayerTree/LayerOnMap.d.ts +0 -7
  157. package/dist/src/ui_components/LayerTree/LayerTree.d.ts +0 -6
  158. package/dist/src/ui_components/LayerTree/LayerTreeListItem.d.ts +0 -18
  159. package/dist/src/ui_components/LayerTree/util/LayerPropertyForm.d.ts +0 -9
  160. package/dist/src/ui_components/LayerTree/util/input/ColorPicker.d.ts +0 -7
  161. package/dist/src/ui_components/LoadingOverlayContext.d.ts +0 -4
  162. package/dist/src/ui_components/MapcomponentsTheme.d.ts +0 -36
  163. package/dist/src/ui_components/SelectStyleButton/SelectStyleButton.d.ts +0 -20
  164. package/dist/src/ui_components/SelectStyleButton/SelectStylePopup.d.ts +0 -18
  165. package/dist/src/ui_components/Sidebar.d.ts +0 -13
  166. package/dist/src/ui_components/SpeedDial/SpeedDial.d.ts +0 -14
  167. package/dist/src/ui_components/TopToolbar.d.ts +0 -9
  168. package/dist/src/ui_components/UploadButton.d.ts +0 -8
  169. package/dist/src/util/BubbleForInstructions.d.ts +0 -16
  170. package/dist/src/util/Instructions.d.ts +0 -14
  171. package/eslint.config.mjs +0 -73
  172. package/rollup.config.mjs +0 -62
package/package.json CHANGED
@@ -1,225 +1,194 @@
1
1
  {
2
- "name": "@mapcomponents/react-maplibre",
3
- "version": "1.3.3",
4
- "main": "dist/index.cjs.js",
5
- "license": "MIT",
6
- "module": "dist/index.esm.js",
7
- "source": "src/index.ts",
8
- "types": "dist/src/index.d.ts",
9
- "scripts": {
10
- "build": "rollup -c",
11
- "start": "storybook dev",
12
- "cypress-test": "npx cypress run --component",
13
- "cypress": "npx cypress open",
14
- "test": "node scripts/test.cjs --watchAll=false --coverage",
15
- "test:noninteractive": "node scripts/test.cjs --verbose --watchAll=false --coverage",
16
- "test:generate-output": "node scripts/test.cjs --watchAll=false --json --outputFile=./src/.jest-test-results.json || true",
17
- "build-storybook": "storybook build -o docs-build",
18
- "storybook-docs": "storybook dev --docs --no-manager-cache",
19
- "build-catalogue-meta": "node scripts/build-catalogue-meta.js",
20
- "create-component": "./scripts/create-map-component.sh"
21
- },
22
- "dependencies": {
23
- "@cypress/react": "^9.0.1",
24
- "@dnd-kit/core": "^6.3.1",
25
- "@dnd-kit/modifiers": "^9.0.0",
26
- "@dnd-kit/sortable": "^10.0.0",
27
- "@dnd-kit/utilities": "^3.2.2",
28
- "@emotion/css": "^11.13.5",
29
- "@emotion/react": "^11.14.0",
30
- "@emotion/styled": "^11.14.1",
31
- "@eslint/eslintrc": "^3.3.1",
32
- "@eslint/js": "^9.30.0",
33
- "@mapbox/mapbox-gl-draw": "1.4.3",
34
- "@mapbox/mapbox-gl-sync-move": "^0.3.1",
35
- "@mui/icons-material": "^7.2.0",
36
- "@mui/material": "^7.2.0",
37
- "@mui/system": "^7.2.0",
38
- "@reduxjs/toolkit": "^2.6.1",
39
- "@rollup/plugin-json": "^6.1.0",
40
- "@testing-library/dom": "^10.4.0",
41
- "@tmcw/togeojson": "^7.0.0",
42
- "@turf/helpers": "^7.2.0",
43
- "@turf/turf": "^7.2.0",
44
- "@types/d3": "^7.4.3",
45
- "@types/geojson": "^7946.0.16",
46
- "@types/react-color": "^3.0.13",
47
- "@types/topojson-client": "^3.1.5",
48
- "@xmldom/xmldom": "^0.9.8",
49
- "csv2geojson": "^5.1.2",
50
- "d3": "^7.9.0",
51
- "globals": "^16.3.0",
52
- "jspdf": "^3.0.1",
53
- "maplibre-gl": "5.6.0",
54
- "osm2geojson-lite": "^1.0.3",
55
- "pako": "^2.1.0",
56
- "react-color": "^2.19.3",
57
- "react-moveable": "^0.56.0",
58
- "react-redux": "^9.2.0",
59
- "redux": "^5.0.1",
60
- "redux-thunk": "^3.1.0",
61
- "three": "^0.178.0",
62
- "topojson-client": "^3.1.0",
63
- "uuid": "^11.1.0",
64
- "wms-capabilities": "^0.6.0"
65
- },
66
- "devDependencies": {
67
- "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
68
- "@babel/preset-react": "^7.26.3",
69
- "@bahmutov/cy-rollup": "^2.0.0",
70
- "@rollup/plugin-babel": "^6.0.4",
71
- "@rollup/plugin-commonjs": "^28.0.6",
72
- "@rollup/plugin-url": "^8.0.2",
73
- "@storybook/addon-docs": "^9.0.15",
74
- "@storybook/addon-links": "^9.0.15",
75
- "@storybook/addons": "^7.6.17",
76
- "@storybook/react-webpack5": "^9.0.15",
77
- "@storybook/testing-react": "^2.0.1",
78
- "@testing-library/react": "^16.3.0",
79
- "@types/chai": "^5.2.1",
80
- "@types/elasticlunr": "^0.9.5",
81
- "@types/enzyme": "^3.10.18",
82
- "@types/expect": "^24.3.2",
83
- "@types/jest": "^30.0.0",
84
- "@types/mapbox__mapbox-gl-draw": "^1.4.9",
85
- "@types/mapbox__point-geometry": "^0.1.4",
86
- "@types/mapbox__vector-tile": "^2.0.0",
87
- "@types/mocha": "^10.0.10",
88
- "@types/pako": "^2.0.3",
89
- "@types/react": "^19.1.0",
90
- "@types/react-dom": "^19.1.1",
91
- "@types/sql.js": "^1.4.9",
92
- "@types/three": "^0.177.0",
93
- "@types/uuid": "^10.0.0",
94
- "@typescript-eslint/eslint-plugin": "^8.35.1",
95
- "@typescript-eslint/parser": "^8.35.1",
96
- "avj": "^0.0.0",
97
- "babel-jest": "^30.0.2",
98
- "babel-loader": "^10.0.0",
99
- "babel-plugin-inline-react-svg": "^2.0.2",
100
- "babel-plugin-styled-components": "^2.1.4",
101
- "babel-preset-react-app": "^10.1.0",
102
- "chai": "^5.2.0",
103
- "cypress": "^14.5.0",
104
- "elasticlunr": "^0.9.5",
105
- "eslint": "^9.30.0",
106
- "eslint-config-prettier": "^10.1.1",
107
- "eslint-plugin-react": "^7.37.5",
108
- "eslint-plugin-storybook": "^9.0.15",
109
- "glob": "^11.0.1",
110
- "jest": "30.0.3",
111
- "jest-circus": "30.0.3",
112
- "jest-environment-jsdom": "^30.0.2",
113
- "jest-enzyme": "^7.1.2",
114
- "jest-resolve": "30.0.2",
115
- "jest-watch-typeahead": "3.0.1",
116
- "mocha": "^11.7.1",
117
- "node-fetch": "^3.3.2",
118
- "path-browserify": "^1.0.1",
119
- "postcss": "^8.5.6",
120
- "prettier": "3.6.2",
121
- "react": "^19.1.0",
122
- "react-app-polyfill": "^3.0.0",
123
- "react-dev-utils": "^12.0.1",
124
- "react-dom": "^19.1.0",
125
- "react-draggable": "^4.5.0",
126
- "react-i18next": "^15.4.1",
127
- "rollup": "^4.44.1",
128
- "rollup-plugin-delete": "^3.0.1",
129
- "rollup-plugin-import-css": "^4.0.1",
130
- "rollup-plugin-node-externals": "^8.0.1",
131
- "rollup-plugin-typescript2": "^0.36.0",
132
- "showdown": "^2.1.0",
133
- "sql.js": "^1.13.0",
134
- "storybook": "^9.0.15",
135
- "ts-jest": "^29.3.1",
136
- "ts-loader": "^9.5.2",
137
- "ts-node": "^10.9.2",
138
- "typescript": "^5.8.3"
139
- },
140
- "jest": {
141
- "roots": [
142
- "<rootDir>/src"
143
- ],
144
- "collectCoverageFrom": [
145
- "src/**/*.{js,jsx,ts,tsx}",
146
- "!src/**/*.d.ts"
147
- ],
148
- "setupFiles": [
149
- "react-app-polyfill/jsdom"
150
- ],
151
- "setupFilesAfterEnv": [
152
- "<rootDir>/src/setupTests.js"
153
- ],
154
- "testMatch": [
155
- "<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
156
- "<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}"
157
- ],
158
- "testEnvironment": "jsdom",
159
- "transform": {
160
- "^.+\\.(js|jsx|mjs|cjs|ts|tsx)$": "<rootDir>/config/jest/babelTransform.js",
161
- "^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
162
- "^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js",
163
- "^.+\\.svg$": "<rootDir>/config/jest/fileTransform.js"
164
- },
165
- "transformIgnorePatterns": [
166
- "[/\\\\]node_modules[/\\\\](?!three/examples/jsm/).+\\.(js|jsx|mjs|cjs|ts|tsx)$",
167
- "^.+\\.module\\.(css|sass|scss)$"
168
- ],
169
- "modulePaths": [],
170
- "moduleNameMapper": {
171
- "^react-native$": "react-native-web",
172
- "^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy",
173
- "^maplibre-gl/dist/maplibre-gl$": "<rootDir>/node_modules/maplibre-gl",
174
- "d3": "<rootDir>/node_modules/d3/dist/d3.min.js"
175
- },
176
- "moduleFileExtensions": [
177
- "web.js",
178
- "js",
179
- "web.ts",
180
- "ts",
181
- "web.tsx",
182
- "tsx",
183
- "json",
184
- "web.jsx",
185
- "jsx",
186
- "node"
187
- ],
188
- "watchPlugins": [
189
- "jest-watch-typeahead/filename",
190
- "jest-watch-typeahead/testname"
191
- ],
192
- "resetMocks": true,
193
- "coveragePathIgnorePatterns": [
194
- "/node_modules/",
195
- "/src/decorators/",
196
- "/src/lab/",
197
- "/src/stories/",
198
- "/src/ui_components/",
199
- "/src/deckgl_components/",
200
- "/src/components/MlBasicComponent",
201
- "/src/components/MlMapDrawTools",
202
- "/src/components/MlComponentTemplate/",
203
- "/src/components/MlAerialPhotograph/",
204
- "/src/components/MapLibreMapDebug/",
205
- "/src/components/MlDemoDashboard/",
206
- "/src/components/MlLaufwettbewerbApp/",
207
- "/src/components/MlLaermkarte/",
208
- "/src/components/MlMobilerImker/",
209
- "/src/components/MlWanderApp/",
210
- "(.test)\\.(ts|tsx|js)$",
211
- "index\\.js$",
212
- ".*/lib/.*",
213
- ".*/utils/.*",
214
- ".*/util/.*",
215
- ".*/assets/.*",
216
- ".*/custom.d.tsx",
217
- "custom\\-.*\\-mode\\.js$",
218
- "(.stories)\\.(ts|tsx|js)$",
219
- "/distribution/.*\\.(ts|js)$"
220
- ]
221
- },
222
- "resolutions": {
223
- "jackspeak": "4.1.0"
224
- }
225
- }
2
+ "name": "@mapcomponents/react-maplibre",
3
+ "version": "1.5.0-2",
4
+ "main": "dist/index.cjs.js",
5
+ "license": "MIT",
6
+ "module": "dist/index.esm.js",
7
+ "source": "src/index.ts",
8
+ "types": "dist/src/index.d.ts",
9
+ "dependencies": {
10
+ "@dnd-kit/core": "^6.3.1",
11
+ "@dnd-kit/modifiers": "^9.0.0",
12
+ "@dnd-kit/sortable": "^10.0.0",
13
+ "@dnd-kit/utilities": "^3.2.2",
14
+ "@emotion/css": "^11.13.5",
15
+ "@emotion/react": "^11.14.0",
16
+ "@emotion/styled": "^11.14.1",
17
+ "@mapbox/mapbox-gl-draw": "1.4.3",
18
+ "@mapbox/mapbox-gl-sync-move": "^0.3.1",
19
+ "@mui/icons-material": "^7.3.2",
20
+ "@mui/material": "^7.3.2",
21
+ "@mui/system": "^7.3.2",
22
+ "@reduxjs/toolkit": "^2.9.0",
23
+ "@testing-library/dom": "^10.4.1",
24
+ "@testing-library/jest-dom": "^6.8.0",
25
+ "@testing-library/user-event": "^14.6.1",
26
+ "@tmcw/togeojson": "^7.1.2",
27
+ "@turf/helpers": "^7.2.0",
28
+ "@turf/turf": "^7.2.0",
29
+ "@types/d3": "^7.4.3",
30
+ "@types/geojson": "^7946.0.16",
31
+ "@types/react-color": "^3.0.13",
32
+ "@types/topojson-client": "^3.1.5",
33
+ "@types/topojson-specification": "^1.0.5",
34
+ "@xmldom/xmldom": "^0.9.8",
35
+ "camelcase": "^8.0.0",
36
+ "csv2geojson": "^5.1.2",
37
+ "d3": "^7.9.0",
38
+ "jspdf": "^3.0.2",
39
+ "maplibre-gl": "5.6.0",
40
+ "osm2geojson-lite": "^1.1.2",
41
+ "pako": "^2.1.0",
42
+ "react-color": "^2.19.3",
43
+ "react-moveable": "^0.56.0",
44
+ "react-redux": "^9.2.0",
45
+ "redux": "^5.0.1",
46
+ "redux-thunk": "^3.1.0",
47
+ "three": "^0.179.1",
48
+ "topojson-client": "^3.1.0",
49
+ "uuid": "^11.1.0",
50
+ "wms-capabilities": "^0.6.0"
51
+ },
52
+ "devDependencies": {
53
+ "@testing-library/react": "^16.3.0",
54
+ "@types/chai": "^5.2.2",
55
+ "@types/elasticlunr": "^0.9.9",
56
+ "@types/enzyme": "^3.10.19",
57
+ "@types/expect": "^24.3.2",
58
+ "@types/jest": "^30.0.0",
59
+ "@types/mapbox__mapbox-gl-draw": "^1.4.9",
60
+ "@types/mapbox__point-geometry": "^0.1.4",
61
+ "@types/mapbox__vector-tile": "^2.0.0",
62
+ "@types/mocha": "^10.0.10",
63
+ "@types/pako": "^2.0.4",
64
+ "@types/react": "^19.1.12",
65
+ "@types/react-dom": "^19.1.9",
66
+ "@types/sql.js": "^1.4.9",
67
+ "@types/three": "^0.179.0",
68
+ "@types/uuid": "^10.0.0",
69
+ "@typescript-eslint/eslint-plugin": "^8.42.0",
70
+ "@typescript-eslint/parser": "^8.42.0",
71
+ "avj": "^0.0.0",
72
+ "babel-jest": "^30.1.2",
73
+ "babel-loader": "^10.0.0",
74
+ "babel-plugin-inline-react-svg": "^2.0.2",
75
+ "babel-plugin-styled-components": "^2.1.4",
76
+ "babel-preset-react-app": "^10.1.0",
77
+ "chai": "^6.0.1",
78
+ "elasticlunr": "^0.9.5",
79
+ "eslint-plugin-storybook": "^9.1.4",
80
+ "glob": "^11.0.3",
81
+ "jest": "30.0.5",
82
+ "jest-circus": "30.0.5",
83
+ "jest-environment-jsdom": "^30.1.2",
84
+ "jest-enzyme": "^7.1.2",
85
+ "jest-resolve": "30.0.5",
86
+ "jest-watch-typeahead": "3.0.1",
87
+ "mocha": "^11.7.2",
88
+ "node-fetch": "^3.3.2",
89
+ "path-browserify": "^1.0.1",
90
+ "postcss": "^8.5.6",
91
+ "react-app-polyfill": "^3.0.0",
92
+ "react-dev-utils": "^12.0.1",
93
+ "react-draggable": "^4.5.0",
94
+ "react-i18next": "^15.7.3",
95
+ "showdown": "^2.1.0",
96
+ "sql.js": "^1.13.0",
97
+ "ts-jest": "^29.4.1",
98
+ "ts-loader": "^9.5.4"
99
+ },
100
+ "jest": {
101
+ "roots": [
102
+ "<rootDir>/src"
103
+ ],
104
+ "collectCoverageFrom": [
105
+ "src/**/*.{js,jsx,ts,tsx}",
106
+ "!src/**/*.d.ts"
107
+ ],
108
+ "setupFiles": [
109
+ "react-app-polyfill/jsdom"
110
+ ],
111
+ "setupFilesAfterEnv": [
112
+ "<rootDir>/src/setupTests.js"
113
+ ],
114
+ "testMatch": [
115
+ "<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
116
+ "<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}"
117
+ ],
118
+ "testEnvironment": "jsdom",
119
+ "transform": {
120
+ "^.+\\.(js|jsx|mjs|cjs|ts|tsx)$": "<rootDir>/config/jest/babelTransform.js",
121
+ "^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
122
+ "^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js",
123
+ "^.+\\.svg$": "<rootDir>/config/jest/fileTransform.js"
124
+ },
125
+ "transformIgnorePatterns": [
126
+ "[/\\\\]node_modules[/\\\\](?!three/examples/jsm/).+\\.(js|jsx|mjs|cjs|ts|tsx)$",
127
+ "^.+\\.module\\.(css|sass|scss)$"
128
+ ],
129
+ "modulePaths": [],
130
+ "moduleNameMapper": {
131
+ "^react-native$": "react-native-web",
132
+ "^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy",
133
+ "^maplibre-gl/dist/maplibre-gl$": "<rootDir>/node_modules/maplibre-gl",
134
+ "d3": "<rootDir>/node_modules/d3/dist/d3.min.js"
135
+ },
136
+ "moduleFileExtensions": [
137
+ "web.js",
138
+ "js",
139
+ "web.ts",
140
+ "ts",
141
+ "web.tsx",
142
+ "tsx",
143
+ "json",
144
+ "web.jsx",
145
+ "jsx",
146
+ "node"
147
+ ],
148
+ "watchPlugins": [
149
+ "jest-watch-typeahead/filename",
150
+ "jest-watch-typeahead/testname"
151
+ ],
152
+ "resetMocks": true,
153
+ "coveragePathIgnorePatterns": [
154
+ "/node_modules/",
155
+ "/src/decorators/",
156
+ "/src/lab/",
157
+ "/src/stories/",
158
+ "/src/ui_components/",
159
+ "/src/deckgl_components/",
160
+ "/src/components/MlBasicComponent",
161
+ "/src/components/MlMapDrawTools",
162
+ "/src/components/MlComponentTemplate/",
163
+ "/src/components/MlAerialPhotograph/",
164
+ "/src/components/MapLibreMapDebug/",
165
+ "/src/components/MlDemoDashboard/",
166
+ "/src/components/MlLaufwettbewerbApp/",
167
+ "/src/components/MlLaermkarte/",
168
+ "/src/components/MlMobilerImker/",
169
+ "/src/components/MlWanderApp/",
170
+ "(.test)\\.(ts|tsx|js)$",
171
+ "index\\.js$",
172
+ ".*/lib/.*",
173
+ ".*/utils/.*",
174
+ ".*/util/.*",
175
+ ".*/assets/.*",
176
+ ".*/custom.d.tsx",
177
+ "custom\\-.*\\-mode\\.js$",
178
+ "(.stories)\\.(ts|tsx|js)$",
179
+ "/distribution/.*\\.(ts|js)$"
180
+ ]
181
+ },
182
+ "resolutions": {
183
+ "jackspeak": "4.1.0"
184
+ },
185
+ "scripts": {
186
+ "test": "node scripts/test.cjs --watchAll=false --coverage",
187
+ "test:noninteractive": "node scripts/test.cjs --verbose --watchAll=false --coverage",
188
+ "test:generate-output": "node scripts/test.cjs --watchAll=false --json --outputFile=./src/.jest-test-results.json || true",
189
+ "build-storybook": "storybook build -o docs-build",
190
+ "storybook-docs": "storybook dev --docs --no-manager-cache",
191
+ "build-catalogue-meta": "node scripts/build-catalogue-meta.js",
192
+ "create-component": "./scripts/create-map-component.sh"
193
+ }
194
+ }
package/project.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "react-maplibre",
3
+ "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
+ "sourceRoot": "packages/react-maplibre/src",
5
+ "projectType": "library",
6
+ "tags": [],
7
+ "// targets": "to see all targets run: nx show project react-maplibre --web",
8
+ "targets": {
9
+ "build": {
10
+ "executor": "@nx/vite:build",
11
+ "options": {
12
+ "outputPath": "dist/libs/react-maplibre"
13
+ }
14
+ },
15
+ "storybook": {
16
+ "options": {
17
+ "port": 4400
18
+ }
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../../dist/out-tsc",
5
+ "types": [
6
+ "node",
7
+ "@nx/react/typings/cssmodule.d.ts",
8
+ "@nx/react/typings/image.d.ts",
9
+ "vite/client"
10
+ ]
11
+ },
12
+ "exclude": [
13
+ "**/*.spec.ts",
14
+ "**/*.test.ts",
15
+ "**/*.spec.tsx",
16
+ "**/*.test.tsx",
17
+ "**/*.spec.js",
18
+ "**/*.test.js",
19
+ "**/*.spec.jsx",
20
+ "**/*.test.jsx",
21
+ "cypress/**/*",
22
+ "cypress.config.ts",
23
+ "**/*.cy.ts",
24
+ "**/*.cy.js",
25
+ "**/*.cy.tsx",
26
+ "**/*.cy.jsx"
27
+ ],
28
+ "include": ["src", "src/**/*.json"]
29
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,61 @@
1
+ /// <reference types='vitest' />
2
+ import { defineConfig } from 'vite';
3
+ import react from '@vitejs/plugin-react';
4
+ import dts from 'vite-plugin-dts';
5
+ import * as path from 'path';
6
+ import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
7
+ import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';
8
+ /*import * as fs from 'node:fs';
9
+
10
+ const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));*/
11
+
12
+ export default defineConfig(() => ({
13
+ root: __dirname,
14
+ cacheDir: '../../node_modules/.vite/packages/react-maplibre',
15
+ plugins: [
16
+ react(),
17
+ nxViteTsPaths(),
18
+ nxCopyAssetsPlugin(['*.md']),
19
+ dts({
20
+ entryRoot: 'src',
21
+ tsconfigPath: path.join(__dirname, 'tsconfig.lib.json'),
22
+ pathsToAliases: false,
23
+ }),
24
+ ],
25
+ // Uncomment this if you are using workers.
26
+ // worker: {
27
+ // plugins: [ nxViteTsPaths() ],
28
+ // },
29
+ // Configuration for building your library.
30
+ // See: https://vitejs.dev/guide/build.html#library-mode
31
+ build: {
32
+ outDir: '../../dist/packages/react-maplibre',
33
+ emptyOutDir: true,
34
+ reportCompressedSize: true,
35
+ commonjsOptions: {
36
+ transformMixedEsModules: true,
37
+ },
38
+ lib: {
39
+ // Could also be a dictionary or array of multiple entry points.
40
+ entry: 'src/index.ts',
41
+ name: 'react-maplibre',
42
+ fileName: 'index',
43
+ // Change this to the formats you want to support.
44
+ // Don't forget to update your package.json as well.
45
+ formats: ['es' as const, 'cjs' as const],
46
+ },
47
+ sourcemap: true,
48
+ rollupOptions: {
49
+ // External packages that should not be bundled into your library.
50
+ external: [
51
+ 'react',
52
+ 'react-dom',
53
+ 'd3',
54
+ 'sql.js',
55
+ /* ...Object.keys(pkg.dependencies),
56
+ ...Object.keys(pkg.devDependencies),*/
57
+ ],
58
+ input: [path.join(__dirname, 'src/index.ts')],
59
+ },
60
+ },
61
+ }));
package/.eslintrc.cjs DELETED
@@ -1,33 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- node: true,
5
- es2021: true,
6
- jest: true,
7
- },
8
- extends: [
9
- "eslint:recommended",
10
- "plugin:react/recommended",
11
- "plugin:@typescript-eslint/recommended",
12
- "prettier",
13
- "plugin:storybook/recommended"
14
- ],
15
- overrides: [],
16
- parser: '@typescript-eslint/parser',
17
- parserOptions: {
18
- ecmaVersion: 'latest',
19
- sourceType: 'module',
20
- },
21
- plugins: ['react', '@typescript-eslint'],
22
- rules: {
23
- 'react/prop-types': 'off',
24
- // empty functions can sometimes be set intentionally. e.g. with useRef/useState, if we want an empty function first
25
- '@typescript-eslint/no-empty-function': 'off',
26
- "@typescript-eslint/no-explicit-any": "off"
27
- },
28
- settings: {
29
- react: {
30
- version: 'detect',
31
- },
32
- },
33
- };