@reactvision/react-viro 2.57.0 → 2.57.2

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 (91) hide show
  1. package/android/react_viro/react_viro-release.aar +0 -0
  2. package/android/viro_renderer/viro_renderer-release.aar +0 -0
  3. package/components/AR/ViroARPlane.tsx +1 -4
  4. package/components/AR/ViroARPlaneSelector.tsx +10 -5
  5. package/components/AR/ViroARScene.tsx +2 -4
  6. package/components/Studio/StudioARScene.tsx +243 -48
  7. package/components/Studio/StudioSceneNavigator.tsx +15 -0
  8. package/components/Studio/VRTStudioModule.ts +10 -0
  9. package/components/Studio/domain/StudioSounds.tsx +46 -0
  10. package/components/Studio/domain/apiRequestHelpers.ts +612 -0
  11. package/components/Studio/domain/collisionBindingsRuntime.ts +17 -2
  12. package/components/Studio/domain/defaultApiRequestExecutor.ts +61 -0
  13. package/components/Studio/domain/expressionEvaluator.ts +603 -0
  14. package/components/Studio/domain/sceneNavigationHandler.ts +770 -20
  15. package/components/Studio/domain/soundManager.ts +141 -0
  16. package/components/Studio/domain/utils.ts +50 -0
  17. package/components/Studio/domain/variableStore.ts +74 -0
  18. package/components/Studio/domain/viroNodeFactory.tsx +175 -44
  19. package/components/Studio/domain/visibilityStore.ts +66 -0
  20. package/components/Studio/index.ts +1 -0
  21. package/components/Studio/types.ts +178 -1
  22. package/components/Utilities/VRModuleOpenXR.ts +35 -0
  23. package/components/Utilities/ViroVersion.ts +1 -1
  24. package/components/ViroAnimatedImage.tsx +1 -0
  25. package/components/ViroFlexView.tsx +1 -0
  26. package/components/ViroImage.tsx +1 -0
  27. package/components/ViroObjectDetector.tsx +13 -5
  28. package/components/ViroParticleEmitter.tsx +2 -0
  29. package/components/ViroPolygon.tsx +2 -1
  30. package/components/ViroQuad.tsx +2 -1
  31. package/components/ViroSurface.tsx +1 -0
  32. package/components/ViroVideo.tsx +1 -0
  33. package/components/ViroXRSceneNavigator.tsx +8 -0
  34. package/dist/components/AR/ViroARPlane.d.ts +1 -1
  35. package/dist/components/AR/ViroARPlane.js +1 -5
  36. package/dist/components/AR/ViroARPlaneSelector.d.ts +1 -1
  37. package/dist/components/AR/ViroARPlaneSelector.js +10 -5
  38. package/dist/components/AR/ViroARScene.d.ts +1 -1
  39. package/dist/components/AR/ViroARScene.js +2 -5
  40. package/dist/components/Studio/StudioARScene.d.ts +3 -0
  41. package/dist/components/Studio/StudioARScene.js +142 -15
  42. package/dist/components/Studio/StudioSceneNavigator.js +14 -0
  43. package/dist/components/Studio/VRTStudioModule.d.ts +6 -0
  44. package/dist/components/Studio/VRTStudioModule.js +10 -0
  45. package/dist/components/Studio/domain/StudioSounds.d.ts +11 -0
  46. package/dist/components/Studio/domain/StudioSounds.js +69 -0
  47. package/dist/components/Studio/domain/apiRequestHelpers.d.ts +180 -0
  48. package/dist/components/Studio/domain/apiRequestHelpers.js +496 -0
  49. package/dist/components/Studio/domain/collisionBindingsRuntime.d.ts +3 -1
  50. package/dist/components/Studio/domain/collisionBindingsRuntime.js +4 -3
  51. package/dist/components/Studio/domain/defaultApiRequestExecutor.d.ts +14 -0
  52. package/dist/components/Studio/domain/defaultApiRequestExecutor.js +58 -0
  53. package/dist/components/Studio/domain/expressionEvaluator.d.ts +108 -0
  54. package/dist/components/Studio/domain/expressionEvaluator.js +520 -0
  55. package/dist/components/Studio/domain/sceneNavigationHandler.d.ts +35 -8
  56. package/dist/components/Studio/domain/sceneNavigationHandler.js +564 -22
  57. package/dist/components/Studio/domain/soundManager.d.ts +52 -0
  58. package/dist/components/Studio/domain/soundManager.js +118 -0
  59. package/dist/components/Studio/domain/utils.d.ts +16 -0
  60. package/dist/components/Studio/domain/utils.js +48 -0
  61. package/dist/components/Studio/domain/variableStore.d.ts +21 -0
  62. package/dist/components/Studio/domain/variableStore.js +65 -0
  63. package/dist/components/Studio/domain/viroNodeFactory.d.ts +4 -9
  64. package/dist/components/Studio/domain/viroNodeFactory.js +84 -25
  65. package/dist/components/Studio/domain/visibilityStore.d.ts +33 -0
  66. package/dist/components/Studio/domain/visibilityStore.js +66 -0
  67. package/dist/components/Studio/index.d.ts +1 -1
  68. package/dist/components/Studio/types.d.ts +150 -1
  69. package/dist/components/Utilities/VRModuleOpenXR.d.ts +19 -0
  70. package/dist/components/Utilities/VRModuleOpenXR.js +16 -0
  71. package/dist/components/Utilities/ViroVersion.d.ts +1 -1
  72. package/dist/components/Utilities/ViroVersion.js +1 -1
  73. package/dist/components/ViroAnimatedImage.js +1 -0
  74. package/dist/components/ViroFlexView.js +1 -0
  75. package/dist/components/ViroImage.js +1 -0
  76. package/dist/components/ViroObjectDetector.d.ts +13 -5
  77. package/dist/components/ViroObjectDetector.js +13 -5
  78. package/dist/components/ViroParticleEmitter.js +2 -0
  79. package/dist/components/ViroPolygon.js +1 -0
  80. package/dist/components/ViroQuad.js +1 -0
  81. package/dist/components/ViroSurface.js +1 -0
  82. package/dist/components/ViroVideo.js +1 -0
  83. package/dist/components/ViroXRSceneNavigator.d.ts +8 -0
  84. package/dist/index.d.ts +4 -4
  85. package/dist/index.js +2 -1
  86. package/dist/plugins/withViroAndroid.js +18 -0
  87. package/index.ts +4 -3
  88. package/ios/dist/ViroRenderer/ViroKit.framework/Info.plist +0 -0
  89. package/ios/dist/ViroRenderer/ViroKit.framework/Shaders.dat +1 -1
  90. package/ios/dist/lib/libViroReact.a +0 -0
  91. package/package.json +1 -1
