@tsparticles/svelte 4.0.5 → 4.1.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/package.json CHANGED
@@ -1,121 +1,80 @@
1
1
  {
2
- "name": "@tsparticles/svelte",
3
- "version": "4.0.5",
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
- "repository": {
6
- "type": "git",
7
- "url": "git+https://github.com/tsparticles/tsparticles.git",
8
- "directory": "wrappers/svelte"
9
- },
10
- "author": "Matteo Bruni <matteo.bruni@me.com>",
11
- "license": "MIT",
12
- "keywords": [
13
- "front-end",
14
- "frontend",
15
- "tsparticles",
16
- "particles.js",
17
- "particlesjs",
18
- "particles",
19
- "particle",
20
- "canvas",
21
- "jsparticles",
22
- "xparticles",
23
- "particles-js",
24
- "particles-bg",
25
- "particles-bg-vue",
26
- "particles-ts",
27
- "particles.ts",
28
- "react-particles-js",
29
- "react-particles.js",
30
- "react-particles",
31
- "react",
32
- "reactjs",
33
- "vue-particles",
34
- "ngx-particles",
35
- "angular-particles",
36
- "particleground",
37
- "vue",
38
- "vuejs",
39
- "preact",
40
- "preactjs",
41
- "jquery",
42
- "angularjs",
43
- "angular",
44
- "typescript",
45
- "javascript",
46
- "animation",
47
- "web",
48
- "html5",
49
- "web-design",
50
- "webdesign",
51
- "css",
52
- "html",
53
- "css3",
54
- "animated",
55
- "background",
56
- "confetti",
57
- "canvas",
58
- "fireworks",
59
- "fireworks-js",
60
- "confetti-js",
61
- "confettijs",
62
- "fireworksjs",
63
- "canvas-confetti"
64
- ],
65
- "scripts": {
66
- "dev": "vite dev",
67
- "build": "pnpm run format && vite build && npm run package",
68
- "build:ci": "vite build && npm run package",
69
- "preview": "vite preview",
70
- "package": "svelte-kit sync && svelte-package && publint",
71
- "prepublishOnly": "npm run package",
72
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
73
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
74
- "lint": "prettier --check . && eslint .",
75
- "format": "prettier --write ."
76
- },
77
- "exports": {
78
- ".": {
79
- "types": "./dist/index.d.ts",
80
- "svelte": "./dist/index.js"
81
- }
82
- },
83
- "files": [
84
- "dist",
85
- "!dist/**/*.test.*",
86
- "!dist/**/*.spec.*"
87
- ],
88
- "publishConfig": {
89
- "access": "public"
90
- },
91
- "peerDependencies": {
92
- "svelte": "^4.2.17"
93
- },
94
- "dependencies": {
95
- "@tsparticles/engine": "^4.0.5"
96
- },
97
- "devDependencies": {
98
- "@sveltejs/adapter-auto": "^7.0.1",
99
- "@sveltejs/kit": "^2.57.1",
100
- "@sveltejs/package": "^2.5.7",
101
- "@sveltejs/vite-plugin-svelte": "^7.0.0",
102
- "@types/eslint": "^9.6.1",
103
- "@typescript-eslint/eslint-plugin": "^8.58.2",
104
- "@typescript-eslint/parser": "^8.58.2",
105
- "eslint": "^10.2.0",
106
- "eslint-config-prettier": "^10.1.8",
107
- "eslint-plugin-svelte": "^3.17.0",
108
- "prettier": "^3.8.2",
109
- "prettier-plugin-svelte": "^3.5.1",
110
- "publint": "^0.3.18",
111
- "svelte": "^5.55.3",
112
- "svelte-check": "^4.4.6",
113
- "tslib": "^2.8.1",
114
- "typescript": "^6.0.2",
115
- "vite": "^8.0.8"
116
- },
117
- "svelte": "./dist/index.js",
118
- "types": "./dist/index.d.ts",
119
- "type": "module",
120
- "gitHead": "4d8b281f8097386714300e39b0004b903f9df87b"
2
+ "name": "@tsparticles/svelte",
3
+ "version": "4.1.0",
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
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/tsparticles/tsparticles.git",
8
+ "directory": "wrappers/svelte"
9
+ },
10
+ "keywords": [
11
+ "front-end",
12
+ "frontend",
13
+ "tsparticles",
14
+ "particles.js",
15
+ "particlesjs",
16
+ "particles",
17
+ "particle",
18
+ "canvas",
19
+ "jsparticles",
20
+ "xparticles",
21
+ "particles-js",
22
+ "particles-bg",
23
+ "particles-bg-vue",
24
+ "particles-ts",
25
+ "particles.ts",
26
+ "react-particles-js",
27
+ "react-particles.js",
28
+ "react-particles",
29
+ "react",
30
+ "reactjs",
31
+ "vue-particles",
32
+ "ngx-particles",
33
+ "angular-particles",
34
+ "particleground",
35
+ "vue",
36
+ "vuejs",
37
+ "preact",
38
+ "preactjs",
39
+ "jquery",
40
+ "angularjs",
41
+ "angular",
42
+ "typescript",
43
+ "javascript",
44
+ "animation",
45
+ "web",
46
+ "html5",
47
+ "web-design",
48
+ "webdesign",
49
+ "css",
50
+ "html",
51
+ "css3",
52
+ "animated",
53
+ "background",
54
+ "confetti",
55
+ "canvas",
56
+ "fireworks",
57
+ "fireworks-js",
58
+ "confetti-js",
59
+ "confettijs",
60
+ "fireworksjs",
61
+ "canvas-confetti"
62
+ ],
63
+ "author": "Matteo Bruni <matteo.bruni@me.com>",
64
+ "license": "MIT",
65
+ "type": "module",
66
+ "types": "/index.d.ts",
67
+ "exports": {
68
+ ".": {
69
+ "types": "./index.d.ts",
70
+ "svelte": "./index.js"
71
+ }
72
+ },
73
+ "peerDependencies": {
74
+ "svelte": "^4.2.17",
75
+ "@tsparticles/engine": "4.1.0"
76
+ },
77
+ "publishConfig": {
78
+ "access": "public"
79
+ }
121
80
  }
