@keybindy/react 2.0.0 → 2.0.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.
- package/dist/useShortcuts.js +3 -2
- package/package.json +2 -2
package/dist/useShortcuts.js
CHANGED
|
@@ -49,16 +49,17 @@ const useShortcuts = (shortcutsProp = [], options = {}) => {
|
|
|
49
49
|
}
|
|
50
50
|
let unregisterBefore;
|
|
51
51
|
let unregisterAfter;
|
|
52
|
+
const hookKeys = stableShortcuts.flatMap(s => Array.isArray(s.keys[0]) ? s.keys : [s.keys]);
|
|
52
53
|
if (beforeEach) {
|
|
53
54
|
unregisterBefore = manager.beforeEach((shortcut, event) => {
|
|
54
55
|
return beforeEachRef.current ? beforeEachRef.current(shortcut, event) : undefined;
|
|
55
|
-
}, { scope });
|
|
56
|
+
}, { scope, keys: hookKeys.length > 0 ? hookKeys : undefined });
|
|
56
57
|
}
|
|
57
58
|
if (afterEach) {
|
|
58
59
|
unregisterAfter = manager.afterEach((shortcut, event) => {
|
|
59
60
|
if (afterEachRef.current)
|
|
60
61
|
afterEachRef.current(shortcut, event);
|
|
61
|
-
}, { scope });
|
|
62
|
+
}, { scope, keys: hookKeys.length > 0 ? hookKeys : undefined });
|
|
62
63
|
}
|
|
63
64
|
// Register shortcuts using the stable definitions.
|
|
64
65
|
stableShortcuts.forEach(({ keys, options: opt }) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keybindy/react",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Keybindy for React: Simple, scoped keyboard shortcuts that require little setup. designed to smoothly blend in with your React applications, allowing for robust keybinding functionality without the overhead.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "PRASSamin",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"react": "^19.1.0",
|
|
55
|
-
"@keybindy/core": "2.0.
|
|
55
|
+
"@keybindy/core": "2.0.1"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public",
|