@tsparticles/shape-path 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.
@@ -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
- * v3.0.0-alpha.0
7
+ * v3.0.0-beta.0
8
8
  */
9
9
  (function webpackUniversalModuleDefinition(root, factory) {
10
10
  if(typeof exports === 'object' && typeof module === 'object')
@@ -91,7 +91,7 @@ __webpack_require__.r(__webpack_exports__);
91
91
 
92
92
  // EXPORTS
93
93
  __webpack_require__.d(__webpack_exports__, {
94
- "loadPathShape": () => (/* binding */ loadPathShape)
94
+ loadPathShape: () => (/* binding */ loadPathShape)
95
95
  });
96
96
 
97
97
  // EXTERNAL MODULE: external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"}
@@ -156,8 +156,8 @@ class PathDrawer {
156
156
  }
157
157
  ;// CONCATENATED MODULE: ./dist/browser/index.js
158
158
 
159
- async function loadPathShape(engine) {
160
- await engine.addShape("path", new PathDrawer());
159
+ async function loadPathShape(engine, refresh = true) {
160
+ await engine.addShape("path", new PathDrawer(), refresh);
161
161
  }
162
162
  })();
163
163
 
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see tsparticles.shape.path.min.js.LICENSE.txt */
2
- !function(e,a){if("object"==typeof exports&&"object"==typeof module)module.exports=a(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],a);else{var s="object"==typeof exports?a(require("@tsparticles/engine")):a(e.window);for(var t in s)("object"==typeof exports?exports:e)[t]=s[t]}}(this,(e=>(()=>{"use strict";var a={533:a=>{a.exports=e}},s={};function t(e){var r=s[e];if(void 0!==r)return r.exports;var l=s[e]={exports:{}};return a[e](l,l.exports,t),l.exports}t.d=(e,a)=>{for(var s in a)t.o(a,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:a[s]})},t.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{t.r(r),t.d(r,{loadPathShape:()=>s});var e=t(533);class a{draw(e,a,s){a.pathData&&function(e,a,s){e.moveTo(s.segments[0].values[0].x*a,s.segments[0].values[0].y*a);for(let t=0;t<s.segments.length;t++){const r=s.segments[t];switch(r.type){case"line":e.lineTo(r.values[0].x*a,r.values[0].y*a);break;case"bezier":e.bezierCurveTo(r.values[1].x*a,r.values[1].y*a,r.values[2].x*a,r.values[2].y*a,r.values[3].x*a,r.values[3].y*a);break;case"quadratic":e.quadraticCurveTo(r.values[1].x*a,r.values[1].y*a,r.values[2].x*a,r.values[2].y*a);break;case"arc":e.arc(r.values[0].x*a,r.values[0].y*a,r.values[1].x*a,r.values[2].x,r.values[2].y);break;case"ellipse":e.ellipse(r.values[0].x*a,r.values[0].y*a,r.values[1].x*a,r.values[1].y*a,r.values[2].x,r.values[3].x,r.values[3].y)}}if(s.half)for(let t=s.segments.length-1;t>=0;t--){const r=s.segments[t];switch(r.type){case"line":e.lineTo(r.values[0].x*-a,r.values[0].y*a);break;case"bezier":e.bezierCurveTo(-r.values[2].x*a,r.values[2].y*a,-r.values[1].x*a,r.values[1].y*a,-r.values[0].x*a,r.values[0].y*a);break;case"quadratic":e.quadraticCurveTo(-r.values[1].x*a,r.values[1].y*a,-r.values[2].x*a,r.values[2].y*a)}}}(e,s,a.pathData)}particleInit(a,s){const t=s.shapeData;t&&(s.pathData=(0,e.deepExtend)({},t))}}async function s(e){await e.addShape("path",new a)}})(),r})()));
2
+ !function(e,a){if("object"==typeof exports&&"object"==typeof module)module.exports=a(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],a);else{var s="object"==typeof exports?a(require("@tsparticles/engine")):a(e.window);for(var t in s)("object"==typeof exports?exports:e)[t]=s[t]}}(this,(e=>(()=>{"use strict";var a={533:a=>{a.exports=e}},s={};function t(e){var r=s[e];if(void 0!==r)return r.exports;var l=s[e]={exports:{}};return a[e](l,l.exports,t),l.exports}t.d=(e,a)=>{for(var s in a)t.o(a,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:a[s]})},t.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{t.r(r),t.d(r,{loadPathShape:()=>s});var e=t(533);class a{draw(e,a,s){a.pathData&&function(e,a,s){e.moveTo(s.segments[0].values[0].x*a,s.segments[0].values[0].y*a);for(let t=0;t<s.segments.length;t++){const r=s.segments[t];switch(r.type){case"line":e.lineTo(r.values[0].x*a,r.values[0].y*a);break;case"bezier":e.bezierCurveTo(r.values[1].x*a,r.values[1].y*a,r.values[2].x*a,r.values[2].y*a,r.values[3].x*a,r.values[3].y*a);break;case"quadratic":e.quadraticCurveTo(r.values[1].x*a,r.values[1].y*a,r.values[2].x*a,r.values[2].y*a);break;case"arc":e.arc(r.values[0].x*a,r.values[0].y*a,r.values[1].x*a,r.values[2].x,r.values[2].y);break;case"ellipse":e.ellipse(r.values[0].x*a,r.values[0].y*a,r.values[1].x*a,r.values[1].y*a,r.values[2].x,r.values[3].x,r.values[3].y)}}if(s.half)for(let t=s.segments.length-1;t>=0;t--){const r=s.segments[t];switch(r.type){case"line":e.lineTo(r.values[0].x*-a,r.values[0].y*a);break;case"bezier":e.bezierCurveTo(-r.values[2].x*a,r.values[2].y*a,-r.values[1].x*a,r.values[1].y*a,-r.values[0].x*a,r.values[0].y*a);break;case"quadratic":e.quadraticCurveTo(-r.values[1].x*a,r.values[1].y*a,-r.values[2].x*a,r.values[2].y*a)}}}(e,s,a.pathData)}particleInit(a,s){const t=s.shapeData;t&&(s.pathData=(0,e.deepExtend)({},t))}}async function s(e,s=!0){await e.addShape("path",new a,s)}})(),r})()));
@@ -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 Path Shape v3.0.0-beta.0 by Matteo Bruni */
@@ -1,4 +1,4 @@
1
- import type { Container, IShapeDrawer } from "@tsparticles/engine";
1
+ import { type Container, type IShapeDrawer } from "@tsparticles/engine";
2
2
  import type { PathParticle } from "./PathParticle";
3
3
  export declare class PathDrawer implements IShapeDrawer {
4
4
  draw(context: CanvasRenderingContext2D, particle: PathParticle, 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 loadPathShape(engine: Engine): Promise<void>;
2
+ export declare function loadPathShape(engine: Engine, refresh?: boolean): Promise<void>;
package/umd/index.js CHANGED
@@ -11,8 +11,8 @@
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.loadPathShape = void 0;
13
13
  const PathDrawer_1 = require("./PathDrawer");
14
- async function loadPathShape(engine) {
15
- await engine.addShape("path", new PathDrawer_1.PathDrawer());
14
+ async function loadPathShape(engine, refresh = true) {
15
+ await engine.addShape("path", new PathDrawer_1.PathDrawer(), refresh);
16
16
  }
17
17
  exports.loadPathShape = loadPathShape;
18
18
  });