Skip to content

Commit 1ff0709

Browse files
authored
Merge pull request #91 from Pilpin/master
fix(release): bump all dependencies to latest BREAKING CHANGE: Angular v17 is required
2 parents aac1fc2 + 26a6048 commit 1ff0709

19 files changed

+9562
-8583
lines changed

README.md

+20-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ Web apps are getting closer and closer to be desktop-class applications. With th
3636
## Compatibility with Angular Versions
3737

3838
| @ngneat/hotkeys | Angular |
39-
| --------------- | ------- |
39+
|-----------------|---------|
40+
| 3.x.x | >=17.2 |
4041
| 2.x.x | >=16 |
4142
| 1.3.x | >=14 |
4243
| 1.2.x | <=13 |
@@ -47,6 +48,7 @@ Web apps are getting closer and closer to be desktop-class applications. With th
4748

4849
## Usage
4950

51+
### Module
5052
Add `HotkeysModule` in your `AppModule`:
5153

5254
```ts
@@ -58,6 +60,17 @@ import { HotkeysModule } from '@ngneat/hotkeys';
5860
export class AppModule {}
5961
```
6062

63+
### Standalone
64+
Add `HotkeysService` in the standalone components :
65+
66+
```ts
67+
@Component({
68+
standalone: true,
69+
imports: [HotkeysDirective],
70+
})
71+
export class AppComponent {}
72+
```
73+
6174
Now you have two ways to start adding shortcuts to your application:
6275

6376
## Hotkeys Directive
@@ -137,7 +150,7 @@ interface Options {
137150
}
138151
```
139152

140-
#### `onShortcut`
153+
### `onShortcut`
141154

142155
Listen to any registered hotkey. For example:
143156

@@ -148,7 +161,7 @@ const unsubscribe = this.hotkeys.onShortcut((event, key, target) => console.log(
148161
unsubscribe();
149162
```
150163

151-
#### `registerHelpModal`
164+
### `registerHelpModal`
152165

153166
Display a help dialog listing all visible hotkeys:
154167

@@ -175,14 +188,15 @@ export class AppComponent implements AfterViewInit {
175188
```
176189

177190
It accepts a second input that allows defining the hotkey that should open the dialog. The default shortcut is `Shift + ?`. Here's how `HotkeysHelpComponent` looks like:
178-
191+
```
179192
<p align="center">
180193
<img width="50%" height="50%" src="./help_screenshot.png">
181194
</p>
195+
```
182196

183197
You can also provide a custom component. To help you with that, the service exposes the `getShortcuts` method.
184198

185-
#### `removeShortcuts`
199+
### `removeShortcuts`
186200

187201
Remove previously registered shortcuts.
188202

@@ -193,7 +207,7 @@ this.hotkeys.removeShortcuts('meta.a');
193207
this.hotkeys.removeShortcuts(['meta.1', 'meta.2']);
194208
```
195209

196-
#### `setSequenceDebounce`
210+
### `setSequenceDebounce`
197211

198212
Set the number of milliseconds to debounce a sequence of keys
199213

angular.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,18 @@
6262
"serve": {
6363
"builder": "@angular-devkit/build-angular:dev-server",
6464
"options": {
65-
"browserTarget": "hotkeys:build"
65+
"buildTarget": "hotkeys:build"
6666
},
6767
"configurations": {
6868
"production": {
69-
"browserTarget": "hotkeys:build:production"
69+
"buildTarget": "hotkeys:build:production"
7070
}
7171
}
7272
},
7373
"extract-i18n": {
7474
"builder": "@angular-devkit/build-angular:extract-i18n",
7575
"options": {
76-
"browserTarget": "hotkeys:build"
76+
"buildTarget": "hotkeys:build"
7777
}
7878
},
7979
"test": {
@@ -130,5 +130,8 @@
130130
}
131131
}
132132
}
133+
},
134+
"cli": {
135+
"analytics": false
133136
}
134137
}

0 commit comments

Comments
 (0)