@tsparticles/interaction-external-bubble 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.
@@ -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 Bubble External Interaction v3.0.0-beta.0 by Matteo Bruni */
1
+ /*! tsParticles Bubble External Interaction v3.0.0-beta.2 by Matteo Bruni */
@@ -1,4 +1,4 @@
1
- import type { BubbleContainer, BubbleMode, IBubbleMode } from "./Types";
1
+ import type { BubbleContainer, BubbleMode, IBubbleMode } from "./Types.js";
2
2
  import { ClickMode, ExternalInteractorBase, type IDelta, type IModes, type Modes, type Particle, type RecursivePartial } from "@tsparticles/engine";
3
3
  export declare class Bubbler extends ExternalInteractorBase<BubbleContainer> {
4
4
  handleClickMode: (mode: ClickMode | string) => void;
@@ -1,4 +1,4 @@
1
- import type { ProcessBubbleType } from "./Enums";
1
+ import type { ProcessBubbleType } from "./Enums.js";
2
2
  export interface Interfaces {
3
3
  bubbleObj: IBubblerProcessParamObj;
4
4
  particlesObj: IBubblerProcessParamObj;
@@ -1,7 +1,7 @@
1
1
  import { type IOptionLoader, type RecursivePartial, type SingleOrMultiple } from "@tsparticles/engine";
2
- import { BubbleBase } from "./BubbleBase";
3
- import { BubbleDiv } from "./BubbleDiv";
4
- import type { IBubble } from "../Interfaces/IBubble";
2
+ import { BubbleBase } from "./BubbleBase.js";
3
+ import { BubbleDiv } from "./BubbleDiv.js";
4
+ import type { IBubble } from "../Interfaces/IBubble.js";
5
5
  export declare class Bubble extends BubbleBase implements IBubble, IOptionLoader<IBubble> {
6
6
  divs?: SingleOrMultiple<BubbleDiv>;
7
7
  load(data?: RecursivePartial<IBubble>): void;
@@ -1,5 +1,5 @@
1
1
  import { type IOptionLoader, OptionsColor, type RecursivePartial, type SingleOrMultiple } from "@tsparticles/engine";
2
- import type { IBubbleBase } from "../Interfaces/IBubbleBase";
2
+ import type { IBubbleBase } from "../Interfaces/IBubbleBase.js";
3
3
  export declare abstract class BubbleBase implements IBubbleBase, IOptionLoader<IBubbleBase> {
4
4
  color?: SingleOrMultiple<OptionsColor>;
5
5
  distance: number;
@@ -1,6 +1,6 @@
1
1
  import { type IOptionLoader, type RecursivePartial, type SingleOrMultiple } from "@tsparticles/engine";
2
- import { BubbleBase } from "./BubbleBase";
3
- import type { IBubbleDiv } from "../Interfaces/IBubbleDiv";
2
+ import { BubbleBase } from "./BubbleBase.js";
3
+ import type { IBubbleDiv } from "../Interfaces/IBubbleDiv.js";
4
4
  export declare class BubbleDiv extends BubbleBase implements IBubbleDiv, IOptionLoader<IBubbleDiv> {
5
5
  selectors: SingleOrMultiple<string>;
6
6
  constructor();
@@ -1,4 +1,4 @@
1
- import type { BubbleMode } from "../../Types";
1
+ import type { BubbleMode } from "../../Types.js";
2
2
  import type { Options } from "@tsparticles/engine";
3
3
  export type BubbleOptions = Options & {
4
4
  interactivity: {
@@ -1,5 +1,5 @@
1
- import type { IBubbleBase } from "./IBubbleBase";
2
- import type { IBubbleDiv } from "./IBubbleDiv";
1
+ import type { IBubbleBase } from "./IBubbleBase.js";
2
+ import type { IBubbleDiv } from "./IBubbleDiv.js";
3
3
  import type { SingleOrMultiple } from "@tsparticles/engine";
4
4
  export interface IBubble extends IBubbleBase {
5
5
  divs?: SingleOrMultiple<IBubbleDiv>;
@@ -1,4 +1,4 @@
1
- import type { IBubbleBase } from "./IBubbleBase";
1
+ import type { IBubbleBase } from "./IBubbleBase.js";
2
2
  import type { IModeDiv } from "@tsparticles/engine";
3
3
  export interface IBubbleDiv extends IBubbleBase, IModeDiv {
4
4
  }
package/types/Types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import type { Bubble } from "./Options/Classes/Bubble";
2
- import type { BubbleOptions } from "./Options/Classes/BubbleOptions";
1
+ import type { Bubble } from "./Options/Classes/Bubble.js";
2
+ import type { BubbleOptions } from "./Options/Classes/BubbleOptions.js";
3
3
  import type { Container } from "@tsparticles/engine";
4
- import type { IBubble } from "./Options/Interfaces/IBubble";
4
+ import type { IBubble } from "./Options/Interfaces/IBubble.js";
5
5
  export type IBubbleMode = {
6
6
  bubble: IBubble;
7
7
  };
package/types/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import type { Engine } from "@tsparticles/engine";
2
2
  export declare function loadExternalBubbleInteraction(engine: Engine, refresh?: boolean): Promise<void>;
3
- export * from "./Options/Classes/BubbleBase";
4
- export * from "./Options/Classes/BubbleDiv";
5
- export * from "./Options/Classes/Bubble";
6
- export * from "./Options/Interfaces/IBubbleBase";
7
- export * from "./Options/Interfaces/IBubbleDiv";
8
- export * from "./Options/Interfaces/IBubble";
3
+ export * from "./Options/Classes/BubbleBase.js";
4
+ export * from "./Options/Classes/BubbleDiv.js";
5
+ export * from "./Options/Classes/Bubble.js";
6
+ export * from "./Options/Interfaces/IBubbleBase.js";
7
+ export * from "./Options/Interfaces/IBubbleDiv.js";
8
+ export * from "./Options/Interfaces/IBubble.js";
package/umd/Bubbler.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", "./Options/Classes/Bubble", "./Utils"], factory);
7
+ define(["require", "exports", "@tsparticles/engine", "./Options/Classes/Bubble.js", "./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.Bubbler = void 0;
13
13
  const engine_1 = require("@tsparticles/engine");
14
- const Bubble_1 = require("./Options/Classes/Bubble");
15
- const Utils_1 = require("./Utils");
14
+ const Bubble_js_1 = require("./Options/Classes/Bubble.js");
15
+ const Utils_js_1 = require("./Utils.js");
16
16
  class Bubbler extends engine_1.ExternalInteractorBase {
17
17
  constructor(container) {
18
18
  super(container);
@@ -130,7 +130,7 @@
130
130
  if (!modeOpacity) {
131
131
  return;
132
132
  }
133
- const optOpacity = particle.options.opacity.value, pOpacity = particle.opacity?.value ?? 1, opacity = (0, Utils_1.calculateBubbleValue)(pOpacity, modeOpacity, (0, engine_1.getRangeMax)(optOpacity), ratio);
133
+ const optOpacity = particle.options.opacity.value, pOpacity = particle.opacity?.value ?? 1, opacity = (0, Utils_js_1.calculateBubbleValue)(pOpacity, modeOpacity, (0, engine_1.getRangeMax)(optOpacity), ratio);
134
134
  if (opacity !== undefined) {
135
135
  particle.bubble.opacity = opacity;
136
136
  }
@@ -140,7 +140,7 @@
140
140
  if (modeSize === undefined) {
141
141
  return;
142
142
  }
143
- const optSize = (0, engine_1.getRangeMax)(particle.options.size.value) * container.retina.pixelRatio, pSize = particle.size.value, size = (0, Utils_1.calculateBubbleValue)(pSize, modeSize, optSize, ratio);
143
+ const optSize = (0, engine_1.getRangeMax)(particle.options.size.value) * container.retina.pixelRatio, pSize = particle.size.value, size = (0, Utils_js_1.calculateBubbleValue)(pSize, modeSize, optSize, ratio);
144
144
  if (size !== undefined) {
145
145
  particle.bubble.radius = size;
146
146
  }
@@ -271,7 +271,7 @@
271
271
  }
272
272
  loadModeOptions(options, ...sources) {
273
273
  if (!options.bubble) {
274
- options.bubble = new Bubble_1.Bubble();
274
+ options.bubble = new Bubble_js_1.Bubble();
275
275
  }
276
276
  for (const source of sources) {
277
277
  options.bubble.load(source?.bubble);
@@ -4,23 +4,23 @@
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", "./BubbleBase", "./BubbleDiv"], factory);
7
+ define(["require", "exports", "@tsparticles/engine", "./BubbleBase.js", "./BubbleDiv.js"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Bubble = void 0;
13
13
  const engine_1 = require("@tsparticles/engine");
14
- const BubbleBase_1 = require("./BubbleBase");
15
- const BubbleDiv_1 = require("./BubbleDiv");
16
- class Bubble extends BubbleBase_1.BubbleBase {
14
+ const BubbleBase_js_1 = require("./BubbleBase.js");
15
+ const BubbleDiv_js_1 = require("./BubbleDiv.js");
16
+ class Bubble extends BubbleBase_js_1.BubbleBase {
17
17
  load(data) {
18
18
  super.load(data);
19
19
  if (!data) {
20
20
  return;
21
21
  }
22
22
  this.divs = (0, engine_1.executeOnSingleOrMultiple)(data.divs, (div) => {
23
- const tmp = new BubbleDiv_1.BubbleDiv();
23
+ const tmp = new BubbleDiv_js_1.BubbleDiv();
24
24
  tmp.load(div);
25
25
  return tmp;
26
26
  });
@@ -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", "./BubbleBase"], factory);
7
+ define(["require", "exports", "./BubbleBase.js"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.BubbleDiv = void 0;
13
- const BubbleBase_1 = require("./BubbleBase");
14
- class BubbleDiv extends BubbleBase_1.BubbleBase {
13
+ const BubbleBase_js_1 = require("./BubbleBase.js");
14
+ class BubbleDiv extends BubbleBase_js_1.BubbleBase {
15
15
  constructor() {
16
16
  super();
17
17
  this.selectors = [];
package/umd/index.js CHANGED
@@ -18,21 +18,21 @@ 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", "./Bubbler", "./Options/Classes/BubbleBase", "./Options/Classes/BubbleDiv", "./Options/Classes/Bubble", "./Options/Interfaces/IBubbleBase", "./Options/Interfaces/IBubbleDiv", "./Options/Interfaces/IBubble"], factory);
21
+ define(["require", "exports", "./Bubbler.js", "./Options/Classes/BubbleBase.js", "./Options/Classes/BubbleDiv.js", "./Options/Classes/Bubble.js", "./Options/Interfaces/IBubbleBase.js", "./Options/Interfaces/IBubbleDiv.js", "./Options/Interfaces/IBubble.js"], factory);
22
22
  }
23
23
  })(function (require, exports) {
24
24
  "use strict";
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.loadExternalBubbleInteraction = void 0;
27
- const Bubbler_1 = require("./Bubbler");
27
+ const Bubbler_js_1 = require("./Bubbler.js");
28
28
  async function loadExternalBubbleInteraction(engine, refresh = true) {
29
- await engine.addInteractor("externalBubble", (container) => new Bubbler_1.Bubbler(container), refresh);
29
+ await engine.addInteractor("externalBubble", (container) => new Bubbler_js_1.Bubbler(container), refresh);
30
30
  }
31
31
  exports.loadExternalBubbleInteraction = loadExternalBubbleInteraction;
32
- __exportStar(require("./Options/Classes/BubbleBase"), exports);
33
- __exportStar(require("./Options/Classes/BubbleDiv"), exports);
34
- __exportStar(require("./Options/Classes/Bubble"), exports);
35
- __exportStar(require("./Options/Interfaces/IBubbleBase"), exports);
36
- __exportStar(require("./Options/Interfaces/IBubbleDiv"), exports);
37
- __exportStar(require("./Options/Interfaces/IBubble"), exports);
32
+ __exportStar(require("./Options/Classes/BubbleBase.js"), exports);
33
+ __exportStar(require("./Options/Classes/BubbleDiv.js"), exports);
34
+ __exportStar(require("./Options/Classes/Bubble.js"), exports);
35
+ __exportStar(require("./Options/Interfaces/IBubbleBase.js"), exports);
36
+ __exportStar(require("./Options/Interfaces/IBubbleDiv.js"), exports);
37
+ __exportStar(require("./Options/Interfaces/IBubble.js"), exports);
38
38
  });