@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.
- package/build/iwer-devui.js +16603 -405
- package/build/iwer-devui.min.js +33 -51
- package/build/iwer-devui.module.js +16603 -405
- package/build/iwer-devui.module.min.js +19 -37
- package/lib/components/header.d.ts +7 -0
- package/lib/components/header.d.ts.map +1 -1
- package/lib/components/header.js +37 -4
- package/lib/components/header.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +7 -7
- package/lib/components/fov.d.ts +0 -16
- package/lib/components/fov.d.ts.map +0 -1
- package/lib/components/fov.js +0 -30
- package/lib/components/fov.js.map +0 -1
- package/lib/package.json +0 -55
- package/lib/src/components/analog.d.ts +0 -17
- package/lib/src/components/analog.d.ts.map +0 -1
- package/lib/src/components/analog.js +0 -111
- package/lib/src/components/analog.js.map +0 -1
- package/lib/src/components/binary.d.ts +0 -17
- package/lib/src/components/binary.d.ts.map +0 -1
- package/lib/src/components/binary.js +0 -77
- package/lib/src/components/binary.js.map +0 -1
- package/lib/src/components/controls.d.ts +0 -29
- package/lib/src/components/controls.d.ts.map +0 -1
- package/lib/src/components/controls.js +0 -139
- package/lib/src/components/controls.js.map +0 -1
- package/lib/src/components/fov.d.ts +0 -16
- package/lib/src/components/fov.d.ts.map +0 -1
- package/lib/src/components/fov.js +0 -30
- package/lib/src/components/fov.js.map +0 -1
- package/lib/src/components/header.d.ts +0 -20
- package/lib/src/components/header.d.ts.map +0 -1
- package/lib/src/components/header.js +0 -47
- package/lib/src/components/header.js.map +0 -1
- package/lib/src/components/headset.d.ts +0 -17
- package/lib/src/components/headset.d.ts.map +0 -1
- package/lib/src/components/headset.js +0 -29
- package/lib/src/components/headset.js.map +0 -1
- package/lib/src/components/icons.d.ts +0 -37
- package/lib/src/components/icons.d.ts.map +0 -1
- package/lib/src/components/icons.js +0 -265
- package/lib/src/components/icons.js.map +0 -1
- package/lib/src/components/joystick.d.ts +0 -21
- package/lib/src/components/joystick.d.ts.map +0 -1
- package/lib/src/components/joystick.js +0 -245
- package/lib/src/components/joystick.js.map +0 -1
- package/lib/src/components/keys.d.ts +0 -10
- package/lib/src/components/keys.d.ts.map +0 -1
- package/lib/src/components/keys.js +0 -74
- package/lib/src/components/keys.js.map +0 -1
- package/lib/src/components/mapper.d.ts +0 -22
- package/lib/src/components/mapper.d.ts.map +0 -1
- package/lib/src/components/mapper.js +0 -108
- package/lib/src/components/mapper.js.map +0 -1
- package/lib/src/components/styled.d.ts +0 -70
- package/lib/src/components/styled.d.ts.map +0 -1
- package/lib/src/components/styled.js +0 -272
- package/lib/src/components/styled.js.map +0 -1
- package/lib/src/components/vec3.d.ts +0 -22
- package/lib/src/components/vec3.d.ts.map +0 -1
- package/lib/src/components/vec3.js +0 -123
- package/lib/src/components/vec3.js.map +0 -1
- package/lib/src/index.d.ts +0 -22
- package/lib/src/index.d.ts.map +0 -1
- package/lib/src/index.js +0 -92
- package/lib/src/index.js.map +0 -1
- package/lib/src/scene.d.ts +0 -51
- package/lib/src/scene.d.ts.map +0 -1
- package/lib/src/scene.js +0 -250
- package/lib/src/scene.js.map +0 -1
|
@@ -7,6 +7,13 @@
|
|
|
7
7
|
import { InputLayer } from '../scene.js';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { XRDevice } from 'iwer';
|
|
10
|
+
type HeaderStateStore = {
|
|
11
|
+
infoPanelOpen: boolean;
|
|
12
|
+
envDropDownOpen: boolean;
|
|
13
|
+
setInfoPanelOpen: (open: boolean) => void;
|
|
14
|
+
setEnvDropDownOpen: (open: boolean) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const useHeaderStateStore: import("zustand").UseBoundStore<import("zustand").StoreApi<HeaderStateStore>>;
|
|
10
17
|
interface HeaderUIProps {
|
|
11
18
|
xrDevice: XRDevice;
|
|
12
19
|
inputLayer: InputLayer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/components/header.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/components/header.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAyBH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AA0BhC,KAAK,gBAAgB,GAAG;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,kBAAkB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,mBAAmB,+EAK7B,CAAC;AASJ,UAAU,aAAa;IACtB,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,CAAC;CACvB;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA+Q5C,CAAC"}
|
package/lib/components/header.js
CHANGED
|
@@ -7,8 +7,9 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
7
7
|
*/
|
|
8
8
|
import { BoxIcon, IWERIcon, MeshIcon, PlaneIcon } from './icons.js';
|
|
9
9
|
import { Button, Colors, ControlButtonStyles, ControlPanel, FAIcon, HeaderButton, HeaderButtonsContainer, PanelHeaderButton, SectionBreak, } from './styled.js';
|
|
10
|
-
import { faBug, faCirclePlay, faCircleXmark, faGamepad, faHand, faRightFromBracket, faRotateLeft, } from '@fortawesome/free-solid-svg-icons';
|
|
10
|
+
import { faBug, faCirclePlay, faCircleXmark, faGamepad, faHand, faPersonShelter, faRightFromBracket, faRotateLeft, } from '@fortawesome/free-solid-svg-icons';
|
|
11
11
|
import React from 'react';
|
|
12
|
+
import { create } from 'zustand';
|
|
12
13
|
import { styled } from 'styled-components';
|
|
13
14
|
import { useInputModeStore } from './controls.js';
|
|
14
15
|
const VersionTableCol1 = styled.td `
|
|
@@ -22,13 +23,32 @@ const VersionTableCol2 = styled.td `
|
|
|
22
23
|
color: ${Colors.textGrey};
|
|
23
24
|
padding: 0;
|
|
24
25
|
`;
|
|
26
|
+
const envNames = [
|
|
27
|
+
'meeting_room',
|
|
28
|
+
'living_room',
|
|
29
|
+
'music_room',
|
|
30
|
+
'office_large',
|
|
31
|
+
'office_small',
|
|
32
|
+
];
|
|
33
|
+
export const useHeaderStateStore = create((set) => ({
|
|
34
|
+
infoPanelOpen: false,
|
|
35
|
+
envDropDownOpen: false,
|
|
36
|
+
setInfoPanelOpen: (open) => set(() => ({ infoPanelOpen: open })),
|
|
37
|
+
setEnvDropDownOpen: (open) => set(() => ({ envDropDownOpen: open })),
|
|
38
|
+
}));
|
|
39
|
+
function underscoreToTitleCase(str) {
|
|
40
|
+
return str
|
|
41
|
+
.split('_')
|
|
42
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
43
|
+
.join(' ');
|
|
44
|
+
}
|
|
25
45
|
export const HeaderUI = ({ xrDevice, inputLayer }) => {
|
|
26
46
|
var _a, _b, _c;
|
|
27
47
|
const [planesVisible, setPlanesVisible] = React.useState(Boolean((_a = xrDevice.sem) === null || _a === void 0 ? void 0 : _a.planesVisible));
|
|
28
48
|
const [boxesVisible, setBoxesVisible] = React.useState(Boolean((_b = xrDevice.sem) === null || _b === void 0 ? void 0 : _b.boundingBoxesVisible));
|
|
29
49
|
const [meshesVisible, setMeshesVisible] = React.useState(Boolean((_c = xrDevice.sem) === null || _c === void 0 ? void 0 : _c.meshesVisible));
|
|
30
|
-
const [infoPanelOpen, setInfoPanelOpen] = React.useState(false);
|
|
31
50
|
const { inputMode, setInputMode } = useInputModeStore();
|
|
51
|
+
const { infoPanelOpen, setInfoPanelOpen, envDropDownOpen, setEnvDropDownOpen, } = useHeaderStateStore();
|
|
32
52
|
return (_jsxs("div", { style: {
|
|
33
53
|
display: 'flex',
|
|
34
54
|
justifyContent: 'center',
|
|
@@ -44,6 +64,8 @@ export const HeaderUI = ({ xrDevice, inputLayer }) => {
|
|
|
44
64
|
inputLayer.resetDeviceTransforms();
|
|
45
65
|
}, children: _jsx(FAIcon, { icon: faRotateLeft, "$size": 16 }) }), _jsx(HeaderButton, { title: "Click to activate play mode", onClick: () => {
|
|
46
66
|
inputLayer.lockPointer();
|
|
67
|
+
setEnvDropDownOpen(false);
|
|
68
|
+
setInfoPanelOpen(false);
|
|
47
69
|
}, children: _jsx(FAIcon, { icon: faCirclePlay, "$size": 16 }) }), _jsx(HeaderButton, { title: "Click to toggle input mode", onClick: () => {
|
|
48
70
|
if (inputMode === 'controller') {
|
|
49
71
|
setInputMode('hand');
|
|
@@ -53,7 +75,7 @@ export const HeaderUI = ({ xrDevice, inputLayer }) => {
|
|
|
53
75
|
setInputMode('controller');
|
|
54
76
|
xrDevice.primaryInputMode = 'controller';
|
|
55
77
|
}
|
|
56
|
-
}, children: _jsx(FAIcon, { icon: inputMode === 'controller' ? faGamepad : faHand, "$size": 16 }) }), xrDevice.sem && (_jsxs(_Fragment, { children: [_jsx(SectionBreak, { "$horizontal": false }), _jsx(HeaderButton, { title: "Click to toggle visibility of planes", onClick: () => {
|
|
78
|
+
}, children: _jsx(FAIcon, { icon: inputMode === 'controller' ? faGamepad : faHand, "$size": 16 }) }), xrDevice.sem && (_jsxs(_Fragment, { children: [_jsx(SectionBreak, { "$horizontal": false }), _jsx(HeaderButton, { title: "Click to select/change emulated environment", onClick: () => setEnvDropDownOpen(!envDropDownOpen), children: _jsx(FAIcon, { icon: faPersonShelter, "$size": 16 }) }), _jsx(HeaderButton, { title: "Click to toggle visibility of planes", onClick: () => {
|
|
57
79
|
xrDevice.sem.planesVisible = !planesVisible;
|
|
58
80
|
setPlanesVisible(!planesVisible);
|
|
59
81
|
}, children: _jsx(PlaneIcon, { size: 16, color: planesVisible ? Colors.textWhite : Colors.textGrey }) }), _jsx(HeaderButton, { title: "Click to toggle visibility of bounding boxes", onClick: () => {
|
|
@@ -96,6 +118,17 @@ export const HeaderUI = ({ xrDevice, inputLayer }) => {
|
|
|
96
118
|
borderRadius: ControlButtonStyles.radiusSolo,
|
|
97
119
|
}, onClick: () => {
|
|
98
120
|
window.open('https://github.com/meta-quest/immersive-web-emulation-runtime', '_blank');
|
|
99
|
-
}, children: "View Source on GitHub" })] }))
|
|
121
|
+
}, children: "View Source on GitHub" })] })), envDropDownOpen && (_jsx(ControlPanel, { style: {
|
|
122
|
+
position: 'absolute',
|
|
123
|
+
top: '40px',
|
|
124
|
+
}, children: envNames.map((name) => (_jsx("div", { children: _jsx(HeaderButton, { style: {
|
|
125
|
+
fontSize: '12px',
|
|
126
|
+
width: '100%',
|
|
127
|
+
justifyContent: 'start',
|
|
128
|
+
borderRadius: '8px',
|
|
129
|
+
}, onClick: () => {
|
|
130
|
+
// @ts-ignore
|
|
131
|
+
xrDevice.sem.loadDefaultEnvironment(name);
|
|
132
|
+
}, children: underscoreToTitleCase(name) }) }, name))) }))] }));
|
|
100
133
|
};
|
|
101
134
|
//# sourceMappingURL=header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.js","sourceRoot":"","sources":["../../src/components/header.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EACN,MAAM,EACN,MAAM,EACN,mBAAmB,EACnB,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,EACL,YAAY,EACZ,aAAa,EACb,SAAS,EACT,MAAM,EACN,kBAAkB,EAClB,YAAY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,QAAQ,CACR,CAAC;wBACH,CAAC,4BAGO,EACT,KAAC,MAAM,IACN,KAAK,EAAE;4BACN,YAAY,EAAE,mBAAmB,CAAC,UAAU;yBAC5C,EACD,OAAO,EAAE,GAAG,EAAE;4BACb,MAAM,CAAC,IAAI,CACV,+DAA+D,EAC/D,QAAQ,CACR,CAAC;wBACH,CAAC,sCAGO,IACK,CACf,EACA,eAAe,IAAI,CACnB,KAAC,YAAY,IACZ,KAAK,EAAE;oBACN,QAAQ,EAAE,UAAU;oBACpB,GAAG,EAAE,MAAM;iBACX,YAEA,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACvB,wBACC,KAAC,YAAY,IACZ,KAAK,EAAE;4BACN,QAAQ,EAAE,MAAM;4BAChB,KAAK,EAAE,MAAM;4BACb,cAAc,EAAE,OAAO;4BACvB,YAAY,EAAE,KAAK;yBACnB,EACD,OAAO,EAAE,GAAG,EAAE;4BACb,aAAa;4BACb,QAAQ,CAAC,GAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;wBAC5C,CAAC,YAEA,qBAAqB,CAAC,IAAI,CAAC,GACd,IAdN,IAAI,CAeR,CACN,CAAC,GACY,CACf,IACI,CACN,CAAC;AACH,CAAC,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { XRDevice } from 'iwer';
|
|
|
9
9
|
export declare class DevUI {
|
|
10
10
|
private inputLayer;
|
|
11
11
|
devUIContainer: HTMLDivElement;
|
|
12
|
-
readonly version = "1.1.
|
|
12
|
+
readonly version = "1.1.1";
|
|
13
13
|
constructor(xrDevice: XRDevice);
|
|
14
14
|
render(time: number): void;
|
|
15
15
|
get devUICanvas(): HTMLCanvasElement;
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.1.
|
|
1
|
+
export declare const VERSION = "1.1.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/lib/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = "1.1.
|
|
1
|
+
export const VERSION = "1.1.1";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iwer/devui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Dev UI for IWER",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"@fortawesome/fontawesome-svg-core": "6.6.0",
|
|
29
29
|
"@fortawesome/free-solid-svg-icons": "6.6.0",
|
|
30
30
|
"@fortawesome/react-fontawesome": "0.2.2",
|
|
31
|
-
"@pmndrs/handle": "^6.
|
|
32
|
-
"@pmndrs/pointer-events": "^6.
|
|
33
|
-
"react": "18.3.1",
|
|
34
|
-
"react-dom": "18.3.1",
|
|
35
|
-
"styled-components": "6.1.13",
|
|
31
|
+
"@pmndrs/handle": "^6.6.17",
|
|
32
|
+
"@pmndrs/pointer-events": "^6.6.17",
|
|
33
|
+
"react": ">=18.3.1",
|
|
34
|
+
"react-dom": ">=18.3.1",
|
|
35
|
+
"styled-components": "^6.1.13",
|
|
36
36
|
"three": "^0.165.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"iwer": "^2.0.
|
|
39
|
+
"iwer": "^2.0.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@rollup/plugin-babel": "^6.0.4",
|
package/lib/components/fov.d.ts
DELETED
|
@@ -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"}
|
package/lib/components/fov.js
DELETED
|
@@ -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"}
|
package/lib/package.json
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@iwer/devui",
|
|
3
|
-
"version": "0.2.1",
|
|
4
|
-
"description": "Dev UI for IWER",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "lib/index.js",
|
|
7
|
-
"types": "lib/index.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"build",
|
|
10
|
-
"lib"
|
|
11
|
-
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"build": "tsc && rollup -c"
|
|
14
|
-
},
|
|
15
|
-
"repository": {
|
|
16
|
-
"type": "git",
|
|
17
|
-
"url": "git+https://github.com/meta-quest/immersive-web-emulation-runtime.git"
|
|
18
|
-
},
|
|
19
|
-
"keywords": [],
|
|
20
|
-
"author": "Felix Zhang <fe1ix@meta.com>",
|
|
21
|
-
"license": "MIT",
|
|
22
|
-
"bugs": {
|
|
23
|
-
"url": "https://github.com/meta-quest/immersive-web-emulation-runtime/issues"
|
|
24
|
-
},
|
|
25
|
-
"homepage": "https://github.com/meta-quest/immersive-web-emulation-runtime#readme",
|
|
26
|
-
"dependencies": {
|
|
27
|
-
"@fortawesome/fontawesome-svg-core": "6.6.0",
|
|
28
|
-
"@fortawesome/free-solid-svg-icons": "6.6.0",
|
|
29
|
-
"@fortawesome/react-fontawesome": "0.2.2",
|
|
30
|
-
"@pmndrs/handle": "^6.5.2",
|
|
31
|
-
"@pmndrs/pointer-events": "^6.5.2",
|
|
32
|
-
"react": "18.3.1",
|
|
33
|
-
"react-dom": "18.3.1",
|
|
34
|
-
"styled-components": "6.1.13",
|
|
35
|
-
"three": "0.172.0",
|
|
36
|
-
"zustand": "^5.0.3"
|
|
37
|
-
},
|
|
38
|
-
"peerDependencies": {
|
|
39
|
-
"iwer": "^1.0.3"
|
|
40
|
-
},
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"@rollup/plugin-babel": "^6.0.4",
|
|
43
|
-
"@rollup/plugin-commonjs": "^28.0.1",
|
|
44
|
-
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
45
|
-
"@rollup/plugin-replace": "^6.0.1",
|
|
46
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
47
|
-
"@types/react": "^18.3.12",
|
|
48
|
-
"@types/react-dom": "^18.3.1",
|
|
49
|
-
"@types/styled-components": "^5.1.34",
|
|
50
|
-
"@types/three": "^0.172.0",
|
|
51
|
-
"rollup": "^4.24.3",
|
|
52
|
-
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
53
|
-
"typescript": "^5.6.3"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,17 +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 { XRController } from 'iwer/lib/device/XRController';
|
|
9
|
-
interface AnalogButtonProps {
|
|
10
|
-
xrController: XRController;
|
|
11
|
-
buttonId: string;
|
|
12
|
-
pointerLocked: boolean;
|
|
13
|
-
mappedKey: string;
|
|
14
|
-
}
|
|
15
|
-
export declare const AnalogButton: React.FC<AnalogButtonProps>;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=analog.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analog.d.ts","sourceRoot":"","sources":["../../../src/components/analog.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAI5D,UAAU,iBAAiB;IAC1B,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA0IpD,CAAC"}
|
|
@@ -1,111 +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 { Button, ButtonContainer, ButtonGroup, Colors, ControlButtonStyles, FAIcon, MappedKeyBlock, RangeSelector, } from './styled.js';
|
|
9
|
-
import { useEffect, useState } from 'react';
|
|
10
|
-
import { GamepadIcon } from './icons.js';
|
|
11
|
-
import { MappedKeyDisplay } from './keys.js';
|
|
12
|
-
import { faFingerprint } from '@fortawesome/free-solid-svg-icons';
|
|
13
|
-
import { useDevUIConfig } from '../index.js';
|
|
14
|
-
export const AnalogButton = ({ xrController, buttonId, pointerLocked, mappedKey, }) => {
|
|
15
|
-
const devuiConfig = useDevUIConfig();
|
|
16
|
-
const [isTouched, setIsTouched] = useState(false);
|
|
17
|
-
const [isPressed, setIsPressed] = useState(false);
|
|
18
|
-
const [isKeyPressed, setIsKeyPressed] = useState(false);
|
|
19
|
-
const [analogValue, setAnalogValue] = useState(0);
|
|
20
|
-
const handedness = xrController.inputSource.handedness;
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
const handleKeyDown = (event) => {
|
|
23
|
-
if (event.code === mappedKey) {
|
|
24
|
-
xrController.updateButtonValue(buttonId, 1);
|
|
25
|
-
setIsKeyPressed(true);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const handleKeyUp = (event) => {
|
|
29
|
-
if (event.code === mappedKey) {
|
|
30
|
-
xrController.updateButtonValue(buttonId, 0);
|
|
31
|
-
setIsKeyPressed(false);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
const handleMouseDown = (event) => {
|
|
35
|
-
if (mappedKey === 'MouseLeft' && event.button === 0) {
|
|
36
|
-
xrController.updateButtonValue(buttonId, 1);
|
|
37
|
-
setIsKeyPressed(true);
|
|
38
|
-
}
|
|
39
|
-
else if (mappedKey === 'MouseRight' && event.button === 2) {
|
|
40
|
-
xrController.updateButtonValue(buttonId, 1);
|
|
41
|
-
setIsKeyPressed(true);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
const handleMouseUp = (event) => {
|
|
45
|
-
if (mappedKey === 'MouseLeft' && event.button === 0) {
|
|
46
|
-
xrController.updateButtonValue(buttonId, 0);
|
|
47
|
-
setIsKeyPressed(false);
|
|
48
|
-
}
|
|
49
|
-
else if (mappedKey === 'MouseRight' && event.button === 2) {
|
|
50
|
-
xrController.updateButtonValue(buttonId, 0);
|
|
51
|
-
setIsKeyPressed(false);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
if (pointerLocked) {
|
|
55
|
-
if (mappedKey === 'MouseLeft' || mappedKey === 'MouseRight') {
|
|
56
|
-
window.addEventListener('mousedown', handleMouseDown);
|
|
57
|
-
window.addEventListener('mouseup', handleMouseUp);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
window.addEventListener('keydown', handleKeyDown);
|
|
61
|
-
window.addEventListener('keyup', handleKeyUp);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
if (mappedKey === 'MouseLeft' || mappedKey === 'MouseRight') {
|
|
66
|
-
window.removeEventListener('mousedown', handleMouseDown);
|
|
67
|
-
window.removeEventListener('mouseup', handleMouseUp);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
window.removeEventListener('keydown', handleKeyDown);
|
|
71
|
-
window.removeEventListener('keyup', handleKeyUp);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return () => {
|
|
75
|
-
if (mappedKey === 'MouseLeft' || mappedKey === 'MouseRight') {
|
|
76
|
-
window.removeEventListener('mousedown', handleMouseDown);
|
|
77
|
-
window.removeEventListener('mouseup', handleMouseUp);
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
window.removeEventListener('keydown', handleKeyDown);
|
|
81
|
-
window.removeEventListener('keyup', handleKeyUp);
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
}, [mappedKey, pointerLocked, buttonId, xrController]);
|
|
85
|
-
return (_jsxs(ButtonContainer, { "$reverse": handedness === 'right', children: [_jsx(GamepadIcon, { buttonName: buttonId, handedness: handedness }), _jsx(ButtonGroup, { "$reverse": handedness === 'right', children: pointerLocked ? (_jsx(MappedKeyBlock, { "$pressed": isKeyPressed, children: MappedKeyDisplay[mappedKey] })) : (_jsxs(_Fragment, { children: [_jsx(Button, { "$reverse": handedness === 'right', style: {
|
|
86
|
-
background: isPressed
|
|
87
|
-
? Colors.gradientLightGreyTranslucent
|
|
88
|
-
: Colors.gradientGreyTranslucent,
|
|
89
|
-
width: ControlButtonStyles.widthLong,
|
|
90
|
-
}, onClick: () => {
|
|
91
|
-
setIsPressed(true);
|
|
92
|
-
xrController.updateButtonValue(buttonId, 1);
|
|
93
|
-
setTimeout(() => {
|
|
94
|
-
setIsPressed(false);
|
|
95
|
-
xrController.updateButtonValue(buttonId, 0);
|
|
96
|
-
}, devuiConfig.buttonPressDuration);
|
|
97
|
-
}, children: "Press" }), _jsx(Button, { "$reverse": handedness === 'right', style: {
|
|
98
|
-
background: isTouched
|
|
99
|
-
? Colors.gradientLightGreyTranslucent
|
|
100
|
-
: Colors.gradientGreyTranslucent,
|
|
101
|
-
width: ControlButtonStyles.widthShort,
|
|
102
|
-
}, onClick: () => {
|
|
103
|
-
setIsTouched(!isTouched);
|
|
104
|
-
xrController.updateButtonTouch(buttonId, !isTouched);
|
|
105
|
-
}, children: _jsx(FAIcon, { icon: faFingerprint }) }), _jsx(RangeSelector, { "$reverse": handedness === 'right', value: analogValue, onChange: (e) => {
|
|
106
|
-
const value = Number(e.target.value);
|
|
107
|
-
setAnalogValue(value);
|
|
108
|
-
xrController.updateButtonValue(buttonId, value / 100);
|
|
109
|
-
}, min: "0", max: "100" })] })) })] }));
|
|
110
|
-
};
|
|
111
|
-
//# sourceMappingURL=analog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analog.js","sourceRoot":"","sources":["../../../src/components/analog.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,EACN,MAAM,EACN,eAAe,EACf,WAAW,EACX,MAAM,EACN,mBAAmB,EACnB,MAAM,EACN,cAAc,EACd,aAAa,GACb,MAAM,aAAa,CAAC;AACrB,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,WAAW,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K,GAAG,GAAG,CAAC,CAAC;4BACvD,CAAC,EACD,GAAG,EAAC,GAAG,EACP,GAAG,EAAC,KAAK,GACR,IACA,CACH,GACY,IACG,CAClB,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,17 +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 { XRController } from 'iwer/lib/device/XRController';
|
|
9
|
-
interface BinaryButtonProps {
|
|
10
|
-
xrController: XRController;
|
|
11
|
-
buttonId: string;
|
|
12
|
-
pointerLocked: boolean;
|
|
13
|
-
mappedKey: string;
|
|
14
|
-
}
|
|
15
|
-
export declare const BinaryButton: React.FC<BinaryButtonProps>;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=binary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"binary.d.ts","sourceRoot":"","sources":["../../../src/components/binary.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAI5D,UAAU,iBAAiB;IAC1B,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA4GpD,CAAC"}
|
|
@@ -1,77 +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 { Button, ButtonContainer, ButtonGroup, Colors, ControlButtonStyles, FAIcon, MappedKeyBlock, } from './styled.js';
|
|
9
|
-
import { useEffect, useState } from 'react';
|
|
10
|
-
import { GamepadIcon } from './icons.js';
|
|
11
|
-
import { MappedKeyDisplay } from './keys.js';
|
|
12
|
-
import { faFingerprint } from '@fortawesome/free-solid-svg-icons';
|
|
13
|
-
import { useDevUIConfig } from '../index.js';
|
|
14
|
-
export const BinaryButton = ({ xrController, buttonId, pointerLocked, mappedKey, }) => {
|
|
15
|
-
const devuiConfig = useDevUIConfig();
|
|
16
|
-
const [isTouched, setIsTouched] = useState(false);
|
|
17
|
-
const [isOnHold, setIsOnHold] = useState(false);
|
|
18
|
-
const [isPressed, setIsPressed] = useState(false);
|
|
19
|
-
const [isKeyPressed, setIsKeyPressed] = useState(false);
|
|
20
|
-
const handedness = xrController.inputSource.handedness;
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
const handleKeyDown = (event) => {
|
|
23
|
-
if (event.code === mappedKey) {
|
|
24
|
-
xrController.updateButtonValue(buttonId, 1);
|
|
25
|
-
setIsKeyPressed(true);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const handleKeyUp = (event) => {
|
|
29
|
-
if (event.code === mappedKey) {
|
|
30
|
-
xrController.updateButtonValue(buttonId, 0);
|
|
31
|
-
setIsKeyPressed(false);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
if (pointerLocked) {
|
|
35
|
-
window.addEventListener('keydown', handleKeyDown);
|
|
36
|
-
window.addEventListener('keyup', handleKeyUp);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
window.removeEventListener('keydown', handleKeyDown);
|
|
40
|
-
window.removeEventListener('keyup', handleKeyUp);
|
|
41
|
-
}
|
|
42
|
-
return () => {
|
|
43
|
-
window.removeEventListener('keydown', handleKeyDown);
|
|
44
|
-
window.removeEventListener('keyup', handleKeyUp);
|
|
45
|
-
};
|
|
46
|
-
}, [mappedKey, pointerLocked, buttonId, xrController]);
|
|
47
|
-
return (_jsxs(ButtonContainer, { "$reverse": handedness === 'right', children: [_jsx(GamepadIcon, { buttonName: buttonId, handedness: handedness }), _jsx(ButtonGroup, { "$reverse": handedness === 'right', children: pointerLocked ? (_jsx(MappedKeyBlock, { "$pressed": isKeyPressed, children: MappedKeyDisplay[mappedKey] })) : (_jsxs(_Fragment, { children: [_jsx(Button, { "$reverse": handedness === 'right', style: {
|
|
48
|
-
background: isPressed
|
|
49
|
-
? Colors.gradientLightGreyTranslucent
|
|
50
|
-
: Colors.gradientGreyTranslucent,
|
|
51
|
-
width: ControlButtonStyles.widthLong,
|
|
52
|
-
}, onClick: () => {
|
|
53
|
-
setIsPressed(true);
|
|
54
|
-
xrController.updateButtonValue(buttonId, 1);
|
|
55
|
-
setTimeout(() => {
|
|
56
|
-
setIsPressed(false);
|
|
57
|
-
xrController.updateButtonValue(buttonId, 0);
|
|
58
|
-
}, devuiConfig.buttonPressDuration);
|
|
59
|
-
}, children: "Press" }), _jsx(Button, { "$reverse": handedness === 'right', style: {
|
|
60
|
-
background: isTouched
|
|
61
|
-
? Colors.gradientLightGreyTranslucent
|
|
62
|
-
: Colors.gradientGreyTranslucent,
|
|
63
|
-
width: ControlButtonStyles.widthShort,
|
|
64
|
-
}, onClick: () => {
|
|
65
|
-
setIsTouched(!isTouched);
|
|
66
|
-
xrController.updateButtonTouch(buttonId, !isTouched);
|
|
67
|
-
}, children: _jsx(FAIcon, { icon: faFingerprint }) }), _jsx(Button, { "$reverse": handedness === 'right', style: {
|
|
68
|
-
background: isOnHold
|
|
69
|
-
? Colors.gradientLightGreyTranslucent
|
|
70
|
-
: Colors.gradientGreyTranslucent,
|
|
71
|
-
width: ControlButtonStyles.widthLong,
|
|
72
|
-
}, onClick: () => {
|
|
73
|
-
setIsOnHold(!isOnHold);
|
|
74
|
-
xrController.updateButtonValue(buttonId, isOnHold ? 0 : 1);
|
|
75
|
-
}, children: "Hold" })] })) })] }));
|
|
76
|
-
};
|
|
77
|
-
//# sourceMappingURL=binary.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"binary.js","sourceRoot":"","sources":["../../../src/components/binary.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,EACN,MAAM,EACN,eAAe,EACf,WAAW,EACX,MAAM,EACN,mBAAmB,EACnB,MAAM,EACN,cAAc,GACd,MAAM,aAAa,CAAC;AACrB,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAS7C,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,EACzD,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,SAAS,GACT,EAAE,EAAE;IACJ,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAExD,MAAM,UAAU,GAAG,YAAY,CAAC,WAAW,CAAC,UAAU,CAAC;IAEvD,SAAS,CAAC,GAAG,EAAE;QACd,MAAM,aAAa,GAAG,CAAC,KAAoB,EAAE,EAAE;YA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BACpC,EACD,OAAO,EAAE,GAAG,EAAE;gCACb,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC;gCACvB,YAAY,CAAC,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;4BAC5D,CAAC,qBAGO,IACP,CACH,GACY,IACG,CAClB,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,29 +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 { TransformHandles } from '@pmndrs/handle';
|
|
10
|
-
import type { XRController } from 'iwer/lib/device/XRController.js';
|
|
11
|
-
import { XRDevice } from 'iwer';
|
|
12
|
-
export declare const HeaderButton: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components/dist/types.js").Substitute<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
13
|
-
$isRed: boolean;
|
|
14
|
-
}>> & string;
|
|
15
|
-
interface ControlsProps {
|
|
16
|
-
xrDevice: XRDevice;
|
|
17
|
-
inputLayer: InputLayer;
|
|
18
|
-
pointerLocked: boolean;
|
|
19
|
-
}
|
|
20
|
-
export declare const ControlsUI: React.FC<ControlsProps>;
|
|
21
|
-
interface ControllerProps {
|
|
22
|
-
controller: XRController;
|
|
23
|
-
handle: TransformHandles;
|
|
24
|
-
handedness: string;
|
|
25
|
-
pointerLocked: boolean;
|
|
26
|
-
}
|
|
27
|
-
export declare const ControllerUI: React.FC<ControllerProps>;
|
|
28
|
-
export {};
|
|
29
|
-
//# sourceMappingURL=controls.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../../src/components/controls.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,EAAE,UAAU,EAAW,MAAM,aAAa,CAAC;AAYlD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AA0BhC,eAAO,MAAM,YAAY;YAA2B,OAAO;YAwB1D,CAAC;AAEF,UAAU,aAAa;IACtB,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;CACvB;AAuCD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAsB9C,CAAC;AAEF,UAAU,eAAe;IACxB,UAAU,EAAE,YAAY,CAAC;IACzB,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAwJlD,CAAC"}
|