@relu-interactives/spatial-ecs 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/{XRHandPose-G0Dl-F0w.d.ts → XRHandPose-CWSrsnYN.d.ts} +144 -1
  2. package/dist/{XRHandPose-VQMT1WXj.d.cts → XRHandPose-Dn2yiALk.d.cts} +144 -1
  3. package/dist/{chunk-G4XJ53LS.js → chunk-JEPUCLZX.js} +3 -3
  4. package/dist/{chunk-G4XJ53LS.js.map → chunk-JEPUCLZX.js.map} +1 -1
  5. package/dist/{chunk-NNDUOQ7O.js → chunk-JNYPJB55.js} +250 -3
  6. package/dist/chunk-JNYPJB55.js.map +1 -0
  7. package/dist/{chunk-SGF73YTF.js → chunk-NXASMBDS.js} +4 -4
  8. package/dist/{chunk-SGF73YTF.js.map → chunk-NXASMBDS.js.map} +1 -1
  9. package/dist/{chunk-JIJQFW6P.js → chunk-VYIWOXAY.js} +1377 -480
  10. package/dist/chunk-VYIWOXAY.js.map +1 -0
  11. package/dist/{chunk-U727NTWQ.js → chunk-WWP46AEF.js} +26 -4
  12. package/dist/chunk-WWP46AEF.js.map +1 -0
  13. package/dist/components/index.cjs +151 -0
  14. package/dist/components/index.cjs.map +1 -1
  15. package/dist/components/index.d.cts +2 -2
  16. package/dist/components/index.d.ts +2 -2
  17. package/dist/components/index.js +1 -1
  18. package/dist/docs/guide/spatial-ui.md +83 -7
  19. package/dist/factories/index.cjs +151 -0
  20. package/dist/factories/index.cjs.map +1 -1
  21. package/dist/factories/index.d.cts +1 -1
  22. package/dist/factories/index.d.ts +1 -1
  23. package/dist/factories/index.js +3 -3
  24. package/dist/{index-D9DjrUn3.d.cts → index-CAZHrh0q.d.cts} +5 -2
  25. package/dist/{index-DppafVu4.d.ts → index-CLtSMf2M.d.ts} +5 -2
  26. package/dist/{index-C61n65PE.d.ts → index-D5MmJNyj.d.ts} +26 -1
  27. package/dist/{index-C70N4BYG.d.cts → index-DiIjV2lm.d.cts} +26 -1
  28. package/dist/index.cjs +1787 -621
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.d.cts +5 -5
  31. package/dist/index.d.ts +5 -5
  32. package/dist/index.js +10 -10
  33. package/dist/network/index.cjs +177 -4
  34. package/dist/network/index.cjs.map +1 -1
  35. package/dist/network/index.js +3 -3
  36. package/dist/systems/index.cjs +1689 -523
  37. package/dist/systems/index.cjs.map +1 -1
  38. package/dist/systems/index.d.cts +1 -1
  39. package/dist/systems/index.d.ts +1 -1
  40. package/dist/systems/index.js +4 -4
  41. package/package.json +1 -1
  42. package/dist/chunk-JIJQFW6P.js.map +0 -1
  43. package/dist/chunk-NNDUOQ7O.js.map +0 -1
  44. package/dist/chunk-U727NTWQ.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { B as EcsSystem, C as Component, K as WorldEntityView, T as TransformComponent, W as World, S as SpawnPrefabSource, L as SpawnPrefabOptions, H as NetworkHandle, N as NetValue, M as PlaySlotOptions, O as ComponentClass, Q as ParentLookup, R as RenderBackend, U as EcsEntityKind, X as ObjectManagementSystem, Y as SubtreeSnapshot, G as EntityId, Z as ExternalRefWarning, _ as AudioBus } from './System-8D-XBDKZ.cjs';
2
2
  export { $ as AssetInput, a0 as AudioSystem, a1 as CheckboxInput, a2 as ChromaKeyOptions, a3 as ColorInput, a4 as ComponentFactory, a5 as ComponentInput, a6 as ComponentKind, a7 as DropdownInput, a8 as DropdownOption, a9 as EcsComponentFactoryKind, aa as EcsEntityEditorKind, ab as EcsRenderer, ac as EntityInput, ad as FloatInput, ae as IKSystem, af as InputSystem, ag as IntersectionResult, ah as KeyboardKey, ai as KeyboardKeys, aj as ModelBoneInfo, ak as MouseButton, J as NetSpawnOptions, al as PREFAB_FILE_VERSION, am as PREFAB_FILE_VERSION_NESTED, an as PostprocessingBuildContext, ao as PostprocessingPipeline, ap as PrefabAsset, aq as RemapSnapshotOptions, ar as RenderSystem, as as RendererKind, at as ScriptErrorEvent, au as ScriptErrorListener, av as ScriptErrorPhase, aw as ScriptErrorReport, ax as ScriptErrorSource, ay as SelectionListener, az as SliderInput, aA as SlotChooser, aB as SoundBankAsset, aC as SoundSlot, aD as SoundTake, aE as TextInput, aF as ToggleInput, aG as TransformSyncSystem, aH as Vec3, aI as Vector2Input, aJ as Vector3Input, aK as clearPrefabCache, aL as despawnPrefab, aM as findModelBone, aN as listModelBones, aO as loadPrefab, aP as parsePrefabAsset, aQ as prefabFileVersionFor, aR as remapSnapshotEntityIds, aS as setPrefabAssetUrlResolver, aT as soundBankFiles, aU as spawnPrefab } from './System-8D-XBDKZ.cjs';
