@relu-interactives/spatial-ecs 0.4.5 → 0.5.1

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 (47) hide show
  1. package/dist/{System-ln4Q7Eot.d.cts → System-V_mv07le.d.cts} +2 -2
  2. package/dist/{System-ln4Q7Eot.d.ts → System-V_mv07le.d.ts} +2 -2
  3. package/dist/{XRHandPose-CxPv-LBo.d.cts → XRHandPose-CQTLGxFC.d.cts} +218 -2
  4. package/dist/{XRHandPose-BImIa4ZS.d.ts → XRHandPose-CU3vNFuS.d.ts} +218 -2
  5. package/dist/{chunk-4AK4I3QF.js → chunk-BUEKOSR5.js} +102 -3
  6. package/dist/chunk-BUEKOSR5.js.map +1 -0
  7. package/dist/{chunk-QIIWFP3V.js → chunk-Q52ADLF7.js} +1255 -18
  8. package/dist/chunk-Q52ADLF7.js.map +1 -0
  9. package/dist/{chunk-SGADE55G.js → chunk-RXBLOO5B.js} +249 -90
  10. package/dist/chunk-RXBLOO5B.js.map +1 -0
  11. package/dist/{chunk-4DWZK4X4.js → chunk-WJD2VKEH.js} +3 -3
  12. package/dist/chunk-WJD2VKEH.js.map +1 -0
  13. package/dist/components/index.cjs +99 -0
  14. package/dist/components/index.cjs.map +1 -1
  15. package/dist/components/index.d.cts +3 -3
  16. package/dist/components/index.d.ts +3 -3
  17. package/dist/components/index.js +1 -1
  18. package/dist/docs/guide/spatial-ui.md +165 -0
  19. package/dist/factories/index.cjs +372 -114
  20. package/dist/factories/index.cjs.map +1 -1
  21. package/dist/factories/index.d.cts +13 -3
  22. package/dist/factories/index.d.ts +13 -3
  23. package/dist/factories/index.js +3 -3
  24. package/dist/{index-CuGqxuk-.d.ts → index-C3ik3sA1.d.ts} +16 -3
  25. package/dist/{index-BphKHaV-.d.ts → index-D2Jt_JzH.d.ts} +156 -3
  26. package/dist/{index-CH7qMsQT.d.cts → index-DaG03vyN.d.cts} +156 -3
  27. package/dist/{index-CQsHUez3.d.cts → index-Dlr-7-4m.d.cts} +16 -3
  28. package/dist/index.cjs +1864 -360
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.d.cts +42 -9
  31. package/dist/index.d.ts +42 -9
  32. package/dist/index.js +10 -8
  33. package/dist/index.js.map +1 -1
  34. package/dist/systems/index.cjs +1346 -13
  35. package/dist/systems/index.cjs.map +1 -1
  36. package/dist/systems/index.d.cts +2 -2
  37. package/dist/systems/index.d.ts +2 -2
  38. package/dist/systems/index.js +3 -3
  39. package/dist/types.d.cts +1 -1
  40. package/dist/types.d.ts +1 -1
  41. package/dist/worldSnapshotUtils.d.cts +1 -1
  42. package/dist/worldSnapshotUtils.d.ts +1 -1
  43. package/package.json +1 -1
  44. package/dist/chunk-4AK4I3QF.js.map +0 -1
  45. package/dist/chunk-4DWZK4X4.js.map +0 -1
  46. package/dist/chunk-QIIWFP3V.js.map +0 -1
  47. package/dist/chunk-SGADE55G.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { A as AnimationComponent, b as AudioComponent, c as CameraComponentOptions, C as CameraComponent, U as RigidbodyState, g as ColliderState, P as PhysicsComponent, p as EntityType, I as ImageComponent, r as ImageTargetAnchor, q as ImageTarget, L as LightComponent, M as MaterialComponent, F as MeshComponent, G as MeshGeometryComponent, K as ModelComponent, N as Name, O as Object3DRef, X as ScriptEntry, W as ScriptComponent, Z as ScriptObjectComponentInput, Y as ScriptObjectComponent, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, x as InstancedMeshKind, H as MeshGeometryParameters, w as InstancedMeshComponent, u as InstanceSlotComponent, a7 as VideoComponent, ai as XRRigComponent, a5 as VRTeleportAreaComponent, ab as XRHandPoseComponent, a9 as XRAnchorComponent, ad as XRInteractableComponent, af as XRInteractorComponent, ah as XRInteractorSideComponent } from '../XRHandPose-CxPv-LBo.cjs';
2
- import { l as World, g as EnvironmentState, E as Environment, P as ParentId, i as PostprocessingState, h as Postprocessing, T as TransformComponent, O as ObjectManagementSystem } from '../System-ln4Q7Eot.cjs';
1
+ import { A as AnimationComponent, b as AudioComponent, c as CameraComponentOptions, C as CameraComponent, U as RigidbodyState, g as ColliderState, P as PhysicsComponent, p as EntityType, I as ImageComponent, r as ImageTargetAnchor, q as ImageTarget, L as LightComponent, M as MaterialComponent, F as MeshComponent, G as MeshGeometryComponent, K as ModelComponent, N as Name, O as Object3DRef, X as ScriptEntry, W as ScriptComponent, Z as ScriptObjectComponentInput, Y as ScriptObjectComponent, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, x as InstancedMeshKind, H as MeshGeometryParameters, w as InstancedMeshComponent, u as InstanceSlotComponent, ak as VideoComponent, av as XRRigComponent, ai as VRTeleportAreaComponent, ao as XRHandPoseComponent, am as XRAnchorComponent, aq as XRInteractableComponent, as as XRInteractorComponent, au as XRInteractorSideComponent, a5 as UIButtonComponent, a7 as UIPanelComponent, a9 as UISliderComponent, ab as UITextComponent, ad as UIToggleComponent } from '../XRHandPose-CQTLGxFC.cjs';
2
+ import { l as World, g as EnvironmentState, E as Environment, P as ParentId, i as PostprocessingState, h as Postprocessing, T as TransformComponent, O as ObjectManagementSystem } from '../System-V_mv07le.cjs';
3
3
  import * as THREE from 'three';
4
4
  import '@dimforge/rapier3d-compat';
5
5
  import '../handPose-DlcTtqgx.cjs';
@@ -89,8 +89,18 @@ declare function createXRInteractorComponent(world: World, entityId: number, ...
89
89
 
90
90
  declare function createXRInteractorSideComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof XRInteractorSideComponent>): XRInteractorSideComponent;
91
91
 
92
+ declare function createUIButtonComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof UIButtonComponent>): UIButtonComponent;
93
+
94
+ declare function createUIPanelComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof UIPanelComponent>): UIPanelComponent;
95
+
96
+ declare function createUISliderComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof UISliderComponent>): UISliderComponent;
97
+
98
+ declare function createUITextComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof UITextComponent>): UITextComponent;
99
+
100
+ declare function createUIToggleComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof UIToggleComponent>): UIToggleComponent;
101
+
92
102
  declare function registerDefaultComponentFactories(objectManagementSystem: ObjectManagementSystem): void;
93
103
 
94
104
  declare function registerDefaultFactories(objectManagementSystem: ObjectManagementSystem): void;
95
105
 
