@tsparticles/plugin-export-json 3.9.1 → 4.0.0-alpha.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.
@@ -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
- * v3.9.1
7
+ * v4.0.0-alpha.0
8
8
  */
9
9
  /*
10
10
  * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
@@ -28,35 +28,15 @@ return /******/ (() => { // webpackBootstrap
28
28
  /******/ "use strict";
29
29
  /******/ var __webpack_modules__ = ({
30
30
 
31
- /***/ "./dist/browser/ExportJSONInstance.js":
32
- /*!********************************************!*\
33
- !*** ./dist/browser/ExportJSONInstance.js ***!
34
- \********************************************/
35
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
36
-
37
- 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, engine) {\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 this._engine = engine;\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}");
38
-
39
- /***/ }),
40
-
41
- /***/ "./dist/browser/ExportJSONPlugin.js":
42
- /*!******************************************!*\
43
- !*** ./dist/browser/ExportJSONPlugin.js ***!
44
- \******************************************/
45
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
46
-
47
- 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(engine) {\n this.id = \"export-json\";\n this._engine = engine;\n }\n getPlugin(container) {\n return Promise.resolve(new _ExportJSONInstance_js__WEBPACK_IMPORTED_MODULE_0__.ExportJSONInstance(container, this._engine));\n }\n loadOptions() {}\n needsPlugin() {\n return true;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-export-json/./dist/browser/ExportJSONPlugin.js?\n}");
48
-
49
- /***/ }),
50
-
51
- /***/ "./dist/browser/index.js":
31
+ /***/ "./dist/browser/index.js"
52
32
  /*!*******************************!*\
53
33
  !*** ./dist/browser/index.js ***!
54
34
  \*******************************/
55
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
35
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
56
36
 
57
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadExportJSONPlugin: () => (/* binding */ loadExportJSONPlugin)\n/* harmony export */ });\n/* harmony import */ var _ExportJSONPlugin_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ExportJSONPlugin.js */ \"./dist/browser/ExportJSONPlugin.js\");\n\nasync function loadExportJSONPlugin(engine, refresh = true) {\n engine.checkVersion(\"3.9.1\");\n await engine.addPlugin(new _ExportJSONPlugin_js__WEBPACK_IMPORTED_MODULE_0__.ExportJSONPlugin(engine), refresh);\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 */ });\nfunction loadExportJSONPlugin(engine) {\n engine.checkVersion(\"4.0.0-alpha.0\");\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}");
58
38
 
59
- /***/ })
39
+ /***/ }
60
40
 
61
41
  /******/ });
62
42
  /************************************************************************/
@@ -70,6 +50,12 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
70
50
  /******/ if (cachedModule !== undefined) {
71
51
  /******/ return cachedModule.exports;
72
52
  /******/ }
53
+ /******/ // Check if module exists (development only)
54
+ /******/ if (__webpack_modules__[moduleId] === undefined) {
55
+ /******/ var e = new Error("Cannot find module '" + moduleId + "'");
56
+ /******/ e.code = 'MODULE_NOT_FOUND';
57
+ /******/ throw e;
58
+ /******/ }
73
59
  /******/ // Create a new module (and put it into the cache)
74
60
  /******/ var module = __webpack_module_cache__[moduleId] = {
75
61
  /******/ // no module.id needed
@@ -84,6 +70,9 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
84
70
  /******/ return module.exports;
85
71
  /******/ }
86
72
  /******/
73
+ /******/ // expose the modules object (__webpack_modules__)
74
+ /******/ __webpack_require__.m = __webpack_modules__;
75
+ /******/
87
76
  /************************************************************************/
88
77
  /******/ /* webpack/runtime/define property getters */
89
78
  /******/ (() => {
@@ -97,11 +86,90 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
97
86
  /******/ };
98
87
  /******/ })();
99
88
  /******/
