@iwsdk/core 0.1.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.
- package/LICENSE +21 -0
- package/dist/asset/asset-manager.d.ts +72 -0
- package/dist/asset/asset-manager.d.ts.map +1 -0
- package/dist/asset/asset-manager.js +138 -0
- package/dist/asset/asset-manager.js.map +1 -0
- package/dist/asset/cache-manager.d.ts +44 -0
- package/dist/asset/cache-manager.d.ts.map +1 -0
- package/dist/asset/cache-manager.js +80 -0
- package/dist/asset/cache-manager.js.map +1 -0
- package/dist/asset/index.d.ts +9 -0
- package/dist/asset/index.d.ts.map +1 -0
- package/dist/asset/loaders/audio-loader.d.ts +21 -0
- package/dist/asset/loaders/audio-loader.d.ts.map +1 -0
- package/dist/asset/loaders/audio-loader.js +57 -0
- package/dist/asset/loaders/audio-loader.js.map +1 -0
- package/dist/asset/loaders/gltf-loader.d.ts +33 -0
- package/dist/asset/loaders/gltf-loader.d.ts.map +1 -0
- package/dist/asset/loaders/gltf-loader.js +79 -0
- package/dist/asset/loaders/gltf-loader.js.map +1 -0
- package/dist/asset/loaders/hdr-texture-loader.d.ts +18 -0
- package/dist/asset/loaders/hdr-texture-loader.d.ts.map +1 -0
- package/dist/asset/loaders/hdr-texture-loader.js +65 -0
- package/dist/asset/loaders/hdr-texture-loader.js.map +1 -0
- package/dist/asset/loaders/texture-loader.d.ts +21 -0
- package/dist/asset/loaders/texture-loader.d.ts.map +1 -0
- package/dist/asset/loaders/texture-loader.js +57 -0
- package/dist/asset/loaders/texture-loader.js.map +1 -0
- package/dist/audio/audio-pool.d.ts +59 -0
- package/dist/audio/audio-pool.d.ts.map +1 -0
- package/dist/audio/audio-pool.js +105 -0
- package/dist/audio/audio-pool.js.map +1 -0
- package/dist/audio/audio-system.d.ts +326 -0
- package/dist/audio/audio-system.d.ts.map +1 -0
- package/dist/audio/audio-system.js +478 -0
- package/dist/audio/audio-system.js.map +1 -0
- package/dist/audio/audio-utils.d.ts +71 -0
- package/dist/audio/audio-utils.d.ts.map +1 -0
- package/dist/audio/audio-utils.js +145 -0
- package/dist/audio/audio-utils.js.map +1 -0
- package/dist/audio/audio.d.ts +178 -0
- package/dist/audio/audio.d.ts.map +1 -0
- package/dist/audio/audio.js +104 -0
- package/dist/audio/audio.js.map +1 -0
- package/dist/audio/index.d.ts +11 -0
- package/dist/audio/index.d.ts.map +1 -0
- package/dist/ecs/component-registry.d.ts +54 -0
- package/dist/ecs/component-registry.d.ts.map +1 -0
- package/dist/ecs/component-registry.js +86 -0
- package/dist/ecs/component-registry.js.map +1 -0
- package/dist/ecs/component.d.ts +12 -0
- package/dist/ecs/component.d.ts.map +1 -0
- package/dist/ecs/entity.d.ts +17 -0
- package/dist/ecs/entity.d.ts.map +1 -0
- package/dist/ecs/entity.js +13 -0
- package/dist/ecs/entity.js.map +1 -0
- package/dist/ecs/index.d.ts +12 -0
- package/dist/ecs/index.d.ts.map +1 -0
- package/dist/ecs/system.d.ts +70 -0
- package/dist/ecs/system.d.ts.map +1 -0
- package/dist/ecs/system.js +79 -0
- package/dist/ecs/system.js.map +1 -0
- package/dist/ecs/world.d.ts +101 -0
- package/dist/ecs/world.d.ts.map +1 -0
- package/dist/ecs/world.js +165 -0
- package/dist/ecs/world.js.map +1 -0
- package/dist/environment/dome-gradient.d.ts +39 -0
- package/dist/environment/dome-gradient.d.ts.map +1 -0
- package/dist/environment/dome-gradient.js +30 -0
- package/dist/environment/dome-gradient.js.map +1 -0
- package/dist/environment/dome-texture.d.ts +39 -0
- package/dist/environment/dome-texture.d.ts.map +1 -0
- package/dist/environment/dome-texture.js +30 -0
- package/dist/environment/dome-texture.js.map +1 -0
- package/dist/environment/environment-system.d.ts +82 -0
- package/dist/environment/environment-system.d.ts.map +1 -0
- package/dist/environment/environment-system.js +389 -0
- package/dist/environment/environment-system.js.map +1 -0
- package/dist/environment/gradient-environment.d.ts +37 -0
- package/dist/environment/gradient-environment.d.ts.map +1 -0
- package/dist/environment/gradient-environment.js +99 -0
- package/dist/environment/gradient-environment.js.map +1 -0
- package/dist/environment/ibl-gradient.d.ts +38 -0
- package/dist/environment/ibl-gradient.d.ts.map +1 -0
- package/dist/environment/ibl-gradient.js +29 -0
- package/dist/environment/ibl-gradient.js.map +1 -0
- package/dist/environment/ibl-texture.d.ts +36 -0
- package/dist/environment/ibl-texture.d.ts.map +1 -0
- package/dist/environment/ibl-texture.js +30 -0
- package/dist/environment/ibl-texture.js.map +1 -0
- package/dist/environment/index.d.ts +12 -0
- package/dist/environment/index.d.ts.map +1 -0
- package/dist/grab/distance-grabbable.d.ts +115 -0
- package/dist/grab/distance-grabbable.d.ts.map +1 -0
- package/dist/grab/distance-grabbable.js +102 -0
- package/dist/grab/distance-grabbable.js.map +1 -0
- package/dist/grab/grab-system.d.ts +320 -0
- package/dist/grab/grab-system.d.ts.map +1 -0
- package/dist/grab/grab-system.js +239 -0
- package/dist/grab/grab-system.js.map +1 -0
- package/dist/grab/handles.d.ts +43 -0
- package/dist/grab/handles.d.ts.map +1 -0
- package/dist/grab/handles.js +132 -0
- package/dist/grab/handles.js.map +1 -0
- package/dist/grab/index.d.ts +13 -0
- package/dist/grab/index.d.ts.map +1 -0
- package/dist/grab/index.js +23 -0
- package/dist/grab/index.js.map +1 -0
- package/dist/grab/one-hand-grabbable.d.ts +80 -0
- package/dist/grab/one-hand-grabbable.d.ts.map +1 -0
- package/dist/grab/one-hand-grabbable.js +80 -0
- package/dist/grab/one-hand-grabbable.js.map +1 -0
- package/dist/grab/pointer-events-patch.d.ts +16 -0
- package/dist/grab/pointer-events-patch.d.ts.map +1 -0
- package/dist/grab/pointer-events-patch.js +223 -0
- package/dist/grab/pointer-events-patch.js.map +1 -0
- package/dist/grab/two-hands-grabbable.d.ts +103 -0
- package/dist/grab/two-hands-grabbable.d.ts.map +1 -0
- package/dist/grab/two-hands-grabbable.js +100 -0
- package/dist/grab/two-hands-grabbable.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +82 -0
- package/dist/index.js.map +1 -0
- package/dist/init/index.d.ts +9 -0
- package/dist/init/index.d.ts.map +1 -0
- package/dist/init/world-initializer.d.ts +76 -0
- package/dist/init/world-initializer.d.ts.map +1 -0
- package/dist/init/world-initializer.js +403 -0
- package/dist/init/world-initializer.js.map +1 -0
- package/dist/init/xr.d.ts +87 -0
- package/dist/init/xr.d.ts.map +1 -0
- package/dist/init/xr.js +193 -0
- package/dist/init/xr.js.map +1 -0
- package/dist/input/index.d.ts +9 -0
- package/dist/input/index.d.ts.map +1 -0
- package/dist/input/input-system.d.ts +52 -0
- package/dist/input/input-system.d.ts.map +1 -0
- package/dist/input/input-system.js +176 -0
- package/dist/input/input-system.js.map +1 -0
- package/dist/input/state-tags.d.ts +56 -0
- package/dist/input/state-tags.d.ts.map +1 -0
- package/dist/input/state-tags.js +63 -0
- package/dist/input/state-tags.js.map +1 -0
- package/dist/level/index.d.ts +12 -0
- package/dist/level/index.d.ts.map +1 -0
- package/dist/level/level-entity-creator.d.ts +27 -0
- package/dist/level/level-entity-creator.d.ts.map +1 -0
- package/dist/level/level-entity-creator.js +110 -0
- package/dist/level/level-entity-creator.js.map +1 -0
- package/dist/level/level-glxf-importer.d.ts +22 -0
- package/dist/level/level-glxf-importer.d.ts.map +1 -0
- package/dist/level/level-glxf-importer.js +40 -0
- package/dist/level/level-glxf-importer.js.map +1 -0
- package/dist/level/level-root.d.ts +18 -0
- package/dist/level/level-root.d.ts.map +1 -0
- package/dist/level/level-root.js +25 -0
- package/dist/level/level-root.js.map +1 -0
- package/dist/level/level-system.d.ts +54 -0
- package/dist/level/level-system.d.ts.map +1 -0
- package/dist/level/level-system.js +134 -0
- package/dist/level/level-system.js.map +1 -0
- package/dist/level/level-tag.d.ts +25 -0
- package/dist/level/level-tag.d.ts.map +1 -0
- package/dist/level/level-tag.js +28 -0
- package/dist/level/level-tag.js.map +1 -0
- package/dist/locomotion/geometries/beveled-cylinder.d.ts +12 -0
- package/dist/locomotion/geometries/beveled-cylinder.d.ts.map +1 -0
- package/dist/locomotion/geometries/beveled-cylinder.js +64 -0
- package/dist/locomotion/geometries/beveled-cylinder.js.map +1 -0
- package/dist/locomotion/index.d.ts +11 -0
- package/dist/locomotion/index.d.ts.map +1 -0
- package/dist/locomotion/locomotion.d.ts +239 -0
- package/dist/locomotion/locomotion.d.ts.map +1 -0
- package/dist/locomotion/locomotion.js +256 -0
- package/dist/locomotion/locomotion.js.map +1 -0
- package/dist/locomotion/materials/line.d.ts +24 -0
- package/dist/locomotion/materials/line.d.ts.map +1 -0
- package/dist/locomotion/materials/line.js +307 -0
- package/dist/locomotion/materials/line.js.map +1 -0
- package/dist/locomotion/slide.d.ts +76 -0
- package/dist/locomotion/slide.d.ts.map +1 -0
- package/dist/locomotion/slide.js +131 -0
- package/dist/locomotion/slide.js.map +1 -0
- package/dist/locomotion/teleport.d.ts +68 -0
- package/dist/locomotion/teleport.d.ts.map +1 -0
- package/dist/locomotion/teleport.js +150 -0
- package/dist/locomotion/teleport.js.map +1 -0
- package/dist/locomotion/turn.d.ts +77 -0
- package/dist/locomotion/turn.d.ts.map +1 -0
- package/dist/locomotion/turn.js +126 -0
- package/dist/locomotion/turn.js.map +1 -0
- package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.0.10_@pmndrs_uikit@1.0.32_super-three@0.177.0_/node_modules/@pmndrs/uikitml/dist/index.js +13 -0
- package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.0.10_@pmndrs_uikit@1.0.32_super-three@0.177.0_/node_modules/@pmndrs/uikitml/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.0.10_@pmndrs_uikit@1.0.32_super-three@0.177.0_/node_modules/@pmndrs/uikitml/dist/interpreter/index.js +154 -0
- package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.0.10_@pmndrs_uikit@1.0.32_super-three@0.177.0_/node_modules/@pmndrs/uikitml/dist/interpreter/index.js.map +1 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/error-codes.js +66 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/error-codes.js.map +1 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/foreign-content.js +162 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/foreign-content.js.map +1 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/html.js +519 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/html.js.map +1 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/token.js +15 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/token.js.map +1 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/unicode.js +32 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/unicode.js.map +1 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/formatting-element-list.js +10 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/formatting-element-list.js.map +1 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/index.js +41 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/index.js.map +1 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/open-element-stack.js +35 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/open-element-stack.js.map +1 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/serializer/index.js +24 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/serializer/index.js.map +1 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/tokenizer/index.js +92 -0
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/tokenizer/index.js.map +1 -0
- package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/libs/fflate.module.js +382 -0
- package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/libs/fflate.module.js.map +1 -0
- package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/loaders/EXRLoader.js +2587 -0
- package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/loaders/EXRLoader.js.map +1 -0
- package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/loaders/RGBELoader.js +477 -0
- package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/loaders/RGBELoader.js.map +1 -0
- package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/src/math/MathUtils.js +17 -0
- package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/src/math/MathUtils.js.map +1 -0
- package/dist/physics/index.d.ts +11 -0
- package/dist/physics/index.d.ts.map +1 -0
- package/dist/physics/physics-system.d.ts +314 -0
- package/dist/physics/physics-system.d.ts.map +1 -0
- package/dist/physics/physics-system.js +419 -0
- package/dist/physics/physics-system.js.map +1 -0
- package/dist/physics/physicsBody.d.ts +83 -0
- package/dist/physics/physicsBody.d.ts.map +1 -0
- package/dist/physics/physicsBody.js +60 -0
- package/dist/physics/physicsBody.js.map +1 -0
- package/dist/physics/physicsManipulation.d.ts +51 -0
- package/dist/physics/physicsManipulation.d.ts.map +1 -0
- package/dist/physics/physicsManipulation.js +46 -0
- package/dist/physics/physicsManipulation.js.map +1 -0
- package/dist/physics/physicsShape.d.ts +133 -0
- package/dist/physics/physicsShape.d.ts.map +1 -0
- package/dist/physics/physicsShape.js +97 -0
- package/dist/physics/physicsShape.js.map +1 -0
- package/dist/physics/utils.d.ts +21 -0
- package/dist/physics/utils.d.ts.map +1 -0
- package/dist/physics/utils.js +130 -0
- package/dist/physics/utils.js.map +1 -0
- package/dist/runtime/index.d.ts +8 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/three.d.ts +8 -0
- package/dist/runtime/three.d.ts.map +1 -0
- package/dist/runtime/three.js +18 -0
- package/dist/runtime/three.js.map +1 -0
- package/dist/scene-understanding/anchor.d.ts +42 -0
- package/dist/scene-understanding/anchor.d.ts.map +1 -0
- package/dist/scene-understanding/anchor.js +45 -0
- package/dist/scene-understanding/anchor.js.map +1 -0
- package/dist/scene-understanding/index.d.ts +11 -0
- package/dist/scene-understanding/index.d.ts.map +1 -0
- package/dist/scene-understanding/mesh.d.ts +67 -0
- package/dist/scene-understanding/mesh.d.ts.map +1 -0
- package/dist/scene-understanding/mesh.js +55 -0
- package/dist/scene-understanding/mesh.js.map +1 -0
- package/dist/scene-understanding/plane.d.ts +39 -0
- package/dist/scene-understanding/plane.d.ts.map +1 -0
- package/dist/scene-understanding/plane.js +42 -0
- package/dist/scene-understanding/plane.js.map +1 -0
- package/dist/scene-understanding/scene-understanding-system.d.ts +180 -0
- package/dist/scene-understanding/scene-understanding-system.d.ts.map +1 -0
- package/dist/scene-understanding/scene-understanding-system.js +342 -0
- package/dist/scene-understanding/scene-understanding-system.js.map +1 -0
- package/dist/transform/index.d.ts +10 -0
- package/dist/transform/index.d.ts.map +1 -0
- package/dist/transform/synced-quaternion.d.ts +35 -0
- package/dist/transform/synced-quaternion.d.ts.map +1 -0
- package/dist/transform/synced-quaternion.js +128 -0
- package/dist/transform/synced-quaternion.js.map +1 -0
- package/dist/transform/synced-vector3.d.ts +34 -0
- package/dist/transform/synced-vector3.d.ts.map +1 -0
- package/dist/transform/synced-vector3.js +106 -0
- package/dist/transform/synced-vector3.js.map +1 -0
- package/dist/transform/transform.d.ts +100 -0
- package/dist/transform/transform.d.ts.map +1 -0
- package/dist/transform/transform.js +194 -0
- package/dist/transform/transform.js.map +1 -0
- package/dist/types/webxr-augmentations.d.ts +23 -0
- package/dist/types/webxr-augmentations.d.ts.map +1 -0
- package/dist/ui/document.d.ts +112 -0
- package/dist/ui/document.d.ts.map +1 -0
- package/dist/ui/document.js +298 -0
- package/dist/ui/document.js.map +1 -0
- package/dist/ui/follow.d.ts +197 -0
- package/dist/ui/follow.d.ts.map +1 -0
- package/dist/ui/follow.js +143 -0
- package/dist/ui/follow.js.map +1 -0
- package/dist/ui/index.d.ts +18 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/screenspace.d.ts +219 -0
- package/dist/ui/screenspace.d.ts.map +1 -0
- package/dist/ui/screenspace.js +215 -0
- package/dist/ui/screenspace.js.map +1 -0
- package/dist/ui/ui.d.ts +209 -0
- package/dist/ui/ui.d.ts.map +1 -0
- package/dist/ui/ui.js +185 -0
- package/dist/ui/ui.js.map +1 -0
- package/dist/vendor/basis/README.md +46 -0
- package/dist/vendor/basis/basis_transcoder.js +19 -0
- package/dist/vendor/basis/basis_transcoder.wasm +0 -0
- package/dist/vendor/draco/README.md +32 -0
- package/dist/vendor/draco/draco_decoder.js +34 -0
- package/dist/vendor/draco/draco_decoder.wasm +0 -0
- package/dist/vendor/draco/draco_encoder.js +33 -0
- package/dist/vendor/draco/draco_wasm_wrapper.js +117 -0
- package/dist/vendor/draco/gltf/draco_decoder.js +33 -0
- package/dist/vendor/draco/gltf/draco_decoder.wasm +0 -0
- package/dist/vendor/draco/gltf/draco_encoder.js +33 -0
- package/dist/vendor/draco/gltf/draco_wasm_wrapper.js +116 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +4 -0
- package/dist/version.js.map +1 -0
- package/dist/visibility/index.d.ts +8 -0
- package/dist/visibility/index.d.ts.map +1 -0
- package/dist/visibility/visibility.d.ts +37 -0
- package/dist/visibility/visibility.d.ts.map +1 -0
- package/dist/visibility/visibility.js +52 -0
- package/dist/visibility/visibility.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* UI toolkit integration: spatial and screen‑space panels, DOM‑like queries, and behaviors.
|
|
9
|
+
*
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
* @category UI
|
|
12
|
+
*/
|
|
13
|
+
export { UIKitDocument } from './document.js';
|
|
14
|
+
export { PanelUI, PanelDocument, PanelUISystem } from './ui.js';
|
|
15
|
+
export type { PanelUIProps } from './ui.js';
|
|
16
|
+
export * from './follow.js';
|
|
17
|
+
export * from './screenspace.js';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG9C,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAChE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { Types } from '../ecs/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* CSS‑like screen‑space layout for a {@link PanelUI}.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* When XR is not presenting, the panel is re‑parented under the active camera and positioned
|
|
13
|
+
* in pixels using CSS‑like expressions for `top`/`left`/`bottom`/`right`, with `width`/`height`
|
|
14
|
+
* specified in any CSS units supported by the browser (e.g. `px`, `vw`, `vh`, `%`, `em`).
|
|
15
|
+
*
|
|
16
|
+
* On XR session start, the panel is automatically returned to world space.
|
|
17
|
+
*
|
|
18
|
+
* All size inputs are ultimately converted to meters using the camera frustum at `zOffset`.
|
|
19
|
+
*
|
|
20
|
+
* @example Place a panel at bottom‑right, 40% width, auto height
|
|
21
|
+
* ```ts
|
|
22
|
+
* entity.addComponent(PanelUI, { config: '/ui/menu.json' })
|
|
23
|
+
* entity.addComponent(ScreenSpace, {
|
|
24
|
+
* width: '40vw',
|
|
25
|
+
* height: 'auto',
|
|
26
|
+
* bottom: '24px',
|
|
27
|
+
* right: '24px',
|
|
28
|
+
* zOffset: 0.25,
|
|
29
|
+
* })
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @category UI
|
|
33
|
+
*/
|
|
34
|
+
export declare const ScreenSpace: import("elics").Component<{
|
|
35
|
+
/** CSS size expression for height (e.g., `240px`, `40vh`, `auto`). */
|
|
36
|
+
height: {
|
|
37
|
+
type: Types.String;
|
|
38
|
+
default: string;
|
|
39
|
+
};
|
|
40
|
+
/** CSS size expression for width (e.g., `480px`, `40vw`, `auto`). */
|
|
41
|
+
width: {
|
|
42
|
+
type: Types.String;
|
|
43
|
+
default: string;
|
|
44
|
+
};
|
|
45
|
+
/** CSS absolute `top` position (pixels/percent/vh) or `auto`. */
|
|
46
|
+
top: {
|
|
47
|
+
type: Types.String;
|
|
48
|
+
default: string;
|
|
49
|
+
};
|
|
50
|
+
/** CSS absolute `bottom` position (pixels/percent/vh) or `auto`. */
|
|
51
|
+
bottom: {
|
|
52
|
+
type: Types.String;
|
|
53
|
+
default: string;
|
|
54
|
+
};
|
|
55
|
+
/** CSS absolute `left` position (pixels/percent/vw) or `auto`. */
|
|
56
|
+
left: {
|
|
57
|
+
type: Types.String;
|
|
58
|
+
default: string;
|
|
59
|
+
};
|
|
60
|
+
/** CSS absolute `right` position (pixels/percent/vw) or `auto`. */
|
|
61
|
+
right: {
|
|
62
|
+
type: Types.String;
|
|
63
|
+
default: string;
|
|
64
|
+
};
|
|
65
|
+
/** Distance in meters in front of the camera’s near plane. */
|
|
66
|
+
zOffset: {
|
|
67
|
+
type: Types.Float32;
|
|
68
|
+
default: number;
|
|
69
|
+
};
|
|
70
|
+
}>;
|
|
71
|
+
declare const ScreenSpaceUISystem_base: import("elics").SystemConstructor<import("elics").SystemSchema, {
|
|
72
|
+
panels: {
|
|
73
|
+
required: (import("elics").Component<{
|
|
74
|
+
config: {
|
|
75
|
+
type: Types.String;
|
|
76
|
+
default: string;
|
|
77
|
+
};
|
|
78
|
+
maxWidth: {
|
|
79
|
+
type: Types.Float32;
|
|
80
|
+
default: number;
|
|
81
|
+
};
|
|
82
|
+
maxHeight: {
|
|
83
|
+
type: Types.Float32;
|
|
84
|
+
default: number;
|
|
85
|
+
};
|
|
86
|
+
}> | import("elics").Component<{
|
|
87
|
+
document: {
|
|
88
|
+
type: Types.Object;
|
|
89
|
+
default: undefined;
|
|
90
|
+
};
|
|
91
|
+
}> | import("elics").Component<{
|
|
92
|
+
/** CSS size expression for height (e.g., `240px`, `40vh`, `auto`). */
|
|
93
|
+
height: {
|
|
94
|
+
type: Types.String;
|
|
95
|
+
default: string;
|
|
96
|
+
};
|
|
97
|
+
/** CSS size expression for width (e.g., `480px`, `40vw`, `auto`). */
|
|
98
|
+
width: {
|
|
99
|
+
type: Types.String;
|
|
100
|
+
default: string;
|
|
101
|
+
};
|
|
102
|
+
/** CSS absolute `top` position (pixels/percent/vh) or `auto`. */
|
|
103
|
+
top: {
|
|
104
|
+
type: Types.String;
|
|
105
|
+
default: string;
|
|
106
|
+
};
|
|
107
|
+
/** CSS absolute `bottom` position (pixels/percent/vh) or `auto`. */
|
|
108
|
+
bottom: {
|
|
109
|
+
type: Types.String;
|
|
110
|
+
default: string;
|
|
111
|
+
};
|
|
112
|
+
/** CSS absolute `left` position (pixels/percent/vw) or `auto`. */
|
|
113
|
+
left: {
|
|
114
|
+
type: Types.String;
|
|
115
|
+
default: string;
|
|
116
|
+
};
|
|
117
|
+
/** CSS absolute `right` position (pixels/percent/vw) or `auto`. */
|
|
118
|
+
right: {
|
|
119
|
+
type: Types.String;
|
|
120
|
+
default: string;
|
|
121
|
+
};
|
|
122
|
+
/** Distance in meters in front of the camera’s near plane. */
|
|
123
|
+
zOffset: {
|
|
124
|
+
type: Types.Float32;
|
|
125
|
+
default: number;
|
|
126
|
+
};
|
|
127
|
+
}>)[];
|
|
128
|
+
};
|
|
129
|
+
}, import("../ecs/world.js").World, import("../ecs/system.js").System<import("elics").SystemSchema, {
|
|
130
|
+
panels: {
|
|
131
|
+
required: (import("elics").Component<{
|
|
132
|
+
config: {
|
|
133
|
+
type: Types.String;
|
|
134
|
+
default: string;
|
|
135
|
+
};
|
|
136
|
+
maxWidth: {
|
|
137
|
+
type: Types.Float32;
|
|
138
|
+
default: number;
|
|
139
|
+
};
|
|
140
|
+
maxHeight: {
|
|
141
|
+
type: Types.Float32;
|
|
142
|
+
default: number;
|
|
143
|
+
};
|
|
144
|
+
}> | import("elics").Component<{
|
|
145
|
+
document: {
|
|
146
|
+
type: Types.Object;
|
|
147
|
+
default: undefined;
|
|
148
|
+
};
|
|
149
|
+
}> | import("elics").Component<{
|
|
150
|
+
/** CSS size expression for height (e.g., `240px`, `40vh`, `auto`). */
|
|
151
|
+
height: {
|
|
152
|
+
type: Types.String;
|
|
153
|
+
default: string;
|
|
154
|
+
};
|
|
155
|
+
/** CSS size expression for width (e.g., `480px`, `40vw`, `auto`). */
|
|
156
|
+
width: {
|
|
157
|
+
type: Types.String;
|
|
158
|
+
default: string;
|
|
159
|
+
};
|
|
160
|
+
/** CSS absolute `top` position (pixels/percent/vh) or `auto`. */
|
|
161
|
+
top: {
|
|
162
|
+
type: Types.String;
|
|
163
|
+
default: string;
|
|
164
|
+
};
|
|
165
|
+
/** CSS absolute `bottom` position (pixels/percent/vh) or `auto`. */
|
|
166
|
+
bottom: {
|
|
167
|
+
type: Types.String;
|
|
168
|
+
default: string;
|
|
169
|
+
};
|
|
170
|
+
/** CSS absolute `left` position (pixels/percent/vw) or `auto`. */
|
|
171
|
+
left: {
|
|
172
|
+
type: Types.String;
|
|
173
|
+
default: string;
|
|
174
|
+
};
|
|
175
|
+
/** CSS absolute `right` position (pixels/percent/vw) or `auto`. */
|
|
176
|
+
right: {
|
|
177
|
+
type: Types.String;
|
|
178
|
+
default: string;
|
|
179
|
+
};
|
|
180
|
+
/** Distance in meters in front of the camera’s near plane. */
|
|
181
|
+
zOffset: {
|
|
182
|
+
type: Types.Float32;
|
|
183
|
+
default: number;
|
|
184
|
+
};
|
|
185
|
+
}>)[];
|
|
186
|
+
};
|
|
187
|
+
}>>;
|
|
188
|
+
/**
|
|
189
|
+
* Positions {@link PanelUI} documents relative to the camera with CSS‑like semantics.
|
|
190
|
+
*
|
|
191
|
+
* @remarks
|
|
192
|
+
* - Converts CSS units to pixels using temporary DOM nodes, then maps pixels to meters at
|
|
193
|
+
* a camera‑relative plane given by `zOffset`.
|
|
194
|
+
* - Automatically toggles between screen‑space (under the camera) and world‑space depending on
|
|
195
|
+
* `renderer.xr.isPresenting`.
|
|
196
|
+
* - Sets {@link UIKitDocument.setTargetDimensions} so that the UI scales to the requested size
|
|
197
|
+
* without distorting aspect ratio.
|
|
198
|
+
*
|
|
199
|
+
* @category UI
|
|
200
|
+
*/
|
|
201
|
+
export declare class ScreenSpaceUISystem extends ScreenSpaceUISystem_base {
|
|
202
|
+
private layoutHelpers;
|
|
203
|
+
private resized;
|
|
204
|
+
/** Prepare hidden DOM helpers and resize listener. */
|
|
205
|
+
init(): void;
|
|
206
|
+
/** Move panels between world and screen space and recompute layout on changes. */
|
|
207
|
+
update(): void;
|
|
208
|
+
/** Compute pixel size/position and apply camera‑relative transform. */
|
|
209
|
+
private calculateLayout;
|
|
210
|
+
/**
|
|
211
|
+
* Evaluate CSS expressions for width/height using a temporary DOM node.
|
|
212
|
+
* Returns pixel values from `window.getComputedStyle`.
|
|
213
|
+
*/
|
|
214
|
+
private getComputedDimensionValues;
|
|
215
|
+
/** Evaluate CSS absolute positioning and return `top`/`left` in pixels. */
|
|
216
|
+
private getComputedPositionValues;
|
|
217
|
+
}
|
|
218
|
+
export {};
|
|
219
|
+
//# sourceMappingURL=screenspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenspace.d.ts","sourceRoot":"","sources":["../../src/ui/screenspace.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAyC,MAAM,iBAAiB,CAAC;AAK/E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,WAAW;IAGpB,sEAAsE;;;;;IAEtE,qEAAqE;;;;;IAErE,iEAAiE;;;;;IAEjE,oEAAoE;;;;;IAEpE,kEAAkE;;;;;IAElE,mEAAmE;;;;;IAEnE,8DAA8D;;;;;EAIjE,CAAC;;;;;;;;;;;;;;;;;;;;;;YAhBE,sEAAsE;;;;;YAEtE,qEAAqE;;;;;YAErE,iEAAiE;;;;;YAEjE,oEAAoE;;;;;YAEpE,kEAAkE;;;;;YAElE,mEAAmE;;;;;YAEnE,8DAA8D;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAZ9D,sEAAsE;;;;;YAEtE,qEAAqE;;;;;YAErE,iEAAiE;;;;;YAEjE,oEAAoE;;;;;YAEpE,kEAAkE;;;;;YAElE,mEAAmE;;;;;YAEnE,8DAA8D;;;;;;;;AAKlE;;;;;;;;;;;;GAYG;AACH,qBAAa,mBAAoB,SAAQ,wBAEvC;IACA,OAAO,CAAC,aAAa,CAKnB;IACF,OAAO,CAAC,OAAO,CAAQ;IAEvB,sDAAsD;IACtD,IAAI;IAoBJ,kFAAkF;IAClF,MAAM,IAAI,IAAI;IA8Bd,uEAAuE;IACvE,OAAO,CAAC,eAAe;IAmEvB;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IAgBlC,2EAA2E;IAC3E,OAAO,CAAC,yBAAyB;CAwBlC"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { createSystem } from '../ecs/system.js';
|
|
2
|
+
import '../ecs/world.js';
|
|
3
|
+
import { createComponent, Types } from 'elics';
|
|
4
|
+
import '../ecs/component-registry.js';
|
|
5
|
+
import '../runtime/three.js';
|
|
6
|
+
import { PanelUI, PanelDocument } from './ui.js';
|
|
7
|
+
import { MathUtils } from 'three';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the MIT license found in the
|
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* CSS‑like screen‑space layout for a {@link PanelUI}.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* When XR is not presenting, the panel is re‑parented under the active camera and positioned
|
|
20
|
+
* in pixels using CSS‑like expressions for `top`/`left`/`bottom`/`right`, with `width`/`height`
|
|
21
|
+
* specified in any CSS units supported by the browser (e.g. `px`, `vw`, `vh`, `%`, `em`).
|
|
22
|
+
*
|
|
23
|
+
* On XR session start, the panel is automatically returned to world space.
|
|
24
|
+
*
|
|
25
|
+
* All size inputs are ultimately converted to meters using the camera frustum at `zOffset`.
|
|
26
|
+
*
|
|
27
|
+
* @example Place a panel at bottom‑right, 40% width, auto height
|
|
28
|
+
* ```ts
|
|
29
|
+
* entity.addComponent(PanelUI, { config: '/ui/menu.json' })
|
|
30
|
+
* entity.addComponent(ScreenSpace, {
|
|
31
|
+
* width: '40vw',
|
|
32
|
+
* height: 'auto',
|
|
33
|
+
* bottom: '24px',
|
|
34
|
+
* right: '24px',
|
|
35
|
+
* zOffset: 0.25,
|
|
36
|
+
* })
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @category UI
|
|
40
|
+
*/
|
|
41
|
+
const ScreenSpace = createComponent('ScreenSpace', {
|
|
42
|
+
/** CSS size expression for height (e.g., `240px`, `40vh`, `auto`). */
|
|
43
|
+
height: { type: Types.String, default: 'auto' },
|
|
44
|
+
/** CSS size expression for width (e.g., `480px`, `40vw`, `auto`). */
|
|
45
|
+
width: { type: Types.String, default: 'auto' },
|
|
46
|
+
/** CSS absolute `top` position (pixels/percent/vh) or `auto`. */
|
|
47
|
+
top: { type: Types.String, default: 'auto' },
|
|
48
|
+
/** CSS absolute `bottom` position (pixels/percent/vh) or `auto`. */
|
|
49
|
+
bottom: { type: Types.String, default: 'auto' },
|
|
50
|
+
/** CSS absolute `left` position (pixels/percent/vw) or `auto`. */
|
|
51
|
+
left: { type: Types.String, default: 'auto' },
|
|
52
|
+
/** CSS absolute `right` position (pixels/percent/vw) or `auto`. */
|
|
53
|
+
right: { type: Types.String, default: 'auto' },
|
|
54
|
+
/** Distance in meters in front of the camera’s near plane. */
|
|
55
|
+
zOffset: { type: Types.Float32, default: 0.2 },
|
|
56
|
+
}, 'Component for screen-space UI positioning');
|
|
57
|
+
/**
|
|
58
|
+
* Positions {@link PanelUI} documents relative to the camera with CSS‑like semantics.
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
* - Converts CSS units to pixels using temporary DOM nodes, then maps pixels to meters at
|
|
62
|
+
* a camera‑relative plane given by `zOffset`.
|
|
63
|
+
* - Automatically toggles between screen‑space (under the camera) and world‑space depending on
|
|
64
|
+
* `renderer.xr.isPresenting`.
|
|
65
|
+
* - Sets {@link UIKitDocument.setTargetDimensions} so that the UI scales to the requested size
|
|
66
|
+
* without distorting aspect ratio.
|
|
67
|
+
*
|
|
68
|
+
* @category UI
|
|
69
|
+
*/
|
|
70
|
+
class ScreenSpaceUISystem extends createSystem({
|
|
71
|
+
panels: { required: [PanelUI, PanelDocument, ScreenSpace] },
|
|
72
|
+
}) {
|
|
73
|
+
constructor() {
|
|
74
|
+
super(...arguments);
|
|
75
|
+
this.layoutHelpers = {
|
|
76
|
+
dimensionContainer: document.createElement('div'),
|
|
77
|
+
positionContainer: document.createElement('div'),
|
|
78
|
+
dimensionElement: document.createElement('div'),
|
|
79
|
+
positionElement: document.createElement('div'),
|
|
80
|
+
};
|
|
81
|
+
this.resized = true;
|
|
82
|
+
}
|
|
83
|
+
/** Prepare hidden DOM helpers and resize listener. */
|
|
84
|
+
init() {
|
|
85
|
+
this.layoutHelpers.dimensionContainer.style.width = '100vw';
|
|
86
|
+
this.layoutHelpers.dimensionContainer.style.height = '100vh';
|
|
87
|
+
this.layoutHelpers.dimensionContainer.style.position = 'absolute';
|
|
88
|
+
this.layoutHelpers.dimensionContainer.style.visibility = 'hidden';
|
|
89
|
+
this.layoutHelpers.positionContainer.style.width = '100vw';
|
|
90
|
+
this.layoutHelpers.positionContainer.style.height = '100vh';
|
|
91
|
+
this.layoutHelpers.positionContainer.style.position = 'relative';
|
|
92
|
+
this.layoutHelpers.positionContainer.style.visibility = 'hidden';
|
|
93
|
+
window.addEventListener('resize', () => {
|
|
94
|
+
this.resized = true;
|
|
95
|
+
}, false);
|
|
96
|
+
}
|
|
97
|
+
/** Move panels between world and screen space and recompute layout on changes. */
|
|
98
|
+
update() {
|
|
99
|
+
this.queries.panels.entities.forEach((entity) => {
|
|
100
|
+
const parent = entity.object3D;
|
|
101
|
+
const document = PanelDocument.data.document[entity.index];
|
|
102
|
+
if (!document) {
|
|
103
|
+
return;
|
|
104
|
+
} // Skip if UI not loaded yet
|
|
105
|
+
const panelInScreenSpace = document.parent === this.camera;
|
|
106
|
+
if (this.renderer.xr.isPresenting && panelInScreenSpace) {
|
|
107
|
+
// Move back to world space when entering XR
|
|
108
|
+
parent === null || parent === void 0 ? void 0 : parent.add(document);
|
|
109
|
+
// Reset position that were set during screen space layout
|
|
110
|
+
document.position.set(0, 0, 0);
|
|
111
|
+
}
|
|
112
|
+
else if (!this.renderer.xr.isPresenting && !panelInScreenSpace) {
|
|
113
|
+
// Move to screen space when not in XR
|
|
114
|
+
this.camera.add(document);
|
|
115
|
+
this.calculateLayout(entity);
|
|
116
|
+
}
|
|
117
|
+
else if (panelInScreenSpace && this.resized) {
|
|
118
|
+
// Recalculate layout on resize
|
|
119
|
+
this.calculateLayout(entity);
|
|
120
|
+
this.resized = false;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/** Compute pixel size/position and apply camera‑relative transform. */
|
|
125
|
+
calculateLayout(entity) {
|
|
126
|
+
const document = PanelDocument.data.document[entity.index];
|
|
127
|
+
const computedSize = document === null || document === void 0 ? void 0 : document.computedSize;
|
|
128
|
+
if (document && computedSize) {
|
|
129
|
+
const widthExp = entity.getValue(ScreenSpace, 'width');
|
|
130
|
+
const heightExp = entity.getValue(ScreenSpace, 'height');
|
|
131
|
+
const top = entity.getValue(ScreenSpace, 'top');
|
|
132
|
+
const bottom = entity.getValue(ScreenSpace, 'bottom');
|
|
133
|
+
const left = entity.getValue(ScreenSpace, 'left');
|
|
134
|
+
const right = entity.getValue(ScreenSpace, 'right');
|
|
135
|
+
const zOffset = entity.getValue(ScreenSpace, 'zOffset');
|
|
136
|
+
// Get desired dimensions in screen pixels
|
|
137
|
+
const { height: hPx, width: wPx } = this.getComputedDimensionValues(widthExp, heightExp);
|
|
138
|
+
// Convert UIKit dimensions to world space units (UIKit uses cm units)
|
|
139
|
+
const uiWidthInWorldUnits = computedSize.width / 100;
|
|
140
|
+
const uiHeightInWorldUnits = computedSize.height / 100;
|
|
141
|
+
// Screen dimensions
|
|
142
|
+
const W = this.renderer.domElement.clientWidth;
|
|
143
|
+
const H = this.renderer.domElement.clientHeight;
|
|
144
|
+
// Calculate world-to-pixel conversion for screen space at zOffset
|
|
145
|
+
const vFOV = MathUtils.degToRad(this.camera.fov);
|
|
146
|
+
const worldHeightAtZ = 2 * Math.tan(vFOV / 2) * zOffset;
|
|
147
|
+
const worldPerPixel = worldHeightAtZ / H;
|
|
148
|
+
// Calculate desired world space dimensions
|
|
149
|
+
const targetWorldWidth = wPx * worldPerPixel;
|
|
150
|
+
const targetWorldHeight = hPx * worldPerPixel;
|
|
151
|
+
// Set target dimensions on UIKitDocument - this will trigger reactive scaling
|
|
152
|
+
document.setTargetDimensions(targetWorldWidth, targetWorldHeight);
|
|
153
|
+
// Get final scaled dimensions for positioning
|
|
154
|
+
const finalScale = document.scale.x; // UIKitDocument sets uniform scale
|
|
155
|
+
const usedWpx = (uiWidthInWorldUnits * finalScale) / worldPerPixel;
|
|
156
|
+
const usedHpx = (uiHeightInWorldUnits * finalScale) / worldPerPixel;
|
|
157
|
+
// Calculate position based on CSS-like positioning
|
|
158
|
+
const { top: computedTop, left: computedLeft } = this.getComputedPositionValues(usedWpx, usedHpx, {
|
|
159
|
+
top,
|
|
160
|
+
bottom,
|
|
161
|
+
left,
|
|
162
|
+
right,
|
|
163
|
+
});
|
|
164
|
+
// Convert screen position to camera-relative world position
|
|
165
|
+
const centerXpx = computedLeft + usedWpx / 2;
|
|
166
|
+
const centerYpx = H - computedTop - usedHpx / 2;
|
|
167
|
+
const camX = (centerXpx - W / 2) * worldPerPixel;
|
|
168
|
+
const camY = (centerYpx - H / 2) * worldPerPixel;
|
|
169
|
+
const camZ = -zOffset;
|
|
170
|
+
// Position the UIKitDocument in camera space
|
|
171
|
+
document.position.set(camX, camY, camZ);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Evaluate CSS expressions for width/height using a temporary DOM node.
|
|
176
|
+
* Returns pixel values from `window.getComputedStyle`.
|
|
177
|
+
*/
|
|
178
|
+
getComputedDimensionValues(widthExp, heightExp) {
|
|
179
|
+
const { dimensionElement: element, dimensionContainer: container } = this.layoutHelpers;
|
|
180
|
+
document.body.appendChild(container);
|
|
181
|
+
element.style.width = widthExp;
|
|
182
|
+
element.style.height = heightExp;
|
|
183
|
+
container.appendChild(element);
|
|
184
|
+
const pixelValues = window.getComputedStyle(element);
|
|
185
|
+
const result = {
|
|
186
|
+
width: parseFloat(pixelValues.width),
|
|
187
|
+
height: parseFloat(pixelValues.height),
|
|
188
|
+
};
|
|
189
|
+
document.body.removeChild(container);
|
|
190
|
+
return result;
|
|
191
|
+
}
|
|
192
|
+
/** Evaluate CSS absolute positioning and return `top`/`left` in pixels. */
|
|
193
|
+
getComputedPositionValues(widthPx, heightPx, { top = 'auto', bottom = 'auto', left = 'auto', right = 'auto' }) {
|
|
194
|
+
const { positionElement: element, positionContainer: container } = this.layoutHelpers;
|
|
195
|
+
document.body.appendChild(container);
|
|
196
|
+
element.style.position = 'absolute';
|
|
197
|
+
element.style.width = `${widthPx}px`;
|
|
198
|
+
element.style.height = `${heightPx}px`;
|
|
199
|
+
element.style.top = top;
|
|
200
|
+
element.style.bottom = bottom;
|
|
201
|
+
element.style.left = left;
|
|
202
|
+
element.style.right = right;
|
|
203
|
+
container.appendChild(element);
|
|
204
|
+
const pixelValues = window.getComputedStyle(element);
|
|
205
|
+
const result = {
|
|
206
|
+
top: parseFloat(pixelValues.top),
|
|
207
|
+
left: parseFloat(pixelValues.left),
|
|
208
|
+
};
|
|
209
|
+
document.body.removeChild(container);
|
|
210
|
+
return result;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export { ScreenSpace, ScreenSpaceUISystem };
|
|
215
|
+
//# sourceMappingURL=screenspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenspace.js","sources":["../../src/ui/screenspace.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAAA;;;;;AAKG;AAOH;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACI,MAAM,WAAW,GAAG,eAAe,CACxC,aAAa,EACb;;IAEE,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE;;IAE/C,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE;;IAE9C,GAAG,EAAE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AAQ,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC;AACpC,QAAA,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU;QACnC,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,CAAA,EAAG,OAAO,IAAI;QACpC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAA,EAAG,QAAQ,IAAI;AACtC,QAAA,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG;AACvB,QAAA,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM;AAC7B,QAAA,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI;AACzB,QAAA,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK;AAC3B,QAAA,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC;QAC9B,MAAM,WAAW,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC;AACpD,QAAA,MAAM,MAAM,GAAG;AACb,YAAA,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC;AAChC,YAAA,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC;SACnC;AACD,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC;AACpC,QAAA,OAAO,MAAM;IACf;AACD;;;;"}
|
package/dist/ui/ui.d.ts
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { Types } from '../ecs/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Props accepted by the {@link PanelUI} component.
|
|
10
|
+
* @category UI
|
|
11
|
+
*/
|
|
12
|
+
export interface PanelUIProps {
|
|
13
|
+
/** Path to compiled UIKitML JSON. @example "/ui/settings.json" */
|
|
14
|
+
config: string;
|
|
15
|
+
/** Max panel width in meters. @defaultValue 1 */
|
|
16
|
+
maxWidth?: number;
|
|
17
|
+
/** Max panel height in meters. @defaultValue 1 */
|
|
18
|
+
maxHeight?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Component for 3D panel UI elements with file‑based configuration.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* - Compile `.uikitml` → JSON using the UIKitML Vite plugin, then set {@link PanelUIProps.config}.
|
|
25
|
+
* - When parented to world space (default), {@link PanelUISystem} drives target dimensions from
|
|
26
|
+
* {@link PanelUIProps.maxWidth} / {@link PanelUIProps.maxHeight} and accounts for world scale.
|
|
27
|
+
* - Pointer events are forwarded to the UI when `forwardHtmlEvents` is enabled.
|
|
28
|
+
* @category UI
|
|
29
|
+
* @see /getting-started/06-spatial-ui
|
|
30
|
+
*/
|
|
31
|
+
export declare const PanelUI: import("elics").Component<{
|
|
32
|
+
/** Path to .json file */
|
|
33
|
+
config: {
|
|
34
|
+
type: Types.String;
|
|
35
|
+
default: string;
|
|
36
|
+
};
|
|
37
|
+
/** Max width constraint */
|
|
38
|
+
maxWidth: {
|
|
39
|
+
type: Types.Float32;
|
|
40
|
+
default: number;
|
|
41
|
+
};
|
|
42
|
+
/** Max height constraint */
|
|
43
|
+
maxHeight: {
|
|
44
|
+
type: Types.Float32;
|
|
45
|
+
default: number;
|
|
46
|
+
};
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* Internal component containing the loaded UI document (a UIKitDocument `Group`).
|
|
50
|
+
* @category UI
|
|
51
|
+
* @hideineditor
|
|
52
|
+
*/
|
|
53
|
+
export declare const PanelDocument: import("elics").Component<{
|
|
54
|
+
document: {
|
|
55
|
+
type: Types.Object;
|
|
56
|
+
default: undefined;
|
|
57
|
+
};
|
|
58
|
+
}>;
|
|
59
|
+
declare const PanelUISystem_base: import("elics").SystemConstructor<{
|
|
60
|
+
/** When true, forwards HTML/DOM pointer events to the 3D UI. */
|
|
61
|
+
forwardHtmlEvents: {
|
|
62
|
+
type: Types.Boolean;
|
|
63
|
+
default: true;
|
|
64
|
+
};
|
|
65
|
+
/** Additional pre-built UI component libraries */
|
|
66
|
+
kits: {
|
|
67
|
+
type: Types.Object;
|
|
68
|
+
default: {};
|
|
69
|
+
};
|
|
70
|
+
}, {
|
|
71
|
+
unconfiguredPanels: {
|
|
72
|
+
required: import("elics").Component<{
|
|
73
|
+
/** Path to .json file */
|
|
74
|
+
config: {
|
|
75
|
+
type: Types.String;
|
|
76
|
+
default: string;
|
|
77
|
+
};
|
|
78
|
+
/** Max width constraint */
|
|
79
|
+
maxWidth: {
|
|
80
|
+
type: Types.Float32;
|
|
81
|
+
default: number;
|
|
82
|
+
};
|
|
83
|
+
/** Max height constraint */
|
|
84
|
+
maxHeight: {
|
|
85
|
+
type: Types.Float32;
|
|
86
|
+
default: number;
|
|
87
|
+
};
|
|
88
|
+
}>[];
|
|
89
|
+
excluded: import("elics").Component<{
|
|
90
|
+
document: {
|
|
91
|
+
type: Types.Object;
|
|
92
|
+
default: undefined;
|
|
93
|
+
};
|
|
94
|
+
}>[];
|
|
95
|
+
};
|
|
96
|
+
configuredPanels: {
|
|
97
|
+
required: (import("elics").Component<{
|
|
98
|
+
/** Path to .json file */
|
|
99
|
+
config: {
|
|
100
|
+
type: Types.String;
|
|
101
|
+
default: string;
|
|
102
|
+
};
|
|
103
|
+
/** Max width constraint */
|
|
104
|
+
maxWidth: {
|
|
105
|
+
type: Types.Float32;
|
|
106
|
+
default: number;
|
|
107
|
+
};
|
|
108
|
+
/** Max height constraint */
|
|
109
|
+
maxHeight: {
|
|
110
|
+
type: Types.Float32;
|
|
111
|
+
default: number;
|
|
112
|
+
};
|
|
113
|
+
}> | import("elics").Component<{
|
|
114
|
+
document: {
|
|
115
|
+
type: Types.Object;
|
|
116
|
+
default: undefined;
|
|
117
|
+
};
|
|
118
|
+
}>)[];
|
|
119
|
+
};
|
|
120
|
+
}, import("../ecs/world.js").World, import("../ecs/system.js").System<{
|
|
121
|
+
/** When true, forwards HTML/DOM pointer events to the 3D UI. */
|
|
122
|
+
forwardHtmlEvents: {
|
|
123
|
+
type: Types.Boolean;
|
|
124
|
+
default: true;
|
|
125
|
+
};
|
|
126
|
+
/** Additional pre-built UI component libraries */
|
|
127
|
+
kits: {
|
|
128
|
+
type: Types.Object;
|
|
129
|
+
default: {};
|
|
130
|
+
};
|
|
131
|
+
}, {
|
|
132
|
+
unconfiguredPanels: {
|
|
133
|
+
required: import("elics").Component<{
|
|
134
|
+
/** Path to .json file */
|
|
135
|
+
config: {
|
|
136
|
+
type: Types.String;
|
|
137
|
+
default: string;
|
|
138
|
+
};
|
|
139
|
+
/** Max width constraint */
|
|
140
|
+
maxWidth: {
|
|
141
|
+
type: Types.Float32;
|
|
142
|
+
default: number;
|
|
143
|
+
};
|
|
144
|
+
/** Max height constraint */
|
|
145
|
+
maxHeight: {
|
|
146
|
+
type: Types.Float32;
|
|
147
|
+
default: number;
|
|
148
|
+
};
|
|
149
|
+
}>[];
|
|
150
|
+
excluded: import("elics").Component<{
|
|
151
|
+
document: {
|
|
152
|
+
type: Types.Object;
|
|
153
|
+
default: undefined;
|
|
154
|
+
};
|
|
155
|
+
}>[];
|
|
156
|
+
};
|
|
157
|
+
configuredPanels: {
|
|
158
|
+
required: (import("elics").Component<{
|
|
159
|
+
/** Path to .json file */
|
|
160
|
+
config: {
|
|
161
|
+
type: Types.String;
|
|
162
|
+
default: string;
|
|
163
|
+
};
|
|
164
|
+
/** Max width constraint */
|
|
165
|
+
maxWidth: {
|
|
166
|
+
type: Types.Float32;
|
|
167
|
+
default: number;
|
|
168
|
+
};
|
|
169
|
+
/** Max height constraint */
|
|
170
|
+
maxHeight: {
|
|
171
|
+
type: Types.Float32;
|
|
172
|
+
default: number;
|
|
173
|
+
};
|
|
174
|
+
}> | import("elics").Component<{
|
|
175
|
+
document: {
|
|
176
|
+
type: Types.Object;
|
|
177
|
+
default: undefined;
|
|
178
|
+
};
|
|
179
|
+
}>)[];
|
|
180
|
+
};
|
|
181
|
+
}>>;
|
|
182
|
+
/**
|
|
183
|
+
* Renders and updates spatial UI panels and forwards pointer events.
|
|
184
|
+
*
|
|
185
|
+
* @remarks
|
|
186
|
+
* - Sets Three.js transparent sort to a stable painter order for UI readability.
|
|
187
|
+
* - When configured to forward HTML events, bridges DOM events into the 3D scene.
|
|
188
|
+
* - Continuously updates document target dimensions in world space.
|
|
189
|
+
* @category UI
|
|
190
|
+
*/
|
|
191
|
+
export declare class PanelUISystem extends PanelUISystem_base {
|
|
192
|
+
private htmlHandler?;
|
|
193
|
+
private vec3;
|
|
194
|
+
/** Configure transparent sort, set up DOM event forwarding, and reactive queries. */
|
|
195
|
+
init(): void;
|
|
196
|
+
/** Forward HTML events and tick loaded UIKit documents each frame. */
|
|
197
|
+
update(_delta: number): void;
|
|
198
|
+
/**
|
|
199
|
+
* Load and interpret the `PanelUI.config` JSON file, create a {@link UIKitDocument},
|
|
200
|
+
* attach it to the entity, and tag the entity with {@link PanelDocument}.
|
|
201
|
+
*/
|
|
202
|
+
private loadPanel;
|
|
203
|
+
/** Remove, dispose, and detach the loaded {@link UIKitDocument} from the entity. */
|
|
204
|
+
private cleanupPanel;
|
|
205
|
+
/** Tear down forwarded event handling. */
|
|
206
|
+
destroy(): void;
|
|
207
|
+
}
|
|
208
|
+
export {};
|
|
209
|
+
//# sourceMappingURL=ui.d.ts.map
|