@tsparticles/shape-circle 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 +16 -12
- package/browser/CircleDrawer.js +8 -9
- package/browser/index.js +2 -2
- package/cjs/CircleDrawer.js +8 -9
- package/cjs/index.js +2 -13
- package/esm/CircleDrawer.js +8 -9
- package/esm/index.js +2 -2
- package/package.json +6 -5
- package/report.html +4 -4
- package/tsparticles.shape.circle.js +51 -13
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.circle.min.js.LICENSE.txt +1 -8
- package/types/CircleDrawer.d.ts +1 -1
- package/types/index.d.ts +1 -1
- package/umd/CircleDrawer.js +9 -10
- package/umd/index.js +2 -2
|
@@ -4,22 +4,54 @@
|
|
|
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-
|
|
7
|
+
* v3.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
11
|
-
module.exports = factory();
|
|
11
|
+
module.exports = factory(require("@tsparticles/engine"));
|
|
12
12
|
else if(typeof define === 'function' && define.amd)
|
|
13
|
-
define([], factory);
|
|
13
|
+
define(["@tsparticles/engine"], factory);
|
|
14
14
|
else {
|
|
15
|
-
var a = factory();
|
|
15
|
+
var a = typeof exports === 'object' ? factory(require("@tsparticles/engine")) : factory(root["window"]);
|
|
16
16
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
17
17
|
}
|
|
18
|
-
})(this, () => {
|
|
18
|
+
})(this, (__WEBPACK_EXTERNAL_MODULE__533__) => {
|
|
19
19
|
return /******/ (() => { // webpackBootstrap
|
|
20
20
|
/******/ "use strict";
|
|
21
|
-
/******/
|
|
22
|
-
|
|
21
|
+
/******/ var __webpack_modules__ = ({
|
|
22
|
+
|
|
23
|
+
/***/ 533:
|
|
24
|
+
/***/ ((module) => {
|
|
25
|
+
|
|
26
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__533__;
|
|
27
|
+
|
|
28
|
+
/***/ })
|
|
29
|
+
|
|
30
|
+
/******/ });
|
|
31
|
+
/************************************************************************/
|
|
32
|
+
/******/ // The module cache
|
|
33
|
+
/******/ var __webpack_module_cache__ = {};
|
|
34
|
+
/******/
|
|
35
|
+
/******/ // The require function
|
|
36
|
+
/******/ function __webpack_require__(moduleId) {
|
|
37
|
+
/******/ // Check if module is in cache
|
|
38
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
39
|
+
/******/ if (cachedModule !== undefined) {
|
|
40
|
+
/******/ return cachedModule.exports;
|
|
41
|
+
/******/ }
|
|
42
|
+
/******/ // Create a new module (and put it into the cache)
|
|
43
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
44
|
+
/******/ // no module.id needed
|
|
45
|
+
/******/ // no module.loaded needed
|
|
46
|
+
/******/ exports: {}
|
|
47
|
+
/******/ };
|
|
48
|
+
/******/
|
|
49
|
+
/******/ // Execute the module function
|
|
50
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
51
|
+
/******/
|
|
52
|
+
/******/ // Return the exports of the module
|
|
53
|
+
/******/ return module.exports;
|
|
54
|
+
/******/ }
|
|
23
55
|
/******/
|
|
24
56
|
/************************************************************************/
|
|
25
57
|
/******/ /* webpack/runtime/define property getters */
|
|
@@ -52,15 +84,20 @@ return /******/ (() => { // webpackBootstrap
|
|
|
52
84
|
/******/
|
|
53
85
|
/************************************************************************/
|
|
54
86
|
var __webpack_exports__ = {};
|
|
87
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
88
|
+
(() => {
|
|
55
89
|
// ESM COMPAT FLAG
|
|
56
90
|
__webpack_require__.r(__webpack_exports__);
|
|
57
91
|
|
|
58
92
|
// EXPORTS
|
|
59
93
|
__webpack_require__.d(__webpack_exports__, {
|
|
60
|
-
|
|
94
|
+
loadCircleShape: () => (/* binding */ loadCircleShape)
|
|
61
95
|
});
|
|
62
96
|
|
|
97
|
+
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"}
|
|
98
|
+
var engine_root_window_ = __webpack_require__(533);
|
|
63
99
|
;// CONCATENATED MODULE: ./dist/browser/CircleDrawer.js
|
|
100
|
+
|
|
64
101
|
class CircleDrawer {
|
|
65
102
|
draw(context, particle, radius) {
|
|
66
103
|
if (!particle.circleRange) {
|
|
@@ -76,13 +113,12 @@ class CircleDrawer {
|
|
|
76
113
|
return 12;
|
|
77
114
|
}
|
|
78
115
|
particleInit(container, particle) {
|
|
79
|
-
var _a;
|
|
80
116
|
const shapeData = particle.shapeData,
|
|
81
|
-
angle =
|
|
117
|
+
angle = shapeData?.angle ?? {
|
|
82
118
|
max: 360,
|
|
83
119
|
min: 0
|
|
84
120
|
};
|
|
85
|
-
particle.circleRange =
|
|
121
|
+
particle.circleRange = !(0,engine_root_window_.isObject)(angle) ? {
|
|
86
122
|
min: 0,
|
|
87
123
|
max: angle * Math.PI / 180
|
|
88
124
|
} : {
|
|
@@ -93,9 +129,11 @@ class CircleDrawer {
|
|
|
93
129
|
}
|
|
94
130
|
;// CONCATENATED MODULE: ./dist/browser/index.js
|
|
95
131
|
|
|
96
|
-
async function loadCircleShape(engine) {
|
|
97
|
-
await engine.addShape("circle", new CircleDrawer());
|
|
132
|
+
async function loadCircleShape(engine, refresh = true) {
|
|
133
|
+
await engine.addShape("circle", new CircleDrawer(), refresh);
|
|
98
134
|
}
|
|
135
|
+
})();
|
|
136
|
+
|
|
99
137
|
/******/ return __webpack_exports__;
|
|
100
138
|
/******/ })()
|
|
101
139
|
;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.shape.circle.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(e=>(()=>{"use strict";var t={533:t=>{t.exports=e}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{loadCircleShape:()=>r});var e=n(533);class t{draw(e,t,r){t.circleRange||(t.circleRange={min:0,max:2*Math.PI});const n=t.circleRange;e.arc(0,0,r,n.min,n.max,!1)}getSidesCount(){return 12}particleInit(t,r){const n=r.shapeData,o=n?.angle??{max:360,min:0};r.circleRange=(0,e.isObject)(o)?{min:o.min*Math.PI/180,max:o.max*Math.PI/180}:{min:0,max:o*Math.PI/180}}}async function r(e,r=!0){await e.addShape("circle",new t,r)}})(),o})()));
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Author : Matteo Bruni
|
|
3
|
-
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
-
* Demo / Generator : https://particles.js.org/
|
|
5
|
-
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
-
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.0.0-alpha.0
|
|
8
|
-
*/
|
|
1
|
+
/*! tsParticles Circle Shape v3.0.0-beta.0 by Matteo Bruni */
|
package/types/CircleDrawer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Container, type IShapeDrawer } from "@tsparticles/engine";
|
|
2
2
|
import type { CircleParticle } from "./CircleParticle";
|
|
3
3
|
export declare class CircleDrawer implements IShapeDrawer {
|
|
4
4
|
draw(context: CanvasRenderingContext2D, particle: CircleParticle, radius: number): void;
|
package/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Engine } from "@tsparticles/engine";
|
|
2
|
-
export declare function loadCircleShape(engine: Engine): Promise<void>;
|
|
2
|
+
export declare function loadCircleShape(engine: Engine, refresh?: boolean): Promise<void>;
|
package/umd/CircleDrawer.js
CHANGED
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
7
|
+
define(["require", "exports", "@tsparticles/engine"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CircleDrawer = void 0;
|
|
13
|
+
const engine_1 = require("@tsparticles/engine");
|
|
13
14
|
class CircleDrawer {
|
|
14
15
|
draw(context, particle, radius) {
|
|
15
16
|
if (!particle.circleRange) {
|
|
@@ -22,18 +23,16 @@
|
|
|
22
23
|
return 12;
|
|
23
24
|
}
|
|
24
25
|
particleInit(container, particle) {
|
|
25
|
-
|
|
26
|
-
const shapeData = particle.shapeData, angle = (_a = shapeData === null || shapeData === void 0 ? void 0 : shapeData.angle) !== null && _a !== void 0 ? _a : {
|
|
26
|
+
const shapeData = particle.shapeData, angle = shapeData?.angle ?? {
|
|
27
27
|
max: 360,
|
|
28
28
|
min: 0,
|
|
29
29
|
};
|
|
30
|
-
particle.circleRange =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
: { min: (angle.min * Math.PI) / 180, max: (angle.max * Math.PI) / 180 };
|
|
30
|
+
particle.circleRange = !(0, engine_1.isObject)(angle)
|
|
31
|
+
? {
|
|
32
|
+
min: 0,
|
|
33
|
+
max: (angle * Math.PI) / 180,
|
|
34
|
+
}
|
|
35
|
+
: { min: (angle.min * Math.PI) / 180, max: (angle.max * Math.PI) / 180 };
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
exports.CircleDrawer = CircleDrawer;
|
package/umd/index.js
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.loadCircleShape = void 0;
|
|
13
13
|
const CircleDrawer_1 = require("./CircleDrawer");
|
|
14
|
-
async function loadCircleShape(engine) {
|
|
15
|
-
await engine.addShape("circle", new CircleDrawer_1.CircleDrawer());
|
|
14
|
+
async function loadCircleShape(engine, refresh = true) {
|
|
15
|
+
await engine.addShape("circle", new CircleDrawer_1.CircleDrawer(), refresh);
|
|
16
16
|
}
|
|
17
17
|
exports.loadCircleShape = loadCircleShape;
|
|
18
18
|
});
|