89
+ /******/ /* webpack/runtime/ensure chunk */
90
+ /******/ (() => {
91
+ /******/ __webpack_require__.f = {};
92
+ /******/ // This file contains only the entry chunk.
93
+ /******/ // The chunk loading function for additional chunks
94
+ /******/ __webpack_require__.e = (chunkId) => {
95
+ /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
96
+ /******/ __webpack_require__.f[key](chunkId, promises);
97
+ /******/ return promises;
98
+ /******/ }, []));
99
+ /******/ };
100
+ /******/ })();
101
+ /******/
102
+ /******/ /* webpack/runtime/get javascript chunk filename */
103
+ /******/ (() => {
104
+ /******/ // This function allow to reference async chunks
105
+ /******/ __webpack_require__.u = (chunkId) => {
106
+ /******/ // return url for filenames based on template
107
+ /******/ return "" + chunkId + ".js";
108
+ /******/ };
109
+ /******/ })();
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
+ /******/
100
123
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
101
124
  /******/ (() => {
102
125
  /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
103
126
  /******/ })();
104
127
  /******/
128
+ /******/ /* webpack/runtime/load script */
129
+ /******/ (() => {
130
+ /******/ var inProgress = {};
131
+ /******/ var dataWebpackPrefix = "@tsparticles/plugin-export-json:";
132
+ /******/ // loadScript function to load a script via script tag
133
+ /******/ __webpack_require__.l = (url, done, key, chunkId) => {
134
+ /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
135
+ /******/ var script, needAttach;
136
+ /******/ if(key !== undefined) {
137
+ /******/ var scripts = document.getElementsByTagName("script");
138
+ /******/ for(var i = 0; i < scripts.length; i++) {
139
+ /******/ var s = scripts[i];
140
+ /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
141
+ /******/ }
142
+ /******/ }
143
+ /******/ if(!script) {
144
+ /******/ needAttach = true;
145
+ /******/ script = document.createElement('script');
146
+ /******/
147
+ /******/ script.charset = 'utf-8';
148
+ /******/ if (__webpack_require__.nc) {
149
+ /******/ script.setAttribute("nonce", __webpack_require__.nc);
150
+ /******/ }
151
+ /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
152
+ /******/
153
+ /******/ script.src = url;
154
+ /******/ }
155
+ /******/ inProgress[url] = [done];
156
+ /******/ var onScriptComplete = (prev, event) => {
157
+ /******/ // avoid mem leaks in IE.
158
+ /******/ script.onerror = script.onload = null;
159
+ /******/ clearTimeout(timeout);
160
+ /******/ var doneFns = inProgress[url];
161
+ /******/ delete inProgress[url];
162
+ /******/ script.parentNode && script.parentNode.removeChild(script);
163
+ /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
164
+ /******/ if(prev) return prev(event);
165
+ /******/ }
166
+ /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
167
+ /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
168
+ /******/ script.onload = onScriptComplete.bind(null, script.onload);
169
+ /******/ needAttach && document.head.appendChild(script);
170
+ /******/ };
171
+ /******/ })();
172
+ /******/
105
173
  /******/ /* webpack/runtime/make namespace object */
106
174
  /******/ (() => {
107
175
  /******/ // define __esModule on exports
@@ -113,6 +181,119 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
113
181
  /******/ };
114
182
  /******/ })();
115
183
  /******/
