@tsparticles/plugin-export-image 4.0.0-alpha.5 → 4.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.
- package/291.min.js +1 -0
- package/668.min.js +1 -0
- package/browser/ExportImagePlugin.js +1 -3
- package/browser/ExportImagePluginInstance.js +16 -15
- package/browser/index.js +1 -1
- package/cjs/ExportImagePlugin.js +1 -3
- package/cjs/ExportImagePluginInstance.js +16 -15
- package/cjs/index.js +1 -1
- package/dist_browser_ExportImagePluginInstance_js.js +2 -2
- package/dist_browser_ExportImagePlugin_js.js +2 -2
- package/esm/ExportImagePlugin.js +1 -3
- package/esm/ExportImagePluginInstance.js +16 -15
- package/esm/index.js +1 -1
- package/package.json +2 -2
- package/report.html +3 -3
- package/tsparticles.plugin.export.image.js +22 -10
- package/tsparticles.plugin.export.image.min.js +2 -2
- package/types/ExportImagePlugin.d.ts +1 -2
- package/umd/ExportImagePlugin.js +1 -3
- package/umd/ExportImagePluginInstance.js +16 -15
- package/umd/index.js +1 -1
- package/232.min.js +0 -2
- package/232.min.js.LICENSE.txt +0 -1
- package/775.min.js +0 -2
- package/775.min.js.LICENSE.txt +0 -1
- package/tsparticles.plugin.export.image.min.js.LICENSE.txt +0 -1
package/291.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_plugin_export_image=this.webpackChunk_tsparticles_plugin_export_image||[]).push([[291],{291(e,t,i){i.d(t,{ExportImagePlugin:()=>n});class n{id="export-image";async getPlugin(e){let{ExportImagePluginInstance:t}=await i.e(668).then(i.bind(i,668));return new t(e)}loadOptions(){}needsPlugin(){return!0}}}}]);
|
package/668.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_plugin_export_image=this.webpackChunk_tsparticles_plugin_export_image||[]).push([[668],{668(t,e,a){a.d(e,{ExportImagePluginInstance:()=>i});class i{_container;constructor(t){this._container=t}async export(t,e){let a={supported:!1};return"image"===t&&(a.supported=!0,a.blob=await this._exportImage(e)),a}_exportImage=async t=>{let e=this._container.canvas.element;if(e)return new Promise(a=>{e.toBlob(t=>{t?a(t):a(void 0)},t.type??"image/png",t.quality)})}}}}]);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export class ExportImagePlugin {
|
|
2
|
-
|
|
3
|
-
this.id = "export-image";
|
|
4
|
-
}
|
|
2
|
+
id = "export-image";
|
|
5
3
|
async getPlugin(container) {
|
|
6
4
|
const { ExportImagePluginInstance } = await import("./ExportImagePluginInstance.js");
|
|
7
5
|
return new ExportImagePluginInstance(container);
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
export class ExportImagePluginInstance {
|
|
2
|
+
_container;
|
|
2
3
|
constructor(container) {
|
|
3
|
-
this._exportImage = async (data) => {
|
|
4
|
-
const element = this._container.canvas.element;
|
|
5
|
-
if (!element) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
return new Promise(resolve => {
|
|
9
|
-
element.toBlob(blob => {
|
|
10
|
-
if (!blob) {
|
|
11
|
-
resolve(undefined);
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
resolve(blob);
|
|
15
|
-
}, data.type ?? "image/png", data.quality);
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
4
|
this._container = container;
|
|
19
5
|
}
|
|
20
6
|
async export(type, data) {
|
|
@@ -29,4 +15,19 @@ export class ExportImagePluginInstance {
|
|
|
29
15
|
}
|
|
30
16
|
return res;
|
|
31
17
|
}
|
|
18
|
+
_exportImage = async (data) => {
|
|
19
|
+
const element = this._container.canvas.element;
|
|
20
|
+
if (!element) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
return new Promise(resolve => {
|
|
24
|
+
element.toBlob(blob => {
|
|
25
|
+
if (!blob) {
|
|
26
|
+
resolve(undefined);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
resolve(blob);
|
|
30
|
+
}, data.type ?? "image/png", data.quality);
|
|
31
|
+
});
|
|
32
|
+
};
|
|
32
33
|
}
|
package/browser/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadExportImagePlugin(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
4
|
const { ExportImagePlugin } = await import("./ExportImagePlugin.js");
|
|
5
5
|
e.addPlugin(new ExportImagePlugin());
|
package/cjs/ExportImagePlugin.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export class ExportImagePlugin {
|
|
2
|
-
|
|
3
|
-
this.id = "export-image";
|
|
4
|
-
}
|
|
2
|
+
id = "export-image";
|
|
5
3
|
async getPlugin(container) {
|
|
6
4
|
const { ExportImagePluginInstance } = await import("./ExportImagePluginInstance.js");
|
|
7
5
|
return new ExportImagePluginInstance(container);
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
export class ExportImagePluginInstance {
|
|
2
|
+
_container;
|
|
2
3
|
constructor(container) {
|
|
3
|
-
this._exportImage = async (data) => {
|
|
4
|
-
const element = this._container.canvas.element;
|
|
5
|
-
if (!element) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
return new Promise(resolve => {
|
|
9
|
-
element.toBlob(blob => {
|
|
10
|
-
if (!blob) {
|
|
11
|
-
resolve(undefined);
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
resolve(blob);
|
|
15
|
-
}, data.type ?? "image/png", data.quality);
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
4
|
this._container = container;
|
|
19
5
|
}
|
|
20
6
|
async export(type, data) {
|
|
@@ -29,4 +15,19 @@ export class ExportImagePluginInstance {
|
|
|
29
15
|
}
|
|
30
16
|
return res;
|
|
31
17
|
}
|
|
18
|
+
_exportImage = async (data) => {
|
|
19
|
+
const element = this._container.canvas.element;
|
|
20
|
+
if (!element) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
return new Promise(resolve => {
|
|
24
|
+
element.toBlob(blob => {
|
|
25
|
+
if (!blob) {
|
|
26
|
+
resolve(undefined);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
resolve(blob);
|
|
30
|
+
}, data.type ?? "image/png", data.quality);
|
|
31
|
+
});
|
|
32
|
+
};
|
|
32
33
|
}
|
package/cjs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadExportImagePlugin(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
4
|
const { ExportImagePlugin } = await import("./ExportImagePlugin.js");
|
|
5
5
|
e.addPlugin(new ExportImagePlugin());
|
|
@@ -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-
|
|
7
|
+
* v4.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
\***************************************************/
|
|
24
24
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
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
|
|
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 _container;\n constructor(container){\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 _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}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-export-image/./dist/browser/ExportImagePluginInstance.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ }
|
|
29
29
|
|
|
@@ -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-
|
|
7
|
+
* v4.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
\*******************************************/
|
|
24
24
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
25
|
|
|
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
|
|
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 id = \"export-image\";\n async getPlugin(container) {\n const { ExportImagePluginInstance } = 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\n//# sourceURL=webpack://@tsparticles/plugin-export-image/./dist/browser/ExportImagePlugin.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ }
|
|
29
29
|
|
package/esm/ExportImagePlugin.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export class ExportImagePlugin {
|
|
2
|
-
|
|
3
|
-
this.id = "export-image";
|
|
4
|
-
}
|
|
2
|
+
id = "export-image";
|
|
5
3
|
async getPlugin(container) {
|
|
6
4
|
const { ExportImagePluginInstance } = await import("./ExportImagePluginInstance.js");
|
|
7
5
|
return new ExportImagePluginInstance(container);
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
export class ExportImagePluginInstance {
|
|
2
|
+
_container;
|
|
2
3
|
constructor(container) {
|
|
3
|
-
this._exportImage = async (data) => {
|
|
4
|
-
const element = this._container.canvas.element;
|
|
5
|
-
if (!element) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
return new Promise(resolve => {
|
|
9
|
-
element.toBlob(blob => {
|
|
10
|
-
if (!blob) {
|
|
11
|
-
resolve(undefined);
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
resolve(blob);
|
|
15
|
-
}, data.type ?? "image/png", data.quality);
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
4
|
this._container = container;
|
|
19
5
|
}
|
|
20
6
|
async export(type, data) {
|
|
@@ -29,4 +15,19 @@ export class ExportImagePluginInstance {
|
|
|
29
15
|
}
|
|
30
16
|
return res;
|
|
31
17
|
}
|
|
18
|
+
_exportImage = async (data) => {
|
|
19
|
+
const element = this._container.canvas.element;
|
|
20
|
+
if (!element) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
return new Promise(resolve => {
|
|
24
|
+
element.toBlob(blob => {
|
|
25
|
+
if (!blob) {
|
|
26
|
+
resolve(undefined);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
resolve(blob);
|
|
30
|
+
}, data.type ?? "image/png", data.quality);
|
|
31
|
+
});
|
|
32
|
+
};
|
|
32
33
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadExportImagePlugin(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await 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-
|
|
3
|
+
"version": "4.0.0-beta.0",
|
|
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-
|
|
103
|
+
"@tsparticles/engine": "4.0.0-beta.0"
|
|
104
104
|
},
|
|
105
105
|
"publishConfig": {
|
|
106
106
|
"access": "public"
|