@iwer/devui 1.1.0 → 1.1.2

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 (73) hide show
  1. package/build/iwer-devui.js +16603 -405
  2. package/build/iwer-devui.min.js +33 -51
  3. package/build/iwer-devui.module.js +16603 -405
  4. package/build/iwer-devui.module.min.js +19 -37
  5. package/lib/components/header.d.ts +7 -0
  6. package/lib/components/header.d.ts.map +1 -1
  7. package/lib/components/header.js +37 -4
  8. package/lib/components/header.js.map +1 -1
  9. package/lib/index.d.ts +1 -1
  10. package/lib/version.d.ts +1 -1
  11. package/lib/version.js +1 -1
  12. package/package.json +7 -7
  13. package/lib/components/fov.d.ts +0 -16
  14. package/lib/components/fov.d.ts.map +0 -1
  15. package/lib/components/fov.js +0 -30
  16. package/lib/components/fov.js.map +0 -1
  17. package/lib/package.json +0 -55
  18. package/lib/src/components/analog.d.ts +0 -17
  19. package/lib/src/components/analog.d.ts.map +0 -1
  20. package/lib/src/components/analog.js +0 -111
  21. package/lib/src/components/analog.js.map +0 -1
  22. package/lib/src/components/binary.d.ts +0 -17
  23. package/lib/src/components/binary.d.ts.map +0 -1
  24. package/lib/src/components/binary.js +0 -77
  25. package/lib/src/components/binary.js.map +0 -1
  26. package/lib/src/components/controls.d.ts +0 -29
  27. package/lib/src/components/controls.d.ts.map +0 -1
  28. package/lib/src/components/controls.js +0 -139
  29. package/lib/src/components/controls.js.map +0 -1
  30. package/lib/src/components/fov.d.ts +0 -16
  31. package/lib/src/components/fov.d.ts.map +0 -1
  32. package/lib/src/components/fov.js +0 -30
  33. package/lib/src/components/fov.js.map +0 -1
  34. package/lib/src/components/header.d.ts +0 -20
  35. package/lib/src/components/header.d.ts.map +0 -1
  36. package/lib/src/components/header.js +0 -47
  37. package/lib/src/components/header.js.map +0 -1
  38. package/lib/src/components/headset.d.ts +0 -17
  39. package/lib/src/components/headset.d.ts.map +0 -1
  40. package/lib/src/components/headset.js +0 -29
  41. package/lib/src/components/headset.js.map +0 -1
  42. package/lib/src/components/icons.d.ts +0 -37
  43. package/lib/src/components/icons.d.ts.map +0 -1
  44. package/lib/src/components/icons.js +0 -265
  45. package/lib/src/components/icons.js.map +0 -1
  46. package/lib/src/components/joystick.d.ts +0 -21
  47. package/lib/src/components/joystick.d.ts.map +0 -1
  48. package/lib/src/components/joystick.js +0 -245
  49. package/lib/src/components/joystick.js.map +0 -1
  50. package/lib/src/components/keys.d.ts +0 -10
  51. package/lib/src/components/keys.d.ts.map +0 -1
  52. package/lib/src/components/keys.js +0 -74
  53. package/lib/src/components/keys.js.map +0 -1
  54. package/lib/src/components/mapper.d.ts +0 -22
  55. package/lib/src/components/mapper.d.ts.map +0 -1
  56. package/lib/src/components/mapper.js +0 -108
  57. package/lib/src/components/mapper.js.map +0 -1
  58. package/lib/src/components/styled.d.ts +0 -70
  59. package/lib/src/components/styled.d.ts.map +0 -1
  60. package/lib/src/components/styled.js +0 -272
  61. package/lib/src/components/styled.js.map +0 -1
  62. package/lib/src/components/vec3.d.ts +0 -22
  63. package/lib/src/components/vec3.d.ts.map +0 -1
  64. package/lib/src/components/vec3.js +0 -123
  65. package/lib/src/components/vec3.js.map +0 -1
  66. package/lib/src/index.d.ts +0 -22
  67. package/lib/src/index.d.ts.map +0 -1
  68. package/lib/src/index.js +0 -92
  69. package/lib/src/index.js.map +0 -1
  70. package/lib/src/scene.d.ts +0 -51
  71. package/lib/src/scene.d.ts.map +0 -1
  72. package/lib/src/scene.js +0 -250
  73. package/lib/src/scene.js.map +0 -1