184
+ /******/ /* webpack/runtime/publicPath */
185
+ /******/ (() => {
186
+ /******/ var scriptUrl;
187
+ /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
188
+ /******/ var document = __webpack_require__.g.document;
189
+ /******/ if (!scriptUrl && document) {
190
+ /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
191
+ /******/ scriptUrl = document.currentScript.src;
192
+ /******/ if (!scriptUrl) {
193
+ /******/ var scripts = document.getElementsByTagName("script");
194
+ /******/ if(scripts.length) {
195
+ /******/ var i = scripts.length - 1;
196
+ /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
197
+ /******/ }
198
+ /******/ }
199
+ /******/ }
200
+ /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
201
+ /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
202
+ /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
203
+ /******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
204
+ /******/ __webpack_require__.p = scriptUrl;
205
+ /******/ })();
206
+ /******/
207
+ /******/ /* webpack/runtime/jsonp chunk loading */
208
+ /******/ (() => {
209
+ /******/ // no baseURI
210
+ /******/
211
+ /******/ // object to store loaded and loading chunks
212
+ /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
213
+ /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
214
+ /******/ var installedChunks = {
215
+ /******/ "tsparticles.plugin.export.json": 0
216
+ /******/ };
217
+ /******/
218
+ /******/ __webpack_require__.f.j = (chunkId, promises) => {
219
+ /******/ // JSONP chunk loading for javascript
220
+ /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
221
+ /******/ if(installedChunkData !== 0) { // 0 means "already installed".
222
+ /******/
223
+ /******/ // a Promise means "currently loading".
224
+ /******/ if(installedChunkData) {
225
+ /******/ promises.push(installedChunkData[2]);
226
+ /******/ } else {
227
+ /******/ if(true) { // all chunks have JS
228
+ /******/ // setup Promise in chunk cache
229
+ /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
230
+ /******/ promises.push(installedChunkData[2] = promise);
231
+ /******/
232
+ /******/ // start chunk loading
233
+ /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
234
+ /******/ // create error before stack unwound to get useful stacktrace later
235
+ /******/ var error = new Error();
236
+ /******/ var loadingEnded = (event) => {
237
+ /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
238
+ /******/ installedChunkData = installedChunks[chunkId];
239
+ /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
240
+ /******/ if(installedChunkData) {
241
+ /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
242
+ /******/ var realSrc = event && event.target && event.target.src;
243
+ /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
244
+ /******/ error.name = 'ChunkLoadError';
245
+ /******/ error.type = errorType;
246
+ /******/ error.request = realSrc;
247
+ /******/ installedChunkData[1](error);
248
+ /******/ }
249
+ /******/ }
250
+ /******/ };
251
+ /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
252
+ /******/ }
253
+ /******/ }
254
+ /******/ }
255
+ /******/ };
256
+ /******/
257
+ /******/ // no prefetching
258
+ /******/
259
+ /******/ // no preloaded
260
+ /******/
261
+ /******/ // no HMR
262
+ /******/
263
+ /******/ // no HMR manifest
264
+ /******/
265
+ /******/ // no on chunks loaded
266
+ /******/
267
+ /******/ // install a JSONP callback for chunk loading
268
+ /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
269
+ /******/ var [chunkIds, moreModules, runtime] = data;
270
+ /******/ // add "moreModules" to the modules object,
271
+ /******/ // then flag all "chunkIds" as loaded and fire callback
272
+ /******/ var moduleId, chunkId, i = 0;
273
+ /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
274
+ /******/ for(moduleId in moreModules) {
275
+ /******/ if(__webpack_require__.o(moreModules, moduleId)) {
276
+ /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
277
+ /******/ }
278
+ /******/ }
279
+ /******/ if(runtime) var result = runtime(__webpack_require__);
280
+ /******/ }
281
+ /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
282
+ /******/ for(;i < chunkIds.length; i++) {
283
+ /******/ chunkId = chunkIds[i];
284
+ /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
285
+ /******/ installedChunks[chunkId][0]();
286
+ /******/ }
287
+ /******/ installedChunks[chunkId] = 0;
288
+ /******/ }
289
+ /******/
290
+ /******/ }
291
+ /******/
292
+ /******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_plugin_export_json"] = this["webpackChunk_tsparticles_plugin_export_json"] || [];
293
+ /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
294
+ /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
295
+ /******/ })();
296
+ /******/
116
297
  /************************************************************************/
117
298
  /******/
118
299
  /******/ // startup
