@tsparticles/shape-emoji
Advanced tools
Comparing version 3.6.0 to 3.7.0
@@ -0,4 +1,6 @@ | ||
import { assertValidVersion } from "@tsparticles/engine"; | ||
import { EmojiDrawer } from "./EmojiDrawer.js"; | ||
export async function loadEmojiShape(engine, refresh = true) { | ||
assertValidVersion(engine, "3.7.0"); | ||
await engine.addShape(new EmojiDrawer(), refresh); | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.loadEmojiShape = loadEmojiShape; | ||
const engine_1 = require("@tsparticles/engine"); | ||
const EmojiDrawer_js_1 = require("./EmojiDrawer.js"); | ||
async function loadEmojiShape(engine, refresh = true) { | ||
(0, engine_1.assertValidVersion)(engine, "3.7.0"); | ||
await engine.addShape(new EmojiDrawer_js_1.EmojiDrawer(), refresh); | ||
} |
@@ -0,4 +1,6 @@ | ||
import { assertValidVersion } from "@tsparticles/engine"; | ||
import { EmojiDrawer } from "./EmojiDrawer.js"; | ||
export async function loadEmojiShape(engine, refresh = true) { | ||
assertValidVersion(engine, "3.7.0"); | ||
await engine.addShape(new EmojiDrawer(), refresh); | ||
} |
{ | ||
"name": "@tsparticles/shape-emoji", | ||
"version": "3.6.0", | ||
"version": "3.7.0", | ||
"description": "tsParticles emoji 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 */ loadEmojiShape: () => (/* binding */ loadEmojiShape)\n/* harmony export */ });\n/* harmony import */ var _EmojiDrawer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EmojiDrawer.js */ \"./dist/browser/EmojiDrawer.js\");\n\nasync function loadEmojiShape(engine, refresh = true) {\n await engine.addShape(new _EmojiDrawer_js__WEBPACK_IMPORTED_MODULE_0__.EmojiDrawer(), refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/shape-emoji/./dist/browser/index.js?"); | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadEmojiShape: () => (/* binding */ loadEmojiShape)\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 _EmojiDrawer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./EmojiDrawer.js */ \"./dist/browser/EmojiDrawer.js\");\n\n\nasync function loadEmojiShape(engine, refresh = true) {\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.assertValidVersion)(engine, \"3.7.0\");\n await engine.addShape(new _EmojiDrawer_js__WEBPACK_IMPORTED_MODULE_1__.EmojiDrawer(), refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/shape-emoji/./dist/browser/index.js?"); | ||
@@ -61,0 +61,0 @@ /***/ }), |
/*! For license information please see tsparticles.shape.emoji.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 a=o[e]={exports:{}};return t[e](a,a.exports,i),a.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,{loadEmojiShape:()=>l});var a=i(303);const r='"Twemoji Mozilla", Apple Color Emoji, "Segoe UI Emoji", "Noto Color Emoji", "EmojiOne Color"';class s{constructor(){this.validTypes=["emoji"],this._emojiShapeDict=new Map}destroy(){for(const[e,t]of this._emojiShapeDict)t instanceof ImageBitmap&&t?.close(),this._emojiShapeDict.delete(e)}draw(e){const t=e.particle.emojiDataKey;if(!t)return;const o=this._emojiShapeDict.get(t);o&&function(e,t){const{context:o,opacity:i}=e,n=o.globalAlpha;if(!t)return;const a=t.width,r=.5*a;o.globalAlpha=i,o.drawImage(t,-r,-r,a,a),o.globalAlpha=n}(e,o)}async init(e){const t=e.actualOptions,{validTypes:o}=this;if(!o.find((e=>(0,a.isInArray)(e,t.particles.shape.type))))return;const i=[(0,a.loadFont)(r)],n=o.map((e=>t.particles.shape.options[e])).find((e=>!!e));n&&(0,a.executeOnSingleOrMultiple)(n,(e=>{e.font&&i.push((0,a.loadFont)(e.font))})),await Promise.all(i)}particleDestroy(e){e.emojiDataKey=void 0}particleInit(e,t){const o=t.shapeData;if(!o?.value)return;const i=(0,a.itemFromSingleOrMultiple)(o.value,t.randomIndexData);if(!i)return;const n="string"==typeof i?{font:o.font??r,padding:o.padding??0,value:i}:{font:r,padding:0,...o,...i},s=n.font,l=n.value,p=`${l}_${s}`;if(this._emojiShapeDict.has(p))return void(t.emojiDataKey=p);const c=2*n.padding,f=(0,a.getRangeMax)(t.size.value),d=f+c,u=2*d;let m;if("undefined"!=typeof OffscreenCanvas){const e=new OffscreenCanvas(u,u),t=e.getContext("2d");if(!t)return;t.font=`400 ${2*f}px ${s}`,t.textBaseline="middle",t.textAlign="center",t.fillText(l,d,d),m=e.transferToImageBitmap()}else{const e=document.createElement("canvas");e.width=u,e.height=u;const t=e.getContext("2d");if(!t)return;t.font=`400 ${2*f}px ${s}`,t.textBaseline="middle",t.textAlign="center",t.fillText(l,d,d),m=e}this._emojiShapeDict.set(p,m),t.emojiDataKey=p}}async function l(e,t=!0){await e.addShape(new s,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 n=o[e];if(void 0!==n)return n.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,i),a.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,{loadEmojiShape:()=>l});var a=i(303);const r='"Twemoji Mozilla", Apple Color Emoji, "Segoe UI Emoji", "Noto Color Emoji", "EmojiOne Color"';class s{constructor(){this.validTypes=["emoji"],this._emojiShapeDict=new Map}destroy(){for(const[e,t]of this._emojiShapeDict)t instanceof ImageBitmap&&t?.close(),this._emojiShapeDict.delete(e)}draw(e){const t=e.particle.emojiDataKey;if(!t)return;const o=this._emojiShapeDict.get(t);o&&function(e,t){const{context:o,opacity:i}=e,n=o.globalAlpha;if(!t)return;const a=t.width,r=.5*a;o.globalAlpha=i,o.drawImage(t,-r,-r,a,a),o.globalAlpha=n}(e,o)}async init(e){const t=e.actualOptions,{validTypes:o}=this;if(!o.find((e=>(0,a.isInArray)(e,t.particles.shape.type))))return;const i=[(0,a.loadFont)(r)],n=o.map((e=>t.particles.shape.options[e])).find((e=>!!e));n&&(0,a.executeOnSingleOrMultiple)(n,(e=>{e.font&&i.push((0,a.loadFont)(e.font))})),await Promise.all(i)}particleDestroy(e){e.emojiDataKey=void 0}particleInit(e,t){const o=t.shapeData;if(!o?.value)return;const i=(0,a.itemFromSingleOrMultiple)(o.value,t.randomIndexData);if(!i)return;const n="string"==typeof i?{font:o.font??r,padding:o.padding??0,value:i}:{font:r,padding:0,...o,...i},s=n.font,l=n.value,p=`${l}_${s}`;if(this._emojiShapeDict.has(p))return void(t.emojiDataKey=p);const c=2*n.padding,f=(0,a.getRangeMax)(t.size.value),d=f+c,u=2*d;let m;if("undefined"!=typeof OffscreenCanvas){const e=new OffscreenCanvas(u,u),t=e.getContext("2d");if(!t)return;t.font=`400 ${2*f}px ${s}`,t.textBaseline="middle",t.textAlign="center",t.fillText(l,d,d),m=e.transferToImageBitmap()}else{const e=document.createElement("canvas");e.width=u,e.height=u;const t=e.getContext("2d");if(!t)return;t.font=`400 ${2*f}px ${s}`,t.textBaseline="middle",t.textAlign="center",t.fillText(l,d,d),m=e}this._emojiShapeDict.set(p,m),t.emojiDataKey=p}}async function l(e,t=!0){(0,a.assertValidVersion)(e,"3.7.0"),await e.addShape(new s,t)}return n})())); |
@@ -1,1 +0,1 @@ | ||
/*! tsParticles Emoji Shape v3.6.0 by Matteo Bruni */ | ||
/*! tsParticles Emoji 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 loadEmojiShape(engine: Engine, refresh?: boolean): Promise<void>; |
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "./EmojiDrawer.js"], factory); | ||
define(["require", "exports", "@tsparticles/engine", "./EmojiDrawer.js"], factory); | ||
} | ||
@@ -14,6 +14,8 @@ })(function (require, exports) { | ||
exports.loadEmojiShape = loadEmojiShape; | ||
const engine_1 = require("@tsparticles/engine"); | ||
const EmojiDrawer_js_1 = require("./EmojiDrawer.js"); | ||
async function loadEmojiShape(engine, refresh = true) { | ||
(0, engine_1.assertValidVersion)(engine, "3.7.0"); | ||
await engine.addShape(new EmojiDrawer_js_1.EmojiDrawer(), 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
317039
747
+ Added@tsparticles/engine@3.7.0(transitive)
- Removed@tsparticles/engine@3.7.1(transitive)
Updated@tsparticles/engine@3.7.0