@tanstack/preact-hotkeys 0.3.3 → 0.4.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.
package/README.md CHANGED
@@ -44,7 +44,7 @@ Type-safe keyboard shortcuts for the web. Template-string bindings, parsed objec
44
44
  - Type-safe bindings — template strings (`Mod+Shift+S`, `Escape`) or parsed objects for full control
45
45
  - Flexible options — `keydown`/`keyup`, `preventDefault`, `stopPropagation`, conditional enabled, `requireReset`
46
46
  - Cross-platform Mod — maps to Cmd on macOS and Ctrl on Windows/Linux
47
- - Batteries included — validation + matching, sequences (Vim-style), key-state tracking, recorder UI helpers, React hooks, and devtools (in progress)
47
+ - Batteries included — validation + matching, sequences (Vim-style), key-state tracking, recorder UI helpers, framework adapters, and devtools
48
48
 
49
49
  ### <a href="https://tanstack.com/hotkeys">Read the docs →</a>
50
50
 
@@ -55,10 +55,10 @@ Type-safe keyboard shortcuts for the web. Template-string bindings, parsed objec
55
55
  >
56
56
  > - [**React Hotkeys**](https://tanstack.com/hotkeys/latest/docs/framework/react/react-hotkeys)
57
57
  > - [**Preact Hotkeys**](https://tanstack.com/hotkeys/latest/docs/framework/preact/preact-hotkeys)
58
- > - [**Solid Hotkeys**](https://tanstack.com/hotkeys/latest/docs/framework/solid/solid-hotkeys)
59
- > - Angular Hotkeys – needs a contributor!
58
+ > - [**Solid Hotkeys**](https://tanstack.com/hotkeys/latest/docs/framework/solid/reference)
59
+ > - [**Angular Hotkeys**](https://tanstack.com/hotkeys/latest/docs/framework/angular/reference)
60
+ > - [**Vue Hotkeys**](https://tanstack.com/hotkeys/latest/docs/framework/vue/reference)
60
61
  > - Svelte Hotkeys – needs a contributor!
61
- > - Vue Hotkeys – needs a contributor!
62
62
 
63
63
  ## Get Involved
64
64
 
@@ -1 +1 @@
1
- {"version":3,"file":"HotkeysProvider.cjs","names":[],"sources":["../src/HotkeysProvider.tsx"],"sourcesContent":["import { createContext } from 'preact'\nimport { useContext, useMemo } from 'preact/hooks'\nimport type { ComponentChildren } from 'preact'\nimport type { HotkeyRecorderOptions } from '@tanstack/hotkeys'\nimport type { UseHotkeyOptions } from './useHotkey'\nimport type { UseHotkeySequenceOptions } from './useHotkeySequence'\n\nexport interface HotkeysProviderOptions {\n hotkey?: Partial<UseHotkeyOptions>\n hotkeyRecorder?: Partial<HotkeyRecorderOptions>\n hotkeySequence?: Partial<UseHotkeySequenceOptions>\n}\n\ninterface HotkeysContextValue {\n defaultOptions: HotkeysProviderOptions\n}\n\nconst HotkeysContext = createContext<HotkeysContextValue | null>(null)\n\nexport interface HotkeysProviderProps {\n children: ComponentChildren\n defaultOptions?: HotkeysProviderOptions\n}\n\nconst DEFAULT_OPTIONS: HotkeysProviderOptions = {}\n\nexport function HotkeysProvider({\n children,\n defaultOptions = DEFAULT_OPTIONS,\n}: HotkeysProviderProps) {\n const contextValue: HotkeysContextValue = useMemo(\n () => ({\n defaultOptions,\n }),\n [defaultOptions],\n )\n\n return (\n <HotkeysContext.Provider value={contextValue}>\n {children}\n </HotkeysContext.Provider>\n )\n}\n\nexport function useHotkeysContext() {\n return useContext(HotkeysContext)\n}\n\nexport function useDefaultHotkeysOptions() {\n const context = useContext(HotkeysContext)\n return context?.defaultOptions ?? {}\n}\n"],"mappings":";;;;;AAiBA,MAAM,2CAA2D,KAAK;AAOtE,MAAM,kBAA0C,EAAE;AAElD,SAAgB,gBAAgB,EAC9B,UACA,iBAAiB,mBACM;CACvB,MAAM,gDACG,EACL,gBACD,GACD,CAAC,eAAe,CACjB;AAED,QACE,4CAAC,eAAe;EAAS,OAAO;EAC7B;GACuB;;AAI9B,SAAgB,oBAAoB;AAClC,qCAAkB,eAAe;;AAGnC,SAAgB,2BAA2B;AAEzC,qCAD2B,eAAe,EAC1B,kBAAkB,EAAE"}
1
+ {"version":3,"file":"HotkeysProvider.cjs","names":[],"sources":["../src/HotkeysProvider.tsx"],"sourcesContent":["import { createContext } from 'preact'\nimport { useContext, useMemo } from 'preact/hooks'\nimport type { ComponentChildren } from 'preact'\nimport type { HotkeyRecorderOptions } from '@tanstack/hotkeys'\nimport type { UseHotkeyOptions } from './useHotkey'\nimport type { UseHotkeySequenceOptions } from './useHotkeySequence'\n\nexport interface HotkeysProviderOptions {\n hotkey?: Partial<UseHotkeyOptions>\n hotkeyRecorder?: Partial<HotkeyRecorderOptions>\n hotkeySequence?: Partial<UseHotkeySequenceOptions>\n}\n\ninterface HotkeysContextValue {\n defaultOptions: HotkeysProviderOptions\n}\n\nconst HotkeysContext = createContext<HotkeysContextValue | null>(null)\n\nexport interface HotkeysProviderProps {\n children: ComponentChildren\n defaultOptions?: HotkeysProviderOptions\n}\n\nconst DEFAULT_OPTIONS: HotkeysProviderOptions = {}\n\nexport function HotkeysProvider({\n children,\n defaultOptions = DEFAULT_OPTIONS,\n}: HotkeysProviderProps) {\n const contextValue: HotkeysContextValue = useMemo(\n () => ({\n defaultOptions,\n }),\n [defaultOptions],\n )\n\n return (\n <HotkeysContext.Provider value={contextValue}>\n {children}\n </HotkeysContext.Provider>\n )\n}\n\nexport function useHotkeysContext() {\n return useContext(HotkeysContext)\n}\n\nexport function useDefaultHotkeysOptions() {\n const context = useContext(HotkeysContext)\n return context?.defaultOptions ?? {}\n}\n"],"mappings":";;;;;AAiBA,MAAM,2CAA2D,KAAK;AAOtE,MAAM,kBAA0C,EAAE;AAElD,SAAgB,gBAAgB,EAC9B,UACA,iBAAiB,mBACM;CACvB,MAAM,gDACG,EACL,gBACD,GACD,CAAC,eAAe,CACjB;AAED,QACE,4CAAC,eAAe,UAAhB;EAAyB,OAAO;EAC7B;EACuB;;AAI9B,SAAgB,oBAAoB;AAClC,qCAAkB,eAAe;;AAGnC,SAAgB,2BAA2B;AAEzC,qCAD2B,eAAe,EAC1B,kBAAkB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"HotkeysProvider.js","names":[],"sources":["../src/HotkeysProvider.tsx"],"sourcesContent":["import { createContext } from 'preact'\nimport { useContext, useMemo } from 'preact/hooks'\nimport type { ComponentChildren } from 'preact'\nimport type { HotkeyRecorderOptions } from '@tanstack/hotkeys'\nimport type { UseHotkeyOptions } from './useHotkey'\nimport type { UseHotkeySequenceOptions } from './useHotkeySequence'\n\nexport interface HotkeysProviderOptions {\n hotkey?: Partial<UseHotkeyOptions>\n hotkeyRecorder?: Partial<HotkeyRecorderOptions>\n hotkeySequence?: Partial<UseHotkeySequenceOptions>\n}\n\ninterface HotkeysContextValue {\n defaultOptions: HotkeysProviderOptions\n}\n\nconst HotkeysContext = createContext<HotkeysContextValue | null>(null)\n\nexport interface HotkeysProviderProps {\n children: ComponentChildren\n defaultOptions?: HotkeysProviderOptions\n}\n\nconst DEFAULT_OPTIONS: HotkeysProviderOptions = {}\n\nexport function HotkeysProvider({\n children,\n defaultOptions = DEFAULT_OPTIONS,\n}: HotkeysProviderProps) {\n const contextValue: HotkeysContextValue = useMemo(\n () => ({\n defaultOptions,\n }),\n [defaultOptions],\n )\n\n return (\n <HotkeysContext.Provider value={contextValue}>\n {children}\n </HotkeysContext.Provider>\n )\n}\n\nexport function useHotkeysContext() {\n return useContext(HotkeysContext)\n}\n\nexport function useDefaultHotkeysOptions() {\n const context = useContext(HotkeysContext)\n return context?.defaultOptions ?? {}\n}\n"],"mappings":";;;;;AAiBA,MAAM,iBAAiB,cAA0C,KAAK;AAOtE,MAAM,kBAA0C,EAAE;AAElD,SAAgB,gBAAgB,EAC9B,UACA,iBAAiB,mBACM;CACvB,MAAM,eAAoC,eACjC,EACL,gBACD,GACD,CAAC,eAAe,CACjB;AAED,QACE,oBAAC,eAAe;EAAS,OAAO;EAC7B;GACuB;;AAI9B,SAAgB,oBAAoB;AAClC,QAAO,WAAW,eAAe;;AAGnC,SAAgB,2BAA2B;AAEzC,QADgB,WAAW,eAAe,EAC1B,kBAAkB,EAAE"}
1
+ {"version":3,"file":"HotkeysProvider.js","names":[],"sources":["../src/HotkeysProvider.tsx"],"sourcesContent":["import { createContext } from 'preact'\nimport { useContext, useMemo } from 'preact/hooks'\nimport type { ComponentChildren } from 'preact'\nimport type { HotkeyRecorderOptions } from '@tanstack/hotkeys'\nimport type { UseHotkeyOptions } from './useHotkey'\nimport type { UseHotkeySequenceOptions } from './useHotkeySequence'\n\nexport interface HotkeysProviderOptions {\n hotkey?: Partial<UseHotkeyOptions>\n hotkeyRecorder?: Partial<HotkeyRecorderOptions>\n hotkeySequence?: Partial<UseHotkeySequenceOptions>\n}\n\ninterface HotkeysContextValue {\n defaultOptions: HotkeysProviderOptions\n}\n\nconst HotkeysContext = createContext<HotkeysContextValue | null>(null)\n\nexport interface HotkeysProviderProps {\n children: ComponentChildren\n defaultOptions?: HotkeysProviderOptions\n}\n\nconst DEFAULT_OPTIONS: HotkeysProviderOptions = {}\n\nexport function HotkeysProvider({\n children,\n defaultOptions = DEFAULT_OPTIONS,\n}: HotkeysProviderProps) {\n const contextValue: HotkeysContextValue = useMemo(\n () => ({\n defaultOptions,\n }),\n [defaultOptions],\n )\n\n return (\n <HotkeysContext.Provider value={contextValue}>\n {children}\n </HotkeysContext.Provider>\n )\n}\n\nexport function useHotkeysContext() {\n return useContext(HotkeysContext)\n}\n\nexport function useDefaultHotkeysOptions() {\n const context = useContext(HotkeysContext)\n return context?.defaultOptions ?? {}\n}\n"],"mappings":";;;;;AAiBA,MAAM,iBAAiB,cAA0C,KAAK;AAOtE,MAAM,kBAA0C,EAAE;AAElD,SAAgB,gBAAgB,EAC9B,UACA,iBAAiB,mBACM;CACvB,MAAM,eAAoC,eACjC,EACL,gBACD,GACD,CAAC,eAAe,CACjB;AAED,QACE,oBAAC,eAAe,UAAhB;EAAyB,OAAO;EAC7B;EACuB;;AAI9B,SAAgB,oBAAoB;AAClC,QAAO,WAAW,eAAe;;AAGnC,SAAgB,2BAA2B;AAEzC,QADgB,WAAW,eAAe,EAC1B,kBAAkB,EAAE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/preact-hotkeys",
3
- "version": "0.3.3",
3
+ "version": "0.4.1",
4
4
  "description": "Preact adapter for TanStack Hotkeys",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -39,13 +39,13 @@
39
39
  "src"
40
40
  ],
41
41
  "dependencies": {
42
- "@tanstack/preact-store": "^0.11.0",
43
- "@tanstack/hotkeys": "0.3.3"
42
+ "@tanstack/preact-store": "^0.11.2",
43
+ "@tanstack/hotkeys": "0.4.1"
44
44
  },
45
45
  "devDependencies": {
46
- "@preact/preset-vite": "^2.10.2",
46
+ "@preact/preset-vite": "^2.10.3",
47
47
  "@testing-library/preact": "^3.2.4",
48
- "preact": "^10.27.2"
48
+ "preact": "^10.28.4"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "preact": ">=10.0.0"