@tsparticles/svelte 3.1.0 → 3.1.1

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.
@@ -6,6 +6,7 @@ import { initialized } from "./utils.js";
6
6
  let cssClass = "";
7
7
  export { cssClass as class };
8
8
  let canStart = false;
9
+ let mounted = false;
9
10
  let style = "";
10
11
  export { style };
11
12
  export let options = {};
@@ -30,11 +31,12 @@ onDestroy(() => {
30
31
  destroyOldContainer();
31
32
  });
32
33
  onMount(() => {
34
+ mounted = true;
33
35
  void loadParticles();
34
36
  });
35
37
  async function loadParticles() {
36
38
  destroyOldContainer();
37
- if (!canStart) {
39
+ if (!canStart || !mounted) {
38
40
  return;
39
41
  }
40
42
  if (id) {
@@ -1,4 +1,5 @@
1
1
  import { SvelteComponent } from "svelte";
2
+ import type { Container } from '@tsparticles/engine';
2
3
  declare const __propDef: {
3
4
  props: {
4
5
  class?: string | undefined;
@@ -8,7 +9,9 @@ declare const __propDef: {
8
9
  id?: string | undefined;
9
10
  };
10
11
  events: {
11
- particlesLoaded: CustomEvent<any>;
12
+ particlesLoaded: CustomEvent<{
13
+ container: Container;
14
+ }>;
12
15
  } & {
13
16
  [evt: string]: CustomEvent<any>;
14
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/svelte",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Official tsParticles Svelte 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, jQuery, Preact, Riot.js, Solid.js, Inferno.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -117,5 +117,5 @@
117
117
  "svelte": "./dist/index.js",
118
118
  "types": "./dist/index.d.ts",
119
119
  "type": "module",
120
- "gitHead": "9961d4ae51bb9873bc983372323df01cbcfe594e"
120
+ "gitHead": "ea10ac19a6c8c160e5e4f90d470db04729821196"
121
121
  }