@tsparticles/shape-circle 4.0.0-alpha.2 → 4.0.0-alpha.21

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.
@@ -4,7 +4,7 @@
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
- * v4.0.0-alpha.2
7
+ * v4.0.0-alpha.21
8
8
  */
9
9
  /*
10
10
  * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
@@ -28,16 +28,6 @@ return /******/ (() => { // webpackBootstrap
28
28
  /******/ "use strict";
29
29
  /******/ var __webpack_modules__ = ({
30
30
 
31
- /***/ "./dist/browser/index.js"
32
- /*!*******************************!*\
33
- !*** ./dist/browser/index.js ***!
34
- \*******************************/
35
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
36
-
37
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadCircleShape: () => (/* binding */ loadCircleShape)\n/* harmony export */ });\nfunction loadCircleShape(engine) {\n engine.checkVersion(\"4.0.0-alpha.2\");\n engine.register(async e => {\n const {\n CircleDrawer\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_CircleDrawer_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./CircleDrawer.js */ \"./dist/browser/CircleDrawer.js\"));\n e.addShape(new CircleDrawer());\n });\n}\n\n//# sourceURL=webpack://@tsparticles/shape-circle/./dist/browser/index.js?\n}");
38
-
39
- /***/ },
40
-
41
31
  /***/ "@tsparticles/engine"
42
32
  /*!*********************************************************************************************************************************!*\
43
33
  !*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
@@ -46,6 +36,16 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
46
36
 
47
37
  module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
48
38
 
39
+ /***/ },
40
+
41
+ /***/ "./dist/browser/index.js"
42
+ /*!*******************************!*\
43
+ !*** ./dist/browser/index.js ***!
44
+ \*******************************/
45
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
46
+
47
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadCircleShape: () => (/* binding */ loadCircleShape)\n/* harmony export */ });\nasync function loadCircleShape(engine) {\n engine.checkVersion(\"4.0.0-alpha.21\");\n await engine.register((e)=>{\n e.addShape([\n \"circle\"\n ], async ()=>{\n const { CircleDrawer } = await __webpack_require__.e(/*! import() */ \"dist_browser_CircleDrawer_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./CircleDrawer.js */ \"./dist/browser/CircleDrawer.js\"));\n return new CircleDrawer();\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/shape-circle/./dist/browser/index.js?\n}");
48
+
49
49
  /***/ }
50
50
 
51
51
  /******/ });