@@ -18,13 +18,131 @@ export interface StudioProjectMeta {
18
18
  id: string;
19
19
  occlusion_mode: "NONE" | "PEOPLEONLY" | "DEPTHBASED";
20
20
  }
21
+ /**
22
+ * One ordered step of a Sequence: an ACTION (runs a function), a WAIT (timed
23
+ * pause), or a STOP (explicit terminal — the run halts here).
24
+ */
25
+ export interface StudioSequenceStep {
26
+ id: string;
27
+ step_order: number;
28
+ step_type: "ACTION" | "WAIT" | "STOP";
29
+ duration_ms: number | null;
30
+ function_id: string | null;
31
+ function: StudioSceneFunction | null;
32
+ advance_immediately: boolean;
33
+ }
34
+ export interface StudioSequence {
35
+ id: string;
36
+ name: string | null;
37
+ steps: StudioSequenceStep[];
38
+ }
39
+ /** Scene-level variable declaration. Runtime state lives in StudioVariableStore. */
40
+ export interface StudioSceneVariable {
41
+ id: string;
42
+ name: string;
43
+ type: "BOOLEAN" | "NUMBER" | "STRING";
44
+ initial_value: boolean | number | string;
45
+ }
46
+ /**
47
+ * One ordered predicate arm of a BRANCH. Variable names/types are joined from
48
+ * project_variables so they follow renames. The arm is an owned, headless
49
+ * sequence run like a nested sequence.
50
+ */
51
+ export interface StudioBranchCondition {
52
+ id: string;
53
+ eval_order: number;
54
+ variable_id: string;
55
+ variable_name: string;
56
+ variable_type: "BOOLEAN" | "NUMBER" | "STRING";
57
+ comparison: "EQUALS" | "NOT_EQUALS" | "GREATER_THAN" | "LESS_THAN" | "GREATER_OR_EQUAL" | "LESS_OR_EQUAL" | "LIKE" | "ILIKE";
58
+ compare_literal: boolean | number | string | null;
59
+ compare_variable_id: string | null;
60
+ compare_variable_name: string | null;
61
+ compare_variable_type: "BOOLEAN" | "NUMBER" | "STRING" | null;
62
+ sequence: StudioSequence;
63
+ }
64
+ /**
65
+ * BRANCH payload. Conditions are evaluated in eval_order (first match wins),
66
+ * falling through to the optional no-match arm. Arms are owned, headless
67
+ * sequences run like nested sequences.
68
+ */
69
+ export interface StudioSceneBranch {
70
+ id: string;
71
+ conditions: StudioBranchCondition[];
72
+ no_match_sequence: StudioSequence | null;
73
+ }
74
+ /**
75
+ * GROUP payload. Owns N lanes, each an owned headless sequence run like a
76
+ * nested sequence. Lanes run concurrently; the group completes when all lanes
77
+ * complete (barrier join).
78
+ */
79
+ export interface StudioSceneGroup {
80
+ id: string;
81
+ lanes: {
82
+ lane_order: number;
83
+ sequence: StudioSequence;
84
+ }[];
85
+ }
86
+ /** One response->variable binding of an API_REQUEST function. */
87
+ export interface StudioApiRequestBinding {
88
+ id: string;
89
+ source: "BODY" | "STATUS" | "OK" | "ERROR_MESSAGE";
90
+ selector: string | null;
91
+ variable_id: string;
92
+ variable_name: string;
93
+ variable_type: "BOOLEAN" | "NUMBER" | "STRING";
94
+ bind_order: number;
95
+ }
96
+ /**
97
+ * API_REQUEST payload. The HTTP call executes server-side through the
98
+ * platform egress proxy (the client only ever sends the function id plus
99
+ * current variable values); connection_id is an opaque server-side
100
+ * reference. Arms are owned, headless sequences run like nested sequences.
101
+ */
102
+ export interface StudioSceneApiRequest {
103
+ id: string;
104
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
105
+ url_template: string;
106
+ headers: {
107
+ key: string;
108
+ value_template: string;
109
+ }[];
110
+ body_template: string | null;
111
+ timeout_ms: number;
112
+ connection_id: string | null;
113
+ bindings: StudioApiRequestBinding[];
114
+ success_sequence: StudioSequence | null;
115
+ failure_sequence: StudioSequence | null;
116
+ }
117
+ /** Outcome envelope an API-request executor resolves with. */
118
+ export interface StudioApiRequestOutcome {
119
+ ok: boolean;
120
+ status: number | null;
121
+ body?: unknown;
122
+ error_code?: string | null;
123
+ error_message?: string | null;
124
+ }
125
+ /**
126
+ * Host-app transport for API_REQUEST functions: StudioGo calls the
127
+ * scene-api-request edge function with the user JWT; production Viro apps
128
+ * call it with their X-API-Key. Must resolve with an outcome (reject only on
129
+ * transport failure).
130
+ */
131
+ export type StudioApiRequestExecutor = (functionId: string, variables: Record<string, boolean | number | string>) => Promise<StudioApiRequestOutcome>;
21
132
  export interface StudioSceneFunction {
22
133
  id: string;
23
134
  scene: string;
24
- function_type: "NAVIGATION" | "ALERT" | "ANIMATION";
135
+ function_type: "NAVIGATION" | "ALERT" | "ANIMATION" | "SEQUENCE" | "SET_VARIABLE" | "BRANCH" | "API_REQUEST" | "SET_VISIBILITY" | "SOUND" | "GROUP";
25
136
  navigation: string | null;
26
137
  alert: string | null;
27
138
  animation: string | null;
139
+ sequence: string | null;
140
+ set_variable: string | null;
141
+ branch: string | null;
142
+ api_request: string | null;
143
+ set_visibility: string | null;
144
+ sound: string | null;
145
+ group_fn: string | null;
28
146
  scene_navigation: {
29
147
  id: string;
30
148
  navigate_to: string;
@@ -41,6 +159,33 @@ export interface StudioSceneFunction {
41
159
  delay_ms: number | null;
42
160
  properties: Record<string, unknown>;
43
161
  } | null;
162
+ scene_sequence: StudioSequence | null;
163
+ /** name/type are joined from the target scene_variables row, so they follow renames. */
164
+ scene_set_variable: {
165
+ id: string;
166
+ variable_id: string;
167
+ name: string;
168
+ type: "BOOLEAN" | "NUMBER" | "STRING";
169
+ expression: string;
170
+ } | null;
171
+ scene_branch: StudioSceneBranch | null;
172
+ scene_api_request: StudioSceneApiRequest | null;
173
+ scene_set_visibility: {
174
+ id: string;
175
+ target_asset_id: string;
176
+ state: "VISIBLE" | "HIDDEN" | "TOGGLE";
177
+ } | null;
178
+ scene_sound: {
179
+ id: string;
180
+ action: "PLAY" | "STOP";
181
+ audio_asset_id: string | null;
182
+ audio_url: string | null;
183
+ target_asset_id: string | null;
184
+ volume: number;
185
+ loop: boolean;
186
+ stop_other_sounds: boolean;
187
+ } | null;
188
+ scene_group: StudioSceneGroup | null;
44
189
  }
45
190
  export interface StudioAsset {
46
191
  id: string;
@@ -59,6 +204,8 @@ export interface StudioAsset {
59
204
  latitude: number | null;
60
205
  longitude: number | null;
61
206
  is_draggable: boolean;
207
+ /** Author-time "hidden on start"; the runtime seeds visibility from it. */
208
+ hidden_on_load: boolean | null;
62
209
  trigger_image_url: string | null;
63
210
  trigger_image_orientation: "Up" | "Down" | "Left" | "Right" | null;
64
211
  trigger_image_physical_width_m: number | null;
@@ -133,6 +280,8 @@ export interface StudioSceneResponse {
133
280
  collision_bindings: StudioCollisionBinding[];
134
281
  animations: StudioAnimation[];
135
282
  functions: StudioSceneFunction[];
283
+ /** Absent in responses from backends predating the Variables feature. */
284
+ variables?: StudioSceneVariable[];
136
285
  meta: {
137
286
  request_id: string;
138
287
  };
@@ -6,7 +6,26 @@ export declare function exitVRScene(): void;
6
6
  export type VRModuleOpenXRType = {
7
7
  recenterTracking?: (viewTag: number) => void;
8
8
  setPassthroughEnabled?: (viewTag: number, enabled: boolean) => void;
9
+ setPassthroughStyle?: (viewTag: number, opacity: number, edgeR: number, edgeG: number, edgeB: number, edgeA: number) => void;
9
10
  };
11
+ /** Options for {@link setPassthroughStyle}. All channels are normalized [0,1]. */
12
+ export type ViroPassthroughStyle = {
13
+ /** Texture opacity factor [0,1]. Default 1 (fully opaque passthrough). */
14
+ opacity?: number;
15
+ /** Edge-highlight colour [r,g,b,a]. Alpha 0 (default) disables the edge effect. */
16
+ edgeColor?: [number, number, number, number];
17
+ };
18
+ /**
19
+ * Style the Quest passthrough layer (XR_FB_passthrough). No-op off-Quest.
20
+ *
21
+ * ```tsx
22
+ * const viewTag = useVRViewTag();
23
+ * if (viewTag != null) {
24
+ * setPassthroughStyle(viewTag, { opacity: 0.8, edgeColor: [0, 1, 1, 1] });
25
+ * }
26
+ * ```
27
+ */
28
+ export declare function setPassthroughStyle(viewTag: number, style: ViroPassthroughStyle): void;
10
29
  /**
11
30
  * Typed reference to the VRModuleOpenXR native module.
12
31
  * undefined when not running on Meta Quest (no-op calls are safe via optional chaining).
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VRModuleOpenXR = void 0;
4
4
  exports.exitVRScene = exitVRScene;
5
+ exports.setPassthroughStyle = setPassthroughStyle;
5
6
  exports.useVRViewTag = useVRViewTag;
6
7
  const react_1 = require("react");
7
8
  const react_native_1 = require("react-native");
@@ -15,6 +16,21 @@ function exitVRScene() {
15
16
  react_native_1.NativeModules.VRLauncher
16
17
  ?.exitVRScene?.();
17
18
  }
19
+ /**
20
+ * Style the Quest passthrough layer (XR_FB_passthrough). No-op off-Quest.
21
+ *
22
+ * ```tsx
23
+ * const viewTag = useVRViewTag();
24
+ * if (viewTag != null) {
25
+ * setPassthroughStyle(viewTag, { opacity: 0.8, edgeColor: [0, 1, 1, 1] });
26
+ * }
27
+ * ```
28
+ */
29
+ function setPassthroughStyle(viewTag, style) {
30
+ const opacity = style.opacity ?? 1;
31
+ const [r, g, b, a] = style.edgeColor ?? [0, 0, 0, 0];
32
+ exports.VRModuleOpenXR?.setPassthroughStyle?.(viewTag, opacity, r, g, b, a);
33
+ }
18
34
  /**
19
35
  * Typed reference to the VRModuleOpenXR native module.
20
36
  * undefined when not running on Meta Quest (no-op calls are safe via optional chaining).
@@ -1 +1 @@
1
- export declare const VIRO_VERSION = "2.57.0";
1
+ export declare const VIRO_VERSION = "2.57.2";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VIRO_VERSION = void 0;
4
- exports.VIRO_VERSION = "2.57.0";
4
+ exports.VIRO_VERSION = "2.57.2";
@@ -110,6 +110,7 @@ class ViroAnimatedImage extends ViroBase_1.ViroBase {
110
110
  nativeProps.style = [this.props.style];
111
111
  nativeProps.onHoverViro = this._onHover;
112
112
  nativeProps.onClickViro = this._onClickState;
113
+ nativeProps.onClick = undefined;
113
114
  nativeProps.onTouchViro = this._onTouch;
114
115
  nativeProps.onScrollViro = this._onScroll;
115
116
  nativeProps.onSwipeViro = this._onSwipe;
@@ -78,6 +78,7 @@ class ViroFlexView extends ViroBase_1.ViroBase {
78
78
  nativeProps.transformBehaviors = transformBehaviors;
79
79
  nativeProps.onHoverViro = this._onHover;
80
80
  nativeProps.onClickViro = this._onClickState;
81
+ nativeProps.onClick = undefined;
81
82
  nativeProps.onTouchViro = this._onTouch;
82
83
  nativeProps.onScrollViro = this._onScroll;
83
84
  nativeProps.onSwipeViro = this._onSwipe;
@@ -117,6 +117,7 @@ class ViroImage extends ViroBase_1.ViroBase {
117
117
  nativeProps.style = [this.props.style];
118
118
  nativeProps.onHoverViro = this._onHover;
119
119
  nativeProps.onClickViro = this._onClickState;
120
+ nativeProps.onClick = undefined;
120
121
  nativeProps.onTouchViro = this._onTouch;
121
122
  nativeProps.onScrollViro = this._onScroll;
122
123
  nativeProps.onSwipeViro = this._onSwipe;
@@ -114,11 +114,19 @@ type Props = ViewProps & {
114
114
  /**
115
115
  * ViroObjectDetector — on-device open-vocabulary object detection powered by YOLOE.
116
116
  *
117
- * Runs **only in AR**: it shares the camera feed of the enclosing
118
- * `ViroARSceneNavigator` (no separate camera session, no preview of its own) and
119
- * fires `onDetection` with labels, normalized bounding boxes, and an on-screen
120
- * `screenBoundingBox` (dp) at up to `maxFPS`. Mount it as a child or sibling of a
121
- * `ViroARSceneNavigator`; it renders nothing itself, so give it `width: 0, height: 0`.
117
+ * Runs in AR and on Meta Quest:
118
+ * - **Phone AR**: shares the camera feed of the enclosing `ViroARSceneNavigator`
119
+ * (no separate camera session) and fires `onDetection` with labels, normalized
120
+ * bounding boxes, and an on-screen `screenBoundingBox` (dp) at up to `maxFPS`.
121
+ * - **Meta Quest 3 / 3S** (Horizon OS v74+): when mounted in a Quest MR scene
122
+ * (under `ViroXRSceneNavigator`), it captures the headset camera via the Meta
123
+ * Passthrough Camera API and runs the same YOLOE pipeline. Requires the
124
+ * `horizonos.permission.HEADSET_CAMERA` runtime permission. v1 emits `label` +
125
+ * normalized `boundingBox` only — `screenBoundingBox` and `worldPosition` are
126
+ * not provided on Quest yet (they need camera extrinsics).
127
+ *
128
+ * Mount it as a child or sibling of the scene navigator; it renders nothing itself,
129
+ * so give it `width: 0, height: 0`.
122
130
  *
123
131
  * @example
124
132
  * ```tsx
@@ -50,11 +50,19 @@ const VRTObjectDetectorView = (0, react_native_1.requireNativeComponent)("VRTObj
50
50
  /**
51
51
  * ViroObjectDetector — on-device open-vocabulary object detection powered by YOLOE.
52
52
  *
53
- * Runs **only in AR**: it shares the camera feed of the enclosing
54
- * `ViroARSceneNavigator` (no separate camera session, no preview of its own) and
55
- * fires `onDetection` with labels, normalized bounding boxes, and an on-screen
56
- * `screenBoundingBox` (dp) at up to `maxFPS`. Mount it as a child or sibling of a
57
- * `ViroARSceneNavigator`; it renders nothing itself, so give it `width: 0, height: 0`.
53
+ * Runs in AR and on Meta Quest:
54
+ * - **Phone AR**: shares the camera feed of the enclosing `ViroARSceneNavigator`
55
+ * (no separate camera session) and fires `onDetection` with labels, normalized
56
+ * bounding boxes, and an on-screen `screenBoundingBox` (dp) at up to `maxFPS`.
57
+ * - **Meta Quest 3 / 3S** (Horizon OS v74+): when mounted in a Quest MR scene
58
+ * (under `ViroXRSceneNavigator`), it captures the headset camera via the Meta
59
+ * Passthrough Camera API and runs the same YOLOE pipeline. Requires the
60
+ * `horizonos.permission.HEADSET_CAMERA` runtime permission. v1 emits `label` +
61
+ * normalized `boundingBox` only — `screenBoundingBox` and `worldPosition` are
62
+ * not provided on Quest yet (they need camera extrinsics).
63
+ *
64
+ * Mount it as a child or sibling of the scene navigator; it renders nothing itself,
65
+ * so give it `width: 0, height: 0`.
58
66
  *
59
67
  * @example
60
68
  * ```tsx
@@ -102,6 +102,7 @@ class ViroParticleEmitter extends React.Component {
102
102
  : undefined;
103
103
  // Create native props object.
104
104
  let nativeProps = Object.assign({}, this.props);
105
+ nativeProps.onClick = undefined;
105
106
  nativeProps.position = this.state.propsPositionState;
106
107
  nativeProps.onNativeTransformDelegateViro = transformDelegate;
107
108
  nativeProps.hasTransformDelegate =
@@ -175,6 +176,7 @@ class ViroParticleEmitter extends React.Component {
175
176
  };
176
177
  nativeProps.particleAppearance.rotation = newAppearanceRotMod;
177
178
  }
179
+ nativeProps.onClick = undefined;
178
180
  nativeProps.ref = (component) => {
179
181
  this._component = component;
180
182
  };
@@ -80,6 +80,7 @@ class ViroPolygon extends ViroBase_1.ViroBase {
80
80
  nativeProps.style = [this.props.style];
81
81
  nativeProps.onHoverViro = this._onHover;
82
82
  nativeProps.onClickViro = this._onClickState;
83
+ nativeProps.onClick = undefined;
83
84
  nativeProps.onTouchViro = this._onTouch;
84
85
  nativeProps.onScrollViro = this._onScroll;
85
86
  nativeProps.onSwipeViro = this._onSwipe;
@@ -80,6 +80,7 @@ class ViroQuad extends ViroBase_1.ViroBase {
80
80
  nativeProps.style = [this.props.style];
81
81
  nativeProps.onHoverViro = this._onHover;
82
82
  nativeProps.onClickViro = this._onClickState;
83
+ nativeProps.onClick = undefined;
83
84
  nativeProps.onTouchViro = this._onTouch;
84
85
  nativeProps.onScrollViro = this._onScroll;
85
86
  nativeProps.onSwipeViro = this._onSwipe;
@@ -81,6 +81,7 @@ class ViroSurface extends ViroBase_1.ViroBase {
81
81
  nativeProps.style = [this.props.style];
82
82
  nativeProps.onHoverViro = this._onHover;
83
83
  nativeProps.onClickViro = this._onClickState;
84
+ nativeProps.onClick = undefined;
84
85
  nativeProps.onTouchViro = this._onTouch;
85
86
  nativeProps.onScrollViro = this._onScroll;
86
87
  nativeProps.onSwipeViro = this._onSwipe;
@@ -98,6 +98,7 @@ class ViroVideo extends ViroBase_1.ViroBase {
98
98
  nativeProps.onUpdateTimeViro = this._onUpdateTime;
99
99
  nativeProps.onHoverViro = this._onHover;
100
100
  nativeProps.onClickViro = this._onClickState;
101
+ nativeProps.onClick = undefined;
101
102
  nativeProps.onTouchViro = this._onTouch;
102
103
  nativeProps.onScrollViro = this._onScroll;
103
104
  nativeProps.onSwipeViro = this._onSwipe;
@@ -33,6 +33,14 @@ export declare const ViroXRSceneNavigator: React.ForwardRefExoticComponent<ViewP
33
33
  * On Quest, this scene is forwarded to VRActivity via VRQuestNavigatorBridge
34
34
  * rather than rendered inline, because OpenXR exclusive display requires the
35
35
  * VR intent category on the host Activity.
36
+ *
37
+ * The scene root may be either:
38
+ * - `ViroScene` → fully-virtual VR.
39
+ * - `ViroARScene` → mixed reality: passthrough is enabled automatically and
40
+ * real-time plane detection (XR_EXT_plane_detection, Quest 3 / 3S) drives
41
+ * `onAnchorFound` and `ViroARPlane`, exactly as on phone AR. A single
42
+ * AR-rooted `initialScene` therefore runs on phones (ARCore) and Quest (OpenXR)
43
+ * with no per-platform changes. See docs/QUEST_SETUP.md §7b.
36
44
  */
37
45
  vrInitialScene?: SceneFactory;
38
46
  worldAlignment?: "Gravity" | "GravityAndHeading" | "Camera";
package/dist/index.d.ts CHANGED
@@ -75,10 +75,10 @@ import { ViroSceneNavigator } from "./components/ViroSceneNavigator";
75
75
  import { VIRO_VERSION } from "./components/Utilities/ViroVersion";
76
76
  import { ViroQuestEntryPoint } from "./components/ViroQuestEntryPoint";
77
77
  import { VRQuestNavigatorBridge } from "./components/Utilities/VRQuestNavigatorBridge";
78
- import { VRModuleOpenXR, useVRViewTag, exitVRScene } from "./components/Utilities/VRModuleOpenXR";
79
- import type { VRModuleOpenXRType } from "./components/Utilities/VRModuleOpenXR";
78
+ import { VRModuleOpenXR, useVRViewTag, exitVRScene, setPassthroughStyle } from "./components/Utilities/VRModuleOpenXR";
79
+ import type { VRModuleOpenXRType, ViroPassthroughStyle } from "./components/Utilities/VRModuleOpenXR";
80
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, };
82
- export type { VRModuleOpenXRType };
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, setPassthroughStyle, 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, };
82
+ export type { VRModuleOpenXRType, ViroPassthroughStyle };
83
83
  export type { ImmersiveSpaceStyle } from "./components/VisionOS/ViroVisionOSModule";
84
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
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;
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.setPassthroughStyle = 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.
@@ -164,6 +164,7 @@ const VRModuleOpenXR_1 = require("./components/Utilities/VRModuleOpenXR");
164
164
  Object.defineProperty(exports, "VRModuleOpenXR", { enumerable: true, get: function () { return VRModuleOpenXR_1.VRModuleOpenXR; } });
165
165
  Object.defineProperty(exports, "useVRViewTag", { enumerable: true, get: function () { return VRModuleOpenXR_1.useVRViewTag; } });
166
166
  Object.defineProperty(exports, "exitVRScene", { enumerable: true, get: function () { return VRModuleOpenXR_1.exitVRScene; } });
167
+ Object.defineProperty(exports, "setPassthroughStyle", { enumerable: true, get: function () { return VRModuleOpenXR_1.setPassthroughStyle; } });
167
168
  const StreamingAudioManager_1 = require("./components/Utilities/StreamingAudioManager");
168
169
  Object.defineProperty(exports, "StreamingAudioManager", { enumerable: true, get: function () { return StreamingAudioManager_1.StreamingAudioManager; } });
169
170
  const react_native_1 = require("react-native");
@@ -343,6 +343,24 @@ const withViroManifest = (config) => (0, config_plugins_1.withAndroidManifest)(c
343
343
  $: { "android:name": "com.oculus.permission.EYE_TRACKING" },
344
344
  });
345
345
  }
