@tsparticles/interaction-particles-links 3.1.0 → 3.2.1
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/356.min.js +2 -0
- package/356.min.js.LICENSE.txt +1 -0
- package/806.min.js +2 -0
- package/806.min.js.LICENSE.txt +1 -0
- package/838.min.js +2 -0
- package/838.min.js.LICENSE.txt +1 -0
- package/browser/LinkInstance.js +2 -1
- package/browser/Linker.js +10 -5
- package/browser/interaction.js +4 -2
- package/browser/plugin.js +2 -2
- package/cjs/LinkInstance.js +2 -1
- package/cjs/Linker.js +33 -5
- package/cjs/interaction.js +27 -2
- package/cjs/plugin.js +26 -3
- package/dist_browser_CircleWarp_js.js +30 -0
- package/dist_browser_LinkInstance_js.js +40 -0
- package/dist_browser_Linker_js.js +30 -0
- package/esm/LinkInstance.js +2 -1
- package/esm/Linker.js +10 -5
- package/esm/interaction.js +4 -2
- package/esm/plugin.js +2 -2
- package/package.json +2 -2
- package/report.html +3 -3
- package/tsparticles.interaction.particles.links.js +291 -635
- package/tsparticles.interaction.particles.links.min.js +1 -1
- package/tsparticles.interaction.particles.links.min.js.LICENSE.txt +1 -1
- package/types/LinkInstance.d.ts +1 -1
- package/umd/LinkInstance.js +2 -1
- package/umd/Linker.js +35 -6
- package/umd/interaction.js +29 -3
- package/umd/plugin.js +28 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.interaction.particles.links.min.js.LICENSE.txt */
|
|
2
|
-
!function(
|
|
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 i="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var r in i)("object"==typeof exports?exports:e)[r]=i[r]}}(this,(e=>(()=>{var t,i,r={515:(e,t,i)=>{i.d(t,{y:()=>a});var r=i(533),o=i(470),n=i(597);class a{constructor(){this.blink=!1,this.color=new r.OptionsColor,this.color.value="#fff",this.consent=!1,this.distance=100,this.enable=!1,this.frequency=1,this.opacity=1,this.shadow=new o.u,this.triangles=new n.e,this.width=1,this.warp=!1}load(e){e&&(void 0!==e.id&&(this.id=e.id),void 0!==e.blink&&(this.blink=e.blink),this.color=r.OptionsColor.create(this.color,e.color),void 0!==e.consent&&(this.consent=e.consent),void 0!==e.distance&&(this.distance=e.distance),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.frequency&&(this.frequency=e.frequency),void 0!==e.opacity&&(this.opacity=e.opacity),this.shadow.load(e.shadow),this.triangles.load(e.triangles),void 0!==e.width&&(this.width=e.width),void 0!==e.warp&&(this.warp=e.warp))}}},470:(e,t,i)=>{i.d(t,{u:()=>o});var r=i(533);class o{constructor(){this.blur=5,this.color=new r.OptionsColor,this.color.value="#000",this.enable=!1}load(e){e&&(void 0!==e.blur&&(this.blur=e.blur),this.color=r.OptionsColor.create(this.color,e.color),void 0!==e.enable&&(this.enable=e.enable))}}},597:(e,t,i)=>{i.d(t,{e:()=>o});var r=i(533);class o{constructor(){this.enable=!1,this.frequency=1}load(e){e&&(void 0!==e.color&&(this.color=r.OptionsColor.create(this.color,e.color)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.frequency&&(this.frequency=e.frequency),void 0!==e.opacity&&(this.opacity=e.opacity))}}},533:t=>{t.exports=e}},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var i=o[e]={exports:{}};return r[e](i,i.exports,n),i.exports}n.m=r,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,i)=>(n.f[i](e,t),t)),[])),n.u=e=>e+".min.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},i="@tsparticles/interaction-particles-links:",n.l=(e,r,o,a)=>{if(t[e])t[e].push(r);else{var s,c;if(void 0!==o)for(var l=document.getElementsByTagName("script"),d=0;d<l.length;d++){var u=l[d];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==i+o){s=u;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",i+o),s.src=e),t[e]=[r];var h=(i,r)=>{s.onerror=s.onload=null,clearTimeout(p);var o=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((e=>e(r))),i)return i(r)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=h.bind(null,s.onerror),s.onload=h.bind(null,s.onload),c&&document.head.appendChild(s)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");if(i.length)for(var r=i.length-1;r>-1&&!e;)e=i[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={71:0};n.f.j=(t,i)=>{var r=n.o(e,t)?e[t]:void 0;if(0!==r)if(r)i.push(r[2]);else{var o=new Promise(((i,o)=>r=e[t]=[i,o]));i.push(r[2]=o);var a=n.p+n.u(t),s=new Error;n.l(a,(i=>{if(n.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=i&&("load"===i.type?"missing":i.type),a=i&&i.target&&i.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",s.name="ChunkLoadError",s.type=o,s.request=a,r[1](s)}}),"chunk-"+t,t)}};var t=(t,i)=>{var r,o,a=i[0],s=i[1],c=i[2],l=0;if(a.some((t=>0!==e[t]))){for(r in s)n.o(s,r)&&(n.m[r]=s[r]);if(c)c(n)}for(t&&t(i);l<a.length;l++)o=a[l],n.o(e,o)&&e[o]&&e[o][0](),e[o]=0},i=this.webpackChunk_tsparticles_interaction_particles_links=this.webpackChunk_tsparticles_interaction_particles_links||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var a={};return(()=>{n.r(a),n.d(a,{Links:()=>t.y,LinksShadow:()=>i.u,LinksTriangle:()=>r.e,loadParticlesLinksInteraction:()=>o});class e{constructor(){this.id="links"}async getPlugin(e){const{LinkInstance:t}=await n.e(838).then(n.bind(n,838));return new t(e)}loadOptions(){}needsPlugin(){return!0}}var t=n(515),i=n(470),r=n(597);async function o(t,i=!0){await async function(e,t=!0){await e.addInteractor("particlesLinks",(async e=>{const{Linker:t}=await n.e(806).then(n.bind(n,806));return new t(e)}),t)}(t,i),await async function(t,i=!0){const r=new e;await t.addPlugin(r,i)}(t,i)}})(),a})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Links Particles Interaction v3.1
|
|
1
|
+
/*! tsParticles Links Particles Interaction v3.2.1 by Matteo Bruni */
|
package/types/LinkInstance.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare class LinkInstance implements IContainerPlugin {
|
|
|
4
4
|
private readonly container;
|
|
5
5
|
private readonly _freqs;
|
|
6
6
|
constructor(container: LinkContainer);
|
|
7
|
-
drawParticle(context: CanvasRenderingContext2D, particle: LinkParticle): void
|
|
7
|
+
drawParticle(context: CanvasRenderingContext2D, particle: LinkParticle): Promise<void>;
|
|
8
8
|
init(): Promise<void>;
|
|
9
9
|
particleCreated(particle: LinkParticle): void;
|
|
10
10
|
particleDestroyed(particle: LinkParticle): void;
|
package/umd/LinkInstance.js
CHANGED
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
triangles: new Map(),
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
drawParticle(context, particle) {
|
|
134
|
+
async drawParticle(context, particle) {
|
|
135
135
|
const { links, options } = particle;
|
|
136
136
|
if (!links?.length) {
|
|
137
137
|
return;
|
|
@@ -143,6 +143,7 @@
|
|
|
143
143
|
this._drawLinkLine(particle, link);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
+
await Promise.resolve();
|
|
146
147
|
}
|
|
147
148
|
async init() {
|
|
148
149
|
this._freqs.links = new Map();
|
package/umd/Linker.js
CHANGED
|
@@ -1,17 +1,40 @@
|
|
|
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 (mod) {
|
|
18
|
+
if (mod && mod.__esModule) return mod;
|
|
19
|
+
var result = {};
|
|
20
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
+
__setModuleDefault(result, mod);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
1
24
|
(function (factory) {
|
|
2
25
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
26
|
var v = factory(require, exports);
|
|
4
27
|
if (v !== undefined) module.exports = v;
|
|
5
28
|
}
|
|
6
29
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine", "./
|
|
30
|
+
define(["require", "exports", "@tsparticles/engine", "./Options/Classes/Links.js"], factory);
|
|
8
31
|
}
|
|
9
32
|
})(function (require, exports) {
|
|
10
33
|
"use strict";
|
|
34
|
+
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
11
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
36
|
exports.Linker = void 0;
|
|
13
37
|
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const CircleWarp_js_1 = require("./CircleWarp.js");
|
|
15
38
|
const Links_js_1 = require("./Options/Classes/Links.js");
|
|
16
39
|
const squarePower = 2, opacityOffset = 1, origin = {
|
|
17
40
|
x: 0,
|
|
@@ -71,9 +94,16 @@
|
|
|
71
94
|
if (pos1.x < origin.x || pos1.y < origin.y || pos1.x > canvasSize.width || pos1.y > canvasSize.height) {
|
|
72
95
|
return;
|
|
73
96
|
}
|
|
74
|
-
const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance, warp = linkOpt1.warp
|
|
75
|
-
|
|
76
|
-
|
|
97
|
+
const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance, warp = linkOpt1.warp;
|
|
98
|
+
let range;
|
|
99
|
+
if (warp) {
|
|
100
|
+
const { CircleWarp } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./CircleWarp.js"))) : new Promise((resolve_1, reject_1) => { require(["./CircleWarp.js"], resolve_1, reject_1); }).then(__importStar));
|
|
101
|
+
range = new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
range = new engine_1.Circle(pos1.x, pos1.y, optDistance);
|
|
105
|
+
}
|
|
106
|
+
const query = container.particles.quadTree.query(range);
|
|
77
107
|
for (const p2 of query) {
|
|
78
108
|
const linkOpt2 = p2.options.links;
|
|
79
109
|
if (p1 === p2 ||
|
|
@@ -101,7 +131,6 @@
|
|
|
101
131
|
opacity: opacityLine,
|
|
102
132
|
});
|
|
103
133
|
}
|
|
104
|
-
await Promise.resolve();
|
|
105
134
|
}
|
|
106
135
|
isEnabled(particle) {
|
|
107
136
|
return !!particle.options.links?.enable;
|
package/umd/interaction.js
CHANGED
|
@@ -1,18 +1,44 @@
|
|
|
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 (mod) {
|
|
18
|
+
if (mod && mod.__esModule) return mod;
|
|
19
|
+
var result = {};
|
|
20
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
+
__setModuleDefault(result, mod);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
1
24
|
(function (factory) {
|
|
2
25
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
26
|
var v = factory(require, exports);
|
|
4
27
|
if (v !== undefined) module.exports = v;
|
|
5
28
|
}
|
|
6
29
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"
|
|
30
|
+
define(["require", "exports"], factory);
|
|
8
31
|
}
|
|
9
32
|
})(function (require, exports) {
|
|
10
33
|
"use strict";
|
|
34
|
+
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
11
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
36
|
exports.loadLinksInteraction = void 0;
|
|
13
|
-
const Linker_js_1 = require("./Linker.js");
|
|
14
37
|
async function loadLinksInteraction(engine, refresh = true) {
|
|
15
|
-
await engine.addInteractor("particlesLinks", (container) =>
|
|
38
|
+
await engine.addInteractor("particlesLinks", async (container) => {
|
|
39
|
+
const { Linker } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./Linker.js"))) : new Promise((resolve_1, reject_1) => { require(["./Linker.js"], resolve_1, reject_1); }).then(__importStar));
|
|
40
|
+
return new Linker(container);
|
|
41
|
+
}, refresh);
|
|
16
42
|
}
|
|
17
43
|
exports.loadLinksInteraction = loadLinksInteraction;
|
|
18
44
|
});
|
package/umd/plugin.js
CHANGED
|
@@ -1,22 +1,46 @@
|
|
|
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 (mod) {
|
|
18
|
+
if (mod && mod.__esModule) return mod;
|
|
19
|
+
var result = {};
|
|
20
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
+
__setModuleDefault(result, mod);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
1
24
|
(function (factory) {
|
|
2
25
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
26
|
var v = factory(require, exports);
|
|
4
27
|
if (v !== undefined) module.exports = v;
|
|
5
28
|
}
|
|
6
29
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"
|
|
30
|
+
define(["require", "exports"], factory);
|
|
8
31
|
}
|
|
9
32
|
})(function (require, exports) {
|
|
10
33
|
"use strict";
|
|
34
|
+
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
11
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
36
|
exports.loadLinksPlugin = void 0;
|
|
13
|
-
const LinkInstance_js_1 = require("./LinkInstance.js");
|
|
14
37
|
class LinksPlugin {
|
|
15
38
|
constructor() {
|
|
16
39
|
this.id = "links";
|
|
17
40
|
}
|
|
18
|
-
getPlugin(container) {
|
|
19
|
-
|
|
41
|
+
async getPlugin(container) {
|
|
42
|
+
const { LinkInstance } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./LinkInstance.js"))) : new Promise((resolve_1, reject_1) => { require(["./LinkInstance.js"], resolve_1, reject_1); }).then(__importStar));
|
|
43
|
+
return new LinkInstance(container);
|
|
20
44
|
}
|
|
21
45
|
loadOptions() {
|
|
22
46
|
}
|