@tanstack/vue-hotkeys 0.21.4 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/useKeyHold.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useHeldKeys } from "./useHeldKeys.js";
|
|
2
|
+
import { getKeyStateTracker } from "@tanstack/hotkeys";
|
|
2
3
|
import { computed, toValue } from "vue";
|
|
3
4
|
|
|
4
5
|
// src/useKeyHold.ts
|
|
@@ -48,8 +49,8 @@ import { computed, toValue } from "vue";
|
|
|
48
49
|
function useKeyHold(key) {
|
|
49
50
|
const heldKeys = useHeldKeys();
|
|
50
51
|
return computed(() => {
|
|
51
|
-
|
|
52
|
-
return
|
|
52
|
+
heldKeys.value;
|
|
53
|
+
return getKeyStateTracker().isKeyHeld(toValue(key));
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/vue-hotkeys",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Vue adapter for TanStack Hotkeys",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,9 +38,10 @@
|
|
|
38
38
|
"skills"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@tanstack/hotkeys": "0.
|
|
41
|
+
"@tanstack/hotkeys": "0.27.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
+
"@tanstack/hotkeys-test-utils": "0.0.0",
|
|
44
45
|
"@vitejs/plugin-vue": "^6.0.10",
|
|
45
46
|
"@vue/test-utils": "^2.5.1",
|
|
46
47
|
"vue": "^3.5.45"
|
|
@@ -53,8 +54,9 @@
|
|
|
53
54
|
"lint": "oxlint ./src",
|
|
54
55
|
"lint:fix": "oxlint ./src --fix",
|
|
55
56
|
"test:oxlint": "oxlint ./src",
|
|
56
|
-
"test:lib": "vitest
|
|
57
|
+
"test:lib": "vitest",
|
|
57
58
|
"test:lib:dev": "pnpm test:lib --watch",
|
|
59
|
+
"test:coverage": "vitest --coverage",
|
|
58
60
|
"test:types": "tsc",
|
|
59
61
|
"build": "tsdown",
|
|
60
62
|
"test:build": "publint --strict && node ../../scripts/verify-package.ts"
|
|
@@ -68,7 +68,7 @@ useHotkey('Escape', () => closePanel(), { target: panel })
|
|
|
68
68
|
| `useHotkeyRegistrations()` | Get a ref listing every registered hotkey with its options, `meta`, and `status` (whether it's enabled and in an active scope). |
|
|
69
69
|
| `useHotkeyScopesState()` | Get a ref of the active scopes and the exclusive scope that owns the keyboard. |
|
|
70
70
|
| `useHotkeyHint(hotkey, options?)` | Get a computed ref of 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. |
|
|
71
|
-
| `useKeyHold(key)` | Get a ref of whether one key is held.
|
|
71
|
+
| `useKeyHold(key)` | Get a ref of whether one key is held. Letters match in any case; other names, such as `Shift`, are case-sensitive. |
|
|
72
72
|
| `useHeldKeys()` | Get a ref of every key that's held right now. |
|
|
73
73
|
| `useHeldKeyCodes()` | Get a ref mapping each held key to its physical `event.code`. |
|
|
74
74
|
|