@tanstack/ember-hotkeys 0.10.4 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,8 @@ import { getKeyStateTracker } from "@tanstack/hotkeys";
4
4
  // src/useKeyHold.ts
5
5
  /** Getter arguments can read changing tracked component properties. */
6
6
  function useKeyHold(owner, key) {
7
- return select(owner, getKeyStateTracker().store, (state) => state.heldKeys.includes(read(key)));
7
+ const tracker = getKeyStateTracker();
8
+ return select(owner, tracker.store, () => tracker.isKeyHeld(read(key)));
8
9
  }
9
10
 
10
11
  export { useKeyHold };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/ember-hotkeys",
3
- "version": "0.10.4",
3
+ "version": "0.11.1",
4
4
  "description": "Ember adapter for TanStack Hotkeys",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  ],
41
41
  "dependencies": {
42
42
  "@embroider/addon-shim": "^1.11.0",
43
- "@tanstack/hotkeys": "0.26.0",
43
+ "@tanstack/hotkeys": "0.27.1",
44
44
  "ember-modifier": "^4.2.2"
45
45
  },
46
46
  "devDependencies": {
@@ -56,6 +56,7 @@
56
56
  "@glint/template": "1.11.1",
57
57
  "@glint/tsserver-plugin": "2.7.16",
58
58
  "@rollup/plugin-babel": "7.1.0",
59
+ "@tanstack/hotkeys-test-utils": "0.0.0",
59
60
  "@types/qunit": "^2.19.14",
60
61
  "babel-plugin-ember-template-compilation": "4.0.1",
61
62
  "decorator-transforms": "2.4.0",
@@ -72,7 +72,7 @@ export default class Editor extends Component {
72
72
  | `useHotkeyRegistrations(this)` | Read `.hotkeys`, every registered hotkey with its options, `meta`, and `status` (whether it's enabled and in an active scope). |
73
73
  | `useHotkeyScopesState(this)` | Get the active scopes and the exclusive scope that owns the keyboard. |
74
74
  | `useHotkeyHint(this, hotkey, options?)` | Get whether held modifiers should reveal a shortcut's hint. False unless a registration of the hotkey can fire: enabled, in an active scope, and with focus inside its element target. |
75
- | `useKeyHold(this, key)` | Get whether one key is held. |
75
+ | `useKeyHold(this, key)` | Get whether one key is held. Letters match in any case; other names, such as `Shift`, are case-sensitive. |
76
76
  | `useHeldKeys(this)` | Get every key that's held right now. |
77
77
  | `useHeldKeyCodes(this)` | Map each held key to its physical `event.code`. |
78
78