@tsparticles/interaction-particles-links 3.0.0-beta.0 → 3.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.
Files changed (42) hide show
  1. package/README.md +1 -1
  2. package/browser/LinkInstance.js +1 -1
  3. package/browser/Linker.js +2 -2
  4. package/browser/Options/Classes/Links.js +2 -2
  5. package/browser/index.js +8 -8
  6. package/browser/interaction.js +1 -1
  7. package/browser/package.json +1 -0
  8. package/browser/plugin.js +1 -1
  9. package/cjs/LinkInstance.js +5 -5
  10. package/cjs/Linker.js +4 -4
  11. package/cjs/Options/Classes/Links.js +4 -4
  12. package/cjs/index.js +10 -10
  13. package/cjs/interaction.js +2 -2
  14. package/cjs/package.json +1 -0
  15. package/cjs/plugin.js +2 -2
  16. package/esm/LinkInstance.js +1 -1
  17. package/esm/Linker.js +2 -2
  18. package/esm/Options/Classes/Links.js +2 -2
  19. package/esm/index.js +8 -8
  20. package/esm/interaction.js +1 -1
  21. package/esm/package.json +1 -0
  22. package/esm/plugin.js +1 -1
  23. package/package.json +18 -6
  24. package/report.html +23 -5
  25. package/tsparticles.interaction.particles.links.js +1 -1
  26. package/tsparticles.interaction.particles.links.min.js.LICENSE.txt +1 -1
  27. package/types/Interfaces.d.ts +1 -1
  28. package/types/LinkInstance.d.ts +1 -1
  29. package/types/Linker.d.ts +1 -1
  30. package/types/Options/Classes/Links.d.ts +3 -3
  31. package/types/Options/Classes/LinksShadow.d.ts +1 -1
  32. package/types/Options/Classes/LinksTriangle.d.ts +1 -1
  33. package/types/Options/Interfaces/ILinks.d.ts +2 -2
  34. package/types/Types.d.ts +3 -3
  35. package/types/Utils.d.ts +1 -1
  36. package/types/index.d.ts +6 -6
  37. package/umd/LinkInstance.js +6 -6
  38. package/umd/Linker.js +5 -5
  39. package/umd/Options/Classes/Links.js +5 -5
  40. package/umd/index.js +11 -11
  41. package/umd/interaction.js +3 -3
  42. package/umd/plugin.js +3 -3
@@ -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
- * v3.0.0-beta.0
7
+ * v3.0.0-beta.2
8
8
  */
