@mapcomponents/three 1.8.10 → 1.8.19-3

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 (39) hide show
  1. package/.storybook/main.ts +15 -6
  2. package/.storybook/manager.js +6 -0
  3. package/.storybook/mapcomponents_logo.png +0 -0
  4. package/.storybook/preview.ts +32 -0
  5. package/.storybook/style.css +13 -0
  6. package/.storybook/wheregroupTheme.js +9 -0
  7. package/cypress.config.ts +27 -4
  8. package/dist/catalogue/mc_meta.json +44 -0
  9. package/dist/components/MlThreeGizmo.d.ts.map +1 -1
  10. package/dist/contexts/ThreeProvider.d.ts.map +1 -1
  11. package/dist/cypress/support/component.d.ts.map +1 -1
  12. package/dist/hooks/useThreeModel.d.ts.map +1 -1
  13. package/dist/index.js +52 -113
  14. package/dist/index.mjs +10311 -12270
  15. package/dist/lib/ThreejsSceneHelper.d.ts.map +1 -1
  16. package/dist/lib/splats/GaussianSplattingMesh.d.ts.map +1 -1
  17. package/dist/thumbnails/MlThreeModelLayer.png +0 -0
  18. package/dist/thumbnails/MlThreeSplatLayer.png +0 -0
  19. package/eslint.config.cjs +3 -0
  20. package/package.json +12 -7
  21. package/public/catalogue/mc_meta.json +44 -0
  22. package/public/thumbnails/MlThreeModelLayer.png +0 -0
  23. package/public/thumbnails/MlThreeSplatLayer.png +0 -0
  24. package/src/components/MlThreeGizmo.tsx +0 -1
  25. package/src/components/MlThreeModelLayer/MlThreeModelLayer.meta.json +2 -2
  26. package/src/components/MlThreeModelLayer/MlThreeModelLayer.stories.tsx +1 -1
  27. package/src/components/MlThreeSplatLayer/MlThreeSplatLayer.meta.json +2 -2
  28. package/src/contexts/ThreeProvider.tsx +0 -1
  29. package/src/cypress/support/component.ts +11 -0
  30. package/src/decorators/style.css +22 -8
  31. package/src/hooks/useThreeModel.tsx +2 -0
  32. package/src/lib/ThreejsSceneHelper.ts +1 -0
  33. package/src/lib/splats/GaussianSplattingMesh.ts +0 -1
  34. package/tsconfig.json +0 -9
  35. package/tsconfig.lib.json +6 -1
  36. package/tsconfig.storybook.json +4 -20
  37. package/vite.config.ts +57 -55
  38. package/dist/package.json +0 -33
  39. package/eslint.config.mjs +0 -12
