@tsparticles/shape-star 4.0.0-beta.0 → 4.0.0-beta.10
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/241.min.js +1 -0
- package/README.md +35 -0
- package/browser/index.js +3 -3
- package/cjs/index.js +3 -3
- package/dist_browser_StarDrawer_js.js +1 -1
- package/esm/index.js +3 -3
- package/package.json +4 -5
- package/report.html +84 -29
- package/tsparticles.shape.star.js +2 -2
- package/tsparticles.shape.star.min.js +2 -2
- package/85.min.js +0 -1
- package/umd/IStarShape.js +0 -12
- package/umd/StarDrawer.js +0 -30
- package/umd/StarParticle.js +0 -12
- package/umd/Utils.js +0 -24
- package/umd/index.js +0 -56
package/241.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_shape_star=this.webpackChunk_tsparticles_shape_star||[]).push([[241],{241(t,e,a){a.d(e,{StarDrawer:()=>r});var s=a(303);class r{draw(t){!function(t){let{context:e,particle:a,radius:s}=t,r=a.sides,n=a.starInset??2;e.moveTo(0,0-s);for(let t=0;t<r;t++)e.rotate(Math.PI/r),e.lineTo(0,0-s*n),e.rotate(Math.PI/r),e.lineTo(0,0-s)}(t)}getSidesCount(t){let e=t.shapeData;return Math.round((0,s.getRangeValue)(e?.sides??5))}particleInit(t,e){let a=e.shapeData;e.starInset=(0,s.getRangeValue)(a?.inset??2)}}}}]);
|
package/README.md
CHANGED
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
[tsParticles](https://github.com/tsparticles/tsparticles) additional star shape.
|
|
10
10
|
|
|
11
|
+
## Quick checklist
|
|
12
|
+
|
|
13
|
+
1. Install `@tsparticles/engine` (or use the CDN bundle below)
|
|
14
|
+
2. Call the package loader function(s) before `tsParticles.load(...)`
|
|
15
|
+
3. Apply the package options in your `tsParticles.load(...)` config
|
|
16
|
+
|
|
11
17
|
## How to use it
|
|
12
18
|
|
|
13
19
|
### CDN / Vanilla JS / jQuery
|
|
@@ -73,3 +79,32 @@ import { loadStarShape } from "@tsparticles/shape-star";
|
|
|
73
79
|
await loadStarShape(tsParticles);
|
|
74
80
|
})();
|
|
75
81
|
```
|
|
82
|
+
|
|
83
|
+
## Option mapping
|
|
84
|
+
|
|
85
|
+
- Primary options key: `particles.shape.type: "star"`
|
|
86
|
+
- Shape-specific options key: `particles.shape.options.star`
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"particles": {
|
|
91
|
+
"shape": {
|
|
92
|
+
"type": "star",
|
|
93
|
+
"options": {
|
|
94
|
+
"star": {}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Common pitfalls
|
|
102
|
+
|
|
103
|
+
- Calling `tsParticles.load(...)` before `loadStarShape(...)`
|
|
104
|
+
- Verify required peer packages before enabling advanced options
|
|
105
|
+
- Change one option group at a time to isolate regressions quickly
|
|
106
|
+
|
|
107
|
+
## Related docs
|
|
108
|
+
|
|
109
|
+
- All packages catalog: <https://github.com/tsparticles/tsparticles>
|
|
110
|
+
- Main docs: <https://particles.js.org/docs/>
|
package/browser/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export async function loadStarShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["star"], async () => {
|
|
2
|
+
engine.checkVersion("4.0.0-beta.10");
|
|
3
|
+
await engine.pluginManager.register(e => {
|
|
4
|
+
e.pluginManager.addShape(["star"], async () => {
|
|
5
5
|
const { StarDrawer } = await import("./StarDrawer.js");
|
|
6
6
|
return new StarDrawer();
|
|
7
7
|
});
|
package/cjs/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export async function loadStarShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["star"], async () => {
|
|
2
|
+
engine.checkVersion("4.0.0-beta.10");
|
|
3
|
+
await engine.pluginManager.register(e => {
|
|
4
|
+
e.pluginManager.addShape(["star"], async () => {
|
|
5
5
|
const { StarDrawer } = await import("./StarDrawer.js");
|
|
6
6
|
return new StarDrawer();
|
|
7
7
|
});
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export async function loadStarShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["star"], async () => {
|
|
2
|
+
engine.checkVersion("4.0.0-beta.10");
|
|
3
|
+
await engine.pluginManager.register(e => {
|
|
4
|
+
e.pluginManager.addShape(["star"], async () => {
|
|
5
5
|
const { StarDrawer } = await import("./StarDrawer.js");
|
|
6
6
|
return new StarDrawer();
|
|
7
7
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/shape-star",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.10",
|
|
4
4
|
"description": "tsParticles star shape",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -53,13 +53,12 @@
|
|
|
53
53
|
"browser": "./browser/index.js",
|
|
54
54
|
"import": "./esm/index.js",
|
|
55
55
|
"require": "./cjs/index.js",
|
|
56
|
-
"
|
|
57
|
-
"default": "./cjs/index.js"
|
|
56
|
+
"default": "./esm/index.js"
|
|
58
57
|
},
|
|
59
58
|
"./package.json": "./package.json"
|
|
60
59
|
},
|
|
61
|
-
"
|
|
62
|
-
"@tsparticles/engine": "4.0.0-beta.
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"@tsparticles/engine": "4.0.0-beta.10"
|
|
63
62
|
},
|
|
64
63
|
"publishConfig": {
|
|
65
64
|
"access": "public"
|