@reactvision/react-viro 2.42.0 → 2.43.1

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 (475) hide show
  1. package/README.md +12 -6
  2. package/android/react_viro/react_viro-release.aar +0 -0
  3. package/components/AR/ViroARPlaneSelector.tsx +76 -37
  4. package/components/Utilities/ViroVersion.ts +1 -1
  5. package/dist/components/AR/ViroARPlaneSelector.d.ts +1 -1
  6. package/dist/components/AR/ViroARPlaneSelector.js +46 -18
  7. package/dist/components/Utilities/ViroVersion.d.ts +1 -1
  8. package/dist/components/Utilities/ViroVersion.js +1 -1
  9. package/dist/dynamic-index.d.ts +11 -0
  10. package/dist/dynamic-index.js +28 -0
  11. package/dist/examples/AutoDetectionExample.d.ts +10 -0
  12. package/dist/examples/AutoDetectionExample.js +91 -0
  13. package/dist/fabric-interop/NativeViro.d.ts +42 -0
  14. package/dist/fabric-interop/NativeViro.js +262 -0
  15. package/dist/fabric-interop/ViroEventsManager.d.ts +83 -0
  16. package/dist/fabric-interop/ViroEventsManager.js +222 -0
  17. package/dist/fabric-interop/ViroFabricContainer.d.ts +34 -0
  18. package/dist/fabric-interop/ViroFabricContainer.js +200 -0
  19. package/dist/fabric-interop/android/src/main/js/specs/ViroFabricContainerViewNativeComponent.d.ts +35 -0
  20. package/dist/fabric-interop/android/src/main/js/specs/ViroFabricContainerViewNativeComponent.js +20 -0
  21. package/dist/fabric-interop/components/AR/ViroARPlane.d.ts +22 -0
  22. package/dist/fabric-interop/components/AR/ViroARPlane.js +95 -0
  23. package/dist/fabric-interop/components/AR/ViroARPlaneSelector.d.ts +43 -0
  24. package/dist/fabric-interop/components/AR/ViroARPlaneSelector.js +152 -0
  25. package/dist/fabric-interop/components/AR/ViroARTrackingTargets.d.ts +55 -0
  26. package/dist/fabric-interop/components/AR/ViroARTrackingTargets.js +85 -0
  27. package/dist/fabric-interop/components/AR/ViroCommonProps.d.ts +91 -0
  28. package/dist/fabric-interop/components/AR/ViroCommonProps.js +7 -0
  29. package/dist/fabric-interop/components/Animation/ViroAnimations.d.ts +48 -0
  30. package/dist/fabric-interop/components/Animation/ViroAnimations.js +64 -0
  31. package/dist/fabric-interop/components/Material/ViroMaterials.d.ts +66 -0
  32. package/dist/fabric-interop/components/Material/ViroMaterials.js +85 -0
  33. package/dist/fabric-interop/components/Types/ViroEvents.d.ts +202 -0
  34. package/dist/fabric-interop/components/Types/ViroEvents.js +53 -0
  35. package/dist/fabric-interop/components/Types/ViroUtils.d.ts +137 -0
  36. package/dist/fabric-interop/components/Types/ViroUtils.js +7 -0
  37. package/dist/fabric-interop/components/Viro360Image.d.ts +23 -0
  38. package/dist/fabric-interop/components/Viro360Image.js +45 -0
  39. package/dist/fabric-interop/components/Viro360Video.d.ts +29 -0
  40. package/dist/fabric-interop/components/Viro360Video.js +47 -0
  41. package/dist/fabric-interop/components/Viro3DObject.d.ts +60 -0
  42. package/dist/fabric-interop/components/Viro3DObject.js +49 -0
  43. package/dist/fabric-interop/components/Viro3DSceneNavigator.d.ts +49 -0
  44. package/dist/fabric-interop/components/Viro3DSceneNavigator.js +388 -0
  45. package/dist/fabric-interop/components/ViroARCamera.d.ts +29 -0
  46. package/dist/fabric-interop/components/ViroARCamera.js +64 -0
  47. package/dist/fabric-interop/components/ViroARImageMarker.d.ts +21 -0
  48. package/dist/fabric-interop/components/ViroARImageMarker.js +71 -0
  49. package/dist/fabric-interop/components/ViroARObjectMarker.d.ts +21 -0
  50. package/dist/fabric-interop/components/ViroARObjectMarker.js +71 -0
  51. package/dist/fabric-interop/components/ViroARPlane.d.ts +24 -0
  52. package/dist/fabric-interop/components/ViroARPlane.js +88 -0
  53. package/dist/fabric-interop/components/ViroARScene.d.ts +29 -0
  54. package/dist/fabric-interop/components/ViroARScene.js +89 -0
  55. package/dist/fabric-interop/components/ViroARSceneNavigator.d.ts +29 -0
  56. package/dist/fabric-interop/components/ViroARSceneNavigator.js +76 -0
  57. package/dist/fabric-interop/components/ViroAmbientLight.d.ts +19 -0
  58. package/dist/fabric-interop/components/ViroAmbientLight.js +46 -0
  59. package/dist/fabric-interop/components/ViroAnimatedComponent.d.ts +24 -0
  60. package/dist/fabric-interop/components/ViroAnimatedComponent.js +63 -0
  61. package/dist/fabric-interop/components/ViroAnimatedImage.d.ts +28 -0
  62. package/dist/fabric-interop/components/ViroAnimatedImage.js +49 -0
  63. package/dist/fabric-interop/components/ViroBox.d.ts +20 -0
  64. package/dist/fabric-interop/components/ViroBox.js +47 -0
  65. package/dist/fabric-interop/components/ViroButton.d.ts +32 -0
  66. package/dist/fabric-interop/components/ViroButton.js +92 -0
  67. package/dist/fabric-interop/components/ViroCamera.d.ts +17 -0
  68. package/dist/fabric-interop/components/ViroCamera.js +30 -0
  69. package/dist/fabric-interop/components/ViroController.d.ts +19 -0
  70. package/dist/fabric-interop/components/ViroController.js +64 -0
  71. package/dist/fabric-interop/components/ViroDirectionalLight.d.ts +28 -0
  72. package/dist/fabric-interop/components/ViroDirectionalLight.js +55 -0
  73. package/dist/fabric-interop/components/ViroFlexView.d.ts +36 -0
  74. package/dist/fabric-interop/components/ViroFlexView.js +97 -0
  75. package/dist/fabric-interop/components/ViroGeometry.d.ts +23 -0
  76. package/dist/fabric-interop/components/ViroGeometry.js +50 -0
  77. package/dist/fabric-interop/components/ViroGlobal.d.ts +45 -0
  78. package/dist/fabric-interop/components/ViroGlobal.js +20 -0
  79. package/dist/fabric-interop/components/ViroImage.d.ts +29 -0
  80. package/dist/fabric-interop/components/ViroImage.js +52 -0
  81. package/dist/fabric-interop/components/ViroLightingEnvironment.d.ts +19 -0
  82. package/dist/fabric-interop/components/ViroLightingEnvironment.js +44 -0
  83. package/dist/fabric-interop/components/ViroMaterialVideo.d.ts +30 -0
  84. package/dist/fabric-interop/components/ViroMaterialVideo.js +48 -0
  85. package/dist/fabric-interop/components/ViroNode.d.ts +36 -0
  86. package/dist/fabric-interop/components/ViroNode.js +28 -0
  87. package/dist/fabric-interop/components/ViroOmniLight.d.ts +21 -0
  88. package/dist/fabric-interop/components/ViroOmniLight.js +48 -0
  89. package/dist/fabric-interop/components/ViroOrbitCamera.d.ts +17 -0
  90. package/dist/fabric-interop/components/ViroOrbitCamera.js +30 -0
  91. package/dist/fabric-interop/components/ViroParticleEmitter.d.ts +51 -0
  92. package/dist/fabric-interop/components/ViroParticleEmitter.js +50 -0
  93. package/dist/fabric-interop/components/ViroPolygon.d.ts +20 -0
  94. package/dist/fabric-interop/components/ViroPolygon.js +47 -0
  95. package/dist/fabric-interop/components/ViroPolyline.d.ts +19 -0
  96. package/dist/fabric-interop/components/ViroPolyline.js +46 -0
  97. package/dist/fabric-interop/components/ViroPortal.d.ts +16 -0
  98. package/dist/fabric-interop/components/ViroPortal.js +73 -0
  99. package/dist/fabric-interop/components/ViroPortalScene.d.ts +16 -0
  100. package/dist/fabric-interop/components/ViroPortalScene.js +29 -0
  101. package/dist/fabric-interop/components/ViroQuad.d.ts +39 -0
  102. package/dist/fabric-interop/components/ViroQuad.js +49 -0
  103. package/dist/fabric-interop/components/ViroScene.d.ts +29 -0
  104. package/dist/fabric-interop/components/ViroScene.js +103 -0
  105. package/dist/fabric-interop/components/ViroSceneNavigator.d.ts +23 -0
  106. package/dist/fabric-interop/components/ViroSceneNavigator.js +73 -0
  107. package/dist/fabric-interop/components/ViroSkyBox.d.ts +39 -0
  108. package/dist/fabric-interop/components/ViroSkyBox.js +44 -0
  109. package/dist/fabric-interop/components/ViroSound.d.ts +23 -0
  110. package/dist/fabric-interop/components/ViroSound.js +46 -0
  111. package/dist/fabric-interop/components/ViroSoundField.d.ts +24 -0
  112. package/dist/fabric-interop/components/ViroSoundField.js +47 -0
  113. package/dist/fabric-interop/components/ViroSpatialSound.d.ts +27 -0
  114. package/dist/fabric-interop/components/ViroSpatialSound.js +50 -0
  115. package/dist/fabric-interop/components/ViroSphere.d.ts +22 -0
  116. package/dist/fabric-interop/components/ViroSphere.js +49 -0
  117. package/dist/fabric-interop/components/ViroSpinner.d.ts +18 -0
  118. package/dist/fabric-interop/components/ViroSpinner.js +45 -0
  119. package/dist/fabric-interop/components/ViroSpotLight.d.ts +30 -0
  120. package/dist/fabric-interop/components/ViroSpotLight.js +57 -0
  121. package/dist/fabric-interop/components/ViroSurface.d.ts +38 -0
  122. package/dist/fabric-interop/components/ViroSurface.js +48 -0
  123. package/dist/fabric-interop/components/ViroText.d.ts +36 -0
  124. package/dist/fabric-interop/components/ViroText.js +59 -0
  125. package/dist/fabric-interop/components/ViroUtils.d.ts +63 -0
  126. package/dist/fabric-interop/components/ViroUtils.js +140 -0
  127. package/dist/fabric-interop/components/ViroVRSceneNavigator.d.ts +25 -0
  128. package/dist/fabric-interop/components/ViroVRSceneNavigator.js +73 -0
  129. package/dist/fabric-interop/components/ViroVideo.d.ts +32 -0
  130. package/dist/fabric-interop/components/ViroVideo.js +52 -0
  131. package/dist/fabric-interop/components/index.d.ts +62 -0
  132. package/dist/fabric-interop/components/index.js +144 -0
  133. package/dist/fabric-interop/examples/BasicSceneExample.d.ts +11 -0
  134. package/dist/fabric-interop/examples/BasicSceneExample.js +244 -0
  135. package/dist/fabric-interop/examples/ComprehensiveExample.d.ts +13 -0
  136. package/dist/fabric-interop/examples/ComprehensiveExample.js +327 -0
  137. package/dist/fabric-interop/examples/SimpleARExample.d.ts +8 -0
  138. package/dist/fabric-interop/examples/SimpleARExample.js +62 -0
  139. package/dist/fabric-interop/index.d.ts +14 -0
  140. package/dist/fabric-interop/index.js +117 -0
  141. package/dist/fabric-interop/specs/ViroEventsTurboModule.d.ts +19 -0
  142. package/dist/fabric-interop/specs/ViroEventsTurboModule.js +11 -0
  143. package/dist/fabric-interop/test/BasicFunctionalityTest.d.ts +9 -0
  144. package/dist/fabric-interop/test/BasicFunctionalityTest.js +222 -0
  145. package/dist/fabric.d.ts +13 -0
  146. package/dist/fabric.js +29 -0
  147. package/dist/plugins/withViro.d.ts +3 -0
  148. package/dist/plugins/withViro.js +19 -0
  149. package/dist/plugins/withViroAndroid.js +24 -20
  150. package/dist/plugins/withViroIos.js +20 -2
  151. package/dynamic-index-source.d.ts +77 -0
  152. package/dynamic-index.ts +41 -0
  153. package/fabric-interop/NativeViro.ts +335 -0
  154. package/fabric-interop/README.md +282 -0
  155. package/fabric-interop/ViroEventsManager.js +257 -0
  156. package/fabric-interop/ViroFabricContainer.tsx +273 -0
  157. package/fabric-interop/components/AR/ViroARPlane.tsx +108 -0
  158. package/fabric-interop/components/AR/ViroARPlaneSelector.tsx +185 -0
  159. package/fabric-interop/components/AR/ViroARTrackingTargets.ts +108 -0
  160. package/fabric-interop/components/AR/ViroCommonProps.ts +140 -0
  161. package/fabric-interop/components/Animation/ViroAnimations.ts +96 -0
  162. package/fabric-interop/components/Material/ViroMaterials.ts +127 -0
  163. package/fabric-interop/components/Resources/viro_spinner_1.png +0 -0
  164. package/fabric-interop/components/Resources/viro_spinner_1_w.png +0 -0
  165. package/fabric-interop/components/Resources/viro_spinner_1a.png +0 -0
  166. package/fabric-interop/components/Resources/viro_spinner_1a_w.png +0 -0
  167. package/fabric-interop/components/Types/ViroEvents.ts +285 -0
  168. package/fabric-interop/components/Types/ViroUtils.ts +160 -0
  169. package/fabric-interop/components/Viro360Image.tsx +70 -0
  170. package/fabric-interop/components/Viro360Video.tsx +78 -0
  171. package/fabric-interop/components/Viro3DObject.tsx +122 -0
  172. package/fabric-interop/components/Viro3DSceneNavigator.tsx +503 -0
  173. package/fabric-interop/components/ViroARCamera.tsx +105 -0
  174. package/fabric-interop/components/ViroARImageMarker.tsx +98 -0
  175. package/fabric-interop/components/ViroARObjectMarker.tsx +100 -0
  176. package/fabric-interop/components/ViroARPlane.tsx +120 -0
  177. package/fabric-interop/components/ViroARScene.tsx +127 -0
  178. package/fabric-interop/components/ViroARSceneNavigator.tsx +82 -0
  179. package/fabric-interop/components/ViroAmbientLight.tsx +62 -0
  180. package/fabric-interop/components/ViroAnimatedComponent.tsx +91 -0
  181. package/fabric-interop/components/ViroAnimatedImage.tsx +81 -0
  182. package/fabric-interop/components/ViroBox.tsx +72 -0
  183. package/fabric-interop/components/ViroButton.tsx +125 -0
  184. package/fabric-interop/components/ViroCamera.tsx +45 -0
  185. package/fabric-interop/components/ViroController.tsx +87 -0
  186. package/fabric-interop/components/ViroDirectionalLight.tsx +84 -0
  187. package/fabric-interop/components/ViroFlexView.tsx +146 -0
  188. package/fabric-interop/components/ViroGeometry.tsx +78 -0
  189. package/fabric-interop/components/ViroGlobal.ts +114 -0
  190. package/fabric-interop/components/ViroImage.tsx +85 -0
  191. package/fabric-interop/components/ViroLightingEnvironment.tsx +63 -0
  192. package/fabric-interop/components/ViroMaterialVideo.tsx +82 -0
  193. package/fabric-interop/components/ViroNode.tsx +62 -0
  194. package/fabric-interop/components/ViroOmniLight.tsx +66 -0
  195. package/fabric-interop/components/ViroOrbitCamera.tsx +45 -0
  196. package/fabric-interop/components/ViroParticleEmitter.tsx +111 -0
  197. package/fabric-interop/components/ViroPolygon.tsx +72 -0
  198. package/fabric-interop/components/ViroPolyline.tsx +71 -0
  199. package/fabric-interop/components/ViroPortal.tsx +91 -0
  200. package/fabric-interop/components/ViroPortalScene.tsx +43 -0
  201. package/fabric-interop/components/ViroQuad.tsx +82 -0
  202. package/fabric-interop/components/ViroScene.tsx +117 -0
  203. package/fabric-interop/components/ViroSceneNavigator.tsx +71 -0
  204. package/fabric-interop/components/ViroSkyBox.tsx +75 -0
  205. package/fabric-interop/components/ViroSound.tsx +71 -0
  206. package/fabric-interop/components/ViroSoundField.tsx +75 -0
  207. package/fabric-interop/components/ViroSpatialSound.tsx +81 -0
  208. package/fabric-interop/components/ViroSphere.tsx +75 -0
  209. package/fabric-interop/components/ViroSpinner.tsx +63 -0
  210. package/fabric-interop/components/ViroSpotLight.tsx +86 -0
  211. package/fabric-interop/components/ViroSurface.tsx +80 -0
  212. package/fabric-interop/components/ViroText.tsx +114 -0
  213. package/fabric-interop/components/ViroUtils.ts +208 -0
  214. package/fabric-interop/components/ViroVRSceneNavigator.tsx +75 -0
  215. package/fabric-interop/components/ViroVideo.tsx +91 -0
  216. package/fabric-interop/components/index.ts +94 -0
  217. package/fabric-interop/dist/NativeViro.d.ts +43 -0
  218. package/fabric-interop/dist/NativeViro.d.ts.map +1 -0
  219. package/fabric-interop/dist/NativeViro.js +263 -0
  220. package/fabric-interop/dist/NativeViro.js.map +1 -0
  221. package/fabric-interop/dist/ViroFabricContainer.d.ts +35 -0
  222. package/fabric-interop/dist/ViroFabricContainer.d.ts.map +1 -0
  223. package/fabric-interop/dist/ViroFabricContainer.js +201 -0
  224. package/fabric-interop/dist/ViroFabricContainer.js.map +1 -0
  225. package/fabric-interop/dist/components/AR/ViroARPlane.d.ts +23 -0
  226. package/fabric-interop/dist/components/AR/ViroARPlane.d.ts.map +1 -0
  227. package/fabric-interop/dist/components/AR/ViroARPlane.js +96 -0
  228. package/fabric-interop/dist/components/AR/ViroARPlane.js.map +1 -0
  229. package/fabric-interop/dist/components/AR/ViroARPlaneSelector.d.ts +44 -0
  230. package/fabric-interop/dist/components/AR/ViroARPlaneSelector.d.ts.map +1 -0
  231. package/fabric-interop/dist/components/AR/ViroARPlaneSelector.js +156 -0
  232. package/fabric-interop/dist/components/AR/ViroARPlaneSelector.js.map +1 -0
  233. package/fabric-interop/dist/components/AR/ViroARTrackingTargets.d.ts +56 -0
  234. package/fabric-interop/dist/components/AR/ViroARTrackingTargets.d.ts.map +1 -0
  235. package/fabric-interop/dist/components/AR/ViroARTrackingTargets.js +86 -0
  236. package/fabric-interop/dist/components/AR/ViroARTrackingTargets.js.map +1 -0
  237. package/fabric-interop/dist/components/AR/ViroCommonProps.d.ts +92 -0
  238. package/fabric-interop/dist/components/AR/ViroCommonProps.d.ts.map +1 -0
  239. package/fabric-interop/dist/components/AR/ViroCommonProps.js +8 -0
  240. package/fabric-interop/dist/components/AR/ViroCommonProps.js.map +1 -0
  241. package/fabric-interop/dist/components/Animation/ViroAnimations.d.ts +49 -0
  242. package/fabric-interop/dist/components/Animation/ViroAnimations.d.ts.map +1 -0
  243. package/fabric-interop/dist/components/Animation/ViroAnimations.js +65 -0
  244. package/fabric-interop/dist/components/Animation/ViroAnimations.js.map +1 -0
  245. package/fabric-interop/dist/components/Material/ViroMaterials.d.ts +67 -0
  246. package/fabric-interop/dist/components/Material/ViroMaterials.d.ts.map +1 -0
  247. package/fabric-interop/dist/components/Material/ViroMaterials.js +86 -0
  248. package/fabric-interop/dist/components/Material/ViroMaterials.js.map +1 -0
  249. package/fabric-interop/dist/components/Types/ViroEvents.d.ts +203 -0
  250. package/fabric-interop/dist/components/Types/ViroEvents.d.ts.map +1 -0
  251. package/fabric-interop/dist/components/Types/ViroEvents.js +54 -0
  252. package/fabric-interop/dist/components/Types/ViroEvents.js.map +1 -0
  253. package/fabric-interop/dist/components/Types/ViroUtils.d.ts +138 -0
  254. package/fabric-interop/dist/components/Types/ViroUtils.d.ts.map +1 -0
  255. package/fabric-interop/dist/components/Types/ViroUtils.js +8 -0
  256. package/fabric-interop/dist/components/Types/ViroUtils.js.map +1 -0
  257. package/fabric-interop/dist/components/Viro360Image.d.ts +24 -0
  258. package/fabric-interop/dist/components/Viro360Image.d.ts.map +1 -0
  259. package/fabric-interop/dist/components/Viro360Image.js +47 -0
  260. package/fabric-interop/dist/components/Viro360Image.js.map +1 -0
  261. package/fabric-interop/dist/components/Viro360Video.d.ts +30 -0
  262. package/fabric-interop/dist/components/Viro360Video.d.ts.map +1 -0
  263. package/fabric-interop/dist/components/Viro360Video.js +49 -0
  264. package/fabric-interop/dist/components/Viro360Video.js.map +1 -0
  265. package/fabric-interop/dist/components/Viro3DObject.d.ts +61 -0
  266. package/fabric-interop/dist/components/Viro3DObject.d.ts.map +1 -0
  267. package/fabric-interop/dist/components/Viro3DObject.js +51 -0
  268. package/fabric-interop/dist/components/Viro3DObject.js.map +1 -0
  269. package/fabric-interop/dist/components/Viro3DSceneNavigator.d.ts +50 -0
  270. package/fabric-interop/dist/components/Viro3DSceneNavigator.d.ts.map +1 -0
  271. package/fabric-interop/dist/components/Viro3DSceneNavigator.js +389 -0
  272. package/fabric-interop/dist/components/Viro3DSceneNavigator.js.map +1 -0
  273. package/fabric-interop/dist/components/ViroARCamera.d.ts +30 -0
  274. package/fabric-interop/dist/components/ViroARCamera.d.ts.map +1 -0
  275. package/fabric-interop/dist/components/ViroARCamera.js +65 -0
  276. package/fabric-interop/dist/components/ViroARCamera.js.map +1 -0
  277. package/fabric-interop/dist/components/ViroARImageMarker.d.ts +22 -0
  278. package/fabric-interop/dist/components/ViroARImageMarker.d.ts.map +1 -0
  279. package/fabric-interop/dist/components/ViroARImageMarker.js +72 -0
  280. package/fabric-interop/dist/components/ViroARImageMarker.js.map +1 -0
  281. package/fabric-interop/dist/components/ViroARObjectMarker.d.ts +22 -0
  282. package/fabric-interop/dist/components/ViroARObjectMarker.d.ts.map +1 -0
  283. package/fabric-interop/dist/components/ViroARObjectMarker.js +72 -0
  284. package/fabric-interop/dist/components/ViroARObjectMarker.js.map +1 -0
  285. package/fabric-interop/dist/components/ViroARPlane.d.ts +25 -0
  286. package/fabric-interop/dist/components/ViroARPlane.d.ts.map +1 -0
  287. package/fabric-interop/dist/components/ViroARPlane.js +89 -0
  288. package/fabric-interop/dist/components/ViroARPlane.js.map +1 -0
  289. package/fabric-interop/dist/components/ViroARScene.d.ts +30 -0
  290. package/fabric-interop/dist/components/ViroARScene.d.ts.map +1 -0
  291. package/fabric-interop/dist/components/ViroARScene.js +90 -0
  292. package/fabric-interop/dist/components/ViroARScene.js.map +1 -0
  293. package/fabric-interop/dist/components/ViroARSceneNavigator.d.ts +30 -0
  294. package/fabric-interop/dist/components/ViroARSceneNavigator.d.ts.map +1 -0
  295. package/fabric-interop/dist/components/ViroARSceneNavigator.js +78 -0
  296. package/fabric-interop/dist/components/ViroARSceneNavigator.js.map +1 -0
  297. package/fabric-interop/dist/components/ViroAmbientLight.d.ts +20 -0
  298. package/fabric-interop/dist/components/ViroAmbientLight.d.ts.map +1 -0
  299. package/fabric-interop/dist/components/ViroAmbientLight.js +48 -0
  300. package/fabric-interop/dist/components/ViroAmbientLight.js.map +1 -0
  301. package/fabric-interop/dist/components/ViroAnimatedComponent.d.ts +25 -0
  302. package/fabric-interop/dist/components/ViroAnimatedComponent.d.ts.map +1 -0
  303. package/fabric-interop/dist/components/ViroAnimatedComponent.js +65 -0
  304. package/fabric-interop/dist/components/ViroAnimatedComponent.js.map +1 -0
  305. package/fabric-interop/dist/components/ViroAnimatedImage.d.ts +29 -0
  306. package/fabric-interop/dist/components/ViroAnimatedImage.d.ts.map +1 -0
  307. package/fabric-interop/dist/components/ViroAnimatedImage.js +51 -0
  308. package/fabric-interop/dist/components/ViroAnimatedImage.js.map +1 -0
  309. package/fabric-interop/dist/components/ViroBox.d.ts +21 -0
  310. package/fabric-interop/dist/components/ViroBox.d.ts.map +1 -0
  311. package/fabric-interop/dist/components/ViroBox.js +49 -0
  312. package/fabric-interop/dist/components/ViroBox.js.map +1 -0
  313. package/fabric-interop/dist/components/ViroButton.d.ts +33 -0
  314. package/fabric-interop/dist/components/ViroButton.d.ts.map +1 -0
  315. package/fabric-interop/dist/components/ViroButton.js +94 -0
  316. package/fabric-interop/dist/components/ViroButton.js.map +1 -0
  317. package/fabric-interop/dist/components/ViroCamera.d.ts +18 -0
  318. package/fabric-interop/dist/components/ViroCamera.d.ts.map +1 -0
  319. package/fabric-interop/dist/components/ViroCamera.js +31 -0
  320. package/fabric-interop/dist/components/ViroCamera.js.map +1 -0
  321. package/fabric-interop/dist/components/ViroController.d.ts +20 -0
  322. package/fabric-interop/dist/components/ViroController.d.ts.map +1 -0
  323. package/fabric-interop/dist/components/ViroController.js +65 -0
  324. package/fabric-interop/dist/components/ViroController.js.map +1 -0
  325. package/fabric-interop/dist/components/ViroDirectionalLight.d.ts +29 -0
  326. package/fabric-interop/dist/components/ViroDirectionalLight.d.ts.map +1 -0
  327. package/fabric-interop/dist/components/ViroDirectionalLight.js +57 -0
  328. package/fabric-interop/dist/components/ViroDirectionalLight.js.map +1 -0
  329. package/fabric-interop/dist/components/ViroFlexView.d.ts +37 -0
  330. package/fabric-interop/dist/components/ViroFlexView.d.ts.map +1 -0
  331. package/fabric-interop/dist/components/ViroFlexView.js +98 -0
  332. package/fabric-interop/dist/components/ViroFlexView.js.map +1 -0
  333. package/fabric-interop/dist/components/ViroGeometry.d.ts +24 -0
  334. package/fabric-interop/dist/components/ViroGeometry.d.ts.map +1 -0
  335. package/fabric-interop/dist/components/ViroGeometry.js +52 -0
  336. package/fabric-interop/dist/components/ViroGeometry.js.map +1 -0
  337. package/fabric-interop/dist/components/ViroGlobal.d.ts +46 -0
  338. package/fabric-interop/dist/components/ViroGlobal.d.ts.map +1 -0
  339. package/fabric-interop/dist/components/ViroGlobal.js +21 -0
  340. package/fabric-interop/dist/components/ViroGlobal.js.map +1 -0
  341. package/fabric-interop/dist/components/ViroImage.d.ts +30 -0
  342. package/fabric-interop/dist/components/ViroImage.d.ts.map +1 -0
  343. package/fabric-interop/dist/components/ViroImage.js +54 -0
  344. package/fabric-interop/dist/components/ViroImage.js.map +1 -0
  345. package/fabric-interop/dist/components/ViroLightingEnvironment.d.ts +20 -0
  346. package/fabric-interop/dist/components/ViroLightingEnvironment.d.ts.map +1 -0
  347. package/fabric-interop/dist/components/ViroLightingEnvironment.js +46 -0
  348. package/fabric-interop/dist/components/ViroLightingEnvironment.js.map +1 -0
  349. package/fabric-interop/dist/components/ViroMaterialVideo.d.ts +31 -0
  350. package/fabric-interop/dist/components/ViroMaterialVideo.d.ts.map +1 -0
  351. package/fabric-interop/dist/components/ViroMaterialVideo.js +50 -0
  352. package/fabric-interop/dist/components/ViroMaterialVideo.js.map +1 -0
  353. package/fabric-interop/dist/components/ViroNode.d.ts +37 -0
  354. package/fabric-interop/dist/components/ViroNode.d.ts.map +1 -0
  355. package/fabric-interop/dist/components/ViroNode.js +29 -0
  356. package/fabric-interop/dist/components/ViroNode.js.map +1 -0
  357. package/fabric-interop/dist/components/ViroOmniLight.d.ts +22 -0
  358. package/fabric-interop/dist/components/ViroOmniLight.d.ts.map +1 -0
  359. package/fabric-interop/dist/components/ViroOmniLight.js +50 -0
  360. package/fabric-interop/dist/components/ViroOmniLight.js.map +1 -0
  361. package/fabric-interop/dist/components/ViroOrbitCamera.d.ts +18 -0
  362. package/fabric-interop/dist/components/ViroOrbitCamera.d.ts.map +1 -0
  363. package/fabric-interop/dist/components/ViroOrbitCamera.js +31 -0
  364. package/fabric-interop/dist/components/ViroOrbitCamera.js.map +1 -0
  365. package/fabric-interop/dist/components/ViroParticleEmitter.d.ts +52 -0
  366. package/fabric-interop/dist/components/ViroParticleEmitter.d.ts.map +1 -0
  367. package/fabric-interop/dist/components/ViroParticleEmitter.js +52 -0
  368. package/fabric-interop/dist/components/ViroParticleEmitter.js.map +1 -0
  369. package/fabric-interop/dist/components/ViroPolygon.d.ts +21 -0
  370. package/fabric-interop/dist/components/ViroPolygon.d.ts.map +1 -0
  371. package/fabric-interop/dist/components/ViroPolygon.js +49 -0
  372. package/fabric-interop/dist/components/ViroPolygon.js.map +1 -0
  373. package/fabric-interop/dist/components/ViroPolyline.d.ts +20 -0
  374. package/fabric-interop/dist/components/ViroPolyline.d.ts.map +1 -0
  375. package/fabric-interop/dist/components/ViroPolyline.js +48 -0
  376. package/fabric-interop/dist/components/ViroPolyline.js.map +1 -0
  377. package/fabric-interop/dist/components/ViroPortal.d.ts +17 -0
  378. package/fabric-interop/dist/components/ViroPortal.d.ts.map +1 -0
  379. package/fabric-interop/dist/components/ViroPortal.js +74 -0
  380. package/fabric-interop/dist/components/ViroPortal.js.map +1 -0
  381. package/fabric-interop/dist/components/ViroPortalScene.d.ts +17 -0
  382. package/fabric-interop/dist/components/ViroPortalScene.d.ts.map +1 -0
  383. package/fabric-interop/dist/components/ViroPortalScene.js +30 -0
  384. package/fabric-interop/dist/components/ViroPortalScene.js.map +1 -0
  385. package/fabric-interop/dist/components/ViroQuad.d.ts +40 -0
  386. package/fabric-interop/dist/components/ViroQuad.d.ts.map +1 -0
  387. package/fabric-interop/dist/components/ViroQuad.js +51 -0
  388. package/fabric-interop/dist/components/ViroQuad.js.map +1 -0
  389. package/fabric-interop/dist/components/ViroScene.d.ts +30 -0
  390. package/fabric-interop/dist/components/ViroScene.d.ts.map +1 -0
  391. package/fabric-interop/dist/components/ViroScene.js +105 -0
  392. package/fabric-interop/dist/components/ViroScene.js.map +1 -0
  393. package/fabric-interop/dist/components/ViroSceneNavigator.d.ts +24 -0
  394. package/fabric-interop/dist/components/ViroSceneNavigator.d.ts.map +1 -0
  395. package/fabric-interop/dist/components/ViroSceneNavigator.js +74 -0
  396. package/fabric-interop/dist/components/ViroSceneNavigator.js.map +1 -0
  397. package/fabric-interop/dist/components/ViroSkyBox.d.ts +40 -0
  398. package/fabric-interop/dist/components/ViroSkyBox.d.ts.map +1 -0
  399. package/fabric-interop/dist/components/ViroSkyBox.js +46 -0
  400. package/fabric-interop/dist/components/ViroSkyBox.js.map +1 -0
  401. package/fabric-interop/dist/components/ViroSound.d.ts +24 -0
  402. package/fabric-interop/dist/components/ViroSound.d.ts.map +1 -0
  403. package/fabric-interop/dist/components/ViroSound.js +48 -0
  404. package/fabric-interop/dist/components/ViroSound.js.map +1 -0
  405. package/fabric-interop/dist/components/ViroSoundField.d.ts +25 -0
  406. package/fabric-interop/dist/components/ViroSoundField.d.ts.map +1 -0
  407. package/fabric-interop/dist/components/ViroSoundField.js +49 -0
  408. package/fabric-interop/dist/components/ViroSoundField.js.map +1 -0
  409. package/fabric-interop/dist/components/ViroSpatialSound.d.ts +28 -0
  410. package/fabric-interop/dist/components/ViroSpatialSound.d.ts.map +1 -0
  411. package/fabric-interop/dist/components/ViroSpatialSound.js +52 -0
  412. package/fabric-interop/dist/components/ViroSpatialSound.js.map +1 -0
  413. package/fabric-interop/dist/components/ViroSphere.d.ts +23 -0
  414. package/fabric-interop/dist/components/ViroSphere.d.ts.map +1 -0
  415. package/fabric-interop/dist/components/ViroSphere.js +51 -0
  416. package/fabric-interop/dist/components/ViroSphere.js.map +1 -0
  417. package/fabric-interop/dist/components/ViroSpinner.d.ts +19 -0
  418. package/fabric-interop/dist/components/ViroSpinner.d.ts.map +1 -0
  419. package/fabric-interop/dist/components/ViroSpinner.js +47 -0
  420. package/fabric-interop/dist/components/ViroSpinner.js.map +1 -0
  421. package/fabric-interop/dist/components/ViroSpotLight.d.ts +31 -0
  422. package/fabric-interop/dist/components/ViroSpotLight.d.ts.map +1 -0
  423. package/fabric-interop/dist/components/ViroSpotLight.js +59 -0
  424. package/fabric-interop/dist/components/ViroSpotLight.js.map +1 -0
  425. package/fabric-interop/dist/components/ViroSurface.d.ts +39 -0
  426. package/fabric-interop/dist/components/ViroSurface.d.ts.map +1 -0
  427. package/fabric-interop/dist/components/ViroSurface.js +50 -0
  428. package/fabric-interop/dist/components/ViroSurface.js.map +1 -0
  429. package/fabric-interop/dist/components/ViroText.d.ts +37 -0
  430. package/fabric-interop/dist/components/ViroText.d.ts.map +1 -0
  431. package/fabric-interop/dist/components/ViroText.js +61 -0
  432. package/fabric-interop/dist/components/ViroText.js.map +1 -0
  433. package/fabric-interop/dist/components/ViroUtils.d.ts +64 -0
  434. package/fabric-interop/dist/components/ViroUtils.d.ts.map +1 -0
  435. package/fabric-interop/dist/components/ViroUtils.js +141 -0
  436. package/fabric-interop/dist/components/ViroUtils.js.map +1 -0
  437. package/fabric-interop/dist/components/ViroVRSceneNavigator.d.ts +26 -0
  438. package/fabric-interop/dist/components/ViroVRSceneNavigator.d.ts.map +1 -0
  439. package/fabric-interop/dist/components/ViroVRSceneNavigator.js +74 -0
  440. package/fabric-interop/dist/components/ViroVRSceneNavigator.js.map +1 -0
  441. package/fabric-interop/dist/components/ViroVideo.d.ts +33 -0
  442. package/fabric-interop/dist/components/ViroVideo.d.ts.map +1 -0
  443. package/fabric-interop/dist/components/ViroVideo.js +54 -0
  444. package/fabric-interop/dist/components/ViroVideo.js.map +1 -0
  445. package/fabric-interop/dist/components/index.d.ts +63 -0
  446. package/fabric-interop/dist/components/index.d.ts.map +1 -0
  447. package/fabric-interop/dist/components/index.js +145 -0
  448. package/fabric-interop/dist/components/index.js.map +1 -0
  449. package/fabric-interop/dist/index.d.ts +15 -0
  450. package/fabric-interop/dist/index.d.ts.map +1 -0
  451. package/fabric-interop/dist/index.js +118 -0
  452. package/fabric-interop/dist/index.js.map +1 -0
  453. package/fabric-interop/dist/specs/ViroEventsTurboModule.d.ts +20 -0
  454. package/fabric-interop/dist/specs/ViroEventsTurboModule.d.ts.map +1 -0
  455. package/fabric-interop/dist/specs/ViroEventsTurboModule.js +12 -0
  456. package/fabric-interop/dist/specs/ViroEventsTurboModule.js.map +1 -0
  457. package/fabric-interop/examples/BasicSceneExample.tsx +287 -0
  458. package/fabric-interop/examples/ComprehensiveExample.tsx +441 -0
  459. package/fabric-interop/examples/SimpleARExample.tsx +95 -0
  460. package/fabric-interop/global.d.ts +14 -0
  461. package/fabric-interop/index.ts +107 -0
  462. package/fabric-interop/metro.config.js +12 -0
  463. package/fabric-interop/package.json +40 -0
  464. package/fabric-interop/react-native.config.js +22 -0
  465. package/fabric-interop/scripts/validate-build.js +393 -0
  466. package/fabric-interop/scripts/validate-implementation.js +272 -0
  467. package/fabric-interop/specs/README.md +22 -0
  468. package/fabric-interop/specs/ViroEventsTurboModule.ts +27 -0
  469. package/fabric-interop/test/BasicFunctionalityTest.tsx +243 -0
  470. package/fabric-interop/tsconfig.json +38 -0
  471. package/fabric.d.ts +5 -0
  472. package/fabric.ts +14 -0
  473. package/ios/ViroReact.podspec +51 -11
  474. package/package.json +33 -20
  475. package/scripts/copy-types.js +46 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <p align="center" style="background-color: #CCCCCC;">
