@tanstack/svelte-hotkeys 0.5.0 → 0.5.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.
|
@@ -7,6 +7,11 @@ export interface CreateHotkeySequenceOptions extends Omit<SequenceOptions, 'targ
|
|
|
7
7
|
/**
|
|
8
8
|
* Register a global keyboard shortcut sequence for the current component.
|
|
9
9
|
*
|
|
10
|
+
* Each step may include modifiers. You can chain the same modifier across
|
|
11
|
+
* steps (e.g. `Shift+R` then `Shift+T`). Modifier-only keydown events (Shift,
|
|
12
|
+
* Control, Alt, or Meta pressed alone) are ignored while matching—they do not
|
|
13
|
+
* advance the sequence or reset progress.
|
|
14
|
+
*
|
|
10
15
|
* @example
|
|
11
16
|
* ```svelte
|
|
12
17
|
* <script lang="ts">
|
|
@@ -26,6 +31,11 @@ export interface CreateHotkeySequenceOptions extends Omit<SequenceOptions, 'targ
|
|
|
26
31
|
* createHotkeySequence(['D', 'I', 'W'], () => {
|
|
27
32
|
* deleteInnerWord()
|
|
28
33
|
* }, { timeout: 500 })
|
|
34
|
+
*
|
|
35
|
+
* // Same modifier on consecutive steps (bare Shift between chords is ignored)
|
|
36
|
+
* createHotkeySequence(['Shift+R', 'Shift+T'], () => {
|
|
37
|
+
* nextAction()
|
|
38
|
+
* })
|
|
29
39
|
* </script>
|
|
30
40
|
*
|
|
31
41
|
* <div>
|
|
@@ -16,6 +16,11 @@ function registerHotkeySequence(target, sequence, callback, options) {
|
|
|
16
16
|
/**
|
|
17
17
|
* Register a global keyboard shortcut sequence for the current component.
|
|
18
18
|
*
|
|
19
|
+
* Each step may include modifiers. You can chain the same modifier across
|
|
20
|
+
* steps (e.g. `Shift+R` then `Shift+T`). Modifier-only keydown events (Shift,
|
|
21
|
+
* Control, Alt, or Meta pressed alone) are ignored while matching—they do not
|
|
22
|
+
* advance the sequence or reset progress.
|
|
23
|
+
*
|
|
19
24
|
* @example
|
|
20
25
|
* ```svelte
|
|
21
26
|
* <script lang="ts">
|
|
@@ -35,6 +40,11 @@ function registerHotkeySequence(target, sequence, callback, options) {
|
|
|
35
40
|
* createHotkeySequence(['D', 'I', 'W'], () => {
|
|
36
41
|
* deleteInnerWord()
|
|
37
42
|
* }, { timeout: 500 })
|
|
43
|
+
*
|
|
44
|
+
* // Same modifier on consecutive steps (bare Shift between chords is ignored)
|
|
45
|
+
* createHotkeySequence(['Shift+R', 'Shift+T'], () => {
|
|
46
|
+
* nextAction()
|
|
47
|
+
* })
|
|
38
48
|
* </script>
|
|
39
49
|
*
|
|
40
50
|
* <div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/svelte-hotkeys",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Svelte adapter for TanStack Hotkeys",
|
|
5
5
|
"author": "Kunal Rao",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"src"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@tanstack/hotkeys": "0.4.
|
|
43
|
+
"@tanstack/hotkeys": "0.4.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@sveltejs/package": "^2.5.7",
|
|
@@ -38,6 +38,11 @@ function registerHotkeySequence(
|
|
|
38
38
|
/**
|
|
39
39
|
* Register a global keyboard shortcut sequence for the current component.
|
|
40
40
|
*
|
|
41
|
+
* Each step may include modifiers. You can chain the same modifier across
|
|
42
|
+
* steps (e.g. `Shift+R` then `Shift+T`). Modifier-only keydown events (Shift,
|
|
43
|
+
* Control, Alt, or Meta pressed alone) are ignored while matching—they do not
|
|
44
|
+
* advance the sequence or reset progress.
|
|
45
|
+
*
|
|
41
46
|
* @example
|
|
42
47
|
* ```svelte
|
|
43
48
|
* <script lang="ts">
|
|
@@ -57,6 +62,11 @@ function registerHotkeySequence(
|
|
|
57
62
|
* createHotkeySequence(['D', 'I', 'W'], () => {
|
|
58
63
|
* deleteInnerWord()
|
|
59
64
|
* }, { timeout: 500 })
|
|
65
|
+
*
|
|
66
|
+
* // Same modifier on consecutive steps (bare Shift between chords is ignored)
|
|
67
|
+
* createHotkeySequence(['Shift+R', 'Shift+T'], () => {
|
|
68
|
+
* nextAction()
|
|
69
|
+
* })
|
|
60
70
|
* </script>
|
|
61
71
|
*
|
|
62
72
|
* <div>
|