@@ -1,2 +1,2 @@
1
- /*! For license information please see tsparticles.shape.circle.min.js.LICENSE.txt */
2
- !function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],r);else{var t="object"==typeof exports?r(require("@tsparticles/engine")):r(e.window);for(var o in t)("object"==typeof exports?exports:e)[o]=t[o]}}(this,(e=>(()=>{var r,t,o={303(r){r.exports=e}},i={};function n(e){var r=i[e];if(void 0!==r)return r.exports;var t=i[e]={exports:{}};return o[e](t,t.exports,n),t.exports}n.m=o,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+".min.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},t="@tsparticles/shape-circle:",n.l=(e,o,i,a)=>{if(r[e])r[e].push(o);else{var c,s;if(void 0!==i)for(var p=document.getElementsByTagName("script"),l=0;l<p.length;l++){var u=p[l];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==t+i){c=u;break}}c||(s=!0,(c=document.createElement("script")).charset="utf-8",n.nc&&c.setAttribute("nonce",n.nc),c.setAttribute("data-webpack",t+i),c.src=e),r[e]=[o];var d=(t,o)=>{c.onerror=c.onload=null,clearTimeout(f);var i=r[e];if(delete r[e],c.parentNode&&c.parentNode.removeChild(c),i&&i.forEach((e=>e(o))),t)return t(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=d.bind(null,c.onerror),c.onload=d.bind(null,c.onload),s&&document.head.appendChild(c)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var r=n.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var o=t.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=t[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={328:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise(((t,i)=>o=e[r]=[t,i]));t.push(o[2]=i);var a=n.p+n.u(r),c=new Error;n.l(a,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var i=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;c.message="Loading chunk "+r+" failed.\n("+i+": "+a+")",c.name="ChunkLoadError",c.type=i,c.request=a,o[1](c)}}),"chunk-"+r,r)}};var r=(r,t)=>{var o,i,[a,c,s]=t,p=0;if(a.some((r=>0!==e[r]))){for(o in c)n.o(c,o)&&(n.m[o]=c[o]);if(s)s(n)}for(r&&r(t);p<a.length;p++)i=a[p],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0},t=this.webpackChunk_tsparticles_shape_circle=this.webpackChunk_tsparticles_shape_circle||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var a={};function c(e){e.checkVersion("4.0.0-alpha.2"),e.register((async e=>{const{CircleDrawer:r}=await n.e(385).then(n.bind(n,385));e.addShape(new r)}))}return n.r(a),n.d(a,{loadCircleShape:()=>c}),a})()));
1
+ !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 o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,e=>(()=>{"use strict";var t,r,o,i={303(t){t.exports=e}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return i[e](r,r.exports,a),r.exports}a.m=i,a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,r)=>(a.f[r](e,t),t),[])),a.u=e=>""+e+".min.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c={},a.l=(e,t,r,o)=>{if(c[e])return void c[e].push(t);if(void 0!==r)for(var i,n,s=document.getElementsByTagName("script"),p=0;p<s.length;p++){var l=s[p];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")=="@tsparticles/shape-circle:"+r){i=l;break}}i||(n=!0,(i=document.createElement("script")).charset="utf-8",a.nc&&i.setAttribute("nonce",a.nc),i.setAttribute("data-webpack","@tsparticles/shape-circle:"+r),i.src=e),c[e]=[t];var u=(t,r)=>{i.onerror=i.onload=null,clearTimeout(d);var o=c[e];if(delete c[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(e=>e(r)),t)return t(r)},d=setTimeout(u.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=u.bind(null,i.onerror),i.onload=u.bind(null,i.onload),n&&document.head.appendChild(i)},a.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.g.importScripts&&(s=a.g.location+"");var c,s,p=a.g.document;if(!s&&p&&(p.currentScript&&"SCRIPT"===p.currentScript.tagName.toUpperCase()&&(s=p.currentScript.src),!s)){var l=p.getElementsByTagName("script");if(l.length)for(var u=l.length-1;u>-1&&(!s||!/^http(s?):/.test(s));)s=l[u--].src}if(!s)throw Error("Automatic publicPath is not supported in this browser");a.p=s=s.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t={328:0},a.f.j=(e,r)=>{var o=a.o(t,e)?t[e]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise((r,i)=>o=t[e]=[r,i]);r.push(o[2]=i);var n=a.p+a.u(e),c=Error();a.l(n,r=>{if(a.o(t,e)&&(0!==(o=t[e])&&(t[e]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;c.message="Loading chunk "+e+` failed.
2
+ (`+i+": "+n+")",c.name="ChunkLoadError",c.type=i,c.request=n,o[1](c)}},"chunk-"+e,e)}},r=(e,r)=>{var o,i,[n,c,s]=r,p=0;if(n.some(e=>0!==t[e])){for(o in c)a.o(c,o)&&(a.m[o]=c[o]);s&&s(a)}for(e&&e(r);p<n.length;p++)i=n[p],a.o(t,i)&&t[i]&&t[i][0](),t[i]=0},(o=this.webpackChunk_tsparticles_shape_circle=this.webpackChunk_tsparticles_shape_circle||[]).forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o));var d={};async function f(e){e.checkVersion("4.0.0-alpha.21"),await e.register(e=>{e.addShape(["circle"],async()=>{let{CircleDrawer:e}=await a.e(210).then(a.bind(a,210));return new e})})}return a.r(d),a.d(d,{loadCircleShape:()=>f}),d})());
@@ -1,7 +1,6 @@
1
1
  import { type Container, type IShapeDrawData, type IShapeDrawer } from "@tsparticles/engine";
2
2
  import type { CircleParticle } from "./CircleParticle.js";
