@needle-tools/engine 5.1.0-canary.db0c38f → 5.1.0-canary.e6680fa

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 (381) hide show
  1. package/.needle/generated/needle-bindings.gen.d.ts +5 -0
  2. package/CHANGELOG.md +133 -1
  3. package/SKILL.md +4 -1
  4. package/components.needle.json +1 -1
  5. package/dist/needle-engine.bundle-Bl_hyH5G.umd.cjs +1734 -0
  6. package/dist/needle-engine.bundle-Cduc1gj6.min.js +1734 -0
  7. package/dist/{needle-engine.bundle-B29kieh0.js → needle-engine.bundle-DNcqT8nJ.js} +13770 -12741
  8. package/dist/needle-engine.d.ts +1628 -402
  9. package/dist/needle-engine.js +591 -586
  10. package/dist/needle-engine.min.js +1 -1
  11. package/dist/needle-engine.umd.cjs +1 -1
  12. package/dist/three.js +1 -0
  13. package/dist/three.min.js +21 -21
  14. package/dist/three.umd.cjs +16 -16
  15. package/lib/engine/api.d.ts +9 -2
  16. package/lib/engine/api.js +7 -1
  17. package/lib/engine/api.js.map +1 -1
  18. package/lib/engine/codegen/register_types.js +10 -18
  19. package/lib/engine/codegen/register_types.js.map +1 -1
  20. package/lib/engine/debug/debug_spatial_console.d.ts +2 -0
  21. package/lib/engine/debug/debug_spatial_console.js +10 -7
  22. package/lib/engine/debug/debug_spatial_console.js.map +1 -1
  23. package/lib/engine/engine_addressables.d.ts +2 -0
  24. package/lib/engine/engine_addressables.js +6 -3
  25. package/lib/engine/engine_addressables.js.map +1 -1
  26. package/lib/engine/engine_audio.d.ts +68 -0
  27. package/lib/engine/engine_audio.js +172 -0
  28. package/lib/engine/engine_audio.js.map +1 -1
  29. package/lib/engine/engine_camera.fit.js +16 -4
  30. package/lib/engine/engine_camera.fit.js.map +1 -1
  31. package/lib/engine/engine_components.js +1 -1
  32. package/lib/engine/engine_components.js.map +1 -1
  33. package/lib/engine/engine_context.d.ts +41 -27
  34. package/lib/engine/engine_context.js +71 -30
  35. package/lib/engine/engine_context.js.map +1 -1
  36. package/lib/engine/engine_context_eventbus.d.ts +47 -0
  37. package/lib/engine/engine_context_eventbus.js +47 -0
  38. package/lib/engine/engine_context_eventbus.js.map +1 -0
  39. package/lib/engine/engine_disposable.d.ts +172 -0
  40. package/lib/engine/engine_disposable.js +136 -0
  41. package/lib/engine/engine_disposable.js.map +1 -0
  42. package/lib/engine/engine_gameobject.d.ts +1 -10
  43. package/lib/engine/engine_gameobject.js +22 -120
  44. package/lib/engine/engine_gameobject.js.map +1 -1
  45. package/lib/engine/engine_gltf_builtin_components.js +7 -69
  46. package/lib/engine/engine_gltf_builtin_components.js.map +1 -1
  47. package/lib/engine/engine_init.js +16 -1
  48. package/lib/engine/engine_init.js.map +1 -1
  49. package/lib/engine/engine_input.d.ts +24 -5
  50. package/lib/engine/engine_input.js +3 -2
  51. package/lib/engine/engine_input.js.map +1 -1
  52. package/lib/engine/engine_instantiate_resolve.d.ts +42 -0
  53. package/lib/engine/engine_instantiate_resolve.js +372 -0
  54. package/lib/engine/engine_instantiate_resolve.js.map +1 -0
  55. package/lib/engine/engine_license.d.ts +8 -6
  56. package/lib/engine/engine_license.js +195 -59
  57. package/lib/engine/engine_license.js.map +1 -1
  58. package/lib/engine/engine_lifecycle_functions_internal.js +5 -0
  59. package/lib/engine/engine_lifecycle_functions_internal.js.map +1 -1
  60. package/lib/engine/engine_mainloop_utils.js +7 -4
  61. package/lib/engine/engine_mainloop_utils.js.map +1 -1
  62. package/lib/engine/engine_networking.d.ts +51 -37
  63. package/lib/engine/engine_networking.js +132 -82
  64. package/lib/engine/engine_networking.js.map +1 -1
  65. package/lib/engine/engine_networking.transport.websocket.d.ts +15 -0
  66. package/lib/engine/engine_networking.transport.websocket.js +38 -0
  67. package/lib/engine/engine_networking.transport.websocket.js.map +1 -0
  68. package/lib/engine/engine_networking_blob.js +4 -4
  69. package/lib/engine/engine_networking_blob.js.map +1 -1
  70. package/lib/engine/engine_networking_instantiate.js +2 -2
  71. package/lib/engine/engine_networking_instantiate.js.map +1 -1
  72. package/lib/engine/engine_networking_types.d.ts +39 -1
  73. package/lib/engine/engine_networking_types.js +7 -0
  74. package/lib/engine/engine_networking_types.js.map +1 -1
  75. package/lib/engine/engine_physics_rapier.d.ts +21 -3
  76. package/lib/engine/engine_physics_rapier.js +94 -25
  77. package/lib/engine/engine_physics_rapier.js.map +1 -1
  78. package/lib/engine/engine_pmrem.js +53 -5
  79. package/lib/engine/engine_pmrem.js.map +1 -1
  80. package/lib/engine/engine_scenedata.d.ts +13 -17
  81. package/lib/engine/engine_scenedata.js +58 -31
  82. package/lib/engine/engine_scenedata.js.map +1 -1
  83. package/lib/engine/engine_serialization_builtin_serializer.d.ts +10 -16
  84. package/lib/engine/engine_serialization_builtin_serializer.js +56 -46
  85. package/lib/engine/engine_serialization_builtin_serializer.js.map +1 -1
  86. package/lib/engine/engine_serialization_core.d.ts +1 -0
  87. package/lib/engine/engine_serialization_core.js +7 -0
  88. package/lib/engine/engine_serialization_core.js.map +1 -1
  89. package/lib/engine/engine_ssr.d.ts +2 -0
  90. package/lib/engine/engine_ssr.js +20 -0
  91. package/lib/engine/engine_ssr.js.map +1 -1
  92. package/lib/engine/engine_types.d.ts +31 -11
  93. package/lib/engine/engine_types.js +1 -1
  94. package/lib/engine/engine_types.js.map +1 -1
  95. package/lib/engine/engine_util_decorator.js +7 -2
  96. package/lib/engine/engine_util_decorator.js.map +1 -1
  97. package/lib/engine/engine_utils.d.ts +1 -1
  98. package/lib/engine/engine_utils.js +19 -5
  99. package/lib/engine/engine_utils.js.map +1 -1
  100. package/lib/engine/engine_utils_format.js +20 -14
  101. package/lib/engine/engine_utils_format.js.map +1 -1
  102. package/lib/engine/engine_utils_qrcode.js +2 -2
  103. package/lib/engine/engine_utils_qrcode.js.map +1 -1
  104. package/lib/engine/physics/workers/mesh-bvh/GenerateMeshBVHWorker.js +1 -1
  105. package/lib/engine/physics/workers/mesh-bvh/GenerateMeshBVHWorker.js.map +1 -1
  106. package/lib/engine/webcomponents/jsx.d.ts +51 -0
  107. package/lib/engine/webcomponents/logo-element.js.map +1 -1
  108. package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js +2 -2
  109. package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js.map +1 -1
  110. package/lib/engine/webcomponents/needle menu/needle-menu.d.ts +3 -4
  111. package/lib/engine/webcomponents/needle menu/needle-menu.js +6 -6
  112. package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
  113. package/lib/engine/webcomponents/needle-button.js.map +1 -1
  114. package/lib/engine/webcomponents/needle-engine.d.ts +10 -4
  115. package/lib/engine/webcomponents/needle-engine.js +3 -3
  116. package/lib/engine/webcomponents/needle-engine.js.map +1 -1
  117. package/lib/engine/webcomponents/needle-engine.loading.js +2 -2
  118. package/lib/engine/webcomponents/needle-engine.loading.js.map +1 -1
  119. package/lib/engine/xr/NeedleXRSession.d.ts +3 -2
  120. package/lib/engine/xr/NeedleXRSession.js +50 -14
  121. package/lib/engine/xr/NeedleXRSession.js.map +1 -1
  122. package/lib/engine/xr/TempXRContext.js +2 -2
  123. package/lib/engine/xr/TempXRContext.js.map +1 -1
  124. package/lib/engine/xr/events.d.ts +1 -1
  125. package/lib/engine/xr/events.js.map +1 -1
  126. package/lib/engine-components/Animation.js +17 -16
  127. package/lib/engine-components/Animation.js.map +1 -1
  128. package/lib/engine-components/AnimationBuilder.d.ts +158 -0
  129. package/lib/engine-components/AnimationBuilder.js +305 -0
  130. package/lib/engine-components/AnimationBuilder.js.map +1 -0
  131. package/lib/engine-components/Animator.d.ts +6 -0
  132. package/lib/engine-components/Animator.js +23 -13
  133. package/lib/engine-components/Animator.js.map +1 -1
  134. package/lib/engine-components/AnimatorController.builder.d.ts +191 -0
  135. package/lib/engine-components/AnimatorController.builder.js +263 -0
  136. package/lib/engine-components/AnimatorController.builder.js.map +1 -0
  137. package/lib/engine-components/AnimatorController.d.ts +4 -119
  138. package/lib/engine-components/AnimatorController.js +37 -233
  139. package/lib/engine-components/AnimatorController.js.map +1 -1
  140. package/lib/engine-components/AudioSource.d.ts +19 -3
  141. package/lib/engine-components/AudioSource.js +121 -68
  142. package/lib/engine-components/AudioSource.js.map +1 -1
  143. package/lib/engine-components/Camera.d.ts +6 -1
  144. package/lib/engine-components/Camera.js +16 -3
  145. package/lib/engine-components/Camera.js.map +1 -1
  146. package/lib/engine-components/CameraUtils.js +14 -6
  147. package/lib/engine-components/CameraUtils.js.map +1 -1
  148. package/lib/engine-components/Collider.d.ts +18 -9
  149. package/lib/engine-components/Collider.js +61 -14
  150. package/lib/engine-components/Collider.js.map +1 -1
  151. package/lib/engine-components/Component.d.ts +72 -9
  152. package/lib/engine-components/Component.js +114 -10
  153. package/lib/engine-components/Component.js.map +1 -1
  154. package/lib/engine-components/ContactShadows.d.ts +1 -0
  155. package/lib/engine-components/ContactShadows.js +14 -1
  156. package/lib/engine-components/ContactShadows.js.map +1 -1
  157. package/lib/engine-components/DragControls.d.ts +7 -0
  158. package/lib/engine-components/DragControls.js +19 -7
  159. package/lib/engine-components/DragControls.js.map +1 -1
  160. package/lib/engine-components/DropListener.js +4 -0
  161. package/lib/engine-components/DropListener.js.map +1 -1
  162. package/lib/engine-components/EventList.d.ts +31 -9
  163. package/lib/engine-components/EventList.js +37 -76
  164. package/lib/engine-components/EventList.js.map +1 -1
  165. package/lib/engine-components/Joints.d.ts +4 -2
  166. package/lib/engine-components/Joints.js +19 -3
  167. package/lib/engine-components/Joints.js.map +1 -1
  168. package/lib/engine-components/Light.d.ts +6 -8
  169. package/lib/engine-components/Light.js +48 -27
  170. package/lib/engine-components/Light.js.map +1 -1
  171. package/lib/engine-components/Networking.d.ts +1 -1
  172. package/lib/engine-components/Networking.js +1 -1
  173. package/lib/engine-components/OrbitControls.d.ts +1 -2
  174. package/lib/engine-components/OrbitControls.js +37 -14
  175. package/lib/engine-components/OrbitControls.js.map +1 -1
  176. package/lib/engine-components/ReflectionProbe.js +2 -0
  177. package/lib/engine-components/ReflectionProbe.js.map +1 -1
  178. package/lib/engine-components/RigidBody.d.ts +12 -4
  179. package/lib/engine-components/RigidBody.js +18 -4
  180. package/lib/engine-components/RigidBody.js.map +1 -1
  181. package/lib/engine-components/SceneSwitcher.js +3 -0
  182. package/lib/engine-components/SceneSwitcher.js.map +1 -1
  183. package/lib/engine-components/SeeThrough.js +2 -2
  184. package/lib/engine-components/SeeThrough.js.map +1 -1
  185. package/lib/engine-components/VideoPlayer.d.ts +8 -2
  186. package/lib/engine-components/VideoPlayer.js +42 -19
  187. package/lib/engine-components/VideoPlayer.js.map +1 -1
  188. package/lib/engine-components/Voip.d.ts +16 -7
  189. package/lib/engine-components/Voip.js +90 -53
  190. package/lib/engine-components/Voip.js.map +1 -1
  191. package/lib/engine-components/api.d.ts +3 -1
  192. package/lib/engine-components/api.js +3 -1
  193. package/lib/engine-components/api.js.map +1 -1
  194. package/lib/engine-components/codegen/components.d.ts +7 -13
  195. package/lib/engine-components/codegen/components.js +7 -13
  196. package/lib/engine-components/codegen/components.js.map +1 -1
  197. package/lib/engine-components/export/usdz/USDZExporter.js +4 -4
  198. package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
  199. package/lib/engine-components/postprocessing/Effects/Tonemapping.utils.d.ts +1 -1
  200. package/lib/engine-components/postprocessing/VolumeParameter.d.ts +2 -0
  201. package/lib/engine-components/postprocessing/VolumeParameter.js +4 -1
  202. package/lib/engine-components/postprocessing/VolumeParameter.js.map +1 -1
  203. package/lib/engine-components/timeline/PlayableDirector.d.ts +21 -11
  204. package/lib/engine-components/timeline/PlayableDirector.js +75 -67
  205. package/lib/engine-components/timeline/PlayableDirector.js.map +1 -1
  206. package/lib/engine-components/timeline/SignalAsset.d.ts +3 -1
  207. package/lib/engine-components/timeline/SignalAsset.js +1 -0
  208. package/lib/engine-components/timeline/SignalAsset.js.map +1 -1
  209. package/lib/engine-components/timeline/TimelineBuilder.d.ts +413 -0
  210. package/lib/engine-components/timeline/TimelineBuilder.js +506 -0
  211. package/lib/engine-components/timeline/TimelineBuilder.js.map +1 -0
  212. package/lib/engine-components/timeline/TimelineModels.d.ts +2 -1
  213. package/lib/engine-components/timeline/TimelineModels.js +3 -0
  214. package/lib/engine-components/timeline/TimelineModels.js.map +1 -1
  215. package/lib/engine-components/timeline/TimelineTracks.d.ts +37 -6
  216. package/lib/engine-components/timeline/TimelineTracks.js +92 -26
  217. package/lib/engine-components/timeline/TimelineTracks.js.map +1 -1
  218. package/lib/engine-components/timeline/index.d.ts +2 -1
  219. package/lib/engine-components/timeline/index.js +2 -0
  220. package/lib/engine-components/timeline/index.js.map +1 -1
  221. package/lib/engine-components/ui/Canvas.d.ts +1 -1
  222. package/lib/engine-components/ui/Canvas.js +2 -8
  223. package/lib/engine-components/ui/Canvas.js.map +1 -1
  224. package/lib/engine-components/ui/Text.d.ts +1 -0
  225. package/lib/engine-components/ui/Text.js +10 -7
  226. package/lib/engine-components/ui/Text.js.map +1 -1
  227. package/lib/engine-components/web/CursorFollow.d.ts +0 -1
  228. package/lib/engine-components/web/CursorFollow.js +21 -13
  229. package/lib/engine-components/web/CursorFollow.js.map +1 -1
  230. package/lib/engine-components/webxr/WebXRImageTracking.d.ts +62 -1
  231. package/lib/engine-components/webxr/WebXRImageTracking.js +59 -2
  232. package/lib/engine-components/webxr/WebXRImageTracking.js.map +1 -1
  233. package/lib/needle-engine.d.ts +2 -0
  234. package/lib/needle-engine.js +2 -0
  235. package/lib/needle-engine.js.map +1 -1
  236. package/package.json +4 -84
  237. package/plugins/common/cloud.js +6 -1
  238. package/plugins/common/license.js +55 -12
  239. package/plugins/common/worker.js +9 -4
  240. package/plugins/dts-generator/dts.codegen.js +255 -50
  241. package/plugins/dts-generator/dts.scan.js +37 -9
  242. package/plugins/dts-generator/dts.writer.js +1 -1
  243. package/plugins/dts-generator/glb.discovery.js +140 -23
  244. package/plugins/dts-generator/glb.extractor.js +48 -8
  245. package/plugins/dts-generator/glb.reader.js +80 -27
  246. package/plugins/dts-generator/index.js +1 -1
  247. package/plugins/types/needle-bindings.d.ts +25 -14
  248. package/plugins/types/userconfig.d.ts +16 -1
  249. package/plugins/vite/asap.js +18 -9
  250. package/plugins/vite/build-pipeline.js +57 -20
  251. package/plugins/vite/dependencies.js +29 -10
  252. package/plugins/vite/dependency-watcher.d.ts +2 -2
  253. package/plugins/vite/dependency-watcher.js +5 -6
  254. package/plugins/vite/drop.d.ts +2 -2
  255. package/plugins/vite/drop.js +3 -4
  256. package/plugins/vite/dts-generator.d.ts +2 -2
  257. package/plugins/vite/dts-generator.js +43 -9
  258. package/plugins/vite/editor-connection.js +3 -3
  259. package/plugins/vite/index.d.ts +9 -3
  260. package/plugins/vite/index.js +23 -10
  261. package/plugins/vite/license.js +42 -7
  262. package/plugins/vite/local-files-core.js +3 -3
  263. package/plugins/vite/local-files-utils.d.ts +3 -1
  264. package/plugins/vite/local-files-utils.js +29 -5
  265. package/plugins/vite/meta.js +4 -2
  266. package/plugins/vite/poster.d.ts +2 -2
  267. package/plugins/vite/poster.js +3 -5
  268. package/plugins/vite/reload.d.ts +2 -2
  269. package/plugins/vite/reload.js +23 -23
  270. package/plugins/vite/server.js +2 -1
  271. package/src/engine/api.ts +12 -2
  272. package/src/engine/codegen/register_types.ts +10 -18
  273. package/src/engine/debug/debug_spatial_console.ts +10 -7
  274. package/src/engine/engine_addressables.ts +6 -3
  275. package/src/engine/engine_audio.ts +184 -0
  276. package/src/engine/engine_camera.fit.ts +15 -4
  277. package/src/engine/engine_components.ts +1 -1
  278. package/src/engine/engine_context.ts +85 -38
  279. package/src/engine/engine_context_eventbus.ts +73 -0
  280. package/src/engine/engine_disposable.ts +214 -0
  281. package/src/engine/engine_gameobject.ts +54 -159
  282. package/src/engine/engine_gltf_builtin_components.ts +7 -76
  283. package/src/engine/engine_init.ts +15 -1
  284. package/src/engine/engine_input.ts +28 -7
  285. package/src/engine/engine_instantiate_resolve.ts +407 -0
  286. package/src/engine/engine_license.ts +209 -61
  287. package/src/engine/engine_lifecycle_functions_internal.ts +7 -0
  288. package/src/engine/engine_mainloop_utils.ts +7 -4
  289. package/src/engine/engine_networking.transport.websocket.ts +45 -0
  290. package/src/engine/engine_networking.ts +161 -137
  291. package/src/engine/engine_networking_blob.ts +4 -4
  292. package/src/engine/engine_networking_instantiate.ts +2 -2
  293. package/src/engine/engine_networking_types.ts +41 -1
  294. package/src/engine/engine_physics_rapier.ts +102 -33
  295. package/src/engine/engine_pmrem.ts +56 -6
  296. package/src/engine/engine_scenedata.ts +56 -30
  297. package/src/engine/engine_serialization_builtin_serializer.ts +64 -52
  298. package/src/engine/engine_serialization_core.ts +9 -0
  299. package/src/engine/engine_ssr.ts +29 -3
  300. package/src/engine/engine_types.ts +48 -27
  301. package/src/engine/engine_util_decorator.ts +7 -2
  302. package/src/engine/engine_utils.ts +16 -5
  303. package/src/engine/engine_utils_format.ts +20 -14
  304. package/src/engine/engine_utils_qrcode.ts +2 -2
  305. package/src/engine/physics/workers/mesh-bvh/GenerateMeshBVHWorker.js +1 -1
  306. package/src/engine/webcomponents/jsx.d.ts +51 -0
  307. package/src/engine/webcomponents/logo-element.ts +1 -0
  308. package/src/engine/webcomponents/needle menu/needle-menu-spatial.ts +2 -2
  309. package/src/engine/webcomponents/needle menu/needle-menu.ts +8 -7
  310. package/src/engine/webcomponents/needle-button.ts +1 -0
  311. package/src/engine/webcomponents/needle-engine.loading.ts +6 -6
  312. package/src/engine/webcomponents/needle-engine.ts +13 -6
  313. package/src/engine/xr/NeedleXRSession.ts +48 -13
  314. package/src/engine/xr/TempXRContext.ts +2 -2
  315. package/src/engine/xr/events.ts +1 -1
  316. package/src/engine-components/Animation.ts +19 -16
  317. package/src/engine-components/AnimationBuilder.ts +472 -0
  318. package/src/engine-components/Animator.ts +24 -12
  319. package/src/engine-components/AnimatorController.builder.ts +387 -0
  320. package/src/engine-components/AnimatorController.ts +24 -292
  321. package/src/engine-components/AudioSource.ts +130 -79
  322. package/src/engine-components/Camera.ts +16 -3
  323. package/src/engine-components/CameraUtils.ts +12 -5
  324. package/src/engine-components/Collider.ts +66 -18
  325. package/src/engine-components/Component.ts +118 -20
  326. package/src/engine-components/ContactShadows.ts +15 -1
  327. package/src/engine-components/DragControls.ts +18 -11
  328. package/src/engine-components/DropListener.ts +4 -0
  329. package/src/engine-components/EventList.ts +45 -83
  330. package/src/engine-components/Joints.ts +20 -4
  331. package/src/engine-components/Light.ts +49 -27
  332. package/src/engine-components/Networking.ts +1 -1
  333. package/src/engine-components/OrbitControls.ts +42 -16
  334. package/src/engine-components/ReflectionProbe.ts +2 -0
  335. package/src/engine-components/RigidBody.ts +18 -4
  336. package/src/engine-components/SceneSwitcher.ts +3 -0
  337. package/src/engine-components/SeeThrough.ts +2 -2
  338. package/src/engine-components/VideoPlayer.ts +40 -17
  339. package/src/engine-components/Voip.ts +88 -53
  340. package/src/engine-components/api.ts +3 -1
  341. package/src/engine-components/codegen/components.ts +7 -13
  342. package/src/engine-components/export/usdz/USDZExporter.ts +4 -4
  343. package/src/engine-components/postprocessing/VolumeParameter.ts +4 -1
  344. package/src/engine-components/timeline/PlayableDirector.ts +83 -81
  345. package/src/engine-components/timeline/SignalAsset.ts +4 -1
  346. package/src/engine-components/timeline/TimelineBuilder.ts +824 -0
  347. package/src/engine-components/timeline/TimelineModels.ts +5 -1
  348. package/src/engine-components/timeline/TimelineTracks.ts +96 -27
  349. package/src/engine-components/timeline/index.ts +2 -1
  350. package/src/engine-components/ui/Canvas.ts +2 -8
  351. package/src/engine-components/ui/Text.ts +12 -8
  352. package/src/engine-components/web/CursorFollow.ts +21 -14
  353. package/src/engine-components/webxr/WebXRImageTracking.ts +79 -7
  354. package/src/needle-engine.ts +3 -0
  355. package/dist/needle-engine.bundle-Dq0Ly8fW.umd.cjs +0 -1732
  356. package/dist/needle-engine.bundle-YnpzzOPL.min.js +0 -1732
  357. package/lib/engine-components/AvatarLoader.d.ts +0 -80
  358. package/lib/engine-components/AvatarLoader.js +0 -232
  359. package/lib/engine-components/AvatarLoader.js.map +0 -1
  360. package/lib/engine-components/avatar/AvatarBlink_Simple.d.ts +0 -11
  361. package/lib/engine-components/avatar/AvatarBlink_Simple.js +0 -77
  362. package/lib/engine-components/avatar/AvatarBlink_Simple.js.map +0 -1
  363. package/lib/engine-components/avatar/AvatarEyeLook_Rotation.d.ts +0 -14
  364. package/lib/engine-components/avatar/AvatarEyeLook_Rotation.js +0 -69
  365. package/lib/engine-components/avatar/AvatarEyeLook_Rotation.js.map +0 -1
  366. package/lib/engine-components/avatar/Avatar_Brain_LookAt.d.ts +0 -29
  367. package/lib/engine-components/avatar/Avatar_Brain_LookAt.js +0 -122
  368. package/lib/engine-components/avatar/Avatar_Brain_LookAt.js.map +0 -1
  369. package/lib/engine-components/avatar/Avatar_MouthShapes.d.ts +0 -15
  370. package/lib/engine-components/avatar/Avatar_MouthShapes.js +0 -80
  371. package/lib/engine-components/avatar/Avatar_MouthShapes.js.map +0 -1
  372. package/lib/engine-components/avatar/Avatar_MustacheShake.d.ts +0 -9
  373. package/lib/engine-components/avatar/Avatar_MustacheShake.js +0 -30
  374. package/lib/engine-components/avatar/Avatar_MustacheShake.js.map +0 -1
  375. package/src/engine-components/AvatarLoader.ts +0 -264
  376. package/src/engine-components/avatar/AvatarBlink_Simple.ts +0 -70
  377. package/src/engine-components/avatar/AvatarEyeLook_Rotation.ts +0 -64
  378. package/src/engine-components/avatar/Avatar_Brain_LookAt.ts +0 -140
  379. package/src/engine-components/avatar/Avatar_MouthShapes.ts +0 -84
  380. package/src/engine-components/avatar/Avatar_MustacheShake.ts +0 -32
  381. package/src/vite-env.d.ts +0 -16