3
3
  import * as THREE from 'three';
4
- import { T as Object3DRef, aJ as XrHandPreset } from './XRHandPose-VQMT1WXj.cjs';
5
- export { aW as AnimationStateCallbacks, aX as AnimationStateMachine, aY as AnimationStateManager, aZ as StateMachine } from './XRHandPose-VQMT1WXj.cjs';
6
- import { X as XrCapabilities, a as XrInputState, b as XrHandPoseEventDetail } from './index-C70N4BYG.cjs';
7
- export { A as AnimationSystem, C as CameraSyncSystem, D as DEFAULT_SCRIPT_ERROR_RETRY_DELAY, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, c as MeshGeometrySystem, d as ModuleLoader, N as NO_XR_CAPABILITIES, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, e as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, f as ScriptBehaviourSystem, g as ScriptBehaviourSystemOptions, h as ScriptObjectSystem, i as SelectionContext, U as UIInteractionSystem, j as UIPanelSystem, k as UiCanvasLike, V as VRTeleportAreaSystem, l as VideoSystem, m as XRAnchorSystem, n as XRControllerVisualSystem, o as XREnvironmentSystem, p as XRHandPoseSystem, q as XRHitTestSystem, r as XRHoverVisualSystem, s as XRInputSystem, t as XRInteractionSystem, u as XRLocomotionSystem, v as XRSessionSystem, w as XRTeleportVisualSystem, x as XR_HOVER_SHELL_FLAG, y as XrHandedness, z as XrHitResult, B as XrInputKind, F as readXrCapabilities } from './index-C70N4BYG.cjs';
8
- export { i as CoreComponents } from './index-D9DjrUn3.cjs';
4
+ import { T as Object3DRef, aM as XrHandPreset } from './XRHandPose-Dn2yiALk.cjs';
5
+ export { aZ as AnimationStateCallbacks, a_ as AnimationStateMachine, a$ as AnimationStateManager, b0 as StateMachine, b1 as UiColorStop, b2 as UiPaint, b3 as UiShadow, b4 as UiStyle, b5 as UiTextStyle, b6 as UiTokens } from './XRHandPose-Dn2yiALk.cjs';
6
+ import { X as XrCapabilities, a as XrInputState, b as XrHandPoseEventDetail } from './index-DiIjV2lm.cjs';
7
+ export { A as AnimationSystem, C as CameraSyncSystem, D as DEFAULT_SCRIPT_ERROR_RETRY_DELAY, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, c as MeshGeometrySystem, d as ModuleLoader, N as NO_XR_CAPABILITIES, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, e as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, f as ScriptBehaviourSystem, g as ScriptBehaviourSystemOptions, h as ScriptObjectSystem, i as SelectionContext, U as UIInteractionSystem, j as UIPanelSystem, k as UiCanvasLike, V as VRTeleportAreaSystem, l as VideoSystem, m as XRAnchorSystem, n as XRControllerVisualSystem, o as XREnvironmentSystem, p as XRHandPoseSystem, q as XRHitTestSystem, r as XRHoverVisualSystem, s as XRInputSystem, t as XRInteractionSystem, u as XRLocomotionSystem, v as XRSessionSystem, w as XRTeleportVisualSystem, x as XR_HOVER_SHELL_FLAG, y as XrHandedness, z as XrHitResult, B as XrInputKind, F as readXrCapabilities } from './index-DiIjV2lm.cjs';
8
+ export { i as CoreComponents } from './index-CAZHrh0q.cjs';
9
9
  export { createAnimationComponent, createAudioComponent, createBoneAttachmentComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createIKComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createNetworkIdentityComponent, createNetworkSpawnerComponent, createNetworkTransformComponent, createNetworkedPropsComponent, 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 './factories/index.cjs';
10
10
  import { GLTF, GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
11
11
  import { X as XrHandPoseDefinition, a as XrFinger, b as XrHandPoseOrientation, c as XrHandPoseDirection } from './handPose-DlcTtqgx.cjs';
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { K as EcsSystem, d as Component, S as WorldEntityView, T as TransformComponent, W as World, U as SpawnPrefabSource, X as SpawnPrefabOptions, O as NetworkHandle, N as NetValue, Y as PlaySlotOptions, Z as ComponentClass, _ as ParentLookup, R as RenderBackend, $ as EcsEntityKind, a0 as ObjectManagementSystem, a1 as SubtreeSnapshot, M as EntityId, a2 as ExternalRefWarning, a3 as AudioBus } from './System-DPMAW30g.js';
2
2
  export { a4 as AssetInput, a5 as AudioSystem, a6 as CheckboxInput, C as ChromaKeyOptions, a7 as ColorInput, a8 as ComponentFactory, a9 as ComponentInput, aa as ComponentKind, ab as DropdownInput, ac as DropdownOption, ad as EcsComponentFactoryKind, ae as EcsEntityEditorKind, E as EcsRenderer, af as EntityInput, ag as FloatInput, ah as IKSystem, ai as InputSystem, aj as IntersectionResult, ak as KeyboardKey, al as KeyboardKeys, am as ModelBoneInfo, an as MouseButton, Q as NetSpawnOptions, ao as PREFAB_FILE_VERSION, ap as PREFAB_FILE_VERSION_NESTED, a as PostprocessingBuildContext, P as PostprocessingPipeline, aq as PrefabAsset, ar as RemapSnapshotOptions, as as RenderSystem, c as RendererKind, at as ScriptErrorEvent, au as ScriptErrorListener, av as ScriptErrorPhase, aw as ScriptErrorReport, ax as ScriptErrorSource, ay as SelectionListener, az as SliderInput, aA as SlotChooser, aB as SoundBankAsset, aC as SoundSlot, aD as SoundTake, aE as TextInput, aF as ToggleInput, aG as TransformSyncSystem, aH as Vec3, aI as Vector2Input, aJ as Vector3Input, aK as clearPrefabCache, aL as despawnPrefab, aM as findModelBone, aN as listModelBones, aO as loadPrefab, aP as parsePrefabAsset, aQ as prefabFileVersionFor, aR as remapSnapshotEntityIds, aS as setPrefabAssetUrlResolver, aT as soundBankFiles, aU as spawnPrefab } from './System-DPMAW30g.js';
3
3
  import * as THREE from 'three';
4
- import { T as Object3DRef, aJ as XrHandPreset } from './XRHandPose-G0Dl-F0w.js';
5
- export { aW as AnimationStateCallbacks, aX as AnimationStateMachine, aY as AnimationStateManager, aZ as StateMachine } from './XRHandPose-G0Dl-F0w.js';
6
- import { X as XrCapabilities, a as XrInputState, b as XrHandPoseEventDetail } from './index-C61n65PE.js';
7
- export { A as AnimationSystem, C as CameraSyncSystem, D as DEFAULT_SCRIPT_ERROR_RETRY_DELAY, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, c as MeshGeometrySystem, d as ModuleLoader, N as NO_XR_CAPABILITIES, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, e as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, f as ScriptBehaviourSystem, g as ScriptBehaviourSystemOptions, h as ScriptObjectSystem, i as SelectionContext, U as UIInteractionSystem, j as UIPanelSystem, k as UiCanvasLike, V as VRTeleportAreaSystem, l as VideoSystem, m as XRAnchorSystem, n as XRControllerVisualSystem, o as XREnvironmentSystem, p as XRHandPoseSystem, q as XRHitTestSystem, r as XRHoverVisualSystem, s as XRInputSystem, t as XRInteractionSystem, u as XRLocomotionSystem, v as XRSessionSystem, w as XRTeleportVisualSystem, x as XR_HOVER_SHELL_FLAG, y as XrHandedness, z as XrHitResult, B as XrInputKind, F as readXrCapabilities } from './index-C61n65PE.js';
8
- export { i as CoreComponents } from './index-DppafVu4.js';
4
+ import { T as Object3DRef, aM as XrHandPreset } from './XRHandPose-CWSrsnYN.js';
5
+ export { aZ as AnimationStateCallbacks, a_ as AnimationStateMachine, a$ as AnimationStateManager, b0 as StateMachine, b1 as UiColorStop, b2 as UiPaint, b3 as UiShadow, b4 as UiStyle, b5 as UiTextStyle, b6 as UiTokens } from './XRHandPose-CWSrsnYN.js';
6
+ import { X as XrCapabilities, a as XrInputState, b as XrHandPoseEventDetail } from './index-D5MmJNyj.js';
7
+ export { A as AnimationSystem, C as CameraSyncSystem, D as DEFAULT_SCRIPT_ERROR_RETRY_DELAY, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, c as MeshGeometrySystem, d as ModuleLoader, N as NO_XR_CAPABILITIES, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, e as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, f as ScriptBehaviourSystem, g as ScriptBehaviourSystemOptions, h as ScriptObjectSystem, i as SelectionContext, U as UIInteractionSystem, j as UIPanelSystem, k as UiCanvasLike, V as VRTeleportAreaSystem, l as VideoSystem, m as XRAnchorSystem, n as XRControllerVisualSystem, o as XREnvironmentSystem, p as XRHandPoseSystem, q as XRHitTestSystem, r as XRHoverVisualSystem, s as XRInputSystem, t as XRInteractionSystem, u as XRLocomotionSystem, v as XRSessionSystem, w as XRTeleportVisualSystem, x as XR_HOVER_SHELL_FLAG, y as XrHandedness, z as XrHitResult, B as XrInputKind, F as readXrCapabilities } from './index-D5MmJNyj.js';
8
+ export { i as CoreComponents } from './index-CLtSMf2M.js';
9
9
  export { createAnimationComponent, createAudioComponent, createBoneAttachmentComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createIKComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createNetworkIdentityComponent, createNetworkSpawnerComponent, createNetworkTransformComponent, createNetworkedPropsComponent, 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 './factories/index.js';
10
10
  import { GLTF, GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
11
11
  import { X as XrHandPoseDefinition, a as XrFinger, b as XrHandPoseOrientation, c as XrHandPoseDirection } from './handPose-DlcTtqgx.js';
package/dist/index.js CHANGED
@@ -1,17 +1,17 @@
1
- import { MeshGeometrySystem, InstancedMeshSystem, EnvironmentSyncSystem, PostprocessingSyncSystem, LightSyncSystem, MaterialSyncSystem, VRTeleportAreaSystem, UIPanelSystem, PhysicsSyncSystem, AnimationSystem, IKSystem, AudioSystem, VideoSystem, CameraSyncSystem, TransformSyncSystem, ObjectVisibilitySystem, RenderSystem } from './chunk-JIJQFW6P.js';
2
- export { ARC_GRAVITY, ARC_MAX_TIME, ARC_SPEED, ARC_STEPS, AnimationSystem, AudioMixer, AudioSystem, CURLED_COS, CameraSyncSystem, DEFAULT_DIRECTION_TOLERANCE, DEFAULT_ENTER_CONFIDENCE, DEFAULT_EXIT_CONFIDENCE, DEFAULT_LOST_GRACE_SECONDS, DEFAULT_MIN_HOLD_SECONDS, DEFAULT_SCRIPT_ERROR_RETRY_DELAY, EnvironmentSyncSystem, FALLBACK_HAND_SCALE, HandPoseTracker, IKSystem, InputSystem, InstancedMeshSystem, KeyboardKeys, LightSyncSystem, MATCH_FALLOFF, MAX_PLAUSIBLE_SPEED, MAX_SAMPLE_AGE_SECONDS, MaterialSyncSystem, MeshGeometrySystem, NO_XR_CAPABILITIES, ObjectVisibilitySystem, PINCH_FINGERS, PhysicsSyncSystem, PostprocessingSyncSystem, RenderSystem, SCRIPT_OBJECT_ROOT_FLAG, STRAIGHT_COS, ScriptBehaviourSystem, ScriptObject, ScriptObjectSystem, SlotChooser, TeleportAimGate, ThrowVelocityTracker, TransformSyncSystem, UIInteractionSystem, UIPanelSystem, VELOCITY_SAMPLES, VRTeleportAreaSystem, VideoSystem, XRAnchorSystem, XRControllerVisualSystem, XREnvironmentSystem, XRHandPoseSystem, XRHitTestSystem, XRHoverVisualSystem, XRInputSystem, XRInteractionSystem, XRLocomotionSystem, XRSessionSystem, XRTeleportVisualSystem, XR_FINGERS, XR_HOVER_SHELL_FLAG, angularVelocityFrom, applyHandMaterial, arcGroundCrossing, computeFingerCurl, computeHandShape, computePalmPose, computePalmWidth, computePinch, computeSpread, createHandMaterial, estimateHandScale, gripQuaternion, matchHandPose, readXrCapabilities, sampleTeleportArc, setWorldQuaternion, soundBankFiles, twoBoneIK } from './chunk-JIJQFW6P.js';
3
- import { registerDefaultFactories } from './chunk-SGF73YTF.js';
4
- export { registerDefaultComponentFactories, registerDefaultFactories } from './chunk-SGF73YTF.js';
1
+ import { MeshGeometrySystem, InstancedMeshSystem, EnvironmentSyncSystem, PostprocessingSyncSystem, LightSyncSystem, MaterialSyncSystem, VRTeleportAreaSystem, UIPanelSystem, PhysicsSyncSystem, AnimationSystem, IKSystem, AudioSystem, VideoSystem, CameraSyncSystem, TransformSyncSystem, ObjectVisibilitySystem, RenderSystem } from './chunk-VYIWOXAY.js';
2
+ export { ARC_GRAVITY, ARC_MAX_TIME, ARC_SPEED, ARC_STEPS, AnimationSystem, AudioMixer, AudioSystem, CURLED_COS, CameraSyncSystem, DEFAULT_DIRECTION_TOLERANCE, DEFAULT_ENTER_CONFIDENCE, DEFAULT_EXIT_CONFIDENCE, DEFAULT_LOST_GRACE_SECONDS, DEFAULT_MIN_HOLD_SECONDS, DEFAULT_SCRIPT_ERROR_RETRY_DELAY, EnvironmentSyncSystem, FALLBACK_HAND_SCALE, HandPoseTracker, IKSystem, InputSystem, InstancedMeshSystem, KeyboardKeys, LightSyncSystem, MATCH_FALLOFF, MAX_PLAUSIBLE_SPEED, MAX_SAMPLE_AGE_SECONDS, MaterialSyncSystem, MeshGeometrySystem, NO_XR_CAPABILITIES, ObjectVisibilitySystem, PINCH_FINGERS, PhysicsSyncSystem, PostprocessingSyncSystem, RenderSystem, SCRIPT_OBJECT_ROOT_FLAG, STRAIGHT_COS, ScriptBehaviourSystem, ScriptObject, ScriptObjectSystem, SlotChooser, TeleportAimGate, ThrowVelocityTracker, TransformSyncSystem, UIInteractionSystem, UIPanelSystem, VELOCITY_SAMPLES, VRTeleportAreaSystem, VideoSystem, XRAnchorSystem, XRControllerVisualSystem, XREnvironmentSystem, XRHandPoseSystem, XRHitTestSystem, XRHoverVisualSystem, XRInputSystem, XRInteractionSystem, XRLocomotionSystem, XRSessionSystem, XRTeleportVisualSystem, XR_FINGERS, XR_HOVER_SHELL_FLAG, angularVelocityFrom, applyHandMaterial, arcGroundCrossing, computeFingerCurl, computeHandShape, computePalmPose, computePalmWidth, computePinch, computeSpread, createHandMaterial, estimateHandScale, gripQuaternion, matchHandPose, readXrCapabilities, sampleTeleportArc, setWorldQuaternion, soundBankFiles, twoBoneIK } from './chunk-VYIWOXAY.js';
3
+ import { registerDefaultFactories } from './chunk-NXASMBDS.js';
4
+ export { registerDefaultComponentFactories, registerDefaultFactories } from './chunk-NXASMBDS.js';
5
5
  import { getRendererKindOf, resolveRenderBackend } from './chunk-OHCNPPMX.js';
6
6
  export { webglBackend } from './chunk-OHCNPPMX.js';
7
7
  import './chunk-QHILSPT4.js';
8
8
  import { normalizeDebugValue, DEBUG_CHANGE_IGNORED_SYSTEMS, cloneHistoryValue } from './chunk-XU2DVWCP.js';
9
- import { spawnPrefab, despawnPrefab, toErrorMessage, toErrorStack, buildNodeKeyMapsFromSnapshot, indexSnapshotByEntity, findTopLevelNestedRegions, collectSnapshotSubtreeIds, groupOverridePaths, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, canonicalizeComponentValue, mergeComponentValue, decanonicalizeComponentValue, computeInstanceOverrides, collectEntitySubtree, ADDED_NODE_MARKER_COMPONENT } from './chunk-U727NTWQ.js';
10
- export { ADDED_NODE_MARKER_COMPONENT, Behaviour, HYDRATABLE_ENTITY_KINDS, NODE_KEY_SEPARATOR, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, PREFAB_FILE_VERSION, PREFAB_FILE_VERSION_NESTED, buildComponentValueMaps, buildNodeKeyMapsFromSnapshot, buildNodeMapsFromSnapshot, canonicalizeComponentValue, clearPrefabCache, collectDiffPaths, collectEntitySubtree, collectSnapshotSubtreeIds, computeInstanceOverrides, decanonicalizeComponentValue, despawnPrefab, encodeOverride, findSnapshotRootEntityIds, findTopLevelNestedRegions, groupOverridePaths, hydrateWorldFromSnapshot, hydrateWorldFromSnapshotDetailed, indexSnapshotByEntity, instantiateSubtree, loadPrefab, mergeComponentValue, parseOverride, parsePrefabAsset, prefabFileVersionFor, restoreComponentState, restorePostCreateComponents, setPrefabAssetUrlResolver, spawnPrefab } from './chunk-U727NTWQ.js';
11
- import { ObjectManagementSystem } from './chunk-G4XJ53LS.js';
12
- export { ObjectManagementSystem, SHARED_MODEL_RESOURCE_FLAG, clearModelCache, createAnimationComponent, createAudioComponent, createBoneAttachmentComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createGLTFLoader, createIKComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createNetworkIdentityComponent, createNetworkSpawnerComponent, createNetworkTransformComponent, createNetworkedPropsComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createUIButtonComponent, createUIPanelComponent, createUISliderComponent, createUITextComponent, createUIToggleComponent, createVRTeleportAreaComponent, createVideoComponent, createXRAnchorComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, findModelBone, listModelBones, loadSharedGltf, resolveDracoDecoderPath, setDracoDecoderPath } from './chunk-G4XJ53LS.js';
13
- import { SelectionTransformState, Object3DRef, Name, EntityType, ParentId, Environment, Postprocessing, ScriptComponent } from './chunk-NNDUOQ7O.js';
14
- export { AnimationStateMachine, AnimationStateManager, components_exports as CoreComponents, HAND_POSE_PRESETS, HAND_POSE_PRESET_IDS, cloneHandPose, getHandPosePreset, handPoseFromCurls } from './chunk-NNDUOQ7O.js';
9
+ import { spawnPrefab, despawnPrefab, toErrorMessage, toErrorStack, buildNodeKeyMapsFromSnapshot, indexSnapshotByEntity, findTopLevelNestedRegions, collectSnapshotSubtreeIds, groupOverridePaths, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, canonicalizeComponentValue, mergeComponentValue, decanonicalizeComponentValue, computeInstanceOverrides, collectEntitySubtree, ADDED_NODE_MARKER_COMPONENT } from './chunk-WWP46AEF.js';
10
+ export { ADDED_NODE_MARKER_COMPONENT, Behaviour, HYDRATABLE_ENTITY_KINDS, NODE_KEY_SEPARATOR, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, PREFAB_FILE_VERSION, PREFAB_FILE_VERSION_NESTED, buildComponentValueMaps, buildNodeKeyMapsFromSnapshot, buildNodeMapsFromSnapshot, canonicalizeComponentValue, clearPrefabCache, collectDiffPaths, collectEntitySubtree, collectSnapshotSubtreeIds, computeInstanceOverrides, decanonicalizeComponentValue, despawnPrefab, encodeOverride, findSnapshotRootEntityIds, findTopLevelNestedRegions, groupOverridePaths, hydrateWorldFromSnapshot, hydrateWorldFromSnapshotDetailed, indexSnapshotByEntity, instantiateSubtree, loadPrefab, mergeComponentValue, parseOverride, parsePrefabAsset, prefabFileVersionFor, restoreComponentState, restorePostCreateComponents, setPrefabAssetUrlResolver, spawnPrefab } from './chunk-WWP46AEF.js';
11
+ import { ObjectManagementSystem } from './chunk-JEPUCLZX.js';
12
+ export { ObjectManagementSystem, SHARED_MODEL_RESOURCE_FLAG, clearModelCache, createAnimationComponent, createAudioComponent, createBoneAttachmentComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createGLTFLoader, createIKComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createNetworkIdentityComponent, createNetworkSpawnerComponent, createNetworkTransformComponent, createNetworkedPropsComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createUIButtonComponent, createUIPanelComponent, createUISliderComponent, createUITextComponent, createUIToggleComponent, createVRTeleportAreaComponent, createVideoComponent, createXRAnchorComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, findModelBone, listModelBones, loadSharedGltf, resolveDracoDecoderPath, setDracoDecoderPath } from './chunk-JEPUCLZX.js';
13
+ import { SelectionTransformState, Object3DRef, Name, EntityType, ParentId, Environment, Postprocessing, ScriptComponent } from './chunk-JNYPJB55.js';
14
+ export { AnimationStateMachine, AnimationStateManager, components_exports as CoreComponents, HAND_POSE_PRESETS, HAND_POSE_PRESET_IDS, cloneHandPose, getHandPosePreset, handPoseFromCurls } from './chunk-JNYPJB55.js';
15
15
  export { Component } from './chunk-CKTHDXPS.js';
16
16
  import './chunk-GSWC6LLD.js';
17
17
  import { __name } from './chunk-XE4OXN2W.js';
@@ -2203,6 +2203,127 @@ var _IKComponent = class _IKComponent extends Component {
2203
2203
  __name(_IKComponent, "IKComponent");
2204
2204
  var IKComponent = _IKComponent;
2205
2205
 
2206
+ // core/ui/uiStyle.ts
2207
+ var isRecord = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isRecord");
2208
+ var finite = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value), "finite");
2209
+ var nonEmpty = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length > 0, "nonEmpty");
2210
+ function normalizeStops(value) {
2211
+ if (!Array.isArray(value)) return null;
2212
+ const stops = [];
2213
+ for (const stop of value) {
2214
+ if (isRecord(stop) && finite(stop.at) && nonEmpty(stop.color)) {
2215
+ stops.push({ at: Math.min(1, Math.max(0, stop.at)), color: stop.color });
2216
+ }
2217
+ }
2218
+ return stops.length >= 2 ? stops : null;
2219
+ }
2220
+ __name(normalizeStops, "normalizeStops");
2221
+ function normalizePaint(value) {
2222
+ if (!isRecord(value)) return void 0;
2223
+ if (value.kind === "solid" && nonEmpty(value.color)) {
2224
+ return { kind: "solid", color: value.color };
2225
+ }
2226
+ if (value.kind === "linear") {
2227
+ const stops = normalizeStops(value.stops);
2228
+ if (stops) {
2229
+ return {
2230
+ kind: "linear",
2231
+ angle: finite(value.angle) ? value.angle : 180,
2232
+ stops
2233
+ };
2234
+ }
2235
+ }
2236
+ if (value.kind === "radial") {
2237
+ const stops = normalizeStops(value.stops);
2238
+ if (stops) return { kind: "radial", stops };
2239
+ }
2240
+ if (value.kind === "image" && nonEmpty(value.src)) {
2241
+ const fit = value.fit === "contain" || value.fit === "fill" ? value.fit : "cover";
2242
+ return {
2243
+ kind: "image",
2244
+ src: value.src,
2245
+ fit,
2246
+ ...nonEmpty(value.tint) ? { tint: value.tint } : {}
2247
+ };
2248
+ }
2249
+ return void 0;
2250
+ }
2251
+ __name(normalizePaint, "normalizePaint");
2252
+ function normalizeShadow(value) {
2253
+ if (!isRecord(value) || !nonEmpty(value.color)) return void 0;
2254
+ return {
2255
+ x: finite(value.x) ? value.x : 0,
2256
+ y: finite(value.y) ? value.y : 0,
2257
+ blur: finite(value.blur) ? Math.max(0, value.blur) : 0,
2258
+ color: value.color
2259
+ };
2260
+ }
2261
+ __name(normalizeShadow, "normalizeShadow");
2262
+ function normalizeText(value) {
2263
+ if (!isRecord(value)) return void 0;
2264
+ const text = {};
2265
+ if (nonEmpty(value.font)) text.font = value.font;
2266
+ if (finite(value.weight)) text.weight = value.weight;
2267
+ if (finite(value.tracking)) text.tracking = value.tracking;
2268
+ if (value.transform === "upper" || value.transform === "lower") {
2269
+ text.transform = value.transform;
2270
+ }
2271
+ const paint = normalizePaint(value.paint);
2272
+ if (paint) text.paint = paint;
2273
+ if (finite(value.maxLines) && value.maxLines >= 1) {
2274
+ text.maxLines = Math.floor(value.maxLines);
2275
+ }
2276
+ const shadow = normalizeShadow(value.shadow);
2277
+ if (shadow) text.shadow = shadow;
2278
+ return Object.keys(text).length > 0 ? text : void 0;
2279
+ }
2280
+ __name(normalizeText, "normalizeText");
2281
+ function normalizeUiStyle(value) {
2282
+ if (!isRecord(value)) return void 0;
2283
+ const style = {};
2284
+ const fill = normalizePaint(value.fill);
2285
+ if (fill) style.fill = fill;
2286
+ if (isRecord(value.border) && finite(value.border.width)) {
2287
+ const paint = normalizePaint(value.border.paint);
2288
+ if (paint) {
2289
+ style.border = { width: Math.max(0, value.border.width), paint };
2290
+ }
2291
+ }
2292
+ if (finite(value.radius)) {
2293
+ style.radius = Math.max(0, value.radius);
2294
+ } else if (Array.isArray(value.radius) && value.radius.length === 4 && value.radius.every(finite)) {
2295
+ style.radius = value.radius.map((r) => Math.max(0, r));
2296
+ }
2297
+ if (Array.isArray(value.shadows)) {
2298
+ const shadows = value.shadows.map(normalizeShadow).filter((s) => !!s);
2299
+ if (shadows.length > 0) style.shadows = shadows;
2300
+ }
2301
+ if (isRecord(value.edge) && finite(value.edge.width) && nonEmpty(value.edge.color)) {
2302
+ style.edge = {
2303
+ width: Math.max(0, value.edge.width),
2304
+ color: value.edge.color
2305
+ };
2306
+ }
2307
+ if (finite(value.opacity)) {
2308
+ style.opacity = Math.min(1, Math.max(0, value.opacity));
2309
+ }
2310
+ const text = normalizeText(value.text);
2311
+ if (text) style.text = text;
2312
+ return Object.keys(style).length > 0 ? style : void 0;
2313
+ }
2314
+ __name(normalizeUiStyle, "normalizeUiStyle");
2315
+ function normalizeUiTokens(value) {
2316
+ if (!isRecord(value)) return void 0;
2317
+ const tokens = {};
2318
+ for (const [key, token] of Object.entries(value)) {
2319
+ if (nonEmpty(token) && key.length > 0 && !key.includes("/")) {
2320
+ tokens[key] = token;
2321
+ }
2322
+ }
2323
+ return Object.keys(tokens).length > 0 ? tokens : void 0;
2324
+ }
2325
+ __name(normalizeUiTokens, "normalizeUiTokens");
2326
+
2206
2327
  // core/components/UIPanel.ts
2207
2328
  var _UIPanelComponent = class _UIPanelComponent extends Component {
2208
2329
  constructor(options) {
@@ -2216,6 +2337,10 @@ var _UIPanelComponent = class _UIPanelComponent extends Component {
2216
2337
  this.borderColor = options?.borderColor ?? "#333333";
2217
2338
  this.pixelDensity = options?.pixelDensity ?? 1024;
2218
2339
  this.follow = options?.follow ?? "world";
2340
+ const style = normalizeUiStyle(options?.style);
2341
+ if (style) this.style = style;
2342
+ const tokens = normalizeUiTokens(options?.tokens);
2343
+ if (tokens) this.tokens = tokens;
2219
2344
  }
2220
2345
  };
2221
2346
  __name(_UIPanelComponent, "UIPanelComponent");
@@ -2235,6 +2360,11 @@ var _UITextComponent = class _UITextComponent extends Component {
2235
2360
  this.valign = options?.valign ?? "middle";
2236
2361
  this.lineHeight = options?.lineHeight ?? 1.25;
2237
2362
  this.padding = options?.padding ?? 0.01;
2363
+ if (options?.pixelDensity !== void 0) {
2364
+ this.pixelDensity = options.pixelDensity;
2365
+ }
2366
+ const style = normalizeUiStyle(options?.style);
2367
+ if (style) this.style = style;
2238
2368
  }
2239
2369
  };
2240
2370
  __name(_UITextComponent, "UITextComponent");
@@ -2256,6 +2386,13 @@ var _UIButtonComponent = class _UIButtonComponent extends Component {
2256
2386
  this.cornerRadius = options?.cornerRadius ?? 0.02;
2257
2387
  this.borderWidth = options?.borderWidth ?? 2e-3;
2258
2388
  this.borderColor = options?.borderColor ?? "#3a3a3a";
2389
+ if (options?.pixelDensity !== void 0) {
2390
+ this.pixelDensity = options.pixelDensity;
2391
+ }
2392
+ const style = normalizeUiStyle(options?.style);
2393
+ if (style) this.style = style;
2394
+ if (options?.icon) this.icon = options.icon;
2395
+ if (options?.iconPosition) this.iconPosition = options.iconPosition;
2259
2396
  }
2260
2397
  };
2261
2398
  __name(_UIButtonComponent, "UIButtonComponent");
@@ -2272,6 +2409,12 @@ var _UIToggleComponent = class _UIToggleComponent extends Component {
2272
2409
  this.trackColor = options?.trackColor ?? "#2a2a2a";
2273
2410
  this.accentColor = options?.accentColor ?? "#ff6b35";
2274
2411
  this.knobColor = options?.knobColor ?? "#ffffff";
2412
+ if (options?.pixelDensity !== void 0) {
2413
+ this.pixelDensity = options.pixelDensity;
2414
+ }
2415
+ const style = normalizeUiStyle(options?.style);
2416
+ if (style) this.style = style;
2417
+ if (options?.variant) this.variant = options.variant;
2275
2418
  }
2276
2419
  };
