@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
@@ -0,0 +1,22 @@
1
+ # TurboModule Specifications
2
+
3
+ This directory contains TurboModule specifications for the Viro Fabric-Interop layer.
4
+
5
+ ## Files
6
+
7
+ - **ViroEventsTurboModule.ts**: TurboModule specification for event emission and management in React Native's New Architecture.
8
+
9
+ ## Purpose
10
+
11
+ These TypeScript files define the interfaces for TurboModules that bridge JavaScript and native code in React Native's New Architecture (Fabric). They are used by the codegen system to generate the appropriate native interfaces.
12
+
13
+ ## Usage
14
+
15
+ These specs are automatically registered with React Native's TurboModule system and provide type-safe interfaces for:
16
+
17
+ - Event emission from native to JavaScript
18
+ - JSI callback management
19
+ - Node and scene event handling
20
+ - TurboModule lifecycle management
21
+
22
+ The native implementations (iOS `.mm` and Android `.java` files) must conform to these interfaces.
@@ -0,0 +1,27 @@
1
+ /**
2
+ * ViroEventsTurboModule.ts
3
+ * TurboModule specification for Viro event emission
4
+ *
5
+ * This module provides proper event emission for JSI callbacks
6
+ * in React Native's New Architecture (Fabric + TurboModules)
7
+ */
8
+
9
+ import type { TurboModule } from "react-native";
10
+ import { TurboModuleRegistry } from "react-native";
11
+
12
+ export interface Spec extends TurboModule {
13
+ // Event listener management
14
+ addListener(eventName: string): void;
15
+ removeListeners(count: number): void;
16
+
17
+ // Event emission methods
18
+ emitJSICallback(callbackId: string, eventData: Object): void;
19
+ emitNodeEvent(nodeId: string, eventName: string, eventData: Object): void;
20
+ emitSceneEvent(sceneId: string, eventName: string, eventData: Object): void;
21
+
22
+ // Utility methods
23
+ isEventSystemReady(): boolean;
24
+ getActiveListenerCount(): number;
25
+ }
26
+
27
+ export default TurboModuleRegistry.getEnforcing<Spec>("ViroEvents");
@@ -0,0 +1,243 @@
1
+ /**
2
+ * BasicFunctionalityTest - Integration test for fabric-interop layer
3
+ *
4
+ * This test verifies the core functionality of the fabric-interop layer
5
+ * by testing basic operations like node creation, scene management, and events.
6
+ */
7
+
8
+ import React, { useEffect, useState } from "react";
9
+ import { View, Text, StyleSheet, Alert } from "react-native";
10
+ import { ViroFabricContainer } from "../ViroFabricContainer";
11
+ import { ViroScene } from "../components/ViroScene";
12
+ import { ViroBox } from "../components/ViroBox";
13
+ import { ViroText } from "../components/ViroText";
14
+ import {
15
+ isViroJSIAvailable,
16
+ createScene,
17
+ createNode,
18
+ getMemoryStats,
19
+ } from "../NativeViro";
20
+
21
+ interface TestResult {
22
+ name: string;
23
+ passed: boolean;
24
+ error?: string;
25
+ }
26
+
27
+ export const BasicFunctionalityTest: React.FC = () => {
28
+ const [testResults, setTestResults] = useState<TestResult[]>([]);
29
+ const [isRunning, setIsRunning] = useState(false);
30
+ const [allTestsPassed, setAllTestsPassed] = useState<boolean | null>(null);
31
+
32
+ useEffect(() => {
33
+ runTests();
34
+ }, []);
35
+
36
+ const addTestResult = (name: string, passed: boolean, error?: string) => {
37
+ setTestResults((prev) => [...prev, { name, passed, error }]);
38
+ };
39
+
40
+ const runTests = async () => {
41
+ setIsRunning(true);
42
+ setTestResults([]);
43
+
44
+ try {
45
+ // Test 1: JSI Availability
46
+ const jsiAvailable = isViroJSIAvailable();
47
+ addTestResult(
48
+ "JSI Available",
49
+ jsiAvailable,
50
+ jsiAvailable ? undefined : "JSI bridge not available"
51
+ );
52
+
53
+ if (jsiAvailable) {
54
+ // Test 2: Scene Creation
55
+ try {
56
+ createScene("test_scene", "scene", { background: [0, 0, 0] });
57
+ addTestResult("Scene Creation", true);
58
+ } catch (error) {
59
+ addTestResult("Scene Creation", false, `Error: ${error}`);
60
+ }
61
+
62
+ // Test 3: Node Creation
63
+ try {
64
+ createNode("test_box", "box", {
65
+ position: [0, 0, -1],
66
+ scale: [0.5, 0.5, 0.5],
67
+ });
68
+ addTestResult("Node Creation", true);
69
+ } catch (error) {
70
+ addTestResult("Node Creation", false, `Error: ${error}`);
71
+ }
72
+
73
+ // Test 4: Memory Stats
74
+ try {
75
+ const stats = getMemoryStats();
76
+ const hasStats = stats && typeof stats === "object";
77
+ addTestResult(
78
+ "Memory Stats",
79
+ !!hasStats,
80
+ hasStats ? undefined : "No memory stats returned"
81
+ );
82
+ } catch (error) {
83
+ addTestResult("Memory Stats", false, `Error: ${error}`);
84
+ }
85
+
86
+ // Test 5: Component Rendering (requires actual container)
87
+ // This will be tested by the component tree below
88
+ addTestResult(
89
+ "Component Rendering",
90
+ true,
91
+ "Testing via component tree"
92
+ );
93
+ }
94
+
95
+ // Calculate overall result
96
+ setTimeout(() => {
97
+ setIsRunning(false);
98
+ const passed = testResults.every((result) => result.passed);
99
+ setAllTestsPassed(passed);
100
+
101
+ if (passed) {
102
+ Alert.alert("Tests Passed", "All basic functionality tests passed!");
103
+ } else {
104
+ const failed = testResults.filter((r) => !r.passed);
105
+ Alert.alert(
106
+ "Tests Failed",
107
+ `${failed.length} test(s) failed. Check the log for details.`
108
+ );
109
+ }
110
+ }, 1000);
111
+ } catch (error) {
112
+ setIsRunning(false);
113
+ addTestResult("Test Execution", false, `Fatal error: ${error}`);
114
+ setAllTestsPassed(false);
115
+ }
116
+ };
117
+
118
+ const handleInitialized = (success: boolean) => {
119
+ console.log("ViroFabricContainer initialized:", success);
120
+ addTestResult(
121
+ "Container Initialization",
122
+ success,
123
+ success ? undefined : "Container failed to initialize"
124
+ );
125
+ };
126
+
127
+ return (
128
+ <View style={styles.container}>
129
+ <Text style={styles.title}>Fabric-Interop Basic Functionality Test</Text>
130
+
131
+ <View style={styles.statusContainer}>
132
+ <Text style={styles.statusText}>
133
+ Status:{" "}
134
+ {isRunning
135
+ ? "Running..."
136
+ : allTestsPassed === null
137
+ ? "Not started"
138
+ : allTestsPassed
139
+ ? "PASSED"
140
+ : "FAILED"}
141
+ </Text>
142
+ </View>
143
+
144
+ <View style={styles.resultsContainer}>
145
+ <Text style={styles.resultsTitle}>Test Results:</Text>
146
+ {testResults.map((result, index) => (
147
+ <View key={index} style={styles.resultItem}>
148
+ <Text
149
+ style={[
150
+ styles.resultText,
151
+ { color: result.passed ? "green" : "red" },
152
+ ]}
153
+ >
154
+ {result.passed ? "✓" : "✗"} {result.name}
155
+ </Text>
156
+ {result.error && (
157
+ <Text style={styles.errorText}>{result.error}</Text>
158
+ )}
159
+ </View>
160
+ ))}
161
+ </View>
162
+
163
+ <View style={styles.viroContainer}>
164
+ <ViroFabricContainer
165
+ style={styles.viroFabric}
166
+ arEnabled={false}
167
+ debug={true}
168
+ onInitialized={handleInitialized}
169
+ >
170
+ <ViroScene>
171
+ <ViroBox
172
+ position={[0, 0, -1]}
173
+ scale={[0.3, 0.3, 0.3]}
174
+ materials={["test_material"]}
175
+ />
176
+ <ViroText text="Test Scene" position={[0, 0.5, -1]} />
177
+ </ViroScene>
178
+ </ViroFabricContainer>
179
+ </View>
180
+ </View>
181
+ );
182
+ };
183
+
184
+ const styles = StyleSheet.create({
185
+ container: {
186
+ flex: 1,
187
+ padding: 20,
188
+ backgroundColor: "#f0f0f0",
189
+ },
190
+ title: {
191
+ fontSize: 18,
192
+ fontWeight: "bold",
193
+ textAlign: "center",
194
+ marginBottom: 20,
195
+ },
196
+ statusContainer: {
197
+ backgroundColor: "#e0e0e0",
198
+ padding: 10,
199
+ borderRadius: 5,
200
+ marginBottom: 20,
201
+ },
202
+ statusText: {
203
+ fontSize: 16,
204
+ fontWeight: "bold",
205
+ textAlign: "center",
206
+ },
207
+ resultsContainer: {
208
+ backgroundColor: "#ffffff",
209
+ padding: 15,
210
+ borderRadius: 5,
211
+ marginBottom: 20,
212
+ maxHeight: 200,
213
+ },
214
+ resultsTitle: {
215
+ fontSize: 16,
216
+ fontWeight: "bold",
217
+ marginBottom: 10,
218
+ },
219
+ resultItem: {
220
+ marginBottom: 8,
221
+ },
222
+ resultText: {
223
+ fontSize: 14,
224
+ fontWeight: "bold",
225
+ },
226
+ errorText: {
227
+ fontSize: 12,
228
+ color: "#666",
229
+ marginLeft: 20,
230
+ marginTop: 2,
231
+ },
232
+ viroContainer: {
233
+ flex: 1,
234
+ backgroundColor: "#000000",
235
+ borderRadius: 5,
236
+ overflow: "hidden",
237
+ },
238
+ viroFabric: {
239
+ flex: 1,
240
+ },
241
+ });
242
+
243
+ export default BasicFunctionalityTest;
@@ -0,0 +1,38 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2018",
4
+ "module": "commonjs",
5
+ "lib": ["es2018"],
6
+ "declaration": true,
7
+ "declarationMap": true,
8
+ "sourceMap": true,
9
+ "outDir": "./dist",
10
+ "rootDir": "./",
11
+ "strict": false,
12
+ "moduleResolution": "node",
13
+ "baseUrl": "./",
14
+ "esModuleInterop": true,
15
+ "skipLibCheck": true,
16
+ "forceConsistentCasingInFileNames": true,
17
+ "resolveJsonModule": true,
18
+ "jsx": "react-native",
19
+ "allowSyntheticDefaultImports": true,
20
+ "noImplicitAny": false,
21
+ "noEmitOnError": false,
22
+ "paths": {
23
+ "*": ["*", "components/*"]
24
+ }
25
+ },
26
+ "include": [
27
+ "index.ts",
28
+ "ViroFabricContainer.tsx",
29
+ "NativeViro.ts",
30
+ "components/**/*",
31
+ "global.d.ts"
32
+ ],
33
+ "exclude": [
34
+ "node_modules",
35
+ "dist",
36
+ "**/__tests__/*"
37
+ ]
38
+ }
package/fabric.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Type definitions for Viro React Native Fabric components
3
+ */
4
+
5
+ export * from "./fabric-interop";
package/fabric.ts ADDED
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Viro React Native - Fabric (New Architecture) Components
3
+ *
4
+ * This entry point provides access to Viro components that are compatible with
5
+ * React Native's New Architecture (Fabric). Use these components when your app
6
+ * has the New Architecture enabled.
7
+ *
8
+ * @example
9
+ * ```
10
+ * import { ViroARScene, Viro3DObject } from '@reactvision/react-viro/fabric';
11
+ * ```
12
+ */
13
+
14
+ export * from "./fabric-interop";
@@ -4,16 +4,56 @@ package = JSON.parse(File.read(File.join(__dir__, '../package.json')))
4
4
 
