@tanstack/react-hotkeys-devtools 0.0.1 → 0.1.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 +21 -0
- package/README.md +121 -45
- package/dist/ReactHotkeysDevtools.d.ts +9 -0
- package/dist/ReactHotkeysDevtools.js +9 -0
- package/dist/ReactHotkeysDevtools.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +17 -0
- package/dist/plugin.js +12 -0
- package/dist/plugin.js.map +1 -0
- package/dist/production.d.ts +3 -0
- package/dist/production.js +6 -0
- package/package.json +65 -7
- package/src/ReactHotkeysDevtools.tsx +10 -0
- package/src/index.ts +16 -0
- package/src/plugin.tsx +9 -0
- package/src/production.ts +7 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tanner Linsley
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,45 +1,121 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
+
> - Solid Hotkeys – needs a contributor!
|
|
58
|
+
> - Angular Hotkeys – needs a contributor!
|
|
59
|
+
> - Svelte Hotkeys – needs a contributor!
|
|
60
|
+
> - Vue Hotkeys – needs a contributor!
|
|
61
|
+
|
|
62
|
+
## Get Involved
|
|
63
|
+
|
|
64
|
+
- We welcome issues and pull requests!
|
|
65
|
+
- Participate in [GitHub discussions](https://github.com/TanStack/hotkeys/discussions)
|
|
66
|
+
- Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ)
|
|
67
|
+
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions
|
|
68
|
+
|
|
69
|
+
## Partners
|
|
70
|
+
|
|
71
|
+
<div align="center">
|
|
72
|
+
|
|
73
|
+
<table align="center">
|
|
74
|
+
<tr>
|
|
75
|
+
<td>
|
|
76
|
+
<a href="https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS" >
|
|
77
|
+
<picture>
|
|
78
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-D643Zkrv.svg" height="40" />
|
|
79
|
+
<source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-CIzGLYU_.svg" height="40" />
|
|
80
|
+
<img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" />
|
|
81
|
+
</picture>
|
|
82
|
+
</a>
|
|
83
|
+
</td>
|
|
84
|
+
<td>
|
|
85
|
+
<a href="https://www.cloudflare.com?utm_source=tanstack">
|
|
86
|
+
<picture>
|
|
87
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-Co-Tyjbl.svg" height="60" />
|
|
88
|
+
<source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-6Ojsn8yh.svg" height="60" />
|
|
89
|
+
<img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" />
|
|
90
|
+
</picture>
|
|
91
|
+
</a>
|
|
92
|
+
</td>
|
|
93
|
+
</tr>
|
|
94
|
+
</table>
|
|
95
|
+
|
|
96
|
+
<div align="center">
|
|
97
|
+
<img src="media/partner_logo.svg" alt="Keys & you?" height="65">
|
|
98
|
+
<p>
|
|
99
|
+
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.
|
|
100
|
+
</p>
|
|
101
|
+
<a href="mailto:partners@tanstack.com?subject=TanStack Hotkeys Partnership"><b>LET'S CHAT</b></a>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
## Explore the TanStack Ecosystem
|
|
107
|
+
|
|
108
|
+
- <a href="https://github.com/tanstack/config"><b>TanStack Config</b></a> – Tooling for JS/TS packages
|
|
109
|
+
- <a href="https://github.com/tanstack/db"><b>TanStack DB</b></a> – Reactive sync client store
|
|
110
|
+
- <a href="https://github.com/tanstack/devtools"><b>TanStack DevTools</b></a> – Unified devtools panel
|
|
111
|
+
- <a href="https://github.com/tanstack/form"><b>TanStack Form</b></a> – Type‑safe form state
|
|
112
|
+
- <a href="https://github.com/tanstack/hotkeys"><b>TanStack Hotkeys</b></a> – Type‑safe keyboard shortcuts
|
|
113
|
+
- <a href="https://github.com/tanstack/query"><b>TanStack Query</b></a> – Async state & caching
|
|
114
|
+
- <a href="https://github.com/tanstack/ranger"><b>TanStack Ranger</b></a> – Range & slider primitives
|
|
115
|
+
- <a href="https://github.com/tanstack/router"><b>TanStack Router</b></a> – Type‑safe routing, caching & URL state
|
|
116
|
+
- <a href="https://github.com/tanstack/start"><b>TanStack Start</b></a> – Full‑stack SSR & streaming
|
|
117
|
+
- <a href="https://github.com/tanstack/store"><b>TanStack Store</b></a> – Reactive data store
|
|
118
|
+
- <a href="https://github.com/tanstack/table"><b>TanStack Table</b></a> – Headless datagrids
|
|
119
|
+
- <a href="https://github.com/tanstack/virtual"><b>TanStack Virtual</b></a> – Virtualized rendering
|
|
120
|
+
|
|
121
|
+
… and more at <a href="https://tanstack.com"><b>TanStack.com »</b></a>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DevtoolsPanelProps } from "@tanstack/devtools-utils/react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/ReactHotkeysDevtools.d.ts
|
|
5
|
+
interface HotkeysDevtoolsReactInit extends DevtoolsPanelProps {}
|
|
6
|
+
declare const HotkeysDevtoolsPanel: (props: DevtoolsPanelProps | undefined) => react_jsx_runtime0.JSX.Element, HotkeysDevtoolsPanelNoOp: (_props: DevtoolsPanelProps | undefined) => react_jsx_runtime0.JSX.Element;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { HotkeysDevtoolsPanel, HotkeysDevtoolsReactInit };
|
|
9
|
+
//# sourceMappingURL=ReactHotkeysDevtools.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createReactPanel } from "@tanstack/devtools-utils/react";
|
|
2
|
+
import { HotkeysDevtoolsCore } from "@tanstack/hotkeys-devtools";
|
|
3
|
+
|
|
4
|
+
//#region src/ReactHotkeysDevtools.tsx
|
|
5
|
+
const [HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp] = createReactPanel(HotkeysDevtoolsCore);
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
export { HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp };
|
|
9
|
+
//# sourceMappingURL=ReactHotkeysDevtools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactHotkeysDevtools.js","names":[],"sources":["../src/ReactHotkeysDevtools.tsx"],"sourcesContent":["import { createReactPanel } from '@tanstack/devtools-utils/react'\nimport { HotkeysDevtoolsCore } from '@tanstack/hotkeys-devtools'\nimport type { DevtoolsPanelProps } from '@tanstack/devtools-utils/react'\n\nexport interface HotkeysDevtoolsReactInit extends DevtoolsPanelProps {}\n\nconst [HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp] =\n createReactPanel(HotkeysDevtoolsCore)\n\nexport { HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp }\n"],"mappings":";;;;AAMA,MAAM,CAAC,sBAAsB,4BAC3B,iBAAiB,oBAAoB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HotkeysDevtoolsReactInit } from "./ReactHotkeysDevtools.js";
|
|
2
|
+
import * as _tanstack_devtools_utils_react0 from "@tanstack/devtools-utils/react";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/index.d.ts
|
|
6
|
+
declare const HotkeysDevtoolsPanel: (props: _tanstack_devtools_utils_react0.DevtoolsPanelProps | undefined) => react_jsx_runtime0.JSX.Element;
|
|
7
|
+
declare const hotkeysDevtoolsPlugin: () => {
|
|
8
|
+
render: (_el: HTMLElement, theme: "light" | "dark") => react_jsx_runtime0.JSX.Element;
|
|
9
|
+
name: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
defaultOpen?: boolean;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { HotkeysDevtoolsPanel, type HotkeysDevtoolsReactInit, hotkeysDevtoolsPlugin };
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { HotkeysDevtoolsPanel as HotkeysDevtoolsPanel$1, HotkeysDevtoolsPanelNoOp } from "./ReactHotkeysDevtools.js";
|
|
4
|
+
import { hotkeysDevtoolsNoOpPlugin, hotkeysDevtoolsPlugin as hotkeysDevtoolsPlugin$1 } from "./plugin.js";
|
|
5
|
+
|
|
6
|
+
//#region src/index.ts
|
|
7
|
+
const HotkeysDevtoolsPanel = process.env.NODE_ENV !== "development" ? HotkeysDevtoolsPanelNoOp : HotkeysDevtoolsPanel$1;
|
|
8
|
+
const hotkeysDevtoolsPlugin = process.env.NODE_ENV !== "development" ? hotkeysDevtoolsNoOpPlugin : hotkeysDevtoolsPlugin$1;
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { HotkeysDevtoolsPanel, hotkeysDevtoolsPlugin };
|
|
12
|
+
//# 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":["'use client'\n\nimport * as Devtools from './ReactHotkeysDevtools'\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 { HotkeysDevtoolsReactInit } from './ReactHotkeysDevtools'\n"],"mappings":";;;;;;AAKA,MAAa,uBACX,QAAQ,IAAI,aAAa,gBACrBA,2BACAC;AAEN,MAAa,wBACX,QAAQ,IAAI,aAAa,gBACrBC,4BACAC"}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/plugin.d.ts
|
|
4
|
+
declare const hotkeysDevtoolsPlugin: () => {
|
|
5
|
+
render: (_el: HTMLElement, theme: "light" | "dark") => react_jsx_runtime0.JSX.Element;
|
|
6
|
+
name: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
defaultOpen?: boolean;
|
|
9
|
+
}, hotkeysDevtoolsNoOpPlugin: () => {
|
|
10
|
+
render: (_el: HTMLElement, _theme: "light" | "dark") => react_jsx_runtime0.JSX.Element;
|
|
11
|
+
name: string;
|
|
12
|
+
id?: string;
|
|
13
|
+
defaultOpen?: boolean;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { hotkeysDevtoolsPlugin };
|
|
17
|
+
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HotkeysDevtoolsPanel } from "./ReactHotkeysDevtools.js";
|
|
2
|
+
import { createReactPlugin } from "@tanstack/devtools-utils/react";
|
|
3
|
+
|
|
4
|
+
//#region src/plugin.tsx
|
|
5
|
+
const [hotkeysDevtoolsPlugin, hotkeysDevtoolsNoOpPlugin] = createReactPlugin({
|
|
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 { createReactPlugin } from '@tanstack/devtools-utils/react'\nimport { HotkeysDevtoolsPanel } from './ReactHotkeysDevtools'\n\nconst [hotkeysDevtoolsPlugin, hotkeysDevtoolsNoOpPlugin] = createReactPlugin({\n name: 'TanStack Hotkeys',\n Component: HotkeysDevtoolsPanel,\n})\n\nexport { hotkeysDevtoolsPlugin, hotkeysDevtoolsNoOpPlugin }\n"],"mappings":";;;;AAGA,MAAM,CAAC,uBAAuB,6BAA6B,kBAAkB;CAC3E,MAAM;CACN,WAAW;CACZ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-hotkeys-devtools",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "React 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/react-hotkeys-devtools"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://tanstack.com/hotkeys",
|
|
13
|
+
"funding": {
|
|
14
|
+
"type": "github",
|
|
15
|
+
"url": "https://github.com/sponsors/tannerlinsley"
|
|
16
|
+
},
|
|
5
17
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
18
|
+
"react",
|
|
19
|
+
"tanstack",
|
|
20
|
+
"keys",
|
|
21
|
+
"devtools",
|
|
22
|
+
"hotkeys",
|
|
23
|
+
"keyboard"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": "./dist/index.js",
|
|
29
|
+
"./production": "./dist/production.js",
|
|
30
|
+
"./package.json": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
"sideEffects": false,
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=18"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist/",
|
|
38
|
+
"src"
|
|
39
|
+
],
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@types/react": ">=16.8",
|
|
42
|
+
"@types/react-dom": ">=16.8",
|
|
43
|
+
"react": ">=16.8",
|
|
44
|
+
"react-dom": ">=16.8"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@tanstack/devtools-utils": "^0.3.0",
|
|
48
|
+
"@tanstack/hotkeys-devtools": "0.1.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@eslint-react/eslint-plugin": "^2.12.2",
|
|
52
|
+
"@types/react": "^19.2.13",
|
|
53
|
+
"@vitejs/plugin-react": "^5.1.4",
|
|
54
|
+
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
|
55
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
56
|
+
"react": "^19.2.4"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"clean": "premove ./build ./dist",
|
|
60
|
+
"lint": "eslint ./src",
|
|
61
|
+
"lint:fix": "eslint ./src --fix",
|
|
62
|
+
"test:eslint": "eslint ./src",
|
|
63
|
+
"test:lib": "vitest --passWithNoTests",
|
|
64
|
+
"test:lib:dev": "pnpm test:lib --watch",
|
|
65
|
+
"test:types": "tsc",
|
|
66
|
+
"build": "tsdown"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createReactPanel } from '@tanstack/devtools-utils/react'
|
|
2
|
+
import { HotkeysDevtoolsCore } from '@tanstack/hotkeys-devtools'
|
|
3
|
+
import type { DevtoolsPanelProps } from '@tanstack/devtools-utils/react'
|
|
4
|
+
|
|
5
|
+
export interface HotkeysDevtoolsReactInit extends DevtoolsPanelProps {}
|
|
6
|
+
|
|
7
|
+
const [HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp] =
|
|
8
|
+
createReactPanel(HotkeysDevtoolsCore)
|
|
9
|
+
|
|
10
|
+
export { HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp }
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as Devtools from './ReactHotkeysDevtools'
|
|
4
|
+
import * as plugin from './plugin'
|
|
5
|
+
|
|
6
|
+
export const HotkeysDevtoolsPanel =
|
|
7
|
+
process.env.NODE_ENV !== 'development'
|
|
8
|
+
? Devtools.HotkeysDevtoolsPanelNoOp
|
|
9
|
+
: Devtools.HotkeysDevtoolsPanel
|
|
10
|
+
|
|
11
|
+
export const hotkeysDevtoolsPlugin =
|
|
12
|
+
process.env.NODE_ENV !== 'development'
|
|
13
|
+
? plugin.hotkeysDevtoolsNoOpPlugin
|
|
14
|
+
: plugin.hotkeysDevtoolsPlugin
|
|
15
|
+
|
|
16
|
+
export type { HotkeysDevtoolsReactInit } from './ReactHotkeysDevtools'
|
package/src/plugin.tsx
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createReactPlugin } from '@tanstack/devtools-utils/react'
|
|
2
|
+
import { HotkeysDevtoolsPanel } from './ReactHotkeysDevtools'
|
|
3
|
+
|
|
4
|
+
const [hotkeysDevtoolsPlugin, hotkeysDevtoolsNoOpPlugin] = createReactPlugin({
|
|
5
|
+
name: 'TanStack Hotkeys',
|
|
6
|
+
Component: HotkeysDevtoolsPanel,
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
export { hotkeysDevtoolsPlugin, hotkeysDevtoolsNoOpPlugin }
|