@reactvision/react-viro 2.57.2 → 2.57.3

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 CHANGED
@@ -92,6 +92,14 @@ You can get a Studio account, which includes Platform access, for free at <https
92
92
  - Cloud Anchors guide: <https://viro-community.readme.io/docs/cloud-anchors>
93
93
  - Geospatial Anchors guide: <https://viro-community.readme.io/docs/geospatial-anchors>
94
94
 
95
+ ## Optional Packages
96
+
97
+ Two capabilities are shipped as separate, opt-in packages rather than in core — install them only if you need them:
98
+
99
+ - **[`@reactvision/react-viro-onnx`](https://www.npmjs.com/package/@reactvision/react-viro-onnx)** — on-device object detection. It provides the ONNX Runtime inference engine behind [`ViroObjectDetector`](https://github.com/ReactVision/viro/blob/main/docs/ViroObjectDetector.md) (model inference, NMS, class-name decoding). Without it, `ViroObjectDetector` returns no detections. Keeping it separate avoids bundling ONNX Runtime (~tens of MB) into apps that don't use detection.
100
+
101
+ - **[`@reactvision/react-viro-face-tracking`](https://www.npmjs.com/package/@reactvision/react-viro-face-tracking)** — front-camera (ARKit face-tracking) AR. It backs the `frontCameraEnabled` prop on `ViroARSceneNavigator`. On iOS ARKit reaches the front camera only through the **TrueDepth** API, which Apple statically scans for under App Store review Guideline 2.5.1 — so it's kept out of the core binary. Apps that don't use front-camera AR stay TrueDepth-free and pass review with no configuration; install this package (and declare TrueDepth) only when you need it. For a selfie *feed* without face tracking, use [`ViroCameraTexture`](https://github.com/ReactVision/viro/blob/main/docs/ViroCameraTexture.md) with `cameraPosition="front"` — that's in core and uses AVFoundation, no TrueDepth.
102
+
95
103
  ## Studio
96
104
 
97
105
  [ReactVision Studio](https://studio.reactvision.xyz) is our browser-based visual scene editor for AR and VR. Build scenes visually in Studio, then embed them inside your own ViroReact app with a single component. Designers and developers can iterate on a scene in Studio and have it update in production without a new app build.
@@ -208,9 +208,17 @@ type Props = ViewProps & {
208
208
 
209
209
  /**
210
210
  * Use the front (selfie) camera as the AR session background.
211
- * On iOS uses ARFaceTrackingConfiguration (requires TrueDepth camera, iPhone X+).
212
- * On Android uses ARCore Augmented Faces mode (front camera).
213
- * World tracking, plane detection, and LiDAR are unavailable in this mode.
211
+ *
212
+ * Requires the optional `@reactvision/react-viro-face-tracking` package to be
213
+ * installed it provides the native front-camera AR configuration and, on
214
+ * iOS, declares TrueDepth usage. Without it, this prop has no effect.
215
+ *
216
+ * On iOS the package uses the front TrueDepth camera; on Android it uses
217
+ * ARCore Augmented Faces mode. World tracking, plane detection, and LiDAR are
218
+ * unavailable in this mode.
219
+ *
220
+ * For a plain selfie feed without face tracking (no TrueDepth), use
221
+ * `ViroCameraTexture` with `cameraPosition="front"` instead.
214
222
  *
215
223
  * @default false
216
224
  * @platform ios, android
@@ -1 +1 @@
1
- export const VIRO_VERSION = "2.57.2";
1
+ export const VIRO_VERSION = "2.57.3";
@@ -149,9 +149,17 @@ type Props = ViewProps & {
149
149
  monocularDepthTargetFPS?: number;
150
150
  /**
151
151
  * Use the front (selfie) camera as the AR session background.
152
- * On iOS uses ARFaceTrackingConfiguration (requires TrueDepth camera, iPhone X+).
153
- * On Android uses ARCore Augmented Faces mode (front camera).
154
- * World tracking, plane detection, and LiDAR are unavailable in this mode.
152
+ *
153
+ * Requires the optional `@reactvision/react-viro-face-tracking` package to be
154
+ * installed it provides the native front-camera AR configuration and, on
155
+ * iOS, declares TrueDepth usage. Without it, this prop has no effect.
156
+ *
157
+ * On iOS the package uses the front TrueDepth camera; on Android it uses
158
+ * ARCore Augmented Faces mode. World tracking, plane detection, and LiDAR are
159
+ * unavailable in this mode.
160
+ *
161
+ * For a plain selfie feed without face tracking (no TrueDepth), use
162
+ * `ViroCameraTexture` with `cameraPosition="front"` instead.
155
163
  *
156
164
  * @default false
157
165
  * @platform ios, android
@@ -1 +1 @@
1
- export declare const VIRO_VERSION = "2.57.2";
1
+ export declare const VIRO_VERSION = "2.57.3";
@@ -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.2";
4
+ exports.VIRO_VERSION = "2.57.3";
@@ -144,6 +144,14 @@ private:
144
144
  */
145
145
  float sampleDepthTextureAtUV(std::shared_ptr<VROTexture> texture, float u, float v) const;
146
146
 
147
+ /*
148
+ Sample the LiDAR depth confidence at normalized UV coordinates (0-1 range).
149
+ Reads ARKit's ARDepthData.confidenceMap (ARConfidenceLevel: 0=low, 1=medium, 2=high)
150
+ and normalizes to [0,1] (low=0.0, medium=0.5, high=1.0). Returns -1.0 when confidence
151
+ is unavailable (no LiDAR / no confidence map).
152
+ */
153
+ float sampleConfidenceAtUV(float u, float v) const;
154
+
147
155
  /*
148
156
  Unproject a camera-image-space point (normalized [0,1] in ARKit's landscape image
149
157
  space, the same space used for [ARFrame hitTest:]) at a given metric depth (meters
@@ -126,8 +126,19 @@ public:
126
126
  void setPreferMonocularDepth(bool prefer);
127
127
  bool isPreferMonocularDepth() const;
128
128
 
129
- // Use the front (TrueDepth) camera via ARFaceTrackingConfiguration.
130
- // When true, world tracking, planes, and LiDAR are unavailable.
129
+ // Front-camera AR is supplied by an optional external module so that ViroKit
130
+ // itself never references the ARKit face-tracking / TrueDepth API. Apps that
131
+ // need it install @reactvision/react-viro-face-tracking, which registers a
132
+ // provider here. The provider returns a ready-to-run front-camera
133
+ // ARConfiguration (or nil if the device is unsupported). When no provider is
134
+ // registered, setFrontCameraEnabled(true) has no effect and AR falls through
135
+ // to world tracking.
136
+ typedef ARConfiguration * _Nullable (^VROARFrontCameraConfigProvider)(void);
137
+ static void setFrontCameraConfigProvider(VROARFrontCameraConfigProvider provider);
138
+
139
+ // Enable/disable front-camera AR. Requires a registered config provider
140
+ // (see setFrontCameraConfigProvider); otherwise it is a no-op. When active,
141
+ // world tracking, planes, and LiDAR are unavailable.
131
142
  void setFrontCameraEnabled(bool enabled);
132
143
  bool isFrontCameraEnabled() const { return _frontCameraEnabled; }
133
144
 
@@ -371,7 +382,7 @@ private:
371
382
  std::shared_ptr<VROMonocularDepthEstimator> _monocularDepthEstimator;
372
383
  bool _monocularDepthEnabled;
373
384
  bool _preferMonocularDepth; // When true, use monocular even on LiDAR devices
374
- bool _frontCameraEnabled; // When true, use ARFaceTrackingConfiguration (front camera)
385
+ bool _frontCameraEnabled; // When true and a config provider is registered, use front-camera AR
375
386
  bool _monocularDepthLoading;
376
387
  float _monocularDepthScale; // Multiplied into depth values (1.0 = no change)
377
388
  int _monocularDepthTargetFPS; // 0 = use estimator default
@@ -0,0 +1,34 @@
1
+ //
2
+ // VROFrontCameraProvider.h
3
+ // ViroKit
4
+ //
5
+ // Copyright © 2026 ReactVision. All rights reserved.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <ARKit/ARKit.h>
10
+
11
+ NS_ASSUME_NONNULL_BEGIN
12
+
13
+ /**
14
+ * VROFrontCameraProvider — Objective-C registration host for front-camera AR.
15
+ *
16
+ * ViroKit itself does NOT reference the ARKit face-tracking / TrueDepth API. An
17
+ * optional external module (@reactvision/react-viro-face-tracking) supplies a
18
+ * front-camera ARConfiguration by calling +registerConfigProvider:. That module
19
+ * discovers this class at runtime via NSClassFromString, so ViroKit carries no
20
+ * build- or link-time dependency on it (mirrors how react-viro-onnx registers
21
+ * against VRTObjectDetectorView).
22
+ *
23
+ * The registered block returns a ready-to-run front-camera ARConfiguration, or
24
+ * nil if the device does not support it. It is stored process-wide and consulted
25
+ * by VROARSessioniOS whenever front-camera AR is requested.
26
+ */
27
+ @interface VROFrontCameraProvider : NSObject
28
+
29
+ /** Register the front-camera config provider used by VROARSessioniOS (idempotent). */
30
+ + (void)registerConfigProvider:(ARConfiguration * _Nullable (^)(void))provider;
31
+
32
+ @end
33
+
34
+ NS_ASSUME_NONNULL_END
@@ -194,7 +194,9 @@ enum class VROCameraPosition;
194
194
  // Target inference rate for monocular depth. Thermal state overrides downward automatically.
195
195
  - (void)setMonocularDepthTargetFPS:(int)fps;
196
196
 
197
- // Switch to ARFaceTrackingConfiguration (front TrueDepth camera) when YES.
197
+ // Switch to front-camera AR when YES. Requires the optional face-tracking
198
+ // module to be installed (see VROARSessioniOS::setFrontCameraConfigProvider);
199
+ // otherwise this has no effect.
198
200
  - (void)setFrontCameraEnabled:(BOOL)enabled;
199
201
 
200
202
  @end
@@ -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.109.0.hR8Z6P/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.qEW6mp/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
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.2",
6
+ "version": "2.57.3",
7
7
  "license": "MIT",
8
8
  "publishConfig": {
9
9
  "registry": "https://registry.npmjs.org/"
@@ -27,12 +27,12 @@
27
27
  "prepare": "npm run build"
28
28
  },
29
29
  "peerDependencies": {
30
- "expo": ">=55.0.0 <57.0.0",
30
+ "expo": ">=55.0.0 <58.0.0",
31
31
  "react": ">=18.0.0",
32
- "react-native": ">=0.83.0 <0.86.0"
32
+ "react-native": ">=0.83.0 <0.87.0"
33
33
  },
34
34
  "engines": {
35
- "react-native": ">=0.83.0 <0.86.0"
35
+ "react-native": ">=0.83.0 <0.87.0"
36
36
  },
37
37
  "peerDependenciesMeta": {
38
38
  "expo": {
@@ -61,23 +61,23 @@
61
61
  "@babel/core": "^7.25.2",
62
62
  "@babel/preset-env": "^7.25.3",
63
63
  "@babel/preset-typescript": "^7.26.0",
64
- "@expo/config-plugins": "~56.0.8",
64
+ "@expo/config-plugins": "~57.0.0",
65
65
  "@jest/globals": "^29.7.0",
66
66
  "@react-native-community/cli": "^20.1.3",
67
67
  "@react-native-community/cli-platform-android": "^20.1.3",
68
68
  "@react-native-community/cli-platform-ios": "^20.1.3",
69
- "@react-native/babel-preset": "^0.85.3",
70
- "@react-native/eslint-config": "^0.85.3",
71
- "@react-native/metro-config": "^0.85.3",
72
- "@react-native/typescript-config": "^0.85.3",
69
+ "@react-native/babel-preset": "^0.86.0",
70
+ "@react-native/eslint-config": "^0.86.0",
71
+ "@react-native/metro-config": "^0.86.0",
72
+ "@react-native/typescript-config": "^0.86.0",
73
73
  "@types/babel__core": "^7.20.5",
74
74
  "@types/node": "^22.13.1",
75
75
  "@types/react": "~19.2.17",
76
76
  "babel-jest": "^29.7.0",
77
- "expo": "~56.0.9",
77
+ "expo": "~57.0.0",
78
78
  "jest": "^29.7.0",
79
79
  "react": "~19.2.3",
80
- "react-native": "~0.85.3",
80
+ "react-native": "~0.86.0",
81
81
  "release-it": "^17.1.1",
82
82
  "ts-node": "^10.9.2",
83
83
  "typescript": "^5.3.0"