@reactvision/react-viro 2.57.3 → 2.57.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/react_viro/react_viro-release.aar +0 -0
- package/components/Studio/StudioARScene.tsx +153 -4
- package/components/Studio/StudioSceneErrorBoundary.tsx +48 -0
- package/components/Studio/StudioSceneNavigator.tsx +186 -41
- package/components/Studio/VRTStudioModule.ts +26 -0
- package/components/Studio/domain/dragConfiguration.ts +6 -4
- package/components/Studio/domain/materialConfig.ts +75 -42
- package/components/Studio/domain/physicsConfig.ts +75 -32
- package/components/Studio/domain/viroNodeFactory.tsx +53 -14
- package/components/Studio/index.ts +4 -0
- package/components/Studio/types.ts +3 -8
- package/components/Utilities/ViroVersion.ts +1 -1
- package/components/ViroXRSceneNavigator.tsx +2 -0
- package/dist/components/Studio/StudioARScene.d.ts +6 -0
- package/dist/components/Studio/StudioARScene.js +101 -6
- package/dist/components/Studio/StudioSceneErrorBoundary.d.ts +28 -0
- package/dist/components/Studio/StudioSceneErrorBoundary.js +31 -0
- package/dist/components/Studio/StudioSceneNavigator.d.ts +28 -3
- package/dist/components/Studio/StudioSceneNavigator.js +84 -20
- package/dist/components/Studio/VRTStudioModule.d.ts +17 -0
- package/dist/components/Studio/VRTStudioModule.js +14 -0
- package/dist/components/Studio/domain/dragConfiguration.d.ts +5 -3
- package/dist/components/Studio/domain/dragConfiguration.js +5 -3
- package/dist/components/Studio/domain/materialConfig.d.ts +0 -1
- package/dist/components/Studio/domain/materialConfig.js +12 -5
- package/dist/components/Studio/domain/physicsConfig.d.ts +0 -1
- package/dist/components/Studio/domain/physicsConfig.js +18 -6
- package/dist/components/Studio/domain/viroNodeFactory.d.ts +2 -2
- package/dist/components/Studio/domain/viroNodeFactory.js +31 -18
- package/dist/components/Studio/index.d.ts +1 -0
- package/dist/components/Studio/types.d.ts +1 -0
- package/dist/components/Utilities/ViroVersion.d.ts +1 -1
- package/dist/components/Utilities/ViroVersion.js +1 -1
- package/dist/components/ViroXRSceneNavigator.d.ts +2 -0
- package/dist/index.d.ts +1 -1
- package/index.ts +2 -0
- package/ios/dist/include/RVStudioWatermarkState.h +25 -0
- package/ios/dist/lib/libViroReact.a +0 -0
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* Studio physics_config and physics_world_config parsing and Viro prop building.
|
|
4
|
-
* Ported from studio-go/domain/physicsConfig.ts — no zod dependency.
|
|
5
4
|
*/
|
|
6
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
6
|
exports.parsePhysicsWorldConfig = parsePhysicsWorldConfig;
|
|
@@ -11,7 +10,7 @@ exports.buildViroPhysicsBody = buildViroPhysicsBody;
|
|
|
11
10
|
exports.shouldUseKinematicPhysicsDrag = shouldUseKinematicPhysicsDrag;
|
|
12
11
|
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
13
12
|
function isVec3(v) {
|
|
14
|
-
return Array.isArray(v) && v.length === 3 && v.every((n) => typeof n === "number");
|
|
13
|
+
return (Array.isArray(v) && v.length === 3 && v.every((n) => typeof n === "number"));
|
|
15
14
|
}
|
|
16
15
|
function parseShape(raw) {
|
|
17
16
|
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
@@ -28,7 +27,9 @@ function parseShape(raw) {
|
|
|
28
27
|
if (!c || typeof c !== "object")
|
|
29
28
|
return false;
|
|
30
29
|
const ch = c;
|
|
31
|
-
return (ch.type === "Box" || ch.type === "Sphere") &&
|
|
30
|
+
return ((ch.type === "Box" || ch.type === "Sphere") &&
|
|
31
|
+
Array.isArray(ch.params) &&
|
|
32
|
+
isVec3(ch.position));
|
|
32
33
|
});
|
|
33
34
|
if (children.length > 0)
|
|
34
35
|
return { type: "Compound", children };
|
|
@@ -44,7 +45,11 @@ function mapShapeToViro(shape) {
|
|
|
44
45
|
type: "Compound",
|
|
45
46
|
params: [],
|
|
46
47
|
children: shape.children.map((c) => {
|
|
47
|
-
const base = {
|
|
48
|
+
const base = {
|
|
49
|
+
type: c.type,
|
|
50
|
+
params: [...c.params],
|
|
51
|
+
position: [...c.position],
|
|
52
|
+
};
|
|
48
53
|
if (c.rotation)
|
|
49
54
|
base.rotation = [...c.rotation];
|
|
50
55
|
return base;
|
|
@@ -134,11 +139,18 @@ function buildViroPhysicsWorld(config) {
|
|
|
134
139
|
}
|
|
135
140
|
/** Maps validated Studio physics_config to Viro `physicsBody` prop. */
|
|
136
141
|
function buildViroPhysicsBody(config, options) {
|
|
137
|
-
const kinematicDrag = options?.kinematicDragOverride === true &&
|
|
142
|
+
const kinematicDrag = options?.kinematicDragOverride === true &&
|
|
143
|
+
config.type === "Dynamic" &&
|
|
144
|
+
config.enabled;
|
|
138
145
|
const type = kinematicDrag ? "Kinematic" : config.type;
|
|
139
146
|
const mass = kinematicDrag ? 0 : config.mass;
|
|
140
147
|
const shape = mapShapeToViro(config.shape ?? { type: "Box", params: [1, 1, 1] });
|
|
141
|
-
const body = {
|
|
148
|
+
const body = {
|
|
149
|
+
type,
|
|
150
|
+
mass,
|
|
151
|
+
shape,
|
|
152
|
+
enabled: config.enabled,
|
|
153
|
+
};
|
|
142
154
|
if (config.restitution !== undefined)
|
|
143
155
|
body.restitution = config.restitution;
|
|
144
156
|
if (config.friction !== undefined)
|
|
@@ -18,6 +18,6 @@ export type NodeConfig = {
|
|
|
18
18
|
animation?: ViroAnimationProp;
|
|
19
19
|
};
|
|
20
20
|
/** Clamps Z to -2 for non-trigger assets to guarantee visibility. */
|
|
21
|
-
export declare function createNodeConfig(asset: StudioAsset, sceneNavigator: SceneNavigator | undefined, animations: StudioAnimation[], scene: StudioSceneMeta | null, onAnimationTrigger?: (targetAssetId: string, animKey: string) => void, animationStates?: Record<string, ViroAnimationProp>, onSceneChange?: (sceneId: string, sceneName: string) => void, runtimeCtx?: SequenceRuntimeContext): NodeConfig;
|
|
22
|
-
export declare function createNode(asset: StudioAsset, sceneNavigator: SceneNavigator | undefined, animations: StudioAnimation[], scene: StudioSceneMeta | null, onAnimationTrigger?: (targetAssetId: string, animKey: string) => void, animationStates?: Record<string, ViroAnimationProp>, onAssetLoaded?: (id: string) => void, onCollision?: (viroTag: string, collidedPoint: [number, number, number], collidedNormal: [number, number, number]) => void, onSceneChange?: (sceneId: string, sceneName: string) => void, runtimeCtx?: SequenceRuntimeContext): React.ReactElement | null;
|
|
21
|
+
export declare function createNodeConfig(asset: StudioAsset, sceneNavigator: SceneNavigator | undefined, animations: StudioAnimation[], scene: StudioSceneMeta | null, onAnimationTrigger?: (targetAssetId: string, animKey: string) => void, animationStates?: Record<string, ViroAnimationProp>, isDragActive?: (assetId: string) => boolean, onSceneChange?: (sceneId: string, sceneName: string) => void, runtimeCtx?: SequenceRuntimeContext): NodeConfig;
|
|
22
|
+
export declare function createNode(asset: StudioAsset, sceneNavigator: SceneNavigator | undefined, animations: StudioAnimation[], scene: StudioSceneMeta | null, onAnimationTrigger?: (targetAssetId: string, animKey: string) => void, animationStates?: Record<string, ViroAnimationProp>, onAssetLoaded?: (id: string) => void, onCollision?: (viroTag: string, collidedPoint: [number, number, number], collidedNormal: [number, number, number]) => void, isDragActive?: (assetId: string) => boolean, notifyPhysicsDrag?: (assetId: string) => void, onSceneChange?: (sceneId: string, sceneName: string) => void, runtimeCtx?: SequenceRuntimeContext): React.ReactElement | null;
|
|
23
23
|
export {};
|
|
@@ -47,7 +47,7 @@ const materialConfig_1 = require("./materialConfig");
|
|
|
47
47
|
const dragConfiguration_1 = require("./dragConfiguration");
|
|
48
48
|
const physicsConfig_1 = require("./physicsConfig");
|
|
49
49
|
/** Clamps Z to -2 for non-trigger assets to guarantee visibility. */
|
|
50
|
-
function createNodeConfig(asset, sceneNavigator, animations, scene, onAnimationTrigger, animationStates, onSceneChange, runtimeCtx) {
|
|
50
|
+
function createNodeConfig(asset, sceneNavigator, animations, scene, onAnimationTrigger, animationStates, isDragActive, onSceneChange, runtimeCtx) {
|
|
51
51
|
const hasTriggerImage = !!asset.trigger_image_url;
|
|
52
52
|
let posZ = asset.position_z ?? -2;
|
|
53
53
|
if (!hasTriggerImage && posZ > -0.5) {
|
|
@@ -87,8 +87,11 @@ function createNodeConfig(asset, sceneNavigator, animations, scene, onAnimationT
|
|
|
87
87
|
dragPlane = dragConfiguration_1.DragConfiguration.getDragPlane(scene?.plane_direction ?? "Horizontal", position);
|
|
88
88
|
}
|
|
89
89
|
const parsedPhysics = (0, physicsConfig_1.parsePhysicsBodyConfig)(asset.physics_config);
|
|
90
|
+
const dragActive = isDragActive?.(asset.id) ?? false;
|
|
90
91
|
const physicsBody = parsedPhysics
|
|
91
|
-
? (0, physicsConfig_1.buildViroPhysicsBody)(parsedPhysics
|
|
92
|
+
? (0, physicsConfig_1.buildViroPhysicsBody)(parsedPhysics, {
|
|
93
|
+
kinematicDragOverride: dragActive && (0, physicsConfig_1.shouldUseKinematicPhysicsDrag)(asset, parsedPhysics),
|
|
94
|
+
})
|
|
92
95
|
: undefined;
|
|
93
96
|
const viroTag = parsedPhysics ? asset.id : undefined;
|
|
94
97
|
const onClick = createOnClickHandler(asset, sceneNavigator, animations, onAnimationTrigger, onSceneChange, runtimeCtx);
|
|
@@ -136,7 +139,7 @@ function inferModelType(url) {
|
|
|
136
139
|
return "VRX";
|
|
137
140
|
return "GLB";
|
|
138
141
|
}
|
|
139
|
-
function create3DObject(asset, config, onAssetLoaded, onCollision) {
|
|
142
|
+
function create3DObject(asset, config, onAssetLoaded, notifyPhysicsDrag, onCollision) {
|
|
140
143
|
if (!asset.file_url) {
|
|
141
144
|
console.warn(`[Studio] 3D model "${asset.name}" has no file_url`);
|
|
142
145
|
return null;
|
|
@@ -157,16 +160,20 @@ function create3DObject(asset, config, onAssetLoaded, onCollision) {
|
|
|
157
160
|
return (<Viro3DObject_1.Viro3DObject key={asset.id} source={{ uri: asset.file_url }} position={config.position} rotation={config.rotation} scale={scale} type={modelType} dragType={config.dragType} dragPlane={config.dragPlane} animation={config.animation} onClick={config.onClick} renderingOrder={react_native_1.Platform.OS === "android" ? 1 : 0} onLoadEnd={() => onAssetLoaded?.(asset.id)} onError={(e) => console.error(`[Studio] 3D model "${asset.name}" error:`, e)}
|
|
158
161
|
// Viro derives native canDrag from `onDrag != undefined`; without this prop
|
|
159
162
|
// the drag recognizer is never attached, even when dragType is set.
|
|
160
|
-
{...(config.dragType
|
|
163
|
+
{...(config.dragType
|
|
164
|
+
? { onDrag: () => notifyPhysicsDrag?.(asset.id) }
|
|
165
|
+
: {})} {...(shaderOverrides ? { shaderOverrides } : {})} {...(config.physicsBody
|
|
161
166
|
? { physicsBody: config.physicsBody, viroTag: config.viroTag }
|
|
162
167
|
: {})} {...(onCollision ? { onCollision: onCollision } : {})}/>);
|
|
163
168
|
}
|
|
164
|
-
function createImage(asset, config, onAssetLoaded) {
|
|
169
|
+
function createImage(asset, config, onAssetLoaded, notifyPhysicsDrag) {
|
|
165
170
|
if (!asset.file_url) {
|
|
166
171
|
console.warn(`[Studio] Image "${asset.name}" has no file_url`);
|
|
167
172
|
return null;
|
|
168
173
|
}
|
|
169
|
-
return (<ViroImage_1.ViroImage key={asset.id} source={{ uri: asset.file_url }} position={config.position} rotation={config.rotation} scale={config.scale} dragType={config.dragType} animation={config.animation} onClick={config.onClick} onLoadEnd={() => onAssetLoaded?.(asset.id)} onError={(e) => console.error(`[Studio] Image "${asset.name}" error:`, e)} {...(config.dragType
|
|
174
|
+
return (<ViroImage_1.ViroImage key={asset.id} source={{ uri: asset.file_url }} position={config.position} rotation={config.rotation} scale={config.scale} dragType={config.dragType} animation={config.animation} onClick={config.onClick} onLoadEnd={() => onAssetLoaded?.(asset.id)} onError={(e) => console.error(`[Studio] Image "${asset.name}" error:`, e)} {...(config.dragType
|
|
175
|
+
? { onDrag: () => notifyPhysicsDrag?.(asset.id) }
|
|
176
|
+
: {})}/>);
|
|
170
177
|
}
|
|
171
178
|
/**
|
|
172
179
|
* TEXT node whose content is a {{variable}} template (the asset name). It
|
|
@@ -174,7 +181,7 @@ function createImage(asset, config, onAssetLoaded) {
|
|
|
174
181
|
* subscribes when the template actually has placeholders). Resolution is
|
|
175
182
|
* fail-soft: unknown names stay literal.
|
|
176
183
|
*/
|
|
177
|
-
const VariableText = ({ asset, config, store, visible }) => {
|
|
184
|
+
const VariableText = ({ asset, config, store, notifyPhysicsDrag, visible }) => {
|
|
178
185
|
const template = asset.name ?? "";
|
|
179
186
|
const compute = () => store
|
|
180
187
|
? (0, apiRequestHelpers_1.interpolateDisplayTemplate)(template, (n) => store.get(n))
|
|
@@ -193,7 +200,9 @@ const VariableText = ({ asset, config, store, visible }) => {
|
|
|
193
200
|
fontSize: 20,
|
|
194
201
|
color: "#FFFFFF",
|
|
195
202
|
textAlign: "center",
|
|
196
|
-
}} {...(config.dragType
|
|
203
|
+
}} {...(config.dragType
|
|
204
|
+
? { onDrag: () => notifyPhysicsDrag?.(asset.id) }
|
|
205
|
+
: {})}/>);
|
|
197
206
|
};
|
|
198
207
|
/**
|
|
199
208
|
* Wraps a created node and drives its `visible` prop from the per-scene
|
|
@@ -211,32 +220,36 @@ const VisibleNode = ({ assetId, store, children }) => {
|
|
|
211
220
|
}, [store, assetId]);
|
|
212
221
|
return React.cloneElement(children, { visible });
|
|
213
222
|
};
|
|
214
|
-
function createText(asset, config, store) {
|
|
215
|
-
return (<VariableText key={asset.id} asset={asset} config={config} store={store}/>);
|
|
223
|
+
function createText(asset, config, notifyPhysicsDrag, store) {
|
|
224
|
+
return (<VariableText key={asset.id} asset={asset} config={config} store={store} notifyPhysicsDrag={notifyPhysicsDrag}/>);
|
|
216
225
|
}
|
|
217
|
-
function createVideo(asset, config) {
|
|
226
|
+
function createVideo(asset, config, notifyPhysicsDrag) {
|
|
218
227
|
if (!asset.file_url) {
|
|
219
228
|
console.warn(`[Studio] Video "${asset.name}" has no file_url`);
|
|
220
229
|
return null;
|
|
221
230
|
}
|
|
222
|
-
return (<ViroVideo_1.ViroVideo key={asset.id} source={{ uri: asset.file_url }} position={config.position} rotation={config.rotation} scale={config.scale} dragType={config.dragType} animation={config.animation} onClick={config.onClick} loop={true} muted={false} onError={(e) => console.error(`[Studio] Video "${asset.name}" error:`, e)} {...(config.dragType
|
|
231
|
+
return (<ViroVideo_1.ViroVideo key={asset.id} source={{ uri: asset.file_url }} position={config.position} rotation={config.rotation} scale={config.scale} dragType={config.dragType} animation={config.animation} onClick={config.onClick} loop={true} muted={false} onError={(e) => console.error(`[Studio] Video "${asset.name}" error:`, e)} {...(config.dragType
|
|
232
|
+
? { onDrag: () => notifyPhysicsDrag?.(asset.id) }
|
|
233
|
+
: {})}/>);
|
|
223
234
|
}
|
|
224
|
-
function createNode(asset, sceneNavigator, animations, scene, onAnimationTrigger, animationStates, onAssetLoaded, onCollision, onSceneChange, runtimeCtx) {
|
|
235
|
+
function createNode(asset, sceneNavigator, animations, scene, onAnimationTrigger, animationStates, onAssetLoaded, onCollision, isDragActive, notifyPhysicsDrag, onSceneChange, runtimeCtx) {
|
|
225
236
|
const type = resolveType(asset);
|
|
226
|
-
const config = createNodeConfig(asset, sceneNavigator, animations, scene, onAnimationTrigger, animationStates, onSceneChange, runtimeCtx);
|
|
237
|
+
const config = createNodeConfig(asset, sceneNavigator, animations, scene, onAnimationTrigger, animationStates, isDragActive, onSceneChange, runtimeCtx);
|
|
227
238
|
let node;
|
|
228
239
|
switch (type) {
|
|
229
240
|
case "3D-MODEL":
|
|
230
|
-
|
|
241
|
+
// NOTE: notifyPhysicsDrag and onCollision are distinct wirings — keep both;
|
|
242
|
+
// a drag-only merge here once silently killed collisions.
|
|
243
|
+
node = create3DObject(asset, config, onAssetLoaded, notifyPhysicsDrag, onCollision);
|
|
231
244
|
break;
|
|
232
245
|
case "IMAGE":
|
|
233
|
-
node = createImage(asset, config, onAssetLoaded);
|
|
246
|
+
node = createImage(asset, config, onAssetLoaded, notifyPhysicsDrag);
|
|
234
247
|
break;
|
|
235
248
|
case "TEXT":
|
|
236
|
-
node = createText(asset, config, runtimeCtx?.variableStore);
|
|
249
|
+
node = createText(asset, config, notifyPhysicsDrag, runtimeCtx?.variableStore);
|
|
237
250
|
break;
|
|
238
251
|
case "VIDEO":
|
|
239
|
-
node = createVideo(asset, config);
|
|
252
|
+
node = createVideo(asset, config, notifyPhysicsDrag);
|
|
240
253
|
break;
|
|
241
254
|
default:
|
|
242
255
|
console.warn(`[Studio] Unknown asset type "${type}" for "${asset.name}"`);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { StudioARScene } from "./StudioARScene";
|
|
2
2
|
export { StudioSceneNavigator } from "./StudioSceneNavigator";
|
|
3
|
+
export type { StudioSceneNavigatorHandle, StudioSceneNavigatorProps, } from "./StudioSceneNavigator";
|
|
3
4
|
export type { StudioAnimation, StudioAsset, StudioCollisionBinding, StudioProjectApiResponse, StudioProjectAsset, StudioProjectMeta, StudioProjectOpeningScene, StudioProjectOverview, StudioProjectSceneSummary, StudioSceneCreatedBy, StudioSceneFunction, StudioSceneMeta, StudioSceneResponse, StudioSceneVariable, ViroAnimationProp, } from "./types";
|
|
@@ -282,6 +282,7 @@ export interface StudioSceneResponse {
|
|
|
282
282
|
functions: StudioSceneFunction[];
|
|
283
283
|
/** Absent in responses from backends predating the Variables feature. */
|
|
284
284
|
variables?: StudioSceneVariable[];
|
|
285
|
+
is_free_tier?: boolean;
|
|
285
286
|
meta: {
|
|
286
287
|
request_id: string;
|
|
287
288
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VIRO_VERSION = "2.57.
|
|
1
|
+
export declare const VIRO_VERSION = "2.57.4";
|
|
@@ -47,6 +47,8 @@ export declare const ViroXRSceneNavigator: React.ForwardRefExoticComponent<ViewP
|
|
|
47
47
|
autofocus?: boolean;
|
|
48
48
|
videoQuality?: "High" | "Low";
|
|
49
49
|
numberOfTrackedImages?: number;
|
|
50
|
+
/** AR depth/people occlusion. Flows via ...rest to ViroARSceneNavigator. */
|
|
51
|
+
occlusionMode?: "peopleOnly" | "depthBased";
|
|
50
52
|
vrModeEnabled?: boolean;
|
|
51
53
|
passthroughEnabled?: boolean;
|
|
52
54
|
handTrackingEnabled?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -81,4 +81,4 @@ import { StreamingAudioManager } from "./components/Utilities/StreamingAudioMana
|
|
|
81
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
82
|
export type { VRModuleOpenXRType, ViroPassthroughStyle };
|
|
83
83
|
export type { ImmersiveSpaceStyle } from "./components/VisionOS/ViroVisionOSModule";
|
|
84
|
-
export type { StudioSceneResponse, StudioAsset, StudioAnimation, StudioCollisionBinding, StudioSceneFunction, StudioSceneMeta, StudioProjectMeta, } from "./components/Studio";
|
|
84
|
+
export type { StudioSceneResponse, StudioAsset, StudioAnimation, StudioCollisionBinding, StudioSceneFunction, StudioSceneMeta, StudioProjectMeta, StudioSceneNavigatorHandle, StudioSceneNavigatorProps, } from "./components/Studio";
|
package/index.ts
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RVStudioWatermarkState.h
|
|
3
|
+
// ViroReact
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
#import <Foundation/Foundation.h>
|
|
7
|
+
|
|
8
|
+
// Process-wide source of truth for the Free-tier "Powered by ReactVision
|
|
9
|
+
// Studio" watermark. Written only from the native rvGetScene response, never
|
|
10
|
+
// from JS, so a consumer cannot strip the watermark by editing JS.
|
|
11
|
+
|
|
12
|
+
/// Posted on the main queue whenever `freeTier` changes.
|
|
13
|
+
extern NSString *const RVStudioWatermarkDidChangeNotification;
|
|
14
|
+
|
|
15
|
+
@interface RVStudioWatermarkState : NSObject
|
|
16
|
+
|
|
17
|
+
@property (atomic, assign, readonly) BOOL freeTier;
|
|
18
|
+
|
|
19
|
+
+ (instancetype)sharedState;
|
|
20
|
+
|
|
21
|
+
/// Parses an rvGetScene resolve payload ({ success, data }) and updates
|
|
22
|
+
/// `freeTier` from its `is_free_tier` field.
|
|
23
|
+
- (void)updateFromSceneResponse:(NSDictionary *)response;
|
|
24
|
+
|
|
25
|
+
@end
|
|
Binary file
|