@@ -207,6 +207,15 @@ export interface ISerializable {
207
207
  onAfterDeserialize?(data: any, context: SerializationContext): void;
208
208
  };
209
209
 
210
+ export function isSerializable(obj: any): obj is ISerializable {
211
+ return obj && typeof obj === "object" && (
212
+ typeof obj.$serializedTypes === "object" ||
213
+ typeof obj.onBeforeDeserialize === "function" ||
214
+ typeof obj.onBeforeDeserializeMember === "function" ||
215
+ typeof obj.onAfterDeserializeMember === "function" ||
216
+ typeof obj.onAfterDeserialize === "function"
217
+ )
218
+ }
210
219
 
211
220
  export function serializeObject(obj: ISerializable, context: SerializationContext): object | null {
212
221
  const types = obj.$serializedTypes;
@@ -9,14 +9,40 @@
9
9
  * to a plain empty class so that `class Foo extends HTMLElementBase` is valid.
10
10
  */
11
11
 
12
+
13
+ /** True when running in an SSR/Node environment (no browser globals). */
14
+ export const SSR: boolean = typeof window === "undefined";
15
+
12
16
  /** SSR-safe base class for web components. */
13
17
  export const HTMLElementBase: typeof HTMLElement =
14
- typeof HTMLElement !== "undefined" ? HTMLElement : (class {} as unknown as typeof HTMLElement);
18
+ typeof HTMLElement !== "undefined" ? HTMLElement : (class { } as unknown as typeof HTMLElement);
15
19
 
16
20
  /** SSR-safe base class for pointer events. */
17
21
  export const PointerEventBase: typeof PointerEvent =
18
- typeof PointerEvent !== "undefined" ? PointerEvent : (class {} as unknown as typeof PointerEvent);
22
+ typeof PointerEvent !== "undefined" ? PointerEvent : (class { } as unknown as typeof PointerEvent);
19
23
 
20
24
  /** SSR-safe base class for keyboard events. */
21
25
  export const KeyboardEventBase: typeof KeyboardEvent =
22
- typeof KeyboardEvent !== "undefined" ? KeyboardEvent : (class {} as unknown as typeof KeyboardEvent);
26
+ typeof KeyboardEvent !== "undefined" ? KeyboardEvent : (class { } as unknown as typeof KeyboardEvent);
27
+
28
+
29
+
30
+
31
+ // #region minimal polyfills
32
+ // Three.js FileLoader uses ProgressEvent in fetch stream callbacks.
33
+ // It doesn't exist in Node — install a minimal stub so SSR doesn't crash.
34
+ if (typeof globalThis.ProgressEvent === "undefined") {
35
+ (globalThis as any).ProgressEvent = class ProgressEvent {
36
+ readonly type: string;
37
+ readonly lengthComputable: boolean;
38
+ readonly loaded: number;
39
+ readonly total: number;
40
+ constructor(type: string, init?: { lengthComputable?: boolean; loaded?: number; total?: number }) {
41
+ this.type = type;
42
+ this.lengthComputable = init?.lengthComputable ?? false;
43
+ this.loaded = init?.loaded ?? 0;
44
+ this.total = init?.total ?? 0;
45
+ }
46
+ };
47
+ }
48
+ // #endregion
@@ -5,7 +5,6 @@ import { type GLTF as THREE_GLTF } from "three/examples/jsm/loaders/GLTFLoader.j
5
5
 
6
6
  import type { Camera as CameraComponent } from "../engine-components/api.js";
7
7
  import type { Context } from "./engine_context.js";
8
- import { InstantiateContext } from "./engine_gameobject.js";
9
8
  import { CollisionDetectionMode, type PhysicsMaterial, RigidbodyConstraints } from "./engine_physics.types.js";
10
9
  import { CircularBuffer } from "./engine_utils.js";
11
10
  import type { NeedleXRSession } from "./engine_xr.js";
@@ -196,13 +195,11 @@ export interface IComponent extends IHasGuid {
196
195
  /** @internal */
197
196
  __internalStart();
198
197
  /** @internal */
199
- __internalEnable(isAddingOrRemovingFromScene?: boolean);
198
+ __internalEnable(isHierarchyChange?: boolean);
200
199
  /** @internal */
201
- __internalDisable(isAddingOrRemovingFromScene?: boolean);
200
+ __internalDisable(isHierarchyChange?: boolean);
202
201
  /** @internal */
203
202
  __internalDestroy();
204
- /** @internal */
205
- resolveGuids?(guidsMap: GuidsMap): void;
206
203
 
207
204
  /** experimental, called when the script is registered for the first time, this is called even if the component is not enabled. */
208
205
  registering?();
@@ -240,14 +237,14 @@ export interface IComponent extends IHasGuid {
240
237
  }
241
238
 
242
239
  export function isComponent(obj: any): obj is IComponent {
243
- return obj && obj.isComponent;
240
+ return obj && typeof obj === "object" && obj.isComponent;
244
241
  }
245
242
 
246
243
  export type ICamera = CameraComponent;
247
244
 
248
245
  export type IAnimationComponent = Pick<IComponent, "gameObject"> & {
249
246
  isAnimationComponent: boolean;
250
- addClip?(clip: AnimationClip);
247
+ addClip?(clip: AnimationClip): void;
251
248
  }
252
249
 
253
250
  /** Interface for a camera controller component that can be attached to a camera to control it */
@@ -258,6 +255,8 @@ export declare interface ICameraController {
258
255
  export declare interface ILight extends IComponent {
259
256
  intensity: number;
260
257
  color: Color;
258
+ /** The type of light as a lowercase string: `"directional"`, `"point"`, `"spot"` */
259
+ readonly type: "directional" | "point" | "spot";
261
260
  }
262
261
 
263
262
  export declare interface ISharedMaterials {
@@ -272,7 +271,10 @@ export declare interface IRenderer extends IComponent {
272
271
 
273
272
  export declare interface IEventList {
274
273
  readonly isEventList: true;
275
- __internalOnInstantiate(map: InstantiateContext): IEventList;
274
+ }
275
+
276
+ export declare interface ISignalReceiver {
277
+ readonly isSignalReceiver: true;
276
278
  }
277
279
 
278
280
  // export declare interface IPhysicsComponent extends IComponent {
@@ -300,12 +302,18 @@ export declare interface ICollider extends IComponent {
300
302
  * Default: [0]
301
303
  */
302
304
  membership?: number[];
303
- /** The collider filter indicates what groups the collider can interact with (e.g. group 3 and 4)
304
- * An `undefined` array indicates that the collider can interact with all groups
305
- * Note: Make sure to call updateProperties after having changed this property
305
+ /** The collider filter indicates what groups the collider can interact with (e.g. group 3 and 4)
306
+ * An `undefined` array indicates that the collider can interact with all groups
307
+ * Note: Make sure to call updateProperties after having changed this property
306
308
  * Default: undefined
307
309
  */
308
310
  filter?: number[];
311
+ /** The density of the collider used for automatic mass calculation.
312
+ * When the attached Rigidbody has `autoMass` enabled, the mass is computed as `density × volume`.
313
+ * Note: Make sure to call updateProperties after having changed this property
314
+ * Default: undefined (uses physics engine default of 1.0)
315
+ */
316
+ density?: number;
309
317
  }
310
318
 
311
319
  export declare interface ISphereCollider extends ICollider {
@@ -473,8 +481,10 @@ export interface IPhysicsEngine {
473
481
  postStep();
474
482
  /** Indicates whether the physics engine is currently updating */
475
483
  get isUpdating(): boolean;
476
- /** Clears all cached data (e.g., mesh data when creating scaled mesh colliders) */
477
- clearCaches();
484
+ /** Tears down the physics world and frees all resources. The world will be re-created on next use. */
485
+ dispose(): void;
486
+ /** @deprecated Use {@link dispose} instead. */
487
+ clearCaches(): void;
478
488
 
479
489
  /** Enables or disables the physics engine */
480
490
  enabled: boolean;
@@ -511,20 +521,25 @@ export interface IPhysicsEngine {
511
521
  /** True if you want to also hit objects when the raycast starts from inside a collider */
512
522
  solid?: boolean,
513
523
  queryFilterFlags?: QueryFilterFlags,
514
- /**
515
- * Raycast filter groups. Groups are used to apply the collision group rules for the scene query.
516
- * The scene query will only consider hits with colliders with collision groups compatible with
524
+ /**
525
+ * Raycast filter groups. Groups are used to apply the collision group rules for the scene query.
526
+ * The scene query will only consider hits with colliders with collision groups compatible with
517
527
  * this collision group (using the bitwise test described in the collision groups section).
518
- * For example membership 0x0001 and filter 0x0002 should be 0x00010002
528
+ * For example membership 0x0001 and filter 0x0002 should be 0x00010002
519
529
  * @see https://rapier.rs/docs/user_guides/javascript/colliders#collision-groups-and-solver-groups
520
530
  */
521
531
  filterGroups?: number,
522
- /**
532
+ /**
523
533
  * Predicate to filter colliders in raycast results
524
534
  * @param collider The collider being tested
525
535
  * @returns False to ignore this collider, true to include it
526
536
  */
527
- filterPredicate?: (collider: ICollider) => boolean
537
+ filterPredicate?: (collider: ICollider) => boolean,
538
+ /** When true, trigger/sensor colliders will be included in the raycast results.
539
+ * By default trigger colliders are skipped.
540
+ * @default false
541
+ */
542
+ includeTriggers?: boolean,
528
543
  }): RaycastResult;
529
544
 
530
545
  /**
@@ -539,20 +554,25 @@ export interface IPhysicsEngine {
539
554
  /** True if you want to also hit objects when the raycast starts from inside a collider */
540
555
  solid?: boolean,
541
556
  queryFilterFlags?: QueryFilterFlags,
542
- /**
543
- * Raycast filter groups. Groups are used to apply the collision group rules for the scene query.
544
- * The scene query will only consider hits with colliders with collision groups compatible with
557
+ /**
558
+ * Raycast filter groups. Groups are used to apply the collision group rules for the scene query.
559
+ * The scene query will only consider hits with colliders with collision groups compatible with
545
560
  * this collision group (using the bitwise test described in the collision groups section).
546
- * For example membership 0x0001 and filter 0x0002 should be 0x00010002
561
+ * For example membership 0x0001 and filter 0x0002 should be 0x00010002
547
562
  * @see https://rapier.rs/docs/user_guides/javascript/colliders#collision-groups-and-solver-groups
548
563
  */
549
564
  filterGroups?: number,
550
- /**
565
+ /**
551
566
  * Predicate to filter colliders in raycast results
552
567
  * @param collider The collider being tested
553
568
  * @returns False to ignore this collider, true to include it
554
569
  */
555
- filterPredicate?: (collider: ICollider) => boolean
570
+ filterPredicate?: (collider: ICollider) => boolean,
571
+ /** When true, trigger/sensor colliders will be included in the raycast results.
572
+ * By default trigger colliders are skipped.
573
+ * @default false
574
+ */
575
+ includeTriggers?: boolean,
556
576
  }): RaycastResult;
557
577
 
558
578
  /**
@@ -736,8 +756,9 @@ export interface IPhysicsEngine {
736
756
  getBody(obj: ICollider | IRigidbody): null | any;
737
757
 
738
758
  // Joints
739
- addFixedJoint(body1: IRigidbody, body2: IRigidbody);
740
- addHingeJoint(body1: IRigidbody, body2: IRigidbody, anchor: Vec3, axis: Vec3);
759
+ addFixedJoint(body1: IRigidbody, body2: IRigidbody): Promise<any> | any;
760
+ addHingeJoint(body1: IRigidbody, body2: IRigidbody, anchor: Vec3, axis: Vec3): Promise<any> | any;
761
+ removeJoint(joint: any): void;
741
762
 
742
763
  /** Enable to render collider shapes */
743
764
  debugRenderColliders: boolean;
@@ -79,8 +79,12 @@ function createPropertyWrapper(target: IComponent | any, _propertyKey: string |
79
79
  return;
80
80
  }
81
81
 
82
- // only build wrapper once per type
83
- if (this[$prop] === undefined) {
82
+ // Only install the getter/setter once per instance.
83
+ // processStart may call __internalAwake again for components that were inactive
84
+ // during processNewScripts — the base Component.__internalAwake has a __didAwake guard
85
+ // but this decorator wrapper runs before reaching it, so we need our own idempotency check.
86
+ const desc = Object.getOwnPropertyDescriptor(this, propertyKey);
87
+ if (!desc || !desc.get) {
84
88
 
85
89
  // make sure the field is initialized in a hidden property
86
90
  this[$prop] = this[propertyKey];
@@ -99,6 +103,7 @@ function createPropertyWrapper(target: IComponent | any, _propertyKey: string |
99
103
  }
100
104
 
101
105
  Object.defineProperty(this, propertyKey, {
106
+ configurable: true,
102
107
  set: function (v) {
103
108
  if (this[$isAssigningProperties] === true) {
104
109
  this[$prop] = v;
@@ -279,24 +279,35 @@ declare type deepClonePredicate = (owner: any, propertyName: string, current: an
279
279
  * return true;
280
280
  * });
281
281
  * */
282
- export function deepClone(obj: any, predicate?: deepClonePredicate): any {
282
+ export function deepClone(obj: any, predicate?: deepClonePredicate, _visited?: WeakSet<object>): any {
283
283
  if (obj !== null && obj !== undefined && typeof obj === "object") {
284
+ if (!_visited) _visited = new WeakSet();
285
+ if (_visited.has(obj)) return obj;
286
+ _visited.add(obj);
287
+
284
288
  let clone;
285
289
  if (Array.isArray(obj)) clone = [];
286
290
  else {
287
- clone = Object.create(obj);
288
- Object.assign(clone, obj);
291
+ clone = Object.create(Object.getPrototypeOf(obj));
292
+ // Copy own properties, skipping getter-only properties that can't be set
293
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
294
+ for (const key in descriptors) {
295
+ const desc = descriptors[key];
296
+ if (desc.set || desc.writable !== false) {
297
+ try { clone[key] = obj[key]; }
298
+ catch { /* skip read-only properties */ }
299
+ }
300
+ }
289
301
  }
290
302
  for (const key of Object.keys(obj)) {
291
303
  const val = obj[key];
292
304
  if (predicate && !predicate(obj, key, val)) {
293
- // console.log("SKIP", val);
294
305
  clone[key] = val;
295
306
  }
296
307
  else if (val?.clone !== undefined && typeof val.clone === "function")
297
308
  clone[key] = val.clone();
298
309
  else
299
- clone[key] = deepClone(val, predicate);
310
+ clone[key] = deepClone(val, predicate, _visited);
300
311
  }
301
312
  return clone;
302
313
  }
@@ -205,7 +205,26 @@ export function tryDetermineMimetypeFromBinary(url: string, data: ArrayBuffer, r
205
205
  if (debug) console.debug("OBJ detected");
206
206
  return "model/obj";
207
207
  }
208
- else if (response.headers.has("content-type")) {
208
+ // Run registered mimetype callbacks BEFORE the Content-Type-based dispatch
209
+ // below. Otherwise files served as `image/*` (HDRIs, KTX2 textures, etc.)
210
+ // hit the hardcoded `image/* → "unsupported"` early-out and the engine
211
+ // never asks our custom detectors whether they want to claim them.
212
+ // Known binary signatures (GLTF, USD, FBX, OBJ above) still resolve first
213
+ // and bypass this loop — no perf regression for the common path.
214
+ for (const callback of registeredMimetypeCallbacks) {
215
+ const mimetype = callback({
216
+ url: url,
217
+ response: response,
218
+ contentType: response.headers.get("content-type"),
219
+ bytes: bytes
220
+ })
221
+ if (mimetype) {
222
+ if (debug) console.debug(`Mimetype callback returned: ${mimetype}`);
223
+ return mimetype;
224
+ }
225
+ }
226
+
227
+ if (response.headers.has("content-type")) {
209
228
  const content_type = response.headers.get("content-type");
210
229
  if (content_type?.startsWith("image/")) {
211
230
  if (debug) console.debug("Image detected, not a model file");
@@ -259,19 +278,6 @@ export function tryDetermineMimetypeFromBinary(url: string, data: ArrayBuffer, r
259
278
  // return "gltf";
260
279
  // }
261
280
 
262
- for (const callback of registeredMimetypeCallbacks) {
263
- const mimetype = callback({
264
- url: url,
265
- response: response,
266
- contentType: response.headers.get("content-type"),
267
- bytes: bytes
268
- })
269
- if (mimetype) {
270
- if (debug) console.debug(`Mimetype callback returned: ${mimetype}`);
271
- return mimetype;
272
- }
273
- }
274
-
275
281
 
276
282
  if (isDevEnvironment() || debug) {
277
283
  const text = new TextDecoder().decode(data.slice(0, Math.min(data.byteLength, 32)));
@@ -4,7 +4,7 @@ import { Quaternion, Vector2, Vector3, Vector4 } from "three";
4
4
 
5
5
  import { needleLogoOnlySVG } from "./assets/index.js";
6
6
  import { isDevEnvironment } from "./debug/debug.js";
7
- import { hasCommercialLicense } from "./engine_license.js";
7
+ import { __gGoBKfJa } from "./engine_license.js";
8
8
  import { InternalAttributeUtils } from "./engine_utils_attributes.js";
9
9
  import type { NeedleEngineWebComponent } from "./webcomponents/needle-engine.js";
10
10
 
@@ -135,7 +135,7 @@ async function internalRenderQRCodeOverlays(canvas: HTMLCanvasElement, args: { s
135
135
  console.debug("[QR Code] No web component found")
136
136
  }
137
137
 
138
- const canUseCustomLogo = hasCommercialLicense();
138
+ const canUseCustomLogo = __gGoBKfJa();
139
139
 
140
140
  // Query logo src from needle-engine attribute.
141
141
  // For any supported attribute it's possible to use "falsey" values (e.g. "0" or "false" to disable the logo in the QR code)
@@ -35,7 +35,7 @@ export class GenerateMeshBVHWorker extends WorkerBase {
35
35
 
36
36
  worker.onerror = e => {
37
37
 
38
- reject(new Error(`[GenerateMeshBVHWorker] ${e.message || "Unknown error. Please check the server console. If you're using vite try adding 'three-mesh-bvh' to 'optimizeDeps.exclude' in your vite.config.js"}`));
38
+ reject(new Error(`[GenerateMeshBVHWorker] ${e.message || "Could not load worker."}`));
39
39
 
40
40
  };
41
41
 
@@ -0,0 +1,51 @@
1
+ /**
2
+ * JSX IntrinsicElements declarations for Needle Engine web components.
3
+ *
4
+ * Covers both the global JSX namespace (Preact, SolidJS, Svelte, vanilla TS)
5
+ * and React's module-scoped JSX namespace (react-jsx / react-jsxdev transform).
6
+ *
7
+ * IMPORTANT: This file must be a module (has a top-level import/export) so that
8
+ * `declare module "react"` is treated as a *module augmentation* (merging into
9
+ * the existing React types) rather than an *ambient module declaration* (which
10
+ * would shadow/replace @types/react).
11
+ */
12
+
13
+ import type { NeedleEngineAttributes } from "./needle-engine.js";
14
+
15
+ interface NeedleButtonJSXAttributes extends Partial<Omit<HTMLElement, "style" | "children">> {
16
+ style?: Partial<CSSStyleDeclaration>;
17
+ ar?: boolean | string;
18
+ vr?: boolean | string;
19
+ quicklook?: boolean | string;
20
+ qrcode?: boolean | string;
21
+ unstyled?: boolean | string;
22
+ }
23
+
24
+ interface NeedleMenuJSXAttributes extends Partial<Omit<HTMLElement, "style" | "children">> {
25
+ style?: Partial<CSSStyleDeclaration>;
26
+ }
27
+
28
+ interface NeedleLogoElementJSXAttributes extends Partial<Omit<HTMLElement, "style" | "children">> {
29
+ style?: Partial<CSSStyleDeclaration>;
30
+ }
31
+
32
+ interface NeedleElements {
33
+ "needle-engine": Partial<NeedleEngineAttributes>;
34
+ "needle-button": NeedleButtonJSXAttributes;
35
+ "needle-menu": NeedleMenuJSXAttributes;
36
+ "needle-logo-element": NeedleLogoElementJSXAttributes;
37
+ }
38
+
39
+ // Global JSX namespace — Preact, SolidJS, Svelte, vanilla TS
40
+ declare global {
41
+ namespace JSX {
42
+ interface IntrinsicElements extends NeedleElements {}
43
+ }
44
+ }
45
+
46
+ // React module-scoped JSX namespace (module augmentation, not ambient declaration)
47
+ declare module "react" {
48
+ namespace JSX {
49
+ interface IntrinsicElements extends NeedleElements {}
50
+ }
51
+ }
@@ -3,6 +3,7 @@ import { HTMLElementBase } from "../engine_ssr.js";
3
3
 
4
4
  const elementName = "needle-logo-element";
5
5
 
6
+ // NOTE: keep JSX attributes in sync with ./jsx.d.ts
6
7
  declare global {
7
8
  interface HTMLElementTagNameMap {
8
9
  "needle-logo-element": NeedleLogoElement;
@@ -2,7 +2,7 @@ import { Mesh, Object3D, TextureLoader, Vector4 } from "three";
2
2
  import ThreeMeshUI from "three-mesh-ui";
3
3
 
4
4
  import { addNewComponent } from "../../engine_components.js";
5
- import { hasProLicense } from "../../engine_license.js";
5
+ import { $TXm } from "../../engine_license.js";
6
6
  import { OneEuroFilterXYZ } from "../../engine_math.js";
7
7
  import type { Context } from "../../engine_setup.js";
8
8
  import { lookAtObject } from "../../engine_three_utils.js";
@@ -321,7 +321,7 @@ export class NeedleSpatialMenu {
321
321
  }
322
322
  if (this.menu) {
323
323
  const index = this.menu.children.indexOf(this._poweredByNeedleElement as any);
324
- if (!this._showNeedleLogo && hasProLicense()) {
324
+ if (!this._showNeedleLogo && $TXm()) {
325
325
  if (index >= 0) {
326
326
  this._poweredByNeedleElement.removeFromParent();
327
327
  this.markDirty();
@@ -1,8 +1,8 @@
1
1
  import { showBalloonMessage } from "../../debug/debug.js";
2
- import { HTMLElementBase } from "../../engine_ssr.js";
3
2
  import type { Context } from "../../engine_context.js";
4
- import { hasCommercialLicense, onLicenseCheckResultChanged, Telemetry } from "../../engine_license.js";
3
+ import { __gGoBKfJa, _MFjTEBcQ, Telemetry } from "../../engine_license.js";
5
4
  import { isLocalNetwork } from "../../engine_networking_utils.js";
5
+ import { HTMLElementBase } from "../../engine_ssr.js";
6
6
  import { DeviceUtilities, getParam } from "../../engine_utils.js";
7
7
  import { onXRSessionStart, XRSessionEventArgs } from "../../xr/events.js";
8
8
  import { ButtonsFactory } from "../buttons.js";
@@ -12,9 +12,10 @@ import { NeedleLogoElement } from "../logo-element.js";
12
12
  import { getElementPriority, setElementPriority as _setElementPriority } from "./menu-priority.js";
13
13
  import { NeedleSpatialMenu } from "./needle-menu-spatial.js";
14
14
 
15
+ // NOTE: keep JSX attributes in sync with ../jsx.d.ts
15
16
  declare global {
16
17
  interface HTMLElementTagNameMap {
17
- "needle-logo-element": NeedleLogoElement;
18
+ "needle-menu": NeedleMenuElement;
18
19
  }
19
20
  }
20
21
 
@@ -777,8 +778,8 @@ export class NeedleMenuElement extends HTMLElementBase {
777
778
  try {
778
779
  // if the user has a license then we CAN hide the needle logo
779
780
  // calling this method immediately will cause an issue with vite bundling tho
780
- window.requestAnimationFrame(() => onLicenseCheckResultChanged(res => {
781
- if (res == true && hasCommercialLicense() && !debugNonCommercial) {
781
+ window.requestAnimationFrame(() => _MFjTEBcQ(res => {
782
+ if (res == true && __gGoBKfJa() && !debugNonCommercial) {
782
783
  let visible = this._userRequestedLogoVisible;
783
784
  if (visible === undefined) visible = false;
784
785
  this.___onSetLogoVisible(visible);
@@ -829,7 +830,7 @@ export class NeedleMenuElement extends HTMLElementBase {
829
830
  // ensure the menu is not hidden or removed
830
831
  const requiredParent = this?.parentNode;
831
832
  if (this.style.display != "flex" || this.style.visibility != "visible" || this.style.opacity != "1" || requiredParent != this._domElement?.shadowRoot) {
832
- if (!hasCommercialLicense()) {
833
+ if (!__gGoBKfJa()) {
833
834
  const change = changeEventCounter++;
834
835
  // if a user doesn't have a local pro license *but* for development the menu is hidden then we show a warning
835
836
  if (isLocalNetwork() && this._userRequestedMenuVisible === false) {
@@ -917,7 +918,7 @@ export class NeedleMenuElement extends HTMLElementBase {
917
918
  showNeedleLogo(visible: boolean) {
918
919
  this._userRequestedLogoVisible = visible;
919
920
  if (!visible) {
920
- if (!hasCommercialLicense() || debugNonCommercial) {
921
+ if (!__gGoBKfJa() || debugNonCommercial) {
921
922
  console.warn("[Needle Engine] You need a PRO license to hide the Needle Engine logo in production.");
922
923
  const localNetwork = isLocalNetwork()
923
924
  if (!localNetwork) return;
@@ -4,6 +4,7 @@ import { ButtonsFactory } from "./buttons.js";
4
4
  import { iconFontUrl, loadFont } from "./fonts.js";
5
5
  import { WebXRButtonFactory } from "./WebXRButtons.js";
6
6
 
7
+ // NOTE: keep JSX attributes in sync with ./jsx.d.ts
7
8
  declare global {
8
9
  interface HTMLElementTagNameMap {
9
10
  "needle-button": NeedleButtonElement;
@@ -1,6 +1,6 @@
1
1
  import { needleLogoOnlySVG } from "../assets/index.js"
2
2
  import { isDevEnvironment, showBalloonWarning } from "../debug/index.js";
3
- import { hasCommercialLicense, hasProLicense, runtimeLicenseCheckPromise } from "../engine_license.js";
3
+ import { __gGoBKfJa, $TXm, $NzCTiAr } from "../engine_license.js";
4
4
  import { Mathf } from "../engine_math.js";
5
5
  import { LoadingProgressArgs } from "../engine_setup.js";
6
6
  import { getParam } from "../engine_utils.js";
@@ -205,7 +205,7 @@ export class EngineLoadingView implements ILoadingViewHandler {
205
205
  }
206
206
 
207
207
 
208
- const hasLicense = hasProLicense();
208
+ const hasLicense = $TXm();
209
209
  if (!existing) {
210
210
  this._loadingElement.style.position = "absolute";
211
211
  this._loadingElement.style.width = "100%";
@@ -373,7 +373,7 @@ export class EngineLoadingView implements ILoadingViewHandler {
373
373
 
374
374
  // private async handleRuntimeLicense(loadingElement: HTMLElement) {
375
375
  // // First check if we have a commercial license
376
- // let commercialLicense = hasCommercialLicense();
376
+ // let commercialLicense = __gGoBKfJa();
377
377
  // // if it's the case then we don't need to perform a runtime check
378
378
  // if (commercialLicense) return;
379
379
 
@@ -393,10 +393,10 @@ export class EngineLoadingView implements ILoadingViewHandler {
393
393
  // loadingElement.appendChild(nonCommercialContainer);
394
394
 
395
395
  // // Use the runtime license check
396
- // if (!isDevEnvironment() && runtimeLicenseCheckPromise) {
396
+ // if (!isDevEnvironment() && $NzCTiAr) {
397
397
  // if (debugLicense) console.log("Waiting for runtime license check");
398
- // await runtimeLicenseCheckPromise;
399
- // commercialLicense = hasCommercialLicense();
398
+ // await $NzCTiAr;
399
+ // commercialLicense = __gGoBKfJa();
400
400
  // }
401
401
  // if (commercialLicense) return;
402
402
  // nonCommercialContainer.style.transition = "opacity .5s ease-in-out";
@@ -1,11 +1,11 @@
1
1
  import { isDevEnvironment, showBalloonWarning } from "../debug/index.js";
2
- import { HTMLElementBase } from "../engine_ssr.js";
3
2
  import { PUBLIC_KEY, VERSION } from "../engine_constants.js";
4
3
  import { ContextEvent, ContextRegistry } from "../engine_context_registry.js";
5
- import { hasCommercialLicense } from "../engine_license.js";
4
+ import { __gGoBKfJa } from "../engine_license.js";
6
5
  import { onStart } from "../engine_lifecycle_api.js";
7
6
  import { setDracoDecoderPath, setDracoDecoderType, setKtx2TranscoderPath } from "../engine_loaders.gltf.js";
8
7
  import { Context, ContextCreateArgs } from "../engine_setup.js";
8
+ import { HTMLElementBase } from "../engine_ssr.js";
9
9
  import { nameToThreeTonemapping } from "../engine_tonemapping.js";
10
10
  import { type INeedleEngineComponent, type LoadedModel } from "../engine_types.js";
11
11
  import type { addAttributeChangeCallback } from "../engine_utils.js";
@@ -17,6 +17,7 @@ import { arContainerClassName, AROverlayHandler } from "./needle-engine.ar-overl
17
17
  import type { registerObservableAttribute } from "./needle-engine.extras.js";
18
18
  import { calculateProgress01, EngineLoadingView, type ILoadingViewHandler } from "./needle-engine.loading.js";
19
19
 
20
+ // NOTE: keep JSX attributes in sync with ./jsx.d.ts
20
21
  declare global {
21
22
  interface HTMLElementTagNameMap {
22
23
  "needle-engine": NeedleEngineWebComponent;
@@ -41,11 +42,17 @@ export interface NeedleEngineAttributes {
41
42
  'hash': string;
42
43
  /** Set to automatically add OrbitControls to the loaded scene. */
43
44
  'camera-controls': string;
44
- /** Override the default draco decoder path location. */
45
+ /** Override the default Draco decoder/decompressor path. Can be a URL or a local path to a directory containing the Draco decoder files.
46
+ * @default "https://www.gstatic.com/draco/versioned/decoders/1.5.7/"
47
+ * @example <needle-engine dracoDecoderPath="./decoders/draco/"></needle-engine>
48
+ */
45
49
  'dracoDecoderPath': string;
46
- /** Override the default draco library type. */
50
+ /** Override the default Draco decoder type. */
47
51
  'dracoDecoderType': 'wasm' | 'js';
48
- /** Override the default KTX2 transcoder/decoder path. */
52
+ /** Override the default KTX2 transcoder/decoder path. Can be a URL or a local path to a directory containing the KTX2 transcoder files.
53
+ * @default "https://cdn.needle.tools/static/three/0.179.1/basis2/"
54
+ * @example <needle-engine ktx2DecoderPath="./decoders/ktx2/"></needle-engine>
55
+ */
49
56
  'ktx2DecoderPath': string;
50
57
  /** Prevent context from being disposed when element is removed from DOM. */
51
58
  'keep-alive': 'true' | 'false';
@@ -539,7 +546,7 @@ export class NeedleEngineWebComponent extends HTMLElementBase implements INeedle
539
546
 
540
547
 
541
548
  // Loading start events
542
- const allowOverridingDefaultLoading = hasCommercialLicense();
549
+ const allowOverridingDefaultLoading = __gGoBKfJa();
543
550
  // default loading can be overriden by calling preventDefault in the onload start event
544
551
  this.ensureLoadStartIsRegistered();
545
552
  let useDefaultLoading = this.dispatchEvent(new CustomEvent("loadstart", {