@tsparticles/interaction-external-push 3.0.0-beta.3 → 3.0.0-beta.5

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.
@@ -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
- * v3.0.0-beta.3
7
+ * v3.0.0-beta.5
8
8
  */
9
9
  (function webpackUniversalModuleDefinition(root, factory) {
10
10
  if(typeof exports === 'object' && typeof module === 'object')
@@ -105,12 +105,6 @@ class Push {
105
105
  this.groups = [];
106
106
  this.quantity = 4;
107
107
  }
108
- get particles_nb() {
109
- return this.quantity;
110
- }
111
- set particles_nb(value) {
112
- this.quantity = (0,engine_root_window_.setRangeValue)(value);
113
- }
114
108
  load(data) {
115
109
  if (!data) {
116
110
  return;
@@ -124,7 +118,7 @@ class Push {
124
118
  if (!this.groups.length) {
125
119
  this.default = true;
126
120
  }
127
- const quantity = data.quantity ?? data.particles_nb;
121
+ const quantity = data.quantity;
128
122
  if (quantity !== undefined) {
129
123
  this.quantity = (0,engine_root_window_.setRangeValue)(quantity);
130
124
  }
@@ -133,11 +127,12 @@ class Push {
133
127
  ;// CONCATENATED MODULE: ./dist/browser/Pusher.js
134
128
 
135
129
 
130
+ const pushMode = "push";
136
131
  class Pusher extends engine_root_window_.ExternalInteractorBase {
137
132
  constructor(container) {
138
133
  super(container);
139
134
  this.handleClickMode = mode => {
140
- if (mode !== "push") {
135
+ if (mode !== pushMode) {
141
136
  return;
142
137
  }
143
138
  const container = this.container,
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see tsparticles.interaction.external.push.min.js.LICENSE.txt */
2
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],e);else{var r="object"==typeof exports?e(require("@tsparticles/engine")):e(t.window);for(var o in r)("object"==typeof exports?exports:t)[o]=r[o]}}(this,(t=>(()=>{"use strict";var e={533:e=>{e.exports=t}},r={};function o(t){var s=r[t];if(void 0!==s)return s.exports;var i=r[t]={exports:{}};return e[t](i,i.exports,o),i.exports}o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};return(()=>{o.r(s),o.d(s,{Push:()=>e,loadExternalPushInteraction:()=>i});var t=o(533);class e{constructor(){this.default=!0,this.groups=[],this.quantity=4}get particles_nb(){return this.quantity}set particles_nb(e){this.quantity=(0,t.setRangeValue)(e)}load(e){if(!e)return;void 0!==e.default&&(this.default=e.default),void 0!==e.groups&&(this.groups=e.groups.map((t=>t))),this.groups.length||(this.default=!0);const r=e.quantity??e.particles_nb;void 0!==r&&(this.quantity=(0,t.setRangeValue)(r))}}class r extends t.ExternalInteractorBase{constructor(e){super(e),this.handleClickMode=e=>{if("push"!==e)return;const r=this.container,o=r.actualOptions.interactivity.modes.push;if(!o)return;const s=(0,t.getRangeValue)(o.quantity);if(s<=0)return;const i=(0,t.itemFromArray)([void 0,...o.groups]),n=void 0!==i?r.actualOptions.particles.groups[i]:void 0;r.particles.push(s,r.interactivity.mouse,n,i)}}clear(){}init(){}async interact(){}isEnabled(){return!0}loadModeOptions(t,...r){t.push||(t.push=new e);for(const e of r)t.push.load(e?.push)}reset(){}}async function i(t,e=!0){await t.addInteractor("externalPush",(t=>new r(t)),e)}})(),s})()));
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e=>(()=>{"use strict";var t={533:t=>{t.exports=e}},r={};function o(e){var s=r[e];if(void 0!==s)return s.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{o.r(s),o.d(s,{Push:()=>t,loadExternalPushInteraction:()=>i});var e=o(533);class t{constructor(){this.default=!0,this.groups=[],this.quantity=4}load(t){if(!t)return;void 0!==t.default&&(this.default=t.default),void 0!==t.groups&&(this.groups=t.groups.map((e=>e))),this.groups.length||(this.default=!0);const r=t.quantity;void 0!==r&&(this.quantity=(0,e.setRangeValue)(r))}}class r extends e.ExternalInteractorBase{constructor(t){super(t),this.handleClickMode=t=>{if("push"!==t)return;const r=this.container,o=r.actualOptions.interactivity.modes.push;if(!o)return;const s=(0,e.getRangeValue)(o.quantity);if(s<=0)return;const i=(0,e.itemFromArray)([void 0,...o.groups]),n=void 0!==i?r.actualOptions.particles.groups[i]:void 0;r.particles.push(s,r.interactivity.mouse,n,i)}}clear(){}init(){}async interact(){}isEnabled(){return!0}loadModeOptions(e,...r){e.push||(e.push=new t);for(const t of r)e.push.load(t?.push)}reset(){}}async function i(e,t=!0){await e.addInteractor("externalPush",(e=>new r(e)),t)}})(),s})()));
@@ -1 +1 @@
1
- /*! tsParticles Push External Interaction v3.0.0-beta.3 by Matteo Bruni */
1
+ /*! tsParticles Push External Interaction v3.0.0-beta.5 by Matteo Bruni */
@@ -5,7 +5,5 @@ export declare class Push implements IPush, IOptionLoader<IPush> {
5
5
  groups: string[];
6
6
  quantity: RangeValue;
7
7
  constructor();
8
- get particles_nb(): RangeValue;
9
- set particles_nb(value: RangeValue);
10
8
  load(data?: RecursivePartial<IPush>): void;
11
9
  }
@@ -2,6 +2,5 @@ import type { RangeValue } from "@tsparticles/engine";
2
2
  export interface IPush {
3
3
  default: boolean;
4
4
  groups: string[];
5
- particles_nb: RangeValue;
6
5
  quantity: RangeValue;
7
6
  }
@@ -17,12 +17,6 @@
17
17
  this.groups = [];
18
18
  this.quantity = 4;
19
19
  }
20
- get particles_nb() {
21
- return this.quantity;
22
- }
23
- set particles_nb(value) {
24
- this.quantity = (0, engine_1.setRangeValue)(value);
25
- }
26
20
  load(data) {
27
21
  if (!data) {
28
22
  return;
@@ -36,7 +30,7 @@
36
30
  if (!this.groups.length) {
37
31
  this.default = true;
38
32
  }
39
- const quantity = data.quantity ?? data.particles_nb;
33
+ const quantity = data.quantity;
40
34
  if (quantity !== undefined) {
41
35
  this.quantity = (0, engine_1.setRangeValue)(quantity);
42
36
  }
package/umd/Pusher.js CHANGED
@@ -12,11 +12,12 @@
12
12
  exports.Pusher = void 0;
13
13
  const engine_1 = require("@tsparticles/engine");
14
14
  const Push_js_1 = require("./Options/Classes/Push.js");
15
+ const pushMode = "push";
15
16
  class Pusher extends engine_1.ExternalInteractorBase {
16
17
  constructor(container) {
17
18
  super(container);
18
19
  this.handleClickMode = (mode) => {
19
- if (mode !== "push") {
20
+ if (mode !== pushMode) {
20
21
  return;
21
22
  }
22
23
  const container = this.container, options = container.actualOptions, pushOptions = options.interactivity.modes.push;