5
5
  Pod::Spec.new do |s|
6
6
  s.name = 'ViroReact'
7
- s.version = '1.0'
8
- s.summary = 'Test description'
9
- s.source = { :http => 'https://s3-us-west-2.amazonaws.com/viro-docs/ViroReact.tar.gz'}
10
- s.source_files = 'dist/include'
11
- s.public_header_files = 'dist/include/*.h'
12
- s.vendored_libraries = 'dist/lib/libViroReact.a'
13
- s.homepage = 'http://viromedia.com'
14
- s.license = {:type => 'Copyright', :text => "Copyright 2018 ViroMedia, Inc" }
15
- s.author = 'Viro Media'
7
+ s.version = package['version']
8
+ s.summary = 'Viro React Native library for AR/VR applications'
9
+ s.source = { :git => 'https://github.com/ReactVision/viro.git', :tag => "v#{s.version}" }
10
+ s.homepage = 'https://github.com/ReactVision/viro'
11
+ s.license = { :type => 'MIT', :file => '../LICENSE' }
12
+ s.author = 'ReactVision'
16
13
  s.requires_arc = true
17
- s.platform = :ios, '10.0'
18
- s.dependency 'React'
14
+ s.platform = :ios, '12.0'
15
+ s.ios.deployment_target = '12.0'
16
+
17
+ # Base source files (always included)
18
+ s.source_files = 'ViroReact/**/*.{h,m,mm}', 'ViroFabric/**/*.{h,m,mm}'
19
+ s.public_header_files = 'ViroReact/**/*.h', 'ViroFabric/**/*.h'
20
+
21
+ # Include dist files if they exist (for release builds)
22
+ if File.exist?(File.join(__dir__, 'dist/include'))
23
+ s.source_files += ', dist/include'
24
+ s.public_header_files += ', dist/include/*.h'
25
+ end
26
+
27
+ if File.exist?(File.join(__dir__, 'dist/lib/libViroReact.a'))
28
+ s.vendored_libraries = 'dist/lib/libViroReact.a'
29
+ end
30
+
31
+ # React Native dependencies
32
+ s.dependency 'React-Core'
33
+
34
+ # Fabric dependencies
35
+ s.dependency 'React-RCTFabric'
36
+ s.dependency 'React-Fabric'
37
+ s.dependency 'React-FabricComponents'
38
+
39
+ # Fabric-specific build configuration
40
+ s.pod_target_xcconfig = {
41
+ 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
42
+ 'HEADER_SEARCH_PATHS' => [
43
+ '"$(PODS_TARGET_SRCROOT)/ViroFabric"',
44
+ '"$(PODS_TARGET_SRCROOT)/ViroReact"',
45
+ '"$(PODS_TARGET_SRCROOT)/dist/include"',
46
+ '"$(PODS_ROOT)/Headers/Public"',
47
+ '"$(PODS_ROOT)/Headers/Public/ViroKit"',
48
+ '"$(PODS_ROOT)/ViroKit/dist/include"',
49
+ '"$(PODS_ROOT)/ViroKit/Headers"'
50
+ ].join(' '),
51
+ 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) RCT_NEW_ARCH_ENABLED=1',
52
+ 'OTHER_CPLUSPLUSFLAGS' => '$(inherited) -std=c++17'
53
+ }
54
+
55
+ # User target configuration for consumers
56
+ s.user_target_xcconfig = {
57
+ 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/ViroReact/ViroFabric"'
58
+ }
19
59
  end
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@reactvision/react-viro",
3
- "main": "dist/index.js",
4
- "module": "dist/index.js",
5
- "types": "dist/index.d.ts",
6
- "version": "2.42.0",
3
+ "main": "fabric-interop/dist/index.js",
4
+ "module": "fabric-interop/dist/index.js",
5
+ "types": "fabric-interop/dist/index.d.ts",
6
+ "version": "2.43.1",
7
7
  "license": "MIT",
