@reactvision/react-viro 2.55.0 → 2.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/README.md +27 -0
  2. package/android/react_viro/react_viro-release.aar +0 -0
  3. package/android/viro_renderer/viro_renderer-release.aar +0 -0
  4. package/components/AR/ViroARScene.tsx +17 -0
  5. package/components/AR/ViroARSceneNavigator.tsx +33 -0
  6. package/components/Utilities/StreamingAudioManager.ts +73 -0
  7. package/components/Utilities/ViroVersion.ts +1 -1
  8. package/components/ViroCameraTexture.tsx +230 -0
  9. package/components/ViroGameLoop.tsx +74 -0
  10. package/components/ViroGameLoopUtils.ts +52 -0
  11. package/components/ViroObjectDetector.tsx +222 -0
  12. package/components/ViroVirtualButton.tsx +101 -0
  13. package/components/ViroVirtualJoystick.tsx +126 -0
  14. package/components/hooks/useGameLoop.ts +78 -0
  15. package/dist/components/AR/ViroARScene.d.ts +12 -0
  16. package/dist/components/AR/ViroARScene.js +8 -1
  17. package/dist/components/AR/ViroARSceneNavigator.d.ts +30 -0
  18. package/dist/components/Utilities/StreamingAudioManager.d.ts +22 -0
  19. package/dist/components/Utilities/StreamingAudioManager.js +45 -0
  20. package/dist/components/Utilities/ViroVersion.d.ts +1 -1
  21. package/dist/components/Utilities/ViroVersion.js +1 -1
  22. package/dist/components/ViroCameraTexture.d.ts +137 -0
  23. package/dist/components/ViroCameraTexture.js +170 -0
  24. package/dist/components/ViroGameLoop.d.ts +31 -0
  25. package/dist/components/ViroGameLoop.js +31 -0
  26. package/dist/components/ViroGameLoopUtils.d.ts +26 -0
  27. package/dist/components/ViroGameLoopUtils.js +44 -0
  28. package/dist/components/ViroObjectDetector.d.ts +138 -0
  29. package/dist/components/ViroObjectDetector.js +85 -0
  30. package/dist/components/ViroVirtualButton.d.ts +76 -0
  31. package/dist/components/ViroVirtualButton.js +62 -0
  32. package/dist/components/ViroVirtualJoystick.d.ts +85 -0
  33. package/dist/components/ViroVirtualJoystick.js +72 -0
  34. package/dist/components/hooks/useGameLoop.d.ts +34 -0
  35. package/dist/components/hooks/useGameLoop.js +63 -0
  36. package/dist/index.d.ts +11 -1
  37. package/dist/index.js +20 -2
  38. package/dist/plugins/withViro.js +2 -15
  39. package/dist/plugins/withViroAndroid.js +52 -15
  40. package/dist/plugins/withViroIos.js +0 -6
  41. package/index.ts +21 -0
  42. package/ios/ViroReact.podspec +25 -6
  43. package/ios/dist/ViroRenderer/ViroKit.framework/ARCoreCoreMLSemanticsResources.bundle/Info.plist +0 -0
  44. package/ios/dist/ViroRenderer/ViroKit.framework/ARCoreResources.bundle/Info.plist +0 -0
  45. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARDepthMesh.h +9 -1
  46. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARFrame.h +33 -0
  47. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARFrameiOS.h +26 -0
  48. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARScene.h +15 -1
  49. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARSceneDelegateiOS.h +8 -0
  50. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARSession.h +7 -0
  51. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARSessioniOS.h +18 -0
  52. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARWorldMesh.h +111 -8
  53. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROAudioPlayer.h +19 -0
  54. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROAudioPlayerStreamiOS.h +95 -0
  55. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROCameraTextureiOS.h +17 -1
  56. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VRODriver.h +20 -0
  57. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VRODynamicGeometry.h +170 -0
  58. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VRODynamicMeshNode.h +87 -0
  59. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROGLTFLoader.h +5 -1
  60. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROGameLoopListener.h +125 -0
  61. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROInputState.h +133 -0
  62. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROMonocularDepthEstimator.h +73 -0
  63. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROObjectDetector.h +134 -0
  64. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROPCMRingBuffer.h +143 -0
  65. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROPencil.h +9 -0
  66. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VRORenderContext.h +4 -0
  67. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VRORenderer.h +1 -0
  68. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROVertexBuffer.h +102 -0
  69. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROViewAR.h +9 -0
  70. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROVirtualControllerRegistry.h +106 -0
  71. package/ios/dist/ViroRenderer/ViroKit.framework/Info.plist +0 -0
  72. package/ios/dist/ViroRenderer/ViroKit.framework/Shaders.dat +1 -1
  73. package/ios/dist/ViroRenderer/ViroKit.framework/ViroKit +0 -0
  74. package/ios/dist/ViroRenderer/ViroKit.framework/constant_fsh.glsl +1 -0
  75. package/ios/dist/ViroRenderer/ViroKit.framework/constant_fsh_adreno.glsl +1 -0
  76. package/ios/dist/ViroRenderer/ViroKit.framework/standard_fsh.glsl +1 -0
  77. package/ios/dist/ViroRenderer/ViroKit.framework/standard_vsh.glsl +4 -0
  78. package/ios/dist/ViroRenderer/ViroKit.framework/standard_vsh_adreno.glsl +4 -0
  79. package/ios/dist/ViroRendererVisionOS/ViroKit.podspec +27 -0
  80. package/ios/dist/include/VRTARScene.h +1 -0
  81. package/ios/dist/include/VRTARSceneNavigator.h +3 -0
  82. package/ios/dist/include/VRTCameraTexture.h +62 -0
  83. package/ios/dist/include/VRTCameraTextureManager.h +30 -0
  84. package/ios/dist/include/VRTCameraTextureModule.h +38 -0
  85. package/ios/dist/include/VRTGameLoopView.h +19 -0
  86. package/ios/dist/include/VRTGameLoopViewManager.h +8 -0
  87. package/ios/dist/include/VRTManagedAnimation.h +67 -0
  88. package/ios/dist/include/VRTStreamingAudioModule.h +21 -0
  89. package/ios/dist/include/VRTVirtualButtonView.h +47 -0
  90. package/ios/dist/include/VRTVirtualButtonViewManager.h +21 -0
  91. package/ios/dist/include/VRTVirtualJoystickView.h +59 -0
  92. package/ios/dist/include/VRTVirtualJoystickViewManager.h +26 -0
  93. package/ios/dist/lib/libViroReact.a +0 -0
  94. package/package.json +17 -20