9
9
  (function webpackUniversalModuleDefinition(root, factory) {
10
10
  if(typeof exports === 'object' && typeof module === 'object')
@@ -1 +1 @@
1
- /*! tsParticles Links Particles Interaction v3.0.0-beta.0 by Matteo Bruni */
1
+ /*! tsParticles Links Particles Interaction v3.0.0-beta.2 by Matteo Bruni */
@@ -1,5 +1,5 @@
1
1
  import type { IRangeColor, RangeValue } from "@tsparticles/engine";
2
- import type { LinkParticle } from "./Types";
2
+ import type { LinkParticle } from "./Types.js";
3
3
  export interface ILink {
4
4
  destination: LinkParticle;
5
5
  opacity: number;
@@ -1,5 +1,5 @@
1
1
  import { type IContainerPlugin } from "@tsparticles/engine";
2
- import type { LinkContainer, LinkParticle } from "./Types";
2
+ import type { LinkContainer, LinkParticle } from "./Types.js";
3
3
  export declare class LinkInstance implements IContainerPlugin {
4
4
  private readonly container;
5
5
  private readonly _freqs;
package/types/Linker.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ParticlesInteractorBase, type RecursivePartial } from "@tsparticles/engine";
2
- import type { IParticlesLinkOptions, LinkContainer, LinkParticle, ParticlesLinkOptions } from "./Types";
2
+ import type { IParticlesLinkOptions, LinkContainer, LinkParticle, ParticlesLinkOptions } from "./Types.js";
3
3
  export declare class Linker extends ParticlesInteractorBase {
4
4
  linkContainer: LinkContainer;
5
5
  constructor(container: LinkContainer);
@@ -1,7 +1,7 @@
1
1
  import { type IOptionLoader, OptionsColor, type RecursivePartial } from "@tsparticles/engine";
2
- import type { ILinks } from "../Interfaces/ILinks";
3
- import { LinksShadow } from "./LinksShadow";
4
- import { LinksTriangle } from "./LinksTriangle";
2
+ import type { ILinks } from "../Interfaces/ILinks.js";
3
+ import { LinksShadow } from "./LinksShadow.js";
4
+ import { LinksTriangle } from "./LinksTriangle.js";
5
5
  export declare class Links implements ILinks, IOptionLoader<ILinks> {
6
6
  blink: boolean;
7
7
  color: OptionsColor;
@@ -1,5 +1,5 @@
1
1
  import { type IOptionLoader, OptionsColor, type RecursivePartial } from "@tsparticles/engine";
2
- import type { ILinksShadow } from "../Interfaces/ILinksShadow";
2
+ import type { ILinksShadow } from "../Interfaces/ILinksShadow.js";
3
3
  export declare class LinksShadow implements ILinksShadow, IOptionLoader<ILinksShadow> {
4
4
  blur: number;
5
5
  color: OptionsColor;
@@ -1,5 +1,5 @@
1
1
  import { type IOptionLoader, OptionsColor, type RecursivePartial } from "@tsparticles/engine";
2
- import type { ILinksTriangle } from "../Interfaces/ILinksTriangle";
2
+ import type { ILinksTriangle } from "../Interfaces/ILinksTriangle.js";
3
3
  export declare class LinksTriangle implements ILinksTriangle, IOptionLoader<ILinksTriangle> {
4
4
  color?: OptionsColor;
5
5
  enable: boolean;
@@ -1,5 +1,5 @@
1
- import type { ILinksShadow } from "./ILinksShadow";
2
- import type { ILinksTriangle } from "./ILinksTriangle";
1
+ import type { ILinksShadow } from "./ILinksShadow.js";
2
+ import type { ILinksTriangle } from "./ILinksTriangle.js";
3
3
  import type { IOptionsColor } from "@tsparticles/engine";
4
4
  export interface ILinks {
5
5
  blink: boolean;
package/types/Types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { BackgroundMask, Container, ICoordinates, IDimension, IParticlesOptions, IRgb, Particle, ParticlesOptions } from "@tsparticles/engine";
2
- import type { ILink } from "./Interfaces";
3
- import type { ILinks } from "./Options/Interfaces/ILinks";
4
- import type { Links } from "./Options/Classes/Links";
2
+ import type { ILink } from "./Interfaces.js";
3
+ import type { ILinks } from "./Options/Interfaces/ILinks.js";
4
+ import type { Links } from "./Options/Classes/Links.js";
5
5
  export type LinkContainer = Container & {
6
6
  particles: {
7
7
  linksColor?: IRgb | string;
package/types/Utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { LinkLineDrawParams, LinkParticle, LinkTriangleDrawParams } from "./Types";
1
+ import type { LinkLineDrawParams, LinkParticle, LinkTriangleDrawParams } from "./Types.js";
2
2
  export declare function drawLinkLine(params: LinkLineDrawParams): void;
3
3
  export declare function drawLinkTriangle(params: LinkTriangleDrawParams): void;
4
4
  export declare function getLinkKey(ids: number[]): string;
package/types/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import type { Engine } from "@tsparticles/engine";
2
2
  export declare function loadParticlesLinksInteraction(engine: Engine, refresh?: boolean): Promise<void>;
3
- export * from "./Options/Classes/Links";
4
- export * from "./Options/Classes/LinksShadow";
5
- export * from "./Options/Classes/LinksTriangle";
6
- export * from "./Options/Interfaces/ILinks";
7
- export * from "./Options/Interfaces/ILinksShadow";
8
- export * from "./Options/Interfaces/ILinksTriangle";
3
+ export * from "./Options/Classes/Links.js";
4
+ export * from "./Options/Classes/LinksShadow.js";
5
+ export * from "./Options/Classes/LinksTriangle.js";
6
+ export * from "./Options/Interfaces/ILinks.js";
7
+ export * from "./Options/Interfaces/ILinksShadow.js";
8
+ export * from "./Options/Interfaces/ILinksTriangle.js";
@@ -4,14 +4,14 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "@tsparticles/engine", "./Utils"], factory);
7
+ define(["require", "exports", "@tsparticles/engine", "./Utils.js"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.LinkInstance = void 0;
13
13
  const engine_1 = require("@tsparticles/engine");
14
- const Utils_1 = require("./Utils");
14
+ const Utils_js_1 = require("./Utils.js");
15
15
  class LinkInstance {
16
16
  constructor(container) {
17
17
  this.container = container;
@@ -42,7 +42,7 @@
42
42
  return;
43
43
  }
44
44
  const width = p1.retina.linksWidth ?? 0, maxDistance = p1.retina.linksDistance ?? 0, { backgroundMask } = options;
45
- (0, Utils_1.drawLinkLine)({
45
+ (0, Utils_js_1.drawLinkLine)({
46
46
  context: ctx,
47
47
  width,
48
48
  begin: pos1,
@@ -86,7 +86,7 @@
86
86
  if (!colorTriangle) {
87
87
  return;
88
88
  }
89
- (0, Utils_1.drawLinkTriangle)({
89
+ (0, Utils_js_1.drawLinkTriangle)({
90
90
  context: ctx,
91
91
  pos1,
92
92
  pos2,
@@ -120,10 +120,10 @@
120
120
  }
121
121
  };
122
122
  this._getLinkFrequency = (p1, p2) => {
123
- return (0, Utils_1.setLinkFrequency)([p1, p2], this._freqs.links);
123
+ return (0, Utils_js_1.setLinkFrequency)([p1, p2], this._freqs.links);
124
124
  };
125
125
  this._getTriangleFrequency = (p1, p2, p3) => {
126
- return (0, Utils_1.setLinkFrequency)([p1, p2, p3], this._freqs.triangles);
126
+ return (0, Utils_js_1.setLinkFrequency)([p1, p2, p3], this._freqs.triangles);
127
127
  };
128
128
  this._freqs = {
129
129
  links: new Map(),
package/umd/Linker.js CHANGED
@@ -4,15 +4,15 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "@tsparticles/engine", "./CircleWarp", "./Options/Classes/Links"], factory);
7
+ define(["require", "exports", "@tsparticles/engine", "./CircleWarp.js", "./Options/Classes/Links.js"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Linker = void 0;
13
13
  const engine_1 = require("@tsparticles/engine");
14
- const CircleWarp_1 = require("./CircleWarp");
15
- const Links_1 = require("./Options/Classes/Links");
14
+ const CircleWarp_js_1 = require("./CircleWarp.js");
15
+ const Links_js_1 = require("./Options/Classes/Links.js");
16
16
  function getLinkDistance(pos1, pos2, optDistance, canvasSize, warp) {
17
17
  const { dx, dy, distance } = (0, engine_1.getDistances)(pos1, pos2);
18
18
  if (!warp || distance <= optDistance) {
@@ -68,7 +68,7 @@
68
68
  return;
69
69
  }
70
70
  const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? 0, warp = linkOpt1.warp, range = warp
71
- ? new CircleWarp_1.CircleWarp(pos1.x, pos1.y, optDistance, canvasSize)
71
+ ? new CircleWarp_js_1.CircleWarp(pos1.x, pos1.y, optDistance, canvasSize)
72
72
  : new engine_1.Circle(pos1.x, pos1.y, optDistance), query = container.particles.quadTree.query(range);
73
73
  for (const p2 of query) {
74
74
  const linkOpt2 = p2.options.links;
@@ -103,7 +103,7 @@
103
103
  }
104
104
  loadParticlesOptions(options, ...sources) {
105
105
  if (!options.links) {
106
- options.links = new Links_1.Links();
106
+ options.links = new Links_js_1.Links();
107
107
  }
108
108
  for (const source of sources) {
109
109
  options.links.load(source?.links ?? source?.lineLinked ?? source?.line_linked);
@@ -4,15 +4,15 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "@tsparticles/engine", "./LinksShadow", "./LinksTriangle"], factory);
7
+ define(["require", "exports", "@tsparticles/engine", "./LinksShadow.js", "./LinksTriangle.js"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Links = void 0;
13
13
  const engine_1 = require("@tsparticles/engine");
14
- const LinksShadow_1 = require("./LinksShadow");
15
- const LinksTriangle_1 = require("./LinksTriangle");
14
+ const LinksShadow_js_1 = require("./LinksShadow.js");
15
+ const LinksTriangle_js_1 = require("./LinksTriangle.js");
16
16
  class Links {
17
17
  constructor() {
18
18
  this.blink = false;
@@ -23,8 +23,8 @@
23
23
  this.enable = false;
24
24
  this.frequency = 1;
25
25
  this.opacity = 1;
26
- this.shadow = new LinksShadow_1.LinksShadow();
27
- this.triangles = new LinksTriangle_1.LinksTriangle();
26
+ this.shadow = new LinksShadow_js_1.LinksShadow();
27
+ this.triangles = new LinksTriangle_js_1.LinksTriangle();
28
28
  this.width = 1;
29
29
  this.warp = false;
30
30
  }
package/umd/index.js CHANGED
@@ -18,23 +18,23 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
18
  if (v !== undefined) module.exports = v;
19
19
  }
20
20
  else if (typeof define === "function" && define.amd) {
21
- define(["require", "exports", "./interaction", "./plugin", "./Options/Classes/Links", "./Options/Classes/LinksShadow", "./Options/Classes/LinksTriangle", "./Options/Interfaces/ILinks", "./Options/Interfaces/ILinksShadow", "./Options/Interfaces/ILinksTriangle"], factory);
21
+ define(["require", "exports", "./interaction.js", "./plugin.js", "./Options/Classes/Links.js", "./Options/Classes/LinksShadow.js", "./Options/Classes/LinksTriangle.js", "./Options/Interfaces/ILinks.js", "./Options/Interfaces/ILinksShadow.js", "./Options/Interfaces/ILinksTriangle.js"], factory);
22
22
  }
23
23
  })(function (require, exports) {
24
24
  "use strict";
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.loadParticlesLinksInteraction = void 0;
27
- const interaction_1 = require("./interaction");
28
- const plugin_1 = require("./plugin");
27
+ const interaction_js_1 = require("./interaction.js");
28
+ const plugin_js_1 = require("./plugin.js");
29
29
  async function loadParticlesLinksInteraction(engine, refresh = true) {
30
- await (0, interaction_1.loadLinksInteraction)(engine, refresh);
31
- await (0, plugin_1.loadLinksPlugin)(engine, refresh);
30
+ await (0, interaction_js_1.loadLinksInteraction)(engine, refresh);
31
+ await (0, plugin_js_1.loadLinksPlugin)(engine, refresh);
32
32
  }
33
33
  exports.loadParticlesLinksInteraction = loadParticlesLinksInteraction;
34
- __exportStar(require("./Options/Classes/Links"), exports);
35
- __exportStar(require("./Options/Classes/LinksShadow"), exports);
36
- __exportStar(require("./Options/Classes/LinksTriangle"), exports);
37
- __exportStar(require("./Options/Interfaces/ILinks"), exports);
38
- __exportStar(require("./Options/Interfaces/ILinksShadow"), exports);
39
- __exportStar(require("./Options/Interfaces/ILinksTriangle"), exports);
34
+ __exportStar(require("./Options/Classes/Links.js"), exports);
35
+ __exportStar(require("./Options/Classes/LinksShadow.js"), exports);
36
+ __exportStar(require("./Options/Classes/LinksTriangle.js"), exports);
37
+ __exportStar(require("./Options/Interfaces/ILinks.js"), exports);
38
+ __exportStar(require("./Options/Interfaces/ILinksShadow.js"), exports);
39
+ __exportStar(require("./Options/Interfaces/ILinksTriangle.js"), exports);
40
40
  });
@@ -4,15 +4,15 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./Linker"], factory);
7
+ define(["require", "exports", "./Linker.js"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.loadLinksInteraction = void 0;
13
- const Linker_1 = require("./Linker");
13
+ const Linker_js_1 = require("./Linker.js");
14
14
  async function loadLinksInteraction(engine, refresh = true) {
15
- await engine.addInteractor("particlesLinks", (container) => new Linker_1.Linker(container), refresh);
15
+ await engine.addInteractor("particlesLinks", (container) => new Linker_js_1.Linker(container), refresh);
16
16
  }
17
17
  exports.loadLinksInteraction = loadLinksInteraction;
18
18
  });
package/umd/plugin.js CHANGED
@@ -4,19 +4,19 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./LinkInstance"], factory);
7
+ define(["require", "exports", "./LinkInstance.js"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.loadLinksPlugin = void 0;
13
- const LinkInstance_1 = require("./LinkInstance");
13
+ const LinkInstance_js_1 = require("./LinkInstance.js");
14
14
  class LinksPlugin {
15
15
  constructor() {
16
16
  this.id = "links";
17
17
  }
18
18
  getPlugin(container) {
19
- return new LinkInstance_1.LinkInstance(container);
19
+ return new LinkInstance_js_1.LinkInstance(container);
20
20
  }
21
21
  loadOptions() {
22
22
  }