@tsparticles/plugin-manual-particles 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.
Files changed (46) hide show
  1. package/187.min.js +2 -0
  2. package/187.min.js.LICENSE.txt +1 -0
  3. package/673.min.js +2 -0
  4. package/673.min.js.LICENSE.txt +1 -0
  5. package/LICENSE +21 -0
  6. package/README.md +74 -0
  7. package/browser/ManualParticlesPlugin.js +26 -0
  8. package/browser/ManualParticlesPluginInstance.js +15 -0
  9. package/browser/Options/Classes/ManualParticle.js +18 -0
  10. package/browser/Options/Interfaces/IManualParticle.js +1 -0
  11. package/browser/index.js +7 -0
  12. package/browser/package.json +1 -0
  13. package/browser/types.js +1 -0
  14. package/cjs/ManualParticlesPlugin.js +26 -0
  15. package/cjs/ManualParticlesPluginInstance.js +15 -0
  16. package/cjs/Options/Classes/ManualParticle.js +18 -0
  17. package/cjs/Options/Interfaces/IManualParticle.js +1 -0
  18. package/cjs/index.js +7 -0
  19. package/cjs/package.json +1 -0
  20. package/cjs/types.js +1 -0
  21. package/dist_browser_ManualParticlesPluginInstance_js.js +30 -0
  22. package/dist_browser_ManualParticlesPlugin_js.js +40 -0
  23. package/esm/ManualParticlesPlugin.js +26 -0
  24. package/esm/ManualParticlesPluginInstance.js +15 -0
  25. package/esm/Options/Classes/ManualParticle.js +18 -0
  26. package/esm/Options/Interfaces/IManualParticle.js +1 -0
  27. package/esm/index.js +7 -0
  28. package/esm/package.json +1 -0
  29. package/esm/types.js +1 -0
  30. package/package.json +95 -0
  31. package/report.html +40 -0
  32. package/tsparticles.plugin.manualParticles.js +305 -0
  33. package/tsparticles.plugin.manualParticles.min.js +2 -0
  34. package/tsparticles.plugin.manualParticles.min.js.LICENSE.txt +1 -0
  35. package/types/ManualParticlesPlugin.d.ts +9 -0
  36. package/types/ManualParticlesPluginInstance.d.ts +8 -0
  37. package/types/Options/Classes/ManualParticle.d.ts +7 -0
  38. package/types/Options/Interfaces/IManualParticle.d.ts +5 -0
  39. package/types/index.d.ts +2 -0
  40. package/types/types.d.ts +12 -0
  41. package/umd/ManualParticlesPlugin.js +74 -0
  42. package/umd/ManualParticlesPluginInstance.js +29 -0
  43. package/umd/Options/Classes/ManualParticle.js +32 -0
  44. package/umd/Options/Interfaces/IManualParticle.js +12 -0
  45. package/umd/index.js +54 -0
  46. package/umd/types.js +12 -0
