@3driseai/3drise-viewer 0.1.2 → 0.1.4

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 (331) hide show
  1. package/dist/components/AnimatedObject.d.ts +2 -1
  2. package/dist/components/AnimatedObject.d.ts.map +1 -1
  3. package/dist/components/AnimatedObject.js +11 -3
  4. package/dist/components/Bubbles.d.ts +2 -1
  5. package/dist/components/Bubbles.d.ts.map +1 -1
  6. package/dist/components/Bubbles.js +5 -2
  7. package/dist/components/CameraController.d.ts +9 -1
  8. package/dist/components/CameraController.d.ts.map +1 -1
  9. package/dist/components/CameraController.js +12 -1
  10. package/dist/components/Clouds.d.ts +2 -1
  11. package/dist/components/Clouds.d.ts.map +1 -1
  12. package/dist/components/Clouds.js +3 -4
  13. package/dist/components/CreatedObject.d.ts +2 -2
  14. package/dist/components/CreatedObject.d.ts.map +1 -1
  15. package/dist/components/CreatedObject.js +5 -10
  16. package/dist/components/CustomPrimitive.d.ts +2 -2
  17. package/dist/components/CustomPrimitive.d.ts.map +1 -1
  18. package/dist/components/CustomPrimitive.js +6 -2
  19. package/dist/components/Earth.d.ts +2 -4
  20. package/dist/components/Earth.d.ts.map +1 -1
  21. package/dist/components/Earth.js +6 -4
  22. package/dist/components/EffectsGenerator.d.ts +2 -1
  23. package/dist/components/EffectsGenerator.d.ts.map +1 -1
  24. package/dist/components/EffectsGenerator.js +26 -25
  25. package/dist/components/EffectsGroup.d.ts +2 -1
  26. package/dist/components/EffectsGroup.d.ts.map +1 -1
  27. package/dist/components/EffectsGroup.js +7 -2
  28. package/dist/components/EnvironmentManager.js +2 -2
  29. package/dist/components/EnvironmentObject.d.ts +2 -1
  30. package/dist/components/EnvironmentObject.d.ts.map +1 -1
  31. package/dist/components/EnvironmentObject.js +2 -2
  32. package/dist/components/Frame.d.ts +3 -2
  33. package/dist/components/Frame.d.ts.map +1 -1
  34. package/dist/components/Frame.js +3 -1
  35. package/dist/components/Galaxy.d.ts +2 -3
  36. package/dist/components/Galaxy.d.ts.map +1 -1
  37. package/dist/components/Galaxy.js +10 -10
  38. package/dist/components/GalleryLayout.d.ts +2 -1
  39. package/dist/components/GalleryLayout.d.ts.map +1 -1
  40. package/dist/components/GalleryLayout.js +3 -1
  41. package/dist/components/GeometryShape.d.ts +3 -2
  42. package/dist/components/GeometryShape.d.ts.map +1 -1
  43. package/dist/components/GeometryShape.js +17 -6
  44. package/dist/components/Glyphs.d.ts +2 -1
  45. package/dist/components/Glyphs.d.ts.map +1 -1
  46. package/dist/components/Glyphs.js +6 -2
  47. package/dist/components/GridHelper.d.ts +2 -1
  48. package/dist/components/GridHelper.d.ts.map +1 -1
  49. package/dist/components/GridHelper.js +3 -1
  50. package/dist/components/GridsGenerator.d.ts +2 -1
  51. package/dist/components/GridsGenerator.d.ts.map +1 -1
  52. package/dist/components/GridsGenerator.js +12 -4
  53. package/dist/components/HdrPlaylistRenderer.d.ts +2 -1
  54. package/dist/components/HdrPlaylistRenderer.d.ts.map +1 -1
  55. package/dist/components/HdrPlaylistRenderer.js +3 -1
  56. package/dist/components/Lensflare.d.ts +2 -1
  57. package/dist/components/Lensflare.d.ts.map +1 -1
  58. package/dist/components/Lensflare.js +3 -1
  59. package/dist/components/Letter.d.ts +3 -2
  60. package/dist/components/Letter.d.ts.map +1 -1
  61. package/dist/components/Letter.js +3 -1
  62. package/dist/components/Letters.d.ts +3 -2
  63. package/dist/components/Letters.d.ts.map +1 -1
  64. package/dist/components/Letters.js +3 -1
  65. package/dist/components/LightObject.d.ts +2 -1
  66. package/dist/components/LightObject.d.ts.map +1 -1
  67. package/dist/components/LightObject.js +11 -7
  68. package/dist/components/LightsManager.d.ts +2 -1
  69. package/dist/components/LightsManager.d.ts.map +1 -1
  70. package/dist/components/LightsManager.js +6 -3
  71. package/dist/components/Lines.d.ts +2 -1
  72. package/dist/components/Lines.d.ts.map +1 -1
  73. package/dist/components/Lines.js +2 -2
  74. package/dist/components/Moon.d.ts +2 -3
  75. package/dist/components/Moon.d.ts.map +1 -1
  76. package/dist/components/Moon.js +6 -4
  77. package/dist/components/MyGrid.d.ts +3 -2
  78. package/dist/components/MyGrid.d.ts.map +1 -1
  79. package/dist/components/MyGrid.js +5 -2
  80. package/dist/components/ObjectNode.d.ts +2 -2
  81. package/dist/components/ObjectNode.d.ts.map +1 -1
  82. package/dist/components/ObjectNode.js +30 -30
  83. package/dist/components/ObjectNodeApi.d.ts +2 -2
  84. package/dist/components/ObjectNodeApi.d.ts.map +1 -1
  85. package/dist/components/ObjectNodeApi.js +2 -2
  86. package/dist/components/ObjectsRenderer.d.ts +2 -1
  87. package/dist/components/ObjectsRenderer.d.ts.map +1 -1
  88. package/dist/components/ObjectsRenderer.js +15 -4
  89. package/dist/components/ObjectsRendererApi.d.ts +2 -1
  90. package/dist/components/ObjectsRendererApi.d.ts.map +1 -1
  91. package/dist/components/ObjectsRendererApi.js +2 -2
  92. package/dist/components/Ocean.d.ts +2 -1
  93. package/dist/components/Ocean.d.ts.map +1 -1
  94. package/dist/components/Ocean.js +3 -1
  95. package/dist/components/Outline.d.ts +3 -2
  96. package/dist/components/Outline.d.ts.map +1 -1
  97. package/dist/components/Outline.js +6 -2
  98. package/dist/components/ParticlesR3f.d.ts +2 -1
  99. package/dist/components/ParticlesR3f.d.ts.map +1 -1
  100. package/dist/components/ParticlesR3f.js +3 -1
  101. package/dist/components/Path.d.ts +2 -1
  102. package/dist/components/Path.d.ts.map +1 -1
  103. package/dist/components/Path.js +14 -3
  104. package/dist/components/PathGeometry.d.ts +2 -1
  105. package/dist/components/PathGeometry.d.ts.map +1 -1
  106. package/dist/components/PathGeometry.js +6 -2
  107. package/dist/components/PathRenderer.d.ts +2 -1
  108. package/dist/components/PathRenderer.d.ts.map +1 -1
  109. package/dist/components/PathRenderer.js +6 -2
  110. package/dist/components/Planet.d.ts +2 -3
  111. package/dist/components/Planet.d.ts.map +1 -1
  112. package/dist/components/Planet.js +6 -4
  113. package/dist/components/PointCloud.d.ts +2 -1
  114. package/dist/components/PointCloud.d.ts.map +1 -1
  115. package/dist/components/PointCloud.js +3 -1
  116. package/dist/components/ProjectLoader.d.ts +2 -1
  117. package/dist/components/ProjectLoader.d.ts.map +1 -1
  118. package/dist/components/ProjectLoader.js +6 -3
  119. package/dist/components/Rain.d.ts +2 -1
  120. package/dist/components/Rain.d.ts.map +1 -1
  121. package/dist/components/Rain.js +7 -1
  122. package/dist/components/SceneBuilder.d.ts +2 -1
  123. package/dist/components/SceneBuilder.d.ts.map +1 -1
  124. package/dist/components/SceneBuilder.js +2 -2
  125. package/dist/components/ShootingStar.d.ts +2 -1
  126. package/dist/components/ShootingStar.d.ts.map +1 -1
  127. package/dist/components/ShootingStar.js +5 -2
  128. package/dist/components/ShootingStars.d.ts +2 -1
  129. package/dist/components/ShootingStars.d.ts.map +1 -1
  130. package/dist/components/ShootingStars.js +2 -2
  131. package/dist/components/SkyController.d.ts +3 -2
  132. package/dist/components/SkyController.d.ts.map +1 -1
  133. package/dist/components/SkyController.js +9 -6
  134. package/dist/components/SkyMesh.d.ts +2 -3
  135. package/dist/components/SkyMesh.d.ts.map +1 -1
  136. package/dist/components/SkyMesh.js +3 -5
  137. package/dist/components/SkySystem.d.ts +2 -1
  138. package/dist/components/SkySystem.d.ts.map +1 -1
  139. package/dist/components/SkySystem.js +6 -2
  140. package/dist/components/Skybox.d.ts +2 -1
  141. package/dist/components/Skybox.d.ts.map +1 -1
  142. package/dist/components/Skybox.js +5 -2
  143. package/dist/components/SolarSystem.d.ts +2 -4
  144. package/dist/components/SolarSystem.d.ts.map +1 -1
  145. package/dist/components/SolarSystem.js +3 -1
  146. package/dist/components/SparklesBurst.d.ts +2 -1
  147. package/dist/components/SparklesBurst.d.ts.map +1 -1
  148. package/dist/components/SparklesBurst.js +5 -2
  149. package/dist/components/Stars.d.ts +2 -3
  150. package/dist/components/Stars.d.ts.map +1 -1
  151. package/dist/components/Stars.js +3 -2
  152. package/dist/components/Sun.d.ts +3 -2
  153. package/dist/components/Sun.d.ts.map +1 -1
  154. package/dist/components/Sun.js +7 -3
  155. package/dist/components/SunCore.d.ts +3 -2
  156. package/dist/components/SunCore.d.ts.map +1 -1
  157. package/dist/components/SunCore.js +3 -1
  158. package/dist/components/SunLight.d.ts +2 -1
  159. package/dist/components/SunLight.d.ts.map +1 -1
  160. package/dist/components/SunLight.js +3 -1
  161. package/dist/components/Text2D.d.ts +2 -1
  162. package/dist/components/Text2D.d.ts.map +1 -1
  163. package/dist/components/Text2D.js +3 -1
  164. package/dist/components/Text3D.d.ts +2 -1
  165. package/dist/components/Text3D.d.ts.map +1 -1
  166. package/dist/components/Text3D.js +2 -2
  167. package/dist/components/VolumePoints.d.ts +3 -2
  168. package/dist/components/VolumePoints.d.ts.map +1 -1
  169. package/dist/components/VolumePoints.js +6 -2
  170. package/dist/components/cursor/AuraCursor.d.ts.map +1 -1
  171. package/dist/components/cursor/AuraCursor.js +3 -1
  172. package/dist/components/cursor/AuroraCursor.d.ts.map +1 -1
  173. package/dist/components/cursor/AuroraCursor.js +5 -2
  174. package/dist/components/cursor/BubblesCursor.d.ts.map +1 -1
  175. package/dist/components/cursor/BubblesCursor.js +5 -2
  176. package/dist/components/cursor/CometCursor.d.ts.map +1 -1
  177. package/dist/components/cursor/CometCursor.js +6 -3
  178. package/dist/components/cursor/CrosshairCursor.d.ts.map +1 -1
  179. package/dist/components/cursor/CrosshairCursor.js +6 -3
  180. package/dist/components/cursor/CursorActions.d.ts +2 -1
  181. package/dist/components/cursor/CursorActions.d.ts.map +1 -1
  182. package/dist/components/cursor/CursorActions.js +12 -10
  183. package/dist/components/cursor/CursorController.d.ts +4 -1
  184. package/dist/components/cursor/CursorController.d.ts.map +1 -1
  185. package/dist/components/cursor/CursorController.js +1 -1
  186. package/dist/components/cursor/CursorEffects.d.ts +4 -2
  187. package/dist/components/cursor/CursorEffects.d.ts.map +1 -1
  188. package/dist/components/cursor/CursorEffects.js +6 -2
  189. package/dist/components/cursor/FerrofluidCursor.d.ts.map +1 -1
  190. package/dist/components/cursor/FerrofluidCursor.js +3 -1
  191. package/dist/components/cursor/GlyphRingCursor.d.ts.map +1 -1
  192. package/dist/components/cursor/GlyphRingCursor.js +3 -1
  193. package/dist/components/cursor/LightningCursor.d.ts.map +1 -1
  194. package/dist/components/cursor/LightningCursor.js +3 -1
  195. package/dist/components/cursor/LiquidMetalCursor.d.ts.map +1 -1
  196. package/dist/components/cursor/LiquidMetalCursor.js +3 -1
  197. package/dist/components/cursor/OrbCursor.d.ts.map +1 -1
  198. package/dist/components/cursor/OrbCursor.js +3 -1
  199. package/dist/components/cursor/PlasmaWhipCursor.d.ts.map +1 -1
  200. package/dist/components/cursor/PlasmaWhipCursor.js +3 -1
  201. package/dist/components/cursor/SparklesCursor.d.ts.map +1 -1
  202. package/dist/components/cursor/SparklesCursor.js +5 -2
  203. package/dist/components/cursor/TeslaCursor.d.ts.map +1 -1
  204. package/dist/components/cursor/TeslaCursor.js +6 -9
  205. package/dist/components/cursor/clickActions/BoltFlashAction.d.ts +2 -1
  206. package/dist/components/cursor/clickActions/BoltFlashAction.d.ts.map +1 -1
  207. package/dist/components/cursor/clickActions/BoltFlashAction.js +5 -2
  208. package/dist/components/cursor/clickActions/GlyphInscriptionAction.d.ts +2 -1
  209. package/dist/components/cursor/clickActions/GlyphInscriptionAction.d.ts.map +1 -1
  210. package/dist/components/cursor/clickActions/GlyphInscriptionAction.js +3 -1
  211. package/dist/components/cursor/clickActions/ImplosionAction.d.ts +2 -1
  212. package/dist/components/cursor/clickActions/ImplosionAction.d.ts.map +1 -1
  213. package/dist/components/cursor/clickActions/ImplosionAction.js +3 -1
  214. package/dist/components/cursor/clickActions/PhaseShiftAction.d.ts +2 -1
  215. package/dist/components/cursor/clickActions/PhaseShiftAction.d.ts.map +1 -1
  216. package/dist/components/cursor/clickActions/PhaseShiftAction.js +5 -2
  217. package/dist/components/cursor/clickActions/PlasmaBombAction.d.ts +2 -1
  218. package/dist/components/cursor/clickActions/PlasmaBombAction.d.ts.map +1 -1
  219. package/dist/components/cursor/clickActions/PlasmaBombAction.js +5 -2
  220. package/dist/components/cursor/clickActions/RealityTearAction.d.ts +2 -1
  221. package/dist/components/cursor/clickActions/RealityTearAction.d.ts.map +1 -1
  222. package/dist/components/cursor/clickActions/RealityTearAction.js +3 -1
  223. package/dist/components/cursor/clickActions/ShockwaveAction.d.ts +2 -1
  224. package/dist/components/cursor/clickActions/ShockwaveAction.d.ts.map +1 -1
  225. package/dist/components/cursor/clickActions/ShockwaveAction.js +5 -2
  226. package/dist/components/cursor/clickActions/SparklesBurstAction.d.ts +2 -1
  227. package/dist/components/cursor/clickActions/SparklesBurstAction.d.ts.map +1 -1
  228. package/dist/components/cursor/clickActions/SparklesBurstAction.js +3 -1
  229. package/dist/components/cursor/clickActions/VoronoiFractureAction.d.ts +2 -1
  230. package/dist/components/cursor/clickActions/VoronoiFractureAction.d.ts.map +1 -1
  231. package/dist/components/cursor/clickActions/VoronoiFractureAction.js +3 -1
  232. package/dist/components/cursor/clickActions/index.d.ts +11 -0
  233. package/dist/components/cursor/clickActions/index.d.ts.map +1 -0
  234. package/dist/components/cursor/clickActions/index.js +10 -0
  235. package/dist/components/cursor/index.d.ts +21 -0
  236. package/dist/components/cursor/index.d.ts.map +1 -0
  237. package/dist/components/cursor/index.js +19 -0
  238. package/dist/components/effects/AuraEffect.d.ts +2 -1
  239. package/dist/components/effects/AuraEffect.d.ts.map +1 -1
  240. package/dist/components/effects/AuraEffect.js +5 -2
  241. package/dist/components/effects/AuroraEffect.d.ts +2 -1
  242. package/dist/components/effects/AuroraEffect.d.ts.map +1 -1
  243. package/dist/components/effects/AuroraEffect.js +3 -1
  244. package/dist/components/effects/BlackHoleEffect.d.ts +2 -1
  245. package/dist/components/effects/BlackHoleEffect.d.ts.map +1 -1
  246. package/dist/components/effects/BlackHoleEffect.js +3 -1
  247. package/dist/components/effects/ConstellationEffect.d.ts +2 -1
  248. package/dist/components/effects/ConstellationEffect.d.ts.map +1 -1
  249. package/dist/components/effects/ConstellationEffect.js +3 -1
  250. package/dist/components/effects/Corona.d.ts +19 -0
  251. package/dist/components/effects/Corona.d.ts.map +1 -0
  252. package/dist/components/effects/Corona.js +15 -0
  253. package/dist/components/effects/DataStreamEffect.d.ts +2 -1
  254. package/dist/components/effects/DataStreamEffect.d.ts.map +1 -1
  255. package/dist/components/effects/DataStreamEffect.js +5 -2
  256. package/dist/components/effects/DnaHelixEffect.d.ts +2 -1
  257. package/dist/components/effects/DnaHelixEffect.d.ts.map +1 -1
  258. package/dist/components/effects/DnaHelixEffect.js +3 -1
  259. package/dist/components/effects/Fire.d.ts +3 -2
  260. package/dist/components/effects/Fire.d.ts.map +1 -1
  261. package/dist/components/effects/Fire.js +3 -1
  262. package/dist/components/effects/FireEffect.d.ts +2 -1
  263. package/dist/components/effects/FireEffect.d.ts.map +1 -1
  264. package/dist/components/effects/FireEffect.js +5 -2
  265. package/dist/components/effects/Flares.d.ts +25 -0
  266. package/dist/components/effects/Flares.d.ts.map +1 -0
  267. package/dist/components/effects/Flares.js +136 -0
  268. package/dist/components/effects/ForcefieldEffect.d.ts +2 -1
  269. package/dist/components/effects/ForcefieldEffect.d.ts.map +1 -1
  270. package/dist/components/effects/ForcefieldEffect.js +3 -1
  271. package/dist/components/effects/HologramEffect.d.ts +2 -1
  272. package/dist/components/effects/HologramEffect.d.ts.map +1 -1
  273. package/dist/components/effects/HologramEffect.js +5 -2
  274. package/dist/components/effects/IceCrystalsEffect.d.ts +2 -1
  275. package/dist/components/effects/IceCrystalsEffect.d.ts.map +1 -1
  276. package/dist/components/effects/IceCrystalsEffect.js +3 -1
  277. package/dist/components/effects/LightningEffect.d.ts +2 -1
  278. package/dist/components/effects/LightningEffect.d.ts.map +1 -1
  279. package/dist/components/effects/LightningEffect.js +5 -2
  280. package/dist/components/effects/MoleculesEffect.d.ts +2 -1
  281. package/dist/components/effects/MoleculesEffect.d.ts.map +1 -1
  282. package/dist/components/effects/MoleculesEffect.js +5 -2
  283. package/dist/components/effects/NeuralNetworkEffect.d.ts +2 -1
  284. package/dist/components/effects/NeuralNetworkEffect.d.ts.map +1 -1
  285. package/dist/components/effects/NeuralNetworkEffect.js +3 -1
  286. package/dist/components/effects/OrbEffect.d.ts +2 -1
  287. package/dist/components/effects/OrbEffect.d.ts.map +1 -1
  288. package/dist/components/effects/OrbEffect.js +5 -2
  289. package/dist/components/effects/PortalEffect.d.ts +2 -1
  290. package/dist/components/effects/PortalEffect.d.ts.map +1 -1
  291. package/dist/components/effects/PortalEffect.js +5 -2
  292. package/dist/components/effects/ShockwaveEffect.d.ts +2 -1
  293. package/dist/components/effects/ShockwaveEffect.d.ts.map +1 -1
  294. package/dist/components/effects/ShockwaveEffect.js +5 -2
  295. package/dist/components/effects/SmokePlumeEffect.d.ts +2 -1
  296. package/dist/components/effects/SmokePlumeEffect.d.ts.map +1 -1
  297. package/dist/components/effects/SmokePlumeEffect.js +5 -2
  298. package/dist/components/effects/SmokeRibbon.d.ts +3 -2
  299. package/dist/components/effects/SmokeRibbon.d.ts.map +1 -1
  300. package/dist/components/effects/SmokeRibbon.js +5 -2
  301. package/dist/components/effects/SmokeRingEffect.d.ts +2 -1
  302. package/dist/components/effects/SmokeRingEffect.d.ts.map +1 -1
  303. package/dist/components/effects/SmokeRingEffect.js +5 -2
  304. package/dist/components/effects/VolumetricFogEffect.d.ts +2 -1
  305. package/dist/components/effects/VolumetricFogEffect.d.ts.map +1 -1
  306. package/dist/components/effects/VolumetricFogEffect.js +5 -2
  307. package/dist/components/effects/index.d.ts +28 -0
  308. package/dist/components/effects/index.d.ts.map +1 -0
  309. package/dist/components/effects/index.js +24 -0
  310. package/dist/components/index.d.ts +112 -0
  311. package/dist/components/index.d.ts.map +1 -0
  312. package/dist/components/index.js +77 -0
  313. package/dist/constants.d.ts +1 -1
  314. package/dist/constants.d.ts.map +1 -1
  315. package/dist/constants.js +1 -1
  316. package/dist/hooks/index.d.ts +55 -0
  317. package/dist/hooks/index.d.ts.map +1 -1
  318. package/dist/hooks/index.js +46 -1
  319. package/dist/hooks/useObjectReady.d.ts +29 -0
  320. package/dist/hooks/useObjectReady.d.ts.map +1 -0
  321. package/dist/hooks/useObjectReady.js +59 -0
  322. package/dist/index.d.ts +4 -135
  323. package/dist/index.d.ts.map +1 -1
  324. package/dist/index.js +6 -108
  325. package/dist/types/index.d.ts +2 -0
  326. package/dist/types/index.d.ts.map +1 -0
  327. package/dist/types/index.js +1 -0
  328. package/dist/types/objectReady.d.ts +24 -0
  329. package/dist/types/objectReady.d.ts.map +1 -0
  330. package/dist/types/objectReady.js +1 -0
  331. package/package.json +3 -3