2277
2420
  __name(_UIToggleComponent, "UIToggleComponent");
@@ -2292,6 +2435,14 @@ var _UISliderComponent = class _UISliderComponent extends Component {
2292
2435
  this.trackColor = options?.trackColor ?? "#2a2a2a";
2293
2436
  this.accentColor = options?.accentColor ?? "#ff6b35";
2294
2437
  this.knobColor = options?.knobColor ?? "#ffffff";
2438
+ if (options?.pixelDensity !== void 0) {
2439
+ this.pixelDensity = options.pixelDensity;
2440
+ }
2441
+ const style = normalizeUiStyle(options?.style);
2442
+ if (style) this.style = style;
2443
+ if (options?.variant) this.variant = options.variant;
2444
+ if (options?.step !== void 0) this.step = options.step;
2445
+ if (options?.readOnly !== void 0) this.readOnly = options.readOnly;
2295
2446
  }
2296
2447
  };
2297
2448
  __name(_UISliderComponent, "UISliderComponent");
@@ -2572,6 +2723,14 @@ function applyParentLinks(snapshot, idMap, objectManagementSystem, world) {
2572
2723
  __name(applyParentLinks, "applyParentLinks");
2573
2724
 
2574
2725
  // core/hydration/postCreateComponents.ts
2726
+ var OPTIONAL_UI_FIELDS = {
2727
+ pixelDensity: "number",
2728
+ icon: "string",
2729
+ iconPosition: "string",
2730
+ variant: "string",
2731
+ step: "number",
2732
+ readOnly: "boolean"
2733
+ };
2575
2734
  function remapEntityRefsInScriptData(data, idMap) {
2576
2735
  const result = {};
2577
2736
  for (const [key, value] of Object.entries(data)) {
@@ -2955,6 +3114,20 @@ function restorePostCreateComponents(world, objectManagementSystem, targetEntity
2955
3114
  const target = component;
2956
3115
  for (const [key, value] of Object.entries(source)) {
2957
3116
  const current = target[key];
3117
+ if (key === "style") {
3118
+ const style = normalizeUiStyle(value);
3119
+ if (style) target.style = style;
3120
+ continue;
3121
+ }
3122
+ if (key === "tokens") {
3123
+ const tokens = normalizeUiTokens(value);
3124
+ if (tokens) target.tokens = tokens;
3125
+ continue;
3126
+ }
3127
+ if (OPTIONAL_UI_FIELDS[key] === typeof value) {
3128
+ target[key] = value;
3129
+ continue;
3130
+ }
2958
3131
  if ((typeof value === "string" || typeof value === "number" || typeof value === "boolean") && typeof current === typeof value) {
2959
3132
  target[key] = value;
2960
3133
  }
@@ -3917,16 +4090,16 @@ function instantiateSubtree(world, objectManagementSystem, snapshot) {
3917
4090
  __name(instantiateSubtree, "instantiateSubtree");
3918
4091
 
3919
4092
  // core/prefab/types.ts
3920
- var isRecord = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isRecord");
4093
+ var isRecord2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isRecord");
3921
4094
  function parsePrefabAsset(json) {
3922
- if (!isRecord(json)) {
4095
+ if (!isRecord2(json)) {
3923
4096
  return null;
3924
4097
  }
3925
4098
  if (typeof json.version !== "number" || json.version < 1) {
3926
4099
  return null;
3927
4100
  }
3928
4101
  const snapshot = json.snapshot;
3929
- if (!isRecord(snapshot)) {
4102
+ if (!isRecord2(snapshot)) {
3930
4103
  return null;
3931
4104
  }
3932
4105
  const entities = snapshot.entities;
@@ -3938,7 +4111,7 @@ function parsePrefabAsset(json) {
3938
4111
  return null;
3939
4112
  }
3940
4113
  if (!components.every(
3941
- (block) => isRecord(block) && typeof block.component === "string" && Array.isArray(block.entries)
4114
+ (block) => isRecord2(block) && typeof block.component === "string" && Array.isArray(block.entries)
3942
4115
  )) {
3943
4116
  return null;
3944
4117
  }