@@ -0,0 +1,305 @@
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
+ /*
10
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
11
+ * This devtool is neither made for production nor for readable output files.
12
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
13
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
14
+ * or disable the default devtool with "devtool: false".
15
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
16
+ */
17
+ (function webpackUniversalModuleDefinition(root, factory) {
18
+ if(typeof exports === 'object' && typeof module === 'object')
19
+ module.exports = factory(require("@tsparticles/engine"));
20
+ else if(typeof define === 'function' && define.amd)
21
+ define(["@tsparticles/engine"], factory);
22
+ else {
23
+ var a = typeof exports === 'object' ? factory(require("@tsparticles/engine")) : factory(root["window"]);
24
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
25
+ }
26
+ })(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__) => {
27
+ return /******/ (() => { // webpackBootstrap
28
+ /******/ "use strict";
29
+ /******/ var __webpack_modules__ = ({
30
+
31
+ /***/ "./dist/browser/index.js"
32
+ /*!*******************************!*\
33
+ !*** ./dist/browser/index.js ***!
34
+ \*******************************/
35
+ (__unused_webpack___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 */ loadManualParticlesPlugin: () => (/* binding */ loadManualParticlesPlugin)\n/* harmony export */ });\nfunction loadManualParticlesPlugin(engine) {\n engine.checkVersion(\"4.0.0-alpha.4\");\n engine.register(async e => {\n const {\n ManualParticlesPlugin\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_ManualParticlesPlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ManualParticlesPlugin.js */ \"./dist/browser/ManualParticlesPlugin.js\"));\n e.addPlugin(new ManualParticlesPlugin());\n });\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-manual-particles/./dist/browser/index.js?\n}");
38
+
39
+ /***/ },
40
+
41
+ /***/ "@tsparticles/engine"
42
+ /*!*********************************************************************************************************************************!*\
43
+ !*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
44
+ \*********************************************************************************************************************************/
45
+ (module) {
46
+
47
+ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
48
+
49
+ /***/ }
50
+
51
+ /******/ });
52
+ /************************************************************************/
53
+ /******/ // The module cache
54
+ /******/ var __webpack_module_cache__ = {};
55
+ /******/
56
+ /******/ // The require function
57
+ /******/ function __webpack_require__(moduleId) {
58
+ /******/ // Check if module is in cache
59
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
60
+ /******/ if (cachedModule !== undefined) {
61
+ /******/ return cachedModule.exports;
62
+ /******/ }
63
+ /******/ // Check if module exists (development only)
64
+ /******/ if (__webpack_modules__[moduleId] === undefined) {
65
+ /******/ var e = new Error("Cannot find module '" + moduleId + "'");
66
+ /******/ e.code = 'MODULE_NOT_FOUND';
67
+ /******/ throw e;
68
+ /******/ }
69
+ /******/ // Create a new module (and put it into the cache)
70
+ /******/ var module = __webpack_module_cache__[moduleId] = {
71
+ /******/ // no module.id needed
72
+ /******/ // no module.loaded needed
73
+ /******/ exports: {}
74
+ /******/ };
75
+ /******/
76
+ /******/ // Execute the module function
77
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
78
+ /******/
79
+ /******/ // Return the exports of the module
80
+ /******/ return module.exports;
81
+ /******/ }
82
+ /******/
83
+ /******/ // expose the modules object (__webpack_modules__)
84
+ /******/ __webpack_require__.m = __webpack_modules__;
85
+ /******/
86
+ /************************************************************************/
87
+ /******/ /* webpack/runtime/define property getters */
88
+ /******/ (() => {
89
+ /******/ // define getter functions for harmony exports
90
+ /******/ __webpack_require__.d = (exports, definition) => {
91
+ /******/ for(var key in definition) {
92
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
93
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
94
+ /******/ }
95
+ /******/ }
96
+ /******/ };
97
+ /******/ })();
98
+ /******/
99
+ /******/ /* webpack/runtime/ensure chunk */
100
+ /******/ (() => {
101
+ /******/ __webpack_require__.f = {};
102
+ /******/ // This file contains only the entry chunk.
103
+ /******/ // The chunk loading function for additional chunks
104
+ /******/ __webpack_require__.e = (chunkId) => {
105
+ /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
106
+ /******/ __webpack_require__.f[key](chunkId, promises);
107
+ /******/ return promises;
108
+ /******/ }, []));
109
+ /******/ };
110
+ /******/ })();
111
+ /******/
112
+ /******/ /* webpack/runtime/get javascript chunk filename */
113
+ /******/ (() => {
114
+ /******/ // This function allow to reference async chunks
115
+ /******/ __webpack_require__.u = (chunkId) => {
116
+ /******/ // return url for filenames based on template
117
+ /******/ return "" + chunkId + ".js";
118
+ /******/ };
119
+ /******/ })();
120
+ /******/
121
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
122
+ /******/ (() => {
123
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
124
+ /******/ })();
125
+ /******/
126
+ /******/ /* webpack/runtime/load script */
127
+ /******/ (() => {
128
+ /******/ var inProgress = {};
129
+ /******/ var dataWebpackPrefix = "@tsparticles/plugin-manual-particles:";
130
+ /******/ // loadScript function to load a script via script tag
131
+ /******/ __webpack_require__.l = (url, done, key, chunkId) => {
132
+ /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
133
+ /******/ var script, needAttach;
134
+ /******/ if(key !== undefined) {
135
+ /******/ var scripts = document.getElementsByTagName("script");
136
+ /******/ for(var i = 0; i < scripts.length; i++) {
137
+ /******/ var s = scripts[i];
138
+ /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
139
+ /******/ }
140
+ /******/ }
141
+ /******/ if(!script) {
142
+ /******/ needAttach = true;
143
+ /******/ script = document.createElement('script');
144
+ /******/
145
+ /******/ script.charset = 'utf-8';
146
+ /******/ if (__webpack_require__.nc) {
147
+ /******/ script.setAttribute("nonce", __webpack_require__.nc);
148
+ /******/ }
149
+ /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
150
+ /******/
151
+ /******/ script.src = url;
152
+ /******/ }
153
+ /******/ inProgress[url] = [done];
154
+ /******/ var onScriptComplete = (prev, event) => {
155
+ /******/ // avoid mem leaks in IE.
156
+ /******/ script.onerror = script.onload = null;
157
+ /******/ clearTimeout(timeout);
158
+ /******/ var doneFns = inProgress[url];
159
+ /******/ delete inProgress[url];
160
+ /******/ script.parentNode && script.parentNode.removeChild(script);
161
+ /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
162
+ /******/ if(prev) return prev(event);
163
+ /******/ }
164
+ /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
165
+ /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
166
+ /******/ script.onload = onScriptComplete.bind(null, script.onload);
167
+ /******/ needAttach && document.head.appendChild(script);
168
+ /******/ };
169
+ /******/ })();
170
+ /******/
171
+ /******/ /* webpack/runtime/make namespace object */
172
+ /******/ (() => {
173
+ /******/ // define __esModule on exports
174
+ /******/ __webpack_require__.r = (exports) => {
175
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
176
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
177
+ /******/ }
178
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
179
+ /******/ };
180
+ /******/ })();
181
+ /******/
182
+ /******/ /* webpack/runtime/publicPath */
183
+ /******/ (() => {
184
+ /******/ var scriptUrl;
185
+ /******/ if (globalThis.importScripts) scriptUrl = globalThis.location + "";
186
+ /******/ var document = globalThis.document;
187
+ /******/ if (!scriptUrl && document) {
188
+ /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
189
+ /******/ scriptUrl = document.currentScript.src;
190
+ /******/ if (!scriptUrl) {
191
+ /******/ var scripts = document.getElementsByTagName("script");
192
+ /******/ if(scripts.length) {
193
+ /******/ var i = scripts.length - 1;
194
+ /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
195
+ /******/ }
196
+ /******/ }
197
+ /******/ }
198
+ /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
199
+ /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
200
+ /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
201
+ /******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
202
+ /******/ __webpack_require__.p = scriptUrl;
203
+ /******/ })();
204
+ /******/
205
+ /******/ /* webpack/runtime/jsonp chunk loading */
206
+ /******/ (() => {
207
+ /******/ // no baseURI
208
+ /******/
209
+ /******/ // object to store loaded and loading chunks
210
+ /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
211
+ /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
212
+ /******/ var installedChunks = {
213
+ /******/ "tsparticles.plugin.manualParticles": 0
214
+ /******/ };
215
+ /******/
216
+ /******/ __webpack_require__.f.j = (chunkId, promises) => {
217
+ /******/ // JSONP chunk loading for javascript
218
+ /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
219
+ /******/ if(installedChunkData !== 0) { // 0 means "already installed".
220
+ /******/
221
+ /******/ // a Promise means "currently loading".
222
+ /******/ if(installedChunkData) {
223
+ /******/ promises.push(installedChunkData[2]);
224
+ /******/ } else {
225
+ /******/ if(true) { // all chunks have JS
226
+ /******/ // setup Promise in chunk cache
227
+ /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
228
+ /******/ promises.push(installedChunkData[2] = promise);
229
+ /******/
230
+ /******/ // start chunk loading
231
+ /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
232
+ /******/ // create error before stack unwound to get useful stacktrace later
233
+ /******/ var error = new Error();
234
+ /******/ var loadingEnded = (event) => {
235
+ /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
236
+ /******/ installedChunkData = installedChunks[chunkId];
237
+ /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
238
+ /******/ if(installedChunkData) {
239
+ /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
240
+ /******/ var realSrc = event && event.target && event.target.src;
241
+ /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
242
+ /******/ error.name = 'ChunkLoadError';
243
+ /******/ error.type = errorType;
244
+ /******/ error.request = realSrc;
245
+ /******/ installedChunkData[1](error);
246
+ /******/ }
247
+ /******/ }
248
+ /******/ };
249
+ /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
250
+ /******/ }
251
+ /******/ }
252
+ /******/ }
253
+ /******/ };
254
+ /******/
255
+ /******/ // no prefetching
256
+ /******/
257
+ /******/ // no preloaded
258
+ /******/
259
+ /******/ // no HMR
260
+ /******/
261
+ /******/ // no HMR manifest
262
+ /******/
263
+ /******/ // no on chunks loaded
264
+ /******/
265
+ /******/ // install a JSONP callback for chunk loading
266
+ /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
267
+ /******/ var [chunkIds, moreModules, runtime] = data;
268
+ /******/ // add "moreModules" to the modules object,
269
+ /******/ // then flag all "chunkIds" as loaded and fire callback
270
+ /******/ var moduleId, chunkId, i = 0;
271
+ /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
272
+ /******/ for(moduleId in moreModules) {
273
+ /******/ if(__webpack_require__.o(moreModules, moduleId)) {
274
+ /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
275
+ /******/ }
276
+ /******/ }
277
+ /******/ if(runtime) var result = runtime(__webpack_require__);
278
+ /******/ }
279
+ /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
280
+ /******/ for(;i < chunkIds.length; i++) {
281
+ /******/ chunkId = chunkIds[i];
282
+ /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
283
+ /******/ installedChunks[chunkId][0]();
284
+ /******/ }
285
+ /******/ installedChunks[chunkId] = 0;
286
+ /******/ }
287
+ /******/
288
+ /******/ }
289
+ /******/
290
+ /******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_plugin_manual_particles"] = this["webpackChunk_tsparticles_plugin_manual_particles"] || [];
291
+ /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
292
+ /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
293
+ /******/ })();
294
+ /******/
295
+ /************************************************************************/
296
+ /******/
297
+ /******/ // startup
298
+ /******/ // Load entry module and return exports
299
+ /******/ // This entry module can't be inlined because the eval devtool is used.
300
+ /******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
301
+ /******/
302
+ /******/ return __webpack_exports__;
303
+ /******/ })()
304
+ ;
305
+ });
@@ -0,0 +1,2 @@
1
+ /*! For license information please see tsparticles.plugin.manualParticles.min.js.LICENSE.txt */
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e=>(()=>{var t,r,o={303(t){t.exports=e}},a={};function n(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return o[e](r,r.exports,n),r.exports}n.m=o,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.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@tsparticles/plugin-manual-particles:",n.l=(e,o,a,i)=>{if(t[e])t[e].push(o);else{var l,s;if(void 0!==a)for(var p=document.getElementsByTagName("script"),c=0;c<p.length;c++){var u=p[c];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==r+a){l=u;break}}l||(s=!0,(l=document.createElement("script")).charset="utf-8",n.nc&&l.setAttribute("nonce",n.nc),l.setAttribute("data-webpack",r+a),l.src=e),t[e]=[o];var d=(r,o)=>{l.onerror=l.onload=null,clearTimeout(f);var a=t[e];if(delete t[e],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),s&&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;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.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={715: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 a=new Promise(((r,a)=>o=e[t]=[r,a]));r.push(o[2]=a);var i=n.p+n.u(t),l=new Error;n.l(i,(r=>{if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var a=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;l.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",l.name="ChunkLoadError",l.type=a,l.request=i,o[1](l)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,a,[i,l,s]=r,p=0;if(i.some((t=>0!==e[t]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(s)s(n)}for(t&&t(r);p<i.length;p++)a=i[p],n.o(e,a)&&e[a]&&e[a][0](),e[a]=0},r=this.webpackChunk_tsparticles_plugin_manual_particles=this.webpackChunk_tsparticles_plugin_manual_particles||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var i={};function l(e){e.checkVersion("4.0.0-alpha.4"),e.register((async e=>{const{ManualParticlesPlugin:t}=await n.e(187).then(n.bind(n,187));e.addPlugin(new t)}))}return n.r(i),n.d(i,{loadManualParticlesPlugin:()=>l}),i})()));
@@ -0,0 +1 @@
1
+ /*! tsParticles Manual Particles Plugin v4.0.0-alpha.4 by Matteo Bruni */
@@ -0,0 +1,9 @@
1
+ import { type Container, type IContainerPlugin, type IPlugin, type RecursivePartial } from "@tsparticles/engine";
2
+ import type { IManualParticlesOptions, ManualParticlesContainer, ManualParticlesOptions } from "./types.js";
3
+ export declare class ManualParticlesPlugin implements IPlugin {
4
+ readonly id: string;
5
+ constructor();
6
+ getPlugin(container: ManualParticlesContainer): Promise<IContainerPlugin>;
7
+ loadOptions(_container: Container, options: ManualParticlesOptions, source?: RecursivePartial<IManualParticlesOptions>): void;
8
+ needsPlugin(options?: RecursivePartial<IManualParticlesOptions>): boolean;
9
+ }
@@ -0,0 +1,8 @@
1
+ import { type IContainerPlugin } from "@tsparticles/engine";
2
+ import type { ManualParticlesContainer } from "./types.js";
3
+ export declare class ManualParticlesPluginInstance implements IContainerPlugin {
4
+ private readonly _container;
5
+ constructor(container: ManualParticlesContainer);
6
+ particlesDensityCount(): number;
7
+ particlesInitialization(): boolean;
8
+ }
@@ -0,0 +1,7 @@
1
+ import { type ICoordinatesWithMode, type IOptionLoader, type IParticlesOptions, type RecursivePartial } from "@tsparticles/engine";
2
+ import type { IManualParticle } from "../Interfaces/IManualParticle.js";
3
+ export declare class ManualParticle implements IManualParticle, IOptionLoader<IManualParticle> {
4
+ options?: RecursivePartial<IParticlesOptions>;
5
+ position?: ICoordinatesWithMode;
6
+ load(data?: RecursivePartial<IManualParticle>): void;
7
+ }
@@ -0,0 +1,5 @@
1
+ import type { ICoordinatesWithMode, IParticlesOptions, RecursivePartial } from "@tsparticles/engine";
2
+ export interface IManualParticle {
3
+ options?: RecursivePartial<IParticlesOptions>;
4
+ position?: ICoordinatesWithMode;
5
+ }
@@ -0,0 +1,2 @@
1
+ import { type Engine } from "@tsparticles/engine";
2
+ export declare function loadManualParticlesPlugin(engine: Engine): void;
@@ -0,0 +1,12 @@
1
+ import type { Container, IOptions, Options } from "@tsparticles/engine";
2
+ import type { IManualParticle } from "./Options/Interfaces/IManualParticle.js";
3
+ import type { ManualParticle } from "./Options/Classes/ManualParticle.js";
4
+ export type IManualParticlesOptions = IOptions & {
5
+ manualParticles?: IManualParticle[];
6
+ };
7
+ export type ManualParticlesOptions = Options & {
8
+ manualParticles?: ManualParticle[];
9
+ };
10
+ export type ManualParticlesContainer = Container & {
11
+ actualOptions: ManualParticlesOptions;
12
+ };
@@ -0,0 +1,74 @@
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
+ })();
34
+ (function (factory) {
35
+ if (typeof module === "object" && typeof module.exports === "object") {
36
+ var v = factory(require, exports);
37
+ if (v !== undefined) module.exports = v;
38
+ }
39
+ else if (typeof define === "function" && define.amd) {
40
+ define(["require", "exports", "./Options/Classes/ManualParticle.js"], factory);
41
+ }
42
+ })(function (require, exports) {
43
+ "use strict";
44
+ var __syncRequire = typeof module === "object" && typeof module.exports === "object";
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.ManualParticlesPlugin = void 0;
47
+ const ManualParticle_js_1 = require("./Options/Classes/ManualParticle.js");
48
+ class ManualParticlesPlugin {
49
+ constructor() {
50
+ this.id = "manual-particles";
51
+ }
52
+ async getPlugin(container) {
53
+ const { ManualParticlesPluginInstance } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./ManualParticlesPluginInstance.js"))) : new Promise((resolve_1, reject_1) => { require(["./ManualParticlesPluginInstance.js"], resolve_1, reject_1); }).then(__importStar));
54
+ return new ManualParticlesPluginInstance(container);
55
+ }
56
+ loadOptions(_container, options, source) {
57
+ if (!this.needsPlugin(options) && !this.needsPlugin(source)) {
58
+ return;
59
+ }
60
+ options.manualParticles ??= [];
61
+ if (source?.manualParticles) {
62
+ options.manualParticles = source.manualParticles.map(t => {
63
+ const tmp = new ManualParticle_js_1.ManualParticle();
64
+ tmp.load(t);
65
+ return tmp;
66
+ });
67
+ }
68
+ }
69
+ needsPlugin(options) {
70
+ return !!options?.manualParticles?.length;
71
+ }
72
+ }
73
+ exports.ManualParticlesPlugin = ManualParticlesPlugin;
74
+ });
@@ -0,0 +1,29 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "@tsparticles/engine"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ManualParticlesPluginInstance = void 0;
13
+ const engine_1 = require("@tsparticles/engine");
14
+ const noParticles = 0;
15
+ class ManualParticlesPluginInstance {
16
+ constructor(container) {
17
+ this._container = container;
18
+ }
19
+ particlesDensityCount() {
20
+ return this._container.actualOptions.manualParticles?.length ?? noParticles;
21
+ }
22
+ particlesInitialization() {
23
+ const container = this._container, options = container.actualOptions;
24
+ options.manualParticles?.forEach(p => container.particles.addParticle(p.position ? (0, engine_1.getPosition)(p.position, container.canvas.size) : undefined, p.options));
25
+ return false;
26
+ }
27
+ }
28
+ exports.ManualParticlesPluginInstance = ManualParticlesPluginInstance;
29
+ });
@@ -0,0 +1,32 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "@tsparticles/engine"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ManualParticle = void 0;
13
+ const engine_1 = require("@tsparticles/engine");
14
+ class ManualParticle {
15
+ load(data) {
16
+ if ((0, engine_1.isNull)(data)) {
17
+ return;
18
+ }
19
+ if (data.position) {
20
+ this.position = {
21
+ x: data.position.x ?? engine_1.manualDefaultPosition,
22
+ y: data.position.y ?? engine_1.manualDefaultPosition,
23
+ mode: data.position.mode ?? engine_1.PixelMode.percent,
24
+ };
25
+ }
26
+ if (data.options) {
27
+ this.options = (0, engine_1.deepExtend)({}, data.options);
28
+ }
29
+ }
30
+ }
31
+ exports.ManualParticle = ManualParticle;
32
+ });
@@ -0,0 +1,12 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ });
package/umd/index.js ADDED
@@ -0,0 +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
+ })();
34
+ (function (factory) {
35
+ if (typeof module === "object" && typeof module.exports === "object") {
36
+ var v = factory(require, exports);
37
+ if (v !== undefined) module.exports = v;
38
+ }
39
+ else if (typeof define === "function" && define.amd) {
40
+ define(["require", "exports"], factory);
41
+ }
42
+ })(function (require, exports) {
43
+ "use strict";
44
+ var __syncRequire = typeof module === "object" && typeof module.exports === "object";
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.loadManualParticlesPlugin = loadManualParticlesPlugin;
47
+ function loadManualParticlesPlugin(engine) {
48
+ engine.checkVersion("4.0.0-alpha.4");
49
+ engine.register(async (e) => {
50
+ const { ManualParticlesPlugin } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./ManualParticlesPlugin.js"))) : new Promise((resolve_1, reject_1) => { require(["./ManualParticlesPlugin.js"], resolve_1, reject_1); }).then(__importStar));
51
+ e.addPlugin(new ManualParticlesPlugin());
52
+ });
53
+ }
54
+ });
package/umd/types.js ADDED
@@ -0,0 +1,12 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ });