tsparticles-interaction-external-push
Advanced tools
Comparing version 2.10.1 to 2.11.0
import { Pusher } from "./Pusher"; | ||
export async function loadExternalPushInteraction(engine) { | ||
await engine.addInteractor("externalPush", (container) => new Pusher(container)); | ||
export async function loadExternalPushInteraction(engine, refresh = true) { | ||
await engine.addInteractor("externalPush", (container) => new Pusher(container), refresh); | ||
} | ||
export * from "./Options/Classes/Push"; | ||
export * from "./Options/Interfaces/IPush"; |
@@ -19,4 +19,4 @@ "use strict"; | ||
const Pusher_1 = require("./Pusher"); | ||
async function loadExternalPushInteraction(engine) { | ||
await engine.addInteractor("externalPush", (container) => new Pusher_1.Pusher(container)); | ||
async function loadExternalPushInteraction(engine, refresh = true) { | ||
await engine.addInteractor("externalPush", (container) => new Pusher_1.Pusher(container), refresh); | ||
} | ||
@@ -23,0 +23,0 @@ exports.loadExternalPushInteraction = loadExternalPushInteraction; |
import { Pusher } from "./Pusher"; | ||
export async function loadExternalPushInteraction(engine) { | ||
await engine.addInteractor("externalPush", (container) => new Pusher(container)); | ||
export async function loadExternalPushInteraction(engine, refresh = true) { | ||
await engine.addInteractor("externalPush", (container) => new Pusher(container), refresh); | ||
} | ||
export * from "./Options/Classes/Push"; | ||
export * from "./Options/Interfaces/IPush"; |
{ | ||
"name": "tsparticles-interaction-external-push", | ||
"version": "2.10.1", | ||
"version": "2.11.0", | ||
"description": "tsParticles push external interaction", | ||
@@ -76,5 +76,6 @@ "homepage": "https://particles.js.org", | ||
"types": "types/index.d.ts", | ||
"sideEffects": false, | ||
"dependencies": { | ||
"tsparticles-engine": "^2.10.1" | ||
"tsparticles-engine": "^2.11.0" | ||
} | ||
} |
@@ -30,7 +30,12 @@ [![banner](https://particles.js.org/images/banner2.png)](https://particles.js.org) | ||
```javascript | ||
loadExternalPushInteraction(tsParticles); | ||
(async () => { | ||
await loadExternalPushInteraction(tsParticles); | ||
tsParticles.load("tsparticles", { | ||
/* options */ | ||
}); | ||
await tsParticles.load({ | ||
id: "tsparticles", | ||
options: { | ||
/* options */ | ||
}, | ||
}); | ||
})(); | ||
``` | ||
@@ -58,3 +63,5 @@ | ||
loadExternalPushInteraction(tsParticles); | ||
(async () => { | ||
await loadExternalPushInteraction(tsParticles); | ||
})(); | ||
``` | ||
@@ -68,3 +75,5 @@ | ||
loadExternalPushInteraction(tsParticles); | ||
(async () => { | ||
await loadExternalPushInteraction(tsParticles); | ||
})(); | ||
``` |
@@ -7,3 +7,3 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v2.10.1 | ||
* v2.11.0 | ||
*/ | ||
@@ -177,4 +177,4 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
async function loadExternalPushInteraction(engine) { | ||
await engine.addInteractor("externalPush", container => new Pusher(container)); | ||
async function loadExternalPushInteraction(engine, refresh = true) { | ||
await engine.addInteractor("externalPush", container => new Pusher(container), refresh); | ||
} | ||
@@ -181,0 +181,0 @@ |
/*! For license information please see tsparticles.interaction.external.push.min.js.LICENSE.txt */ | ||
!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={961: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(961);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){await t.addInteractor("externalPush",(t=>new r(t)))}})(),s})())); | ||
!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={961: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(961);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})())); |
@@ -1,1 +0,1 @@ | ||
/*! tsParticles Push External Interaction v2.10.1 by Matteo Bruni */ | ||
/*! tsParticles Push External Interaction v2.11.0 by Matteo Bruni */ |
import type { Engine } from "tsparticles-engine"; | ||
export declare function loadExternalPushInteraction(engine: Engine): Promise<void>; | ||
export declare function loadExternalPushInteraction(engine: Engine, refresh?: boolean): Promise<void>; | ||
export * from "./Options/Classes/Push"; | ||
export * from "./Options/Interfaces/IPush"; |
@@ -28,4 +28,4 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
const Pusher_1 = require("./Pusher"); | ||
async function loadExternalPushInteraction(engine) { | ||
await engine.addInteractor("externalPush", (container) => new Pusher_1.Pusher(container)); | ||
async function loadExternalPushInteraction(engine, refresh = true) { | ||
await engine.addInteractor("externalPush", (container) => new Pusher_1.Pusher(container), refresh); | ||
} | ||
@@ -32,0 +32,0 @@ exports.loadExternalPushInteraction = loadExternalPushInteraction; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
310007
77
Updatedtsparticles-engine@^2.11.0