mehdi-akbari-ai-assistant-free 0.9.4 → 0.9.6

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 ADDED
@@ -0,0 +1,152 @@
1
+ AI Assistant - React Component
2
+ Author: Mehdi Akbari
3
+ Gmail: mehdiakbarideveloper@gmail.com
4
+ Telegram: @MehdiAkbariDev
5
+ ![alt text](https://img.shields.io/npm/v/mehdi-akbari-ai-assistant-free.svg)
6
+
7
+ ![alt text](https://img.shields.io/npm/l/mehdi-akbari-ai-assistant-free.svg)
8
+ ⚠️ Note: This project is currently under active development.
9
+ Features may change, and new updates are being added regularly. Contributions and feedback are welcome!
10
+ ⚠️ توجه: این پروژه در حال حاضر در حال توسعه فعال است.
11
+ ویژگی‌ها ممکن است تغییر کنند و به‌روزرسانی‌های جدید به طور مرتب اضافه می‌شوند. از مشارکت و بازخورد شما استقبال می‌شود!
12
+ English
13
+ A professional, beautiful, and ready-to-use AI chatbot component for your React projects. This package provides a floating, engaging UI, allowing you to easily integrate a smart assistant into your website. It's built with pure CSS, inspired by Tailwind's aesthetics, to ensure it works out-of-the-box in any project without extra configuration.
14
+ ![alt text](https://your-image-host.com/demo.gif)
15
+
16
+ (Recommendation: Record a GIF of the component in action and replace this link)
17
+ ✨ Key Features
18
+ Easy Setup: Just install the package, import the CSS, and drop the component into your app.
19
+ Floating Action Button (FAB): A floating button with a Lottie animation that opens and closes the chat window, accessible on all pages.
20
+ Fullscreen Mode: With a single click, the chat window expands to fill the entire screen for an immersive chat experience.
21
+ Customizable Lottie Animation: Easily replace the default FAB animation with your own Lottie animation.
22
+ Dynamic Text Input: A textarea that automatically resizes as the user types, perfect for comfortable multi-line messages.
23
+ CSS Variable Theming: Customize the component's colors and appearance to match your brand by simply overriding CSS variables.
24
+ Backend Agnostic: The component connects to any API endpoint you provide.
25
+ 🚀 Installation
26
+ Install the package in your project using npm or yarn:
27
+ code
28
+ Bash
29
+ npm install mehdi-akbari-ai-assistant-free
30
+ or
31
+ code
32
+ Bash
33
+ yarn add mehdi-akbari-ai-assistant-free
34
+ 📋 Usage
35
+ Step 1: Import the Styles
36
+ The most important step is to import the package's CSS file into your main application file. This makes all the necessary styles globally available.
37
+ In your layout.js/layout.tsx (Next.js) or App.js (Create React App), add the following line:
38
+ code
39
+ JavaScript
40
+ import 'mehdi-akbari-ai-assistant-free/styles.css';
41
+ Step 2: Use the Component
42
+ Import the AiAssistant component and place it in your desired page. The only required prop is apiEndpoint.
43
+ code
44
+ JavaScript
45
+ import { AiAssistant } from "mehdi-akbari-ai-assistant-free/react";
46
+
47
+ export default function HomePage() {
48
+ return (
49
+ <div>
50
+ <h1>Welcome to my website</h1>
51
+ <p>Click the robot in the bottom-right corner!</p>
52
+
53
+ <AiAssistant apiEndpoint="/api/chat" />
54
+ </div>
55
+ );
56
+ }
57
+ ⚙️ Props (API Reference)
58
+ Prop Type Required Default Description
59
+ apiEndpoint string Yes - The URL of your API endpoint that handles chat requests.
60
+ title string No "AI Assistant" The title displayed in the chat window header.
61
+ welcomeMessage string No "Hello! How can I help you?" The initial message displayed by the bot when the window opens.
62
+ lottieAnimationData any No A default robot animation The Lottie animation data. Can be a URL (string) or an imported JSON object.
63
+ 🎨 Customization (Theming)
64
+ You can easily customize the component's appearance by overriding the following CSS variables in your project's main CSS file (e.g., globals.css).
65
+ code
66
+ CSS
67
+ :root {
68
+ --ai-primary: #007BFF; /* Primary color (e.g., blue) */
69
+ --ai-primary-fg: #FFFFFF; /* Text color on primary background (e.g., white) */
70
+
71
+ --ai-bg: #FFFFFF; /* Main background of the chat window */
72
+ --ai-border: #DDDDDD; /* Border color */
73
+
74
+ --ai-text: #333333; /* Main text color */
75
+ --ai-text-secondary: #777777; /* Secondary text color (like placeholders) */
76
+
77
+ --ai-bot-bg: #F1F1F1; /* Bot message bubble background */
78
+ --ai-user-bg: #E1F0FF; /* User message bubble background */
79
+ --ai-user-text: #0052D4; /* User message text color */
80
+ }
81
+ <br>
82
+ فارسی
83
+ یک کامپوننت چت‌بات هوش مصنوعی حرفه‌ای، زیبا و کاملاً آماده برای استفاده در پروژه‌های React شما. این پکیج با ارائه یک رابط کاربری شناور و جذاب، به شما اجازه می‌دهد تا به سادگی یک دستیار هوشمند را به وب‌سایت خود اضافه کنید. این کامپوننت با الهام از زیبایی‌شناسی Tailwind CSS و با استفاده از CSS خالص ساخته شده تا بدون نیاز به هیچ‌گونه تنظیمات اضافی، در هر پروژه‌ای قابل استفاده باشد.
84
+ ![alt text](https://your-image-host.com/demo.gif)
85
+
86
+ (توصیه: یک فایل GIF از عملکرد کامپوننت ضبط کرده و این لینک را جایگزین کنید)
87
+ ✨ ویژگی‌های کلیدی
88
+ نصب و استفاده آسان: فقط پکیج را نصب کرده، فایل CSS را وارد کنید و کامپوننت را در برنامه خود قرار دهید.
89
+ رابط کاربری شناور (FAB): یک دکمه شناور با انیمیشن Lottie که پنجره چت را باز و بسته می‌کند و در تمام صفحات در دسترس است.
90
+ حالت تمام‌صفحه: با یک کلیک، پنجره چت کل صفحه را می‌پوشاند تا کاربر یک تجربه چت فراگیر داشته باشد.
91
+ انیمیشن Lottie قابل شخصی‌سازی: انیمیشن دکمه شناور را به سادگی با انیمیشن Lottie دلخواه خود جایگزین کنید.
92
+ ورودی متن داینامیک: textarea با قابلیت افزایش خودکار ارتفاع برای نوشتن پیام‌های چندخطی راحت.
93
+ شخصی‌سازی با متغیرهای CSS: رنگ‌ها و ظاهر کامپوننت را به سادگی با override کردن متغیرهای CSS مطابق با برند خود تغییر دهید.
94
+ مستقل از Backend: کامپوننت به سادگی به هر API Endpointی که شما مشخص کنید، متصل می‌شود.
95
+ 🚀 نصب
96
+ برای نصب پکیج، از دستور زیر در پروژه خود استفاده کنید:
97
+ code
98
+ Bash
99
+ npm install mehdi-akbari-ai-assistant-free
100
+ یا با استفاده از yarn:
101
+ code
102
+ Bash
103
+ yarn add mehdi-akbari-ai-assistant-free
104
+ 📋 نحوه استفاده
105
+ مرحله ۱: وارد کردن استایل‌ها
106
+ مهم‌ترین قدم، وارد کردن فایل CSS پکیج در فایل اصلی برنامه شماست. این کار باعث می‌شود تمام استایل‌های لازم در کل پروژه شما در دسترس باشند.
107
+ در فایل layout.js/layout.tsx (در Next.js) یا App.js (در Create React App)، خط زیر را اضافه کنید:
108
+ code
109
+ JavaScript
110
+ import 'mehdi-akbari-ai-assistant-free/styles.css';
111
+ مرحله ۲: استفاده از کامپوننت
112
+ کامپوننت AiAssistant را وارد کرده و آن را در صفحه مورد نظر خود قرار دهید. تنها پراپ ضروری، apiEndpoint است.
113
+ code
114
+ JavaScript
115
+ import { AiAssistant } from "mehdi-akbari-ai-assistant-free/react";
116
+
117
+ export default function HomePage() {
118
+ return (
119
+ <div>
120
+ <h1>به وب‌سایت من خوش آمدید</h1>
121
+ <p>روی ربات در گوشه پایین صفحه کلیک کنید!</p>
122
+
123
+ <AiAssistant apiEndpoint="/api/chat" />
124
+ </div>
125
+ );
126
+ }
127
+ ⚙️ پراپ‌ها (API Reference)
128
+ پراپ نوع ضروری پیش‌فرض توضیحات
129
+ apiEndpoint string بله - آدرس API Endpoint شما که درخواست‌های چت به آن ارسال می‌شود.
130
+ title string خیر "AI Assistant" عنوانی که در هدر پنجره چت نمایش داده می‌شود.
131
+ welcomeMessage string خیر "سلام! چطور می‌توانم کمکتان کنم؟" اولین پیامی که ربات پس از باز شدن پنجره نمایش می‌دهد.
132
+ lottieAnimationData any خیر یک انیمیشن ربات پیش‌فرض داده‌های انیمیشن Lottie. می‌توانید یک URL (رشته) یا یک آبجکت JSON وارد شده به آن بدهید.
133
+ 🎨 شخصی‌سازی (Theming)
134
+ شما می‌توانید به راحتی ظاهر کامپوننت را با override کردن متغیرهای CSS زیر در فایل CSS اصلی پروژه خود (مانند globals.css)، شخصی‌سازی کنید.
135
+ code
136
+ CSS
137
+ :root {
138
+ --ai-primary: #007BFF; /* رنگ اصلی (مثلا آبی) */
139
+ --ai-primary-fg: #FFFFFF; /* رنگ متن روی رنگ اصلی (مثلا سفید) */
140
+
141
+ --ai-bg: #FFFFFF; /* پس‌زمینه اصلی پنجره چت */
142
+ --ai-border: #DDDDDD; /* رنگ حاشیه‌ها */
143
+
144
+ --ai-text: #333333; /* رنگ متن اصلی */
145
+ --ai-text-secondary: #777777; /* رنگ متن ثانویه (مانند placeholder) */
146
+
147
+ --ai-bot-bg: #F1F1F1; /* پس‌زمینه حباب پیام ربات */
148
+ --ai-user-bg: #E1F0FF; /* پس‌زمینه حباب پیام کاربر */
149
+ --ai-user-text: #0052D4; /* رنگ متن پیام کاربر */
150
+ }
151
+ 📜 لایسنس
152
+ این پروژه تحت لایسنس MIT منتشر شده است. برای اطلاعات بیشتر فایل LICENSE را مطالعه کنید.
package/dist/react.js CHANGED
@@ -144,7 +144,7 @@ var ChatWindow = ({
144
144
  }) => {
145
145
  const [messages, setMessages] = (0, import_react3.useState)([]);
146
146
  const [isLoading, setIsLoading] = (0, import_react3.useState)(false);
147
- const version = "0.9.4";
147
+ const version = "0.9.6";
148
148
  (0, import_react3.useEffect)(() => {
149
149
  if (welcomeMessage && messages.length === 0) {
150
150
  setMessages([{ role: "assistant", content: welcomeMessage }]);
package/dist/react.mjs CHANGED
@@ -108,7 +108,7 @@ var ChatWindow = ({
108
108
  }) => {
109
109
  const [messages, setMessages] = useState2([]);
110
110
  const [isLoading, setIsLoading] = useState2(false);
111
- const version = "0.9.4";
111
+ const version = "0.9.6";
112
112
  useEffect3(() => {
113
113
  if (welcomeMessage && messages.length === 0) {
114
114
  setMessages([{ role: "assistant", content: welcomeMessage }]);
package/package.json CHANGED
@@ -1,12 +1,22 @@
1
1
  {
2
2
  "name": "mehdi-akbari-ai-assistant-free",
3
- "version": "0.9.4",
3
+ "version": "0.9.6",
4
4
  "description": "Professional AI Chatbot Library with self-contained CSS styles",
5
+ "homepage": "https://github.com/MehdiAkbariF/mehdi-akbari-ai-assistant-free#readme",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/MehdiAkbariF/mehdi-akbari-ai-assistant-free.git"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/MehdiAkbariF/mehdi-akbari-ai-assistant-free/issues"
12
+ },
5
13
  "main": "./dist/index.js",
6
14
  "module": "./dist/index.mjs",
7
15
  "types": "./dist/index.d.ts",
8
16
  "files": [
9
- "dist"
17
+ "dist",
18
+ "README.md",
19
+ "LICENSE"
10
20
  ],
11
21
  "exports": {
12
22
  ".": {
@@ -31,8 +41,8 @@
31
41
  "react-dom": ">=18"
32
42
  },
33
43
  "dependencies": {
34
- "@langchain/core": "^1.1.8",
35
- "@langchain/groq": "^1.0.2",
44
+ "@langchain/core": "^0.1.0",
45
+ "@langchain/groq": "^0.0.14",
36
46
  "clsx": "^2.1.0",
37
47
  "lottie-react": "^2.4.0",
38
48
  "lucide-react": "^0.300.0"
@@ -50,11 +60,9 @@
50
60
  "react",
51
61
  "chatbot",
52
62
  "ai",
53
- "groq",
54
- "langchain",
55
63
  "chat-window",
56
64
  "ui-component"
57
65
  ],
58
66
  "author": "Mehdi Akbari",
59
67
  "license": "MIT"
60
- }
68
+ }