@tsparticles/interaction-particles-collisions 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 CHANGED
@@ -6,7 +6,7 @@
6
6
  [![npmjs](https://badge.fury.io/js/@tsparticles/interaction-particles-collisions.svg)](https://www.npmjs.com/package/@tsparticles/interaction-particles-collisions)
7
7
  [![npmjs](https://img.shields.io/npm/dt/@tsparticles/interaction-particles-collisions)](https://www.npmjs.com/package/@tsparticles/interaction-particles-collisions) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni)
8
8
 
9
- [tsParticles](https://github.com/matteobruni/tsparticles) interaction plugin for collisions effect between particles.
9
+ [tsParticles](https://github.com/tsparticles/tsparticles) interaction plugin for collisions effect between particles.
10
10
 
11
11
  ## How to use it
12
12
 
@@ -1,5 +1,5 @@
1
1
  import { ParticlesInteractorBase, getDistance } from "@tsparticles/engine";
2
- import { resolveCollision } from "./ResolveCollision";
2
+ import { resolveCollision } from "./ResolveCollision.js";
3
3
  export class Collider extends ParticlesInteractorBase {
4
4
  constructor(container) {
5
5
  super(container);
@@ -1,4 +1,4 @@
1
- import { bounce } from "./Bounce";
1
+ import { bounce } from "./Bounce.js";
2
2
  export function destroy(p1, p2) {
3
3
  if (!p1.unbreakable && !p2.unbreakable) {
4
4
  bounce(p1, p2);
@@ -1,6 +1,6 @@
1
- import { absorb } from "./Absorb";
2
- import { bounce } from "./Bounce";
3
- import { destroy } from "./Destroy";
1
+ import { absorb } from "./Absorb.js";
2
+ import { bounce } from "./Bounce.js";
3
+ import { destroy } from "./Destroy.js";
4
4
  export function resolveCollision(p1, p2, delta, pixelRatio) {
5
5
  switch (p1.options.collisions.mode) {
6
6
  case "absorb": {
package/browser/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Collider } from "./Collider";
1
+ import { Collider } from "./Collider.js";
2
2
  export async function loadParticlesCollisionsInteraction(engine, refresh = true) {
3
3
  await engine.addInteractor("particlesCollisions", (container) => new Collider(container), refresh);
4
4
  }
@@ -0,0 +1 @@
1
+ { "type": "module" }
package/cjs/Collider.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Collider = void 0;
4
4
  const engine_1 = require("@tsparticles/engine");
5
- const ResolveCollision_1 = require("./ResolveCollision");
5
+ const ResolveCollision_js_1 = require("./ResolveCollision.js");
6
6
  class Collider extends engine_1.ParticlesInteractorBase {
7
7
  constructor(container) {
8
8
  super(container);
@@ -32,7 +32,7 @@ class Collider extends engine_1.ParticlesInteractorBase {
32
32
  if (dist > distP) {
33
33
  continue;
34
34
  }
35
- (0, ResolveCollision_1.resolveCollision)(p1, p2, delta, container.retina.pixelRatio);
35
+ (0, ResolveCollision_js_1.resolveCollision)(p1, p2, delta, container.retina.pixelRatio);
36
36
  }
37
37
  }
38
38
  isEnabled(particle) {
package/cjs/Destroy.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.destroy = void 0;
4
- const Bounce_1 = require("./Bounce");
4
+ const Bounce_js_1 = require("./Bounce.js");
5
5
  function destroy(p1, p2) {
6
6
  if (!p1.unbreakable && !p2.unbreakable) {
7
- (0, Bounce_1.bounce)(p1, p2);
7
+ (0, Bounce_js_1.bounce)(p1, p2);
8
8
  }
9
9
  if (p1.getRadius() === undefined && p2.getRadius() !== undefined) {
10
10
  p1.destroy();
@@ -1,21 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resolveCollision = void 0;
4
- const Absorb_1 = require("./Absorb");
5
- const Bounce_1 = require("./Bounce");
6
- const Destroy_1 = require("./Destroy");
4
+ const Absorb_js_1 = require("./Absorb.js");
5
+ const Bounce_js_1 = require("./Bounce.js");
6
+ const Destroy_js_1 = require("./Destroy.js");
7
7
  function resolveCollision(p1, p2, delta, pixelRatio) {
8
8
  switch (p1.options.collisions.mode) {
9
9
  case "absorb": {
10
- (0, Absorb_1.absorb)(p1, p2, delta, pixelRatio);
10
+ (0, Absorb_js_1.absorb)(p1, p2, delta, pixelRatio);
11
11
  break;
12
12
  }
13
13
  case "bounce": {
14
- (0, Bounce_1.bounce)(p1, p2);
14
+ (0, Bounce_js_1.bounce)(p1, p2);
15
15
  break;
16
16
  }
17
17
  case "destroy": {
18
- (0, Destroy_1.destroy)(p1, p2);
18
+ (0, Destroy_js_1.destroy)(p1, p2);
19
19
  break;
20
20
  }
21
21
  }
package/cjs/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadParticlesCollisionsInteraction = void 0;
4
- const Collider_1 = require("./Collider");
4
+ const Collider_js_1 = require("./Collider.js");
5
5
  async function loadParticlesCollisionsInteraction(engine, refresh = true) {
6
- await engine.addInteractor("particlesCollisions", (container) => new Collider_1.Collider(container), refresh);
6
+ await engine.addInteractor("particlesCollisions", (container) => new Collider_js_1.Collider(container), refresh);
7
7
  }
8
8
  exports.loadParticlesCollisionsInteraction = loadParticlesCollisionsInteraction;
@@ -0,0 +1 @@
1
+ { "type": "commonjs" }
package/esm/Collider.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ParticlesInteractorBase, getDistance } from "@tsparticles/engine";
2
- import { resolveCollision } from "./ResolveCollision";
2
+ import { resolveCollision } from "./ResolveCollision.js";
3
3
  export class Collider extends ParticlesInteractorBase {
4
4
  constructor(container) {
5
5
  super(container);
package/esm/Destroy.js CHANGED
@@ -1,4 +1,4 @@
1
- import { bounce } from "./Bounce";
1
+ import { bounce } from "./Bounce.js";
2
2
  export function destroy(p1, p2) {
3
3
  if (!p1.unbreakable && !p2.unbreakable) {
4
4
  bounce(p1, p2);
@@ -1,6 +1,6 @@
1
- import { absorb } from "./Absorb";
2
- import { bounce } from "./Bounce";
3
- import { destroy } from "./Destroy";
1
+ import { absorb } from "./Absorb.js";
2
+ import { bounce } from "./Bounce.js";
3
+ import { destroy } from "./Destroy.js";
4
4
  export function resolveCollision(p1, p2, delta, pixelRatio) {
5
5
  switch (p1.options.collisions.mode) {
6
6
  case "absorb": {
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Collider } from "./Collider";
1
+ import { Collider } from "./Collider.js";
2
2
  export async function loadParticlesCollisionsInteraction(engine, refresh = true) {
3
3
  await engine.addInteractor("particlesCollisions", (container) => new Collider(container), refresh);
4
4
  }
@@ -0,0 +1 @@
1
+ { "type": "module" }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@tsparticles/interaction-particles-collisions",
3
- "version": "3.0.0-beta.0",
3
+ "version": "3.0.0-beta.2",
4
4
  "description": "tsParticles collisions particles interaction",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/matteobruni/tsparticles.git",
8
+ "url": "git+https://github.com/tsparticles/tsparticles.git",
9
9
  "directory": "interactions/particles/collisions"
10
10
  },
11
11
  "keywords": [
@@ -66,16 +66,28 @@
66
66
  "author": "Matteo Bruni <matteo.bruni@me.com>",
67
67
  "license": "MIT",
68
68
  "bugs": {
69
- "url": "https://github.com/matteobruni/tsparticles/issues"
69
+ "url": "https://github.com/tsparticles/tsparticles/issues"
70
70
  },
71
- "main": "cjs/index.js",
71
+ "sideEffects": false,
72
72
  "jsdelivr": "tsparticles.interaction.particles.collisions.min.js",
73
73
  "unpkg": "tsparticles.interaction.particles.collisions.min.js",
74
+ "browser": "browser/index.js",
75
+ "main": "cjs/index.js",
74
76
  "module": "esm/index.js",
75
77
  "types": "types/index.d.ts",
76
- "sideEffects": false,
78
+ "exports": {
79
+ ".": {
80
+ "types": "./types/index.d.ts",
81
+ "browser": "./browser/index.js",
82
+ "import": "./esm/index.js",
83
+ "require": "./cjs/index.js",
84
+ "umd": "./umd/index.js",
85
+ "default": "./cjs/index.js"
86
+ },
87
+ "./package.json": "./package.json"
88
+ },
77
89
  "dependencies": {
78
- "@tsparticles/engine": "^3.0.0-beta.0"
90
+ "@tsparticles/engine": "^3.0.0-beta.2"
79
91
  },
80
92
  "publishConfig": {
81
93
  "access": "public"