@tanstack/lit-hotkeys 0.23.0 → 0.24.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.
|
@@ -90,8 +90,7 @@ var KeyHoldController = class {
|
|
|
90
90
|
}
|
|
91
91
|
/** Recomputes the held state and reports whether it changed. */
|
|
92
92
|
_refresh() {
|
|
93
|
-
const
|
|
94
|
-
const next = getKeyStateTracker().store.state.heldKeys.some((heldKey) => heldKey.toLowerCase() === key);
|
|
93
|
+
const next = getKeyStateTracker().isKeyHeld(typeof this._key === "function" ? this._key() : this._key);
|
|
95
94
|
const changed = next !== this._value;
|
|
96
95
|
this._value = next;
|
|
97
96
|
return changed;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/lit-hotkeys",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "Lit adapter for TanStack Hotkeys",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,9 +35,10 @@
|
|
|
35
35
|
"skills"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@tanstack/hotkeys": "0.
|
|
38
|
+
"@tanstack/hotkeys": "0.27.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
+
"@tanstack/hotkeys-test-utils": "0.0.0",
|
|
41
42
|
"lit": "^3.3.3"
|
|
42
43
|
},
|
|
43
44
|
"peerDependencies": {
|
|
@@ -48,8 +49,9 @@
|
|
|
48
49
|
"lint": "oxlint ./src",
|
|
49
50
|
"lint:fix": "oxlint ./src --fix",
|
|
50
51
|
"test:oxlint": "oxlint ./src",
|
|
51
|
-
"test:lib": "vitest
|
|
52
|
+
"test:lib": "vitest",
|
|
52
53
|
"test:lib:dev": "pnpm test:lib --watch",
|
|
54
|
+
"test:coverage": "vitest --coverage",
|
|
53
55
|
"test:types": "tsc",
|
|
54
56
|
"build": "tsdown",
|
|
55
57
|
"test:build": "publint --strict && node ../../scripts/verify-package.ts"
|
|
@@ -69,7 +69,7 @@ export class MyEditor extends LitElement {
|
|
|
69
69
|
| `new HotkeyRegistrationsController(host)` | Read `.hotkeys`, every registered hotkey with its options, `meta`, and `status` (whether it's enabled and in an active scope). |
|
|
70
70
|
| `new HotkeyScopesStateController(host)` | Read `.value`, the active scopes and the exclusive scope that owns the keyboard. |
|
|
71
71
|
| `new HotkeyHintController(host, hotkey, options?)` | Read `.value`, 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. |
|
|
72
|
-
| `new KeyHoldController(host, key)` | Read `.value`, whether one key is held. Pass a getter, such as `() => this.key`, for a key that changes.
|
|
72
|
+
| `new KeyHoldController(host, key)` | Read `.value`, whether one key is held. Pass a getter, such as `() => this.key`, for a key that changes. Letters match in any case; other names, such as `Shift`, are case-sensitive. |
|
|
73
73
|
| `new HeldKeysController(host)` | Read `.value`, every key that's held right now. |
|
|
74
74
|
| `new HeldKeyCodesController(host)` | Read `.value`, which maps each held key to its physical `event.code`. |
|
|
75
75
|
|