keyroute 0.1.0 → 0.1.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 +24 -13
- package/keyroute-0.1.1.tgz +0 -0
- package/package.json +5 -1
- package/keyroute-0.1.0.tgz +0 -0
package/README.md
CHANGED
|
@@ -1,24 +1,35 @@
|
|
|
1
|
-
#
|
|
1
|
+
# keyroute
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Simple keyboard shortcuts for web applications.
|
|
4
|
+
Framework-agnostic. Tiny. No dependencies.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
---
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
> Note: Don't forget to add `--project keyroute` or else it will be added to the default project in your `angular.json` file.
|
|
8
|
+
## What is keyroute?
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
`keyroute` lets you map keyboard shortcuts to application actions in a simple and predictable way.
|
|
11
|
+
Define your own keyboard shortcut and make your website more accessible.
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
```ts
|
|
14
|
+
createKeyroute({
|
|
15
|
+
'ctrl+s': () => save(),
|
|
16
|
+
'esc': () => close()
|
|
17
|
+
});
|
|
13
18
|
|
|
14
|
-
##
|
|
19
|
+
## Installation
|
|
15
20
|
|
|
16
|
-
|
|
21
|
+
```bash
|
|
22
|
+
npm install keyroute
|
|
17
23
|
|
|
18
|
-
##
|
|
24
|
+
## Basic usage in Angular
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
```ts
|
|
27
|
+
import { createKeyroute } from 'keyroute';
|
|
21
28
|
|
|
22
|
-
|
|
29
|
+
const shortcuts = createKeyroute({
|
|
30
|
+
'ctrl+s': () => console.log('Saved'),
|
|
31
|
+
'esc': () => console.log('Closed')
|
|
32
|
+
});
|
|
23
33
|
|
|
24
|
-
|
|
34
|
+
// Call when you no longer need the shortcuts
|
|
35
|
+
shortcuts.destroy();
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keyroute",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Route keyboard shortcuts to application actions. Framework-agnostic keyboard shortcut routing for web applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"keyboard",
|
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"tslib": "^2.3.0"
|
|
26
26
|
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/mervynmanilall/keyroute"
|
|
30
|
+
},
|
|
27
31
|
"sideEffects": false,
|
|
28
32
|
"module": "fesm2022/keyroute.mjs",
|
|
29
33
|
"typings": "index.d.ts",
|
package/keyroute-0.1.0.tgz
DELETED
|
Binary file
|