@tsparticles/interaction-external-push 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.
package/91.min.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(this.webpackChunk_tsparticles_interaction_external_push=this.webpackChunk_tsparticles_interaction_external_push||[]).push([[91],{91(t,e,i){i.d(e,{Pusher:()=>o});var s=i(702),n=i(303),r=i(586);let a="push";class o extends s.ExternalInteractorBase{handleClickMode;maxDistance=0;constructor(t){super(t),this.handleClickMode=(t,e)=>{if(t!==a)return;let i=this.container,s=i.actualOptions,r=s.interactivity?.modes.push;if(!r)return;let o=(0,n.getRangeValue)(r.quantity);if(o<=0)return;let l=(0,n.itemFromArray)([void 0,...r.groups]),c=void 0!==l?i.actualOptions.particles.groups[l]:void 0,u=(0,n.itemFromSingleOrMultiple)(r.particles),p=(0,n.deepExtend)(c,u);i.particles.push(o,e.mouse.position,p,l)}}clear(){}init(){}interact(){}isEnabled(t,e){let i=this.container.actualOptions,s=t.mouse,r=(e?.interactivity??i.interactivity)?.events;return!!r&&s.clicking&&s.inside&&!!s.position&&(0,n.isInArray)(a,r.onClick.mode)}loadModeOptions(t,...e){for(let i of(t.push??=new r.$,e))t.push.load(i?.push)}reset(){}}}}]);
package/README.md CHANGED
@@ -9,6 +9,12 @@
9
9
  [tsParticles](https://github.com/tsparticles/tsparticles) interaction plugin for push effect around mouse or HTML
10
10
  elements.
11
11
 
12
+ ## Quick checklist
13
+
14
+ 1. Install `@tsparticles/engine` (or use the CDN bundle below)
15
+ 2. Call the package loader function(s) before `tsParticles.load(...)`
16
+ 3. Apply the package options in your `tsParticles.load(...)` config
17
+
12
18
  ## How to use it
13
19
 
14
20
  ### CDN / Vanilla JS / jQuery
@@ -79,3 +85,35 @@ import { loadExternalPushInteraction } from "@tsparticles/interaction-external-p
79
85
  await loadExternalPushInteraction(tsParticles);
80
86
  })();
81
87
  ```
88
+
89
+ ## Option mapping
90
+
91
+ - Event mode key: `interactivity.events.onHover.mode` or `interactivity.events.onClick.mode` with value `"push"`
92
+ - Mode options key: `interactivity.modes.push`
93
+
94
+ ```json
95
+ {
96
+ "interactivity": {
97
+ "events": {
98
+ "onHover": {
99
+ "enable": true,
100
+ "mode": "push"
101
+ }
102
+ },
103
+ "modes": {
104
+ "push": {}
105
+ }
106
+ }
107
+ }
108
+ ```
109
+
110
+ ## Common pitfalls
111
+
112
+ - Calling `tsParticles.load(...)` before `loadInteractivityPlugin(...)`
113
+ - Verify required peer packages before enabling advanced options
114
+ - Change one option group at a time to isolate regressions quickly
115
+
116
+ ## Related docs
117
+
118
+ - All packages catalog: <https://github.com/tsparticles/tsparticles>
119
+ - Main docs: <https://particles.js.org/docs/>
package/browser/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  export async function loadExternalPushInteraction(engine) {
2
- engine.checkVersion("4.0.0-beta.0");
3
- await engine.register(async (e) => {
2
+ engine.checkVersion("4.0.0-beta.10");
3
+ await engine.pluginManager.register(async (e) => {
4
4
  const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
5
5
  ensureInteractivityPluginLoaded(e);
6
- e.addInteractor?.("externalPush", async (container) => {
6
+ e.pluginManager.addInteractor?.("externalPush", async (container) => {
7
7
  const { Pusher } = await import("./Pusher.js");
8
8
  return new Pusher(container);
9
9
  });
package/cjs/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  export async function loadExternalPushInteraction(engine) {
2
- engine.checkVersion("4.0.0-beta.0");
3
- await engine.register(async (e) => {
2
+ engine.checkVersion("4.0.0-beta.10");
3
+ await engine.pluginManager.register(async (e) => {
4
4
  const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
5
5
  ensureInteractivityPluginLoaded(e);
6
- e.addInteractor?.("externalPush", async (container) => {
6
+ e.pluginManager.addInteractor?.("externalPush", async (container) => {
7
7
  const { Pusher } = await import("./Pusher.js");
8
8
  return new Pusher(container);
9
9
  });
@@ -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,9 +1,9 @@
1
1
  export async function loadExternalPushInteraction(engine) {
2
- engine.checkVersion("4.0.0-beta.0");
3
- await engine.register(async (e) => {
2
+ engine.checkVersion("4.0.0-beta.10");
3
+ await engine.pluginManager.register(async (e) => {
4
4
  const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
5
5
  ensureInteractivityPluginLoaded(e);
6
- e.addInteractor?.("externalPush", async (container) => {
6
+ e.pluginManager.addInteractor?.("externalPush", async (container) => {
7
7
  const { Pusher } = await import("./Pusher.js");
8
8
  return new Pusher(container);
9
9
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/interaction-external-push",
3
- "version": "4.0.0-beta.0",
3
+ "version": "4.0.0-beta.10",
4
4
  "description": "tsParticles push external interaction",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -81,17 +81,20 @@
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",
91
- "@tsparticles/plugin-interactivity": "4.0.0-beta.0"
88
+ "peerDepdendencies": {
89
+ "@tsparticles/engine": "4.0.0-beta.1",
90
+ "@tsparticles/plugin-interactivity": "4.0.0-beta.1"
92
91
  },
93
92
  "publishConfig": {
94
93
  "access": "public"
95
94
  },
96
- "type": "module"
95
+ "type": "module",
96
+ "peerDependencies": {
97
+ "@tsparticles/engine": "4.0.0-beta.10",
98
+ "@tsparticles/plugin-interactivity": "4.0.0-beta.10"
99
+ }
97
100
  }