package/README.md DELETED
@@ -1,206 +0,0 @@
1
- [![banner](https://particles.js.org/images/banner3.png)](https://particles.js.org)
2
-
3
- # @tsparticles/svelte
4
-
5
- [![npm](https://img.shields.io/npm/v/@tsparticles/svelte)](https://www.npmjs.com/package/@tsparticles/svelte) [![npm downloads](https://img.shields.io/npm/dm/@tsparticles/svelte)](https://www.npmjs.com/package/@tsparticles/svelte) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni)
6
-
7
- Official [tsParticles](https://github.com/matteobruni/tsparticles) SvelteJS component
8
-
9
- [![Slack](https://particles.js.org/images/slack.png)](https://join.slack.com/t/tsparticles/shared_invite/enQtOTcxNTQxNjQ4NzkxLWE2MTZhZWExMWRmOWI5MTMxNjczOGE1Yjk0MjViYjdkYTUzODM3OTc5MGQ5MjFlODc4MzE0N2Q1OWQxZDc1YzI) [![Discord](https://particles.js.org/images/discord.png)](https://discord.gg/hACwv45Hme) [![Telegram](https://particles.js.org/images/telegram.png)](https://t.me/tsparticles)
10
-
11
- [![tsParticles Product Hunt](https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=186113&theme=light)](https://www.producthunt.com/posts/tsparticles?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-tsparticles") <a href="https://www.buymeacoffee.com/matteobruni"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a beer&emoji=🍺&slug=matteobruni&button_colour=5F7FFF&font_colour=ffffff&font_family=Arial&outline_colour=000000&coffee_colour=FFDD00"></a>
12
-
13
- ## Installation
14
-
15
- ```shell
16
- npm install @tsparticles/svelte
17
- ```
18
-
19
- or
20
-
21
- ```shell
22
- yarn add @tsparticles/svelte
23
- ```
24
-
25
- ## Usage
26
-
27
- ```html
28
- <script>
29
- import Particles, { particlesInit } from '@tsparticles/svelte';
30
- //import { loadFull } from "tsparticles"; // if you are going to use `loadFull`, install the "tsparticles" package too.
31
- import { loadSlim } from '@tsparticles/slim'; // if you are going to use `loadSlim`, install the "@tsparticles/slim" package too.
32
-
33
- let particlesUrl = 'http://foo.bar/particles.json'; // placeholder, replace it with a real url
34
-
35
- let particlesConfig = {
36
- particles: {
37
- color: {
38
- value: '#000'
39
- },
40
- links: {
41
- enable: true,
42
- color: '#000'
43
- },
44
- move: {
45
- enable: true
46
- },
47
- number: {
48
- value: 100
49
- }
50
- }
51
- };
52
-
53
- let onParticlesLoaded = (event) => {
54
- const particlesContainer = event.detail.particles;
55
-
56
- // you can use particlesContainer to call all the Container class
57
- // (from the core library) methods like play, pause, refresh, start, stop
58
- };
59
-
60
- void particlesInit(async (engine) => {
61
- // call this once per app
62
- // you can use main to customize the tsParticles instance adding presets or custom shapes
63
- // this loads the tsparticles package bundle, it's the easiest method for getting everything ready
64
- // starting from v2 you can add only the features you need reducing the bundle size
65
- //await loadFull(engine);
66
- await loadSlim(engine);
67
- });
68
- </script>
69
-
70
- <Particles
71
- id="tsparticles"
72
- class="put your classes here"
73
- style=""
74
- options="{particlesConfig}"
75
- on:particlesLoaded="{onParticlesLoaded}"
76
- />
77
-
78
- <!-- or -->
79
-
80
- <Particles
81
- id="tsparticles"
82
- class="put your classes here"
83
- style=""
84
- url="{particlesUrl}"
85
- on:particlesLoaded="{onParticlesLoaded}"
86
- />
87
- ```
88
-
89
- ### SSR
90
-
91
- The particles component isn't built for SSR, so you have to force the component to be called client side
92
- with `async import`.
93
-
94
- You can see a sample below:
95
-
96
- ```html
97
- <script>
98
- import { particlesInit } from '@tsparticles/svelte';
99
- import { onMount } from 'svelte';
100
- //import { loadFull } from "tsparticles"; // if you are going to use `loadFull`, install the "tsparticles" package too.
101
- import { loadSlim } from '@tsparticles/slim'; // if you are going to use `loadSlim`, install the "@tsparticles/slim" package too.
102
-
103
- let ParticlesComponent;
104
-
105
- onMount(async () => {
106
- const module = await import('@tsparticles/svelte');
107
-
108
- ParticlesComponent = module.default;
109
- });
110
-
111
- let particlesUrl = 'http://foo.bar/particles.json'; // placeholder, replace it with a real url
112
-
113
- let particlesConfig = {
114
- particles: {
115
- color: {
116
- value: '#000'
117
- },
118
- links: {
119
- enable: true,
120
- color: '#000'
121
- },
122
- move: {
123
- enable: true
124
- },
125
- number: {
126
- value: 100
127
- }
128
- }
129
- };
130
-
131
- let onParticlesLoaded = (event) => {
132
- const particlesContainer = event.detail.particles;
133
-
134
- // you can use particlesContainer to call all the Container class
135
- // (from the core library) methods like play, pause, refresh, start, stop
136
- };
137
-
138
- void particlesInit(async (engine) => {
139
- // call this once per app
140
- // you can use main to customize the tsParticles instance adding presets or custom shapes
141
- // this loads the tsparticles package bundle, it's the easiest method for getting everything ready
142
- // starting from v2 you can add only the features you need reducing the bundle size
143
- //await loadFull(main);
144
- await loadSlim(engine);
145
- });
146
- </script>
147
-
148
- <svelte:component
149
- this="{ParticlesComponent}"
150
- id="tsparticles"
151
- class="put your classes here"
152
- style=""
153
- options="{particlesConfig}"
154
- on:particlesLoaded="{onParticlesLoaded}"
155
- />
156
-
157
- <!-- or -->
158
-
159
- <svelte:component
160
- this="{ParticlesComponent}"
161
- id="tsparticles"
162
- class="put your classes here"
163
- style=""
164
- url="{particlesUrl}"
165
- on:particlesLoaded="{onParticlesLoaded}"
166
- />
167
- ```
168
-
169
- ### TypeScript errors
170
-
171
- A user reported me a TypeScript error (#3963), and that's because this Svelte component is built using TypeScript.
172
-
173
- If someone is experiencing the same error, please follow these steps:
174
-
175
- - install these packages: `typescript`, `svelte-preprocess`.
176
- - add a `tsconfig.json` file to your project, following this sample: <https://github.com/ivanhofer/sveltekit-typescript-showcase#configure-typescript> (see this for example: <https://github.com/ivanhofer/sveltekit-typescript-showcase/blob/main/tsconfig.json>)
177
- - import `svelte-preprocess` in your svelte configuration file, like this: `import preprocess from 'svelte-preprocess'` (see this for example: <https://github.com/ivanhofer/sveltekit-typescript-showcase/blob/c824e45338ffc1a9c907c63d00a6a0af4884a0e9/svelte.config.js#L2>)
178
- - use the `preprocess` function in your svelte configuration file, like this: `preprocess: preprocess(),` (see this for example: <https://github.com/ivanhofer/sveltekit-typescript-showcase/blob/c824e45338ffc1a9c907c63d00a6a0af4884a0e9/svelte.config.js#L9>)
179
-
180
- After that, everything should work as expected.
181
-
182
- ### SvelteKit
183
-
184
- If you have issues with SvelteKit, like you _Cannot use import statement outside a module_, change your `vite.config.ts` file like this:
185
-
186
- ```ts
187
- import { sveltekit } from '@sveltejs/kit/vite';
188
- import { defineConfig } from 'vite';
189
-
190
- export default defineConfig({
191
- plugins: [sveltekit()],
192
- ssr: {
193
- noExternal: ['tsparticles', '@tsparticles/slim', '@tsparticles/engine', '@tsparticles/svelte'] // add all tsparticles libraries here, they're not made for SSR, they're client only
194
- }
195
- });
196
- ```
197
-
198
- ## Demos
199
-
200
- The demo website is [here](https://particles.js.org)
201
-
202
- <https://particles.js.org>
203
-
204
- There's also a CodePen collection actively maintained and updated [here](https://codepen.io/collection/DPOage)
205
-
206
- <https://codepen.io/collection/DPOage>
File without changes
File without changes
File without changes
File without changes
File without changes