@tsparticles/interaction-external-pause 3.0.0-alpha.1 → 3.0.0-beta.0
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 +25 -19
- package/browser/index.js +2 -2
- package/cjs/Pauser.js +1 -12
- package/cjs/index.js +2 -2
- package/esm/index.js +2 -2
- package/package.json +6 -5
- package/report.html +4 -4
- package/tsparticles.interaction.external.pause.js +4 -4
- package/tsparticles.interaction.external.pause.min.js +1 -1
- package/tsparticles.interaction.external.pause.min.js.LICENSE.txt +1 -8
- package/types/Pauser.d.ts +1 -2
- package/types/index.d.ts +1 -1
- package/umd/index.js +2 -2
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# tsParticles External Pause Interaction
|
|
4
4
|
|
|
5
|
-
[](https://www.jsdelivr.com/package/npm/@tsparticles/interaction-external-pause)
|
|
6
|
+
[](https://www.npmjs.com/package/@tsparticles/interaction-external-pause)
|
|
7
|
+
[](https://www.npmjs.com/package/@tsparticles/interaction-external-pause) [](https://github.com/sponsors/matteobruni)
|
|
8
8
|
|
|
9
9
|
[tsParticles](https://github.com/matteobruni/tsparticles) interaction plugin for pause effect around mouse or HTML
|
|
10
10
|
elements.
|
|
@@ -27,14 +27,16 @@ loadExternalPauseInteraction;
|
|
|
27
27
|
Once the scripts are loaded you can set up `tsParticles` and the interaction plugin like this:
|
|
28
28
|
|
|
29
29
|
```javascript
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
30
|
+
(async () => {
|
|
31
|
+
await loadExternalPauseInteraction(tsParticles);
|
|
32
|
+
|
|
33
|
+
await tsParticles.load({
|
|
34
|
+
id: "tsparticles",
|
|
35
|
+
options: {
|
|
36
|
+
/* options */
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
})();
|
|
38
40
|
```
|
|
39
41
|
|
|
40
42
|
### ESM / CommonJS
|
|
@@ -42,29 +44,33 @@ tsParticles.load({
|
|
|
42
44
|
This package is compatible also with ES or CommonJS modules, firstly this needs to be installed, like this:
|
|
43
45
|
|
|
44
46
|
```shell
|
|
45
|
-
$ npm install tsparticles
|
|
47
|
+
$ npm install @tsparticles/interaction-external-pause
|
|
46
48
|
```
|
|
47
49
|
|
|
48
50
|
or
|
|
49
51
|
|
|
50
52
|
```shell
|
|
51
|
-
$ yarn add tsparticles
|
|
53
|
+
$ yarn add @tsparticles/interaction-external-pause
|
|
52
54
|
```
|
|
53
55
|
|
|
54
56
|
Then you need to import it in the app, like this:
|
|
55
57
|
|
|
56
58
|
```javascript
|
|
57
|
-
const { tsParticles } = require("tsparticles
|
|
58
|
-
const { loadExternalPauseInteraction } = require("tsparticles
|
|
59
|
+
const { tsParticles } = require("@tsparticles/engine");
|
|
60
|
+
const { loadExternalPauseInteraction } = require("@tsparticles/interaction-external-pause");
|
|
59
61
|
|
|
60
|
-
|
|
62
|
+
(async () => {
|
|
63
|
+
await loadExternalPauseInteraction(tsParticles);
|
|
64
|
+
})();
|
|
61
65
|
```
|
|
62
66
|
|
|
63
67
|
or
|
|
64
68
|
|
|
65
69
|
```javascript
|
|
66
|
-
import { tsParticles } from "tsparticles
|
|
67
|
-
import { loadExternalPauseInteraction } from "tsparticles
|
|
70
|
+
import { tsParticles } from "@tsparticles/engine";
|
|
71
|
+
import { loadExternalPauseInteraction } from "@tsparticles/interaction-external-pause";
|
|
68
72
|
|
|
69
|
-
|
|
73
|
+
(async () => {
|
|
74
|
+
await loadExternalPauseInteraction(tsParticles);
|
|
75
|
+
})();
|
|
70
76
|
```
|
package/browser/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Pauser } from "./Pauser";
|
|
2
|
-
export function loadExternalPauseInteraction(engine) {
|
|
3
|
-
engine.addInteractor("externalPause", (container) => new Pauser(container));
|
|
2
|
+
export async function loadExternalPauseInteraction(engine, refresh = true) {
|
|
3
|
+
await engine.addInteractor("externalPause", (container) => new Pauser(container), refresh);
|
|
4
4
|
}
|
package/cjs/Pauser.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.Pauser = void 0;
|
|
13
4
|
const engine_1 = require("@tsparticles/engine");
|
|
@@ -31,9 +22,7 @@ class Pauser extends engine_1.ExternalInteractorBase {
|
|
|
31
22
|
}
|
|
32
23
|
init() {
|
|
33
24
|
}
|
|
34
|
-
interact() {
|
|
35
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
});
|
|
25
|
+
async interact() {
|
|
37
26
|
}
|
|
38
27
|
isEnabled() {
|
|
39
28
|
return true;
|
package/cjs/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadExternalPauseInteraction = void 0;
|
|
4
4
|
const Pauser_1 = require("./Pauser");
|
|
5
|
-
function loadExternalPauseInteraction(engine) {
|
|
6
|
-
engine.addInteractor("externalPause", (container) => new Pauser_1.Pauser(container));
|
|
5
|
+
async function loadExternalPauseInteraction(engine, refresh = true) {
|
|
6
|
+
await engine.addInteractor("externalPause", (container) => new Pauser_1.Pauser(container), refresh);
|
|
7
7
|
}
|
|
8
8
|
exports.loadExternalPauseInteraction = loadExternalPauseInteraction;
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Pauser } from "./Pauser";
|
|
2
|
-
export function loadExternalPauseInteraction(engine) {
|
|
3
|
-
engine.addInteractor("externalPause", (container) => new Pauser(container));
|
|
2
|
+
export async function loadExternalPauseInteraction(engine, refresh = true) {
|
|
3
|
+
await engine.addInteractor("externalPause", (container) => new Pauser(container), refresh);
|
|
4
4
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-external-pause",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-beta.0",
|
|
4
4
|
"description": "tsParticles pause external interaction",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -73,10 +73,11 @@
|
|
|
73
73
|
"unpkg": "tsparticles.interaction.external.pause.min.js",
|
|
74
74
|
"module": "esm/index.js",
|
|
75
75
|
"types": "types/index.d.ts",
|
|
76
|
+
"sideEffects": false,
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"@tsparticles/engine": "^3.0.0-beta.0"
|
|
79
|
+
},
|
|
76
80
|
"publishConfig": {
|
|
77
81
|
"access": "public"
|
|
78
|
-
},
|
|
79
|
-
"dependencies": {
|
|
80
|
-
"@tsparticles/engine": "^3.0.0-alpha.1"
|
|
81
82
|
}
|
|
82
|
-
}
|
|
83
|
+
}
|