@wamlib/ngx-screen-size-reporter 1.0.0 → 1.0.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 +29 -54
- package/package.json +11 -1
package/README.md
CHANGED
|
@@ -1,63 +1,38 @@
|
|
|
1
|
-
# NgxScreenSizeReporter
|
|
2
|
-
|
|
3
|
-
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 21.1.0.
|
|
4
|
-
|
|
5
|
-
## Code scaffolding
|
|
6
|
-
|
|
7
|
-
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
ng generate component component-name
|
|
11
1
|
```
|
|
12
|
-
|
|
13
|
-
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
ng generate --help
|
|
2
|
+
npm install @wamlib/ngx-screen-size-reporter
|
|
17
3
|
```
|
|
18
4
|
|
|
19
|
-
##
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
## Initialization
|
|
6
|
+
```ts name="src/app/app.config.ts" {3}
|
|
7
|
+
export const appConfig: ApplicationConfig = {
|
|
8
|
+
providers: [
|
|
9
|
+
provideScreenSizeReporter()
|
|
10
|
+
]
|
|
11
|
+
};
|
|
25
12
|
```
|
|
26
13
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
cd dist/ngx-screen-size-reporter
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
39
|
-
```bash
|
|
40
|
-
npm publish
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Running unit tests
|
|
44
|
-
|
|
45
|
-
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
ng test
|
|
14
|
+
## Initialization (With optional custom breakpoints)
|
|
15
|
+
```ts name="src/app/app.config.ts" {3}
|
|
16
|
+
export const appConfig: ApplicationConfig = {
|
|
17
|
+
providers: [
|
|
18
|
+
provideScreenSizeReporter({ small: '(max-width: 600px)' })
|
|
19
|
+
]
|
|
20
|
+
};
|
|
49
21
|
```
|
|
50
22
|
|
|
51
|
-
##
|
|
23
|
+
## Usage
|
|
24
|
+
```ts
|
|
25
|
+
import { ScreenSizeReporter } from '@wamlib/ngx-screen-size-reporter';
|
|
52
26
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
27
|
+
@Component({...})
|
|
28
|
+
export class AppComponent {
|
|
29
|
+
protected screenSizeReporter = inject(ScreenSizeReporter);
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
```html
|
|
33
|
+
@if (screenSizeReporter.isSmallScreen()) {
|
|
34
|
+
<app-mobile-nav />
|
|
35
|
+
} @else {
|
|
36
|
+
<app-desktop-sidebar />
|
|
37
|
+
}
|
|
57
38
|
```
|
|
58
|
-
|
|
59
|
-
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
60
|
-
|
|
61
|
-
## Additional Resources
|
|
62
|
-
|
|
63
|
-
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
package/package.json
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wamlib/ngx-screen-size-reporter",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "A lightweight library for reporting and reacting to screen size changes in Angular apps.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"angular",
|
|
7
|
+
"breakpoints",
|
|
8
|
+
"signals"
|
|
9
|
+
],
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://tangled.org/tmyams.bsky.social/ngx-screen-size-reporter"
|
|
13
|
+
},
|
|
4
14
|
"peerDependencies": {
|
|
5
15
|
"@angular/common": ">=15.0.0",
|
|
6
16
|
"@angular/core": ">=15.0.0",
|