@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.
- package/README.md +1 -1
- package/browser/Bubbler.js +2 -2
- package/browser/Options/Classes/Bubble.js +2 -2
- package/browser/Options/Classes/BubbleDiv.js +1 -1
- package/browser/index.js +7 -7
- package/browser/package.json +1 -0
- package/cjs/Bubbler.js +5 -5
- package/cjs/Options/Classes/Bubble.js +4 -4
- package/cjs/Options/Classes/BubbleDiv.js +2 -2
- package/cjs/index.js +8 -8
- package/cjs/package.json +1 -0
- package/esm/Bubbler.js +2 -2
- package/esm/Options/Classes/Bubble.js +2 -2
- package/esm/Options/Classes/BubbleDiv.js +1 -1
- package/esm/index.js +7 -7
- package/esm/package.json +1 -0
- package/package.json +18 -6
- package/report.html +23 -5
- package/tsparticles.interaction.external.bubble.js +1 -1
- package/tsparticles.interaction.external.bubble.min.js.LICENSE.txt +1 -1
- package/types/Bubbler.d.ts +1 -1
- package/types/Interfaces.d.ts +1 -1
- package/types/Options/Classes/Bubble.d.ts +3 -3
- package/types/Options/Classes/BubbleBase.d.ts +1 -1
- package/types/Options/Classes/BubbleDiv.d.ts +2 -2
- package/types/Options/Classes/BubbleOptions.d.ts +1 -1
- package/types/Options/Interfaces/IBubble.d.ts +2 -2
- package/types/Options/Interfaces/IBubbleDiv.d.ts +1 -1
- package/types/Types.d.ts +3 -3
- package/types/index.d.ts +6 -6
- package/umd/Bubbler.js +6 -6
- package/umd/Options/Classes/Bubble.js +5 -5
- package/umd/Options/Classes/BubbleDiv.js +3 -3
- package/umd/index.js +9 -9
|
@@ -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.
|
|
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.
|
|
1
|
+
/*! tsParticles Bubble External Interaction v3.0.0-beta.2 by Matteo Bruni */
|
package/types/Bubbler.d.ts
CHANGED
|
@@ -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;
|
package/types/Interfaces.d.ts
CHANGED
|
@@ -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,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>;
|
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
|
|
15
|
-
const
|
|
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,
|
|
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,
|
|
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
|
|
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
|
|
15
|
-
const
|
|
16
|
-
class Bubble extends
|
|
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
|
|
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
|
|
14
|
-
class BubbleDiv extends
|
|
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
|
|
27
|
+
const Bubbler_js_1 = require("./Bubbler.js");
|
|
28
28
|
async function loadExternalBubbleInteraction(engine, refresh = true) {
|
|
29
|
-
await engine.addInteractor("externalBubble", (container) => new
|
|
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
|
});
|