@reactvision/react-viro 2.43.1 → 2.43.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -11
- package/android/react_viro/react_viro-release.aar +0 -0
- package/android/viro_renderer/viro_renderer-release.aar +0 -0
- package/components/AR/ViroARPlaneSelector.tsx +1 -1
- package/components/AR/ViroARSceneNavigator.tsx +16 -17
- package/components/Utilities/ViroVersion.ts +1 -1
- package/components/ViroVRSceneNavigator.tsx +1 -1
- package/dist/components/AR/ViroARPlaneSelector.d.ts +1 -1
- package/dist/components/AR/ViroARSceneNavigator.d.ts +9 -9
- package/dist/components/AR/ViroARSceneNavigator.js +11 -11
- package/dist/components/Utilities/ViroVersion.d.ts +1 -1
- package/dist/components/Utilities/ViroVersion.js +1 -1
- package/dist/components/ViroVRSceneNavigator.d.ts +1 -1
- package/dist/dynamic-index.js +2 -2
- package/dist/plugins/withViroAndroid.js +20 -60
- package/ios/ViroReact.podspec +7 -9
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROBodyMesher.h +1 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROVideoTextureCache.h +1 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/ViroKit.h +11 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Info.plist +0 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/ViroKit +0 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/bodymesh.mlmodelc/metadata.json +14 -11
- package/ios/dist/ViroRenderer/ViroKit.framework/hourglass_2_1.mlmodelc/metadata.json +12 -9
- package/ios/dist/ViroRenderer/ViroKit.framework/hourglass_2_1_ds_t.mlmodelc/metadata.json +12 -9
- package/ios/dist/ViroRenderer/ViroKit.framework/hourglass_2_1_t.mlmodelc/metadata.json +12 -9
- package/ios/dist/ViroRenderer/ViroKit.podspec +4 -4
- package/ios/dist/ViroRenderer/armv7_arm64/ViroKit.framework/Headers/VROBodyMesher.h +1 -0
- package/ios/dist/ViroRenderer/armv7_arm64/ViroKit.framework/Headers/VROVideoTextureCache.h +1 -0
- package/ios/dist/ViroRenderer/armv7_arm64/ViroKit.framework/Headers/ViroKit.h +11 -0
- package/ios/dist/ViroRenderer/armv7_arm64/ViroKit.framework/Info.plist +0 -0
- package/ios/dist/ViroRenderer/armv7_arm64/ViroKit.framework/ViroKit +0 -0
- package/ios/dist/ViroRenderer/armv7_arm64/ViroKit.framework/bodymesh.mlmodelc/metadata.json +14 -11
- package/ios/dist/ViroRenderer/armv7_arm64/ViroKit.framework/hourglass_2_1.mlmodelc/metadata.json +12 -9
- package/ios/dist/ViroRenderer/armv7_arm64/ViroKit.framework/hourglass_2_1_ds_t.mlmodelc/metadata.json +12 -9
- package/ios/dist/ViroRenderer/armv7_arm64/ViroKit.framework/hourglass_2_1_t.mlmodelc/metadata.json +12 -9
- package/ios/dist/armv7_arm64/libViroReact.a +0 -0
- package/ios/dist/include/VRTFabricCrashFix.h +16 -0
- package/ios/dist/lib/libViroReact.a +0 -0
- package/package.json +13 -20
- package/dist/components/Telemetry/ViroTelemetry.d.ts +0 -16
- package/dist/components/Telemetry/ViroTelemetry.js +0 -87
- package/dist/components/Telemetry/index.d.ts +0 -16
- package/dist/components/Telemetry/index.js +0 -97
- package/dist/examples/AutoDetectionExample.d.ts +0 -10
- package/dist/examples/AutoDetectionExample.js +0 -91
- package/dist/fabric-interop/NativeViro.d.ts +0 -42
- package/dist/fabric-interop/NativeViro.js +0 -262
- package/dist/fabric-interop/ViroEventsManager.d.ts +0 -83
- package/dist/fabric-interop/ViroEventsManager.js +0 -222
- package/dist/fabric-interop/ViroFabricContainer.d.ts +0 -34
- package/dist/fabric-interop/ViroFabricContainer.js +0 -200
- package/dist/fabric-interop/android/src/main/js/specs/ViroFabricContainerViewNativeComponent.d.ts +0 -35
- package/dist/fabric-interop/android/src/main/js/specs/ViroFabricContainerViewNativeComponent.js +0 -20
- package/dist/fabric-interop/components/AR/ViroARPlane.d.ts +0 -22
- package/dist/fabric-interop/components/AR/ViroARPlane.js +0 -95
- package/dist/fabric-interop/components/AR/ViroARPlaneSelector.d.ts +0 -43
- package/dist/fabric-interop/components/AR/ViroARPlaneSelector.js +0 -152
- package/dist/fabric-interop/components/AR/ViroARTrackingTargets.d.ts +0 -55
- package/dist/fabric-interop/components/AR/ViroARTrackingTargets.js +0 -85
- package/dist/fabric-interop/components/AR/ViroCommonProps.d.ts +0 -91
- package/dist/fabric-interop/components/AR/ViroCommonProps.js +0 -7
- package/dist/fabric-interop/components/Animation/ViroAnimations.d.ts +0 -48
- package/dist/fabric-interop/components/Animation/ViroAnimations.js +0 -64
- package/dist/fabric-interop/components/Material/ViroMaterials.d.ts +0 -66
- package/dist/fabric-interop/components/Material/ViroMaterials.js +0 -85
- package/dist/fabric-interop/components/Types/ViroEvents.d.ts +0 -202
- package/dist/fabric-interop/components/Types/ViroEvents.js +0 -53
- package/dist/fabric-interop/components/Types/ViroUtils.d.ts +0 -137
- package/dist/fabric-interop/components/Types/ViroUtils.js +0 -7
- package/dist/fabric-interop/components/Viro360Image.d.ts +0 -23
- package/dist/fabric-interop/components/Viro360Image.js +0 -45
- package/dist/fabric-interop/components/Viro360Video.d.ts +0 -29
- package/dist/fabric-interop/components/Viro360Video.js +0 -47
- package/dist/fabric-interop/components/Viro3DObject.d.ts +0 -60
- package/dist/fabric-interop/components/Viro3DObject.js +0 -49
- package/dist/fabric-interop/components/Viro3DSceneNavigator.d.ts +0 -49
- package/dist/fabric-interop/components/Viro3DSceneNavigator.js +0 -388
- package/dist/fabric-interop/components/ViroARCamera.d.ts +0 -29
- package/dist/fabric-interop/components/ViroARCamera.js +0 -64
- package/dist/fabric-interop/components/ViroARImageMarker.d.ts +0 -21
- package/dist/fabric-interop/components/ViroARImageMarker.js +0 -71
- package/dist/fabric-interop/components/ViroARObjectMarker.d.ts +0 -21
- package/dist/fabric-interop/components/ViroARObjectMarker.js +0 -71
- package/dist/fabric-interop/components/ViroARPlane.d.ts +0 -24
- package/dist/fabric-interop/components/ViroARPlane.js +0 -88
- package/dist/fabric-interop/components/ViroARScene.d.ts +0 -29
- package/dist/fabric-interop/components/ViroARScene.js +0 -89
- package/dist/fabric-interop/components/ViroARSceneNavigator.d.ts +0 -29
- package/dist/fabric-interop/components/ViroARSceneNavigator.js +0 -76
- package/dist/fabric-interop/components/ViroAmbientLight.d.ts +0 -19
- package/dist/fabric-interop/components/ViroAmbientLight.js +0 -46
- package/dist/fabric-interop/components/ViroAnimatedComponent.d.ts +0 -24
- package/dist/fabric-interop/components/ViroAnimatedComponent.js +0 -63
- package/dist/fabric-interop/components/ViroAnimatedImage.d.ts +0 -28
- package/dist/fabric-interop/components/ViroAnimatedImage.js +0 -49
- package/dist/fabric-interop/components/ViroBox.d.ts +0 -20
- package/dist/fabric-interop/components/ViroBox.js +0 -47
- package/dist/fabric-interop/components/ViroButton.d.ts +0 -32
- package/dist/fabric-interop/components/ViroButton.js +0 -92
- package/dist/fabric-interop/components/ViroCamera.d.ts +0 -17
- package/dist/fabric-interop/components/ViroCamera.js +0 -30
- package/dist/fabric-interop/components/ViroController.d.ts +0 -19
- package/dist/fabric-interop/components/ViroController.js +0 -64
- package/dist/fabric-interop/components/ViroDirectionalLight.d.ts +0 -28
- package/dist/fabric-interop/components/ViroDirectionalLight.js +0 -55
- package/dist/fabric-interop/components/ViroFlexView.d.ts +0 -36
- package/dist/fabric-interop/components/ViroFlexView.js +0 -97
- package/dist/fabric-interop/components/ViroGeometry.d.ts +0 -23
- package/dist/fabric-interop/components/ViroGeometry.js +0 -50
- package/dist/fabric-interop/components/ViroGlobal.d.ts +0 -45
- package/dist/fabric-interop/components/ViroGlobal.js +0 -20
- package/dist/fabric-interop/components/ViroImage.d.ts +0 -29
- package/dist/fabric-interop/components/ViroImage.js +0 -52
- package/dist/fabric-interop/components/ViroLightingEnvironment.d.ts +0 -19
- package/dist/fabric-interop/components/ViroLightingEnvironment.js +0 -44
- package/dist/fabric-interop/components/ViroMaterialVideo.d.ts +0 -30
- package/dist/fabric-interop/components/ViroMaterialVideo.js +0 -48
- package/dist/fabric-interop/components/ViroNode.d.ts +0 -36
- package/dist/fabric-interop/components/ViroNode.js +0 -28
- package/dist/fabric-interop/components/ViroOmniLight.d.ts +0 -21
- package/dist/fabric-interop/components/ViroOmniLight.js +0 -48
- package/dist/fabric-interop/components/ViroOrbitCamera.d.ts +0 -17
- package/dist/fabric-interop/components/ViroOrbitCamera.js +0 -30
- package/dist/fabric-interop/components/ViroParticleEmitter.d.ts +0 -51
- package/dist/fabric-interop/components/ViroParticleEmitter.js +0 -50
- package/dist/fabric-interop/components/ViroPolygon.d.ts +0 -20
- package/dist/fabric-interop/components/ViroPolygon.js +0 -47
- package/dist/fabric-interop/components/ViroPolyline.d.ts +0 -19
- package/dist/fabric-interop/components/ViroPolyline.js +0 -46
- package/dist/fabric-interop/components/ViroPortal.d.ts +0 -16
- package/dist/fabric-interop/components/ViroPortal.js +0 -73
- package/dist/fabric-interop/components/ViroPortalScene.d.ts +0 -16
- package/dist/fabric-interop/components/ViroPortalScene.js +0 -29
- package/dist/fabric-interop/components/ViroQuad.d.ts +0 -39
- package/dist/fabric-interop/components/ViroQuad.js +0 -49
- package/dist/fabric-interop/components/ViroScene.d.ts +0 -29
- package/dist/fabric-interop/components/ViroScene.js +0 -103
- package/dist/fabric-interop/components/ViroSceneNavigator.d.ts +0 -23
- package/dist/fabric-interop/components/ViroSceneNavigator.js +0 -73
- package/dist/fabric-interop/components/ViroSkyBox.d.ts +0 -39
- package/dist/fabric-interop/components/ViroSkyBox.js +0 -44
- package/dist/fabric-interop/components/ViroSound.d.ts +0 -23
- package/dist/fabric-interop/components/ViroSound.js +0 -46
- package/dist/fabric-interop/components/ViroSoundField.d.ts +0 -24
- package/dist/fabric-interop/components/ViroSoundField.js +0 -47
- package/dist/fabric-interop/components/ViroSpatialSound.d.ts +0 -27
- package/dist/fabric-interop/components/ViroSpatialSound.js +0 -50
- package/dist/fabric-interop/components/ViroSphere.d.ts +0 -22
- package/dist/fabric-interop/components/ViroSphere.js +0 -49
- package/dist/fabric-interop/components/ViroSpinner.d.ts +0 -18
- package/dist/fabric-interop/components/ViroSpinner.js +0 -45
- package/dist/fabric-interop/components/ViroSpotLight.d.ts +0 -30
- package/dist/fabric-interop/components/ViroSpotLight.js +0 -57
- package/dist/fabric-interop/components/ViroSurface.d.ts +0 -38
- package/dist/fabric-interop/components/ViroSurface.js +0 -48
- package/dist/fabric-interop/components/ViroText.d.ts +0 -36
- package/dist/fabric-interop/components/ViroText.js +0 -59
- package/dist/fabric-interop/components/ViroUtils.d.ts +0 -63
- package/dist/fabric-interop/components/ViroUtils.js +0 -140
- package/dist/fabric-interop/components/ViroVRSceneNavigator.d.ts +0 -25
- package/dist/fabric-interop/components/ViroVRSceneNavigator.js +0 -73
- package/dist/fabric-interop/components/ViroVideo.d.ts +0 -32
- package/dist/fabric-interop/components/ViroVideo.js +0 -52
- package/dist/fabric-interop/components/index.d.ts +0 -62
- package/dist/fabric-interop/components/index.js +0 -144
- package/dist/fabric-interop/examples/BasicSceneExample.d.ts +0 -11
- package/dist/fabric-interop/examples/BasicSceneExample.js +0 -244
- package/dist/fabric-interop/examples/ComprehensiveExample.d.ts +0 -13
- package/dist/fabric-interop/examples/ComprehensiveExample.js +0 -327
- package/dist/fabric-interop/examples/SimpleARExample.d.ts +0 -8
- package/dist/fabric-interop/examples/SimpleARExample.js +0 -62
- package/dist/fabric-interop/index.d.ts +0 -14
- package/dist/fabric-interop/index.js +0 -117
- package/dist/fabric-interop/specs/ViroEventsTurboModule.d.ts +0 -19
- package/dist/fabric-interop/specs/ViroEventsTurboModule.js +0 -11
- package/dist/fabric-interop/test/BasicFunctionalityTest.d.ts +0 -9
- package/dist/fabric-interop/test/BasicFunctionalityTest.js +0 -222
- package/dist/fabric.d.ts +0 -13
- package/dist/fabric.js +0 -29
- package/dynamic-index-source.d.ts +0 -77
- package/dynamic-index.ts +0 -41
- package/fabric-interop/NativeViro.ts +0 -335
- package/fabric-interop/README.md +0 -282
- package/fabric-interop/ViroEventsManager.js +0 -257
- package/fabric-interop/ViroFabricContainer.tsx +0 -273
- package/fabric-interop/components/AR/ViroARPlane.tsx +0 -108
- package/fabric-interop/components/AR/ViroARPlaneSelector.tsx +0 -185
- package/fabric-interop/components/AR/ViroARTrackingTargets.ts +0 -108
- package/fabric-interop/components/AR/ViroCommonProps.ts +0 -140
- package/fabric-interop/components/Animation/ViroAnimations.ts +0 -96
- package/fabric-interop/components/Material/ViroMaterials.ts +0 -127
- 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 +0 -285
- package/fabric-interop/components/Types/ViroUtils.ts +0 -160
- package/fabric-interop/components/Viro360Image.tsx +0 -70
- package/fabric-interop/components/Viro360Video.tsx +0 -78
- package/fabric-interop/components/Viro3DObject.tsx +0 -122
- package/fabric-interop/components/Viro3DSceneNavigator.tsx +0 -503
- package/fabric-interop/components/ViroARCamera.tsx +0 -105
- package/fabric-interop/components/ViroARImageMarker.tsx +0 -98
- package/fabric-interop/components/ViroARObjectMarker.tsx +0 -100
- package/fabric-interop/components/ViroARPlane.tsx +0 -120
- package/fabric-interop/components/ViroARScene.tsx +0 -127
- package/fabric-interop/components/ViroARSceneNavigator.tsx +0 -82
- package/fabric-interop/components/ViroAmbientLight.tsx +0 -62
- package/fabric-interop/components/ViroAnimatedComponent.tsx +0 -91
- package/fabric-interop/components/ViroAnimatedImage.tsx +0 -81
- package/fabric-interop/components/ViroBox.tsx +0 -72
- package/fabric-interop/components/ViroButton.tsx +0 -125
- package/fabric-interop/components/ViroCamera.tsx +0 -45
- package/fabric-interop/components/ViroController.tsx +0 -87
- package/fabric-interop/components/ViroDirectionalLight.tsx +0 -84
- package/fabric-interop/components/ViroFlexView.tsx +0 -146
- package/fabric-interop/components/ViroGeometry.tsx +0 -78
- package/fabric-interop/components/ViroGlobal.ts +0 -114
- package/fabric-interop/components/ViroImage.tsx +0 -85
- package/fabric-interop/components/ViroLightingEnvironment.tsx +0 -63
- package/fabric-interop/components/ViroMaterialVideo.tsx +0 -82
- package/fabric-interop/components/ViroNode.tsx +0 -62
- package/fabric-interop/components/ViroOmniLight.tsx +0 -66
- package/fabric-interop/components/ViroOrbitCamera.tsx +0 -45
- package/fabric-interop/components/ViroParticleEmitter.tsx +0 -111
- package/fabric-interop/components/ViroPolygon.tsx +0 -72
- package/fabric-interop/components/ViroPolyline.tsx +0 -71
- package/fabric-interop/components/ViroPortal.tsx +0 -91
- package/fabric-interop/components/ViroPortalScene.tsx +0 -43
- package/fabric-interop/components/ViroQuad.tsx +0 -82
- package/fabric-interop/components/ViroScene.tsx +0 -117
- package/fabric-interop/components/ViroSceneNavigator.tsx +0 -71
- package/fabric-interop/components/ViroSkyBox.tsx +0 -75
- package/fabric-interop/components/ViroSound.tsx +0 -71
- package/fabric-interop/components/ViroSoundField.tsx +0 -75
- package/fabric-interop/components/ViroSpatialSound.tsx +0 -81
- package/fabric-interop/components/ViroSphere.tsx +0 -75
- package/fabric-interop/components/ViroSpinner.tsx +0 -63
- package/fabric-interop/components/ViroSpotLight.tsx +0 -86
- package/fabric-interop/components/ViroSurface.tsx +0 -80
- package/fabric-interop/components/ViroText.tsx +0 -114
- package/fabric-interop/components/ViroUtils.ts +0 -208
- package/fabric-interop/components/ViroVRSceneNavigator.tsx +0 -75
- package/fabric-interop/components/ViroVideo.tsx +0 -91
- package/fabric-interop/components/index.ts +0 -94
- package/fabric-interop/dist/NativeViro.d.ts +0 -43
- package/fabric-interop/dist/NativeViro.d.ts.map +0 -1
- package/fabric-interop/dist/NativeViro.js +0 -263
- package/fabric-interop/dist/NativeViro.js.map +0 -1
- package/fabric-interop/dist/ViroFabricContainer.d.ts +0 -35
- package/fabric-interop/dist/ViroFabricContainer.d.ts.map +0 -1
- package/fabric-interop/dist/ViroFabricContainer.js +0 -201
- package/fabric-interop/dist/ViroFabricContainer.js.map +0 -1
- package/fabric-interop/dist/components/AR/ViroARPlane.d.ts +0 -23
- package/fabric-interop/dist/components/AR/ViroARPlane.d.ts.map +0 -1
- package/fabric-interop/dist/components/AR/ViroARPlane.js +0 -96
- package/fabric-interop/dist/components/AR/ViroARPlane.js.map +0 -1
- package/fabric-interop/dist/components/AR/ViroARPlaneSelector.d.ts +0 -44
- package/fabric-interop/dist/components/AR/ViroARPlaneSelector.d.ts.map +0 -1
- package/fabric-interop/dist/components/AR/ViroARPlaneSelector.js +0 -156
- package/fabric-interop/dist/components/AR/ViroARPlaneSelector.js.map +0 -1
- package/fabric-interop/dist/components/AR/ViroARTrackingTargets.d.ts +0 -56
- package/fabric-interop/dist/components/AR/ViroARTrackingTargets.d.ts.map +0 -1
- package/fabric-interop/dist/components/AR/ViroARTrackingTargets.js +0 -86
- package/fabric-interop/dist/components/AR/ViroARTrackingTargets.js.map +0 -1
- package/fabric-interop/dist/components/AR/ViroCommonProps.d.ts +0 -92
- package/fabric-interop/dist/components/AR/ViroCommonProps.d.ts.map +0 -1
- package/fabric-interop/dist/components/AR/ViroCommonProps.js +0 -8
- package/fabric-interop/dist/components/AR/ViroCommonProps.js.map +0 -1
- package/fabric-interop/dist/components/Animation/ViroAnimations.d.ts +0 -49
- package/fabric-interop/dist/components/Animation/ViroAnimations.d.ts.map +0 -1
- package/fabric-interop/dist/components/Animation/ViroAnimations.js +0 -65
- package/fabric-interop/dist/components/Animation/ViroAnimations.js.map +0 -1
- package/fabric-interop/dist/components/Material/ViroMaterials.d.ts +0 -67
- package/fabric-interop/dist/components/Material/ViroMaterials.d.ts.map +0 -1
- package/fabric-interop/dist/components/Material/ViroMaterials.js +0 -86
- package/fabric-interop/dist/components/Material/ViroMaterials.js.map +0 -1
- package/fabric-interop/dist/components/Types/ViroEvents.d.ts +0 -203
- package/fabric-interop/dist/components/Types/ViroEvents.d.ts.map +0 -1
- package/fabric-interop/dist/components/Types/ViroEvents.js +0 -54
- package/fabric-interop/dist/components/Types/ViroEvents.js.map +0 -1
- package/fabric-interop/dist/components/Types/ViroUtils.d.ts +0 -138
- package/fabric-interop/dist/components/Types/ViroUtils.d.ts.map +0 -1
- package/fabric-interop/dist/components/Types/ViroUtils.js +0 -8
- package/fabric-interop/dist/components/Types/ViroUtils.js.map +0 -1
- package/fabric-interop/dist/components/Viro360Image.d.ts +0 -24
- package/fabric-interop/dist/components/Viro360Image.d.ts.map +0 -1
- package/fabric-interop/dist/components/Viro360Image.js +0 -47
- package/fabric-interop/dist/components/Viro360Image.js.map +0 -1
- package/fabric-interop/dist/components/Viro360Video.d.ts +0 -30
- package/fabric-interop/dist/components/Viro360Video.d.ts.map +0 -1
- package/fabric-interop/dist/components/Viro360Video.js +0 -49
- package/fabric-interop/dist/components/Viro360Video.js.map +0 -1
- package/fabric-interop/dist/components/Viro3DObject.d.ts +0 -61
- package/fabric-interop/dist/components/Viro3DObject.d.ts.map +0 -1
- package/fabric-interop/dist/components/Viro3DObject.js +0 -51
- package/fabric-interop/dist/components/Viro3DObject.js.map +0 -1
- package/fabric-interop/dist/components/Viro3DSceneNavigator.d.ts +0 -50
- package/fabric-interop/dist/components/Viro3DSceneNavigator.d.ts.map +0 -1
- package/fabric-interop/dist/components/Viro3DSceneNavigator.js +0 -389
- package/fabric-interop/dist/components/Viro3DSceneNavigator.js.map +0 -1
- package/fabric-interop/dist/components/ViroARCamera.d.ts +0 -30
- package/fabric-interop/dist/components/ViroARCamera.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroARCamera.js +0 -65
- package/fabric-interop/dist/components/ViroARCamera.js.map +0 -1
- package/fabric-interop/dist/components/ViroARImageMarker.d.ts +0 -22
- package/fabric-interop/dist/components/ViroARImageMarker.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroARImageMarker.js +0 -72
- package/fabric-interop/dist/components/ViroARImageMarker.js.map +0 -1
- package/fabric-interop/dist/components/ViroARObjectMarker.d.ts +0 -22
- package/fabric-interop/dist/components/ViroARObjectMarker.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroARObjectMarker.js +0 -72
- package/fabric-interop/dist/components/ViroARObjectMarker.js.map +0 -1
- package/fabric-interop/dist/components/ViroARPlane.d.ts +0 -25
- package/fabric-interop/dist/components/ViroARPlane.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroARPlane.js +0 -89
- package/fabric-interop/dist/components/ViroARPlane.js.map +0 -1
- package/fabric-interop/dist/components/ViroARScene.d.ts +0 -30
- package/fabric-interop/dist/components/ViroARScene.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroARScene.js +0 -90
- package/fabric-interop/dist/components/ViroARScene.js.map +0 -1
- package/fabric-interop/dist/components/ViroARSceneNavigator.d.ts +0 -30
- package/fabric-interop/dist/components/ViroARSceneNavigator.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroARSceneNavigator.js +0 -78
- package/fabric-interop/dist/components/ViroARSceneNavigator.js.map +0 -1
- package/fabric-interop/dist/components/ViroAmbientLight.d.ts +0 -20
- package/fabric-interop/dist/components/ViroAmbientLight.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroAmbientLight.js +0 -48
- package/fabric-interop/dist/components/ViroAmbientLight.js.map +0 -1
- package/fabric-interop/dist/components/ViroAnimatedComponent.d.ts +0 -25
- package/fabric-interop/dist/components/ViroAnimatedComponent.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroAnimatedComponent.js +0 -65
- package/fabric-interop/dist/components/ViroAnimatedComponent.js.map +0 -1
- package/fabric-interop/dist/components/ViroAnimatedImage.d.ts +0 -29
- package/fabric-interop/dist/components/ViroAnimatedImage.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroAnimatedImage.js +0 -51
- package/fabric-interop/dist/components/ViroAnimatedImage.js.map +0 -1
- package/fabric-interop/dist/components/ViroBox.d.ts +0 -21
- package/fabric-interop/dist/components/ViroBox.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroBox.js +0 -49
- package/fabric-interop/dist/components/ViroBox.js.map +0 -1
- package/fabric-interop/dist/components/ViroButton.d.ts +0 -33
- package/fabric-interop/dist/components/ViroButton.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroButton.js +0 -94
- package/fabric-interop/dist/components/ViroButton.js.map +0 -1
- package/fabric-interop/dist/components/ViroCamera.d.ts +0 -18
- package/fabric-interop/dist/components/ViroCamera.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroCamera.js +0 -31
- package/fabric-interop/dist/components/ViroCamera.js.map +0 -1
- package/fabric-interop/dist/components/ViroController.d.ts +0 -20
- package/fabric-interop/dist/components/ViroController.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroController.js +0 -65
- package/fabric-interop/dist/components/ViroController.js.map +0 -1
- package/fabric-interop/dist/components/ViroDirectionalLight.d.ts +0 -29
- package/fabric-interop/dist/components/ViroDirectionalLight.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroDirectionalLight.js +0 -57
- package/fabric-interop/dist/components/ViroDirectionalLight.js.map +0 -1
- package/fabric-interop/dist/components/ViroFlexView.d.ts +0 -37
- package/fabric-interop/dist/components/ViroFlexView.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroFlexView.js +0 -98
- package/fabric-interop/dist/components/ViroFlexView.js.map +0 -1
- package/fabric-interop/dist/components/ViroGeometry.d.ts +0 -24
- package/fabric-interop/dist/components/ViroGeometry.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroGeometry.js +0 -52
- package/fabric-interop/dist/components/ViroGeometry.js.map +0 -1
- package/fabric-interop/dist/components/ViroGlobal.d.ts +0 -46
- package/fabric-interop/dist/components/ViroGlobal.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroGlobal.js +0 -21
- package/fabric-interop/dist/components/ViroGlobal.js.map +0 -1
- package/fabric-interop/dist/components/ViroImage.d.ts +0 -30
- package/fabric-interop/dist/components/ViroImage.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroImage.js +0 -54
- package/fabric-interop/dist/components/ViroImage.js.map +0 -1
- package/fabric-interop/dist/components/ViroLightingEnvironment.d.ts +0 -20
- package/fabric-interop/dist/components/ViroLightingEnvironment.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroLightingEnvironment.js +0 -46
- package/fabric-interop/dist/components/ViroLightingEnvironment.js.map +0 -1
- package/fabric-interop/dist/components/ViroMaterialVideo.d.ts +0 -31
- package/fabric-interop/dist/components/ViroMaterialVideo.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroMaterialVideo.js +0 -50
- package/fabric-interop/dist/components/ViroMaterialVideo.js.map +0 -1
- package/fabric-interop/dist/components/ViroNode.d.ts +0 -37
- package/fabric-interop/dist/components/ViroNode.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroNode.js +0 -29
- package/fabric-interop/dist/components/ViroNode.js.map +0 -1
- package/fabric-interop/dist/components/ViroOmniLight.d.ts +0 -22
- package/fabric-interop/dist/components/ViroOmniLight.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroOmniLight.js +0 -50
- package/fabric-interop/dist/components/ViroOmniLight.js.map +0 -1
- package/fabric-interop/dist/components/ViroOrbitCamera.d.ts +0 -18
- package/fabric-interop/dist/components/ViroOrbitCamera.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroOrbitCamera.js +0 -31
- package/fabric-interop/dist/components/ViroOrbitCamera.js.map +0 -1
- package/fabric-interop/dist/components/ViroParticleEmitter.d.ts +0 -52
- package/fabric-interop/dist/components/ViroParticleEmitter.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroParticleEmitter.js +0 -52
- package/fabric-interop/dist/components/ViroParticleEmitter.js.map +0 -1
- package/fabric-interop/dist/components/ViroPolygon.d.ts +0 -21
- package/fabric-interop/dist/components/ViroPolygon.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroPolygon.js +0 -49
- package/fabric-interop/dist/components/ViroPolygon.js.map +0 -1
- package/fabric-interop/dist/components/ViroPolyline.d.ts +0 -20
- package/fabric-interop/dist/components/ViroPolyline.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroPolyline.js +0 -48
- package/fabric-interop/dist/components/ViroPolyline.js.map +0 -1
- package/fabric-interop/dist/components/ViroPortal.d.ts +0 -17
- package/fabric-interop/dist/components/ViroPortal.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroPortal.js +0 -74
- package/fabric-interop/dist/components/ViroPortal.js.map +0 -1
- package/fabric-interop/dist/components/ViroPortalScene.d.ts +0 -17
- package/fabric-interop/dist/components/ViroPortalScene.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroPortalScene.js +0 -30
- package/fabric-interop/dist/components/ViroPortalScene.js.map +0 -1
- package/fabric-interop/dist/components/ViroQuad.d.ts +0 -40
- package/fabric-interop/dist/components/ViroQuad.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroQuad.js +0 -51
- package/fabric-interop/dist/components/ViroQuad.js.map +0 -1
- package/fabric-interop/dist/components/ViroScene.d.ts +0 -30
- package/fabric-interop/dist/components/ViroScene.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroScene.js +0 -105
- package/fabric-interop/dist/components/ViroScene.js.map +0 -1
- package/fabric-interop/dist/components/ViroSceneNavigator.d.ts +0 -24
- package/fabric-interop/dist/components/ViroSceneNavigator.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroSceneNavigator.js +0 -74
- package/fabric-interop/dist/components/ViroSceneNavigator.js.map +0 -1
- package/fabric-interop/dist/components/ViroSkyBox.d.ts +0 -40
- package/fabric-interop/dist/components/ViroSkyBox.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroSkyBox.js +0 -46
- package/fabric-interop/dist/components/ViroSkyBox.js.map +0 -1
- package/fabric-interop/dist/components/ViroSound.d.ts +0 -24
- package/fabric-interop/dist/components/ViroSound.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroSound.js +0 -48
- package/fabric-interop/dist/components/ViroSound.js.map +0 -1
- package/fabric-interop/dist/components/ViroSoundField.d.ts +0 -25
- package/fabric-interop/dist/components/ViroSoundField.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroSoundField.js +0 -49
- package/fabric-interop/dist/components/ViroSoundField.js.map +0 -1
- package/fabric-interop/dist/components/ViroSpatialSound.d.ts +0 -28
- package/fabric-interop/dist/components/ViroSpatialSound.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroSpatialSound.js +0 -52
- package/fabric-interop/dist/components/ViroSpatialSound.js.map +0 -1
- package/fabric-interop/dist/components/ViroSphere.d.ts +0 -23
- package/fabric-interop/dist/components/ViroSphere.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroSphere.js +0 -51
- package/fabric-interop/dist/components/ViroSphere.js.map +0 -1
- package/fabric-interop/dist/components/ViroSpinner.d.ts +0 -19
- package/fabric-interop/dist/components/ViroSpinner.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroSpinner.js +0 -47
- package/fabric-interop/dist/components/ViroSpinner.js.map +0 -1
- package/fabric-interop/dist/components/ViroSpotLight.d.ts +0 -31
- package/fabric-interop/dist/components/ViroSpotLight.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroSpotLight.js +0 -59
- package/fabric-interop/dist/components/ViroSpotLight.js.map +0 -1
- package/fabric-interop/dist/components/ViroSurface.d.ts +0 -39
- package/fabric-interop/dist/components/ViroSurface.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroSurface.js +0 -50
- package/fabric-interop/dist/components/ViroSurface.js.map +0 -1
- package/fabric-interop/dist/components/ViroText.d.ts +0 -37
- package/fabric-interop/dist/components/ViroText.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroText.js +0 -61
- package/fabric-interop/dist/components/ViroText.js.map +0 -1
- package/fabric-interop/dist/components/ViroUtils.d.ts +0 -64
- package/fabric-interop/dist/components/ViroUtils.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroUtils.js +0 -141
- package/fabric-interop/dist/components/ViroUtils.js.map +0 -1
- package/fabric-interop/dist/components/ViroVRSceneNavigator.d.ts +0 -26
- package/fabric-interop/dist/components/ViroVRSceneNavigator.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroVRSceneNavigator.js +0 -74
- package/fabric-interop/dist/components/ViroVRSceneNavigator.js.map +0 -1
- package/fabric-interop/dist/components/ViroVideo.d.ts +0 -33
- package/fabric-interop/dist/components/ViroVideo.d.ts.map +0 -1
- package/fabric-interop/dist/components/ViroVideo.js +0 -54
- package/fabric-interop/dist/components/ViroVideo.js.map +0 -1
- package/fabric-interop/dist/components/index.d.ts +0 -63
- package/fabric-interop/dist/components/index.d.ts.map +0 -1
- package/fabric-interop/dist/components/index.js +0 -145
- package/fabric-interop/dist/components/index.js.map +0 -1
- package/fabric-interop/dist/index.d.ts +0 -15
- package/fabric-interop/dist/index.d.ts.map +0 -1
- package/fabric-interop/dist/index.js +0 -118
- package/fabric-interop/dist/index.js.map +0 -1
- package/fabric-interop/dist/specs/ViroEventsTurboModule.d.ts +0 -20
- package/fabric-interop/dist/specs/ViroEventsTurboModule.d.ts.map +0 -1
- package/fabric-interop/dist/specs/ViroEventsTurboModule.js +0 -12
- package/fabric-interop/dist/specs/ViroEventsTurboModule.js.map +0 -1
- package/fabric-interop/examples/BasicSceneExample.tsx +0 -287
- package/fabric-interop/examples/ComprehensiveExample.tsx +0 -441
- package/fabric-interop/examples/SimpleARExample.tsx +0 -95
- package/fabric-interop/global.d.ts +0 -14
- package/fabric-interop/index.ts +0 -107
- package/fabric-interop/metro.config.js +0 -12
- package/fabric-interop/package.json +0 -40
- package/fabric-interop/react-native.config.js +0 -22
- package/fabric-interop/scripts/validate-build.js +0 -393
- package/fabric-interop/scripts/validate-implementation.js +0 -272
- package/fabric-interop/specs/README.md +0 -22
- package/fabric-interop/specs/ViroEventsTurboModule.ts +0 -27
- package/fabric-interop/test/BasicFunctionalityTest.tsx +0 -243
- package/fabric-interop/tsconfig.json +0 -38
- package/fabric.d.ts +0 -5
- package/fabric.ts +0 -14
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ViroEventsManager.js
|
|
3
|
-
* JavaScript integration for ViroEventsTurboModule
|
|
4
|
-
*
|
|
5
|
-
* This module provides the JavaScript interface for handling
|
|
6
|
-
* Viro JSI events through the TurboModule system
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { NativeEventEmitter, NativeModules } from "react-native";
|
|
10
|
-
import ViroEventsTurboModule from "./specs/ViroEventsTurboModule";
|
|
11
|
-
|
|
12
|
-
class ViroEventsManager {
|
|
13
|
-
constructor() {
|
|
14
|
-
this.eventEmitter = new NativeEventEmitter(ViroEventsTurboModule);
|
|
15
|
-
this.listeners = new Map();
|
|
16
|
-
this.callbackRegistry = new Map();
|
|
17
|
-
|
|
18
|
-
// Set up event listeners
|
|
19
|
-
this.setupEventListeners();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
setupEventListeners() {
|
|
23
|
-
// Listen for JSI callbacks
|
|
24
|
-
this.eventEmitter.addListener("ViroJSICallback", (event) => {
|
|
25
|
-
this.handleJSICallback(event);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
// Listen for node events
|
|
29
|
-
this.eventEmitter.addListener("ViroNodeEvent", (event) => {
|
|
30
|
-
this.handleNodeEvent(event);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
// Listen for scene events
|
|
34
|
-
this.eventEmitter.addListener("ViroSceneEvent", (event) => {
|
|
35
|
-
this.handleSceneEvent(event);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Register a callback for JSI events
|
|
41
|
-
* @param {string} callbackId - The callback ID from JSI
|
|
42
|
-
* @param {function} callback - The JavaScript callback function
|
|
43
|
-
*/
|
|
44
|
-
registerJSICallback(callbackId, callback) {
|
|
45
|
-
if (typeof callback === "function") {
|
|
46
|
-
this.callbackRegistry.set(callbackId, callback);
|
|
47
|
-
console.log(`[ViroEventsManager] Registered JSI callback: ${callbackId}`);
|
|
48
|
-
} else {
|
|
49
|
-
console.warn(
|
|
50
|
-
`[ViroEventsManager] Invalid callback for ID: ${callbackId}`
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Unregister a JSI callback
|
|
57
|
-
* @param {string} callbackId - The callback ID to remove
|
|
58
|
-
*/
|
|
59
|
-
unregisterJSICallback(callbackId) {
|
|
60
|
-
if (this.callbackRegistry.has(callbackId)) {
|
|
61
|
-
this.callbackRegistry.delete(callbackId);
|
|
62
|
-
console.log(
|
|
63
|
-
`[ViroEventsManager] Unregistered JSI callback: ${callbackId}`
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Register a listener for node events
|
|
70
|
-
* @param {string} nodeId - The node ID
|
|
71
|
-
* @param {string} eventName - The event name
|
|
72
|
-
* @param {function} callback - The callback function
|
|
73
|
-
*/
|
|
74
|
-
registerNodeEventListener(nodeId, eventName, callback) {
|
|
75
|
-
const key = `${nodeId}.${eventName}`;
|
|
76
|
-
this.listeners.set(key, callback);
|
|
77
|
-
console.log(`[ViroEventsManager] Registered node event listener: ${key}`);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Register a listener for scene events
|
|
82
|
-
* @param {string} sceneId - The scene ID
|
|
83
|
-
* @param {string} eventName - The event name
|
|
84
|
-
* @param {function} callback - The callback function
|
|
85
|
-
*/
|
|
86
|
-
registerSceneEventListener(sceneId, eventName, callback) {
|
|
87
|
-
const key = `scene.${sceneId}.${eventName}`;
|
|
88
|
-
this.listeners.set(key, callback);
|
|
89
|
-
console.log(`[ViroEventsManager] Registered scene event listener: ${key}`);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Handle JSI callback events
|
|
94
|
-
* @private
|
|
95
|
-
*/
|
|
96
|
-
handleJSICallback(event) {
|
|
97
|
-
const { callbackId, eventData, timestamp } = event;
|
|
98
|
-
|
|
99
|
-
console.log(
|
|
100
|
-
`[ViroEventsManager] Received JSI callback: ${callbackId}`,
|
|
101
|
-
eventData
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
const callback = this.callbackRegistry.get(callbackId);
|
|
105
|
-
if (callback) {
|
|
106
|
-
try {
|
|
107
|
-
callback(eventData);
|
|
108
|
-
} catch (error) {
|
|
109
|
-
console.error(
|
|
110
|
-
`[ViroEventsManager] Error executing JSI callback ${callbackId}:`,
|
|
111
|
-
error
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
} else {
|
|
115
|
-
console.warn(
|
|
116
|
-
`[ViroEventsManager] No callback registered for ID: ${callbackId}`
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Handle node events
|
|
123
|
-
* @private
|
|
124
|
-
*/
|
|
125
|
-
handleNodeEvent(event) {
|
|
126
|
-
const { nodeId, eventName, eventData, timestamp } = event;
|
|
127
|
-
const key = `${nodeId}.${eventName}`;
|
|
128
|
-
|
|
129
|
-
console.log(`[ViroEventsManager] Received node event: ${key}`, eventData);
|
|
130
|
-
|
|
131
|
-
const callback = this.listeners.get(key);
|
|
132
|
-
if (callback) {
|
|
133
|
-
try {
|
|
134
|
-
callback(eventData);
|
|
135
|
-
} catch (error) {
|
|
136
|
-
console.error(
|
|
137
|
-
`[ViroEventsManager] Error executing node event callback ${key}:`,
|
|
138
|
-
error
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Handle scene events
|
|
146
|
-
* @private
|
|
147
|
-
*/
|
|
148
|
-
handleSceneEvent(event) {
|
|
149
|
-
const { sceneId, eventName, eventData, timestamp } = event;
|
|
150
|
-
const key = `scene.${sceneId}.${eventName}`;
|
|
151
|
-
|
|
152
|
-
console.log(`[ViroEventsManager] Received scene event: ${key}`, eventData);
|
|
153
|
-
|
|
154
|
-
const callback = this.listeners.get(key);
|
|
155
|
-
if (callback) {
|
|
156
|
-
try {
|
|
157
|
-
callback(eventData);
|
|
158
|
-
} catch (error) {
|
|
159
|
-
console.error(
|
|
160
|
-
`[ViroEventsManager] Error executing scene event callback ${key}:`,
|
|
161
|
-
error
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Check if the event system is ready
|
|
169
|
-
* @returns {boolean}
|
|
170
|
-
*/
|
|
171
|
-
isEventSystemReady() {
|
|
172
|
-
try {
|
|
173
|
-
return ViroEventsTurboModule.isEventSystemReady();
|
|
174
|
-
} catch (error) {
|
|
175
|
-
console.error(
|
|
176
|
-
"[ViroEventsManager] Error checking event system status:",
|
|
177
|
-
error
|
|
178
|
-
);
|
|
179
|
-
return false;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Get the number of active listeners
|
|
185
|
-
* @returns {number}
|
|
186
|
-
*/
|
|
187
|
-
getActiveListenerCount() {
|
|
188
|
-
try {
|
|
189
|
-
return ViroEventsTurboModule.getActiveListenerCount();
|
|
190
|
-
} catch (error) {
|
|
191
|
-
console.error("[ViroEventsManager] Error getting listener count:", error);
|
|
192
|
-
return 0;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Manually emit a JSI callback (for testing)
|
|
198
|
-
* @param {string} callbackId - The callback ID
|
|
199
|
-
* @param {object} eventData - The event data
|
|
200
|
-
*/
|
|
201
|
-
emitJSICallback(callbackId, eventData = {}) {
|
|
202
|
-
try {
|
|
203
|
-
ViroEventsTurboModule.emitJSICallback(callbackId, eventData);
|
|
204
|
-
} catch (error) {
|
|
205
|
-
console.error("[ViroEventsManager] Error emitting JSI callback:", error);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Manually emit a node event (for testing)
|
|
211
|
-
* @param {string} nodeId - The node ID
|
|
212
|
-
* @param {string} eventName - The event name
|
|
213
|
-
* @param {object} eventData - The event data
|
|
214
|
-
*/
|
|
215
|
-
emitNodeEvent(nodeId, eventName, eventData = {}) {
|
|
216
|
-
try {
|
|
217
|
-
ViroEventsTurboModule.emitNodeEvent(nodeId, eventName, eventData);
|
|
218
|
-
} catch (error) {
|
|
219
|
-
console.error("[ViroEventsManager] Error emitting node event:", error);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Manually emit a scene event (for testing)
|
|
225
|
-
* @param {string} sceneId - The scene ID
|
|
226
|
-
* @param {string} eventName - The event name
|
|
227
|
-
* @param {object} eventData - The event data
|
|
228
|
-
*/
|
|
229
|
-
emitSceneEvent(sceneId, eventName, eventData = {}) {
|
|
230
|
-
try {
|
|
231
|
-
ViroEventsTurboModule.emitSceneEvent(sceneId, eventName, eventData);
|
|
232
|
-
} catch (error) {
|
|
233
|
-
console.error("[ViroEventsManager] Error emitting scene event:", error);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Clean up all listeners and callbacks
|
|
239
|
-
*/
|
|
240
|
-
cleanup() {
|
|
241
|
-
console.log("[ViroEventsManager] Cleaning up event manager");
|
|
242
|
-
|
|
243
|
-
// Remove all event listeners
|
|
244
|
-
this.eventEmitter.removeAllListeners("ViroJSICallback");
|
|
245
|
-
this.eventEmitter.removeAllListeners("ViroNodeEvent");
|
|
246
|
-
this.eventEmitter.removeAllListeners("ViroSceneEvent");
|
|
247
|
-
|
|
248
|
-
// Clear registries
|
|
249
|
-
this.listeners.clear();
|
|
250
|
-
this.callbackRegistry.clear();
|
|
251
|
-
|
|
252
|
-
console.log("[ViroEventsManager] Event manager cleanup completed");
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// Export singleton instance
|
|
257
|
-
export default new ViroEventsManager();
|
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ViroFabricContainer
|
|
3
|
-
*
|
|
4
|
-
* This is the main container component that Fabric manages directly.
|
|
5
|
-
* It serves as a viewport for the Viro rendering engine and delegates
|
|
6
|
-
* rendering to the existing native implementation.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import React, { useEffect, useRef, useState } from "react";
|
|
10
|
-
import {
|
|
11
|
-
requireNativeComponent,
|
|
12
|
-
UIManager,
|
|
13
|
-
findNodeHandle,
|
|
14
|
-
Platform,
|
|
15
|
-
View,
|
|
16
|
-
Text,
|
|
17
|
-
NativeEventEmitter,
|
|
18
|
-
NativeModules,
|
|
19
|
-
} from "react-native";
|
|
20
|
-
|
|
21
|
-
// Check if New Architecture is enabled
|
|
22
|
-
const isNewArchitectureEnabled = () => {
|
|
23
|
-
if (global.__turboModuleProxy == null) {
|
|
24
|
-
throw new Error(
|
|
25
|
-
"Viro: New Architecture is not enabled. This library requires React Native New Architecture. " +
|
|
26
|
-
"Please enable it in your app by following the instructions at: " +
|
|
27
|
-
"https://reactnative.dev/docs/new-architecture-intro"
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// We're assuming the minimum supported version (0.76.9+) since this is a Fabric-only component
|
|
32
|
-
return true;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// Check if the component exists in UIManager
|
|
36
|
-
const isFabricComponentAvailable = () => {
|
|
37
|
-
isNewArchitectureEnabled(); // This will throw if New Architecture is not enabled
|
|
38
|
-
|
|
39
|
-
if (
|
|
40
|
-
!UIManager.getViewManagerConfig ||
|
|
41
|
-
UIManager.getViewManagerConfig("ViroFabricContainerView") == null
|
|
42
|
-
) {
|
|
43
|
-
throw new Error(
|
|
44
|
-
"ViroFabricContainerView is not available. Make sure you have installed the native module properly."
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return true;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
// Define the native component
|
|
52
|
-
// @ts-ignore - TypeScript doesn't know about the props of the native component
|
|
53
|
-
const NativeViroFabricContainer = requireNativeComponent<any>(
|
|
54
|
-
"ViroFabricContainerView"
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
// Props for the container
|
|
58
|
-
export interface ViroFabricContainerProps {
|
|
59
|
-
// General props
|
|
60
|
-
debug?: boolean;
|
|
61
|
-
style?: React.CSSProperties;
|
|
62
|
-
|
|
63
|
-
// AR specific props
|
|
64
|
-
arEnabled?: boolean;
|
|
65
|
-
autofocus?: boolean;
|
|
66
|
-
worldAlignment?: "Gravity" | "GravityAndHeading" | "Camera";
|
|
67
|
-
videoQuality?: "High" | "Low";
|
|
68
|
-
|
|
69
|
-
// Event callbacks
|
|
70
|
-
onInitialized?: (success: boolean) => void;
|
|
71
|
-
onTrackingUpdated?: (state: any) => void;
|
|
72
|
-
onCameraTransformUpdate?: (transform: any) => void;
|
|
73
|
-
onARSessionFailed?: (error: string) => void;
|
|
74
|
-
|
|
75
|
-
// Scene management callbacks
|
|
76
|
-
onSceneStateChanged?: (event: { sceneId: string; state: string }) => void;
|
|
77
|
-
onMemoryWarning?: (event: { memoryStats: Record<string, any> }) => void;
|
|
78
|
-
|
|
79
|
-
// Children components
|
|
80
|
-
children?: React.ReactNode;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* ViroFabricContainer is the main component that hosts the Viro rendering engine.
|
|
85
|
-
* It creates a native view that the Viro renderer can draw on and manages the
|
|
86
|
-
* lifecycle of the Viro system.
|
|
87
|
-
*/
|
|
88
|
-
export const ViroFabricContainer: React.FC<ViroFabricContainerProps> = ({
|
|
89
|
-
debug = false,
|
|
90
|
-
arEnabled = false,
|
|
91
|
-
worldAlignment = "Gravity",
|
|
92
|
-
onInitialized,
|
|
93
|
-
onTrackingUpdated,
|
|
94
|
-
onCameraTransformUpdate,
|
|
95
|
-
onSceneStateChanged,
|
|
96
|
-
onMemoryWarning,
|
|
97
|
-
children,
|
|
98
|
-
}) => {
|
|
99
|
-
// Reference to the native component
|
|
100
|
-
const containerRef = useRef<any>(null);
|
|
101
|
-
|
|
102
|
-
// Root node ID for the scene
|
|
103
|
-
const rootNodeId = useRef<string>("viro_root_scene");
|
|
104
|
-
|
|
105
|
-
// Event callback registry
|
|
106
|
-
const eventCallbacks = useRef<Record<string, (event: any) => void>>({});
|
|
107
|
-
|
|
108
|
-
// Set up event handling for JSI and fallback event emitter approach
|
|
109
|
-
useEffect(() => {
|
|
110
|
-
// Set up global event handler for JSI events
|
|
111
|
-
if (typeof global !== "undefined") {
|
|
112
|
-
// @ts-ignore - This property will be added by the native code
|
|
113
|
-
global.handleViroEvent = (callbackId: string, eventData: any) => {
|
|
114
|
-
// Find the callback in the registry and call it
|
|
115
|
-
const callback = eventCallbacks.current[callbackId];
|
|
116
|
-
if (callback) {
|
|
117
|
-
callback(eventData);
|
|
118
|
-
} else {
|
|
119
|
-
console.warn(`No callback found for ID: ${callbackId}`);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// Set up event emitter for fallback approach
|
|
125
|
-
const eventEmitter = new NativeEventEmitter(
|
|
126
|
-
NativeModules.ViroFabricManager
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
// Add the ViroEvent listener
|
|
130
|
-
const subscription = eventEmitter.addListener("ViroEvent", (event) => {
|
|
131
|
-
const { callbackId, data } = event;
|
|
132
|
-
const callback = eventCallbacks.current[callbackId];
|
|
133
|
-
if (callback) {
|
|
134
|
-
callback(data);
|
|
135
|
-
} else {
|
|
136
|
-
console.warn(
|
|
137
|
-
`No callback found for ID: ${callbackId} (via event emitter)`
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
return () => {
|
|
143
|
-
// Clean up event subscription
|
|
144
|
-
subscription.remove();
|
|
145
|
-
|
|
146
|
-
// Clean up global event handler
|
|
147
|
-
if (typeof global !== "undefined") {
|
|
148
|
-
// @ts-ignore - This property was added by us
|
|
149
|
-
delete global.handleViroEvent;
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
}, []);
|
|
153
|
-
|
|
154
|
-
// Initialize the Viro system when the component mounts
|
|
155
|
-
useEffect(() => {
|
|
156
|
-
if (containerRef.current && isFabricComponentAvailable()) {
|
|
157
|
-
const nodeHandle = findNodeHandle(containerRef.current);
|
|
158
|
-
if (!nodeHandle) {
|
|
159
|
-
console.error("Failed to get node handle for ViroFabricContainer");
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
try {
|
|
164
|
-
// Use the codegenNativeCommands approach for New Architecture
|
|
165
|
-
const ViroFabricContainerCommands = UIManager.getViewManagerConfig(
|
|
166
|
-
"ViroFabricContainerView"
|
|
167
|
-
).Commands;
|
|
168
|
-
|
|
169
|
-
if (!ViroFabricContainerCommands) {
|
|
170
|
-
console.error(
|
|
171
|
-
"ViroFabricContainerView commands not found in UIManager"
|
|
172
|
-
);
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// Call the native method to initialize
|
|
177
|
-
UIManager.dispatchViewManagerCommand(
|
|
178
|
-
nodeHandle,
|
|
179
|
-
ViroFabricContainerCommands.initialize,
|
|
180
|
-
[debug || false, arEnabled || false, worldAlignment || "Gravity"]
|
|
181
|
-
);
|
|
182
|
-
} catch (error) {
|
|
183
|
-
console.error("Failed to initialize ViroFabricContainer:", error);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// Cleanup when unmounting
|
|
188
|
-
return () => {
|
|
189
|
-
if (containerRef.current) {
|
|
190
|
-
const nodeHandle = findNodeHandle(containerRef.current);
|
|
191
|
-
if (!nodeHandle) return;
|
|
192
|
-
|
|
193
|
-
try {
|
|
194
|
-
// Use the same approach as initialize for cleanup
|
|
195
|
-
const ViroFabricContainerCommands = UIManager.getViewManagerConfig(
|
|
196
|
-
"ViroFabricContainerView"
|
|
197
|
-
).Commands;
|
|
198
|
-
|
|
199
|
-
if (
|
|
200
|
-
!ViroFabricContainerCommands ||
|
|
201
|
-
!ViroFabricContainerCommands.cleanup
|
|
202
|
-
) {
|
|
203
|
-
console.error(
|
|
204
|
-
"ViroFabricContainerView cleanup command not found in UIManager"
|
|
205
|
-
);
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// Call the native method to cleanup
|
|
210
|
-
UIManager.dispatchViewManagerCommand(
|
|
211
|
-
nodeHandle,
|
|
212
|
-
ViroFabricContainerCommands.cleanup,
|
|
213
|
-
[]
|
|
214
|
-
);
|
|
215
|
-
} catch (error) {
|
|
216
|
-
console.error("Failed to cleanup ViroFabricContainer:", error);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
}, [debug, arEnabled, worldAlignment]);
|
|
221
|
-
|
|
222
|
-
// Handle initialization event
|
|
223
|
-
const handleInitialized = (event: any) => {
|
|
224
|
-
if (onInitialized) {
|
|
225
|
-
onInitialized(event.nativeEvent.success);
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
// Handle tracking updated event
|
|
230
|
-
const handleTrackingUpdated = (event: any) => {
|
|
231
|
-
if (onTrackingUpdated) {
|
|
232
|
-
onTrackingUpdated(event.nativeEvent);
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
// Handle camera transform update event
|
|
237
|
-
const handleCameraTransformUpdate = (event: any) => {
|
|
238
|
-
if (onCameraTransformUpdate) {
|
|
239
|
-
onCameraTransformUpdate(event.nativeEvent);
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
// Handle scene state changed event
|
|
244
|
-
const handleSceneStateChanged = (event: any) => {
|
|
245
|
-
if (onSceneStateChanged) {
|
|
246
|
-
onSceneStateChanged(event.nativeEvent);
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
// Handle memory warning event
|
|
251
|
-
const handleMemoryWarning = (event: any) => {
|
|
252
|
-
if (onMemoryWarning) {
|
|
253
|
-
onMemoryWarning(event.nativeEvent);
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
// This will throw an error if the native component is not available or New Architecture is not enabled
|
|
258
|
-
isFabricComponentAvailable();
|
|
259
|
-
|
|
260
|
-
return (
|
|
261
|
-
<NativeViroFabricContainer
|
|
262
|
-
ref={containerRef}
|
|
263
|
-
style={{ flex: 1 }}
|
|
264
|
-
onInitialized={handleInitialized}
|
|
265
|
-
onTrackingUpdated={handleTrackingUpdated}
|
|
266
|
-
onCameraTransformUpdate={handleCameraTransformUpdate}
|
|
267
|
-
onSceneStateChanged={handleSceneStateChanged}
|
|
268
|
-
onMemoryWarning={handleMemoryWarning}
|
|
269
|
-
>
|
|
270
|
-
{children}
|
|
271
|
-
</NativeViroFabricContainer>
|
|
272
|
-
);
|
|
273
|
-
};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ViroARPlane
|
|
3
|
-
*
|
|
4
|
-
* Container for Viro Components anchored to a detected plane.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
import { useEffect, useState } from "react";
|
|
9
|
-
import { ViroNode } from "../ViroNode";
|
|
10
|
-
import { useViroNode } from "../ViroUtils";
|
|
11
|
-
import {
|
|
12
|
-
registerEventListener,
|
|
13
|
-
unregisterEventListener,
|
|
14
|
-
} from "../../NativeViro";
|
|
15
|
-
import { ViroCommonProps, ViroObjectProps } from "./ViroCommonProps";
|
|
16
|
-
import { ViroAnchorFoundMap, ViroAnchorUpdatedMap } from "../Types/ViroEvents";
|
|
17
|
-
|
|
18
|
-
type Props = ViroCommonProps &
|
|
19
|
-
ViroObjectProps & {
|
|
20
|
-
anchorId?: string;
|
|
21
|
-
minHeight?: number;
|
|
22
|
-
minWidth?: number;
|
|
23
|
-
alignment?:
|
|
24
|
-
| "Horizontal"
|
|
25
|
-
| "HorizontalUpward"
|
|
26
|
-
| "HorizontalDownward"
|
|
27
|
-
| "Vertical";
|
|
28
|
-
onAnchorFound?: (anchorMap: ViroAnchorFoundMap) => void;
|
|
29
|
-
onAnchorUpdated?: (anchorMap: ViroAnchorUpdatedMap) => void;
|
|
30
|
-
onAnchorRemoved?: () => void;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Container for Viro Components anchored to a detected plane.
|
|
35
|
-
*/
|
|
36
|
-
export function ViroARPlane(props: Props): React.ReactElement {
|
|
37
|
-
const {
|
|
38
|
-
anchorId,
|
|
39
|
-
minHeight,
|
|
40
|
-
minWidth,
|
|
41
|
-
alignment,
|
|
42
|
-
onAnchorFound,
|
|
43
|
-
onAnchorUpdated,
|
|
44
|
-
onAnchorRemoved,
|
|
45
|
-
children,
|
|
46
|
-
...rest
|
|
47
|
-
} = props;
|
|
48
|
-
|
|
49
|
-
// Create the node
|
|
50
|
-
const nodeProps = {
|
|
51
|
-
...rest,
|
|
52
|
-
anchorId,
|
|
53
|
-
minHeight,
|
|
54
|
-
minWidth,
|
|
55
|
-
alignment,
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const nodeId = useViroNode("arPlane", nodeProps);
|
|
59
|
-
|
|
60
|
-
// Set up event listeners
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
const anchorFoundCallbackId = onAnchorFound
|
|
63
|
-
? registerEventListener(nodeId, "onAnchorFound", (event) => {
|
|
64
|
-
onAnchorFound(event.anchorFoundMap);
|
|
65
|
-
})
|
|
66
|
-
: null;
|
|
67
|
-
|
|
68
|
-
const anchorUpdatedCallbackId = onAnchorUpdated
|
|
69
|
-
? registerEventListener(nodeId, "onAnchorUpdated", (event) => {
|
|
70
|
-
onAnchorUpdated(event.anchorUpdatedMap);
|
|
71
|
-
})
|
|
72
|
-
: null;
|
|
73
|
-
|
|
74
|
-
const anchorRemovedCallbackId = onAnchorRemoved
|
|
75
|
-
? registerEventListener(nodeId, "onAnchorRemoved", () => {
|
|
76
|
-
onAnchorRemoved();
|
|
77
|
-
})
|
|
78
|
-
: null;
|
|
79
|
-
|
|
80
|
-
// Clean up event listeners
|
|
81
|
-
return () => {
|
|
82
|
-
if (anchorFoundCallbackId) {
|
|
83
|
-
unregisterEventListener(nodeId, "onAnchorFound", anchorFoundCallbackId);
|
|
84
|
-
}
|
|
85
|
-
if (anchorUpdatedCallbackId) {
|
|
86
|
-
unregisterEventListener(
|
|
87
|
-
nodeId,
|
|
88
|
-
"onAnchorUpdated",
|
|
89
|
-
anchorUpdatedCallbackId
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
if (anchorRemovedCallbackId) {
|
|
93
|
-
unregisterEventListener(
|
|
94
|
-
nodeId,
|
|
95
|
-
"onAnchorRemoved",
|
|
96
|
-
anchorRemovedCallbackId
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
}, [nodeId, onAnchorFound, onAnchorUpdated, onAnchorRemoved]);
|
|
101
|
-
|
|
102
|
-
// Render children within this node
|
|
103
|
-
return (
|
|
104
|
-
<ViroNode viroTag={nodeId} position={[0, 0, 0]}>
|
|
105
|
-
{children}
|
|
106
|
-
</ViroNode>
|
|
107
|
-
);
|
|
108
|
-
}
|