@tsparticles/riot 4.0.0-beta.12 → 4.0.0-beta.16

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 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-beta.16](https://github.com/tsparticles/tsparticles/compare/v4.0.0-beta.15...v4.0.0-beta.16) (2026-05-09)
7
+
8
+ **Note:** Version bump only for package @tsparticles/riot
9
+
10
+ # [4.0.0-beta.15](https://github.com/tsparticles/tsparticles/compare/v4.0.0-beta.14...v4.0.0-beta.15) (2026-05-09)
11
+
12
+ **Note:** Version bump only for package @tsparticles/riot
13
+
6
14
  # [4.0.0-beta.12](https://github.com/tsparticles/tsparticles/compare/v4.0.0-beta.11...v4.0.0-beta.12) (2026-04-15)
7
15
 
8
16
  ### Features
@@ -0,0 +1,127 @@
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
@@ -0,0 +1 @@
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,uEA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SAAS,CAAC;IACpC,gBAAA;;IAEA,gBAAA,KAAI,GAAI,KAAK,CAAC,EAAE;gBACpB,CAAC;;IAED,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;YACvF,CAAA,MAAO;gBACH,IAAI,KAAK,CAAC,eAAe,EAAE;IACvB,gBAAA,KAAK,CAAC,eAAe,CAAC,SAAS,CAAC;IACpC,YAAA;IACJ,QAAA;IACJ,IAAA;;;;;;;;;;;;;;;;;;;;IAGE,YAAA,QAAA,EAAA,MAAA,IAAA,MAAA,CAAA,KAAI,CAAE;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@tsparticles/riot",
3
- "version": "4.0.0-beta.12",
3
+ "version": "4.0.0-beta.16",
4
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
5
  "main": "dist/riot-particles.js",
6
6
  "scripts": {
7
- "build": "echo build",
8
- "build:ci": "echo build",
9
7
  "prettify:ci:src": "prettier --check ./src/*",
10
8
  "prettify:ci:readme": "prettier --check ./README.md",
11
9
  "prettify:src": "prettier --write ./src/*",
12
10
  "prettify:readme": "prettier --write ./README.md",
11
+ "build": "pnpm run prettify:src && rollup -c",
12
+ "build:ci": "pnpm run prettify:ci:src && rollup -c",
13
13
  "prepack": "pnpm run build"
14
14
  },
15
15
  "repository": {
@@ -94,14 +94,15 @@
94
94
  "riot": "^9.1.2"
95
95
  },
96
96
  "dependencies": {
97
- "@tsparticles/engine": "^4.0.0-beta.12"
97
+ "@tsparticles/engine": "^4.0.0-beta.16"
98
98
  },
99
99
  "devDependencies": {
100
100
  "@babel/core": "^7.29.0",
101
101
  "@babel/preset-typescript": "^7.28.5",
102
102
  "@riotjs/cli": "^10.0.0",
103
103
  "@riotjs/compiler": "^10.0.1",
104
- "@tsparticles/prettier-config": "^3.4.6",
104
+ "@rollup/plugin-babel": "^7.0.0",
105
+ "@tsparticles/prettier-config": "^4.0.0-beta.16",
105
106
  "chai": "^6.2.2",
106
107
  "esm": "^3.2.25",
107
108
  "jsdom": "^29.0.2",
@@ -109,10 +110,12 @@
109
110
  "mocha": "^11.7.5",
110
111
  "nyc": "^18.0.0",
111
112
  "prettier": "^3.8.2",
112
- "riot": "^10.1.3"
113
+ "riot": "^10.1.3",
114
+ "rollup": "^4.60.1",
115
+ "rollup-plugin-riot": "^10.0.0"
113
116
  },
114
117
  "publishConfig": {
115
118
  "access": "public"
116
119
  },
117
- "gitHead": "ebd73f94ae2391c9068de098f2856e1efb26254c"
120
+ "gitHead": "8ac678c4da53ea2b6a9a33aaa40f5141e2a7d513"
118
121
  }
@@ -0,0 +1,26 @@
1
+ const riot = require('rollup-plugin-riot');
2
+ const babel = require('@rollup/plugin-babel').babel || require('@rollup/plugin-babel');
3
+
4
+ module.exports = {
5
+ input: 'src/riot-particles.riot',
6
+ output: {
7
+ file: 'dist/riot-particles.js',
8
+ format: 'iife',
9
+ sourcemap: true,
10
+ globals: {
11
+ riot: 'riot',
12
+ '@tsparticles/engine': 'window'
13
+ }
14
+ },
15
+ external: [
16
+ 'riot',
17
+ '@tsparticles/engine'
18
+ ],
19
+ plugins: [
20
+ riot(),
21
+ babel({
22
+ exclude: 'node_modules/**',
23
+ inputSourceMap: true,
24
+ }),
25
+ ]
26
+ };