@tsparticles/shape-arrow 3.0.0-beta.2 → 3.0.0-beta.4
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/browser/ArrowDrawer.js +2 -2
- package/cjs/ArrowDrawer.js +2 -2
- package/esm/ArrowDrawer.js +2 -2
- package/package.json +3 -3
- package/report.html +4 -22
- package/tsparticles.shape.arrow.js +8 -3
- package/tsparticles.shape.arrow.min.js +1 -1
- package/tsparticles.shape.arrow.min.js.LICENSE.txt +1 -1
- package/types/ArrowDrawer.d.ts +3 -3
- package/umd/ArrowDrawer.js +2 -2
|
@@ -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-beta.
|
|
7
|
+
* v3.0.0-beta.4
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -99,8 +99,13 @@ var engine_root_window_ = __webpack_require__(533);
|
|
|
99
99
|
;// CONCATENATED MODULE: ./dist/browser/ArrowDrawer.js
|
|
100
100
|
|
|
101
101
|
class ArrowDrawer {
|
|
102
|
-
draw(
|
|
103
|
-
const
|
|
102
|
+
draw(data) {
|
|
103
|
+
const {
|
|
104
|
+
context,
|
|
105
|
+
particle,
|
|
106
|
+
radius
|
|
107
|
+
} = data,
|
|
108
|
+
width = radius * 2,
|
|
104
109
|
heightFactor = particle.heightFactor ?? 0.5,
|
|
105
110
|
headWidthFactor = particle.headWidthFactor ?? 0.2,
|
|
106
111
|
bodyHeightFactor = particle.bodyHeightFactor ?? 0.5,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.shape.arrow.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 o="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(this,(e=>(()=>{"use strict";var t={533:t=>{t.exports=e}},o={};function r(e){var a=o[e];if(void 0!==a)return a.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{r.r(a),r.d(a,{loadArrowShape:()=>o});var e=r(533);class t{draw(e
|
|
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 o="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(this,(e=>(()=>{"use strict";var t={533:t=>{t.exports=e}},o={};function r(e){var a=o[e];if(void 0!==a)return a.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{r.r(a),r.d(a,{loadArrowShape:()=>o});var e=r(533);class t{draw(e){const{context:t,particle:o,radius:r}=e,a=2*r,i=a*(o.heightFactor??.5),n=a*(o.headWidthFactor??.2),c=i*(o.bodyHeightFactor??.5);t.moveTo(-a/2,0),t.lineTo(-a/2,-c/2),t.lineTo(a/2-n,-c/2),t.lineTo(a/2-n,-i/2),t.lineTo(a/2+n,0),t.lineTo(a/2-n,i/2),t.lineTo(a/2-n,c/2),t.lineTo(-a/2,c/2),t.lineTo(-a/2,0)}particleInit(t,o){const r=o.shapeData;o.heightFactor=(0,e.getRangeValue)(r?.heightFactor??.5),o.headWidthFactor=(0,e.getRangeValue)(r?.headWidthFactor??.2),o.bodyHeightFactor=(0,e.getRangeValue)(r?.bodyHeightFactor??.5)}}async function o(e,o=!0){await e.addShape("arrow",new t,o)}})(),a})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Arrow Shape v3.0.0-beta.
|
|
1
|
+
/*! tsParticles Arrow Shape v3.0.0-beta.4 by Matteo Bruni */
|
package/types/ArrowDrawer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Container, type IShapeDrawer } from "@tsparticles/engine";
|
|
1
|
+
import { type Container, type IShapeDrawData, type IShapeDrawer } from "@tsparticles/engine";
|
|
2
2
|
import type { ArrowParticle } from "./ArrowParticle.js";
|
|
3
|
-
export declare class ArrowDrawer implements IShapeDrawer {
|
|
4
|
-
draw(
|
|
3
|
+
export declare class ArrowDrawer implements IShapeDrawer<ArrowParticle> {
|
|
4
|
+
draw(data: IShapeDrawData<ArrowParticle>): void;
|
|
5
5
|
particleInit(container: Container, particle: ArrowParticle): void;
|
|
6
6
|
}
|
package/umd/ArrowDrawer.js
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
exports.ArrowDrawer = void 0;
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
14
|
class ArrowDrawer {
|
|
15
|
-
draw(
|
|
16
|
-
const width = radius * 2, heightFactor = particle.heightFactor ?? 0.5, headWidthFactor = particle.headWidthFactor ?? 0.2, bodyHeightFactor = particle.bodyHeightFactor ?? 0.5, height = width * heightFactor, headWidth = width * headWidthFactor, bodyHeight = height * bodyHeightFactor;
|
|
15
|
+
draw(data) {
|
|
16
|
+
const { context, particle, radius } = data, width = radius * 2, heightFactor = particle.heightFactor ?? 0.5, headWidthFactor = particle.headWidthFactor ?? 0.2, bodyHeightFactor = particle.bodyHeightFactor ?? 0.5, height = width * heightFactor, headWidth = width * headWidthFactor, bodyHeight = height * bodyHeightFactor;
|
|
17
17
|
context.moveTo(-width / 2, 0);
|
|
18
18
|
context.lineTo(-width / 2, -bodyHeight / 2);
|
|
19
19
|
context.lineTo(width / 2 - headWidth, -bodyHeight / 2);
|