@@ -0,0 +1,76 @@
1
+ /**
2
+ * ViroVirtualButton.tsx
3
+ *
4
+ * Copyright © 2026 ReactVision. All rights reserved.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining
7
+ * a copy of this software and associated documentation files (the
8
+ * "Software"), to deal in the Software without restriction, including
9
+ * without limitation the rights to use, copy, modify, merge, publish,
10
+ * distribute, sublicense, and/or sell copies of the Software, and to
11
+ * permit persons to whom the Software is furnished to do so, subject to
12
+ * the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included
15
+ * in all copies or substantial portions of the Software.
16
+ */
17
+ import * as React from "react";
18
+ import { StyleProp, ViewStyle } from "react-native";
19
+ /**
20
+ * Native virtual-button component. Renders an on-screen circular button labelled
21
+ * with the button name (e.g. "A", "B"). On press it writes setButton(idx, true)
22
+ * to a VROInputState in VROVirtualControllerRegistry; on release it writes false.
23
+ *
24
+ * Like ViroVirtualJoystick, touch handling is entirely native — no JS bridge
25
+ * round-trip — so press/release latency stays in the single-digit-milliseconds range.
26
+ *
27
+ * Example:
28
+ *
29
+ * <ViroVirtualButton
30
+ * controllerId="p1"
31
+ * button="A"
32
+ * style={{ position: "absolute", bottom: 60, right: 60, width: 60, height: 60 }}
33
+ * size={44}
34
+ * tintColor="rgba(255,255,255,0.6)"
35
+ * />
36
+ */
37
+ export type ViroButtonName = "A" | "B" | "X" | "Y" | "Z" | "L1" | "R1" | "L2" | "R2" | "Start" | "Select";
38
+ export interface ViroVirtualButtonProps {
39
+ /**
40
+ * Identifier of the controller this button writes to. Must match the
41
+ * `controllerId` of any joystick or other adapter sharing the same state.
42
+ */
43
+ controllerId: string;
44
+ /**
45
+ * Which button this view maps to. Determines the index written to
46
+ * VROInputState::setButton and the label drawn on the circle.
47
+ */
48
+ button: ViroButtonName;
49
+ /**
50
+ * Diameter of the button circle in points. Defaults to 44.
51
+ */
52
+ size?: number;
53
+ /**
54
+ * Fill colour of the circle. Any value accepted by React Native's color prop.
55
+ * Defaults to `rgba(255, 255, 255, 0.6)`.
56
+ */
57
+ tintColor?: number | string;
58
+ /** Fired when the button is pressed down (same tick as C++ VROInputState write). */
59
+ onPressIn?: (event: {
60
+ nativeEvent: {
61
+ button: string;
62
+ };
63
+ }) => void;
64
+ /** Fired when the button is released (same tick as C++ VROInputState write). */
65
+ onPressOut?: (event: {
66
+ nativeEvent: {
67
+ button: string;
68
+ };
69
+ }) => void;
70
+ /**
71
+ * Positioning / sizing.
72
+ */
73
+ style?: StyleProp<ViewStyle>;
74
+ }
75
+ export declare const ViroVirtualButton: React.FC<ViroVirtualButtonProps>;
76
+ export default ViroVirtualButton;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ /**
3
+ * ViroVirtualButton.tsx
4
+ *
5
+ * Copyright © 2026 ReactVision. All rights reserved.
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining
8
+ * a copy of this software and associated documentation files (the
9
+ * "Software"), to deal in the Software without restriction, including
10
+ * without limitation the rights to use, copy, modify, merge, publish,
11
+ * distribute, sublicense, and/or sell copies of the Software, and to
12
+ * permit persons to whom the Software is furnished to do so, subject to
13
+ * the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included
16
+ * in all copies or substantial portions of the Software.
17
+ */
18
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ var desc = Object.getOwnPropertyDescriptor(m, k);
21
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
22
+ desc = { enumerable: true, get: function() { return m[k]; } };
23
+ }
24
+ Object.defineProperty(o, k2, desc);
25
+ }) : (function(o, m, k, k2) {
26
+ if (k2 === undefined) k2 = k;
27
+ o[k2] = m[k];
28
+ }));
29
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
30
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
31
+ }) : function(o, v) {
32
+ o["default"] = v;
33
+ });
34
+ var __importStar = (this && this.__importStar) || (function () {
35
+ var ownKeys = function(o) {
36
+ ownKeys = Object.getOwnPropertyNames || function (o) {
37
+ var ar = [];
38
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
39
+ return ar;
40
+ };
41
+ return ownKeys(o);
42
+ };
43
+ return function (mod) {
44
+ if (mod && mod.__esModule) return mod;
45
+ var result = {};
46
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
47
+ __setModuleDefault(result, mod);
48
+ return result;
49
+ };
50
+ })();
51
+ Object.defineProperty(exports, "__esModule", { value: true });
52
+ exports.ViroVirtualButton = void 0;
53
+ const React = __importStar(require("react"));
54
+ const react_native_1 = require("react-native");
55
+ const NativeVirtualButton = (0, react_native_1.requireNativeComponent)("VRTVirtualButtonView");
56
+ const ViroVirtualButton = (props) => {
57
+ const { tintColor, ...rest } = props;
58
+ const processedTint = tintColor != null ? (0, react_native_1.processColor)(tintColor) : undefined;
59
+ return (<NativeVirtualButton {...rest} tintColor={processedTint}/>);
60
+ };
61
+ exports.ViroVirtualButton = ViroVirtualButton;
62
+ exports.default = exports.ViroVirtualButton;
@@ -0,0 +1,85 @@
1
+ /**
2
+ * ViroVirtualJoystick.tsx
3
+ *
4
+ * Copyright © 2026 ReactVision. All rights reserved.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining
7
+ * a copy of this software and associated documentation files (the
8
+ * "Software"), to deal in the Software without restriction, including
9
+ * without limitation the rights to use, copy, modify, merge, publish,
10
+ * distribute, sublicense, and/or sell copies of the Software, and to
11
+ * permit persons to whom the Software is furnished to do so, subject to
12
+ * the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included
15
+ * in all copies or substantial portions of the Software.
16
+ */
17
+ import * as React from "react";
18
+ import { StyleProp, ViewStyle } from "react-native";
19
+ /**
20
+ * Native virtual-joystick component. Renders an on-screen analog stick whose
21
+ * deflection is written to a process-wide controller state identified by
22
+ * `controllerId`. The touch handling and state update happen entirely on the
23
+ * native side — events do not cross the JS bridge — so input latency stays in
24
+ * the single-digit-milliseconds range even under heavy JS load.
25
+ *
26
+ * Consumers read the resulting controller state from native code (via a
27
+ * VROFrameListener that calls VROVirtualControllerRegistry::instance().peek(id))
28
+ * or from JS via the forthcoming useVirtualController hook.
29
+ *
30
+ * Multiple input sources (this joystick, a future MFi-gamepad adapter, a tilt
31
+ * adapter) can target the same `controllerId`; the controller state aggregates
32
+ * whichever sources last wrote to each field.
33
+ *
34
+ * Example:
35
+ *
36
+ * <ViroVirtualJoystick
37
+ * controllerId="p1"
38
+ * stickSide="left"
39
+ * style={{ position: "absolute", bottom: 40, left: 40, width: 140, height: 140 }}
40
+ * radius={60}
41
+ * tintColor="rgba(255,255,255,0.6)"
42
+ * />
43
+ */
44
+ export type ViroStickSide = "left" | "right";
45
+ export interface ViroVirtualJoystickProps {
46
+ /**
47
+ * Identifier of the controller this joystick writes to. Matches the id used
48
+ * by readers (e.g. native simulation adapters) and by other input adapters
49
+ * targeting the same controller.
50
+ */
51
+ controllerId: string;
52
+ /**
53
+ * Which stick on the controller this joystick drives. Defaults to `"left"`.
54
+ */
55
+ stickSide?: ViroStickSide;
56
+ /**
57
+ * Outer ring radius in points (the knob is clamped to this distance from the
58
+ * centre). The view's frame should be at least `radius * 2 + knobMargin` on
59
+ * each axis for the stick to render fully inside its bounds. Defaults to 60.
60
+ */
61
+ radius?: number;
62
+ /**
63
+ * Tint colour applied to both the outer ring stroke and the knob fill. Any
64
+ * value accepted by React Native's color prop. Defaults to
65
+ * `rgba(255, 255, 255, 0.6)`.
66
+ */
67
+ tintColor?: number | string;
68
+ /**
69
+ * Fired on every stick movement with { x, y } normalised to [-1, 1].
70
+ * Called from native synchronously after VROInputState is updated,
71
+ * so you can drive JS visuals from the same user gesture.
72
+ */
73
+ onStickChange?: (event: {
74
+ nativeEvent: {
75
+ x: number;
76
+ y: number;
77
+ };
78
+ }) => void;
79
+ /**
80
+ * Positioning / sizing. Same prop as any RN view.
81
+ */
82
+ style?: StyleProp<ViewStyle>;
83
+ }
84
+ export declare const ViroVirtualJoystick: React.FC<ViroVirtualJoystickProps>;
85
+ export default ViroVirtualJoystick;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ /**
3
+ * ViroVirtualJoystick.tsx
4
+ *
5
+ * Copyright © 2026 ReactVision. All rights reserved.
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining
8
+ * a copy of this software and associated documentation files (the
9
+ * "Software"), to deal in the Software without restriction, including
10
+ * without limitation the rights to use, copy, modify, merge, publish,
11
+ * distribute, sublicense, and/or sell copies of the Software, and to
12
+ * permit persons to whom the Software is furnished to do so, subject to
13
+ * the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included
16
+ * in all copies or substantial portions of the Software.
17
+ */
18
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ var desc = Object.getOwnPropertyDescriptor(m, k);
21
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
22
+ desc = { enumerable: true, get: function() { return m[k]; } };
23
+ }
24
+ Object.defineProperty(o, k2, desc);
25
+ }) : (function(o, m, k, k2) {
26
+ if (k2 === undefined) k2 = k;
27
+ o[k2] = m[k];
28
+ }));
29
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
30
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
31
+ }) : function(o, v) {
32
+ o["default"] = v;
33
+ });
34
+ var __importStar = (this && this.__importStar) || (function () {
35
+ var ownKeys = function(o) {
36
+ ownKeys = Object.getOwnPropertyNames || function (o) {
37
+ var ar = [];
38
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
39
+ return ar;
40
+ };
41
+ return ownKeys(o);
42
+ };
43
+ return function (mod) {
44
+ if (mod && mod.__esModule) return mod;
45
+ var result = {};
46
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
47
+ __setModuleDefault(result, mod);
48
+ return result;
49
+ };
50
+ })();
51
+ Object.defineProperty(exports, "__esModule", { value: true });
52
+ exports.ViroVirtualJoystick = void 0;
53
+ const React = __importStar(require("react"));
54
+ const react_native_1 = require("react-native");
55
+ const NativeVirtualJoystick = (0, react_native_1.requireNativeComponent)("VRTVirtualJoystickView");
56
+ const ViroVirtualJoystick = (props) => {
57
+ const { tintColor, onStickChange, ...rest } = props;
58
+ const processedTint = tintColor != null ? (0, react_native_1.processColor)(tintColor) : undefined;
59
+ // Native sends x/y as strings to avoid Fabric conversions.h type-check spam.
60
+ const handleStickChange = onStickChange
61
+ ? (e) => onStickChange({
62
+ nativeEvent: { x: parseFloat(e.nativeEvent.x), y: parseFloat(e.nativeEvent.y) }
63
+ })
64
+ : undefined;
65
+ return (<NativeVirtualJoystick {...rest} tintColor={processedTint} onStickChange={handleStickChange}/>);
66
+ };
67
+ exports.ViroVirtualJoystick = ViroVirtualJoystick;
68
+ if (react_native_1.Platform.OS === "web") {
69
+ // No-op on web; the joystick is a native-only view today.
70
+ // Tracked as a follow-up: HTML/Canvas equivalent for the wasm path.
71
+ }
72
+ exports.default = exports.ViroVirtualJoystick;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * useGameLoop — convenience hook that wraps <ViroGameLoop />.
3
+ *
4
+ * NOTE: This hook does NOT imperatively mount a component. It is designed to
5
+ * be used alongside a <ViroGameLoop> component in the scene. The component
6
+ * fires the events; the hook subscribes to them via a shared ref pattern.
7
+ *
8
+ * For the most common case — one game loop per scene — use <ViroGameLoop>
9
+ * directly with onUpdate/onFixedUpdate props. The hook is provided as
10
+ * syntactic sugar for cases where the callback needs to live deep in the tree.
11
+ *
12
+ * Copyright © 2026 ReactVision. All rights reserved.
13
+ */
14
+ import type { ViroGameLoopUpdateEvent, ViroGameLoopFixedEvent } from "../ViroGameLoop";
15
+ export type UseGameLoopOptions = {
16
+ /** Fixed simulation frequency in Hz. Requires a ViroGameLoop with matching fixedHz. */
17
+ fixedHz?: number;
18
+ };
19
+ /**
20
+ * Subscribe to the variable-step update from the nearest <ViroGameLoop>.
21
+ *
22
+ * The callback is always current (uses a ref internally) so it is safe to
23
+ * reference component state without adding it to a dependency array.
24
+ */
25
+ export declare function useGameLoop(callback: (event: ViroGameLoopUpdateEvent) => void, _options?: UseGameLoopOptions): (event: ViroGameLoopUpdateEvent) => void;
26
+ /**
27
+ * Subscribe to the late-update (post-physics) callback.
28
+ */
29
+ export declare function useLateUpdate(callback: (event: ViroGameLoopUpdateEvent) => void): (event: ViroGameLoopUpdateEvent) => void;
30
+ /**
31
+ * Subscribe to the fixed-step callback.
32
+ * Requires a <ViroGameLoop fixedHz={N}> in the scene.
33
+ */
34
+ export declare function useFixedUpdate(callback: (event: ViroGameLoopFixedEvent) => void): (event: ViroGameLoopFixedEvent) => void;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ /**
3
+ * useGameLoop — convenience hook that wraps <ViroGameLoop />.
4
+ *
5
+ * NOTE: This hook does NOT imperatively mount a component. It is designed to
6
+ * be used alongside a <ViroGameLoop> component in the scene. The component
7
+ * fires the events; the hook subscribes to them via a shared ref pattern.
8
+ *
9
+ * For the most common case — one game loop per scene — use <ViroGameLoop>
10
+ * directly with onUpdate/onFixedUpdate props. The hook is provided as
11
+ * syntactic sugar for cases where the callback needs to live deep in the tree.
12
+ *
13
+ * Copyright © 2026 ReactVision. All rights reserved.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.useGameLoop = useGameLoop;
17
+ exports.useLateUpdate = useLateUpdate;
18
+ exports.useFixedUpdate = useFixedUpdate;
19
+ const react_1 = require("react");
20
+ /**
21
+ * Subscribe to the variable-step update from the nearest <ViroGameLoop>.
22
+ *
23
+ * The callback is always current (uses a ref internally) so it is safe to
24
+ * reference component state without adding it to a dependency array.
25
+ */
26
+ function useGameLoop(callback, _options) {
27
+ const cbRef = (0, react_1.useRef)(callback);
28
+ (0, react_1.useEffect)(() => {
29
+ cbRef.current = callback;
30
+ });
31
+ // Return a stable handler to pass to ViroGameLoop's onUpdate prop
32
+ const handlerRef = (0, react_1.useRef)((event) => {
33
+ cbRef.current(event);
34
+ });
35
+ return handlerRef.current;
36
+ }
37
+ /**
38
+ * Subscribe to the late-update (post-physics) callback.
39
+ */
40
+ function useLateUpdate(callback) {
41
+ const cbRef = (0, react_1.useRef)(callback);
42
+ (0, react_1.useEffect)(() => {
43
+ cbRef.current = callback;
44
+ });
45
+ const handlerRef = (0, react_1.useRef)((event) => {
46
+ cbRef.current(event);
47
+ });
48
+ return handlerRef.current;
49
+ }
50
+ /**
51
+ * Subscribe to the fixed-step callback.
52
+ * Requires a <ViroGameLoop fixedHz={N}> in the scene.
53
+ */
54
+ function useFixedUpdate(callback) {
55
+ const cbRef = (0, react_1.useRef)(callback);
56
+ (0, react_1.useEffect)(() => {
57
+ cbRef.current = callback;
58
+ });
59
+ const handlerRef = (0, react_1.useRef)((event) => {
60
+ cbRef.current(event);
61
+ });
62
+ return handlerRef.current;
63
+ }
package/dist/index.d.ts CHANGED
@@ -24,6 +24,11 @@ import { ViroButton } from "./components/ViroButton";
24
24
  import { ViroCamera } from "./components/ViroCamera";
