@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
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Hub } from "../hub/hub.js";
|
|
2
|
-
import { Port } from "../
|
|
2
|
+
import { Port } from "../hub/port.js";
|
|
3
3
|
import { asBindings } from "../bindings/types.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { Resolver } from "../bindings/resolver.js";
|
|
5
|
+
import { SampleMap } from "../bindings/sample-map.js";
|
|
6
|
+
import { SamplerDevice } from "../devices/infra/sampler.js";
|
|
6
7
|
export class TestTime {
|
|
7
8
|
frame = 0;
|
|
8
9
|
get now() {
|
|
@@ -17,23 +18,23 @@ export function testBindings() {
|
|
|
17
18
|
},
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
|
-
export function
|
|
21
|
-
|
|
22
|
-
return
|
|
21
|
+
export function testPlug(hub, device) {
|
|
22
|
+
hub.plug(device);
|
|
23
|
+
return device;
|
|
23
24
|
}
|
|
24
25
|
export function testSetupAlpha() {
|
|
25
26
|
const time = new TestTime();
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return {
|
|
27
|
+
const device = new SamplerDevice();
|
|
28
|
+
const resolver = new Resolver(testBindings());
|
|
29
|
+
const modes = new Set(Object.keys(resolver.bindings));
|
|
30
|
+
const resolve = () => resolver.resolve(time.now, modes, new SampleMap(device.samples()));
|
|
31
|
+
return { device, resolver, resolve, time };
|
|
31
32
|
}
|
|
32
33
|
export function testSetupBravo() {
|
|
33
34
|
const time = new TestTime();
|
|
34
35
|
const port = () => {
|
|
35
|
-
const port = new Port(
|
|
36
|
-
port.modes.adds(
|
|
36
|
+
const port = new Port(testBindings());
|
|
37
|
+
port.modes.adds("basic");
|
|
37
38
|
return port;
|
|
38
39
|
};
|
|
39
40
|
const hub = new Hub([port(), port(), port(), port()]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../s/core/testing/testing.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,eAAe,CAAA;AACjC,OAAO,EAAC,IAAI,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../s/core/testing/testing.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,eAAe,CAAA;AACjC,OAAO,EAAC,IAAI,EAAC,MAAM,gBAAgB,CAAA;AAEnC,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAA;AAChD,OAAO,EAAC,SAAS,EAAC,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAA;AAEzD,MAAM,OAAO,QAAQ;IACpB,KAAK,GAAG,CAAC,CAAA;IAET,IAAI,GAAG;QACN,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAA;IACpC,CAAC;CACD;AAED,MAAM,UAAU,YAAY;IAC3B,OAAO,UAAU,CAAC;QACjB,KAAK,EAAE;YACN,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,qBAAqB;SAC5B;KACD,CAAC,CAAA;AACH,CAAC;AAED,MAAM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+
import { Db } from "./parts/db.js";
|
|
3
|
+
import { Hub } from "../core/hub/hub.js";
|
|
4
|
+
import { Bindings } from "../core/bindings/types.js";
|
|
5
|
+
import { MetaBindings } from "../core/hub/types.js";
|
|
6
|
+
import { DeviceSkins } from "./parts/device-skins/device-skin.js";
|
|
7
|
+
import { OverlayVisibility } from "./parts/overlay-visibility.js";
|
|
8
|
+
import { PrimaryDevice } from "../core/devices/standard/primary.js";
|
|
9
|
+
export type DeckOptions<B extends Bindings, MB extends MetaBindings = any> = {
|
|
10
|
+
kv: Kv;
|
|
11
|
+
bindings: B;
|
|
12
|
+
portCount: number;
|
|
13
|
+
metaBindings?: MB;
|
|
14
|
+
};
|
|
15
|
+
export declare class Deck<B extends Bindings, MB extends MetaBindings = any> {
|
|
16
|
+
hub: Hub<B, MB>;
|
|
17
|
+
db: Db;
|
|
18
|
+
static load<B extends Bindings, MB extends MetaBindings = any>(options: DeckOptions<B, MB>): Promise<Deck<B, any>>;
|
|
19
|
+
dispose: {
|
|
20
|
+
(): void;
|
|
21
|
+
schedule(fn: () => void): any;
|
|
22
|
+
};
|
|
23
|
+
deviceSkins: DeviceSkins;
|
|
24
|
+
overlayVisibility: OverlayVisibility;
|
|
25
|
+
primaryDevice: PrimaryDevice;
|
|
26
|
+
views: {
|
|
27
|
+
DeckOverlay: import("@e280/sly").View<[]>;
|
|
28
|
+
};
|
|
29
|
+
components: {
|
|
30
|
+
DeckOverlay: import("@e280/sly").ComponentClass<import("@e280/stz").Constructor<import("@e280/sly").BaseElement>, []>;
|
|
31
|
+
};
|
|
32
|
+
registerComponents(): void;
|
|
33
|
+
constructor(hub: Hub<B, MB>, db: Db);
|
|
34
|
+
get catalog(): import("./index.js").Catalog;
|
|
35
|
+
}
|
package/x/deck/deck.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { disposer, ob, range } from "@e280/stz";
|
|
2
|
+
import { Db } from "./parts/db.js";
|
|
3
|
+
import { Hub } from "../core/hub/hub.js";
|
|
4
|
+
import { Port } from "../core/hub/port.js";
|
|
5
|
+
import { mergeBindings } from "./parts/merge-bindings.js";
|
|
6
|
+
import { metaMode } from "../core/hub/types.js";
|
|
7
|
+
import { DeckOverlay } from "./views/deck-overlay/component.js";
|
|
8
|
+
import { makeMetaBindings } from "../core/hub/meta-bindings.js";
|
|
9
|
+
import { DeviceSkins } from "./parts/device-skins/device-skin.js";
|
|
10
|
+
import { OverlayVisibility } from "./parts/overlay-visibility.js";
|
|
11
|
+
import { PrimaryDevice } from "../core/devices/standard/primary.js";
|
|
12
|
+
import { dom } from "@e280/sly";
|
|
13
|
+
export class Deck {
|
|
14
|
+
hub;
|
|
15
|
+
db;
|
|
16
|
+
static async load(options) {
|
|
17
|
+
const db = await Db.load(options.kv.store("catalog"));
|
|
18
|
+
const ports = range(options.portCount)
|
|
19
|
+
.map(index => db.$catalog().getProfileForPort(index))
|
|
20
|
+
.map(profile => mergeBindings(options.bindings, profile?.bindings))
|
|
21
|
+
.map(bindings => new Port(bindings));
|
|
22
|
+
const hub = new Hub(ports, db.$catalog().metaBindings
|
|
23
|
+
?? options.metaBindings
|
|
24
|
+
?? makeMetaBindings());
|
|
25
|
+
return new this(hub, db);
|
|
26
|
+
}
|
|
27
|
+
dispose = disposer();
|
|
28
|
+
deviceSkins = new DeviceSkins();
|
|
29
|
+
overlayVisibility;
|
|
30
|
+
primaryDevice = new PrimaryDevice();
|
|
31
|
+
views = ob({ DeckOverlay }).map(fn => fn(this));
|
|
32
|
+
components = ob(this.views).map(v => v.component().props(_c => []));
|
|
33
|
+
registerComponents() {
|
|
34
|
+
dom.register(this.components);
|
|
35
|
+
}
|
|
36
|
+
constructor(hub, db) {
|
|
37
|
+
this.hub = hub;
|
|
38
|
+
this.db = db;
|
|
39
|
+
this.overlayVisibility = new OverlayVisibility(hub, this.deviceSkins);
|
|
40
|
+
// meta reveal overlay
|
|
41
|
+
this.dispose.schedule(hub.metaPort.actions[metaMode].revealOverlay.on(action => {
|
|
42
|
+
if (action.pressed)
|
|
43
|
+
this.overlayVisibility.bump();
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
get catalog() {
|
|
47
|
+
return this.db.$catalog();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=deck.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deck.js","sourceRoot":"","sources":["../../s/deck/deck.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAC,MAAM,WAAW,CAAA;AAE7C,OAAO,EAAC,EAAE,EAAC,MAAM,eAAe,CAAA;AAChC,OAAO,EAAC,GAAG,EAAC,MAAM,oBAAoB,CAAA;AACtC,OAAO,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAA;AAExC,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAe,QAAQ,EAAC,MAAM,sBAAsB,CAAA;AAE3D,OAAO,EAAC,WAAW,EAAC,MAAM,mCAAmC,CAAA;AAC7D,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAC,WAAW,EAAC,MAAM,qCAAqC,CAAA;AAC/D,OAAO,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAC,aAAa,EAAC,MAAM,qCAAqC,CAAA;AACjE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAS/B,MAAM,OAAO,IAAI;IAgCP;IACA;IAhCT,MAAM,CAAC,KAAK,CAAC,IAAI,CAAoD,OAA2B;QAC/F,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAA;QAErD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;aACpC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC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C,OAAO,CAAC,QAAQ,CACpB,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YACxD,IAAI,MAAM,CAAC,OAAO;gBACjB,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAA;QAC/B,CAAC,CAAC,CACF,CAAA;IACF,CAAC;IAED,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAA;IAC1B,CAAC;CACD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./parts/device-skins/device-icons.js";
|
|
2
|
+
export * from "./parts/device-skins/device-skin.js";
|
|
3
|
+
export * from "./parts/catalog.js";
|
|
4
|
+
export * from "./parts/db.js";
|
|
5
|
+
export * from "./parts/local-storage-kv.js";
|
|
6
|
+
export * from "./parts/merge-bindings.js";
|
|
7
|
+
export * from "./parts/overlay-visibility.js";
|
|
8
|
+
export * from "./views/deck-overlay/component.js";
|
|
9
|
+
export * from "./views/deck-overlay/style.css.js";
|
|
10
|
+
export * from "./deck.js";
|
package/x/deck/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./parts/device-skins/device-icons.js";
|
|
2
|
+
export * from "./parts/device-skins/device-skin.js";
|
|
3
|
+
export * from "./parts/catalog.js";
|
|
4
|
+
export * from "./parts/db.js";
|
|
5
|
+
export * from "./parts/local-storage-kv.js";
|
|
6
|
+
export * from "./parts/merge-bindings.js";
|
|
7
|
+
export * from "./parts/overlay-visibility.js";
|
|
8
|
+
export * from "./views/deck-overlay/component.js";
|
|
9
|
+
export * from "./views/deck-overlay/style.css.js";
|
|
10
|
+
export * from "./deck.js";
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../s/deck/index.ts"],"names":[],"mappings":"AACA,cAAc,sCAAsC,CAAA;AACpD,cAAc,qCAAqC,CAAA;AACnD,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,+BAA+B,CAAA;AAE7C,cAAc,mCAAmC,CAAA;AACjD,cAAc,mCAAmC,CAAA;AAEjD,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MapG } from "@e280/stz";
|
|
2
|
+
import { MetaBindings } from "../../core/hub/types.js";
|
|
3
|
+
import { Bindings } from "../../core/bindings/types.js";
|
|
4
|
+
export type Profile = {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
bindings: Bindings;
|
|
8
|
+
};
|
|
9
|
+
export type CatalogData = {
|
|
10
|
+
profiles: Profile[];
|
|
11
|
+
portProfiles: (string | null)[];
|
|
12
|
+
metaBindings: MetaBindings | null;
|
|
13
|
+
};
|
|
14
|
+
export declare class Catalog {
|
|
15
|
+
profiles: MapG<string, Profile>;
|
|
16
|
+
portProfiles: (string | null)[];
|
|
17
|
+
metaBindings: MetaBindings | null;
|
|
18
|
+
constructor(data?: CatalogData);
|
|
19
|
+
toJSON(): CatalogData;
|
|
20
|
+
clone(): Catalog;
|
|
21
|
+
getProfile(profileId: string): Profile | undefined;
|
|
22
|
+
getProfileForPort(portIndex: number): Profile | undefined;
|
|
23
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { deep, MapG } from "@e280/stz";
|
|
2
|
+
export class Catalog {
|
|
3
|
+
profiles = new MapG();
|
|
4
|
+
portProfiles = [];
|
|
5
|
+
metaBindings = null;
|
|
6
|
+
constructor(data) {
|
|
7
|
+
if (data) {
|
|
8
|
+
for (const profile of data.profiles)
|
|
9
|
+
this.profiles.set(profile.id, profile);
|
|
10
|
+
this.portProfiles = data.portProfiles
|
|
11
|
+
.map(id => id && (this.profiles.has(id) ? id : null));
|
|
12
|
+
this.metaBindings = data.metaBindings;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
toJSON() {
|
|
16
|
+
return deep.clone({
|
|
17
|
+
profiles: [...this.profiles.values()],
|
|
18
|
+
portProfiles: this.portProfiles,
|
|
19
|
+
metaBindings: this.metaBindings,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
clone() {
|
|
23
|
+
return new Catalog(this.toJSON());
|
|
24
|
+
}
|
|
25
|
+
getProfile(profileId) {
|
|
26
|
+
return this.profiles.get(profileId);
|
|
27
|
+
}
|
|
28
|
+
getProfileForPort(portIndex) {
|
|
29
|
+
const profileId = this.portProfiles.at(portIndex);
|
|
30
|
+
return profileId
|
|
31
|
+
? this.getProfile(profileId)
|
|
32
|
+
: undefined;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../../s/deck/parts/catalog.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AAgBpC,MAAM,OAAO,OAAO;IACnB,QAAQ,GAAG,IAAI,IAAI,EAAmB,CAAA;IACtC,YAAY,GAAsB,EAAE,CAAA;IACpC,YAAY,GAAwB,IAAI,CAAA;IAExC,YAAY,IAAkB;QAC7B,IAAI,IAAI,EAAE,CAAC;YACV,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ;gBAClC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;YAEvC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY;iBACnC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA,EAAE,CAAC,CAAC,CAAA,IAAI,CAAC,CAAC,CAAA;YAEpD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAA;QACtC,CAAC;IACF,CAAC;IAED,MAAM;QACL,OAAO,IAAI,CAAC,KAAK,CAAC;YACjB,QAAQ,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YACrC,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,YAAY,EAAE,IAAI,CAAC,YAAY;SAC/B,CAAC,CAAA;IACH,CAAC;IAED,KAAK;QACJ,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IAClC,CAAC;IAED,UAAU,CAAC,SAAiB;QAC3B,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IACpC,CAAC;IAED,iBAAiB,CAAC,SAAiB;QAClC,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,SAAS,CAAC,CAAA;QACjD,OAAO,SAAS;YACf,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;YAC5B,CAAC,CAAC,SAAS,CAAA;IACb,CAAC;CACD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SignalFn } from "@e280/strata";
|
|
2
|
+
import { Store } from "@e280/kv";
|
|
3
|
+
import { Bindings } from "../../core/bindings/types.js";
|
|
4
|
+
import { Catalog, CatalogData, Profile } from "./catalog.js";
|
|
5
|
+
export declare class Db {
|
|
6
|
+
#private;
|
|
7
|
+
private store;
|
|
8
|
+
$catalog: SignalFn<Catalog>;
|
|
9
|
+
static load(store: Store<CatalogData>): Promise<Db>;
|
|
10
|
+
dispose: {
|
|
11
|
+
(): void;
|
|
12
|
+
schedule(fn: () => void): any;
|
|
13
|
+
};
|
|
14
|
+
constructor(store: Store<CatalogData>, $catalog: SignalFn<Catalog>);
|
|
15
|
+
reload(): Promise<void>;
|
|
16
|
+
save(catalog: Catalog): Promise<void>;
|
|
17
|
+
createProfile(label: string, bindings: Bindings): Promise<Profile>;
|
|
18
|
+
deleteProfile(id: string): Promise<void>;
|
|
19
|
+
assignPortToProfile(index: number, profileId: string | null): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { disposer, Hex } from "@e280/stz";
|
|
2
|
+
import { signal } from "@e280/strata";
|
|
3
|
+
import { StorageDriver } from "@e280/kv";
|
|
4
|
+
import { Catalog } from "./catalog.js";
|
|
5
|
+
export class Db {
|
|
6
|
+
store;
|
|
7
|
+
$catalog;
|
|
8
|
+
static async load(store) {
|
|
9
|
+
const $catalog = signal(new Catalog(await store.get()));
|
|
10
|
+
return new this(store, $catalog);
|
|
11
|
+
}
|
|
12
|
+
dispose = disposer();
|
|
13
|
+
constructor(store, $catalog) {
|
|
14
|
+
this.store = store;
|
|
15
|
+
this.$catalog = $catalog;
|
|
16
|
+
this.dispose.schedule(StorageDriver.onStorageEvent(async () => this.reload()));
|
|
17
|
+
}
|
|
18
|
+
async reload() {
|
|
19
|
+
const fresh = new Catalog(await this.store.get());
|
|
20
|
+
await this.$catalog.set(fresh);
|
|
21
|
+
}
|
|
22
|
+
async save(catalog) {
|
|
23
|
+
await this.store.set(catalog.toJSON());
|
|
24
|
+
await this.$catalog(catalog);
|
|
25
|
+
}
|
|
26
|
+
async #mutateAndSave(fn) {
|
|
27
|
+
const catalog = this.$catalog().clone();
|
|
28
|
+
const result = fn(catalog);
|
|
29
|
+
await this.store.set(catalog.toJSON());
|
|
30
|
+
await this.$catalog(catalog);
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
async createProfile(label, bindings) {
|
|
34
|
+
return this.#mutateAndSave(catalog => {
|
|
35
|
+
const id = Hex.random();
|
|
36
|
+
const profile = { id, label, bindings };
|
|
37
|
+
catalog.profiles.set(id, profile);
|
|
38
|
+
return profile;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
async deleteProfile(id) {
|
|
42
|
+
return this.#mutateAndSave(catalog => {
|
|
43
|
+
catalog.profiles.delete(id);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
async assignPortToProfile(index, profileId) {
|
|
47
|
+
return this.#mutateAndSave(catalog => {
|
|
48
|
+
catalog.portProfiles[index] = profileId;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=db.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.js","sourceRoot":"","sources":["../../../s/deck/parts/db.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAE,GAAG,EAAC,MAAM,WAAW,CAAA;AACvC,OAAO,EAAC,MAAM,EAAW,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAC,aAAa,EAAQ,MAAM,UAAU,CAAA;AAG7C,OAAO,EAAC,OAAO,EAAuB,MAAM,cAAc,CAAA;AAE1D,MAAM,OAAO,EAAE;IASJ;IACD;IATT,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAyB;QAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;QACvD,OAAO,IAAI,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IACjC,CAAC;IAED,OAAO,GAAG,QAAQ,EAAE,CAAA;IAEpB,YACU,KAAyB,EAC1B,QAA2B;QAD1B,UAAK,GAAL,KAAK,CAAoB;QAC1B,aAAQ,GAAR,QAAQ,CAAmB;QAGnC,IAAI,CAAC,OAAO,CAAC,QAAQ,CACpB,aAAa,CAAC,cAAc,CAAC,KAAK,IAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CACtD,CAAA;IACF,CAAC;IAED,KAAK,CAAC,MAAM;QACX,MAAM,KAAK,GAAG,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAA;QACjD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AAc,CAAC,OAAO,CAAC,EAAE;YACpC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,SAAS,CAAA;QACxC,CAAC,CAAC,CAAA;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Content } from "@e280/sly";
|
|
2
|
+
import { Constructor } from "@e280/stz";
|
|
3
|
+
import { Device } from "../../../core/devices/device.js";
|
|
4
|
+
export type DeviceIconEntry = [DeviceClass: Constructor<Device>, icon: Content];
|
|
5
|
+
export declare class DeviceIcons {
|
|
6
|
+
#private;
|
|
7
|
+
fallback: Content;
|
|
8
|
+
constructor(entries?: DeviceIconEntry[]);
|
|
9
|
+
get(DeviceClass: Constructor<Device>): Content;
|
|
10
|
+
add(...entries: DeviceIconEntry[]): this;
|
|
11
|
+
clear(): this;
|
|
12
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { VpadDevice } from "../../../core/devices/standard/vpad.js";
|
|
2
|
+
import { PrimaryDevice } from "../../../core/devices/standard/primary.js";
|
|
3
|
+
import { GamepadDevice } from "../../../core/devices/standard/gamepad.js";
|
|
4
|
+
export class DeviceIcons {
|
|
5
|
+
fallback = "❔";
|
|
6
|
+
#map = new Map();
|
|
7
|
+
constructor(entries = [
|
|
8
|
+
[PrimaryDevice, "💻"],
|
|
9
|
+
[GamepadDevice, "🎮"],
|
|
10
|
+
[VpadDevice, "📱"],
|
|
11
|
+
]) {
|
|
12
|
+
this.add(...entries);
|
|
13
|
+
}
|
|
14
|
+
get(DeviceClass) {
|
|
15
|
+
return this.#map.get(DeviceClass) ?? this.fallback;
|
|
16
|
+
}
|
|
17
|
+
add(...entries) {
|
|
18
|
+
for (const [dc, icon] of entries)
|
|
19
|
+
this.#map.set(dc, icon);
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
clear() {
|
|
23
|
+
this.#map.clear();
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=device-icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-icons.js","sourceRoot":"","sources":["../../../../s/deck/parts/device-skins/device-icons.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,MAAM,wCAAwC,CAAA;AACjE,OAAO,EAAC,aAAa,EAAC,MAAM,2CAA2C,CAAA;AACvE,OAAO,EAAC,aAAa,EAAC,MAAM,2CAA2C,CAAA;AAIvE,MAAM,OAAO,WAAW;IACvB,QAAQ,GAAY,GAAG,CAAA;IACvB,IAAI,GAAG,IAAI,GAAG,EAAgC,CAAA;IAE9C,YAAY,UAA6B;QACvC,CAAC,aAAa,EAAE,IAAI,CAAC;QACrB,CAAC,aAAa,EAAE,IAAI,CAAC;QACrB,CAAC,UAAU,EAAE,IAAI,CAAC;KAClB;QACD,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAA;IACrB,CAAC;IAED,GAAG,CAAC,WAAgC;QACnC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAA;IACnD,CAAC;IAED,GAAG,CAAC,GAAG,OAA0B;QAChC,KAAK,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,OAAO;YAC/B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;QACxB,OAAO,IAAI,CAAA;IACZ,CAAC;IAED,KAAK;QACJ,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAA;QACjB,OAAO,IAAI,CAAA;IACZ,CAAC;CACD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Content } from "@e280/sly";
|
|
2
|
+
import { DeviceIcons } from "./device-icons.js";
|
|
3
|
+
import { Device } from "../../../core/devices/device.js";
|
|
4
|
+
export declare class DeviceSkin {
|
|
5
|
+
icon: Content;
|
|
6
|
+
label: string;
|
|
7
|
+
color: string;
|
|
8
|
+
constructor(icon: Content, label: string, color: string);
|
|
9
|
+
}
|
|
10
|
+
export declare class DeviceSkins {
|
|
11
|
+
#private;
|
|
12
|
+
icons: DeviceIcons;
|
|
13
|
+
get(device: Device): DeviceSkin;
|
|
14
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Hex, WeakMapG } from "@e280/stz";
|
|
2
|
+
import { DeviceIcons } from "./device-icons.js";
|
|
3
|
+
import { ColorDispenser } from "../../../utils/dispensers.js";
|
|
4
|
+
export class DeviceSkin {
|
|
5
|
+
icon;
|
|
6
|
+
label;
|
|
7
|
+
color;
|
|
8
|
+
constructor(icon, label, color) {
|
|
9
|
+
this.icon = icon;
|
|
10
|
+
this.label = label;
|
|
11
|
+
this.color = color;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export class DeviceSkins {
|
|
15
|
+
icons = new DeviceIcons();
|
|
16
|
+
#map = new WeakMapG();
|
|
17
|
+
#colors = new ColorDispenser();
|
|
18
|
+
get(device) {
|
|
19
|
+
return this.#map.guarantee(device, () => new DeviceSkin(this.icons.get(device.constructor), Hex.random(4), this.#colors.takeFirst()));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=device-skin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-skin.js","sourceRoot":"","sources":["../../../../s/deck/parts/device-skins/device-skin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,GAAG,EAAE,QAAQ,EAAC,MAAM,WAAW,CAAA;AACvC,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAA;AAE7C,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAA;AAE3D,MAAM,OAAO,UAAU;IAEd;IACA;IACA;IAHR,YACQ,IAAa,EACb,KAAa,EACb,KAAa;QAFb,SAAI,GAAJ,IAAI,CAAS;QACb,UAAK,GAAL,KAAK,CAAQ;QACb,UAAK,GAAL,KAAK,CAAQ;IAClB,CAAC;CACJ;AAED,MAAM,OAAO,WAAW;IACvB,KAAK,GAAG,IAAI,WAAW,EAAE,CAAA;IACzB,IAAI,GAAG,IAAI,QAAQ,EAAsB,CAAA;IACzC,OAAO,GAAG,IAAI,cAAc,EAAE,CAAA;IAE9B,GAAG,CAAC,MAAc;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,UAAU,CACtD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,WAAkB,CAAC,EACzC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EACb,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CACxB,CAAC,CAAA;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-storage-kv.js","sourceRoot":"","sources":["../../../s/deck/parts/local-storage-kv.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,EAAE,EAAE,aAAa,EAAC,MAAM,UAAU,CAAA;AAE1C,MAAM,UAAU,cAAc;IAC7B,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;IACrD,OAAO,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;AACpC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { deep } from "@e280/stz";
|
|
2
|
+
export function mergeBindings(normative, sus) {
|
|
3
|
+
const bindings = deep.clone(normative);
|
|
4
|
+
if (!sus)
|
|
5
|
+
return bindings;
|
|
6
|
+
for (const [mode, bracket] of Object.entries(bindings)) {
|
|
7
|
+
for (const actionKey of Object.keys(bracket)) {
|
|
8
|
+
const susAction = sus[mode]?.[actionKey];
|
|
9
|
+
if (susAction)
|
|
10
|
+
bracket[actionKey] = susAction;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return bindings;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=merge-bindings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-bindings.js","sourceRoot":"","sources":["../../../s/deck/parts/merge-bindings.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAA;AAG9B,MAAM,UAAU,aAAa,CAAqB,SAAY,EAAE,GAAO;IACtE,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;IAEtC,IAAI,CAAC,GAAG;QACP,OAAO,QAAQ,CAAA;IAEhB,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxD,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9C,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,CAAA;YACxC,IAAI,SAAS;gBACZ,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAAA;QAChC,CAAC;IACF,CAAC;IAED,OAAO,QAAQ,CAAA;AAChB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Hub } from "../../core/hub/hub.js";
|
|
2
|
+
import { DeviceSkins } from "./device-skins/device-skin.js";
|
|
3
|
+
export declare class OverlayVisibility {
|
|
4
|
+
#private;
|
|
5
|
+
hub: Hub<any>;
|
|
6
|
+
deviceSkins: DeviceSkins;
|
|
7
|
+
auto: boolean;
|
|
8
|
+
dispose: {
|
|
9
|
+
(): void;
|
|
10
|
+
schedule(fn: () => void): any;
|
|
11
|
+
};
|
|
12
|
+
/** manual override for whether the ports view should be visible */
|
|
13
|
+
readonly $manual: import("@e280/strata").SignalFn<boolean>;
|
|
14
|
+
/** derived signal about whether the ports view should be visible */
|
|
15
|
+
readonly $visible: import("@e280/strata").DerivedFn<boolean>;
|
|
16
|
+
/** whether or not to show labels in the overlay ui */
|
|
17
|
+
readonly $showLabels: import("@e280/strata").SignalFn<boolean>;
|
|
18
|
+
constructor(hub: Hub<any>, deviceSkins?: DeviceSkins);
|
|
19
|
+
bump(): Promise<void>;
|
|
20
|
+
toggle(active?: boolean): Promise<boolean>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { signal } from "@e280/strata";
|
|
2
|
+
import { debounce, disposer } from "@e280/stz";
|
|
3
|
+
import { DeviceSkins } from "./device-skins/device-skin.js";
|
|
4
|
+
export class OverlayVisibility {
|
|
5
|
+
hub;
|
|
6
|
+
deviceSkins;
|
|
7
|
+
auto = true;
|
|
8
|
+
dispose = disposer();
|
|
9
|
+
#created = Date.now();
|
|
10
|
+
#$auto = signal(false);
|
|
11
|
+
/** manual override for whether the ports view should be visible */
|
|
12
|
+
$manual = signal(false);
|
|
13
|
+
/** derived signal about whether the ports view should be visible */
|
|
14
|
+
$visible = signal.derived(() => (this.$manual() || (this.auto && this.#$auto())));
|
|
15
|
+
/** whether or not to show labels in the overlay ui */
|
|
16
|
+
$showLabels = signal(false);
|
|
17
|
+
constructor(hub, deviceSkins = new DeviceSkins()) {
|
|
18
|
+
this.hub = hub;
|
|
19
|
+
this.deviceSkins = deviceSkins;
|
|
20
|
+
this.dispose.schedule(hub.on(async () => {
|
|
21
|
+
const since = Date.now() - this.#created;
|
|
22
|
+
if (since > 100)
|
|
23
|
+
await this.bump();
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
#autoOff = debounce(1500, () => this.#$auto(false));
|
|
27
|
+
async bump() {
|
|
28
|
+
await this.#$auto(true);
|
|
29
|
+
await this.#autoOff();
|
|
30
|
+
}
|
|
31
|
+
async toggle(active = !this.$manual()) {
|
|
32
|
+
return this.$manual.set(active);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=overlay-visibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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AAM,CAAC,KAAK,CAAC,CAAC,CAAA;IAEnD,KAAK,CAAC,IAAI;QACT,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QACvB,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAA;IACtB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IAChC,CAAC;CACD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { cssReset } from "@e280/sly";
|
|
3
|
+
import styleCss from "./style.css.js";
|
|
4
|
+
import { deckView } from "../framework.js";
|
|
5
|
+
export const DeckOverlay = deckView(deck => use => {
|
|
6
|
+
use.css(cssReset, styleCss);
|
|
7
|
+
use.attrs.string.deck = "overlay";
|
|
8
|
+
const { hub, deviceSkins, overlayVisibility: { $visible, $showLabels } } = deck;
|
|
9
|
+
function renderDevice(device) {
|
|
10
|
+
const skin = deviceSkins.get(device);
|
|
11
|
+
const style = `--color: ${skin.color};`;
|
|
12
|
+
const next = () => hub.shimmy(device, 1);
|
|
13
|
+
const previous = () => hub.shimmy(device, -1);
|
|
14
|
+
return html `
|
|
15
|
+
<div class=device style="${style}">
|
|
16
|
+
<div class="primary row">
|
|
17
|
+
<button @click="${previous}"><</button>
|
|
18
|
+
<div class=icon>${skin.icon}</div>
|
|
19
|
+
<button @click="${next}">></button>
|
|
20
|
+
</div>
|
|
21
|
+
${$showLabels() ? html `
|
|
22
|
+
<div class="secondary row">
|
|
23
|
+
<div class=label>${skin.label}</div>
|
|
24
|
+
</div>
|
|
25
|
+
` : null}
|
|
26
|
+
</div>
|
|
27
|
+
`;
|
|
28
|
+
}
|
|
29
|
+
return html `
|
|
30
|
+
<div class=portlist ?data-active="${$visible()}">
|
|
31
|
+
${hub.ports.map((port, index) => html `
|
|
32
|
+
<div class=port>
|
|
33
|
+
<header>P${index + 1}</header>
|
|
34
|
+
${port.devices.array().map(renderDevice)}
|
|
35
|
+
</div>
|
|
36
|
+
`)}
|
|
37
|
+
</div>
|
|
38
|
+
`;
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../s/deck/views/deck-overlay/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAA;AAElC,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAA;AAGxC,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE;IACjD,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC3B,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,SAAS,CAAA;IAEjC,MAAM,EAAC,GAAG,EAAE,WAAW,EAAE,iBAAiB,EAAE,EAAC,QAAQ,EAAE,WAAW,EAAC,EAAC,GAAG,IAAI,CAAA;IAE3E,SAAS,YAAY,CAAC,MAAc;QACnC,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACpC,MAAM,KAAK,GAAG,YAAY,IAAI,CAAC,KAAK,GAAG,CAAA;QACvC,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;QACxC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAA;QAC7C,OAAO,IAAI,CAAA;8BACiB,KAAK;;uBAEZ,QAAQ;uBACR,IAAI,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