@headless-tree/core 0.0.0-20250506223720 → 0.0.0-20250506224638
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/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# @headless-tree/core
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20250506224638
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- 6ed84b4: recursive item references are filtered out when rendering (#89)
|
|
8
|
+
- 4bef2f2: fixed a bug where hotkeys involving shift may not work properly depending on the order of shift and other key inputs (#98)
|
|
8
9
|
|
|
9
10
|
## 1.0.0
|
|
10
11
|
|
|
@@ -8,7 +8,7 @@ const specialKeys = {
|
|
|
8
8
|
Space: /^ $/,
|
|
9
9
|
};
|
|
10
10
|
const testHotkeyMatch = (pressedKeys, tree, hotkey) => {
|
|
11
|
-
const supposedKeys = hotkey.hotkey.split("+");
|
|
11
|
+
const supposedKeys = hotkey.hotkey.toLowerCase().split("+");
|
|
12
12
|
const doKeysMatch = supposedKeys.every((key) => key in specialKeys
|
|
13
13
|
? [...pressedKeys].some((pressedKey) => specialKeys[key].test(pressedKey))
|
|
14
14
|
: pressedKeys.has(key));
|
|
@@ -27,9 +27,10 @@ exports.hotkeysCoreFeature = {
|
|
|
27
27
|
const keydown = (e) => {
|
|
28
28
|
var _a, _b, _c, _d;
|
|
29
29
|
var _e;
|
|
30
|
+
const key = e.key.toLowerCase();
|
|
30
31
|
(_a = (_e = data.current).pressedKeys) !== null && _a !== void 0 ? _a : (_e.pressedKeys = new Set());
|
|
31
|
-
const newMatch = !data.current.pressedKeys.has(
|
|
32
|
-
data.current.pressedKeys.add(
|
|
32
|
+
const newMatch = !data.current.pressedKeys.has(key);
|
|
33
|
+
data.current.pressedKeys.add(key);
|
|
33
34
|
const hotkeyName = findHotkeyMatch(data.current.pressedKeys, tree, tree.getHotkeyPresets(), tree.getConfig().hotkeys);
|
|
34
35
|
if (!hotkeyName)
|
|
35
36
|
return;
|
|
@@ -50,7 +51,7 @@ exports.hotkeysCoreFeature = {
|
|
|
50
51
|
var _a;
|
|
51
52
|
var _b;
|
|
52
53
|
(_a = (_b = data.current).pressedKeys) !== null && _a !== void 0 ? _a : (_b.pressedKeys = new Set());
|
|
53
|
-
data.current.pressedKeys.delete(e.key);
|
|
54
|
+
data.current.pressedKeys.delete(e.key.toLowerCase());
|
|
54
55
|
};
|
|
55
56
|
// keyup is registered on document, because some hotkeys shift
|
|
56
57
|
// the focus away from the tree (i.e. search)
|
|
@@ -5,7 +5,7 @@ const specialKeys = {
|
|
|
5
5
|
Space: /^ $/,
|
|
6
6
|
};
|
|
7
7
|
const testHotkeyMatch = (pressedKeys, tree, hotkey) => {
|
|
8
|
-
const supposedKeys = hotkey.hotkey.split("+");
|
|
8
|
+
const supposedKeys = hotkey.hotkey.toLowerCase().split("+");
|
|
9
9
|
const doKeysMatch = supposedKeys.every((key) => key in specialKeys
|
|
10
10
|
? [...pressedKeys].some((pressedKey) => specialKeys[key].test(pressedKey))
|
|
11
11
|
: pressedKeys.has(key));
|
|
@@ -24,9 +24,10 @@ export const hotkeysCoreFeature = {
|
|
|
24
24
|
const keydown = (e) => {
|
|
25
25
|
var _a, _b, _c, _d;
|
|
26
26
|
var _e;
|
|
27
|
+
const key = e.key.toLowerCase();
|
|
27
28
|
(_a = (_e = data.current).pressedKeys) !== null && _a !== void 0 ? _a : (_e.pressedKeys = new Set());
|
|
28
|
-
const newMatch = !data.current.pressedKeys.has(
|
|
29
|
-
data.current.pressedKeys.add(
|
|
29
|
+
const newMatch = !data.current.pressedKeys.has(key);
|
|
30
|
+
data.current.pressedKeys.add(key);
|
|
30
31
|
const hotkeyName = findHotkeyMatch(data.current.pressedKeys, tree, tree.getHotkeyPresets(), tree.getConfig().hotkeys);
|
|
31
32
|
if (!hotkeyName)
|
|
32
33
|
return;
|
|
@@ -47,7 +48,7 @@ export const hotkeysCoreFeature = {
|
|
|
47
48
|
var _a;
|
|
48
49
|
var _b;
|
|
49
50
|
(_a = (_b = data.current).pressedKeys) !== null && _a !== void 0 ? _a : (_b.pressedKeys = new Set());
|
|
50
|
-
data.current.pressedKeys.delete(e.key);
|
|
51
|
+
data.current.pressedKeys.delete(e.key.toLowerCase());
|
|
51
52
|
};
|
|
52
53
|
// keyup is registered on document, because some hotkeys shift
|
|
53
54
|
// the focus away from the tree (i.e. search)
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ const testHotkeyMatch = (
|
|
|
17
17
|
tree: TreeInstance<any>,
|
|
18
18
|
hotkey: HotkeyConfig<any>,
|
|
19
19
|
) => {
|
|
20
|
-
const supposedKeys = hotkey.hotkey.split("+");
|
|
20
|
+
const supposedKeys = hotkey.hotkey.toLowerCase().split("+");
|
|
21
21
|
const doKeysMatch = supposedKeys.every((key) =>
|
|
22
22
|
key in specialKeys
|
|
23
23
|
? [...pressedKeys].some((pressedKey) => specialKeys[key].test(pressedKey))
|
|
@@ -45,9 +45,10 @@ export const hotkeysCoreFeature: FeatureImplementation = {
|
|
|
45
45
|
onTreeMount: (tree, element) => {
|
|
46
46
|
const data = tree.getDataRef<HotkeysCoreDataRef>();
|
|
47
47
|
const keydown = (e: KeyboardEvent) => {
|
|
48
|
+
const key = e.key.toLowerCase();
|
|
48
49
|
data.current.pressedKeys ??= new Set();
|
|
49
|
-
const newMatch = !data.current.pressedKeys.has(
|
|
50
|
-
data.current.pressedKeys.add(
|
|
50
|
+
const newMatch = !data.current.pressedKeys.has(key);
|
|
51
|
+
data.current.pressedKeys.add(key);
|
|
51
52
|
|
|
52
53
|
const hotkeyName = findHotkeyMatch(
|
|
53
54
|
data.current.pressedKeys,
|
|
@@ -78,7 +79,7 @@ export const hotkeysCoreFeature: FeatureImplementation = {
|
|
|
78
79
|
|
|
79
80
|
const keyup = (e: KeyboardEvent) => {
|
|
80
81
|
data.current.pressedKeys ??= new Set();
|
|
81
|
-
data.current.pressedKeys.delete(e.key);
|
|
82
|
+
data.current.pressedKeys.delete(e.key.toLowerCase());
|
|
82
83
|
};
|
|
83
84
|
|
|
84
85
|
// keyup is registered on document, because some hotkeys shift
|