@tsparticles/plugin-export-json 4.0.0-alpha.2 → 4.0.0-alpha.20

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.
@@ -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.20
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 */ loadExportJSONPlugin: () => (/* binding */ loadExportJSONPlugin)\n/* harmony export */ });\nfunction loadExportJSONPlugin(engine) {\n engine.checkVersion(\"4.0.0-alpha.2\");\n engine.register(async e => {\n const {\n ExportJSONPlugin\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_ExportJSONPlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ExportJSONPlugin.js */ \"./dist/browser/ExportJSONPlugin.js\"));\n e.addPlugin(new ExportJSONPlugin());\n });\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-export-json/./dist/browser/index.js?\n}");
37
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadExportJSONPlugin: () => (/* binding */ loadExportJSONPlugin)\n/* harmony export */ });\nasync function loadExportJSONPlugin(engine) {\n engine.checkVersion(\"4.0.0-alpha.20\");\n await engine.register(async (e)=>{\n const { ExportJSONPlugin } = await __webpack_require__.e(/*! import() */ \"dist_browser_ExportJSONPlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ExportJSONPlugin.js */ \"./dist/browser/ExportJSONPlugin.js\"));\n e.addPlugin(new ExportJSONPlugin());\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-export-json/./dist/browser/index.js?\n}");
38
38
 
39
39
  /***/ }
40
40
 
