@tsparticles/interaction-external-connect 4.0.0-beta.1 → 4.0.0-beta.2
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/101.min.js +1 -1
- package/browser/index.js +2 -1
- package/cjs/index.js +2 -1
- package/dist_browser_Connector_js.js +1 -1
- package/esm/index.js +2 -1
- package/package.json +9 -5
- package/report.html +1 -1
- package/tsparticles.interaction.external.connect.js +2 -2
- package/tsparticles.interaction.external.connect.min.js +2 -2
- package/umd/Connector.js +0 -78
- package/umd/Options/Classes/Connect.js +0 -38
- package/umd/Options/Classes/ConnectLinks.js +0 -29
- package/umd/Options/Classes/ConnectOptions.js +0 -12
- package/umd/Options/Interfaces/IConnect.js +0 -12
- package/umd/Options/Interfaces/IConnectLinks.js +0 -12
- package/umd/Types.js +0 -12
- package/umd/Utils.js +0 -53
- package/umd/index.js +0 -63
package/101.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(this.webpackChunk_tsparticles_interaction_external_connect=this.webpackChunk_tsparticles_interaction_external_connect||[]).push([[101],{101(t,e,i){i.d(e,{Connector:()=>s});var n=i(702),o=i(
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_interaction_external_connect=this.webpackChunk_tsparticles_interaction_external_connect||[]).push([[101],{101(t,e,i){i.d(e,{Connector:()=>s});var n=i(702),o=i(303),a=i(684),r=i(425);class s extends n.ExternalInteractorBase{_maxDistance;constructor(t){super(t),this._maxDistance=0}get maxDistance(){return this._maxDistance}clear(){}init(){let t=this.container,e=t.actualOptions.interactivity?.modes.connect;e&&(this._maxDistance=e.distance,t.retina.connectModeDistance=e.distance*t.retina.pixelRatio,t.retina.connectModeRadius=e.radius*t.retina.pixelRatio)}interact(t){let e=this.container,i=e.actualOptions;if(i.interactivity?.events.onHover.enable&&"pointermove"===t.status){let i=t.mouse.position,{connectModeDistance:n,connectModeRadius:a}=e.retina;if(!n||n<0||!a||a<0||!i)return;let s=Math.abs(a),c=e.particles.grid.queryCircle(i,s,e=>this.isEnabled(t,e));c.forEach((t,i)=>{let a=t.getPosition();for(let s of c.slice(i+1)){let i=s.getPosition(),c=Math.abs(n),l=Math.abs(a.x-i.x),d=Math.abs(a.y-i.y);l<c&&d<c&&function(t,e,i){t.canvas.render.draw(n=>{var a;let s=function(t,e,i,n){let a=t.actualOptions,r=a.interactivity?.modes.connect;if(r)return function(t,e,i,n,a){let r=Math.floor(n.getRadius()/i.getRadius()),s=i.getFillColor(),c=n.getFillColor();if(!s||!c)return;let l=i.getPosition(),d=n.getPosition(),u=(0,o.colorMix)(s,c,i.getRadius(),n.getRadius()),h=e.createLinearGradient(l.x,l.y,d.x,d.y);return h.addColorStop(0,(0,o.getStyleFromHsl)(s,t.hdr,a)),h.addColorStop((0,o.clamp)(r,0,1),(0,o.getStyleFromRgb)(u,t.hdr,a)),h.addColorStop(1,(0,o.getStyleFromHsl)(c,t.hdr,a)),h}(t,e,i,n,r.links.opacity)}(t,n,e,i);if(!s)return;let c=e.getPosition(),l=i.getPosition();a=e.retina.linksWidth??0,(0,r.drawLine)(n,c,l),n.lineWidth=a,n.strokeStyle=s,n.stroke()})}(e,t,s)}})}}isEnabled(t,e){let i=this.container,n=t.mouse,a=(e?.interactivity??i.actualOptions.interactivity)?.events;return!!(a?.onHover.enable&&n.position)&&(0,o.isInArray)("connect",a.onHover.mode)}loadModeOptions(t,...e){for(let i of(t.connect??=new a.d,e))t.connect.load(i?.connect)}reset(){}}}}]);
|
package/browser/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadExternalConnectInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
3
4
|
await engine.pluginManager.register(async (e) => {
|
|
4
5
|
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
6
|
ensureInteractivityPluginLoaded(e);
|
package/cjs/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadExternalConnectInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
3
4
|
await engine.pluginManager.register(async (e) => {
|
|
4
5
|
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
6
|
ensureInteractivityPluginLoaded(e);
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadExternalConnectInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
3
4
|
await engine.pluginManager.register(async (e) => {
|
|
4
5
|
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
6
|
ensureInteractivityPluginLoaded(e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-external-connect",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.2",
|
|
4
4
|
"description": "tsParticles connect external interaction",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -81,12 +81,11 @@
|
|
|
81
81
|
"browser": "./browser/index.js",
|
|
82
82
|
"import": "./esm/index.js",
|
|
83
83
|
"require": "./cjs/index.js",
|
|
84
|
-
"
|
|
85
|
-
"default": "./cjs/index.js"
|
|
84
|
+
"default": "./esm/index.js"
|
|
86
85
|
},
|
|
87
86
|
"./package.json": "./package.json"
|
|
88
87
|
},
|
|
89
|
-
"
|
|
88
|
+
"peerDepdendencies": {
|
|
90
89
|
"@tsparticles/canvas-utils": "4.0.0-beta.1",
|
|
91
90
|
"@tsparticles/engine": "4.0.0-beta.1",
|
|
92
91
|
"@tsparticles/plugin-interactivity": "4.0.0-beta.1"
|
|
@@ -94,5 +93,10 @@
|
|
|
94
93
|
"publishConfig": {
|
|
95
94
|
"access": "public"
|
|
96
95
|
},
|
|
97
|
-
"type": "module"
|
|
96
|
+
"type": "module",
|
|
97
|
+
"peerDependencies": {
|
|
98
|
+
"@tsparticles/canvas-utils": "4.0.0-beta.1",
|
|
99
|
+
"@tsparticles/engine": "4.0.0-beta.1",
|
|
100
|
+
"@tsparticles/plugin-interactivity": "4.0.0-beta.1"
|
|
101
|
+
}
|
|
98
102
|
}
|
package/report.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<title>@tsparticles/interaction-external-connect [
|
|
6
|
+
<title>@tsparticles/interaction-external-connect [2 Apr 2026 at 07:39]</title>
|
|
7
7
|
<link
|
|
8
8
|
rel="shortcut icon"
|
|
9
9
|
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII="
|
|
@@ -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.
|
|
7
|
+
* v4.0.0-beta.2
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -84,7 +84,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
84
84
|
\*******************************/
|
|
85
85
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
86
86
|
|
|
87
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Connect: () => (/* reexport safe */
|
|
87
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Connect: () => (/* reexport safe */ _Options_Classes_Connect_js__WEBPACK_IMPORTED_MODULE_1__.Connect),\n/* harmony export */ ConnectLinks: () => (/* reexport safe */ _Options_Classes_ConnectLinks_js__WEBPACK_IMPORTED_MODULE_2__.ConnectLinks),\n/* harmony export */ loadExternalConnectInteraction: () => (/* binding */ loadExternalConnectInteraction)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _Options_Classes_Connect_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/Connect.js */ \"./dist/browser/Options/Classes/Connect.js\");\n/* harmony import */ var _Options_Classes_ConnectLinks_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/ConnectLinks.js */ \"./dist/browser/Options/Classes/ConnectLinks.js\");\n\nasync function loadExternalConnectInteraction(engine) {\n engine.checkVersion(\"4.0.0-beta.2\");\n await engine.pluginManager.register(async (e)=>{\n const { ensureInteractivityPluginLoaded } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\", 19));\n ensureInteractivityPluginLoaded(e);\n e.pluginManager.addInteractor?.(\"externalConnect\", async (container)=>{\n const { Connector } = await __webpack_require__.e(/*! import() */ \"dist_browser_Connector_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Connector.js */ \"./dist/browser/Connector.js\"));\n return new Connector(container);\n });\n });\n}\n\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-connect/./dist/browser/index.js?\n}");
|
|
88
88
|
|
|
89
89
|
/***/ }
|
|
90
90
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),require("@tsparticles/plugin-interactivity"),require("@tsparticles/canvas-utils"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/plugin-interactivity","@tsparticles/canvas-utils"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/plugin-interactivity"),require("@tsparticles/canvas-utils")):t(e.window,e.window,e.window);for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(this,(e,t,r)=>(()=>{"use strict";var i,n,o,a={425(e){e.exports=r},
|
|
2
|
-
(`+n+": "+o+")",a.name="ChunkLoadError",a.type=n,a.request=o,r[1](a)}},"chunk-"+e,e)}},n=(e,t)=>{var r,n,[o,a,s]=t,l=0;if(o.some(e=>0!==i[e])){for(r in a)c.o(a,r)&&(c.m[r]=a[r]);s&&s(c)}for(e&&e(t);l<o.length;l++)n=o[l],c.o(i,n)&&i[n]&&i[n][0](),i[n]=0},(o=this.webpackChunk_tsparticles_interaction_external_connect=this.webpackChunk_tsparticles_interaction_external_connect||[]).forEach(n.bind(null,0)),o.push=n.bind(null,o.push.bind(o));var v={};c.r(v),c.d(v,{Connect:()=>g.d,ConnectLinks:()=>y.e,loadExternalConnectInteraction:()=>m});var g=c(
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),require("@tsparticles/plugin-interactivity"),require("@tsparticles/canvas-utils"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/plugin-interactivity","@tsparticles/canvas-utils"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/plugin-interactivity"),require("@tsparticles/canvas-utils")):t(e.window,e.window,e.window);for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(this,(e,t,r)=>(()=>{"use strict";var i,n,o,a={425(e){e.exports=r},303(t){t.exports=e},702(e){e.exports=t},684(e,t,r){r.d(t,{d:()=>o});var i=r(303),n=r(714);class o{distance;links;radius;constructor(){this.distance=80,this.links=new n.e,this.radius=60}load(e){(0,i.isNull)(e)||(void 0!==e.distance&&(this.distance=e.distance),this.links.load(e.links),void 0!==e.radius&&(this.radius=e.radius))}}},714(e,t,r){r.d(t,{e:()=>n});var i=r(303);class n{opacity;constructor(){this.opacity=.5}load(e){(0,i.isNull)(e)||void 0!==e.opacity&&(this.opacity=e.opacity)}}}},s={};function c(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}};return a[e](r,r.exports,c),r.exports}c.m=a,u=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var r=Object.create(null);c.r(r);var i={};l=l||[null,u({}),u([]),u(u)];for(var n=2&t&&e;("object"==typeof n||"function"==typeof n)&&!~l.indexOf(n);n=u(n))Object.getOwnPropertyNames(n).forEach(t=>i[t]=()=>e[t]);return i.default=()=>e,c.d(r,i),r},c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce((t,r)=>(c.f[r](e,t),t),[])),c.u=e=>""+e+".min.js",c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),p={},c.l=(e,t,r,i)=>{if(p[e])return void p[e].push(t);if(void 0!==r)for(var n,o,a=document.getElementsByTagName("script"),s=0;s<a.length;s++){var l=a[s];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")=="@tsparticles/interaction-external-connect:"+r){n=l;break}}n||(o=!0,(n=document.createElement("script")).charset="utf-8",c.nc&&n.setAttribute("nonce",c.nc),n.setAttribute("data-webpack","@tsparticles/interaction-external-connect:"+r),n.src=e),p[e]=[t];var u=(t,r)=>{n.onerror=n.onload=null,clearTimeout(d);var i=p[e];if(delete p[e],n.parentNode&&n.parentNode.removeChild(n),i&&i.forEach(e=>e(r)),t)return t(r)},d=setTimeout(u.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=u.bind(null,n.onerror),n.onload=u.bind(null,n.onload),o&&document.head.appendChild(n)},c.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.g.importScripts&&(d=c.g.location+"");var l,u,p,d,f=c.g.document;if(!d&&f&&(f.currentScript&&"SCRIPT"===f.currentScript.tagName.toUpperCase()&&(d=f.currentScript.src),!d)){var h=f.getElementsByTagName("script");if(h.length)for(var b=h.length-1;b>-1&&(!d||!/^http(s?):/.test(d));)d=h[b--].src}if(!d)throw Error("Automatic publicPath is not supported in this browser");c.p=d=d.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i={500:0},c.f.j=(e,t)=>{var r=c.o(i,e)?i[e]:void 0;if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((t,n)=>r=i[e]=[t,n]);t.push(r[2]=n);var o=c.p+c.u(e),a=Error();c.l(o,t=>{if(c.o(i,e)&&(0!==(r=i[e])&&(i[e]=void 0),r)){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;a.message="Loading chunk "+e+` failed.
|
|
2
|
+
(`+n+": "+o+")",a.name="ChunkLoadError",a.type=n,a.request=o,r[1](a)}},"chunk-"+e,e)}},n=(e,t)=>{var r,n,[o,a,s]=t,l=0;if(o.some(e=>0!==i[e])){for(r in a)c.o(a,r)&&(c.m[r]=a[r]);s&&s(c)}for(e&&e(t);l<o.length;l++)n=o[l],c.o(i,n)&&i[n]&&i[n][0](),i[n]=0},(o=this.webpackChunk_tsparticles_interaction_external_connect=this.webpackChunk_tsparticles_interaction_external_connect||[]).forEach(n.bind(null,0)),o.push=n.bind(null,o.push.bind(o));var v={};c.r(v),c.d(v,{Connect:()=>g.d,ConnectLinks:()=>y.e,loadExternalConnectInteraction:()=>m}),c(303);var g=c(684),y=c(714);async function m(e){e.checkVersion("4.0.0-beta.2"),await e.pluginManager.register(async e=>{let{ensureInteractivityPluginLoaded:t}=await Promise.resolve().then(c.t.bind(c,702,19));t(e),e.pluginManager.addInteractor?.("externalConnect",async e=>{let{Connector:t}=await c.e(101).then(c.bind(c,101));return new t(e)})})}return v})());
|
package/umd/Connector.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
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/plugin-interactivity", "@tsparticles/engine", "./Options/Classes/Connect.js", "./Utils.js"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Connector = void 0;
|
|
13
|
-
const plugin_interactivity_1 = require("@tsparticles/plugin-interactivity");
|
|
14
|
-
const engine_1 = require("@tsparticles/engine");
|
|
15
|
-
const Connect_js_1 = require("./Options/Classes/Connect.js");
|
|
16
|
-
const Utils_js_1 = require("./Utils.js");
|
|
17
|
-
const connectMode = "connect", minDistance = 0;
|
|
18
|
-
class Connector extends plugin_interactivity_1.ExternalInteractorBase {
|
|
19
|
-
_maxDistance;
|
|
20
|
-
constructor(container) {
|
|
21
|
-
super(container);
|
|
22
|
-
this._maxDistance = 0;
|
|
23
|
-
}
|
|
24
|
-
get maxDistance() {
|
|
25
|
-
return this._maxDistance;
|
|
26
|
-
}
|
|
27
|
-
clear() {
|
|
28
|
-
}
|
|
29
|
-
init() {
|
|
30
|
-
const container = this.container, connect = container.actualOptions.interactivity?.modes.connect;
|
|
31
|
-
if (!connect) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
this._maxDistance = connect.distance;
|
|
35
|
-
container.retina.connectModeDistance = connect.distance * container.retina.pixelRatio;
|
|
36
|
-
container.retina.connectModeRadius = connect.radius * container.retina.pixelRatio;
|
|
37
|
-
}
|
|
38
|
-
interact(interactivityData) {
|
|
39
|
-
const container = this.container, options = container.actualOptions;
|
|
40
|
-
if (options.interactivity?.events.onHover.enable && interactivityData.status === "pointermove") {
|
|
41
|
-
const mousePos = interactivityData.mouse.position, { connectModeDistance, connectModeRadius } = container.retina;
|
|
42
|
-
if (!connectModeDistance ||
|
|
43
|
-
connectModeDistance < minDistance ||
|
|
44
|
-
!connectModeRadius ||
|
|
45
|
-
connectModeRadius < minDistance ||
|
|
46
|
-
!mousePos) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const distance = Math.abs(connectModeRadius), query = container.particles.grid.queryCircle(mousePos, distance, p => this.isEnabled(interactivityData, p));
|
|
50
|
-
query.forEach((p1, i) => {
|
|
51
|
-
const pos1 = p1.getPosition(), indexOffset = 1;
|
|
52
|
-
for (const p2 of query.slice(i + indexOffset)) {
|
|
53
|
-
const pos2 = p2.getPosition(), distMax = Math.abs(connectModeDistance), xDiff = Math.abs(pos1.x - pos2.x), yDiff = Math.abs(pos1.y - pos2.y);
|
|
54
|
-
if (xDiff < distMax && yDiff < distMax) {
|
|
55
|
-
(0, Utils_js_1.drawConnection)(container, p1, p2);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
isEnabled(interactivityData, particle) {
|
|
62
|
-
const container = this.container, mouse = interactivityData.mouse, events = (particle?.interactivity ?? container.actualOptions.interactivity)?.events;
|
|
63
|
-
if (!(events?.onHover.enable && mouse.position)) {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
return (0, engine_1.isInArray)(connectMode, events.onHover.mode);
|
|
67
|
-
}
|
|
68
|
-
loadModeOptions(options, ...sources) {
|
|
69
|
-
options.connect ??= new Connect_js_1.Connect();
|
|
70
|
-
for (const source of sources) {
|
|
71
|
-
options.connect.load(source?.connect);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
reset() {
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
exports.Connector = Connector;
|
|
78
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
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", "./ConnectLinks.js"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Connect = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const ConnectLinks_js_1 = require("./ConnectLinks.js");
|
|
15
|
-
class Connect {
|
|
16
|
-
distance;
|
|
17
|
-
links;
|
|
18
|
-
radius;
|
|
19
|
-
constructor() {
|
|
20
|
-
this.distance = 80;
|
|
21
|
-
this.links = new ConnectLinks_js_1.ConnectLinks();
|
|
22
|
-
this.radius = 60;
|
|
23
|
-
}
|
|
24
|
-
load(data) {
|
|
25
|
-
if ((0, engine_1.isNull)(data)) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (data.distance !== undefined) {
|
|
29
|
-
this.distance = data.distance;
|
|
30
|
-
}
|
|
31
|
-
this.links.load(data.links);
|
|
32
|
-
if (data.radius !== undefined) {
|
|
33
|
-
this.radius = data.radius;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.Connect = Connect;
|
|
38
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
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.ConnectLinks = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
class ConnectLinks {
|
|
15
|
-
opacity;
|
|
16
|
-
constructor() {
|
|
17
|
-
this.opacity = 0.5;
|
|
18
|
-
}
|
|
19
|
-
load(data) {
|
|
20
|
-
if ((0, engine_1.isNull)(data)) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
if (data.opacity !== undefined) {
|
|
24
|
-
this.opacity = data.opacity;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.ConnectLinks = ConnectLinks;
|
|
29
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
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"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
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"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
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"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
});
|
package/umd/Types.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
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"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
});
|
package/umd/Utils.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
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", "@tsparticles/canvas-utils"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.gradient = gradient;
|
|
13
|
-
exports.drawConnectLine = drawConnectLine;
|
|
14
|
-
exports.lineStyle = lineStyle;
|
|
15
|
-
exports.drawConnection = drawConnection;
|
|
16
|
-
const engine_1 = require("@tsparticles/engine");
|
|
17
|
-
const canvas_utils_1 = require("@tsparticles/canvas-utils");
|
|
18
|
-
const gradientMin = 0, gradientMax = 1, defaultLinksWidth = 0;
|
|
19
|
-
function gradient(container, context, p1, p2, opacity) {
|
|
20
|
-
const gradStop = Math.floor(p2.getRadius() / p1.getRadius()), color1 = p1.getFillColor(), color2 = p2.getFillColor();
|
|
21
|
-
if (!color1 || !color2) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const sourcePos = p1.getPosition(), destPos = p2.getPosition(), midRgb = (0, engine_1.colorMix)(color1, color2, p1.getRadius(), p2.getRadius()), grad = context.createLinearGradient(sourcePos.x, sourcePos.y, destPos.x, destPos.y);
|
|
25
|
-
grad.addColorStop(gradientMin, (0, engine_1.getStyleFromHsl)(color1, container.hdr, opacity));
|
|
26
|
-
grad.addColorStop((0, engine_1.clamp)(gradStop, gradientMin, gradientMax), (0, engine_1.getStyleFromRgb)(midRgb, container.hdr, opacity));
|
|
27
|
-
grad.addColorStop(gradientMax, (0, engine_1.getStyleFromHsl)(color2, container.hdr, opacity));
|
|
28
|
-
return grad;
|
|
29
|
-
}
|
|
30
|
-
function drawConnectLine(context, width, lineStyle, begin, end) {
|
|
31
|
-
(0, canvas_utils_1.drawLine)(context, begin, end);
|
|
32
|
-
context.lineWidth = width;
|
|
33
|
-
context.strokeStyle = lineStyle;
|
|
34
|
-
context.stroke();
|
|
35
|
-
}
|
|
36
|
-
function lineStyle(container, ctx, p1, p2) {
|
|
37
|
-
const options = container.actualOptions, connectOptions = options.interactivity?.modes.connect;
|
|
38
|
-
if (!connectOptions) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
return gradient(container, ctx, p1, p2, connectOptions.links.opacity);
|
|
42
|
-
}
|
|
43
|
-
function drawConnection(container, p1, p2) {
|
|
44
|
-
container.canvas.render.draw(ctx => {
|
|
45
|
-
const ls = lineStyle(container, ctx, p1, p2);
|
|
46
|
-
if (!ls) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const pos1 = p1.getPosition(), pos2 = p2.getPosition();
|
|
50
|
-
drawConnectLine(ctx, p1.retina.linksWidth ?? defaultLinksWidth, ls, pos1, pos2);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
});
|
package/umd/index.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
|
-
if (k2 === undefined) k2 = k;
|
|
3
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
5
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6
|
-
}
|
|
7
|
-
Object.defineProperty(o, k2, desc);
|
|
8
|
-
}) : (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
o[k2] = m[k];
|
|
11
|
-
}));
|
|
12
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
-
}) : function(o, v) {
|
|
15
|
-
o["default"] = v;
|
|
16
|
-
});
|
|
17
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
18
|
-
var ownKeys = function(o) {
|
|
19
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
20
|
-
var ar = [];
|
|
21
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
22
|
-
return ar;
|
|
23
|
-
};
|
|
24
|
-
return ownKeys(o);
|
|
25
|
-
};
|
|
26
|
-
return function (mod) {
|
|
27
|
-
if (mod && mod.__esModule) return mod;
|
|
28
|
-
var result = {};
|
|
29
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
30
|
-
__setModuleDefault(result, mod);
|
|
31
|
-
return result;
|
|
32
|
-
};
|
|
33
|
-
})();
|
|
34
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
35
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
36
|
-
};
|
|
37
|
-
(function (factory) {
|
|
38
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
39
|
-
var v = factory(require, exports);
|
|
40
|
-
if (v !== undefined) module.exports = v;
|
|
41
|
-
}
|
|
42
|
-
else if (typeof define === "function" && define.amd) {
|
|
43
|
-
define(["require", "exports", "./Options/Classes/Connect.js", "./Options/Classes/ConnectLinks.js"], factory);
|
|
44
|
-
}
|
|
45
|
-
})(function (require, exports) {
|
|
46
|
-
"use strict";
|
|
47
|
-
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
48
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
-
exports.loadExternalConnectInteraction = loadExternalConnectInteraction;
|
|
50
|
-
async function loadExternalConnectInteraction(engine) {
|
|
51
|
-
engine.checkVersion("4.0.0-beta.1");
|
|
52
|
-
await engine.pluginManager.register(async (e) => {
|
|
53
|
-
const { ensureInteractivityPluginLoaded } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/plugin-interactivity"))) : new Promise((resolve_1, reject_1) => { require(["@tsparticles/plugin-interactivity"], resolve_1, reject_1); }).then(__importStar));
|
|
54
|
-
ensureInteractivityPluginLoaded(e);
|
|
55
|
-
e.pluginManager.addInteractor?.("externalConnect", async (container) => {
|
|
56
|
-
const { Connector } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./Connector.js"))) : new Promise((resolve_2, reject_2) => { require(["./Connector.js"], resolve_2, reject_2); }).then(__importStar));
|
|
57
|
-
return new Connector(container);
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
__exportStar(require("./Options/Classes/Connect.js"), exports);
|
|
62
|
-
__exportStar(require("./Options/Classes/ConnectLinks.js"), exports);
|
|
63
|
-
});
|