@@ -1,139 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * Copyright (c) Meta Platforms, Inc. and affiliates.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
- import { Colors, FAIcon } from './styled.js';
9
- import { ControllerMapper, useKeyMapStore } from './mapper.js';
10
- import { PRIVATE } from '../scene.js';
11
- import { faCircleXmark, faGamepad, faGear, faPlug, } from '@fortawesome/free-solid-svg-icons';
12
- import { AnalogButton } from './analog.js';
13
- import { BinaryButton } from './binary.js';
14
- import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
15
- import { Joystick } from './joystick.js';
16
- import React from 'react';
17
- import { Vector3Input } from './vec3.js';
18
- import { styled } from 'styled-components';
19
- const ControlsContainer = styled.div `
20
- position: fixed;
21
- bottom: 8px;
22
- padding: 5px;
23
- font-family: Arial, sans-serif;
24
- color: ${Colors.textWhite};
25
- pointer-events: all;
26
- background-color: ${Colors.panelBackground};
27
- border: 1px solid ${Colors.panelBorder};
28
- backdrop-filter: blur(40px);
29
- -webkit-backdrop-filter: blur(40px);
30
- border-radius: 12px;
31
- box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
32
- overflow: hidden;
33
- `;
34
- const SectionBreak = styled.hr `
35
- width: 100%;
36
- height: 1px;
37
- background-color: ${Colors.panelBorder};
38
- border: none;
39
- `;
40
- export const HeaderButton = styled.button `
41
- background-color: transparent;
42
- border: none;
43
- display: flex;
44
- align-items: center;
45
- justify-content: center;
46
- cursor: pointer;
47
- color: ${({ $isRed }) => ($isRed ? Colors.dangerRed : Colors.textWhite)};
48
- font-size: 12px;
49
- padding: 3px;
50
- text-transform: none;
51
- box-shadow: none;
52
-
53
- &:hover {
54
- color: ${({ $isRed }) => ($isRed ? Colors.dangerRedPressed : '#ffffff')};
55
- }
56
-
57
- &:active {
58
- color: ${({ $isRed }) => ($isRed ? Colors.dangerRedPressed : '#ffffff')};
59
- }
60
-
61
- &:focus {
62
- outline: none;
63
- }
64
- `;
65
- function transformGamepadConfig(gamepadConfig) {
66
- const axesSet = new Set();
67
- // Add all axis ids to the set
68
- for (const axis of gamepadConfig.axes) {
69
- if (axis && axis.id) {
70
- axesSet.add(axis.id);
71
- }
72
- }
73
- // Transform buttons to the desired format
74
- const transformed = gamepadConfig.buttons
75
- .filter((button) => button !== null) // Filter out null values
76
- .map((button) => ({
77
- id: button.id,
78
- type: button.type,
79
- hasAxes: axesSet.has(button.id),
80
- }));
81
- // Sort the array by hasAxes
82
- transformed.sort((a, b) => {
83
- if (a.hasAxes && !b.hasAxes)
84
- return -1;
85
- if (!a.hasAxes && b.hasAxes)
86
- return 1;
87
- return 0;
88
- });
89
- return transformed;
90
- }
91
- export const ControlsUI = ({ xrDevice, inputLayer, pointerLocked, }) => {
92
- return (_jsx(_Fragment, { children: Object.entries(xrDevice.controllers).map(([handedness, controller]) => (_jsx(ControllerUI, { controller: controller, handle: inputLayer[PRIVATE].transformHandles.get(handedness), handedness: handedness, pointerLocked: pointerLocked }, `controller-${handedness}`))) }));
93
- };
94
- export const ControllerUI = ({ controller, handle, handedness, pointerLocked, }) => {
95
- const { keyMap } = useKeyMapStore();
96
- const [connected, setConnected] = React.useState(controller.connected);
97
- const [settingsOpen, setSettingsOpen] = React.useState(false);
98
- React.useEffect(() => {
99
- if (pointerLocked) {
100
- setSettingsOpen(false);
101
- }
102
- }, [pointerLocked]);
103
- return (_jsxs(ControlsContainer, { style: handedness === 'left' ? { left: '8px' } : { right: '8px' }, children: [!pointerLocked && (_jsx(_Fragment, { children: _jsxs("div", { style: {
104
- display: 'flex',
105
- flexDirection: 'row',
106
- justifyContent: 'space-between',
107
- alignItems: 'center',
108
- }, children: [_jsxs("div", { style: {
109
- fontSize: '13px',
110
- display: 'flex',
111
- flexDirection: 'row',
112
- alignItems: 'center',
113
- }, children: [_jsx(FontAwesomeIcon, { icon: faGamepad, style: { marginRight: '5px' } }), "Controller\u00A0", _jsxs("span", { style: { fontWeight: 'bold' }, children: ["[", handedness === 'left' ? 'L' : 'R', "]"] })] }), _jsx("div", { style: {
114
- display: 'flex',
115
- flexDirection: 'row',
116
- gap: '1px',
117
- }, children: connected ? (_jsxs(_Fragment, { children: [_jsx(HeaderButton, { "$isRed": false, onClick: () => {
118
- setSettingsOpen(!settingsOpen);
119
- }, children: _jsx(FAIcon, { icon: faGear }) }), _jsx(HeaderButton, { "$isRed": true, onClick: () => {
120
- controller.connected = false;
121
- setConnected(false);
122
- }, children: _jsx(FAIcon, { icon: faCircleXmark }) })] })) : (_jsx(HeaderButton, { "$isRed": false, onClick: () => {
123
- controller.connected = true;
124
- setConnected(true);
125
- }, style: { marginLeft: '5px' }, children: _jsx(FAIcon, { icon: faPlug }) })) })] }) })), connected && !pointerLocked && (_jsxs(_Fragment, { children: [!settingsOpen && (_jsxs(_Fragment, { children: [_jsx(SectionBreak, {}), _jsx(Vector3Input, { vector: handle.position, label: "Position" }), _jsx(Vector3Input, { vector: handle.rotation, label: "Rotation" })] })), _jsx(SectionBreak, {})] })), connected &&
126
- (settingsOpen ? (_jsx(ControllerMapper, { handedness: handedness })) : (transformGamepadConfig(controller.gamepadConfig).map((buttonConfig) => {
127
- const mapping = keyMap[handedness];
128
- if (buttonConfig.hasAxes) {
129
- return (_jsx(Joystick, { xrController: controller, pointerLocked: pointerLocked, buttonId: buttonConfig.id, mappedKeyUp: keyMap[handedness][`${buttonConfig.id}-up`], mappedKeyDown: mapping[`${buttonConfig.id}-down`], mappedKeyLeft: mapping[`${buttonConfig.id}-left`], mappedKeyRight: mapping[`${buttonConfig.id}-right`], mappedKeyPressed: mapping[buttonConfig.id] }, buttonConfig.id));
130
- }
131
- else if (buttonConfig.type === 'analog') {
132
- return (_jsx(AnalogButton, { xrController: controller, buttonId: buttonConfig.id, mappedKey: mapping[buttonConfig.id], pointerLocked: pointerLocked }, buttonConfig.id));
133
- }
134
- else {
135
- return (_jsx(BinaryButton, { xrController: controller, buttonId: buttonConfig.id, mappedKey: mapping[buttonConfig.id], pointerLocked: pointerLocked }, buttonConfig.id));
136
- }
137
- })))] }, handedness));
138
- };
139
- //# sourceMappingURL=controls.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"controls.js","sourceRoot":"","sources":["../../../src/components/controls.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,aA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B,YAAY,CAAC,EAAE,CACnB,CACF,CAAC;oBACH,CAAC;yBAAM,CAAC;wBACP,OAAO,CACN,KAAC,YAAY,IACZ,YAAY,EAAE,UAAU,EACxB,QAAQ,EAAE,YAAY,CAAC,EAAE,EACzB,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,EACnC,aAAa,EAAE,aAAa,IACvB,YAAY,CAAC,EAAE,CACnB,CACF,CAAC;oBACH,CAAC;gBACF,CAAC,CACD,CACD,CAAC,KArIE,UAAU,CAsII,CACpB,CAAC;AACH,CAAC,CAAC"}
@@ -1,16 +0,0 @@
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 React from 'react';
8
- import { InputLayer } from '../scene.js';
9
- import { XRDevice } from 'iwer';
10
- interface FOVMenuProps {
11
- xrDevice: XRDevice;
12
- inputLayer: InputLayer;
13
- }
14
- export declare const FOVMenu: React.FC<FOVMenuProps>;
15
- export {};
16
- //# sourceMappingURL=fov.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fov.d.ts","sourceRoot":"","sources":["../../../src/components/fov.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAGhC,UAAU,YAAY;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,CAAC;CACvB;AAaD,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA4B1C,CAAC"}
@@ -1,30 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * Copyright (c) Meta Platforms, Inc. and affiliates.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
- import { Button, ButtonGroup, RangeSelector } from './styled.js';
9
- import { useState } from 'react';
10
- import { styled } from 'styled-components';
11
- const FovSettingContainer = styled.div `
12
- display: flex;
13
- justify-content: center;
14
- pointer-events: all;
15
- position: fixed;
16
- display: flex;
17
- top: 40px;
18
- left: calc(50vw - 156px);
19
- width: 312px;
20
- `;
21
- export const FOVMenu = ({ xrDevice, inputLayer }) => {
22
- const [fovy, setFovy] = useState(xrDevice.fovy);
23
- return (_jsx(FovSettingContainer, { children: _jsxs(ButtonGroup, { "$reverse": false, children: [_jsx(Button, { "$reverse": false, disabled: true, children: "FOV-Y" }), _jsx(RangeSelector, { "$reverse": false, value: fovy, style: { width: '100px', borderRadius: '2px' }, onChange: (e) => {
24
- const value = Number(e.target.value);
25
- setFovy(value);
26
- xrDevice.fovy = value;
27
- inputLayer.syncFovy();
28
- }, min: Math.PI / 6, max: Math.PI / 1.5, step: Math.PI / 48 }), _jsxs(Button, { "$reverse": false, disabled: true, children: [((fovy / Math.PI) * 180).toFixed(2), "\u00B0"] })] }) }));
29
- };
30
- //# sourceMappingURL=fov.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fov.js","sourceRoot":"","sources":["../../../src/components/fov.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjE,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIxC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAO3C,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;CASrC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAA2B,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;IAC3E,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAChD,OAAO,CACN,KAAC,mBAAmB,cACnB,MAAC,WAAW,gBAAW,KAAK,aAC3B,KAAC,MAAM,gBAAW,KAAK,EAAE,QAAQ,EAAE,IAAI,sBAE9B,EACT,KAAC,aAAa,gBACH,KAAK,EACf,KAAK,EAAE,IAAI,EACX,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,EAC9C,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;wBACf,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;wBACrC,OAAO,CAAC,KAAK,CAAC,CAAC;wBACf,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC;wBACtB,UAAU,CAAC,QAAQ,EAAE,CAAC;oBACvB,CAAC,EACD,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,EAChB,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,EAClB,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,GACjB,EACF,MAAC,MAAM,gBAAW,KAAK,EAAE,QAAQ,EAAE,IAAI,aACrC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,cAC5B,IACI,GACO,CACtB,CAAC;AACH,CAAC,CAAC"}
@@ -1,20 +0,0 @@
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 { InputLayer } from '../scene.js';
8
- import React from 'react';
9
- import { XRDevice } from 'iwer';
10
- interface HeaderUIProps {
11
- xrDevice: XRDevice;
12
- inputLayer: InputLayer;
13
- keyMapOpen: boolean;
14
- setKeyMapOpen: React.Dispatch<React.SetStateAction<boolean>>;
15
- fovSettingOpen: boolean;
16
- setFovSettingOpen: React.Dispatch<React.SetStateAction<boolean>>;
17
- }
18
- export declare const HeaderUI: React.FC<HeaderUIProps>;
19
- export {};
20
- //# sourceMappingURL=header.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../src/components/header.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AA6ChC,UAAU,aAAa;IACtB,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC7D,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CACjE;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAoG5C,CAAC"}
@@ -1,47 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * Copyright (c) Meta Platforms, Inc. and affiliates.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
- import { Colors, FAIcon, HeaderButton } from './styled.js';
9
- import { faCirclePlay, faRightFromBracket, faRotateLeft, faVideo, } from '@fortawesome/free-solid-svg-icons';
10
- import { styled } from 'styled-components';
11
- const HeaderButtonsContainer = styled.div `
12
- padding: 2px;
13
- display: flex;
14
- background-color: ${Colors.panelBackground};
15
- border: 1px solid ${Colors.panelBorder};
16
- backdrop-filter: blur(40px);
17
- -webkit-backdrop-filter: blur(40px);
18
- justify-content: center;
19
- pointer-events: all;
20
- border-radius: 14px;
21
- align-items: center;
22
- height: 24px;
23
- `;
24
- export const HeaderUI = ({ xrDevice, inputLayer, setKeyMapOpen, fovSettingOpen, setFovSettingOpen, }) => {
25
- return (_jsx("div", { style: {
26
- display: 'flex',
27
- justifyContent: 'center',
28
- padding: '8px',
29
- }, children: _jsx(HeaderButtonsContainer, { children: _jsxs("div", { style: {
30
- display: 'flex',
31
- flexDirection: 'row',
32
- gap: '1px',
33
- }, children: [_jsx(HeaderButton, { onClick: () => {
34
- inputLayer.resetDeviceTransforms();
35
- }, children: _jsx(FAIcon, { icon: faRotateLeft }) }), _jsx(HeaderButton, { onClick: () => {
36
- inputLayer.lockPointer();
37
- setKeyMapOpen(false);
38
- setFovSettingOpen(false);
39
- }, children: _jsx(FAIcon, { icon: faCirclePlay }) }), _jsx(HeaderButton, { onClick: () => {
40
- setFovSettingOpen(!fovSettingOpen);
41
- setKeyMapOpen(false);
42
- }, children: _jsx(FAIcon, { icon: faVideo }) }), _jsx(HeaderButton, { onClick: () => {
43
- const xrSession = xrDevice.activeSession;
44
- xrSession === null || xrSession === void 0 ? void 0 : xrSession.end();
45
- }, children: _jsx(FAIcon, { icon: faRightFromBracket }) })] }) }) }));
46
- };
47
- //# sourceMappingURL=header.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"header.js","sourceRoot":"","sources":["../../../src/components/header.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EACN,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,OAAO,GACP,MAAM,mCAAmC,CAAC;AAK3C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAA;;;qBAGpB,MAAM,CAAC,eAAe;qBACtB,MAAM,CAAC,WAAW;;;;;;;;CAQtC,CAAC;AAuCF,MAAM,CAAC,MAAM,QAAQ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ates.
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 { InputLayer } from '../scene.js';
8
- import React from 'react';
9
- import { XRDevice } from 'iwer';
10
- interface HeadsetProps {
11
- xrDevice: XRDevice;
12
- inputLayer: InputLayer;
13
- pointerLocked: boolean;
14
- }
15
- export declare const HeadsetUI: React.FC<HeadsetProps>;
16
- export {};
17
- //# sourceMappingURL=headset.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"headset.d.ts","sourceRoot":"","sources":["../../../src/components/headset.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAGhC,UAAU,YAAY;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAyC5C,CAAC"}
@@ -1,29 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /**
3
- * Copyright (c) Meta Platforms, Inc. and affiliates.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
- import { ControlPanel } from './styled.js';
9
- import { IWERIcon } from './icons.js';
10
- import { version } from '../../package.json';
11
- export const HeadsetUI = ({ xrDevice, inputLayer, pointerLocked, }) => {
12
- console.log(xrDevice, inputLayer);
13
- return (_jsx(ControlPanel, { style: { left: '8px', top: '8px' }, children: !pointerLocked && (_jsx(_Fragment, { children: _jsxs("div", { style: {
14
- display: 'flex',
15
- flexDirection: 'row',
16
- justifyContent: 'space-between',
17
- alignItems: 'center',
18
- }, children: [_jsxs("div", { style: {
19
- fontSize: '13px',
20
- display: 'flex',
21
- flexDirection: 'row',
22
- alignItems: 'center',
23
- }, children: [_jsx(IWERIcon, {}), "IWER v", version] }), _jsx("div", { style: {
24
- display: 'flex',
25
- flexDirection: 'row',
26
- gap: '1px',
27
- } })] }) })) }));
28
- };
29
- //# sourceMappingURL=headset.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"headset.js","sourceRoot":"","sources":["../../../src/components/headset.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAQ7C,MAAM,CAAC,MAAM,SAAS,GAA2B,CAAC,EACjD,QAAQ,EACR,UAAU,EACV,aAAa,GACb,EAAE,EAAE;IACJ,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAClC,OAAO,CACN,KAAC,YAAY,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,YAC9C,CAAC,aAAa,IAAI,CAClB,4BACC,eACC,KAAK,EAAE;oBACN,OAAO,EAAE,MAAM;oBACf,aAAa,EAAE,KAAK;oBACpB,cAAc,EAAE,eAAe;oBAC/B,UAAU,EAAE,QAAQ;iBACpB,aAED,eACC,KAAK,EAAE;4BACN,QAAQ,EAAE,MAAM;4BAChB,OAAO,EAAE,MAAM;4BACf,aAAa,EAAE,KAAK;4BACpB,UAAU,EAAE,QAAQ;yBACpB,aAED,KAAC,QAAQ,KAAG,YACL,OAAO,IACT,EACN,cACC,KAAK,EAAE;4BACN,OAAO,EAAE,MAAM;4BACf,aAAa,EAAE,KAAK;4BACpB,GAAG,EAAE,KAAK;yBACV,GACK,IACF,GACJ,CACH,GACa,CACf,CAAC;AACH,CAAC,CAAC"}
@@ -1,37 +0,0 @@
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 React from 'react';
8
- export declare const ButtonX: React.FC;
9
- export declare const ButtonY: React.FC;
10
- export declare const ButtonA: React.FC;
11
- export declare const ButtonB: React.FC;
12
- export declare const ThumbstickL: React.FC;
13
- export declare const ThumbstickR: React.FC;
14
- export declare const ThumbstickLUp: React.FC;
15
- export declare const ThumbstickLDown: React.FC;
16
- export declare const ThumbstickLLeft: React.FC;
17
- export declare const ThumbstickLRight: React.FC;
18
- export declare const ThumbstickRUp: React.FC;
19
- export declare const ThumbstickRDown: React.FC;
20
- export declare const ThumbstickRLeft: React.FC;
21
- export declare const ThumbstickRRight: React.FC;
22
- export declare const GripL: React.FC;
23
- export declare const GripR: React.FC;
24
- export declare const TriggerL: React.FC;
25
- export declare const TriggerR: React.FC;
26
- export declare const ThumbrestL: React.FC;
27
- export declare const ThumbrestR: React.FC;
28
- interface GamepadIconProps {
29
- buttonName: string;
30
- handedness: XRHandedness;
31
- }
32
- export declare const GamepadIcon: React.FC<GamepadIconProps>;
33
- export declare const IWERIcon: React.FC;
34
- export declare const MouseLeft: React.FC;
35
- export declare const MouseRight: React.FC;
36
- export {};
37
- //# sourceMappingURL=icons.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/icons.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAoC3B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAoC3B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAoC3B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAoC3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAoC/B,CAAC;AAE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