@benev/tact 0.1.0-3 → 0.1.0-5
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/README.md +113 -104
- package/package.json +7 -7
- package/s/core/bindings/action.ts +14 -4
- package/s/core/bindings/parts/defaults.ts +4 -1
- package/s/core/bindings/parts/lens-algo.ts +21 -13
- package/s/core/bindings/parts/lookup-proxies.ts +17 -0
- package/s/core/bindings/resolver.ts +12 -12
- package/s/core/bindings/sample-map.ts +25 -0
- package/s/core/bindings/types.ts +4 -1
- package/s/core/core.test.ts +46 -34
- package/s/core/devices/auto-gamepads.ts +8 -0
- package/s/core/devices/device.ts +12 -0
- package/s/core/devices/infra/group.ts +24 -0
- package/s/core/devices/infra/sampler.ts +22 -0
- package/s/core/devices/standard/gamepad.ts +83 -0
- package/s/core/{controllers → devices}/standard/index.ts +2 -1
- package/s/core/devices/standard/keyboard.ts +31 -0
- package/s/core/{controllers → devices}/standard/pointer.ts +19 -11
- package/s/core/devices/standard/primary.ts +20 -0
- package/s/core/devices/standard/stick.ts +27 -0
- package/s/core/{controllers/standard/virtual-gamepad.ts → devices/standard/vpad.ts} +9 -9
- package/s/core/{controllers → devices}/types.ts +0 -1
- package/s/core/hub/hub.ts +78 -62
- package/s/core/hub/meta-bindings.ts +23 -0
- package/s/core/hub/parts/connected.ts +15 -0
- package/s/core/hub/port.ts +26 -0
- package/s/core/hub/types.ts +5 -6
- package/s/core/index.ts +12 -14
- package/s/core/testing/testing.ts +19 -14
- package/s/deck/components/components.ts +22 -0
- package/s/deck/components/deck-bindings/component.ts +99 -0
- package/s/deck/components/deck-bindings/style.css.ts +6 -0
- package/s/deck/components/deck-overlay/component.ts +51 -0
- package/s/deck/components/deck-overlay/style.css.ts +110 -0
- package/s/deck/components/framework.ts +17 -0
- package/s/deck/deck.ts +82 -0
- package/s/deck/index.ts +14 -0
- package/s/deck/parts/catalog.ts +58 -0
- package/s/deck/parts/db.ts +66 -0
- package/s/deck/parts/device-skins/device-icons.ts +38 -0
- package/s/deck/parts/device-skins/device-skin.ts +29 -0
- package/s/deck/parts/local-storage-kv.ts +8 -0
- package/s/deck/parts/merge-bindings.ts +21 -0
- package/s/deck/parts/overlay-visibility.ts +49 -0
- package/s/demo/game/game.ts +85 -0
- package/s/demo/game/parts/agent.ts +10 -0
- package/s/demo/game/parts/game-bindings.ts +20 -0
- package/s/demo/game/parts/logic.ts +24 -0
- package/s/demo/game/parts/player.ts +32 -0
- package/s/demo/game/parts/renderer.ts +113 -0
- package/s/demo/game/parts/state.ts +24 -0
- package/s/demo/game/parts/virtual-device.ts +13 -0
- package/s/demo/main.bundle.ts +9 -10
- package/s/demo/main.css +30 -2
- package/s/demo/ui/theater/styles.css.ts +58 -0
- package/s/demo/ui/theater/view.ts +60 -0
- package/s/demo/ui/theater/virtual/style.css.ts +43 -0
- package/s/demo/ui/theater/virtual/view.ts +31 -0
- package/s/demo/ui/utils/loader.ts +5 -0
- package/s/index.html.ts +17 -7
- package/s/index.ts +3 -1
- package/s/nubs/components.ts +14 -0
- package/s/nubs/index.ts +6 -0
- package/s/nubs/lookpad/component.ts +45 -0
- package/s/nubs/stick/component.ts +115 -0
- package/s/nubs/stick/style.css.ts +70 -0
- package/s/nubs/{virtual-gamepad/view.ts → vpad/component.ts} +21 -11
- package/s/nubs/{virtual-gamepad → vpad}/styles.css.ts +5 -4
- package/s/utils/circular-clamp.ts +15 -0
- package/s/utils/dispensers.ts +20 -0
- package/s/utils/split-axis.ts +10 -2
- package/s/utils/types.ts +19 -0
- package/x/core/bindings/action.d.ts +3 -1
- package/x/core/bindings/action.js +12 -4
- package/x/core/bindings/action.js.map +1 -1
- package/x/core/bindings/parts/defaults.js +4 -1
- package/x/core/bindings/parts/defaults.js.map +1 -1
- package/x/core/bindings/parts/lens-algo.js +18 -7
- package/x/core/bindings/parts/lens-algo.js.map +1 -1
- package/x/core/bindings/parts/lookup-proxies.d.ts +1 -0
- package/x/core/bindings/parts/lookup-proxies.js +19 -0
- package/x/core/bindings/parts/lookup-proxies.js.map +1 -0
- package/x/core/bindings/resolver.d.ts +5 -4
- package/x/core/bindings/resolver.js +12 -10
- package/x/core/bindings/resolver.js.map +1 -1
- package/x/core/bindings/sample-map.d.ts +7 -0
- package/x/core/bindings/sample-map.js +22 -0
- package/x/core/bindings/sample-map.js.map +1 -0
- package/x/core/bindings/types.d.ts +4 -1
- package/x/core/core.test.d.ts +5 -4
- package/x/core/core.test.js +45 -34
- package/x/core/core.test.js.map +1 -1
- package/x/core/devices/auto-gamepads.d.ts +2 -0
- package/x/core/devices/auto-gamepads.js +6 -0
- package/x/core/devices/auto-gamepads.js.map +1 -0
- package/x/core/devices/device.d.ts +5 -0
- package/x/core/devices/device.js +7 -0
- package/x/core/devices/device.js.map +1 -0
- package/x/core/devices/infra/group.d.ts +8 -0
- package/x/core/devices/infra/group.js +21 -0
- package/x/core/devices/infra/group.js.map +1 -0
- package/x/core/devices/infra/sampler.d.ts +9 -0
- package/x/core/devices/infra/sampler.js +18 -0
- package/x/core/devices/infra/sampler.js.map +1 -0
- package/x/core/devices/standard/gamepad.d.ts +11 -0
- package/x/core/devices/standard/gamepad.js +65 -0
- package/x/core/devices/standard/gamepad.js.map +1 -0
- package/x/core/{controllers → devices}/standard/index.d.ts +2 -1
- package/x/core/{controllers → devices}/standard/index.js +2 -1
- package/x/core/devices/standard/index.js.map +1 -0
- package/x/core/devices/standard/keyboard.d.ts +9 -0
- package/x/core/devices/standard/keyboard.js +28 -0
- package/x/core/devices/standard/keyboard.js.map +1 -0
- package/x/core/devices/standard/pointer.d.ts +15 -0
- package/x/core/{controllers → devices}/standard/pointer.js +18 -11
- package/x/core/devices/standard/pointer.js.map +1 -0
- package/x/core/devices/standard/primary.d.ts +10 -0
- package/x/core/devices/standard/primary.js +17 -0
- package/x/core/devices/standard/primary.js.map +1 -0
- package/x/core/devices/standard/stick.d.ts +15 -0
- package/x/core/devices/standard/stick.js +24 -0
- package/x/core/devices/standard/stick.js.map +1 -0
- package/x/core/devices/standard/vpad.d.ts +7 -0
- package/x/core/{controllers/standard/virtual-gamepad.js → devices/standard/vpad.js} +10 -10
- package/x/core/devices/standard/vpad.js.map +1 -0
- package/x/core/{controllers → devices}/types.d.ts +0 -1
- package/x/core/{controllers → devices}/types.js.map +1 -1
- package/x/core/hub/hub.d.ts +27 -23
- package/x/core/hub/hub.js +71 -61
- package/x/core/hub/hub.js.map +1 -1
- package/x/core/hub/meta-bindings.d.ts +2 -0
- package/x/core/hub/meta-bindings.js +21 -0
- package/x/core/hub/meta-bindings.js.map +1 -0
- package/x/core/hub/parts/connected.d.ts +14 -0
- package/x/core/hub/parts/connected.js +12 -0
- package/x/core/hub/parts/connected.js.map +1 -0
- package/x/core/hub/port.d.ts +10 -0
- package/x/core/hub/port.js +19 -0
- package/x/core/hub/port.js.map +1 -0
- package/x/core/hub/types.d.ts +5 -5
- package/x/core/hub/types.js +1 -1
- package/x/core/hub/types.js.map +1 -1
- package/x/core/index.d.ts +12 -12
- package/x/core/index.js +12 -12
- package/x/core/index.js.map +1 -1
- package/x/core/testing/testing.d.ts +13 -11
- package/x/core/testing/testing.js +14 -13
- package/x/core/testing/testing.js.map +1 -1
- package/x/deck/components/components.d.ts +14 -0
- package/x/deck/components/components.js +9 -0
- package/x/deck/components/components.js.map +1 -0
- package/x/deck/components/deck-bindings/component.d.ts +6 -0
- package/x/deck/components/deck-bindings/component.js +83 -0
- package/x/deck/components/deck-bindings/component.js.map +1 -0
- package/x/deck/components/deck-bindings/style.css.js +5 -0
- package/x/deck/components/deck-bindings/style.css.js.map +1 -0
- package/x/deck/components/deck-overlay/component.d.ts +6 -0
- package/x/deck/components/deck-overlay/component.js +44 -0
- package/x/deck/components/deck-overlay/component.js.map +1 -0
- package/x/deck/components/deck-overlay/style.css.d.ts +2 -0
- package/x/deck/components/deck-overlay/style.css.js +109 -0
- package/x/deck/components/deck-overlay/style.css.js.map +1 -0
- package/x/deck/components/framework.d.ts +7 -0
- package/x/deck/components/framework.js +13 -0
- package/x/deck/components/framework.js.map +1 -0
- package/x/deck/deck.d.ts +37 -0
- package/x/deck/deck.js +55 -0
- package/x/deck/deck.js.map +1 -0
- package/x/deck/index.d.ts +10 -0
- package/x/deck/index.js +11 -0
- package/x/deck/index.js.map +1 -0
- package/x/deck/parts/catalog.d.ts +23 -0
- package/x/deck/parts/catalog.js +35 -0
- package/x/deck/parts/catalog.js.map +1 -0
- package/x/deck/parts/db.d.ts +20 -0
- package/x/deck/parts/db.js +52 -0
- package/x/deck/parts/db.js.map +1 -0
- package/x/deck/parts/device-skins/device-icons.d.ts +12 -0
- package/x/deck/parts/device-skins/device-icons.js +27 -0
- package/x/deck/parts/device-skins/device-icons.js.map +1 -0
- package/x/deck/parts/device-skins/device-skin.d.ts +14 -0
- package/x/deck/parts/device-skins/device-skin.js +22 -0
- package/x/deck/parts/device-skins/device-skin.js.map +1 -0
- package/x/deck/parts/local-storage-kv.js +6 -0
- package/x/deck/parts/local-storage-kv.js.map +1 -0
- package/x/deck/parts/merge-bindings.d.ts +2 -0
- package/x/deck/parts/merge-bindings.js +15 -0
- package/x/deck/parts/merge-bindings.js.map +1 -0
- package/x/deck/parts/overlay-visibility.d.ts +21 -0
- package/x/deck/parts/overlay-visibility.js +35 -0
- package/x/deck/parts/overlay-visibility.js.map +1 -0
- package/x/demo/game/game.d.ts +20 -0
- package/x/demo/game/game.js +63 -0
- package/x/demo/game/game.js.map +1 -0
- package/x/demo/game/parts/agent.d.ts +7 -0
- package/x/demo/game/parts/agent.js +8 -0
- package/x/demo/game/parts/agent.js.map +1 -0
- package/x/demo/game/parts/game-bindings.d.ts +15 -0
- package/x/demo/game/parts/game-bindings.js +10 -0
- package/x/demo/game/parts/game-bindings.js.map +1 -0
- package/x/demo/game/parts/logic.d.ts +8 -0
- package/x/demo/game/parts/logic.js +21 -0
- package/x/demo/game/parts/logic.js.map +1 -0
- package/x/demo/game/parts/player.d.ts +14 -0
- package/x/demo/game/parts/player.js +26 -0
- package/x/demo/game/parts/player.js.map +1 -0
- package/x/demo/game/parts/renderer.d.ts +13 -0
- package/x/demo/game/parts/renderer.js +91 -0
- package/x/demo/game/parts/renderer.js.map +1 -0
- package/x/demo/game/parts/state.d.ts +8 -0
- package/x/demo/game/parts/state.js +20 -0
- package/x/demo/game/parts/state.js.map +1 -0
- package/x/demo/game/parts/virtual-device.d.ts +8 -0
- package/x/demo/game/parts/virtual-device.js +11 -0
- package/x/demo/game/parts/virtual-device.js.map +1 -0
- package/x/demo/main.bundle.js +9 -9
- package/x/demo/main.bundle.js.map +1 -1
- package/x/demo/main.bundle.min.js +361 -55
- package/x/demo/main.bundle.min.js.map +4 -4
- package/x/demo/main.css +30 -2
- package/x/demo/ui/theater/styles.css.js +57 -0
- package/x/demo/ui/theater/styles.css.js.map +1 -0
- package/x/demo/ui/theater/view.d.ts +368 -0
- package/x/demo/ui/theater/view.js +50 -0
- package/x/demo/ui/theater/view.js.map +1 -0
- package/x/demo/ui/theater/virtual/style.css.d.ts +2 -0
- package/x/demo/ui/theater/virtual/style.css.js +42 -0
- package/x/demo/ui/theater/virtual/style.css.js.map +1 -0
- package/x/demo/ui/theater/virtual/view.d.ts +4 -0
- package/x/demo/ui/theater/virtual/view.js +19 -0
- package/x/demo/ui/theater/virtual/view.js.map +1 -0
- package/x/demo/ui/utils/loader.d.ts +2 -0
- package/x/demo/ui/utils/loader.js +3 -0
- package/x/demo/ui/utils/loader.js.map +1 -0
- package/x/index.d.ts +3 -1
- package/x/index.html +48 -9
- package/x/index.html.js +17 -7
- package/x/index.html.js.map +1 -1
- package/x/index.js +3 -1
- package/x/index.js.map +1 -1
- package/x/nubs/components.d.ts +9 -0
- package/x/nubs/components.js +11 -0
- package/x/nubs/components.js.map +1 -0
- package/x/nubs/index.d.ts +4 -0
- package/x/nubs/index.js +5 -0
- package/x/nubs/index.js.map +1 -0
- package/x/nubs/lookpad/component.d.ts +4 -0
- package/x/nubs/lookpad/component.js +36 -0
- package/x/nubs/lookpad/component.js.map +1 -0
- package/x/nubs/stick/component.d.ts +368 -0
- package/x/nubs/stick/component.js +101 -0
- package/x/nubs/stick/component.js.map +1 -0
- package/x/nubs/stick/style.css.d.ts +2 -0
- package/x/nubs/stick/style.css.js +69 -0
- package/x/nubs/stick/style.css.js.map +1 -0
- package/x/nubs/vpad/component.d.ts +368 -0
- package/x/nubs/{virtual-gamepad/view.js → vpad/component.js} +20 -11
- package/x/nubs/vpad/component.js.map +1 -0
- package/x/nubs/vpad/styles.css.d.ts +2 -0
- package/x/nubs/{virtual-gamepad → vpad}/styles.css.js +4 -4
- package/x/nubs/vpad/styles.css.js.map +1 -0
- package/x/nubs/vpad/utils/gamepad-inputs.js.map +1 -0
- package/x/nubs/vpad/utils/prevent-default-touch-shenanigans.js.map +1 -0
- package/x/nubs/vpad/utils/touch-tracking.js.map +1 -0
- package/x/utils/circular-clamp.d.ts +2 -0
- package/x/utils/circular-clamp.js +8 -0
- package/x/utils/circular-clamp.js.map +1 -0
- package/x/utils/dispensers.d.ts +7 -0
- package/x/utils/dispensers.js +16 -0
- package/x/utils/dispensers.js.map +1 -0
- package/x/utils/split-axis.d.ts +7 -0
- package/x/utils/split-axis.js +7 -2
- package/x/utils/split-axis.js.map +1 -1
- package/x/utils/types.d.ts +3 -0
- package/x/utils/types.js +3 -0
- package/x/utils/types.js.map +1 -0
- package/s/core/controllers/controller.ts +0 -7
- package/s/core/controllers/infra/group.ts +0 -17
- package/s/core/controllers/infra/sampler.ts +0 -22
- package/s/core/controllers/standard/gamepad.ts +0 -77
- package/s/core/controllers/standard/keyboard.ts +0 -50
- package/s/core/controllers/standard/stick.ts +0 -30
- package/s/core/deck/deck.ts +0 -40
- package/s/core/deck/parts/bindings-depot.ts +0 -24
- package/s/core/deck/parts/local-storage-kv.ts +0 -7
- package/s/core/hub/auto-gamepads.ts +0 -8
- package/s/core/hub/bindings.ts +0 -18
- package/s/core/port/port.ts +0 -34
- package/s/core/port/utils/aggregate_samples_into_map.ts +0 -20
- package/s/core/port/utils/wipe_samples_map.ts +0 -8
- package/s/nubs/lookpad/utils/listeners.ts +0 -53
- package/s/nubs/lookpad/view.ts +0 -32
- package/s/nubs/stick/styles.ts +0 -22
- package/s/nubs/stick/utils/calculate_new_vector_from_pointer_position.ts +0 -27
- package/s/nubs/stick/utils/find_closest_point_on_circle.ts +0 -15
- package/s/nubs/stick/utils/make_pointer_listeners.ts +0 -50
- package/s/nubs/stick/utils/within_radius.ts +0 -6
- package/s/nubs/stick/view.ts +0 -50
- package/s/nubs/stick-graphic/styles.ts +0 -38
- package/s/nubs/stick-graphic/types/basis.ts +0 -5
- package/s/nubs/stick-graphic/utils/calculate_basis.ts +0 -19
- package/s/nubs/stick-graphic/utils/stick_vector_to_pixels.ts +0 -13
- package/s/nubs/stick-graphic/utils/transform.ts +0 -10
- package/s/nubs/stick-graphic/view.ts +0 -43
- package/x/core/controllers/controller.d.ts +0 -4
- package/x/core/controllers/controller.js +0 -3
- package/x/core/controllers/controller.js.map +0 -1
- package/x/core/controllers/infra/group.d.ts +0 -7
- package/x/core/controllers/infra/group.js +0 -13
- package/x/core/controllers/infra/group.js.map +0 -1
- package/x/core/controllers/infra/sampler.d.ts +0 -8
- package/x/core/controllers/infra/sampler.js +0 -17
- package/x/core/controllers/infra/sampler.js.map +0 -1
- package/x/core/controllers/standard/gamepad.d.ts +0 -9
- package/x/core/controllers/standard/gamepad.js +0 -66
- package/x/core/controllers/standard/gamepad.js.map +0 -1
- package/x/core/controllers/standard/index.js.map +0 -1
- package/x/core/controllers/standard/keyboard.d.ts +0 -9
- package/x/core/controllers/standard/keyboard.js +0 -39
- package/x/core/controllers/standard/keyboard.js.map +0 -1
- package/x/core/controllers/standard/pointer.d.ts +0 -11
- package/x/core/controllers/standard/pointer.js.map +0 -1
- package/x/core/controllers/standard/stick.d.ts +0 -15
- package/x/core/controllers/standard/stick.js +0 -27
- package/x/core/controllers/standard/stick.js.map +0 -1
- package/x/core/controllers/standard/virtual-gamepad.d.ts +0 -7
- package/x/core/controllers/standard/virtual-gamepad.js.map +0 -1
- package/x/core/deck/deck.d.ts +0 -16
- package/x/core/deck/deck.js +0 -31
- package/x/core/deck/deck.js.map +0 -1
- package/x/core/deck/parts/bindings-depot.d.ts +0 -9
- package/x/core/deck/parts/bindings-depot.js +0 -19
- package/x/core/deck/parts/bindings-depot.js.map +0 -1
- package/x/core/deck/parts/local-storage-kv.js +0 -5
- package/x/core/deck/parts/local-storage-kv.js.map +0 -1
- package/x/core/hub/auto-gamepads.d.ts +0 -2
- package/x/core/hub/auto-gamepads.js +0 -6
- package/x/core/hub/auto-gamepads.js.map +0 -1
- package/x/core/hub/bindings.d.ts +0 -2
- package/x/core/hub/bindings.js +0 -16
- package/x/core/hub/bindings.js.map +0 -1
- package/x/core/port/port.d.ts +0 -12
- package/x/core/port/port.js +0 -25
- package/x/core/port/port.js.map +0 -1
- package/x/core/port/utils/aggregate_samples_into_map.d.ts +0 -3
- package/x/core/port/utils/aggregate_samples_into_map.js +0 -11
- package/x/core/port/utils/aggregate_samples_into_map.js.map +0 -1
- package/x/core/port/utils/wipe_samples_map.d.ts +0 -2
- package/x/core/port/utils/wipe_samples_map.js +0 -5
- package/x/core/port/utils/wipe_samples_map.js.map +0 -1
- package/x/nubs/lookpad/utils/listeners.d.ts +0 -19
- package/x/nubs/lookpad/utils/listeners.js +0 -37
- package/x/nubs/lookpad/utils/listeners.js.map +0 -1
- package/x/nubs/lookpad/view.d.ts +0 -1
- package/x/nubs/lookpad/view.js +0 -24
- package/x/nubs/lookpad/view.js.map +0 -1
- package/x/nubs/stick/styles.d.ts +0 -1
- package/x/nubs/stick/styles.js +0 -22
- package/x/nubs/stick/styles.js.map +0 -1
- package/x/nubs/stick/utils/calculate_new_vector_from_pointer_position.d.ts +0 -3
- package/x/nubs/stick/utils/calculate_new_vector_from_pointer_position.js +0 -16
- package/x/nubs/stick/utils/calculate_new_vector_from_pointer_position.js.map +0 -1
- package/x/nubs/stick/utils/find_closest_point_on_circle.d.ts +0 -2
- package/x/nubs/stick/utils/find_closest_point_on_circle.js +0 -6
- package/x/nubs/stick/utils/find_closest_point_on_circle.js.map +0 -1
- package/x/nubs/stick/utils/make_pointer_listeners.d.ts +0 -16
- package/x/nubs/stick/utils/make_pointer_listeners.js +0 -34
- package/x/nubs/stick/utils/make_pointer_listeners.js.map +0 -1
- package/x/nubs/stick/utils/within_radius.d.ts +0 -2
- package/x/nubs/stick/utils/within_radius.js +0 -4
- package/x/nubs/stick/utils/within_radius.js.map +0 -1
- package/x/nubs/stick/view.d.ts +0 -2
- package/x/nubs/stick/view.js +0 -38
- package/x/nubs/stick/view.js.map +0 -1
- package/x/nubs/stick-graphic/styles.js +0 -38
- package/x/nubs/stick-graphic/styles.js.map +0 -1
- package/x/nubs/stick-graphic/types/basis.d.ts +0 -4
- package/x/nubs/stick-graphic/types/basis.js +0 -2
- package/x/nubs/stick-graphic/types/basis.js.map +0 -1
- package/x/nubs/stick-graphic/utils/calculate_basis.d.ts +0 -2
- package/x/nubs/stick-graphic/utils/calculate_basis.js +0 -10
- package/x/nubs/stick-graphic/utils/calculate_basis.js.map +0 -1
- package/x/nubs/stick-graphic/utils/stick_vector_to_pixels.d.ts +0 -2
- package/x/nubs/stick-graphic/utils/stick_vector_to_pixels.js +0 -7
- package/x/nubs/stick-graphic/utils/stick_vector_to_pixels.js.map +0 -1
- package/x/nubs/stick-graphic/utils/transform.d.ts +0 -2
- package/x/nubs/stick-graphic/utils/transform.js +0 -7
- package/x/nubs/stick-graphic/utils/transform.js.map +0 -1
- package/x/nubs/stick-graphic/view.d.ts +0 -3
- package/x/nubs/stick-graphic/view.js +0 -30
- package/x/nubs/stick-graphic/view.js.map +0 -1
- package/x/nubs/virtual-gamepad/styles.css.js.map +0 -1
- package/x/nubs/virtual-gamepad/utils/gamepad-inputs.js.map +0 -1
- package/x/nubs/virtual-gamepad/utils/prevent-default-touch-shenanigans.js.map +0 -1
- package/x/nubs/virtual-gamepad/utils/touch-tracking.js.map +0 -1
- package/x/nubs/virtual-gamepad/view.d.ts +0 -2
- package/x/nubs/virtual-gamepad/view.js.map +0 -1
- /package/s/nubs/{virtual-gamepad → vpad}/utils/gamepad-inputs.ts +0 -0
- /package/s/nubs/{virtual-gamepad → vpad}/utils/prevent-default-touch-shenanigans.ts +0 -0
- /package/s/nubs/{virtual-gamepad → vpad}/utils/touch-tracking.ts +0 -0
- /package/x/core/{controllers → devices}/types.js +0 -0
- /package/x/{nubs/virtual-gamepad/styles.css.d.ts → deck/components/deck-bindings/style.css.d.ts} +0 -0
- /package/x/{core/deck → deck}/parts/local-storage-kv.d.ts +0 -0
- /package/x/{nubs/stick-graphic/styles.d.ts → demo/ui/theater/styles.css.d.ts} +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/gamepad-inputs.d.ts +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/gamepad-inputs.js +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/prevent-default-touch-shenanigans.d.ts +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/prevent-default-touch-shenanigans.js +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/touch-tracking.d.ts +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/touch-tracking.js +0 -0
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import {Vec2} from "@benev/math"
|
|
3
|
-
|
|
4
|
-
export function make_pointer_listeners({
|
|
5
|
-
set_vector,
|
|
6
|
-
set_pointer_position,
|
|
7
|
-
}: {
|
|
8
|
-
set_vector: (vector: Vec2) => void
|
|
9
|
-
set_pointer_position: (position: Vec2) => void
|
|
10
|
-
}) {
|
|
11
|
-
|
|
12
|
-
let pointer_id: number | undefined
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
pointerdown: {
|
|
16
|
-
handleEvent: (event: PointerEvent) => {
|
|
17
|
-
event.preventDefault()
|
|
18
|
-
|
|
19
|
-
const element = event.currentTarget as HTMLElement
|
|
20
|
-
|
|
21
|
-
if (pointer_id)
|
|
22
|
-
element.releasePointerCapture(pointer_id)
|
|
23
|
-
|
|
24
|
-
pointer_id = event.pointerId
|
|
25
|
-
element.setPointerCapture(pointer_id)
|
|
26
|
-
set_pointer_position(Vec2.new(event.clientX, event.clientY))
|
|
27
|
-
set_vector(Vec2.zero())
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
pointermove: {
|
|
32
|
-
passive: false,
|
|
33
|
-
handleEvent: (event: PointerEvent) => {
|
|
34
|
-
event.preventDefault()
|
|
35
|
-
|
|
36
|
-
if (event.pointerId === pointer_id)
|
|
37
|
-
set_pointer_position(Vec2.new(event.clientX, event.clientY))
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
pointerup: {
|
|
42
|
-
handleEvent: (event: PointerEvent) => {
|
|
43
|
-
event.preventDefault()
|
|
44
|
-
pointer_id = undefined
|
|
45
|
-
set_vector(Vec2.zero())
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
package/s/nubs/stick/view.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import {html} from "lit"
|
|
3
|
-
import {view} from "@e280/sly"
|
|
4
|
-
import {Vec2} from "@benev/math"
|
|
5
|
-
|
|
6
|
-
import {styles} from "./styles.js"
|
|
7
|
-
import {Basis} from "../stick-graphic/types/basis.js"
|
|
8
|
-
import {NubStickGraphic} from "../stick-graphic/view.js"
|
|
9
|
-
import {StickController} from "../../core/controllers/standard/stick.js"
|
|
10
|
-
import {make_pointer_listeners} from "./utils/make_pointer_listeners.js"
|
|
11
|
-
import {calculate_new_vector_from_pointer_position} from "./utils/calculate_new_vector_from_pointer_position.js"
|
|
12
|
-
|
|
13
|
-
export const NubStick = view(use => (stick: StickController) => {
|
|
14
|
-
use.name("nub-stick")
|
|
15
|
-
use.styles(styles)
|
|
16
|
-
|
|
17
|
-
let basis: Basis | undefined = undefined
|
|
18
|
-
const updateBasis = (b: Basis) => basis = b
|
|
19
|
-
|
|
20
|
-
const listeners = use.once(() => make_pointer_listeners({
|
|
21
|
-
set_vector: vector => stick.vector.value = vector,
|
|
22
|
-
set_pointer_position: position => {
|
|
23
|
-
if (basis)
|
|
24
|
-
stick.vector.value = calculate_new_vector_from_pointer_position(
|
|
25
|
-
basis,
|
|
26
|
-
position,
|
|
27
|
-
)
|
|
28
|
-
},
|
|
29
|
-
}))
|
|
30
|
-
|
|
31
|
-
use.mount(() => {
|
|
32
|
-
stick.vector.set(Vec2.zero())
|
|
33
|
-
return () => stick.vector.set(Vec2.zero())
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
return html`
|
|
37
|
-
<div
|
|
38
|
-
class=container
|
|
39
|
-
.vector="${stick.vector}"
|
|
40
|
-
@pointerdown="${listeners.pointerdown}"
|
|
41
|
-
@pointermove="${listeners.pointermove}"
|
|
42
|
-
@pointerup="${listeners.pointerup}"
|
|
43
|
-
>
|
|
44
|
-
${NubStickGraphic
|
|
45
|
-
.attr("part", "graphic")
|
|
46
|
-
.props(stick.vector.get(), updateBasis)}
|
|
47
|
-
</div>
|
|
48
|
-
`
|
|
49
|
-
})
|
|
50
|
-
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import {css} from "lit"
|
|
3
|
-
export const styles = css`
|
|
4
|
-
|
|
5
|
-
:host {
|
|
6
|
-
display: block;
|
|
7
|
-
width: 8em;
|
|
8
|
-
height: 8em;
|
|
9
|
-
--size: var(--nub-stick-size, 66%);
|
|
10
|
-
--background: var(--nub-stick-background, black);
|
|
11
|
-
--color: var(--nub-stick-color, white);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
[part="base"] {
|
|
15
|
-
position: relative;
|
|
16
|
-
aspect-ratio: 1/1;
|
|
17
|
-
width: 100%;
|
|
18
|
-
height: 100%;
|
|
19
|
-
background: var(--background);
|
|
20
|
-
border-radius: 100%;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
[part="over"], [part="under"] {
|
|
24
|
-
position: absolute;
|
|
25
|
-
inset: 0;
|
|
26
|
-
width: var(--size);
|
|
27
|
-
height: var(--size);
|
|
28
|
-
border-radius: 100%;
|
|
29
|
-
margin: auto;
|
|
30
|
-
pointer-events: none;
|
|
31
|
-
background: var(--color);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
[part="under"] {
|
|
35
|
-
opacity: 0.5;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
`
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import {Basis} from "../types/basis.js"
|
|
3
|
-
|
|
4
|
-
export function calculate_basis(
|
|
5
|
-
base: HTMLElement,
|
|
6
|
-
over: HTMLElement,
|
|
7
|
-
): Basis {
|
|
8
|
-
|
|
9
|
-
const rect = base.getBoundingClientRect()
|
|
10
|
-
|
|
11
|
-
const half_base = (rect.width / 2)
|
|
12
|
-
const quarter_stick = (over.getBoundingClientRect().width / 4)
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
rect,
|
|
16
|
-
radius: half_base - quarter_stick,
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import {html} from "lit"
|
|
3
|
-
import {view} from "@e280/sly"
|
|
4
|
-
import {Vec2} from "@benev/math"
|
|
5
|
-
|
|
6
|
-
import {styles} from "./styles.js"
|
|
7
|
-
import {Basis} from "./types/basis.js"
|
|
8
|
-
import {transform} from "./utils/transform.js"
|
|
9
|
-
import {calculate_basis} from "./utils/calculate_basis.js"
|
|
10
|
-
import {stick_vector_to_pixels} from "./utils/stick_vector_to_pixels.js"
|
|
11
|
-
|
|
12
|
-
export const NubStickGraphic = view(use => (
|
|
13
|
-
vector: Vec2,
|
|
14
|
-
updateBasis: (basis: Basis) => void,
|
|
15
|
-
) => {
|
|
16
|
-
|
|
17
|
-
use.name("nub-stick-graphic")
|
|
18
|
-
use.styles(styles)
|
|
19
|
-
|
|
20
|
-
const basis = use.signal<Basis | null>(null)
|
|
21
|
-
|
|
22
|
-
use.rendered.then(() => {
|
|
23
|
-
const base = use.shadow.querySelector<HTMLElement>(`[part="base"]`)
|
|
24
|
-
const over = use.shadow.querySelector<HTMLElement>(`[part="over"]`)
|
|
25
|
-
if (base && over) {
|
|
26
|
-
const newBasis = calculate_basis(base, over)
|
|
27
|
-
basis.value = newBasis
|
|
28
|
-
updateBasis(newBasis)
|
|
29
|
-
}
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
const pixels = stick_vector_to_pixels(basis.value?.radius, vector)
|
|
33
|
-
const over_style = transform(pixels)
|
|
34
|
-
const under_style = transform(pixels.clone().half())
|
|
35
|
-
|
|
36
|
-
return html`
|
|
37
|
-
<div part=base>
|
|
38
|
-
<div part=under style="${under_style}"></div>
|
|
39
|
-
<div part=over style="${over_style}"></div>
|
|
40
|
-
</div>
|
|
41
|
-
`
|
|
42
|
-
})
|
|
43
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../../../s/core/controllers/controller.ts"],"names":[],"mappings":"AAGA,MAAM,OAAgB,UAAU;CAE/B"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SetG } from "@e280/stz";
|
|
2
|
-
import { Controller } from "../controller.js";
|
|
3
|
-
export declare class GroupController extends Controller {
|
|
4
|
-
controllers: SetG<Controller>;
|
|
5
|
-
constructor(...controllers: Controller[]);
|
|
6
|
-
takeSamples(): import("../types.js").Sample[];
|
|
7
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SetG } from "@e280/stz";
|
|
2
|
-
import { Controller } from "../controller.js";
|
|
3
|
-
export class GroupController extends Controller {
|
|
4
|
-
controllers = new SetG();
|
|
5
|
-
constructor(...controllers) {
|
|
6
|
-
super();
|
|
7
|
-
this.controllers.adds(...controllers);
|
|
8
|
-
}
|
|
9
|
-
takeSamples() {
|
|
10
|
-
return [...this.controllers].flatMap(controller => controller.takeSamples());
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=group.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"group.js","sourceRoot":"","sources":["../../../../s/core/controllers/infra/group.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAA;AAE3C,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAC9C,WAAW,GAAG,IAAI,IAAI,EAAc,CAAA;IAEpC,YAAY,GAAG,WAAyB;QACvC,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAA;IACtC,CAAC;IAED,WAAW;QACV,OAAO,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAA;IAC7E,CAAC;CACD"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Controller } from "../controller.js";
|
|
2
|
-
import { Sample } from "../types.js";
|
|
3
|
-
export declare class SamplerController extends Controller {
|
|
4
|
-
#private;
|
|
5
|
-
on: import("@e280/stz").Sub<Sample>;
|
|
6
|
-
setSample(code: string, value: number): this;
|
|
7
|
-
takeSamples(): Sample[];
|
|
8
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { sub } from "@e280/stz";
|
|
2
|
-
import { Controller } from "../controller.js";
|
|
3
|
-
export class SamplerController extends Controller {
|
|
4
|
-
on = sub();
|
|
5
|
-
#map = new Map();
|
|
6
|
-
setSample(code, value) {
|
|
7
|
-
this.#map.set(code, value);
|
|
8
|
-
this.on.pub(code, value);
|
|
9
|
-
return this;
|
|
10
|
-
}
|
|
11
|
-
takeSamples() {
|
|
12
|
-
const samples = [...this.#map];
|
|
13
|
-
this.#map.clear();
|
|
14
|
-
return samples;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=sampler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sampler.js","sourceRoot":"","sources":["../../../../s/core/controllers/infra/sampler.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,WAAW,CAAA;AAC7B,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAA;AAG3C,MAAM,OAAO,iBAAkB,SAAQ,UAAU;IAChD,EAAE,GAAG,GAAG,EAAU,CAAA;IAClB,IAAI,GAAc,IAAI,GAAG,EAAE,CAAA;IAE3B,SAAS,CAAC,IAAY,EAAE,KAAa;QACpC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QAC1B,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,OAAO,IAAI,CAAA;IACZ,CAAC;IAED,WAAW;QACV,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAA;QAC9B,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAA;QACjB,OAAO,OAAO,CAAA;IACf,CAAC;CACD"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Pad } from "../../../utils/gamepads.js";
|
|
2
|
-
import { SamplerController } from "../infra/sampler.js";
|
|
3
|
-
export declare class GamepadController extends SamplerController {
|
|
4
|
-
#private;
|
|
5
|
-
pad: Pad;
|
|
6
|
-
constructor(pad: Pad);
|
|
7
|
-
get gamepad(): Gamepad;
|
|
8
|
-
takeSamples(): import("../types.js").Sample[];
|
|
9
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { tmax } from "../../../utils/quick-math.js";
|
|
2
|
-
import { splitAxis } from "../../../utils/split-axis.js";
|
|
3
|
-
import { SamplerController } from "../infra/sampler.js";
|
|
4
|
-
const gamepadButtonCodes = [
|
|
5
|
-
"gamepad.a",
|
|
6
|
-
"gamepad.b",
|
|
7
|
-
"gamepad.x",
|
|
8
|
-
"gamepad.y",
|
|
9
|
-
"gamepad.bumper.left",
|
|
10
|
-
"gamepad.bumper.right",
|
|
11
|
-
"gamepad.trigger.left",
|
|
12
|
-
"gamepad.trigger.right",
|
|
13
|
-
"gamepad.alpha",
|
|
14
|
-
"gamepad.beta",
|
|
15
|
-
"gamepad.stick.left.click",
|
|
16
|
-
"gamepad.stick.right.click",
|
|
17
|
-
"gamepad.up",
|
|
18
|
-
"gamepad.down",
|
|
19
|
-
"gamepad.left",
|
|
20
|
-
"gamepad.right",
|
|
21
|
-
"gamepad.gamma",
|
|
22
|
-
];
|
|
23
|
-
export class GamepadController extends SamplerController {
|
|
24
|
-
pad;
|
|
25
|
-
constructor(pad) {
|
|
26
|
-
super();
|
|
27
|
-
this.pad = pad;
|
|
28
|
-
}
|
|
29
|
-
get gamepad() {
|
|
30
|
-
return this.pad.gamepad;
|
|
31
|
-
}
|
|
32
|
-
takeSamples() {
|
|
33
|
-
const { gamepad } = this.pad;
|
|
34
|
-
this.#pollButtons(gamepad);
|
|
35
|
-
this.#pollSticks(gamepad);
|
|
36
|
-
return super.takeSamples();
|
|
37
|
-
}
|
|
38
|
-
#pollButtons(gamepad) {
|
|
39
|
-
let anyButtonValue = 0;
|
|
40
|
-
const recordAny = (value) => {
|
|
41
|
-
anyButtonValue = tmax([anyButtonValue, value]);
|
|
42
|
-
};
|
|
43
|
-
for (const [index, code] of gamepadButtonCodes.entries()) {
|
|
44
|
-
const value = gamepad.buttons.at(index)?.value ?? 0;
|
|
45
|
-
recordAny(value);
|
|
46
|
-
this.setSample(code, value);
|
|
47
|
-
}
|
|
48
|
-
this.setSample("gamepad.any", anyButtonValue);
|
|
49
|
-
}
|
|
50
|
-
#pollSticks(gamepad) {
|
|
51
|
-
const [leftY, leftX, rightY, rightX] = gamepad.axes;
|
|
52
|
-
const [leftUp, leftDown] = splitAxis(leftX);
|
|
53
|
-
const [leftLeft, leftRight] = splitAxis(leftY);
|
|
54
|
-
this.setSample("gamepad.stick.left.up", leftUp);
|
|
55
|
-
this.setSample("gamepad.stick.left.down", leftDown);
|
|
56
|
-
this.setSample("gamepad.stick.left.left", leftLeft);
|
|
57
|
-
this.setSample("gamepad.stick.left.right", leftRight);
|
|
58
|
-
const [rightUp, rightDown] = splitAxis(rightX);
|
|
59
|
-
const [rightLeft, rightRight] = splitAxis(rightY);
|
|
60
|
-
this.setSample("gamepad.stick.right.up", rightUp);
|
|
61
|
-
this.setSample("gamepad.stick.right.down", rightDown);
|
|
62
|
-
this.setSample("gamepad.stick.right.left", rightLeft);
|
|
63
|
-
this.setSample("gamepad.stick.right.right", rightRight);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=gamepad.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gamepad.js","sourceRoot":"","sources":["../../../../s/core/controllers/standard/gamepad.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,IAAI,EAAC,MAAM,8BAA8B,CAAA;AACjD,OAAO,EAAC,SAAS,EAAC,MAAM,8BAA8B,CAAA;AACtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAA;AAErD,MAAM,kBAAkB,GAAG;IAC1B,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,qBAAqB;IACrB,sBAAsB;IACtB,sBAAsB;IACtB,uBAAuB;IACvB,eAAe;IACf,cAAc;IACd,0BAA0B;IAC1B,2BAA2B;IAC3B,YAAY;IACZ,cAAc;IACd,cAAc;IACd,eAAe;IACf,eAAe;CACf,CAAA;AAED,MAAM,OAAO,iBAAkB,SAAQ,iBAAiB;IACpC;IAAnB,YAAmB,GAAQ;QAC1B,KAAK,EAAE,CAAA;QADW,QAAG,GAAH,GAAG,CAAK;IAE3B,CAA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C,IAAI,CAAC,SAAS,CAAC,yBAAyB,EAAE,QAAQ,CAAC,CAAA;QACnD,IAAI,CAAC,SAAS,CAAC,yBAAyB,EAAE,QAAQ,CAAC,CAAA;QACnD,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAA;QAErD,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,CAAA;QAC9C,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,CAAA;QACjD,IAAI,CAAC,SAAS,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAA;QACjD,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAA;QACrD,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAA;QACrD,IAAI,CAAC,SAAS,CAAC,2BAA2B,EAAE,UAAU,CAAC,CAAA;IACxD,CAAC;CACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../s/core/controllers/standard/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,sBAAsB,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Sample } from "../types.js";
|
|
2
|
-
import { Controller } from "../controller.js";
|
|
3
|
-
export declare class KeyboardController extends Controller {
|
|
4
|
-
#private;
|
|
5
|
-
on: import("@e280/stz").Sub<Sample>;
|
|
6
|
-
dispose: () => void;
|
|
7
|
-
constructor(target?: EventTarget);
|
|
8
|
-
takeSamples(): Sample[];
|
|
9
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { coalesce, ev, sub } from "@e280/stz";
|
|
2
|
-
import { Controller } from "../controller.js";
|
|
3
|
-
export class KeyboardController extends Controller {
|
|
4
|
-
on = sub();
|
|
5
|
-
dispose;
|
|
6
|
-
#held = new Set();
|
|
7
|
-
constructor(target = window) {
|
|
8
|
-
super();
|
|
9
|
-
const down = (code) => {
|
|
10
|
-
this.#held.add(code);
|
|
11
|
-
this.on.pub(code, 1);
|
|
12
|
-
};
|
|
13
|
-
const up = (code) => {
|
|
14
|
-
this.#held.delete(code);
|
|
15
|
-
this.on.pub(code, 0);
|
|
16
|
-
};
|
|
17
|
-
this.dispose = coalesce(ev(target, {
|
|
18
|
-
keydown: (event) => {
|
|
19
|
-
if (event.repeat)
|
|
20
|
-
return;
|
|
21
|
-
down(event.code);
|
|
22
|
-
},
|
|
23
|
-
keyup: (event) => {
|
|
24
|
-
up(event.code);
|
|
25
|
-
},
|
|
26
|
-
}), ev(window, {
|
|
27
|
-
blur: () => {
|
|
28
|
-
for (const code of this.#held)
|
|
29
|
-
this.on.pub(code, 0);
|
|
30
|
-
this.#held.clear();
|
|
31
|
-
},
|
|
32
|
-
}));
|
|
33
|
-
}
|
|
34
|
-
takeSamples() {
|
|
35
|
-
return [...this.#held]
|
|
36
|
-
.map(code => [code, 1]);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=keyboard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard.js","sourceRoot":"","sources":["../../../../s/core/controllers/standard/keyboard.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAC,MAAM,WAAW,CAAA;AAE3C,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAA;AAE3C,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IACjD,EAAE,GAAG,GAAG,EAAU,CAAA;IAClB,OAAO,CAAY;IACnB,KAAK,GAAG,IAAI,GAAG,EAAU,CAAA;IAEzB,YAAY,SAAsB,MAAM;QACvC,KAAK,EAAE,CAAA;QAEP,MAAM,IAAI,GAAG,CAA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|
|
3
|
-
export declare class PointerController extends SamplerController {
|
|
4
|
-
client: Vec2;
|
|
5
|
-
movement: Vec2;
|
|
6
|
-
dispose: () => void;
|
|
7
|
-
constructor(target?: EventTarget);
|
|
8
|
-
static buttonCode(event: PointerEvent): string;
|
|
9
|
-
static wheelCodes(event: WheelEvent): [string, number][];
|
|
10
|
-
takeSamples(): import("../types.js").Sample[];
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pointer.js","sourceRoot":"","sources":["../../../../s/core/controllers/standard/pointer.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,EAAE,EAAC,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,8BAA8B,CAAA;AACtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAA;AAErD,MAAM,OAAO,iBAAkB,SAAQ,iBAAiB;IACvD,MAAM,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACvB,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACzB,OAAO,CAAY;IAEnB,YAAY,SAAsB,MAAM;QACvC,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,MAAM,EAAE;YACzB,WAAW,EAAE,CAAC,KAAmB,EAAE,EAAE;gBACpC,MAAM,IAAI,GAAG,iBAAiB,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;gBAChD,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;YACxB,CAAC;YAED,SAAS,EAAE,CAAC,KAAmB,EAAE,EAAE;gBAClC,MAAM,IAAI,GAAG,iBAAiB,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;gBAChD,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;YACxB,C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;gBACd,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,kBAAkB;gBAC5D,KAAK,CAAC,MAAM;aACZ,CAAC,CAAA;QAEH,OAAO,SAAS,CAAA;IACjB,CAAC;IAED,WAAW;QACV,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC5B,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;QAClC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;QAE/B,IAAI,CAAC,EAAE,CAAC;YACP,IAAI,CAAC,IAAI,CAAC;gBACT,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAA;;gBAErD,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;QACrD,CAAC;QACD,IAAI,CAAC,EAAE,CAAC;YACP,IAAI,CAAC,IAAI,CAAC;gBACT,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;;gBAE/C,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;QACrD,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QACxB,OAAO,KAAK,CAAC,WAAW,EAAE,CAAA;IAC3B,CAAC;CACD"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Vec2 } from "@benev/math";
|
|
2
|
-
import { Disposable } from "@e280/stz";
|
|
3
|
-
import { SamplerController } from "../infra/sampler.js";
|
|
4
|
-
export declare class StickController extends SamplerController implements Disposable {
|
|
5
|
-
channel: string;
|
|
6
|
-
vector: import("@e280/strata").Signal<Vec2>;
|
|
7
|
-
dispose: () => void;
|
|
8
|
-
constructor(channel?: string);
|
|
9
|
-
breakdown(): {
|
|
10
|
-
up: number;
|
|
11
|
-
down: number;
|
|
12
|
-
left: number;
|
|
13
|
-
right: number;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Vec2 } from "@benev/math";
|
|
2
|
-
import { signal } from "@e280/strata";
|
|
3
|
-
import { SamplerController } from "../infra/sampler.js";
|
|
4
|
-
import { splitAxis } from "../../../utils/split-axis.js";
|
|
5
|
-
export class StickController extends SamplerController {
|
|
6
|
-
channel;
|
|
7
|
-
vector = signal(Vec2.zero());
|
|
8
|
-
dispose;
|
|
9
|
-
constructor(channel = "stick") {
|
|
10
|
-
super();
|
|
11
|
-
this.channel = channel;
|
|
12
|
-
this.dispose = this.vector.on(() => {
|
|
13
|
-
const { up, down, left, right } = this.breakdown();
|
|
14
|
-
this.setSample(`${channel}.up`, up);
|
|
15
|
-
this.setSample(`${channel}.down`, down);
|
|
16
|
-
this.setSample(`${channel}.left`, left);
|
|
17
|
-
this.setSample(`${channel}.right`, right);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
breakdown() {
|
|
21
|
-
const { x, y } = this.vector.get();
|
|
22
|
-
const [down, up] = splitAxis(y);
|
|
23
|
-
const [left, right] = splitAxis(x);
|
|
24
|
-
return { up, down, left, right };
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=stick.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stick.js","sourceRoot":"","sources":["../../../../s/core/controllers/standard/stick.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAChC,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAA;AAEnC,OAAO,EAAC,iBAAiB,EAAC,MAAM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
|
|
3
|
-
export declare class VirtualGamepadController extends SamplerController {
|
|
4
|
-
stickLeft: StickController;
|
|
5
|
-
stickRight: StickController;
|
|
6
|
-
takeSamples(): import("../types.js").Sample[];
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-gamepad.js","sourceRoot":"","sources":["../../../../s/core/controllers/standard/virtual-gamepad.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,eAAe,EAAC,MAAM,YAAY,CAAA;AAC1C,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAA;AAErD,MAAM,OAAO,wBAAyB,SAAQ,iBAAiB;IAC9D,SAAS,GAAG,IAAI,eAAe,EAAE,CAAA;IACjC,UAAU,GAAG,IAAI,eAAe,EAAE,CAAA;IAElC,WAAW;QACV,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,CAAA;QACvC,IAAI,CAAC,SAAS,CAAC,uBAAuB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAA;QAChD,IAAI,CAAC,SAAS,CAAC,yBAAyB,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;QACpD,IAAI,CAAC,SAAS,CAAC,yBAAyB,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;QACpD,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;QAEtD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAA;QACzC,IAAI,CAAC,SAAS,CAAC,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;QAClD,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;QACtD,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;QACtD,IAAI,CAAC,SAAS,CAAC,2BAA2B,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;QAExD,OAAO,KAAK,CAAC,WAAW,EAAE,CAAA;IAC3B,CAAC;CACD"}
|
package/x/core/deck/deck.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Kv } from "@e280/kv";
|
|
2
|
-
import { Hub } from "../hub/hub.js";
|
|
3
|
-
import { HubFriendlyBindings } from "../hub/types.js";
|
|
4
|
-
import { BindingsDepot } from "./parts/bindings-depot.js";
|
|
5
|
-
export declare class Deck<B extends HubFriendlyBindings> {
|
|
6
|
-
readonly hub: Hub<B>;
|
|
7
|
-
private bindingsDepot;
|
|
8
|
-
static load<B extends HubFriendlyBindings>(options: {
|
|
9
|
-
portCount: number;
|
|
10
|
-
kv: Kv;
|
|
11
|
-
bindings: B;
|
|
12
|
-
}): Promise<Deck<B>>;
|
|
13
|
-
constructor(hub: Hub<B>, bindingsDepot: BindingsDepot<B>);
|
|
14
|
-
reload(): Promise<void>;
|
|
15
|
-
save(index: number, bindings: B): Promise<void>;
|
|
16
|
-
}
|
package/x/core/deck/deck.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Hub } from "../hub/hub.js";
|
|
2
|
-
import { Port } from "../port/port.js";
|
|
3
|
-
import { BindingsDepot } from "./parts/bindings-depot.js";
|
|
4
|
-
export class Deck {
|
|
5
|
-
hub;
|
|
6
|
-
bindingsDepot;
|
|
7
|
-
static async load(options) {
|
|
8
|
-
const bindingsDepot = new BindingsDepot(options.portCount, options.kv);
|
|
9
|
-
const bindings = await bindingsDepot.loadAll();
|
|
10
|
-
const ports = bindings.map(b => new Port(b));
|
|
11
|
-
const hub = new Hub(ports);
|
|
12
|
-
return new this(hub, bindingsDepot);
|
|
13
|
-
}
|
|
14
|
-
constructor(hub, bindingsDepot) {
|
|
15
|
-
this.hub = hub;
|
|
16
|
-
this.bindingsDepot = bindingsDepot;
|
|
17
|
-
}
|
|
18
|
-
async reload() {
|
|
19
|
-
const allBindings = await this.bindingsDepot.loadAll();
|
|
20
|
-
for (const [index, bindings] of allBindings.entries()) {
|
|
21
|
-
const port = this.hub.ports.at(index);
|
|
22
|
-
port.bindings = bindings;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
async save(index, bindings) {
|
|
26
|
-
const port = this.hub.ports.at(index);
|
|
27
|
-
port.bindings = bindings;
|
|
28
|
-
await this.bindingsDepot.save(index, bindings);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=deck.js.map
|
package/x/core/deck/deck.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deck.js","sourceRoot":"","sources":["../../../s/core/deck/deck.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,GAAG,EAAC,MAAM,eAAe,CAAA;AACjC,OAAO,EAAC,IAAI,EAAC,MAAM,iBAAiB,CAAA;AAEpC,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAA;AAEvD,MAAM,OAAO,IAAI;IAcC;IACR;IAdT,MAAM,CAAC,KAAK,CAAC,IAAI,CAAgC,OAI/C;QACD,MAAM,aAAa,GAAG,IAAI,aAAa,CAAI,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;QACzE,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,OAAO,EAAE,CAAA;QAC9C,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;QAC5C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAI,KAAK,CAAC,CAAA;QAC7B,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;IACpC,CAAC;IAED,YACiB,GAAW,EACnB,aAA+B;QADvB,QAAG,GAAH,GAAG,CAAQ;QACnB,kBAAa,GAAb,aAAa,CAAkB;IACrC,CAAC;IAEJ,KAAK,CAAC,MAAM;QACX,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAA;QACtD,KAAK,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,CAAC;YACvD,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAE,CAAA;YACtC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACzB,CAAC;IACF,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAa,EAAE,QAAW;QACpC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAE,CAAA;QACtC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAC/C,CAAC;CACD"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Kv } from "@e280/kv";
|
|
2
|
-
import { HubFriendlyBindings } from "../../hub/types.js";
|
|
3
|
-
export declare class BindingsDepot<B extends HubFriendlyBindings> {
|
|
4
|
-
#private;
|
|
5
|
-
readonly portCount: number;
|
|
6
|
-
constructor(portCount: number, rootKv: Kv);
|
|
7
|
-
loadAll(): Promise<B[]>;
|
|
8
|
-
save(index: number, bindings: B): Promise<void>;
|
|
9
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { deep, range } from "@e280/stz";
|
|
2
|
-
export class BindingsDepot {
|
|
3
|
-
portCount;
|
|
4
|
-
#kv;
|
|
5
|
-
constructor(portCount, rootKv) {
|
|
6
|
-
this.portCount = portCount;
|
|
7
|
-
this.#kv = rootKv.scope("bindings");
|
|
8
|
-
}
|
|
9
|
-
async loadAll() {
|
|
10
|
-
const indices = range(this.portCount);
|
|
11
|
-
const keys = indices.map(k => k.toString());
|
|
12
|
-
return (await this.#kv.gets(...keys))
|
|
13
|
-
.map(bindings => bindings ?? deep.clone(bindings));
|
|
14
|
-
}
|
|
15
|
-
async save(index, bindings) {
|
|
16
|
-
await this.#kv.set(index.toString(), bindings);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=bindings-depot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bindings-depot.js","sourceRoot":"","sources":["../../../../s/core/deck/parts/bindings-depot.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,WAAW,CAAA;AAGrC,MAAM,OAAO,aAAa;IAGG;IAF5B,GAAG,CAAO;IAEV,YAA4B,SAAiB,EAAE,MAAU;QAA7B,cAAS,GAAT,SAAS,CAAQ;QAC5C,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;IACpC,CAAC;IAED,KAAK,CAAC,OAAO;QACZ,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QACrC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;QAC3C,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;aACnC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAQ,CAAA;IAC3D,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAa,EAAE,QAAW;QACpC,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAA;IAC/C,CAAC;CACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-storage-kv.js","sourceRoot":"","sources":["../../../../s/core/deck/parts/local-storage-kv.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,EAAE,EAAE,aAAa,EAAC,MAAM,UAAU,CAAA;AAE1C,MAAM,UAAU,cAAc;IAC7B,OAAO,IAAI,EAAE,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAA;AACtD,CAAC"}
|