25
25
  import { ViroARTrackingReasonConstants, ViroRecordingErrorConstants, ViroTrackingStateConstants } from "./components/ViroConstants";
26
26
  import { ViroController } from "./components/ViroController";
27
+ import { ViroVirtualJoystick } from "./components/ViroVirtualJoystick";
28
+ import { ViroVirtualButton } from "./components/ViroVirtualButton";
29
+ import { ViroGameLoop } from "./components/ViroGameLoop";
30
+ import { ViroGameLoopUtils } from "./components/ViroGameLoopUtils";
31
+ import { useGameLoop, useLateUpdate, useFixedUpdate } from "./components/hooks/useGameLoop";
27
32
  import { ViroDirectionalLight } from "./components/ViroDirectionalLight";
28
33
  import { ViroFlexView } from "./components/ViroFlexView";
29
34
  import { ViroGeometry } from "./components/ViroGeometry";
@@ -31,6 +36,10 @@ import { ViroLightingEnvironment } from "./components/ViroLightingEnvironment";
31
36
  import { ViroImage } from "./components/ViroImage";
32
37
  import { ViroMaterials, ViroMaterial, ViroShaderModifiers, ViroShaderUniform, ViroShaderModifier } from "./components/Material/ViroMaterials";
33
38
  import { ViroMaterialVideo } from "./components/ViroMaterialVideo";