@@ -1,8 +1,9 @@
1
+ import type { ObjectReadyProps } from '../types/objectReady';
1
2
  import React from "react";
2
3
  import type { Object3D } from "three";
3
4
  import type { ThreeEvent } from "@react-three/fiber";
4
5
  import type { AnimatedTransform, AnchorSettings, CreatedObjectSettings } from "@3driseai/3drise-core";
5
- export interface AnimatedObjectProps {
6
+ export interface AnimatedObjectProps extends ObjectReadyProps {
6
7
  stateKey: string;
7
8
  transitionSettings: AnimatedTransform;
8
9
  createdObject: CreatedObjectSettings;
@@ -1 +1 @@
1
- {"version":3,"file":"AnimatedObject.d.ts","sourceRoot":"","sources":["../../src/components/AnimatedObject.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACtG,MAAM,WAAW,mBAAmB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,iBAAiB,CAAC;IACtC,aAAa,EAAE,qBAAqB,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACtC,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IACjH,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACvD,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACvD,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAGD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAwDvD,CAAC;AAEH,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"AnimatedObject.d.ts","sourceRoot":"","sources":["../../src/components/AnimatedObject.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAM7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACtG,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,iBAAiB,CAAC;IACtC,aAAa,EAAE,qBAAqB,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACtC,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IACjH,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACvD,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACvD,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAGD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA+DvD,CAAC;AAEH,eAAe,cAAc,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useObjectReady } from '../hooks/useObjectReady.js';
2
3
  import { useRef, useEffect, useCallback, memo } from 'react';
3
4
  import { usePathAnimation } from '../hooks/usePathAnimation.js';
4
5
  import EffectsGroup from './EffectsGroup.js';
@@ -6,11 +7,18 @@ import { useObjectAnimation } from '../hooks/useObjectAnimation.js';
6
7
  import { hasHoverAnimation } from '../utils/hasHoverAnimation.js';
7
8
  export const AnimatedObject = memo(({ stateKey, transitionSettings, createdObject,
8
9
  // speed = 1,
9
- visible = true, children, parentRef, handleObjectClick, onPointerEnter, onPointerLeave, anchor, hovered = false, animateMaterial = true,
10
+ visible = true, children, parentRef, handleObjectClick, onPointerEnter, onPointerLeave, anchor, hovered = false, animateMaterial = true, onObjectReady, onObjectDispose,
10
11
  // isActive = false,
11
12
  }) => {
12
13
  const internalRef = useRef(null);
13
14
  const groupRef = parentRef ?? internalRef;
15
+ // Ownership rule: whoever creates the group reports it. CreatedObject passes
16
+ // its own meshRef in as parentRef, so groupRef is literally CreatedObject's
17
+ // object — reporting it here as well would fire twice for one Object3D.
18
+ // Standalone use (no parentRef) means this component owns the group, so it
19
+ // reports. `unownedRef` stays null, which the hook treats as nothing to report.
20
+ const unownedRef = useRef(null);
21
+ useObjectReady(parentRef ? unownedRef : groupRef, createdObject, onObjectReady, onObjectDispose);
14
22
  const { position, scale, rotation, targetPosition, targetScale, targetRotation } = transitionSettings;
15
23
  const animationStartTime = useRef(null);
16
24
  const stepDuration = useRef(1);
@@ -57,9 +65,9 @@ visible = true, children, parentRef, handleObjectClick, onPointerEnter, onPointe
57
65
  return _jsx(_Fragment, { children: _jsxs("group", { ref: groupRef, position: position, scale: scale, rotation: rotation, visible: visible, onClick: onClick,
58
66
  // onPointerEnter={onPointerEnter}
59
67
  // onPointerLeave={onPointerLeave}
60
- name: createdObject.meshSettings.name, userData: { id: createdObject.id }, children: [children, _jsx(EffectsGroup, { createdObject: createdObject })] }) });
68
+ name: createdObject.meshSettings.name, userData: { id: createdObject.id }, children: [children, _jsx(EffectsGroup, { createdObject: createdObject, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose })] }) });
61
69
  }
