angular-fireworks 4.4.0 → 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.
|
@@ -1,93 +1,145 @@
|
|
|
1
|
-
import { isPlatformServer } from
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import {
|
|
4
|
-
import { fireworks } 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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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 { fireworks } from "@tsparticles/fireworks";
|
|
5
|
+
var NgxFireworksComponent = class NgxFireworksComponent {
|
|
6
|
+
#fireworksInstance;
|
|
7
|
+
#destroyed;
|
|
8
|
+
#loadId;
|
|
9
|
+
constructor(platformId) {
|
|
10
|
+
this.platformId = platformId;
|
|
11
|
+
this.id = "tsparticles";
|
|
12
|
+
this.#destroyed = false;
|
|
13
|
+
this.#loadId = 0;
|
|
14
|
+
}
|
|
15
|
+
ngAfterViewInit() {
|
|
16
|
+
if (isPlatformServer(this.platformId)) return;
|
|
17
|
+
this.#startFireworks();
|
|
18
|
+
}
|
|
19
|
+
ngOnChanges(changes) {
|
|
20
|
+
if (isPlatformServer(this.platformId)) return;
|
|
21
|
+
if (this.#destroyed || !this.#fireworksInstance) return;
|
|
22
|
+
if (changes["options"] || changes["id"]) this.#startFireworks();
|
|
23
|
+
}
|
|
24
|
+
ngOnDestroy() {
|
|
25
|
+
this.#destroyed = true;
|
|
26
|
+
++this.#loadId;
|
|
27
|
+
this.#fireworksInstance?.destroy();
|
|
28
|
+
this.#fireworksInstance = void 0;
|
|
29
|
+
}
|
|
30
|
+
async #startFireworks() {
|
|
31
|
+
this.#fireworksInstance?.destroy();
|
|
32
|
+
this.#fireworksInstance = void 0;
|
|
33
|
+
const currentLoadId = ++this.#loadId;
|
|
34
|
+
const instance = await fireworks(this.id, this.options);
|
|
35
|
+
if (currentLoadId !== this.#loadId) {
|
|
36
|
+
instance?.destroy();
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.#fireworksInstance = instance;
|
|
40
|
+
this.#fireworksInstance?.play();
|
|
41
|
+
}
|
|
42
|
+
static {
|
|
43
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
44
|
+
minVersion: "12.0.0",
|
|
45
|
+
version: "22.2.3",
|
|
46
|
+
ngImport: i0,
|
|
47
|
+
type: NgxFireworksComponent,
|
|
48
|
+
deps: [{ token: PLATFORM_ID }],
|
|
49
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
static {
|
|
53
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
54
|
+
minVersion: "14.0.0",
|
|
55
|
+
version: "22.2.3",
|
|
56
|
+
type: NgxFireworksComponent,
|
|
57
|
+
isStandalone: false,
|
|
58
|
+
selector: "ngx-fireworks",
|
|
59
|
+
inputs: {
|
|
60
|
+
options: "options",
|
|
61
|
+
id: "id"
|
|
62
|
+
},
|
|
63
|
+
usesOnChanges: true,
|
|
64
|
+
ngImport: i0,
|
|
65
|
+
template: ` <div [id]="id"></div>`,
|
|
66
|
+
isInline: true
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
71
|
+
minVersion: "12.0.0",
|
|
72
|
+
version: "22.2.3",
|
|
73
|
+
ngImport: i0,
|
|
74
|
+
type: NgxFireworksComponent,
|
|
75
|
+
decorators: [{
|
|
76
|
+
type: Component,
|
|
77
|
+
args: [{
|
|
78
|
+
selector: "ngx-fireworks",
|
|
79
|
+
standalone: false,
|
|
80
|
+
template: ` <div [id]="id"></div>`
|
|
81
|
+
}]
|
|
82
|
+
}],
|
|
83
|
+
ctorParameters: () => [{
|
|
84
|
+
type: void 0,
|
|
85
|
+
decorators: [{
|
|
86
|
+
type: Inject,
|
|
87
|
+
args: [PLATFORM_ID]
|
|
88
|
+
}]
|
|
89
|
+
}],
|
|
90
|
+
propDecorators: {
|
|
91
|
+
options: [{ type: Input }],
|
|
92
|
+
id: [{ type: Input }]
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
var NgxFireworksModule = class NgxFireworksModule {
|
|
96
|
+
constructor() {
|
|
97
|
+
fireworks.init();
|
|
98
|
+
}
|
|
99
|
+
static {
|
|
100
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
101
|
+
minVersion: "12.0.0",
|
|
102
|
+
version: "22.2.3",
|
|
103
|
+
ngImport: i0,
|
|
104
|
+
type: NgxFireworksModule,
|
|
105
|
+
deps: [],
|
|
106
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
static {
|
|
110
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
111
|
+
minVersion: "14.0.0",
|
|
112
|
+
version: "22.2.3",
|
|
113
|
+
ngImport: i0,
|
|
114
|
+
type: NgxFireworksModule,
|
|
115
|
+
declarations: [NgxFireworksComponent],
|
|
116
|
+
exports: [NgxFireworksComponent]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
static {
|
|
120
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
121
|
+
minVersion: "12.0.0",
|
|
122
|
+
version: "22.2.3",
|
|
123
|
+
ngImport: i0,
|
|
124
|
+
type: NgxFireworksModule
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
129
|
+
minVersion: "12.0.0",
|
|
130
|
+
version: "22.2.3",
|
|
131
|
+
ngImport: i0,
|
|
132
|
+
type: NgxFireworksModule,
|
|
133
|
+
decorators: [{
|
|
134
|
+
type: NgModule,
|
|
135
|
+
args: [{
|
|
136
|
+
declarations: [NgxFireworksComponent],
|
|
137
|
+
imports: [],
|
|
138
|
+
exports: [NgxFireworksComponent]
|
|
139
|
+
}]
|
|
140
|
+
}],
|
|
141
|
+
ctorParameters: () => []
|
|
142
|
+
});
|
|
92
143
|
export { NgxFireworksComponent, NgxFireworksModule };
|
|
93
|
-
|
|
144
|
+
|
|
145
|
+
//# sourceMappingURL=angular-fireworks.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular-fireworks.mjs","sources":["../../../projects/ng-fireworks/src/lib/ng-fireworks.component.ts","../../../projects/ng-fireworks/src/lib/ng-fireworks.module.ts"
|
|
1
|
+
{"version":3,"file":"angular-fireworks.mjs","names":[],"sources":["../../../projects/ng-fireworks/src/lib/ng-fireworks.component.ts","../../../projects/ng-fireworks/src/lib/ng-fireworks.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 { FireworkOptions, fireworks } from \"@tsparticles/fireworks\";\n\n@Component({\n selector: \"ngx-fireworks\",\n standalone: false,\n template: ` <div [id]=\"id\"></div>`,\n styles: [],\n})\nexport class NgxFireworksComponent implements AfterViewInit, OnChanges, OnDestroy {\n @Input() options?: FireworkOptions;\n @Input() id = \"tsparticles\";\n\n #fireworksInstance?: Awaited<ReturnType<typeof fireworks>>;\n #destroyed = false;\n #loadId = 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.#startFireworks();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (isPlatformServer(this.platformId)) {\n return;\n }\n\n if (this.#destroyed || !this.#fireworksInstance) {\n return;\n }\n\n if (changes[\"options\"] || changes[\"id\"]) {\n void this.#startFireworks();\n }\n }\n\n public ngOnDestroy(): void {\n this.#destroyed = true;\n ++this.#loadId;\n\n this.#fireworksInstance?.destroy();\n\n this.#fireworksInstance = undefined;\n }\n\n async #startFireworks(): Promise<void> {\n this.#fireworksInstance?.destroy();\n this.#fireworksInstance = undefined;\n\n const currentLoadId = ++this.#loadId;\n const instance = await fireworks(this.id, this.options);\n\n if (currentLoadId !== this.#loadId) {\n instance?.destroy();\n return;\n }\n\n this.#fireworksInstance = instance;\n this.#fireworksInstance?.play();\n }\n}\n","import { NgModule } from \"@angular/core\";\nimport { fireworks } from \"@tsparticles/fireworks\";\nimport { NgxFireworksComponent } from \"./ng-fireworks.component\";\n\n@NgModule({\n declarations: [NgxFireworksComponent],\n imports: [],\n exports: [NgxFireworksComponent],\n})\nexport class NgxFireworksModule {\n constructor() {\n /* Register fireworks plugins before tsParticles.init() is called */\n void (fireworks as unknown as { init: () => Promise<void> }).init();\n }\n}\n"],"mappings":";;;;AAmBA,IAAa,wBAAb,MAAa,sBAAqB;CAIhC;CACA;CACA;CAEA,YAA2C,YAAkB;EAAlB,KAAA,aAAA;EANlC,KAAA,KAAK;EAGd,KAAA,aAAa;EACb,KAAA,UAAU;CAEsD;CAEzD,kBAAe;EACpB,IAAI,iBAAiB,KAAK,UAAU,GAClC;EAGF,AAAK,KAAK,gBAAe;CAC3B;CAEO,YAAY,SAAsB;EACvC,IAAI,iBAAiB,KAAK,UAAU,GAClC;EAGF,IAAI,KAAK,cAAc,CAAC,KAAK,oBAC3B;EAGF,IAAI,QAAQ,cAAc,QAAQ,OAChC,AAAK,KAAK,gBAAe;CAE7B;CAEO,cAAW;EAChB,KAAK,aAAa;EAClB,EAAE,KAAK;EAEP,KAAK,oBAAoB,QAAO;EAEhC,KAAK,qBAAqB;CAC5B;CAEA,MAAM,kBAAe;EACnB,KAAK,oBAAoB,QAAO;EAChC,KAAK,qBAAqB;EAE1B,MAAM,gBAAgB,EAAE,KAAK;EAC7B,MAAM,WAAW,MAAM,UAAU,KAAK,IAAI,KAAK,OAAO;EAEtD,IAAI,kBAAkB,KAAK,SAAS;GAClC,UAAU,QAAO;GACjB;EACF;EAEA,KAAK,qBAAqB;EAC1B,KAAK,oBAAoB,KAAI;CAC/B;CAvDW;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAqB,MAAA,CAAA,EAAA,OAQZ,YAAW,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAA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 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-fireworks",
|
|
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/fireworks": "
|
|
89
|
-
"@tsparticles/engine": "
|
|
88
|
+
"@tsparticles/fireworks": "4.5.0",
|
|
89
|
+
"@tsparticles/engine": "4.5.0"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
92
|
"tslib": "^2.8.1"
|
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { AfterViewInit, OnChanges, OnDestroy, SimpleChanges } from
|
|
3
|
-
import { FireworkOptions } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { AfterViewInit, OnChanges, OnDestroy, SimpleChanges } from "@angular/core";
|
|
3
|
+
import { FireworkOptions } from "@tsparticles/fireworks";
|
|
4
|
+
export declare class NgxFireworksComponent implements AfterViewInit, OnChanges, OnDestroy {
|
|
5
|
+
#private;
|
|
6
|
+
protected platformId: string;
|
|
7
|
+
options?: FireworkOptions;
|
|
8
|
+
id: string;
|
|
9
|
+
constructor(platformId: string);
|
|
10
|
+
ngAfterViewInit(): void;
|
|
11
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
12
|
+
ngOnDestroy(): void;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxFireworksComponent, never>;
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxFireworksComponent, "ngx-fireworks", never, {
|
|
15
|
+
"options": {
|
|
16
|
+
"alias": "options";
|
|
17
|
+
"required": false;
|
|
18
|
+
};
|
|
19
|
+
"id": {
|
|
20
|
+
"alias": "id";
|
|
21
|
+
"required": false;
|
|
22
|
+
};
|
|
23
|
+
}, {}, never, never, false, never>;
|
|
16
24
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export { NgxFireworksComponent, NgxFireworksModule };
|
|
25
|
+
export declare class NgxFireworksModule {
|
|
26
|
+
constructor();
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxFireworksModule, never>;
|
|
28
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxFireworksModule, [typeof NgxFireworksComponent], never, [typeof NgxFireworksComponent]>;
|
|
29
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgxFireworksModule>;
|
|
30
|
+
}
|