39
+ import { ViroCameraTexture } from "./components/ViroCameraTexture";
40
+ export type { ViroCameraPosition, ViroCameraReadyEvent } from "./components/ViroCameraTexture";
41
+ import { ViroObjectDetector } from "./components/ViroObjectDetector";
42
+ export type { ViroDetectorMode, ViroDetectedObject, ViroDetectionBoundingBox, ViroDetectionEvent, ViroDetectorReadyEvent, ViroDetectorErrorEvent } from "./components/ViroObjectDetector";
34
43
  import { ViroNode } from "./components/ViroNode";
35
44
  import { ViroOmniLight } from "./components/ViroOmniLight";
36
45
  import { ViroOrbitCamera } from "./components/ViroOrbitCamera";
@@ -68,7 +77,8 @@ import { ViroQuestEntryPoint } from "./components/ViroQuestEntryPoint";
68
77
  import { VRQuestNavigatorBridge } from "./components/Utilities/VRQuestNavigatorBridge";
69
78
  import { VRModuleOpenXR, useVRViewTag, exitVRScene } from "./components/Utilities/VRModuleOpenXR";
70
79
  import type { VRModuleOpenXRType } from "./components/Utilities/VRModuleOpenXR";
71
- export { ViroARImageMarker, ViroARObjectMarker, ViroARTrackingTargets, ViroARPlane, ViroARPlaneSelector, ViroARScene, ViroARSceneNavigator, ViroBox, ViroButton, ViroCamera, ViroController, ViroDirectionalLight, ViroFlexView, ViroGeometry, ViroLightingEnvironment, ViroImage, ViroMaterials, ViroARCamera, ViroMaterialVideo, ViroNode, ViroOmniLight, ViroOrbitCamera, ViroParticleEmitter, ViroPolygon, ViroPolyline, ViroPortal, ViroPortalScene, ViroQuad, ViroScene, ViroSurface, ViroSceneNavigator, ViroSkyBox, ViroAnimations, Viro3DObject, Viro360Image, Viro360Video, ViroAnimatedImage, ViroAmbientLight, ViroAnimatedComponent, ViroSound, ViroSoundField, ViroSpatialSound, ViroSphere, ViroSpinner, ViroSpotLight, ViroText, ViroVideo, ViroVRSceneNavigator, ViroXRSceneNavigator, ViroQuestEntryPoint, VRQuestNavigatorBridge, VRModuleOpenXR, useVRViewTag, exitVRScene, Viro3DSceneNavigator, hasOpenXRSupport, isQuest, useAnySourceHover, useAnySourcePressed, ViroARTrackingReasonConstants, ViroRecordingErrorConstants, ViroTrackingStateConstants, polarToCartesian, polarToCartesianActual, isARSupportedOnDevice, requestRequiredPermissions, checkPermissions, latLngToMercator, gpsToArWorld, ViroARSupportResponse, ViroPermissionsResult, ViroPermission, ViroHoverEvent, ViroClickEvent, ViroClickStateEvent, ViroClickStateTypes, ViroTouchEvent, ViroScrollEvent, ViroSwipeEvent, ViroFuseEvent, ViroPinchEvent, ViroPinchStateTypes, ViroRotateEvent, ViroRotateStateTypes, ViroDragEvent, ViroPlatformEvent, ViroCollisionEvent, ViroPlatformInfo, ViroCameraTransformEvent, ViroPlatformUpdateEvent, ViroCameraTransform, ViroExitViroEvent, ViroErrorEvent, ViroAnimationStartEvent, ViroAnimationFinishEvent, ViroLoadStartEvent, ViroLoadEndEvent, ViroLoadErrorEvent, ViroVideoBufferStartEvent, ViroVideoBufferEndEvent, ViroVideoUpdateTimeEvent, ViroVideoErrorEvent, ViroVideoFinishEvent, ViroAnimatedComponentStartEvent, ViroAnimatedComponentFinishEvent, ViroARAnchorRemovedEvent, ViroARAnchorUpdatedEvent, ViroARAnchorFoundEvent, ViroAnchor, ViroAnchorFoundMap, ViroAnchorUpdatedMap, ViroPlaneUpdatedMap, ViroPlaneUpdatedEvent, ViroARPlaneSizes, ViroCameraARHitTestEvent, ViroCameraARHitTest, ViroARHitTestResult, ViroARPointCloudUpdateEvent, ViroARPointCloud, ViroTrackingUpdatedEvent, ViroTrackingState, ViroTrackingReason, ViroAmbientLightUpdateEvent, ViroAmbientLightInfo, ViroWorldOrigin, ViroNativeTransformUpdateEvent, ViroControllerStatusEvent, ViroControllerStatus, ViroPortalEnterEvent, ViroPortalExitEvent, ViroSoundFinishEvent, ViroTextStyle, ViroStyle, ViroMaterial, ViroShaderModifiers, ViroShaderUniform, ViroShaderModifier, VIRO_VERSION, ViroProvider, ViroCloudAnchorState, ViroCloudAnchorProvider, ViroCloudAnchor, ViroHostCloudAnchorResult, ViroResolveCloudAnchorResult, ViroCloudAnchorStateChangeEvent, ViroGeospatialAnchorProvider, ViroEarthTrackingState, ViroVPSAvailability, ViroGeospatialAnchorType, ViroQuaternion, ViroGeospatialPose, ViroGeospatialAnchor, ViroGeospatialSupportResult, ViroEarthTrackingStateResult, ViroGeospatialPoseResult, ViroVPSAvailabilityResult, ViroCreateGeospatialAnchorResult, ViroMonocularDepthSupportResult, ViroMonocularDepthModelAvailableResult, ViroMonocularDepthPreferenceResult, ViroJoint, ViroHandJoints, ViroHandPinchEvent, ViroHandUpdateEvent, StudioSceneNavigator, StudioARScene, ViroVisionOSModule, isVisionOS, enterImmersiveSpace, exitImmersiveSpace, };
80
+ import { StreamingAudioManager } from "./components/Utilities/StreamingAudioManager";
81
+ export { ViroARImageMarker, ViroARObjectMarker, ViroARTrackingTargets, ViroARPlane, ViroARPlaneSelector, ViroARScene, ViroARSceneNavigator, ViroBox, ViroButton, ViroCamera, ViroController, ViroVirtualJoystick, ViroVirtualButton, ViroGameLoop, ViroGameLoopUtils, useGameLoop, useLateUpdate, useFixedUpdate, ViroDirectionalLight, ViroFlexView, ViroGeometry, ViroLightingEnvironment, ViroImage, ViroMaterials, ViroARCamera, ViroMaterialVideo, ViroCameraTexture, ViroObjectDetector, ViroNode, ViroOmniLight, ViroOrbitCamera, ViroParticleEmitter, ViroPolygon, ViroPolyline, ViroPortal, ViroPortalScene, ViroQuad, ViroScene, ViroSurface, ViroSceneNavigator, ViroSkyBox, ViroAnimations, Viro3DObject, Viro360Image, Viro360Video, ViroAnimatedImage, ViroAmbientLight, ViroAnimatedComponent, ViroSound, ViroSoundField, ViroSpatialSound, ViroSphere, ViroSpinner, ViroSpotLight, ViroText, ViroVideo, ViroVRSceneNavigator, ViroXRSceneNavigator, ViroQuestEntryPoint, VRQuestNavigatorBridge, VRModuleOpenXR, useVRViewTag, exitVRScene, Viro3DSceneNavigator, StreamingAudioManager, hasOpenXRSupport, isQuest, useAnySourceHover, useAnySourcePressed, ViroARTrackingReasonConstants, ViroRecordingErrorConstants, ViroTrackingStateConstants, polarToCartesian, polarToCartesianActual, isARSupportedOnDevice, requestRequiredPermissions, checkPermissions, latLngToMercator, gpsToArWorld, ViroARSupportResponse, ViroPermissionsResult, ViroPermission, ViroHoverEvent, ViroClickEvent, ViroClickStateEvent, ViroClickStateTypes, ViroTouchEvent, ViroScrollEvent, ViroSwipeEvent, ViroFuseEvent, ViroPinchEvent, ViroPinchStateTypes, ViroRotateEvent, ViroRotateStateTypes, ViroDragEvent, ViroPlatformEvent, ViroCollisionEvent, ViroPlatformInfo, ViroCameraTransformEvent, ViroPlatformUpdateEvent, ViroCameraTransform, ViroExitViroEvent, ViroErrorEvent, ViroAnimationStartEvent, ViroAnimationFinishEvent, ViroLoadStartEvent, ViroLoadEndEvent, ViroLoadErrorEvent, ViroVideoBufferStartEvent, ViroVideoBufferEndEvent, ViroVideoUpdateTimeEvent, ViroVideoErrorEvent, ViroVideoFinishEvent, ViroAnimatedComponentStartEvent, ViroAnimatedComponentFinishEvent, ViroARAnchorRemovedEvent, ViroARAnchorUpdatedEvent, ViroARAnchorFoundEvent, ViroAnchor, ViroAnchorFoundMap, ViroAnchorUpdatedMap, ViroPlaneUpdatedMap, ViroPlaneUpdatedEvent, ViroARPlaneSizes, ViroCameraARHitTestEvent, ViroCameraARHitTest, ViroARHitTestResult, ViroARPointCloudUpdateEvent, ViroARPointCloud, ViroTrackingUpdatedEvent, ViroTrackingState, ViroTrackingReason, ViroAmbientLightUpdateEvent, ViroAmbientLightInfo, ViroWorldOrigin, ViroNativeTransformUpdateEvent, ViroControllerStatusEvent, ViroControllerStatus, ViroPortalEnterEvent, ViroPortalExitEvent, ViroSoundFinishEvent, ViroTextStyle, ViroStyle, ViroMaterial, ViroShaderModifiers, ViroShaderUniform, ViroShaderModifier, VIRO_VERSION, ViroProvider, ViroCloudAnchorState, ViroCloudAnchorProvider, ViroCloudAnchor, ViroHostCloudAnchorResult, ViroResolveCloudAnchorResult, ViroCloudAnchorStateChangeEvent, ViroGeospatialAnchorProvider, ViroEarthTrackingState, ViroVPSAvailability, ViroGeospatialAnchorType, ViroQuaternion, ViroGeospatialPose, ViroGeospatialAnchor, ViroGeospatialSupportResult, ViroEarthTrackingStateResult, ViroGeospatialPoseResult, ViroVPSAvailabilityResult, ViroCreateGeospatialAnchorResult, ViroMonocularDepthSupportResult, ViroMonocularDepthModelAvailableResult, ViroMonocularDepthPreferenceResult, ViroJoint, ViroHandJoints, ViroHandPinchEvent, ViroHandUpdateEvent, StudioSceneNavigator, StudioARScene, ViroVisionOSModule, isVisionOS, enterImmersiveSpace, exitImmersiveSpace, };
72
82
  export type { VRModuleOpenXRType };
