@tsparticles/riot 4.0.0-beta.16 → 4.0.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/CHANGELOG.md +8 -0
- package/dist/riot-particles.cjs +124 -0
- package/dist/riot-particles.cjs.map +1 -0
- package/dist/riot-particles.esm.js +117 -0
- package/dist/riot-particles.esm.js.map +1 -0
- package/package.json +13 -6
- package/rollup.config.cjs +44 -23
- package/typedoc.json +1 -1
- package/dist/riot-particles.js +0 -127
- package/dist/riot-particles.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [4.0.0](https://github.com/tsparticles/tsparticles/compare/v4.0.0-beta.17...v4.0.0) (2026-05-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @tsparticles/riot
|
|
9
|
+
|
|
10
|
+
# [4.0.0-beta.17](https://github.com/tsparticles/tsparticles/compare/v4.0.0-beta.16...v4.0.0-beta.17) (2026-05-15)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @tsparticles/riot
|
|
13
|
+
|
|
6
14
|
# [4.0.0-beta.16](https://github.com/tsparticles/tsparticles/compare/v4.0.0-beta.15...v4.0.0-beta.16) (2026-05-09)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @tsparticles/riot
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var engine = require('@tsparticles/engine');
|
|
6
|
+
|
|
7
|
+
let oldId;
|
|
8
|
+
let initialized = false;
|
|
9
|
+
let initPromise;
|
|
10
|
+
let initCallback;
|
|
11
|
+
|
|
12
|
+
async function initParticlesEngine(
|
|
13
|
+
cb,
|
|
14
|
+
) {
|
|
15
|
+
if (initialized) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (initPromise) {
|
|
20
|
+
if (initCallback !== cb) {
|
|
21
|
+
throw new Error("initParticlesEngine callback must be stable across the app lifecycle.");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
await initPromise;
|
|
25
|
+
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
initCallback = cb;
|
|
30
|
+
initPromise = (async () => {
|
|
31
|
+
if (cb) {
|
|
32
|
+
await cb(engine.tsParticles);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
await engine.tsParticles.init();
|
|
36
|
+
initialized = true;
|
|
37
|
+
})().catch((error) => {
|
|
38
|
+
initPromise = undefined;
|
|
39
|
+
initCallback = undefined;
|
|
40
|
+
initialized = false;
|
|
41
|
+
|
|
42
|
+
throw error;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
await initPromise;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function isParticlesEngineInitialized() {
|
|
49
|
+
return initialized;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function waitForParticlesEngineInitialization() {
|
|
53
|
+
await (initPromise ?? Promise.resolve());
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
var riotParticles = {
|
|
57
|
+
css: null,
|
|
58
|
+
|
|
59
|
+
exports: {
|
|
60
|
+
async onMounted(props) {
|
|
61
|
+
await waitForParticlesEngineInitialization();
|
|
62
|
+
|
|
63
|
+
if (!isParticlesEngineInitialized()) {
|
|
64
|
+
throw new Error("initParticlesEngine(...) must be called once before mounting <riot-particles /> components.");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (oldId) {
|
|
68
|
+
const oldContainer = engine.tsParticles.dom().find((c) => c.id === oldId);
|
|
69
|
+
|
|
70
|
+
if (oldContainer) {
|
|
71
|
+
oldContainer.destroy();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (props.id) {
|
|
76
|
+
const cb = (container) => {
|
|
77
|
+
if (props.particlesLoaded) {
|
|
78
|
+
props.particlesLoaded(container);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
oldId = props.id;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
engine.tsParticles.load({ id: props.id, options: props.options, url: props.url }).then(cb);
|
|
85
|
+
} else {
|
|
86
|
+
if (props.particlesLoaded) {
|
|
87
|
+
props.particlesLoaded(undefined);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
template: (
|
|
94
|
+
template,
|
|
95
|
+
expressionTypes,
|
|
96
|
+
bindingTypes,
|
|
97
|
+
getComponent
|
|
98
|
+
) => template(
|
|
99
|
+
'<div expr0="expr0"></div>',
|
|
100
|
+
[
|
|
101
|
+
{
|
|
102
|
+
redundantAttribute: 'expr0',
|
|
103
|
+
selector: '[expr0]',
|
|
104
|
+
|
|
105
|
+
expressions: [
|
|
106
|
+
{
|
|
107
|
+
type: expressionTypes.ATTRIBUTE,
|
|
108
|
+
isBoolean: false,
|
|
109
|
+
name: 'id',
|
|
110
|
+
evaluate: _scope => _scope.props.id
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
),
|
|
116
|
+
|
|
117
|
+
name: 'riot-particles'
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
exports.default = riotParticles;
|
|
121
|
+
exports.initParticlesEngine = initParticlesEngine;
|
|
122
|
+
exports.isParticlesEngineInitialized = isParticlesEngineInitialized;
|
|
123
|
+
exports.waitForParticlesEngineInitialization = waitForParticlesEngineInitialization;
|
|
124
|
+
//# sourceMappingURL=riot-particles.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"riot-particles.cjs","sources":["../src/riot-particles.riot"],"sourcesContent":["<riot-particles>\n <script>\n import { tsParticles } from \"@tsparticles/engine\";\n\n let oldId;\n let initialized = false;\n let initPromise;\n let initCallback;\n\n export async function initParticlesEngine(\n cb,\n ) {\n if (initialized) {\n return;\n }\n\n if (initPromise) {\n if (initCallback !== cb) {\n throw new Error(\"initParticlesEngine callback must be stable across the app lifecycle.\");\n }\n\n await initPromise;\n\n return;\n }\n\n initCallback = cb;\n initPromise = (async () => {\n if (cb) {\n await cb(tsParticles);\n }\n\n await tsParticles.init();\n initialized = true;\n })().catch((error) => {\n initPromise = undefined;\n initCallback = undefined;\n initialized = false;\n\n throw error;\n });\n\n await initPromise;\n }\n\n export function isParticlesEngineInitialized() {\n return initialized;\n }\n\n export async function waitForParticlesEngineInitialization() {\n await (initPromise ?? Promise.resolve());\n }\n\n export default {\n async onMounted(props) {\n await waitForParticlesEngineInitialization();\n\n if (!isParticlesEngineInitialized()) {\n throw new Error(\"initParticlesEngine(...) must be called once before mounting <riot-particles /> components.\");\n }\n\n if (oldId) {\n const oldContainer = tsParticles.dom().find((c) => c.id === oldId);\n\n if (oldContainer) {\n oldContainer.destroy();\n }\n }\n\n if (props.id) {\n const cb = (container) => {\n if (props.particlesLoaded) {\n props.particlesLoaded(container);\n }\n\n oldId = props.id;\n };\n\n tsParticles.load({ id: props.id, options: props.options, url: props.url }).then(cb);\n } else {\n if (props.particlesLoaded) {\n props.particlesLoaded(undefined);\n }\n }\n }\n }\n </script>\n <div id=\"{props.id}\"></div>\n\n</riot-particles>\n"],"names":["tsParticles"],"mappings":";;;;;;AAIQ,IAAI,KAAK;AACT,IAAI,WAAU,GAAI,KAAK;AACvB,IAAI,WAAW;AACf,IAAI,YAAY;;AAET,eAAe,mBAAmB;AACrC,IAAA,EAAE;AACN,EAAE;AACE,IAAA,IAAI,WAAW,EAAE;AACb,QAAA;AACJ,IAAA;;AAEA,IAAA,IAAI,WAAW,EAAE;AACb,QAAA,IAAI,YAAW,KAAM,EAAE,EAAE;AACrB,YAAA,MAAM,IAAI,KAAK,CAAC,uEAAuE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CAAC;AACpC,gBAAA;;AAEA,gBAAA,KAAI,GAAI,KAAK,CAAC,EAAE;YACpB,CAAC;;AAED,YAAAA,kBAAW,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QACvF,CAAA,MAAO;YACH,IAAI,KAAK,CAAC,eAAe,EAAE;AACvB,gBAAA,KAAK,CAAC,eAAe,CAAC,SAAS,CAAC;AACpC,YAAA;AACJ,QAAA;AACJ,IAAA;;;;;;;;;;;;;;;;;;;;AAGE,YAAA,QAAA,EAAA,MAAA,IAAA,MAAA,CAAA,KAAI,CAAE;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { tsParticles } from '@tsparticles/engine';
|
|
2
|
+
|
|
3
|
+
let oldId;
|
|
4
|
+
let initialized = false;
|
|
5
|
+
let initPromise;
|
|
6
|
+
let initCallback;
|
|
7
|
+
|
|
8
|
+
async function initParticlesEngine(
|
|
9
|
+
cb,
|
|
10
|
+
) {
|
|
11
|
+
if (initialized) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (initPromise) {
|
|
16
|
+
if (initCallback !== cb) {
|
|
17
|
+
throw new Error("initParticlesEngine callback must be stable across the app lifecycle.");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
await initPromise;
|
|
21
|
+
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
initCallback = cb;
|
|
26
|
+
initPromise = (async () => {
|
|
27
|
+
if (cb) {
|
|
28
|
+
await cb(tsParticles);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
await tsParticles.init();
|
|
32
|
+
initialized = true;
|
|
33
|
+
})().catch((error) => {
|
|
34
|
+
initPromise = undefined;
|
|
35
|
+
initCallback = undefined;
|
|
36
|
+
initialized = false;
|
|
37
|
+
|
|
38
|
+
throw error;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
await initPromise;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function isParticlesEngineInitialized() {
|
|
45
|
+
return initialized;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function waitForParticlesEngineInitialization() {
|
|
49
|
+
await (initPromise ?? Promise.resolve());
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
var riotParticles = {
|
|
53
|
+
css: null,
|
|
54
|
+
|
|
55
|
+
exports: {
|
|
56
|
+
async onMounted(props) {
|
|
57
|
+
await waitForParticlesEngineInitialization();
|
|
58
|
+
|
|
59
|
+
if (!isParticlesEngineInitialized()) {
|
|
60
|
+
throw new Error("initParticlesEngine(...) must be called once before mounting <riot-particles /> components.");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (oldId) {
|
|
64
|
+
const oldContainer = tsParticles.dom().find((c) => c.id === oldId);
|
|
65
|
+
|
|
66
|
+
if (oldContainer) {
|
|
67
|
+
oldContainer.destroy();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (props.id) {
|
|
72
|
+
const cb = (container) => {
|
|
73
|
+
if (props.particlesLoaded) {
|
|
74
|
+
props.particlesLoaded(container);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
oldId = props.id;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
tsParticles.load({ id: props.id, options: props.options, url: props.url }).then(cb);
|
|
81
|
+
} else {
|
|
82
|
+
if (props.particlesLoaded) {
|
|
83
|
+
props.particlesLoaded(undefined);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
template: (
|
|
90
|
+
template,
|
|
91
|
+
expressionTypes,
|
|
92
|
+
bindingTypes,
|
|
93
|
+
getComponent
|
|
94
|
+
) => template(
|
|
95
|
+
'<div expr1="expr1"></div>',
|
|
96
|
+
[
|
|
97
|
+
{
|
|
98
|
+
redundantAttribute: 'expr1',
|
|
99
|
+
selector: '[expr1]',
|
|
100
|
+
|
|
101
|
+
expressions: [
|
|
102
|
+
{
|
|
103
|
+
type: expressionTypes.ATTRIBUTE,
|
|
104
|
+
isBoolean: false,
|
|
105
|
+
name: 'id',
|
|
106
|
+
evaluate: _scope => _scope.props.id
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
),
|
|
112
|
+
|
|
113
|
+
name: 'riot-particles'
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export { riotParticles as default, initParticlesEngine, isParticlesEngineInitialized, waitForParticlesEngineInitialization };
|
|
117
|
+
//# sourceMappingURL=riot-particles.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"riot-particles.esm.js","sources":["../src/riot-particles.riot"],"sourcesContent":["<riot-particles>\n <script>\n import { tsParticles } from \"@tsparticles/engine\";\n\n let oldId;\n let initialized = false;\n let initPromise;\n let initCallback;\n\n export async function initParticlesEngine(\n cb,\n ) {\n if (initialized) {\n return;\n }\n\n if (initPromise) {\n if (initCallback !== cb) {\n throw new Error(\"initParticlesEngine callback must be stable across the app lifecycle.\");\n }\n\n await initPromise;\n\n return;\n }\n\n initCallback = cb;\n initPromise = (async () => {\n if (cb) {\n await cb(tsParticles);\n }\n\n await tsParticles.init();\n initialized = true;\n })().catch((error) => {\n initPromise = undefined;\n initCallback = undefined;\n initialized = false;\n\n throw error;\n });\n\n await initPromise;\n }\n\n export function isParticlesEngineInitialized() {\n return initialized;\n }\n\n export async function waitForParticlesEngineInitialization() {\n await (initPromise ?? Promise.resolve());\n }\n\n export default {\n async onMounted(props) {\n await waitForParticlesEngineInitialization();\n\n if (!isParticlesEngineInitialized()) {\n throw new Error(\"initParticlesEngine(...) must be called once before mounting <riot-particles /> components.\");\n }\n\n if (oldId) {\n const oldContainer = tsParticles.dom().find((c) => c.id === oldId);\n\n if (oldContainer) {\n oldContainer.destroy();\n }\n }\n\n if (props.id) {\n const cb = (container) => {\n if (props.particlesLoaded) {\n props.particlesLoaded(container);\n }\n\n oldId = props.id;\n };\n\n tsParticles.load({ id: props.id, options: props.options, url: props.url }).then(cb);\n } else {\n if (props.particlesLoaded) {\n props.particlesLoaded(undefined);\n }\n }\n }\n }\n </script>\n <div id=\"{props.id}\"></div>\n\n</riot-particles>\n"],"names":[],"mappings":";;AAIQ,IAAI,KAAK;AACT,IAAI,WAAU,GAAI,KAAK;AACvB,IAAI,WAAW;AACf,IAAI,YAAY;;AAET,eAAe,mBAAmB;AACrC,IAAA,EAAE;AACN,EAAE;AACE,IAAA,IAAI,WAAW,EAAE;AACb,QAAA;AACJ,IAAA;;AAEA,IAAA,IAAI,WAAW,EAAE;AACb,QAAA,IAAI,YAAW,KAAM,EAAE,EAAE;AACrB,YAAA,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC;AAC5F,QAAA;;AAEA,QAAA,MAAM,WAAW;;AAEjB,QAAA;AACJ,IAAA;;AAEA,IAAA,YAAW,GAAI,EAAE;IACjB,WAAU,GAAI,CAAC,YAAY;AACvB,QAAA,IAAI,EAAE,EAAE;AACJ,YAAA,MAAM,EAAE,CAAC,WAAW,CAAC;AACzB,QAAA;;QAEA,MAAM,WAAW,CAAC,IAAI,EAAE;AACxB,QAAA,WAAU,GAAI,IAAI;AACtB,IAAA,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK;AAClB,QAAA,cAAc,SAAS;QACvB,eAAe,SAAS;AACxB,QAAA,cAAc,KAAK;;QAEnB,MAAM,KAAK;AACf,IAAA,CAAC,CAAC;;AAEF,IAAA,MAAM,WAAW;AACrB;;AAEO,SAAS,4BAA4B,GAAG;AAC3C,IAAA,OAAO,WAAW;AACtB;;AAEO,eAAe,oCAAoC,GAAG;AACzD,IAAA,OAAO,WAAU,IAAK,OAAO,CAAC,OAAO,EAAE,CAA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4
|
"description": "Official tsParticles Riot Component - Easily create highly customizable particle, confetti and fireworks animations and use them as animated backgrounds for your website. Ready to use components available also for Web Components, React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno.",
|
|
5
|
-
"main": "dist/riot-particles.
|
|
5
|
+
"main": "dist/riot-particles.cjs",
|
|
6
|
+
"module": "dist/riot-particles.esm.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/riot-particles.esm.js",
|
|
10
|
+
"require": "./dist/riot-particles.cjs"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
6
13
|
"scripts": {
|
|
7
14
|
"prettify:ci:src": "prettier --check ./src/*",
|
|
8
15
|
"prettify:ci:readme": "prettier --check ./README.md",
|
|
@@ -91,10 +98,10 @@
|
|
|
91
98
|
],
|
|
92
99
|
"prettier": "@tsparticles/prettier-config",
|
|
93
100
|
"peerDependencies": {
|
|
94
|
-
"riot": "^
|
|
101
|
+
"riot": "^10"
|
|
95
102
|
},
|
|
96
103
|
"dependencies": {
|
|
97
|
-
"@tsparticles/engine": "^4.0.0
|
|
104
|
+
"@tsparticles/engine": "^4.0.0"
|
|
98
105
|
},
|
|
99
106
|
"devDependencies": {
|
|
100
107
|
"@babel/core": "^7.29.0",
|
|
@@ -102,7 +109,7 @@
|
|
|
102
109
|
"@riotjs/cli": "^10.0.0",
|
|
103
110
|
"@riotjs/compiler": "^10.0.1",
|
|
104
111
|
"@rollup/plugin-babel": "^7.0.0",
|
|
105
|
-
"@tsparticles/prettier-config": "^4.0.0
|
|
112
|
+
"@tsparticles/prettier-config": "^4.0.0",
|
|
106
113
|
"chai": "^6.2.2",
|
|
107
114
|
"esm": "^3.2.25",
|
|
108
115
|
"jsdom": "^29.0.2",
|
|
@@ -117,5 +124,5 @@
|
|
|
117
124
|
"publishConfig": {
|
|
118
125
|
"access": "public"
|
|
119
126
|
},
|
|
120
|
-
"gitHead": "
|
|
127
|
+
"gitHead": "3058cb84befe9d2bffdb58f115c3050d26ceb9ef"
|
|
121
128
|
}
|
package/rollup.config.cjs
CHANGED
|
@@ -1,26 +1,47 @@
|
|
|
1
|
-
const
|
|
1
|
+
const { compile } = require('@riotjs/compiler');
|
|
2
2
|
const babel = require('@rollup/plugin-babel').babel || require('@rollup/plugin-babel');
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
// Inline riot plugin to avoid peer-dependency resolution issues with rollup-plugin-riot
|
|
5
|
+
const riotPlugin = () => ({
|
|
6
|
+
name: 'riot',
|
|
7
|
+
transform(code, id) {
|
|
8
|
+
if (!id.endsWith('.riot')) return null;
|
|
9
|
+
const { code: compiledCode, map } = compile(code, { file: id });
|
|
10
|
+
return { code: compiledCode, map };
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const external = ['riot', '@tsparticles/engine'];
|
|
15
|
+
|
|
16
|
+
const plugins = [
|
|
17
|
+
riotPlugin(),
|
|
18
|
+
babel({
|
|
19
|
+
exclude: 'node_modules/**',
|
|
20
|
+
inputSourceMap: true,
|
|
21
|
+
babelHelpers: 'bundled',
|
|
22
|
+
}),
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
module.exports = [
|
|
26
|
+
{
|
|
27
|
+
input: 'src/riot-particles.riot',
|
|
28
|
+
output: {
|
|
29
|
+
file: 'dist/riot-particles.cjs',
|
|
30
|
+
format: 'cjs',
|
|
31
|
+
sourcemap: true,
|
|
32
|
+
exports: 'named',
|
|
33
|
+
},
|
|
34
|
+
external,
|
|
35
|
+
plugins,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
input: 'src/riot-particles.riot',
|
|
39
|
+
output: {
|
|
40
|
+
file: 'dist/riot-particles.esm.js',
|
|
41
|
+
format: 'esm',
|
|
42
|
+
sourcemap: true,
|
|
43
|
+
},
|
|
44
|
+
external,
|
|
45
|
+
plugins,
|
|
14
46
|
},
|
|
15
|
-
|
|
16
|
-
'riot',
|
|
17
|
-
'@tsparticles/engine'
|
|
18
|
-
],
|
|
19
|
-
plugins: [
|
|
20
|
-
riot(),
|
|
21
|
-
babel({
|
|
22
|
-
exclude: 'node_modules/**',
|
|
23
|
-
inputSourceMap: true,
|
|
24
|
-
}),
|
|
25
|
-
]
|
|
26
|
-
};
|
|
47
|
+
];
|
package/typedoc.json
CHANGED
package/dist/riot-particles.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
(function (exports, engine) {
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
let oldId;
|
|
5
|
-
let initialized = false;
|
|
6
|
-
let initPromise;
|
|
7
|
-
let initCallback;
|
|
8
|
-
|
|
9
|
-
async function initParticlesEngine(
|
|
10
|
-
cb,
|
|
11
|
-
) {
|
|
12
|
-
if (initialized) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (initPromise) {
|
|
17
|
-
if (initCallback !== cb) {
|
|
18
|
-
throw new Error("initParticlesEngine callback must be stable across the app lifecycle.");
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
await initPromise;
|
|
22
|
-
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
initCallback = cb;
|
|
27
|
-
initPromise = (async () => {
|
|
28
|
-
if (cb) {
|
|
29
|
-
await cb(engine.tsParticles);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
await engine.tsParticles.init();
|
|
33
|
-
initialized = true;
|
|
34
|
-
})().catch((error) => {
|
|
35
|
-
initPromise = undefined;
|
|
36
|
-
initCallback = undefined;
|
|
37
|
-
initialized = false;
|
|
38
|
-
|
|
39
|
-
throw error;
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
await initPromise;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function isParticlesEngineInitialized() {
|
|
46
|
-
return initialized;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
async function waitForParticlesEngineInitialization() {
|
|
50
|
-
await (initPromise ?? Promise.resolve());
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
var riotParticles = {
|
|
54
|
-
css: null,
|
|
55
|
-
|
|
56
|
-
exports: {
|
|
57
|
-
async onMounted(props) {
|
|
58
|
-
await waitForParticlesEngineInitialization();
|
|
59
|
-
|
|
60
|
-
if (!isParticlesEngineInitialized()) {
|
|
61
|
-
throw new Error("initParticlesEngine(...) must be called once before mounting <riot-particles /> components.");
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (oldId) {
|
|
65
|
-
const oldContainer = engine.tsParticles.dom().find((c) => c.id === oldId);
|
|
66
|
-
|
|
67
|
-
if (oldContainer) {
|
|
68
|
-
oldContainer.destroy();
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (props.id) {
|
|
73
|
-
const cb = (container) => {
|
|
74
|
-
if (props.particlesLoaded) {
|
|
75
|
-
props.particlesLoaded(container);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
oldId = props.id;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
engine.tsParticles.load({ id: props.id, options: props.options, url: props.url }).then(cb);
|
|
82
|
-
} else {
|
|
83
|
-
if (props.particlesLoaded) {
|
|
84
|
-
props.particlesLoaded(undefined);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
template: (
|
|
91
|
-
template,
|
|
92
|
-
expressionTypes,
|
|
93
|
-
bindingTypes,
|
|
94
|
-
getComponent
|
|
95
|
-
) => template(
|
|
96
|
-
'<div expr0="expr0"></div>',
|
|
97
|
-
[
|
|
98
|
-
{
|
|
99
|
-
redundantAttribute: 'expr0',
|
|
100
|
-
selector: '[expr0]',
|
|
101
|
-
|
|
102
|
-
expressions: [
|
|
103
|
-
{
|
|
104
|
-
type: expressionTypes.ATTRIBUTE,
|
|
105
|
-
isBoolean: false,
|
|
106
|
-
name: 'id',
|
|
107
|
-
evaluate: _scope => _scope.props.id
|
|
108
|
-
}
|
|
109
|
-
]
|
|
110
|
-
}
|
|
111
|
-
]
|
|
112
|
-
),
|
|
113
|
-
|
|
114
|
-
name: 'riot-particles'
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
exports.default = riotParticles;
|
|
118
|
-
exports.initParticlesEngine = initParticlesEngine;
|
|
119
|
-
exports.isParticlesEngineInitialized = isParticlesEngineInitialized;
|
|
120
|
-
exports.waitForParticlesEngineInitialization = waitForParticlesEngineInitialization;
|
|
121
|
-
|
|
122
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
123
|
-
|
|
124
|
-
return exports;
|
|
125
|
-
|
|
126
|
-
})({}, window);
|
|
127
|
-
//# sourceMappingURL=riot-particles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"riot-particles.js","sources":["../src/riot-particles.riot"],"sourcesContent":["<riot-particles>\n <script>\n import { tsParticles } from \"@tsparticles/engine\";\n\n let oldId;\n let initialized = false;\n let initPromise;\n let initCallback;\n\n export async function initParticlesEngine(\n cb,\n ) {\n if (initialized) {\n return;\n }\n\n if (initPromise) {\n if (initCallback !== cb) {\n throw new Error(\"initParticlesEngine callback must be stable across the app lifecycle.\");\n }\n\n await initPromise;\n\n return;\n }\n\n initCallback = cb;\n initPromise = (async () => {\n if (cb) {\n await cb(tsParticles);\n }\n\n await tsParticles.init();\n initialized = true;\n })().catch((error) => {\n initPromise = undefined;\n initCallback = undefined;\n initialized = false;\n\n throw error;\n });\n\n await initPromise;\n }\n\n export function isParticlesEngineInitialized() {\n return initialized;\n }\n\n export async function waitForParticlesEngineInitialization() {\n await (initPromise ?? Promise.resolve());\n }\n\n export default {\n async onMounted(props) {\n await waitForParticlesEngineInitialization();\n\n if (!isParticlesEngineInitialized()) {\n throw new Error(\"initParticlesEngine(...) must be called once before mounting <riot-particles /> components.\");\n }\n\n if (oldId) {\n const oldContainer = tsParticles.dom().find((c) => c.id === oldId);\n\n if (oldContainer) {\n oldContainer.destroy();\n }\n }\n\n if (props.id) {\n const cb = (container) => {\n if (props.particlesLoaded) {\n props.particlesLoaded(container);\n }\n\n oldId = props.id;\n };\n\n tsParticles.load({ id: props.id, options: props.options, url: props.url }).then(cb);\n } else {\n if (props.particlesLoaded) {\n props.particlesLoaded(undefined);\n }\n }\n }\n }\n </script>\n <div id=\"{props.id}\"></div>\n\n</riot-particles>\n"],"names":["tsParticles"],"mappings":";;;IAIQ,IAAI,KAAK;IACT,IAAI,WAAU,GAAI,KAAK;IACvB,IAAI,WAAW;IACf,IAAI,YAAY;;IAET,eAAe,mBAAmB;IACrC,IAAA,EAAE;IACN,EAAE;IACE,IAAA,IAAI,WAAW,EAAE;IACb,QAAA;IACJ,IAAA;;IAEA,IAAA,IAAI,WAAW,EAAE;IACb,QAAA,IAAI,YAAW,KAAM,EAAE,EAAE;IACrB,YAAA,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC;IAC5F,QAAA;;IAEA,QAAA,MAAM,WAAW;;IAEjB,QAAA;IACJ,IAAA;;IAEA,IAAA,YAAW,GAAI,EAAE;QACjB,WAAU,GAAI,CAAC,YAAY;IACvB,QAAA,IAAI,EAAE,EAAE;IACJ,YAAA,MAAM,EAAE,CAACA,kBAAW,CAAC;IACzB,QAAA;;YAEA,MAAMA,kBAAW,CAAC,IAAI,EAAE;IACxB,QAAA,WAAU,GAAI,IAAI;IACtB,IAAA,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK;IAClB,QAAA,cAAc,SAAS;YACvB,eAAe,SAAS;IACxB,QAAA,cAAc,KAAK;;YAEnB,MAAM,KAAK;IACf,IAAA,CAAC,CAAC;;IAEF,IAAA,MAAM,WAAW;IACrB;;IAEO,SAAS,4BAA4B,GAAG;IAC3C,IAAA,OAAO,WAAW;IACtB;;IAEO,eAAe,oCAAoC,G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