@tsparticles/shape-rounded-rect 4.0.0-alpha.2 → 4.0.0-alpha.20

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.20
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 */ loadRoundedRectShape: () => (/* binding */ loadRoundedRectShape)\n/* harmony export */ });\nfunction loadRoundedRectShape(engine) {\n engine.checkVersion(\"4.0.0-alpha.2\");\n engine.register(async e => {\n const {\n RoundedRectDrawer\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_RoundedRectDrawer_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./RoundedRectDrawer.js */ \"./dist/browser/RoundedRectDrawer.js\"));\n e.addShape(new RoundedRectDrawer());\n });\n}\n\n//# sourceURL=webpack://@tsparticles/shape-rounded-rect/./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 */ loadRoundedRectShape: () => (/* binding */ loadRoundedRectShape)\n/* harmony export */ });\nasync function loadRoundedRectShape(engine) {\n engine.checkVersion(\"4.0.0-alpha.20\");\n await engine.register((e)=>{\n e.addShape([\n \"rounded-rect\"\n ], async ()=>{\n const { RoundedRectDrawer } = await __webpack_require__.e(/*! import() */ \"dist_browser_RoundedRectDrawer_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./RoundedRectDrawer.js */ \"./dist/browser/RoundedRectDrawer.js\"));\n return new RoundedRectDrawer();\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/shape-rounded-rect/./dist/browser/index.js?\n}");
48
+
49
49
  /***/ }
50
50
 
51
51
  /******/ });
