tsparticles-interaction-external-push
Advanced tools
Comparing version 2.3.3 to 2.4.0
@@ -1,4 +0,1 @@ | ||
/** | ||
* @category Options | ||
*/ | ||
export class Push { | ||
@@ -10,14 +7,5 @@ constructor() { | ||
} | ||
/** | ||
* | ||
* @deprecated this property is obsolete, please use the new quantity | ||
*/ | ||
get particles_nb() { | ||
return this.quantity; | ||
} | ||
/** | ||
* | ||
* @deprecated this property is obsolete, please use the new quantity | ||
* @param value | ||
*/ | ||
set particles_nb(value) { | ||
@@ -24,0 +12,0 @@ this.quantity = value; |
import { ExternalInteractorBase } from "tsparticles-engine"; | ||
import { Push } from "./Options/Classes/Push"; | ||
import { itemFromArray } from "tsparticles-engine"; | ||
/** | ||
* Particle attract manager | ||
* @category Interactions | ||
*/ | ||
export class Pusher extends ExternalInteractorBase { | ||
@@ -12,3 +8,3 @@ constructor(container) { | ||
this.handleClickMode = (mode) => { | ||
if (mode !== "push" /* ClickMode.push */) { | ||
if (mode !== "push") { | ||
return; | ||
@@ -29,9 +25,6 @@ } | ||
clear() { | ||
// do nothing | ||
} | ||
init() { | ||
// do nothing | ||
} | ||
async interact() { | ||
// do nothing | ||
} | ||
@@ -50,4 +43,3 @@ isEnabled() { | ||
reset() { | ||
// do nothing | ||
} | ||
} |
@@ -16,7 +16,18 @@ "use strict"; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.loadExternalPushInteraction = void 0; | ||
const Pusher_1 = require("./Pusher"); | ||
async function loadExternalPushInteraction(engine) { | ||
await engine.addInteractor("externalPush", (container) => new Pusher_1.Pusher(container)); | ||
function loadExternalPushInteraction(engine) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield engine.addInteractor("externalPush", (container) => new Pusher_1.Pusher(container)); | ||
}); | ||
} | ||
@@ -23,0 +34,0 @@ exports.loadExternalPushInteraction = loadExternalPushInteraction; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -30,3 +39,5 @@ exports.Pusher = void 0; | ||
} | ||
async interact() { | ||
interact() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
}); | ||
} | ||
@@ -33,0 +44,0 @@ isEnabled() { |
{ | ||
"name": "tsparticles-interaction-external-push", | ||
"version": "2.3.3", | ||
"version": "2.4.0", | ||
"description": "tsParticles push external interaction", | ||
@@ -77,4 +77,4 @@ "homepage": "https://particles.js.org", | ||
"dependencies": { | ||
"tsparticles-engine": "^2.3.3" | ||
"tsparticles-engine": "^2.4.0" | ||
} | ||
} |
@@ -7,3 +7,3 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v2.3.3 | ||
* v2.4.0 | ||
*/ | ||
@@ -102,5 +102,2 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
;// CONCATENATED MODULE: ./dist/browser/Options/Classes/Push.js | ||
/** | ||
* @category Options | ||
*/ | ||
class Push { | ||
@@ -112,43 +109,23 @@ constructor() { | ||
} | ||
/** | ||
* | ||
* @deprecated this property is obsolete, please use the new quantity | ||
*/ | ||
get particles_nb() { | ||
return this.quantity; | ||
} | ||
/** | ||
* | ||
* @deprecated this property is obsolete, please use the new quantity | ||
* @param value | ||
*/ | ||
set particles_nb(value) { | ||
this.quantity = value; | ||
} | ||
load(data) { | ||
var _a; | ||
if (!data) { | ||
return; | ||
} | ||
if (data.default !== undefined) { | ||
this.default = data.default; | ||
} | ||
if (data.groups !== undefined) { | ||
this.groups = data.groups.map(t => t); | ||
} | ||
if (!this.groups.length) { | ||
this.default = true; | ||
} | ||
const quantity = (_a = data.quantity) !== null && _a !== void 0 ? _a : data.particles_nb; | ||
if (quantity !== undefined) { | ||
@@ -158,3 +135,2 @@ this.quantity = quantity; | ||
} | ||
} | ||
@@ -165,51 +141,30 @@ ;// CONCATENATED MODULE: ./dist/browser/Pusher.js | ||
/** | ||
* Particle attract manager | ||
* @category Interactions | ||
*/ | ||
class Pusher extends external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.ExternalInteractorBase { | ||
constructor(container) { | ||
super(container); | ||
this.handleClickMode = mode => { | ||
if (mode !== "push" | ||
/* ClickMode.push */ | ||
) { | ||
if (mode !== "push") { | ||
return; | ||
} | ||
const container = this.container, | ||
options = container.actualOptions, | ||
pushOptions = options.interactivity.modes.push; | ||
options = container.actualOptions, | ||
pushOptions = options.interactivity.modes.push; | ||
if (!pushOptions) { | ||
return; | ||
} | ||
const pushNb = pushOptions.quantity; | ||
if (pushNb <= 0) { | ||
return; | ||
} | ||
const group = (0,external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.itemFromArray)([undefined, ...pushOptions.groups]), | ||
groupOptions = group !== undefined ? container.actualOptions.particles.groups[group] : undefined; | ||
groupOptions = group !== undefined ? container.actualOptions.particles.groups[group] : undefined; | ||
container.particles.push(pushNb, container.interactivity.mouse, groupOptions, group); | ||
}; | ||
} | ||
clear() {// do nothing | ||
} | ||
init() {// do nothing | ||
} | ||
async interact() {// do nothing | ||
} | ||
clear() {} | ||
init() {} | ||
async interact() {} | ||
isEnabled() { | ||
return true; | ||
} | ||
loadModeOptions(options, ...sources) { | ||
@@ -219,3 +174,2 @@ if (!options.push) { | ||
} | ||
for (const source of sources) { | ||
@@ -225,6 +179,3 @@ options.push.load(source === null || source === void 0 ? void 0 : source.push); | ||
} | ||
reset() {// do nothing | ||
} | ||
reset() {} | ||
} | ||
@@ -231,0 +182,0 @@ ;// CONCATENATED MODULE: ./dist/browser/index.js |
@@ -7,3 +7,3 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v2.3.3 | ||
* v2.4.0 | ||
*/ |
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
311752
700
Updatedtsparticles-engine@^2.4.0