keyroute 0.1.0 → 0.1.2

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
@@ -1,24 +1,47 @@
1
- # Keyroute
1
+ # keyroute
2
2
 
3
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.3.0.
3
+ Simple keyboard shortcuts for web applications.
4
+ Framework-agnostic. Tiny. No dependencies.
4
5
 
5
- ## Code scaffolding
6
+ ---
6
7
 
7
- Run `ng generate component component-name --project keyroute` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project keyroute`.
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
- ## Build
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
- Run `ng build keyroute` to build the project. The build artifacts will be stored in the `dist/` directory.
13
+ ```ts
14
+ createKeyroute({
15
+ 'ctrl+s': () => save(),
16
+ 'esc': () => close()
17
+ });```
13
18
 
14
- ## Publishing
19
+ ## Installation
15
20
 
16
- After building your library with `ng build keyroute`, go to the dist folder `cd dist/keyroute` and run `npm publish`.
21
+ ```bash
22
+ npm install keyroute
23
+ ```
17
24
 
18
- ## Running unit tests
25
+ ## Basic usage in Angular
19
26
 
20
- Run `ng test keyroute` to execute the unit tests via [Karma](https://karma-runner.github.io).
27
+ ```ts
28
+ import { createKeyroute } from 'keyroute';
21
29
 
22
- ## Further help
30
+ const shortcuts = createKeyroute({
31
+ 'ctrl+s': () => console.log('Saved'),
32
+ 'esc': () => console.log('Closed')
33
+ });
23
34
 
24
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
35
+ // Call when you no longer need the shortcuts
36
+ shortcuts.destroy();
37
+ ```
38
+
39
+ ## Contributing
40
+
41
+ PRs welcome.
42
+ If you have ideas for:
43
+ - additional key combos
44
+ - accessibility improvements
45
+ - framework helpers
46
+
47
+ Feel free to open an issue.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keyroute",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
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",
Binary file