nextjs-chatbot-ui 1.0.0 → 1.0.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.
- package/README.md +21 -8
- package/package.json +11 -5
package/README.md
CHANGED
|
@@ -13,10 +13,23 @@ A beautiful, configurable chatbot UI component for Next.js applications with Tai
|
|
|
13
13
|
- 🎭 Customizable user and bot avatars
|
|
14
14
|
- ⏰ Optional timestamp display
|
|
15
15
|
|
|
16
|
+
## Compatibility Requirements
|
|
17
|
+
|
|
18
|
+
This package requires:
|
|
19
|
+
- **Next.js 14+** (with App Router or Pages Router support)
|
|
20
|
+
- **React 18+**
|
|
21
|
+
- **TypeScript 5+** (for TypeScript projects)
|
|
22
|
+
- **Tailwind CSS 3+** (must be configured in your project)
|
|
23
|
+
|
|
24
|
+
**Important Notes:**
|
|
25
|
+
- The package exports TypeScript source files directly, which Next.js will compile automatically
|
|
26
|
+
- Make sure your `tailwind.config.js` includes the package path in the `content` array (see setup instructions)
|
|
27
|
+
- This package uses the `'use client'` directive and requires client-side rendering
|
|
28
|
+
|
|
16
29
|
## Installation
|
|
17
30
|
|
|
18
31
|
```bash
|
|
19
|
-
npm install nextjs-
|
|
32
|
+
npm install nextjs-chatbot-ui
|
|
20
33
|
```
|
|
21
34
|
|
|
22
35
|
## Usage
|
|
@@ -41,8 +54,8 @@ module.exports = {
|
|
|
41
54
|
2. **Import the component and types**:
|
|
42
55
|
|
|
43
56
|
```javascript
|
|
44
|
-
import { Chatbot } from 'nextjs-
|
|
45
|
-
import type { ChatbotConfig } from 'nextjs-
|
|
57
|
+
import { Chatbot } from 'nextjs-chatbot-ui';
|
|
58
|
+
import type { ChatbotConfig } from 'nextjs-chatbot-ui';
|
|
46
59
|
```
|
|
47
60
|
|
|
48
61
|
2. Configure and use the component:
|
|
@@ -161,8 +174,8 @@ or
|
|
|
161
174
|
// pages/index.js or app/page.js
|
|
162
175
|
'use client';
|
|
163
176
|
|
|
164
|
-
import { Chatbot } from 'nextjs-
|
|
165
|
-
import type { ChatbotConfig } from 'nextjs-
|
|
177
|
+
import { Chatbot } from 'nextjs-chatbot-ui';
|
|
178
|
+
import type { ChatbotConfig } from 'nextjs-chatbot-ui';
|
|
166
179
|
|
|
167
180
|
export default function Home() {
|
|
168
181
|
const chatbotConfig: ChatbotConfig = {
|
|
@@ -185,7 +198,7 @@ export default function Home() {
|
|
|
185
198
|
autoOpen: false,
|
|
186
199
|
showTimestamp: true,
|
|
187
200
|
showDateSeparator: true,
|
|
188
|
-
poweredByText: 'Powered by nextjs-
|
|
201
|
+
poweredByText: 'Powered by nextjs-chatbot-ui',
|
|
189
202
|
};
|
|
190
203
|
|
|
191
204
|
return (
|
|
@@ -234,8 +247,8 @@ The package also includes an `AdminSetup` component for configuring database con
|
|
|
234
247
|
### Usage
|
|
235
248
|
|
|
236
249
|
```javascript
|
|
237
|
-
import { AdminSetup } from 'nextjs-
|
|
238
|
-
import type { DatabaseConfig, DatabaseConnection } from 'nextjs-
|
|
250
|
+
import { AdminSetup } from 'nextjs-chatbot-ui';
|
|
251
|
+
import type { DatabaseConfig, DatabaseConnection } from 'nextjs-chatbot-ui';
|
|
239
252
|
|
|
240
253
|
function AdminPanel() {
|
|
241
254
|
const handleSave = (config: DatabaseConfig) => {
|
package/package.json
CHANGED
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nextjs-chatbot-ui",
|
|
3
3
|
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"description": "A configurable chatbot UI component for Next.js with Tailwind CSS",
|
|
6
6
|
"main": "./index.tsx",
|
|
7
|
+
"module": "./index.tsx",
|
|
7
8
|
"types": "./types/index.ts",
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
11
|
+
"types": "./types/index.ts",
|
|
10
12
|
"import": "./index.tsx",
|
|
11
13
|
"require": "./index.tsx",
|
|
12
|
-
"
|
|
14
|
+
"default": "./index.tsx"
|
|
13
15
|
},
|
|
14
16
|
"./components/Chatbot": {
|
|
17
|
+
"types": "./types/index.ts",
|
|
15
18
|
"import": "./components/Chatbot.tsx",
|
|
16
|
-
"require": "./components/Chatbot.tsx"
|
|
19
|
+
"require": "./components/Chatbot.tsx",
|
|
20
|
+
"default": "./components/Chatbot.tsx"
|
|
17
21
|
},
|
|
18
22
|
"./types": {
|
|
23
|
+
"types": "./types/index.ts",
|
|
19
24
|
"import": "./types/index.ts",
|
|
20
25
|
"require": "./types/index.ts",
|
|
21
|
-
"
|
|
26
|
+
"default": "./types/index.ts"
|
|
22
27
|
}
|
|
23
28
|
},
|
|
24
29
|
"files": [
|
|
@@ -30,7 +35,8 @@
|
|
|
30
35
|
"scripts": {
|
|
31
36
|
"build": "echo 'Package is ready to use. Source files are included.'",
|
|
32
37
|
"dev": "next dev",
|
|
33
|
-
"prepare": "npm run build"
|
|
38
|
+
"prepare": "npm run build",
|
|
39
|
+
"type-check": "tsc --noEmit"
|
|
34
40
|
},
|
|
35
41
|
"keywords": [
|
|
36
42
|
"chatbot",
|