2
- <a href="https://www.reactvision.org/">
3
- <img src="../viro/public/icons/NVLogo.png">
2
+ <a href="https://www.reactvision.xyz/">
3
+ <img src="https://jjhxsdfjbcyrgmbjocnp.supabase.co/storage/v1/object/public/Downloads/ReactVision/rv-logo-icon.png" alt="react vision logo" width="120px" height="120px">
4
4
  </a>
5
5
  </p>
6
6
 
@@ -25,7 +25,7 @@ ViroReact is a library for developers to rapidly build augmented reality (AR) an
25
25
 
26
26
  # Documentation
27
27
 
28
- [Documentation can be found here!](https://viro-community.readme.io/docs/overview). Currently, the documentation has some issues with code samples and broken links. If you would like to help fix these issues, either submit an edit or [get in touch](https://discord.gg/H3ksm5NhzT)!
28
+ [Documentation can be found here](https://viro-community.readme.io/docs/overview). While we do our best to keep all documentation up to date you may come across issues with broken links or outdated code samples If you do come across any issues please do let us know by either submitting an edit or [get in touch on Discord.](https://discord.gg/H3ksm5NhzT)
29
29
 
30
30
  ## Getting Started
31
31
 
@@ -37,19 +37,25 @@ If you are starting a fresh project with ViroReact, consider cloning one of our
37
37
 
38
38
  # Examples
39
39
 
40
- See our [Example projects](https://viro-community.readme.io/docs/examples) page. These are a little old (~2019) but are a great reference point for how to use bits of the library.
40
+ Check out the [examples](./examples) directory for sample code demonstrating how to use ViroReact with automatic architecture detection and other features.
41
+
42
+ You can also see our [Example projects](https://viro-community.readme.io/docs/examples) page. These are a little old (~2019) but are a great reference point for how to use bits of the library.
41
43
 
42
44
  # Need help? Or want to contribute?
43
45
 
46
+ Whether you're looking for support with building your AR or VR application or you want to contribute to ViroReact, the best way to contact our team is via Discord. If you need more hands-on support with a project, you can visit our documentation site, where we have a [list of trusted partners whom you can hire to help with your project](https://viro-community.readme.io/docs/hire-a-viro-react-expert).
47
+
44
48
  <a href="https://discord.gg/H3ksm5NhzT">
45
49
  <img src="https://discordapp.com/api/guilds/774471080713781259/widget.png?style=banner2" alt="Discord Banner 2"/>
46
50
  </a>
47
51
 
48
52
  # A little history...
49
53
 
50
- ViroReact was originaly developed by the [Viro Media](http://www.viromedia.com/) company, but was open sourced in 2019. In late 2020 the Viro Community was formed to help maintain and move the project onwards, updating it so it could run with modern versions of react native, and start to add in new features. ReactVision now focuses on the project full time making sure the codebase is updated and ready for the future of XR / Spatial Computing.
54
+ ViroReact was originally developed by the [Viro Media](http://www.viromedia.com/), but was open-sourced in 2019. In late 2020, the Viro Community was formed to help maintain and move the project onwards, updating it so it could run with modern versions of React Native, and start to add in new features.
55
+
56
+ Following years of support, in 2025, [Morrow acquired ReactVision](https://www.themorrow.digital/blog/morrow-acquires-reactvision-and-viroreact-library) to help accelerate its development and give it the resources needed to enable ReactVision to capture the rapidly growing demand for ViroReact. ReactVision now has a team working full-time to help ensure the codebase is updated and ready for the future of XR / Spatial Computing. Our vision is to enable React Native developers to build AR and VR applications that can run across all XR devices (smartphones, smart glasses, and headsets) off of a single React Native codebase.
51
57
 
52
- We, as a community, owe a great debt to Viro Media and the people who developed this library originally. We hope to make them proud as it continues to develop and grow in the Viro Community.
58
+ We, as a community, owe a great debt to Viro Media and the people who developed this library originally. We hope to make them proud as it continues to develop and grow within ReactVision.
53
59
 
54
60
  # Supporters
55
61
 
@@ -68,52 +68,91 @@ export class ViroARPlaneSelector extends React.Component<Props, State> {
68
68
  }
69
69
 
70
70
  _getARPlanes() {
71
- if (this.state.selectedSurface == -1) {
72
- let arPlanes: JSX.Element[] = [];
73
- let numPlanes = this.props.maxPlanes || _maxPlanes;
74
- for (let i = 0; i < numPlanes; i++) {
75
- let foundARPlane = this.state.foundARPlanes[i];
76
- let surfaceWidth = foundARPlane ? foundARPlane.width : 0;
77
- let surfaceHeight = foundARPlane ? foundARPlane.height : 0;
78
- let surfacePosition = foundARPlane ? foundARPlane.center : [0, 0, 0];
79
- arPlanes.push(
80
- <ViroARPlane
81
- key={_planePrefix + i}
82
- minWidth={this.props.minWidth}
83
- minHeight={this.props.minHeight}
84
- alignment={this.props.alignment}
85
- onAnchorUpdated={this._onARPlaneUpdated(i)}
86
- >
87
- <ViroQuad
88
- materials={"ViroARPlaneSelector_Translucent"}
89
- onClickState={(clickState, position, source) =>
90
- this._getOnClickSurface(i, { clickState, position, source })
91
- }
92
- position={surfacePosition}
93
- width={surfaceWidth}
94
- height={surfaceHeight}
95
- rotation={[-90, 0, 0]}
96
- />
97
- </ViroARPlane>
98
- );
99
- }
100
- return arPlanes;
101
- } else {
102
- return (
71
+ // Always render a fixed number of planes, controlling visibility instead of conditional rendering
72
+ let arPlanes: JSX.Element[] = [];
73
+ let numPlanes = this.props.maxPlanes || _maxPlanes;
74
+
75
+ // Create all plane slots (both detected and placeholder)
76
+ for (let i = 0; i < numPlanes; i++) {
77
+ // Determine if this is the selected plane
78
+ const isSelected = this.state.selectedSurface === i;
79
+
80
+ // Get real plane data if available, or use defaults
81
+ const foundARPlane = this.state.foundARPlanes[i];
82
+ const hasPlaneData = !!foundARPlane;
83
+
84
+ // Extract plane data or use defaults
85
+ const surfaceWidth = hasPlaneData ? foundARPlane.width || 0.5 : 0.5;
86
+ const surfaceHeight = hasPlaneData ? foundARPlane.height || 0.5 : 0.5;
87
+ const surfacePosition = hasPlaneData
88
+ ? foundARPlane.center || [0, 0, 0]
89
+ : [0, 0, 0];
90
+ const anchorId = hasPlaneData
91
+ ? (foundARPlane as any).anchorId
92
+ : undefined;
93
+
94
+ // Determine visibility based on selection state
95
+ // - In selection mode (selectedSurface === -1): show all planes
96
+ // - In selected mode: only show the selected plane
97
+ const isVisible = this.state.selectedSurface === -1 || isSelected;
98
+
99
+ arPlanes.push(
103
100
  <ViroARPlane
104
- key={_planePrefix + this.state.selectedSurface}
105
- {...this.props}
106
- ></ViroARPlane>
101
+ key={_planePrefix + i}
102
+ minWidth={this.props.minWidth || 0.5}
103
+ minHeight={this.props.minHeight || 0.5}
104
+ alignment={this.props.alignment}
105
+ anchorId={anchorId}
106
+ onAnchorFound={(anchor) => {
107
+ // If we find an anchor, update our plane data
108
+ this._onARPlaneUpdated(i)(anchor);
109
+ }}
110
+ onAnchorUpdated={this._onARPlaneUpdated(i)}
111
+ >
112
+ {/* Always render both the quad and children, controlling only visibility */}
113
+ <ViroQuad
114
+ materials={"ViroARPlaneSelector_Translucent"}
115
+ onClickState={(clickState, position, source) =>
116
+ this._getOnClickSurface(i, { clickState, position, source })
117
+ }
118
+ position={surfacePosition}
119
+ width={surfaceWidth}
120
+ height={surfaceHeight}
121
+ rotation={[-90, 0, 0]}
122
+ opacity={isSelected ? 0 : isVisible ? 1 : 0}
123
+ />
124
+
125
+ {/* Wrap children in a ViroNode to control visibility if children exist */}
126
+ {this.props.children && (
127
+ <ViroNode opacity={isSelected ? 1 : 0}>
128
+ {this.props.children}
129
+ </ViroNode>
130
+ )}
131
+ </ViroARPlane>
107
132
  );
108
133
  }
134
+
135
+ return arPlanes;
109
136
  }
110
137
 
111
138
  _getOnClickSurface = (index: number, event: ViroClickStateEvent) => {
112
139
  if (event.clickState < 3) {
113
140
  return;
114
141
  }
115
- this.setState({ selectedSurface: index });
116
- this._onPlaneSelected(this.state.foundARPlanes[index]);
142
+
143
+ // Get the plane data before updating state to avoid race conditions
144
+ const selectedPlane = this.state.foundARPlanes[index];
145
+ if (!selectedPlane) {
146
+ console.warn(
147
+ "ViroARPlaneSelector: Cannot select plane - plane data not found"
148
+ );
149
+ return;
150
+ }
151
+
152
+ // Update state and call callback with the captured data
153
+ this.setState({ selectedSurface: index }, () => {
154
+ this._onPlaneSelected(selectedPlane);
155
+ });
117
156
  };
118
157
 
119
158
  _onARPlaneUpdated = (index: number) => {
@@ -1 +1 @@
1
- export const VIRO_VERSION = "2.42.0";
1
+ export const VIRO_VERSION = "2.43.1";
@@ -37,7 +37,7 @@ export declare class ViroARPlaneSelector extends React.Component<Props, State> {
37
37
  arPlaneSizes: number[];
38
38
  };
39
39
  render(): React.JSX.Element;
40
- _getARPlanes(): React.JSX.Element | JSX.Element[];
40
+ _getARPlanes(): JSX.Element[];
41
41
  _getOnClickSurface: (index: number, event: ViroClickStateEvent) => void;
42
42
  _onARPlaneUpdated: (index: number) => (updateMap: ViroPlaneUpdatedMap) => void;
43
43
  _onPlaneSelected: (updateMap: ViroPlaneUpdatedMap) => void;
@@ -69,30 +69,58 @@ class ViroARPlaneSelector extends React.Component {
69
69
  return <ViroNode_1.ViroNode>{this._getARPlanes()}</ViroNode_1.ViroNode>;
70
70
  }
71
71
  _getARPlanes() {
72
- if (this.state.selectedSurface == -1) {
73
- let arPlanes = [];
74
- let numPlanes = this.props.maxPlanes || _maxPlanes;
75
- for (let i = 0; i < numPlanes; i++) {
76
- let foundARPlane = this.state.foundARPlanes[i];
77
- let surfaceWidth = foundARPlane ? foundARPlane.width : 0;
78
- let surfaceHeight = foundARPlane ? foundARPlane.height : 0;
79
- let surfacePosition = foundARPlane ? foundARPlane.center : [0, 0, 0];
80
- arPlanes.push(<ViroARPlane_1.ViroARPlane key={_planePrefix + i} minWidth={this.props.minWidth} minHeight={this.props.minHeight} alignment={this.props.alignment} onAnchorUpdated={this._onARPlaneUpdated(i)}>
81
- <ViroQuad_1.ViroQuad materials={"ViroARPlaneSelector_Translucent"} onClickState={(clickState, position, source) => this._getOnClickSurface(i, { clickState, position, source })} position={surfacePosition} width={surfaceWidth} height={surfaceHeight} rotation={[-90, 0, 0]}/>
82
- </ViroARPlane_1.ViroARPlane>);
83
- }
84
- return arPlanes;
85
- }
86
- else {
87
- return (<ViroARPlane_1.ViroARPlane key={_planePrefix + this.state.selectedSurface} {...this.props}></ViroARPlane_1.ViroARPlane>);
72
+ // Always render a fixed number of planes, controlling visibility instead of conditional rendering
73
+ let arPlanes = [];
74
+ let numPlanes = this.props.maxPlanes || _maxPlanes;
75
+ // Create all plane slots (both detected and placeholder)
76
+ for (let i = 0; i < numPlanes; i++) {
77
+ // Determine if this is the selected plane
78
+ const isSelected = this.state.selectedSurface === i;
79
+ // Get real plane data if available, or use defaults
80
+ const foundARPlane = this.state.foundARPlanes[i];
81
+ const hasPlaneData = !!foundARPlane;
82
+ // Extract plane data or use defaults
83
+ const surfaceWidth = hasPlaneData ? foundARPlane.width || 0.5 : 0.5;
84
+ const surfaceHeight = hasPlaneData ? foundARPlane.height || 0.5 : 0.5;
85
+ const surfacePosition = hasPlaneData
86
+ ? foundARPlane.center || [0, 0, 0]
87
+ : [0, 0, 0];
88
+ const anchorId = hasPlaneData
89
+ ? foundARPlane.anchorId
90
+ : undefined;
91
+ // Determine visibility based on selection state
92
+ // - In selection mode (selectedSurface === -1): show all planes
93
+ // - In selected mode: only show the selected plane
94
+ const isVisible = this.state.selectedSurface === -1 || isSelected;
95
+ arPlanes.push(<ViroARPlane_1.ViroARPlane key={_planePrefix + i} minWidth={this.props.minWidth || 0.5} minHeight={this.props.minHeight || 0.5} alignment={this.props.alignment} anchorId={anchorId} onAnchorFound={(anchor) => {
96
+ // If we find an anchor, update our plane data
97
+ this._onARPlaneUpdated(i)(anchor);
98
+ }} onAnchorUpdated={this._onARPlaneUpdated(i)}>
99
+ {/* Always render both the quad and children, controlling only visibility */}
100
+ <ViroQuad_1.ViroQuad materials={"ViroARPlaneSelector_Translucent"} onClickState={(clickState, position, source) => this._getOnClickSurface(i, { clickState, position, source })} position={surfacePosition} width={surfaceWidth} height={surfaceHeight} rotation={[-90, 0, 0]} opacity={isSelected ? 0 : isVisible ? 1 : 0}/>
101
+
102
+ {/* Wrap children in a ViroNode to control visibility if children exist */}
103
+ {this.props.children && (<ViroNode_1.ViroNode opacity={isSelected ? 1 : 0}>
104
+ {this.props.children}
105
+ </ViroNode_1.ViroNode>)}
106
+ </ViroARPlane_1.ViroARPlane>);
88
107
  }
108
+ return arPlanes;
89
109
  }
90
110
  _getOnClickSurface = (index, event) => {
91
111
  if (event.clickState < 3) {
92
112
  return;
93
113
  }
94
- this.setState({ selectedSurface: index });
95
- this._onPlaneSelected(this.state.foundARPlanes[index]);
114
+ // Get the plane data before updating state to avoid race conditions
115
+ const selectedPlane = this.state.foundARPlanes[index];
116
+ if (!selectedPlane) {
117
+ console.warn("ViroARPlaneSelector: Cannot select plane - plane data not found");
118
+ return;
119
+ }
120
+ // Update state and call callback with the captured data
121
+ this.setState({ selectedSurface: index }, () => {
122
+ this._onPlaneSelected(selectedPlane);
123
+ });
96
124
  };
97
125
  _onARPlaneUpdated = (index) => {
98
126
  return (updateMap) => {
@@ -1 +1 @@
1
- export declare const VIRO_VERSION = "2.42.0";
1
+ export declare const VIRO_VERSION = "2.43.1";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VIRO_VERSION = void 0;
4
- exports.VIRO_VERSION = "2.42.0";
4
+ exports.VIRO_VERSION = "2.43.1";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Viro React Native - New Architecture Required
3
+ *
4
+ * This library requires React Native's New Architecture (Fabric) to be enabled.
5
+ * Legacy architecture support has been removed as of version 2.43.1.
6
+ */
7
+ declare global {
8
+ var nativeFabricUIManager: any;
9
+ var __turboModuleProxy: any;
10
+ }
11
+ export {};
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ /**
3
+ * Viro React Native - New Architecture Required
4
+ *
5
+ * This library requires React Native's New Architecture (Fabric) to be enabled.
6
+ * Legacy architecture support has been removed as of version 2.43.1.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ // Strict New Architecture validation
10
+ function validateNewArchitecture() {
11
+ // Check for New Architecture indicators
12
+ const hasFabricUIManager = !!global.nativeFabricUIManager;
13
+ const hasTurboModules = !!global.__turboModuleProxy;
14
+ if (!hasFabricUIManager && !hasTurboModules) {
15
+ throw new Error("ViroReact: New Architecture (Fabric) is required but not detected.\n\n" +
16
+ "This library requires React Native 0.76.9+ with New Architecture enabled.\n" +
17
+ "Please enable New Architecture in your app:\n\n" +
18
+ "1. Set 'newArchEnabled=true' in android/gradle.properties\n" +
19
+ "2. Set 'RCT_NEW_ARCH_ENABLED=1' in ios/.xcode.env\n" +
20
+ "3. Ensure you're using React Native 0.76.9 or higher\n\n" +
21
+ "For more information, visit: https://reactnative.dev/docs/new-architecture-intro");
22
+ }
23
+ console.log("ViroReact: New Architecture (Fabric) detected ✓");
24
+ }
25
+ // Validate New Architecture on module load
26
+ validateNewArchitecture();
27
+ // Export fabric-interop components directly
28
+ module.exports = require("./fabric-interop");
@@ -0,0 +1,10 @@
1
+ /**
2
+ * AutoDetectionExample
3
+ *
4
+ * This example demonstrates how to use ViroReact with automatic architecture detection.
5
+ * The library will automatically detect whether your app is using the New Architecture (Fabric)
6
+ * and use the appropriate implementation.
7
+ */
8
+ import React from "react";
9
+ declare const AutoDetectionExample: () => React.JSX.Element;
10
+ export default AutoDetectionExample;
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ /**
3
+ * AutoDetectionExample
4
+ *
5
+ * This example demonstrates how to use ViroReact with automatic architecture detection.
6
+ * The library will automatically detect whether your app is using the New Architecture (Fabric)
7
+ * and use the appropriate implementation.
8
+ */
9
+ var __importDefault = (this && this.__importDefault) || function (mod) {
10
+ return (mod && mod.__esModule) ? mod : { "default": mod };
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ const react_1 = __importDefault(require("react"));
14
+ const react_native_1 = require("react-native");
15
+ const react_viro_1 = require("@reactvision/react-viro");
16
+ // Define the AR scene component
17
+ const ARScene = () => {
18
+ const [text, setText] = react_1.default.useState("Initializing AR...");
19
+ // Handle tracking state updates
20
+ const onTrackingUpdated = (state) => {
21
+ if (state.state === react_viro_1.ViroTrackingStateConstants.TRACKING_NORMAL) {
22
+ setText("Hello Viro!");
23
+ }
24
+ else if (state.state === react_viro_1.ViroTrackingStateConstants.TRACKING_NONE) {
25
+ setText("Tracking lost. Please point the camera at a flat surface.");
26
+ }
27
+ };
28
+ return (<react_viro_1.ViroARScene onTrackingUpdated={onTrackingUpdated}>
29
+ {/* A simple 3D box floating 1 meter in front of the user */}
30
+ <react_viro_1.ViroBox position={[0, 0, -1]} scale={[0.1, 0.1, 0.1]} materials={["grid"]}/>
31
+
32
+ {/* Text above the box */}
33
+ <react_viro_1.ViroText text={text} position={[0, 0.1, -1]} scale={[0.1, 0.1, 0.1]} style={{ color: "#ffffff", fontWeight: "bold", textAlign: "center" }}/>
34
+ </react_viro_1.ViroARScene>);
35
+ };
36
+ // Main app component
37
+ const AutoDetectionExample = () => {
38
+ const [arStarted, setArStarted] = react_1.default.useState(false);
39
+ const startAR = () => {
40
+ setArStarted(true);
41
+ };
42
+ if (arStarted) {
43
+ return (<react_viro_1.ViroARSceneNavigator initialScene={{
44
+ scene: ARScene,
45
+ }} style={styles.arView}/>);
46
+ }
47
+ return (<react_native_1.View style={styles.container}>
48
+ <react_native_1.Text style={styles.title}>ViroReact Auto-Detection Example</react_native_1.Text>
49
+ <react_native_1.Text style={styles.description}>
50
+ This example uses the automatic architecture detection feature. The
51
+ library will automatically use the appropriate implementation based on
52
+ whether your app has the New Architecture enabled.
53
+ </react_native_1.Text>
54
+ <react_native_1.TouchableOpacity style={styles.button} onPress={startAR}>
55
+ <react_native_1.Text style={styles.buttonText}>Start AR</react_native_1.Text>
56
+ </react_native_1.TouchableOpacity>
57
+ </react_native_1.View>);
58
+ };
59
+ const styles = react_native_1.StyleSheet.create({
60
+ container: {
61
+ flex: 1,
62
+ justifyContent: "center",
63
+ alignItems: "center",
64
+ padding: 20,
65
+ },
66
+ title: {
67
+ fontSize: 24,
68
+ fontWeight: "bold",
69
+ marginBottom: 20,
70
+ },
71
+ description: {
72
+ fontSize: 16,
73
+ textAlign: "center",
74
+ marginBottom: 30,
75
+ },
76
+ button: {
77
+ backgroundColor: "#1E88E5",
78
+ paddingHorizontal: 30,
79
+ paddingVertical: 15,
80
+ borderRadius: 8,
81
+ },
82
+ buttonText: {
83
+ color: "white",
84
+ fontSize: 18,
85
+ fontWeight: "bold",
86
+ },
87
+ arView: {
88
+ flex: 1,
89
+ },
90
+ });
91
+ exports.default = AutoDetectionExample;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * NativeViro - JSI Bridge Functions
3
+ *
4
+ * This module provides direct JSI functions to communicate with the native Viro implementation.
5
+ * These functions bypass the React Native bridge and codegen, providing direct access to
6
+ * the existing native implementation.
7
+ */
8
+ export type ViroNodeProps = Record<string, any>;
9
+ export type ViroNodeType = "box" | "sphere" | "text" | "image" | "animatedImage" | "animatedComponent" | "object" | "scene" | "arScene" | "camera" | "arCamera" | "orbitCamera" | "light" | "ambientLight" | "directionalLight" | "spotLight" | "omniLight" | "sound" | "soundField" | "spatialSound" | "video" | "materialVideo" | "portal" | "portalScene" | "plane" | "arPlane" | "arImageMarker" | "arObjectMarker" | "quad" | "polygon" | "polyline" | "geometry" | "particle" | "flexView" | "surface" | "360Image" | "360Video" | "skyBox" | "lightingEnvironment" | "button" | "controller" | "node";
10
+ export type ViroEventCallback = (event: any) => void;
11
+ export declare const generateNodeId: () => string;
12
+ export declare const generateCallbackId: () => string;
13
+ export declare function handleViroEvent(callbackId: string, event: any): void;
14
+ export declare function registerEventListener(nodeId: string, eventName: string, callback: ViroEventCallback): string;
15
+ export declare function unregisterEventListener(nodeId: string, eventName: string, callbackId: string): void;
16
+ export declare function initializeViro(config?: {
17
+ debug?: boolean;
18
+ arEnabled?: boolean;
19
+ worldAlignment?: string;
20
+ }): Promise<boolean>;
21
+ export declare function createScene(sceneId: string, sceneType: string, props?: ViroNodeProps): void;
22
+ export declare function activateScene(sceneId: string): void;
23
+ export declare function deactivateScene(sceneId: string): void;
24
+ export declare function destroyScene(sceneId: string): void;
25
+ export declare function getSceneState(sceneId: string): string | null;
26
+ export declare function getMemoryStats(): Record<string, any> | null;
27
+ export declare function performMemoryCleanup(): void;
28
+ export declare function createNode(nodeId: string, nodeType: ViroNodeType, props?: ViroNodeProps): void;
29
+ export declare function updateNode(nodeId: string, props: ViroNodeProps): void;
30
+ export declare function deleteNode(nodeId: string): void;
31
+ export declare function addChild(parentId: string, childId: string): void;
32
+ export declare function removeChild(parentId: string, childId: string): void;
33
+ export declare function createMaterial(materialName: string, properties: Record<string, any>): void;
34
+ export declare function updateMaterial(materialName: string, properties: Record<string, any>): void;
35
+ export declare function createAnimation(animationName: string, properties: Record<string, any>): void;
36
+ export declare function executeAnimation(nodeId: string, animationName: string, options?: Record<string, any>): void;
37
+ export declare function setARPlaneDetection(config: {
38
+ enabled?: boolean;
39
+ alignment?: string;
40
+ }): void;
41
+ export declare function setARImageTargets(targets: Record<string, any>): void;
42
+ export declare function isViroJSIAvailable(): boolean;