@tsparticles/plugin-export-json 3.9.1 → 4.0.0-alpha.1
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/285.min.js +2 -0
- package/285.min.js.LICENSE.txt +1 -0
- package/browser/ExportJSONInstance.js +1 -2
- package/browser/ExportJSONPlugin.js +2 -3
- package/browser/index.js +6 -4
- package/cjs/ExportJSONInstance.js +2 -7
- package/cjs/ExportJSONPlugin.js +4 -9
- package/cjs/index.js +6 -7
- package/dist_browser_ExportJSONPlugin_js.js +40 -0
- package/esm/ExportJSONInstance.js +1 -2
- package/esm/ExportJSONPlugin.js +2 -3
- package/esm/index.js +6 -4
- package/package.json +4 -3
- package/report.html +5 -4
- package/tsparticles.plugin.export.json.js +206 -25
- package/tsparticles.plugin.export.json.min.js +1 -1
- package/tsparticles.plugin.export.json.min.js.LICENSE.txt +1 -1
- package/types/ExportJSONInstance.d.ts +2 -3
- package/types/ExportJSONPlugin.d.ts +2 -3
- package/types/index.d.ts +1 -1
- package/umd/ExportJSONInstance.js +1 -2
- package/umd/ExportJSONPlugin.js +2 -3
- package/umd/index.js +41 -5
package/285.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 285.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_plugin_export_json=this.webpackChunk_tsparticles_plugin_export_json||[]).push([[285],{285(t,s,n){n.d(s,{ExportJSONPlugin:()=>o});class r{constructor(t){this._exportJSON=async()=>{const t=JSON.stringify(this._container.actualOptions,((t,s)=>{if(!t.startsWith("_"))return s}),2);return Promise.resolve(new Blob([t],{type:"application/json"}))},this._container=t}async export(t){const s={supported:!1};if("json"===t)s.supported=!0,s.blob=await this._exportJSON();return s}}class o{constructor(){this.id="export-json"}getPlugin(t){return Promise.resolve(new r(t))}loadOptions(){}needsPlugin(){return!0}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Export JSON Plugin v4.0.0-alpha.1 by Matteo Bruni */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const indent = 2;
|
|
2
2
|
export class ExportJSONInstance {
|
|
3
|
-
constructor(container
|
|
3
|
+
constructor(container) {
|
|
4
4
|
this._exportJSON = async () => {
|
|
5
5
|
const json = JSON.stringify(this._container.actualOptions, (key, value) => {
|
|
6
6
|
if (key.startsWith("_")) {
|
|
@@ -11,7 +11,6 @@ export class ExportJSONInstance {
|
|
|
11
11
|
return Promise.resolve(new Blob([json], { type: "application/json" }));
|
|
12
12
|
};
|
|
13
13
|
this._container = container;
|
|
14
|
-
this._engine = engine;
|
|
15
14
|
}
|
|
16
15
|
async export(type) {
|
|
17
16
|
const res = {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { ExportJSONInstance } from "./ExportJSONInstance.js";
|
|
2
2
|
export class ExportJSONPlugin {
|
|
3
|
-
constructor(
|
|
3
|
+
constructor() {
|
|
4
4
|
this.id = "export-json";
|
|
5
|
-
this._engine = engine;
|
|
6
5
|
}
|
|
7
6
|
getPlugin(container) {
|
|
8
|
-
return Promise.resolve(new ExportJSONInstance(container
|
|
7
|
+
return Promise.resolve(new ExportJSONInstance(container));
|
|
9
8
|
}
|
|
10
9
|
loadOptions() {
|
|
11
10
|
}
|
package/browser/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
engine.
|
|
4
|
-
|
|
1
|
+
export function loadExportJSONPlugin(engine) {
|
|
2
|
+
engine.checkVersion("4.0.0-alpha.1");
|
|
3
|
+
engine.register(async (e) => {
|
|
4
|
+
const { ExportJSONPlugin } = await import("./ExportJSONPlugin.js");
|
|
5
|
+
e.addPlugin(new ExportJSONPlugin());
|
|
6
|
+
});
|
|
5
7
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExportJSONInstance = void 0;
|
|
4
1
|
const indent = 2;
|
|
5
|
-
class ExportJSONInstance {
|
|
6
|
-
constructor(container
|
|
2
|
+
export class ExportJSONInstance {
|
|
3
|
+
constructor(container) {
|
|
7
4
|
this._exportJSON = async () => {
|
|
8
5
|
const json = JSON.stringify(this._container.actualOptions, (key, value) => {
|
|
9
6
|
if (key.startsWith("_")) {
|
|
@@ -14,7 +11,6 @@ class ExportJSONInstance {
|
|
|
14
11
|
return Promise.resolve(new Blob([json], { type: "application/json" }));
|
|
15
12
|
};
|
|
16
13
|
this._container = container;
|
|
17
|
-
this._engine = engine;
|
|
18
14
|
}
|
|
19
15
|
async export(type) {
|
|
20
16
|
const res = {
|
|
@@ -29,4 +25,3 @@ class ExportJSONInstance {
|
|
|
29
25
|
return res;
|
|
30
26
|
}
|
|
31
27
|
}
|
|
32
|
-
exports.ExportJSONInstance = ExportJSONInstance;
|
package/cjs/ExportJSONPlugin.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const ExportJSONInstance_js_1 = require("./ExportJSONInstance.js");
|
|
5
|
-
class ExportJSONPlugin {
|
|
6
|
-
constructor(engine) {
|
|
1
|
+
import { ExportJSONInstance } from "./ExportJSONInstance.js";
|
|
2
|
+
export class ExportJSONPlugin {
|
|
3
|
+
constructor() {
|
|
7
4
|
this.id = "export-json";
|
|
8
|
-
this._engine = engine;
|
|
9
5
|
}
|
|
10
6
|
getPlugin(container) {
|
|
11
|
-
return Promise.resolve(new
|
|
7
|
+
return Promise.resolve(new ExportJSONInstance(container));
|
|
12
8
|
}
|
|
13
9
|
loadOptions() {
|
|
14
10
|
}
|
|
@@ -16,4 +12,3 @@ class ExportJSONPlugin {
|
|
|
16
12
|
return true;
|
|
17
13
|
}
|
|
18
14
|
}
|
|
19
|
-
exports.ExportJSONPlugin = ExportJSONPlugin;
|
package/cjs/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
await engine.addPlugin(new ExportJSONPlugin_js_1.ExportJSONPlugin(engine), refresh);
|
|
1
|
+
export function loadExportJSONPlugin(engine) {
|
|
2
|
+
engine.checkVersion("4.0.0-alpha.1");
|
|
3
|
+
engine.register(async (e) => {
|
|
4
|
+
const { ExportJSONPlugin } = await import("./ExportJSONPlugin.js");
|
|
5
|
+
e.addPlugin(new ExportJSONPlugin());
|
|
6
|
+
});
|
|
8
7
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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.1
|
|
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_json"] = this["webpackChunk_tsparticles_plugin_export_json"] || []).push([["dist_browser_ExportJSONPlugin_js"],{
|
|
19
|
+
|
|
20
|
+
/***/ "./dist/browser/ExportJSONInstance.js"
|
|
21
|
+
/*!********************************************!*\
|
|
22
|
+
!*** ./dist/browser/ExportJSONInstance.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 */ ExportJSONInstance: () => (/* binding */ ExportJSONInstance)\n/* harmony export */ });\nconst indent = 2;\nclass ExportJSONInstance {\n constructor(container) {\n this._exportJSON = async () => {\n const json = JSON.stringify(this._container.actualOptions, (key, value) => {\n if (key.startsWith(\"_\")) {\n return;\n }\n return value;\n }, indent);\n return Promise.resolve(new Blob([json], {\n type: \"application/json\"\n }));\n };\n this._container = container;\n }\n async export(type) {\n const res = {\n supported: false\n };\n switch (type) {\n case \"json\":\n res.supported = true;\n res.blob = await this._exportJSON();\n break;\n }\n return res;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-export-json/./dist/browser/ExportJSONInstance.js?\n}");
|
|
27
|
+
|
|
28
|
+
/***/ },
|
|
29
|
+
|
|
30
|
+
/***/ "./dist/browser/ExportJSONPlugin.js"
|
|
31
|
+
/*!******************************************!*\
|
|
32
|
+
!*** ./dist/browser/ExportJSONPlugin.js ***!
|
|
33
|
+
\******************************************/
|
|
34
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
35
|
+
|
|
36
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExportJSONPlugin: () => (/* binding */ ExportJSONPlugin)\n/* harmony export */ });\n/* harmony import */ var _ExportJSONInstance_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ExportJSONInstance.js */ \"./dist/browser/ExportJSONInstance.js\");\n\nclass ExportJSONPlugin {\n constructor() {\n this.id = \"export-json\";\n }\n getPlugin(container) {\n return Promise.resolve(new _ExportJSONInstance_js__WEBPACK_IMPORTED_MODULE_0__.ExportJSONInstance(container));\n }\n loadOptions() {}\n needsPlugin() {\n return true;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-export-json/./dist/browser/ExportJSONPlugin.js?\n}");
|
|
37
|
+
|
|
38
|
+
/***/ }
|
|
39
|
+
|
|
40
|
+
}]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const indent = 2;
|
|
2
2
|
export class ExportJSONInstance {
|
|
3
|
-
constructor(container
|
|
3
|
+
constructor(container) {
|
|
4
4
|
this._exportJSON = async () => {
|
|
5
5
|
const json = JSON.stringify(this._container.actualOptions, (key, value) => {
|
|
6
6
|
if (key.startsWith("_")) {
|
|
@@ -11,7 +11,6 @@ export class ExportJSONInstance {
|
|
|
11
11
|
return Promise.resolve(new Blob([json], { type: "application/json" }));
|
|
12
12
|
};
|
|
13
13
|
this._container = container;
|
|
14
|
-
this._engine = engine;
|
|
15
14
|
}
|
|
16
15
|
async export(type) {
|
|
17
16
|
const res = {
|
package/esm/ExportJSONPlugin.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { ExportJSONInstance } from "./ExportJSONInstance.js";
|
|
2
2
|
export class ExportJSONPlugin {
|
|
3
|
-
constructor(
|
|
3
|
+
constructor() {
|
|
4
4
|
this.id = "export-json";
|
|
5
|
-
this._engine = engine;
|
|
6
5
|
}
|
|
7
6
|
getPlugin(container) {
|
|
8
|
-
return Promise.resolve(new ExportJSONInstance(container
|
|
7
|
+
return Promise.resolve(new ExportJSONInstance(container));
|
|
9
8
|
}
|
|
10
9
|
loadOptions() {
|
|
11
10
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
engine.
|
|
4
|
-
|
|
1
|
+
export function loadExportJSONPlugin(engine) {
|
|
2
|
+
engine.checkVersion("4.0.0-alpha.1");
|
|
3
|
+
engine.register(async (e) => {
|
|
4
|
+
const { ExportJSONPlugin } = await import("./ExportJSONPlugin.js");
|
|
5
|
+
e.addPlugin(new ExportJSONPlugin());
|
|
6
|
+
});
|
|
5
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/plugin-export-json",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.1",
|
|
4
4
|
"description": "tsParticles export json plugin",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -100,9 +100,10 @@
|
|
|
100
100
|
"./package.json": "./package.json"
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@tsparticles/engine": "
|
|
103
|
+
"@tsparticles/engine": "4.0.0-alpha.1"
|
|
104
104
|
},
|
|
105
105
|
"publishConfig": {
|
|
106
106
|
"access": "public"
|
|
107
|
-
}
|
|
107
|
+
},
|
|
108
|
+
"type": "module"
|
|
108
109
|
}
|