@tsparticles/plugin-infection 4.0.0-beta.8 → 4.0.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.
@@ -0,0 +1,5 @@
1
+ import { loadInfectionPlugin } from "./index.js";
2
+ const globalObject = globalThis;
3
+ globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
4
+ globalObject.loadInfectionPlugin = loadInfectionPlugin;
5
+ export * from "./index.js";
package/browser/index.js CHANGED
@@ -1,15 +1,13 @@
1
+ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivity";
2
+ import { InfectionPlugin } from "./InfectionPlugin.js";
3
+ import { ParticlesInfecter } from "./ParticlesInfecter.js";
1
4
  export async function loadInfectionPlugin(engine) {
2
- engine.checkVersion("4.0.0-beta.8");
3
- await engine.pluginManager.register(async (e) => {
4
- const [{ ensureInteractivityPluginLoaded }, { InfectionPlugin },] = await Promise.all([
5
- import("@tsparticles/plugin-interactivity"),
6
- import("./InfectionPlugin.js"),
7
- ]);
5
+ engine.checkVersion("4.0.0");
6
+ await engine.pluginManager.register((e) => {
8
7
  ensureInteractivityPluginLoaded(e);
9
8
  e.pluginManager.addPlugin(new InfectionPlugin());
10
- e.pluginManager.addInteractor?.("particlesInfection", async (container) => {
11
- const { ParticlesInfecter } = await import("./ParticlesInfecter.js");
12
- return new ParticlesInfecter(container);
9
+ e.pluginManager.addInteractor?.("particlesInfection", (container) => {
10
+ return Promise.resolve(new ParticlesInfecter(container));
13
11
  });
14
12
  });
15
13
  }
@@ -0,0 +1,15 @@
1
+ export async function loadInfectionPlugin(engine) {
2
+ engine.checkVersion("4.0.0");
3
+ await engine.pluginManager.register(async (e) => {
4
+ const [{ ensureInteractivityPluginLoaded }, { InfectionPlugin },] = await Promise.all([
5
+ import("@tsparticles/plugin-interactivity/lazy"),
6
+ import("./InfectionPlugin.js"),
7
+ ]);
8
+ ensureInteractivityPluginLoaded(e);
9
+ e.pluginManager.addPlugin(new InfectionPlugin());
10
+ e.pluginManager.addInteractor?.("particlesInfection", async (container) => {
11
+ const { ParticlesInfecter } = await import("./ParticlesInfecter.js");
12
+ return new ParticlesInfecter(container);
13
+ });
14
+ });
15
+ }
package/cjs/browser.js ADDED
@@ -0,0 +1,5 @@
1
+ import { loadInfectionPlugin } from "./index.js";
2
+ const globalObject = globalThis;
3
+ globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
4
+ globalObject.loadInfectionPlugin = loadInfectionPlugin;
5
+ export * from "./index.js";
package/cjs/index.js CHANGED
@@ -1,15 +1,13 @@
1
+ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivity";
2
+ import { InfectionPlugin } from "./InfectionPlugin.js";
3
+ import { ParticlesInfecter } from "./ParticlesInfecter.js";
1
4
  export async function loadInfectionPlugin(engine) {
2
- engine.checkVersion("4.0.0-beta.8");
3
- await engine.pluginManager.register(async (e) => {
4
- const [{ ensureInteractivityPluginLoaded }, { InfectionPlugin },] = await Promise.all([
5
- import("@tsparticles/plugin-interactivity"),
6
- import("./InfectionPlugin.js"),
7
- ]);
5
+ engine.checkVersion("4.0.0");
6
+ await engine.pluginManager.register((e) => {
8
7
  ensureInteractivityPluginLoaded(e);
9
8
  e.pluginManager.addPlugin(new InfectionPlugin());
10
- e.pluginManager.addInteractor?.("particlesInfection", async (container) => {
11
- const { ParticlesInfecter } = await import("./ParticlesInfecter.js");
12
- return new ParticlesInfecter(container);
9
+ e.pluginManager.addInteractor?.("particlesInfection", (container) => {
10
+ return Promise.resolve(new ParticlesInfecter(container));
13
11
  });
14
12
  });
15
13
  }
@@ -0,0 +1,15 @@
1
+ export async function loadInfectionPlugin(engine) {
2
+ engine.checkVersion("4.0.0");
3
+ await engine.pluginManager.register(async (e) => {
4
+ const [{ ensureInteractivityPluginLoaded }, { InfectionPlugin },] = await Promise.all([
5
+ import("@tsparticles/plugin-interactivity/lazy"),
6
+ import("./InfectionPlugin.js"),
7
+ ]);
8
+ ensureInteractivityPluginLoaded(e);
9
+ e.pluginManager.addPlugin(new InfectionPlugin());
10
+ e.pluginManager.addInteractor?.("particlesInfection", async (container) => {
11
+ const { ParticlesInfecter } = await import("./ParticlesInfecter.js");
12
+ return new ParticlesInfecter(container);
13
+ });
14
+ });
15
+ }
package/esm/browser.js ADDED
@@ -0,0 +1,5 @@
1
+ import { loadInfectionPlugin } from "./index.js";
2
+ const globalObject = globalThis;
3
+ globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
4
+ globalObject.loadInfectionPlugin = loadInfectionPlugin;
5
+ export * from "./index.js";
package/esm/index.js CHANGED
@@ -1,15 +1,13 @@
1
+ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivity";
2
+ import { InfectionPlugin } from "./InfectionPlugin.js";
3
+ import { ParticlesInfecter } from "./ParticlesInfecter.js";
1
4
  export async function loadInfectionPlugin(engine) {
2
- engine.checkVersion("4.0.0-beta.8");
3
- await engine.pluginManager.register(async (e) => {
4
- const [{ ensureInteractivityPluginLoaded }, { InfectionPlugin },] = await Promise.all([
5
- import("@tsparticles/plugin-interactivity"),
6
- import("./InfectionPlugin.js"),
7
- ]);
5
+ engine.checkVersion("4.0.0");
6
+ await engine.pluginManager.register((e) => {
8
7
  ensureInteractivityPluginLoaded(e);
9
8
  e.pluginManager.addPlugin(new InfectionPlugin());
10
- e.pluginManager.addInteractor?.("particlesInfection", async (container) => {
11
- const { ParticlesInfecter } = await import("./ParticlesInfecter.js");
12
- return new ParticlesInfecter(container);
9
+ e.pluginManager.addInteractor?.("particlesInfection", (container) => {
10
+ return Promise.resolve(new ParticlesInfecter(container));
13
11
  });
14
12
  });
15
13
  }
@@ -0,0 +1,15 @@
1
+ export async function loadInfectionPlugin(engine) {
2
+ engine.checkVersion("4.0.0");
3
+ await engine.pluginManager.register(async (e) => {
4
+ const [{ ensureInteractivityPluginLoaded }, { InfectionPlugin },] = await Promise.all([
5
+ import("@tsparticles/plugin-interactivity/lazy"),
6
+ import("./InfectionPlugin.js"),
7
+ ]);
8
+ ensureInteractivityPluginLoaded(e);
9
+ e.pluginManager.addPlugin(new InfectionPlugin());
10
+ e.pluginManager.addInteractor?.("particlesInfection", async (container) => {
11
+ const { ParticlesInfecter } = await import("./ParticlesInfecter.js");
12
+ return new ParticlesInfecter(container);
13
+ });
14
+ });
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/plugin-infection",
3
- "version": "4.0.0-beta.8",
3
+ "version": "4.0.0",
4
4
  "description": "tsParticles infection plugin",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -96,11 +96,18 @@
96
96
  "require": "./cjs/index.js",
97
97
  "default": "./esm/index.js"
98
98
  },
99
+ "./lazy": {
100
+ "types": "./types/index.lazy.d.ts",
101
+ "browser": "./browser/index.lazy.js",
102
+ "import": "./esm/index.lazy.js",
103
+ "require": "./cjs/index.lazy.js",
104
+ "default": "./esm/index.lazy.js"
105
+ },
99
106
  "./package.json": "./package.json"
100
107
  },
101
108
  "peerDependencies": {
102
- "@tsparticles/engine": "4.0.0-beta.8",
103
- "@tsparticles/plugin-interactivity": "4.0.0-beta.8"
109
+ "@tsparticles/engine": "4.0.0",
110
+ "@tsparticles/plugin-interactivity": "4.0.0"
104
111
  },
105
112
  "publishConfig": {
106
113
  "access": "public"