@tsparticles/interaction-light 3.0.0-beta.3 → 3.0.0-beta.4

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,6 +1,6 @@
1
1
  import { ExternalInteractorBase, isInArray, rangeColorToRgb, } from "@tsparticles/engine";
2
+ import { drawLight, lightMode } from "./Utils.js";
2
3
  import { Light } from "./Options/Classes/Light.js";
3
- import { drawLight } from "./Utils.js";
4
4
  export class ExternalLighter extends ExternalInteractorBase {
5
5
  constructor(container) {
6
6
  super(container);
@@ -27,7 +27,7 @@ export class ExternalLighter extends ExternalInteractorBase {
27
27
  if (!(events.onHover.enable && mouse.position)) {
28
28
  return false;
29
29
  }
30
- const res = isInArray("light", events.onHover.mode);
30
+ const res = isInArray(lightMode, events.onHover.mode);
31
31
  if (res && interactivity.modes.light) {
32
32
  const lightGradient = interactivity.modes.light.area.gradient;
33
33
  container.canvas.mouseLight = {
@@ -1,5 +1,5 @@
1
1
  import { ParticlesInteractorBase, isInArray, rangeColorToRgb } from "@tsparticles/engine";
2
- import { drawParticleShadow } from "./Utils.js";
2
+ import { drawParticleShadow, lightMode } from "./Utils.js";
3
3
  export class ParticlesLighter extends ParticlesInteractorBase {
4
4
  constructor(container) {
5
5
  super(container);
@@ -26,7 +26,7 @@ export class ParticlesLighter extends ParticlesInteractorBase {
26
26
  if (!(events.onHover.enable && mouse.position)) {
27
27
  return false;
28
28
  }
29
- const res = isInArray("light", events.onHover.mode);
29
+ const res = isInArray(lightMode, events.onHover.mode);
30
30
  if (res && interactivity.modes.light) {
31
31
  const shadowOptions = interactivity.modes.light.shadow;
32
32
  particle.lightShadow = rangeColorToRgb(shadowOptions.color);
package/browser/Utils.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { getStyleFromRgb } from "@tsparticles/engine";
2
+ export const lightMode = "light";
2
3
  export function drawLight(container, context, mousePos) {
3
4
  const lightOptions = container.actualOptions.interactivity.modes.light?.area;
4
5
  if (!lightOptions) {
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ExternalLighter = void 0;
4
4
  const engine_1 = require("@tsparticles/engine");
5
- const Light_js_1 = require("./Options/Classes/Light.js");
6
5
  const Utils_js_1 = require("./Utils.js");
6
+ const Light_js_1 = require("./Options/Classes/Light.js");
7
7
  class ExternalLighter extends engine_1.ExternalInteractorBase {
8
8
  constructor(container) {
9
9
  super(container);
@@ -30,7 +30,7 @@ class ExternalLighter extends engine_1.ExternalInteractorBase {
30
30
  if (!(events.onHover.enable && mouse.position)) {
31
31
  return false;
32
32
  }
33
- const res = (0, engine_1.isInArray)("light", events.onHover.mode);
33
+ const res = (0, engine_1.isInArray)(Utils_js_1.lightMode, events.onHover.mode);
34
34
  if (res && interactivity.modes.light) {
35
35
  const lightGradient = interactivity.modes.light.area.gradient;
36
36
  container.canvas.mouseLight = {
@@ -29,7 +29,7 @@ class ParticlesLighter extends engine_1.ParticlesInteractorBase {
29
29
  if (!(events.onHover.enable && mouse.position)) {
30
30
  return false;
31
31
  }
32
- const res = (0, engine_1.isInArray)("light", events.onHover.mode);
32
+ const res = (0, engine_1.isInArray)(Utils_js_1.lightMode, events.onHover.mode);
33
33
  if (res && interactivity.modes.light) {
34
34
  const shadowOptions = interactivity.modes.light.shadow;
35
35
  particle.lightShadow = (0, engine_1.rangeColorToRgb)(shadowOptions.color);
package/cjs/Utils.js CHANGED
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.drawParticleShadow = exports.drawLight = void 0;
3
+ exports.drawParticleShadow = exports.drawLight = exports.lightMode = void 0;
4
4
  const engine_1 = require("@tsparticles/engine");
5
+ exports.lightMode = "light";
5
6
  function drawLight(container, context, mousePos) {
6
7
  const lightOptions = container.actualOptions.interactivity.modes.light?.area;
7
8
  if (!lightOptions) {
@@ -1,6 +1,6 @@
1
1
  import { ExternalInteractorBase, isInArray, rangeColorToRgb, } from "@tsparticles/engine";
2
+ import { drawLight, lightMode } from "./Utils.js";
2
3
  import { Light } from "./Options/Classes/Light.js";
3
- import { drawLight } from "./Utils.js";
4
4
  export class ExternalLighter extends ExternalInteractorBase {
5
5
  constructor(container) {
6
6
  super(container);
@@ -27,7 +27,7 @@ export class ExternalLighter extends ExternalInteractorBase {
27
27
  if (!(events.onHover.enable && mouse.position)) {
28
28
  return false;
29
29
  }
30
- const res = isInArray("light", events.onHover.mode);
30
+ const res = isInArray(lightMode, events.onHover.mode);
31
31
  if (res && interactivity.modes.light) {
32
32
  const lightGradient = interactivity.modes.light.area.gradient;
33
33
  container.canvas.mouseLight = {
@@ -1,5 +1,5 @@
1
1
  import { ParticlesInteractorBase, isInArray, rangeColorToRgb } from "@tsparticles/engine";
2
- import { drawParticleShadow } from "./Utils.js";
2
+ import { drawParticleShadow, lightMode } from "./Utils.js";
3
3
  export class ParticlesLighter extends ParticlesInteractorBase {
4
4
  constructor(container) {
5
5
  super(container);
@@ -26,7 +26,7 @@ export class ParticlesLighter extends ParticlesInteractorBase {
26
26
  if (!(events.onHover.enable && mouse.position)) {
27
27
  return false;
28
28
  }
29
- const res = isInArray("light", events.onHover.mode);
29
+ const res = isInArray(lightMode, events.onHover.mode);
30
30
  if (res && interactivity.modes.light) {
31
31
  const shadowOptions = interactivity.modes.light.shadow;
32
32
  particle.lightShadow = rangeColorToRgb(shadowOptions.color);
package/esm/Utils.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { getStyleFromRgb } from "@tsparticles/engine";
2
+ export const lightMode = "light";
2
3
  export function drawLight(container, context, mousePos) {
3
4
  const lightOptions = container.actualOptions.interactivity.modes.light?.area;
4
5
  if (!lightOptions) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/interaction-light",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.4",
4
4
  "description": "tsParticles Light interaction",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -60,7 +60,7 @@
60
60
  "confettijs",
61
61
  "fireworksjs",
62
62
  "canvas-confetti",
63
- "@tsparticles/plugin",
63
+ "tsparticles-plugin",
64
64
  "@tsparticles/interaction"
65
65
  ],
66
66
  "author": "Matteo Bruni <matteo.bruni@me.com>",
@@ -101,7 +101,7 @@
101
101
  "./package.json": "./package.json"
102
102
  },
103
103
  "dependencies": {
104
- "@tsparticles/engine": "^3.0.0-beta.3"
104
+ "@tsparticles/engine": "^3.0.0-beta.4"
105
105
  },
106
106
  "publishConfig": {
107
107
  "access": "public"