62
- return (_jsx(_Fragment, { children: _jsxs("group", { ref: groupRef, position: position, scale: scale, rotation: rotation, visible: visible, onClick: onClick, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, name: createdObject.meshSettings.name, userData: { id: createdObject.id }, children: [children, _jsx(EffectsGroup, { createdObject: createdObject })] }) }));
70
+ return (_jsx(_Fragment, { children: _jsxs("group", { ref: groupRef, position: position, scale: scale, rotation: rotation, visible: visible, onClick: onClick, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, name: createdObject.meshSettings.name, userData: { id: createdObject.id }, children: [children, _jsx(EffectsGroup, { createdObject: createdObject, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose })] }) }));
63
71
  });
64
72
  AnimatedObject.displayName = 'AnimatedObject';
65
73
  export default AnimatedObject;
@@ -1,6 +1,7 @@
1
+ import type { ObjectReadyProps } from '../types/objectReady';
1
2
  import type { BubblesConfig } from '@3driseai/3drise-core';
2
3
  import React from "react";
3
- export interface BubblesProps {
4
+ export interface BubblesProps extends ObjectReadyProps {
4
5
  config: BubblesConfig;
5
6
  boundingRadius?: number;
6
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Bubbles.d.ts","sourceRoot":"","sources":["../../src/components/Bubbles.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,YAAY;IACzB,MAAM,EAAE,aAAa,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAID,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAiGnC,CAAC;AACF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Bubbles.d.ts","sourceRoot":"","sources":["../../src/components/Bubbles.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAK7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IAClD,MAAM,EAAE,aAAa,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAID,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAmGnC,CAAC;AACF,eAAe,OAAO,CAAC"}
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useObjectReady } from '../hooks/useObjectReady.js';
2
3
  import { useEffect, useMemo, useRef } from 'react';
3
4
  import { useFrame } from '@react-three/fiber';
4
5
  import * as THREE from 'three';
5
6
  import { BubblesPointsMaterial } from '@3driseai/3drise-core';
6
7
  const MAX_BUBBLES = 256;
7
- const Bubbles = ({ config }) => {
8
+ const Bubbles = ({ config, onObjectReady, onObjectDispose }) => {
8
9
  const positions = useMemo(() => new Float32Array(MAX_BUBBLES * 3), []);
9
10
  const velocities = useMemo(() => new Float32Array(MAX_BUBBLES * 3), []);
10
11
  const ages = useMemo(() => new Float32Array(MAX_BUBBLES), []);
@@ -43,6 +44,8 @@ const Bubbles = ({ config }) => {
43
44
  }, [config.colors, config.scale, config.opacity, config.iridescence, config.speed, material]);
44
45
  useEffect(() => () => { geometry.dispose(); material.dispose(); }, [geometry, material]);
45
46
  const spawnAccum = useRef(0);
47
+ const rootRef = useRef(null);
48
+ useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
46
49
  useFrame((state, delta) => {
47
50
  material.uniforms.uTime.value = state.clock.getElapsedTime();
48
51
  const scale = config.scale ?? 1;
@@ -100,6 +103,6 @@ const Bubbles = ({ config }) => {
100
103
  });
101
104
  if (!config.enabled)
102
105
  return null;
103
- return _jsx("points", { geometry: geometry, material: material, frustumCulled: false });
106
+ return _jsx("points", { ref: rootRef, geometry: geometry, material: material, frustumCulled: false });
104
107
  };
105
108
  export default Bubbles;
@@ -1,9 +1,17 @@
1
+ import type { ObjectReadyProps } from '../types/objectReady';
1
2
  import type { CameraState } from "@3driseai/3drise-core";
2
- interface CameraControllerProps {
3
+ interface CameraControllerProps extends ObjectReadyProps {
3
4
  settings: CameraState;
4
5
  enableAutoAnimation?: boolean;
5
6
  animationDuration?: number;
6
7
  animationEase?: string;
8
+ /**
9
+ * drei's OrbitControls instance is not an Object3D, so it cannot travel
10
+ * through onObjectReady — it gets its own pair. onObjectReady reports the
11
+ * camera, which is an Object3D.
12
+ */
13
+ onControlsReady?: (controls: any) => void;
14
+ onControlsDispose?: (controls: any) => void;
7
15
  }
8
16
  export declare const CameraController: React.FC<CameraControllerProps>;
9
17
  export default CameraController;
@@ -1 +1 @@
1
- {"version":3,"file":"CameraController.d.ts","sourceRoot":"","sources":["../../src/components/CameraController.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,UAAU,qBAAqB;IAC3B,QAAQ,EAAE,WAAW,CAAC;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAGD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAoJ5D,CAAC;AACF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"CameraController.d.ts","sourceRoot":"","sources":["../../src/components/CameraController.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQ7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,UAAU,qBAAsB,SAAQ,gBAAgB;IACpD,QAAQ,EAAE,WAAW,CAAC;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;IAC1C,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;CAC/C;AAGD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA8J5D,CAAC;AACF,eAAe,gBAAgB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useObjectReady } from '../hooks/useObjectReady.js';
2
3
  import { useEffect, useRef } from 'react';
3
4
  import { useFrame, useThree } from '@react-three/fiber';
4
5
  import { useCameraAnimation } from '../hooks/useCameraAnimation.js';
@@ -6,11 +7,21 @@ import { cameraManager } from '../utils/CameraSingleton.js';
6
7
  import { useAnimationEvents } from '../hooks/useAnimationEvents.js';
7
8
  import { usePathAnimation } from '../hooks/usePathAnimation.js';
8
9
  import { OrbitControls } from "@react-three/drei";
9
- export const CameraController = ({ enableAutoAnimation = true, animationDuration = 1, animationEase = "power2.out", settings, }) => {
10
+ export const CameraController = ({ enableAutoAnimation = true, animationDuration = 1, animationEase = "power2.out", settings, onObjectReady, onObjectDispose, onControlsReady, onControlsDispose, }) => {
10
11
  const { camera, set } = useThree();
11
12
  const cameraRef = useRef(camera);
12
13
  const transformAnimationProgress = useRef(0);
13
14
  const controlsRef = useRef(null);
15
+ useObjectReady(cameraRef, settings, onObjectReady, onObjectDispose);
16
+ useEffect(() => {
17
+ const controls = controlsRef.current;
18
+ if (!controls)
19
+ return;
20
+ onControlsReady && onControlsReady(controls);
21
+ return () => {
22
+ onControlsDispose && onControlsDispose(controls);
23
+ };
24
+ }, [controlsRef.current]); // eslint-disable-line react-hooks/exhaustive-deps
14
25
  const { position, orientation, fov, near, far, controls } = settings;
15
26
  const initialControls = useRef(controls);
16
27
  const { startPathAnimation, updatePathAnimation, isAnimating: isPathAnimating, } = usePathAnimation();
@@ -1,6 +1,7 @@
1
+ import type { ObjectReadyProps } from '../types/objectReady';
1
2
  import type { TimeSettings, CreatedObjectSettings } from '@3driseai/3drise-core';
2
3
  import React from "react";
3
- export interface CloudsProps {
4
+ export interface CloudsProps extends ObjectReadyProps {
4
5
  settings: CreatedObjectSettings;
5
6
  timeSettings?: TimeSettings;
6
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Clouds.d.ts","sourceRoot":"","sources":["../../src/components/Clouds.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,WAAW;IACxB,QAAQ,EAAE,qBAAqB,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAmFD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA4LjC,CAAC;AACF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Clouds.d.ts","sourceRoot":"","sources":["../../src/components/Clouds.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQ7D,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACjD,QAAQ,EAAE,qBAAqB,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAmFD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA2LjC,CAAC;AACF,eAAe,MAAM,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useObjectReady } from '../hooks/useObjectReady.js';
2
3
  import { useRef, useCallback } from 'react';
3
4
  import * as THREE from 'three';
4
5
  import { useThree, useFrame } from '@react-three/fiber';
@@ -86,7 +87,7 @@ const defaultTimeSettings = {
86
87
  syncWithRealTime: false,
87
88
  autoAnimate: false,
88
89
  };
89
- const Clouds = ({ settings, timeSettings = defaultTimeSettings }) => {
90
+ const Clouds = ({ settings, timeSettings = defaultTimeSettings, onObjectReady, onObjectDispose }) => {
90
91
  const visible = settings.meshSettings.visible ?? true;
91
92
  const meshSettings = settings.meshSettings;
92
93
  const config = settings.config;
@@ -100,6 +101,7 @@ const Clouds = ({ settings, timeSettings = defaultTimeSettings }) => {
100
101
  const planeSize = config?.planeSize || [10000, 10000];
101
102
  const planeSegments = config?.planeSegments || 64;
102
103
  const meshRef = useRef(null);
104
+ useObjectReady(meshRef, settings, onObjectReady, onObjectDispose);
103
105
  const cloudAnimTime = useRef(0);
104
106
  const { camera } = useThree();
105
107
  const cloudColorRef = useRef(new THREE.Color(1, 1, 1));
@@ -111,10 +113,7 @@ const Clouds = ({ settings, timeSettings = defaultTimeSettings }) => {
111
113
  const animatedOverrideRef = useRef({});
112
114
  const mouseOverrideRef = useRef({});
113
115
  // Keyframe-animation start-value caches (one per domain that uses them)
114
- const transformAnimCacheRef = useRef({});
115
- const materialAnimCacheRef = useRef({});
116
116
  const cloudsAnimCacheRef = useRef({});
117
- // useMaterialApplication(visible ? (meshRef.current as any) : null, materialSettings, true);
118
117
  const handleTimeUpdate = useCallback((state) => {
119
118
  const { normalizedTime, isDaytime, delta } = state;
120
119
  if (isDaytime) {
@@ -1,12 +1,12 @@
1
1
  import type { CreatedObjectSettings } from '@3driseai/3drise-core';
2
+ import type { ObjectReadyProps } from "../types/objectReady";
2
3
  import React from "react";
3
4
  import { Object3D } from "three";
4
5
  import { type ThreeEvent } from "@react-three/fiber";
5
- interface CreatedObjectProps {
6
+ interface CreatedObjectProps extends ObjectReadyProps {
6
7
  createdObject: CreatedObjectSettings;
7
8
  children: React.ReactNode;
8
9
  shouldApply3driseMaterial?: boolean;
9
- onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void;
10
10
  handleObjectClick?: (createdObject: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
11
11
  }
12
12
  declare const CreatedObject: React.FC<CreatedObjectProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"CreatedObject.d.ts","sourceRoot":"","sources":["../../src/components/CreatedObject.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AASnE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,UAAU,kBAAkB;IACxB,aAAa,EAAE,qBAAqB,CAAC;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACpH;AAGD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAuF9C,CAAC;AAEH,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"CreatedObject.d.ts","sourceRoot":"","sources":["../../src/components/CreatedObject.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAUnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,UAAU,kBAAmB,SAAQ,gBAAgB;IACjD,aAAa,EAAE,qBAAqB,CAAC;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACpH;AAGD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAmF9C,CAAC;AAEH,eAAe,aAAa,CAAC"}
@@ -9,7 +9,8 @@ import { cameraManager } from "../utils/CameraSingleton.js";
9
9
  import AnimatedObject from "./AnimatedObject.js";
10
10
  import { useFrameEffects } from "../hooks/useFrameEffects.js";
11
11
  import { useObjectEdges } from "../hooks/useObjectEdges.js";
12
- const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial = true, onObjectReady, handleObjectClick, }) => {
12
+ import { useObjectReady } from "../hooks/useObjectReady.js";
13
+ const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial = true, onObjectReady, onObjectDispose, handleObjectClick, }) => {
13
14
  const isSelected = false;
14
15
  // const isSelected = useObjectSelection(createdObject.id);
15
16
  // const { handleObjectClick: contextHandleObjectClick } = useSceneClick();
@@ -34,11 +35,9 @@ const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial
34
35
  useEffect(() => {
35
36
  if (meshRef.current) {
36
37
  meshRef.current.userData.id = createdObject.id;
37
- onObjectReady && onObjectReady(createdObject, meshRef.current);
38
38
  }
39
- return () => {
40
- };
41
- }, [meshRef.current]);
39
+ }, [meshRef.current, createdObject.id]);
40
+ useObjectReady(meshRef, createdObject, onObjectReady, onObjectDispose);
42
41
  useEffect(() => {
43
42
  if (transformRef.current && isSelected) {
44
43
  controllersRef.current.set(createdObject.id.toString(), transformRef.current);
@@ -57,10 +56,6 @@ const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial
57
56
  });
58
57
  }, [createdObject.meshSettings.position, createdObject.meshSettings.rotation, createdObject.meshSettings.scale]);
59
58
  // const [noiseTexture, setNoiseTexture] = useState<Texture | null>(null);
60
- const isTransforming = useRef(false);
61
- // useMaterialApplication(obj.object, createdObject.materialSettings);
62
- // Check if this should use the new MaterialLibrary system for Drei materials
63
- // console.log(object)
64
59
  const handleObjectEnter = (e) => {
65
60
  // console.log(e)
66
61
  // Only handle if this is the actual mesh group, not a child
@@ -94,7 +89,7 @@ const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial
94
89
  position: anchorEnabled ? [anchoredPosition.x, anchoredPosition.y, anchoredPosition.z] : animatedTransform.position
95
90
  }, createdObject: createdObject,
96
91
  // animateMaterial={!useDreiMaterials}
97
- parentRef: meshRef, visible: createdObject.meshSettings.visible, handleObjectClick: handleObjectClick, onPointerEnter: handleObjectEnter, onPointerLeave: e => handleObjectLeave(e), hovered: hovered, children: createdObject.rigidBodySettings?.enabled ? (_jsx(RigidBody, { type: createdObject.rigidBodySettings?.type || 'dynamic', mass: createdObject.rigidBodySettings?.mass || 1, colliders: createdObject.userData?.type === 'plane'
92
+ parentRef: meshRef, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose, visible: createdObject.meshSettings.visible, handleObjectClick: handleObjectClick, onPointerEnter: handleObjectEnter, onPointerLeave: e => handleObjectLeave(e), hovered: hovered, children: createdObject.rigidBodySettings?.enabled ? (_jsx(RigidBody, { type: createdObject.rigidBodySettings?.type || 'dynamic', mass: createdObject.rigidBodySettings?.mass || 1, colliders: createdObject.userData?.type === 'plane'
98
93
  ? 'cuboid' // Force box collider for planes
99
94
  : undefined // Auto-detect for others
100
95
  , friction: createdObject.rigidBodySettings?.friction, restitution: createdObject.rigidBodySettings?.restitution, gravityScale: createdObject.rigidBodySettings?.gravityScale ?? 1, linearDamping: createdObject.rigidBodySettings?.linearDamping ?? 0.01, angularDamping: createdObject.rigidBodySettings?.angularDamping ?? 0.01, children: children })) : (children) }));
@@ -1,10 +1,10 @@
1
1
  import type { CreatedObjectSettings } from '@3driseai/3drise-core';
2
2
  import type { Object3D } from 'three';
3
+ import type { ObjectReadyProps } from "../types/objectReady";
3
4
  import React from "react";
4
5
  import { type ThreeEvent } from "@react-three/fiber";
5
- interface CustomPrimitiveProps {
6
+ interface CustomPrimitiveProps extends ObjectReadyProps {
6
7
  createdObject: CreatedObjectSettings;
7
- onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void;
8
8
  handleObjectClick?: (createdObject: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
9
9
  }
10
10
  declare const CustomPrimitive: React.FC<CustomPrimitiveProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"CustomPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/CustomPrimitive.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAItC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,UAAU,oBAAoB;IAC1B,aAAa,EAAE,qBAAqB,CAAC;IACrC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACpH;AAGD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA6ElD,CAAC;AAEH,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"CustomPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/CustomPrimitive.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAKtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,UAAU,oBAAqB,SAAQ,gBAAgB;IACnD,aAAa,EAAE,qBAAqB,CAAC;IACrC,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACpH;AAGD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAgFlD,CAAC;AAEH,eAAe,eAAe,CAAC"}
@@ -5,8 +5,11 @@ import { Vector3 } from "three";
5
5
  import MaterialLibrary from "./MaterialLibrary.js";
6
6
  import { useWaterReflections } from "../hooks/useWaterReflections.js";
7
7
  import { GeometryMesh } from "./GeometryShape.js";
8
- const CustomPrimitive = memo(({ createdObject, onObjectReady, handleObjectClick, }) => {
8
+ import { useObjectReady } from "../hooks/useObjectReady.js";
9
+ const CustomPrimitive = memo(({ createdObject, onObjectReady, onObjectDispose, handleObjectClick, }) => {
9
10
  const meshRef = useRef(null);
11
+ // CustomPrimitive accepted onObjectReady but never fired it; this is the fix.
12
+ useObjectReady(meshRef, createdObject, onObjectReady, onObjectDispose);
10
13
  const resolvedObject = useMemo(() => {
11
14
  // console.log(`Resolving object for ${createdObject.name}`, createdObject);
12
15
  if (!createdObject)
@@ -75,8 +78,9 @@ const CustomPrimitive = memo(({ createdObject, onObjectReady, handleObjectClick,
75
78
  // else if (materialType === 'line') {
76
79
  // mode = 'outline';
77
80
  // }
81
+ // console.log({createdObject});
78
82
  if (createdObject.type === 'mesh')
79
- return _jsx("mesh", { ref: meshRef, name: createdObject.name, children: _jsx(GeometryMesh, { config: createdObject.config, materialSettings: createdObject.materialSettings, animations: createdObject.animations, modeConfig: createdObject.modeConfig || { mode: 'solid', count: 1000, symmetry: 3, spacing: 0.1, slices: 8, linkRadius: 0.05, angle: 18, lineWidth: 1 } }) }, createdObject.id);
83
+ return _jsx("mesh", { ref: meshRef, name: createdObject.name, children: _jsx(GeometryMesh, { config: createdObject.config, materialSettings: createdObject.materialSettings, animations: createdObject.animations, onObjectReady: (_object, ref) => onObjectReady && onObjectReady(createdObject, ref), onObjectDispose: (_object, ref) => onObjectDispose && onObjectDispose(createdObject, ref), modeConfig: createdObject.modeConfig || { mode: 'solid', count: 1000, symmetry: 3, spacing: 0.1, slices: 8, linkRadius: 0.05, angle: 18, lineWidth: 1 } }) }, createdObject.id);
80
84
  if (!resolvedObject) {
81
85
  console.warn(`no resolved object for ${createdObject.name} (${createdObject.id})`);
82
86
  return null;
@@ -1,8 +1,6 @@
1
- import * as THREE from 'three';
1
+ import type { ObjectReadyProps } from '../types/objectReady';
2
2
  import React from "react";
3
3
  import { EarthConfig } from "@3driseai/3drise-core";
4
- declare const Earth: React.FC<EarthConfig & {
5
- onMeshReady?: (mesh: THREE.Mesh) => void;
6
- }>;
4
+ declare const Earth: React.FC<EarthConfig & ObjectReadyProps>;
7
5
  export default Earth;
8
6
  //# sourceMappingURL=Earth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Earth.d.ts","sourceRoot":"","sources":["../../src/components/Earth.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAMpD,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,GAAG;IACxB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;CAC5C,CA2BR,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Earth.d.ts","sourceRoot":"","sources":["../../src/components/Earth.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAI7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAMpD,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,GAAG,gBAAgB,CA4BnD,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useObjectReady } from '../hooks/useObjectReady.js';
2
3
  import { useRef, useMemo, useCallback, useEffect } from 'react';
3
4
  import * as THREE from 'three';
4
5
  import { useTexture } from '@react-three/drei';
@@ -6,8 +7,10 @@ const CDN = 'https://3d-rise.sfo3.cdn.digitaloceanspaces.com/app/images/planets'
6
7
  const EARTH_DAY_URL = `${CDN}/earth_day_4096.jpg`;
7
8
  const EARTH_NIGHT_URL = `${CDN}/earth_night_4096.jpg`;
8
9
  const EARTH_BUMP_ROUGHNESS_CLOUDS_URL = `${CDN}/earth_bump_roughness_clouds_4096.jpg`;
9
- const Earth = ({ sunPosition = [0, 0, 3], atmosphereDayColor = '#4db2ff', atmosphereTwilightColor = '#bc490b', radius = 1, onMeshReady, }) => {
10
+ const Earth = ({ sunPosition = [0, 0, 3], atmosphereDayColor = '#4db2ff', atmosphereTwilightColor = '#bc490b', radius = 1, onObjectReady, onObjectDispose, }) => {
10
11
  const globeRef = useRef(null);
12
+ const rootRef = useRef(null);
13
+ useObjectReady(rootRef, { sunPosition, atmosphereDayColor, atmosphereTwilightColor, radius }, onObjectReady, onObjectDispose);
11
14
  const globeMatRef = useRef(null);
12
15
  const atmosphereMatRef = useRef(null);
13
16
  const segments = 64;
@@ -29,10 +32,9 @@ const Earth = ({ sunPosition = [0, 0, 3], atmosphereDayColor = '#4db2ff', atmosp
29
32
  const handleGlobeRef = useCallback((mesh) => {
30
33
  if (mesh) {
31
34
  globeRef.current = mesh;
32
- onMeshReady?.(mesh);
33
35
  }
34
- }, [onMeshReady]);
35
- return (_jsxs("group", { userData: { id: '3drise-earth' }, children: [_jsxs("mesh", { ref: handleGlobeRef, children: [_jsx("sphereGeometry", { args: [radius, segments, segments] }), _jsx("earthMaterial", { ref: globeMatRef, uDayMap: dayMap, uNightMap: nightMap, uBumpRoughnessClouds: bumpRoughnessClouds, uSunDirection: sunDirection, uAtmosphereDayColor: dayColor, uAtmosphereTwilightColor: twilightColor })] }), _jsxs("mesh", { scale: 1.04, children: [_jsx("sphereGeometry", { args: [radius, segments, segments] }), _jsx("earthAtmosphereMaterial", { ref: atmosphereMatRef, transparent: true, side: THREE.BackSide, depthWrite: false, uSunDirection: sunDirection, uAtmosphereDayColor: dayColor, uAtmosphereTwilightColor: twilightColor })] })] }));
36
+ }, []);
37
+ return (_jsxs("group", { ref: rootRef, userData: { id: '3drise-earth' }, children: [_jsxs("mesh", { ref: handleGlobeRef, children: [_jsx("sphereGeometry", { args: [radius, segments, segments] }), _jsx("earthMaterial", { ref: globeMatRef, uDayMap: dayMap, uNightMap: nightMap, uBumpRoughnessClouds: bumpRoughnessClouds, uSunDirection: sunDirection, uAtmosphereDayColor: dayColor, uAtmosphereTwilightColor: twilightColor })] }), _jsxs("mesh", { scale: 1.04, children: [_jsx("sphereGeometry", { args: [radius, segments, segments] }), _jsx("earthAtmosphereMaterial", { ref: atmosphereMatRef, transparent: true, side: THREE.BackSide, depthWrite: false, uSunDirection: sunDirection, uAtmosphereDayColor: dayColor, uAtmosphereTwilightColor: twilightColor })] })] }));
36
38
  };
37
39
  Earth.displayName = 'Earth';
38
40
  export default Earth;
@@ -1,7 +1,8 @@
1
1
  import type { Object3D } from 'three';
2
2
  import React from "react";
3
3
  import type { GenerativeEffectSettings } from "@3driseai/3drise-core";
4
- export interface EffectsGeneratorProps {
4
+ import type { ObjectReadyProps } from '../types/objectReady';
5
+ export interface EffectsGeneratorProps extends ObjectReadyProps {
5
6
  settings: GenerativeEffectSettings;
6
7
  object?: Object3D | null;
7
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"EffectsGenerator.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGenerator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAyBtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,MAAM,WAAW,qBAAqB;IAClC,QAAQ,EAAE,wBAAwB,CAAC;IACnC,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC5B;AAGD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA0CrD,CAAC;AACF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"EffectsGenerator.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGenerator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAyBtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC3D,QAAQ,EAAE,wBAAwB,CAAC;IACnC,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC5B;AAGD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA4CrD,CAAC;AACF,eAAe,gBAAgB,CAAC"}
@@ -19,17 +19,15 @@ import IceCrystalsEffect from './effects/IceCrystalsEffect.js';
19
19
  import SmokePlumeEffect from './effects/SmokePlumeEffect.js';
20
20
  import VolumetricFogEffect from './effects/VolumetricFogEffect.js';
21
21
  import SmokeRingEffect from './effects/SmokeRingEffect.js';
22
- import Flares from './Flares.js';
22
+ import Flares from './effects/Flares.js';
23
23
  import SparklesBurst from './SparklesBurst.js';
24
24
  import Bubbles from './Bubbles.js';
25
25
  import Glyphs from './Glyphs.js';
26
26
  import Fire from './effects/Fire.js';
27
27
  import SmokeRibbon from './effects/SmokeRibbon.js';
28
- const EffectsGenerator = ({ settings, object }) => {
28
+ const EffectsGenerator = ({ settings, object, onObjectReady, onObjectDispose }) => {
29
29
  console.log('EffectsGenerator render with settings:', settings, 'and object:', object);
30
30
  const { config } = settings;
31
- if (!config.enabled)
32
- return null;
33
31
  // console.log('Effect config:', config);
34
32
  const boundingRadius = useMemo(() => {
35
33
  if (!object)
@@ -39,32 +37,35 @@ const EffectsGenerator = ({ settings, object }) => {
39
37
  box.getBoundingSphere(sphere);
40
38
  return sphere.radius || 1;
41
39
  }, [object]);
40
+ if (!config.enabled)
41
+ return null;
42
42
  const animations = settings.animations;
43
+ const ready = { onObjectReady, onObjectDispose };
43
44
  switch (config.type) {
44
- case 'molecules': return _jsx(MoleculesEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
45
- case 'shockwave': return _jsx(ShockwaveEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
46
- case 'aura': return _jsx(AuraEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
47
- case 'dataStream': return _jsx(DataStreamEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
48
- case 'constellation': return _jsx(ConstellationEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
49
- case 'hologram': return _jsx(HologramEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
50
- case 'portal': return _jsx(PortalEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
51
- case 'dnaHelix': return _jsx(DnaHelixEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
52
- case 'orb': return _jsx(OrbEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
53
- case 'lightning': return _jsx(LightningEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
54
- case 'aurora': return _jsx(AuroraEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
55
- case 'forcefield': return _jsx(ForcefieldEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
56
- case 'neuralNetwork': return _jsx(NeuralNetworkEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
57
- case 'blackHole': return _jsx(BlackHoleEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
58
- case 'iceCrystals': return _jsx(IceCrystalsEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
59
- case 'smokePlume': return _jsx(SmokePlumeEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
60
- case 'volumetricFog': return _jsx(VolumetricFogEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
61
- case 'smokeRing': return _jsx(SmokeRingEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
62
- case 'fire': return _jsx(Fire, { hostRef: object, config: config, animations: animations });
63
- case 'flares': return _jsx(Flares, { hostRef: object, config: config, animations: animations });
45
+ case 'molecules': return _jsx(MoleculesEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
46
+ case 'shockwave': return _jsx(ShockwaveEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
47
+ case 'aura': return _jsx(AuraEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
48
+ case 'dataStream': return _jsx(DataStreamEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
49
+ case 'constellation': return _jsx(ConstellationEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
50
+ case 'hologram': return _jsx(HologramEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
51
+ case 'portal': return _jsx(PortalEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
52
+ case 'dnaHelix': return _jsx(DnaHelixEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
53
+ case 'orb': return _jsx(OrbEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
54
+ case 'lightning': return _jsx(LightningEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
55
+ case 'aurora': return _jsx(AuroraEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
56
+ case 'forcefield': return _jsx(ForcefieldEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
57
+ case 'neuralNetwork': return _jsx(NeuralNetworkEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
58
+ case 'blackHole': return _jsx(BlackHoleEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
59
+ case 'iceCrystals': return _jsx(IceCrystalsEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
60
+ case 'smokePlume': return _jsx(SmokePlumeEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
61
+ case 'volumetricFog': return _jsx(VolumetricFogEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
62
+ case 'smokeRing': return _jsx(SmokeRingEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
63
+ case 'fire': return _jsx(Fire, { hostRef: object, config: config, animations: animations, ...ready });
64
+ case 'flares': return _jsx(Flares, { hostRef: object, config: config, animations: animations, ...ready });
64
65
  case 'sparklesBurst': return _jsx(SparklesBurst, { boundingRadius: boundingRadius, config: config });
65
66
  case 'bubbles': return _jsx(Bubbles, { boundingRadius: boundingRadius, config: config });
66
67
  case 'glyphs': return _jsx(Glyphs, { boundingRadius: boundingRadius, config: config });
67
- case 'smokeRibbon': return _jsx(SmokeRibbon, { config: config, boundingRadius: boundingRadius });
68
+ case 'smokeRibbon': return _jsx(SmokeRibbon, { config: config, boundingRadius: boundingRadius, ...ready });
68
69
  default: return null;
69
70
  }
70
71
  };
@@ -1,6 +1,7 @@
1
+ import type { ObjectReadyProps } from '../types/objectReady';
1
2
  import type { CreatedObjectSettings } from '@3driseai/3drise-core';
2
3
  import React from "react";
3
- interface EffectsGroupProps {
4
+ interface EffectsGroupProps extends ObjectReadyProps {
4
5
  createdObject: CreatedObjectSettings;
5
6
  }
6
7
  declare const EffectsGroup: React.FC<EffectsGroupProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"EffectsGroup.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGroup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAGnE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,UAAU,iBAAiB;IACvB,aAAa,EAAE,qBAAqB,CAAC;CACxC;AAGD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAK7C,CAAC;AACF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"EffectsGroup.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAGnE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,UAAU,iBAAkB,SAAQ,gBAAgB;IAChD,aAAa,EAAE,qBAAqB,CAAC;CACxC;AAGD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAQ7C,CAAC;AACF,eAAe,YAAY,CAAC"}
@@ -1,11 +1,16 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useRef } from 'react';
3
+ import { useObjectReady } from '../hooks/useObjectReady.js';
2
4
  import { GEREATIVE_EFFECTS_KEY } from '@3driseai/3drise-core';
3
5
  import EffectsGenerator from './EffectsGenerator.js';
4
6
  import { findById } from '../utils/sceneQuery.js';
5
- const EffectsGroup = ({ createdObject }) => {
7
+ const EffectsGroup = ({ createdObject, onObjectReady, onObjectDispose }) => {
8
+ // Hooks must run before the early return below.
9
+ const groupRef = useRef(null);
10
+ useObjectReady(groupRef, createdObject, onObjectReady, onObjectDispose);
6
11
  if (!createdObject.effects || createdObject.effects.length === 0)
7
12
  return null;
8
13
  const object = findById(createdObject.id);
9
- return (_jsx("group", { name: `${createdObject.id}-effects`, userData: { [GEREATIVE_EFFECTS_KEY]: true }, children: createdObject.effects.map((effect, index) => (_jsx(EffectsGenerator, { settings: effect, object: object }, index))) }));
14
+ return (_jsx("group", { ref: groupRef, name: `${createdObject.id}-effects`, userData: { [GEREATIVE_EFFECTS_KEY]: true }, children: createdObject.effects.map((effect, index) => (_jsx(EffectsGenerator, { settings: effect, object: object, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose }, index))) }));
10
15
  };
11
16
  export default EffectsGroup;
@@ -7,7 +7,7 @@ import SkySystem from './SkySystem.js';
7
7
  import { useCubeCamera } from '../hooks/useCubeCamera.js';
8
8
  import HdrPlaylistRenderer from './HdrPlaylistRenderer.js';
9
9
  import { getTransitionSettings } from '@3driseai/3drise-core';
10
- const EnvironmentManager = forwardRef(({ environment, cubeCameraResolution = 512, timeSettings, onTimeOfDayChange, onTimeUpdate, }, ref) => {
10
+ const EnvironmentManager = forwardRef(({ environment, cubeCameraResolution = 512, timeSettings, onTimeOfDayChange, onTimeUpdate, onObjectReady, onObjectDispose, }, ref) => {
11
11
  const { scene } = useThree();
12
12
  const defaultHdr = {
13
13
  visible: false,
@@ -68,7 +68,7 @@ const EnvironmentManager = forwardRef(({ environment, cubeCameraResolution = 512
68
68
  scale: hdr.settings.groundScale,
69
69
  } }));
70
70
  }, [playlistActive, singleUrl, backgroundName, hdr.settings, scene]);
71
- return (_jsxs(_Fragment, { children: [environmentComponent, playlistActive && urls && (_jsx(HdrPlaylistRenderer, { urls: urls, transition: getTransitionSettings(hdr) })), _jsx(SkySystem, { ref: ref, timeSettings: timeSettings, visible: true, sunSystemVisible: sunSystemVisible, sunSize: sunSize, moonSize: moonSize, skyboxScale: skyboxScale, sunIntensity: sunIntensity, castShadow: castShadow, shadowMapSize: shadowMapSize, playerPosition: playerPosition, starsSettings: starsSettings, cloudsSettings: cloudsSettings, cloudsMaterialSettings: cloudsMaterialSettings, skyControllerSettings: skyControllerSettings, rainSettings: rainSettings, fogSettings: fogSettings, onTimeOfDayChange: onTimeOfDayChange, onTimeUpdate: onTimeUpdate })] }));
71
+ return (_jsxs(_Fragment, { children: [environmentComponent, playlistActive && urls && (_jsx(HdrPlaylistRenderer, { urls: urls, transition: getTransitionSettings(hdr), onObjectReady: onObjectReady, onObjectDispose: onObjectDispose })), _jsx(SkySystem, { ref: ref, timeSettings: timeSettings, visible: true, sunSystemVisible: sunSystemVisible, sunSize: sunSize, moonSize: moonSize, skyboxScale: skyboxScale, sunIntensity: sunIntensity, castShadow: castShadow, shadowMapSize: shadowMapSize, playerPosition: playerPosition, starsSettings: starsSettings, cloudsSettings: cloudsSettings, cloudsMaterialSettings: cloudsMaterialSettings, skyControllerSettings: skyControllerSettings, rainSettings: rainSettings, fogSettings: fogSettings, onTimeOfDayChange: onTimeOfDayChange, onTimeUpdate: onTimeUpdate, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose })] }));
72
72
  });
73
73
  EnvironmentManager.displayName = 'EnvironmentManager';
74
74
  export default EnvironmentManager;
@@ -1,6 +1,7 @@
1
+ import type { ObjectReadyProps } from '../types/objectReady';
1
2
  import React from "react";
2
3
  import type { CreatedObjectSettings } from "@3driseai/3drise-core";
3
- type EnvironmentObjectProps = {
4
+ type EnvironmentObjectProps = ObjectReadyProps & {
4
5
  createdObject: CreatedObjectSettings;
5
6
  };
6
7
  declare const EnvironmentObject: React.FC<EnvironmentObjectProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentObject.d.ts","sourceRoot":"","sources":["../../src/components/EnvironmentObject.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,KAAK,sBAAsB,GAAG;IAC1B,aAAa,EAAE,qBAAqB,CAAC;CACxC,CAAC;AAGF,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAUvD,CAAC;AACF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"EnvironmentObject.d.ts","sourceRoot":"","sources":["../../src/components/EnvironmentObject.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,KAAK,sBAAsB,GAAG,gBAAgB,GAAG;IAC7C,aAAa,EAAE,qBAAqB,CAAC;CACxC,CAAC;AAGF,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAUvD,CAAC;AACF,eAAe,iBAAiB,CAAC"}
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import Rain from './Rain.js';
3
- const EnvironmentObject = ({ createdObject }) => {
3
+ const EnvironmentObject = ({ createdObject, onObjectReady, onObjectDispose }) => {
4
4
  const config = createdObject.config;
5
5
  if (!config || config.enabled === false)
6
6
  return null;
7
7
  switch (config.type) {
8
8
  case 'rain':
9
- return _jsx(Rain, { settings: createdObject });
9
+ return _jsx(Rain, { settings: createdObject, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose });
10
10
  default:
11
11
  return null;
12
12
  }
@@ -1,9 +1,10 @@
1
+ import type { ObjectReadyProps } from '../types/objectReady';
1
2
  import type { Object3D } from 'three';
2
3
  import type { CreatedObjectSettings, HoverSettings, GalleryLayoutSettings, TransformEffect, ColorEffect, MaterialSettings } from '@3driseai/3drise-core';
3
4
  import type { FrameShapeType } from './FrameGeometry';
4
5
  import { type ThreeEvent } from "@react-three/fiber";
5
6
  export type { FrameShapeType };
6
- export interface FrameProps {
7
+ export interface FrameProps extends ObjectReadyProps {
7
8
  url: string;
8
9
  isActive: boolean;
9
10
  createdObject: CreatedObjectSettings;
@@ -19,5 +20,5 @@ export interface FrameProps {
19
20
  children?: React.ReactNode;
20
21
  handleObjectClick?: (createdObject: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
21
22
  }
22
- export default function Frame({ url, isActive, createdObject, position, rotation, shapeType, hoverSettings, transformEffects, colorEffects, layoutSettings, side, materialSettings, children, handleObjectClick, }: FrameProps): import("react").JSX.Element;
23
+ export default function Frame({ url, isActive, createdObject, position, rotation, shapeType, hoverSettings, transformEffects, colorEffects, layoutSettings, side, materialSettings, children, handleObjectClick, onObjectReady, onObjectDispose, }: FrameProps): import("react").JSX.Element;
23
24
  //# sourceMappingURL=Frame.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Frame.d.ts","sourceRoot":"","sources":["../../src/components/Frame.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,qBAAqB,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzJ,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKtD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,MAAM,WAAW,UAAU;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,qBAAqB,CAAC;IACrC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;IACrC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,cAAc,EAAE,qBAAqB,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACpH;AAGD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAoB,EAAE,aAAa,EAAE,gBAAqB,EAAE,YAAiB,EAAE,cAAc,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,iBAAiB,GAAG,EAAE,UAAU,+BA2ClP"}
1
+ {"version":3,"file":"Frame.d.ts","sourceRoot":"","sources":["../../src/components/Frame.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAI7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,qBAAqB,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzJ,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKtD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,MAAM,WAAW,UAAW,SAAQ,gBAAgB;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,qBAAqB,CAAC;IACrC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;IACrC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,cAAc,EAAE,qBAAqB,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACpH;AAGD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAoB,EAAE,aAAa,EAAE,gBAAqB,EAAE,YAAiB,EAAE,cAAc,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,aAAa,EAAE,eAAe,GAAG,EAAE,UAAU,+BA4ClR"}