@tsparticles/plugin-infection 3.0.0-beta.0 → 3.0.0-beta.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 +1 -1
- package/browser/InfectionInstance.js +1 -1
- package/browser/Options/Classes/Infection.js +1 -1
- package/browser/index.js +5 -5
- package/browser/package.json +1 -0
- package/cjs/InfectionInstance.js +2 -2
- package/cjs/Options/Classes/Infection.js +2 -2
- package/cjs/index.js +8 -8
- package/cjs/package.json +1 -0
- package/esm/InfectionInstance.js +1 -1
- package/esm/Options/Classes/Infection.js +1 -1
- package/esm/index.js +5 -5
- package/esm/package.json +1 -0
- package/package.json +18 -6
- package/report.html +23 -5
- package/tsparticles.plugin.infection.js +1 -1
- package/tsparticles.plugin.infection.min.js.LICENSE.txt +1 -1
- package/types/Infecter.d.ts +1 -1
- package/types/InfectionInstance.d.ts +1 -1
- package/types/Options/Classes/Infection.d.ts +2 -2
- package/types/Options/Classes/InfectionStage.d.ts +1 -1
- package/types/Options/Interfaces/IInfection.d.ts +1 -1
- package/types/ParticlesInfecter.d.ts +1 -1
- package/types/Types.d.ts +3 -3
- package/types/index.d.ts +2 -2
- package/umd/InfectionInstance.js +3 -3
- package/umd/Options/Classes/Infection.js +3 -3
- package/umd/index.js +9 -9
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://www.npmjs.com/package/@tsparticles/plugin-infection)
|
|
7
7
|
[](https://www.npmjs.com/package/@tsparticles/plugin-infection) [](https://github.com/sponsors/matteobruni)
|
|
8
8
|
|
|
9
|
-
[tsParticles](https://github.com/
|
|
9
|
+
[tsParticles](https://github.com/tsparticles/tsparticles) plugin for particles infection simulation effect.
|
|
10
10
|
|
|
11
11
|
## How to use it
|
|
12
12
|
|
package/browser/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Infection } from "./Options/Classes/Infection";
|
|
2
|
-
import { InfectionInstance } from "./InfectionInstance";
|
|
3
|
-
import { ParticlesInfecter } from "./ParticlesInfecter";
|
|
1
|
+
import { Infection } from "./Options/Classes/Infection.js";
|
|
2
|
+
import { InfectionInstance } from "./InfectionInstance.js";
|
|
3
|
+
import { ParticlesInfecter } from "./ParticlesInfecter.js";
|
|
4
4
|
class InfectionPlugin {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.id = "infection";
|
|
@@ -27,5 +27,5 @@ export async function loadInfectionPlugin(engine, refresh = true) {
|
|
|
27
27
|
await engine.addPlugin(plugin, refresh);
|
|
28
28
|
await engine.addInteractor("particlesInfection", (container) => new ParticlesInfecter(container), refresh);
|
|
29
29
|
}
|
|
30
|
-
export * from "./Options/Interfaces/IInfection";
|
|
31
|
-
export * from "./Options/Interfaces/IInfectionStage";
|
|
30
|
+
export * from "./Options/Interfaces/IInfection.js";
|
|
31
|
+
export * from "./Options/Interfaces/IInfectionStage.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "type": "module" }
|
package/cjs/InfectionInstance.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InfectionInstance = void 0;
|
|
4
4
|
const engine_1 = require("@tsparticles/engine");
|
|
5
|
-
const
|
|
5
|
+
const Infecter_js_1 = require("./Infecter.js");
|
|
6
6
|
class InfectionInstance {
|
|
7
7
|
constructor(container) {
|
|
8
8
|
this._container = container;
|
|
9
|
-
this._container.infecter = new
|
|
9
|
+
this._container.infecter = new Infecter_js_1.Infecter(this._container);
|
|
10
10
|
}
|
|
11
11
|
particleFillColor(particle) {
|
|
12
12
|
const options = this._container.actualOptions;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Infection = void 0;
|
|
4
|
-
const
|
|
4
|
+
const InfectionStage_js_1 = require("./InfectionStage.js");
|
|
5
5
|
class Infection {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.cure = false;
|
|
@@ -30,7 +30,7 @@ class Infection {
|
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
this.stages = data.stages.map((t) => {
|
|
33
|
-
const s = new
|
|
33
|
+
const s = new InfectionStage_js_1.InfectionStage();
|
|
34
34
|
s.load(t);
|
|
35
35
|
return s;
|
|
36
36
|
});
|
package/cjs/index.js
CHANGED
|
@@ -15,15 +15,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.loadInfectionPlugin = void 0;
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
18
|
+
const Infection_js_1 = require("./Options/Classes/Infection.js");
|
|
19
|
+
const InfectionInstance_js_1 = require("./InfectionInstance.js");
|
|
20
|
+
const ParticlesInfecter_js_1 = require("./ParticlesInfecter.js");
|
|
21
21
|
class InfectionPlugin {
|
|
22
22
|
constructor() {
|
|
23
23
|
this.id = "infection";
|
|
24
24
|
}
|
|
25
25
|
getPlugin(container) {
|
|
26
|
-
return new
|
|
26
|
+
return new InfectionInstance_js_1.InfectionInstance(container);
|
|
27
27
|
}
|
|
28
28
|
loadOptions(options, source) {
|
|
29
29
|
if (!this.needsPlugin(options) && !this.needsPlugin(source)) {
|
|
@@ -31,7 +31,7 @@ class InfectionPlugin {
|
|
|
31
31
|
}
|
|
32
32
|
let infectionOptions = options.infection;
|
|
33
33
|
if (infectionOptions?.load === undefined) {
|
|
34
|
-
options.infection = infectionOptions = new
|
|
34
|
+
options.infection = infectionOptions = new Infection_js_1.Infection();
|
|
35
35
|
}
|
|
36
36
|
infectionOptions.load(source?.infection);
|
|
37
37
|
}
|
|
@@ -42,8 +42,8 @@ class InfectionPlugin {
|
|
|
42
42
|
async function loadInfectionPlugin(engine, refresh = true) {
|
|
43
43
|
const plugin = new InfectionPlugin();
|
|
44
44
|
await engine.addPlugin(plugin, refresh);
|
|
45
|
-
await engine.addInteractor("particlesInfection", (container) => new
|
|
45
|
+
await engine.addInteractor("particlesInfection", (container) => new ParticlesInfecter_js_1.ParticlesInfecter(container), refresh);
|
|
46
46
|
}
|
|
47
47
|
exports.loadInfectionPlugin = loadInfectionPlugin;
|
|
48
|
-
__exportStar(require("./Options/Interfaces/IInfection"), exports);
|
|
49
|
-
__exportStar(require("./Options/Interfaces/IInfectionStage"), exports);
|
|
48
|
+
__exportStar(require("./Options/Interfaces/IInfection.js"), exports);
|
|
49
|
+
__exportStar(require("./Options/Interfaces/IInfectionStage.js"), exports);
|
package/cjs/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "type": "commonjs" }
|
package/esm/InfectionInstance.js
CHANGED
package/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Infection } from "./Options/Classes/Infection";
|
|
2
|
-
import { InfectionInstance } from "./InfectionInstance";
|
|
3
|
-
import { ParticlesInfecter } from "./ParticlesInfecter";
|
|
1
|
+
import { Infection } from "./Options/Classes/Infection.js";
|
|
2
|
+
import { InfectionInstance } from "./InfectionInstance.js";
|
|
3
|
+
import { ParticlesInfecter } from "./ParticlesInfecter.js";
|
|
4
4
|
class InfectionPlugin {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.id = "infection";
|
|
@@ -27,5 +27,5 @@ export async function loadInfectionPlugin(engine, refresh = true) {
|
|
|
27
27
|
await engine.addPlugin(plugin, refresh);
|
|
28
28
|
await engine.addInteractor("particlesInfection", (container) => new ParticlesInfecter(container), refresh);
|
|
29
29
|
}
|
|
30
|
-
export * from "./Options/Interfaces/IInfection";
|
|
31
|
-
export * from "./Options/Interfaces/IInfectionStage";
|
|
30
|
+
export * from "./Options/Interfaces/IInfection.js";
|
|
31
|
+
export * from "./Options/Interfaces/IInfectionStage.js";
|
package/esm/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "type": "module" }
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/plugin-infection",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.2",
|
|
4
4
|
"description": "tsParticles infection plugin",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/
|
|
8
|
+
"url": "git+https://github.com/tsparticles/tsparticles.git",
|
|
9
9
|
"directory": "plugins/infection"
|
|
10
10
|
},
|
|
11
11
|
"keywords": [
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"author": "Matteo Bruni <matteo.bruni@me.com>",
|
|
66
66
|
"license": "MIT",
|
|
67
67
|
"bugs": {
|
|
68
|
-
"url": "https://github.com/
|
|
68
|
+
"url": "https://github.com/tsparticles/tsparticles/issues"
|
|
69
69
|
},
|
|
70
70
|
"funding": [
|
|
71
71
|
{
|
|
@@ -81,14 +81,26 @@
|
|
|
81
81
|
"url": "https://www.buymeacoffee.com/matteobruni"
|
|
82
82
|
}
|
|
83
83
|
],
|
|
84
|
-
"
|
|
84
|
+
"sideEffects": false,
|
|
85
85
|
"jsdelivr": "tsparticles.plugin.infection.min.js",
|
|
86
86
|
"unpkg": "tsparticles.plugin.infection.min.js",
|
|
87
|
+
"browser": "browser/index.js",
|
|
88
|
+
"main": "cjs/index.js",
|
|
87
89
|
"module": "esm/index.js",
|
|
88
90
|
"types": "types/index.d.ts",
|
|
89
|
-
"
|
|
91
|
+
"exports": {
|
|
92
|
+
".": {
|
|
93
|
+
"types": "./types/index.d.ts",
|
|
94
|
+
"browser": "./browser/index.js",
|
|
95
|
+
"import": "./esm/index.js",
|
|
96
|
+
"require": "./cjs/index.js",
|
|
97
|
+
"umd": "./umd/index.js",
|
|
98
|
+
"default": "./cjs/index.js"
|
|
99
|
+
},
|
|
100
|
+
"./package.json": "./package.json"
|
|
101
|
+
},
|
|
90
102
|
"dependencies": {
|
|
91
|
-
"@tsparticles/engine": "^3.0.0-beta.
|
|
103
|
+
"@tsparticles/engine": "^3.0.0-beta.2"
|
|
92
104
|
},
|
|
93
105
|
"publishConfig": {
|
|
94
106
|
"access": "public"
|