@skeletonizer/angular 0.0.6-alpha.0 → 0.0.8-alpha.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 CHANGED
@@ -4,3 +4,256 @@ This is the Angular adapter for Skeletonizer. It provides a simple way to create
4
4
  ## Installation
5
5
  To install the package, run the following command:
6
6
  `npm install @skeletonizer/angular @skeletonizer/utils --save`
7
+
8
+ `@skeletonizer/angular` is always used in conjunction with `@skeletonizer/utils`. The `@skeletonizer/utils` package provides the core functionality for creating skeletonized views, while the `@skeletonizer/angular` package provides the Angular-specific functionality. **The versions should always match**.
9
+
10
+ ## Template Adjustments
11
+ Generally speaking, all you need to do to use the skeletonizer in the template, is to wrap the part of the template you wish to skeletonize in the `<skeletonizer-skeleton>` component and in a `<ng-template let-foo>` (all examples henceforth assume `foo` is called `context`). The `skeletonConfig`, `showSkeleton` and `scope` properties must be passed to the `<skeletonizer-skeleton>` as inputs.
12
+ Furthermore, all the data that you wish to access in the skeletonized part of the template must be accessed through the `proxy(context)` method, except the data that you provide and is available even whilst the data is being loaded (ie. `[showSkeleton]="true"`)..
13
+
14
+ As far as the template goes, it essentially means transforming the code from this:
15
+ ```html
16
+ <div>{{ somePropOrMethodCallAvailableAsync }}</div>
17
+ <div>{{ someAlreadyHardCodedOrInputBoundPropAvailableSync }} </div>
18
+ ```
19
+
20
+ into this:
21
+
22
+ ```html
23
+ <skeletonizer-skeleton [showSkeleton]="showSkeleton" [config]="skeletonConfig" [scope]="{ somePropOrMethodCallAvailableAsync } ">
24
+ <ng-template let-context>
25
+ <div>{{ proxy(context).somePropOrMethodCallAvailableAsync }}</div>
26
+ <div>{{ someAlreadyHardCodedOrInputBoundPropAvailableSync }} </div>
27
+ </ng-template>
28
+ </skeletonizer-skeleton>
29
+ ```
30
+
31
+ As long as the shape of the properties you access within the skeleton part of the template matches the shape of the data you provide in the `scope` and `skeletonConfig` properties, the skeletonized view will be in sync with the actual view, regardless of changes to the design.
32
+
33
+ ## Usage
34
+ You can use Skeletonizer either in a standalone component or in a component that is a part of a module.
35
+
36
+ If you wish to use Skeletonizer in a standalone component, you need to add `SkeletonizerSkeletonComponent` in the imports of the component.
37
+ The usage in a component that is a part of a module is the same as the standalone component, but you need to add `SkeletonizerSkeletonComponent` in the imports of the **module** where the component is declared.
38
+
39
+ Every component that uses Skeletonizer should extend `SkeletonAbstractComponent`, which is available in `@skeletonizer/utils`.
40
+ The `SkeletonAbstractComponent` requires you to pass a type argument that represents the data model of the **part(s) of the component that you intend to skeletonize**.
41
+ It also requires you to implement the `skeletonConfig` (type validated against the type argument you pass to `SkeletonAbstractComponent`) and `showSkeleton` properties which must be passed to the `SkeletonizerSkeletonComponent` as inputs.
42
+ By extending the `SkeletonAbstractComponent`, you also get access to the `proxy` method via which you can (type) safely access props and methods **within the skeletonized part of the current component**.
43
+
44
+ In the skeletonized part of the template, you **must** access the data through the `proxy(context)` method.
45
+ You can think of `proxy(context)` in the same way as you would think of `this` in a class method (or in the template, where the `this` is usually omitted when accessing props / methods and we usually call `foo` instead of `this.foo`). The only difference is that when using `proxy(context)`, the content-projected template will use the mocked values when the `showSkeleton` is `true`, and resolved values when `showSkeleton` is `false` - all while maintaining the type safety.
46
+
47
+ For more details about the `SkeletonAbstractComponent`, see the [SkeletonAbstractComponent](/../utils/README.md#SkeletonAbstractComponent) section.
48
+ For more details about the `SchemaItem` property, see the [SchemaItem](/../utils/README.md#SchemaItem) section.
49
+ For more details about the `skeletonConfig` property, see the [TSchemaConfig](/../utils/README.md#TSchemaConfig) section.
50
+
51
+ ```typescript
52
+ import { Component } from '@angular/core';
53
+ import { SkeletonizerSkeletonComponent } from '@skeletonizer/angular';
54
+ import { SchemaItem, SkeletonAbstractComponent, TSchemaConfig } from '@skeletonizer/utils';
55
+ import { DomSanitizer } from '@angular/platform-browser';
56
+
57
+ interface IResource {
58
+ title: string;
59
+ link: string;
60
+ svg: string;
61
+ }
62
+
63
+ // the svgs are just for the sake of the example
64
+ const learnNgSvg: string = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82zM12 3L1 9l11 6 9-4.91V17h2V9L12 3z"/></svg>';
65
+
66
+ const cliDocsSvg: string = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"/></svg>';
67
+
68
+ const loadingSvg: string = '<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>.spinner{transform-origin:center;animation:spinner .75s linear infinite}@keyframes spinner{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}</style><g class="spinner"><circle cx="12" cy="2.5" r="1.5" opacity=".14"/><circle cx="16.75" cy="3.77" r="1.5" opacity=".29"/><circle cx="20.23" cy="7.25" r="1.5" opacity=".43"/><circle cx="21.50" cy="12.00" r="1.5" opacity=".57"/><circle cx="20.23" cy="16.75" r="1.5" opacity=".71"/><circle cx="16.75" cy="20.23" r="1.5" opacity=".86"/><circle cx="12" cy="21.5" r="1.5"/></g></svg>';
69
+
70
+ type TSkeletonizedPart = Pick<AppComponent, 'resources' | 'otherPropWeWantToUseInSkeletonizedPart'>;
71
+
72
+ @Component({
73
+ selector: 'my-component',
74
+ template: `
75
+ <h2>{{ pageTitle }}</h2>
76
+
77
+ <skeletonizer-skeleton [showSkeleton]="showSkeleton" [config]="skeletonConfig" [scope]="{ resources, otherPropWeWantToUseInSkeletonizedPart }">
78
+ <ng-template let-context>
79
+ <span>{{ proxy(context).otherPropWeWantToUseInSkeletonizedPart }}</span>
80
+
81
+ <a *ngFor="let resource of proxy(context).resources" target="_blank" rel="noopener" [href]="resource.link">
82
+ <div [innerHTML]="sanitizer.bypassSecurityTrustHtml(resource.svg)"></div>
83
+ <span>{{ resource.title }}</span>
84
+ </a>
85
+ </ng-template>
86
+ </skeletonizer-skeleton>
87
+ `,
88
+ styleUrls: ['./my-component.component.scss'],
89
+ // for standalone components, otherwise add SkeletonizerSkeletonComponent to the module imports of the module where MyComponent is declared
90
+ // standalone: true,
91
+ // imports: [SkeletonizerSkeletonComponent, NgFor], // ngFor is just for the sake of the example where the *ngFor is used in the template
92
+ })
93
+ export class MyComponent extends SkeletonAbstractComponent<TSkeletonizedPart> implements OnInit {
94
+ public pageTitle: string = 'Some prop that we do not wish to skeletonize, but wish to use in the view nonetheless';
95
+ public otherPropWeWantToUseInSkeletonizedPart: string = 'angular';
96
+
97
+ public resources: IResource[] = [];
98
+ public showSkeleton: boolean = true;
99
+
100
+ public readonly skeletonConfig: TSchemaConfig<TSkeletonizedPart> = {
101
+ repeat: 1,
102
+ schemaGenerator: () => ({
103
+ otherPropWeWantToUseInSkeletonizedPart: new SchemaItem<string>().words(3),
104
+ // Array.from({ length: 5 }, () => ({ ... })) is just a simple way of creating an array of 5 objects - you could also hardcode the array if you wanted to
105
+ resources: Array.from({ length: 5 }, () => ({
106
+ title: new SchemaItem<string>().words(3),
107
+ link: new SchemaItem().identical('https://www.google.com'),
108
+ svg: new SchemaItem().identical(loadingSvg),
109
+ })),
110
+ }),
111
+ };
112
+
113
+ public constructor(
114
+ public readonly sanitizer: DomSanitizer,
115
+ ) {
116
+ super();
117
+ }
118
+
119
+ public ngOnInit(): void {
120
+ // simulate loading data
121
+ setTimeout(() => {
122
+ this.resources = [
123
+ {
124
+ title: 'Mocked Resolved Resource #1',
125
+ link: 'https://github.com/lukaVarga/skeletonizer/tree/main/packages/angular/projects/skeletonizer',
126
+ svg: learnNgSvg,
127
+ },
128
+ {
129
+ title: 'Mocked Resolved Resource #2',
130
+ link: 'https://github.com/lukaVarga/skeletonizer/tree/main',
131
+ svg: cliDocsSvg,
132
+ },
133
+ ];
134
+
135
+ this.otherPropWeWantToUseInSkeletonizedPart = 'loaded title'
136
+
137
+ this.showSkeleton = false;
138
+ }, Math.max(3_000, Math.random() * 10_000));
139
+ }
140
+ }
141
+ ```
142
+
143
+ You can also skeletonize multiple independent parts (ie. parts for which the data gets loaded independently of each-other) of the same component by using the `<skeletonizer-skeleton>` multiple times in the template. Each `skeletonizer-skeleton` component should, in this case, receive its own `showSkeleton` input property, while the `config` and the `scope` can be shared for all of them. That way, the config is defined in a single place and all skeletonized parts enjoy the same level of type safety via the known `proxy(context)` method.
144
+ You can also provide separate config and scope for each `skeletonizer-skeleton` component if needed, although it is recommended that you do not extend `SkeletonAbstractComponent` in this case, and you will need to provide your own (separate) `proxy`-like methods for each of the skeletonized parts of the component to maintain the same level of type safety in the template.
145
+
146
+ ```typescript
147
+ import { Component } from '@angular/core';
148
+ import { SkeletonizerSkeletonComponent } from '@skeletonizer/angular';
149
+ import { SchemaItem, SkeletonAbstractComponent, TSchemaConfig } from '@skeletonizer/utils';
150
+ import { DomSanitizer } from '@angular/platform-browser';
151
+
152
+ interface IResource {
153
+ title: string;
154
+ link: string;
155
+ svg: string;
156
+ }
157
+
158
+ // the svgs are just for the sake of the example
159
+ const learnNgSvg: string = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82zM12 3L1 9l11 6 9-4.91V17h2V9L12 3z"/></svg>';
160
+
161
+ const loadingSvg: string = '<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>.spinner{transform-origin:center;animation:spinner .75s linear infinite}@keyframes spinner{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}</style><g class="spinner"><circle cx="12" cy="2.5" r="1.5" opacity=".14"/><circle cx="16.75" cy="3.77" r="1.5" opacity=".29"/><circle cx="20.23" cy="7.25" r="1.5" opacity=".43"/><circle cx="21.50" cy="12.00" r="1.5" opacity=".57"/><circle cx="20.23" cy="16.75" r="1.5" opacity=".71"/><circle cx="16.75" cy="20.23" r="1.5" opacity=".86"/><circle cx="12" cy="21.5" r="1.5"/></g></svg>';
162
+
163
+ type TSkeletonizedPart = Pick<AppComponent, 'resources' | 'otherPropWeWantToUseInSkeletonizedPart'>;
164
+
165
+ @Component({
166
+ selector: 'my-component',
167
+ template: `
168
+ <h2>{{ pageTitle }}</h2>
169
+
170
+ <skeletonizer-skeleton [showSkeleton]="showSkeleton" [config]="skeletonConfig" [scope]="{ resources, otherPropWeWantToUseInSkeletonizedPart }">
171
+ <ng-template let-context>
172
+ <div class="card-container">
173
+ <a *ngFor="let resource of proxy(context).resources" class="card" target="_blank" rel="noopener" [href]="resource.link">
174
+ <div [innerHTML]="sanitizer.bypassSecurityTrustHtml(resource.svg)"></div>
175
+ <span>{{ resource.title }}</span>
176
+ </a>
177
+ </div>
178
+ </ng-template>
179
+ </skeletonizer-skeleton>
180
+
181
+ <skeletonizer-skeleton [showSkeleton]="showOtherSkeleton" [config]="skeletonConfig" [scope]="{ resources, otherPropWeWantToUseInSkeletonizedPart }">
182
+ <ng-template let-context>
183
+ <span>{{ proxy(context).otherPropWeWantToUseInSkeletonizedPart }}</span>
184
+ </ng-template>
185
+ </skeletonizer-skeleton>
186
+ `,
187
+ styleUrls: ['./my-component.component.scss'],
188
+ // for standalone components, otherwise add SkeletonizerSkeletonComponent to the module imports of the module where MyComponent is declared
189
+ // standalone: true,
190
+ // imports: [SkeletonizerSkeletonComponent, NgFor], // ngFor is just for the sake of the example where the *ngFor is used in the template
191
+ })
192
+ export class MyComponent extends SkeletonAbstractComponent<TSkeletonizedPart> implements OnInit {
193
+ public pageTitle: string = 'Some prop that we do not wish to skeletonize, but wish to use in the view nonetheless';
194
+ public otherPropWeWantToUseInSkeletonizedPart: string = 'angular';
195
+
196
+ public resources: IResource[] = [];
197
+ public showSkeleton: boolean = true;
198
+
199
+ public readonly skeletonConfig: TSchemaConfig<TSkeletonizedPart> = {
200
+ repeat: 1,
201
+ schemaGenerator: () => ({
202
+ otherPropWeWantToUseInSkeletonizedPart: new SchemaItem<string>().words(3),
203
+ // Array.from({ length: 5 }, () => ({ ... })) is just a simple way of creating an array of 5 objects - you could also hardcode the array if you wanted to
204
+ resources: Array.from({ length: 5 }, () => ({
205
+ title: new SchemaItem<string>().words(3),
206
+ link: new SchemaItem().identical('https://www.google.com'),
207
+ svg: new SchemaItem().identical(loadingSvg),
208
+ })),
209
+ }),
210
+ };
211
+
212
+ public constructor(
213
+ public readonly sanitizer: DomSanitizer,
214
+ ) {
215
+ super();
216
+ }
217
+
218
+ public ngOnInit(): void {
219
+ setTimeout(() => {
220
+ this.resources = [
221
+ {
222
+ title: 'Mocked Resolved Resource #1',
223
+ link: 'https://github.com/lukaVarga/skeletonizer/tree/main/packages/angular/projects/skeletonizer',
224
+ svg: learnNgSvg,
225
+ },
226
+ {
227
+ title: 'Mocked Resolved Resource #2',
228
+ link: 'https://github.com/lukaVarga/skeletonizer/tree/main',
229
+ svg: cliDocsSvg,
230
+ },
231
+ ];
232
+
233
+ this.showSkeleton = false;
234
+ }, Math.max(3_000, Math.random() * 10_000));
235
+
236
+ setTimeout(() => {
237
+ this.showOtherSkeleton = false;
238
+ }, Math.max(6_000, Math.random() * 10_000));
239
+ }
240
+ }
241
+ ```
242
+
243
+ ### Color Scheme
244
+ Generally speaking, you shouldn't need to adjust the color scheme of the skeletonized component in most cases. However, should you need to, the color scheme of the skeletonized views can be customized by providing the `colorScheme` property to the `SkeletonizerSkeletonComponent`.
245
+ For more details about the `colorScheme` property, see the [colorScheme](/../utils/README.md#colorScheme) section.
246
+
247
+ ## Contributing
248
+ For Angular adapter-specific contributions, run the following commands to get started:
249
+ - `npm install`
250
+ - adjust the code in the `packages/projects/skeletonizer` directory
251
+ - run `npm run build` in the `packages/projects/skeletonizer` directory
252
+ - adjust the code in the `packages/angular/src/app` directory to make sure the changes can easily be seen in the example app
253
+ - `npm run dev`
254
+
255
+ Before submitting a pull request, make sure to run the following commands:
256
+ - `npm run lint`
257
+ - `npm run type-check`
258
+ - `npm run coverage`
259
+ - `npm run build`
@@ -1,24 +1,7 @@
1
- # Skeletonizer
1
+ # @skeletonizer/angular
2
+ This is the Angular adapter for Skeletonizer. It provides a simple way to create skeletonized views for your Angular application.
2
3
 
3
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 16.1.0.
4
+ ## Installation
5
+ To install the package, run the following command:
6
+ `npm install @skeletonizer/angular @skeletonizer/utils --save`
4
7
 
5
- ## Code scaffolding
6
-
7
- Run `ng generate component component-name --project skeletonizer` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project skeletonizer`.
8
- > Note: Don't forget to add `--project skeletonizer` or else it will be added to the default project in your `angular.json` file.
9
-
10
- ## Build
11
-
12
- Run `ng build skeletonizer` to build the project. The build artifacts will be stored in the `dist/` directory.
13
-
14
- ## Publishing
15
-
16
- After building your library with `ng build skeletonizer`, go to the dist folder `cd dist/skeletonizer` and run `npm publish`.
17
-
18
- ## Running unit tests
19
-
20
- Run `ng test skeletonizer` to execute the unit tests via [Karma](https://karma-runner.github.io).
21
-
22
- ## Further help
23
-
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.
@@ -8,10 +8,10 @@ export class SkeletonizeDirective {
8
8
  ngAfterViewInit() {
9
9
  SkeletonDirective.skeletonizeProjectedTemplate(this.el.nativeElement, this.colorSchema);
10
10
  }
11
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: SkeletonizeDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
12
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.2", type: SkeletonizeDirective, isStandalone: true, selector: "[skeletonize]", inputs: { colorSchema: ["skeletonize", "colorSchema"] }, ngImport: i0 }); }
11
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: SkeletonizeDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
12
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: SkeletonizeDirective, isStandalone: true, selector: "[skeletonize]", inputs: { colorSchema: ["skeletonize", "colorSchema"] }, ngImport: i0 }); }
13
13
  }
14
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: SkeletonizeDirective, decorators: [{
14
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: SkeletonizeDirective, decorators: [{
15
15
  type: Directive,
16
16
  args: [{
17
17
  selector: '[skeletonize]',
@@ -8,10 +8,10 @@ export class SkeletonizerSkeletonComponent extends SkeletonAdapterComponent {
8
8
  this.config = config;
9
9
  this.setupModels();
10
10
  }
11
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: SkeletonizerSkeletonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
12
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.2", type: SkeletonizerSkeletonComponent, isStandalone: true, selector: "skeletonizer-skeleton", inputs: { showSkeleton: "showSkeleton", scope: "scope", colorSchema: "colorSchema", configInput: ["config", "configInput"] }, queries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"showSkeleton\">\n <ng-container *ngFor=\"let model of viewModels\">\n <div [skeletonize]=\"colorSchema\">\n <ng-container *ngTemplateOutlet=\"templateRef; context: { $implicit: model }\"></ng-container>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"!showSkeleton\">\n <ng-container *ngTemplateOutlet=\"templateRef; context: { $implicit: scope }\"></ng-container>\n</ng-container>\n", styles: ["[data-skeletonizer=wrapper-element]{--skeletonizer-text-background: rgba(0, 0, 0, .2);display:contents;filter:grayscale(100%);pointer-events:none}[data-skeletonizer=wrapper-element] *{pointer-events:none}[data-skeletonizer=wrapper-element] [data-skeletonizer=text]{animation:text-animation 2s infinite ease-in-out;background:var(--skeletonizer-primary-color);border-radius:50px;color:#0000!important}@keyframes text-animation{0%{background:var(--skeletonizer-primary-color)}50%{background:var(--skeletonizer-secondary-color)}to{background:var(--skeletonizer-primary-color)}}skeletonizer-skeleton{display:contents}\n"], dependencies: [{ kind: "directive", type: SkeletonizeDirective, selector: "[skeletonize]", inputs: ["skeletonize"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None }); }
11
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: SkeletonizerSkeletonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
12
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.5", type: SkeletonizerSkeletonComponent, isStandalone: true, selector: "skeletonizer-skeleton", inputs: { showSkeleton: "showSkeleton", scope: "scope", colorSchema: "colorSchema", configInput: ["config", "configInput"] }, queries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"showSkeleton\">\n <ng-container *ngFor=\"let model of viewModels\">\n <div [skeletonize]=\"colorSchema\">\n <ng-container *ngTemplateOutlet=\"templateRef; context: { $implicit: model }\"></ng-container>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"!showSkeleton\">\n <ng-container *ngTemplateOutlet=\"templateRef; context: { $implicit: scope }\"></ng-container>\n</ng-container>\n", styles: ["[data-skeletonizer=wrapper-element]{--skeletonizer-text-background: rgba(0, 0, 0, .2);display:contents;filter:grayscale(100%);pointer-events:none}[data-skeletonizer=wrapper-element] *{pointer-events:none}[data-skeletonizer=wrapper-element] [data-skeletonizer=text]{animation:text-animation 2s infinite ease-in-out;background:var(--skeletonizer-primary-color);border-radius:50px;color:#0000!important}@keyframes text-animation{0%{background:var(--skeletonizer-primary-color)}50%{background:var(--skeletonizer-secondary-color)}to{background:var(--skeletonizer-primary-color)}}skeletonizer-skeleton{display:contents}\n"], dependencies: [{ kind: "directive", type: SkeletonizeDirective, selector: "[skeletonize]", inputs: ["skeletonize"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None }); }
13
13
  }
14
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: SkeletonizerSkeletonComponent, decorators: [{
14
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: SkeletonizerSkeletonComponent, decorators: [{
15
15
  type: Component,
16
16
  args: [{ selector: 'skeletonizer-skeleton', encapsulation: ViewEncapsulation.None, standalone: true, imports: [
17
17
  SkeletonizeDirective,
@@ -10,10 +10,10 @@ class SkeletonizeDirective {
10
10
  ngAfterViewInit() {
11
11
  SkeletonDirective.skeletonizeProjectedTemplate(this.el.nativeElement, this.colorSchema);
12
12
  }
13
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: SkeletonizeDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
14
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.2", type: SkeletonizeDirective, isStandalone: true, selector: "[skeletonize]", inputs: { colorSchema: ["skeletonize", "colorSchema"] }, ngImport: i0 }); }
13
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: SkeletonizeDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
14
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: SkeletonizeDirective, isStandalone: true, selector: "[skeletonize]", inputs: { colorSchema: ["skeletonize", "colorSchema"] }, ngImport: i0 }); }
15
15
  }
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: SkeletonizeDirective, decorators: [{
16
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: SkeletonizeDirective, decorators: [{
17
17
  type: Directive,
18
18
  args: [{
19
19
  selector: '[skeletonize]',
@@ -29,10 +29,10 @@ class SkeletonizerSkeletonComponent extends SkeletonAdapterComponent {
29
29
  this.config = config;
30
30
  this.setupModels();
31
31
  }
32
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: SkeletonizerSkeletonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
33
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.2", type: SkeletonizerSkeletonComponent, isStandalone: true, selector: "skeletonizer-skeleton", inputs: { showSkeleton: "showSkeleton", scope: "scope", colorSchema: "colorSchema", configInput: ["config", "configInput"] }, queries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"showSkeleton\">\n <ng-container *ngFor=\"let model of viewModels\">\n <div [skeletonize]=\"colorSchema\">\n <ng-container *ngTemplateOutlet=\"templateRef; context: { $implicit: model }\"></ng-container>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"!showSkeleton\">\n <ng-container *ngTemplateOutlet=\"templateRef; context: { $implicit: scope }\"></ng-container>\n</ng-container>\n", styles: ["[data-skeletonizer=wrapper-element]{--skeletonizer-text-background: rgba(0, 0, 0, .2);display:contents;filter:grayscale(100%);pointer-events:none}[data-skeletonizer=wrapper-element] *{pointer-events:none}[data-skeletonizer=wrapper-element] [data-skeletonizer=text]{animation:text-animation 2s infinite ease-in-out;background:var(--skeletonizer-primary-color);border-radius:50px;color:#0000!important}@keyframes text-animation{0%{background:var(--skeletonizer-primary-color)}50%{background:var(--skeletonizer-secondary-color)}to{background:var(--skeletonizer-primary-color)}}skeletonizer-skeleton{display:contents}\n"], dependencies: [{ kind: "directive", type: SkeletonizeDirective, selector: "[skeletonize]", inputs: ["skeletonize"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None }); }
32
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: SkeletonizerSkeletonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
33
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.5", type: SkeletonizerSkeletonComponent, isStandalone: true, selector: "skeletonizer-skeleton", inputs: { showSkeleton: "showSkeleton", scope: "scope", colorSchema: "colorSchema", configInput: ["config", "configInput"] }, queries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"showSkeleton\">\n <ng-container *ngFor=\"let model of viewModels\">\n <div [skeletonize]=\"colorSchema\">\n <ng-container *ngTemplateOutlet=\"templateRef; context: { $implicit: model }\"></ng-container>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"!showSkeleton\">\n <ng-container *ngTemplateOutlet=\"templateRef; context: { $implicit: scope }\"></ng-container>\n</ng-container>\n", styles: ["[data-skeletonizer=wrapper-element]{--skeletonizer-text-background: rgba(0, 0, 0, .2);display:contents;filter:grayscale(100%);pointer-events:none}[data-skeletonizer=wrapper-element] *{pointer-events:none}[data-skeletonizer=wrapper-element] [data-skeletonizer=text]{animation:text-animation 2s infinite ease-in-out;background:var(--skeletonizer-primary-color);border-radius:50px;color:#0000!important}@keyframes text-animation{0%{background:var(--skeletonizer-primary-color)}50%{background:var(--skeletonizer-secondary-color)}to{background:var(--skeletonizer-primary-color)}}skeletonizer-skeleton{display:contents}\n"], dependencies: [{ kind: "directive", type: SkeletonizeDirective, selector: "[skeletonize]", inputs: ["skeletonize"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None }); }
34
34
  }
35
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: SkeletonizerSkeletonComponent, decorators: [{
35
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: SkeletonizerSkeletonComponent, decorators: [{
36
36
  type: Component,
37
37
  args: [{ selector: 'skeletonizer-skeleton', encapsulation: ViewEncapsulation.None, standalone: true, imports: [
38
38
  SkeletonizeDirective,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skeletonizer/angular",
3
- "version": "0.0.6-alpha.0",
3
+ "version": "0.0.8-alpha.0",
4
4
  "description": "The way to skeletonize your Angular components",
5
5
  "author": "Luka Varga",
6
6
  "license": "MIT",
@@ -53,7 +53,7 @@
53
53
  "**/*.{scss,css}": "stylelint --fix",
54
54
  "**/*.{ts,js}": "eslint --fix"
55
55
  },
56
- "dependencies": {
56
+ "peerDependencies": {
57
57
  "@angular/animations": "^17.3.2",
58
58
  "@angular/common": "^17.3.2",
59
59
  "@angular/compiler": "^17.3.2",
@@ -88,5 +88,5 @@
88
88
  "ng-packagr": "^17.3.0",
89
89
  "typescript": "~5.4.3"
90
90
  },
91
- "gitHead": "9f01828c3a993c3e78f871e420d5f8b0776175ea"
91
+ "gitHead": "b62b4bb34e4e875e69e63b838fd15ce92750ffa7"
92
92
  }