@@ -1,2 +1,2 @@
1
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 o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(this,(()=>(()=>{var e={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{loadExportJSONPlugin:()=>r});class o{constructor(e,t){this._exportJSON=async()=>{const e=JSON.stringify(this._container.actualOptions,((e,t)=>{if(!e.startsWith("_"))return t}),2);return Promise.resolve(new Blob([e],{type:"application/json"}))},this._container=e,this._engine=t}async export(e){const t={supported:!1};if("json"===e)t.supported=!0,t.blob=await this._exportJSON();return t}}class n{constructor(e){this.id="export-json",this._engine=e}getPlugin(e){return Promise.resolve(new o(e,this._engine))}loadOptions(){}needsPlugin(){return!0}}async function r(e,t=!0){e.checkVersion("3.9.1"),await e.addPlugin(new n(e),t)}return t})()));
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.0"),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 +1 @@
1
- /*! tsParticles Export JSON Plugin v3.9.1 by Matteo Bruni */
1
+ /*! tsParticles Export JSON Plugin v4.0.0-alpha.0 by Matteo Bruni */
@@ -1,8 +1,7 @@
1
- import type { Container, Engine, ExportResult, IContainerPlugin } from "@tsparticles/engine";
1
+ import type { Container, ExportResult, IContainerPlugin } from "@tsparticles/engine";
2
2
  export declare class ExportJSONInstance implements IContainerPlugin {
3
3
  private readonly _container;
4
- private readonly _engine;
5
- constructor(container: Container, engine: Engine);
4
+ constructor(container: Container);
6
5
  export(type: string): Promise<ExportResult>;
7
6
  private readonly _exportJSON;
8
7
  }
@@ -1,9 +1,8 @@
1
- import type { Container, Engine, IPlugin } from "@tsparticles/engine";
1
+ import type { Container, IPlugin } from "@tsparticles/engine";
2
2
  import { ExportJSONInstance } from "./ExportJSONInstance.js";
3
3
  export declare class ExportJSONPlugin implements IPlugin {
4
4
  readonly id: string;
5
- private readonly _engine;
6
- constructor(engine: Engine);
5
+ constructor();
7
6
  getPlugin(container: Container): Promise<ExportJSONInstance>;
8
7
  loadOptions(): void;
9
8
  needsPlugin(): boolean;
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, refresh?: boolean): Promise<void>;
2
+ export declare function loadExportJSONPlugin(engine: Engine): void;
@@ -12,7 +12,7 @@
12
12
  exports.ExportJSONInstance = void 0;
13
13
  const indent = 2;
14
14
  class ExportJSONInstance {
15
- constructor(container, engine) {
15
+ constructor(container) {
16
16
  this._exportJSON = async () => {
17
17
  const json = JSON.stringify(this._container.actualOptions, (key, value) => {
18
18
  if (key.startsWith("_")) {
@@ -23,7 +23,6 @@
23
23
  return Promise.resolve(new Blob([json], { type: "application/json" }));
24
24
  };
25
25
  this._container = container;
26
- this._engine = engine;
27
26
  }
28
27
  async export(type) {
29
28
  const res = {
@@ -12,12 +12,11 @@
12
12
  exports.ExportJSONPlugin = void 0;
13
13
  const ExportJSONInstance_js_1 = require("./ExportJSONInstance.js");
14
14
  class ExportJSONPlugin {
15
- constructor(engine) {
15
+ constructor() {
16
16
  this.id = "export-json";
17
- this._engine = engine;
18
17
  }
19
18
  getPlugin(container) {
20
- return Promise.resolve(new ExportJSONInstance_js_1.ExportJSONInstance(container, this._engine));
19
+ return Promise.resolve(new ExportJSONInstance_js_1.ExportJSONInstance(container));
21
20
  }
22
21
  loadOptions() {
23
22
  }
package/umd/index.js CHANGED
@@ -1,18 +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", "./ExportJSONPlugin.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.loadExportJSONPlugin = loadExportJSONPlugin;
13
- const ExportJSONPlugin_js_1 = require("./ExportJSONPlugin.js");
14
- async function loadExportJSONPlugin(engine, refresh = true) {
15
- engine.checkVersion("3.9.1");
16
- await engine.addPlugin(new ExportJSONPlugin_js_1.ExportJSONPlugin(engine), refresh);
47
+ function loadExportJSONPlugin(engine) {
48
+ engine.checkVersion("4.0.0-alpha.0");
49
+ engine.register(async (e) => {
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
+ e.addPlugin(new ExportJSONPlugin());
52
+ });
17
53
  }
18
54
  });