@benev/tact 0.1.0-3 → 0.1.0-4
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 +111 -103
- package/package.json +7 -7
- package/s/core/bindings/action.ts +14 -4
- package/s/core/bindings/parts/defaults.ts +3 -1
- package/s/core/bindings/parts/lens-algo.ts +17 -13
- package/s/core/bindings/resolver.ts +12 -12
- package/s/core/bindings/sample-map.ts +25 -0
- package/s/core/bindings/types.ts +3 -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 +15 -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/deck.ts +77 -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/deck/views/deck-overlay/component.ts +48 -0
- package/s/deck/views/deck-overlay/style.css.ts +112 -0
- package/s/deck/views/framework.ts +14 -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 +6 -12
- package/s/demo/main.css +30 -2
- package/s/demo/ui/tact-demo/component.ts +13 -0
- package/s/demo/ui/tact-demo/style.css.ts +4 -0
- package/s/demo/ui/theater/styles.css.ts +57 -0
- package/s/demo/ui/theater/view.ts +53 -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 +16 -6
- 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 +1 -0
- package/s/utils/circular-clamp.ts +15 -0
- package/s/utils/dispensers.ts +20 -0
- package/s/utils/split-axis.ts +10 -2
- 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 +3 -1
- package/x/core/bindings/parts/defaults.js.map +1 -1
- package/x/core/bindings/parts/lens-algo.js +14 -7
- package/x/core/bindings/parts/lens-algo.js.map +1 -1
- 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 +3 -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 +14 -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/deck.d.ts +35 -0
- package/x/deck/deck.js +50 -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/deck/views/deck-overlay/component.d.ts +2 -0
- package/x/deck/views/deck-overlay/component.js +40 -0
- package/x/deck/views/deck-overlay/component.js.map +1 -0
- package/x/deck/views/deck-overlay/style.css.js +109 -0
- package/x/deck/views/deck-overlay/style.css.js.map +1 -0
- package/x/deck/views/framework.d.ts +3 -0
- package/x/deck/views/framework.js +8 -0
- package/x/deck/views/framework.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 +4 -10
- package/x/demo/main.bundle.js.map +1 -1
- package/x/demo/main.bundle.min.js +315 -54
- package/x/demo/main.bundle.min.js.map +4 -4
- package/x/demo/main.css +30 -2
- package/x/demo/ui/tact-demo/component.d.ts +4 -0
- package/x/demo/ui/tact-demo/component.js +12 -0
- package/x/demo/ui/tact-demo/component.js.map +1 -0
- package/x/demo/ui/tact-demo/style.css.d.ts +2 -0
- package/x/demo/ui/tact-demo/style.css.js +3 -0
- package/x/demo/ui/tact-demo/style.css.js.map +1 -0
- package/x/demo/ui/theater/styles.css.js +56 -0
- package/x/demo/ui/theater/styles.css.js.map +1 -0
- package/x/demo/ui/theater/view.d.ts +2 -0
- package/x/demo/ui/theater/view.js +42 -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 +1 -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 +47 -8
- package/x/index.html.js +16 -6
- 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/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/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/{core/deck → deck}/parts/local-storage-kv.d.ts +0 -0
- /package/x/{nubs/virtual-gamepad/styles.css.d.ts → deck/views/deck-overlay/style.css.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}/styles.css.js +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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Vec2 } from "@benev/math";
|
|
2
|
+
import { Sample } from "../types.js";
|
|
3
|
+
import { Device } from "../device.js";
|
|
4
|
+
export declare class StickDevice extends Device {
|
|
5
|
+
channel: string;
|
|
6
|
+
$vector: import("@e280/strata").SignalFn<Vec2>;
|
|
7
|
+
$breakdown: import("@e280/strata").DerivedFn<{
|
|
8
|
+
up: number;
|
|
9
|
+
down: number;
|
|
10
|
+
left: number;
|
|
11
|
+
right: number;
|
|
12
|
+
}>;
|
|
13
|
+
constructor(channel?: string);
|
|
14
|
+
samples(): Sample[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Vec2 } from "@benev/math";
|
|
2
|
+
import { derived, signal } from "@e280/strata";
|
|
3
|
+
import { Device } from "../device.js";
|
|
4
|
+
import { splitVector } from "../../../utils/split-axis.js";
|
|
5
|
+
export class StickDevice extends Device {
|
|
6
|
+
channel;
|
|
7
|
+
$vector = signal(Vec2.zero());
|
|
8
|
+
$breakdown = derived(() => splitVector(this.$vector.get()));
|
|
9
|
+
constructor(channel = "stick") {
|
|
10
|
+
super();
|
|
11
|
+
this.channel = channel;
|
|
12
|
+
}
|
|
13
|
+
samples() {
|
|
14
|
+
const { channel } = this;
|
|
15
|
+
const { up, down, left, right } = this.$breakdown.get();
|
|
16
|
+
return [
|
|
17
|
+
[`${channel}.up`, up],
|
|
18
|
+
[`${channel}.down`, down],
|
|
19
|
+
[`${channel}.left`, left],
|
|
20
|
+
[`${channel}.right`, right],
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=stick.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stick.js","sourceRoot":"","sources":["../../../../s/core/devices/standard/stick.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAChC,OAAO,EAAC,OAAO,EAAE,MAAM,EAAC,MAAM,cAAc,CAAA;AAE5C,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAA;AACnC,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AAExD,MAAM,OAAO,WAAY,SAAQ,MAAM;IAInB;IAHnB,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;IAC7B,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;IAE3D,YAAmB,UAAU,OAAO;QACnC,KAAK,EAAE,CAAA;QADW,YAAO,GAAP,OAAO,CAAU;IAEpC,CAAC;IAED,OAAO;QACN,MAAM,EAAC,OAAO,EAAC,GAAG,IAAI,CAAA;QACtB,MAAM,EAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAA;QACrD,OAAO;YACN,CAAC,GAAG,OAAO,KAAK,EAAE,EAAE,CAAC;YACrB,CAAC,GAAG,OAAO,OAAO,EAAE,IAAI,CAAC;YACzB,CAAC,GAAG,OAAO,OAAO,EAAE,IAAI,CAAC;YACzB,CAAC,GAAG,OAAO,QAAQ,EAAE,KAAK,CAAC;SACf,CAAA;IACd,CAAC;CACD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StickDevice } from "./stick.js";
|
|
2
|
+
import { SamplerDevice } from "../infra/sampler.js";
|
|
3
|
+
export declare class VpadDevice extends SamplerDevice {
|
|
4
|
+
stickLeft: StickDevice;
|
|
5
|
+
stickRight: StickDevice;
|
|
6
|
+
samples(): Generator<import("../types.js").Sample, void, unknown>;
|
|
7
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export class
|
|
4
|
-
stickLeft = new
|
|
5
|
-
stickRight = new
|
|
6
|
-
|
|
7
|
-
const left = this.stickLeft
|
|
1
|
+
import { StickDevice } from "./stick.js";
|
|
2
|
+
import { SamplerDevice } from "../infra/sampler.js";
|
|
3
|
+
export class VpadDevice extends SamplerDevice {
|
|
4
|
+
stickLeft = new StickDevice();
|
|
5
|
+
stickRight = new StickDevice();
|
|
6
|
+
samples() {
|
|
7
|
+
const left = this.stickLeft.$breakdown();
|
|
8
8
|
this.setSample("gamepad.stick.left.up", left.up);
|
|
9
9
|
this.setSample("gamepad.stick.left.down", left.down);
|
|
10
10
|
this.setSample("gamepad.stick.left.left", left.left);
|
|
11
11
|
this.setSample("gamepad.stick.left.right", left.right);
|
|
12
|
-
const right = this.stickRight
|
|
12
|
+
const right = this.stickRight.$breakdown();
|
|
13
13
|
this.setSample("gamepad.stick.right.up", right.up);
|
|
14
14
|
this.setSample("gamepad.stick.right.down", right.down);
|
|
15
15
|
this.setSample("gamepad.stick.right.left", right.left);
|
|
16
16
|
this.setSample("gamepad.stick.right.right", right.right);
|
|
17
|
-
return super.
|
|
17
|
+
return super.samples();
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
//# sourceMappingURL=
|
|
20
|
+
//# sourceMappingURL=vpad.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vpad.js","sourceRoot":"","sources":["../../../../s/core/devices/standard/vpad.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,YAAY,CAAA;AACtC,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAA;AAEjD,MAAM,OAAO,UAAW,SAAQ,aAAa;IAC5C,SAAS,GAAG,IAAI,WAAW,EAAE,CAAA;IAC7B,UAAU,GAAG,IAAI,WAAW,EAAE,CAAA;IAE9B,OAAO;QACN,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAA;QACxC,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,UAAU,EAAE,CAAA;QAC1C,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,OAAO,EAAE,CAAA;IACvB,CAAC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../s/core/
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../s/core/devices/types.ts"],"names":[],"mappings":""}
|
package/x/core/hub/hub.d.ts
CHANGED
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export declare class Hub<B extends
|
|
1
|
+
import { Port } from "./port.js";
|
|
2
|
+
import { Device } from "../devices/device.js";
|
|
3
|
+
import { Bindings } from "../bindings/types.js";
|
|
4
|
+
import { MetaBindings } from "./types.js";
|
|
5
|
+
export declare class Hub<B extends Bindings, MB extends MetaBindings = any> {
|
|
6
|
+
#private;
|
|
7
|
+
/** available ports that devices can be assigned to. */
|
|
6
8
|
readonly ports: Port<B>[];
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
|
|
9
|
+
/** special bindings for devices to shimmy between ports. */
|
|
10
|
+
metaBindings: MB;
|
|
11
|
+
/** event fires whenever a device changes ports. */
|
|
12
|
+
readonly on: import("@e280/stz").Sub<[]>;
|
|
13
|
+
metaPort: Port<MB>;
|
|
14
|
+
constructor(
|
|
15
|
+
/** available ports that devices can be assigned to. */
|
|
16
|
+
ports: Port<B>[],
|
|
17
|
+
/** special bindings for devices to shimmy between ports. */
|
|
18
|
+
metaBindings?: MB);
|
|
19
|
+
/** poll every device, providing actions for each port, and internally handling meta actions. */
|
|
20
|
+
poll(now?: number): Port<B>[];
|
|
17
21
|
portByIndex(index: number): Port<B>;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
|
|
22
|
+
portByDevice(device: Device): Port<B> | undefined;
|
|
23
|
+
/** move a player's device to the next or previous port */
|
|
24
|
+
shimmy(device: Device, indexDelta: 1 | -1): Port<B>;
|
|
25
|
+
reassign(device: Device, port?: Port<B>): void;
|
|
26
|
+
/** unplug a device */
|
|
27
|
+
unplug(device: Device): void;
|
|
28
|
+
/** plug a device into a port */
|
|
29
|
+
plug: (device: Device, port?: Port<B>) => () => void;
|
|
26
30
|
/** returns an unplugged port (otherwise the last one) */
|
|
27
31
|
getLonelyPort(): Port<B>;
|
|
28
32
|
}
|
package/x/core/hub/hub.js
CHANGED
|
@@ -1,43 +1,31 @@
|
|
|
1
|
-
import { SetG } from "@e280/stz";
|
|
2
1
|
import { Scalar } from "@benev/math";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { debounce, MapG, sub } from "@e280/stz";
|
|
3
|
+
import { Port } from "./port.js";
|
|
4
|
+
import { Connected } from "./parts/connected.js";
|
|
5
|
+
import { metaMode } from "./types.js";
|
|
6
|
+
import { makeMetaBindings } from "./meta-bindings.js";
|
|
5
7
|
export class Hub {
|
|
6
8
|
ports;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
metaBindings;
|
|
10
|
+
/** event fires whenever a device changes ports. */
|
|
11
|
+
on = sub();
|
|
12
|
+
/** all devices known to this hub */
|
|
13
|
+
#connected = new MapG();
|
|
14
|
+
metaPort;
|
|
15
|
+
constructor(
|
|
16
|
+
/** available ports that devices can be assigned to. */
|
|
17
|
+
ports,
|
|
18
|
+
/** special bindings for devices to shimmy between ports. */
|
|
19
|
+
metaBindings = makeMetaBindings()) {
|
|
11
20
|
this.ports = ports;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
*[Symbol.iterator]() {
|
|
17
|
-
yield* this.ports.values();
|
|
18
|
-
}
|
|
19
|
-
*entries() {
|
|
20
|
-
yield* this.ports.entries();
|
|
21
|
+
this.metaBindings = metaBindings;
|
|
22
|
+
this.metaPort = new Port(metaBindings);
|
|
21
23
|
}
|
|
22
|
-
/** poll
|
|
24
|
+
/** poll every device, providing actions for each port, and internally handling meta actions. */
|
|
23
25
|
poll(now = Date.now()) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const controller = this.controllerByPort(port);
|
|
28
|
-
if (controller)
|
|
29
|
-
this.shimmy(controller, delta);
|
|
30
|
-
};
|
|
31
|
-
if (actions[hubMode].shimmyNext.down)
|
|
32
|
-
fn(1);
|
|
33
|
-
if (actions[hubMode].shimmyPrevious.down)
|
|
34
|
-
fn(-1);
|
|
35
|
-
return actions;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
/** check if a port has a known switchboard controller assigned */
|
|
39
|
-
isPlugged(port) {
|
|
40
|
-
return !!this.controllerByPort(port);
|
|
26
|
+
this.#resolveMetaPort(now);
|
|
27
|
+
this.#actuateMetaActions(now);
|
|
28
|
+
return this.#resolvePorts(now);
|
|
41
29
|
}
|
|
42
30
|
portByIndex(index) {
|
|
43
31
|
const port = this.ports.at(index);
|
|
@@ -45,47 +33,69 @@ export class Hub {
|
|
|
45
33
|
throw new Error(`port ${index} not found`);
|
|
46
34
|
return port;
|
|
47
35
|
}
|
|
48
|
-
|
|
36
|
+
portByDevice(device) {
|
|
49
37
|
for (const port of this.ports) {
|
|
50
|
-
if (port.
|
|
38
|
+
if (port.devices.has(device))
|
|
51
39
|
return port;
|
|
52
40
|
}
|
|
53
41
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return controller;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
/** move a player's controller to the next or previous port */
|
|
61
|
-
shimmy(controller, indexDelta) {
|
|
62
|
-
const oldIndex = this.ports.findIndex(port => port.controllers.has(controller));
|
|
42
|
+
/** move a player's device to the next or previous port */
|
|
43
|
+
shimmy(device, indexDelta) {
|
|
44
|
+
const oldIndex = this.ports.findIndex(port => port.devices.has(device));
|
|
63
45
|
const maxIndex = Math.max(0, this.ports.length - 1);
|
|
64
46
|
const newIndex = Scalar.clamp(oldIndex + indexDelta, 0, maxIndex);
|
|
65
47
|
const port = this.portByIndex(newIndex);
|
|
66
|
-
this.
|
|
48
|
+
this.reassign(device, port);
|
|
67
49
|
return port;
|
|
68
50
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
this
|
|
73
|
-
port.controllers.add(controller);
|
|
74
|
-
return () => this.unplug(controller);
|
|
75
|
-
};
|
|
76
|
-
/** unplug a controller */
|
|
77
|
-
unplug(controller) {
|
|
78
|
-
this.ports.forEach(port => port.controllers.delete(controller));
|
|
79
|
-
this.controllers.delete(controller);
|
|
51
|
+
reassign(device, port = this.getLonelyPort()) {
|
|
52
|
+
this.ports.forEach(port => port.devices.delete(device));
|
|
53
|
+
port.devices.add(device);
|
|
54
|
+
this.#dispatchChange();
|
|
80
55
|
}
|
|
56
|
+
/** unplug a device */
|
|
57
|
+
unplug(device) {
|
|
58
|
+
this.ports.forEach(port => port.devices.delete(device));
|
|
59
|
+
this.#connected.delete(device);
|
|
60
|
+
this.#dispatchChange();
|
|
61
|
+
}
|
|
62
|
+
/** plug a device into a port */
|
|
63
|
+
plug = (device, port = this.getLonelyPort()) => {
|
|
64
|
+
this.unplug(device);
|
|
65
|
+
this.#connected.set(device, new Connected(device, this.metaBindings));
|
|
66
|
+
port.devices.add(device);
|
|
67
|
+
this.#dispatchChange();
|
|
68
|
+
return () => this.unplug(device);
|
|
69
|
+
};
|
|
81
70
|
/** returns an unplugged port (otherwise the last one) */
|
|
82
71
|
getLonelyPort() {
|
|
72
|
+
let smallest = this.ports.at(0);
|
|
83
73
|
for (const port of this.ports) {
|
|
84
|
-
if (
|
|
85
|
-
|
|
74
|
+
if (port.devices.size < smallest.devices.size)
|
|
75
|
+
smallest = port;
|
|
86
76
|
}
|
|
87
|
-
|
|
88
|
-
|
|
77
|
+
return smallest;
|
|
78
|
+
}
|
|
79
|
+
#dispatchChange = debounce(0, () => this.on.publish());
|
|
80
|
+
#resolveMetaPort(now) {
|
|
81
|
+
this.metaPort.devices.clear();
|
|
82
|
+
this.metaPort.devices.adds(...this.#connected.keys());
|
|
83
|
+
this.metaPort.resolve(now);
|
|
84
|
+
}
|
|
85
|
+
#actuateMetaActions(now) {
|
|
86
|
+
for (const connected of this.#connected.values()) {
|
|
87
|
+
const actions = connected.metaPort.resolve(now);
|
|
88
|
+
if (actions[metaMode].shimmyNext.down)
|
|
89
|
+
this.shimmy(connected.device, 1);
|
|
90
|
+
if (actions[metaMode].shimmyPrevious.down)
|
|
91
|
+
this.shimmy(connected.device, -1);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
#resolvePorts(now) {
|
|
95
|
+
return this.ports.map(port => {
|
|
96
|
+
port.resolve(now);
|
|
97
|
+
return port;
|
|
98
|
+
});
|
|
89
99
|
}
|
|
90
100
|
}
|
|
91
101
|
//# sourceMappingURL=hub.js.map
|
package/x/core/hub/hub.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hub.js","sourceRoot":"","sources":["../../../s/core/hub/hub.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"hub.js","sourceRoot":"","sources":["../../../s/core/hub/hub.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAA;AAClC,OAAO,EAAC,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAC,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAA;AAG9B,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAe,QAAQ,EAAC,MAAM,YAAY,CAAA;AACjD,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AAEnD,MAAM,OAAO,GAAG;IAaG;IAGT;IAdT,mDAAmD;IAC1C,EAAE,GAAG,GAAG,EAAE,CAAA;IAEnB,oCAAoC;IACpC,UAAU,GAAG,IAAI,IAAI,EAAqB,CAAA;IAE1C,QAAQ,CAAU;IAElB;IAEE,uDAAuD;IACvC,KAAgB;IAEhC,4DAA4D;IACrD,eAA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C,IAAI,CAAC,EAAE;YAC5B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YACjB,OAAO,IAAI,CAAA;QACZ,CAAC,CAAC,CAAA;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { metaMode } from "./types.js";
|
|
2
|
+
export const makeMetaBindings = () => ({
|
|
3
|
+
[metaMode]: {
|
|
4
|
+
revealOverlay: ["or",
|
|
5
|
+
"Backslash",
|
|
6
|
+
"gamepad.beta",
|
|
7
|
+
"gamepad.gamma",
|
|
8
|
+
],
|
|
9
|
+
shimmyNext: ["or",
|
|
10
|
+
"BracketRight",
|
|
11
|
+
["and", ["or", "gamepad.beta", "gamepad.gamma"], "gamepad.right"],
|
|
12
|
+
["and", ["or", "gamepad.beta", "gamepad.gamma"], "gamepad.bumper.right"],
|
|
13
|
+
],
|
|
14
|
+
shimmyPrevious: ["or",
|
|
15
|
+
"BracketLeft",
|
|
16
|
+
["and", ["or", "gamepad.beta", "gamepad.gamma"], "gamepad.left"],
|
|
17
|
+
["and", ["or", "gamepad.beta", "gamepad.gamma"], "gamepad.bumper.left"],
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=meta-bindings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta-bindings.js","sourceRoot":"","sources":["../../../s/core/hub/meta-bindings.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,QAAQ,EAAC,MAAM,YAAY,CAAA;AAEjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAiB,EAAE,CAAC,CAAC;IACpD,CAAC,QAAQ,CAAC,EAAE;QACX,aAAa,EAAE,CAAC,IAAI;YACnB,WAAW;YACX,cAAc;YACd,eAAe;SACf;QACD,UAAU,EAAE,CAAC,IAAI;YAChB,cAAc;YACd,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,eAAe,CAAC,EAAE,eAAe,CAAC;YACjE,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,eAAe,CAAC,EAAE,sBAAsB,CAAC;SACxE;QACD,cAAc,EAAE,CAAC,IAAI;YACpB,aAAa;YACb,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,eAAe,CAAC,EAAE,cAAc,CAAC;YAChE,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,eAAe,CAAC,EAAE,qBAAqB,CAAC;SACvE;KACD;CACD,CAAC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Port } from "../port.js";
|
|
2
|
+
import { MetaBindings } from "../types.js";
|
|
3
|
+
import { Device } from "../../devices/device.js";
|
|
4
|
+
export declare class Connected {
|
|
5
|
+
device: Device;
|
|
6
|
+
metaPort: Port<MetaBindings>;
|
|
7
|
+
constructor(device: Device, metaB?: {
|
|
8
|
+
meta: {
|
|
9
|
+
revealOverlay: import("../../index.js").Atom;
|
|
10
|
+
shimmyNext: import("../../index.js").Atom;
|
|
11
|
+
shimmyPrevious: import("../../index.js").Atom;
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Port } from "../port.js";
|
|
2
|
+
import { makeMetaBindings } from "../meta-bindings.js";
|
|
3
|
+
export class Connected {
|
|
4
|
+
device;
|
|
5
|
+
metaPort;
|
|
6
|
+
constructor(device, metaB = makeMetaBindings()) {
|
|
7
|
+
this.device = device;
|
|
8
|
+
this.metaPort = new Port(metaB);
|
|
9
|
+
this.metaPort.devices.add(device);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=connected.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connected.js","sourceRoot":"","sources":["../../../../s/core/hub/parts/connected.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,YAAY,CAAA;AAG/B,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAA;AAEpD,MAAM,OAAO,SAAS;IAGF;IAFnB,QAAQ,CAAoB;IAE5B,YAAmB,MAAc,EAAE,KAAK,GAAG,gBAAgB,EAAE;QAA1C,WAAM,GAAN,MAAM,CAAQ;QAChC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAA;QAC/B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IAClC,CAAC;CACD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SetG } from "@e280/stz";
|
|
2
|
+
import { Bindings } from "../bindings/types.js";
|
|
3
|
+
import { Resolver } from "../bindings/resolver.js";
|
|
4
|
+
export declare class Port<B extends Bindings> extends Resolver<B> {
|
|
5
|
+
#private;
|
|
6
|
+
readonly devices: SetG<import("../index.js").Device>;
|
|
7
|
+
readonly modes: SetG<keyof B>;
|
|
8
|
+
constructor(bindings: B);
|
|
9
|
+
resolve(now?: number): import("../bindings/types.js").Actions<B>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SetG } from "@e280/stz";
|
|
2
|
+
import { Resolver } from "../bindings/resolver.js";
|
|
3
|
+
import { SampleMap } from "../bindings/sample-map.js";
|
|
4
|
+
import { GroupDevice } from "../devices/infra/group.js";
|
|
5
|
+
export class Port extends Resolver {
|
|
6
|
+
#group = new GroupDevice();
|
|
7
|
+
devices = this.#group.devices;
|
|
8
|
+
modes = new SetG();
|
|
9
|
+
constructor(bindings) {
|
|
10
|
+
super(bindings);
|
|
11
|
+
// start with all modes enabled by default
|
|
12
|
+
this.modes.adds(...Object.keys(bindings));
|
|
13
|
+
}
|
|
14
|
+
resolve(now = Date.now()) {
|
|
15
|
+
const sampleMap = new SampleMap(this.#group.samples());
|
|
16
|
+
return super.resolve(now, this.modes, sampleMap);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=port.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"port.js","sourceRoot":"","sources":["../../../s/core/hub/port.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAA;AAE9B,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAA;AAChD,OAAO,EAAC,SAAS,EAAC,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAA;AAErD,MAAM,OAAO,IAAyB,SAAQ,QAAW;IACxD,MAAM,GAAG,IAAI,WAAW,EAAE,CAAA;IAEjB,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAA;IAC7B,KAAK,GAAG,IAAI,IAAI,EAAW,CAAA;IAEpC,YAAY,QAAW;QACtB,KAAK,CAAC,QAAQ,CAAC,CAAA;QAEf,0CAA0C;QAC1C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC1C,CAAC;IAED,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE;QACvB,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;QACtD,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;IACjD,CAAC;CACD"}
|
package/x/core/hub/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AsBindings, Atom
|
|
2
|
-
export declare const
|
|
3
|
-
export type
|
|
4
|
-
[
|
|
1
|
+
import { AsBindings, Atom } from "../bindings/types.js";
|
|
2
|
+
export declare const metaMode: "meta";
|
|
3
|
+
export type MetaBindings = AsBindings<{
|
|
4
|
+
[metaMode]: {
|
|
5
|
+
revealOverlay: Atom;
|
|
5
6
|
shimmyNext: Atom;
|
|
6
7
|
shimmyPrevious: Atom;
|
|
7
8
|
};
|
|
8
9
|
}>;
|
|
9
|
-
export type HubFriendlyBindings = Bindings & HubBindings;
|
package/x/core/hub/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const metaMode = "meta";
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
package/x/core/hub/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../s/core/hub/types.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../s/core/hub/types.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAe,CAAA"}
|
package/x/core/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export * from "./bindings/action.js";
|
|
2
|
+
export * from "./bindings/resolver.js";
|
|
3
|
+
export * from "./bindings/sample-map.js";
|
|
2
4
|
export * from "./bindings/types.js";
|
|
3
|
-
export *
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
10
|
-
export * from "./deck/parts/local-storage-kv.js";
|
|
11
|
-
export * from "./deck/deck.js";
|
|
12
|
-
export * from "./hub/auto-gamepads.js";
|
|
13
|
-
export * from "./hub/bindings.js";
|
|
5
|
+
export * from "./devices/infra/group.js";
|
|
6
|
+
export * from "./devices/infra/sampler.js";
|
|
7
|
+
export * from "./devices/standard/index.js";
|
|
8
|
+
export * as devices from "./devices/standard/index.js";
|
|
9
|
+
export * from "./devices/auto-gamepads.js";
|
|
10
|
+
export * from "./devices/device.js";
|
|
11
|
+
export * from "./devices/types.js";
|
|
14
12
|
export * from "./hub/hub.js";
|
|
15
|
-
export * from "./
|
|
13
|
+
export * from "./hub/meta-bindings.js";
|
|
14
|
+
export * from "./hub/port.js";
|
|
15
|
+
export * from "./hub/types.js";
|
package/x/core/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export * from "./bindings/action.js";
|
|
2
|
+
export * from "./bindings/resolver.js";
|
|
3
|
+
export * from "./bindings/sample-map.js";
|
|
2
4
|
export * from "./bindings/types.js";
|
|
3
|
-
export *
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
10
|
-
export * from "./deck/parts/local-storage-kv.js";
|
|
11
|
-
export * from "./deck/deck.js";
|
|
12
|
-
export * from "./hub/auto-gamepads.js";
|
|
13
|
-
export * from "./hub/bindings.js";
|
|
5
|
+
export * from "./devices/infra/group.js";
|
|
6
|
+
export * from "./devices/infra/sampler.js";
|
|
7
|
+
export * from "./devices/standard/index.js";
|
|
8
|
+
export * as devices from "./devices/standard/index.js";
|
|
9
|
+
export * from "./devices/auto-gamepads.js";
|
|
10
|
+
export * from "./devices/device.js";
|
|
11
|
+
export * from "./devices/types.js";
|
|
14
12
|
export * from "./hub/hub.js";
|
|
15
|
-
export * from "./
|
|
13
|
+
export * from "./hub/meta-bindings.js";
|
|
14
|
+
export * from "./hub/port.js";
|
|
15
|
+
export * from "./hub/types.js";
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
package/x/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../s/core/index.ts"],"names":[],"mappings":"AACA,cAAc,sBAAsB,CAAA;AACpC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../s/core/index.ts"],"names":[],"mappings":"AACA,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,qBAAqB,CAAA;AAEnC,cAAc,0BAA0B,CAAA;AACxC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAA;AACtD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAElC,cAAc,cAAc,CAAA;AAC5B,cAAc,wBAAwB,CAAA;AACtC,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hub } from "../hub/hub.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { Device } from "../devices/device.js";
|
|
3
|
+
import { Resolver } from "../bindings/resolver.js";
|
|
4
|
+
import { SamplerDevice } from "../devices/infra/sampler.js";
|
|
5
5
|
export declare class TestTime {
|
|
6
6
|
frame: number;
|
|
7
7
|
get now(): number;
|
|
@@ -12,10 +12,16 @@ export declare function testBindings(): {
|
|
|
12
12
|
shoot: string;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
export declare function
|
|
15
|
+
export declare function testPlug<C extends Device>(hub: Hub<any>, device: C): C;
|
|
16
16
|
export declare function testSetupAlpha(): {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
device: SamplerDevice;
|
|
18
|
+
resolver: Resolver<{
|
|
19
|
+
basic: {
|
|
20
|
+
jump: string;
|
|
21
|
+
shoot: string;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
resolve: () => import("../bindings/types.js").Actions<{
|
|
19
25
|
basic: {
|
|
20
26
|
jump: string;
|
|
21
27
|
shoot: string;
|
|
@@ -25,14 +31,10 @@ export declare function testSetupAlpha(): {
|
|
|
25
31
|
};
|
|
26
32
|
export declare function testSetupBravo(): {
|
|
27
33
|
hub: Hub<{
|
|
28
|
-
hub: {
|
|
29
|
-
shimmyNext: import("../bindings/types.js").Atom;
|
|
30
|
-
shimmyPrevious: import("../bindings/types.js").Atom;
|
|
31
|
-
};
|
|
32
34
|
basic: {
|
|
33
35
|
jump: string;
|
|
34
36
|
shoot: string;
|
|
35
37
|
};
|
|
36
|
-
}>;
|
|
38
|
+
}, any>;
|
|
37
39
|
time: TestTime;
|
|
38
40
|
};
|