angular-confetti 4.3.2 → 4.5.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/fesm2022/angular-confetti.mjs +141 -90
- package/fesm2022/angular-confetti.mjs.map +1 -1
- package/package.json +3 -3
- package/types/angular-confetti.d.ts +34 -25
- package/.npmignore +0 -2
|
@@ -1,91 +1,142 @@
|
|
|
1
|
-
import { isPlatformServer } from
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import {
|
|
4
|
-
import { confetti } from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
1
|
+
import { isPlatformServer } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { Component, Inject, Input, NgModule, PLATFORM_ID } from "@angular/core";
|
|
4
|
+
import { confetti } from "@tsparticles/confetti";
|
|
5
|
+
var NgxConfettiComponent = class NgxConfettiComponent {
|
|
6
|
+
#container;
|
|
7
|
+
#renderId;
|
|
8
|
+
constructor(platformId) {
|
|
9
|
+
this.platformId = platformId;
|
|
10
|
+
this.id = "tsparticles";
|
|
11
|
+
this.fire = true;
|
|
12
|
+
this.#renderId = 0;
|
|
13
|
+
}
|
|
14
|
+
ngAfterViewInit() {
|
|
15
|
+
if (isPlatformServer(this.platformId)) return;
|
|
16
|
+
this.#tryFire();
|
|
17
|
+
}
|
|
18
|
+
ngOnChanges(changes) {
|
|
19
|
+
if (isPlatformServer(this.platformId)) return;
|
|
20
|
+
const fireChanges = changes["fire"];
|
|
21
|
+
if (this.fire && fireChanges && fireChanges.previousValue !== fireChanges.currentValue) this.#tryFire();
|
|
22
|
+
}
|
|
23
|
+
ngOnDestroy() {
|
|
24
|
+
this.#renderId++;
|
|
25
|
+
this.#container?.destroy();
|
|
26
|
+
this.#container = void 0;
|
|
27
|
+
}
|
|
28
|
+
async #tryFire() {
|
|
29
|
+
const currentRenderId = ++this.#renderId;
|
|
30
|
+
const container = await confetti(this.id, this.options);
|
|
31
|
+
if (currentRenderId !== this.#renderId) {
|
|
32
|
+
container?.destroy();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this.#container = container;
|
|
36
|
+
}
|
|
37
|
+
static {
|
|
38
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
39
|
+
minVersion: "12.0.0",
|
|
40
|
+
version: "22.2.3",
|
|
41
|
+
ngImport: i0,
|
|
42
|
+
type: NgxConfettiComponent,
|
|
43
|
+
deps: [{ token: PLATFORM_ID }],
|
|
44
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
static {
|
|
48
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
49
|
+
minVersion: "14.0.0",
|
|
50
|
+
version: "22.2.3",
|
|
51
|
+
type: NgxConfettiComponent,
|
|
52
|
+
isStandalone: false,
|
|
53
|
+
selector: "ngx-confetti",
|
|
54
|
+
inputs: {
|
|
55
|
+
options: "options",
|
|
56
|
+
id: "id",
|
|
57
|
+
fire: "fire"
|
|
58
|
+
},
|
|
59
|
+
usesOnChanges: true,
|
|
60
|
+
ngImport: i0,
|
|
61
|
+
template: "<div [id]=\"id\"></div>",
|
|
62
|
+
isInline: true
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
67
|
+
minVersion: "12.0.0",
|
|
68
|
+
version: "22.2.3",
|
|
69
|
+
ngImport: i0,
|
|
70
|
+
type: NgxConfettiComponent,
|
|
71
|
+
decorators: [{
|
|
72
|
+
type: Component,
|
|
73
|
+
args: [{
|
|
74
|
+
selector: "ngx-confetti",
|
|
75
|
+
standalone: false,
|
|
76
|
+
template: "<div [id]=\"id\"></div>"
|
|
77
|
+
}]
|
|
78
|
+
}],
|
|
79
|
+
ctorParameters: () => [{
|
|
80
|
+
type: void 0,
|
|
81
|
+
decorators: [{
|
|
82
|
+
type: Inject,
|
|
83
|
+
args: [PLATFORM_ID]
|
|
84
|
+
}]
|
|
85
|
+
}],
|
|
86
|
+
propDecorators: {
|
|
87
|
+
options: [{ type: Input }],
|
|
88
|
+
id: [{ type: Input }],
|
|
89
|
+
fire: [{ type: Input }]
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
var NgxConfettiModule = class NgxConfettiModule {
|
|
93
|
+
constructor() {
|
|
94
|
+
confetti.init();
|
|
95
|
+
}
|
|
96
|
+
static {
|
|
97
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
98
|
+
minVersion: "12.0.0",
|
|
99
|
+
version: "22.2.3",
|
|
100
|
+
ngImport: i0,
|
|
101
|
+
type: NgxConfettiModule,
|
|
102
|
+
deps: [],
|
|
103
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
static {
|
|
107
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
108
|
+
minVersion: "14.0.0",
|
|
109
|
+
version: "22.2.3",
|
|
110
|
+
ngImport: i0,
|
|
111
|
+
type: NgxConfettiModule,
|
|
112
|
+
declarations: [NgxConfettiComponent],
|
|
113
|
+
exports: [NgxConfettiComponent]
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
static {
|
|
117
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
118
|
+
minVersion: "12.0.0",
|
|
119
|
+
version: "22.2.3",
|
|
120
|
+
ngImport: i0,
|
|
121
|
+
type: NgxConfettiModule
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
126
|
+
minVersion: "12.0.0",
|
|
127
|
+
version: "22.2.3",
|
|
128
|
+
ngImport: i0,
|
|
129
|
+
type: NgxConfettiModule,
|
|
130
|
+
decorators: [{
|
|
131
|
+
type: NgModule,
|
|
132
|
+
args: [{
|
|
133
|
+
declarations: [NgxConfettiComponent],
|
|
134
|
+
imports: [],
|
|
135
|
+
exports: [NgxConfettiComponent]
|
|
136
|
+
}]
|
|
137
|
+
}],
|
|
138
|
+
ctorParameters: () => []
|
|
139
|
+
});
|
|
90
140
|
export { NgxConfettiComponent, NgxConfettiModule };
|
|
91
|
-
|
|
141
|
+
|
|
142
|
+
//# sourceMappingURL=angular-confetti.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular-confetti.mjs","sources":["../../../projects/ng-confetti/src/lib/ng-confetti.component.ts","../../../projects/ng-confetti/src/lib/ng-confetti.module.ts"
|
|
1
|
+
{"version":3,"file":"angular-confetti.mjs","names":[],"sources":["../../../projects/ng-confetti/src/lib/ng-confetti.component.ts","../../../projects/ng-confetti/src/lib/ng-confetti.module.ts"],"sourcesContent":["import { isPlatformServer } from \"@angular/common\";\nimport {\n AfterViewInit,\n Component,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n PLATFORM_ID,\n SimpleChanges,\n} from \"@angular/core\";\nimport { confetti, ConfettiOptions } from \"@tsparticles/confetti\";\nimport type { Container } from \"@tsparticles/engine\";\n\n@Component({\n selector: \"ngx-confetti\",\n standalone: false,\n template: '<div [id]=\"id\"></div>',\n})\nexport class NgxConfettiComponent implements AfterViewInit, OnChanges, OnDestroy {\n @Input() options?: ConfettiOptions;\n @Input() id = \"tsparticles\";\n @Input() fire: boolean | number = true;\n\n #container?: Container;\n #renderId = 0;\n\n constructor(@Inject(PLATFORM_ID) protected platformId: string) {}\n\n public ngAfterViewInit(): void {\n if (isPlatformServer(this.platformId)) {\n return;\n }\n\n void this.#tryFire();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (isPlatformServer(this.platformId)) {\n return;\n }\n\n const fireChanges = changes[\"fire\"];\n\n if (this.fire && fireChanges && fireChanges.previousValue !== fireChanges.currentValue) {\n void this.#tryFire();\n }\n }\n\n public ngOnDestroy(): void {\n this.#renderId++;\n this.#container?.destroy();\n\n this.#container = undefined;\n }\n\n async #tryFire(): Promise<void> {\n const currentRenderId = ++this.#renderId;\n const container = await confetti(this.id, this.options);\n\n if (currentRenderId !== this.#renderId) {\n container?.destroy();\n\n return;\n }\n\n this.#container = container;\n }\n}\n","import { NgModule } from \"@angular/core\";\nimport { confetti } from \"@tsparticles/confetti\";\nimport { NgxConfettiComponent } from \"./ng-confetti.component\";\n\n@NgModule({\n declarations: [NgxConfettiComponent],\n imports: [],\n exports: [NgxConf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;EAAU,MAAA,CAAA;GACT,UAAU;GACV,YAAY;GACZ,UAAU;EACX,CAAA;;;;;GASc,MAAA;GAAO,MAAA,CAAA,WAAW;;;;EAP9B,SAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,IAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,MAAA,CAAA,EAAA,MAAA,MAAA,CAAA;;;ACbH,IAAa,oBAAb,MAAa,kBAAiB;CAC5B,cAAA;EACE,AAAK,SAAS,KAAI;CACpB;CAHW;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAiB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAjB;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAiB,cAAA,CAJb,oBAAoB;GAAA,SAAA,CAEzB,oBAAoB;EAAA,CAAA;CAAA;CAEnB;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;EAAiB,CAAA;CAAA;;AAAjB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAiB,YAAA,CAAA;EAL7B,MAAA;EAAS,MAAA,CAAA;GACR,cAAc,CAAC,oBAAoB;GACnC,SAAS,CAAA;GACT,SAAS,CAAC,oBAAoB;EAC/B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-confetti",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"description": "Official tsParticles Angular Confetti Component - Easily create highly customizable particle, confetti and fireworks animations and use them as animated backgrounds for your website. Ready to use components available also for Web Components, React, Vue.js (2.x and 3.x), Svelte, jQuery, Preact, Riot.js, Solid.js, Inferno.",
|
|
5
5
|
"homepage": "https://confetti.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"@angular/common": ">=12.0.0",
|
|
86
86
|
"@angular/core": ">=12.0.0",
|
|
87
87
|
"rxjs": ">=7.0.0",
|
|
88
|
-
"@tsparticles/confetti": "^4.
|
|
89
|
-
"@tsparticles/engine": "^4.
|
|
88
|
+
"@tsparticles/confetti": "^4.5.0",
|
|
89
|
+
"@tsparticles/engine": "^4.5.0"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
92
|
"tslib": "^2.8.1"
|
|
@@ -1,26 +1,35 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { AfterViewInit, OnChanges, OnDestroy, SimpleChanges } from
|
|
3
|
-
import { ConfettiOptions } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { AfterViewInit, OnChanges, OnDestroy, SimpleChanges } from "@angular/core";
|
|
3
|
+
import { ConfettiOptions } from "@tsparticles/confetti";
|
|
4
|
+
export declare class NgxConfettiComponent implements AfterViewInit, OnChanges, OnDestroy {
|
|
5
|
+
#private;
|
|
6
|
+
protected platformId: string;
|
|
7
|
+
options?: ConfettiOptions;
|
|
8
|
+
id: string;
|
|
9
|
+
fire: boolean | number;
|
|
10
|
+
constructor(platformId: string);
|
|
11
|
+
ngAfterViewInit(): void;
|
|
12
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
13
|
+
ngOnDestroy(): void;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxConfettiComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxConfettiComponent, "ngx-confetti", never, {
|
|
16
|
+
"options": {
|
|
17
|
+
"alias": "options";
|
|
18
|
+
"required": false;
|
|
19
|
+
};
|
|
20
|
+
"id": {
|
|
21
|
+
"alias": "id";
|
|
22
|
+
"required": false;
|
|
23
|
+
};
|
|
24
|
+
"fire": {
|
|
25
|
+
"alias": "fire";
|
|
26
|
+
"required": false;
|
|
27
|
+
};
|
|
28
|
+
}, {}, never, never, false, never>;
|
|
17
29
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { NgxConfettiComponent, NgxConfettiModule };
|
|
30
|
+
export declare class NgxConfettiModule {
|
|
31
|
+
constructor();
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxConfettiModule, never>;
|
|
33
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxConfettiModule, [typeof NgxConfettiComponent], never, [typeof NgxConfettiComponent]>;
|
|
34
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgxConfettiModule>;
|
|
35
|
+
}
|
package/.npmignore
DELETED