@needle-tools/engine 4.16.5-next.c1731f4 → 4.16.6

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 (58) hide show
  1. package/dist/gltf-progressive-BacJPTD6.umd.cjs +10 -0
  2. package/dist/gltf-progressive-BmXoz_HR.min.js +10 -0
  3. package/dist/gltf-progressive-CzxjNmG6.js +1537 -0
  4. package/dist/loader.worker-BqODMeeW.js +23 -0
  5. package/dist/{materialx-DQ6OMWe8.js → materialx-BgYphGV9.js} +7 -6
  6. package/dist/{materialx-C3cdjbh7.umd.cjs → materialx-Dk-cjpFv.umd.cjs} +1 -1
  7. package/dist/{materialx-DwkZECrV.min.js → materialx-bmTetdSz.min.js} +1 -1
  8. package/dist/{needle-engine.bundle-CccTL32C.js → needle-engine.bundle-BN_X4iTv.js} +2495 -2456
  9. package/dist/{needle-engine.bundle-DXd0yCBg.umd.cjs → needle-engine.bundle-D-slQEcs.umd.cjs} +152 -152
  10. package/dist/{needle-engine.bundle-XVF9W1_-.min.js → needle-engine.bundle-DY-lNV9M.min.js} +121 -121
  11. package/dist/needle-engine.d.ts +193 -102
  12. package/dist/needle-engine.js +3 -3
  13. package/dist/needle-engine.min.js +1 -1
  14. package/dist/needle-engine.umd.cjs +1 -1
  15. package/dist/three-examples.js +4643 -3294
  16. package/dist/three-examples.min.js +47 -13
  17. package/dist/three-examples.umd.cjs +46 -12
  18. package/dist/three.js +15999 -24892
  19. package/dist/three.min.js +214 -214
  20. package/dist/three.umd.cjs +208 -208
  21. package/dist/{vendor-CQMI3jTS.js → vendor-BsRxp-FT.js} +901 -862
  22. package/dist/{vendor-CipoooTV.umd.cjs → vendor-BwxpsdCm.umd.cjs} +20 -20
  23. package/dist/{vendor-BPp9F5vR.min.js → vendor-DZ45lcA8.min.js} +19 -19
  24. package/lib/engine/engine_application.d.ts +0 -9
  25. package/lib/engine/engine_application.js.map +1 -1
  26. package/lib/engine/engine_feature_flags.d.ts +3 -3
  27. package/lib/engine/engine_feature_flags.js +5 -3
  28. package/lib/engine/engine_feature_flags.js.map +1 -1
  29. package/lib/engine/engine_modules.d.ts +30 -26
  30. package/lib/engine/engine_modules.js +103 -32
  31. package/lib/engine/engine_modules.js.map +1 -1
  32. package/lib/engine/webcomponents/needle-engine.d.ts +144 -57
  33. package/lib/engine/webcomponents/needle-engine.js +10 -1
  34. package/lib/engine/webcomponents/needle-engine.js.map +1 -1
  35. package/lib/engine-components/postprocessing/PostProcessingHandler.js +1 -1
  36. package/lib/engine-components/postprocessing/PostProcessingHandler.js.map +1 -1
  37. package/package.json +2 -4
  38. package/plugins/next/meshbvhworker.cjs +19 -0
  39. package/plugins/next/next.js +4 -34
  40. package/plugins/vite/alias.d.ts +1 -1
  41. package/plugins/vite/alias.js +82 -87
  42. package/plugins/vite/build-pipeline.js +3 -4
  43. package/plugins/vite/dependencies.js +5 -7
  44. package/plugins/vite/drop.js +8 -6
  45. package/plugins/vite/editor-connection.js +1 -2
  46. package/plugins/vite/poster.js +1 -2
  47. package/plugins/vite/reload.js +2 -7
  48. package/plugins/vite/transform-codegen.js +2 -6
  49. package/src/engine/engine_application.ts +0 -10
  50. package/src/engine/engine_feature_flags.ts +7 -3
  51. package/src/engine/engine_modules.ts +101 -39
  52. package/src/engine/webcomponents/needle-engine.ts +189 -59
  53. package/src/engine-components/postprocessing/PostProcessingHandler.ts +1 -1
  54. package/dist/gltf-progressive-BJ9OrddA.js +0 -28272
  55. package/dist/gltf-progressive-Ck_bXBr_.umd.cjs +0 -4022
  56. package/dist/gltf-progressive-CqZYu6Hx.min.js +0 -4022
  57. package/dist/loader.worker-CCrD-Ycm.js +0 -3
  58. package/plugins/next/meshbvhworker-import.cjs +0 -40
@@ -1,40 +0,0 @@
1
-
2
- // Transforms GenerateMeshBVHWorker.js to replace the bare package specifier
3
- // in `new URL('three-mesh-bvh/...', import.meta.url)` with a resolved relative path.
4
- // Webpack 5 supports the `new Worker(new URL('./relative.js', import.meta.url))` pattern
5
- // natively and will bundle the worker with all its dependencies as a separate chunk.
6
- // We also prepend a `self.window = self` shim to handle three.js referencing `window`
7
- // in a worker context.
8
-
9
- const path = require('path');
10
-
11
- /**
12
- * @param {string} source
13
- */
14
- module.exports = function (source) {
15
- if (source.includes("Modified by Needle")) return source;
16
- console.log("Transform GenerateMeshBVHWorker import");
17
-
18
- // Resolve the actual file path of the worker
19
- let workerPath;
20
- try {
21
- workerPath = require.resolve('three-mesh-bvh/src/workers/generateMeshBVH.worker.js');
22
- } catch {
23
- console.warn("Could not resolve three-mesh-bvh worker path, skipping transform");
24
- return source;
25
- }
26
-
27
- // Make it relative to the source file being transformed
28
- const sourceDir = path.dirname(this.resourcePath);
29
- let relativePath = path.relative(sourceDir, workerPath).replace(/\\/g, '/');
30
- if (!relativePath.startsWith('.')) relativePath = './' + relativePath;
31
-
32
- // Replace the bare package specifier with the relative path.
33
- // Webpack 5 will detect `new Worker(new URL(..., import.meta.url))` and bundle it correctly.
34
- source = source.replace(
35
- `'three-mesh-bvh/src/workers/generateMeshBVH.worker.js'`,
36
- `'${relativePath}'`
37
- );
38
-
39
- return `// Modified by Needle\n${source}`;
40
- };