96
- export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVRTeleportAreaComponent, createVideoComponent, createXRAnchorComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories };
106
+ export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createUIButtonComponent, createUIPanelComponent, createUISliderComponent, createUITextComponent, createUIToggleComponent, createVRTeleportAreaComponent, createVideoComponent, createXRAnchorComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories };
@@ -1,5 +1,5 @@
1
- import { A as AnimationComponent, b as AudioComponent, c as CameraComponentOptions, C as CameraComponent, U as RigidbodyState, g as ColliderState, P as PhysicsComponent, p as EntityType, I as ImageComponent, r as ImageTargetAnchor, q as ImageTarget, L as LightComponent, M as MaterialComponent, F as MeshComponent, G as MeshGeometryComponent, K as ModelComponent, N as Name, O as Object3DRef, X as ScriptEntry, W as ScriptComponent, Z as ScriptObjectComponentInput, Y as ScriptObjectComponent, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, x as InstancedMeshKind, H as MeshGeometryParameters, w as InstancedMeshComponent, u as InstanceSlotComponent, a7 as VideoComponent, ai as XRRigComponent, a5 as VRTeleportAreaComponent, ab as XRHandPoseComponent, a9 as XRAnchorComponent, ad as XRInteractableComponent, af as XRInteractorComponent, ah as XRInteractorSideComponent } from '../XRHandPose-BImIa4ZS.js';
2
- import { l as World, g as EnvironmentState, E as Environment, P as ParentId, i as PostprocessingState, h as Postprocessing, T as TransformComponent, O as ObjectManagementSystem } from '../System-ln4Q7Eot.js';
1
+ import { A as AnimationComponent, b as AudioComponent, c as CameraComponentOptions, C as CameraComponent, U as RigidbodyState, g as ColliderState, P as PhysicsComponent, p as EntityType, I as ImageComponent, r as ImageTargetAnchor, q as ImageTarget, L as LightComponent, M as MaterialComponent, F as MeshComponent, G as MeshGeometryComponent, K as ModelComponent, N as Name, O as Object3DRef, X as ScriptEntry, W as ScriptComponent, Z as ScriptObjectComponentInput, Y as ScriptObjectComponent, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, x as InstancedMeshKind, H as MeshGeometryParameters, w as InstancedMeshComponent, u as InstanceSlotComponent, ak as VideoComponent, av as XRRigComponent, ai as VRTeleportAreaComponent, ao as XRHandPoseComponent, am as XRAnchorComponent, aq as XRInteractableComponent, as as XRInteractorComponent, au as XRInteractorSideComponent, a5 as UIButtonComponent, a7 as UIPanelComponent, a9 as UISliderComponent, ab as UITextComponent, ad as UIToggleComponent } from '../XRHandPose-CU3vNFuS.js';
2
+ import { l as World, g as EnvironmentState, E as Environment, P as ParentId, i as PostprocessingState, h as Postprocessing, T as TransformComponent, O as ObjectManagementSystem } from '../System-V_mv07le.js';
3
3
  import * as THREE from 'three';
4
4
  import '@dimforge/rapier3d-compat';
5
5
  import '../handPose-DlcTtqgx.js';
@@ -89,8 +89,18 @@ declare function createXRInteractorComponent(world: World, entityId: number, ...
89
89
 
90
90
  declare function createXRInteractorSideComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof XRInteractorSideComponent>): XRInteractorSideComponent;
91
91
 
92
+ declare function createUIButtonComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof UIButtonComponent>): UIButtonComponent;
93
+
94
+ declare function createUIPanelComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof UIPanelComponent>): UIPanelComponent;
95
+
96
+ declare function createUISliderComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof UISliderComponent>): UISliderComponent;
97
+
98
+ declare function createUITextComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof UITextComponent>): UITextComponent;
99
+
100
+ declare function createUIToggleComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof UIToggleComponent>): UIToggleComponent;
101
+
92
102
  declare function registerDefaultComponentFactories(objectManagementSystem: ObjectManagementSystem): void;
93
103
 
94
104
  declare function registerDefaultFactories(objectManagementSystem: ObjectManagementSystem): void;
95
105
 
96
- export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVRTeleportAreaComponent, createVideoComponent, createXRAnchorComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories };
106
+ export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createUIButtonComponent, createUIPanelComponent, createUISliderComponent, createUITextComponent, createUIToggleComponent, createVRTeleportAreaComponent, createVideoComponent, createXRAnchorComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories };
@@ -1,6 +1,6 @@
1
- export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVRTeleportAreaComponent, createVideoComponent, createXRAnchorComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories } from '../chunk-SGADE55G.js';
2
- import '../chunk-4DWZK4X4.js';
3
- import '../chunk-4AK4I3QF.js';
1
+ export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createUIButtonComponent, createUIPanelComponent, createUISliderComponent, createUITextComponent, createUIToggleComponent, createVRTeleportAreaComponent, createVideoComponent, createXRAnchorComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories } from '../chunk-RXBLOO5B.js';
2
+ import '../chunk-WJD2VKEH.js';
3
+ import '../chunk-BUEKOSR5.js';
4
4
  import '../chunk-OY7ZODZP.js';
5
5
  //# sourceMappingURL=index.js.map
