@tsparticles/shape-spiral 4.0.0-alpha.1 → 4.0.0-alpha.15

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.1
7
+ * v4.0.0-alpha.15
8
8
  */
9
9
  /*
10
10
  * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
@@ -34,7 +34,7 @@ return /******/ (() => { // webpackBootstrap
34
34
  \*******************************/
35
35
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
36
36
 
37
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadSpiralShape: () => (/* binding */ loadSpiralShape)\n/* harmony export */ });\nfunction loadSpiralShape(engine) {\n engine.checkVersion(\"4.0.0-alpha.1\");\n engine.register(async e => {\n const {\n SpiralDrawer\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_SpiralDrawer_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./SpiralDrawer.js */ \"./dist/browser/SpiralDrawer.js\"));\n e.addShape(new SpiralDrawer());\n });\n}\n\n//# sourceURL=webpack://@tsparticles/shape-spiral/./dist/browser/index.js?\n}");
37
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadSpiralShape: () => (/* binding */ loadSpiralShape)\n/* harmony export */ });\nasync function loadSpiralShape(engine) {\n engine.checkVersion(\"4.0.0-alpha.15\");\n await engine.register((e)=>{\n e.addShape([\n \"spiral\"\n ], async ()=>{\n const { SpiralDrawer } = await __webpack_require__.e(/*! import() */ \"dist_browser_SpiralDrawer_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./SpiralDrawer.js */ \"./dist/browser/SpiralDrawer.js\"));\n return new SpiralDrawer();\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/shape-spiral/./dist/browser/index.js?\n}");
38
38
 
39
39
  /***/ },
40
40
 
