@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,20 +1,29 @@
1
1
  import type { StorybookConfig } from '@storybook/react-vite';
2
2
 
3
+
3
4
  const config: StorybookConfig = {
4
5
  stories: ['../src/**/*.@(mdx|stories.@(js|jsx|ts|tsx))'],
5
- addons: [],
6
+ addons: ["@storybook/addon-docs"],
6
7
  framework: {
7
- name: '@storybook/react-vite',
8
+ name: "@storybook/react-vite",
8
9
  options: {
9
10
  builder: {
10
11
  viteConfigPath: 'vite.config.ts',
11
12
  },
12
13
  },
13
14
  },
15
+ staticDirs: ['../public'],
16
+
17
+ typescript: {
18
+ check: false,
19
+ reactDocgen: 'react-docgen-typescript',
20
+ reactDocgenTypescriptOptions: {
21
+ tsconfigPath: "./tsconfig.lib.json",
22
+ shouldExtractLiteralValuesFromEnum: true,
23
+ propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
24
+ },
25
+ },
26
+
14
27
  };
15
28
 
16
29
  export default config;
17
-
18
- // To customize your Vite configuration you can use the viteFinal field.
19
- // Check https://storybook.js.org/docs/react/builders/vite#configuration
20
- // and https://nx.dev/recipes/storybook/custom-builder-configs
@@ -0,0 +1,6 @@
1
+ import { addons } from "storybook/manager-api";
2
+ import wheregroupTheme from "./wheregroupTheme";
3
+
4
+ addons.setConfig({
5
+ theme: wheregroupTheme,
6
+ });
@@ -0,0 +1,32 @@
1
+ import './style.css';
2
+
3
+ const preview = {
4
+ parameters: {
5
+ layout: 'fullscreen',
6
+ docs: {
7
+ story: {
8
+ iframeHeight: 500,
9
+ },
10
+ },
11
+ actions: { argTypesRegex: '^on[A-Z].*' },
12
+ },
13
+ globalTypes: {
14
+ theme: {
15
+ name: 'Theme',
16
+ title: 'Theme',
17
+ description: 'Theme for your components',
18
+ defaultValue: 'light',
19
+ toolbar: {
20
+ icon: 'paintbrush',
21
+ dynamicTitle: true,
22
+ items: [
23
+ { value: 'light', left: '☀️', title: 'Light mode' },
24
+ { value: 'dark', left: '🌙', title: 'Dark mode' },
25
+ ],
26
+ },
27
+ },
28
+ },
29
+ tags: ['autodocs'],
30
+ };
31
+
32
+ export default preview;
@@ -0,0 +1,13 @@
1
+ .sb-story {
2
+ min-height: 500px;
3
+ position: relative;
4
+ }
5
+
6
+ .sb-story > div {
7
+ height: 100%;
8
+ position: absolute;
9
+ top: 0;
10
+ bottom: 0;
11
+ left: 0;
12
+ right: 0;
13
+ }
@@ -0,0 +1,9 @@
1
+ import { create } from 'storybook/theming';
2
+ import logo from './mapcomponents_logo.png';
3
+
4
+ export default create({
5
+ base: 'light',
6
+ brandTitle: 'WhereGroup GmbH',
7
+ brandUrl: 'https://wheregroup.com',
8
+ brandImage: logo,
9
+ });
package/cypress.config.ts CHANGED
@@ -1,13 +1,36 @@
1
1
  import { nxComponentTestingPreset } from '@nx/react/plugins/component-testing';
2
2
  import { defineConfig } from 'cypress';
3
3
 
4
+ // @ts-expect-error __filename is available in Node CJS context where Cypress runs
5
+ const filename: string = __filename;
6
+
7
+ const preset = nxComponentTestingPreset(filename, {
8
+ bundler: 'vite',
9
+ buildTarget: '@mapcomponents/three:build',
10
+ });
11
+
4
12
  export default defineConfig({
5
13
  component: {
6
- ...nxComponentTestingPreset(__filename, {
7
- bundler: 'vite',
8
- buildTarget: '@mapcomponents/three:build',
9
- }),
14
+ ...preset,
10
15
  supportFile: 'src/cypress/support/component.ts',
11
16
  indexHtmlFile: 'src/cypress/support/component-index.html',
17
+ setupNodeEvents(on) {
18
+ on('before:browser:launch', (browser, launchOptions) => {
19
+ if (browser.family === 'chromium') {
20
+ launchOptions.args.push('--use-gl=angle');
21
+ launchOptions.args.push('--use-angle=swiftshader');
22
+ launchOptions.args.push('--ignore-gpu-blocklist');
23
+ launchOptions.args.push('--disable-gpu-sandbox');
24
+ launchOptions.args.push('--enable-webgl');
25
+ }
26
+ if (browser.name === 'electron') {
27
+ launchOptions.preferences.webPreferences = {
28
+ ...launchOptions.preferences.webPreferences,
29
+ webgl: true,
30
+ };
31
+ }
32
+ return launchOptions;
33
+ });
34
+ },
12
35
  },
13
36
  });
@@ -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
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"MlThreeGizmo.d.ts","sourceRoot":"","sources":["../../src/components/MlThreeGizmo.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,iBAAiB;IACjC,MAAM,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IACxB,IAAI,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC;CAClD;AAED,QAAA,MAAM,YAAY,GAAI,OAAO,iBAAiB,SA+F7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"MlThreeGizmo.d.ts","sourceRoot":"","sources":["../../src/components/MlThreeGizmo.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,iBAAiB;IACjC,MAAM,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IACxB,IAAI,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC;CAClD;AAED,QAAA,MAAM,YAAY,GAAI,OAAO,iBAAiB,SA8F7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ThreeProvider.d.ts","sourceRoot":"","sources":["../../src/contexts/ThreeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,UAAU,EAAwB,MAAM,aAAa,CAAC;AAM/D,MAAM,WAAW,kBAAkB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA4HtD,CAAC"}
1
+ {"version":3,"file":"ThreeProvider.d.ts","sourceRoot":"","sources":["../../src/contexts/ThreeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,UAAU,EAAwB,MAAM,aAAa,CAAC;AAM/D,MAAM,WAAW,kBAAkB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA2HtD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/cypress/support/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,YAAY,CAAC;AAEpB,OAAO,CAAC,MAAM,CAAC;IAEd,UAAU,OAAO,CAAC;QACjB,UAAU,SAAS;YAClB,KAAK,EAAE,OAAO,KAAK,CAAC;SACpB;KACD;CACD"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/cypress/support/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,YAAY,CAAC;AAapB,OAAO,CAAC,MAAM,CAAC;IAEd,UAAU,OAAO,CAAC;QACjB,UAAU,SAAS;YAClB,KAAK,EAAE,OAAO,KAAK,CAAC;SACpB;KACD;CACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"useThreeModel.d.ts","sourceRoot":"","sources":["../../src/hooks/useThreeModel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,KAAK,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC;IACrD,QAAQ,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,MAAM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