73
83
  export type { ImmersiveSpaceStyle } from "./components/VisionOS/ViroVisionOSModule";
74
84
  export type { StudioSceneResponse, StudioAsset, StudioAnimation, StudioCollisionBinding, StudioSceneFunction, StudioSceneMeta, StudioProjectMeta, } from "./components/Studio";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ViroQuestEntryPoint = exports.ViroXRSceneNavigator = exports.ViroVRSceneNavigator = exports.ViroVideo = exports.ViroText = exports.ViroSpotLight = exports.ViroSpinner = exports.ViroSphere = exports.ViroSpatialSound = exports.ViroSoundField = exports.ViroSound = exports.ViroAnimatedComponent = exports.ViroAmbientLight = exports.ViroAnimatedImage = exports.Viro360Video = exports.Viro360Image = exports.Viro3DObject = exports.ViroAnimations = exports.ViroSkyBox = exports.ViroSceneNavigator = exports.ViroSurface = exports.ViroScene = exports.ViroQuad = exports.ViroPortalScene = exports.ViroPortal = exports.ViroPolyline = exports.ViroPolygon = exports.ViroParticleEmitter = exports.ViroOrbitCamera = exports.ViroOmniLight = exports.ViroNode = exports.ViroMaterialVideo = exports.ViroARCamera = exports.ViroMaterials = exports.ViroImage = exports.ViroLightingEnvironment = exports.ViroGeometry = exports.ViroFlexView = exports.ViroDirectionalLight = exports.ViroController = exports.ViroCamera = exports.ViroButton = exports.ViroBox = exports.ViroARSceneNavigator = exports.ViroARScene = exports.ViroARPlaneSelector = exports.ViroARPlane = exports.ViroARTrackingTargets = exports.ViroARObjectMarker = exports.ViroARImageMarker = void 0;