@@ -1,2 +1,2 @@
1
- /*! For license information please see tsparticles.plugin.export.json.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-json:",n.l=(r,o,i,a)=>{if(e[r])e[r].push(o);else{var s,l;if(void 0!==i)for(var p=document.getElementsByTagName("script"),c=0;c<p.length;c++){var u=p[c];if(u.getAttribute("src")==r||u.getAttribute("data-webpack")==t+i){s=u;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",t+i),s.src=r),e[r]=[o];var d=(t,o)=>{s.onerror=s.onload=null,clearTimeout(f);var n=e[r];if(delete e[r],s.parentNode&&s.parentNode.removeChild(s),n&&n.forEach((e=>e(o))),t)return t(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=d.bind(null,s.onerror),s.onload=d.bind(null,s.onload),l&&document.head.appendChild(s)}},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={682: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),s=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;s.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,o[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,i,[a,s,l]=r,p=0;if(a.some((t=>0!==e[t]))){for(o in s)n.o(s,o)&&(n.m[o]=s[o]);if(l)l(n)}for(t&&t(r);p<a.length;p++)i=a[p],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=this.webpackChunk_tsparticles_plugin_export_json=this.webpackChunk_tsparticles_plugin_export_json||[];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{ExportJSONPlugin:t}=await n.e(285).then(n.bind(n,285));e.addPlugin(new t)}))}return n.r(i),n.d(i,{loadExportJSONPlugin:()=>a}),i})()));
1
+ !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,()=>(()=>{"use strict";var e,t,r,o={},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e](r,r.exports,i),r.exports}i.m=o,i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((t,r)=>(i.f[r](e,t),t),[])),i.u=e=>""+e+".min.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},i.l=(e,t,r,o)=>{if(a[e])return void a[e].push(t);if(void 0!==r)for(var n,s,p=document.getElementsByTagName("script"),l=0;l<p.length;l++){var c=p[l];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")=="@tsparticles/plugin-export-json:"+r){n=c;break}}n||(s=!0,(n=document.createElement("script")).charset="utf-8",i.nc&&n.setAttribute("nonce",i.nc),n.setAttribute("data-webpack","@tsparticles/plugin-export-json:"+r),n.src=e),a[e]=[t];var u=(t,r)=>{n.onerror=n.onload=null,clearTimeout(d);var o=a[e];if(delete a[e],n.parentNode&&n.parentNode.removeChild(n),o&&o.forEach(e=>e(r)),t)return t(r)},d=setTimeout(u.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=u.bind(null,n.onerror),n.onload=u.bind(null,n.onload),s&&document.head.appendChild(n)},i.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.g.importScripts&&(s=i.g.location+"");var a,s,p=i.g.document;if(!s&&p&&(p.currentScript&&"SCRIPT"===p.currentScript.tagName.toUpperCase()&&(s=p.currentScript.src),!s)){var l=p.getElementsByTagName("script");if(l.length)for(var c=l.length-1;c>-1&&(!s||!/^http(s?):/.test(s));)s=l[c--].src}if(!s)throw Error("Automatic publicPath is not supported in this browser");i.p=s=s.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e={682:0},i.f.j=(t,r)=>{var o=i.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise((r,n)=>o=e[t]=[r,n]);r.push(o[2]=n);var a=i.p+i.u(t),s=Error();i.l(a,r=>{if(i.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+t+` failed.
2
+ (`+n+": "+a+")",s.name="ChunkLoadError",s.type=n,s.request=a,o[1](s)}},"chunk-"+t,t)}},t=(t,r)=>{var o,n,[a,s,p]=r,l=0;if(a.some(t=>0!==e[t])){for(o in s)i.o(s,o)&&(i.m[o]=s[o]);p&&p(i)}for(t&&t(r);l<a.length;l++)n=a[l],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0},(r=this.webpackChunk_tsparticles_plugin_export_json=this.webpackChunk_tsparticles_plugin_export_json||[]).forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r));var u={};async function d(e){e.checkVersion("4.0.0-alpha.20"),await e.register(async e=>{let{ExportJSONPlugin:t}=await i.e(127).then(i.bind(i,127));e.addPlugin(new t)})}return i.r(u),i.d(u,{loadExportJSONPlugin:()=>d}),u})());
@@ -1,9 +1,7 @@
1
- import type { Container, IPlugin } from "@tsparticles/engine";
2
- import { ExportJSONInstance } from "./ExportJSONInstance.js";
1
+ import type { Container, IContainerPlugin, IPlugin } from "@tsparticles/engine";
3
2
  export declare class ExportJSONPlugin implements IPlugin {
4
- readonly id: string;
5
- constructor();
6
- getPlugin(container: Container): Promise<ExportJSONInstance>;
3
+ readonly id = "export-json";
4
+ getPlugin(container: Container): Promise<IContainerPlugin>;
7
5
  loadOptions(): void;
8
6
  needsPlugin(): boolean;
9
7
  }
@@ -1,5 +1,5 @@
1
1
  import type { Container, ExportResult, IContainerPlugin } from "@tsparticles/engine";
2
- export declare class ExportJSONInstance implements IContainerPlugin {
2
+ export declare class ExportJSONPluginInstance implements IContainerPlugin {
3
3
  private readonly _container;
4
4
  constructor(container: Container);
5
5
  export(type: string): Promise<ExportResult>;
package/types/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  import { type Engine } from "@tsparticles/engine";
2
- export declare function loadExportJSONPlugin(engine: Engine): void;
2
+ export declare function loadExportJSONPlugin(engine: Engine): Promise<void>;
@@ -1,22 +1,54 @@
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", "./ExportJSONInstance.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.ExportJSONPlugin = void 0;
13
- const ExportJSONInstance_js_1 = require("./ExportJSONInstance.js");
14
47
  class ExportJSONPlugin {
15
- constructor() {
16
- this.id = "export-json";
17
- }
18
- getPlugin(container) {
19
- return Promise.resolve(new ExportJSONInstance_js_1.ExportJSONInstance(container));
48
+ id = "export-json";
49
+ async getPlugin(container) {
50
+ const { ExportJSONPluginInstance } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./ExportJSONPluginInstance.js"))) : new Promise((resolve_1, reject_1) => { require(["./ExportJSONPluginInstance.js"], resolve_1, reject_1); }).then(__importStar));
51
+ return new ExportJSONPluginInstance(container);
20
52
  }
21
53
  loadOptions() {
22
54
  }
@@ -9,19 +9,11 @@
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ExportJSONInstance = void 0;
12
+ exports.ExportJSONPluginInstance = void 0;
13
13
  const indent = 2;
14
- class ExportJSONInstance {
14
+ class ExportJSONPluginInstance {
15
+ _container;
15
16
  constructor(container) {
16
- this._exportJSON = async () => {
17
- const json = JSON.stringify(this._container.actualOptions, (key, value) => {
18
- if (key.startsWith("_")) {
19
- return;
20
- }
21
- return value;
22
- }, indent);
23
- return Promise.resolve(new Blob([json], { type: "application/json" }));
24
- };
25
17
  this._container = container;
26
18
  }
27
19
  async export(type) {
@@ -36,6 +28,15 @@
36
28
  }
37
29
  return res;
38
30
  }
31
+ _exportJSON = async () => {
32
+ const json = JSON.stringify(this._container.actualOptions, (key, value) => {
33
+ if (key.startsWith("_")) {
34
+ return;
35
+ }
36
+ return value;
37
+ }, indent);
38
+ return Promise.resolve(new Blob([json], { type: "application/json" }));
39
+ };
39
40
  }
40
- exports.ExportJSONInstance = ExportJSONInstance;
41
+ exports.ExportJSONPluginInstance = ExportJSONPluginInstance;
41
42
  });
package/umd/index.js CHANGED
@@ -44,9 +44,9 @@ var __importStar = (this && this.__importStar) || (function () {
44
44
  var __syncRequire = typeof module === "object" && typeof module.exports === "object";
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
46
  exports.loadExportJSONPlugin = loadExportJSONPlugin;
47
- function loadExportJSONPlugin(engine) {
48
- engine.checkVersion("4.0.0-alpha.2");
49
- engine.register(async (e) => {
47
+ async function loadExportJSONPlugin(engine) {
48
+ engine.checkVersion("4.0.0-alpha.20");
49
+ await engine.register(async (e) => {
50
50
  const { ExportJSONPlugin } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./ExportJSONPlugin.js"))) : new Promise((resolve_1, reject_1) => { require(["./ExportJSONPlugin.js"], resolve_1, reject_1); }).then(__importStar));
51
51
  e.addPlugin(new ExportJSONPlugin());
52
52
  });
package/285.min.js DELETED
@@ -1,2 +0,0 @@
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}}}}]);
@@ -1 +0,0 @@
1
- /*! tsParticles Export JSON Plugin v4.0.0-alpha.2 by Matteo Bruni */
@@ -1,27 +0,0 @@
1
- const indent = 2;
2
- export class ExportJSONInstance {
3
- constructor(container) {
4
- this._exportJSON = async () => {
5
- const json = JSON.stringify(this._container.actualOptions, (key, value) => {
6
- if (key.startsWith("_")) {
7
- return;
8
- }
9
- return value;
10
- }, indent);
11
- return Promise.resolve(new Blob([json], { type: "application/json" }));
12
- };
13
- this._container = container;
14
- }
15
- async export(type) {
16
- const res = {
17
- supported: false,
18
- };
19
- switch (type) {
20
- case "json":
21
- res.supported = true;
22
- res.blob = await this._exportJSON();
23
- break;
24
- }
25
- return res;
26
- }
27
- }
@@ -1,27 +0,0 @@
1
- const indent = 2;
2
- export class ExportJSONInstance {
3
- constructor(container) {
4
- this._exportJSON = async () => {
5
- const json = JSON.stringify(this._container.actualOptions, (key, value) => {
6
- if (key.startsWith("_")) {
7
- return;
8
- }
9
- return value;
10
- }, indent);
11
- return Promise.resolve(new Blob([json], { type: "application/json" }));
12
- };
13
- this._container = container;
14
- }
15
- async export(type) {
16
- const res = {
17
- supported: false,
18
- };
19
- switch (type) {
20
- case "json":
21
- res.supported = true;
22
- res.blob = await this._exportJSON();
23
- break;
24
- }
25
- return res;
26
- }
27
- }
@@ -1,27 +0,0 @@
1
- const indent = 2;
2
- export class ExportJSONInstance {
3
- constructor(container) {
4
- this._exportJSON = async () => {
5
- const json = JSON.stringify(this._container.actualOptions, (key, value) => {
6
- if (key.startsWith("_")) {
7
- return;
8
- }
9
- return value;
10
- }, indent);
11
- return Promise.resolve(new Blob([json], { type: "application/json" }));
12
- };
13
- this._container = container;
14
- }
15
- async export(type) {
16
- const res = {
17
- supported: false,
18
- };
19
- switch (type) {
20
- case "json":
21
- res.supported = true;
22
- res.blob = await this._exportJSON();
23
- break;
24
- }
25
- return res;
26
- }
27
- }
@@ -1 +0,0 @@
1
- /*! tsParticles Export JSON Plugin v4.0.0-alpha.2 by Matteo Bruni */