@tsparticles/plugin-export-image 4.0.0-alpha.2 → 4.0.0-alpha.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/232.min.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 232.min.js.LICENSE.txt */
2
+ (this.webpackChunk_tsparticles_plugin_export_image=this.webpackChunk_tsparticles_plugin_export_image||[]).push([[232],{232(t,e,i){i.d(e,{ExportImagePluginInstance:()=>s});class s{constructor(t){this._exportImage=async t=>{const e=this._container.canvas.element;if(e)return new Promise((i=>{e.toBlob((t=>{i(t||void 0)}),t.type??"image/png",t.quality)}))},this._container=t}async export(t,e){const i={supported:!1};if("image"===t)i.supported=!0,i.blob=await this._exportImage(e);return i}}}}]);
@@ -0,0 +1 @@
1
+ /*! tsParticles Export Image Plugin v4.0.0-alpha.4 by Matteo Bruni */
package/775.min.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 775.min.js.LICENSE.txt */
2
+ (this.webpackChunk_tsparticles_plugin_export_image=this.webpackChunk_tsparticles_plugin_export_image||[]).push([[775],{775(t,e,n){n.d(e,{ExportImagePlugin:()=>i});class i{constructor(){this.id="export-image"}async getPlugin(t){const{ExportImagePluginInstance:e}=await n.e(232).then(n.bind(n,232));return new e(t)}loadOptions(){}needsPlugin(){return!0}}}}]);
@@ -0,0 +1 @@
1
+ /*! tsParticles Export Image Plugin v4.0.0-alpha.4 by Matteo Bruni */
@@ -1,10 +1,10 @@
1
- import { ExportImageInstance } from "./ExportImageInstance.js";
2
1
  export class ExportImagePlugin {
3
2
  constructor() {
4
3
  this.id = "export-image";
5
4
  }
6
- getPlugin(container) {
7
- return Promise.resolve(new ExportImageInstance(container));
5
+ async getPlugin(container) {
6
+ const { ExportImagePluginInstance } = await import("./ExportImagePluginInstance.js");
7
+ return new ExportImagePluginInstance(container);
8
8
  }
9
9
  loadOptions() {
10
10
  }
@@ -1,4 +1,4 @@
1
- export class ExportImageInstance {
1
+ export class ExportImagePluginInstance {
2
2
  constructor(container) {
3
3
  this._exportImage = async (data) => {
4
4
  const element = this._container.canvas.element;
package/browser/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export function loadExportImagePlugin(engine) {
2
- engine.checkVersion("4.0.0-alpha.2");
2
+ engine.checkVersion("4.0.0-alpha.4");
3
3
  engine.register(async (e) => {
4
4
  const { ExportImagePlugin } = await import("./ExportImagePlugin.js");
5
5
  e.addPlugin(new ExportImagePlugin());
@@ -1,10 +1,10 @@
1
- import { ExportImageInstance } from "./ExportImageInstance.js";
2
1
  export class ExportImagePlugin {
3
2
  constructor() {
4
3
  this.id = "export-image";
5
4
  }
6
- getPlugin(container) {
7
- return Promise.resolve(new ExportImageInstance(container));
5
+ async getPlugin(container) {
6
+ const { ExportImagePluginInstance } = await import("./ExportImagePluginInstance.js");
7
+ return new ExportImagePluginInstance(container);
8
8
  }
9
9
  loadOptions() {
10
10
  }
@@ -1,4 +1,4 @@
1
- export class ExportImageInstance {
1
+ export class ExportImagePluginInstance {
2
2
  constructor(container) {
3
3
  this._exportImage = async (data) => {
4
4
  const element = this._container.canvas.element;
package/cjs/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export function loadExportImagePlugin(engine) {
2
- engine.checkVersion("4.0.0-alpha.2");
2
+ engine.checkVersion("4.0.0-alpha.4");
3
3
  engine.register(async (e) => {
4
4
  const { ExportImagePlugin } = await import("./ExportImagePlugin.js");
5
5
  e.addPlugin(new ExportImagePlugin());
@@ -0,0 +1,30 @@
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
+ * v4.0.0-alpha.4
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_plugin_export_image"] = this["webpackChunk_tsparticles_plugin_export_image"] || []).push([["dist_browser_ExportImagePluginInstance_js"],{
19
+
20
+ /***/ "./dist/browser/ExportImagePluginInstance.js"
21
+ /*!***************************************************!*\
22
+ !*** ./dist/browser/ExportImagePluginInstance.js ***!
23
+ \***************************************************/
24
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
25
+
26
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExportImagePluginInstance: () => (/* binding */ ExportImagePluginInstance)\n/* harmony export */ });\nclass ExportImagePluginInstance {\n constructor(container) {\n this._exportImage = async data => {\n const element = this._container.canvas.element;\n if (!element) {\n return;\n }\n return new Promise(resolve => {\n element.toBlob(blob => {\n if (!blob) {\n resolve(undefined);\n return;\n }\n resolve(blob);\n }, data.type ?? \"image/png\", data.quality);\n });\n };\n this._container = container;\n }\n async export(type, data) {\n const res = {\n supported: false\n };\n switch (type) {\n case \"image\":\n res.supported = true;\n res.blob = await this._exportImage(data);\n break;\n }\n return res;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-export-image/./dist/browser/ExportImagePluginInstance.js?\n}");
27
+
28
+ /***/ }
29
+
30
+ }]);
@@ -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.2
7
+ * v4.0.0-alpha.4
8
8
  */
9
9
  "use strict";
10
10
  /*
@@ -17,23 +17,13 @@
17
17
  */
18
18
  (this["webpackChunk_tsparticles_plugin_export_image"] = this["webpackChunk_tsparticles_plugin_export_image"] || []).push([["dist_browser_ExportImagePlugin_js"],{
19
19
 
20
- /***/ "./dist/browser/ExportImageInstance.js"
21
- /*!*********************************************!*\
22
- !*** ./dist/browser/ExportImageInstance.js ***!
23
- \*********************************************/
24
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
25
-
26
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExportImageInstance: () => (/* binding */ ExportImageInstance)\n/* harmony export */ });\nclass ExportImageInstance {\n constructor(container) {\n this._exportImage = async data => {\n const element = this._container.canvas.element;\n if (!element) {\n return;\n }\n return new Promise(resolve => {\n element.toBlob(blob => {\n if (!blob) {\n resolve(undefined);\n return;\n }\n resolve(blob);\n }, data.type ?? \"image/png\", data.quality);\n });\n };\n this._container = container;\n }\n async export(type, data) {\n const res = {\n supported: false\n };\n switch (type) {\n case \"image\":\n res.supported = true;\n res.blob = await this._exportImage(data);\n break;\n }\n return res;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-export-image/./dist/browser/ExportImageInstance.js?\n}");
27
-
28
- /***/ },
29
-
30
20
  /***/ "./dist/browser/ExportImagePlugin.js"
31
21
  /*!*******************************************!*\
32
22
  !*** ./dist/browser/ExportImagePlugin.js ***!
33
23
  \*******************************************/
34
24
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
35
25
 
36
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExportImagePlugin: () => (/* binding */ ExportImagePlugin)\n/* harmony export */ });\n/* harmony import */ var _ExportImageInstance_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ExportImageInstance.js */ \"./dist/browser/ExportImageInstance.js\");\n\nclass ExportImagePlugin {\n constructor() {\n this.id = \"export-image\";\n }\n getPlugin(container) {\n return Promise.resolve(new _ExportImageInstance_js__WEBPACK_IMPORTED_MODULE_0__.ExportImageInstance(container));\n }\n loadOptions() {}\n needsPlugin() {\n return true;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-export-image/./dist/browser/ExportImagePlugin.js?\n}");
26
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExportImagePlugin: () => (/* binding */ ExportImagePlugin)\n/* harmony export */ });\nclass ExportImagePlugin {\n constructor() {\n this.id = \"export-image\";\n }\n async getPlugin(container) {\n const {\n ExportImagePluginInstance\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_ExportImagePluginInstance_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ExportImagePluginInstance.js */ \"./dist/browser/ExportImagePluginInstance.js\"));\n return new ExportImagePluginInstance(container);\n }\n loadOptions() {}\n needsPlugin() {\n return true;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-export-image/./dist/browser/ExportImagePlugin.js?\n}");
37
27
 
38
28
  /***/ }
39
29
 
@@ -1,10 +1,10 @@
1
- import { ExportImageInstance } from "./ExportImageInstance.js";
2
1
  export class ExportImagePlugin {
3
2
  constructor() {
4
3
  this.id = "export-image";
5
4
  }
6
- getPlugin(container) {
7
- return Promise.resolve(new ExportImageInstance(container));
5
+ async getPlugin(container) {
6
+ const { ExportImagePluginInstance } = await import("./ExportImagePluginInstance.js");
7
+ return new ExportImagePluginInstance(container);
8
8
  }
9
9
  loadOptions() {
10
10
  }
@@ -1,4 +1,4 @@
1
- export class ExportImageInstance {
1
+ export class ExportImagePluginInstance {
2
2
  constructor(container) {
3
3
  this._exportImage = async (data) => {
4
4
  const element = this._container.canvas.element;
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export function loadExportImagePlugin(engine) {
2
- engine.checkVersion("4.0.0-alpha.2");
2
+ engine.checkVersion("4.0.0-alpha.4");
3
3
  engine.register(async (e) => {
4
4
  const { ExportImagePlugin } = await import("./ExportImagePlugin.js");
5
5
  e.addPlugin(new ExportImagePlugin());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/plugin-export-image",
3
- "version": "4.0.0-alpha.2",
3
+ "version": "4.0.0-alpha.4",
4
4
  "description": "tsParticles export image plugin",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -100,7 +100,7 @@
100
100
  "./package.json": "./package.json"
101
101
  },
102
102
  "dependencies": {
103
- "@tsparticles/engine": "4.0.0-alpha.2"
103
+ "@tsparticles/engine": "4.0.0-alpha.4"
104
104
  },
105
105
  "publishConfig": {
106
106
  "access": "public"
package/report.html CHANGED
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8"/>
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
6
- <title>@tsparticles/plugin-export-image [8 Jan 2026 at 10:13]</title>
6
+ <title>@tsparticles/plugin-export-image [21 Jan 2026 at 14:32]</title>
7
7
  <link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
8
8
 
9
9
  <script>
@@ -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.2
7
+ * v4.0.0-alpha.4
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 */ loadExportImagePlugin: () => (/* binding */ loadExportImagePlugin)\n/* harmony export */ });\nfunction loadExportImagePlugin(engine) {\n engine.checkVersion(\"4.0.0-alpha.2\");\n engine.register(async e => {\n const {\n ExportImagePlugin\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_ExportImagePlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ExportImagePlugin.js */ \"./dist/browser/ExportImagePlugin.js\"));\n e.addPlugin(new ExportImagePlugin());\n });\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-export-image/./dist/browser/index.js?\n}");
37
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadExportImagePlugin: () => (/* binding */ loadExportImagePlugin)\n/* harmony export */ });\nfunction loadExportImagePlugin(engine) {\n engine.checkVersion(\"4.0.0-alpha.4\");\n engine.register(async e => {\n const {\n ExportImagePlugin\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_ExportImagePlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ExportImagePlugin.js */ \"./dist/browser/ExportImagePlugin.js\"));\n e.addPlugin(new ExportImagePlugin());\n });\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-export-image/./dist/browser/index.js?\n}");
38
38
 
39
39
  /***/ }
40
40
 
@@ -108,18 +108,6 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
108
108
  /******/ };
109
109
  /******/ })();
110
110
  /******/
111
- /******/ /* webpack/runtime/global */
112
- /******/ (() => {
113
- /******/ __webpack_require__.g = (function() {
114
- /******/ if (typeof globalThis === 'object') return globalThis;
115
- /******/ try {
116
- /******/ return this || new Function('return this')();
117
- /******/ } catch (e) {
118
- /******/ if (typeof window === 'object') return window;
119
- /******/ }
120
- /******/ })();
121
- /******/ })();
122
- /******/
123
111
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
124
112
  /******/ (() => {
125
113
  /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
@@ -184,8 +172,8 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
184
172
  /******/ /* webpack/runtime/publicPath */
185
173
  /******/ (() => {
186
174
  /******/ var scriptUrl;
187
- /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
188
- /******/ var document = __webpack_require__.g.document;
175
+ /******/ if (globalThis.importScripts) scriptUrl = globalThis.location + "";
176
+ /******/ var document = globalThis.document;
189
177
  /******/ if (!scriptUrl && document) {
190
178
  /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
191
179
  /******/ scriptUrl = document.currentScript.src;
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see tsparticles.plugin.export.image.min.js.LICENSE.txt */
2
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(()=>(()=>{var e,t,r={},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var i=o[e]={exports:{}};return r[e](i,i.exports,n),i.exports}n.m=r,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||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@tsparticles/plugin-export-image:",n.l=(r,o,i,a)=>{if(e[r])e[r].push(o);else{var l,p;if(void 0!==i)for(var s=document.getElementsByTagName("script"),c=0;c<s.length;c++){var u=s[c];if(u.getAttribute("src")==r||u.getAttribute("data-webpack")==t+i){l=u;break}}l||(p=!0,(l=document.createElement("script")).charset="utf-8",n.nc&&l.setAttribute("nonce",n.nc),l.setAttribute("data-webpack",t+i),l.src=r),e[r]=[o];var d=(t,o)=>{l.onerror=l.onload=null,clearTimeout(f);var n=e[r];if(delete e[r],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(o))),t)return t(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),p&&document.head.appendChild(l)}},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 t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[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={843:0};n.f.j=(t,r)=>{var o=n.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=i);var a=n.p+n.u(t),l=new Error;n.l(a,(r=>{if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;l.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",l.name="ChunkLoadError",l.type=i,l.request=a,o[1](l)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,i,[a,l,p]=r,s=0;if(a.some((t=>0!==e[t]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(p)p(n)}for(t&&t(r);s<a.length;s++)i=a[s],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=this.webpackChunk_tsparticles_plugin_export_image=this.webpackChunk_tsparticles_plugin_export_image||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var i={};function a(e){e.checkVersion("4.0.0-alpha.2"),e.register((async e=>{const{ExportImagePlugin:t}=await n.e(82).then(n.bind(n,82));e.addPlugin(new t)}))}return n.r(i),n.d(i,{loadExportImagePlugin:()=>a}),i})()));
2
+ !function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var t=r();for(var o in t)("object"==typeof exports?exports:e)[o]=t[o]}}(this,(()=>(()=>{var e,r,t={},o={};function a(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,a),i.exports}a.m=t,a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((r,t)=>(a.f[t](e,r),r)),[])),a.u=e=>e+".min.js",a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@tsparticles/plugin-export-image:",a.l=(t,o,i,n)=>{if(e[t])e[t].push(o);else{var l,p;if(void 0!==i)for(var s=document.getElementsByTagName("script"),c=0;c<s.length;c++){var u=s[c];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==r+i){l=u;break}}l||(p=!0,(l=document.createElement("script")).charset="utf-8",a.nc&&l.setAttribute("nonce",a.nc),l.setAttribute("data-webpack",r+i),l.src=t),e[t]=[o];var d=(r,o)=>{l.onerror=l.onload=null,clearTimeout(f);var a=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),a&&a.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),p&&document.head.appendChild(l)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var r=globalThis.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(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={843:0};a.f.j=(r,t)=>{var o=a.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise(((t,a)=>o=e[r]=[t,a]));t.push(o[2]=i);var n=a.p+a.u(r),l=new Error;a.l(n,(t=>{if(a.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var i=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;l.message="Loading chunk "+r+" failed.\n("+i+": "+n+")",l.name="ChunkLoadError",l.type=i,l.request=n,o[1](l)}}),"chunk-"+r,r)}};var r=(r,t)=>{var o,i,[n,l,p]=t,s=0;if(n.some((r=>0!==e[r]))){for(o in l)a.o(l,o)&&(a.m[o]=l[o]);if(p)p(a)}for(r&&r(t);s<n.length;s++)i=n[s],a.o(e,i)&&e[i]&&e[i][0](),e[i]=0},t=this.webpackChunk_tsparticles_plugin_export_image=this.webpackChunk_tsparticles_plugin_export_image||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var i={};function n(e){e.checkVersion("4.0.0-alpha.4"),e.register((async e=>{const{ExportImagePlugin:r}=await a.e(775).then(a.bind(a,775));e.addPlugin(new r)}))}return a.r(i),a.d(i,{loadExportImagePlugin:()=>n}),i})()));
@@ -1 +1 @@
1
- /*! tsParticles Export Image Plugin v4.0.0-alpha.2 by Matteo Bruni */
1
+ /*! tsParticles Export Image Plugin v4.0.0-alpha.4 by Matteo Bruni */
@@ -1,9 +1,8 @@
1
- import type { Container, IPlugin } from "@tsparticles/engine";
2
- import { ExportImageInstance } from "./ExportImageInstance.js";
1
+ import type { Container, IContainerPlugin, IPlugin } from "@tsparticles/engine";
3
2
  export declare class ExportImagePlugin implements IPlugin {
4
3
  readonly id: string;
5
4
  constructor();
6
- getPlugin(container: Container): Promise<ExportImageInstance>;
5
+ getPlugin(container: Container): Promise<IContainerPlugin>;
7
6
  loadOptions(): void;
8
7
  needsPlugin(): boolean;
9
8
  }
@@ -1,5 +1,5 @@
1
1
  import type { Container, ExportResult, IContainerPlugin } from "@tsparticles/engine";
2
- export declare class ExportImageInstance implements IContainerPlugin {
2
+ export declare class ExportImagePluginInstance implements IContainerPlugin {
3
3
  private readonly _container;
4
4
  constructor(container: Container);
5
5
  export(type: string, data: Record<string, unknown>): Promise<ExportResult>;
@@ -1,22 +1,56 @@
1
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2
+ if (k2 === undefined) k2 = k;
3
+ var desc = Object.getOwnPropertyDescriptor(m, k);
4
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
5
+ desc = { enumerable: true, get: function() { return m[k]; } };
6
+ }
7
+ Object.defineProperty(o, k2, desc);
8
+ }) : (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ o[k2] = m[k];
11
+ }));
12
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
13
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
14
+ }) : function(o, v) {
15
+ o["default"] = v;
16
+ });
17
+ var __importStar = (this && this.__importStar) || (function () {
18
+ var ownKeys = function(o) {
19
+ ownKeys = Object.getOwnPropertyNames || function (o) {
20
+ var ar = [];
21
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
22
+ return ar;
23
+ };
24
+ return ownKeys(o);
25
+ };
26
+ return function (mod) {
27
+ if (mod && mod.__esModule) return mod;
28
+ var result = {};
29
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
30
+ __setModuleDefault(result, mod);
31
+ return result;
32
+ };
33
+ })();
1
34
  (function (factory) {
2
35
  if (typeof module === "object" && typeof module.exports === "object") {
3
36
  var v = factory(require, exports);
4
37
  if (v !== undefined) module.exports = v;
5
38
  }
6
39
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./ExportImageInstance.js"], factory);
40
+ define(["require", "exports"], factory);
8
41
  }
9
42
  })(function (require, exports) {
10
43
  "use strict";
44
+ var __syncRequire = typeof module === "object" && typeof module.exports === "object";
11
45
  Object.defineProperty(exports, "__esModule", { value: true });
12
46
  exports.ExportImagePlugin = void 0;
13
- const ExportImageInstance_js_1 = require("./ExportImageInstance.js");
14
47
  class ExportImagePlugin {
15
48
  constructor() {
16
49
  this.id = "export-image";
17
50
  }
18
- getPlugin(container) {
19
- return Promise.resolve(new ExportImageInstance_js_1.ExportImageInstance(container));
51
+ async getPlugin(container) {
52
+ const { ExportImagePluginInstance } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./ExportImagePluginInstance.js"))) : new Promise((resolve_1, reject_1) => { require(["./ExportImagePluginInstance.js"], resolve_1, reject_1); }).then(__importStar));
53
+ return new ExportImagePluginInstance(container);
20
54
  }
21
55
  loadOptions() {
22
56
  }
@@ -9,8 +9,8 @@
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ExportImageInstance = void 0;
13
- class ExportImageInstance {
12
+ exports.ExportImagePluginInstance = void 0;
13
+ class ExportImagePluginInstance {
14
14
  constructor(container) {
15
15
  this._exportImage = async (data) => {
16
16
  const element = this._container.canvas.element;
@@ -42,5 +42,5 @@
42
42
  return res;
43
43
  }
44
44
  }
45
- exports.ExportImageInstance = ExportImageInstance;
45
+ exports.ExportImagePluginInstance = ExportImagePluginInstance;
46
46
  });
package/umd/index.js CHANGED
@@ -45,7 +45,7 @@ var __importStar = (this && this.__importStar) || (function () {
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
46
  exports.loadExportImagePlugin = loadExportImagePlugin;
47
47
  function loadExportImagePlugin(engine) {
48
- engine.checkVersion("4.0.0-alpha.2");
48
+ engine.checkVersion("4.0.0-alpha.4");
49
49
  engine.register(async (e) => {
50
50
  const { ExportImagePlugin } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./ExportImagePlugin.js"))) : new Promise((resolve_1, reject_1) => { require(["./ExportImagePlugin.js"], resolve_1, reject_1); }).then(__importStar));
51
51
  e.addPlugin(new ExportImagePlugin());
package/82.min.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 82.min.js.LICENSE.txt */
2
- (this.webpackChunk_tsparticles_plugin_export_image=this.webpackChunk_tsparticles_plugin_export_image||[]).push([[82],{82(e,t,i){i.d(t,{ExportImagePlugin:()=>n});class s{constructor(e){this._exportImage=async e=>{const t=this._container.canvas.element;if(t)return new Promise((i=>{t.toBlob((e=>{i(e||void 0)}),e.type??"image/png",e.quality)}))},this._container=e}async export(e,t){const i={supported:!1};if("image"===e)i.supported=!0,i.blob=await this._exportImage(t);return i}}class n{constructor(){this.id="export-image"}getPlugin(e){return Promise.resolve(new s(e))}loadOptions(){}needsPlugin(){return!0}}}}]);
@@ -1 +0,0 @@
1
- /*! tsParticles Export Image Plugin v4.0.0-alpha.2 by Matteo Bruni */