@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.
- package/README.md +12 -6
- package/android/react_viro/react_viro-release.aar +0 -0
- package/components/AR/ViroARPlaneSelector.tsx +76 -37
- package/components/Utilities/ViroVersion.ts +1 -1
- package/dist/components/AR/ViroARPlaneSelector.d.ts +1 -1
- package/dist/components/AR/ViroARPlaneSelector.js +46 -18
- package/dist/components/Utilities/ViroVersion.d.ts +1 -1
- package/dist/components/Utilities/ViroVersion.js +1 -1
- package/dist/dynamic-index.d.ts +11 -0
- package/dist/dynamic-index.js +28 -0
- package/dist/examples/AutoDetectionExample.d.ts +10 -0
- package/dist/examples/AutoDetectionExample.js +91 -0
- package/dist/fabric-interop/NativeViro.d.ts +42 -0
- package/dist/fabric-interop/NativeViro.js +262 -0
- package/dist/fabric-interop/ViroEventsManager.d.ts +83 -0
- package/dist/fabric-interop/ViroEventsManager.js +222 -0
- package/dist/fabric-interop/ViroFabricContainer.d.ts +34 -0
- package/dist/fabric-interop/ViroFabricContainer.js +200 -0
- package/dist/fabric-interop/android/src/main/js/specs/ViroFabricContainerViewNativeComponent.d.ts +35 -0
- package/dist/fabric-interop/android/src/main/js/specs/ViroFabricContainerViewNativeComponent.js +20 -0
- package/dist/fabric-interop/components/AR/ViroARPlane.d.ts +22 -0
- package/dist/fabric-interop/components/AR/ViroARPlane.js +95 -0
- package/dist/fabric-interop/components/AR/ViroARPlaneSelector.d.ts +43 -0
- package/dist/fabric-interop/components/AR/ViroARPlaneSelector.js +152 -0
- package/dist/fabric-interop/components/AR/ViroARTrackingTargets.d.ts +55 -0
- package/dist/fabric-interop/components/AR/ViroARTrackingTargets.js +85 -0
- package/dist/fabric-interop/components/AR/ViroCommonProps.d.ts +91 -0
- package/dist/fabric-interop/components/AR/ViroCommonProps.js +7 -0
- package/dist/fabric-interop/components/Animation/ViroAnimations.d.ts +48 -0
- package/dist/fabric-interop/components/Animation/ViroAnimations.js +64 -0
- package/dist/fabric-interop/components/Material/ViroMaterials.d.ts +66 -0
- package/dist/fabric-interop/components/Material/ViroMaterials.js +85 -0
- package/dist/fabric-interop/components/Types/ViroEvents.d.ts +202 -0
- package/dist/fabric-interop/components/Types/ViroEvents.js +53 -0
- package/dist/fabric-interop/components/Types/ViroUtils.d.ts +137 -0
- package/dist/fabric-interop/components/Types/ViroUtils.js +7 -0
- package/dist/fabric-interop/components/Viro360Image.d.ts +23 -0
- package/dist/fabric-interop/components/Viro360Image.js +45 -0
- package/dist/fabric-interop/components/Viro360Video.d.ts +29 -0
- package/dist/fabric-interop/components/Viro360Video.js +47 -0
- package/dist/fabric-interop/components/Viro3DObject.d.ts +60 -0
- package/dist/fabric-interop/components/Viro3DObject.js +49 -0
- package/dist/fabric-interop/components/Viro3DSceneNavigator.d.ts +49 -0
- package/dist/fabric-interop/components/Viro3DSceneNavigator.js +388 -0
- package/dist/fabric-interop/components/ViroARCamera.d.ts +29 -0
- package/dist/fabric-interop/components/ViroARCamera.js +64 -0
- package/dist/fabric-interop/components/ViroARImageMarker.d.ts +21 -0
- package/dist/fabric-interop/components/ViroARImageMarker.js +71 -0
- package/dist/fabric-interop/components/ViroARObjectMarker.d.ts +21 -0
- package/dist/fabric-interop/components/ViroARObjectMarker.js +71 -0
- package/dist/fabric-interop/components/ViroARPlane.d.ts +24 -0
- package/dist/fabric-interop/components/ViroARPlane.js +88 -0
- package/dist/fabric-interop/components/ViroARScene.d.ts +29 -0
- package/dist/fabric-interop/components/ViroARScene.js +89 -0
- package/dist/fabric-interop/components/ViroARSceneNavigator.d.ts +29 -0
- package/dist/fabric-interop/components/ViroARSceneNavigator.js +76 -0
- package/dist/fabric-interop/components/ViroAmbientLight.d.ts +19 -0
- package/dist/fabric-interop/components/ViroAmbientLight.js +46 -0
- package/dist/fabric-interop/components/ViroAnimatedComponent.d.ts +24 -0
- package/dist/fabric-interop/components/ViroAnimatedComponent.js +63 -0
- package/dist/fabric-interop/components/ViroAnimatedImage.d.ts +28 -0
- package/dist/fabric-interop/components/ViroAnimatedImage.js +49 -0
- package/dist/fabric-interop/components/ViroBox.d.ts +20 -0
- package/dist/fabric-interop/components/ViroBox.js +47 -0
- package/dist/fabric-interop/components/ViroButton.d.ts +32 -0
- package/dist/fabric-interop/components/ViroButton.js +92 -0
- package/dist/fabric-interop/components/ViroCamera.d.ts +17 -0
- package/dist/fabric-interop/components/ViroCamera.js +30 -0
- package/dist/fabric-interop/components/ViroController.d.ts +19 -0
- package/dist/fabric-interop/components/ViroController.js +64 -0
- package/dist/fabric-interop/components/ViroDirectionalLight.d.ts +28 -0
- package/dist/fabric-interop/components/ViroDirectionalLight.js +55 -0
- package/dist/fabric-interop/components/ViroFlexView.d.ts +36 -0
- package/dist/fabric-interop/components/ViroFlexView.js +97 -0
- package/dist/fabric-interop/components/ViroGeometry.d.ts +23 -0
- package/dist/fabric-interop/components/ViroGeometry.js +50 -0
- package/dist/fabric-interop/components/ViroGlobal.d.ts +45 -0
- package/dist/fabric-interop/components/ViroGlobal.js +20 -0
- package/dist/fabric-interop/components/ViroImage.d.ts +29 -0
- package/dist/fabric-interop/components/ViroImage.js +52 -0
- package/dist/fabric-interop/components/ViroLightingEnvironment.d.ts +19 -0
- package/dist/fabric-interop/components/ViroLightingEnvironment.js +44 -0
- package/dist/fabric-interop/components/ViroMaterialVideo.d.ts +30 -0
- package/dist/fabric-interop/components/ViroMaterialVideo.js +48 -0
- package/dist/fabric-interop/components/ViroNode.d.ts +36 -0
- package/dist/fabric-interop/components/ViroNode.js +28 -0
- package/dist/fabric-interop/components/ViroOmniLight.d.ts +21 -0
- package/dist/fabric-interop/components/ViroOmniLight.js +48 -0
- package/dist/fabric-interop/components/ViroOrbitCamera.d.ts +17 -0
- package/dist/fabric-interop/components/ViroOrbitCamera.js +30 -0
- package/dist/fabric-interop/components/ViroParticleEmitter.d.ts +51 -0
- package/dist/fabric-interop/components/ViroParticleEmitter.js +50 -0
- package/dist/fabric-interop/components/ViroPolygon.d.ts +20 -0
- package/dist/fabric-interop/components/ViroPolygon.js +47 -0
- package/dist/fabric-interop/components/ViroPolyline.d.ts +19 -0
- package/dist/fabric-interop/components/ViroPolyline.js +46 -0
- package/dist/fabric-interop/components/ViroPortal.d.ts +16 -0
- package/dist/fabric-interop/components/ViroPortal.js +73 -0
- package/dist/fabric-interop/components/ViroPortalScene.d.ts +16 -0
- package/dist/fabric-interop/components/ViroPortalScene.js +29 -0
- package/dist/fabric-interop/components/ViroQuad.d.ts +39 -0
- package/dist/fabric-interop/components/ViroQuad.js +49 -0
- package/dist/fabric-interop/components/ViroScene.d.ts +29 -0
- package/dist/fabric-interop/components/ViroScene.js +103 -0
- package/dist/fabric-interop/components/ViroSceneNavigator.d.ts +23 -0
- package/dist/fabric-interop/components/ViroSceneNavigator.js +73 -0
- package/dist/fabric-interop/components/ViroSkyBox.d.ts +39 -0
- package/dist/fabric-interop/components/ViroSkyBox.js +44 -0
- package/dist/fabric-interop/components/ViroSound.d.ts +23 -0
- package/dist/fabric-interop/components/ViroSound.js +46 -0
- package/dist/fabric-interop/components/ViroSoundField.d.ts +24 -0
- package/dist/fabric-interop/components/ViroSoundField.js +47 -0
- package/dist/fabric-interop/components/ViroSpatialSound.d.ts +27 -0
- package/dist/fabric-interop/components/ViroSpatialSound.js +50 -0
- package/dist/fabric-interop/components/ViroSphere.d.ts +22 -0
- package/dist/fabric-interop/components/ViroSphere.js +49 -0
- package/dist/fabric-interop/components/ViroSpinner.d.ts +18 -0
- package/dist/fabric-interop/components/ViroSpinner.js +45 -0
- package/dist/fabric-interop/components/ViroSpotLight.d.ts +30 -0
- package/dist/fabric-interop/components/ViroSpotLight.js +57 -0
- package/dist/fabric-interop/components/ViroSurface.d.ts +38 -0
- package/dist/fabric-interop/components/ViroSurface.js +48 -0
- package/dist/fabric-interop/components/ViroText.d.ts +36 -0
- package/dist/fabric-interop/components/ViroText.js +59 -0
- package/dist/fabric-interop/components/ViroUtils.d.ts +63 -0
- package/dist/fabric-interop/components/ViroUtils.js +140 -0
- package/dist/fabric-interop/components/ViroVRSceneNavigator.d.ts +25 -0
- package/dist/fabric-interop/components/ViroVRSceneNavigator.js +73 -0
- package/dist/fabric-interop/components/ViroVideo.d.ts +32 -0
- package/dist/fabric-interop/components/ViroVideo.js +52 -0
- package/dist/fabric-interop/components/index.d.ts +62 -0
- package/dist/fabric-interop/components/index.js +144 -0
- package/dist/fabric-interop/examples/BasicSceneExample.d.ts +11 -0
- package/dist/fabric-interop/examples/BasicSceneExample.js +244 -0
- package/dist/fabric-interop/examples/ComprehensiveExample.d.ts +13 -0
- package/dist/fabric-interop/examples/ComprehensiveExample.js +327 -0
- package/dist/fabric-interop/examples/SimpleARExample.d.ts +8 -0
- package/dist/fabric-interop/examples/SimpleARExample.js +62 -0
- package/dist/fabric-interop/index.d.ts +14 -0
- package/dist/fabric-interop/index.js +117 -0
- package/dist/fabric-interop/specs/ViroEventsTurboModule.d.ts +19 -0
- package/dist/fabric-interop/specs/ViroEventsTurboModule.js +11 -0
- package/dist/fabric-interop/test/BasicFunctionalityTest.d.ts +9 -0
- package/dist/fabric-interop/test/BasicFunctionalityTest.js +222 -0
- package/dist/fabric.d.ts +13 -0
- package/dist/fabric.js +29 -0
- package/dist/plugins/withViro.d.ts +3 -0
- package/dist/plugins/withViro.js +19 -0
- package/dist/plugins/withViroAndroid.js +24 -20
- package/dist/plugins/withViroIos.js +20 -2
- package/dynamic-index-source.d.ts +77 -0
- package/dynamic-index.ts +41 -0
- package/fabric-interop/NativeViro.ts +335 -0
- package/fabric-interop/README.md +282 -0
- package/fabric-interop/ViroEventsManager.js +257 -0
- package/fabric-interop/ViroFabricContainer.tsx +273 -0
- package/fabric-interop/components/AR/ViroARPlane.tsx +108 -0
- package/fabric-interop/components/AR/ViroARPlaneSelector.tsx +185 -0
- package/fabric-interop/components/AR/ViroARTrackingTargets.ts +108 -0
- package/fabric-interop/components/AR/ViroCommonProps.ts +140 -0
- package/fabric-interop/components/Animation/ViroAnimations.ts +96 -0
- package/fabric-interop/components/Material/ViroMaterials.ts +127 -0
- package/fabric-interop/components/Resources/viro_spinner_1.png +0 -0
- package/fabric-interop/components/Resources/viro_spinner_1_w.png +0 -0
- package/fabric-interop/components/Resources/viro_spinner_1a.png +0 -0
- package/fabric-interop/components/Resources/viro_spinner_1a_w.png +0 -0
- package/fabric-interop/components/Types/ViroEvents.ts +285 -0
- package/fabric-interop/components/Types/ViroUtils.ts +160 -0
- package/fabric-interop/components/Viro360Image.tsx +70 -0
- package/fabric-interop/components/Viro360Video.tsx +78 -0
- package/fabric-interop/components/Viro3DObject.tsx +122 -0
- package/fabric-interop/components/Viro3DSceneNavigator.tsx +503 -0
- package/fabric-interop/components/ViroARCamera.tsx +105 -0
- package/fabric-interop/components/ViroARImageMarker.tsx +98 -0
- package/fabric-interop/components/ViroARObjectMarker.tsx +100 -0
- package/fabric-interop/components/ViroARPlane.tsx +120 -0
- package/fabric-interop/components/ViroARScene.tsx +127 -0
- package/fabric-interop/components/ViroARSceneNavigator.tsx +82 -0
- package/fabric-interop/components/ViroAmbientLight.tsx +62 -0
- package/fabric-interop/components/ViroAnimatedComponent.tsx +91 -0
- package/fabric-interop/components/ViroAnimatedImage.tsx +81 -0
- package/fabric-interop/components/ViroBox.tsx +72 -0
- package/fabric-interop/components/ViroButton.tsx +125 -0
- package/fabric-interop/components/ViroCamera.tsx +45 -0
- package/fabric-interop/components/ViroController.tsx +87 -0
- package/fabric-interop/components/ViroDirectionalLight.tsx +84 -0
- package/fabric-interop/components/ViroFlexView.tsx +146 -0
- package/fabric-interop/components/ViroGeometry.tsx +78 -0
- package/fabric-interop/components/ViroGlobal.ts +114 -0
- package/fabric-interop/components/ViroImage.tsx +85 -0
- package/fabric-interop/components/ViroLightingEnvironment.tsx +63 -0
- package/fabric-interop/components/ViroMaterialVideo.tsx +82 -0
- package/fabric-interop/components/ViroNode.tsx +62 -0
- package/fabric-interop/components/ViroOmniLight.tsx +66 -0
- package/fabric-interop/components/ViroOrbitCamera.tsx +45 -0
- package/fabric-interop/components/ViroParticleEmitter.tsx +111 -0
- package/fabric-interop/components/ViroPolygon.tsx +72 -0
- package/fabric-interop/components/ViroPolyline.tsx +71 -0
- package/fabric-interop/components/ViroPortal.tsx +91 -0
- package/fabric-interop/components/ViroPortalScene.tsx +43 -0
- package/fabric-interop/components/ViroQuad.tsx +82 -0
- package/fabric-interop/components/ViroScene.tsx +117 -0
- package/fabric-interop/components/ViroSceneNavigator.tsx +71 -0
- package/fabric-interop/components/ViroSkyBox.tsx +75 -0
- package/fabric-interop/components/ViroSound.tsx +71 -0
- package/fabric-interop/components/ViroSoundField.tsx +75 -0
- package/fabric-interop/components/ViroSpatialSound.tsx +81 -0
- package/fabric-interop/components/ViroSphere.tsx +75 -0
- package/fabric-interop/components/ViroSpinner.tsx +63 -0
- package/fabric-interop/components/ViroSpotLight.tsx +86 -0
- package/fabric-interop/components/ViroSurface.tsx +80 -0
- package/fabric-interop/components/ViroText.tsx +114 -0
- package/fabric-interop/components/ViroUtils.ts +208 -0
- package/fabric-interop/components/ViroVRSceneNavigator.tsx +75 -0
- package/fabric-interop/components/ViroVideo.tsx +91 -0
- package/fabric-interop/components/index.ts +94 -0
- package/fabric-interop/dist/NativeViro.d.ts +43 -0
- package/fabric-interop/dist/NativeViro.d.ts.map +1 -0
- package/fabric-interop/dist/NativeViro.js +263 -0
- package/fabric-interop/dist/NativeViro.js.map +1 -0
- package/fabric-interop/dist/ViroFabricContainer.d.ts +35 -0
- package/fabric-interop/dist/ViroFabricContainer.d.ts.map +1 -0
- package/fabric-interop/dist/ViroFabricContainer.js +201 -0
- package/fabric-interop/dist/ViroFabricContainer.js.map +1 -0
- package/fabric-interop/dist/components/AR/ViroARPlane.d.ts +23 -0
- package/fabric-interop/dist/components/AR/ViroARPlane.d.ts.map +1 -0
- package/fabric-interop/dist/components/AR/ViroARPlane.js +96 -0
- package/fabric-interop/dist/components/AR/ViroARPlane.js.map +1 -0
- package/fabric-interop/dist/components/AR/ViroARPlaneSelector.d.ts +44 -0
- package/fabric-interop/dist/components/AR/ViroARPlaneSelector.d.ts.map +1 -0
- package/fabric-interop/dist/components/AR/ViroARPlaneSelector.js +156 -0
- package/fabric-interop/dist/components/AR/ViroARPlaneSelector.js.map +1 -0
- package/fabric-interop/dist/components/AR/ViroARTrackingTargets.d.ts +56 -0
- package/fabric-interop/dist/components/AR/ViroARTrackingTargets.d.ts.map +1 -0
- package/fabric-interop/dist/components/AR/ViroARTrackingTargets.js +86 -0
- package/fabric-interop/dist/components/AR/ViroARTrackingTargets.js.map +1 -0
- package/fabric-interop/dist/components/AR/ViroCommonProps.d.ts +92 -0
- package/fabric-interop/dist/components/AR/ViroCommonProps.d.ts.map +1 -0
- package/fabric-interop/dist/components/AR/ViroCommonProps.js +8 -0
- package/fabric-interop/dist/components/AR/ViroCommonProps.js.map +1 -0
- package/fabric-interop/dist/components/Animation/ViroAnimations.d.ts +49 -0
- package/fabric-interop/dist/components/Animation/ViroAnimations.d.ts.map +1 -0
- package/fabric-interop/dist/components/Animation/ViroAnimations.js +65 -0
- package/fabric-interop/dist/components/Animation/ViroAnimations.js.map +1 -0
- package/fabric-interop/dist/components/Material/ViroMaterials.d.ts +67 -0
- package/fabric-interop/dist/components/Material/ViroMaterials.d.ts.map +1 -0
- package/fabric-interop/dist/components/Material/ViroMaterials.js +86 -0
- package/fabric-interop/dist/components/Material/ViroMaterials.js.map +1 -0
- package/fabric-interop/dist/components/Types/ViroEvents.d.ts +203 -0
- package/fabric-interop/dist/components/Types/ViroEvents.d.ts.map +1 -0
- package/fabric-interop/dist/components/Types/ViroEvents.js +54 -0
- package/fabric-interop/dist/components/Types/ViroEvents.js.map +1 -0
- package/fabric-interop/dist/components/Types/ViroUtils.d.ts +138 -0
- package/fabric-interop/dist/components/Types/ViroUtils.d.ts.map +1 -0
- package/fabric-interop/dist/components/Types/ViroUtils.js +8 -0
- package/fabric-interop/dist/components/Types/ViroUtils.js.map +1 -0
- package/fabric-interop/dist/components/Viro360Image.d.ts +24 -0
- package/fabric-interop/dist/components/Viro360Image.d.ts.map +1 -0
- package/fabric-interop/dist/components/Viro360Image.js +47 -0
- package/fabric-interop/dist/components/Viro360Image.js.map +1 -0
- package/fabric-interop/dist/components/Viro360Video.d.ts +30 -0
- package/fabric-interop/dist/components/Viro360Video.d.ts.map +1 -0
- package/fabric-interop/dist/components/Viro360Video.js +49 -0
- package/fabric-interop/dist/components/Viro360Video.js.map +1 -0
- package/fabric-interop/dist/components/Viro3DObject.d.ts +61 -0
- package/fabric-interop/dist/components/Viro3DObject.d.ts.map +1 -0
- package/fabric-interop/dist/components/Viro3DObject.js +51 -0
- package/fabric-interop/dist/components/Viro3DObject.js.map +1 -0
- package/fabric-interop/dist/components/Viro3DSceneNavigator.d.ts +50 -0
- package/fabric-interop/dist/components/Viro3DSceneNavigator.d.ts.map +1 -0
- package/fabric-interop/dist/components/Viro3DSceneNavigator.js +389 -0
- package/fabric-interop/dist/components/Viro3DSceneNavigator.js.map +1 -0
- package/fabric-interop/dist/components/ViroARCamera.d.ts +30 -0
- package/fabric-interop/dist/components/ViroARCamera.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroARCamera.js +65 -0
- package/fabric-interop/dist/components/ViroARCamera.js.map +1 -0
- package/fabric-interop/dist/components/ViroARImageMarker.d.ts +22 -0
- package/fabric-interop/dist/components/ViroARImageMarker.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroARImageMarker.js +72 -0
- package/fabric-interop/dist/components/ViroARImageMarker.js.map +1 -0
- package/fabric-interop/dist/components/ViroARObjectMarker.d.ts +22 -0
- package/fabric-interop/dist/components/ViroARObjectMarker.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroARObjectMarker.js +72 -0
- package/fabric-interop/dist/components/ViroARObjectMarker.js.map +1 -0
- package/fabric-interop/dist/components/ViroARPlane.d.ts +25 -0
- package/fabric-interop/dist/components/ViroARPlane.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroARPlane.js +89 -0
- package/fabric-interop/dist/components/ViroARPlane.js.map +1 -0
- package/fabric-interop/dist/components/ViroARScene.d.ts +30 -0
- package/fabric-interop/dist/components/ViroARScene.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroARScene.js +90 -0
- package/fabric-interop/dist/components/ViroARScene.js.map +1 -0
- package/fabric-interop/dist/components/ViroARSceneNavigator.d.ts +30 -0
- package/fabric-interop/dist/components/ViroARSceneNavigator.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroARSceneNavigator.js +78 -0
- package/fabric-interop/dist/components/ViroARSceneNavigator.js.map +1 -0
- package/fabric-interop/dist/components/ViroAmbientLight.d.ts +20 -0
- package/fabric-interop/dist/components/ViroAmbientLight.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroAmbientLight.js +48 -0
- package/fabric-interop/dist/components/ViroAmbientLight.js.map +1 -0
- package/fabric-interop/dist/components/ViroAnimatedComponent.d.ts +25 -0
- package/fabric-interop/dist/components/ViroAnimatedComponent.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroAnimatedComponent.js +65 -0
- package/fabric-interop/dist/components/ViroAnimatedComponent.js.map +1 -0
- package/fabric-interop/dist/components/ViroAnimatedImage.d.ts +29 -0
- package/fabric-interop/dist/components/ViroAnimatedImage.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroAnimatedImage.js +51 -0
- package/fabric-interop/dist/components/ViroAnimatedImage.js.map +1 -0
- package/fabric-interop/dist/components/ViroBox.d.ts +21 -0
- package/fabric-interop/dist/components/ViroBox.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroBox.js +49 -0
- package/fabric-interop/dist/components/ViroBox.js.map +1 -0
- package/fabric-interop/dist/components/ViroButton.d.ts +33 -0
- package/fabric-interop/dist/components/ViroButton.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroButton.js +94 -0
- package/fabric-interop/dist/components/ViroButton.js.map +1 -0
- package/fabric-interop/dist/components/ViroCamera.d.ts +18 -0
- package/fabric-interop/dist/components/ViroCamera.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroCamera.js +31 -0
- package/fabric-interop/dist/components/ViroCamera.js.map +1 -0
- package/fabric-interop/dist/components/ViroController.d.ts +20 -0
- package/fabric-interop/dist/components/ViroController.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroController.js +65 -0
- package/fabric-interop/dist/components/ViroController.js.map +1 -0
- package/fabric-interop/dist/components/ViroDirectionalLight.d.ts +29 -0
- package/fabric-interop/dist/components/ViroDirectionalLight.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroDirectionalLight.js +57 -0
- package/fabric-interop/dist/components/ViroDirectionalLight.js.map +1 -0
- package/fabric-interop/dist/components/ViroFlexView.d.ts +37 -0
- package/fabric-interop/dist/components/ViroFlexView.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroFlexView.js +98 -0
- package/fabric-interop/dist/components/ViroFlexView.js.map +1 -0
- package/fabric-interop/dist/components/ViroGeometry.d.ts +24 -0
- package/fabric-interop/dist/components/ViroGeometry.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroGeometry.js +52 -0
- package/fabric-interop/dist/components/ViroGeometry.js.map +1 -0
- package/fabric-interop/dist/components/ViroGlobal.d.ts +46 -0
- package/fabric-interop/dist/components/ViroGlobal.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroGlobal.js +21 -0
- package/fabric-interop/dist/components/ViroGlobal.js.map +1 -0
- package/fabric-interop/dist/components/ViroImage.d.ts +30 -0
- package/fabric-interop/dist/components/ViroImage.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroImage.js +54 -0
- package/fabric-interop/dist/components/ViroImage.js.map +1 -0
- package/fabric-interop/dist/components/ViroLightingEnvironment.d.ts +20 -0
- package/fabric-interop/dist/components/ViroLightingEnvironment.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroLightingEnvironment.js +46 -0
- package/fabric-interop/dist/components/ViroLightingEnvironment.js.map +1 -0
- package/fabric-interop/dist/components/ViroMaterialVideo.d.ts +31 -0
- package/fabric-interop/dist/components/ViroMaterialVideo.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroMaterialVideo.js +50 -0
- package/fabric-interop/dist/components/ViroMaterialVideo.js.map +1 -0
- package/fabric-interop/dist/components/ViroNode.d.ts +37 -0
- package/fabric-interop/dist/components/ViroNode.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroNode.js +29 -0
- package/fabric-interop/dist/components/ViroNode.js.map +1 -0
- package/fabric-interop/dist/components/ViroOmniLight.d.ts +22 -0
- package/fabric-interop/dist/components/ViroOmniLight.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroOmniLight.js +50 -0
- package/fabric-interop/dist/components/ViroOmniLight.js.map +1 -0
- package/fabric-interop/dist/components/ViroOrbitCamera.d.ts +18 -0
- package/fabric-interop/dist/components/ViroOrbitCamera.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroOrbitCamera.js +31 -0
- package/fabric-interop/dist/components/ViroOrbitCamera.js.map +1 -0
- package/fabric-interop/dist/components/ViroParticleEmitter.d.ts +52 -0
- package/fabric-interop/dist/components/ViroParticleEmitter.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroParticleEmitter.js +52 -0
- package/fabric-interop/dist/components/ViroParticleEmitter.js.map +1 -0
- package/fabric-interop/dist/components/ViroPolygon.d.ts +21 -0
- package/fabric-interop/dist/components/ViroPolygon.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroPolygon.js +49 -0
- package/fabric-interop/dist/components/ViroPolygon.js.map +1 -0
- package/fabric-interop/dist/components/ViroPolyline.d.ts +20 -0
- package/fabric-interop/dist/components/ViroPolyline.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroPolyline.js +48 -0
- package/fabric-interop/dist/components/ViroPolyline.js.map +1 -0
- package/fabric-interop/dist/components/ViroPortal.d.ts +17 -0
- package/fabric-interop/dist/components/ViroPortal.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroPortal.js +74 -0
- package/fabric-interop/dist/components/ViroPortal.js.map +1 -0
- package/fabric-interop/dist/components/ViroPortalScene.d.ts +17 -0
- package/fabric-interop/dist/components/ViroPortalScene.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroPortalScene.js +30 -0
- package/fabric-interop/dist/components/ViroPortalScene.js.map +1 -0
- package/fabric-interop/dist/components/ViroQuad.d.ts +40 -0
- package/fabric-interop/dist/components/ViroQuad.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroQuad.js +51 -0
- package/fabric-interop/dist/components/ViroQuad.js.map +1 -0
- package/fabric-interop/dist/components/ViroScene.d.ts +30 -0
- package/fabric-interop/dist/components/ViroScene.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroScene.js +105 -0
- package/fabric-interop/dist/components/ViroScene.js.map +1 -0
- package/fabric-interop/dist/components/ViroSceneNavigator.d.ts +24 -0
- package/fabric-interop/dist/components/ViroSceneNavigator.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSceneNavigator.js +74 -0
- package/fabric-interop/dist/components/ViroSceneNavigator.js.map +1 -0
- package/fabric-interop/dist/components/ViroSkyBox.d.ts +40 -0
- package/fabric-interop/dist/components/ViroSkyBox.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSkyBox.js +46 -0
- package/fabric-interop/dist/components/ViroSkyBox.js.map +1 -0
- package/fabric-interop/dist/components/ViroSound.d.ts +24 -0
- package/fabric-interop/dist/components/ViroSound.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSound.js +48 -0
- package/fabric-interop/dist/components/ViroSound.js.map +1 -0
- package/fabric-interop/dist/components/ViroSoundField.d.ts +25 -0
- package/fabric-interop/dist/components/ViroSoundField.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSoundField.js +49 -0
- package/fabric-interop/dist/components/ViroSoundField.js.map +1 -0
- package/fabric-interop/dist/components/ViroSpatialSound.d.ts +28 -0
- package/fabric-interop/dist/components/ViroSpatialSound.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSpatialSound.js +52 -0
- package/fabric-interop/dist/components/ViroSpatialSound.js.map +1 -0
- package/fabric-interop/dist/components/ViroSphere.d.ts +23 -0
- package/fabric-interop/dist/components/ViroSphere.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSphere.js +51 -0
- package/fabric-interop/dist/components/ViroSphere.js.map +1 -0
- package/fabric-interop/dist/components/ViroSpinner.d.ts +19 -0
- package/fabric-interop/dist/components/ViroSpinner.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSpinner.js +47 -0
- package/fabric-interop/dist/components/ViroSpinner.js.map +1 -0
- package/fabric-interop/dist/components/ViroSpotLight.d.ts +31 -0
- package/fabric-interop/dist/components/ViroSpotLight.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSpotLight.js +59 -0
- package/fabric-interop/dist/components/ViroSpotLight.js.map +1 -0
- package/fabric-interop/dist/components/ViroSurface.d.ts +39 -0
- package/fabric-interop/dist/components/ViroSurface.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSurface.js +50 -0
- package/fabric-interop/dist/components/ViroSurface.js.map +1 -0
- package/fabric-interop/dist/components/ViroText.d.ts +37 -0
- package/fabric-interop/dist/components/ViroText.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroText.js +61 -0
- package/fabric-interop/dist/components/ViroText.js.map +1 -0
- package/fabric-interop/dist/components/ViroUtils.d.ts +64 -0
- package/fabric-interop/dist/components/ViroUtils.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroUtils.js +141 -0
- package/fabric-interop/dist/components/ViroUtils.js.map +1 -0
- package/fabric-interop/dist/components/ViroVRSceneNavigator.d.ts +26 -0
- package/fabric-interop/dist/components/ViroVRSceneNavigator.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroVRSceneNavigator.js +74 -0
- package/fabric-interop/dist/components/ViroVRSceneNavigator.js.map +1 -0
- package/fabric-interop/dist/components/ViroVideo.d.ts +33 -0
- package/fabric-interop/dist/components/ViroVideo.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroVideo.js +54 -0
- package/fabric-interop/dist/components/ViroVideo.js.map +1 -0
- package/fabric-interop/dist/components/index.d.ts +63 -0
- package/fabric-interop/dist/components/index.d.ts.map +1 -0
- package/fabric-interop/dist/components/index.js +145 -0
- package/fabric-interop/dist/components/index.js.map +1 -0
- package/fabric-interop/dist/index.d.ts +15 -0
- package/fabric-interop/dist/index.d.ts.map +1 -0
- package/fabric-interop/dist/index.js +118 -0
- package/fabric-interop/dist/index.js.map +1 -0
- package/fabric-interop/dist/specs/ViroEventsTurboModule.d.ts +20 -0
- package/fabric-interop/dist/specs/ViroEventsTurboModule.d.ts.map +1 -0
- package/fabric-interop/dist/specs/ViroEventsTurboModule.js +12 -0
- package/fabric-interop/dist/specs/ViroEventsTurboModule.js.map +1 -0
- package/fabric-interop/examples/BasicSceneExample.tsx +287 -0
- package/fabric-interop/examples/ComprehensiveExample.tsx +441 -0
- package/fabric-interop/examples/SimpleARExample.tsx +95 -0
- package/fabric-interop/global.d.ts +14 -0
- package/fabric-interop/index.ts +107 -0
- package/fabric-interop/metro.config.js +12 -0
- package/fabric-interop/package.json +40 -0
- package/fabric-interop/react-native.config.js +22 -0
- package/fabric-interop/scripts/validate-build.js +393 -0
- package/fabric-interop/scripts/validate-implementation.js +272 -0
- package/fabric-interop/specs/README.md +22 -0
- package/fabric-interop/specs/ViroEventsTurboModule.ts +27 -0
- package/fabric-interop/test/BasicFunctionalityTest.tsx +243 -0
- package/fabric-interop/tsconfig.json +38 -0
- package/fabric.d.ts +5 -0
- package/fabric.ts +14 -0
- package/ios/ViroReact.podspec +51 -11
- package/package.json +33 -20
- 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.
|
|
3
|
-
<img src="
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
|
Binary file
|
|
@@ -68,52 +68,91 @@ export class ViroARPlaneSelector extends React.Component<Props, State> {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
_getARPlanes() {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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 +
|
|
105
|
-
{
|
|
106
|
-
|
|
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
|
-
|
|
116
|
-
|
|
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.
|
|
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():
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
95
|
-
this.
|
|
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.
|
|
1
|
+
export declare const 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;
|