346
+ // Spatial Data / Scene permissions — required for the Meta OpenXR runtime
347
+ // to expose the scene & spatial-entity extensions (XR_FB_scene,
348
+ // XR_FB_spatial_entity*, XR_FB_scene_capture). Without USE_ANCHOR_API the
349
+ // runtime skips those extensions, so plane / anchor data is unavailable on
350
+ // Quest. These are runtime permissions — also require a grant at runtime.
351
+ const sceneAnchorPerms = [
352
+ "horizonos.permission.USE_ANCHOR_API", // gates XR_FB_scene / XR_FB_spatial_entity on current Horizon OS
353
+ "com.oculus.permission.USE_SCENE", // legacy Scene permission (older OS)
354
+ // Meta Passthrough Camera API (Quest 3 / 3S, Horizon OS v74+): grants the
355
+ // app the headset RGB cameras via Camera2, used by ViroObjectDetector to
356
+ // run on-device object detection over passthrough. Runtime-granted.
357
+ "horizonos.permission.HEADSET_CAMERA",
358
+ ];
359
+ for (const perm of sceneAnchorPerms) {
360
+ if (!existingPermissions.includes(perm)) {
361
+ contents.manifest["uses-permission"].push({ $: { "android:name": perm } });
362
+ }
363
+ }
346
364
  }
