@tsparticles/updater-rotate 4.0.0-beta.0 → 4.0.0-beta.10

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 +1 @@
1
- "use strict";(this.webpackChunk_tsparticles_updater_rotate=this.webpackChunk_tsparticles_updater_rotate||[]).push([[558],{558(t,e,a){a.d(e,{RotateUpdater:()=>s});var i=a(303);class o{decay;enable;speed;sync;constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(t){(0,i.isNull)(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=(0,i.setRangeValue)(t.speed)),void 0!==t.decay&&(this.decay=(0,i.setRangeValue)(t.decay)),void 0!==t.sync&&(this.sync=t.sync))}}class n extends i.ValueWithRandom{animation;direction;path;constructor(){super(),this.animation=new o,this.direction=i.RotateDirection.clockwise,this.path=!1,this.value=0}load(t){(0,i.isNull)(t)||(super.load(t),void 0!==t.direction&&(this.direction=t.direction),this.animation.load(t.animation),void 0!==t.path&&(this.path=t.path))}}class s{container;constructor(t){this.container=t}init(t){let e=t.options.rotate;if(!e)return;t.rotate={enable:e.animation.enable,value:(0,i.degToRad)((0,i.getRangeValue)(e.value)),min:0,max:i.doublePI},t.pathRotation=e.path;let a=e.direction;switch(a===i.RotateDirection.random&&(a=Math.floor((0,i.getRandom)()*i.double)>0?i.RotateDirection.counterClockwise:i.RotateDirection.clockwise),a){case i.RotateDirection.counterClockwise:case"counterClockwise":t.rotate.status=i.AnimationStatus.decreasing;break;case i.RotateDirection.clockwise:t.rotate.status=i.AnimationStatus.increasing}let o=e.animation;o.enable&&(t.rotate.decay=i.identity-(0,i.getRangeValue)(o.decay),t.rotate.velocity=(0,i.getRangeValue)(o.speed)/360*this.container.retina.reduceFactor,o.sync||(t.rotate.velocity*=(0,i.getRandom)())),t.rotation=t.rotate.value}isEnabled(t){let e=t.options.rotate;return!!e&&!t.destroyed&&!t.spawning&&(!!e.value||e.animation.enable||e.path)}loadOptions(t,...e){for(let a of(t.rotate??=new n,e))t.rotate.load(a?.rotate)}update(t,e){!this.isEnabled(t)||(t.isRotating=!!t.rotate,t.rotate&&((0,i.updateAnimation)(t,t.rotate,!1,i.DestroyType.none,e),t.rotation=t.rotate.value))}}}}]);
1
+ "use strict";(this.webpackChunk_tsparticles_updater_rotate=this.webpackChunk_tsparticles_updater_rotate||[]).push([[350],{350(t,e,a){a.d(e,{RotateUpdater:()=>s});var i=a(303);class o{decay;enable;speed;sync;constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(t){(0,i.isNull)(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=(0,i.setRangeValue)(t.speed)),void 0!==t.decay&&(this.decay=(0,i.setRangeValue)(t.decay)),void 0!==t.sync&&(this.sync=t.sync))}}class n extends i.ValueWithRandom{animation;direction;path;constructor(){super(),this.animation=new o,this.direction=i.RotateDirection.clockwise,this.path=!1,this.value=0}load(t){(0,i.isNull)(t)||(super.load(t),void 0!==t.direction&&(this.direction=t.direction),this.animation.load(t.animation),void 0!==t.path&&(this.path=t.path))}}class s{container;constructor(t){this.container=t}init(t){let e=t.options.rotate;if(!e)return;t.rotate={enable:e.animation.enable,value:(0,i.degToRad)((0,i.getRangeValue)(e.value)),min:0,max:i.doublePI},t.pathRotation=e.path;let a=e.direction;switch(a===i.RotateDirection.random&&(a=Math.floor((0,i.getRandom)()*i.double)>0?i.RotateDirection.counterClockwise:i.RotateDirection.clockwise),a){case i.RotateDirection.counterClockwise:case"counterClockwise":t.rotate.status=i.AnimationStatus.decreasing;break;case i.RotateDirection.clockwise:t.rotate.status=i.AnimationStatus.increasing}let o=e.animation;o.enable&&(t.rotate.decay=i.identity-(0,i.getRangeValue)(o.decay),t.rotate.velocity=(0,i.getRangeValue)(o.speed)/360*this.container.retina.reduceFactor,o.sync||(t.rotate.velocity*=(0,i.getRandom)())),t.rotation=t.rotate.value}isEnabled(t){let e=t.options.rotate;return!!e&&!t.destroyed&&!t.spawning&&(!!e.value||e.animation.enable||e.path)}loadOptions(t,...e){for(let a of(t.rotate??=new n,e))t.rotate.load(a?.rotate)}update(t,e){!this.isEnabled(t)||(t.isRotating=!!t.rotate,t.rotate&&((0,i.updateAnimation)(t,t.rotate,!1,i.DestroyType.none,e),t.rotation=t.rotate.value))}}}}]);
package/README.md CHANGED
@@ -8,6 +8,12 @@
8
8
 