6
6
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
- import { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_INSTANCED_MESH_PARAMETERS, j as DEFAULT_INSTANCE_TRANSFORM, k as DEFAULT_MESH_GEOMETRY_PARAMETERS, l as DEFAULT_PHYSICS_STATE, m as DEFAULT_POSE_CURLS, n as DEFAULT_POSE_DIRECTIONS, o as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind, p as EntityType, I as ImageComponent, q as ImageTarget, r as ImageTargetAnchor, s as ImageTargetAnchorOptions, t as ImageTargetReference, u as InstanceSlotComponent, v as InstanceTransform, w as InstancedMeshComponent, x as InstancedMeshKind, L as LightComponent, y as LightValueState, M as MaterialComponent, z as MaterialTypeValue, B as MaterialValueState, F as MeshComponent, G as MeshGeometryComponent, H as MeshGeometryParameters, J as MeshGeometryParametersByKind, K as ModelComponent, N as Name, O as Object3DRef, P as PhysicsComponent, Q as PhysicsState, R as PlaneMeshParameters, S as RadiusHeightMeshParameters, T as RadiusMeshParameters, U as RigidbodyState, V as RigidbodyType, W as ScriptComponent, X as ScriptEntry, Y as ScriptObjectComponent, Z as ScriptObjectComponentInput, _ as ScriptObjectRuntimeState, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, a2 as TextureFilteringValue, a3 as TransformModeValue, a4 as TransformSpaceValue, a5 as VRTeleportAreaComponent, a6 as VRTeleportAreaOptions, a7 as VideoComponent, a8 as VrTeleportShape, a9 as XRAnchorComponent, aa as XRAnchorOptions, ab as XRHandPoseComponent, ac as XRHandPoseOptions, ad as XRInteractableComponent, ae as XRInteractableOptions, af as XRInteractorComponent, ag as XRInteractorOptions, ah as XRInteractorSideComponent, ai as XRRigComponent, aj as XRRigOptions, ak as XrAttachPoint, al as XrDistanceGrabBehavior, am as XrEnvironmentPhysics, an as XrGrabGesture, ao as XrGrabHands, ap as XrGrabReach, aq as XrHandPoseEntry, ar as XrHandPreset, as as XrInteractorSide, at as XrInteractorType, au as XrLocomotionMode, av as XrTrackingOrigin, aw as XrTwoHandRotation, ax as createAttachPoint, ay as createHandPoseEntry, az as defaultMaterialValue, aA as handPoseDefinitionFor, aB as normalizePhysicsState, aC as setPhysicsLiveRef } from './XRHandPose-BImIa4ZS.js';
2
- import { C as Component, D as DEFAULT_ENVIRONMENT_STATE, a as DEFAULT_POSTPROCESSING_STATE, E as Environment, b as EnvironmentFogState, c as EnvironmentFogType, d as EnvironmentGradientEffect, e as EnvironmentSkyboxState, f as EnvironmentSkyboxType, g as EnvironmentState, P as ParentId, h as Postprocessing, i as PostprocessingState, T as TransformComponent, j as TransformData, V as Vec3 } from './System-ln4Q7Eot.js';
1
+ import { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_INSTANCED_MESH_PARAMETERS, j as DEFAULT_INSTANCE_TRANSFORM, k as DEFAULT_MESH_GEOMETRY_PARAMETERS, l as DEFAULT_PHYSICS_STATE, m as DEFAULT_POSE_CURLS, n as DEFAULT_POSE_DIRECTIONS, o as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind, p as EntityType, I as ImageComponent, q as ImageTarget, r as ImageTargetAnchor, s as ImageTargetAnchorOptions, t as ImageTargetReference, u as InstanceSlotComponent, v as InstanceTransform, w as InstancedMeshComponent, x as InstancedMeshKind, L as LightComponent, y as LightValueState, M as MaterialComponent, z as MaterialTypeValue, B as MaterialValueState, F as MeshComponent, G as MeshGeometryComponent, H as MeshGeometryParameters, J as MeshGeometryParametersByKind, K as ModelComponent, N as Name, O as Object3DRef, P as PhysicsComponent, Q as PhysicsState, R as PlaneMeshParameters, S as RadiusHeightMeshParameters, T as RadiusMeshParameters, U as RigidbodyState, V as RigidbodyType, W as ScriptComponent, X as ScriptEntry, Y as ScriptObjectComponent, Z as ScriptObjectComponentInput, _ as ScriptObjectRuntimeState, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, a2 as TextureFilteringValue, a3 as TransformModeValue, a4 as TransformSpaceValue, a5 as UIButtonComponent, a6 as UIButtonOptions, a7 as UIPanelComponent, a8 as UIPanelOptions, a9 as UISliderComponent, aa as UISliderOptions, ab as UITextComponent, ac as UITextOptions, ad as UIToggleComponent, ae as UIToggleOptions, af as UiFollowMode, ag as UiTextAlign, ah as UiTextVAlign, ai as VRTeleportAreaComponent, aj as VRTeleportAreaOptions, ak as VideoComponent, al as VrTeleportShape, am as XRAnchorComponent, an as XRAnchorOptions, ao as XRHandPoseComponent, ap as XRHandPoseOptions, aq as XRInteractableComponent, ar as XRInteractableOptions, as as XRInteractorComponent, at as XRInteractorOptions, au as XRInteractorSideComponent, av as XRRigComponent, aw as XRRigOptions, ax as XrAttachPoint, ay as XrDistanceGrabBehavior, az as XrEnvironmentPhysics, aA as XrGrabGesture, aB as XrGrabHands, aC as XrGrabReach, aD as XrHandPoseEntry, aE as XrHandPreset, aF as XrInteractorSide, aG as XrInteractorType, aH as XrLocomotionMode, aI as XrTrackingOrigin, aJ as XrTwoHandRotation, aK as createAttachPoint, aL as createHandPoseEntry, aM as defaultMaterialValue, aN as handPoseDefinitionFor, aO as normalizePhysicsState, aP as setPhysicsLiveRef } from './XRHandPose-CU3vNFuS.js';
2
+ import { C as Component, D as DEFAULT_ENVIRONMENT_STATE, a as DEFAULT_POSTPROCESSING_STATE, E as Environment, b as EnvironmentFogState, c as EnvironmentFogType, d as EnvironmentGradientEffect, e as EnvironmentSkyboxState, f as EnvironmentSkyboxType, g as EnvironmentState, P as ParentId, h as Postprocessing, i as PostprocessingState, T as TransformComponent, j as TransformData, V as Vec3 } from './System-V_mv07le.js';
3
3
 
