@ntalmagor/3drize-viewer 0.1.2

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 (337) hide show
  1. package/dist/components/AnimatedObject.d.ts +22 -0
  2. package/dist/components/AnimatedObject.d.ts.map +1 -0
  3. package/dist/components/AnimatedObject.js +121 -0
  4. package/dist/components/CameraController.d.ts +16 -0
  5. package/dist/components/CameraController.d.ts.map +1 -0
  6. package/dist/components/CameraController.js +132 -0
  7. package/dist/components/Clouds.d.ts +14 -0
  8. package/dist/components/Clouds.d.ts.map +1 -0
  9. package/dist/components/Clouds.js +97 -0
  10. package/dist/components/CreatedObject.d.ts +12 -0
  11. package/dist/components/CreatedObject.d.ts.map +1 -0
  12. package/dist/components/CreatedObject.js +139 -0
  13. package/dist/components/CustomPrimitive.d.ts +12 -0
  14. package/dist/components/CustomPrimitive.d.ts.map +1 -0
  15. package/dist/components/CustomPrimitive.js +80 -0
  16. package/dist/components/EffectsGenerator.d.ts +10 -0
  17. package/dist/components/EffectsGenerator.d.ts.map +1 -0
  18. package/dist/components/EffectsGenerator.js +59 -0
  19. package/dist/components/EffectsGroup.d.ts +8 -0
  20. package/dist/components/EffectsGroup.d.ts.map +1 -0
  21. package/dist/components/EffectsGroup.js +8 -0
  22. package/dist/components/EnvironmentManager.d.ts +9 -0
  23. package/dist/components/EnvironmentManager.d.ts.map +1 -0
  24. package/dist/components/EnvironmentManager.js +47 -0
  25. package/dist/components/Frame.d.ts +26 -0
  26. package/dist/components/Frame.d.ts.map +1 -0
  27. package/dist/components/Frame.js +50 -0
  28. package/dist/components/FrameGeometry.d.ts +10 -0
  29. package/dist/components/FrameGeometry.d.ts.map +1 -0
  30. package/dist/components/FrameGeometry.js +17 -0
  31. package/dist/components/FrameImage.d.ts +14 -0
  32. package/dist/components/FrameImage.d.ts.map +1 -0
  33. package/dist/components/FrameImage.js +15 -0
  34. package/dist/components/Galaxy.d.ts +8 -0
  35. package/dist/components/Galaxy.d.ts.map +1 -0
  36. package/dist/components/Galaxy.js +9 -0
  37. package/dist/components/GalleryLayout.d.ts +10 -0
  38. package/dist/components/GalleryLayout.d.ts.map +1 -0
  39. package/dist/components/GalleryLayout.js +18 -0
  40. package/dist/components/GridHelper.d.ts +23 -0
  41. package/dist/components/GridHelper.d.ts.map +1 -0
  42. package/dist/components/GridHelper.js +38 -0
  43. package/dist/components/ImageGeometry.d.ts +14 -0
  44. package/dist/components/ImageGeometry.d.ts.map +1 -0
  45. package/dist/components/ImageGeometry.js +62 -0
  46. package/dist/components/Lensflare.d.ts +12 -0
  47. package/dist/components/Lensflare.d.ts.map +1 -0
  48. package/dist/components/Lensflare.js +66 -0
  49. package/dist/components/Letter.d.ts +20 -0
  50. package/dist/components/Letter.d.ts.map +1 -0
  51. package/dist/components/Letter.js +83 -0
  52. package/dist/components/Letters.d.ts +16 -0
  53. package/dist/components/Letters.d.ts.map +1 -0
  54. package/dist/components/Letters.js +18 -0
  55. package/dist/components/LightsManager.d.ts +9 -0
  56. package/dist/components/LightsManager.d.ts.map +1 -0
  57. package/dist/components/LightsManager.js +121 -0
  58. package/dist/components/Lines.d.ts +9 -0
  59. package/dist/components/Lines.d.ts.map +1 -0
  60. package/dist/components/Lines.js +19 -0
  61. package/dist/components/LoadingIndicator.d.ts +10 -0
  62. package/dist/components/LoadingIndicator.d.ts.map +1 -0
  63. package/dist/components/LoadingIndicator.js +143 -0
  64. package/dist/components/MaterialLibrary.d.ts +9 -0
  65. package/dist/components/MaterialLibrary.d.ts.map +1 -0
  66. package/dist/components/MaterialLibrary.js +57 -0
  67. package/dist/components/Moon.d.ts +13 -0
  68. package/dist/components/Moon.d.ts.map +1 -0
  69. package/dist/components/Moon.js +52 -0
  70. package/dist/components/ObjectNode.d.ts +11 -0
  71. package/dist/components/ObjectNode.d.ts.map +1 -0
  72. package/dist/components/ObjectNode.js +61 -0
  73. package/dist/components/ObjectsRenderer.d.ts +11 -0
  74. package/dist/components/ObjectsRenderer.d.ts.map +1 -0
  75. package/dist/components/ObjectsRenderer.js +19 -0
  76. package/dist/components/Ocean.d.ts +8 -0
  77. package/dist/components/Ocean.d.ts.map +1 -0
  78. package/dist/components/Ocean.js +111 -0
  79. package/dist/components/ParticlesR3f.d.ts +16 -0
  80. package/dist/components/ParticlesR3f.d.ts.map +1 -0
  81. package/dist/components/ParticlesR3f.js +66 -0
  82. package/dist/components/Path.d.ts +13 -0
  83. package/dist/components/Path.d.ts.map +1 -0
  84. package/dist/components/Path.js +41 -0
  85. package/dist/components/PathGeometry.d.ts +11 -0
  86. package/dist/components/PathGeometry.d.ts.map +1 -0
  87. package/dist/components/PathGeometry.js +109 -0
  88. package/dist/components/PathRenderer.d.ts +14 -0
  89. package/dist/components/PathRenderer.d.ts.map +1 -0
  90. package/dist/components/PathRenderer.js +33 -0
  91. package/dist/components/ProductionScene.d.ts +29 -0
  92. package/dist/components/ProductionScene.d.ts.map +1 -0
  93. package/dist/components/ProductionScene.js +18 -0
  94. package/dist/components/ProjectLoader.d.ts +14 -0
  95. package/dist/components/ProjectLoader.d.ts.map +1 -0
  96. package/dist/components/ProjectLoader.js +76 -0
  97. package/dist/components/Rain.d.ts +8 -0
  98. package/dist/components/Rain.d.ts.map +1 -0
  99. package/dist/components/Rain.js +133 -0
  100. package/dist/components/SceneBuilder.d.ts +5 -0
  101. package/dist/components/SceneBuilder.d.ts.map +1 -0
  102. package/dist/components/SceneBuilder.js +104 -0
  103. package/dist/components/SceneFog.d.ts +8 -0
  104. package/dist/components/SceneFog.d.ts.map +1 -0
  105. package/dist/components/SceneFog.js +19 -0
  106. package/dist/components/ShootingStar.d.ts +16 -0
  107. package/dist/components/ShootingStar.d.ts.map +1 -0
  108. package/dist/components/ShootingStar.js +92 -0
  109. package/dist/components/ShootingStars.d.ts +8 -0
  110. package/dist/components/ShootingStars.d.ts.map +1 -0
  111. package/dist/components/ShootingStars.js +40 -0
  112. package/dist/components/SkyController.d.ts +10 -0
  113. package/dist/components/SkyController.d.ts.map +1 -0
  114. package/dist/components/SkyController.js +159 -0
  115. package/dist/components/SkyMesh.d.ts +11 -0
  116. package/dist/components/SkyMesh.d.ts.map +1 -0
  117. package/dist/components/SkyMesh.js +36 -0
  118. package/dist/components/SkySystem.d.ts +34 -0
  119. package/dist/components/SkySystem.d.ts.map +1 -0
  120. package/dist/components/SkySystem.js +47 -0
  121. package/dist/components/Skybox.d.ts +12 -0
  122. package/dist/components/Skybox.d.ts.map +1 -0
  123. package/dist/components/Skybox.js +79 -0
  124. package/dist/components/Stars.d.ts +14 -0
  125. package/dist/components/Stars.d.ts.map +1 -0
  126. package/dist/components/Stars.js +165 -0
  127. package/dist/components/SunLight.d.ts +15 -0
  128. package/dist/components/SunLight.d.ts.map +1 -0
  129. package/dist/components/SunLight.js +57 -0
  130. package/dist/components/Text2D.d.ts +9 -0
  131. package/dist/components/Text2D.d.ts.map +1 -0
  132. package/dist/components/Text2D.js +56 -0
  133. package/dist/components/Text3D.d.ts +10 -0
  134. package/dist/components/Text3D.d.ts.map +1 -0
  135. package/dist/components/Text3D.js +8 -0
  136. package/dist/components/effects/AuraEffect.d.ts +10 -0
  137. package/dist/components/effects/AuraEffect.d.ts.map +1 -0
  138. package/dist/components/effects/AuraEffect.js +127 -0
  139. package/dist/components/effects/AuroraEffect.d.ts +10 -0
  140. package/dist/components/effects/AuroraEffect.d.ts.map +1 -0
  141. package/dist/components/effects/AuroraEffect.js +112 -0
  142. package/dist/components/effects/BlackHoleEffect.d.ts +10 -0
  143. package/dist/components/effects/BlackHoleEffect.d.ts.map +1 -0
  144. package/dist/components/effects/BlackHoleEffect.js +193 -0
  145. package/dist/components/effects/ConstellationEffect.d.ts +10 -0
  146. package/dist/components/effects/ConstellationEffect.d.ts.map +1 -0
  147. package/dist/components/effects/ConstellationEffect.js +189 -0
  148. package/dist/components/effects/DataStreamEffect.d.ts +10 -0
  149. package/dist/components/effects/DataStreamEffect.d.ts.map +1 -0
  150. package/dist/components/effects/DataStreamEffect.js +138 -0
  151. package/dist/components/effects/DnaHelixEffect.d.ts +10 -0
  152. package/dist/components/effects/DnaHelixEffect.d.ts.map +1 -0
  153. package/dist/components/effects/DnaHelixEffect.js +311 -0
  154. package/dist/components/effects/FireEffect.d.ts +10 -0
  155. package/dist/components/effects/FireEffect.d.ts.map +1 -0
  156. package/dist/components/effects/FireEffect.js +194 -0
  157. package/dist/components/effects/ForcefieldEffect.d.ts +10 -0
  158. package/dist/components/effects/ForcefieldEffect.d.ts.map +1 -0
  159. package/dist/components/effects/ForcefieldEffect.js +132 -0
  160. package/dist/components/effects/HologramEffect.d.ts +10 -0
  161. package/dist/components/effects/HologramEffect.d.ts.map +1 -0
  162. package/dist/components/effects/HologramEffect.js +143 -0
  163. package/dist/components/effects/IceCrystalsEffect.d.ts +10 -0
  164. package/dist/components/effects/IceCrystalsEffect.d.ts.map +1 -0
  165. package/dist/components/effects/IceCrystalsEffect.js +190 -0
  166. package/dist/components/effects/LightningEffect.d.ts +10 -0
  167. package/dist/components/effects/LightningEffect.d.ts.map +1 -0
  168. package/dist/components/effects/LightningEffect.js +240 -0
  169. package/dist/components/effects/MoleculesEffect.d.ts +10 -0
  170. package/dist/components/effects/MoleculesEffect.d.ts.map +1 -0
  171. package/dist/components/effects/MoleculesEffect.js +179 -0
  172. package/dist/components/effects/NeuralNetworkEffect.d.ts +10 -0
  173. package/dist/components/effects/NeuralNetworkEffect.d.ts.map +1 -0
  174. package/dist/components/effects/NeuralNetworkEffect.js +188 -0
  175. package/dist/components/effects/OrbEffect.d.ts +10 -0
  176. package/dist/components/effects/OrbEffect.d.ts.map +1 -0
  177. package/dist/components/effects/OrbEffect.js +291 -0
  178. package/dist/components/effects/PortalEffect.d.ts +10 -0
  179. package/dist/components/effects/PortalEffect.d.ts.map +1 -0
  180. package/dist/components/effects/PortalEffect.js +191 -0
  181. package/dist/components/effects/ShockwaveEffect.d.ts +10 -0
  182. package/dist/components/effects/ShockwaveEffect.d.ts.map +1 -0
  183. package/dist/components/effects/ShockwaveEffect.js +159 -0
  184. package/dist/components/effects/SmokePlumeEffect.d.ts +10 -0
  185. package/dist/components/effects/SmokePlumeEffect.d.ts.map +1 -0
  186. package/dist/components/effects/SmokePlumeEffect.js +141 -0
  187. package/dist/components/effects/SmokeRingEffect.d.ts +10 -0
  188. package/dist/components/effects/SmokeRingEffect.d.ts.map +1 -0
  189. package/dist/components/effects/SmokeRingEffect.js +158 -0
  190. package/dist/components/effects/VolumetricFogEffect.d.ts +10 -0
  191. package/dist/components/effects/VolumetricFogEffect.d.ts.map +1 -0
  192. package/dist/components/effects/VolumetricFogEffect.js +111 -0
  193. package/dist/constants.d.ts +2 -0
  194. package/dist/constants.d.ts.map +1 -0
  195. package/dist/constants.js +1 -0
  196. package/dist/hooks/index.d.ts +1 -0
  197. package/dist/hooks/index.d.ts.map +1 -0
  198. package/dist/hooks/index.js +1 -0
  199. package/dist/hooks/useAnimationEvents.d.ts +10 -0
  200. package/dist/hooks/useAnimationEvents.d.ts.map +1 -0
  201. package/dist/hooks/useAnimationEvents.js +28 -0
  202. package/dist/hooks/useCameraAnimation.d.ts +35 -0
  203. package/dist/hooks/useCameraAnimation.d.ts.map +1 -0
  204. package/dist/hooks/useCameraAnimation.js +268 -0
  205. package/dist/hooks/useContinuousEffects.d.ts +15 -0
  206. package/dist/hooks/useContinuousEffects.d.ts.map +1 -0
  207. package/dist/hooks/useContinuousEffects.js +173 -0
  208. package/dist/hooks/useCubeCamera.d.ts +19 -0
  209. package/dist/hooks/useCubeCamera.d.ts.map +1 -0
  210. package/dist/hooks/useCubeCamera.js +73 -0
  211. package/dist/hooks/useEnvironmentEffects.d.ts +12 -0
  212. package/dist/hooks/useEnvironmentEffects.d.ts.map +1 -0
  213. package/dist/hooks/useEnvironmentEffects.js +22 -0
  214. package/dist/hooks/useFrameEffects.d.ts +6 -0
  215. package/dist/hooks/useFrameEffects.d.ts.map +1 -0
  216. package/dist/hooks/useFrameEffects.js +19 -0
  217. package/dist/hooks/useInteractionEffects.d.ts +11 -0
  218. package/dist/hooks/useInteractionEffects.d.ts.map +1 -0
  219. package/dist/hooks/useInteractionEffects.js +35 -0
  220. package/dist/hooks/useKey.d.ts +26 -0
  221. package/dist/hooks/useKey.d.ts.map +1 -0
  222. package/dist/hooks/useKey.js +73 -0
  223. package/dist/hooks/useLightHandlers.d.ts +14 -0
  224. package/dist/hooks/useLightHandlers.d.ts.map +1 -0
  225. package/dist/hooks/useLightHandlers.js +116 -0
  226. package/dist/hooks/useMaterialApplication.d.ts +9 -0
  227. package/dist/hooks/useMaterialApplication.d.ts.map +1 -0
  228. package/dist/hooks/useMaterialApplication.js +113 -0
  229. package/dist/hooks/useMaterialOptions.d.ts +13 -0
  230. package/dist/hooks/useMaterialOptions.d.ts.map +1 -0
  231. package/dist/hooks/useMaterialOptions.js +110 -0
  232. package/dist/hooks/useMaterialUniforms.d.ts +18 -0
  233. package/dist/hooks/useMaterialUniforms.d.ts.map +1 -0
  234. package/dist/hooks/useMaterialUniforms.js +96 -0
  235. package/dist/hooks/useMeshController.d.ts +3 -0
  236. package/dist/hooks/useMeshController.d.ts.map +1 -0
  237. package/dist/hooks/useMeshController.js +152 -0
  238. package/dist/hooks/useMouseHandlers.d.ts +8 -0
  239. package/dist/hooks/useMouseHandlers.d.ts.map +1 -0
  240. package/dist/hooks/useMouseHandlers.js +47 -0
  241. package/dist/hooks/useObjectAnimation.d.ts +13 -0
  242. package/dist/hooks/useObjectAnimation.d.ts.map +1 -0
  243. package/dist/hooks/useObjectAnimation.js +11 -0
  244. package/dist/hooks/useObjectEdges.d.ts +4 -0
  245. package/dist/hooks/useObjectEdges.d.ts.map +1 -0
  246. package/dist/hooks/useObjectEdges.js +199 -0
  247. package/dist/hooks/useOrbitControls.d.ts +7 -0
  248. package/dist/hooks/useOrbitControls.d.ts.map +1 -0
  249. package/dist/hooks/useOrbitControls.js +9 -0
  250. package/dist/hooks/useParticlePositions.d.ts +19 -0
  251. package/dist/hooks/useParticlePositions.d.ts.map +1 -0
  252. package/dist/hooks/useParticlePositions.js +56 -0
  253. package/dist/hooks/useParticlesColors.d.ts +14 -0
  254. package/dist/hooks/useParticlesColors.d.ts.map +1 -0
  255. package/dist/hooks/useParticlesColors.js +27 -0
  256. package/dist/hooks/useParticlesTextures.d.ts +10 -0
  257. package/dist/hooks/useParticlesTextures.d.ts.map +1 -0
  258. package/dist/hooks/useParticlesTextures.js +23 -0
  259. package/dist/hooks/usePathAnimation.d.ts +26 -0
  260. package/dist/hooks/usePathAnimation.d.ts.map +1 -0
  261. package/dist/hooks/usePathAnimation.js +120 -0
  262. package/dist/hooks/useSkyAnimation.d.ts +14 -0
  263. package/dist/hooks/useSkyAnimation.d.ts.map +1 -0
  264. package/dist/hooks/useSkyAnimation.js +46 -0
  265. package/dist/hooks/useSkySystem.d.ts +26 -0
  266. package/dist/hooks/useSkySystem.d.ts.map +1 -0
  267. package/dist/hooks/useSkySystem.js +57 -0
  268. package/dist/hooks/useSkyUniforms.d.ts +18 -0
  269. package/dist/hooks/useSkyUniforms.d.ts.map +1 -0
  270. package/dist/hooks/useSkyUniforms.js +59 -0
  271. package/dist/hooks/useTransformControls.d.ts +6 -0
  272. package/dist/hooks/useTransformControls.d.ts.map +1 -0
  273. package/dist/hooks/useTransformControls.js +111 -0
  274. package/dist/hooks/useWaterEnvironment.d.ts +5 -0
  275. package/dist/hooks/useWaterEnvironment.d.ts.map +1 -0
  276. package/dist/hooks/useWaterEnvironment.js +27 -0
  277. package/dist/hooks/useWaterReflections.d.ts +17 -0
  278. package/dist/hooks/useWaterReflections.d.ts.map +1 -0
  279. package/dist/hooks/useWaterReflections.js +77 -0
  280. package/dist/index.d.ts +140 -0
  281. package/dist/index.d.ts.map +1 -0
  282. package/dist/index.js +109 -0
  283. package/dist/services/AnimationsManager.d.ts +33 -0
  284. package/dist/services/AnimationsManager.d.ts.map +1 -0
  285. package/dist/services/AnimationsManager.js +58 -0
  286. package/dist/services/FontManager.d.ts +32 -0
  287. package/dist/services/FontManager.d.ts.map +1 -0
  288. package/dist/services/FontManager.js +76 -0
  289. package/dist/services/TexturesManager.d.ts +17 -0
  290. package/dist/services/TexturesManager.d.ts.map +1 -0
  291. package/dist/services/TexturesManager.js +48 -0
  292. package/dist/shaders/RainMaterial.d.ts +34 -0
  293. package/dist/shaders/RainMaterial.d.ts.map +1 -0
  294. package/dist/shaders/RainMaterial.js +56 -0
  295. package/dist/shaders/ShaderEffectsMaterial.d.ts +279 -0
  296. package/dist/shaders/ShaderEffectsMaterial.d.ts.map +1 -0
  297. package/dist/shaders/ShaderEffectsMaterial.js +257 -0
  298. package/dist/shaders/ShootingStarMaterial.d.ts +14 -0
  299. package/dist/shaders/ShootingStarMaterial.d.ts.map +1 -0
  300. package/dist/shaders/ShootingStarMaterial.js +33 -0
  301. package/dist/shaders/SkyboxMaterial.d.ts +38 -0
  302. package/dist/shaders/SkyboxMaterial.d.ts.map +1 -0
  303. package/dist/shaders/SkyboxMaterial.js +57 -0
  304. package/dist/shaders/effects/EffectsVertexFunctions.glsl.d.ts +2 -0
  305. package/dist/shaders/effects/EffectsVertexFunctions.glsl.d.ts.map +1 -0
  306. package/dist/shaders/effects/EffectsVertexFunctions.glsl.js +167 -0
  307. package/dist/utils/CameraSingleton.d.ts +35 -0
  308. package/dist/utils/CameraSingleton.d.ts.map +1 -0
  309. package/dist/utils/CameraSingleton.js +178 -0
  310. package/dist/utils/anchorUtils.d.ts +10 -0
  311. package/dist/utils/anchorUtils.d.ts.map +1 -0
  312. package/dist/utils/anchorUtils.js +13 -0
  313. package/dist/utils/frameAnimations.d.ts +49 -0
  314. package/dist/utils/frameAnimations.d.ts.map +1 -0
  315. package/dist/utils/frameAnimations.js +213 -0
  316. package/dist/utils/handleGenerativeEffectsAnimations.d.ts +5 -0
  317. package/dist/utils/handleGenerativeEffectsAnimations.d.ts.map +1 -0
  318. package/dist/utils/handleGenerativeEffectsAnimations.js +268 -0
  319. package/dist/utils/hasHoverAnimation.d.ts +3 -0
  320. package/dist/utils/hasHoverAnimation.d.ts.map +1 -0
  321. package/dist/utils/hasHoverAnimation.js +15 -0
  322. package/dist/utils/particleAnimations.d.ts +3 -0
  323. package/dist/utils/particleAnimations.d.ts.map +1 -0
  324. package/dist/utils/particleAnimations.js +17 -0
  325. package/dist/utils/sceneQuery.d.ts +9 -0
  326. package/dist/utils/sceneQuery.d.ts.map +1 -0
  327. package/dist/utils/sceneQuery.js +22 -0
  328. package/dist/utils/shaderUtils.d.ts +6 -0
  329. package/dist/utils/shaderUtils.d.ts.map +1 -0
  330. package/dist/utils/shaderUtils.js +145 -0
  331. package/dist/utils/textEffects.d.ts +31 -0
  332. package/dist/utils/textEffects.d.ts.map +1 -0
  333. package/dist/utils/textEffects.js +61 -0
  334. package/dist/utils/utils3d.d.ts +7 -0
  335. package/dist/utils/utils3d.d.ts.map +1 -0
  336. package/dist/utils/utils3d.js +34 -0
  337. package/package.json +43 -0