9
9
  [tsParticles](https://github.com/tsparticles/tsparticles) updater plugin for rotate animations.
10
10
 
11
+ ## Quick checklist
12
+
13
+ 1. Install `@tsparticles/engine` (or use the CDN bundle below)
14
+ 2. Call the package loader function(s) before `tsParticles.load(...)`
15
+ 3. Apply the package options in your `tsParticles.load(...)` config
16
+
11
17
  ## How to use it
12
18
 
13
19
  ### CDN / Vanilla JS / jQuery
@@ -72,3 +78,26 @@ import { loadRotateUpdater } from "@tsparticles/updater-rotate";
72
78
  await loadRotateUpdater(tsParticles);
73
79
  })();
74
80
  ```
81
+
82
+ ## Option mapping
83
+
84
+ - Primary options key: `particles.rotate`
85
+
86
+ ```json
87
+ {
88
+ "particles": {
89
+ "rotate": {}
90
+ }
91
+ }
92
+ ```
93
+
94
+ ## Common pitfalls
95
+
96
+ - Calling `tsParticles.load(...)` before `loadRotateUpdater(...)`
97
+ - Verify required peer packages before enabling advanced options
98
+ - Change one option group at a time to isolate regressions quickly
99
+
100
+ ## Related docs
101
+
102
+ - All packages catalog: <https://github.com/tsparticles/tsparticles>
103
+ - Main docs: <https://particles.js.org/docs/>
package/browser/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export async function loadRotateUpdater(engine) {
2
- engine.checkVersion("4.0.0-beta.0");
3
- await engine.register(e => {
4
- e.addParticleUpdater("rotate", async (container) => {
2
+ engine.checkVersion("4.0.0-beta.10");
3
+ await engine.pluginManager.register(e => {
4
+ e.pluginManager.addParticleUpdater("rotate", async (container) => {
5
5
  const { RotateUpdater } = await import("./RotateUpdater.js");
6
6
  return new RotateUpdater(container);
7
7
  });
package/cjs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export async function loadRotateUpdater(engine) {
2
- engine.checkVersion("4.0.0-beta.0");
3
- await engine.register(e => {
4
- e.addParticleUpdater("rotate", async (container) => {
2
+ engine.checkVersion("4.0.0-beta.10");
3
+ await engine.pluginManager.register(e => {
4
+ e.pluginManager.addParticleUpdater("rotate", async (container) => {
5
5
  const { RotateUpdater } = await import("./RotateUpdater.js");
6
6
  return new RotateUpdater(container);
7
7
  });
@@ -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.10
8
8
  */
9
9
  "use strict";
10
10
  /*
package/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export async function loadRotateUpdater(engine) {
2
- engine.checkVersion("4.0.0-beta.0");
3
- await engine.register(e => {
4
- e.addParticleUpdater("rotate", async (container) => {
2
+ engine.checkVersion("4.0.0-beta.10");
3
+ await engine.pluginManager.register(e => {
4
+ e.pluginManager.addParticleUpdater("rotate", async (container) => {
5
5
  const { RotateUpdater } = await import("./RotateUpdater.js");
6
6
  return new RotateUpdater(container);
7
7
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/updater-rotate",
3
- "version": "4.0.0-beta.0",
3
+ "version": "4.0.0-beta.10",
4
4
  "description": "tsParticles particles rotate 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.10"
91
90
  },
92
91
  "publishConfig": {
93
92
  "access": "public"