4
- exports.exitImmersiveSpace = exports.enterImmersiveSpace = exports.isVisionOS = exports.ViroVisionOSModule = exports.StudioARScene = exports.StudioSceneNavigator = exports.VIRO_VERSION = exports.ViroRotateStateTypes = exports.ViroPinchStateTypes = exports.ViroClickStateTypes = exports.gpsToArWorld = exports.latLngToMercator = exports.checkPermissions = exports.requestRequiredPermissions = exports.isARSupportedOnDevice = exports.polarToCartesianActual = exports.polarToCartesian = exports.ViroTrackingStateConstants = exports.ViroRecordingErrorConstants = exports.ViroARTrackingReasonConstants = exports.useAnySourcePressed = exports.useAnySourceHover = exports.isQuest = exports.hasOpenXRSupport = exports.Viro3DSceneNavigator = exports.exitVRScene = exports.useVRViewTag = exports.VRModuleOpenXR = exports.VRQuestNavigatorBridge = void 0;
3
+ exports.ViroSoundField = exports.ViroSound = exports.ViroAnimatedComponent = exports.ViroAmbientLight = exports.ViroAnimatedImage = exports.Viro360Video = exports.Viro360Image = exports.Viro3DObject = exports.ViroAnimations = exports.ViroSkyBox = exports.ViroSceneNavigator = exports.ViroSurface = exports.ViroScene = exports.ViroQuad = exports.ViroPortalScene = exports.ViroPortal = exports.ViroPolyline = exports.ViroPolygon = exports.ViroParticleEmitter = exports.ViroOrbitCamera = exports.ViroOmniLight = exports.ViroNode = exports.ViroObjectDetector = exports.ViroCameraTexture = exports.ViroMaterialVideo = exports.ViroARCamera = exports.ViroMaterials = exports.ViroImage = exports.ViroLightingEnvironment = exports.ViroGeometry = exports.ViroFlexView = exports.ViroDirectionalLight = exports.useFixedUpdate = exports.useLateUpdate = exports.useGameLoop = exports.ViroGameLoopUtils = exports.ViroGameLoop = exports.ViroVirtualButton = exports.ViroVirtualJoystick = exports.ViroController = exports.ViroCamera = exports.ViroButton = exports.ViroBox = exports.ViroARSceneNavigator = exports.ViroARScene = exports.ViroARPlaneSelector = exports.ViroARPlane = exports.ViroARTrackingTargets = exports.ViroARObjectMarker = exports.ViroARImageMarker = void 0;
4
+ exports.exitImmersiveSpace = exports.enterImmersiveSpace = exports.isVisionOS = exports.ViroVisionOSModule = exports.StudioARScene = exports.StudioSceneNavigator = exports.VIRO_VERSION = exports.ViroRotateStateTypes = exports.ViroPinchStateTypes = exports.ViroClickStateTypes = exports.gpsToArWorld = exports.latLngToMercator = exports.checkPermissions = exports.requestRequiredPermissions = exports.isARSupportedOnDevice = exports.polarToCartesianActual = exports.polarToCartesian = exports.ViroTrackingStateConstants = exports.ViroRecordingErrorConstants = exports.ViroARTrackingReasonConstants = exports.useAnySourcePressed = exports.useAnySourceHover = exports.isQuest = exports.hasOpenXRSupport = exports.StreamingAudioManager = exports.Viro3DSceneNavigator = exports.exitVRScene = exports.useVRViewTag = exports.VRModuleOpenXR = exports.VRQuestNavigatorBridge = exports.ViroQuestEntryPoint = exports.ViroXRSceneNavigator = exports.ViroVRSceneNavigator = exports.ViroVideo = exports.ViroText = exports.ViroSpotLight = exports.ViroSpinner = exports.ViroSphere = exports.ViroSpatialSound = void 0;
5
5
  /**
6
6
  * Copyright (c) 2016-present, Viro Media, Inc.
7
7
  * All rights reserved.
@@ -55,6 +55,18 @@ Object.defineProperty(exports, "ViroRecordingErrorConstants", { enumerable: true
55
55
  Object.defineProperty(exports, "ViroTrackingStateConstants", { enumerable: true, get: function () { return ViroConstants_1.ViroTrackingStateConstants; } });
56
56
  const ViroController_1 = require("./components/ViroController");
57
57
  Object.defineProperty(exports, "ViroController", { enumerable: true, get: function () { return ViroController_1.ViroController; } });
58
+ const ViroVirtualJoystick_1 = require("./components/ViroVirtualJoystick");
59
+ Object.defineProperty(exports, "ViroVirtualJoystick", { enumerable: true, get: function () { return ViroVirtualJoystick_1.ViroVirtualJoystick; } });
60
+ const ViroVirtualButton_1 = require("./components/ViroVirtualButton");
61
+ Object.defineProperty(exports, "ViroVirtualButton", { enumerable: true, get: function () { return ViroVirtualButton_1.ViroVirtualButton; } });
62
+ const ViroGameLoop_1 = require("./components/ViroGameLoop");
63
+ Object.defineProperty(exports, "ViroGameLoop", { enumerable: true, get: function () { return ViroGameLoop_1.ViroGameLoop; } });
64
+ const ViroGameLoopUtils_1 = require("./components/ViroGameLoopUtils");
65
+ Object.defineProperty(exports, "ViroGameLoopUtils", { enumerable: true, get: function () { return ViroGameLoopUtils_1.ViroGameLoopUtils; } });
66
+ const useGameLoop_1 = require("./components/hooks/useGameLoop");
67
+ Object.defineProperty(exports, "useGameLoop", { enumerable: true, get: function () { return useGameLoop_1.useGameLoop; } });
68
+ Object.defineProperty(exports, "useLateUpdate", { enumerable: true, get: function () { return useGameLoop_1.useLateUpdate; } });
69
+ Object.defineProperty(exports, "useFixedUpdate", { enumerable: true, get: function () { return useGameLoop_1.useFixedUpdate; } });
58
70
  const ViroDirectionalLight_1 = require("./components/ViroDirectionalLight");
59
71
  Object.defineProperty(exports, "ViroDirectionalLight", { enumerable: true, get: function () { return ViroDirectionalLight_1.ViroDirectionalLight; } });
60
72
  const ViroFlexView_1 = require("./components/ViroFlexView");
@@ -69,6 +81,10 @@ const ViroMaterials_1 = require("./components/Material/ViroMaterials");
69
81
  Object.defineProperty(exports, "ViroMaterials", { enumerable: true, get: function () { return ViroMaterials_1.ViroMaterials; } });
70
82
  const ViroMaterialVideo_1 = require("./components/ViroMaterialVideo");
71
83
  Object.defineProperty(exports, "ViroMaterialVideo", { enumerable: true, get: function () { return ViroMaterialVideo_1.ViroMaterialVideo; } });
84
+ const ViroCameraTexture_1 = require("./components/ViroCameraTexture");
85
+ Object.defineProperty(exports, "ViroCameraTexture", { enumerable: true, get: function () { return ViroCameraTexture_1.ViroCameraTexture; } });
86
+ const ViroObjectDetector_1 = require("./components/ViroObjectDetector");
87
+ Object.defineProperty(exports, "ViroObjectDetector", { enumerable: true, get: function () { return ViroObjectDetector_1.ViroObjectDetector; } });
72
88
  const ViroNode_1 = require("./components/ViroNode");
73
89
  Object.defineProperty(exports, "ViroNode", { enumerable: true, get: function () { return ViroNode_1.ViroNode; } });
74
90
  const ViroOmniLight_1 = require("./components/ViroOmniLight");
@@ -148,6 +164,8 @@ const VRModuleOpenXR_1 = require("./components/Utilities/VRModuleOpenXR");
148
164
  Object.defineProperty(exports, "VRModuleOpenXR", { enumerable: true, get: function () { return VRModuleOpenXR_1.VRModuleOpenXR; } });
149
165
  Object.defineProperty(exports, "useVRViewTag", { enumerable: true, get: function () { return VRModuleOpenXR_1.useVRViewTag; } });
150
166
  Object.defineProperty(exports, "exitVRScene", { enumerable: true, get: function () { return VRModuleOpenXR_1.exitVRScene; } });
167
+ const StreamingAudioManager_1 = require("./components/Utilities/StreamingAudioManager");
168
+ Object.defineProperty(exports, "StreamingAudioManager", { enumerable: true, get: function () { return StreamingAudioManager_1.StreamingAudioManager; } });
151
169
  const react_native_1 = require("react-native");
152
170
  // Auto-register the Quest VR entry point. VRActivity launches this component
153
171
  // as 'VRQuestScene'. Registering here means apps need no manual setup.
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEFAULTS = void 0;
4
- const config_plugins_1 = require("@expo/config-plugins");
5
4
  const withViroAndroid_1 = require("./withViroAndroid");
6
5
  const withViroIos_1 = require("./withViroIos");
7
6
  const CAMERA_USAGE = "Allow $(PRODUCT_NAME) to use your camera";
@@ -34,20 +33,8 @@ exports.DEFAULTS = {
34
33
  * @returns expo configuration
35
34
  */