@@ -0,0 +1,80 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React, { useRef, useEffect, memo, useState } from "react";
3
+ import { ObjectManager, createDefaultEffectState, applyTransformEffects } from "@ntalmagor/3drize-core";
4
+ // import ObjectManager from "~/utils/ObjectManager";
5
+ import { useMaterialApplication } from "../hooks/useMaterialApplication";
6
+ import { useFrame } from "@react-three/fiber";
7
+ import MaterialLibrary from "./MaterialLibrary";
8
+ // import type { AnimatedTransform } from "~/types/mesh";
9
+ import CreatedObject from "./CreatedObject";
10
+ import { useFrameEffects } from "../hooks/useFrameEffects";
11
+ const CustomPrimitive = memo(({ createdObject, cameraSettings, updateObjectSettings, onObjectReady, }) => {
12
+ // const { handleObjectClick } = useSceneClick();
13
+ // console.log("Rendering CustomPrimitive with settings:", createdObject.name, createdObject);
14
+ const meshRef = useRef(null);
15
+ const effectStateRef = useRef(null);
16
+ const [animatedTransform, setAnimatedTransform] = React.useState({
17
+ position: createdObject.meshSettings.position,
18
+ rotation: createdObject.meshSettings.rotation,
19
+ scale: createdObject.meshSettings.scale,
20
+ });
21
+ // Initialize transform controls
22
+ const { handlePointerEnter, handlePointerLeave, hovered } = useFrameEffects(true);
23
+ useEffect(() => {
24
+ setAnimatedTransform({
25
+ position: createdObject.meshSettings.position,
26
+ rotation: createdObject.meshSettings.rotation,
27
+ scale: createdObject.meshSettings.scale,
28
+ });
29
+ }, [createdObject.meshSettings.position, createdObject.meshSettings.rotation, createdObject.meshSettings.scale]);
30
+ // Derive material flags before any early return so hooks are always called in the same order
31
+ const useDreiMaterials = createdObject.materialSettings.materialType === "advanced";
32
+ const apply3driseMaterials = !useDreiMaterials;
33
+ // Hide the model until the 3drise material is applied to prevent a flash of original GLTF materials.
34
+ // If no 3drise material variant is set, or Drei materials are used, show immediately.
35
+ const willApplyMaterial = apply3driseMaterials && !!createdObject.materialSettings.materialVariant;
36
+ const [materialReady, setMaterialReady] = useState(!willApplyMaterial);
37
+ // Get the actual Three.js object from ObjectManager
38
+ const obj = ObjectManager.getObject(createdObject.id);
39
+ // console.log("CustomPrimitive - Retrieved object from ObjectManager:", obj);
40
+ // Apply material directly to obj.object (always non-null when obj exists, available before the
41
+ // outer group ref is committed) so the material is ready on the first visible frame.
42
+ useMaterialApplication(obj?.object ?? null, createdObject.materialSettings, apply3driseMaterials, () => setMaterialReady(true));
43
+ if (!obj) {
44
+ // console.warn(`CustomPrimitive - Object with ID ${createdObject.id} not found.`);
45
+ return null;
46
+ }
47
+ // const { sensitivity = 0.5, applyToChildren = false } = createdObject.interactions. || {};
48
+ const sensitivity = 0.5;
49
+ const applyToChildren = false;
50
+ const clicked = false;
51
+ const transformEffects = createdObject.animations?.transform?.effects || []; // Array of effects from transform domain
52
+ const enabledTransformEffects = transformEffects.filter(e => e.enabled);
53
+ // console.log(isSelected)
54
+ useFrame((state, dt) => {
55
+ if (!meshRef.current || !applyToChildren)
56
+ return;
57
+ const time = state.clock.elapsedTime;
58
+ // Initialize effect state if needed
59
+ if (!effectStateRef.current && meshRef.current) {
60
+ effectStateRef.current = createDefaultEffectState(meshRef.current);
61
+ }
62
+ // Apply transform effects from new continuous structure (multiple effects)
63
+ if (enabledTransformEffects.length > 0 && effectStateRef.current) {
64
+ applyTransformEffects(meshRef.current, enabledTransformEffects, // Pass array of enabled effects
65
+ time, dt, effectStateRef.current, hovered, clicked, sensitivity);
66
+ }
67
+ });
68
+ const geometry = obj.object.geometry;
69
+ return (
70
+ // <Select enabled={isSelected}>
71
+ _jsx(CreatedObject, { createdObject: createdObject, shouldApply3driseMaterial: false,
72
+ // Outer group must be registered so transform animations and edges share the same root
73
+ onObjectReady: (object, ref) => {
74
+ onObjectReady && onObjectReady(object, ref);
75
+ }, children: _jsx("primitive", { ref: meshRef, name: obj.name, object: obj.object, visible: materialReady && createdObject.meshSettings.visible, position: [0, 0, 0], rotation: [0, 0, 0], scale: [1, 1, 1], children: useDreiMaterials && createdObject.type === 'mesh' && createdObject.meshSettings.visible && (_jsx(MaterialLibrary, { materialSettings: createdObject.materialSettings })) }, obj.id) })
76
+ // {/* </Select> */}
77
+ );
78
+ });
79
+ CustomPrimitive.displayName = 'CustomPrimitive';
80
+ export default CustomPrimitive;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { Object3D } from 'three';
3
+ import type { GenerativeEffectSettings } from '@ntalmagor/3drize-core';
4
+ export interface EffectsGeneratorProps {
5
+ settings: GenerativeEffectSettings;
6
+ object?: Object3D;
7
+ }
8
+ declare const EffectsGenerator: React.FC<EffectsGeneratorProps>;
9
+ export default EffectsGenerator;
10
+ //# sourceMappingURL=EffectsGenerator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EffectsGenerator.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGenerator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAgB,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAsBvE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,wBAAwB,CAAC;IACnC,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB;AAED,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAoCrD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { Box3, Sphere } from 'three';
4
+ import MoleculesEffect from './effects/MoleculesEffect';
5
+ import ShockwaveEffect from './effects/ShockwaveEffect';
6
+ import AuraEffect from './effects/AuraEffect';
7
+ import DataStreamEffect from './effects/DataStreamEffect';
8
+ import ConstellationEffect from './effects/ConstellationEffect';
9
+ import HologramEffect from './effects/HologramEffect';
10
+ import PortalEffect from './effects/PortalEffect';
11
+ import DnaHelixEffect from './effects/DnaHelixEffect';
12
+ import OrbEffect from './effects/OrbEffect';
13
+ import LightningEffect from './effects/LightningEffect';
14
+ import AuroraEffect from './effects/AuroraEffect';
15
+ import FireEffect from './effects/FireEffect';
16
+ import ForcefieldEffect from './effects/ForcefieldEffect';
17
+ import NeuralNetworkEffect from './effects/NeuralNetworkEffect';
18
+ import BlackHoleEffect from './effects/BlackHoleEffect';
19
+ import IceCrystalsEffect from './effects/IceCrystalsEffect';
20
+ import SmokePlumeEffect from './effects/SmokePlumeEffect';
21
+ import VolumetricFogEffect from './effects/VolumetricFogEffect';
22
+ import SmokeRingEffect from './effects/SmokeRingEffect';
23
+ const EffectsGenerator = ({ settings, object }) => {
24
+ if (!settings.enabled)
25
+ return null;
26
+ const boundingRadius = useMemo(() => {
27
+ if (!object)
28
+ return 1;
29
+ const box = new Box3().setFromObject(object);
30
+ const sphere = new Sphere();
31
+ box.getBoundingSphere(sphere);
32
+ return sphere.radius || 1;
33
+ }, [object]);
34
+ const { config } = settings;
35
+ const animations = settings.animations;
36
+ switch (config.type) {
37
+ case 'molecules': return _jsx(MoleculesEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
38
+ case 'shockwave': return _jsx(ShockwaveEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
39
+ case 'aura': return _jsx(AuraEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
40
+ case 'dataStream': return _jsx(DataStreamEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
41
+ case 'constellation': return _jsx(ConstellationEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
42
+ case 'hologram': return _jsx(HologramEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
43
+ case 'portal': return _jsx(PortalEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
44
+ case 'dnaHelix': return _jsx(DnaHelixEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
45
+ case 'orb': return _jsx(OrbEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
46
+ case 'lightning': return _jsx(LightningEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
47
+ case 'aurora': return _jsx(AuroraEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
48
+ case 'fire': return _jsx(FireEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
49
+ case 'forcefield': return _jsx(ForcefieldEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
50
+ case 'neuralNetwork': return _jsx(NeuralNetworkEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
51
+ case 'blackHole': return _jsx(BlackHoleEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
52
+ case 'iceCrystals': return _jsx(IceCrystalsEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
53
+ case 'smokePlume': return _jsx(SmokePlumeEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
54
+ case 'volumetricFog': return _jsx(VolumetricFogEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
55
+ case 'smokeRing': return _jsx(SmokeRingEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
56
+ default: return null;
57
+ }
58
+ };
59
+ export default EffectsGenerator;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { CreatedObjectSettings } from '@ntalmagor/3drize-core';
3
+ interface EffectsGroupProps {
4
+ createdObject: CreatedObjectSettings;
5
+ }
6
+ declare const EffectsGroup: React.FC<EffectsGroupProps>;
7
+ export default EffectsGroup;
8
+ //# sourceMappingURL=EffectsGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EffectsGroup.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAGpE,UAAU,iBAAiB;IACzB,aAAa,EAAE,qBAAqB,CAAC;CACtC;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAS7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import EffectsGenerator from './EffectsGenerator';
3
+ const EffectsGroup = ({ createdObject }) => {
4
+ if (!createdObject.effects || createdObject.effects.length === 0)
5
+ return null;
6
+ return (_jsx("group", { name: `${createdObject.id}-effects`, children: createdObject.effects.map((effect, index) => (_jsx(EffectsGenerator, { settings: effect }, index))) }));
7
+ };
8
+ export default EffectsGroup;
@@ -0,0 +1,9 @@
1
+ import { type SkySystemRef, type SkySystemProps } from './SkySystem';
2
+ import type { HdrSettings } from '../../../core/src/types/environment';
3
+ export interface EnvironmentManagerProps extends SkySystemProps {
4
+ hdrSettings?: HdrSettings;
5
+ cubeCameraResolution?: number;
6
+ }
7
+ declare const EnvironmentManager: import("react").ForwardRefExoticComponent<EnvironmentManagerProps & import("react").RefAttributes<SkySystemRef>>;
8
+ export default EnvironmentManager;
9
+ //# sourceMappingURL=EnvironmentManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnvironmentManager.d.ts","sourceRoot":"","sources":["../../src/components/EnvironmentManager.tsx"],"names":[],"mappings":"AAGA,OAAkB,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAEhF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAGvE,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,QAAA,MAAM,kBAAkB,kHAoGtB,CAAC;AAIH,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo, forwardRef } from 'react';
3
+ import { Environment } from '@react-three/drei';
4
+ import { useThree } from '@react-three/fiber';
5
+ import SkySystem from './SkySystem';
6
+ import { useCubeCamera } from '../hooks/useCubeCamera';
7
+ const EnvironmentManager = forwardRef(({ hdrSettings, cubeCameraResolution = 512,
8
+ // SkySystemProps — all forwarded to SkySystem
9
+ timeSettings, visible = true, sunSystemVisible = false, sunSize, moonSize, skyboxScale, sunIntensity, castShadow, shadowMapSize, playerPosition, starsSettings, cloudsSettings, cloudsMaterialSettings, skyControllerSettings, rainSettings, fogSettings, onTimeOfDayChange, onTimeUpdate, }, ref) => {
10
+ const { scene } = useThree();
11
+ const defaultHdr = {
12
+ visible: false,
13
+ name: null,
14
+ settings: {
15
+ groundRadius: 200,
16
+ groundHeight: 10,
17
+ groundScale: 100,
18
+ blur: 0,
19
+ backgroundBlurriness: 0,
20
+ backgroundIntensity: 1,
21
+ backgroundRotation: 0,
22
+ environmentIntensity: 1,
23
+ environmentRotation: 0,
24
+ },
25
+ };
26
+ const hdr = hdrSettings ?? defaultHdr;
27
+ const backgroundName = hdr.visible ? hdr.name : null;
28
+ useCubeCamera({
29
+ hdrSettings: hdr,
30
+ skyVisible: visible ?? true,
31
+ sunSystemVisible: sunSystemVisible ?? false,
32
+ timeSettings,
33
+ resolution: cubeCameraResolution,
34
+ });
35
+ const environmentComponent = useMemo(() => {
36
+ if (!backgroundName)
37
+ return null;
38
+ return (_jsx(Environment, { preset: backgroundName, background: true, scene: scene, backgroundBlurriness: hdr.settings.backgroundBlurriness ?? 0, backgroundIntensity: hdr.settings.backgroundIntensity ?? 1, backgroundRotation: [0, hdr.settings.backgroundRotation ?? Math.PI / 2, 0], environmentIntensity: hdr.settings.environmentIntensity ?? 1, environmentRotation: [0, hdr.settings.environmentRotation ?? Math.PI / 2, 0], blur: hdr.settings.blur ?? 0, ground: {
39
+ radius: hdr.settings.groundRadius,
40
+ height: hdr.settings.groundHeight,
41
+ scale: hdr.settings.groundScale,
42
+ } }));
43
+ }, [backgroundName, hdr.settings, scene]);
44
+ return (_jsxs(_Fragment, { children: [environmentComponent, _jsx(SkySystem, { ref: ref, timeSettings: timeSettings, visible: visible, 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 })] }));
45
+ });
46
+ EnvironmentManager.displayName = 'EnvironmentManager';
47
+ export default EnvironmentManager;
@@ -0,0 +1,26 @@
1
+ import { type ThreeEvent } from '@react-three/fiber';
2
+ import { Mesh } from "three";
3
+ import type { CreatedObjectSettings, HoverSettings } from '@ntalmagor/3drize-core';
4
+ import type { GalleryLayoutSettings } from '@ntalmagor/3drize-core';
5
+ import type { TransformEffect, ColorEffect } from '@ntalmagor/3drize-core';
6
+ import type { MaterialSettings } from '@ntalmagor/3drize-core';
7
+ import { type FrameShapeType } from "./FrameGeometry";
8
+ export type { FrameShapeType };
9
+ export interface FrameProps {
10
+ url: string;
11
+ isActive: boolean;
12
+ createdObject: CreatedObjectSettings;
13
+ position?: [number, number, number];
14
+ rotation?: [number, number, number];
15
+ shapeType?: FrameShapeType;
16
+ hoverSettings: HoverSettings;
17
+ transformEffects?: TransformEffect[];
18
+ colorEffects?: ColorEffect[];
19
+ layoutSettings: GalleryLayoutSettings;
20
+ side: number;
21
+ materialSettings: MaterialSettings;
22
+ children?: React.ReactNode;
23
+ onFrameClick?: (createdObject: CreatedObjectSettings, mesh: Mesh, e: ThreeEvent<MouseEvent>) => void;
24
+ }
25
+ export default function Frame({ url, isActive, createdObject, position, rotation, shapeType, hoverSettings, transformEffects, colorEffects, layoutSettings, side, materialSettings, children, onFrameClick, }: FrameProps): import("react/jsx-runtime").JSX.Element | null;
26
+ //# sourceMappingURL=Frame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Frame.d.ts","sourceRoot":"","sources":["../../src/components/Frame.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAA0C,IAAI,EAAgB,MAAM,OAAO,CAAC;AACnF,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAgB,MAAM,wBAAwB,CAAC;AACjG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAMrE,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,MAAM,WAAW,UAAU;IACzB,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,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACtG;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,GAAG,EACH,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,SAAoB,EACpB,aAAa,EACb,gBAAqB,EACrB,YAAiB,EACjB,cAAc,EACd,IAAI,EACJ,gBAAgB,EAChB,QAAQ,EACR,YAAY,GACb,EAAE,UAAU,kDAkFZ"}
@@ -0,0 +1,50 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef, useState, useEffect } from "react";
3
+ import { useCursor } from "@react-three/drei";
4
+ import { BackSide, DoubleSide, FrontSide, Mesh } from "three";
5
+ import texturesManager from "../../../core/src/services/TexturesManager";
6
+ import { FrameGeometry } from "./FrameGeometry";
7
+ import { FrameImage } from "./FrameImage";
8
+ import MaterialLibrary from "./MaterialLibrary";
9
+ import { useFrameEffects } from "../hooks/useFrameEffects";
10
+ import { useObjectAnimation } from "../hooks/useObjectAnimation";
11
+ export default function Frame({ url, isActive, createdObject, position, rotation, shapeType = 'circle', hoverSettings, transformEffects = [], colorEffects = [], layoutSettings, side, materialSettings, children, onFrameClick, }) {
12
+ const frameRef = useRef(new Mesh());
13
+ const imageRef = useRef(null);
14
+ const [texture, setTexture] = useState(null);
15
+ useEffect(() => {
16
+ let mounted = true;
17
+ const existing = texturesManager.getTextureByUrl(url);
18
+ if (existing) {
19
+ setTexture(existing);
20
+ }
21
+ else {
22
+ const name = url.split('/').pop()?.split('.')[0] || `texture-${Date.now()}`;
23
+ texturesManager.loadTexture(name, url, 'images')
24
+ .then((loaded) => { if (mounted)
25
+ setTexture(loaded); })
26
+ .catch((err) => console.error('Failed to load texture:', err));
27
+ }
28
+ return () => { mounted = false; };
29
+ }, [url]);
30
+ const { handlePointerEnter, handlePointerLeave, hovered } = useFrameEffects(isActive);
31
+ useCursor(hovered);
32
+ const enabledEffects = transformEffects.filter(e => e.enabled !== false);
33
+ const animateMaterial = enabledEffects.length > 0 || colorEffects.some(e => e.enabled !== false);
34
+ useObjectAnimation(createdObject, animateMaterial, { enabled: true, hovered }, frameRef.current);
35
+ const scale = [
36
+ 0.9 * (layoutSettings.width || 1),
37
+ 0.9 * (layoutSettings.height || 1),
38
+ 0.9,
39
+ ];
40
+ const showFront = side === FrontSide || side === DoubleSide;
41
+ const showBack = side === BackSide || side === DoubleSide;
42
+ const handleObjectClick = (e) => {
43
+ if (!frameRef.current)
44
+ return;
45
+ onFrameClick?.(createdObject, frameRef.current, e);
46
+ };
47
+ if (!texture)
48
+ return null;
49
+ return (_jsx("mesh", { name: url, ref: frameRef, position: position, rotation: rotation, scale: scale, raycast: () => null, onPointerEnter: handlePointerEnter, onPointerLeave: handlePointerLeave, onClick: handleObjectClick, children: children ? children : (_jsxs(_Fragment, { children: [_jsx(FrameGeometry, { shapeType: 'rectangle', layoutSettings: layoutSettings, scale: layoutSettings.outerFrameScale }), _jsx(MaterialLibrary, { materialSettings: materialSettings }), showFront && (_jsx(FrameImage, { ref: imageRef, texture: texture, shapeType: 'rectangle', position: [0, 0, 0.02] })), showBack && (_jsx(FrameImage, { texture: texture, shapeType: 'rectangle', position: [0, 0, -0.02], rotation: [0, Math.PI, 0], isBack: true }))] })) }));
50
+ }
@@ -0,0 +1,10 @@
1
+ import type { GalleryLayoutSettings } from '@ntalmagor/3drize-core';
2
+ export type FrameShapeType = 'rectangle' | 'ellipse' | 'circle' | 'roundedRectangle';
3
+ interface FrameGeometryProps {
4
+ shapeType: FrameShapeType;
5
+ scale?: number;
6
+ layoutSettings?: GalleryLayoutSettings;
7
+ }
8
+ export declare function FrameGeometry({ shapeType, scale, layoutSettings }: FrameGeometryProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=FrameGeometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FrameGeometry.d.ts","sourceRoot":"","sources":["../../src/components/FrameGeometry.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,kBAAkB,CAAC;AAErF,UAAU,kBAAkB;IAC1B,SAAS,EAAE,cAAc,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,qBAAqB,CAAC;CACxC;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,KAAS,EAAE,cAAc,EAAE,EAAE,kBAAkB,2CAgBzF"}
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function FrameGeometry({ shapeType, scale = 1, layoutSettings }) {
3
+ const width = (layoutSettings?.width || 1) * scale;
4
+ const height = (layoutSettings?.height || 1) * scale;
5
+ const depth = 0.05;
6
+ switch (shapeType) {
7
+ case 'ellipse':
8
+ return _jsx("circleGeometry", { args: [scale * 0.5, 32] });
9
+ case 'circle':
10
+ return _jsx("cylinderGeometry", { args: [scale * 0.5, depth, scale * 0.5, 32] });
11
+ case 'roundedRectangle':
12
+ return _jsx("cylinderGeometry", { args: [scale * 0.1, scale * 0.1, 1, 8] });
13
+ case 'rectangle':
14
+ default:
15
+ return _jsx("boxGeometry", { args: [width, height, depth] });
16
+ }
17
+ }
@@ -0,0 +1,14 @@
1
+ import { Mesh, Texture } from "three";
2
+ import type { GalleryLayoutSettings } from '@ntalmagor/3drize-core';
3
+ import { type FrameShapeType } from "./FrameGeometry";
4
+ interface FrameImageProps {
5
+ texture: Texture;
6
+ shapeType: FrameShapeType;
7
+ position: [number, number, number];
8
+ rotation?: [number, number, number];
9
+ isBack?: boolean;
10
+ layoutSettings?: GalleryLayoutSettings;
11
+ }
12
+ export declare const FrameImage: import("react").ForwardRefExoticComponent<FrameImageProps & import("react").RefAttributes<Mesh<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material | import("three").Material[], import("three").Object3DEventMap>>>;
13
+ export {};
14
+ //# sourceMappingURL=FrameImage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FrameImage.d.ts","sourceRoot":"","sources":["../../src/components/FrameImage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAErE,UAAU,eAAe;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,cAAc,CAAC;IAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,qBAAqB,CAAC;CACxC;AAED,eAAO,MAAM,UAAU,2SAuBrB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { FrameGeometry } from "./FrameGeometry";
4
+ export const FrameImage = forwardRef(({ texture, shapeType, position, rotation, isBack = false, layoutSettings, }, ref) => {
5
+ const width = layoutSettings?.width || 1;
6
+ const height = layoutSettings?.height || 1;
7
+ const imageScale = 0.9;
8
+ const scaledSettings = {
9
+ ...layoutSettings,
10
+ width: width * imageScale,
11
+ height: height * imageScale,
12
+ };
13
+ return (_jsxs("mesh", { ref: ref, raycast: () => null, position: position, rotation: rotation, children: [_jsx(FrameGeometry, { shapeType: shapeType, layoutSettings: scaledSettings }), _jsx("meshBasicMaterial", { map: texture, toneMapped: false, transparent: true })] }));
14
+ });
15
+ FrameImage.displayName = 'FrameImage';
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { StarsSettings } from '@ntalmagor/3drize-core';
3
+ export interface GalaxyProps {
4
+ settings: StarsSettings;
5
+ }
6
+ declare const Galaxy: React.FC<GalaxyProps>;
7
+ export default Galaxy;
8
+ //# sourceMappingURL=Galaxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Galaxy.d.ts","sourceRoot":"","sources":["../../src/components/Galaxy.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI5D,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CASjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Stars from './Stars';
3
+ import ShootingStars from './ShootingStars';
4
+ const Galaxy = ({ settings }) => {
5
+ if (!settings.visible)
6
+ return null;
7
+ return (_jsxs(_Fragment, { children: [_jsx(Stars, { settings: settings }), _jsx(ShootingStars, { settings: settings.shootingStars })] }));
8
+ };
9
+ export default Galaxy;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { CreatedObjectSettings } from '@ntalmagor/3drize-core';
3
+ export interface GalleryLayoutProps {
4
+ createdObject: CreatedObjectSettings;
5
+ selectedFrameUrl?: string;
6
+ onFrameSelect?: (url: string) => void;
7
+ }
8
+ declare const GalleryLayout: React.FC<GalleryLayoutProps>;
9
+ export default GalleryLayout;
10
+ //# sourceMappingURL=GalleryLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GalleryLayout.d.ts","sourceRoot":"","sources":["../../src/components/GalleryLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,qBAAqB,EAAyB,MAAM,wBAAwB,CAAC;AAM3F,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,qBAAqB,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAkD/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo, useRef } from 'react';
3
+ import { updateCurrentLayoutSettings } from '@ntalmagor/3drize-core';
4
+ import Frame from './Frame';
5
+ import EffectsGenerator from './EffectsGenerator';
6
+ import { ImageGeometry } from './ImageGeometry';
7
+ const GalleryLayout = ({ createdObject, selectedFrameUrl, onFrameSelect, }) => {
8
+ const groupRef = useRef(null);
9
+ const { config, materialSettings, animations } = createdObject;
10
+ const galleryLayout = config || {
11
+ frames: [],
12
+ geometryType: 'none',
13
+ outerFrameScale: 1,
14
+ };
15
+ const { frames, layoutSettings } = useMemo(() => updateCurrentLayoutSettings(galleryLayout), [galleryLayout]);
16
+ return (_jsx("group", { ref: groupRef, scale: [1, 1, 1], position: [0, 0, 0], rotation: [0, 0, 0], children: frames.map((frame, index) => (_jsxs(Frame, { url: frame.url, isActive: selectedFrameUrl === frame.url, createdObject: createdObject, position: frame.position, rotation: frame.rotation, hoverSettings: { sensitivity: 0.5, applyToChildren: false }, transformEffects: animations?.transform?.effects || [], layoutSettings: layoutSettings, side: galleryLayout?.side || 2, materialSettings: materialSettings, onFrameClick: onFrameSelect ? (obj, mesh, e) => onFrameSelect(frame.url) : undefined, children: [layoutSettings.geometryType !== 'none' && (_jsx(ImageGeometry, { url: frame.url, geometryType: layoutSettings.geometryType, outerFrameScale: layoutSettings.outerFrameScale })), createdObject.effects?.map((effect, effectIndex) => (_jsx(EffectsGenerator, { settings: effect }, effectIndex)))] }, index))) }));
17
+ };
18
+ export default GalleryLayout;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import * as THREE from 'three';
3
+ export interface GridHelperProps {
4
+ cellSize?: number;
5
+ cellThickness?: number;
6
+ cellColor?: THREE.ColorRepresentation;
7
+ sectionSize?: number;
8
+ sectionThickness?: number;
9
+ sectionColor?: THREE.ColorRepresentation;
10
+ followCamera?: boolean;
11
+ infiniteGrid?: boolean;
12
+ fadeDistance?: number;
13
+ fadeStrength?: number;
14
+ fadeFrom?: number;
15
+ side?: THREE.Side;
16
+ position?: [number, number, number];
17
+ rotation?: [number, number, number];
18
+ visible?: boolean;
19
+ device?: 'desktop' | 'tablet' | 'mobile';
20
+ }
21
+ declare const GridHelper: React.FC<GridHelperProps>;
22
+ export default GridHelper;
23
+ //# sourceMappingURL=GridHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridHelper.d.ts","sourceRoot":"","sources":["../../src/components/GridHelper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAG/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC;IACzC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;CAC1C;AAYD,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA2DzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useRef, useMemo } from 'react';
3
+ import { useFrame } from '@react-three/fiber';
4
+ import { Grid } from '@react-three/drei';
5
+ import * as THREE from 'three';
6
+ const cleanColor = (color) => {
7
+ if (typeof color !== 'string')
8
+ return color;
9
+ if (color.length === 9 && color.startsWith('#'))
10
+ return color.slice(0, 7);
11
+ const rgba = color.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
12
+ if (rgba) {
13
+ return new THREE.Color(+rgba[1] / 255, +rgba[2] / 255, +rgba[3] / 255).convertSRGBToLinear();
14
+ }
15
+ return color;
16
+ };
17
+ const GridHelper = ({ cellSize = 1, cellThickness = 1, cellColor = '#000000', sectionSize = 10, sectionThickness = 1.5, sectionColor = '#000000', followCamera = false, infiniteGrid = true, fadeDistance = 30, fadeStrength = 1, fadeFrom = 0, side = THREE.BackSide, position = [0, 0, 0], rotation = [0, 0, 0], visible = true, device = 'desktop', }) => {
18
+ const gridRef = useRef(null);
19
+ const targetY = useRef(position[1]);
20
+ const responsiveScale = useMemo(() => {
21
+ if (device === 'mobile')
22
+ return [0.7, 0.7, 0.7];
23
+ if (device === 'tablet')
24
+ return [0.85, 0.85, 0.85];
25
+ return [1, 1, 1];
26
+ }, [device]);
27
+ // Animate Y position toward target (replaces GSAP fade-in/out)
28
+ useFrame((_s, delta) => {
29
+ if (!gridRef.current)
30
+ return;
31
+ targetY.current = visible ? position[1] : position[1] - 2;
32
+ gridRef.current.position.y += (targetY.current - gridRef.current.position.y) * Math.min(delta * 4, 1);
33
+ });
34
+ if (!visible)
35
+ return null;
36
+ return (_jsx(Grid, { ref: gridRef, cellSize: cellSize, cellThickness: cellThickness, cellColor: cleanColor(cellColor), sectionSize: sectionSize, sectionThickness: sectionThickness, sectionColor: cleanColor(sectionColor), followCamera: followCamera, infiniteGrid: infiniteGrid, fadeDistance: fadeDistance, fadeStrength: fadeStrength, fadeFrom: fadeFrom, side: side, position: position, rotation: rotation, scale: responsiveScale, castShadow: false, receiveShadow: false, userData: { id: '3drise-grid' } }));
37
+ };
38
+ export default GridHelper;
@@ -0,0 +1,14 @@
1
+ import { Mesh } from 'three';
2
+ import type { GeometryType, ObjectEdges, MaterialSettings } from '@ntalmagor/3drize-core';
3
+ export interface ImageGeometryProps {
4
+ geometryType: GeometryType;
5
+ url: string;
6
+ position?: [number, number, number];
7
+ rotation?: [number, number, number];
8
+ scale?: [number, number, number];
9
+ outerFrameScale?: number;
10
+ materialSettings?: MaterialSettings;
11
+ edgesSettings?: ObjectEdges;
12
+ }
13
+ export declare const ImageGeometry: import("react").ForwardRefExoticComponent<ImageGeometryProps & import("react").RefAttributes<Mesh<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material | import("three").Material[], import("three").Object3DEventMap>>>;
14
+ //# sourceMappingURL=ImageGeometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageGeometry.d.ts","sourceRoot":"","sources":["../../src/components/ImageGeometry.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,IAAI,EAA8B,MAAM,OAAO,CAAC;AAErE,OAAO,KAAK,EAEiB,YAAY,EAAE,WAAW,EAAE,gBAAgB,EACvE,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,YAAY,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,aAAa,CAAC,EAAE,WAAW,CAAC;CAC7B;AAED,eAAO,MAAM,aAAa,8SAqExB,CAAC"}
@@ -0,0 +1,62 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef, useEffect, useMemo, useState } from 'react';
3
+ import { DoubleSide, Mesh, MeshBasicMaterial } from 'three';
4
+ import { createMeshByType } from '@ntalmagor/3drize-core';
5
+ import texturesManager from '../../../core/src/services/TexturesManager';
6
+ export const ImageGeometry = forwardRef(({ geometryType, url, position = [0, 0, 0], rotation = [0, 0, 0], scale = [1, 1, 1], }, ref) => {
7
+ const [texture, setTexture] = useState(null);
8
+ useEffect(() => {
9
+ const textureName = url.split('/').pop()?.split('.')[0] || `texture-${Date.now()}`;
10
+ texturesManager.loadTexture(textureName, url, 'images')
11
+ .then(setTexture)
12
+ .catch((err) => console.error('Failed to load texture:', err));
13
+ }, [url]);
14
+ const meshConfig = useMemo(() => {
15
+ const base = {
16
+ type: geometryType,
17
+ position,
18
+ rotation,
19
+ scale,
20
+ visible: true,
21
+ id: `image-${geometryType}-${Date.now()}`,
22
+ name: `image-${geometryType}`,
23
+ castShadow: true,
24
+ receiveShadow: true,
25
+ };
26
+ switch (geometryType) {
27
+ case 'plane':
28
+ return { ...base, scale: [1, 1, 1], widthSegments: 1, heightSegments: 1 };
29
+ case 'ring':
30
+ return { ...base, scale: [1, 1, 1], innerRadius: 0.5, outerRadius: 1, thetaSegments: 32, phiSegments: 8 };
31
+ case 'arc':
32
+ return { ...base, scale: [1, 1, 1], radius: 1, startAngle: 0, endAngle: Math.PI, width: 0.3, segments: 32 };
33
+ case 'bentPlane':
34
+ return { ...base, scale: [1, 1, 1], width: 2, height: 1, radius: 2, arc: Math.PI / 2, widthSegments: 32, heightSegments: 1 };
35
+ case 'bentPlaneInverse':
36
+ return { ...base, scale: [1, 1, 1], width: 2, height: 1, radius: 2, arc: Math.PI / 2, widthSegments: 32, heightSegments: 1 };
37
+ default:
38
+ return base;
39
+ }
40
+ }, [geometryType, position, rotation, scale]);
41
+ const createdMesh = useMemo(() => {
42
+ const mesh = createMeshByType(meshConfig);
43
+ if (!(mesh instanceof Mesh))
44
+ return null;
45
+ if (texture) {
46
+ mesh.material = new MeshBasicMaterial({
47
+ map: texture,
48
+ side: DoubleSide,
49
+ toneMapped: false,
50
+ transparent: true,
51
+ polygonOffset: true,
52
+ polygonOffsetFactor: 1,
53
+ polygonOffsetUnits: 1,
54
+ });
55
+ }
56
+ return mesh;
57
+ }, [meshConfig, texture]);
58
+ if (!createdMesh)
59
+ return null;
60
+ return (_jsx("group", { position: position, rotation: rotation, children: _jsx("primitive", { name: url, ref: ref, object: createdMesh }) }));
61
+ });
62
+ ImageGeometry.displayName = 'ImageGeometry';
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import * as THREE from 'three';
3
+ import type { TimeSettings } from '../../../core/src/types/scene3d';
4
+ export declare function createFlareTexture(type: number): THREE.CanvasTexture;
5
+ export interface LensflareProps {
6
+ visible?: boolean;
7
+ intensity?: number;
8
+ timeSettings: TimeSettings;
9
+ }
10
+ declare const Lensflare: React.FC<LensflareProps>;
11
+ export default Lensflare;
12
+ //# sourceMappingURL=Lensflare.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Lensflare.d.ts","sourceRoot":"","sources":["../../src/components/Lensflare.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,aAAa,CA6BpE;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA4CvC,CAAC;AAEF,eAAe,SAAS,CAAC"}