react-better-hotkeys 0.3.0 → 0.5.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/README.md +1 -2
- package/dist/HotkeyRegistry.d.ts +8 -8
- package/dist/HotkeyRegistry.d.ts.map +1 -1
- package/dist/HotkeyRegistry.js +7 -7
- package/dist/HotkeyTextResolver.d.ts +2 -2
- package/dist/HotkeyTextResolver.d.ts.map +1 -1
- package/dist/HotkeyTextResolver.js +11 -11
- package/dist/hooks/useHotkey.d.ts +10 -15
- package/dist/hooks/useHotkey.d.ts.map +1 -1
- package/dist/hooks/useHotkey.js +26 -25
- package/dist/hooks/useRenderedHotkey.d.ts +2 -2
- package/dist/hooks/useRenderedHotkey.d.ts.map +1 -1
- package/dist/types/hotkey/chord/ChordNode.d.ts +2 -2
- package/dist/types/hotkey/chord/ChordNode.d.ts.map +1 -1
- package/dist/types/hotkey/chord/IncompleteChordHotkey.d.ts +2 -2
- package/dist/types/hotkey/chord/IncompleteChordHotkey.d.ts.map +1 -1
- package/dist/types/hotkey/definition/ChordHotkey.d.ts +4 -0
- package/dist/types/hotkey/definition/ChordHotkey.d.ts.map +1 -0
- package/dist/types/hotkey/definition/ChordHotkeySpec.d.ts +11 -0
- package/dist/types/hotkey/definition/ChordHotkeySpec.d.ts.map +1 -0
- package/dist/types/hotkey/definition/Hotkey.d.ts +4 -0
- package/dist/types/hotkey/definition/Hotkey.d.ts.map +1 -0
- package/dist/types/hotkey/definition/HotkeyInstanceBase.d.ts +12 -0
- package/dist/types/hotkey/definition/HotkeyInstanceBase.d.ts.map +1 -0
- package/dist/types/hotkey/definition/HotkeySpec.d.ts +4 -0
- package/dist/types/hotkey/definition/HotkeySpec.d.ts.map +1 -0
- package/dist/types/hotkey/definition/SequenceHotkey.d.ts +4 -0
- package/dist/types/hotkey/definition/SequenceHotkey.d.ts.map +1 -0
- package/dist/types/hotkey/definition/SequenceHotkeySpec.d.ts +6 -0
- package/dist/types/hotkey/definition/SequenceHotkeySpec.d.ts.map +1 -0
- package/dist/types/hotkey/sequence/SequenceNode.d.ts +2 -2
- package/dist/types/hotkey/sequence/SequenceNode.d.ts.map +1 -1
- package/dist/types/hotkey/sequence/SequenceTree.d.ts +2 -2
- package/dist/types/hotkey/sequence/SequenceTree.d.ts.map +1 -1
- package/dist/types/other/OS.d.ts +2 -0
- package/dist/types/other/OS.d.ts.map +1 -0
- package/dist/util/checkModifierPressed.d.ts +2 -2
- package/dist/util/checkModifierPressed.d.ts.map +1 -1
- package/dist/util/detectOS.d.ts +1 -1
- package/dist/util/detectOS.d.ts.map +1 -1
- package/dist/util/wrongModifierPressed.d.ts +2 -2
- package/dist/util/wrongModifierPressed.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/types/hotkey/HotKeyChordDef.d.ts +0 -4
- package/dist/types/hotkey/HotKeyChordDef.d.ts.map +0 -1
- package/dist/types/hotkey/HotKeyDef.d.ts +0 -4
- package/dist/types/hotkey/HotKeyDef.d.ts.map +0 -1
- package/dist/types/hotkey/HotKeyDefBase.d.ts +0 -11
- package/dist/types/hotkey/HotKeyDefBase.d.ts.map +0 -1
- package/dist/types/hotkey/HotKeyDefChordBase.d.ts +0 -11
- package/dist/types/hotkey/HotKeyDefChordBase.d.ts.map +0 -1
- package/dist/types/hotkey/HotKeyDefSequenceBase.d.ts +0 -6
- package/dist/types/hotkey/HotKeyDefSequenceBase.d.ts.map +0 -1
- package/dist/types/hotkey/HotKeySequenceDef.d.ts +0 -4
- package/dist/types/hotkey/HotKeySequenceDef.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
React Better
|
|
2
|
-
======================
|
|
1
|
+
# React Better Hotkeys
|
|
3
2
|
|
|
4
3
|
A tiny, typed helper for registering global hotkeys in React. It supports both **chords** (e.g. `Shift + Alt + A`) and **key sequences** (e.g. `g` then `h`), respects platform-specific modifier keys, and cleans up registrations automatically.
|
|
5
4
|
|
package/dist/HotkeyRegistry.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { HotkeyTextResolver } from './HotkeyTextResolver';
|
|
2
2
|
import { IncompleteHotkey } from './types/hotkey/chord/IncompleteChordHotkey';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ChordHotkey } from './types/hotkey/definition/ChordHotkey';
|
|
4
|
+
import { SequenceHotkey } from './types/hotkey/definition/SequenceHotkey';
|
|
5
5
|
import { SequenceTree } from './types/hotkey/sequence/SequenceTree';
|
|
6
6
|
export declare class HotkeyRegistry {
|
|
7
7
|
sequenceTimeout: number;
|
|
8
8
|
chordTimeout: number;
|
|
9
|
-
chords: Record<string,
|
|
10
|
-
chordMap: Partial<Record<string,
|
|
11
|
-
sequence: Record<string,
|
|
9
|
+
chords: Record<string, ChordHotkey>;
|
|
10
|
+
chordMap: Partial<Record<string, ChordHotkey[]>>;
|
|
11
|
+
sequence: Record<string, SequenceHotkey>;
|
|
12
12
|
sequenceTree: SequenceTree | undefined;
|
|
13
13
|
incompleteChords: Record<string, IncompleteHotkey>;
|
|
14
14
|
waitingSequenceNodes: Record<number, SequenceTree>;
|
|
15
15
|
textResolver?: HotkeyTextResolver;
|
|
16
16
|
constructor(sequenceTimeout?: number, chordTimeout?: number, textResolver?: HotkeyTextResolver);
|
|
17
|
-
addChordHotkey(hotkey:
|
|
18
|
-
addSequenceHotkey(hotkey:
|
|
17
|
+
addChordHotkey(hotkey: ChordHotkey): void;
|
|
18
|
+
addSequenceHotkey(hotkey: SequenceHotkey): void;
|
|
19
19
|
removeChordHotkey(id: string): void;
|
|
20
20
|
removeSequenceHotkey(id: string): void;
|
|
21
21
|
private resolveSequenceTreeNode;
|
|
22
22
|
clearIncompleteChords(): void;
|
|
23
23
|
handleModifierKeydown(event: KeyboardEvent): void;
|
|
24
|
-
handleChordHotkeyPressSuccess(chord:
|
|
24
|
+
handleChordHotkeyPressSuccess(chord: ChordHotkey, event: KeyboardEvent): void;
|
|
25
25
|
handleKeydown(event: KeyboardEvent): void;
|
|
26
26
|
handleKeyup(event: KeyboardEvent): void;
|
|
27
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HotkeyRegistry.d.ts","sourceRoot":"","sources":["../src/lib/HotkeyRegistry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"HotkeyRegistry.d.ts","sourceRoot":"","sources":["../src/lib/HotkeyRegistry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AASzE,qBAAa,cAAc;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IAGrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAM;IAEzC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,CAAM;IAEtD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAM;IAC9C,YAAY,EAAE,YAAY,GAAG,SAAS,CAAC;IAGvC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAM;IAExD,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAM;IAExD,YAAY,CAAC,EAAE,kBAAkB,CAAC;gBAGhC,eAAe,CAAC,EAAE,MAAM,EACxB,YAAY,CAAC,EAAE,MAAM,EACrB,YAAY,CAAC,EAAE,kBAAkB;IAO5B,cAAc,CAAC,MAAM,EAAE,WAAW;IAOlC,iBAAiB,CAAC,MAAM,EAAE,cAAc;IAwBxC,iBAAiB,CAAC,EAAE,EAAE,MAAM;IAQ5B,oBAAoB,CAAC,EAAE,EAAE,MAAM;IAoCtC,OAAO,CAAC,uBAAuB;IA4C/B,qBAAqB;IAOrB,qBAAqB,CAAC,KAAK,EAAE,aAAa;IAW1C,6BAA6B,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,aAAa;IAc/D,aAAa,CAAC,KAAK,EAAE,aAAa;IA4ClC,WAAW,CAAC,KAAK,EAAE,aAAa;CAGxC"}
|
package/dist/HotkeyRegistry.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { KeyMap as h } from "./definitions/KeyMap.js";
|
|
2
2
|
import { checkModifierPressed as l } from "./util/checkModifierPressed.js";
|
|
3
3
|
import { isClearKeydown as f } from "./util/isCleanKeydown.js";
|
|
4
|
-
import { isEditingKeystrokeContext as
|
|
4
|
+
import { isEditingKeystrokeContext as k } from "./util/isEditable.js";
|
|
5
5
|
import { isModifierKeyboardEvent as a } from "./util/isModifierKeyboardEvent.js";
|
|
6
|
-
import { wrongModifierPressed as
|
|
6
|
+
import { wrongModifierPressed as p } from "./util/wrongModifierPressed.js";
|
|
7
7
|
class B {
|
|
8
8
|
sequenceTimeout;
|
|
9
9
|
chordTimeout;
|
|
@@ -60,7 +60,7 @@ class B {
|
|
|
60
60
|
if (t != null)
|
|
61
61
|
if (t.hotkey.length > 0 && Object.keys(t.codeBased).length === 0 && Object.keys(t.keyBased).length === 0)
|
|
62
62
|
t.hotkey.forEach((i) => {
|
|
63
|
-
i.options.disabled || i.
|
|
63
|
+
i.options.disabled || i.callbackRef.current(s);
|
|
64
64
|
}), this.waitingSequenceNodes = {};
|
|
65
65
|
else {
|
|
66
66
|
const i = setTimeout(() => {
|
|
@@ -71,7 +71,7 @@ class B {
|
|
|
71
71
|
if (o != null)
|
|
72
72
|
if (o.hotkey.length > 0 && Object.keys(o.codeBased).length === 0 && Object.keys(o.keyBased).length === 0)
|
|
73
73
|
o.hotkey.forEach((i) => {
|
|
74
|
-
i.options.disabled || i.
|
|
74
|
+
i.options.disabled || i.callbackRef.current(s);
|
|
75
75
|
}), this.waitingSequenceNodes = {};
|
|
76
76
|
else {
|
|
77
77
|
const i = setTimeout(() => {
|
|
@@ -86,13 +86,13 @@ class B {
|
|
|
86
86
|
}
|
|
87
87
|
handleModifierKeydown(e) {
|
|
88
88
|
for (const s of Object.values(this.incompleteChords))
|
|
89
|
-
l(s.hotkey, e) ? (this.handleChordHotkeyPressSuccess(s.hotkey, e), this.clearIncompleteChords()) :
|
|
89
|
+
l(s.hotkey, e) ? (this.handleChordHotkeyPressSuccess(s.hotkey, e), this.clearIncompleteChords()) : p(s.hotkey, e) && this.clearIncompleteChords();
|
|
90
90
|
}
|
|
91
91
|
handleChordHotkeyPressSuccess(e, s) {
|
|
92
|
-
|
|
92
|
+
k(s) && !e.options.enableOnContentEditable || (e.options.preventDefault && s.preventDefault(), e.callbackRef.current(s), this.waitingSequenceNodes = {});
|
|
93
93
|
}
|
|
94
94
|
handleKeydown(e) {
|
|
95
|
-
if (a(e)) {
|
|
95
|
+
if (console.log("key", e.key, "code", e.code), a(e)) {
|
|
96
96
|
this.handleModifierKeydown(e);
|
|
97
97
|
return;
|
|
98
98
|
} else f(e) && this.textResolver?.setSymbol(e.code, e.key);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Hotkey } from './types/hotkey/definition/Hotkey';
|
|
2
2
|
import { HotKeyType } from './types/hotkey/HotkeyType';
|
|
3
3
|
import { ResolvedKeyStatus } from './types/hotkey/renderer/ResolvedKeyStatus';
|
|
4
4
|
import { PrimaryKeyCode } from './types/key/PrimaryKeyCode';
|
|
@@ -22,6 +22,6 @@ export declare class HotkeyTextResolver {
|
|
|
22
22
|
subscribe(code: PrimaryKeyCode, callback: (newSymbol: string) => void): () => void;
|
|
23
23
|
unsubscribe(code: PrimaryKeyCode, subscriberId: number): void;
|
|
24
24
|
delimiterForType(type: HotKeyType): string;
|
|
25
|
-
toString(hotkey:
|
|
25
|
+
toString(hotkey: Hotkey): string;
|
|
26
26
|
}
|
|
27
27
|
//# sourceMappingURL=HotkeyTextResolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HotkeyTextResolver.d.ts","sourceRoot":"","sources":["../src/lib/HotkeyTextResolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"HotkeyTextResolver.d.ts","sourceRoot":"","sources":["../src/lib/HotkeyTextResolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAcjE,qBAAa,kBAAkB;IAC7B,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAM;IACxD,gBAAgB,EAAE,GAAG,CAAC,cAAc,CAAC,CAAa;IAElD,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IAEzB,EAAE,EAAE,MAAM,CAAiB;IAE3B,OAAO,CAAC,gBAAgB,CAAK;IAE7B,OAAO,CAAC,WAAW,CAEZ;gBAGL,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,EACnD,cAAc,CAAC,EAAE,MAAM,EACvB,iBAAiB,CAAC,EAAE,MAAM;IAW5B,OAAO,CAAC,eAAe;IAiBvB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,eAAe;IAwBvB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,SAAS;IAUV,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAiCtC,OAAO,CACZ,IAAI,EAAE,cAAc,GACnB,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,SAAS;IAOnC,SAAS,CACd,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,GACpC,MAAM,IAAI;IAcN,WAAW,CAAC,IAAI,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI;IAW7D,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM;IAK1C,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;CAIxC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KeyMap as a } from "./definitions/KeyMap.js";
|
|
2
|
-
const
|
|
3
|
-
class
|
|
2
|
+
const b = "rbh-symbols-cache";
|
|
3
|
+
class p {
|
|
4
4
|
symbolMap = {};
|
|
5
5
|
invalidSymbolMap = /* @__PURE__ */ new Set();
|
|
6
6
|
chordDelimiter;
|
|
@@ -40,10 +40,10 @@ class c {
|
|
|
40
40
|
}
|
|
41
41
|
storeState(t) {
|
|
42
42
|
for (const e of t) this.invalidSymbolMap.delete(e);
|
|
43
|
-
localStorage.setItem(
|
|
43
|
+
localStorage.setItem(b, this.stringifyState());
|
|
44
44
|
}
|
|
45
45
|
loadState() {
|
|
46
|
-
const t = localStorage.getItem(
|
|
46
|
+
const t = localStorage.getItem(b);
|
|
47
47
|
if (t) {
|
|
48
48
|
const e = JSON.parse(t);
|
|
49
49
|
return this.parseState(e), !0;
|
|
@@ -56,13 +56,13 @@ class c {
|
|
|
56
56
|
);
|
|
57
57
|
if (s == null)
|
|
58
58
|
return;
|
|
59
|
-
const i = s[0];
|
|
60
|
-
if (this.symbolMap[i] ===
|
|
61
|
-
this.symbolMap[i] =
|
|
62
|
-
const
|
|
63
|
-
([r,
|
|
59
|
+
const i = s[0], n = e.length === 1 ? e.toLocaleUpperCase() : e;
|
|
60
|
+
if (this.symbolMap[i] === n) return;
|
|
61
|
+
this.symbolMap[i] = n;
|
|
62
|
+
const o = Object.entries(this.symbolMap).find(
|
|
63
|
+
([r, h]) => r !== i && h === this.symbolMap[i]
|
|
64
64
|
);
|
|
65
|
-
|
|
65
|
+
o && this.invalidSymbolMap.add(o[0]), this.storeState([i]);
|
|
66
66
|
const l = this.subscribers[i];
|
|
67
67
|
if (l)
|
|
68
68
|
for (const r of l.values())
|
|
@@ -91,5 +91,5 @@ class c {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
export {
|
|
94
|
-
|
|
94
|
+
p as HotkeyTextResolver
|
|
95
95
|
};
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { ChordHotkeySpec } from '../types/hotkey/definition/ChordHotkeySpec';
|
|
2
|
+
import { SequenceHotkeySpec } from '../types/hotkey/definition/SequenceHotkeySpec';
|
|
3
|
+
import { ChordHotkey } from '../types/hotkey/definition/ChordHotkey';
|
|
4
|
+
import { SequenceHotkey } from '../types/hotkey/definition/SequenceHotkey';
|
|
5
5
|
import { HotkeyCallback } from '../types/hotkey/HotkeyCallback';
|
|
6
6
|
import { HotkeyOptions } from '../types/hotkey/HotkeyOptions';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
export declare function useHotkey(hotkey: ChordIn, callback: HotkeyCallback, dependencies?: unknown[], options?: Partial<HotkeyOptions>): ChordOut;
|
|
15
|
-
export declare function useHotkey(hotkey: SequenceIn, callback: HotkeyCallback, dependencies?: unknown[], options?: Partial<HotkeyOptions>): SequenceOut;
|
|
16
|
-
export declare function useHotkey<const T extends readonly (ChordIn | SequenceIn)[]>(hotkey: T, callback: HotkeyCallback, dependencies?: unknown[], options?: Partial<HotkeyOptions>): HotkeyMapping<typeof hotkey>;
|
|
17
|
-
export {};
|
|
7
|
+
import { HotkeySpec } from '../types/hotkey/definition/HotkeySpec';
|
|
8
|
+
import { Hotkey } from '../types/hotkey/definition/Hotkey';
|
|
9
|
+
export declare function useHotkey(hotkey: HotkeySpec[], callback: HotkeyCallback, options?: Partial<HotkeyOptions>): Hotkey[];
|
|
10
|
+
export declare function useHotkey(hotkey: ChordHotkeySpec, callback: HotkeyCallback, options?: Partial<HotkeyOptions>): ChordHotkey;
|
|
11
|
+
export declare function useHotkey(hotkey: SequenceHotkeySpec, callback: HotkeyCallback, options?: Partial<HotkeyOptions>): SequenceHotkey;
|
|
12
|
+
export declare function useHotkey(hotkey: HotkeySpec, callback: HotkeyCallback, options?: Partial<HotkeyOptions>): Hotkey;
|
|
18
13
|
//# sourceMappingURL=useHotkey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHotkey.d.ts","sourceRoot":"","sources":["../../src/lib/hooks/useHotkey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"useHotkey.d.ts","sourceRoot":"","sources":["../../src/lib/hooks/useHotkey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAenE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAKhE,wBAAgB,SAAS,CACvB,MAAM,EAAE,UAAU,EAAE,EACpB,QAAQ,EAAE,cAAc,EACxB,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAC/B,MAAM,EAAE,CAAC;AACZ,wBAAgB,SAAS,CACvB,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,cAAc,EACxB,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAC/B,WAAW,CAAC;AACf,wBAAgB,SAAS,CACvB,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,EAAE,cAAc,EACxB,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAC/B,cAAc,CAAC;AAClB,wBAAgB,SAAS,CACvB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,cAAc,EACxB,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAC/B,MAAM,CAAC"}
|
package/dist/hooks/useHotkey.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { useLayoutEffect as
|
|
2
|
-
import { HotkeyContext as
|
|
1
|
+
import { useLayoutEffect as H, useEffect as C, useContext as R, useId as g, useRef as S, useMemo as m, useCallback as p } from "react";
|
|
2
|
+
import { HotkeyContext as E } from "../context/HotkeyContext.js";
|
|
3
3
|
import { KeyMap as x } from "../definitions/KeyMap.js";
|
|
4
|
-
import { isPrimaryKeyCode as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { isPrimaryKeyCode as w } from "../util/isPrimaryKeyCode.js";
|
|
5
|
+
const $ = typeof window < "u" ? H : C;
|
|
6
|
+
function k(o, d, v) {
|
|
7
|
+
const r = R(E), n = g(), y = S(d);
|
|
8
|
+
C(() => {
|
|
9
|
+
y.current = d;
|
|
10
|
+
}, [d]);
|
|
11
|
+
const l = m(
|
|
11
12
|
() => ({
|
|
12
13
|
preventDefault: !0,
|
|
13
14
|
enableOnContentEditable: !1,
|
|
@@ -15,39 +16,39 @@ function q(o, y, p, v) {
|
|
|
15
16
|
...v
|
|
16
17
|
}),
|
|
17
18
|
[v]
|
|
18
|
-
),
|
|
19
|
-
(e) =>
|
|
19
|
+
), a = p(
|
|
20
|
+
(e) => w(e) ? r?.textResolver.resolve(e) ?? [
|
|
20
21
|
x[`Key${e}`].value,
|
|
21
22
|
"unknown"
|
|
22
23
|
] : [x[e].value, "unknown"],
|
|
23
24
|
[r?.textResolver]
|
|
24
|
-
),
|
|
25
|
+
), c = p(
|
|
25
26
|
(e, t) => {
|
|
26
27
|
const i = {
|
|
27
28
|
...e,
|
|
28
|
-
options:
|
|
29
|
+
options: l,
|
|
29
30
|
id: t == null ? n : `${n}-${t}`,
|
|
30
|
-
|
|
31
|
+
callbackRef: y,
|
|
31
32
|
toParts: () => [
|
|
32
|
-
e.keys.map((u) =>
|
|
33
|
+
e.keys.map((u) => a(u)),
|
|
33
34
|
r?.textResolver.delimiterForType(e.type) ?? ""
|
|
34
35
|
],
|
|
35
36
|
toString: () => r?.textResolver.toString(i) ?? ""
|
|
36
37
|
};
|
|
37
38
|
return i;
|
|
38
39
|
},
|
|
39
|
-
[
|
|
40
|
-
), f =
|
|
40
|
+
[l, r?.textResolver, n, a]
|
|
41
|
+
), f = p(
|
|
41
42
|
(e, t) => {
|
|
42
43
|
const i = {
|
|
43
44
|
...e,
|
|
44
|
-
options:
|
|
45
|
+
options: l,
|
|
45
46
|
id: t == null ? n : `${n}-${t}`,
|
|
46
|
-
|
|
47
|
+
callbackRef: y,
|
|
47
48
|
toParts: () => [
|
|
48
49
|
[
|
|
49
50
|
...Object.entries(e.modifier).filter((u) => u[1]).map((u) => [u[0], "valid"]),
|
|
50
|
-
|
|
51
|
+
a(e.keyId)
|
|
51
52
|
],
|
|
52
53
|
r?.textResolver.delimiterForType(e.type) ?? ""
|
|
53
54
|
],
|
|
@@ -55,9 +56,9 @@ function q(o, y, p, v) {
|
|
|
55
56
|
};
|
|
56
57
|
return i;
|
|
57
58
|
},
|
|
58
|
-
[
|
|
59
|
-
), s = m(() =>
|
|
60
|
-
return
|
|
59
|
+
[l, r?.textResolver, n, a]
|
|
60
|
+
), s = m(() => Array.isArray(o) ? o.map((e, t) => e.type === "chord" ? f(e, t) : c(e, t)) : o.type === "chord" ? f(o) : c(o), [f, c, o]);
|
|
61
|
+
return $(() => {
|
|
61
62
|
if (r == null) {
|
|
62
63
|
console.warn(
|
|
63
64
|
"No HotkeyContext provided. Use <HotkeyProvider> to provide a HotkeyContext"
|
|
@@ -72,8 +73,8 @@ function q(o, y, p, v) {
|
|
|
72
73
|
t.type === "chord" ? r.registry.removeChordHotkey(t.id) : r.registry.removeSequenceHotkey(t.id);
|
|
73
74
|
});
|
|
74
75
|
};
|
|
75
|
-
}, [s
|
|
76
|
+
}, [s]), s;
|
|
76
77
|
}
|
|
77
78
|
export {
|
|
78
|
-
|
|
79
|
+
k as useHotkey
|
|
79
80
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Hotkey } from '../types/hotkey/definition/Hotkey';
|
|
2
2
|
import { HotkeyTextParts } from '../types/hotkey/HotkeyTextParts';
|
|
3
|
-
export declare function useRenderedHotkey(hotkey:
|
|
3
|
+
export declare function useRenderedHotkey(hotkey: Hotkey): {
|
|
4
4
|
asString: string;
|
|
5
5
|
asParts: HotkeyTextParts;
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRenderedHotkey.d.ts","sourceRoot":"","sources":["../../src/lib/hooks/useRenderedHotkey.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"useRenderedHotkey.d.ts","sourceRoot":"","sources":["../../src/lib/hooks/useRenderedHotkey.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAGhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAEvE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM;cAIlC,MAAM;aACP,eAAe;EAiC3B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChordHotkeySpec } from '../definition/ChordHotkeySpec';
|
|
2
2
|
export type ChordNode<Modifier extends string, Keys extends string> = {
|
|
3
|
-
readonly [K in Keys]:
|
|
3
|
+
readonly [K in Keys]: ChordHotkeySpec;
|
|
4
4
|
} & {
|
|
5
5
|
readonly [K in Modifier]: ChordNode<Exclude<Modifier, K>, Keys>;
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChordNode.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/hotkey/chord/ChordNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ChordNode.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/hotkey/chord/ChordNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,MAAM,MAAM,SAAS,CAAC,QAAQ,SAAS,MAAM,EAAE,IAAI,SAAS,MAAM,IAAI;IACpE,QAAQ,EAAE,CAAC,IAAI,IAAI,GAAG,eAAe;CACtC,GAAG;IACF,QAAQ,EAAE,CAAC,IAAI,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC;CAChE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChordHotkey } from '../definition/ChordHotkey';
|
|
2
2
|
export type IncompleteHotkey = {
|
|
3
|
-
hotkey:
|
|
3
|
+
hotkey: ChordHotkey;
|
|
4
4
|
timeoutId: number;
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=IncompleteChordHotkey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IncompleteChordHotkey.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/hotkey/chord/IncompleteChordHotkey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"IncompleteChordHotkey.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/hotkey/chord/IncompleteChordHotkey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChordHotkey.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/hotkey/definition/ChordHotkey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,MAAM,WAAW,GAAG,kBAAkB,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { KeyValueType } from '../../key/KeyValueType';
|
|
2
|
+
import { ModifierKeyCode } from '../../key/ModifierKeyCode';
|
|
3
|
+
import { PrimaryKey } from '../../key/PrimaryKey';
|
|
4
|
+
export type ChordHotkeySpec = {
|
|
5
|
+
type: "chord";
|
|
6
|
+
resolve: KeyValueType;
|
|
7
|
+
keyId: PrimaryKey;
|
|
8
|
+
primaryValue: string;
|
|
9
|
+
modifier: Record<Exclude<ModifierKeyCode, "Mod">, boolean>;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=ChordHotkeySpec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChordHotkeySpec.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/hotkey/definition/ChordHotkeySpec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,EAAE,UAAU,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,eAAe,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;CAC5D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Hotkey.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/hotkey/definition/Hotkey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,MAAM,MAAM,GAAG,WAAW,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { HotkeyCallback } from '../HotkeyCallback';
|
|
3
|
+
import { HotkeyOptions } from '../HotkeyOptions';
|
|
4
|
+
import { HotkeyTextParts } from '../HotkeyTextParts';
|
|
5
|
+
export type HotkeyInstanceBase = {
|
|
6
|
+
id: string;
|
|
7
|
+
callbackRef: RefObject<HotkeyCallback>;
|
|
8
|
+
options: HotkeyOptions;
|
|
9
|
+
toString: () => string;
|
|
10
|
+
toParts: () => HotkeyTextParts;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=HotkeyInstanceBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HotkeyInstanceBase.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/hotkey/definition/HotkeyInstanceBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACvC,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,eAAe,CAAC;CAChC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HotkeySpec.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/hotkey/definition/HotkeySpec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SequenceHotkey.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/hotkey/definition/SequenceHotkey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SequenceHotkeySpec.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/hotkey/definition/SequenceHotkeySpec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,UAAU,EAAE,CAAC;CACpB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SequenceHotkeySpec } from '../definition/SequenceHotkeySpec';
|
|
2
2
|
export type SequenceNode<All extends string> = {
|
|
3
|
-
end:
|
|
3
|
+
end: SequenceHotkeySpec;
|
|
4
4
|
} & {
|
|
5
5
|
readonly [K in All]: SequenceNode<All>;
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SequenceNode.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/hotkey/sequence/SequenceNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SequenceNode.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/hotkey/sequence/SequenceNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,MAAM,MAAM,YAAY,CAAC,GAAG,SAAS,MAAM,IAAI;IAC7C,GAAG,EAAE,kBAAkB,CAAC;CACzB,GAAG;IACF,QAAQ,EAAE,CAAC,IAAI,GAAG,GAAG,YAAY,CAAC,GAAG,CAAC;CACvC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SequenceHotkey } from '../definition/SequenceHotkey';
|
|
2
2
|
export type SequenceTree = {
|
|
3
|
-
hotkey:
|
|
3
|
+
hotkey: SequenceHotkey[];
|
|
4
4
|
keyBased: Partial<{
|
|
5
5
|
[key in string]: SequenceTree;
|
|
6
6
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SequenceTree.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/hotkey/sequence/SequenceTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SequenceTree.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/hotkey/sequence/SequenceTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;SACf,GAAG,IAAI,MAAM,GAAG,YAAY;KAC9B,CAAC,CAAC;IACH,SAAS,EAAE,OAAO,CAAC;SAChB,IAAI,IAAI,MAAM,GAAG,YAAY;KAC/B,CAAC,CAAC;CACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OS.d.ts","sourceRoot":"","sources":["../../../src/lib/types/other/OS.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,EAAE,GACV,YAAY,GACZ,SAAS,GACT,SAAS,GACT,OAAO,GACP,OAAO,GACP,SAAS,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function checkModifierPressed(chord:
|
|
1
|
+
import { ChordHotkey } from '../types/hotkey/definition/ChordHotkey';
|
|
2
|
+
export declare function checkModifierPressed(chord: ChordHotkey, event: KeyboardEvent): boolean;
|
|
3
3
|
//# sourceMappingURL=checkModifierPressed.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkModifierPressed.d.ts","sourceRoot":"","sources":["../../src/lib/util/checkModifierPressed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"checkModifierPressed.d.ts","sourceRoot":"","sources":["../../src/lib/util/checkModifierPressed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAE1E,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,aAAa,GACnB,OAAO,CAOT"}
|
package/dist/util/detectOS.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detectOS.d.ts","sourceRoot":"","sources":["../../src/lib/util/detectOS.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"detectOS.d.ts","sourceRoot":"","sources":["../../src/lib/util/detectOS.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAI5C,wBAAgB,QAAQ,IAAI,EAAE,CAkB7B"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function wrongModifierPressed(chord:
|
|
1
|
+
import { ChordHotkey } from '../types/hotkey/definition/ChordHotkey';
|
|
2
|
+
export declare function wrongModifierPressed(chord: ChordHotkey, event: KeyboardEvent): boolean;
|
|
3
3
|
//# sourceMappingURL=wrongModifierPressed.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrongModifierPressed.d.ts","sourceRoot":"","sources":["../../src/lib/util/wrongModifierPressed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"wrongModifierPressed.d.ts","sourceRoot":"","sources":["../../src/lib/util/wrongModifierPressed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAE1E,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,aAAa,GACnB,OAAO,CAOT"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HotKeyChordDef.d.ts","sourceRoot":"","sources":["../../../src/lib/types/hotkey/HotKeyChordDef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,kBAAkB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HotKeyDef.d.ts","sourceRoot":"","sources":["../../../src/lib/types/hotkey/HotKeyDef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,MAAM,SAAS,GAAG,cAAc,GAAG,iBAAiB,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { HotkeyCallback } from './HotkeyCallback';
|
|
2
|
-
import { HotkeyOptions } from './HotkeyOptions';
|
|
3
|
-
import { HotkeyTextParts } from './HotkeyTextParts';
|
|
4
|
-
export type HotKeyDefBase = {
|
|
5
|
-
id: string;
|
|
6
|
-
callback: HotkeyCallback;
|
|
7
|
-
options: HotkeyOptions;
|
|
8
|
-
toString: () => string;
|
|
9
|
-
toParts: () => HotkeyTextParts;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=HotKeyDefBase.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HotKeyDefBase.d.ts","sourceRoot":"","sources":["../../../src/lib/types/hotkey/HotKeyDefBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,eAAe,CAAC;CAChC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { KeyValueType } from '../key/KeyValueType';
|
|
2
|
-
import { ModifierKeyCode } from '../key/ModifierKeyCode';
|
|
3
|
-
import { PrimaryKey } from '../key/PrimaryKey';
|
|
4
|
-
export type HotKeyDefChordBase = {
|
|
5
|
-
type: "chord";
|
|
6
|
-
resolve: KeyValueType;
|
|
7
|
-
keyId: PrimaryKey;
|
|
8
|
-
primaryValue: string;
|
|
9
|
-
modifier: Record<Exclude<ModifierKeyCode, "Mod">, boolean>;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=HotKeyDefChordBase.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HotKeyDefChordBase.d.ts","sourceRoot":"","sources":["../../../src/lib/types/hotkey/HotKeyDefChordBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,EAAE,UAAU,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,eAAe,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;CAC5D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HotKeyDefSequenceBase.d.ts","sourceRoot":"","sources":["../../../src/lib/types/hotkey/HotKeyDefSequenceBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,UAAU,EAAE,CAAC;CACpB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HotKeySequenceDef.d.ts","sourceRoot":"","sources":["../../../src/lib/types/hotkey/HotKeySequenceDef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,qBAAqB,CAAC"}
|