@@ -1,2 +1,2 @@
1
- /*! For license information please see tsparticles.shape.spiral.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-spiral:",n.l=(e,o,i,a)=>{if(r[e])r[e].push(o);else{var s,p;if(void 0!==i)for(var l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var u=l[c];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==t+i){s=u;break}}s||(p=!0,(s=document.createElement("script")).charset="utf-8",n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",t+i),s.src=e),r[e]=[o];var d=(t,o)=>{s.onerror=s.onload=null,clearTimeout(f);var i=r[e];if(delete r[e],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((e=>e(o))),t)return t(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),p&&document.head.appendChild(s)}},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={291: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),s=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;s.message="Loading chunk "+r+" failed.\n("+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,o[1](s)}}),"chunk-"+r,r)}};var r=(r,t)=>{var o,i,[a,s,p]=t,l=0;if(a.some((r=>0!==e[r]))){for(o in s)n.o(s,o)&&(n.m[o]=s[o]);if(p)p(n)}for(r&&r(t);l<a.length;l++)i=a[l],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0},t=this.webpackChunk_tsparticles_shape_spiral=this.webpackChunk_tsparticles_shape_spiral||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var a={};function s(e){e.checkVersion("4.0.0-alpha.1"),e.register((async e=>{const{SpiralDrawer:r}=await n.e(536).then(n.bind(n,536));e.addShape(new r)}))}return n.r(a),n.d(a,{loadSpiralShape:()=>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,i={303(t){t.exports=e}},a={};function n(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return i[e](r,r.exports,n),r.exports}n.m=i,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.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((t,r)=>(n.f[r](e,t),t),[])),n.u=e=>""+e+".min.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s={},n.l=(e,t,r,o)=>{if(s[e])return void s[e].push(t);if(void 0!==r)for(var i,a,p=document.getElementsByTagName("script"),l=0;l<p.length;l++){var c=p[l];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")=="@tsparticles/shape-spiral:"+r){i=c;break}}i||(a=!0,(i=document.createElement("script")).charset="utf-8",n.nc&&i.setAttribute("nonce",n.nc),i.setAttribute("data-webpack","@tsparticles/shape-spiral:"+r),i.src=e),s[e]=[t];var u=(t,r)=>{i.onerror=i.onload=null,clearTimeout(d);var o=s[e];if(delete s[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),a&&document.head.appendChild(i)},n.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.g.importScripts&&(p=n.g.location+"");var s,p,l=n.g.document;if(!p&&l&&(l.currentScript&&"SCRIPT"===l.currentScript.tagName.toUpperCase()&&(p=l.currentScript.src),!p)){var c=l.getElementsByTagName("script");if(c.length)for(var u=c.length-1;u>-1&&(!p||!/^http(s?):/.test(p));)p=c[u--].src}if(!p)throw Error("Automatic publicPath is not supported in this browser");n.p=p=p.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t={291:0},n.f.j=(e,r)=>{var o=n.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 a=n.p+n.u(e),s=Error();n.l(a,r=>{if(n.o(t,e)&&(0!==(o=t[e])&&(t[e]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+e+` failed.
2
+ (`+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,o[1](s)}},"chunk-"+e,e)}},r=(e,r)=>{var o,i,[a,s,p]=r,l=0;if(a.some(e=>0!==t[e])){for(o in s)n.o(s,o)&&(n.m[o]=s[o]);p&&p(n)}for(e&&e(r);l<a.length;l++)i=a[l],n.o(t,i)&&t[i]&&t[i][0](),t[i]=0},(o=this.webpackChunk_tsparticles_shape_spiral=this.webpackChunk_tsparticles_shape_spiral||[]).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.15"),await e.register(e=>{e.addShape(["spiral"],async()=>{let{SpiralDrawer:e}=await n.e(930).then(n.bind(n,930));return new e})})}return n.r(d),n.d(d,{loadSpiralShape:()=>f}),d})());
@@ -1,7 +1,6 @@
1
1
  import { type Container, type IShapeDrawData, type IShapeDrawer } from "@tsparticles/engine";
2
2
  import type { SpiralParticle } from "./SpiralParticle.js";
3
3
  export declare class SpiralDrawer implements IShapeDrawer<SpiralParticle> {
4
- readonly validTypes: readonly ["spiral"];
5
4
  draw(data: IShapeDrawData<SpiralParticle>): void;
6
5
  particleInit(container: Container, particle: SpiralParticle): 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 loadSpiralShape(engine: Engine): void;
2
+ export declare function loadSpiralShape(engine: Engine): Promise<void>;
@@ -14,9 +14,6 @@
14
14
  const Utils_js_1 = require("./Utils.js");
15
15
  const defaultInnerRadius = 1, defaultLineSpacing = 1, defaultWidthFactor = 10;
16
16
  class SpiralDrawer {
17
- constructor() {
18
- this.validTypes = ["spiral"];
19
- }
20
17
  draw(data) {
21
18
  (0, Utils_js_1.drawSpiral)(data);
22
19
  }
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.loadSpiralShape = loadSpiralShape;
47
- function loadSpiralShape(engine) {
48
- engine.checkVersion("4.0.0-alpha.1");
49
- engine.register(async (e) => {
50
- const { SpiralDrawer } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./SpiralDrawer.js"))) : new Promise((resolve_1, reject_1) => { require(["./SpiralDrawer.js"], resolve_1, reject_1); }).then(__importStar));
51
- e.addShape(new SpiralDrawer());
47
+ async function loadSpiralShape(engine) {
48
+ engine.checkVersion("4.0.0-alpha.15");
49
+ await engine.register(e => {
50
+ e.addShape(["spiral"], async () => {
51
+ const { SpiralDrawer } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./SpiralDrawer.js"))) : new Promise((resolve_1, reject_1) => { require(["./SpiralDrawer.js"], resolve_1, reject_1); }).then(__importStar));
52
+ return new SpiralDrawer();
53
+ });
52
54
  });
53
55
  }
54
56
  });
package/536.min.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 536.min.js.LICENSE.txt */
2
- (this.webpackChunk_tsparticles_shape_spiral=this.webpackChunk_tsparticles_shape_spiral||[]).push([[536],{536(a,i,s){s.d(i,{SpiralDrawer:()=>r});var n=s(303);class r{constructor(){this.validTypes=["spiral"]}draw(a){!function(a){const{context:i,particle:s,radius:n}=a;if(void 0===s.spiralInnerRadius||void 0===s.spiralLineSpacing||void 0===s.spiralWidthFactor)return;const r=(n-s.spiralInnerRadius)/s.spiralLineSpacing;for(let a=0;a<10*r;a++){const n=a/10,r=s.spiralInnerRadius+s.spiralLineSpacing*n,e={x:r*Math.cos(n),y:r*Math.sin(n)};i.lineTo(e.x,e.y)}}(a)}particleInit(a,i){const s=a.retina.pixelRatio,r=i.shapeData;i.spiralInnerRadius=(0,n.getRangeValue)(r?.innerRadius??1)*s,i.spiralLineSpacing=(0,n.getRangeValue)(r?.lineSpacing??1)*s,i.spiralWidthFactor=(0,n.getRangeValue)(r?.widthFactor??10)}}}}]);
@@ -1 +0,0 @@
1
- /*! tsParticles Spiral Shape v4.0.0-alpha.1 by Matteo Bruni */
@@ -1 +0,0 @@
1
- /*! tsParticles Spiral Shape v4.0.0-alpha.1 by Matteo Bruni */