36
35
  const withViro = (config, props) => {
37
- // Validate New Architecture is enabled
38
- const newArchEnabled = config.plugins?.some((plugin) => Array.isArray(plugin) &&
39
- plugin[0] === "expo-dev-client" &&
40
- plugin[1]?.newArchEnabled === true) || config.newArchEnabled === true;
41
- if (!newArchEnabled) {
42
- config_plugins_1.WarningAggregator.addWarningAndroid("withViro", "ViroReact requires React Native New Architecture (Fabric) to be enabled. " +
43
- "Please enable New Architecture in your app configuration. " +
44
- 'Add "newArchEnabled": true to your app.json/app.config.js expo configuration, ' +
45
- "or ensure your React Native project has New Architecture enabled.");
46
- config_plugins_1.WarningAggregator.addWarningIOS("withViro", "ViroReact requires React Native New Architecture (Fabric) to be enabled. " +
47
- "Please enable New Architecture in your app configuration. " +
48
- 'Add "newArchEnabled": true to your app.json/app.config.js expo configuration, ' +
49
- "or ensure your React Native project has New Architecture enabled.");
50
- }
36
+ // New Architecture is the only architecture in Expo SDK 53+ (and the React
37
+ // Native versions ViroReact supports), so there is nothing to validate here.
51
38
  // Apply platform-specific configurations
52
39
  config = (0, withViroIos_1.withViroIos)(config, props);
53
40
  config = (0, withViroAndroid_1.withViroAndroid)(config, props);