8
8
  "publishConfig": {
9
9
  "registry": "https://registry.npmjs.org/"
@@ -12,22 +12,28 @@
12
12
  "type": "git",
13
13
  "url": "git+ssh://git@github.com/ReactVision/viro.git"
14
14
  },
15
- "description": "Maintained version of react-viro",
15
+ "description": "Maintained version of react-viro - New Architecture (Fabric) required",
16
16
  "scripts": {
17
17
  "start": "echo 'I dont think you meant to run npm start here.'",
18
18
  "test": "jest",
19
19
  "tsc": "tsc",
20
20
  "prebuild": "node -p \"'export const VIRO_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > components/Utilities/ViroVersion.ts",
21
- "build": "tsc && npm run copy-files",
21
+ "build": "cd fabric-interop && npm run build",
22
+ "build:legacy": "tsc && npm run copy-files",
23
+ "build:all": "npm run build && npm run build:legacy",
22
24
  "bundle": "./prepare_release.sh",
23
25
  "copy-files": "cp -r ./components/Resources/ ./dist/components/Resources/",
24
- "clean": "rm -rf ./dist/ *.tgz node_modules/",
26
+ "clean": "rm -rf ./dist/ *.tgz node_modules/ fabric-interop/dist/",
25
27
  "release": "release-it",
26
- "after:release": "./prepare_release.sh"
28
+ "after:release": "./prepare_release.sh",
29
+ "prepare": "npm run build"
27
30
  },
