@tsparticles/interaction-external-pop 3.0.0-beta.4

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.
@@ -0,0 +1,141 @@
1
+ /*!
2
+ * Author : Matteo Bruni
3
+ * MIT license: https://opensource.org/licenses/MIT
4
+ * Demo / Generator : https://particles.js.org/
5
+ * GitHub : https://www.github.com/matteobruni/tsparticles
6
+ * How to use? : Check the GitHub README
7
+ * v3.0.0-beta.4
8
+ */
9
+ (function webpackUniversalModuleDefinition(root, factory) {
10
+ if(typeof exports === 'object' && typeof module === 'object')
11
+ module.exports = factory(require("@tsparticles/engine"));
12
+ else if(typeof define === 'function' && define.amd)
13
+ define(["@tsparticles/engine"], factory);
14
+ else {
15
+ var a = typeof exports === 'object' ? factory(require("@tsparticles/engine")) : factory(root["window"]);
16
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
17
+ }
18
+ })(this, (__WEBPACK_EXTERNAL_MODULE__533__) => {
19
+ return /******/ (() => { // webpackBootstrap
20
+ /******/ "use strict";
21
+ /******/ var __webpack_modules__ = ({
22
+
23
+ /***/ 533:
24
+ /***/ ((module) => {
25
+
26
+ module.exports = __WEBPACK_EXTERNAL_MODULE__533__;
27
+
28
+ /***/ })
29
+
30
+ /******/ });
31
+ /************************************************************************/
32
+ /******/ // The module cache
33
+ /******/ var __webpack_module_cache__ = {};
34
+ /******/
35
+ /******/ // The require function
36
+ /******/ function __webpack_require__(moduleId) {
37
+ /******/ // Check if module is in cache
38
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
39
+ /******/ if (cachedModule !== undefined) {
40
+ /******/ return cachedModule.exports;
41
+ /******/ }
42
+ /******/ // Create a new module (and put it into the cache)
43
+ /******/ var module = __webpack_module_cache__[moduleId] = {
44
+ /******/ // no module.id needed
45
+ /******/ // no module.loaded needed
46
+ /******/ exports: {}
47
+ /******/ };
48
+ /******/
49
+ /******/ // Execute the module function
50
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
51
+ /******/
52
+ /******/ // Return the exports of the module
53
+ /******/ return module.exports;
54
+ /******/ }
55
+ /******/
56
+ /************************************************************************/
57
+ /******/ /* webpack/runtime/define property getters */
58
+ /******/ (() => {
59
+ /******/ // define getter functions for harmony exports
60
+ /******/ __webpack_require__.d = (exports, definition) => {
61
+ /******/ for(var key in definition) {
62
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
63
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
64
+ /******/ }
65
+ /******/ }
66
+ /******/ };
67
+ /******/ })();
68
+ /******/
69
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
70
+ /******/ (() => {
71
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
72
+ /******/ })();
73
+ /******/
74
+ /******/ /* webpack/runtime/make namespace object */
75
+ /******/ (() => {
76
+ /******/ // define __esModule on exports
77
+ /******/ __webpack_require__.r = (exports) => {
78
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
79
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
80
+ /******/ }
81
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
82
+ /******/ };
83
+ /******/ })();
84
+ /******/
85
+ /************************************************************************/
86
+ var __webpack_exports__ = {};
87
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
88
+ (() => {
89
+ // ESM COMPAT FLAG
90
+ __webpack_require__.r(__webpack_exports__);
91
+
92
+ // EXPORTS
93
+ __webpack_require__.d(__webpack_exports__, {
94
+ loadExternalPopInteraction: () => (/* binding */ loadExternalPopInteraction)
95
+ });
96
+
97
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"}
98
+ var engine_root_window_ = __webpack_require__(533);
99
+ ;// CONCATENATED MODULE: ./dist/browser/Popper.js
100
+
101
+ const popMode = "pop";
102
+ class Popper extends engine_root_window_.ExternalInteractorBase {
103
+ constructor(container) {
104
+ super(container);
105
+ this.handleClickMode = mode => {
106
+ const container = this.container;
107
+ if (mode !== popMode) {
108
+ return;
109
+ }
110
+ const clickPos = container.interactivity.mouse.clickPosition;
111
+ if (!clickPos) {
112
+ return;
113
+ }
114
+ const poppedParticles = container.particles.quadTree.queryCircle(clickPos, container.retina.pixelRatio);
115
+ if (!poppedParticles.length) {
116
+ return;
117
+ }
118
+ for (const particle of poppedParticles) {
119
+ container.particles.remove(particle);
120
+ }
121
+ };
122
+ }
123
+ clear() {}
124
+ init() {}
125
+ async interact() {}
126
+ isEnabled() {
127
+ return true;
128
+ }
129
+ reset() {}
130
+ }
131
+ ;// CONCATENATED MODULE: ./dist/browser/index.js
132
+
133
+ async function loadExternalPopInteraction(engine, refresh = true) {
134
+ await engine.addInteractor("externalPop", container => new Popper(container), refresh);
135
+ }
136
+ })();
137
+
138
+ /******/ return __webpack_exports__;
139
+ /******/ })()
140
+ ;
141
+ });
@@ -0,0 +1,2 @@
1
+ /*! For license information please see tsparticles.interaction.external.pop.min.js.LICENSE.txt */
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 n=r[e];if(void 0!==n)return n.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 n={};return(()=>{o.r(n),o.d(n,{loadExternalPopInteraction:()=>r});var e=o(533);class t extends e.ExternalInteractorBase{constructor(e){super(e),this.handleClickMode=e=>{const t=this.container;if("pop"!==e)return;const r=t.interactivity.mouse.clickPosition;if(!r)return;const o=t.particles.quadTree.queryCircle(r,t.retina.pixelRatio);if(o.length)for(const e of o)t.particles.remove(e)}}clear(){}init(){}async interact(){}isEnabled(){return!0}reset(){}}async function r(e,r=!0){await e.addInteractor("externalPop",(e=>new t(e)),r)}})(),n})()));
@@ -0,0 +1 @@
1
+ /*! tsParticles Pop External Interaction v3.0.0-beta.4 by Matteo Bruni */
@@ -0,0 +1,10 @@
1
+ import { type Container, ExternalInteractorBase } from "@tsparticles/engine";
2
+ export declare class Popper extends ExternalInteractorBase {
3
+ handleClickMode: (mode: string) => void;
4
+ constructor(container: Container);
5
+ clear(): void;
6
+ init(): void;
7
+ interact(): Promise<void>;
8
+ isEnabled(): boolean;
9
+ reset(): void;
10
+ }
@@ -0,0 +1,2 @@
1
+ import type { Engine } from "@tsparticles/engine";
2
+ export declare function loadExternalPopInteraction(engine: Engine, refresh?: boolean): Promise<void>;
package/umd/Popper.js ADDED
@@ -0,0 +1,49 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "@tsparticles/engine"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Popper = void 0;
13
+ const engine_1 = require("@tsparticles/engine");
14
+ const popMode = "pop";
15
+ class Popper extends engine_1.ExternalInteractorBase {
16
+ constructor(container) {
17
+ super(container);
18
+ this.handleClickMode = (mode) => {
19
+ const container = this.container;
20
+ if (mode !== popMode) {
21
+ return;
22
+ }
23
+ const clickPos = container.interactivity.mouse.clickPosition;
24
+ if (!clickPos) {
25
+ return;
26
+ }
27
+ const poppedParticles = container.particles.quadTree.queryCircle(clickPos, container.retina.pixelRatio);
28
+ if (!poppedParticles.length) {
29
+ return;
30
+ }
31
+ for (const particle of poppedParticles) {
32
+ container.particles.remove(particle);
33
+ }
34
+ };
35
+ }
36
+ clear() {
37
+ }
38
+ init() {
39
+ }
40
+ async interact() {
41
+ }
42
+ isEnabled() {
43
+ return true;
44
+ }
45
+ reset() {
46
+ }
47
+ }
48
+ exports.Popper = Popper;
49
+ });
package/umd/index.js ADDED
@@ -0,0 +1,18 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "./Popper.js"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.loadExternalPopInteraction = void 0;
13
+ const Popper_js_1 = require("./Popper.js");
14
+ async function loadExternalPopInteraction(engine, refresh = true) {
15
+ await engine.addInteractor("externalPop", (container) => new Popper_js_1.Popper(container), refresh);
16
+ }
17
+ exports.loadExternalPopInteraction = loadExternalPopInteraction;
18
+ });