@mappedin/mappedin-js 6.0.1-beta.42 → 6.0.1-beta.44

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 (36) hide show
  1. package/README.md +74 -0
  2. package/THIRD_PARTY_LICENSES.txt +5675 -2451
  3. package/lib/esm/{GLTFExporter-YKSUDH7B.js → GLTFExporter-4THLS4PM.js} +1 -1
  4. package/lib/esm/{GLTFLoader-EHCGUUZ7.js → GLTFLoader-KOQIUT25.js} +1 -1
  5. package/lib/esm/{browser-WIIM7TQK.js → browser-LGW6JLJT.js} +1 -1
  6. package/lib/esm/{chunk-4CCSRLCA.js → chunk-5SY5TZBS.js} +1 -1
  7. package/lib/esm/chunk-A5SAO63E.js +1 -0
  8. package/lib/esm/chunk-KNDTFHOY.js +1 -0
  9. package/lib/esm/chunk-M46A4YQ5.js +1 -0
  10. package/lib/esm/chunk-Q2KR5YO7.js +1 -0
  11. package/lib/esm/{chunk-ECHMMCCK.js → chunk-QO7JQA7V.js} +1 -1
  12. package/lib/esm/chunk-XGYIT3MM.js +1 -0
  13. package/lib/esm/index.css +1 -1
  14. package/lib/esm/index.d.ts +2081 -832
  15. package/lib/esm/index.js +1 -1
  16. package/lib/esm/inspector-GOK26VAV.css +1 -0
  17. package/lib/esm/{inspector-ZDG5OPVJ.js → inspector-KJE2KP6V.js} +1 -1
  18. package/lib/esm/internal-7A3UJNAV.css +1 -0
  19. package/lib/esm/{internal-ZMA7M4I6.js → internal-RS3PVAR3.js} +1 -1
  20. package/lib/esm/outdoor-context-v4-6CUOE2HW.js +1 -0
  21. package/lib/esm/{roboto-regular-E2V4PXOH.js → roboto-regular-PKVZDOB2.js} +1 -1
  22. package/lib/esm/text3d-QIM5QGO6.js +1 -0
  23. package/lib/esm/workers/collision-worker.csp.js +1 -0
  24. package/lib/esm/workers/maplibre-worker.csp.js +1 -0
  25. package/lib/index.css +1 -1
  26. package/package.json +2 -2
  27. package/lib/esm/chunk-DDM2BPE5.js +0 -1
  28. package/lib/esm/chunk-GQSDOUZP.js +0 -1
  29. package/lib/esm/chunk-HALSTKAB.js +0 -1
  30. package/lib/esm/chunk-LDGPSNHO.js +0 -1
  31. package/lib/esm/chunk-OZP63OFH.js +0 -1
  32. package/lib/esm/inspector-D2RCHDOY.css +0 -1
  33. package/lib/esm/internal-55777EMI.css +0 -1
  34. package/lib/esm/outdoor-context-v4-HKUDARND.js +0 -1
  35. package/lib/esm/text3d-4TF6HI7P.js +0 -1
  36. package/lib/esm/text3d-Q7FFP3YS.css +0 -1
package/README.md CHANGED
@@ -43,3 +43,77 @@ init();
43
43
  ```
44
44
 
45
45
  For full documentation, read our [Getting Started guide on the Developer Portal](https://developer.mappedin.com/web-sdk/getting-started).
46
+
47
+ ### Content Security Policy (CSP) Support
48
+
49
+ The SDK provides solutions for applications that use a strict Content Security Policy.
50
+
51
+ #### Web Worker CSP Solution
52
+
53
+ If your CSP blocks `blob:` URLs or `unsafe-eval` directives (affecting web workers), you can host worker scripts externally:
54
+
55
+ ```javascript
56
+ import { setWorkerUrl } from '@mappedin/mappedin-js';
57
+
58
+ // Call this before initializing any maps
59
+ setWorkerUrl('/path/to/workers');
60
+ ```
61
+
62
+ This function configures both the MapLibre and collision detection workers to load from external URLs. To set this up:
63
+
64
+ 1. Copy the worker files from `node_modules/@mappedin/mappedin-js/lib/esm/workers/` to your web server
65
+ 2. Call `setWorkerUrl` with the base URL path to these files
66
+ 3. Ensure your CSP allows scripts from this location
67
+
68
+ Example in a build script:
69
+ ```bash
70
+ # Copy worker files to your public directory
71
+ cp -r node_modules/@mappedin/mappedin-js/lib/esm/workers ./public/mappedin-workers
72
+ ```
73
+
74
+ ```javascript
75
+ // In your JavaScript
76
+ setWorkerUrl('/mappedin-workers');
77
+ ```
78
+
79
+ #### CSS Injection CSP Solution
80
+
81
+ If your CSP blocks inline styles (`style-src 'unsafe-inline'`), use external CSS loading instead:
82
+
83
+ 1. Load the SDK's CSS with a `<link>` tag in your HTML
84
+ 2. Disable automatic style injection in `show3dMap` options
85
+
86
+ ```html
87
+ <!-- In your HTML file -->
88
+ <link rel="stylesheet" href="/path/to/mappedin-js/index.css">
89
+ ```
90
+
91
+ ```javascript
92
+ // In your JavaScript
93
+ const mapView = await show3dMap(element, venue, {
94
+ injectStyles: false, // Disable automatic style injection
95
+ });
96
+ ```
97
+
98
+ For your build process:
99
+ ```bash
100
+ # Copy CSS file to your public directory
101
+ cp node_modules/@mappedin/mappedin-js/lib/index.css ./public/
102
+ ```
103
+
104
+ #### Text3D Worker CSP Solution (Optional)
105
+
106
+ If you use Text3D features (like `labelAll()`) in a CSP-restricted environment, you'll need to disable the Text3D worker if you don't want see error message:
107
+
108
+ ```javascript
109
+ import { disableText3DWorker } from '@mappedin/mappedin-js';
110
+ // After initializing your map
111
+ disableText3DWorker();
112
+
113
+ // Now you can use Text3D features without errors or warnings
114
+ mapView.Text3D.labelAll();
115
+ ```
116
+
117
+ This disables the worker and processes text on the main thread instead, allowing Text3D to work in CSP environments that block worker creation.
118
+
119
+ You can apply any combination of these solutions based on your specific CSP restrictions and SDK feature usage.