@tanstack/preact-hotkeys-devtools 0.3.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 ADDED
@@ -0,0 +1,122 @@
1
+ <div align="center">
2
+ <img src="./media/header_hotkeys.png" alt="TanStack Hotkeys" />
3
+ </div>
4
+
5
+ <br />
6
+
7
+ <div align="center">
8
+ <a href="https://www.npmjs.com/package/@tanstack/hotkeys" target="\_parent">
9
+ <img alt="" src="https://img.shields.io/npm/dm/@tanstack/hotkeys.svg" alt="npm downloads" />
10
+ </a>
11
+ <a href="https://github.com/TanStack/hotkeys" target="\_parent">
12
+ <img alt="" src="https://img.shields.io/github/stars/TanStack/hotkeys.svg?style=social&label=Star" alt="GitHub stars" />
13
+ </a>
14
+ <a href="https://bundlephobia.com/result?p=@tanstack/react-hotkeys@latest" target="\_parent">
15
+ <img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-hotkeys@latest" alt="Bundle size" />
16
+ </a>
17
+ </div>
18
+
19
+ <div align="center">
20
+ <a href="#badge">
21
+ <img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
22
+ </a>
23
+ <a href="#badge">
24
+ <img src="https://img.shields.io/github/v/release/tanstack/hotkeys" alt="Release"/>
25
+ </a>
26
+ <a href="https://twitter.com/tan_stack">
27
+ <img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>
28
+ </a>
29
+ </div>
30
+
31
+ <div align="center">
32
+
33
+ ### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
34
+
35
+ </div>
36
+
37
+ # TanStack Hotkeys
38
+
39
+ > [!NOTE]
40
+ > TanStack Hotkeys is pre-alpha (prototyping phase). We are actively developing the library and are open to feedback and contributions.
41
+
42
+ Type-safe keyboard shortcuts for the web. Template-string bindings, parsed objects, a cross-platform `Mod` key, a singleton Hotkey Manager, and utilities for cheatsheet UIs—built to stay SSR-friendly.
43
+
44
+ - Type-safe bindings — template strings (`Mod+Shift+S`, `Escape`) or parsed objects for full control
45
+ - Flexible options — `keydown`/`keyup`, `preventDefault`, `stopPropagation`, conditional enabled, `requireReset`
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)
48
+
49
+ ### <a href="https://tanstack.com/hotkeys">Read the docs →</a>
50
+
51
+ <br />
52
+
53
+ > [!NOTE]
54
+ > You may know **TanStack Hotkeys** by our adapter names, too!
55
+ >
56
+ > - [**React Hotkeys**](https://tanstack.com/hotkeys/latest/docs/framework/react/react-hotkeys)
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!
60
+ > - Svelte Hotkeys – needs a contributor!
61
+ > - Vue Hotkeys – needs a contributor!
62
+
63
+ ## Get Involved
64
+
65
+ - We welcome issues and pull requests!
66
+ - Participate in [GitHub discussions](https://github.com/TanStack/hotkeys/discussions)
67
+ - Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ)
68
+ - See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions
69
+
70
+ ## Partners
71
+
72
+ <div align="center">
73
+
74
+ <table align="center">
75
+ <tr>
76
+ <td>
77
+ <a href="https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS" >
78
+ <picture>
79
+ <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-D643Zkrv.svg" height="40" />
80
+ <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-CIzGLYU_.svg" height="40" />
81
+ <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" />
82
+ </picture>
83
+ </a>
84
+ </td>
85
+ <td>
86
+ <a href="https://www.cloudflare.com?utm_source=tanstack">
87
+ <picture>
88
+ <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-Co-Tyjbl.svg" height="60" />
89
+ <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-6Ojsn8yh.svg" height="60" />
90
+ <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" />
91
+ </picture>
92
+ </a>
93
+ </td>
94
+ </tr>
95
+ </table>
96
+
97
+ <div align="center">
98
+ <img src="media/partner_logo.svg" alt="Keys & you?" height="65">
99
+ <p>
100
+ We're looking for TanStack Hotkeys Partners to join our mission! Partner with us to push the boundaries of TanStack Hotkeys and build amazing things together.
101
+ </p>
102
+ <a href="mailto:partners@tanstack.com?subject=TanStack Hotkeys Partnership"><b>LET'S CHAT</b></a>
103
+ </div>
104
+
105
+ </div>
106
+
107
+ ## Explore the TanStack Ecosystem
108
+
109
+ - <a href="https://github.com/tanstack/config"><b>TanStack Config</b></a> – Tooling for JS/TS packages
110
+ - <a href="https://github.com/tanstack/db"><b>TanStack DB</b></a> – Reactive sync client store
111
+ - <a href="https://github.com/tanstack/devtools"><b>TanStack DevTools</b></a> – Unified devtools panel
112
+ - <a href="https://github.com/tanstack/form"><b>TanStack Form</b></a> – Type‑safe form state
113
+ - <a href="https://github.com/tanstack/hotkeys"><b>TanStack Hotkeys</b></a> – Type‑safe keyboard shortcuts
114
+ - <a href="https://github.com/tanstack/query"><b>TanStack Query</b></a> – Async state & caching
115
+ - <a href="https://github.com/tanstack/ranger"><b>TanStack Ranger</b></a> – Range & slider primitives
116
+ - <a href="https://github.com/tanstack/router"><b>TanStack Router</b></a> – Type‑safe routing, caching & URL state
117
+ - <a href="https://github.com/tanstack/start"><b>TanStack Start</b></a> – Full‑stack SSR & streaming
118
+ - <a href="https://github.com/tanstack/store"><b>TanStack Store</b></a> – Reactive data store
119
+ - <a href="https://github.com/tanstack/table"><b>TanStack Table</b></a> – Headless datagrids
120
+ - <a href="https://github.com/tanstack/virtual"><b>TanStack Virtual</b></a> – Virtualized rendering
121
+
122
+ … and more at <a href="https://tanstack.com"><b>TanStack.com »</b></a>
@@ -0,0 +1,7 @@
1
+ import { DevtoolsPanelProps } from "@tanstack/devtools-utils/preact";
2
+
3
+ //#region src/PreactHotkeysDevtools.d.ts
4
+ interface HotkeysDevtoolsPreactInit extends DevtoolsPanelProps {}
5
+ //#endregion
6
+ export { HotkeysDevtoolsPreactInit };
7
+ //# sourceMappingURL=PreactHotkeysDevtools.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { createPreactPanel } from "@tanstack/devtools-utils/preact";
2
+ import { HotkeysDevtoolsCore } from "@tanstack/hotkeys-devtools";
3
+
4
+ //#region src/PreactHotkeysDevtools.tsx
5
+ const [HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp] = createPreactPanel(HotkeysDevtoolsCore);
6
+
7
+ //#endregion
8
+ export { HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp };
9
+ //# sourceMappingURL=PreactHotkeysDevtools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PreactHotkeysDevtools.js","names":[],"sources":["../src/PreactHotkeysDevtools.tsx"],"sourcesContent":["import { createPreactPanel } from '@tanstack/devtools-utils/preact'\nimport { HotkeysDevtoolsCore } from '@tanstack/hotkeys-devtools'\nimport type { DevtoolsPanelProps } from '@tanstack/devtools-utils/preact'\n\nexport interface HotkeysDevtoolsPreactInit extends DevtoolsPanelProps {}\n\nconst [HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp] =\n createPreactPanel(HotkeysDevtoolsCore)\n\nexport { HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp }\n"],"mappings":";;;;AAMA,MAAM,CAAC,sBAAsB,4BAC3B,kBAAkB,oBAAoB"}
@@ -0,0 +1,15 @@
1
+ import { HotkeysDevtoolsPreactInit } from "./PreactHotkeysDevtools.js";
2
+ import * as _tanstack_devtools_utils_preact0 from "@tanstack/devtools-utils/preact";
3
+ import * as preact from "preact";
4
+
5
+ //#region src/index.d.ts
6
+ declare const HotkeysDevtoolsPanel: (props: _tanstack_devtools_utils_preact0.DevtoolsPanelProps | undefined) => preact.JSX.Element;
7
+ declare const hotkeysDevtoolsPlugin: () => {
8
+ render: (_el: HTMLElement, theme: "light" | "dark") => preact.JSX.Element;
9
+ name: string;
10
+ id?: string;
11
+ defaultOpen?: boolean;
12
+ };
13
+ //#endregion
14
+ export { HotkeysDevtoolsPanel, type HotkeysDevtoolsPreactInit, hotkeysDevtoolsPlugin };
15
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ import { HotkeysDevtoolsPanel as HotkeysDevtoolsPanel$1, HotkeysDevtoolsPanelNoOp } from "./PreactHotkeysDevtools.js";
2
+ import { hotkeysDevtoolsNoOpPlugin, hotkeysDevtoolsPlugin as hotkeysDevtoolsPlugin$1 } from "./plugin.js";
3
+
4
+ //#region src/index.ts
5
+ const HotkeysDevtoolsPanel = process.env.NODE_ENV !== "development" ? HotkeysDevtoolsPanelNoOp : HotkeysDevtoolsPanel$1;
6
+ const hotkeysDevtoolsPlugin = process.env.NODE_ENV !== "development" ? hotkeysDevtoolsNoOpPlugin : hotkeysDevtoolsPlugin$1;
7
+
8
+ //#endregion
9
+ export { HotkeysDevtoolsPanel, hotkeysDevtoolsPlugin };
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["Devtools.HotkeysDevtoolsPanelNoOp","Devtools.HotkeysDevtoolsPanel","plugin.hotkeysDevtoolsNoOpPlugin","plugin.hotkeysDevtoolsPlugin"],"sources":["../src/index.ts"],"sourcesContent":["import * as Devtools from './PreactHotkeysDevtools'\nimport * as plugin from './plugin'\n\nexport const HotkeysDevtoolsPanel =\n process.env.NODE_ENV !== 'development'\n ? Devtools.HotkeysDevtoolsPanelNoOp\n : Devtools.HotkeysDevtoolsPanel\n\nexport const hotkeysDevtoolsPlugin =\n process.env.NODE_ENV !== 'development'\n ? plugin.hotkeysDevtoolsNoOpPlugin\n : plugin.hotkeysDevtoolsPlugin\n\nexport type { HotkeysDevtoolsPreactInit } from './PreactHotkeysDevtools'\n"],"mappings":";;;;AAGA,MAAa,uBACX,QAAQ,IAAI,aAAa,gBACrBA,2BACAC;AAEN,MAAa,wBACX,QAAQ,IAAI,aAAa,gBACrBC,4BACAC"}
package/dist/plugin.js ADDED
@@ -0,0 +1,12 @@
1
+ import { HotkeysDevtoolsPanel } from "./PreactHotkeysDevtools.js";
2
+ import { createPreactPlugin } from "@tanstack/devtools-utils/preact";
3
+
4
+ //#region src/plugin.tsx
5
+ const [hotkeysDevtoolsPlugin, hotkeysDevtoolsNoOpPlugin] = createPreactPlugin({
6
+ name: "TanStack Hotkeys",
7
+ Component: HotkeysDevtoolsPanel
8
+ });
9
+
10
+ //#endregion
11
+ export { hotkeysDevtoolsNoOpPlugin, hotkeysDevtoolsPlugin };
12
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","names":[],"sources":["../src/plugin.tsx"],"sourcesContent":["import { createPreactPlugin } from '@tanstack/devtools-utils/preact'\nimport { HotkeysDevtoolsPanel } from './PreactHotkeysDevtools'\n\nconst [hotkeysDevtoolsPlugin, hotkeysDevtoolsNoOpPlugin] = createPreactPlugin({\n name: 'TanStack Hotkeys',\n Component: HotkeysDevtoolsPanel,\n})\n\nexport { hotkeysDevtoolsPlugin, hotkeysDevtoolsNoOpPlugin }\n"],"mappings":";;;;AAGA,MAAM,CAAC,uBAAuB,6BAA6B,mBAAmB;CAC5E,MAAM;CACN,WAAW;CACZ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@tanstack/preact-hotkeys-devtools",
3
+ "version": "0.3.0",
4
+ "description": "Preact devtools for TanStack Hotkeys",
5
+ "author": "Tanner Linsley",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/TanStack/hotkeys.git",
10
+ "directory": "packages/preact-hotkeys-devtools"
11
+ },
12
+ "homepage": "https://tanstack.com/hotkeys",
13
+ "funding": {
14
+ "type": "github",
15
+ "url": "https://github.com/sponsors/tannerlinsley"
16
+ },
17
+ "keywords": [
18
+ "preact",
19
+ "tanstack",
20
+ "keys",
21
+ "devtools",
22
+ "hotkeys",
23
+ "keyboard"
24
+ ],
25
+ "scripts": {
26
+ "clean": "premove ./build ./dist",
27
+ "lint": "eslint ./src",
28
+ "lint:fix": "eslint ./src --fix",
29
+ "test:eslint": "eslint ./src",
30
+ "test:lib": "vitest --passWithNoTests",
31
+ "test:lib:dev": "pnpm test:lib --watch",
32
+ "test:types": "tsc",
33
+ "build": "tsdown"
34
+ },
35
+ "type": "module",
36
+ "types": "./dist/index.d.ts",
37
+ "exports": {
38
+ ".": "./dist/index.js",
39
+ "./package.json": "./package.json"
40
+ },
41
+ "sideEffects": false,
42
+ "engines": {
43
+ "node": ">=18"
44
+ },
45
+ "files": [
46
+ "dist/",
47
+ "src"
48
+ ],
49
+ "peerDependencies": {
50
+ "preact": ">=10.0.0"
51
+ },
52
+ "dependencies": {
53
+ "@tanstack/devtools-utils": "^0.3.0",
54
+ "@tanstack/hotkeys-devtools": "workspace:*"
55
+ },
56
+ "devDependencies": {
57
+ "@preact/preset-vite": "^2.10.2",
58
+ "preact": "^10.27.2"
59
+ }
60
+ }
@@ -0,0 +1,10 @@
1
+ import { createPreactPanel } from '@tanstack/devtools-utils/preact'
2
+ import { HotkeysDevtoolsCore } from '@tanstack/hotkeys-devtools'
3
+ import type { DevtoolsPanelProps } from '@tanstack/devtools-utils/preact'
4
+
5
+ export interface HotkeysDevtoolsPreactInit extends DevtoolsPanelProps {}
6
+
7
+ const [HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp] =
8
+ createPreactPanel(HotkeysDevtoolsCore)
9
+
10
+ export { HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp }
package/src/index.ts ADDED
@@ -0,0 +1,14 @@
1
+ import * as Devtools from './PreactHotkeysDevtools'
2
+ import * as plugin from './plugin'
3
+
4
+ export const HotkeysDevtoolsPanel =
5
+ process.env.NODE_ENV !== 'development'
6
+ ? Devtools.HotkeysDevtoolsPanelNoOp
7
+ : Devtools.HotkeysDevtoolsPanel
8
+
9
+ export const hotkeysDevtoolsPlugin =
10
+ process.env.NODE_ENV !== 'development'
11
+ ? plugin.hotkeysDevtoolsNoOpPlugin
12
+ : plugin.hotkeysDevtoolsPlugin
13
+
14
+ export type { HotkeysDevtoolsPreactInit } from './PreactHotkeysDevtools'
package/src/plugin.tsx ADDED
@@ -0,0 +1,9 @@
1
+ import { createPreactPlugin } from '@tanstack/devtools-utils/preact'
2
+ import { HotkeysDevtoolsPanel } from './PreactHotkeysDevtools'
3
+
4
+ const [hotkeysDevtoolsPlugin, hotkeysDevtoolsNoOpPlugin] = createPreactPlugin({
5
+ name: 'TanStack Hotkeys',
6
+ Component: HotkeysDevtoolsPanel,
7
+ })
8
+
9
+ export { hotkeysDevtoolsPlugin, hotkeysDevtoolsNoOpPlugin }