@a.izzuddin/ai-chat 0.1.1 → 0.1.2
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 +16 -16
- package/README.npm.md +20 -20
- package/custom-elements.json +28 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A **framework-agnostic** AI chat web component built with Lit and TypeScript. Works seamlessly with React, Vue, Svelte, Angular, and vanilla JavaScript.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/@a.izzuddin/ai-chat)
|
|
6
|
+
[](https://www.npmjs.com/package/@a.izzuddin/ai-chat)
|
|
7
7
|
|
|
8
8
|
## ✨ Features
|
|
9
9
|
|
|
@@ -19,11 +19,11 @@ A **framework-agnostic** AI chat web component built with Lit and TypeScript. Wo
|
|
|
19
19
|
## 📦 Installation
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
npm install @
|
|
22
|
+
npm install @a.izzuddin/ai-chat
|
|
23
23
|
# or
|
|
24
|
-
yarn add @
|
|
24
|
+
yarn add @a.izzuddin/ai-chat
|
|
25
25
|
# or
|
|
26
|
-
pnpm add @
|
|
26
|
+
pnpm add @a.izzuddin/ai-chat
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
## 🚀 Quick Start
|
|
@@ -35,7 +35,7 @@ pnpm add @yourusername/ai-chat
|
|
|
35
35
|
<html>
|
|
36
36
|
<body>
|
|
37
37
|
<script type="module">
|
|
38
|
-
import '@
|
|
38
|
+
import '@a.izzuddin/ai-chat';
|
|
39
39
|
</script>
|
|
40
40
|
|
|
41
41
|
<ai-chat
|
|
@@ -50,7 +50,7 @@ pnpm add @yourusername/ai-chat
|
|
|
50
50
|
### React
|
|
51
51
|
|
|
52
52
|
```tsx
|
|
53
|
-
import '@
|
|
53
|
+
import '@a.izzuddin/ai-chat';
|
|
54
54
|
|
|
55
55
|
function App() {
|
|
56
56
|
return (
|
|
@@ -75,7 +75,7 @@ function App() {
|
|
|
75
75
|
</template>
|
|
76
76
|
|
|
77
77
|
<script setup>
|
|
78
|
-
import '@
|
|
78
|
+
import '@a.izzuddin/ai-chat';
|
|
79
79
|
const apiUrl = import.meta.env.VITE_API_URL;
|
|
80
80
|
</script>
|
|
81
81
|
```
|
|
@@ -84,7 +84,7 @@ const apiUrl = import.meta.env.VITE_API_URL;
|
|
|
84
84
|
|
|
85
85
|
```svelte
|
|
86
86
|
<script>
|
|
87
|
-
import '@
|
|
87
|
+
import '@a.izzuddin/ai-chat';
|
|
88
88
|
export let apiUrl;
|
|
89
89
|
</script>
|
|
90
90
|
|
|
@@ -99,7 +99,7 @@ const apiUrl = import.meta.env.VITE_API_URL;
|
|
|
99
99
|
|
|
100
100
|
```typescript
|
|
101
101
|
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
102
|
-
import '@
|
|
102
|
+
import '@a.izzuddin/ai-chat';
|
|
103
103
|
|
|
104
104
|
@Component({
|
|
105
105
|
selector: 'app-root',
|
|
@@ -163,7 +163,7 @@ chat.addEventListener('error', (event) => {
|
|
|
163
163
|
### TypeScript Types
|
|
164
164
|
|
|
165
165
|
```typescript
|
|
166
|
-
import type { Message } from '@
|
|
166
|
+
import type { Message } from '@a.izzuddin/ai-chat';
|
|
167
167
|
|
|
168
168
|
interface Message {
|
|
169
169
|
id: string;
|
|
@@ -253,13 +253,13 @@ If you were using the React-only version:
|
|
|
253
253
|
|
|
254
254
|
**Before:**
|
|
255
255
|
```tsx
|
|
256
|
-
import { AIChat } from '@
|
|
256
|
+
import { AIChat } from '@a.izzuddin/ai-chat';
|
|
257
257
|
<AIChat apiUrl="..." />
|
|
258
258
|
```
|
|
259
259
|
|
|
260
260
|
**After:**
|
|
261
261
|
```tsx
|
|
262
|
-
import '@
|
|
262
|
+
import '@a.izzuddin/ai-chat';
|
|
263
263
|
<ai-chat api-url="..." />
|
|
264
264
|
```
|
|
265
265
|
|
|
@@ -278,10 +278,10 @@ MIT © [Your Name]
|
|
|
278
278
|
|
|
279
279
|
## 🔗 Links
|
|
280
280
|
|
|
281
|
-
- [Documentation](https://github.com/
|
|
281
|
+
- [Documentation](https://github.com/a.izzuddin/ai-chat#readme)
|
|
282
282
|
- [Examples](./examples)
|
|
283
|
-
- [Issue Tracker](https://github.com/
|
|
284
|
-
- [npm Package](https://www.npmjs.com/package/@
|
|
283
|
+
- [Issue Tracker](https://github.com/a.izzuddin/ai-chat/issues)
|
|
284
|
+
- [npm Package](https://www.npmjs.com/package/@a.izzuddin/ai-chat)
|
|
285
285
|
|
|
286
286
|
## ⭐ Similar Projects
|
|
287
287
|
|
package/README.npm.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @a.izzuddin/ai-chat
|
|
2
2
|
|
|
3
3
|
A beautiful, configurable AI chat component for React applications. Built with Radix UI, Tailwind CSS, and TypeScript.
|
|
4
4
|
|
|
@@ -14,11 +14,11 @@ A beautiful, configurable AI chat component for React applications. Built with R
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
npm install @
|
|
17
|
+
npm install @a.izzuddin/ai-chat
|
|
18
18
|
# or
|
|
19
|
-
yarn add @
|
|
19
|
+
yarn add @a.izzuddin/ai-chat
|
|
20
20
|
# or
|
|
21
|
-
pnpm add @
|
|
21
|
+
pnpm add @a.izzuddin/ai-chat
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
### Peer Dependencies
|
|
@@ -32,8 +32,8 @@ npm install react react-dom
|
|
|
32
32
|
## Quick Start
|
|
33
33
|
|
|
34
34
|
```tsx
|
|
35
|
-
import { AIChat } from "@
|
|
36
|
-
import "@
|
|
35
|
+
import { AIChat } from "@a.izzuddin/ai-chat";
|
|
36
|
+
import "@a.izzuddin/ai-chat/styles";
|
|
37
37
|
|
|
38
38
|
function App() {
|
|
39
39
|
return (
|
|
@@ -57,7 +57,7 @@ module.exports = {
|
|
|
57
57
|
"./app/**/*.{js,ts,jsx,tsx}",
|
|
58
58
|
"./components/**/*.{js,ts,jsx,tsx}",
|
|
59
59
|
// Add this line:
|
|
60
|
-
"./node_modules/@
|
|
60
|
+
"./node_modules/@a.izzuddin/ai-chat/**/*.{js,ts,jsx,tsx}",
|
|
61
61
|
],
|
|
62
62
|
// ... rest of your config
|
|
63
63
|
};
|
|
@@ -67,7 +67,7 @@ Or if using Tailwind v4, add to your CSS:
|
|
|
67
67
|
|
|
68
68
|
```css
|
|
69
69
|
@import "tailwindcss";
|
|
70
|
-
@import "@
|
|
70
|
+
@import "@a.izzuddin/ai-chat/styles";
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
## API Requirements
|
|
@@ -174,7 +174,7 @@ function ChatPage() {
|
|
|
174
174
|
Full TypeScript support is included. Import types as needed:
|
|
175
175
|
|
|
176
176
|
```tsx
|
|
177
|
-
import type { Message, AIChatProps } from "@
|
|
177
|
+
import type { Message, AIChatProps } from "@a.izzuddin/ai-chat";
|
|
178
178
|
|
|
179
179
|
const customMessage: Message = {
|
|
180
180
|
id: "123",
|
|
@@ -216,8 +216,8 @@ The component uses Tailwind CSS with custom theme variables. You can customize t
|
|
|
216
216
|
```tsx
|
|
217
217
|
"use client";
|
|
218
218
|
|
|
219
|
-
import { AIChat } from "@
|
|
220
|
-
import "@
|
|
219
|
+
import { AIChat } from "@a.izzuddin/ai-chat";
|
|
220
|
+
import "@a.izzuddin/ai-chat/styles";
|
|
221
221
|
|
|
222
222
|
export default function ChatPage() {
|
|
223
223
|
return <AIChat apiUrl={process.env.NEXT_PUBLIC_API_URL!} />;
|
|
@@ -227,8 +227,8 @@ export default function ChatPage() {
|
|
|
227
227
|
### Next.js (Pages Router)
|
|
228
228
|
|
|
229
229
|
```tsx
|
|
230
|
-
import { AIChat } from "@
|
|
231
|
-
import "@
|
|
230
|
+
import { AIChat } from "@a.izzuddin/ai-chat";
|
|
231
|
+
import "@a.izzuddin/ai-chat/styles";
|
|
232
232
|
|
|
233
233
|
export default function ChatPage() {
|
|
234
234
|
return <AIChat apiUrl={process.env.NEXT_PUBLIC_API_URL!} />;
|
|
@@ -238,8 +238,8 @@ export default function ChatPage() {
|
|
|
238
238
|
### Vite + React
|
|
239
239
|
|
|
240
240
|
```tsx
|
|
241
|
-
import { AIChat } from "@
|
|
242
|
-
import "@
|
|
241
|
+
import { AIChat } from "@a.izzuddin/ai-chat";
|
|
242
|
+
import "@a.izzuddin/ai-chat/styles";
|
|
243
243
|
|
|
244
244
|
function App() {
|
|
245
245
|
return <AIChat apiUrl={import.meta.env.VITE_API_URL} />;
|
|
@@ -249,8 +249,8 @@ function App() {
|
|
|
249
249
|
### Create React App
|
|
250
250
|
|
|
251
251
|
```tsx
|
|
252
|
-
import { AIChat } from "@
|
|
253
|
-
import "@
|
|
252
|
+
import { AIChat } from "@a.izzuddin/ai-chat";
|
|
253
|
+
import "@a.izzuddin/ai-chat/styles";
|
|
254
254
|
|
|
255
255
|
function App() {
|
|
256
256
|
return <AIChat apiUrl={process.env.REACT_APP_API_URL} />;
|
|
@@ -288,6 +288,6 @@ MIT © [Your Name]
|
|
|
288
288
|
|
|
289
289
|
## Support
|
|
290
290
|
|
|
291
|
-
- 📖 [Documentation](https://github.com/
|
|
292
|
-
- 🐛 [Issue Tracker](https://github.com/
|
|
293
|
-
- 💬 [Discussions](https://github.com/
|
|
291
|
+
- 📖 [Documentation](https://github.com/a.izzuddin/ai-chat#readme)
|
|
292
|
+
- 🐛 [Issue Tracker](https://github.com/a.izzuddin/ai-chat/issues)
|
|
293
|
+
- 💬 [Discussions](https://github.com/a.izzuddin/ai-chat/discussions)
|
package/custom-elements.json
CHANGED
|
@@ -72,6 +72,34 @@
|
|
|
72
72
|
"declarations": [],
|
|
73
73
|
"exports": []
|
|
74
74
|
},
|
|
75
|
+
{
|
|
76
|
+
"kind": "javascript-module",
|
|
77
|
+
"path": "lib/utils.ts",
|
|
78
|
+
"declarations": [
|
|
79
|
+
{
|
|
80
|
+
"kind": "function",
|
|
81
|
+
"name": "cn",
|
|
82
|
+
"parameters": [
|
|
83
|
+
{
|
|
84
|
+
"name": "inputs",
|
|
85
|
+
"type": {
|
|
86
|
+
"text": "ClassValue[]"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"exports": [
|
|
93
|
+
{
|
|
94
|
+
"kind": "js",
|
|
95
|
+
"name": "cn",
|
|
96
|
+
"declaration": {
|
|
97
|
+
"name": "cn",
|
|
98
|
+
"module": "lib/utils.ts"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
},
|
|
75
103
|
{
|
|
76
104
|
"kind": "javascript-module",
|
|
77
105
|
"path": "examples/angular.component.ts",
|
|
@@ -162,34 +190,6 @@
|
|
|
162
190
|
}
|
|
163
191
|
]
|
|
164
192
|
},
|
|
165
|
-
{
|
|
166
|
-
"kind": "javascript-module",
|
|
167
|
-
"path": "lib/utils.ts",
|
|
168
|
-
"declarations": [
|
|
169
|
-
{
|
|
170
|
-
"kind": "function",
|
|
171
|
-
"name": "cn",
|
|
172
|
-
"parameters": [
|
|
173
|
-
{
|
|
174
|
-
"name": "inputs",
|
|
175
|
-
"type": {
|
|
176
|
-
"text": "ClassValue[]"
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
]
|
|
180
|
-
}
|
|
181
|
-
],
|
|
182
|
-
"exports": [
|
|
183
|
-
{
|
|
184
|
-
"kind": "js",
|
|
185
|
-
"name": "cn",
|
|
186
|
-
"declaration": {
|
|
187
|
-
"name": "cn",
|
|
188
|
-
"module": "lib/utils.ts"
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
]
|
|
192
|
-
},
|
|
193
193
|
{
|
|
194
194
|
"kind": "javascript-module",
|
|
195
195
|
"path": "src/index.ts",
|
package/package.json
CHANGED