28
31
  "peerDependencies": {
29
- "expo": "52.0.30",
30
- "react-native": "0.76.0"
32
+ "expo": "~52.0.43",
33
+ "react-native": ">=0.76.9"
34
+ },
35
+ "engines": {
36
+ "react-native": ">=0.76.9"
31
37
  },
32
38
  "peerDependenciesMeta": {
33
39
  "expo": {
@@ -38,8 +44,15 @@
38
44
  "index.d.ts",
39
45
  "index.js",
40
46
  "index.ts",
47
+ "fabric.ts",
48
+ "fabric.d.ts",
49
+ "dynamic-index.ts",
50
+ "dynamic-index-source.d.ts",
41
51
  "components",
42
52
  "dist",
53
+ "fabric-interop",
54
+ "scripts",
55
+ "examples",
43
56
  "app.plugin.js",
44
57
  "android/react_viro",
45
58
  "android/viro_renderer",
@@ -52,7 +65,7 @@
52
65
  ],
53
66
  "dependencies": {
54
67
  "@expo/config-plugins": "^9.0.14",
55
- "react": "^18.3.1",
68
+ "react": "18.3.1",
56
69
  "react-native-gradle-plugin": "^0.71.19"
57
70
  },
58
71
  "devDependencies": {
@@ -60,21 +73,21 @@
60
73
  "@babel/preset-env": "^7.25.3",
61
74
  "@babel/preset-typescript": "^7.26.0",
62
75
  "@jest/globals": "^29.7.0",
63
- "@react-native-community/cli": "15.0.1",
64
- "@react-native-community/cli-platform-android": "15.0.1",
65
- "@react-native-community/cli-platform-ios": "15.0.1",
66
- "@react-native/babel-preset": "0.77.0",
67
- "@react-native/eslint-config": "0.77.0",
68
- "@react-native/metro-config": "0.77.0",
69
- "@react-native/typescript-config": "0.77.0",
76
+ "@react-native-community/cli": "^15.0.1",
77
+ "@react-native-community/cli-platform-android": "^15.0.1",
78
+ "@react-native-community/cli-platform-ios": "^15.0.1",
79
+ "@react-native/babel-preset": "^0.77.0",
80
+ "@react-native/eslint-config": "^0.77.0",
81
+ "@react-native/metro-config": "^0.77.0",
82
+ "@react-native/typescript-config": "^0.77.0",
70
83
  "@types/babel__core": "^7.20.5",
71
84
  "@types/node": "^22.13.1",
72
85
  "@types/react": "^18.3.18",
73
86
  "@types/react-native": "^0.73.0",
74
87
  "babel-jest": "^29.7.0",
75
- "expo": "52.0.30",
88
+ "expo": ">=52.0.0",
76
89
  "jest": "^29.7.0",
77
- "react-native": "0.76.0",
90
+ "react-native": "0.74.7 || 0.75.5 || 0.76.9",
78
91
  "release-it": "^17.1.1",
79
92
  "ts-node": "^10.9.2",
80
93
  "typescript": "^5.3.0"
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Script to copy index.d.ts to dynamic-index.d.ts and add global declarations
3
+ */
4
+
5
+ const fs = require("fs");
6
+ const path = require("path");
7
+
8
+ // Paths
9
+ const indexDtsPath = path.join(__dirname, "../dist/index.d.ts");
10
+ const dynamicIndexDtsPath = path.join(__dirname, "../dist/dynamic-index.d.ts");
11
+
12
+ // Read the index.d.ts file
13
+ let indexDtsContent = fs.readFileSync(indexDtsPath, "utf8");
14
+
15
+ // Create the dynamic-index.d.ts content
16
+ const dynamicIndexDtsContent = `/**
17
+ * Type definitions for Viro React Native with dynamic architecture detection
18
+ *
19
+ * This file provides type definitions for the dynamic architecture detection.
20
+ * At runtime, either the legacy or Fabric implementation will be used,
21
+ * but for TypeScript purposes, we use the legacy implementation's types.
22
+ */
23
+
24
+ // Add type declarations for global variables used in New Architecture detection
25
+ declare global {
26
+ var nativeFabricUIManager: any;
27
+ var __turboModuleProxy: any;
28
+ }
29
+
30
+ // Export all types from the legacy implementation
31
+ ${indexDtsContent}
32
+ `;
33
+
34
+ // Write the dynamic-index.d.ts file
35
+ fs.writeFileSync(dynamicIndexDtsPath, dynamicIndexDtsContent);
36
+
37
+ // Also write to the source file for reference
38
+ const dynamicIndexSourceDtsPath = path.join(
39
+ __dirname,
40
+ "../dynamic-index-source.d.ts"
41
+ );
42
+ fs.writeFileSync(dynamicIndexSourceDtsPath, dynamicIndexDtsContent);
43
+
44
+ console.log(
45
+ "Successfully copied types from index.d.ts to dynamic-index.d.ts and dynamic-index-source.d.ts"
46
+ );