4
4
  /**
5
5
  * Marks the ROOT entity of a prefab instance and records its link to the
@@ -176,6 +176,19 @@ declare const index_TransformComponent: typeof TransformComponent;
176
176
  declare const index_TransformData: typeof TransformData;
177
177
  declare const index_TransformModeValue: typeof TransformModeValue;
178
178
  declare const index_TransformSpaceValue: typeof TransformSpaceValue;
179
+ declare const index_UIButtonComponent: typeof UIButtonComponent;
180
+ declare const index_UIButtonOptions: typeof UIButtonOptions;
181
+ declare const index_UIPanelComponent: typeof UIPanelComponent;
182
+ declare const index_UIPanelOptions: typeof UIPanelOptions;
183
+ declare const index_UISliderComponent: typeof UISliderComponent;
184
+ declare const index_UISliderOptions: typeof UISliderOptions;
185
+ declare const index_UITextComponent: typeof UITextComponent;
186
+ declare const index_UITextOptions: typeof UITextOptions;
187
+ declare const index_UIToggleComponent: typeof UIToggleComponent;
188
+ declare const index_UIToggleOptions: typeof UIToggleOptions;
189
+ declare const index_UiFollowMode: typeof UiFollowMode;
190
+ declare const index_UiTextAlign: typeof UiTextAlign;
191
+ declare const index_UiTextVAlign: typeof UiTextVAlign;
179
192
  declare const index_VRTeleportAreaComponent: typeof VRTeleportAreaComponent;
180
193
  declare const index_VRTeleportAreaOptions: typeof VRTeleportAreaOptions;
181
194
  declare const index_Vec3: typeof Vec3;
@@ -216,7 +229,7 @@ declare const index_handPoseDefinitionFor: typeof handPoseDefinitionFor;
216
229
  declare const index_normalizePhysicsState: typeof normalizePhysicsState;
217
230
  declare const index_setPhysicsLiveRef: typeof setPhysicsLiveRef;
218
231
  declare namespace index {
219
- export { index_AnimationComponent as AnimationComponent, index_AnimationComponentOptions as AnimationComponentOptions, index_AudioComponent as AudioComponent, index_CameraComponent as CameraComponent, index_CameraComponentOptions as CameraComponentOptions, index_CameraProjection as CameraProjection, index_CameraRuntimeType as CameraRuntimeType, index_ColliderShape as ColliderShape, index_ColliderState as ColliderState, index_CubeMeshParameters as CubeMeshParameters, index_DEFAULT_COLLIDER_STATE as DEFAULT_COLLIDER_STATE, index_DEFAULT_ENVIRONMENT_STATE as DEFAULT_ENVIRONMENT_STATE, index_DEFAULT_INSTANCED_MESH_PARAMETERS as DEFAULT_INSTANCED_MESH_PARAMETERS, index_DEFAULT_INSTANCE_TRANSFORM as DEFAULT_INSTANCE_TRANSFORM, index_DEFAULT_MESH_GEOMETRY_PARAMETERS as DEFAULT_MESH_GEOMETRY_PARAMETERS, index_DEFAULT_PHYSICS_STATE as DEFAULT_PHYSICS_STATE, index_DEFAULT_POSE_CURLS as DEFAULT_POSE_CURLS, index_DEFAULT_POSE_DIRECTIONS as DEFAULT_POSE_DIRECTIONS, index_DEFAULT_POSTPROCESSING_STATE as DEFAULT_POSTPROCESSING_STATE, index_DEFAULT_RIGIDBODY_STATE as DEFAULT_RIGIDBODY_STATE, index_EditableMeshObjectKind as EditableMeshObjectKind, index_EntityType as EntityType, index_Environment as Environment, index_EnvironmentFogState as EnvironmentFogState, index_EnvironmentFogType as EnvironmentFogType, index_EnvironmentGradientEffect as EnvironmentGradientEffect, index_EnvironmentSkyboxState as EnvironmentSkyboxState, index_EnvironmentSkyboxType as EnvironmentSkyboxType, index_EnvironmentState as EnvironmentState, index_ImageComponent as ImageComponent, index_ImageTarget as ImageTarget, index_ImageTargetAnchor as ImageTargetAnchor, index_ImageTargetAnchorOptions as ImageTargetAnchorOptions, index_ImageTargetReference as ImageTargetReference, index_InstanceSlotComponent as InstanceSlotComponent, index_InstanceTransform as InstanceTransform, index_InstancedMeshComponent as InstancedMeshComponent, index_InstancedMeshKind as InstancedMeshKind, index_LightComponent as LightComponent, index_LightValueState as LightValueState, index_MaterialComponent as MaterialComponent, index_MaterialTypeValue as MaterialTypeValue, index_MaterialValueState as MaterialValueState, index_MeshComponent as MeshComponent, index_MeshGeometryComponent as MeshGeometryComponent, index_MeshGeometryParameters as MeshGeometryParameters, index_MeshGeometryParametersByKind as MeshGeometryParametersByKind, index_ModelComponent as ModelComponent, index_Name as Name, index_Object3DRef as Object3DRef, index_ParentId as ParentId, index_PhysicsComponent as PhysicsComponent, index_PhysicsState as PhysicsState, index_PlaneMeshParameters as PlaneMeshParameters, index_Postprocessing as Postprocessing, index_PostprocessingState as PostprocessingState, index_PrefabInstance as PrefabInstance, index_PrefabNode as PrefabNode, index_RadiusHeightMeshParameters as RadiusHeightMeshParameters, index_RadiusMeshParameters as RadiusMeshParameters, index_RigidbodyState as RigidbodyState, index_RigidbodyType as RigidbodyType, index_ScriptComponent as ScriptComponent, index_ScriptEntry as ScriptEntry, index_ScriptObjectComponent as ScriptObjectComponent, index_ScriptObjectComponentInput as ScriptObjectComponentInput, index_ScriptObjectRuntimeState as ScriptObjectRuntimeState, index_Selectable as Selectable, index_SelectionTransformState as SelectionTransformState, index_SpriteComponent as SpriteComponent, index_TextureFilteringValue as TextureFilteringValue, index_TransformComponent as TransformComponent, index_TransformData as TransformData, index_TransformModeValue as TransformModeValue, index_TransformSpaceValue as TransformSpaceValue, index_VRTeleportAreaComponent as VRTeleportAreaComponent, index_VRTeleportAreaOptions as VRTeleportAreaOptions, index_Vec3 as Vec3, index_VideoComponent as VideoComponent, index_VrTeleportShape as VrTeleportShape, index_XRAnchorComponent as XRAnchorComponent, index_XRAnchorOptions as XRAnchorOptions, index_XREnvironmentComponent as XREnvironmentComponent, index_XRHandPoseComponent as XRHandPoseComponent, index_XRHandPoseOptions as XRHandPoseOptions, index_XRInteractableComponent as XRInteractableComponent, index_XRInteractableOptions as XRInteractableOptions, index_XRInteractorComponent as XRInteractorComponent, index_XRInteractorOptions as XRInteractorOptions, index_XRInteractorSideComponent as XRInteractorSideComponent, index_XRRigComponent as XRRigComponent, index_XRRigOptions as XRRigOptions, index_XrAttachPoint as XrAttachPoint, index_XrDistanceGrabBehavior as XrDistanceGrabBehavior, type index_XrEnvironmentKind as XrEnvironmentKind, type index_XrEnvironmentOrientation as XrEnvironmentOrientation, index_XrEnvironmentPhysics as XrEnvironmentPhysics, index_XrGrabGesture as XrGrabGesture, index_XrGrabHands as XrGrabHands, index_XrGrabReach as XrGrabReach, index_XrHandPoseEntry as XrHandPoseEntry, index_XrHandPreset as XrHandPreset, index_XrInteractorSide as XrInteractorSide, index_XrInteractorType as XrInteractorType, index_XrLocomotionMode as XrLocomotionMode, index_XrTrackingOrigin as XrTrackingOrigin, index_XrTwoHandRotation as XrTwoHandRotation, index_createAttachPoint as createAttachPoint, index_createHandPoseEntry as createHandPoseEntry, index_defaultMaterialValue as defaultMaterialValue, index_handPoseDefinitionFor as handPoseDefinitionFor, index_normalizePhysicsState as normalizePhysicsState, index_setPhysicsLiveRef as setPhysicsLiveRef };
232
+ export { index_AnimationComponent as AnimationComponent, index_AnimationComponentOptions as AnimationComponentOptions, index_AudioComponent as AudioComponent, index_CameraComponent as CameraComponent, index_CameraComponentOptions as CameraComponentOptions, index_CameraProjection as CameraProjection, index_CameraRuntimeType as CameraRuntimeType, index_ColliderShape as ColliderShape, index_ColliderState as ColliderState, index_CubeMeshParameters as CubeMeshParameters, index_DEFAULT_COLLIDER_STATE as DEFAULT_COLLIDER_STATE, index_DEFAULT_ENVIRONMENT_STATE as DEFAULT_ENVIRONMENT_STATE, index_DEFAULT_INSTANCED_MESH_PARAMETERS as DEFAULT_INSTANCED_MESH_PARAMETERS, index_DEFAULT_INSTANCE_TRANSFORM as DEFAULT_INSTANCE_TRANSFORM, index_DEFAULT_MESH_GEOMETRY_PARAMETERS as DEFAULT_MESH_GEOMETRY_PARAMETERS, index_DEFAULT_PHYSICS_STATE as DEFAULT_PHYSICS_STATE, index_DEFAULT_POSE_CURLS as DEFAULT_POSE_CURLS, index_DEFAULT_POSE_DIRECTIONS as DEFAULT_POSE_DIRECTIONS, index_DEFAULT_POSTPROCESSING_STATE as DEFAULT_POSTPROCESSING_STATE, index_DEFAULT_RIGIDBODY_STATE as DEFAULT_RIGIDBODY_STATE, index_EditableMeshObjectKind as EditableMeshObjectKind, index_EntityType as EntityType, index_Environment as Environment, index_EnvironmentFogState as EnvironmentFogState, index_EnvironmentFogType as EnvironmentFogType, index_EnvironmentGradientEffect as EnvironmentGradientEffect, index_EnvironmentSkyboxState as EnvironmentSkyboxState, index_EnvironmentSkyboxType as EnvironmentSkyboxType, index_EnvironmentState as EnvironmentState, index_ImageComponent as ImageComponent, index_ImageTarget as ImageTarget, index_ImageTargetAnchor as ImageTargetAnchor, index_ImageTargetAnchorOptions as ImageTargetAnchorOptions, index_ImageTargetReference as ImageTargetReference, index_InstanceSlotComponent as InstanceSlotComponent, index_InstanceTransform as InstanceTransform, index_InstancedMeshComponent as InstancedMeshComponent, index_InstancedMeshKind as InstancedMeshKind, index_LightComponent as LightComponent, index_LightValueState as LightValueState, index_MaterialComponent as MaterialComponent, index_MaterialTypeValue as MaterialTypeValue, index_MaterialValueState as MaterialValueState, index_MeshComponent as MeshComponent, index_MeshGeometryComponent as MeshGeometryComponent, index_MeshGeometryParameters as MeshGeometryParameters, index_MeshGeometryParametersByKind as MeshGeometryParametersByKind, index_ModelComponent as ModelComponent, index_Name as Name, index_Object3DRef as Object3DRef, index_ParentId as ParentId, index_PhysicsComponent as PhysicsComponent, index_PhysicsState as PhysicsState, index_PlaneMeshParameters as PlaneMeshParameters, index_Postprocessing as Postprocessing, index_PostprocessingState as PostprocessingState, index_PrefabInstance as PrefabInstance, index_PrefabNode as PrefabNode, index_RadiusHeightMeshParameters as RadiusHeightMeshParameters, index_RadiusMeshParameters as RadiusMeshParameters, index_RigidbodyState as RigidbodyState, index_RigidbodyType as RigidbodyType, index_ScriptComponent as ScriptComponent, index_ScriptEntry as ScriptEntry, index_ScriptObjectComponent as ScriptObjectComponent, index_ScriptObjectComponentInput as ScriptObjectComponentInput, index_ScriptObjectRuntimeState as ScriptObjectRuntimeState, index_Selectable as Selectable, index_SelectionTransformState as SelectionTransformState, index_SpriteComponent as SpriteComponent, index_TextureFilteringValue as TextureFilteringValue, index_TransformComponent as TransformComponent, index_TransformData as TransformData, index_TransformModeValue as TransformModeValue, index_TransformSpaceValue as TransformSpaceValue, index_UIButtonComponent as UIButtonComponent, index_UIButtonOptions as UIButtonOptions, index_UIPanelComponent as UIPanelComponent, index_UIPanelOptions as UIPanelOptions, index_UISliderComponent as UISliderComponent, index_UISliderOptions as UISliderOptions, index_UITextComponent as UITextComponent, index_UITextOptions as UITextOptions, index_UIToggleComponent as UIToggleComponent, index_UIToggleOptions as UIToggleOptions, index_UiFollowMode as UiFollowMode, index_UiTextAlign as UiTextAlign, index_UiTextVAlign as UiTextVAlign, index_VRTeleportAreaComponent as VRTeleportAreaComponent, index_VRTeleportAreaOptions as VRTeleportAreaOptions, index_Vec3 as Vec3, index_VideoComponent as VideoComponent, index_VrTeleportShape as VrTeleportShape, index_XRAnchorComponent as XRAnchorComponent, index_XRAnchorOptions as XRAnchorOptions, index_XREnvironmentComponent as XREnvironmentComponent, index_XRHandPoseComponent as XRHandPoseComponent, index_XRHandPoseOptions as XRHandPoseOptions, index_XRInteractableComponent as XRInteractableComponent, index_XRInteractableOptions as XRInteractableOptions, index_XRInteractorComponent as XRInteractorComponent, index_XRInteractorOptions as XRInteractorOptions, index_XRInteractorSideComponent as XRInteractorSideComponent, index_XRRigComponent as XRRigComponent, index_XRRigOptions as XRRigOptions, index_XrAttachPoint as XrAttachPoint, index_XrDistanceGrabBehavior as XrDistanceGrabBehavior, type index_XrEnvironmentKind as XrEnvironmentKind, type index_XrEnvironmentOrientation as XrEnvironmentOrientation, index_XrEnvironmentPhysics as XrEnvironmentPhysics, index_XrGrabGesture as XrGrabGesture, index_XrGrabHands as XrGrabHands, index_XrGrabReach as XrGrabReach, index_XrHandPoseEntry as XrHandPoseEntry, index_XrHandPreset as XrHandPreset, index_XrInteractorSide as XrInteractorSide, index_XrInteractorType as XrInteractorType, index_XrLocomotionMode as XrLocomotionMode, index_XrTrackingOrigin as XrTrackingOrigin, index_XrTwoHandRotation as XrTwoHandRotation, index_createAttachPoint as createAttachPoint, index_createHandPoseEntry as createHandPoseEntry, index_defaultMaterialValue as defaultMaterialValue, index_handPoseDefinitionFor as handPoseDefinitionFor, index_normalizePhysicsState as normalizePhysicsState, index_setPhysicsLiveRef as setPhysicsLiveRef };
220
233
  }
221
234
 
222
235
  export { PrefabInstance as P, XREnvironmentComponent as X, PrefabNode as a, type XrEnvironmentKind as b, type XrEnvironmentOrientation as c, index as i };
@@ -1,4 +1,4 @@
1
- import { k as EcsSystem, l as World, r as EntityId } from './System-ln4Q7Eot.js';
1
+ import { k as EcsSystem, l as World, I as InputSystem, r as EntityId } from './System-V_mv07le.js';
2
2
  import * as THREE from 'three';
3
3
  import { m as XrHandJoints, r as XrHandShape } from './handPose-DlcTtqgx.js';
4
4
 
@@ -426,6 +426,7 @@ declare class XRInteractionSystem implements EcsSystem {
426
426
  private readonly grabs;
427
427
  private hoveredEntityId;
428
428
  /** Per-hand hover, with the hit distance so the ray can stop at the surface. */
