@tsparticles/updater-stroke-color 4.0.0-beta.0 → 4.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/496.min.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(this.webpackChunk_tsparticles_updater_stroke_color=this.webpackChunk_tsparticles_updater_stroke_color||[]).push([[496],{496(e,t,o){o.d(t,{StrokeColorUpdater:()=>r});var i=o(303);class r{_container;_pluginManager;constructor(e,t){this._container=t,this._pluginManager=e}init(e){let t=this._container,o=e.options,r=(0,i.itemFromSingleOrMultiple)(o.stroke,e.id,o.reduceDuplicates);if(!r)return;e.strokeWidth=(0,i.getRangeValue)(r.width)*t.retina.pixelRatio,e.strokeOpacity=(0,i.getRangeValue)(r.opacity??1),e.strokeAnimation=r.color?.animation;let a=(0,i.rangeColorToHsl)(this._pluginManager,r.color)??e.getFillColor();a&&(e.strokeColor=(0,i.getHslAnimationFromHsl)(a,e.strokeAnimation,t.retina.reduceFactor))}isEnabled(e){let t=e.strokeAnimation,{strokeColor:o}=e;return!e.destroyed&&!e.spawning&&!!t&&(o?.h.value!==void 0&&o.h.enable||o?.s.value!==void 0&&o.s.enable||o?.l.value!==void 0&&o.l.enable)}update(e,t){this.isEnabled(e)&&(0,i.updateColor)(e.strokeColor,t)}}}}]);
@@ -2,10 +2,10 @@ import { getHslAnimationFromHsl, getRangeValue, itemFromSingleOrMultiple, rangeC
2
2
  const defaultOpacity = 1;
3
3
  export class StrokeColorUpdater {
4
4
  _container;
5
- _engine;
6
- constructor(engine, container) {
5
+ _pluginManager;
6
+ constructor(pluginManager, container) {
7
7
  this._container = container;
8
- this._engine = engine;
8
+ this._pluginManager = pluginManager;
9
9
  }
10
10
  init(particle) {
11
11
  const container = this._container, options = particle.options, stroke = itemFromSingleOrMultiple(options.stroke, particle.id, options.reduceDuplicates);
@@ -15,7 +15,7 @@ export class StrokeColorUpdater {
15
15
  particle.strokeWidth = getRangeValue(stroke.width) * container.retina.pixelRatio;
16
16
  particle.strokeOpacity = getRangeValue(stroke.opacity ?? defaultOpacity);
17
17
  particle.strokeAnimation = stroke.color?.animation;
18
- const strokeHslColor = rangeColorToHsl(this._engine, stroke.color) ?? particle.getFillColor();
18
+ const strokeHslColor = rangeColorToHsl(this._pluginManager, stroke.color) ?? particle.getFillColor();
19
19
  if (strokeHslColor) {
20
20
  particle.strokeColor = getHslAnimationFromHsl(strokeHslColor, particle.strokeAnimation, container.retina.reduceFactor);
21
21
  }
package/browser/Types.js CHANGED
@@ -1 +1 @@
1
- export {};
1
+ import {} from "@tsparticles/engine";
package/browser/index.js CHANGED
@@ -1,9 +1,10 @@
1
+ import {} from "@tsparticles/engine";
1
2
  export async function loadStrokeColorUpdater(engine) {
2
- engine.checkVersion("4.0.0-beta.0");
3
- await engine.register(e => {
4
- e.addParticleUpdater("strokeColor", async (container) => {
3
+ engine.checkVersion("4.0.0-beta.2");
4
+ await engine.pluginManager.register(e => {
5
+ e.pluginManager.addParticleUpdater("strokeColor", async (container) => {
5
6
  const { StrokeColorUpdater } = await import("./StrokeColorUpdater.js");
6
- return new StrokeColorUpdater(e, container);
7
+ return new StrokeColorUpdater(e.pluginManager, container);
7
8
  });
8
9
  });
9
10
  }
@@ -2,10 +2,10 @@ import { getHslAnimationFromHsl, getRangeValue, itemFromSingleOrMultiple, rangeC
2
2
  const defaultOpacity = 1;
3
3
  export class StrokeColorUpdater {
4
4
  _container;
5
- _engine;
6
- constructor(engine, container) {
5
+ _pluginManager;
6
+ constructor(pluginManager, container) {
7
7
  this._container = container;
8
- this._engine = engine;
8
+ this._pluginManager = pluginManager;
9
9
  }
10
10
  init(particle) {
11
11
  const container = this._container, options = particle.options, stroke = itemFromSingleOrMultiple(options.stroke, particle.id, options.reduceDuplicates);
@@ -15,7 +15,7 @@ export class StrokeColorUpdater {
15
15
  particle.strokeWidth = getRangeValue(stroke.width) * container.retina.pixelRatio;
16
16
  particle.strokeOpacity = getRangeValue(stroke.opacity ?? defaultOpacity);
17
17
  particle.strokeAnimation = stroke.color?.animation;
18
- const strokeHslColor = rangeColorToHsl(this._engine, stroke.color) ?? particle.getFillColor();
18
+ const strokeHslColor = rangeColorToHsl(this._pluginManager, stroke.color) ?? particle.getFillColor();
19
19
  if (strokeHslColor) {
20
20
  particle.strokeColor = getHslAnimationFromHsl(strokeHslColor, particle.strokeAnimation, container.retina.reduceFactor);
21
21
  }
package/cjs/Types.js CHANGED
@@ -1 +1 @@
1
- export {};
1
+ import {} from "@tsparticles/engine";
package/cjs/index.js CHANGED
@@ -1,9 +1,10 @@
1
+ import {} from "@tsparticles/engine";
1
2
  export async function loadStrokeColorUpdater(engine) {
2
- engine.checkVersion("4.0.0-beta.0");
3
- await engine.register(e => {
4
- e.addParticleUpdater("strokeColor", async (container) => {
3
+ engine.checkVersion("4.0.0-beta.2");
4
+ await engine.pluginManager.register(e => {
5
+ e.pluginManager.addParticleUpdater("strokeColor", async (container) => {
5
6
  const { StrokeColorUpdater } = await import("./StrokeColorUpdater.js");
6
- return new StrokeColorUpdater(e, container);
7
+ return new StrokeColorUpdater(e.pluginManager, container);
7
8
  });
8
9
  });
9
10
  }
@@ -4,7 +4,7 @@
4
4
  * Demo / Generator : https://particles.js.org/
5
5
  * GitHub : https://www.github.com/matteobruni/tsparticles
6
6
  * How to use? : Check the GitHub README
7
- * v4.0.0-beta.0
7
+ * v4.0.0-beta.2
8
8
  */
9
9
  "use strict";
10
10
  /*
@@ -23,7 +23,7 @@
23
23
  \********************************************/
24
24
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
25
25
 
26
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ StrokeColorUpdater: () => (/* binding */ StrokeColorUpdater)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst defaultOpacity = 1;\nclass StrokeColorUpdater {\n _container;\n _engine;\n constructor(engine, container){\n this._container = container;\n this._engine = engine;\n }\n init(particle) {\n const container = this._container, options = particle.options, stroke = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(options.stroke, particle.id, options.reduceDuplicates);\n if (!stroke) {\n return;\n }\n particle.strokeWidth = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(stroke.width) * container.retina.pixelRatio;\n particle.strokeOpacity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(stroke.opacity ?? defaultOpacity);\n particle.strokeAnimation = stroke.color?.animation;\n const strokeHslColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToHsl)(this._engine, stroke.color) ?? particle.getFillColor();\n if (strokeHslColor) {\n particle.strokeColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getHslAnimationFromHsl)(strokeHslColor, particle.strokeAnimation, container.retina.reduceFactor);\n }\n }\n isEnabled(particle) {\n const color = particle.strokeAnimation, { strokeColor } = particle;\n return !particle.destroyed && !particle.spawning && !!color && (strokeColor?.h.value !== undefined && strokeColor.h.enable || strokeColor?.s.value !== undefined && strokeColor.s.enable || strokeColor?.l.value !== undefined && strokeColor.l.enable);\n }\n update(particle, delta) {\n if (!this.isEnabled(particle)) {\n return;\n }\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.updateColor)(particle.strokeColor, delta);\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-stroke-color/./dist/browser/StrokeColorUpdater.js?\n}");
26
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ StrokeColorUpdater: () => (/* binding */ StrokeColorUpdater)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst defaultOpacity = 1;\nclass StrokeColorUpdater {\n _container;\n _pluginManager;\n constructor(pluginManager, container){\n this._container = container;\n this._pluginManager = pluginManager;\n }\n init(particle) {\n const container = this._container, options = particle.options, stroke = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(options.stroke, particle.id, options.reduceDuplicates);\n if (!stroke) {\n return;\n }\n particle.strokeWidth = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(stroke.width) * container.retina.pixelRatio;\n particle.strokeOpacity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(stroke.opacity ?? defaultOpacity);\n particle.strokeAnimation = stroke.color?.animation;\n const strokeHslColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToHsl)(this._pluginManager, stroke.color) ?? particle.getFillColor();\n if (strokeHslColor) {\n particle.strokeColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getHslAnimationFromHsl)(strokeHslColor, particle.strokeAnimation, container.retina.reduceFactor);\n }\n }\n isEnabled(particle) {\n const color = particle.strokeAnimation, { strokeColor } = particle;\n return !particle.destroyed && !particle.spawning && !!color && (strokeColor?.h.value !== undefined && strokeColor.h.enable || strokeColor?.s.value !== undefined && strokeColor.s.enable || strokeColor?.l.value !== undefined && strokeColor.l.enable);\n }\n update(particle, delta) {\n if (!this.isEnabled(particle)) {\n return;\n }\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.updateColor)(particle.strokeColor, delta);\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-stroke-color/./dist/browser/StrokeColorUpdater.js?\n}");
27
27
 
28
28
  /***/ }
29
29
 
@@ -2,10 +2,10 @@ import { getHslAnimationFromHsl, getRangeValue, itemFromSingleOrMultiple, rangeC
2
2
  const defaultOpacity = 1;
3
3
  export class StrokeColorUpdater {
4
4
  _container;
5
- _engine;
6
- constructor(engine, container) {
5
+ _pluginManager;
6
+ constructor(pluginManager, container) {
7
7
  this._container = container;
8
- this._engine = engine;
8
+ this._pluginManager = pluginManager;
9
9
  }
10
10
  init(particle) {
11
11
  const container = this._container, options = particle.options, stroke = itemFromSingleOrMultiple(options.stroke, particle.id, options.reduceDuplicates);
@@ -15,7 +15,7 @@ export class StrokeColorUpdater {
15
15
  particle.strokeWidth = getRangeValue(stroke.width) * container.retina.pixelRatio;
16
16
  particle.strokeOpacity = getRangeValue(stroke.opacity ?? defaultOpacity);
17
17
  particle.strokeAnimation = stroke.color?.animation;
18
- const strokeHslColor = rangeColorToHsl(this._engine, stroke.color) ?? particle.getFillColor();
18
+ const strokeHslColor = rangeColorToHsl(this._pluginManager, stroke.color) ?? particle.getFillColor();
19
19
  if (strokeHslColor) {
20
20
  particle.strokeColor = getHslAnimationFromHsl(strokeHslColor, particle.strokeAnimation, container.retina.reduceFactor);
21
21
  }
package/esm/Types.js CHANGED
@@ -1 +1 @@
1
- export {};
1
+ import {} from "@tsparticles/engine";
package/esm/index.js CHANGED
@@ -1,9 +1,10 @@
1
+ import {} from "@tsparticles/engine";
1
2
  export async function loadStrokeColorUpdater(engine) {
2
- engine.checkVersion("4.0.0-beta.0");
3
- await engine.register(e => {
4
- e.addParticleUpdater("strokeColor", async (container) => {
3
+ engine.checkVersion("4.0.0-beta.2");
4
+ await engine.pluginManager.register(e => {
5
+ e.pluginManager.addParticleUpdater("strokeColor", async (container) => {
5
6
  const { StrokeColorUpdater } = await import("./StrokeColorUpdater.js");
6
- return new StrokeColorUpdater(e, container);
7
+ return new StrokeColorUpdater(e.pluginManager, container);
7
8
  });
8
9
  });
9
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/updater-stroke-color",
3
- "version": "4.0.0-beta.0",
3
+ "version": "4.0.0-beta.2",
4
4
  "description": "tsParticles particles stroke color updater",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -81,13 +81,12 @@
81
81
  "browser": "./browser/index.js",
82
82
  "import": "./esm/index.js",
83
83
  "require": "./cjs/index.js",
84
- "umd": "./umd/index.js",
85
- "default": "./cjs/index.js"
84
+ "default": "./esm/index.js"
86
85
  },
87
86
  "./package.json": "./package.json"
88
87
  },
89
- "dependencies": {
90
- "@tsparticles/engine": "4.0.0-beta.0"
88
+ "peerDependencies": {
89
+ "@tsparticles/engine": "4.0.0-beta.1"
91
90
  },
92
91
  "publishConfig": {
93
92
  "access": "public"