@iwer/devui 0.2.1 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/iwer-devui.js +5198 -2628
- package/build/iwer-devui.min.js +266 -130
- package/build/iwer-devui.module.js +5198 -2628
- package/build/iwer-devui.module.min.js +266 -130
- package/lib/components/analog.d.ts.map +1 -1
- package/lib/components/analog.js +11 -13
- package/lib/components/analog.js.map +1 -1
- package/lib/components/binary.d.ts.map +1 -1
- package/lib/components/binary.js +15 -17
- package/lib/components/binary.js.map +1 -1
- package/lib/components/controls.d.ts +11 -2
- package/lib/components/controls.d.ts.map +1 -1
- package/lib/components/controls.js +61 -27
- package/lib/components/controls.js.map +1 -1
- package/lib/components/fov.d.ts.map +1 -1
- package/lib/components/fov.js +0 -1
- package/lib/components/fov.js.map +1 -1
- package/lib/components/header.d.ts +0 -4
- package/lib/components/header.d.ts.map +1 -1
- package/lib/components/header.js +75 -61
- package/lib/components/header.js.map +1 -1
- package/lib/components/headset.d.ts +17 -0
- package/lib/components/headset.d.ts.map +1 -0
- package/lib/components/headset.js +91 -0
- package/lib/components/headset.js.map +1 -0
- package/lib/components/icons.d.ts +8 -1
- package/lib/components/icons.d.ts.map +1 -1
- package/lib/components/icons.js +53 -27
- package/lib/components/icons.js.map +1 -1
- package/lib/components/joystick.d.ts.map +1 -1
- package/lib/components/joystick.js +56 -60
- package/lib/components/joystick.js.map +1 -1
- package/lib/components/mapper.d.ts +7 -3
- package/lib/components/mapper.d.ts.map +1 -1
- package/lib/components/mapper.js +34 -60
- package/lib/components/mapper.js.map +1 -1
- package/lib/components/styled.d.ts +48 -7
- package/lib/components/styled.d.ts.map +1 -1
- package/lib/components/styled.js +213 -40
- package/lib/components/styled.js.map +1 -1
- package/lib/components/vec3.d.ts +25 -0
- package/lib/components/vec3.d.ts.map +1 -0
- package/lib/components/vec3.js +90 -0
- package/lib/components/vec3.js.map +1 -0
- package/lib/index.d.ts +8 -12
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +73 -51
- package/lib/index.js.map +1 -1
- package/lib/package.json +55 -0
- package/lib/scene.d.ts +23 -40
- package/lib/scene.d.ts.map +1 -1
- package/lib/scene.js +160 -192
- package/lib/scene.js.map +1 -1
- package/lib/src/components/analog.d.ts +17 -0
- package/lib/src/components/analog.d.ts.map +1 -0
- package/lib/src/components/analog.js +111 -0
- package/lib/src/components/analog.js.map +1 -0
- package/lib/src/components/binary.d.ts +17 -0
- package/lib/src/components/binary.d.ts.map +1 -0
- package/lib/src/components/binary.js +77 -0
- package/lib/src/components/binary.js.map +1 -0
- package/lib/src/components/controls.d.ts +29 -0
- package/lib/src/components/controls.d.ts.map +1 -0
- package/lib/src/components/controls.js +139 -0
- package/lib/src/components/controls.js.map +1 -0
- package/lib/src/components/fov.d.ts +16 -0
- package/lib/src/components/fov.d.ts.map +1 -0
- package/lib/src/components/fov.js +30 -0
- package/lib/src/components/fov.js.map +1 -0
- package/lib/src/components/header.d.ts +20 -0
- package/lib/src/components/header.d.ts.map +1 -0
- package/lib/src/components/header.js +47 -0
- package/lib/src/components/header.js.map +1 -0
- package/lib/src/components/headset.d.ts +17 -0
- package/lib/src/components/headset.d.ts.map +1 -0
- package/lib/src/components/headset.js +29 -0
- package/lib/src/components/headset.js.map +1 -0
- package/lib/src/components/icons.d.ts +37 -0
- package/lib/src/components/icons.d.ts.map +1 -0
- package/lib/src/components/icons.js +265 -0
- package/lib/src/components/icons.js.map +1 -0
- package/lib/src/components/joystick.d.ts +21 -0
- package/lib/src/components/joystick.d.ts.map +1 -0
- package/lib/src/components/joystick.js +245 -0
- package/lib/src/components/joystick.js.map +1 -0
- package/lib/src/components/keys.d.ts +10 -0
- package/lib/src/components/keys.d.ts.map +1 -0
- package/lib/src/components/keys.js +74 -0
- package/lib/src/components/keys.js.map +1 -0
- package/lib/src/components/mapper.d.ts +22 -0
- package/lib/src/components/mapper.d.ts.map +1 -0
- package/lib/src/components/mapper.js +108 -0
- package/lib/src/components/mapper.js.map +1 -0
- package/lib/src/components/styled.d.ts +70 -0
- package/lib/src/components/styled.d.ts.map +1 -0
- package/lib/src/components/styled.js +272 -0
- package/lib/src/components/styled.js.map +1 -0
- package/lib/src/components/vec3.d.ts +22 -0
- package/lib/src/components/vec3.d.ts.map +1 -0
- package/lib/src/components/vec3.js +123 -0
- package/lib/src/components/vec3.js.map +1 -0
- package/lib/src/index.d.ts +22 -0
- package/lib/src/index.d.ts.map +1 -0
- package/lib/src/index.js +92 -0
- package/lib/src/index.js.map +1 -0
- package/lib/src/scene.d.ts +51 -0
- package/lib/src/scene.d.ts.map +1 -0
- package/lib/src/scene.js +250 -0
- package/lib/src/scene.js.map +1 -0
- package/lib/version.d.ts +2 -0
- package/lib/version.d.ts.map +1 -0
- package/lib/version.js +2 -0
- package/lib/version.js.map +1 -0
- package/package.json +6 -3
- package/build/iwe.min.js +0 -180
- package/lib/components/settings.d.ts +0 -50
- package/lib/components/settings.d.ts.map +0 -1
- package/lib/components/settings.js +0 -103
- package/lib/components/settings.js.map +0 -1
|
@@ -5,73 +5,67 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
import { Button, ButtonGroup,
|
|
8
|
+
import { Button, ButtonContainer, ButtonGroup, Colors, ControlButtonStyles, FAIcon, MappedKeyBlock, } from './styled.js';
|
|
9
9
|
import { useEffect, useRef, useState } from 'react';
|
|
10
|
+
import { faCircleXmark, faFingerprint, } from '@fortawesome/free-solid-svg-icons';
|
|
10
11
|
import { GamepadIcon } from './icons.js';
|
|
11
12
|
import { MappedKeyDisplay } from './keys.js';
|
|
12
|
-
import { faFingerprint } from '@fortawesome/free-solid-svg-icons';
|
|
13
13
|
import { styled } from 'styled-components';
|
|
14
|
-
import { useDevUIConfig } from '../index.js';
|
|
15
14
|
const JoystickContainer = styled.div `
|
|
16
15
|
display: flex;
|
|
17
16
|
align-items: center;
|
|
18
|
-
margin-bottom:
|
|
17
|
+
margin-bottom: ${ControlButtonStyles.gap};
|
|
19
18
|
`;
|
|
19
|
+
const joystickSize = `calc(2 * ${ControlButtonStyles.height} + ${ControlButtonStyles.gap})`;
|
|
20
20
|
const JoystickButton = styled.button `
|
|
21
|
-
background
|
|
21
|
+
background: ${Colors.gradientGreyTranslucent};
|
|
22
22
|
border: none;
|
|
23
23
|
display: flex;
|
|
24
24
|
justify-content: center;
|
|
25
25
|
align-items: center;
|
|
26
26
|
padding: 0;
|
|
27
27
|
pointer-events: none;
|
|
28
|
-
width:
|
|
29
|
-
height:
|
|
28
|
+
width: ${joystickSize};
|
|
29
|
+
height: ${joystickSize};
|
|
30
30
|
border-radius: 50%;
|
|
31
31
|
position: relative;
|
|
32
32
|
margin: 0 5px;
|
|
33
|
-
backdrop-filter: blur(10px);
|
|
34
|
-
-webkit-backdrop-filter: blur(10px);
|
|
35
33
|
`;
|
|
36
34
|
const JoystickInner = styled.div `
|
|
37
35
|
position: absolute;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
font-size: 50px;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
color: ${Colors.textWhite};
|
|
42
41
|
cursor: pointer;
|
|
43
42
|
pointer-events: auto;
|
|
44
43
|
`;
|
|
45
44
|
const SmallButton = styled(Button) `
|
|
46
|
-
width:
|
|
47
|
-
font-size:
|
|
45
|
+
width: ${ControlButtonStyles.widthLong};
|
|
46
|
+
font-size: ${ControlButtonStyles.fontSize};
|
|
48
47
|
|
|
49
48
|
${({ $reverse }) => $reverse
|
|
50
49
|
? `
|
|
51
50
|
&:first-child {
|
|
52
|
-
|
|
53
|
-
border-radius: 2px 8px 8px 2px;
|
|
51
|
+
border-radius: ${ControlButtonStyles.radiusLast};
|
|
54
52
|
}
|
|
55
53
|
|
|
56
54
|
&:last-child {
|
|
57
|
-
|
|
58
|
-
border-radius: 8px 2px 2px 8px;
|
|
55
|
+
border-radius: ${ControlButtonStyles.radiusFirst};
|
|
59
56
|
}
|
|
60
57
|
`
|
|
61
58
|
: `
|
|
62
59
|
&:first-child {
|
|
63
|
-
|
|
64
|
-
border-radius: 8px 2px 2px 8px;
|
|
60
|
+
border-radius: ${ControlButtonStyles.radiusFirst};
|
|
65
61
|
}
|
|
66
62
|
|
|
67
63
|
&:last-child {
|
|
68
|
-
|
|
69
|
-
border-radius: 2px 8px 8px 2px;
|
|
64
|
+
border-radius: ${ControlButtonStyles.radiusLast};
|
|
70
65
|
}
|
|
71
66
|
`}
|
|
72
67
|
`;
|
|
73
68
|
export const Joystick = ({ xrController, pointerLocked, buttonId, mappedKeyUp, mappedKeyDown, mappedKeyLeft, mappedKeyRight, mappedKeyPressed, }) => {
|
|
74
|
-
const devuiConfig = useDevUIConfig();
|
|
75
69
|
const joystickRef = useRef(null);
|
|
76
70
|
const [isDragging, setIsDragging] = useState(false);
|
|
77
71
|
const [isTouched, setIsTouched] = useState(false);
|
|
@@ -202,45 +196,47 @@ export const Joystick = ({ xrController, pointerLocked, buttonId, mappedKeyUp, m
|
|
|
202
196
|
document.removeEventListener('mouseup', handleMouseUp);
|
|
203
197
|
};
|
|
204
198
|
}, [isDragging, initialPosition]);
|
|
205
|
-
return (_jsxs(
|
|
199
|
+
return pointerLocked ? (_jsxs(_Fragment, { children: [_jsxs(ButtonContainer, { "$reverse": handedness === 'right', children: [_jsx(GamepadIcon, { buttonName: "thumbstick", handedness: xrController.inputSource.handedness }), _jsxs(ButtonGroup, { "$reverse": handedness === 'right', children: [_jsx(MappedKeyBlock, { "$pressed": keyStates.up, children: MappedKeyDisplay[mappedKeyUp] }), _jsx(MappedKeyBlock, { "$pressed": keyStates.pressed, children: MappedKeyDisplay[mappedKeyPressed] })] })] }), _jsx(ButtonContainer, { "$reverse": handedness === 'right', style: handedness === 'right'
|
|
200
|
+
? { marginRight: '2px' }
|
|
201
|
+
: { marginLeft: '2px' }, children: _jsxs(ButtonGroup, { "$reverse": false, style: { margin: 0 }, children: [_jsx(MappedKeyBlock, { "$pressed": keyStates.left, children: MappedKeyDisplay[mappedKeyLeft] }), _jsx(MappedKeyBlock, { "$pressed": keyStates.down, children: MappedKeyDisplay[mappedKeyDown] }), _jsx(MappedKeyBlock, { "$pressed": keyStates.right, children: MappedKeyDisplay[mappedKeyRight] })] }) })] })) : (_jsx(JoystickContainer, { style: {
|
|
206
202
|
flexDirection: xrController.inputSource.handedness === 'left'
|
|
207
203
|
? 'row'
|
|
208
204
|
: 'row-reverse',
|
|
209
205
|
alignItems: 'flex-start',
|
|
210
|
-
}, children: [_jsx(GamepadIcon, { buttonName: "thumbstick", handedness: xrController.inputSource.handedness }),
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
206
|
+
}, children: _jsxs(_Fragment, { children: [_jsx(GamepadIcon, { buttonName: "thumbstick", handedness: xrController.inputSource.handedness }), _jsx(JoystickButton, { style: { margin: '0 5px' }, children: _jsx(JoystickInner, { ref: joystickRef, onMouseDown: handleMouseDown, children: _jsx(FAIcon, { icon: faCircleXmark, "$size": 50 }) }) }), _jsxs("div", { style: {
|
|
207
|
+
display: 'flex',
|
|
208
|
+
flexDirection: 'column',
|
|
209
|
+
alignItems: handedness === 'right' ? 'start' : 'end',
|
|
210
|
+
}, children: [_jsx(Button, { "$reverse": handedness === 'right', style: {
|
|
211
|
+
background: isPressed
|
|
212
|
+
? Colors.gradientLightGreyTranslucent
|
|
213
|
+
: Colors.gradientGreyTranslucent,
|
|
214
|
+
width: `calc(${ControlButtonStyles.widthLong} + ${ControlButtonStyles.widthShort} + ${ControlButtonStyles.gap})`,
|
|
215
|
+
marginBottom: ControlButtonStyles.gap,
|
|
216
|
+
borderRadius: ControlButtonStyles.radiusSolo,
|
|
217
|
+
}, onClick: () => {
|
|
218
|
+
setIsPressed(true);
|
|
219
|
+
xrController.updateButtonValue(buttonId, 1);
|
|
220
|
+
setTimeout(() => {
|
|
221
|
+
setIsPressed(false);
|
|
222
|
+
xrController.updateButtonValue(buttonId, 0);
|
|
223
|
+
}, 250);
|
|
224
|
+
}, children: "Press" }), _jsxs(ButtonGroup, { "$reverse": handedness === 'right', children: [_jsx(SmallButton, { title: "Click to toggle touch state", "$reverse": xrController.inputSource.handedness !== 'left', style: {
|
|
225
|
+
background: isTouched
|
|
226
|
+
? Colors.gradientLightGreyTranslucent
|
|
227
|
+
: Colors.gradientGreyTranslucent,
|
|
228
|
+
width: ControlButtonStyles.widthShort,
|
|
229
|
+
}, onClick: () => {
|
|
230
|
+
setIsTouched(!isTouched);
|
|
231
|
+
xrController.updateButtonTouch(buttonId, !isTouched);
|
|
232
|
+
}, children: _jsx(FAIcon, { icon: faFingerprint }) }), _jsx(SmallButton, { "$reverse": xrController.inputSource.handedness !== 'left', style: {
|
|
233
|
+
background: isOnHold
|
|
234
|
+
? Colors.gradientLightGreyTranslucent
|
|
235
|
+
: Colors.gradientGreyTranslucent,
|
|
236
|
+
width: ControlButtonStyles.widthLong,
|
|
237
|
+
}, onClick: () => {
|
|
238
|
+
setIsOnHold(!isOnHold);
|
|
239
|
+
xrController.updateButtonValue(buttonId, isOnHold ? 0 : 1);
|
|
240
|
+
}, children: "Hold" })] })] })] }) }));
|
|
245
241
|
};
|
|
246
242
|
//# sourceMappingURL=joystick.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joystick.js","sourceRoot":"","sources":["../../src/components/joystick.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,EACN,MAAM,EACN,WAAW,EACX,MAAM,EACN,
|
|
1
|
+
{"version":3,"file":"joystick.js","sourceRoot":"","sources":["../../src/components/joystick.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,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EACN,aAAa,EACb,aAAa,GACb,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAa3C,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;;kBAGlB,mBAAmB,CAAC,GAAG;CACxC,CAAC;AAEF,MAAM,YAAY,GAAG,YAAY,mBAAmB,CAAC,MAAM,MAAM,mBAAmB,CAAC,GAAG,GAAG,CAAC;AAE5F,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAA;eACrB,MAAM,CAAC,uBAAuB;;;;;;;UAOnC,YAAY;WACX,YAAY;;;;CAItB,CAAC;AAEF,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;UAMtB,MAAM,CAAC,SAAS;;;CAGzB,CAAC;AAEF,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,CAAuB;UAC/C,mBAAmB,CAAC,SAAS;cACzB,mBAAmB,CAAC,QAAQ;;GAEvC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAClB,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AK,MAAM,EACxD,KAAK,EAAE;wCACN,UAAU,EAAE,SAAS;4CACpB,CAAC,CAAC,MAAM,CAAC,4BAA4B;4CACrC,CAAC,CAAC,MAAM,CAAC,uBAAuB;wCACjC,KAAK,EAAE,mBAAmB,CAAC,UAAU;qCACrC,EACD,OAAO,EAAE,GAAG,EAAE;wCACb,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC;wCACzB,YAAY,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC;oCACtD,CAAC,YAED,KAAC,MAAM,IAAC,IAAI,EAAE,aAAa,GAAI,GAClB,EACd,KAAC,WAAW,gBACD,YAAY,CAAC,WAAW,CAAC,UAAU,KAAK,MAAM,EACxD,KAAK,EAAE;wCACN,UAAU,EAAE,QAAQ;4CACnB,CAAC,CAAC,MAAM,CAAC,4BAA4B;4CACrC,CAAC,CAAC,MAAM,CAAC,uBAAuB;wCACjC,KAAK,EAAE,mBAAmB,CAAC,SAAS;qCACpC,EACD,OAAO,EAAE,GAAG,EAAE;wCACb,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC;wCACvB,YAAY,CAAC,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oCAC5D,CAAC,qBAGY,IACD,IACT,IACJ,GACgB,CACpB,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -9,10 +9,14 @@ export type KeyMapType = Partial<Record<XRHandedness, {
|
|
|
9
9
|
[key: string]: string;
|
|
10
10
|
}>>;
|
|
11
11
|
export declare const DEFAULT_KEYMAP: KeyMapType;
|
|
12
|
-
|
|
12
|
+
type KeyMapStore = {
|
|
13
13
|
keyMap: KeyMapType;
|
|
14
|
-
|
|
14
|
+
bindKey: (handedness: 'left' | 'right', action: string, keyCode?: string) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const useKeyMapStore: import("zustand").UseBoundStore<import("zustand").StoreApi<KeyMapStore>>;
|
|
17
|
+
interface ControllerMapperProps {
|
|
18
|
+
handedness: 'left' | 'right';
|
|
15
19
|
}
|
|
16
|
-
export declare const
|
|
20
|
+
export declare const ControllerMapper: React.FC<ControllerMapperProps>;
|
|
17
21
|
export {};
|
|
18
22
|
//# sourceMappingURL=mapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../src/components/mapper.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAA8B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../src/components/mapper.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAA8B,MAAM,OAAO,CAAC;AASnD,MAAM,MAAM,UAAU,GAAG,OAAO,CAC/B,MAAM,CAAC,YAAY,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC,CAC/C,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,UAuB5B,CAAC;AAEF,KAAK,WAAW,GAAG;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,CACR,UAAU,EAAE,MAAM,GAAG,OAAO,EAC5B,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,KACZ,IAAI,CAAC;CACV,CAAC;AAEF,eAAO,MAAM,cAAc,0EAgBxB,CAAC;AAcJ,UAAU,qBAAqB;IAC9B,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAkF5D,CAAC"}
|
package/lib/components/mapper.js
CHANGED
|
@@ -5,11 +5,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
import { Button, ButtonGroup } from './styled.js';
|
|
8
|
+
import { Button, ButtonGroup, Colors, ControlButtonStyles } from './styled.js';
|
|
9
9
|
import { useEffect, useState } from 'react';
|
|
10
10
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
11
11
|
import { GamepadIcon } from './icons.js';
|
|
12
12
|
import { MappedKeyDisplay } from './keys.js';
|
|
13
|
+
import { create } from 'zustand';
|
|
13
14
|
import { faBan } from '@fortawesome/free-solid-svg-icons';
|
|
14
15
|
import { styled } from 'styled-components';
|
|
15
16
|
export const DEFAULT_KEYMAP = {
|
|
@@ -36,51 +37,39 @@ export const DEFAULT_KEYMAP = {
|
|
|
36
37
|
squeeze: 'MouseRight',
|
|
37
38
|
},
|
|
38
39
|
};
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
flex-direction: column;
|
|
52
|
-
width: 50%;
|
|
53
|
-
`;
|
|
40
|
+
export const useKeyMapStore = create((set) => ({
|
|
41
|
+
keyMap: DEFAULT_KEYMAP,
|
|
42
|
+
bindKey: (handedness, action, keyCode = 'Unmapped') => set((state) => ({
|
|
43
|
+
keyMap: {
|
|
44
|
+
...state.keyMap,
|
|
45
|
+
[handedness]: {
|
|
46
|
+
...state.keyMap[handedness],
|
|
47
|
+
[action]: keyCode,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
})),
|
|
51
|
+
}));
|
|
54
52
|
const Row = styled.div `
|
|
55
53
|
display: flex;
|
|
56
|
-
height:
|
|
54
|
+
height: ${ControlButtonStyles.height};
|
|
57
55
|
align-items: center;
|
|
58
|
-
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
margin-bottom: ${ControlButtonStyles.gap};
|
|
58
|
+
|
|
59
|
+
&:last-child {
|
|
60
|
+
margin-bottom: 0;
|
|
61
|
+
}
|
|
59
62
|
`;
|
|
60
|
-
export const
|
|
63
|
+
export const ControllerMapper = ({ handedness, }) => {
|
|
64
|
+
const { keyMap, bindKey } = useKeyMapStore();
|
|
61
65
|
const [currentMapping, setCurrentMapping] = useState(null);
|
|
62
|
-
const startMapping = (
|
|
63
|
-
setCurrentMapping({
|
|
64
|
-
};
|
|
65
|
-
const unmapKey = (controller, action) => {
|
|
66
|
-
setKeyMap((prevKeyMap) => ({
|
|
67
|
-
...prevKeyMap,
|
|
68
|
-
[controller]: {
|
|
69
|
-
...prevKeyMap[controller],
|
|
70
|
-
[action]: 'Unmapped',
|
|
71
|
-
},
|
|
72
|
-
}));
|
|
66
|
+
const startMapping = (action) => {
|
|
67
|
+
setCurrentMapping({ action });
|
|
73
68
|
};
|
|
74
69
|
useEffect(() => {
|
|
75
70
|
const handleKeyDown = (event) => {
|
|
76
71
|
if (currentMapping && MappedKeyDisplay[event.code]) {
|
|
77
|
-
|
|
78
|
-
...prevKeyMap,
|
|
79
|
-
[currentMapping.controller]: {
|
|
80
|
-
...prevKeyMap[currentMapping.controller],
|
|
81
|
-
[currentMapping.action]: event.code,
|
|
82
|
-
},
|
|
83
|
-
}));
|
|
72
|
+
bindKey(handedness, currentMapping.action, event.code);
|
|
84
73
|
setCurrentMapping(null);
|
|
85
74
|
}
|
|
86
75
|
};
|
|
@@ -92,13 +81,7 @@ export const KeyMapMenu = ({ keyMap, setKeyMap, }) => {
|
|
|
92
81
|
? 'MouseRight'
|
|
93
82
|
: null;
|
|
94
83
|
if (mouseButton && MappedKeyDisplay[mouseButton]) {
|
|
95
|
-
|
|
96
|
-
...prevKeyMap,
|
|
97
|
-
[currentMapping.controller]: {
|
|
98
|
-
...prevKeyMap[currentMapping.controller],
|
|
99
|
-
[currentMapping.action]: mouseButton,
|
|
100
|
-
},
|
|
101
|
-
}));
|
|
84
|
+
bindKey(handedness, currentMapping.action, mouseButton);
|
|
102
85
|
setCurrentMapping(null);
|
|
103
86
|
}
|
|
104
87
|
}
|
|
@@ -114,21 +97,12 @@ export const KeyMapMenu = ({ keyMap, setKeyMap, }) => {
|
|
|
114
97
|
window.removeEventListener('mousedown', handleMouseDown);
|
|
115
98
|
window.removeEventListener('contextmenu', preventDefaultContextMenu);
|
|
116
99
|
};
|
|
117
|
-
}, [currentMapping
|
|
118
|
-
return
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
: 'rgba(255, 255, 255, 0.3)',
|
|
125
|
-
}, onClick: () => startMapping('left', action), onContextMenu: (e) => e.preventDefault(), children: keyMap.left[action] }), _jsx(Button, { style: { width: '24px' }, "$reverse": false, onClick: () => unmapKey('left', action), onContextMenu: (e) => e.preventDefault(), children: _jsx(FontAwesomeIcon, { icon: faBan }) })] })] }, action))) }), _jsx(Column, { children: Object.keys(keyMap.right).map((action) => (_jsxs(Row, { children: [_jsx(GamepadIcon, { buttonName: action === 'up' ? 'thumbstick' : action, handedness: "right" }), _jsxs(ButtonGroup, { "$reverse": false, children: [_jsx(Button, { "$reverse": false, style: {
|
|
126
|
-
width: '100px',
|
|
127
|
-
backgroundColor: currentMapping &&
|
|
128
|
-
currentMapping.controller === 'right' &&
|
|
129
|
-
currentMapping.action === action
|
|
130
|
-
? 'rgba(255, 255, 255, 0.6)'
|
|
131
|
-
: 'rgba(255, 255, 255, 0.3)',
|
|
132
|
-
}, onClick: () => startMapping('right', action), onContextMenu: (e) => e.preventDefault(), children: keyMap.right[action] }), _jsx(Button, { "$reverse": false, style: { width: '24px' }, onClick: () => unmapKey('right', action), onContextMenu: (e) => e.preventDefault(), children: _jsx(FontAwesomeIcon, { icon: faBan }) })] })] }, action))) })] }));
|
|
100
|
+
}, [currentMapping]);
|
|
101
|
+
return Object.keys(keyMap[handedness]).map((action) => (_jsxs(Row, { children: [_jsx(GamepadIcon, { buttonName: action === 'up' ? 'thumbstick' : action, handedness: handedness }), _jsxs(ButtonGroup, { "$reverse": false, children: [_jsx(Button, { "$reverse": false, style: {
|
|
102
|
+
width: '100px',
|
|
103
|
+
background: currentMapping && currentMapping.action === action
|
|
104
|
+
? Colors.gradientLightGreyTranslucent
|
|
105
|
+
: Colors.gradientGreyTranslucent,
|
|
106
|
+
}, onClick: () => startMapping(action), onContextMenu: (e) => e.preventDefault(), children: keyMap[handedness][action] }), _jsx(Button, { style: { width: ControlButtonStyles.widthShort }, "$reverse": false, onClick: () => bindKey(handedness, action), onContextMenu: (e) => e.preventDefault(), children: _jsx(FontAwesomeIcon, { icon: faBan }) })] })] }, action)));
|
|
133
107
|
};
|
|
134
108
|
//# sourceMappingURL=mapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapper.js","sourceRoot":"","sources":["../../src/components/mapper.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"mapper.js","sourceRoot":"","sources":["../../src/components/mapper.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAM3C,MAAM,CAAC,MAAM,cAAc,GAAe;IACzC,IAAI,EAAE;QACL,eAAe,EAAE,MAAM;QACvB,iBAAiB,EAAE,MAAM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KAAK,GAAI,GACxB,IACI,KA5BL,MAAM,CA6BV,CACN,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -5,24 +5,52 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
8
|
+
export declare const Colors: {
|
|
9
|
+
textWhite: string;
|
|
10
|
+
textGrey: string;
|
|
11
|
+
dangerRed: string;
|
|
12
|
+
dangerRedPressed: string;
|
|
13
|
+
panelBackground: string;
|
|
14
|
+
panelBorder: string;
|
|
15
|
+
buttonBackground: string;
|
|
16
|
+
buttonHovered: string;
|
|
17
|
+
buttonPressed: string;
|
|
18
|
+
gradientGrey: string;
|
|
19
|
+
gradientGreyTranslucent: string;
|
|
20
|
+
gradientLightGreyTranslucent: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const ControlButtonStyles: {
|
|
23
|
+
height: string;
|
|
24
|
+
minWidth: string;
|
|
25
|
+
fontSize: string;
|
|
26
|
+
radiusMiddle: string;
|
|
27
|
+
radiusSolo: string;
|
|
28
|
+
radiusFirst: string;
|
|
29
|
+
radiusLast: string;
|
|
30
|
+
widthLong: string;
|
|
31
|
+
widthShort: string;
|
|
32
|
+
gap: string;
|
|
33
|
+
};
|
|
8
34
|
export declare const Button: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
9
|
-
$reverse
|
|
35
|
+
$reverse?: boolean;
|
|
10
36
|
}>> & string;
|
|
37
|
+
export declare const HeaderButtonsContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
38
|
+
export declare const HeaderButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
11
39
|
export declare const MappedKeyBlock: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
12
40
|
$pressed: boolean;
|
|
13
41
|
}>> & string;
|
|
14
42
|
export declare const ButtonContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
15
|
-
$reverse
|
|
43
|
+
$reverse?: boolean;
|
|
16
44
|
}>> & string;
|
|
17
45
|
export declare const ButtonGroup: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
18
|
-
$reverse
|
|
46
|
+
$reverse?: boolean;
|
|
19
47
|
}>> & string;
|
|
20
48
|
export declare const JoystickButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
21
49
|
export declare const JoystickInner: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
22
50
|
export declare const RangeSelector: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
|
|
23
51
|
ref?: ((instance: HTMLInputElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLInputElement> | null | undefined;
|
|
24
52
|
}>, never>, {
|
|
25
|
-
$reverse
|
|
53
|
+
$reverse?: boolean;
|
|
26
54
|
}>> & string;
|
|
27
55
|
export declare const KeyBlockContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
28
56
|
$reverse: boolean;
|
|
@@ -30,8 +58,21 @@ export declare const KeyBlockContainer: import("styled-components/dist/types").I
|
|
|
30
58
|
export declare const KeyRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
31
59
|
$reverse: boolean;
|
|
32
60
|
}>> & string;
|
|
33
|
-
export declare const
|
|
34
|
-
export declare const FAIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("@fortawesome/react-fontawesome").FontAwesomeIconProps, "ref"> & {
|
|
61
|
+
export declare const FAIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<import("@fortawesome/react-fontawesome").FontAwesomeIconProps, "ref"> & {
|
|
35
62
|
ref?: ((instance: SVGSVGElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<SVGSVGElement> | null | undefined;
|
|
36
|
-
},
|
|
63
|
+
}, {
|
|
64
|
+
$size?: number;
|
|
65
|
+
}>> & string & Omit<typeof FontAwesomeIcon, keyof import("react").Component<any, {}, any>>;
|
|
66
|
+
export declare const ControlPanel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
67
|
+
export declare const SectionBreak: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHRElement>, HTMLHRElement>, {
|
|
68
|
+
$horizontal?: boolean;
|
|
69
|
+
}>> & string;
|
|
70
|
+
export declare const PanelHeaderButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
71
|
+
$isRed?: boolean;
|
|
72
|
+
}>> & string;
|
|
73
|
+
export declare const ValuesContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
74
|
+
export declare const ValueInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
|
|
75
|
+
ref?: ((instance: HTMLInputElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLInputElement> | null | undefined;
|
|
76
|
+
}>, never>, never>> & string;
|
|
77
|
+
export declare const InputSuffix: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
37
78
|
//# sourceMappingURL=styled.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../src/components/styled.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGjE,eAAO,MAAM,MAAM;
|
|
1
|
+
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../src/components/styled.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGjE,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAelB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;CAW/B,CAAC;AAEF,eAAO,MAAM,MAAM;eAA8B,OAAO;YAmCvD,CAAC;AAGF,eAAO,MAAM,sBAAsB,6NAYlC,CAAC;AAEF,eAAO,MAAM,YAAY,yOAyCxB,CAAC;AAEF,eAAO,MAAM,cAAc;cAA0B,OAAO;YAc3D,CAAC;AAEF,eAAO,MAAM,eAAe;eAA2B,OAAO;YAW7D,CAAC;AAGF,eAAO,MAAM,WAAW;eAA2B,OAAO;YAQzD,CAAC;AAGF,eAAO,MAAM,cAAc,yOAe1B,CAAC;AAEF,eAAO,MAAM,aAAa,6NAQzB,CAAC;AAEF,eAAO,MAAM,aAAa;;;eACd,OAAO;YAsClB,CAAC;AAGF,eAAO,MAAM,iBAAiB;cAA0B,OAAO;YAM9D,CAAC;AAEF,eAAO,MAAM,MAAM;cAA0B,OAAO;YAKnD,CAAC;AAEF,eAAO,MAAM,MAAM;;;YAAqC,MAAM;0FAO7D,CAAC;AAGF,eAAO,MAAM,YAAY,6NAexB,CAAC;AAEF,eAAO,MAAM,YAAY;kBAA6B,OAAO;YAM5D,CAAC;AAGF,eAAO,MAAM,iBAAiB;aAA4B,OAAO;YAwBhE,CAAC;AAGF,eAAO,MAAM,eAAe,6NAK3B,CAAC;AAEF,eAAO,MAAM,UAAU;;4BAmBtB,CAAC;AAEF,eAAO,MAAM,WAAW,+NAQvB,CAAC"}
|