@tsparticles/updater-gradient 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.
Files changed (42) hide show
  1. package/README.md +1 -1
  2. package/browser/GradientUpdater.js +2 -2
  3. package/browser/Options/Classes/AnimatableGradient.js +2 -2
  4. package/browser/Options/Classes/AnimatableGradientColor.js +1 -1
  5. package/browser/Options/Classes/GradientAngle.js +1 -1
  6. package/browser/Options/Classes/GradientColorOpacity.js +1 -1
  7. package/browser/index.js +1 -1
  8. package/browser/package.json +1 -0
  9. package/cjs/GradientUpdater.js +4 -4
  10. package/cjs/Options/Classes/AnimatableGradient.js +4 -4
  11. package/cjs/Options/Classes/AnimatableGradientColor.js +2 -2
  12. package/cjs/Options/Classes/GradientAngle.js +2 -2
  13. package/cjs/Options/Classes/GradientColorOpacity.js +2 -2
  14. package/cjs/index.js +2 -2
  15. package/cjs/package.json +1 -0
  16. package/esm/GradientUpdater.js +2 -2
  17. package/esm/Options/Classes/AnimatableGradient.js +2 -2
  18. package/esm/Options/Classes/AnimatableGradientColor.js +1 -1
  19. package/esm/Options/Classes/GradientAngle.js +1 -1
  20. package/esm/Options/Classes/GradientColorOpacity.js +1 -1
  21. package/esm/index.js +1 -1
  22. package/esm/package.json +1 -0
  23. package/package.json +18 -6
  24. package/report.html +23 -5
  25. package/tsparticles.updater.gradient.js +1 -1
  26. package/tsparticles.updater.gradient.min.js.LICENSE.txt +1 -1
  27. package/types/GradientUpdater.d.ts +1 -1
  28. package/types/Options/Classes/AnimatableGradient.d.ts +3 -3
  29. package/types/Options/Classes/AnimatableGradientColor.d.ts +2 -2
  30. package/types/Options/Classes/GradientAngle.d.ts +2 -2
  31. package/types/Options/Classes/GradientColorOpacity.d.ts +3 -3
  32. package/types/Options/Classes/GradientColorOpacityAnimation.d.ts +1 -1
  33. package/types/Options/Interfaces/IAnimatableGradient.d.ts +2 -2
  34. package/types/Options/Interfaces/IOptionsGradient.d.ts +1 -1
  35. package/types/Types.d.ts +2 -2
  36. package/types/Utils.d.ts +1 -1
  37. package/umd/GradientUpdater.js +5 -5
  38. package/umd/Options/Classes/AnimatableGradient.js +5 -5
  39. package/umd/Options/Classes/AnimatableGradientColor.js +3 -3
  40. package/umd/Options/Classes/GradientAngle.js +3 -3
  41. package/umd/Options/Classes/GradientColorOpacity.js +3 -3
  42. package/umd/index.js +3 -3
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  [![npmjs](https://badge.fury.io/js/@tsparticles/updater-gradient.svg)](https://www.npmjs.com/package/@tsparticles/updater-gradient)
7
7
  [![npmjs](https://img.shields.io/npm/dt/@tsparticles/updater-gradient)](https://www.npmjs.com/package/@tsparticles/updater-gradient) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni)
8
8
 
9
- [tsParticles](https://github.com/matteobruni/tsparticles) updater plugin for gradient animations.
9
+ [tsParticles](https://github.com/tsparticles/tsparticles) updater plugin for gradient animations.
10
10
 
11
11
  ## How to use it
12
12
 
@@ -1,6 +1,6 @@
1
1
  import { executeOnSingleOrMultiple, getHslAnimationFromHsl, getRandom, getRangeMax, getRangeMin, getRangeValue, getStyleFromHsl, itemFromSingleOrMultiple, randomInRange, rangeColorToHsl, } from "@tsparticles/engine";
2
- import { AnimatableGradient } from "./Options/Classes/AnimatableGradient";
3
- import { updateGradient } from "./Utils";
2
+ import { AnimatableGradient } from "./Options/Classes/AnimatableGradient.js";
3
+ import { updateGradient } from "./Utils.js";
4
4
  export class GradientUpdater {
5
5
  getColorStyles(particle, context, radius, opacity) {
6
6
  const gradient = particle.gradient;
@@ -1,5 +1,5 @@
1
- import { AnimatableGradientColor } from "./AnimatableGradientColor";
2
- import { GradientAngle } from "./GradientAngle";
1
+ import { AnimatableGradientColor } from "./AnimatableGradientColor.js";
2
+ import { GradientAngle } from "./GradientAngle.js";
3
3
  export class AnimatableGradient {
4
4
  constructor() {
5
5
  this.angle = new GradientAngle();
@@ -1,5 +1,5 @@
1
1
  import { AnimatableColor, isNumber } from "@tsparticles/engine";
2
- import { GradientColorOpacity } from "./GradientColorOpacity";
2
+ import { GradientColorOpacity } from "./GradientColorOpacity.js";
3
3
  export class AnimatableGradientColor {
4
4
  constructor() {
5
5
  this.stop = 0;
@@ -1,5 +1,5 @@
1
1
  import { setRangeValue, } from "@tsparticles/engine";
2
- import { GradientAngleAnimation } from "./GradientAngleAnimation";
2
+ import { GradientAngleAnimation } from "./GradientAngleAnimation.js";
3
3
  export class GradientAngle {
4
4
  constructor() {
5
5
  this.value = 0;
@@ -1,5 +1,5 @@
1
1
  import { setRangeValue, } from "@tsparticles/engine";
2
- import { GradientColorOpacityAnimation } from "./GradientColorOpacityAnimation";
2
+ import { GradientColorOpacityAnimation } from "./GradientColorOpacityAnimation.js";
3
3
  export class GradientColorOpacity {
4
4
  constructor() {
5
5
  this.value = 0;
package/browser/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { GradientUpdater } from "./GradientUpdater";
1
+ import { GradientUpdater } from "./GradientUpdater.js";
2
2
  export async function loadGradientUpdater(engine, refresh = true) {
3
3
  await engine.addParticleUpdater("gradient", () => new GradientUpdater(), refresh);
4
4
  }
@@ -0,0 +1 @@
1
+ { "type": "module" }
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GradientUpdater = void 0;
4
4
  const engine_1 = require("@tsparticles/engine");
5
- const AnimatableGradient_1 = require("./Options/Classes/AnimatableGradient");
6
- const Utils_1 = require("./Utils");
5
+ const AnimatableGradient_js_1 = require("./Options/Classes/AnimatableGradient.js");
6
+ const Utils_js_1 = require("./Utils.js");
7
7
  class GradientUpdater {
8
8
  getColorStyles(particle, context, radius, opacity) {
9
9
  const gradient = particle.gradient;
@@ -120,14 +120,14 @@ class GradientUpdater {
120
120
  continue;
121
121
  }
122
122
  options.gradient = (0, engine_1.executeOnSingleOrMultiple)(gradientToLoad, (gradient) => {
123
- const tmp = new AnimatableGradient_1.AnimatableGradient();
123
+ const tmp = new AnimatableGradient_js_1.AnimatableGradient();
124
124
  tmp.load(gradient);
125
125
  return tmp;
126
126
  });
127
127
  }
128
128
  }
129
129
  update(particle, delta) {
130
- (0, Utils_1.updateGradient)(particle, delta);
130
+ (0, Utils_js_1.updateGradient)(particle, delta);
131
131
  }
132
132
  }
133
133
  exports.GradientUpdater = GradientUpdater;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AnimatableGradient = void 0;
4
- const AnimatableGradientColor_1 = require("./AnimatableGradientColor");
5
- const GradientAngle_1 = require("./GradientAngle");
4
+ const AnimatableGradientColor_js_1 = require("./AnimatableGradientColor.js");
5
+ const GradientAngle_js_1 = require("./GradientAngle.js");
6
6
  class AnimatableGradient {
7
7
  constructor() {
8
- this.angle = new GradientAngle_1.GradientAngle();
8
+ this.angle = new GradientAngle_js_1.GradientAngle();
9
9
  this.colors = [];
10
10
  this.type = "random";
11
11
  }
@@ -16,7 +16,7 @@ class AnimatableGradient {
16
16
  this.angle.load(data.angle);
17
17
  if (data.colors !== undefined) {
18
18
  this.colors = data.colors.map((s) => {
19
- const tmp = new AnimatableGradientColor_1.AnimatableGradientColor();
19
+ const tmp = new AnimatableGradientColor_js_1.AnimatableGradientColor();
20
20
  tmp.load(s);
21
21
  return tmp;
22
22
  });
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AnimatableGradientColor = void 0;
4
4
  const engine_1 = require("@tsparticles/engine");
5
- const GradientColorOpacity_1 = require("./GradientColorOpacity");
5
+ const GradientColorOpacity_js_1 = require("./GradientColorOpacity.js");
6
6
  class AnimatableGradientColor {
7
7
  constructor() {
8
8
  this.stop = 0;
@@ -17,7 +17,7 @@ class AnimatableGradientColor {
17
17
  }
18
18
  this.value = engine_1.AnimatableColor.create(this.value, data.value);
19
19
  if (data.opacity !== undefined) {
20
- this.opacity = new GradientColorOpacity_1.GradientColorOpacity();
20
+ this.opacity = new GradientColorOpacity_js_1.GradientColorOpacity();
21
21
  if ((0, engine_1.isNumber)(data.opacity)) {
22
22
  this.opacity.value = data.opacity;
23
23
  }
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GradientAngle = void 0;
4
4
  const engine_1 = require("@tsparticles/engine");
5
- const GradientAngleAnimation_1 = require("./GradientAngleAnimation");
5
+ const GradientAngleAnimation_js_1 = require("./GradientAngleAnimation.js");
6
6
  class GradientAngle {
7
7
  constructor() {
8
8
  this.value = 0;
9
- this.animation = new GradientAngleAnimation_1.GradientAngleAnimation();
9
+ this.animation = new GradientAngleAnimation_js_1.GradientAngleAnimation();
10
10
  this.direction = "clockwise";
11
11
  }
12
12
  load(data) {
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GradientColorOpacity = void 0;
4
4
  const engine_1 = require("@tsparticles/engine");
5
- const GradientColorOpacityAnimation_1 = require("./GradientColorOpacityAnimation");
5
+ const GradientColorOpacityAnimation_js_1 = require("./GradientColorOpacityAnimation.js");
6
6
  class GradientColorOpacity {
7
7
  constructor() {
8
8
  this.value = 0;
9
- this.animation = new GradientColorOpacityAnimation_1.GradientColorOpacityAnimation();
9
+ this.animation = new GradientColorOpacityAnimation_js_1.GradientColorOpacityAnimation();
10
10
  }
11
11
  load(data) {
12
12
  if (!data) {
package/cjs/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadGradientUpdater = void 0;
4
- const GradientUpdater_1 = require("./GradientUpdater");
4
+ const GradientUpdater_js_1 = require("./GradientUpdater.js");
5
5
  async function loadGradientUpdater(engine, refresh = true) {
6
- await engine.addParticleUpdater("gradient", () => new GradientUpdater_1.GradientUpdater(), refresh);
6
+ await engine.addParticleUpdater("gradient", () => new GradientUpdater_js_1.GradientUpdater(), refresh);
7
7
  }
8
8
  exports.loadGradientUpdater = loadGradientUpdater;
@@ -0,0 +1 @@
1
+ { "type": "commonjs" }
@@ -1,6 +1,6 @@
1
1
  import { executeOnSingleOrMultiple, getHslAnimationFromHsl, getRandom, getRangeMax, getRangeMin, getRangeValue, getStyleFromHsl, itemFromSingleOrMultiple, randomInRange, rangeColorToHsl, } from "@tsparticles/engine";
2
- import { AnimatableGradient } from "./Options/Classes/AnimatableGradient";
3
- import { updateGradient } from "./Utils";
2
+ import { AnimatableGradient } from "./Options/Classes/AnimatableGradient.js";
3
+ import { updateGradient } from "./Utils.js";
4
4
  export class GradientUpdater {
5
5
  getColorStyles(particle, context, radius, opacity) {
6
6
  const gradient = particle.gradient;
@@ -1,5 +1,5 @@
1
- import { AnimatableGradientColor } from "./AnimatableGradientColor";
2
- import { GradientAngle } from "./GradientAngle";
1
+ import { AnimatableGradientColor } from "./AnimatableGradientColor.js";
2
+ import { GradientAngle } from "./GradientAngle.js";
3
3
  export class AnimatableGradient {
4
4
  constructor() {
5
5
  this.angle = new GradientAngle();
@@ -1,5 +1,5 @@
1
1
  import { AnimatableColor, isNumber } from "@tsparticles/engine";
2
- import { GradientColorOpacity } from "./GradientColorOpacity";
2
+ import { GradientColorOpacity } from "./GradientColorOpacity.js";
3
3
  export class AnimatableGradientColor {
4
4
  constructor() {
5
5
  this.stop = 0;
@@ -1,5 +1,5 @@
1
1
  import { setRangeValue, } from "@tsparticles/engine";
2
- import { GradientAngleAnimation } from "./GradientAngleAnimation";
2
+ import { GradientAngleAnimation } from "./GradientAngleAnimation.js";
3
3
  export class GradientAngle {
4
4
  constructor() {
5
5
  this.value = 0;
@@ -1,5 +1,5 @@
1
1
  import { setRangeValue, } from "@tsparticles/engine";
2
- import { GradientColorOpacityAnimation } from "./GradientColorOpacityAnimation";
2
+ import { GradientColorOpacityAnimation } from "./GradientColorOpacityAnimation.js";
3
3
  export class GradientColorOpacity {
4
4
  constructor() {
5
5
  this.value = 0;
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { GradientUpdater } from "./GradientUpdater";
1
+ import { GradientUpdater } from "./GradientUpdater.js";
2
2
  export async function loadGradientUpdater(engine, refresh = true) {
3
3
  await engine.addParticleUpdater("gradient", () => new GradientUpdater(), refresh);
4
4
  }
@@ -0,0 +1 @@
1
+ { "type": "module" }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@tsparticles/updater-gradient",
3
- "version": "3.0.0-beta.0",
3
+ "version": "3.0.0-beta.2",
4
4
  "description": "tsParticles particles gradient updater",
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": "updaters/gradient"
10
10
  },
11
11
  "keywords": [
@@ -66,7 +66,7 @@
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
71
  "funding": [
72
72
  {
@@ -82,14 +82,26 @@
82
82
  "url": "https://www.buymeacoffee.com/matteobruni"
83
83
  }
84
84
  ],
85
- "main": "cjs/index.js",
85
+ "sideEffects": false,
86
86
  "jsdelivr": "tsparticles.updater.gradient.min.js",
87
87
  "unpkg": "tsparticles.updater.gradient.min.js",
88
+ "browser": "browser/index.js",
89
+ "main": "cjs/index.js",
88
90
  "module": "esm/index.js",
89
91
  "types": "types/index.d.ts",
90
- "sideEffects": false,
92
+ "exports": {
93
+ ".": {
94
+ "types": "./types/index.d.ts",
95
+ "browser": "./browser/index.js",
96
+ "import": "./esm/index.js",
97
+ "require": "./cjs/index.js",
98
+ "umd": "./umd/index.js",
99
+ "default": "./cjs/index.js"
100
+ },
101
+ "./package.json": "./package.json"
102
+ },
91
103
  "dependencies": {
92
- "@tsparticles/engine": "^3.0.0-beta.0"
104
+ "@tsparticles/engine": "^3.0.0-beta.2"
93
105
  },
94
106
  "publishConfig": {
95
107
  "access": "public"