@antha/input 0.0.7 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -92,7 +92,7 @@ function readPlayerBindings({ bindingsMap, activeBindingsMap, rawInputs, msSince
92
92
  }, check.isTruthy).flat();
93
93
  if (matchingInputs.length) {
94
94
  const value = matchingInputs.reduce((accum, matchingInput) => {
95
- return accum + matchingInput.inputValue;
95
+ return accum + Math.abs(matchingInput.inputValue);
96
96
  }, 0);
97
97
  const previousActiveBinding = activeBindingsMap?.[bindingName];
98
98
  const previousBindingDuration = previousActiveBinding?.holdDuration;
@@ -1,9 +1,9 @@
1
1
  import { defineAnthaMod } from '@antha/engine';
2
+ import { KnownInput } from '@antha/gamepad-type';
2
3
  import { check } from '@augment-vir/assert';
3
4
  import { getObjectTypedEntries, getObjectTypedValues } from '@augment-vir/common';
4
5
  import { convertDuration } from 'date-vir';
5
6
  import { NavController, NavDirection, NavValue } from 'device-navigation';
6
- import { KnownInput } from 'gamepad-type';
7
7
  import { InputDirection } from '../raw-inputs/raw-input.js';
8
8
  import { AnyGamepad, } from './player-bindings.js';
9
9
  export { nav, navAttribute, NavController } from 'device-navigation';
@@ -1,6 +1,5 @@
1
- import { type PartialWithUndefined } from '@augment-vir/common';
1
+ import { type PartialWithUndefined, type RequireExactlyOne } from '@augment-vir/common';
2
2
  import { type NavController } from 'device-navigation';
3
- import { type RequireExactlyOne } from 'type-fest';
4
3
  /**
5
4
  * Keypress details emitted by the `keyPress` event from {@link AnthaKeyboard}.
6
5
  *
package/dist/index.d.ts CHANGED
@@ -7,5 +7,5 @@ export * from './elements/antha-keyboard.element.js';
7
7
  export * from './raw-inputs/antha-raw-input-debug.element.js';
8
8
  export * from './raw-inputs/antha-read-raw-input.mod.js';
9
9
  export * from './raw-inputs/raw-input.js';
10
- export * from 'gamepad-type';
10
+ export * from '@antha/gamepad-type';
11
11
  export * from 'input-device-handler';
package/dist/index.js CHANGED
@@ -7,5 +7,5 @@ export * from './elements/antha-keyboard.element.js';
7
7
  export * from './raw-inputs/antha-raw-input-debug.element.js';
8
8
  export * from './raw-inputs/antha-read-raw-input.mod.js';
9
9
  export * from './raw-inputs/raw-input.js';
10
- export * from 'gamepad-type';
10
+ export * from '@antha/gamepad-type';
11
11
  export * from 'input-device-handler';
@@ -1,5 +1,5 @@
1
+ import { type GamepadBrandMap, type GamepadLayout, type GamepadModelMap } from '@antha/gamepad-type';
1
2
  import { type PartialWithUndefined, type SelectFrom, type SetRequired } from '@augment-vir/common';
2
- import { type GamepadBrandMap, type GamepadLayout, type GamepadModelMap } from 'gamepad-type';
3
3
  import { InputDeviceHandler, type InputDeviceHandlerOptions, type InputDeviceKey } from 'input-device-handler';
4
4
  import { type RawInput, type RawInputs, type SimpleInputDevicesMap } from './raw-input.js';
5
5
  /**
@@ -1,8 +1,8 @@
1
1
  import { defineAnthaMod } from '@antha/engine';
2
+ import { defaultGamepadLayouts, defaultGamepadModelMap, findMatchingGamepadLayout, findMatchingGamepadModel, modelInputNameOverrides, } from '@antha/gamepad-type';
2
3
  import { check } from '@augment-vir/assert';
3
4
  import { mapObject, } from '@augment-vir/common';
4
5
  import { html } from 'element-vir';
5
- import { defaultGamepadLayouts, defaultGamepadModelMap, findMatchingGamepadLayout, findMatchingGamepadModel, modelInputNameOverrides, } from 'gamepad-type';
6
6
  import { InputDeviceHandler, isGamepadDeviceKey, } from 'input-device-handler';
7
7
  import { AnthaRawInputDebug } from './antha-raw-input-debug.element.js';
8
8
  import { calculateInputDirection, mapToSimpleDevicesMap, } from './raw-input.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antha/input",
3
- "version": "0.0.7",
3
+ "version": "0.1.0",
4
4
  "description": "An Antha mod for handling inputs.",
5
5
  "keywords": [
6
6
  "vir",
@@ -33,26 +33,25 @@
33
33
  "test:docs": "virmator docs check"
34
34
  },
35
35
  "dependencies": {
36
- "@augment-vir/assert": "^31.73.1",
37
- "@augment-vir/common": "^31.73.1",
38
- "date-vir": "^8.5.0",
39
- "device-navigation": "^4.7.2",
40
- "gamepad-type": "^2.1.0",
41
- "input-device-handler": "^9.0.3",
42
- "object-shape-tester": "^6.14.0",
43
- "type-fest": "^5.7.0",
44
- "vira": "^31.24.1"
36
+ "@antha/gamepad-type": "^0.1.0",
37
+ "@augment-vir/assert": "^32.2.2",
38
+ "@augment-vir/common": "^32.2.2",
39
+ "date-vir": "^9.0.0",
40
+ "device-navigation": "^4.7.3",
41
+ "input-device-handler": "^9.0.4",
42
+ "object-shape-tester": "^6.14.1",
43
+ "vira": "^31.29.0"
45
44
  },
46
45
  "devDependencies": {
47
- "@augment-vir/test": "^31.73.1",
48
- "@web/dev-server-esbuild": "^1.0.5",
49
- "@web/test-runner": "^0.20.2",
50
- "@web/test-runner-playwright": "^0.11.1",
51
- "element-vir": "^26.17.0",
46
+ "@augment-vir/test": "^32.2.2",
47
+ "@web/dev-server-esbuild": "^2.0.0",
48
+ "@web/test-runner": "^1.0.0",
49
+ "@web/test-runner-playwright": "^1.0.0",
50
+ "element-vir": "^26.17.3",
52
51
  "istanbul-smart-text-reporter": "^1.1.5"
53
52
  },
54
53
  "peerDependencies": {
55
- "@antha/engine": "^0.0.7",
54
+ "@antha/engine": "^0.1.0",
56
55
  "element-vir": ">=26"
57
56
  },
58
57
  "engines": {