@@ -1 +1 @@
1
- {"version":3,"file":"ThreejsSceneHelper.d.ts","sourceRoot":"","sources":["../../src/lib/ThreejsSceneHelper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,GAAG,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACN,KAAK,EACL,iBAAiB,EACjB,OAAO,EACP,KAAK,EAOL,MAAM,OAAO,CAAC;AAIf,MAAM,CAAC,OAAO,OAAO,kBAAkB;IACtC,WAAW,CAAC,WAAW,UAAO,GAAG,KAAK;IAetC,WAAW,CAAC,MAAM,EAAE,KAAK,GAAG,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK;IAOvD,YAAY,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,iBAAiB;IAY/D,OAAO,CAAC,sBAAsB;IA6B9B,OAAO,CAAC,uBAAuB;IAgC/B,OAAO,CAAC,oBAAoB;IAqC5B,qBAAqB,CACpB,MAAM,EAAE,iBAAiB,EACzB,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,GAAG,EACX,WAAW,EAAE,OAAO,EACpB,cAAc,EAAE,OAAO,GACrB,IAAI;IA6BP,OAAO,CAAC,mBAAmB;IA0B3B,OAAO,CAAC,gBAAgB;IAexB,OAAO,CAAC,qBAAqB;IAU7B,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;CASxD"}
1
+ {"version":3,"file":"ThreejsSceneHelper.d.ts","sourceRoot":"","sources":["../../src/lib/ThreejsSceneHelper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,GAAG,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,O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B,0BAEtB;IACD,IAAI,cAAc,0BAEjB;IACD,IAAI,aAAa,0BAEhB;IACD,IAAI,UAAU,4BAEb;;IASD,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIlC,YAAY,CAAC,MAAM,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS;IA4B9C,cAAc,CACtB,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,GACV,IAAI;IAiBP,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/C,OAAO,IAAI,IAAI;IAiBf,OAAO,CAAC,YAAY;IAWX,KAAK,IAAI,qBAAqB;IAYvC,OAAO,CAAC,uBAAuB;IA4F/B,OAAO,CAAC,mBAAmB;IA8C3B,OAAO,CAAC,cAAc;IAuHtB,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAE,mBAAmB;IAmDtB,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1E,UAAU,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI;IAItD,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAS5D,OAAO,CAAC,sBAAsB;IAY9B,OAAO,CAAC,iBAAiB;IA8BzB,OAAO,CAAC,cAAc;CAkBtB"}
@@ -0,0 +1,3 @@
1
+ const baseConfig = require('../../eslint.config.mjs').default;
2
+
3
+ module.exports = [...baseConfig];
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@mapcomponents/three",
3
- "version": "1.8.10",
3
+ "version": "1.8.19-3",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
+ "repository": {
9
+ "url": "https://github.com/mapcomponents/react-map-components-maplibre"
10
+ },
8
11
  "exports": {
9
12
  ".": {
10
13
  "import": "dist/index.mjs",
@@ -17,17 +20,19 @@
17
20
  "peerDependencies": {
18
21
  "react": "^19.1.0",
19
22
  "react-dom": "^19.1.0",
20
- "@mapcomponents/react-maplibre": "1.8.10"
23
+ "@mapcomponents/react-maplibre": "1.8.19-3"
21
24
  },
22
25
  "dependencies": {
23
26
  "@emotion/react": "^11.14.0",
24
27
  "@emotion/styled": "^11.14.1",
25
- "@mui/material": "^7.3.2",
26
- "@mui/system": "^7.3.2",
27
- "maplibre-gl": "^5.16.0",
28
- "three": "^0.182.0"
28
+ "@mui/material": "^9.0.1",
29
+ "maplibre-gl": "^5.24.0",
30
+ "three": "^0.184.0"
29
31
  },
30
32
  "devDependencies": {
31
- "@types/three": "^0.182.0"
33
+ "@types/three": "^0.184.1"
34
+ },
35
+ "scripts": {
36
+ "build-catalogue-meta": "node ../../scripts/build-catalogue-meta.js"
32
37
  }
33
38
  }
@@ -0,0 +1,44 @@
1
+ {
2
+ "MlThreeSplatLayer": {
3
+ "name": "MlThreeSplatLayer",
4
+ "title": "3D Splat Model",
5
+ "description": "Displays a Gaussian Splatting (GS) scene at a specific location on the map, enabling photorealistic 3D visuals captured from the real world. The scene can be positioned, rotated and scaled to fit the surroundings.",
6
+ "i18n": {
7
+ "de": {
8
+ "title": "3D Splat Modelle",
9
+ "description": "Zeigt eine Gaussian-Splatting-Szene (GS) an einem bestimmten Ort auf der Karte an und ermöglicht fotorealistische 3D-Ansichten realer Umgebungen. Die Szene kann in Position, Ausrichtung und Größe angepasst werden."
10
+ }
11
+ },
12
+ "tags": ["Map layer", "3D", "Splat"],
13
+ "category": "layer",
14
+ "type": "component",
15
+ "demos": [
16
+ {
17
+ "name": "Demo",
18
+ "url": "https://mapcomponents.github.io/react-map-components-maplibre/three/iframe.html?id=mapcomponents-mlthreesplatlayer--default&viewMode=story"
19
+ }
20
+ ],
21
+ "thumbnail": "https://mapcomponents.github.io/react-map-components-maplibre/three/thumbnails/MlThreeSplatLayer.png"
22
+ },
23
+ "MlThreeModelLayer": {
24
+ "name": "MlThreeModelLayer",
25
+ "title": "3D Model",
26
+ "description": "Renders a 3D model at a specific location on the map. The model can be loaded from a file and positioned, rotated and scaled to fit the scene.",
27
+ "i18n": {
28
+ "de": {
29
+ "title": "3D Modelle",
30
+ "description": "Rendert ein 3D-Modell an einem bestimmten Ort auf der Karte. Das Modell kann aus einer Datei geladen und in Position, Ausrichtung und Größe angepasst werden."
31
+ }
32
+ },
33
+ "tags": ["Map layer"],
34
+ "category": "layer",
35
+ "type": "component",
36
+ "demos": [
37
+ {
38
+ "name": "Demo",
39
+ "url": "https://mapcomponents.github.io/react-map-components-maplibre/three/iframe.html?id=mapcomponents-mlthreemodellayer--example-config&viewMode=story"
40
+ }
41
+ ],
42
+ "thumbnail": "https://mapcomponents.github.io/react-map-components-maplibre/three/thumbnails/MlThreeModelLayer.png"
43
+ }
44
+ }
@@ -67,7 +67,6 @@ const MlThreeGizmo = (props: MlThreeGizmoProps) => {
67
67
  controls.dispose();
68
68
  controlsRef.current = null;
69
69
  };
70
- // eslint-disable-next-line react-hooks/exhaustive-deps
71
70
  }, [scene, camera, renderer, map, sceneRoot]);
72
71
 
73
72
  // Update target object
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "MlThreeModelLayer",
3
3
  "title": "3D Model",
4
- "description": "Layer Component, that makes it possible to show 3D Models on the map.",
4
+ "description": "Renders a 3D model at a specific location on the map. The model can be loaded from a file and positioned, rotated and scaled to fit the scene.",
5
5
  "i18n": {
6
6
  "de": {
7
7
  "title": "3D Modelle",
8
- "description": "Layer Component, das es ermöglicht 3D Modelle auf der Karte darzustellen."
8
+ "description": "Rendert ein 3D-Modell an einem bestimmten Ort auf der Karte. Das Modell kann aus einer Datei geladen und in Position, Ausrichtung und Größe angepasst werden."
9
9
  }
10
10
  },
11
11
  "tags": ["Map layer"],
@@ -50,7 +50,7 @@ const Template: any = () => {
50
50
  const [showLayer, setShowLayer] = useState(true);
51
51
  const [scale, setScale] = useState(1);
52
52
  const [rotation, setRotation] = useState({ x: 90, y: 90, z: 0 });
53
- const [mapPosition, setMapPosition] = useState({ lng: 7.097, lat: 50.7355 });
53
+ const [mapPosition, setMapPosition] = useState({ lng: 7.0996, lat: 50.7339 });
54
54
  const [position, setPosition] = useState({ x: 0, y: 0, z: 0 });
55
55
  const [sidebarOpen, setSidebarOpen] = useState(true);
56
56
  const [enableTransformControls, setEnableTransformControls] = useState(false);
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "MlThreeSplatLayer",
3
3
  "title": "3D Splat Model",
4
- "description": "Layer Component, that makes it possible to show 3D Gaussian Splatting Models on the map.",
4
+ "description": "Displays a Gaussian Splatting (GS) scene at a specific location on the map, enabling photorealistic 3D visuals captured from the real world. The scene can be positioned, rotated and scaled to fit the surroundings.",
5
5
  "i18n": {
6
6
  "de": {
7
7
  "title": "3D Splat Modelle",
8
- "description": "Layer Component, das es ermöglicht 3D Gaussian Splatting Modelle auf der Karte darzustellen."
8
+ "description": "Zeigt eine Gaussian-Splatting-Szene (GS) an einem bestimmten Ort auf der Karte an und ermöglicht fotorealistische 3D-Ansichten realer Umgebungen. Die Szene kann in Position, Ausrichtung und Größe angepasst werden."
9
9
  }
10
10
  },
11
11
  "tags": ["Map layer", "3D", "Splat"],
@@ -112,7 +112,6 @@ export const ThreeProvider: React.FC<ThreeProviderProps> = ({
112
112
  }
113
113
  // Cleanup is handled in onRemove
114
114
  };
115
- // eslint-disable-next-line react-hooks/exhaustive-deps
116
115
  }, [map, id]); // Re-run if map or id changes.
