@tsparticles/interaction-external-pause 3.0.0-alpha.0 → 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 CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  # tsParticles External Pause Interaction
4
4
 
5
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-interaction-external-pause/badge)](https://www.jsdelivr.com/package/npm/tsparticles-interaction-external-pause)
6
- [![npmjs](https://badge.fury.io/js/tsparticles-interaction-external-pause.svg)](https://www.npmjs.com/package/tsparticles-interaction-external-pause)
7
- [![npmjs](https://img.shields.io/npm/dt/tsparticles-interaction-external-pause)](https://www.npmjs.com/package/tsparticles-interaction-external-pause) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni)
5
+ [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/interaction-external-pause/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/interaction-external-pause)
6
+ [![npmjs](https://badge.fury.io/js/@tsparticles/interaction-external-pause.svg)](https://www.npmjs.com/package/@tsparticles/interaction-external-pause)
7
+ [![npmjs](https://img.shields.io/npm/dt/@tsparticles/interaction-external-pause)](https://www.npmjs.com/package/@tsparticles/interaction-external-pause) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](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
- loadExternalPauseInteraction(tsParticles);
31
-
32
- tsParticles.load({
33
- id: "tsparticles",
34
- options: {
35
- /* options */
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-interaction-external-pause
47
+ $ npm install @tsparticles/interaction-external-pause
46
48
  ```
47
49
 
48
50
  or
49
51
 
50
52
  ```shell
51
- $ yarn add tsparticles-interaction-external-pause
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-engine");
58
- const { loadExternalPauseInteraction } = require("tsparticles-interaction-external-pause");
59
+ const { tsParticles } = require("@tsparticles/engine");
60
+ const { loadExternalPauseInteraction } = require("@tsparticles/interaction-external-pause");
59
61
 
60
- loadExternalPauseInteraction(tsParticles);
62
+ (async () => {
63
+ await loadExternalPauseInteraction(tsParticles);
64
+ })();
61
65
  ```
62
66
 
63
67
  or
64
68
 
65
69
  ```javascript
66
- import { tsParticles } from "tsparticles-engine";
67
- import { loadExternalPauseInteraction } from "tsparticles-interaction-external-pause";
70
+ import { tsParticles } from "@tsparticles/engine";
71
+ import { loadExternalPauseInteraction } from "@tsparticles/interaction-external-pause";
68
72
 
69
- loadExternalPauseInteraction(tsParticles);
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-alpha.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.0"
81
82
  }
82
- }
83
+ }