@tsparticles/shape-text
Advanced tools
Comparing version 3.6.0 to 3.7.0
@@ -0,4 +1,6 @@ | ||
import { assertValidVersion } from "@tsparticles/engine"; | ||
import { TextDrawer } from "./TextDrawer.js"; | ||
export async function loadTextShape(engine, refresh = true) { | ||
assertValidVersion(engine, "3.7.0"); | ||
await engine.addShape(new TextDrawer(), refresh); | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.loadTextShape = loadTextShape; | ||
const engine_1 = require("@tsparticles/engine"); | ||
const TextDrawer_js_1 = require("./TextDrawer.js"); | ||
async function loadTextShape(engine, refresh = true) { | ||
(0, engine_1.assertValidVersion)(engine, "3.7.0"); | ||
await engine.addShape(new TextDrawer_js_1.TextDrawer(), refresh); | ||
} |
@@ -0,4 +1,6 @@ | ||
import { assertValidVersion } from "@tsparticles/engine"; | ||
import { TextDrawer } from "./TextDrawer.js"; | ||
export async function loadTextShape(engine, refresh = true) { | ||
assertValidVersion(engine, "3.7.0"); | ||
await engine.addShape(new TextDrawer(), refresh); | ||
} |
{ | ||
"name": "@tsparticles/shape-text", | ||
"version": "3.6.0", | ||
"version": "3.7.0", | ||
"description": "tsParticles text shape", | ||
@@ -62,3 +62,3 @@ "homepage": "https://particles.js.org", | ||
"dependencies": { | ||
"@tsparticles/engine": "^3.6.0" | ||
"@tsparticles/engine": "3.7.0" | ||
}, | ||
@@ -65,0 +65,0 @@ "publishConfig": { |
@@ -7,3 +7,3 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v3.6.0 | ||
* v3.7.0 | ||
*/ | ||
@@ -58,3 +58,3 @@ /* | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadTextShape: () => (/* binding */ loadTextShape)\n/* harmony export */ });\n/* harmony import */ var _TextDrawer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TextDrawer.js */ \"./dist/browser/TextDrawer.js\");\n\nasync function loadTextShape(engine, refresh = true) {\n await engine.addShape(new _TextDrawer_js__WEBPACK_IMPORTED_MODULE_0__.TextDrawer(), refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/shape-text/./dist/browser/index.js?"); | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadTextShape: () => (/* binding */ loadTextShape)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _TextDrawer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TextDrawer.js */ \"./dist/browser/TextDrawer.js\");\n\n\nasync function loadTextShape(engine, refresh = true) {\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.assertValidVersion)(engine, \"3.7.0\");\n await engine.addShape(new _TextDrawer_js__WEBPACK_IMPORTED_MODULE_1__.TextDrawer(), refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/shape-text/./dist/browser/index.js?"); | ||
@@ -61,0 +61,0 @@ /***/ }), |
/*! For license information please see tsparticles.shape.text.min.js.LICENSE.txt */ | ||
!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 i in o)("object"==typeof exports?exports:e)[i]=o[i]}}(this,(e=>(()=>{var t={303:t=>{t.exports=e}},o={};function i(e){var n=o[e];if(void 0!==n)return n.exports;var r=o[e]={exports:{}};return t[e](r,r.exports,i),r.exports}i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};i.r(n),i.d(n,{loadTextShape:()=>c});var r=i(303);const a=2,s=.5;function l(e,t,o,i,n,r){const l={x:-(t.length*o*s),y:o*s},p=o*a;r?e.fillText(t,l.x,l.y+p*n):e.strokeText(t,l.x,l.y+p*n)}class p{constructor(){this.validTypes=["text","character","char","multiline-text"]}draw(e){!function(e){const{context:t,particle:o,radius:i,opacity:n}=e,s=o.shapeData;if(!s)return;const p=s.value;if(void 0===p)return;void 0===o.text&&(o.text=(0,r.itemFromSingleOrMultiple)(p,o.randomIndexData));const c=o.text,d=s.style??"",f=s.weight??"400",u=Math.round(i)*a,x=s.font??"Verdana",y=o.shapeFill,h=c?.split("\n");if(h){t.font=`${d} ${f} ${u}px "${x}"`,t.globalAlpha=n;for(let e=0;e<h.length;e++)l(t,h[e],i,0,e,y);t.globalAlpha=1}}(e)}async init(e){const t=e.actualOptions,{validTypes:o}=this;if(o.find((e=>(0,r.isInArray)(e,t.particles.shape.type)))){const e=o.map((e=>t.particles.shape.options[e])).find((e=>!!e)),i=[];(0,r.executeOnSingleOrMultiple)(e,(e=>{i.push((0,r.loadFont)(e.font,e.weight))})),await Promise.all(i)}}particleInit(e,t){if(!t.shape||!this.validTypes.includes(t.shape))return;const o=t.shapeData;if(void 0===o)return;const i=o.value;void 0!==i&&(t.text=(0,r.itemFromSingleOrMultiple)(i,t.randomIndexData))}}async function c(e,t=!0){await e.addShape(new p,t)}return n})())); | ||
!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 i in o)("object"==typeof exports?exports:e)[i]=o[i]}}(this,(e=>(()=>{var t={303:t=>{t.exports=e}},o={};function i(e){var r=o[e];if(void 0!==r)return r.exports;var n=o[e]={exports:{}};return t[e](n,n.exports,i),n.exports}i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};i.r(r),i.d(r,{loadTextShape:()=>c});var n=i(303);const a=2,s=.5;function l(e,t,o,i,r,n){const l={x:-(t.length*o*s),y:o*s},p=o*a;n?e.fillText(t,l.x,l.y+p*r):e.strokeText(t,l.x,l.y+p*r)}class p{constructor(){this.validTypes=["text","character","char","multiline-text"]}draw(e){!function(e){const{context:t,particle:o,radius:i,opacity:r}=e,s=o.shapeData;if(!s)return;const p=s.value;if(void 0===p)return;void 0===o.text&&(o.text=(0,n.itemFromSingleOrMultiple)(p,o.randomIndexData));const c=o.text,d=s.style??"",f=s.weight??"400",u=Math.round(i)*a,x=s.font??"Verdana",y=o.shapeFill,h=c?.split("\n");if(h){t.font=`${d} ${f} ${u}px "${x}"`,t.globalAlpha=r;for(let e=0;e<h.length;e++)l(t,h[e],i,0,e,y);t.globalAlpha=1}}(e)}async init(e){const t=e.actualOptions,{validTypes:o}=this;if(o.find((e=>(0,n.isInArray)(e,t.particles.shape.type)))){const e=o.map((e=>t.particles.shape.options[e])).find((e=>!!e)),i=[];(0,n.executeOnSingleOrMultiple)(e,(e=>{i.push((0,n.loadFont)(e.font,e.weight))})),await Promise.all(i)}}particleInit(e,t){if(!t.shape||!this.validTypes.includes(t.shape))return;const o=t.shapeData;if(void 0===o)return;const i=o.value;void 0!==i&&(t.text=(0,n.itemFromSingleOrMultiple)(i,t.randomIndexData))}}async function c(e,t=!0){(0,n.assertValidVersion)(e,"3.7.0"),await e.addShape(new p,t)}return r})())); |
@@ -1,1 +0,1 @@ | ||
/*! tsParticles Text Shape v3.6.0 by Matteo Bruni */ | ||
/*! tsParticles Text Shape v3.7.0 by Matteo Bruni */ |
@@ -1,2 +0,2 @@ | ||
import type { Engine } from "@tsparticles/engine"; | ||
import { type Engine } from "@tsparticles/engine"; | ||
export declare function loadTextShape(engine: Engine, refresh?: boolean): Promise<void>; |
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "./TextDrawer.js"], factory); | ||
define(["require", "exports", "@tsparticles/engine", "./TextDrawer.js"], factory); | ||
} | ||
@@ -14,6 +14,8 @@ })(function (require, exports) { | ||
exports.loadTextShape = loadTextShape; | ||
const engine_1 = require("@tsparticles/engine"); | ||
const TextDrawer_js_1 = require("./TextDrawer.js"); | ||
async function loadTextShape(engine, refresh = true) { | ||
(0, engine_1.assertValidVersion)(engine, "3.7.0"); | ||
await engine.addShape(new TextDrawer_js_1.TextDrawer(), refresh); | ||
} | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
308938
577
+ Added@tsparticles/engine@3.7.0(transitive)
- Removed@tsparticles/engine@3.7.1(transitive)
Updated@tsparticles/engine@3.7.0