117
116
 
118
117
  // Handle dynamic prop changes
@@ -1,6 +1,17 @@
1
1
  import { mount } from 'cypress/react';
2
2
  import './commands';
3
3
 
4
+ // Ignore WebGL context creation errors (e.g. in headless/CI environments)
5
+ Cypress.on('uncaught:exception', (err) => {
6
+ if (
7
+ err.message.includes('Failed to initialize WebGL') ||
8
+ err.message.includes('webglcontextcreationerror')
9
+ ) {
10
+ return false;
11
+ }
12
+ return true;
13
+ });
14
+
4
15
  declare global {
5
16
  // eslint-disable-next-line @typescript-eslint/no-namespace
6
17
  namespace Cypress {
@@ -1,19 +1,24 @@
1
+ html,
2
+ body,
3
+ #storybook-root,
4
+ #root {
5
+ height: 100%;
6
+ margin: 0;
7
+ padding: 0;
8
+ }
9
+
1
10
  #root {
2
11
  background-color: #000;
3
12
  position: absolute;
4
- min-height: 400px;
5
13
  top: 0;
6
14
  bottom: 0;
7
15
  left: 0;
8
16
  right: 0;
9
17
  }
10
- .docs-story {
11
- min-height: 400px;
12
- display: flex;
13
- align-items: stretch;
14
- }
15
- .docs-story > div:first-child {
16
- width: 100%;
18
+
19
+ #storybook-root > div,
20
+ #root > div {
21
+ height: 100%;
17
22
  }
