@tanstack/ember-hotkeys 0.10.2 → 0.10.4
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/types.d.ts +4 -1
- package/package.json +2 -2
- package/skills/ember-hotkeys/SKILL.md +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -4,7 +4,10 @@ import { AdapterCommonOptions, AdapterHotkeyDefinition } from "@tanstack/hotkeys
|
|
|
4
4
|
export interface EmberHotkeyState<T> {
|
|
5
5
|
readonly value: T;
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* The element to listen on. A `null` or `undefined` target skips registration
|
|
9
|
+
* until it is set. Omit `target` for the document.
|
|
10
|
+
*/
|
|
8
11
|
export type EmberHotkeyTarget = Target | null;
|
|
9
12
|
/** One hotkey for `useHotkeys` and `onHotkeys`: a chord, a sequence, or an app hotkey. */
|
|
10
13
|
export type EmberHotkeyDefinition = AdapterHotkeyDefinition<EmberHotkeyTarget>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/ember-hotkeys",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"description": "Ember adapter for TanStack Hotkeys",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@embroider/addon-shim": "^1.11.0",
|
|
43
|
-
"@tanstack/hotkeys": "0.
|
|
43
|
+
"@tanstack/hotkeys": "0.26.0",
|
|
44
44
|
"ember-modifier": "^4.2.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
@@ -87,7 +87,7 @@ The helpers are template helpers, not JavaScript functions. State readers take t
|
|
|
87
87
|
- **`createHotkeysScope` isn't a hotkey scope.** It only sets defaults for its helpers. For a dialog, call `getHotkeyManager().activateScope(name, { exclusive: true })` in the constructor, pass the result to `registerDestructor(this, release)`, and put `scope=name` on the dialog's hotkeys. Give each open dialog its own name.
|
|
88
88
|
- **Read app hotkeys through getters.** Template paths can't index ids that contain dots.
|
|
89
89
|
- **Scopes have no `useHotkeyRecorder`** since v0.9.0. Call `useHotkeyRecorder(this, options, this.hotkeys)`, so apps that set defaults but don't record don't ship the recorder.
|
|
90
|
-
- **Server-rendered labels need the user's platform.** On the server, `formatForDisplay` can't see the user's OS, so it renders Linux labels that differ after hydration for Mac and Windows users. Pass `platform: detectPlatform(userAgent)` to `createHotkeysScope`, with the user agent from FastBoot's request, and format labels with `format = useFormatForDisplay(this.hotkeys)`, then `{{this.format hotkey}}`. Keep plain `formatForDisplay` for labels that render only in the browser
|
|
90
|
+
- **Server-rendered labels need the user's platform.** On the server, `formatForDisplay` can't see the user's OS, so it renders Linux labels that differ after hydration for Mac and Windows users. Pass `platform: detectPlatform(userAgent)` to `createHotkeysScope`, with the user agent from FastBoot's request, and format labels with `format = useFormatForDisplay(this.hotkeys)`, then `{{this.format hotkey}}`. Keep plain `formatForDisplay` for labels that render only in the browser, when no scope sets `platform`.
|
|
91
91
|
|
|
92
92
|
When declaring app hotkeys, building a cheat sheet, or letting users rebind shortcuts, load `@tanstack/hotkeys#app-hotkeys` and read [app hotkeys in Ember](references/app-hotkeys.md).
|
|
93
93
|
|