@tanstack/lit-hotkeys 0.19.0 → 0.20.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.
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { AppHotkey, HeldModifierOptions, RegisterableHotkey } from "@tanstack/hotkeys";
|
|
2
2
|
import { ReactiveController, ReactiveControllerHost } from "lit";
|
|
3
3
|
//#region src/controllers/hotkey-hint.d.ts
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Modifier hint controller. Getter arguments can read reactive host
|
|
6
|
+
* properties. No hotkey (`undefined`, `null`, or `''`) is never visible.
|
|
7
|
+
*/
|
|
5
8
|
export declare class HotkeyHintController implements ReactiveController {
|
|
6
9
|
private host;
|
|
7
10
|
private hotkey;
|
|
@@ -9,7 +12,7 @@ export declare class HotkeyHintController implements ReactiveController {
|
|
|
9
12
|
private unsubscribe?;
|
|
10
13
|
private visible;
|
|
11
14
|
/** Attaches to the host; getter arguments can read changing reactive properties. */
|
|
12
|
-
constructor(host: ReactiveControllerHost, hotkey: RegisterableHotkey | AppHotkey | (() => RegisterableHotkey | AppHotkey), options?: HeldModifierOptions | (() => HeldModifierOptions));
|
|
15
|
+
constructor(host: ReactiveControllerHost, hotkey: RegisterableHotkey | AppHotkey | null | undefined | (() => RegisterableHotkey | AppHotkey | null | undefined), options?: HeldModifierOptions | (() => HeldModifierOptions));
|
|
13
16
|
/**
|
|
14
17
|
* Current visibility. True only while the hotkey can fire: some registration
|
|
15
18
|
* of it is enabled and in an active scope. A hotkey on an element counts only while focus is inside it.
|
|
@@ -3,7 +3,10 @@ import { isServer } from "./_server.js";
|
|
|
3
3
|
import { getHotkeyManager, getKeyStateTracker, isAppHotkey, matchesHeldModifiers, resolveAppHotkey } from "@tanstack/hotkeys";
|
|
4
4
|
|
|
5
5
|
//#region src/controllers/hotkey-hint.ts
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Modifier hint controller. Getter arguments can read reactive host
|
|
8
|
+
* properties. No hotkey (`undefined`, `null`, or `''`) is never visible.
|
|
9
|
+
*/
|
|
7
10
|
var HotkeyHintController = class {
|
|
8
11
|
host;
|
|
9
12
|
hotkey;
|
|
@@ -51,12 +51,12 @@ export declare class HotkeyController implements ReactiveController {
|
|
|
51
51
|
private _unsubscribe;
|
|
52
52
|
/**
|
|
53
53
|
* @param host - The Lit component that owns this controller. Add the controller with `addController()`.
|
|
54
|
-
* @param hotkey - The chord, sequence, or app hotkey to register, or a getter. A getter is read on connection and after host updates.
|
|
54
|
+
* @param hotkey - The chord, sequence, or app hotkey to register, or a getter. A getter is read on connection and after host updates. `undefined`, `null`, or `''` registers nothing, for an optional shortcut.
|
|
55
55
|
* @param callback - Called with the host as `this`.
|
|
56
56
|
* @param options - Options or a getter. Property getters are read on connection and after host updates.
|
|
57
57
|
*/
|
|
58
|
-
constructor(host: ReactiveControllerHost, hotkey: MaybeGetter<AppHotkey>, callback: HotkeyCallback, options?: MaybeGetter<AppHotkeyControllerOptions>);
|
|
59
|
-
constructor(host: ReactiveControllerHost, hotkey: MaybeGetter<RegisterableHotkey>, callback: HotkeyCallback, options?: MaybeGetter<HotkeyControllerCommonOptions>);
|
|
58
|
+
constructor(host: ReactiveControllerHost, hotkey: MaybeGetter<AppHotkey | null | undefined>, callback: HotkeyCallback, options?: MaybeGetter<AppHotkeyControllerOptions>);
|
|
59
|
+
constructor(host: ReactiveControllerHost, hotkey: MaybeGetter<RegisterableHotkey | null | undefined>, callback: HotkeyCallback, options?: MaybeGetter<HotkeyControllerCommonOptions>);
|
|
60
60
|
/** Registers when connected and a target is available. */
|
|
61
61
|
hostConnected(): void;
|
|
62
62
|
/** Refreshes options after rendering, when scoped targets are available. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/lit-hotkeys",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"description": "Lit adapter for TanStack Hotkeys",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"skills"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@tanstack/hotkeys": "0.
|
|
38
|
+
"@tanstack/hotkeys": "0.22.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"lit": "^3.3.3"
|