@inklu/keys 2.0.2 → 2.2.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/LICENSE +1 -1
- package/README.md +209 -66
- package/dist/attributes.d.mts +11 -2
- package/dist/attributes.mjs +22 -24
- package/dist/index-DRXMJmbc.d.mts +173 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -3
- package/dist/react.d.mts +27 -28
- package/dist/react.mjs +125 -130
- package/dist/src-TaZw4V61.mjs +1797 -0
- package/dist/types-D-hUKGoN.d.mts +357 -0
- package/package.json +5 -5
- package/dist/attributes-DotLr2MW.d.mts +0 -426
- package/dist/index-BTgscYdI.d.mts +0 -116
- package/dist/src-DgYjA1oS.mjs +0 -1697
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
//#region src/chord.d.ts
|
|
2
|
+
/** Chords: reading one from text or a keypress, matching the two, and writing one back. */
|
|
3
|
+
/**
|
|
4
|
+
* The two kinds of keyboard: `"mac"` for Apple's (macOS, iPadOS, iOS), whose
|
|
5
|
+
* primary modifier is Command, and `"other"` for the rest, where it is Control.
|
|
6
|
+
*/
|
|
7
|
+
type Platform = "mac" | "other";
|
|
8
|
+
/** Named keys in the `Key` type, as `KeyboardEvent.key` spells them. Other names still work. */
|
|
9
|
+
declare const NAMED_KEYS: readonly ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Home", "End", "PageUp", "PageDown", "Enter", "Escape", "Space", "Tab", "Backspace", "Delete", "Insert", "CapsLock", "ContextMenu", "PrintScreen", "ScrollLock", "Pause", "NumLock", "Help", "Clear", "MediaPlayPause", "MediaStop", "MediaTrackNext", "MediaTrackPrevious", "AudioVolumeUp", "AudioVolumeDown", "AudioVolumeMute", "BrowserBack", "BrowserForward", "BrowserRefresh", "BrowserSearch", "BrowserHome"];
|
|
10
|
+
type Letter = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z";
|
|
11
|
+
type Digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
|
|
12
|
+
type FunctionKey = `F${Exclude<Digit, "0">}` | `F1${Digit}` | `F2${"0" | "1" | "2" | "3" | "4"}`;
|
|
13
|
+
type Punctuation = "/" | "[" | "]" | "\\" | "=" | "-" | "," | "." | ";" | "`" | "'" | "+" | "?" | "!" | "@" | "#" | "$" | "%" | "^" | "&" | "*" | "(" | ")" | "_" | "{" | "}" | "|" | ":" | '"' | "<" | ">" | "~";
|
|
14
|
+
/**
|
|
15
|
+
* The key of a chord: the character or named key it produces (`"K"`,
|
|
16
|
+
* `"Escape"`), or a physical key by its `KeyboardEvent.code` in brackets
|
|
17
|
+
* (`"[KeyK]"`), which stays put whatever the keyboard layout.
|
|
18
|
+
*/
|
|
19
|
+
type Key = Letter | Digit | FunctionKey | Punctuation | (typeof NAMED_KEYS)[number] | `[${string}]`;
|
|
20
|
+
type Held<Modifier extends string> = "" | `${Modifier}+`;
|
|
21
|
+
type Modifiers = `${Held<"Control">}${Held<"Alt">}${Held<"Shift">}${Held<"Meta">}` | `Mod+${Held<"Alt">}${Held<"Shift">}`;
|
|
22
|
+
/**
|
|
23
|
+
* A single hotkey chord, e.g. `"Mod+K"`: modifiers in the order Control, Alt,
|
|
24
|
+
* Shift, Meta, then one key. `Mod` is Command on macOS and Control elsewhere.
|
|
25
|
+
*/
|
|
26
|
+
type Chord = `${Modifiers}${Key}`;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/types.d.ts
|
|
29
|
+
/** A sequence of chords pressed in order, e.g. `G` then `I`. */
|
|
30
|
+
interface SequenceBinding {
|
|
31
|
+
readonly sequence: ReadonlyArray<Chord>;
|
|
32
|
+
}
|
|
33
|
+
/** A hotkey chord or sequence that triggers a command. */
|
|
34
|
+
type Binding = Chord | SequenceBinding;
|
|
35
|
+
/** One binding or an array of alternative bindings. */
|
|
36
|
+
type BindingInput = Binding | ReadonlyArray<Binding>;
|
|
37
|
+
/**
|
|
38
|
+
* Keys that differ by platform: `mac` on Apple keyboards (macOS, iPadOS and
|
|
39
|
+
* iOS), `other` everywhere else. A side left out is unbound there.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* keys: { mac: "Mod+Shift+Z", other: ["Mod+Y", "Mod+Shift+Z"] }
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
interface PlatformBindings {
|
|
47
|
+
readonly mac?: BindingInput;
|
|
48
|
+
readonly other?: BindingInput;
|
|
49
|
+
}
|
|
50
|
+
/** JSON-serializable form of a binding. */
|
|
51
|
+
type SerializedBinding = string | Array<string>;
|
|
52
|
+
/** An arbitrary JSON-compatible value, e.g. from `JSON.parse` or persisted storage. */
|
|
53
|
+
type Json = string | number | boolean | null | ReadonlyArray<Json> | {
|
|
54
|
+
readonly [key: string]: Json;
|
|
55
|
+
};
|
|
56
|
+
/** Display options for formatting hotkeys. */
|
|
57
|
+
interface DisplayOptions {
|
|
58
|
+
/** Platform to write for. Defaults to the one detected. */
|
|
59
|
+
platform?: Platform;
|
|
60
|
+
/** Symbols such as `⌘` and `↩` rather than names such as `Cmd`. Defaults to `true`. */
|
|
61
|
+
useSymbols?: boolean;
|
|
62
|
+
}
|
|
63
|
+
/** Trigger source for a command. */
|
|
64
|
+
type CommandSource = "keyboard" | "api" | "dom";
|
|
65
|
+
/** Context passed to a command's handler. */
|
|
66
|
+
interface CommandContext<Id extends string = string> {
|
|
67
|
+
/** ID of the command being run. */
|
|
68
|
+
readonly id: Id;
|
|
69
|
+
/** How the command was triggered. */
|
|
70
|
+
readonly source: CommandSource;
|
|
71
|
+
/** Originating DOM event, if triggered by user interaction. */
|
|
72
|
+
readonly event?: Event;
|
|
73
|
+
/** Specific binding that triggered the command. */
|
|
74
|
+
readonly binding?: Binding;
|
|
75
|
+
/** The registry, typed with its own ids. */
|
|
76
|
+
readonly commands: Commands<Id>;
|
|
77
|
+
}
|
|
78
|
+
/** What a command does when it runs. */
|
|
79
|
+
type CommandHandler<Id extends string = string> = (context: CommandContext<Id>) => void | Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* A command: what it is called, which keys reach it, and where it is live.
|
|
82
|
+
* `Id` is the registry's id union, which `createCommands` fills in.
|
|
83
|
+
*/
|
|
84
|
+
interface CommandDefinition<Id extends string = string> {
|
|
85
|
+
/** Human-readable title. */
|
|
86
|
+
title: string;
|
|
87
|
+
/** Longer explanation, such as a palette's secondary line or a tooltip. */
|
|
88
|
+
description?: string;
|
|
89
|
+
/** Heading to list the command under in a palette or shortcut sheet, e.g. `"Navigate"`. */
|
|
90
|
+
group?: string;
|
|
91
|
+
/** Extra search terms `matchCommands` checks besides the title, e.g. `["find", "search"]`. */
|
|
92
|
+
keywords?: ReadonlyArray<string>;
|
|
93
|
+
/**
|
|
94
|
+
* Leave the command out of `matchCommands`. It still runs and still appears
|
|
95
|
+
* in `list()`. Defaults to `false`.
|
|
96
|
+
*/
|
|
97
|
+
hidden?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Default key binding(s). Write `{ mac, other }` where the platforms'
|
|
100
|
+
* conventions differ, as they do for redo and for back and forward.
|
|
101
|
+
*/
|
|
102
|
+
keys?: BindingInput | PlatformBindings;
|
|
103
|
+
/** Scope required for this command to fire. Omit for global, or `"*"` to bypass exclusive scopes. */
|
|
104
|
+
scope?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Prevent default event behavior when run, and for each step of a sequence as
|
|
107
|
+
* it matches. Defaults to `true`.
|
|
108
|
+
*/
|
|
109
|
+
preventDefault?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Whether to ignore key events from text inputs, selects, contenteditable
|
|
112
|
+
* elements and widgets with a text-entry ARIA role. When omitted, chords
|
|
113
|
+
* holding Control or Meta and bare `Escape` still fire there, except the
|
|
114
|
+
* field's own: select all, copy, cut, paste, undo, redo, and moving or
|
|
115
|
+
* deleting by word or line.
|
|
116
|
+
*/
|
|
117
|
+
ignoreInputs?: boolean;
|
|
118
|
+
/** Timeout in milliseconds between sequence steps. Defaults to `1000`. */
|
|
119
|
+
sequenceTimeout?: number;
|
|
120
|
+
/**
|
|
121
|
+
* Whether holding the keys down runs the command again on each auto-repeat.
|
|
122
|
+
* Defaults to `true`. With `false` it runs once per press and still claims
|
|
123
|
+
* its key while held.
|
|
124
|
+
*/
|
|
125
|
+
repeat?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* What the command does, when that needs nothing a component owns. Otherwise
|
|
128
|
+
* attach it with `commands.handle()` or `useCommandHandler`. A command with
|
|
129
|
+
* no handler cannot run and leaves its key alone.
|
|
130
|
+
*/
|
|
131
|
+
run?: CommandHandler<Id>;
|
|
132
|
+
}
|
|
133
|
+
/** Resolved command snapshot including effective bindings, display tokens, and reachability. */
|
|
134
|
+
interface Command<Id extends string = string> {
|
|
135
|
+
readonly id: Id;
|
|
136
|
+
readonly title: string;
|
|
137
|
+
readonly description?: string;
|
|
138
|
+
readonly group?: string;
|
|
139
|
+
/** Extra search terms; empty when the definition gave none. */
|
|
140
|
+
readonly keywords: ReadonlyArray<string>;
|
|
141
|
+
/** Whether `matchCommands` leaves the command out. */
|
|
142
|
+
readonly hidden: boolean;
|
|
143
|
+
readonly scope?: string;
|
|
144
|
+
/** Active bindings after user overrides. */
|
|
145
|
+
readonly bindings: ReadonlyArray<Binding>;
|
|
146
|
+
/** Formatted display strings for active bindings. */
|
|
147
|
+
readonly display: ReadonlyArray<string>;
|
|
148
|
+
/** Formatted tokens per binding for rendering `<kbd>` elements. */
|
|
149
|
+
readonly tokens: ReadonlyArray<ReadonlyArray<string>>;
|
|
150
|
+
/** Value for the `aria-keyshortcuts` attribute. Chords only: it cannot express a sequence. */
|
|
151
|
+
readonly aria: string;
|
|
152
|
+
/**
|
|
153
|
+
* Every binding phrased for a screen reader, joined by `" or "`: `"Command K"`,
|
|
154
|
+
* `"G then I"`. The only accessible form of a sequence.
|
|
155
|
+
*/
|
|
156
|
+
readonly spoken: string;
|
|
157
|
+
/** Whether its keys work right now: it has a handler and its scope is active. */
|
|
158
|
+
readonly reachable: boolean;
|
|
159
|
+
/** Whether the command has a user keymap override. */
|
|
160
|
+
readonly overridden: boolean;
|
|
161
|
+
}
|
|
162
|
+
/** A user's change to one command: `"replace"` the default (`[]` unbinds), or `"add"` to it. */
|
|
163
|
+
interface Override {
|
|
164
|
+
readonly kind: "replace" | "add";
|
|
165
|
+
readonly bindings: ReadonlyArray<Binding>;
|
|
166
|
+
}
|
|
167
|
+
/** Where user overrides are kept between visits. `webStorage()` makes one. */
|
|
168
|
+
interface KeymapStore {
|
|
169
|
+
/** The stored overrides: empty when there are none, `null` when they cannot be read. */
|
|
170
|
+
read(): Map<string, Override> | null;
|
|
171
|
+
write(overrides: ReadonlyMap<string, Override>): void;
|
|
172
|
+
/** Calls `onChange` when another tab writes. Returns a function that stops. */
|
|
173
|
+
watch(onChange: () => void): () => void;
|
|
174
|
+
}
|
|
175
|
+
/** One command's stored override: an array replaces the default, `{ add }` extends it. */
|
|
176
|
+
type SerializedOverride = Array<SerializedBinding> | {
|
|
177
|
+
add: Array<SerializedBinding>;
|
|
178
|
+
};
|
|
179
|
+
/** User overrides as JSON-safe data, keyed by command id. What `exportKeymap()` returns. */
|
|
180
|
+
type SerializedKeymap = {
|
|
181
|
+
version: 1;
|
|
182
|
+
overrides: Record<string, SerializedOverride>;
|
|
183
|
+
};
|
|
184
|
+
/** A registry's keymap: the keys in effect, and the user's changes to them. */
|
|
185
|
+
interface CommandKeymap<Id extends string = string> {
|
|
186
|
+
/** Active bindings in effect: the default, with any user override applied. */
|
|
187
|
+
get(id: Id): ReadonlyArray<Binding>;
|
|
188
|
+
/** Replaces a command's bindings. `null` unbinds it; exactly the default forgets the override. */
|
|
189
|
+
set(id: Id, input: BindingInput | null): void;
|
|
190
|
+
/** Appends a binding, stored on top of the default so a default that changes still applies. */
|
|
191
|
+
add(id: Id, input: BindingInput): void;
|
|
192
|
+
/** Resets user overrides back to defaults for a specific command or all commands. */
|
|
193
|
+
reset(id?: Id): void;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* One thing in a binding's way: a command in an overlapping scope with the
|
|
197
|
+
* same keys (`"exact"`) or with one binding starting the other (`"prefix"`),
|
|
198
|
+
* or the browser or operating system keeping the keys (`"reserved"`, which
|
|
199
|
+
* has no `id`).
|
|
200
|
+
*/
|
|
201
|
+
type Conflict<Id extends string = string> = {
|
|
202
|
+
/** Whether the bindings are identical or one is a prefix of the other. */
|
|
203
|
+
readonly kind: "exact" | "prefix";
|
|
204
|
+
/** ID of the conflicting command. */
|
|
205
|
+
readonly id: Id;
|
|
206
|
+
/** The conflicting command's binding. */
|
|
207
|
+
readonly binding: Binding;
|
|
208
|
+
/** Formatted display representation of that binding. */
|
|
209
|
+
readonly display: string;
|
|
210
|
+
/** The conflicting command's scope, if it has one. */
|
|
211
|
+
readonly scope?: string;
|
|
212
|
+
} | {
|
|
213
|
+
readonly kind: "reserved";
|
|
214
|
+
/** The binding that was asked about. */
|
|
215
|
+
readonly binding: Binding;
|
|
216
|
+
/** Formatted display representation of that binding. */
|
|
217
|
+
readonly display: string;
|
|
218
|
+
};
|
|
219
|
+
/** Options for conflict detection. */
|
|
220
|
+
interface ConflictOptions<Id extends string = string> {
|
|
221
|
+
/** Command ID to ignore during conflict checking. */
|
|
222
|
+
ignore?: Id;
|
|
223
|
+
/** Scope to evaluate conflicts in. Defaults to global. */
|
|
224
|
+
scope?: string;
|
|
225
|
+
}
|
|
226
|
+
/** Options for activating a scope. */
|
|
227
|
+
interface ScopeOptions {
|
|
228
|
+
/** Silence the keys of commands in lower scopes, including global commands. */
|
|
229
|
+
exclusive?: boolean;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Receives each keypress while the keyboard is captured: the event, and the
|
|
233
|
+
* chord it expresses (`null` for a modifier on its own).
|
|
234
|
+
*/
|
|
235
|
+
type KeyCapture = (event: KeyboardEvent, chord: Chord | null) => void;
|
|
236
|
+
/** Options passed when manually running a command. */
|
|
237
|
+
interface RunOptions {
|
|
238
|
+
/** Trigger source. Defaults to `"api"`. */
|
|
239
|
+
source?: CommandSource;
|
|
240
|
+
/** Originating DOM event. */
|
|
241
|
+
event?: Event;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Why a command cannot run: its id is not registered, nothing has attached a
|
|
245
|
+
* handler to it, or its scope is not open.
|
|
246
|
+
*/
|
|
247
|
+
type RunBlockReason = "unknown" | "unhandled" | "out-of-scope";
|
|
248
|
+
/** Represents a partially completed key sequence. */
|
|
249
|
+
interface PendingSequence<Id extends string = string> {
|
|
250
|
+
/** Command ID. */
|
|
251
|
+
readonly id: Id;
|
|
252
|
+
/** Sequence binding being typed. */
|
|
253
|
+
readonly binding: SequenceBinding;
|
|
254
|
+
/** Number of steps matched so far. */
|
|
255
|
+
readonly matched: number;
|
|
256
|
+
/** Total steps in the sequence. */
|
|
257
|
+
readonly total: number;
|
|
258
|
+
/** Formatted remaining steps. */
|
|
259
|
+
readonly remaining: ReadonlyArray<string>;
|
|
260
|
+
}
|
|
261
|
+
/** Configuration options for a commands registry. */
|
|
262
|
+
interface CommandsOptions<Id extends string = string> {
|
|
263
|
+
/**
|
|
264
|
+
* Replaces the default `keys` of commands, by id, for rebinding commands the
|
|
265
|
+
* app did not define. `null` ships a command unbound. A user's own rebinding
|
|
266
|
+
* still wins.
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
* ```ts
|
|
270
|
+
* createCommands(commands, {
|
|
271
|
+
* bindings: { "palette.open": "Mod+P", "doc.publish": null },
|
|
272
|
+
* });
|
|
273
|
+
* ```
|
|
274
|
+
*/
|
|
275
|
+
bindings?: Partial<Record<Id, BindingInput | PlatformBindings | null>>;
|
|
276
|
+
/** Platform for modifier resolution and display formatting. Defaults to auto-detection. */
|
|
277
|
+
platform?: Platform;
|
|
278
|
+
/** Target element for key events. Defaults to `document`. */
|
|
279
|
+
target?: HTMLElement | Document | Window | null;
|
|
280
|
+
/**
|
|
281
|
+
* Where to keep user keymap overrides between visits, such as
|
|
282
|
+
* `webStorage("my-app.keys")`. They load on the first `mount()`, so the
|
|
283
|
+
* server render and the client's first render agree.
|
|
284
|
+
*/
|
|
285
|
+
persist?: KeymapStore;
|
|
286
|
+
/**
|
|
287
|
+
* Whether single-key shortcuts (every step a printable character with no
|
|
288
|
+
* Control, Alt or Meta, such as `?` or `G then I`) are active. Defaults to
|
|
289
|
+
* `true`. WCAG 2.1.4 requires a way to turn them off.
|
|
290
|
+
*/
|
|
291
|
+
singleKeyShortcuts?: boolean;
|
|
292
|
+
/** Display options for rendering shortcuts. */
|
|
293
|
+
display?: DisplayOptions;
|
|
294
|
+
/** Called whenever a command runs. */
|
|
295
|
+
onRun?: (context: CommandContext<Id>) => void;
|
|
296
|
+
/**
|
|
297
|
+
* Error handler called when a handler or `onRun` throws. Defaults to
|
|
298
|
+
* `console.error`.
|
|
299
|
+
*/
|
|
300
|
+
onError?: (error: Error, context: CommandContext<Id>) => void;
|
|
301
|
+
}
|
|
302
|
+
/** The commands registry. */
|
|
303
|
+
interface Commands<Id extends string = string> {
|
|
304
|
+
/** Keymap holding default and user bindings. */
|
|
305
|
+
readonly keymap: CommandKeymap<Id>;
|
|
306
|
+
/** Retrieves a command's snapshot, or `undefined` if unregistered. */
|
|
307
|
+
get(id: Id): Command<Id> | undefined;
|
|
308
|
+
/** Returns all commands in definition order. */
|
|
309
|
+
list(): ReadonlyArray<Command<Id>>;
|
|
310
|
+
/**
|
|
311
|
+
* The list as the server rendered it: defaults only, and referentially
|
|
312
|
+
* stable. For a framework's server snapshot.
|
|
313
|
+
*/
|
|
314
|
+
serverList(): ReadonlyArray<Command<Id>>;
|
|
315
|
+
/**
|
|
316
|
+
* Runs a command by ID. Returns `true` if executed. Passes `exclusive`
|
|
317
|
+
* barriers, which silence keys, not commands.
|
|
318
|
+
*/
|
|
319
|
+
run(id: Id, options?: RunOptions): boolean;
|
|
320
|
+
/** Checks whether `run` would execute the command right now. */
|
|
321
|
+
canRun(id: Id): boolean;
|
|
322
|
+
/** Returns why `run` would refuse the command, or `null` if it would run. */
|
|
323
|
+
whyNotRun(id: Id): RunBlockReason | null;
|
|
324
|
+
/**
|
|
325
|
+
* Attaches what a command does until the returned function is called. The
|
|
326
|
+
* most recently attached handler runs.
|
|
327
|
+
*/
|
|
328
|
+
handle(id: Id, run: CommandHandler<Id>): () => void;
|
|
329
|
+
/** Activates a scope until the returned disposal function is called. */
|
|
330
|
+
pushScope(name: string, options?: ScopeOptions): () => void;
|
|
331
|
+
/**
|
|
332
|
+
* Takes the whole keyboard until the returned function is called: every
|
|
333
|
+
* keypress goes to `onKey` and no command runs.
|
|
334
|
+
*/
|
|
335
|
+
capture(onKey: KeyCapture): () => void;
|
|
336
|
+
/**
|
|
337
|
+
* Finds what stands in a binding's way: the platform reserving it (listed
|
|
338
|
+
* first), then commands in overlapping scopes with colliding keys.
|
|
339
|
+
*/
|
|
340
|
+
conflicts(binding: BindingInput, options?: ConflictOptions<Id>): Array<Conflict<Id>>;
|
|
341
|
+
/** Returns the partially-typed sequences. Tracked only while something is subscribed. */
|
|
342
|
+
pending(): ReadonlyArray<PendingSequence<Id>>;
|
|
343
|
+
/** Subscribes to sequence progress changes. */
|
|
344
|
+
subscribePending(listener: () => void): () => void;
|
|
345
|
+
/** Starts listening for key events. Returns an unmount function. */
|
|
346
|
+
mount(): () => void;
|
|
347
|
+
/** Subscribes to registry changes. Returns an unsubscribe function. */
|
|
348
|
+
subscribe(listener: () => void): () => void;
|
|
349
|
+
/** Whether single-key shortcuts are active. See `CommandsOptions.singleKeyShortcuts`. */
|
|
350
|
+
readonly singleKeyShortcuts: boolean;
|
|
351
|
+
/** Turns single-key shortcuts on or off for every command (WCAG 2.1.4). */
|
|
352
|
+
setSingleKeyShortcuts(enabled: boolean): void;
|
|
353
|
+
/** Tears down listeners and clears all commands. */
|
|
354
|
+
destroy(): void;
|
|
355
|
+
}
|
|
356
|
+
//#endregion
|
|
357
|
+
export { SequenceBinding as C, Chord as D, SerializedOverride as E, Key as O, ScopeOptions as S, SerializedKeymap as T, Override as _, CommandDefinition as a, RunBlockReason as b, CommandSource as c, Conflict as d, ConflictOptions as f, KeymapStore as g, KeyCapture as h, CommandContext as i, Platform as k, Commands as l, Json as m, BindingInput as n, CommandHandler as o, DisplayOptions as p, Command as r, CommandKeymap as s, Binding as t, CommandsOptions as u, PendingSequence as v, SerializedBinding as w, RunOptions as x, PlatformBindings as y };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inklu/keys",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "A command system for the web — typed commands, portable keybindings, scopes, sequences, conflict detection, rebinding, and platform-aware display.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -41,12 +41,11 @@
|
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"dependencies": {
|
|
45
|
-
"@tanstack/hotkeys": "^0.10.0"
|
|
46
|
-
},
|
|
47
44
|
"devDependencies": {
|
|
48
45
|
"@inklu/tsconfig": "1.0.0",
|
|
46
|
+
"@playwright/test": "^1.63.0",
|
|
49
47
|
"@testing-library/react": "^16.3.3",
|
|
48
|
+
"@types/node": "^26.6.2",
|
|
50
49
|
"@types/react": "^19.3.0",
|
|
51
50
|
"@types/react-dom": "^19.3.0",
|
|
52
51
|
"jsdom": "^30.1.1",
|
|
@@ -67,6 +66,7 @@
|
|
|
67
66
|
"scripts": {
|
|
68
67
|
"build": "vp pack",
|
|
69
68
|
"dev": "vp pack --watch",
|
|
70
|
-
"test": "vp test"
|
|
69
|
+
"test": "vp test",
|
|
70
|
+
"test:e2e": "playwright test"
|
|
71
71
|
}
|
|
72
72
|
}
|