@tanstack/svelte-hotkeys-devtools 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/README.md +140 -0
- package/dist/SvelteHotkeysDevtools.d.ts +6 -0
- package/dist/SvelteHotkeysDevtools.js +15 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +8 -0
- package/dist/plugin.d.ts +14 -0
- package/dist/plugin.js +7 -0
- package/dist/production.d.ts +3 -0
- package/dist/production.js +2 -0
- package/package.json +74 -0
package/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source
|
|
4
|
+
media="(prefers-color-scheme: dark)"
|
|
5
|
+
srcset="https://tanstack.com/api/readme/hotkeys.png?theme=dark"
|
|
6
|
+
/>
|
|
7
|
+
<source
|
|
8
|
+
media="(prefers-color-scheme: light)"
|
|
9
|
+
srcset="https://tanstack.com/api/readme/hotkeys.png"
|
|
10
|
+
/>
|
|
11
|
+
<img
|
|
12
|
+
src="https://tanstack.com/api/readme/hotkeys.png"
|
|
13
|
+
alt="TanStack Hotkeys"
|
|
14
|
+
width="900"
|
|
15
|
+
/>
|
|
16
|
+
</picture>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<br />
|
|
20
|
+
|
|
21
|
+
<div align="center">
|
|
22
|
+
<a href="https://www.npmjs.com/package/@tanstack/hotkeys" target="\_parent">
|
|
23
|
+
<img alt="" src="https://img.shields.io/npm/dm/@tanstack/hotkeys.svg" alt="npm downloads" />
|
|
24
|
+
</a>
|
|
25
|
+
<a href="https://github.com/TanStack/hotkeys" target="\_parent">
|
|
26
|
+
<img alt="" src="https://img.shields.io/github/stars/TanStack/hotkeys.svg?style=social&label=Star" alt="GitHub stars" />
|
|
27
|
+
</a>
|
|
28
|
+
<a href="https://bundlephobia.com/result?p=@tanstack/react-hotkeys@latest" target="\_parent">
|
|
29
|
+
<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-hotkeys@latest" alt="Bundle size" />
|
|
30
|
+
</a>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div align="center">
|
|
34
|
+
<a href="#badge">
|
|
35
|
+
<img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
|
|
36
|
+
</a>
|
|
37
|
+
<a href="#badge">
|
|
38
|
+
<img src="https://img.shields.io/github/v/release/tanstack/hotkeys" alt="Release"/>
|
|
39
|
+
</a>
|
|
40
|
+
<a href="https://twitter.com/tan_stack">
|
|
41
|
+
<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>
|
|
42
|
+
</a>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div align="center">
|
|
46
|
+
|
|
47
|
+
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
|
|
48
|
+
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
# TanStack Hotkeys
|
|
52
|
+
|
|
53
|
+
> [!NOTE]
|
|
54
|
+
> TanStack Hotkeys is alpha. We are actively developing the library and are open to feedback and contributions.
|
|
55
|
+
|
|
56
|
+
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.
|
|
57
|
+
|
|
58
|
+
- Type-safe bindings — template strings (`Mod+Shift+S`, `Escape`) or parsed objects for full control
|
|
59
|
+
- Flexible options — `keydown`/`keyup`, `preventDefault`, `stopPropagation`, conditional enabled, `requireReset`
|
|
60
|
+
- Cross-platform Mod — maps to Cmd on macOS and Ctrl on Windows/Linux
|
|
61
|
+
- Batteries included — validation + matching, sequences (Vim-style), key-state tracking, recorder UI helpers, framework adapters, and devtools
|
|
62
|
+
|
|
63
|
+
### <a href="https://tanstack.com/hotkeys">Read the docs →</a>
|
|
64
|
+
|
|
65
|
+
<br />
|
|
66
|
+
|
|
67
|
+
> [!NOTE]
|
|
68
|
+
> You may know **TanStack Hotkeys** by our adapter names, too!
|
|
69
|
+
>
|
|
70
|
+
> - [**Alpine Hotkeys**](https://tanstack.com/hotkeys/latest/docs/framework/alpine/quick-start)
|
|
71
|
+
> - [**Ember Hotkeys**](https://tanstack.com/hotkeys/latest/docs/framework/ember/quick-start)
|
|
72
|
+
> - [**Octane Hotkeys**](https://tanstack.com/hotkeys/latest/docs/framework/octane/quick-start)
|
|
73
|
+
> - [**React Hotkeys**](https://tanstack.com/hotkeys/latest/docs/framework/react/react-hotkeys)
|
|
74
|
+
> - [**Preact Hotkeys**](https://tanstack.com/hotkeys/latest/docs/framework/preact/preact-hotkeys)
|
|
75
|
+
> - [**Solid Hotkeys**](https://tanstack.com/hotkeys/latest/docs/framework/solid/reference)
|
|
76
|
+
> - [**Angular Hotkeys**](https://tanstack.com/hotkeys/latest/docs/framework/angular/reference)
|
|
77
|
+
> - [**Vue Hotkeys**](https://tanstack.com/hotkeys/latest/docs/framework/vue/reference)
|
|
78
|
+
> - [**Lit Hotkeys**](https://tanstack.com/hotkeys/latest/docs/framework/lit/reference)
|
|
79
|
+
> - [**Svelte Hotkeys**](https://tanstack.com/hotkeys/latest/docs/framework/svelte/reference)
|
|
80
|
+
|
|
81
|
+
## Get Involved
|
|
82
|
+
|
|
83
|
+
- We welcome issues and pull requests!
|
|
84
|
+
- Participate in [GitHub discussions](https://github.com/TanStack/hotkeys/discussions)
|
|
85
|
+
- Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ)
|
|
86
|
+
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions
|
|
87
|
+
|
|
88
|
+
## Partners
|
|
89
|
+
|
|
90
|
+
<div align="center">
|
|
91
|
+
|
|
92
|
+
<table align="center">
|
|
93
|
+
<tr>
|
|
94
|
+
<td>
|
|
95
|
+
<a href="https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS" >
|
|
96
|
+
<picture>
|
|
97
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-D643Zkrv.svg" height="40" />
|
|
98
|
+
<source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-CIzGLYU_.svg" height="40" />
|
|
99
|
+
<img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" />
|
|
100
|
+
</picture>
|
|
101
|
+
</a>
|
|
102
|
+
</td>
|
|
103
|
+
<td>
|
|
104
|
+
<a href="https://www.cloudflare.com?utm_source=tanstack">
|
|
105
|
+
<picture>
|
|
106
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-Co-Tyjbl.svg" height="60" />
|
|
107
|
+
<source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-6Ojsn8yh.svg" height="60" />
|
|
108
|
+
<img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" />
|
|
109
|
+
</picture>
|
|
110
|
+
</a>
|
|
111
|
+
</td>
|
|
112
|
+
</tr>
|
|
113
|
+
</table>
|
|
114
|
+
|
|
115
|
+
<div align="center">
|
|
116
|
+
<img src="media/partner_logo.svg" alt="Keys & you?" height="65">
|
|
117
|
+
<p>
|
|
118
|
+
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.
|
|
119
|
+
</p>
|
|
120
|
+
<a href="mailto:partners@tanstack.com?subject=TanStack Hotkeys Partnership"><b>LET'S CHAT</b></a>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
## Explore the TanStack Ecosystem
|
|
126
|
+
|
|
127
|
+
- <a href="https://github.com/tanstack/config"><b>TanStack Config</b></a> – Tooling for JS/TS packages
|
|
128
|
+
- <a href="https://github.com/tanstack/db"><b>TanStack DB</b></a> – Reactive sync client store
|
|
129
|
+
- <a href="https://github.com/tanstack/devtools"><b>TanStack DevTools</b></a> – Unified devtools panel
|
|
130
|
+
- <a href="https://github.com/tanstack/form"><b>TanStack Form</b></a> – Type‑safe form state
|
|
131
|
+
- <a href="https://github.com/tanstack/hotkeys"><b>TanStack Hotkeys</b></a> – Type‑safe keyboard shortcuts
|
|
132
|
+
- <a href="https://github.com/tanstack/query"><b>TanStack Query</b></a> – Async state & caching
|
|
133
|
+
- <a href="https://github.com/tanstack/ranger"><b>TanStack Ranger</b></a> – Range & slider primitives
|
|
134
|
+
- <a href="https://github.com/tanstack/router"><b>TanStack Router</b></a> – Type‑safe routing, caching & URL state
|
|
135
|
+
- <a href="https://github.com/tanstack/start"><b>TanStack Start</b></a> – Full‑stack SSR & streaming
|
|
136
|
+
- <a href="https://github.com/tanstack/store"><b>TanStack Store</b></a> – Reactive data store
|
|
137
|
+
- <a href="https://github.com/tanstack/table"><b>TanStack Table</b></a> – Headless datagrids
|
|
138
|
+
- <a href="https://github.com/tanstack/virtual"><b>TanStack Virtual</b></a> – Virtualized rendering
|
|
139
|
+
|
|
140
|
+
… and more at <a href="https://tanstack.com"><b>TanStack.com »</b></a>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DevtoolsPanelProps } from '@tanstack/devtools-utils/svelte';
|
|
2
|
+
import type { Component } from 'svelte';
|
|
3
|
+
export interface HotkeysDevtoolsSvelteInit extends Partial<DevtoolsPanelProps> {
|
|
4
|
+
}
|
|
5
|
+
export declare const HotkeysDevtoolsPanel: Component<HotkeysDevtoolsSvelteInit, {}, string>;
|
|
6
|
+
export declare const HotkeysDevtoolsPanelNoOp: Component<HotkeysDevtoolsSvelteInit, {}, string>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createSveltePanel } from '@tanstack/devtools-utils/svelte';
|
|
2
|
+
import { HotkeysDevtoolsCore } from '@tanstack/hotkeys-devtools/production';
|
|
3
|
+
const panels = createSveltePanel(HotkeysDevtoolsCore);
|
|
4
|
+
function withDefaults(Panel) {
|
|
5
|
+
return (internals, props) => Panel(internals, {
|
|
6
|
+
get theme() {
|
|
7
|
+
return props.theme ?? 'dark';
|
|
8
|
+
},
|
|
9
|
+
get devtoolsOpen() {
|
|
10
|
+
return props.devtoolsOpen ?? true;
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export const HotkeysDevtoolsPanel = withDefaults(panels[0]);
|
|
15
|
+
export const HotkeysDevtoolsPanelNoOp = withDefaults(panels[1]);
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as Devtools from './SvelteHotkeysDevtools';
|
|
2
|
+
export declare const HotkeysDevtoolsPanel: import("svelte").Component<Devtools.HotkeysDevtoolsSvelteInit, {}, string>;
|
|
3
|
+
export declare const hotkeysDevtoolsPlugin: ((props?: Devtools.HotkeysDevtoolsSvelteInit | undefined) => {
|
|
4
|
+
component: import("svelte").Component<Devtools.HotkeysDevtoolsSvelteInit, {}, string>;
|
|
5
|
+
props: Devtools.HotkeysDevtoolsSvelteInit | undefined;
|
|
6
|
+
name: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
defaultOpen?: boolean;
|
|
9
|
+
}) | ((props?: Devtools.HotkeysDevtoolsSvelteInit | undefined) => {
|
|
10
|
+
component: import("svelte/legacy").LegacyComponentType;
|
|
11
|
+
props: Devtools.HotkeysDevtoolsSvelteInit | undefined;
|
|
12
|
+
name: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
defaultOpen?: boolean;
|
|
15
|
+
});
|
|
16
|
+
export type { HotkeysDevtoolsSvelteInit } from './SvelteHotkeysDevtools';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as Devtools from './SvelteHotkeysDevtools';
|
|
2
|
+
import * as plugin from './plugin';
|
|
3
|
+
export const HotkeysDevtoolsPanel = process.env.NODE_ENV !== 'development'
|
|
4
|
+
? Devtools.HotkeysDevtoolsPanelNoOp
|
|
5
|
+
: Devtools.HotkeysDevtoolsPanel;
|
|
6
|
+
export const hotkeysDevtoolsPlugin = process.env.NODE_ENV !== 'development'
|
|
7
|
+
? plugin.hotkeysDevtoolsNoOpPlugin
|
|
8
|
+
: plugin.hotkeysDevtoolsPlugin;
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const hotkeysDevtoolsPlugin: (props?: import("./SvelteHotkeysDevtools").HotkeysDevtoolsSvelteInit | undefined) => {
|
|
2
|
+
component: import("svelte").Component<import("./SvelteHotkeysDevtools").HotkeysDevtoolsSvelteInit, {}, string>;
|
|
3
|
+
props: import("./SvelteHotkeysDevtools").HotkeysDevtoolsSvelteInit | undefined;
|
|
4
|
+
name: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
}, hotkeysDevtoolsNoOpPlugin: (props?: import("./SvelteHotkeysDevtools").HotkeysDevtoolsSvelteInit | undefined) => {
|
|
8
|
+
component: import("svelte/legacy").LegacyComponentType;
|
|
9
|
+
props: import("./SvelteHotkeysDevtools").HotkeysDevtoolsSvelteInit | undefined;
|
|
10
|
+
name: string;
|
|
11
|
+
id?: string;
|
|
12
|
+
defaultOpen?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export { hotkeysDevtoolsPlugin, hotkeysDevtoolsNoOpPlugin };
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createSveltePlugin } from '@tanstack/devtools-utils/svelte';
|
|
2
|
+
import { HotkeysDevtoolsPanel } from './SvelteHotkeysDevtools';
|
|
3
|
+
const [hotkeysDevtoolsPlugin, hotkeysDevtoolsNoOpPlugin] = createSveltePlugin({
|
|
4
|
+
name: 'TanStack Hotkeys',
|
|
5
|
+
Component: HotkeysDevtoolsPanel,
|
|
6
|
+
});
|
|
7
|
+
export { hotkeysDevtoolsPlugin, hotkeysDevtoolsNoOpPlugin };
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tanstack/svelte-hotkeys-devtools",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Svelte 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/svelte-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
|
+
"svelte",
|
|
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": "svelte-package --input ./src --output ./dist",
|
|
34
|
+
"test:build": "publint --strict && node ../../scripts/verify-package.ts"
|
|
35
|
+
},
|
|
36
|
+
"type": "module",
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
38
|
+
"exports": {
|
|
39
|
+
".": {
|
|
40
|
+
"types": "./dist/index.d.ts",
|
|
41
|
+
"svelte": "./dist/index.js",
|
|
42
|
+
"import": "./dist/index.js"
|
|
43
|
+
},
|
|
44
|
+
"./production": {
|
|
45
|
+
"types": "./dist/production.d.ts",
|
|
46
|
+
"svelte": "./dist/production.js",
|
|
47
|
+
"import": "./dist/production.js"
|
|
48
|
+
},
|
|
49
|
+
"./package.json": "./package.json"
|
|
50
|
+
},
|
|
51
|
+
"sideEffects": false,
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=20"
|
|
54
|
+
},
|
|
55
|
+
"files": [
|
|
56
|
+
"dist"
|
|
57
|
+
],
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"svelte": "^5.25.0"
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"@tanstack/devtools-utils": "^0.7.0",
|
|
63
|
+
"@tanstack/hotkeys-devtools": "workspace:*"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@sveltejs/package": "^3.0.0",
|
|
67
|
+
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
|
68
|
+
"@typescript-eslint/parser": "^8.71.0",
|
|
69
|
+
"eslint-plugin-svelte": "^3.23.0",
|
|
70
|
+
"svelte": "^5.57.1"
|
|
71
|
+
},
|
|
72
|
+
"module": "dist/index.js",
|
|
73
|
+
"svelte": "./dist/index.js"
|
|
74
|
+
}
|