3
3
  export declare class CircleDrawer implements IShapeDrawer<CircleParticle> {
4
- readonly validTypes: readonly ["circle"];
5
4
  draw(data: IShapeDrawData<CircleParticle>): void;
6
5
  getSidesCount(): number;
7
6
  particleInit(_container: Container, particle: CircleParticle): void;
package/types/Utils.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { IShapeDrawData } from "@tsparticles/engine";
1
+ import { type IShapeDrawData } from "@tsparticles/engine";
2
2
  import type { CircleParticle } from "./CircleParticle.js";
3
3
  export declare function drawCircle(data: IShapeDrawData<CircleParticle>): 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): void;
2
+ export declare function loadCircleShape(engine: Engine): Promise<void>;
@@ -14,9 +14,6 @@
14
14
  const Utils_js_1 = require("./Utils.js");
15
15
  const sides = 12, maxAngle = 360, minAngle = 0;
16
16
  class CircleDrawer {
17
- constructor() {
18
- this.validTypes = ["circle"];
19
- }
20
17
  draw(data) {
21
18
  (0, Utils_js_1.drawCircle)(data);
22
19
  }
package/umd/Utils.js CHANGED
@@ -4,17 +4,18 @@
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.drawCircle = drawCircle;
13
- const double = 2, doublePI = Math.PI * double, minAngle = 0, origin = { x: 0, y: 0 };
13
+ const engine_1 = require("@tsparticles/engine");
14
+ const minAngle = 0;
14
15
  function drawCircle(data) {
15
16
  const { context, particle, radius } = data;
16
- particle.circleRange ??= { min: minAngle, max: doublePI };
17
+ particle.circleRange ??= { min: minAngle, max: engine_1.doublePI };
17
18
  const circleRange = particle.circleRange;
18
- context.arc(origin.x, origin.y, radius, circleRange.min, circleRange.max, false);
19
+ context.arc(engine_1.originPoint.x, engine_1.originPoint.y, radius, circleRange.min, circleRange.max, false);
19
20
  }
20
21
  });
package/umd/index.js CHANGED
@@ -44,11 +44,13 @@ var __importStar = (this && this.__importStar) || (function () {
44
44
  var __syncRequire = typeof module === "object" && typeof module.exports === "object";
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
46
  exports.loadCircleShape = loadCircleShape;
47
- function loadCircleShape(engine) {
48
- engine.checkVersion("4.0.0-alpha.2");
49
- engine.register(async (e) => {
50
- const { CircleDrawer } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./CircleDrawer.js"))) : new Promise((resolve_1, reject_1) => { require(["./CircleDrawer.js"], resolve_1, reject_1); }).then(__importStar));
51
- e.addShape(new CircleDrawer());
47
+ async function loadCircleShape(engine) {
48
+ engine.checkVersion("4.0.0-alpha.21");
49
+ await engine.register(e => {
50
+ e.addShape(["circle"], async () => {
51
+ const { CircleDrawer } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./CircleDrawer.js"))) : new Promise((resolve_1, reject_1) => { require(["./CircleDrawer.js"], resolve_1, reject_1); }).then(__importStar));
52
+ return new CircleDrawer();
53
+ });
52
54
  });
53
55
  }
54
56
  });
package/385.min.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 385.min.js.LICENSE.txt */
2
- (this.webpackChunk_tsparticles_shape_circle=this.webpackChunk_tsparticles_shape_circle||[]).push([[385],{385(a,c,e){e.d(c,{CircleDrawer:()=>r});var i=e(303);const t=2*Math.PI,n=0,s=0;class r{constructor(){this.validTypes=["circle"]}draw(a){!function(a){const{context:c,particle:e,radius:i}=a;e.circleRange??={min:0,max:t};const r=e.circleRange;c.arc(n,s,i,r.min,r.max,!1)}(a)}getSidesCount(){return 12}particleInit(a,c){const e=c.shapeData,t=e?.angle??{max:360,min:0};c.circleRange=(0,i.isObject)(t)?{min:(0,i.degToRad)(t.min),max:(0,i.degToRad)(t.max)}:{min:0,max:(0,i.degToRad)(t)}}}}}]);
@@ -1 +0,0 @@
1
- /*! tsParticles Circle Shape v4.0.0-alpha.2 by Matteo Bruni */
@@ -1 +0,0 @@
1
- /*! tsParticles Circle Shape v4.0.0-alpha.2 by Matteo Bruni */