@tsparticles/interaction-external-connect 4.0.0-beta.12 → 4.0.0-beta.15
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/browser/browser.js +5 -0
- package/browser/index.js +6 -6
- package/browser/index.lazy.js +13 -0
- package/cjs/browser.js +5 -0
- package/cjs/index.js +6 -6
- package/cjs/index.lazy.js +13 -0
- package/esm/browser.js +5 -0
- package/esm/index.js +6 -6
- package/esm/index.lazy.js +13 -0
- package/package.json +11 -4
- package/report.html +4949 -94
- package/tsparticles.interaction.external.connect.js +164 -387
- package/tsparticles.interaction.external.connect.min.js +1 -2
- package/types/browser.d.ts +1 -0
- package/types/index.lazy.d.ts +6 -0
- package/473.min.js +0 -1
- package/dist_browser_Connector_js.js +0 -40
|
@@ -1,387 +1,164 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
/******/ }
|
|
166
|
-
/******/ };
|
|
167
|
-
/******/ })();
|
|
168
|
-
/******/
|
|
169
|
-
/******/ /* webpack/runtime/ensure chunk */
|
|
170
|
-
/******/ (() => {
|
|
171
|
-
/******/ __webpack_require__.f = {};
|
|
172
|
-
/******/ // This file contains only the entry chunk.
|
|
173
|
-
/******/ // The chunk loading function for additional chunks
|
|
174
|
-
/******/ __webpack_require__.e = (chunkId) => {
|
|
175
|
-
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
|
|
176
|
-
/******/ __webpack_require__.f[key](chunkId, promises);
|
|
177
|
-
/******/ return promises;
|
|
178
|
-
/******/ }, []));
|
|
179
|
-
/******/ };
|
|
180
|
-
/******/ })();
|
|
181
|
-
/******/
|
|
182
|
-
/******/ /* webpack/runtime/get javascript chunk filename */
|
|
183
|
-
/******/ (() => {
|
|
184
|
-
/******/ // This function allow to reference async chunks
|
|
185
|
-
/******/ __webpack_require__.u = (chunkId) => {
|
|
186
|
-
/******/ // return url for filenames based on template
|
|
187
|
-
/******/ return "" + chunkId + ".js";
|
|
188
|
-
/******/ };
|
|
189
|
-
/******/ })();
|
|
190
|
-
/******/
|
|
191
|
-
/******/ /* webpack/runtime/global */
|
|
192
|
-
/******/ (() => {
|
|
193
|
-
/******/ __webpack_require__.g = (function() {
|
|
194
|
-
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
195
|
-
/******/ try {
|
|
196
|
-
/******/ return this || new Function('return this')();
|
|
197
|
-
/******/ } catch (e) {
|
|
198
|
-
/******/ if (typeof window === 'object') return window;
|
|
199
|
-
/******/ }
|
|
200
|
-
/******/ })();
|
|
201
|
-
/******/ })();
|
|
202
|
-
/******/
|
|
203
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
204
|
-
/******/ (() => {
|
|
205
|
-
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
206
|
-
/******/ })();
|
|
207
|
-
/******/
|
|
208
|
-
/******/ /* webpack/runtime/load script */
|
|
209
|
-
/******/ (() => {
|
|
210
|
-
/******/ var inProgress = {};
|
|
211
|
-
/******/ var dataWebpackPrefix = "@tsparticles/interaction-external-connect:";
|
|
212
|
-
/******/ // loadScript function to load a script via script tag
|
|
213
|
-
/******/ __webpack_require__.l = (url, done, key, chunkId) => {
|
|
214
|
-
/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
|
|
215
|
-
/******/ var script, needAttach;
|
|
216
|
-
/******/ if(key !== undefined) {
|
|
217
|
-
/******/ var scripts = document.getElementsByTagName("script");
|
|
218
|
-
/******/ for(var i = 0; i < scripts.length; i++) {
|
|
219
|
-
/******/ var s = scripts[i];
|
|
220
|
-
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
|
|
221
|
-
/******/ }
|
|
222
|
-
/******/ }
|
|
223
|
-
/******/ if(!script) {
|
|
224
|
-
/******/ needAttach = true;
|
|
225
|
-
/******/ script = document.createElement('script');
|
|
226
|
-
/******/
|
|
227
|
-
/******/ script.charset = 'utf-8';
|
|
228
|
-
/******/ if (__webpack_require__.nc) {
|
|
229
|
-
/******/ script.setAttribute("nonce", __webpack_require__.nc);
|
|
230
|
-
/******/ }
|
|
231
|
-
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
|
|
232
|
-
/******/
|
|
233
|
-
/******/ script.src = url;
|
|
234
|
-
/******/ }
|
|
235
|
-
/******/ inProgress[url] = [done];
|
|
236
|
-
/******/ var onScriptComplete = (prev, event) => {
|
|
237
|
-
/******/ // avoid mem leaks in IE.
|
|
238
|
-
/******/ script.onerror = script.onload = null;
|
|
239
|
-
/******/ clearTimeout(timeout);
|
|
240
|
-
/******/ var doneFns = inProgress[url];
|
|
241
|
-
/******/ delete inProgress[url];
|
|
242
|
-
/******/ script.parentNode && script.parentNode.removeChild(script);
|
|
243
|
-
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
|
|
244
|
-
/******/ if(prev) return prev(event);
|
|
245
|
-
/******/ }
|
|
246
|
-
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
|
|
247
|
-
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
|
|
248
|
-
/******/ script.onload = onScriptComplete.bind(null, script.onload);
|
|
249
|
-
/******/ needAttach && document.head.appendChild(script);
|
|
250
|
-
/******/ };
|
|
251
|
-
/******/ })();
|
|
252
|
-
/******/
|
|
253
|
-
/******/ /* webpack/runtime/make namespace object */
|
|
254
|
-
/******/ (() => {
|
|
255
|
-
/******/ // define __esModule on exports
|
|
256
|
-
/******/ __webpack_require__.r = (exports) => {
|
|
257
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
258
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
259
|
-
/******/ }
|
|
260
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
261
|
-
/******/ };
|
|
262
|
-
/******/ })();
|
|
263
|
-
/******/
|
|
264
|
-
/******/ /* webpack/runtime/publicPath */
|
|
265
|
-
/******/ (() => {
|
|
266
|
-
/******/ var scriptUrl;
|
|
267
|
-
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
|
|
268
|
-
/******/ var document = __webpack_require__.g.document;
|
|
269
|
-
/******/ if (!scriptUrl && document) {
|
|
270
|
-
/******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
|
|
271
|
-
/******/ scriptUrl = document.currentScript.src;
|
|
272
|
-
/******/ if (!scriptUrl) {
|
|
273
|
-
/******/ var scripts = document.getElementsByTagName("script");
|
|
274
|
-
/******/ if(scripts.length) {
|
|
275
|
-
/******/ var i = scripts.length - 1;
|
|
276
|
-
/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
|
|
277
|
-
/******/ }
|
|
278
|
-
/******/ }
|
|
279
|
-
/******/ }
|
|
280
|
-
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
|
|
281
|
-
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
|
|
282
|
-
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
|
|
283
|
-
/******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
284
|
-
/******/ __webpack_require__.p = scriptUrl;
|
|
285
|
-
/******/ })();
|
|
286
|
-
/******/
|
|
287
|
-
/******/ /* webpack/runtime/jsonp chunk loading */
|
|
288
|
-
/******/ (() => {
|
|
289
|
-
/******/ // no baseURI
|
|
290
|
-
/******/
|
|
291
|
-
/******/ // object to store loaded and loading chunks
|
|
292
|
-
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
|
293
|
-
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
|
294
|
-
/******/ var installedChunks = {
|
|
295
|
-
/******/ "tsparticles.interaction.external.connect": 0
|
|
296
|
-
/******/ };
|
|
297
|
-
/******/
|
|
298
|
-
/******/ __webpack_require__.f.j = (chunkId, promises) => {
|
|
299
|
-
/******/ // JSONP chunk loading for javascript
|
|
300
|
-
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
|
|
301
|
-
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
|
|
302
|
-
/******/
|
|
303
|
-
/******/ // a Promise means "currently loading".
|
|
304
|
-
/******/ if(installedChunkData) {
|
|
305
|
-
/******/ promises.push(installedChunkData[2]);
|
|
306
|
-
/******/ } else {
|
|
307
|
-
/******/ if(true) { // all chunks have JS
|
|
308
|
-
/******/ // setup Promise in chunk cache
|
|
309
|
-
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
|
|
310
|
-
/******/ promises.push(installedChunkData[2] = promise);
|
|
311
|
-
/******/
|
|
312
|
-
/******/ // start chunk loading
|
|
313
|
-
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
|
|
314
|
-
/******/ // create error before stack unwound to get useful stacktrace later
|
|
315
|
-
/******/ var error = new Error();
|
|
316
|
-
/******/ var loadingEnded = (event) => {
|
|
317
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
|
|
318
|
-
/******/ installedChunkData = installedChunks[chunkId];
|
|
319
|
-
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
|
|
320
|
-
/******/ if(installedChunkData) {
|
|
321
|
-
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
|
|
322
|
-
/******/ var realSrc = event && event.target && event.target.src;
|
|
323
|
-
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
|
|
324
|
-
/******/ error.name = 'ChunkLoadError';
|
|
325
|
-
/******/ error.type = errorType;
|
|
326
|
-
/******/ error.request = realSrc;
|
|
327
|
-
/******/ installedChunkData[1](error);
|
|
328
|
-
/******/ }
|
|
329
|
-
/******/ }
|
|
330
|
-
/******/ };
|
|
331
|
-
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
|
|
332
|
-
/******/ }
|
|
333
|
-
/******/ }
|
|
334
|
-
/******/ }
|
|
335
|
-
/******/ };
|
|
336
|
-
/******/
|
|
337
|
-
/******/ // no prefetching
|
|
338
|
-
/******/
|
|
339
|
-
/******/ // no preloaded
|
|
340
|
-
/******/
|
|
341
|
-
/******/ // no HMR
|
|
342
|
-
/******/
|
|
343
|
-
/******/ // no HMR manifest
|
|
344
|
-
/******/
|
|
345
|
-
/******/ // no on chunks loaded
|
|
346
|
-
/******/
|
|
347
|
-
/******/ // install a JSONP callback for chunk loading
|
|
348
|
-
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
|
349
|
-
/******/ var [chunkIds, moreModules, runtime] = data;
|
|
350
|
-
/******/ // add "moreModules" to the modules object,
|
|
351
|
-
/******/ // then flag all "chunkIds" as loaded and fire callback
|
|
352
|
-
/******/ var moduleId, chunkId, i = 0;
|
|
353
|
-
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
|
354
|
-
/******/ for(moduleId in moreModules) {
|
|
355
|
-
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
|
356
|
-
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
|
357
|
-
/******/ }
|
|
358
|
-
/******/ }
|
|
359
|
-
/******/ if(runtime) var result = runtime(__webpack_require__);
|
|
360
|
-
/******/ }
|
|
361
|
-
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
|
362
|
-
/******/ for(;i < chunkIds.length; i++) {
|
|
363
|
-
/******/ chunkId = chunkIds[i];
|
|
364
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
|
365
|
-
/******/ installedChunks[chunkId][0]();
|
|
366
|
-
/******/ }
|
|
367
|
-
/******/ installedChunks[chunkId] = 0;
|
|
368
|
-
/******/ }
|
|
369
|
-
/******/
|
|
370
|
-
/******/ }
|
|
371
|
-
/******/
|
|
372
|
-
/******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_interaction_external_connect"] = this["webpackChunk_tsparticles_interaction_external_connect"] || [];
|
|
373
|
-
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
|
374
|
-
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
|
375
|
-
/******/ })();
|
|
376
|
-
/******/
|
|
377
|
-
/************************************************************************/
|
|
378
|
-
/******/
|
|
379
|
-
/******/ // startup
|
|
380
|
-
/******/ // Load entry module and return exports
|
|
381
|
-
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
382
|
-
/******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
|
|
383
|
-
/******/
|
|
384
|
-
/******/ return __webpack_exports__;
|
|
385
|
-
/******/ })()
|
|
386
|
-
;
|
|
387
|
-
});
|
|
1
|
+
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
+
/* External Interaction v4.0.0-beta.15 */
|
|
3
|
+
(function (global, factory) {
|
|
4
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/plugin-interactivity'), require('@tsparticles/engine'), require('@tsparticles/canvas-utils')) :
|
|
5
|
+
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/plugin-interactivity', '@tsparticles/engine', '@tsparticles/canvas-utils'], factory) :
|
|
6
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.interactions = global.__tsParticlesInternals.interactions || {}, global.__tsParticlesInternals.interactions.externalConnect = global.__tsParticlesInternals.interactions.externalConnect || {}), global.__tsParticlesInternals.plugins.interactivity, global.__tsParticlesInternals.engine, global.__tsParticlesInternals.canvas.utils));
|
|
7
|
+
})(this, (function (exports, pluginInteractivity, engine, canvasUtils) { 'use strict';
|
|
8
|
+
|
|
9
|
+
class ConnectLinks {
|
|
10
|
+
opacity;
|
|
11
|
+
constructor() {
|
|
12
|
+
this.opacity = 0.5;
|
|
13
|
+
}
|
|
14
|
+
load(data) {
|
|
15
|
+
if (engine.isNull(data)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (data.opacity !== undefined) {
|
|
19
|
+
this.opacity = data.opacity;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
class Connect {
|
|
25
|
+
distance;
|
|
26
|
+
links;
|
|
27
|
+
radius;
|
|
28
|
+
constructor() {
|
|
29
|
+
this.distance = 80;
|
|
30
|
+
this.links = new ConnectLinks();
|
|
31
|
+
this.radius = 60;
|
|
32
|
+
}
|
|
33
|
+
load(data) {
|
|
34
|
+
if (engine.isNull(data)) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (data.distance !== undefined) {
|
|
38
|
+
this.distance = data.distance;
|
|
39
|
+
}
|
|
40
|
+
this.links.load(data.links);
|
|
41
|
+
if (data.radius !== undefined) {
|
|
42
|
+
this.radius = data.radius;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const gradientMin = 0, gradientMax = 1, defaultLinksWidth = 0;
|
|
48
|
+
function gradient(container, context, p1, p2, opacity) {
|
|
49
|
+
const gradStop = Math.floor(p2.getRadius() / p1.getRadius()), color1 = p1.getFillColor(), color2 = p2.getFillColor();
|
|
50
|
+
if (!color1 || !color2) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const sourcePos = p1.getPosition(), destPos = p2.getPosition(), midRgb = engine.colorMix(color1, color2, p1.getRadius(), p2.getRadius()), grad = context.createLinearGradient(sourcePos.x, sourcePos.y, destPos.x, destPos.y);
|
|
54
|
+
grad.addColorStop(gradientMin, engine.getStyleFromHsl(color1, container.hdr, opacity));
|
|
55
|
+
grad.addColorStop(engine.clamp(gradStop, gradientMin, gradientMax), engine.getStyleFromRgb(midRgb, container.hdr, opacity));
|
|
56
|
+
grad.addColorStop(gradientMax, engine.getStyleFromHsl(color2, container.hdr, opacity));
|
|
57
|
+
return grad;
|
|
58
|
+
}
|
|
59
|
+
function drawConnectLine(context, width, lineStyle, begin, end) {
|
|
60
|
+
canvasUtils.drawLine(context, begin, end);
|
|
61
|
+
context.lineWidth = width;
|
|
62
|
+
context.strokeStyle = lineStyle;
|
|
63
|
+
context.stroke();
|
|
64
|
+
}
|
|
65
|
+
function lineStyle(container, ctx, p1, p2) {
|
|
66
|
+
const options = container.actualOptions, connectOptions = options.interactivity?.modes.connect;
|
|
67
|
+
if (!connectOptions) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
return gradient(container, ctx, p1, p2, connectOptions.links.opacity);
|
|
71
|
+
}
|
|
72
|
+
function drawConnection(container, p1, p2) {
|
|
73
|
+
container.canvas.render.draw(ctx => {
|
|
74
|
+
const ls = lineStyle(container, ctx, p1, p2);
|
|
75
|
+
if (!ls) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const pos1 = p1.getPosition(), pos2 = p2.getPosition();
|
|
79
|
+
drawConnectLine(ctx, p1.retina.linksWidth ?? defaultLinksWidth, ls, pos1, pos2);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const connectMode = "connect", minDistance = 0;
|
|
84
|
+
class Connector extends pluginInteractivity.ExternalInteractorBase {
|
|
85
|
+
_maxDistance;
|
|
86
|
+
constructor(container) {
|
|
87
|
+
super(container);
|
|
88
|
+
this._maxDistance = 0;
|
|
89
|
+
}
|
|
90
|
+
get maxDistance() {
|
|
91
|
+
return this._maxDistance;
|
|
92
|
+
}
|
|
93
|
+
clear() {
|
|
94
|
+
}
|
|
95
|
+
init() {
|
|
96
|
+
const container = this.container, connect = container.actualOptions.interactivity?.modes.connect;
|
|
97
|
+
if (!connect) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
this._maxDistance = connect.distance;
|
|
101
|
+
container.retina.connectModeDistance = connect.distance * container.retina.pixelRatio;
|
|
102
|
+
container.retina.connectModeRadius = connect.radius * container.retina.pixelRatio;
|
|
103
|
+
}
|
|
104
|
+
interact(interactivityData) {
|
|
105
|
+
const container = this.container, options = container.actualOptions;
|
|
106
|
+
if (options.interactivity?.events.onHover.enable && interactivityData.status === "pointermove") {
|
|
107
|
+
const mousePos = interactivityData.mouse.position, { connectModeDistance, connectModeRadius } = container.retina;
|
|
108
|
+
if (!connectModeDistance ||
|
|
109
|
+
connectModeDistance < minDistance ||
|
|
110
|
+
!connectModeRadius ||
|
|
111
|
+
connectModeRadius < minDistance ||
|
|
112
|
+
!mousePos) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const distance = Math.abs(connectModeRadius), query = container.particles.grid.queryCircle(mousePos, distance, p => this.isEnabled(interactivityData, p));
|
|
116
|
+
query.forEach((p1, i) => {
|
|
117
|
+
const pos1 = p1.getPosition(), indexOffset = 1;
|
|
118
|
+
for (const p2 of query.slice(i + indexOffset)) {
|
|
119
|
+
const pos2 = p2.getPosition(), distMax = Math.abs(connectModeDistance), xDiff = Math.abs(pos1.x - pos2.x), yDiff = Math.abs(pos1.y - pos2.y);
|
|
120
|
+
if (xDiff < distMax && yDiff < distMax) {
|
|
121
|
+
drawConnection(container, p1, p2);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
isEnabled(interactivityData, particle) {
|
|
128
|
+
const container = this.container, mouse = interactivityData.mouse, events = (particle?.interactivity ?? container.actualOptions.interactivity)?.events;
|
|
129
|
+
if (!(events?.onHover.enable && mouse.position)) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
return engine.isInArray(connectMode, events.onHover.mode);
|
|
133
|
+
}
|
|
134
|
+
loadModeOptions(options, ...sources) {
|
|
135
|
+
options.connect ??= new Connect();
|
|
136
|
+
for (const source of sources) {
|
|
137
|
+
options.connect.load(source?.connect);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
reset() {
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
async function loadExternalConnectInteraction(engine) {
|
|
145
|
+
engine.checkVersion("4.0.0-beta.15");
|
|
146
|
+
await engine.pluginManager.register((e) => {
|
|
147
|
+
pluginInteractivity.ensureInteractivityPluginLoaded(e);
|
|
148
|
+
e.pluginManager.addInteractor?.("externalConnect", container => {
|
|
149
|
+
return Promise.resolve(new Connector(container));
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const globalObject = globalThis;
|
|
155
|
+
globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
|
|
156
|
+
globalObject.loadExternalConnectInteraction = loadExternalConnectInteraction;
|
|
157
|
+
|
|
158
|
+
exports.Connect = Connect;
|
|
159
|
+
exports.ConnectLinks = ConnectLinks;
|
|
160
|
+
exports.loadExternalConnectInteraction = loadExternalConnectInteraction;
|
|
161
|
+
|
|
162
|
+
}));
|
|
163
|
+
Object.assign(globalThis.window || globalThis, { loadExternalConnectInteraction: (globalThis.__tsParticlesInternals.interactions.externalConnect || {}).loadExternalConnectInteraction });
|
|
164
|
+
delete (globalThis.window || globalThis).tsparticlesInternalExports;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
!function(
|
|
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(218),y=c(573);async function m(e){e.checkVersion("4.0.0-beta.12"),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(473).then(c.bind(c,473));return new t(e)})})}return v})());
|
|
1
|
+
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine"),require("@tsparticles/canvas-utils")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-interactivity","@tsparticles/engine","@tsparticles/canvas-utils"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.interactions.externalConnect=t.__tsParticlesInternals.interactions.externalConnect||{}),t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine,t.__tsParticlesInternals.canvas.utils)}(this,function(t,s,e,n){"use strict";class a{opacity;constructor(){this.opacity=.5}load(t){e.isNull(t)||void 0!==t.opacity&&(this.opacity=t.opacity)}}class i{distance;links;radius;constructor(){this.distance=80,this.links=new a,this.radius=60}load(t){e.isNull(t)||(void 0!==t.distance&&(this.distance=t.distance),this.links.load(t.links),void 0!==t.radius&&(this.radius=t.radius))}}function r(t,s,n,a){const i=t.actualOptions,r=i.interactivity?.modes.connect;if(r)return function(t,s,n,a,i){const r=Math.floor(a.getRadius()/n.getRadius()),l=n.getFillColor(),c=a.getFillColor();if(!l||!c)return;const o=n.getPosition(),_=a.getPosition(),u=e.colorMix(l,c,n.getRadius(),a.getRadius()),p=s.createLinearGradient(o.x,o.y,_.x,_.y);return p.addColorStop(0,e.getStyleFromHsl(l,t.hdr,i)),p.addColorStop(e.clamp(r,0,1),e.getStyleFromRgb(u,t.hdr,i)),p.addColorStop(1,e.getStyleFromHsl(c,t.hdr,i)),p}(t,s,n,a,r.links.opacity)}function l(t,s,e){t.canvas.render.draw(a=>{const i=r(t,a,s,e);if(!i)return;const l=s.getPosition(),c=e.getPosition();!function(t,s,e,a,i){n.drawLine(t,a,i),t.lineWidth=s,t.strokeStyle=e,t.stroke()}(a,s.retina.linksWidth??0,i,l,c)})}class c extends s.ExternalInteractorBase{_maxDistance;constructor(t){super(t),this._maxDistance=0}get maxDistance(){return this._maxDistance}clear(){}init(){const t=this.container,s=t.actualOptions.interactivity?.modes.connect;s&&(this._maxDistance=s.distance,t.retina.connectModeDistance=s.distance*t.retina.pixelRatio,t.retina.connectModeRadius=s.radius*t.retina.pixelRatio)}interact(t){const s=this.container,e=s.actualOptions;if(e.interactivity?.events.onHover.enable&&"pointermove"===t.status){const e=t.mouse.position,{connectModeDistance:n,connectModeRadius:a}=s.retina;if(!n||n<0||!a||a<0||!e)return;const i=Math.abs(a),r=s.particles.grid.queryCircle(e,i,s=>this.isEnabled(t,s));r.forEach((t,e)=>{const a=t.getPosition();for(const i of r.slice(e+1)){const e=i.getPosition(),r=Math.abs(n),c=Math.abs(a.x-e.x),o=Math.abs(a.y-e.y);c<r&&o<r&&l(s,t,i)}})}}isEnabled(t,s){const n=this.container,a=t.mouse,i=(s?.interactivity??n.actualOptions.interactivity)?.events;return!(!i?.onHover.enable||!a.position)&&e.isInArray("connect",i.onHover.mode)}loadModeOptions(t,...s){t.connect??=new i;for(const e of s)t.connect.load(e?.connect)}reset(){}}async function o(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{s.ensureInteractivityPluginLoaded(t),t.pluginManager.addInteractor?.("externalConnect",t=>Promise.resolve(new c(t)))})}const _=globalThis;_.__tsParticlesInternals=_.__tsParticlesInternals??{},_.loadExternalConnectInteraction=o,t.Connect=i,t.ConnectLinks=a,t.loadExternalConnectInteraction=o}),Object.assign(globalThis.window||globalThis,{loadExternalConnectInteraction:(globalThis.__tsParticlesInternals.interactions.externalConnect||{}).loadExternalConnectInteraction}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Engine } from "@tsparticles/engine/lazy";
|
|
2
|
+
export declare function loadExternalConnectInteraction(engine: Engine): Promise<void>;
|
|
3
|
+
export * from "./Options/Classes/Connect.js";
|
|
4
|
+
export * from "./Options/Classes/ConnectLinks.js";
|
|
5
|
+
export type * from "./Options/Interfaces/IConnect.js";
|
|
6
|
+
export type * from "./Options/Interfaces/IConnectLinks.js";
|