@@ -1,2 +1,2 @@
1
- /*! For license information please see tsparticles.shape.rounded-rect.min.js.LICENSE.txt */
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 o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e=>(()=>{var t,r,o={303(t){t.exports=e}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e](r,r.exports,i),r.exports}i.m=o,i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>e+".min.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@tsparticles/shape-rounded-rect:",i.l=(e,o,n,a)=>{if(t[e])t[e].push(o);else{var s,c;if(void 0!==n)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")==r+n){s=u;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",i.nc&&s.setAttribute("nonce",i.nc),s.setAttribute("data-webpack",r+n),s.src=e),t[e]=[o];var d=(r,o)=>{s.onerror=s.onload=null,clearTimeout(f);var n=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=d.bind(null,s.onerror),s.onload=d.bind(null,s.onload),c&&document.head.appendChild(s)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={314:0};i.f.j=(t,r)=>{var o=i.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var a=i.p+i.u(t),s=new Error;i.l(a,(r=>{if(i.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+n+": "+a+")",s.name="ChunkLoadError",s.type=n,s.request=a,o[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,n,[a,s,c]=r,p=0;if(a.some((t=>0!==e[t]))){for(o in s)i.o(s,o)&&(i.m[o]=s[o]);if(c)c(i)}for(t&&t(r);p<a.length;p++)n=a[p],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0},r=this.webpackChunk_tsparticles_shape_rounded_rect=this.webpackChunk_tsparticles_shape_rounded_rect||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a={};function s(e){e.checkVersion("4.0.0-alpha.2"),e.register((async e=>{const{RoundedRectDrawer:t}=await i.e(404).then(i.bind(i,404));e.addShape(new t)}))}return i.r(a),i.d(a,{loadRoundedRectShape:()=>s}),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,n={303(t){t.exports=e}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return n[e](r,r.exports,a),r.exports}a.m=n,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),s={},a.l=(e,t,r,o)=>{if(s[e])return void s[e].push(t);if(void 0!==r)for(var n,i,c=document.getElementsByTagName("script"),p=0;p<c.length;p++){var u=c[p];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")=="@tsparticles/shape-rounded-rect:"+r){n=u;break}}n||(i=!0,(n=document.createElement("script")).charset="utf-8",a.nc&&n.setAttribute("nonce",a.nc),n.setAttribute("data-webpack","@tsparticles/shape-rounded-rect:"+r),n.src=e),s[e]=[t];var l=(t,r)=>{n.onerror=n.onload=null,clearTimeout(d);var o=s[e];if(delete s[e],n.parentNode&&n.parentNode.removeChild(n),o&&o.forEach(e=>e(r)),t)return t(r)},d=setTimeout(l.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=l.bind(null,n.onerror),n.onload=l.bind(null,n.onload),i&&document.head.appendChild(n)},a.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.g.importScripts&&(c=a.g.location+"");var s,c,p=a.g.document;if(!c&&p&&(p.currentScript&&"SCRIPT"===p.currentScript.tagName.toUpperCase()&&(c=p.currentScript.src),!c)){var u=p.getElementsByTagName("script");if(u.length)for(var l=u.length-1;l>-1&&(!c||!/^http(s?):/.test(c));)c=u[l--].src}if(!c)throw Error("Automatic publicPath is not supported in this browser");a.p=c=c.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t={314: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 n=new Promise((r,n)=>o=t[e]=[r,n]);r.push(o[2]=n);var i=a.p+a.u(e),s=Error();a.l(i,r=>{if(a.o(t,e)&&(0!==(o=t[e])&&(t[e]=void 0),o)){var n=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;s.message="Loading chunk "+e+` failed.
2
+ (`+n+": "+i+")",s.name="ChunkLoadError",s.type=n,s.request=i,o[1](s)}},"chunk-"+e,e)}},r=(e,r)=>{var o,n,[i,s,c]=r,p=0;if(i.some(e=>0!==t[e])){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);c&&c(a)}for(e&&e(r);p<i.length;p++)n=i[p],a.o(t,n)&&t[n]&&t[n][0](),t[n]=0},(o=this.webpackChunk_tsparticles_shape_rounded_rect=this.webpackChunk_tsparticles_shape_rounded_rect||[]).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.20"),await e.register(e=>{e.addShape(["rounded-rect"],async()=>{let{RoundedRectDrawer:e}=await a.e(430).then(a.bind(a,430));return new e})})}return a.r(d),a.d(d,{loadRoundedRectShape:()=>f}),d})());
@@ -1,7 +1,6 @@
1
1
  import { type Container, type IShapeDrawData, type IShapeDrawer } from "@tsparticles/engine";
2
2
  import type { RoundedParticle } from "./RoundedParticle.js";
3
3
  export declare class RoundedRectDrawer implements IShapeDrawer<RoundedParticle> {
4
- readonly validTypes: readonly ["rounded-rect"];
5
4
  draw(data: IShapeDrawData<RoundedParticle>): void;
6
5
  particleInit(container: Container, particle: RoundedParticle): void;
7
6
  }
package/types/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  import { type Engine } from "@tsparticles/engine";
2
- export declare function loadRoundedRectShape(engine: Engine): void;
2
+ export declare function loadRoundedRectShape(engine: Engine): Promise<void>;
@@ -12,13 +12,10 @@
12
12
  exports.RoundedRectDrawer = void 0;
13
13
  const engine_1 = require("@tsparticles/engine");
14
14
  const Utils_js_1 = require("./Utils.js");
15
- const fixFactorSquare = 2, fixFactor = Math.sqrt(fixFactorSquare), double = 2, defaultRadius = 5;
15
+ const fixFactorSquare = 2, fixFactor = Math.sqrt(fixFactorSquare), defaultRadius = 5;
16
16
  class RoundedRectDrawer {
17
- constructor() {
18
- this.validTypes = ["rounded-rect"];
19
- }
20
17
  draw(data) {
21
- const { context, particle, radius } = data, fixedRadius = radius / fixFactor, fixedDiameter = fixedRadius * double, borderRadius = particle.borderRadius ?? defaultRadius;
18
+ const { context, particle, radius } = data, fixedRadius = radius / fixFactor, fixedDiameter = fixedRadius * engine_1.double, borderRadius = particle.borderRadius ?? defaultRadius;
22
19
  if ("roundRect" in context) {
23
20
  context.roundRect(-fixedRadius, -fixedRadius, fixedDiameter, fixedDiameter, borderRadius);
24
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.loadRoundedRectShape = loadRoundedRectShape;
47
- function loadRoundedRectShape(engine) {
48
- engine.checkVersion("4.0.0-alpha.2");
49
- engine.register(async (e) => {
50
- const { RoundedRectDrawer } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./RoundedRectDrawer.js"))) : new Promise((resolve_1, reject_1) => { require(["./RoundedRectDrawer.js"], resolve_1, reject_1); }).then(__importStar));
51
- e.addShape(new RoundedRectDrawer());
47
+ async function loadRoundedRectShape(engine) {
48
+ engine.checkVersion("4.0.0-alpha.20");
49
+ await engine.register(e => {
50
+ e.addShape(["rounded-rect"], async () => {
51
+ const { RoundedRectDrawer } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./RoundedRectDrawer.js"))) : new Promise((resolve_1, reject_1) => { require(["./RoundedRectDrawer.js"], resolve_1, reject_1); }).then(__importStar));
52
+ return new RoundedRectDrawer();
53
+ });
52
54
  });
53
55
  }
54
56
  });
package/404.min.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 404.min.js.LICENSE.txt */
2
- (this.webpackChunk_tsparticles_shape_rounded_rect=this.webpackChunk_tsparticles_shape_rounded_rect||[]).push([[404],{404(e,t,r){r.d(t,{RoundedRectDrawer:()=>o});var a=r(303);const i=Math.sqrt(2);class o{constructor(){this.validTypes=["rounded-rect"]}draw(e){const{context:t,particle:r,radius:a}=e,o=a/i,c=2*o,d=r.borderRadius??5;"roundRect"in t?t.roundRect(-o,-o,c,c,d):function(e,t,r,a){const i={x:-t,y:-t,height:r,width:r},o=a,c=a,d=a,n=a,{x:s,y:u,width:h,height:l}=i,p=s+h,T=u+l;e.moveTo(s+o,u),e.lineTo(p-c,u),e.quadraticCurveTo(p,u,p,u+c),e.lineTo(p,u+l-n),e.quadraticCurveTo(p,T,p-n,T),e.lineTo(s+d,T),e.quadraticCurveTo(s,T,s,T-d),e.lineTo(s,u+o),e.quadraticCurveTo(s,u,s+o,u)}(t,o,c,d)}particleInit(e,t){const r=t.shapeData;t.borderRadius=(0,a.getRangeValue)(r?.radius??5)*e.retina.pixelRatio}}}}]);
@@ -1 +0,0 @@
1
- /*! tsParticles Rounded Rect Shape v4.0.0-alpha.2 by Matteo Bruni */
@@ -1 +0,0 @@
1
- /*! tsParticles Rounded Rect Shape v4.0.0-alpha.2 by Matteo Bruni */