@tsparticles/shape-cards 3.0.0-alpha.1 → 3.0.0-beta.1

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 Cards Shape
4
4
 
5
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-shape-cards/badge)](https://www.jsdelivr.com/package/npm/tsparticles-shape-cards)
6
- [![npmjs](https://badge.fury.io/js/tsparticles-shape-cards.svg)](https://www.npmjs.com/package/tsparticles-shape-cards)
7
- [![npmjs](https://img.shields.io/npm/dt/tsparticles-shape-cards)](https://www.npmjs.com/package/tsparticles-shape-cards) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni)
5
+ [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/shape-cards/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/shape-cards)
6
+ [![npmjs](https://badge.fury.io/js/@tsparticles/shape-cards.svg)](https://www.npmjs.com/package/@tsparticles/shape-cards)
7
+ [![npmjs](https://img.shields.io/npm/dt/@tsparticles/shape-cards)](https://www.npmjs.com/package/@tsparticles/shape-cards) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni)
8
8
 
9
9
  [tsParticles](https://github.com/matteobruni/tsparticles) additional cards shape.
10
10
 
@@ -26,7 +26,7 @@ Once the scripts are loaded you can set up `tsParticles` and the shape like this
26
26
 
27
27
  ```javascript
28
28
  (async () => {
29
- await loadCardsShape();
29
+ await loadCardsShape(tsParticles);
30
30
 
31
31
  await tsParticles.load({
32
32
  id: "tsparticles",
@@ -44,29 +44,33 @@ Once the scripts are loaded you can set up `tsParticles` and the shape like this
44
44
  This package is compatible also with ES or CommonJS modules, firstly this needs to be installed, like this:
45
45
 
46
46
  ```shell
47
- $ npm install tsparticles-shape-cards
47
+ $ npm install @tsparticles/shape-cards
48
48
  ```
49
49
 
50
50
  or
51
51
 
52
52
  ```shell
53
- $ yarn add tsparticles-shape-cards
53
+ $ yarn add @tsparticles/shape-cards
54
54
  ```
55
55
 
56
56
  Then you need to import it in the app, like this:
57
57
 
58
58
  ```javascript
59
- const { tsParticles } = require("tsparticles-engine");
60
- const { loadCardsShape } = require("tsparticles-shape-cards");
59
+ const { tsParticles } = require("@tsparticles/engine");
60
+ const { loadCardsShape } = require("@tsparticles/shape-cards");
61
61
 
62
- loadCardsShape(tsParticles);
62
+ (async () => {
63
+ await loadCardsShape(tsParticles);
64
+ })();
63
65
  ```
64
66
 
65
67
  or
66
68
 
67
69
  ```javascript
68
- import { tsParticles } from "tsparticles-engine";
69
- import { loadCardsShape } from "tsparticles-shape-cards";
70
+ import { tsParticles } from "@tsparticles/engine";
71
+ import { loadCardsShape } from "@tsparticles/shape-cards";
70
72
 
71
- loadCardsShape(tsParticles);
73
+ (async () => {
74
+ await loadCardsShape(tsParticles);
75
+ })();
72
76
  ```
@@ -1,21 +1,21 @@
1
- import { drawPath, paths } from "./Utils";
1
+ import { drawPath, paths } from "./Utils.js";
2
2
  export class SpadeDrawer {
3
- draw(context, particle, radius) {
3
+ draw(context, _particle, radius) {
4
4
  drawPath(context, radius, paths.spade);
5
5
  }
6
6
  }
7
7
  export class HeartDrawer {
8
- draw(context, particle, radius) {
8
+ draw(context, _particle, radius) {
9
9
  drawPath(context, radius, paths.heart);
10
10
  }
11
11
  }
12
12
  export class DiamondDrawer {
13
- draw(context, particle, radius) {
13
+ draw(context, _particle, radius) {
14
14
  drawPath(context, radius, paths.diamond);
15
15
  }
16
16
  }
17
17
  export class ClubDrawer {
18
- draw(context, particle, radius) {
18
+ draw(context, _particle, radius) {
19
19
  drawPath(context, radius, paths.club);
20
20
  }
21
21
  }
package/browser/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { ClubDrawer, DiamondDrawer, HeartDrawer, SpadeDrawer } from "./CardsSuitsDrawers";
2
- export async function loadCardsShape(engine) {
3
- await engine.addShape(["spade", "spades"], new SpadeDrawer());
4
- await engine.addShape(["heart", "hearts"], new HeartDrawer());
5
- await engine.addShape(["diamond", "diamonds"], new DiamondDrawer());
6
- await engine.addShape(["club", "clubs"], new ClubDrawer());
1
+ import { ClubDrawer, DiamondDrawer, HeartDrawer, SpadeDrawer } from "./CardsSuitsDrawers.js";
2
+ export async function loadCardsShape(engine, refresh = true) {
3
+ await engine.addShape(["spade", "spades"], new SpadeDrawer(), refresh);
4
+ await engine.addShape(["heart", "hearts"], new HeartDrawer(), refresh);
5
+ await engine.addShape(["diamond", "diamonds"], new DiamondDrawer(), refresh);
6
+ await engine.addShape(["club", "clubs"], new ClubDrawer(), refresh);
7
7
  }
@@ -0,0 +1 @@
1
+ { "type": "module" }
@@ -1,28 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ClubDrawer = exports.DiamondDrawer = exports.HeartDrawer = exports.SpadeDrawer = void 0;
4
- const Utils_1 = require("./Utils");
4
+ const Utils_js_1 = require("./Utils.js");
5
5
  class SpadeDrawer {
6
- draw(context, particle, radius) {
7
- (0, Utils_1.drawPath)(context, radius, Utils_1.paths.spade);
6
+ draw(context, _particle, radius) {
7
+ (0, Utils_js_1.drawPath)(context, radius, Utils_js_1.paths.spade);
8
8
  }
9
9
  }
10
10
  exports.SpadeDrawer = SpadeDrawer;
11
11
  class HeartDrawer {
12
- draw(context, particle, radius) {
13
- (0, Utils_1.drawPath)(context, radius, Utils_1.paths.heart);
12
+ draw(context, _particle, radius) {
13
+ (0, Utils_js_1.drawPath)(context, radius, Utils_js_1.paths.heart);
14
14
  }
15
15
  }
16
16
  exports.HeartDrawer = HeartDrawer;
17
17
  class DiamondDrawer {
18
- draw(context, particle, radius) {
19
- (0, Utils_1.drawPath)(context, radius, Utils_1.paths.diamond);
18
+ draw(context, _particle, radius) {
19
+ (0, Utils_js_1.drawPath)(context, radius, Utils_js_1.paths.diamond);
20
20
  }
21
21
  }
22
22
  exports.DiamondDrawer = DiamondDrawer;
23
23
  class ClubDrawer {
24
- draw(context, particle, radius) {
25
- (0, Utils_1.drawPath)(context, radius, Utils_1.paths.club);
24
+ draw(context, _particle, radius) {
25
+ (0, Utils_js_1.drawPath)(context, radius, Utils_js_1.paths.club);
26
26
  }
27
27
  }
28
28
  exports.ClubDrawer = ClubDrawer;
package/cjs/index.js CHANGED
@@ -1,22 +1,11 @@
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.loadCardsShape = void 0;
13
- const CardsSuitsDrawers_1 = require("./CardsSuitsDrawers");
14
- function loadCardsShape(engine) {
15
- return __awaiter(this, void 0, void 0, function* () {
16
- yield engine.addShape(["spade", "spades"], new CardsSuitsDrawers_1.SpadeDrawer());
17
- yield engine.addShape(["heart", "hearts"], new CardsSuitsDrawers_1.HeartDrawer());
18
- yield engine.addShape(["diamond", "diamonds"], new CardsSuitsDrawers_1.DiamondDrawer());
19
- yield engine.addShape(["club", "clubs"], new CardsSuitsDrawers_1.ClubDrawer());
20
- });
4
+ const CardsSuitsDrawers_js_1 = require("./CardsSuitsDrawers.js");
5
+ async function loadCardsShape(engine, refresh = true) {
6
+ await engine.addShape(["spade", "spades"], new CardsSuitsDrawers_js_1.SpadeDrawer(), refresh);
7
+ await engine.addShape(["heart", "hearts"], new CardsSuitsDrawers_js_1.HeartDrawer(), refresh);
8
+ await engine.addShape(["diamond", "diamonds"], new CardsSuitsDrawers_js_1.DiamondDrawer(), refresh);
9
+ await engine.addShape(["club", "clubs"], new CardsSuitsDrawers_js_1.ClubDrawer(), refresh);
21
10
  }
22
11
  exports.loadCardsShape = loadCardsShape;
@@ -0,0 +1 @@
1
+ { "type": "commonjs" }
@@ -1,21 +1,21 @@
1
- import { drawPath, paths } from "./Utils";
1
+ import { drawPath, paths } from "./Utils.js";
2
2
  export class SpadeDrawer {
3
- draw(context, particle, radius) {
3
+ draw(context, _particle, radius) {
4
4
  drawPath(context, radius, paths.spade);
5
5
  }
6
6
  }
7
7
  export class HeartDrawer {
8
- draw(context, particle, radius) {
8
+ draw(context, _particle, radius) {
9
9
  drawPath(context, radius, paths.heart);
10
10
  }
11
11
  }
12
12
  export class DiamondDrawer {
13
- draw(context, particle, radius) {
13
+ draw(context, _particle, radius) {
14
14
  drawPath(context, radius, paths.diamond);
15
15
  }
16
16
  }
17
17
  export class ClubDrawer {
18
- draw(context, particle, radius) {
18
+ draw(context, _particle, radius) {
19
19
  drawPath(context, radius, paths.club);
20
20
  }
21
21
  }
package/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { ClubDrawer, DiamondDrawer, HeartDrawer, SpadeDrawer } from "./CardsSuitsDrawers";
2
- export async function loadCardsShape(engine) {
3
- await engine.addShape(["spade", "spades"], new SpadeDrawer());
4
- await engine.addShape(["heart", "hearts"], new HeartDrawer());
5
- await engine.addShape(["diamond", "diamonds"], new DiamondDrawer());
6
- await engine.addShape(["club", "clubs"], new ClubDrawer());
1
+ import { ClubDrawer, DiamondDrawer, HeartDrawer, SpadeDrawer } from "./CardsSuitsDrawers.js";
2
+ export async function loadCardsShape(engine, refresh = true) {
3
+ await engine.addShape(["spade", "spades"], new SpadeDrawer(), refresh);
4
+ await engine.addShape(["heart", "hearts"], new HeartDrawer(), refresh);
5
+ await engine.addShape(["diamond", "diamonds"], new DiamondDrawer(), refresh);
6
+ await engine.addShape(["club", "clubs"], new ClubDrawer(), refresh);
7
7
  }
@@ -0,0 +1 @@
1
+ { "type": "module" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/shape-cards",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0-beta.1",
4
4
  "description": "tsParticles cards shape",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -72,20 +72,37 @@
72
72
  "type": "github",
73
73
  "url": "https://github.com/sponsors/matteobruni"
74
74
  },
75
+ {
76
+ "type": "github",
77
+ "url": "https://github.com/sponsors/tsparticles"
78
+ },
75
79
  {
76
80
  "type": "buymeacoffee",
77
81
  "url": "https://www.buymeacoffee.com/matteobruni"
78
82
  }
79
83
  ],
80
- "main": "cjs/index.js",
84
+ "sideEffects": false,
81
85
  "jsdelivr": "tsparticles.shape.cards.min.js",
82
86
  "unpkg": "tsparticles.shape.cards.min.js",
87
+ "browser": "browser/index.js",
88
+ "main": "cjs/index.js",
83
89
  "module": "esm/index.js",
84
90
  "types": "types/index.d.ts",
85
- "publishConfig": {
86
- "access": "public"
91
+ "exports": {
92
+ ".": {
93
+ "types": "./types/index.d.ts",
94
+ "browser": "./browser/index.js",
95
+ "import": "./esm/index.js",
96
+ "require": "./cjs/index.js",
97
+ "umd": "./umd/index.js",
98
+ "default": "./cjs/index.js"
99
+ },
100
+ "./package.json": "./package.json"
87
101
  },
88
102
  "dependencies": {
89
- "@tsparticles/engine": "^3.0.0-alpha.1"
103
+ "@tsparticles/engine": "^3.0.0-beta.1"
104
+ },
105
+ "publishConfig": {
106
+ "access": "public"
90
107
  }
91
- }
108
+ }