347
365
  return newConfig;
348
366
  });
package/index.ts CHANGED
@@ -187,8 +187,8 @@ import { ViroSceneNavigator } from "./components/ViroSceneNavigator";
187
187
  import { VIRO_VERSION } from "./components/Utilities/ViroVersion";
188
188
  import { ViroQuestEntryPoint } from "./components/ViroQuestEntryPoint";
189
189
  import { VRQuestNavigatorBridge } from "./components/Utilities/VRQuestNavigatorBridge";
190
- import { VRModuleOpenXR, useVRViewTag, exitVRScene } from "./components/Utilities/VRModuleOpenXR";
191
- import type { VRModuleOpenXRType } from "./components/Utilities/VRModuleOpenXR";
190
+ import { VRModuleOpenXR, useVRViewTag, exitVRScene, setPassthroughStyle } from "./components/Utilities/VRModuleOpenXR";
191
+ import type { VRModuleOpenXRType, ViroPassthroughStyle } from "./components/Utilities/VRModuleOpenXR";
192
192
  import { StreamingAudioManager } from "./components/Utilities/StreamingAudioManager";
193
193
  import { AppRegistry } from "react-native";
194
194
 
@@ -262,6 +262,7 @@ export {
262
262
  VRModuleOpenXR,
263
263
  useVRViewTag,
264
264
  exitVRScene,
265
+ setPassthroughStyle,
265
266
  Viro3DSceneNavigator,
266
267
  // Streaming audio
267
268
  StreamingAudioManager,
@@ -391,7 +392,7 @@ export {
391
392
  exitImmersiveSpace,
392
393
  };
393
394
 
394
- export type { VRModuleOpenXRType };
395
+ export type { VRModuleOpenXRType, ViroPassthroughStyle };
395
396
  export type { ImmersiveSpaceStyle } from "./components/VisionOS/ViroVisionOSModule";
396
397
 
397
398
  export type {
@@ -1,5 +1,5 @@
1
1
  dependencies: \
2
2
  /Users/dorantes/Documents/ViroWorkspace/virocore/ViroRenderer/Shaders.metal \
3
- /private/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.6.42.0.h0RVpk/Metal.xctoolchain/usr/metal/32023/lib/clang/32023.883/include/metal/module.modulemap \
3
+ /private/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.6.109.0.hR8Z6P/Metal.xctoolchain/usr/metal/32023/lib/clang/32023.883/include/metal/module.modulemap \
4
4
  /Users/dorantes/Documents/ViroWorkspace/virocore/ViroRenderer/VROSharedStructures.h \
5
5
  /Users/dorantes/Documents/ViroWorkspace/virocore/ViroRenderer/VRODefines.h
Binary file
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "main": "dist/index.js",
4
4
  "module": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
- "version": "2.57.0",
6
+ "version": "2.57.2",
7
7
  "license": "MIT",
8
8
  "publishConfig": {
9
9
  "registry": "https://registry.npmjs.org/"