@tsparticles/nextjs 4.0.4 → 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,71 +1,29 @@
1
1
  {
2
2
  "name": "@tsparticles/nextjs",
3
- "version": "4.0.4",
3
+ "version": "4.1.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/tsparticles/tsparticles.git",
8
8
  "directory": "wrappers/nextjs"
9
9
  },
10
- "main": "dist/index.js",
11
- "types": "dist/lib/index.d.ts",
12
- "scripts": {
13
- "dev": "vite",
14
- "build": "prettier --write README.md && pnpm run prettify && tsc && vite build",
15
- "build:ci": "prettier --check README.md && pnpm run prettify:ci && tsc && vite build",
16
- "lint": "eslint . --max-warnings 0",
17
- "preview": "vite preview",
18
- "prettify": "prettier --write \"src/**/*.{ts,tsx}\" && prettier --write \"lib/**/*.{ts,tsx}\"",
19
- "prettify:ci": "prettier --check \"src/**/*.{ts,tsx}\" && prettier --check \"lib/**/*.{ts,tsx}\"",
20
- "prepublishOnly": "pnpm run build"
21
- },
10
+ "main": "./index.js",
11
+ "types": "./lib/index.d.ts",
22
12
  "exports": {
23
13
  ".": {
24
- "types": "./dist/lib/index.d.ts",
25
- "default": "./dist/index.js"
14
+ "types": "./lib/index.d.ts",
15
+ "default": "./index.js"
26
16
  }
27
17
  },
28
- "files": [
29
- "dist"
30
- ],
31
18
  "license": "MIT",
32
19
  "peerDependencies": {
33
- "@tsparticles/react": "workspace:^",
20
+ "@tsparticles/react": "^4.1.0",
34
21
  "next": ">=13.0.0",
35
22
  "react": ">=18.0.0",
36
- "react-dom": ">=18.0.0"
37
- },
38
- "devDependencies": {
39
- "@tsparticles/react": "^4.0.4",
40
- "@types/react": "^19.2.14",
41
- "@types/react-dom": "^19.2.3",
42
- "@typescript-eslint/eslint-plugin": "^8.58.2",
43
- "@typescript-eslint/parser": "^8.58.2",
44
- "@vitejs/plugin-react": "^6.0.1",
45
- "eslint": "^10.2.0",
46
- "eslint-plugin-react-hooks": "^7.0.1",
47
- "eslint-plugin-react-refresh": "^0.5.2",
48
- "glob": "^13.0.6",
49
- "next": "^16.2.3",
50
- "react": "^19.2.5",
51
- "react-dom": "^19.2.5",
52
- "typescript": "^6.0.2",
53
- "vite": "^8.0.8",
54
- "vite-plugin-dts": "^4.5.4"
55
- },
56
- "nx": {
57
- "targets": {
58
- "build": {
59
- "inputs": [
60
- "production",
61
- "^production",
62
- "{projectRoot}/lib/**/*"
63
- ]
64
- }
65
- }
23
+ "react-dom": ">=18.0.0",
24
+ "@tsparticles/engine": "4.1.0"
66
25
  },
67
26
  "publishConfig": {
68
27
  "access": "public"
69
- },
70
- "gitHead": "ccaa764e22df90102d33c977aa91e3f552ce12dd"
28
+ }
71
29
  }
package/README.md DELETED
@@ -1,80 +0,0 @@
1
- [![banner](https://particles.js.org/images/banner3.png)](https://particles.js.org)
2
-
3
- # @tsparticles/nextjs
4
-
5
- Next.js integration wrapper for [@tsparticles/react](https://www.npmjs.com/package/@tsparticles/react).
6
-
7
- ## Why this package
8
-
9
- - Provides Next.js-first exports (`NextParticlesProvider`, `NextParticles`).
10
- - Handles client-only rendering for particles via dynamic import.
11
- - Keeps the one-time async init flow centered on the provider.
12
-
13
- ## Installation
14
-
15
- ```bash
16
- pnpm add @tsparticles/nextjs @tsparticles/react @tsparticles/engine
17
- ```
18
-
19
- or
20
-
21
- ```bash
22
- npm install @tsparticles/nextjs @tsparticles/react @tsparticles/engine
23
- ```
24
-
25
- or
26
-
27
- ```bash
28
- yarn add @tsparticles/nextjs @tsparticles/react @tsparticles/engine
29
- ```
30
-
31
- ## Usage (App Router)
32
-
33
- ```tsx
34
- "use client";
35
-
36
- import { NextParticles, NextParticlesProvider } from "@tsparticles/nextjs";
37
- import type { Engine } from "@tsparticles/engine";
38
-
39
- const init = async (engine: Engine): Promise<void> => {
40
- const [{ loadSlim }, { loadThemesPlugin }] = await Promise.all([
41
- import("@tsparticles/slim"),
42
- import("@tsparticles/plugin-themes"),
43
- ]);
44
-
45
- await Promise.all([loadSlim(engine), loadThemesPlugin(engine)]);
46
- };
47
-
48
- export default function Page() {
49
- return (
50
- <NextParticlesProvider init={init}>
51
- <NextParticles id="tsparticles" options={{ fullScreen: { zIndex: -1 } }} />
52
- </NextParticlesProvider>
53
- );
54
- }
55
- ```
56
-
57
- ## Usage (Pages Router)
58
-
59
- ```tsx
60
- import type { AppProps } from "next/app";
61
- import { NextParticlesProvider } from "@tsparticles/nextjs";
62
- import type { Engine } from "@tsparticles/engine";
63
-
64
- const init = async (engine: Engine): Promise<void> => {
65
- const [{ loadSlim }, { loadThemesPlugin }] = await Promise.all([
66
- import("@tsparticles/slim"),
67
- import("@tsparticles/plugin-themes"),
68
- ]);
69
-
70
- await Promise.all([loadSlim(engine), loadThemesPlugin(engine)]);
71
- };
72
-
73
- export default function App({ Component, pageProps }: AppProps) {
74
- return (
75
- <NextParticlesProvider init={init}>
76
- <Component {...pageProps} />
77
- </NextParticlesProvider>
78
- );
79
- }
80
- ```
File without changes
File without changes