429
+ private readonly busyContributors;
429
430
  private readonly hovers;
430
431
  /** Monotonic seconds, accumulated from deltaTime for velocity sampling. */
431
432
  private elapsed;
@@ -529,6 +530,14 @@ declare class XRInteractionSystem implements EcsSystem {
529
530
  * grabbed and teleported.
530
531
  */
531
532
  isSourceBusy(world: World, input: XrInputState): boolean;
533
+ /** OR-ed into isSourceBusy; see the comment there. */
534
+ registerBusyContributor(contributor: (world: World, input: XrInputState) => boolean): void;
535
+ /** Hover for a specific input source (handedness-free — Vision Pro's
536
+ * transient pointers all report handedness "none"). */
537
+ getHoverForInput(input: XrInputState): {
538
+ entityId: number;
539
+ distance: number;
540
+ } | null;
532
541
  /** True when THIS hand is holding something. */
533
542
  isGrabbingWith(handedness: XrInputState["handedness"]): boolean;
534
543
  /**
@@ -709,12 +718,30 @@ declare class XREnvironmentSystem implements EcsSystem {
709
718
  /** Keyed by the XRPlane/XRMesh object itself — the runtime's own identity. */
710
719
  private readonly planes;
711
720
  private readonly meshes;
721
+ /**
722
+ * Surfaces observed but not yet SPAWNED — their gate is still proving the
723
+ * pose is world-anchored. Creating from an unflagged head-glued pose (seen
724
+ * on-device after a suspend/resume regenerated the scan identities) plants
725
+ * a rotated ghost copy of the room wherever the head happens to be, which
726
+ * the apply-gate then freezes there — wrong forever. So admission itself
727
+ * is gated: a few frames of world-anchored behavior first.
728
+ */
729
+ private readonly pendingPlanes;
730
+ private readonly pendingMeshes;
712
731
  private presenting;
713
732
  private debugVisible;
714
733
  /** Seconds presenting, used to decide the room has genuinely nothing in it. */
715
734
  private elapsed;
716
735
  /** `initiateRoomCapture` may be called only ONCE per session. */
717
736
  private roomCaptureRequested;
737
+ /** This frame's inverse viewer matrix, or null when unavailable. */
738
+ private viewerInverse;
739
+ /** This frame's viewer position in reference space, for room election. */
740
+ private viewerPos;
741
+ /** The ONE global room mesh currently allowed to spawn. */
742
+ private electedGlobalMesh;
743
+ private readonly tmpViewerMatrix;
744
+ private readonly tmpViewPos;
718
745
  update(world: World, deltaTime?: number): void;
719
746
  /**
720
747
  * Ask the runtime to scan the room when it turns out we have no room.
@@ -763,6 +790,28 @@ declare class XREnvironmentSystem implements EcsSystem {
763
790
  private findRig;
764
791
  private syncPlanes;
765
792
  private syncMeshes;
793
+ /**
794
+ * Pick THE room's global mesh: the one whose scan origin is nearest the
795
+ * viewer, sticky to the current choice within a margin so origin jitter
796
+ * can't flap the room. Without a viewer pose (or with a single candidate)
797
+ * the first candidate stands; ties are impossible to break anyway.
798
+ */
799
+ private electGlobalMesh;
800
+ /**
801
+ * Admission control for a NOT-yet-spawned surface. With a viewer pose
802
+ * available, the surface must behave world-anchored for a few frames before
803
+ * an entity is created for it; without one (older runtimes, tests) it is
804
+ * admitted immediately — the gate can't classify anyway. Returns the
805
+ * warmed-up gate (carried into the entry so its motion history survives),
806
+ * or null while the surface must keep waiting.
807
+ */
808
+ private admit;
809
+ /**
810
+ * Run a surface's pose through its head-glue gate: position in reference
811
+ * space vs position relative to the viewer. Without a viewer pose the gate
812
+ * passes everything, degrading to the flag-only behavior.
813
+ */
814
+ private gateAllows;
766
815
  private createPlaneEntity;
767
816
  private applyPlaneCollider;
768
817
  private createMeshEntity;
@@ -776,6 +825,106 @@ declare class XREnvironmentSystem implements EcsSystem {
776
825
  dispose(world: World): void;
777
826
  }
778
827
 
828
+ declare class UIInteractionSystem implements EcsSystem {
829
+ private readonly interaction;
830
+ private readonly inputSystem;
831
+ private readonly xrPresses;
832
+ private mousePress;
833
+ private mouseHover;
834
+ /** entityId → seconds of pressed-tint left to display. */
835
+ private readonly tintFloors;
836
+ private readonly tinted;
837
+ private readonly raycaster;
838
+ /**
839
+ * @param interaction The XR interaction system, or null in a world with no
840
+ * XR (flat 3D experiences) — the mouse path still works via
841
+ * `options.inputSystem`.
842
+ */
843
+ constructor(interaction: XRInteractionSystem | null, options?: {
844
+ inputSystem?: InputSystem;
845
+ });
846
+ update(world: World, deltaTime?: number): void;
847
+ private updateXr;
848
+ private updateMouse;
849
+ private raycastMouse;
850
+ private widgetKind;
851
+ private fire;
852
+ private dragSlider;
853
+ private dragSliderMouse;
854
+ private applySliderPoint;
855
+ private widgetObject;
856
+ private rayHitsWidget;
857
+ private rayPointOnWidget;
858
+ /**
859
+ * Dispatch to the widget's Behaviours, then BUBBLE up the parent chain so a
860
+ * panel script hears its children. Bubbling (not a world broadcast) keeps
861
+ * two spawned copies of the same menu prefab independent.
862
+ */
863
+ private dispatchBubbling;
864
+ private actionIdOf;
865
+ private beginPressTint;
866
+ private endPressTint;
867
+ private updateTints;
868
+ private setTint;
869
+ }
870
+
871
+ /**
872
+ * Renders spatial-UI widgets: panels, text, buttons, toggles and sliders.
873
+ *
874
+ * Lives in `World.setup`'s DEFAULT system list (like `VRTeleportAreaSystem`)
875
+ * so the editor and every runtime render UI with no consumer wiring. Each
876
+ * widget's face is ONE canvas-textured quad, rebuilt only when its style
877
+ * SIGNATURE changes — a canvas redraw plus GPU upload costs 1–3 ms, fine per
878
+ * edit and catastrophic per frame. Interaction state (hover/pressed) never
879
+ * touches the canvas: `UIInteractionSystem` tints the material instead.
880
+ *
881
+ * Toggle knobs and slider knob/fill are separate GEOMETRY positioned from the
882
+ * value each frame, so dragging a slider redraws nothing.
883
+ *
884
+ * Widget SIZE is authored on the component in metres, never via transform
885
+ * scale — the texture is rasterised for the authored size, so scale would
886
+ * stretch texels into blur (and folding live scale into the signature would
887
+ * rebuild every frame during a two-hand scale gesture).
888
+ */
889
+ /** Structural canvas type so tests can inject a stub with no DOM. */
890
+ type UiCanvasLike = {
891
+ width: number;
892
+ height: number;
893
+ getContext(kind: "2d"): CanvasRenderingContext2D | null;
894
+ };
895
+ declare class UIPanelSystem implements EcsSystem {
896
+ private readonly entries;
897
+ private readonly createCanvas;
898
+ constructor(options?: {
899
+ createCanvas?: () => UiCanvasLike;
900
+ });
901
+ update(world: World, deltaTime?: number): void;
902
+ /** All GPU/canvas resources; call on world teardown. */
903
+ dispose(): void;
904
+ private syncPanel;
905
+ private syncText;
906
+ private syncButton;
907
+ private syncToggle;
908
+ private syncSlider;
909
+ private rebuildIfChanged;
910
+ private configureTexture;
911
+ private makeQuad;
912
+ /** A filled disc (or arc segment, for the fill's rounded cap). */
913
+ private makeDisc;
914
+ private addPart;
915
+ /** Remove + dispose knob/fill/cap so a sync pass rebuilds them fresh. */
916
+ private disposeMovingParts;
917
+ /**
918
+ * Billboard: yaw the ENTITY TRANSFORM toward the camera. Writing the
919
+ * Object3D directly would be overwritten by `TransformSyncSystem` (which
920
+ * runs after this system, before render) — the same reason locomotion
921
+ * writes the rig transform. Skipped in the editor so the gizmo and the
922
+ * authored rotation stay in charge while authoring.
923
+ */
924
+ private applyFollow;
925
+ private destroyEntry;
926
+ }
927
+
779
928
  /**
780
929
  * Answers "where does this ray meet the real world?".
781
930
  *
@@ -829,8 +978,12 @@ declare class XRAnchorSystem implements EcsSystem {
829
978
  private readonly anchors;
830
979
  /** In-flight creations, so one entity is not anchored twice. */
831
980
  private readonly pending;
981
+ /** Per-anchor head-glue gates — see XREnvironmentSystem's TrackedEntry. */
982
+ private readonly gates;
832
983
  private presenting;
833
- update(world: World): void;
984
+ private readonly tmpViewerMatrix;
985
+ private readonly tmpViewPos;
986
+ update(world: World, deltaTime?: number): void;
834
987
  /** Whether this entity's pose is currently being driven by an anchor. */
835
988
  isAnchored(entityId: EntityId): boolean;
836
989
  private requestAnchor;
@@ -1021,4 +1174,4 @@ declare class XRHoverVisualSystem implements EcsSystem {
1021
1174
  dispose(): void;
1022
1175
  }
1023
1176
 
1024
- export { AnimationSystem as A, CameraSyncSystem as C, EnvironmentSyncSystem as E, InstancedMeshSystem as I, LightSyncSystem as L, MaterialSyncSystem as M, NO_XR_CAPABILITIES as N, ObjectVisibilitySystem as O, PhysicsSyncSystem as P, SCRIPT_OBJECT_ROOT_FLAG as S, VRTeleportAreaSystem as V, type XrCapabilities as X, type XrInputState as a, type XrHandPoseEventDetail as b, AudioSystem as c, MeshGeometrySystem as d, type ModuleLoader as e, PostprocessingSyncSystem as f, ScriptBehaviourSystem as g, ScriptObjectSystem as h, type SelectionContext as i, VideoSystem as j, XRAnchorSystem as k, XRControllerVisualSystem as l, XREnvironmentSystem as m, XRHandPoseSystem as n, XRHitTestSystem as o, XRHoverVisualSystem as p, XRInputSystem as q, XRInteractionSystem as r, XRLocomotionSystem as s, XRSessionSystem as t, XRTeleportVisualSystem as u, XR_HOVER_SHELL_FLAG as v, type XrHandedness as w, type XrHitResult as x, type XrInputKind as y, readXrCapabilities as z };
1177
+ export { AnimationSystem as A, type XrInputKind as B, CameraSyncSystem as C, readXrCapabilities as D, EnvironmentSyncSystem as E, InstancedMeshSystem as I, LightSyncSystem as L, MaterialSyncSystem as M, NO_XR_CAPABILITIES as N, ObjectVisibilitySystem as O, PhysicsSyncSystem as P, SCRIPT_OBJECT_ROOT_FLAG as S, UIInteractionSystem as U, VRTeleportAreaSystem as V, type XrCapabilities as X, type XrInputState as a, type XrHandPoseEventDetail as b, AudioSystem as c, MeshGeometrySystem as d, type ModuleLoader as e, PostprocessingSyncSystem as f, ScriptBehaviourSystem as g, ScriptObjectSystem as h, type SelectionContext as i, UIPanelSystem as j, type UiCanvasLike as k, VideoSystem as l, XRAnchorSystem as m, XRControllerVisualSystem as n, XREnvironmentSystem as o, XRHandPoseSystem as p, XRHitTestSystem as q, XRHoverVisualSystem as r, XRInputSystem as s, XRInteractionSystem as t, XRLocomotionSystem as u, XRSessionSystem as v, XRTeleportVisualSystem as w, XR_HOVER_SHELL_FLAG as x, type XrHandedness as y, type XrHitResult as z };
@@ -1,4 +1,4 @@
1
- import { k as EcsSystem, l as World, r as EntityId } from './System-ln4Q7Eot.cjs';
1
+ import { k as EcsSystem, l as World, I as InputSystem, r as EntityId } from './System-V_mv07le.cjs';
2
2
  import * as THREE from 'three';
3
3
  import { m as XrHandJoints, r as XrHandShape } from './handPose-DlcTtqgx.cjs';
4
4
 
@@ -426,6 +426,7 @@ declare class XRInteractionSystem implements EcsSystem {
426
426
  private readonly grabs;
427
427
  private hoveredEntityId;
428
428
  /** Per-hand hover, with the hit distance so the ray can stop at the surface. */
429
+ private readonly busyContributors;
429
430
  private readonly hovers;
430
431
  /** Monotonic seconds, accumulated from deltaTime for velocity sampling. */
431
432
  private elapsed;
@@ -529,6 +530,14 @@ declare class XRInteractionSystem implements EcsSystem {
529
530
  * grabbed and teleported.
530
531
  */
531
532
  isSourceBusy(world: World, input: XrInputState): boolean;
533
+ /** OR-ed into isSourceBusy; see the comment there. */
534
+ registerBusyContributor(contributor: (world: World, input: XrInputState) => boolean): void;
535
+ /** Hover for a specific input source (handedness-free — Vision Pro's
536
+ * transient pointers all report handedness "none"). */
537
+ getHoverForInput(input: XrInputState): {
538
+ entityId: number;
539
+ distance: number;
540
+ } | null;
532
541
  /** True when THIS hand is holding something. */
533
542
  isGrabbingWith(handedness: XrInputState["handedness"]): boolean;
534
543
  /**
@@ -709,12 +718,30 @@ declare class XREnvironmentSystem implements EcsSystem {
709
718
  /** Keyed by the XRPlane/XRMesh object itself — the runtime's own identity. */
710
719
  private readonly planes;
711
720
  private readonly meshes;
721
+ /**
722
+ * Surfaces observed but not yet SPAWNED — their gate is still proving the
723
+ * pose is world-anchored. Creating from an unflagged head-glued pose (seen
724
+ * on-device after a suspend/resume regenerated the scan identities) plants
725
+ * a rotated ghost copy of the room wherever the head happens to be, which
726
+ * the apply-gate then freezes there — wrong forever. So admission itself
727
+ * is gated: a few frames of world-anchored behavior first.
728
+ */
729
+ private readonly pendingPlanes;
730
+ private readonly pendingMeshes;
712
731
  private presenting;
713
732
  private debugVisible;
714
733
  /** Seconds presenting, used to decide the room has genuinely nothing in it. */
715
734
  private elapsed;
716
735
  /** `initiateRoomCapture` may be called only ONCE per session. */
717
736
  private roomCaptureRequested;
737
+ /** This frame's inverse viewer matrix, or null when unavailable. */
738
+ private viewerInverse;
739
+ /** This frame's viewer position in reference space, for room election. */
740
+ private viewerPos;
741
+ /** The ONE global room mesh currently allowed to spawn. */
742
+ private electedGlobalMesh;
743
+ private readonly tmpViewerMatrix;
744
+ private readonly tmpViewPos;
718
745
  update(world: World, deltaTime?: number): void;
719
746
  /**
720
747
  * Ask the runtime to scan the room when it turns out we have no room.
@@ -763,6 +790,28 @@ declare class XREnvironmentSystem implements EcsSystem {
763
790
  private findRig;
764
791
  private syncPlanes;
765
792
  private syncMeshes;
793
+ /**
794
+ * Pick THE room's global mesh: the one whose scan origin is nearest the
795
+ * viewer, sticky to the current choice within a margin so origin jitter
796
+ * can't flap the room. Without a viewer pose (or with a single candidate)
797
+ * the first candidate stands; ties are impossible to break anyway.
798
+ */
799
+ private electGlobalMesh;
800
+ /**
801
+ * Admission control for a NOT-yet-spawned surface. With a viewer pose
802
+ * available, the surface must behave world-anchored for a few frames before
803
+ * an entity is created for it; without one (older runtimes, tests) it is
804
+ * admitted immediately — the gate can't classify anyway. Returns the
805
+ * warmed-up gate (carried into the entry so its motion history survives),
806
+ * or null while the surface must keep waiting.
807
+ */
808
+ private admit;
809
+ /**
810
+ * Run a surface's pose through its head-glue gate: position in reference
811
+ * space vs position relative to the viewer. Without a viewer pose the gate
812
+ * passes everything, degrading to the flag-only behavior.
813
+ */
814
+ private gateAllows;
766
815
  private createPlaneEntity;
767
816
  private applyPlaneCollider;
768
817
  private createMeshEntity;
@@ -776,6 +825,106 @@ declare class XREnvironmentSystem implements EcsSystem {
776
825
  dispose(world: World): void;
777
826
  }
778
827
 
828
+ declare class UIInteractionSystem implements EcsSystem {
829
+ private readonly interaction;
830
+ private readonly inputSystem;
831
+ private readonly xrPresses;
832
+ private mousePress;
833
+ private mouseHover;
834
+ /** entityId → seconds of pressed-tint left to display. */
835
+ private readonly tintFloors;
836
+ private readonly tinted;
837
+ private readonly raycaster;
838
+ /**
839
+ * @param interaction The XR interaction system, or null in a world with no
840
+ * XR (flat 3D experiences) — the mouse path still works via
841
+ * `options.inputSystem`.
842
+ */
843
+ constructor(interaction: XRInteractionSystem | null, options?: {
844
+ inputSystem?: InputSystem;
845
+ });
846
+ update(world: World, deltaTime?: number): void;
847
+ private updateXr;
848
+ private updateMouse;
849
+ private raycastMouse;
850
+ private widgetKind;
851
+ private fire;
852
+ private dragSlider;
853
+ private dragSliderMouse;
854
+ private applySliderPoint;
855
+ private widgetObject;
856
+ private rayHitsWidget;
857
+ private rayPointOnWidget;
858
+ /**
859
+ * Dispatch to the widget's Behaviours, then BUBBLE up the parent chain so a
860
+ * panel script hears its children. Bubbling (not a world broadcast) keeps
861
+ * two spawned copies of the same menu prefab independent.
862
+ */
863
+ private dispatchBubbling;
864
+ private actionIdOf;
865
+ private beginPressTint;
866
+ private endPressTint;
867
+ private updateTints;
868
+ private setTint;
869
+ }
870
+
871
+ /**
872
+ * Renders spatial-UI widgets: panels, text, buttons, toggles and sliders.
873
+ *
874
+ * Lives in `World.setup`'s DEFAULT system list (like `VRTeleportAreaSystem`)
875
+ * so the editor and every runtime render UI with no consumer wiring. Each
876
+ * widget's face is ONE canvas-textured quad, rebuilt only when its style
877
+ * SIGNATURE changes — a canvas redraw plus GPU upload costs 1–3 ms, fine per
878
+ * edit and catastrophic per frame. Interaction state (hover/pressed) never
879
+ * touches the canvas: `UIInteractionSystem` tints the material instead.
880
+ *
881
+ * Toggle knobs and slider knob/fill are separate GEOMETRY positioned from the
882
+ * value each frame, so dragging a slider redraws nothing.
883
+ *
884
+ * Widget SIZE is authored on the component in metres, never via transform
885
+ * scale — the texture is rasterised for the authored size, so scale would
886
+ * stretch texels into blur (and folding live scale into the signature would
887
+ * rebuild every frame during a two-hand scale gesture).
888
+ */
889
+ /** Structural canvas type so tests can inject a stub with no DOM. */
890
+ type UiCanvasLike = {
891
+ width: number;
892
+ height: number;
893
+ getContext(kind: "2d"): CanvasRenderingContext2D | null;
894
+ };
895
+ declare class UIPanelSystem implements EcsSystem {
896
+ private readonly entries;
897
+ private readonly createCanvas;
898
+ constructor(options?: {
899
+ createCanvas?: () => UiCanvasLike;
900
+ });
901
+ update(world: World, deltaTime?: number): void;
902
+ /** All GPU/canvas resources; call on world teardown. */
903
+ dispose(): void;
904
+ private syncPanel;
905
+ private syncText;
906
+ private syncButton;
907
+ private syncToggle;
908
+ private syncSlider;
909
+ private rebuildIfChanged;
910
+ private configureTexture;
911
+ private makeQuad;
912
+ /** A filled disc (or arc segment, for the fill's rounded cap). */
913
+ private makeDisc;
914
+ private addPart;
915
+ /** Remove + dispose knob/fill/cap so a sync pass rebuilds them fresh. */
916
+ private disposeMovingParts;
917
+ /**
918
+ * Billboard: yaw the ENTITY TRANSFORM toward the camera. Writing the
919
+ * Object3D directly would be overwritten by `TransformSyncSystem` (which
920
+ * runs after this system, before render) — the same reason locomotion
921
+ * writes the rig transform. Skipped in the editor so the gizmo and the
922
+ * authored rotation stay in charge while authoring.
923
+ */
924
+ private applyFollow;
925
+ private destroyEntry;
926
+ }
927
+
779
928
  /**
780
929
  * Answers "where does this ray meet the real world?".
781
930
  *
@@ -829,8 +978,12 @@ declare class XRAnchorSystem implements EcsSystem {
829
978
  private readonly anchors;
830
979
  /** In-flight creations, so one entity is not anchored twice. */
831
980
  private readonly pending;
981
+ /** Per-anchor head-glue gates — see XREnvironmentSystem's TrackedEntry. */
982
+ private readonly gates;
832
983
  private presenting;
833
- update(world: World): void;
984
+ private readonly tmpViewerMatrix;
985
+ private readonly tmpViewPos;
986
+ update(world: World, deltaTime?: number): void;
834
987
  /** Whether this entity's pose is currently being driven by an anchor. */
835
988
  isAnchored(entityId: EntityId): boolean;
836
989
  private requestAnchor;
@@ -1021,4 +1174,4 @@ declare class XRHoverVisualSystem implements EcsSystem {
1021
1174
  dispose(): void;
1022
1175
  }
1023
1176
 
1024
- export { AnimationSystem as A, CameraSyncSystem as C, EnvironmentSyncSystem as E, InstancedMeshSystem as I, LightSyncSystem as L, MaterialSyncSystem as M, NO_XR_CAPABILITIES as N, ObjectVisibilitySystem as O, PhysicsSyncSystem as P, SCRIPT_OBJECT_ROOT_FLAG as S, VRTeleportAreaSystem as V, type XrCapabilities as X, type XrInputState as a, type XrHandPoseEventDetail as b, AudioSystem as c, MeshGeometrySystem as d, type ModuleLoader as e, PostprocessingSyncSystem as f, ScriptBehaviourSystem as g, ScriptObjectSystem as h, type SelectionContext as i, VideoSystem as j, XRAnchorSystem as k, XRControllerVisualSystem as l, XREnvironmentSystem as m, XRHandPoseSystem as n, XRHitTestSystem as o, XRHoverVisualSystem as p, XRInputSystem as q, XRInteractionSystem as r, XRLocomotionSystem as s, XRSessionSystem as t, XRTeleportVisualSystem as u, XR_HOVER_SHELL_FLAG as v, type XrHandedness as w, type XrHitResult as x, type XrInputKind as y, readXrCapabilities as z };
1177
+ export { AnimationSystem as A, type XrInputKind as B, CameraSyncSystem as C, readXrCapabilities as D, EnvironmentSyncSystem as E, InstancedMeshSystem as I, LightSyncSystem as L, MaterialSyncSystem as M, NO_XR_CAPABILITIES as N, ObjectVisibilitySystem as O, PhysicsSyncSystem as P, SCRIPT_OBJECT_ROOT_FLAG as S, UIInteractionSystem as U, VRTeleportAreaSystem as V, type XrCapabilities as X, type XrInputState as a, type XrHandPoseEventDetail as b, AudioSystem as c, MeshGeometrySystem as d, type ModuleLoader as e, PostprocessingSyncSystem as f, ScriptBehaviourSystem as g, ScriptObjectSystem as h, type SelectionContext as i, UIPanelSystem as j, type UiCanvasLike as k, VideoSystem as l, XRAnchorSystem as m, XRControllerVisualSystem as n, XREnvironmentSystem as o, XRHandPoseSystem as p, XRHitTestSystem as q, XRHoverVisualSystem as r, XRInputSystem as s, XRInteractionSystem as t, XRLocomotionSystem as u, XRSessionSystem as v, XRTeleportVisualSystem as w, XR_HOVER_SHELL_FLAG as x, type XrHandedness as y, type XrHitResult as z };