18
23
 
19
24
  .App {
@@ -23,6 +28,15 @@
23
28
  bottom: 0;
24
29
  left: 0;
25
30
  }
31
+
32
+ .fullscreen_map {
33
+ position: absolute;
34
+ top: 0;
35
+ bottom: 0;
36
+ left: 0;
37
+ right: 0;
38
+ }
39
+
26
40
  .fullscreen_map .mapContainer {
27
41
  position: absolute;
28
42
  top: 0;
@@ -122,10 +122,12 @@ export const useThreeModel = (props: UseThreeModelProps) => {
122
122
  initRef.current();
123
123
  }
124
124
 
125
+ // eslint-disable-next-line no-useless-assignment
125
126
  let extension = '';
126
127
  try {
127
128
  const urlObj = new URL(url, window.location.origin);
128
129
  extension = urlObj.pathname.split('.').pop()?.toLowerCase() || '';
130
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
129
131
  } catch (e) {
130
132
  extension = url.split('.').pop()?.toLowerCase() || '';
131
133
  }
@@ -157,6 +157,7 @@ export default class ThreejsSceneHelper {
157
157
  map: MaplibreMap,
158
158
  matrix: any,
159
159
  worldMatrix: Matrix4,
160
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
160
161
  worldMatrixInv: Matrix4
161
162
  ): void {
162
163
  const transform = map.transform;
@@ -18,7 +18,6 @@ import {
18
18
  HalfFloatType,
19
19
  InstancedBufferAttribute,
20
20
  InstancedBufferGeometry,
21
- LinearFilter,
22
21
  Material,
23
22
  Matrix4,
24
23
  Mesh,
package/tsconfig.json CHANGED
@@ -1,13 +1,4 @@
1
1
  {
2
- "compilerOptions": {
3
- "jsx": "react-jsx",
4
- "allowJs": false,
5
- "esModuleInterop": false,
6
- "allowSyntheticDefaultImports": true,
7
- "strict": true,
8
- "types": ["vite/client"]
9
- },
10
- "files": [],
11
2
  "include": [],
12
3
  "references": [
13
4
  {
package/tsconfig.lib.json CHANGED
@@ -23,5 +23,10 @@
23
23
  "**/*.stories.jsx",
24
24
  "**/*.stories.tsx"
25
25
  ],
26
- "include": ["src/**/*", "../react-maplibre/src/**/*"]
26
+ "include": ["src/**/*", "../react-maplibre/src/**/*"],
27
+ "references": [
28
+ {
29
+ "path": "../react-maplibre/tsconfig.lib.json"
30
+ }
31
+ ]
27
32
  }
@@ -1,24 +1,8 @@
1
1
  {
2
- "extends": "./tsconfig.json",
2
+ "extends": "../../tsconfig.base.json",
3
3
  "compilerOptions": {
4
- "emitDecoratorMetadata": true,
5
- "experimentalDecorators": true,
6
- "outDir": ""
4
+ "composite": false,
5
+ "noEmit": true
7
6
  },
8
- "exclude": [
9
- "src/**/*.spec.ts",
10
- "src/**/*.test.ts",
11
- "src/**/*.spec.js",
12
- "src/**/*.test.js",
13
- "src/**/*.spec.tsx",
14
- "src/**/*.test.tsx",
15
- "src/**/*.spec.jsx",
16
- "src/**/*.test.js"
17
- ],
18
- "include": ["src/**/*", "../react-maplibre/src/**/*"],
19
- "files": [
20
- "../../node_modules/@nx/react/typings/styled-jsx.d.ts",
21
- "../../node_modules/@nx/react/typings/cssmodule.d.ts",
22
- "../../node_modules/@nx/react/typings/image.d.ts"
23
- ]
7
+ "include": [".storybook/**/*"]
24
8
  }
package/vite.config.ts CHANGED
@@ -1,70 +1,72 @@
1
1
  /// <reference types='vitest' />
2
2
  import { defineConfig } from 'vite';
3
- import react from '@vitejs/plugin-react';
4
3
  import dts from 'vite-plugin-dts';
5
4
  import * as path from 'path';
6
5
  import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
7
6
  import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';
8
7
 
9
- export default defineConfig(() => ({
10
- root: __dirname,
11
- cacheDir: '../../node_modules/.vite/packages/three',
12
- resolve: {
13
- dedupe: [
14
- 'react',
15
- 'react-dom',
16
- '@mui/material',
17
- '@mui/system',
18
- '@emotion/react',
19
- '@emotion/styled',
20
- ],
21
- },
22
- plugins: [
23
- react(),
24
- nxViteTsPaths(),
25
- nxCopyAssetsPlugin(['*.md']),
26
- dts({
27
- entryRoot: 'src',
28
- tsconfigPath: path.join(__dirname, 'tsconfig.lib.json'),
29
- pathsToAliases: false,
30
- }),
31
- ],
32
- // Uncomment this if you are using workers.
33
- // worker: {
34
- // plugins: [ nxViteTsPaths() ],
35
- // },
36
- // Configuration for building your library.
37
- // See: https://vitejs.dev/guide/build.html#library-mode
38
- build: {
39
- outDir: 'dist',
40
- emptyOutDir: true,
41
- reportCompressedSize: true,
42
- commonjsOptions: {
43
- transformMixedEsModules: true,
44
- },
45
- lib: {
46
- // Could also be a dictionary or array of multiple entry points.
47
- entry: 'src/index.ts',
48
- name: '@mapcomponents/three',
49
- fileName: 'index',
50
- // Change this to the formats you want to support.
51
- // Don't forget to update your package.json as well.
52
- formats: ['es' as const, 'cjs' as const],
53
- },
54
- rollupOptions: {
55
- // External packages that should not be bundled into your library.
56
- external: [
8
+ export default defineConfig(async () => {
9
+ const react = (await import('@vitejs/plugin-react')).default;
10
+ return {
11
+ root: __dirname,
12
+ cacheDir: '../../node_modules/.vite/packages/three',
13
+ resolve: {
14
+ dedupe: [
57
15
  'react',
58
16
  'react-dom',
59
- 'react/jsx-runtime',
60
- '@mapcomponents/react-maplibre',
61
- 'three',
62
- 'maplibre-gl',
63
17
  '@mui/material',
64
18
  '@mui/system',
65
19
  '@emotion/react',
66
20
  '@emotion/styled',
67
21
  ],
68
22
  },
69
- },
70
- }));
23
+ plugins: [
24
+ react(),
25
+ nxViteTsPaths(),
26
+ nxCopyAssetsPlugin(['*.md']),
27
+ dts({
28
+ entryRoot: 'src',
29
+ tsconfigPath: path.join(__dirname, 'tsconfig.lib.json'),
30
+ pathsToAliases: false,
31
+ }),
32
+ ],
33
+ // Uncomment this if you are using workers.
34
+ // worker: {
35
+ // plugins: [ nxViteTsPaths() ],
36
+ // },
37
+ // Configuration for building your library.
38
+ // See: https://vitejs.dev/guide/build.html#library-mode
39
+ build: {
40
+ outDir: 'dist',
41
+ emptyOutDir: true,
42
+ reportCompressedSize: true,
43
+ commonjsOptions: {
44
+ transformMixedEsModules: true,
45
+ },
46
+ lib: {
47
+ // Could also be a dictionary or array of multiple entry points.
48
+ entry: 'src/index.ts',
49
+ name: '@mapcomponents/three',
50
+ fileName: 'index',
51
+ // Change this to the formats you want to support.
52
+ // Don't forget to update your package.json as well.
53
+ formats: ['es' as const, 'cjs' as const],
54
+ },
55
+ rolldownOptions: {
56
+ // External packages that should not be bundled into your library.
57
+ external: [
58
+ 'react',
59
+ 'react-dom',
60
+ 'react/jsx-runtime',
61
+ '@mapcomponents/react-maplibre',
62
+ 'three',
63
+ 'maplibre-gl',
64
+ '@mui/material',
65
+ '@mui/system',
66
+ '@emotion/react',
67
+ '@emotion/styled',
68
+ ],
69
+ },
70
+ },
71
+ };
72
+ });
package/dist/package.json DELETED
@@ -1,33 +0,0 @@
1
- {
2
- "name": "@mapcomponents/three",
3
- "version": "1.8.10",
4
- "license": "MIT",
5
- "main": "dist/index.cjs.js",
6
- "module": "dist/index.mjs",
7
- "types": "dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "import": "dist/index.mjs",
11
- "require": "dist/index.cjs.js"
12
- }
13
- },
14
- "publishConfig": {
15
- "access": "public"
16
- },
17
- "peerDependencies": {
18
- "@mapcomponents/react-maplibre": "workspace:*",
19
- "react": "^19.1.0",
20
- "react-dom": "^19.1.0"
21
- },
22
- "dependencies": {
23
- "@emotion/react": "^11.14.0",
24
- "@emotion/styled": "^11.14.1",
25
- "@mui/material": "^7.3.2",
26
- "@mui/system": "^7.3.2",
27
- "maplibre-gl": "^5.16.0",
28
- "three": "^0.182.0"
29
- },
30
- "devDependencies": {
31
- "@types/three": "^0.182.0"
32
- }
33
- }
package/eslint.config.mjs DELETED
@@ -1,12 +0,0 @@
1
- import nx from '@nx/eslint-plugin';
2
- import baseConfig from '../../eslint.config.mjs';
3
-
4
- export default [
5
- ...baseConfig,
6
- ...nx.configs['flat/react'],
7
- {
8
- files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
9
- // Override or add rules here
10
- rules: {},
11
- },
12
- ];