nerdagent-chat-widget-angular 1.0.25 → 1.0.26
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 +14 -166
- package/package.json +19 -16
- package/dist/README.md +0 -267
- package/dist/esm2022/index.mjs +0 -4
- package/dist/esm2022/lib/chat-widget.component.mjs +0 -99
- package/dist/esm2022/lib/chat-widget.module.mjs +0 -29
- package/dist/esm2022/lib/chat-widget.types.mjs +0 -2
- package/dist/esm2022/nerdagent-chat-widget-angular.mjs +0 -5
- package/dist/fesm2022/nerdagent-chat-widget-angular.mjs +0 -131
- package/dist/fesm2022/nerdagent-chat-widget-angular.mjs.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/lib/chat-widget.component.d.ts +0 -33
- package/dist/lib/chat-widget.module.d.ts +0 -8
- package/dist/lib/chat-widget.types.d.ts +0 -27
package/README.md
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
# NerdAgent Chat Widget for Angular
|
|
2
2
|
|
|
3
|
-
A
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- 🚀 **Framework Agnostic Core** - Built with Stencil.js Web Components
|
|
8
|
-
- 🎨 **Highly Customizable** - Colors, positioning, features, and more
|
|
9
|
-
- 📱 **Responsive Design** - Works on desktop and mobile
|
|
10
|
-
- 🔧 **TypeScript Support** - Full type definitions included
|
|
11
|
-
- ⚡ **Lightweight** - Minimal bundle size impact
|
|
12
|
-
- 🎯 **Easy Integration** - Simple Angular component wrapper
|
|
3
|
+
A customizable chat widget component for Angular applications.
|
|
13
4
|
|
|
14
5
|
## Installation
|
|
15
6
|
|
|
@@ -17,7 +8,7 @@ A powerful, customizable chat widget component for Angular applications. Built w
|
|
|
17
8
|
npm install nerdagent-chat-widget-angular
|
|
18
9
|
```
|
|
19
10
|
|
|
20
|
-
##
|
|
11
|
+
## Usage
|
|
21
12
|
|
|
22
13
|
### 1. Import the Module
|
|
23
14
|
|
|
@@ -31,7 +22,6 @@ import { NerdChatWidgetModule } from 'nerdagent-chat-widget-angular';
|
|
|
31
22
|
BrowserModule,
|
|
32
23
|
NerdChatWidgetModule
|
|
33
24
|
],
|
|
34
|
-
// ... rest of your module
|
|
35
25
|
})
|
|
36
26
|
export class AppModule { }
|
|
37
27
|
```
|
|
@@ -40,11 +30,14 @@ export class AppModule { }
|
|
|
40
30
|
|
|
41
31
|
```html
|
|
42
32
|
<nerd-chat-widget
|
|
33
|
+
[apikey]="'your-api-key'"
|
|
34
|
+
[agent-id]="'your-agent-id'"
|
|
43
35
|
[agent-name]="'Support Agent'"
|
|
44
36
|
[agent-role]="'Customer Support'"
|
|
45
37
|
[primary-color]="'#2d3e50'"
|
|
46
38
|
[accent-color]="'#4e8cff'"
|
|
47
39
|
[welcome-message]="'Hi! How can I help you today?'"
|
|
40
|
+
[placeholder-text]="'Type your message...'"
|
|
48
41
|
[position]="'bottom-right'"
|
|
49
42
|
[width]="'350'"
|
|
50
43
|
[height]="'500'"
|
|
@@ -66,75 +59,37 @@ import { Component } from '@angular/core';
|
|
|
66
59
|
|
|
67
60
|
@Component({
|
|
68
61
|
selector: 'app-root',
|
|
69
|
-
|
|
70
|
-
<nerd-chat-widget
|
|
71
|
-
[agent-name]="config.agentName"
|
|
72
|
-
[agent-role]="config.agentRole"
|
|
73
|
-
[primary-color]="config.primaryColor"
|
|
74
|
-
[accent-color]="config.accentColor"
|
|
75
|
-
[welcome-message]="config.welcomeMessage"
|
|
76
|
-
[position]="config.position"
|
|
77
|
-
[width]="config.width"
|
|
78
|
-
[height]="config.height"
|
|
79
|
-
[show-minimize-button]="config.showMinimizeButton"
|
|
80
|
-
[show-timestamps]="config.showTimestamps"
|
|
81
|
-
[enable-file-upload]="config.enableFileUpload"
|
|
82
|
-
[enable-speech]="config.enableSpeech"
|
|
83
|
-
[show-powered-by]="config.showPoweredBy"
|
|
84
|
-
(messageSent)="onMessageSent($event)"
|
|
85
|
-
(widgetOpened)="onWidgetOpened()"
|
|
86
|
-
(widgetClosed)="onWidgetClosed()">
|
|
87
|
-
</nerd-chat-widget>
|
|
88
|
-
`
|
|
62
|
+
templateUrl: './app.component.html'
|
|
89
63
|
})
|
|
90
64
|
export class AppComponent {
|
|
91
|
-
config = {
|
|
92
|
-
agentName: 'Support Agent',
|
|
93
|
-
agentRole: 'Customer Support',
|
|
94
|
-
primaryColor: '#2d3e50',
|
|
95
|
-
accentColor: '#4e8cff',
|
|
96
|
-
welcomeMessage: 'Hi! How can I help you today?',
|
|
97
|
-
placeholderText: 'Type your message...',
|
|
98
|
-
position: 'bottom-right' as 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left',
|
|
99
|
-
width: '350',
|
|
100
|
-
height: '500',
|
|
101
|
-
showMinimizeButton: true,
|
|
102
|
-
showTimestamps: true,
|
|
103
|
-
enableFileUpload: false,
|
|
104
|
-
enableSpeech: false,
|
|
105
|
-
showPoweredBy: true
|
|
106
|
-
};
|
|
107
|
-
|
|
108
65
|
onMessageSent(event: { message: string; timestamp: Date }) {
|
|
109
66
|
console.log('Message sent:', event);
|
|
110
|
-
// Handle message sent event
|
|
111
67
|
}
|
|
112
68
|
|
|
113
69
|
onWidgetOpened() {
|
|
114
70
|
console.log('Widget opened');
|
|
115
|
-
// Handle widget opened event
|
|
116
71
|
}
|
|
117
72
|
|
|
118
73
|
onWidgetClosed() {
|
|
119
74
|
console.log('Widget closed');
|
|
120
|
-
// Handle widget closed event
|
|
121
75
|
}
|
|
122
76
|
}
|
|
123
77
|
```
|
|
124
78
|
|
|
125
|
-
##
|
|
126
|
-
|
|
127
|
-
### Input Properties
|
|
79
|
+
## Properties
|
|
128
80
|
|
|
129
81
|
| Property | Type | Default | Description |
|
|
130
82
|
|----------|------|---------|-------------|
|
|
83
|
+
| `apikey` | `string` | - | API key for authentication |
|
|
84
|
+
| `agent-id` | `string` | - | Agent ID to connect to |
|
|
85
|
+
| `token` | `string` | - | JWT token for authentication |
|
|
131
86
|
| `agentName` | `string` | `'Support Agent'` | Name of the support agent |
|
|
132
87
|
| `agentRole` | `string` | `'Customer Support'` | Role/title of the agent |
|
|
133
88
|
| `primaryColor` | `string` | `'#2d3e50'` | Primary color theme |
|
|
134
89
|
| `accentColor` | `string` | `'#4e8cff'` | Accent color theme |
|
|
135
90
|
| `welcomeMessage` | `string` | `'Hi! How can I help?'` | Initial welcome message |
|
|
136
91
|
| `placeholderText` | `string` | `'Type your message...'` | Input placeholder text |
|
|
137
|
-
| `position` | `
|
|
92
|
+
| `position` | `'bottom-right' \| 'bottom-left' \| 'top-right' \| 'top-left'` | `'bottom-right'` | Widget position on screen |
|
|
138
93
|
| `width` | `string` | `'350'` | Widget width in pixels |
|
|
139
94
|
| `height` | `string` | `'500'` | Widget height in pixels |
|
|
140
95
|
| `showMinimizeButton` | `boolean` | `true` | Show minimize/maximize button |
|
|
@@ -143,13 +98,7 @@ export class AppComponent {
|
|
|
143
98
|
| `enableSpeech` | `boolean` | `false` | Enable speech recognition |
|
|
144
99
|
| `showPoweredBy` | `boolean` | `true` | Show "Powered by" branding |
|
|
145
100
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
```typescript
|
|
149
|
-
type WidgetPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Output Events
|
|
101
|
+
## Events
|
|
153
102
|
|
|
154
103
|
| Event | Type | Description |
|
|
155
104
|
|-------|------|-------------|
|
|
@@ -157,111 +106,10 @@ type WidgetPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
|
157
106
|
| `widgetOpened` | `void` | Fired when widget is opened |
|
|
158
107
|
| `widgetClosed` | `void` | Fired when widget is closed |
|
|
159
108
|
|
|
160
|
-
## Advanced Usage
|
|
161
|
-
|
|
162
|
-
### Dynamic Configuration
|
|
163
|
-
|
|
164
|
-
```typescript
|
|
165
|
-
export class AppComponent {
|
|
166
|
-
config = {
|
|
167
|
-
agentName: 'AI Assistant',
|
|
168
|
-
agentRole: 'Virtual Support',
|
|
169
|
-
primaryColor: '#007bff',
|
|
170
|
-
accentColor: '#28a745',
|
|
171
|
-
welcomeMessage: 'Hello! I\'m here to help.',
|
|
172
|
-
position: 'bottom-left' as WidgetPosition,
|
|
173
|
-
width: '400',
|
|
174
|
-
height: '600',
|
|
175
|
-
showMinimizeButton: true,
|
|
176
|
-
showTimestamps: true,
|
|
177
|
-
enableFileUpload: true,
|
|
178
|
-
enableSpeech: true,
|
|
179
|
-
showPoweredBy: false
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
updateConfig() {
|
|
183
|
-
// Update configuration dynamically
|
|
184
|
-
this.config.primaryColor = '#ff6b6b';
|
|
185
|
-
this.config.position = 'top-right';
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### Custom Styling
|
|
191
|
-
|
|
192
|
-
The widget uses CSS custom properties for theming. You can override these in your global styles:
|
|
193
|
-
|
|
194
|
-
```css
|
|
195
|
-
:root {
|
|
196
|
-
--primary-color: #your-color;
|
|
197
|
-
--accent-color: #your-accent;
|
|
198
|
-
--widget-width: 400px;
|
|
199
|
-
--widget-height: 600px;
|
|
200
|
-
--font-family: 'Your Font', sans-serif;
|
|
201
|
-
}
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
## Browser Support
|
|
205
|
-
|
|
206
|
-
- Chrome 60+
|
|
207
|
-
- Firefox 55+
|
|
208
|
-
- Safari 10+
|
|
209
|
-
- Edge 79+
|
|
210
|
-
|
|
211
109
|
## TypeScript Support
|
|
212
110
|
|
|
213
|
-
Full TypeScript definitions are included.
|
|
214
|
-
|
|
215
|
-
```typescript
|
|
216
|
-
import { WidgetPosition } from 'nerdagent-chat-widget-angular';
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
## Troubleshooting
|
|
220
|
-
|
|
221
|
-
### Common Issues
|
|
222
|
-
|
|
223
|
-
1. **Widget not appearing**: Ensure the module is imported in your app module
|
|
224
|
-
2. **Styling issues**: Check that FontAwesome is loaded for icons
|
|
225
|
-
3. **Events not firing**: Verify event handlers are properly bound
|
|
226
|
-
|
|
227
|
-
### Debug Mode
|
|
228
|
-
|
|
229
|
-
Enable debug logging by setting the browser's localStorage:
|
|
230
|
-
|
|
231
|
-
```javascript
|
|
232
|
-
localStorage.setItem('nerdagent-chat-widget-debug', 'true');
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
## Contributing
|
|
236
|
-
|
|
237
|
-
We welcome contributions! Please see our [Contributing Guide](../../CONTRIBUTING.md) for details.
|
|
111
|
+
Full TypeScript definitions are included.
|
|
238
112
|
|
|
239
113
|
## License
|
|
240
114
|
|
|
241
|
-
MIT
|
|
242
|
-
|
|
243
|
-
## Support
|
|
244
|
-
|
|
245
|
-
- 📧 Email: support@nerdagent.ai
|
|
246
|
-
- 📖 Documentation: [docs.nerdagent.ai](https://docs.nerdagent.ai)
|
|
247
|
-
- 🐛 Issues: [GitHub Issues](https://github.com/nerdagent/chat-widget/issues)
|
|
248
|
-
|
|
249
|
-
## Changelog
|
|
250
|
-
|
|
251
|
-
### v1.0.6
|
|
252
|
-
- Fixed infinite recursion issue in component template
|
|
253
|
-
- Improved AOT compilation support
|
|
254
|
-
- Enhanced TypeScript definitions
|
|
255
|
-
|
|
256
|
-
### v1.0.5
|
|
257
|
-
- Fixed package entry points for proper module resolution
|
|
258
|
-
- Improved build configuration
|
|
259
|
-
|
|
260
|
-
### v1.0.4
|
|
261
|
-
- Added proper AOT compilation support
|
|
262
|
-
- Fixed Angular Ivy compatibility
|
|
263
|
-
|
|
264
|
-
### v1.0.3
|
|
265
|
-
- Initial release with Angular wrapper
|
|
266
|
-
- Full TypeScript support
|
|
267
|
-
- Event handling integration
|
|
115
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nerdagent-chat-widget-angular",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"description": "NerdAgent Chat Widget for Angular",
|
|
5
5
|
"main": "dist/fesm2022/nerdagent-chat-widget-angular.mjs",
|
|
6
|
-
"module": "
|
|
6
|
+
"module": "fesm2022/nerdagent-chat-widget-angular.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist/"
|
|
10
10
|
],
|
|
11
|
-
"scripts": {
|
|
12
|
-
"build": "ng-packagr -p ng-package.json",
|
|
13
|
-
"prepublishOnly": "npm run build"
|
|
14
|
-
},
|
|
15
11
|
"keywords": [
|
|
16
12
|
"angular",
|
|
17
13
|
"chat",
|
|
@@ -26,19 +22,26 @@
|
|
|
26
22
|
"@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
|
|
27
23
|
},
|
|
28
24
|
"dependencies": {
|
|
29
|
-
"nerdagent-chat-widget": "^1.0.5"
|
|
30
|
-
|
|
31
|
-
"devDependencies": {
|
|
32
|
-
"@angular/common": "^18.0.0",
|
|
33
|
-
"@angular/core": "^18.0.0",
|
|
34
|
-
"@types/node": "^20.0.0",
|
|
35
|
-
"ng-packagr": "^18.0.0",
|
|
36
|
-
"typescript": "^5.0.0"
|
|
25
|
+
"nerdagent-chat-widget": "^1.0.5",
|
|
26
|
+
"tslib": "^2.3.0"
|
|
37
27
|
},
|
|
38
28
|
"repository": {
|
|
39
29
|
"type": "git",
|
|
40
30
|
"url": "https://github.com/nerdagent/chat-widget.git",
|
|
41
31
|
"directory": "packages/angular"
|
|
42
32
|
},
|
|
43
|
-
"gitHead": "
|
|
44
|
-
|
|
33
|
+
"gitHead": "f46abd47a7632d8fc690b202bfc7c202bcb8b18f",
|
|
34
|
+
"typings": "index.d.ts",
|
|
35
|
+
"exports": {
|
|
36
|
+
"./package.json": {
|
|
37
|
+
"default": "./package.json"
|
|
38
|
+
},
|
|
39
|
+
".": {
|
|
40
|
+
"types": "./index.d.ts",
|
|
41
|
+
"esm2022": "./esm2022/nerdagent-chat-widget-angular.mjs",
|
|
42
|
+
"esm": "./esm2022/nerdagent-chat-widget-angular.mjs",
|
|
43
|
+
"default": "./fesm2022/nerdagent-chat-widget-angular.mjs"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"sideEffects": false
|
|
47
|
+
}
|
package/dist/README.md
DELETED
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
# NerdAgent Chat Widget for Angular
|
|
2
|
-
|
|
3
|
-
A powerful, customizable chat widget component for Angular applications. Built with Stencil.js for maximum compatibility and performance.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- 🚀 **Framework Agnostic Core** - Built with Stencil.js Web Components
|
|
8
|
-
- 🎨 **Highly Customizable** - Colors, positioning, features, and more
|
|
9
|
-
- 📱 **Responsive Design** - Works on desktop and mobile
|
|
10
|
-
- 🔧 **TypeScript Support** - Full type definitions included
|
|
11
|
-
- ⚡ **Lightweight** - Minimal bundle size impact
|
|
12
|
-
- 🎯 **Easy Integration** - Simple Angular component wrapper
|
|
13
|
-
|
|
14
|
-
## Installation
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npm install nerdagent-chat-widget-angular
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Quick Start
|
|
21
|
-
|
|
22
|
-
### 1. Import the Module
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
import { NgModule } from '@angular/core';
|
|
26
|
-
import { BrowserModule } from '@angular/platform-browser';
|
|
27
|
-
import { NerdChatWidgetModule } from 'nerdagent-chat-widget-angular';
|
|
28
|
-
|
|
29
|
-
@NgModule({
|
|
30
|
-
imports: [
|
|
31
|
-
BrowserModule,
|
|
32
|
-
NerdChatWidgetModule
|
|
33
|
-
],
|
|
34
|
-
// ... rest of your module
|
|
35
|
-
})
|
|
36
|
-
export class AppModule { }
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### 2. Use the Component
|
|
40
|
-
|
|
41
|
-
```html
|
|
42
|
-
<nerd-chat-widget
|
|
43
|
-
[agent-name]="'Support Agent'"
|
|
44
|
-
[agent-role]="'Customer Support'"
|
|
45
|
-
[primary-color]="'#2d3e50'"
|
|
46
|
-
[accent-color]="'#4e8cff'"
|
|
47
|
-
[welcome-message]="'Hi! How can I help you today?'"
|
|
48
|
-
[position]="'bottom-right'"
|
|
49
|
-
[width]="'350'"
|
|
50
|
-
[height]="'500'"
|
|
51
|
-
[show-minimize-button]="true"
|
|
52
|
-
[show-timestamps]="true"
|
|
53
|
-
[enable-file-upload]="false"
|
|
54
|
-
[enable-speech]="false"
|
|
55
|
-
[show-powered-by]="true"
|
|
56
|
-
(messageSent)="onMessageSent($event)"
|
|
57
|
-
(widgetOpened)="onWidgetOpened()"
|
|
58
|
-
(widgetClosed)="onWidgetClosed()">
|
|
59
|
-
</nerd-chat-widget>
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### 3. Handle Events
|
|
63
|
-
|
|
64
|
-
```typescript
|
|
65
|
-
import { Component } from '@angular/core';
|
|
66
|
-
|
|
67
|
-
@Component({
|
|
68
|
-
selector: 'app-root',
|
|
69
|
-
template: `
|
|
70
|
-
<nerd-chat-widget
|
|
71
|
-
[agent-name]="config.agentName"
|
|
72
|
-
[agent-role]="config.agentRole"
|
|
73
|
-
[primary-color]="config.primaryColor"
|
|
74
|
-
[accent-color]="config.accentColor"
|
|
75
|
-
[welcome-message]="config.welcomeMessage"
|
|
76
|
-
[position]="config.position"
|
|
77
|
-
[width]="config.width"
|
|
78
|
-
[height]="config.height"
|
|
79
|
-
[show-minimize-button]="config.showMinimizeButton"
|
|
80
|
-
[show-timestamps]="config.showTimestamps"
|
|
81
|
-
[enable-file-upload]="config.enableFileUpload"
|
|
82
|
-
[enable-speech]="config.enableSpeech"
|
|
83
|
-
[show-powered-by]="config.showPoweredBy"
|
|
84
|
-
(messageSent)="onMessageSent($event)"
|
|
85
|
-
(widgetOpened)="onWidgetOpened()"
|
|
86
|
-
(widgetClosed)="onWidgetClosed()">
|
|
87
|
-
</nerd-chat-widget>
|
|
88
|
-
`
|
|
89
|
-
})
|
|
90
|
-
export class AppComponent {
|
|
91
|
-
config = {
|
|
92
|
-
agentName: 'Support Agent',
|
|
93
|
-
agentRole: 'Customer Support',
|
|
94
|
-
primaryColor: '#2d3e50',
|
|
95
|
-
accentColor: '#4e8cff',
|
|
96
|
-
welcomeMessage: 'Hi! How can I help you today?',
|
|
97
|
-
placeholderText: 'Type your message...',
|
|
98
|
-
position: 'bottom-right' as 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left',
|
|
99
|
-
width: '350',
|
|
100
|
-
height: '500',
|
|
101
|
-
showMinimizeButton: true,
|
|
102
|
-
showTimestamps: true,
|
|
103
|
-
enableFileUpload: false,
|
|
104
|
-
enableSpeech: false,
|
|
105
|
-
showPoweredBy: true
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
onMessageSent(event: { message: string; timestamp: Date }) {
|
|
109
|
-
console.log('Message sent:', event);
|
|
110
|
-
// Handle message sent event
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
onWidgetOpened() {
|
|
114
|
-
console.log('Widget opened');
|
|
115
|
-
// Handle widget opened event
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
onWidgetClosed() {
|
|
119
|
-
console.log('Widget closed');
|
|
120
|
-
// Handle widget closed event
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## Configuration Options
|
|
126
|
-
|
|
127
|
-
### Input Properties
|
|
128
|
-
|
|
129
|
-
| Property | Type | Default | Description |
|
|
130
|
-
|----------|------|---------|-------------|
|
|
131
|
-
| `agentName` | `string` | `'Support Agent'` | Name of the support agent |
|
|
132
|
-
| `agentRole` | `string` | `'Customer Support'` | Role/title of the agent |
|
|
133
|
-
| `primaryColor` | `string` | `'#2d3e50'` | Primary color theme |
|
|
134
|
-
| `accentColor` | `string` | `'#4e8cff'` | Accent color theme |
|
|
135
|
-
| `welcomeMessage` | `string` | `'Hi! How can I help?'` | Initial welcome message |
|
|
136
|
-
| `placeholderText` | `string` | `'Type your message...'` | Input placeholder text |
|
|
137
|
-
| `position` | `WidgetPosition` | `'bottom-right'` | Widget position on screen |
|
|
138
|
-
| `width` | `string` | `'350'` | Widget width in pixels |
|
|
139
|
-
| `height` | `string` | `'500'` | Widget height in pixels |
|
|
140
|
-
| `showMinimizeButton` | `boolean` | `true` | Show minimize/maximize button |
|
|
141
|
-
| `showTimestamps` | `boolean` | `true` | Show message timestamps |
|
|
142
|
-
| `enableFileUpload` | `boolean` | `false` | Enable file upload feature |
|
|
143
|
-
| `enableSpeech` | `boolean` | `false` | Enable speech recognition |
|
|
144
|
-
| `showPoweredBy` | `boolean` | `true` | Show "Powered by" branding |
|
|
145
|
-
|
|
146
|
-
### WidgetPosition Type
|
|
147
|
-
|
|
148
|
-
```typescript
|
|
149
|
-
type WidgetPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Output Events
|
|
153
|
-
|
|
154
|
-
| Event | Type | Description |
|
|
155
|
-
|-------|------|-------------|
|
|
156
|
-
| `messageSent` | `{ message: string; timestamp: Date }` | Fired when user sends a message |
|
|
157
|
-
| `widgetOpened` | `void` | Fired when widget is opened |
|
|
158
|
-
| `widgetClosed` | `void` | Fired when widget is closed |
|
|
159
|
-
|
|
160
|
-
## Advanced Usage
|
|
161
|
-
|
|
162
|
-
### Dynamic Configuration
|
|
163
|
-
|
|
164
|
-
```typescript
|
|
165
|
-
export class AppComponent {
|
|
166
|
-
config = {
|
|
167
|
-
agentName: 'AI Assistant',
|
|
168
|
-
agentRole: 'Virtual Support',
|
|
169
|
-
primaryColor: '#007bff',
|
|
170
|
-
accentColor: '#28a745',
|
|
171
|
-
welcomeMessage: 'Hello! I\'m here to help.',
|
|
172
|
-
position: 'bottom-left' as WidgetPosition,
|
|
173
|
-
width: '400',
|
|
174
|
-
height: '600',
|
|
175
|
-
showMinimizeButton: true,
|
|
176
|
-
showTimestamps: true,
|
|
177
|
-
enableFileUpload: true,
|
|
178
|
-
enableSpeech: true,
|
|
179
|
-
showPoweredBy: false
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
updateConfig() {
|
|
183
|
-
// Update configuration dynamically
|
|
184
|
-
this.config.primaryColor = '#ff6b6b';
|
|
185
|
-
this.config.position = 'top-right';
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### Custom Styling
|
|
191
|
-
|
|
192
|
-
The widget uses CSS custom properties for theming. You can override these in your global styles:
|
|
193
|
-
|
|
194
|
-
```css
|
|
195
|
-
:root {
|
|
196
|
-
--primary-color: #your-color;
|
|
197
|
-
--accent-color: #your-accent;
|
|
198
|
-
--widget-width: 400px;
|
|
199
|
-
--widget-height: 600px;
|
|
200
|
-
--font-family: 'Your Font', sans-serif;
|
|
201
|
-
}
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
## Browser Support
|
|
205
|
-
|
|
206
|
-
- Chrome 60+
|
|
207
|
-
- Firefox 55+
|
|
208
|
-
- Safari 10+
|
|
209
|
-
- Edge 79+
|
|
210
|
-
|
|
211
|
-
## TypeScript Support
|
|
212
|
-
|
|
213
|
-
Full TypeScript definitions are included. Import types as needed:
|
|
214
|
-
|
|
215
|
-
```typescript
|
|
216
|
-
import { WidgetPosition } from 'nerdagent-chat-widget-angular';
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
## Troubleshooting
|
|
220
|
-
|
|
221
|
-
### Common Issues
|
|
222
|
-
|
|
223
|
-
1. **Widget not appearing**: Ensure the module is imported in your app module
|
|
224
|
-
2. **Styling issues**: Check that FontAwesome is loaded for icons
|
|
225
|
-
3. **Events not firing**: Verify event handlers are properly bound
|
|
226
|
-
|
|
227
|
-
### Debug Mode
|
|
228
|
-
|
|
229
|
-
Enable debug logging by setting the browser's localStorage:
|
|
230
|
-
|
|
231
|
-
```javascript
|
|
232
|
-
localStorage.setItem('nerdagent-chat-widget-debug', 'true');
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
## Contributing
|
|
236
|
-
|
|
237
|
-
We welcome contributions! Please see our [Contributing Guide](../../CONTRIBUTING.md) for details.
|
|
238
|
-
|
|
239
|
-
## License
|
|
240
|
-
|
|
241
|
-
MIT License - see [LICENSE](../../LICENSE) for details.
|
|
242
|
-
|
|
243
|
-
## Support
|
|
244
|
-
|
|
245
|
-
- 📧 Email: support@nerdagent.ai
|
|
246
|
-
- 📖 Documentation: [docs.nerdagent.ai](https://docs.nerdagent.ai)
|
|
247
|
-
- 🐛 Issues: [GitHub Issues](https://github.com/nerdagent/chat-widget/issues)
|
|
248
|
-
|
|
249
|
-
## Changelog
|
|
250
|
-
|
|
251
|
-
### v1.0.6
|
|
252
|
-
- Fixed infinite recursion issue in component template
|
|
253
|
-
- Improved AOT compilation support
|
|
254
|
-
- Enhanced TypeScript definitions
|
|
255
|
-
|
|
256
|
-
### v1.0.5
|
|
257
|
-
- Fixed package entry points for proper module resolution
|
|
258
|
-
- Improved build configuration
|
|
259
|
-
|
|
260
|
-
### v1.0.4
|
|
261
|
-
- Added proper AOT compilation support
|
|
262
|
-
- Fixed Angular Ivy compatibility
|
|
263
|
-
|
|
264
|
-
### v1.0.3
|
|
265
|
-
- Initial release with Angular wrapper
|
|
266
|
-
- Full TypeScript support
|
|
267
|
-
- Event handling integration
|
package/dist/esm2022/index.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { NerdChatWidgetModule } from './lib/chat-widget.module';
|
|
2
|
-
export { ChatWidgetComponent } from './lib/chat-widget.component';
|
|
3
|
-
export * from './lib/chat-widget.types';
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFDaEUsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDbEUsY0FBYyx5QkFBeUIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB7IE5lcmRDaGF0V2lkZ2V0TW9kdWxlIH0gZnJvbSAnLi9saWIvY2hhdC13aWRnZXQubW9kdWxlJztcbmV4cG9ydCB7IENoYXRXaWRnZXRDb21wb25lbnQgfSBmcm9tICcuL2xpYi9jaGF0LXdpZGdldC5jb21wb25lbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvY2hhdC13aWRnZXQudHlwZXMnO1xuIl19
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export class ChatWidgetComponent {
|
|
4
|
-
elementRef;
|
|
5
|
-
renderer;
|
|
6
|
-
constructor(elementRef, renderer) {
|
|
7
|
-
this.elementRef = elementRef;
|
|
8
|
-
this.renderer = renderer;
|
|
9
|
-
}
|
|
10
|
-
apikey = '';
|
|
11
|
-
agentId = '';
|
|
12
|
-
agentName = 'Support Agent';
|
|
13
|
-
agentRole = 'Customer Support';
|
|
14
|
-
primaryColor = '#2d3e50';
|
|
15
|
-
accentColor = '#4e8cff';
|
|
16
|
-
welcomeMessage = 'Hi! How can I help?';
|
|
17
|
-
placeholderText = 'Type your message...';
|
|
18
|
-
position = 'bottom-right';
|
|
19
|
-
width = '350';
|
|
20
|
-
height = '500';
|
|
21
|
-
showMinimizeButton = true;
|
|
22
|
-
showTimestamps = true;
|
|
23
|
-
enableFileUpload = false;
|
|
24
|
-
enableSpeech = false;
|
|
25
|
-
showPoweredBy = true;
|
|
26
|
-
messageSent = new EventEmitter();
|
|
27
|
-
widgetOpened = new EventEmitter();
|
|
28
|
-
widgetClosed = new EventEmitter();
|
|
29
|
-
ngAfterViewInit() {
|
|
30
|
-
// Set properties directly on the web component element
|
|
31
|
-
const element = this.elementRef.nativeElement;
|
|
32
|
-
// Set properties (not attributes) for the web component
|
|
33
|
-
element.apikey = this.apikey || '';
|
|
34
|
-
element.agentId = this.agentId || '';
|
|
35
|
-
element.agentName = this.agentName || '';
|
|
36
|
-
element.agentRole = this.agentRole || '';
|
|
37
|
-
element.primaryColor = this.primaryColor || '';
|
|
38
|
-
element.accentColor = this.accentColor || '';
|
|
39
|
-
element.welcomeMessage = this.welcomeMessage || '';
|
|
40
|
-
element.placeholderText = this.placeholderText || '';
|
|
41
|
-
element.position = this.position || '';
|
|
42
|
-
element.width = this.width || '';
|
|
43
|
-
element.height = this.height || '';
|
|
44
|
-
element.showMinimizeButton = this.showMinimizeButton;
|
|
45
|
-
element.showTimestamps = this.showTimestamps;
|
|
46
|
-
element.enableFileUpload = this.enableFileUpload;
|
|
47
|
-
element.enableSpeech = this.enableSpeech;
|
|
48
|
-
element.showPoweredBy = this.showPoweredBy;
|
|
49
|
-
console.log('[Angular Wrapper] Set properties on web component:', {
|
|
50
|
-
apikey: element.apikey,
|
|
51
|
-
agentId: element.agentId
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ChatWidgetComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
55
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ChatWidgetComponent, selector: "nerd-chat-widget", inputs: { apikey: "apikey", agentId: "agentId", agentName: "agentName", agentRole: "agentRole", primaryColor: "primaryColor", accentColor: "accentColor", welcomeMessage: "welcomeMessage", placeholderText: "placeholderText", position: "position", width: "width", height: "height", showMinimizeButton: "showMinimizeButton", showTimestamps: "showTimestamps", enableFileUpload: "enableFileUpload", enableSpeech: "enableSpeech", showPoweredBy: "showPoweredBy" }, outputs: { messageSent: "messageSent", widgetOpened: "widgetOpened", widgetClosed: "widgetClosed" }, ngImport: i0, template: '', isInline: true });
|
|
56
|
-
}
|
|
57
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ChatWidgetComponent, decorators: [{
|
|
58
|
-
type: Component,
|
|
59
|
-
args: [{ selector: 'nerd-chat-widget', template: '' }]
|
|
60
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { apikey: [{
|
|
61
|
-
type: Input
|
|
62
|
-
}], agentId: [{
|
|
63
|
-
type: Input
|
|
64
|
-
}], agentName: [{
|
|
65
|
-
type: Input
|
|
66
|
-
}], agentRole: [{
|
|
67
|
-
type: Input
|
|
68
|
-
}], primaryColor: [{
|
|
69
|
-
type: Input
|
|
70
|
-
}], accentColor: [{
|
|
71
|
-
type: Input
|
|
72
|
-
}], welcomeMessage: [{
|
|
73
|
-
type: Input
|
|
74
|
-
}], placeholderText: [{
|
|
75
|
-
type: Input
|
|
76
|
-
}], position: [{
|
|
77
|
-
type: Input
|
|
78
|
-
}], width: [{
|
|
79
|
-
type: Input
|
|
80
|
-
}], height: [{
|
|
81
|
-
type: Input
|
|
82
|
-
}], showMinimizeButton: [{
|
|
83
|
-
type: Input
|
|
84
|
-
}], showTimestamps: [{
|
|
85
|
-
type: Input
|
|
86
|
-
}], enableFileUpload: [{
|
|
87
|
-
type: Input
|
|
88
|
-
}], enableSpeech: [{
|
|
89
|
-
type: Input
|
|
90
|
-
}], showPoweredBy: [{
|
|
91
|
-
type: Input
|
|
92
|
-
}], messageSent: [{
|
|
93
|
-
type: Output
|
|
94
|
-
}], widgetOpened: [{
|
|
95
|
-
type: Output
|
|
96
|
-
}], widgetClosed: [{
|
|
97
|
-
type: Output
|
|
98
|
-
}] } });
|
|
99
|
-
//# sourceMappingURL=data:application/json;base64,e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nQuc2hvd1Bvd2VyZWRCeSA9IHRoaXMuc2hvd1Bvd2VyZWRCeTtcbiAgICBcbiAgICBjb25zb2xlLmxvZygnW0FuZ3VsYXIgV3JhcHBlcl0gU2V0IHByb3BlcnRpZXMgb24gd2ViIGNvbXBvbmVudDonLCB7XG4gICAgICBhcGlrZXk6IGVsZW1lbnQuYXBpa2V5LFxuICAgICAgYWdlbnRJZDogZWxlbWVudC5hZ2VudElkXG4gICAgfSk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { ChatWidgetComponent } from './chat-widget.component';
|
|
4
|
-
// Import and define custom elements
|
|
5
|
-
import { defineCustomElements } from 'nerdagent-chat-widget/loader';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
// Define custom elements when module is imported
|
|
8
|
-
defineCustomElements();
|
|
9
|
-
export class NerdChatWidgetModule {
|
|
10
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NerdChatWidgetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
11
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: NerdChatWidgetModule, declarations: [ChatWidgetComponent], imports: [CommonModule], exports: [ChatWidgetComponent] });
|
|
12
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NerdChatWidgetModule, imports: [CommonModule] });
|
|
13
|
-
}
|
|
14
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NerdChatWidgetModule, decorators: [{
|
|
15
|
-
type: NgModule,
|
|
16
|
-
args: [{
|
|
17
|
-
declarations: [
|
|
18
|
-
ChatWidgetComponent
|
|
19
|
-
],
|
|
20
|
-
imports: [
|
|
21
|
-
CommonModule
|
|
22
|
-
],
|
|
23
|
-
exports: [
|
|
24
|
-
ChatWidgetComponent
|
|
25
|
-
],
|
|
26
|
-
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
|
27
|
-
}]
|
|
28
|
-
}] });
|
|
29
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hhdC13aWRnZXQubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi9jaGF0LXdpZGdldC5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxzQkFBc0IsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNqRSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDL0MsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFFOUQsb0NBQW9DO0FBQ3BDLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLDhCQUE4QixDQUFDOztBQUVwRSxpREFBaUQ7QUFDakQsb0JBQW9CLEVBQUUsQ0FBQztBQWN2QixNQUFNLE9BQU8sb0JBQW9CO3dHQUFwQixvQkFBb0I7eUdBQXBCLG9CQUFvQixpQkFWN0IsbUJBQW1CLGFBR25CLFlBQVksYUFHWixtQkFBbUI7eUdBSVYsb0JBQW9CLFlBUDdCLFlBQVk7OzRGQU9ILG9CQUFvQjtrQkFaaEMsUUFBUTttQkFBQztvQkFDUixZQUFZLEVBQUU7d0JBQ1osbUJBQW1CO3FCQUNwQjtvQkFDRCxPQUFPLEVBQUU7d0JBQ1AsWUFBWTtxQkFDYjtvQkFDRCxPQUFPLEVBQUU7d0JBQ1AsbUJBQW1CO3FCQUNwQjtvQkFDRCxPQUFPLEVBQUUsQ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@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './index';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmVyZGFnZW50LWNoYXQtd2lkZ2V0LWFuZ3VsYXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbmVyZGFnZW50LWNoYXQtd2lkZ2V0LWFuZ3VsYXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG4iXX0=
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Output, Input, Component, CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
|
|
3
|
-
import { CommonModule } from '@angular/common';
|
|
4
|
-
import { defineCustomElements } from 'nerdagent-chat-widget/loader';
|
|
5
|
-
|
|
6
|
-
class ChatWidgetComponent {
|
|
7
|
-
elementRef;
|
|
8
|
-
renderer;
|
|
9
|
-
constructor(elementRef, renderer) {
|
|
10
|
-
this.elementRef = elementRef;
|
|
11
|
-
this.renderer = renderer;
|
|
12
|
-
}
|
|
13
|
-
apikey = '';
|
|
14
|
-
agentId = '';
|
|
15
|
-
agentName = 'Support Agent';
|
|
16
|
-
agentRole = 'Customer Support';
|
|
17
|
-
primaryColor = '#2d3e50';
|
|
18
|
-
accentColor = '#4e8cff';
|
|
19
|
-
welcomeMessage = 'Hi! How can I help?';
|
|
20
|
-
placeholderText = 'Type your message...';
|
|
21
|
-
position = 'bottom-right';
|
|
22
|
-
width = '350';
|
|
23
|
-
height = '500';
|
|
24
|
-
showMinimizeButton = true;
|
|
25
|
-
showTimestamps = true;
|
|
26
|
-
enableFileUpload = false;
|
|
27
|
-
enableSpeech = false;
|
|
28
|
-
showPoweredBy = true;
|
|
29
|
-
messageSent = new EventEmitter();
|
|
30
|
-
widgetOpened = new EventEmitter();
|
|
31
|
-
widgetClosed = new EventEmitter();
|
|
32
|
-
ngAfterViewInit() {
|
|
33
|
-
// Set properties directly on the web component element
|
|
34
|
-
const element = this.elementRef.nativeElement;
|
|
35
|
-
// Set properties (not attributes) for the web component
|
|
36
|
-
element.apikey = this.apikey || '';
|
|
37
|
-
element.agentId = this.agentId || '';
|
|
38
|
-
element.agentName = this.agentName || '';
|
|
39
|
-
element.agentRole = this.agentRole || '';
|
|
40
|
-
element.primaryColor = this.primaryColor || '';
|
|
41
|
-
element.accentColor = this.accentColor || '';
|
|
42
|
-
element.welcomeMessage = this.welcomeMessage || '';
|
|
43
|
-
element.placeholderText = this.placeholderText || '';
|
|
44
|
-
element.position = this.position || '';
|
|
45
|
-
element.width = this.width || '';
|
|
46
|
-
element.height = this.height || '';
|
|
47
|
-
element.showMinimizeButton = this.showMinimizeButton;
|
|
48
|
-
element.showTimestamps = this.showTimestamps;
|
|
49
|
-
element.enableFileUpload = this.enableFileUpload;
|
|
50
|
-
element.enableSpeech = this.enableSpeech;
|
|
51
|
-
element.showPoweredBy = this.showPoweredBy;
|
|
52
|
-
console.log('[Angular Wrapper] Set properties on web component:', {
|
|
53
|
-
apikey: element.apikey,
|
|
54
|
-
agentId: element.agentId
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ChatWidgetComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
58
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ChatWidgetComponent, selector: "nerd-chat-widget", inputs: { apikey: "apikey", agentId: "agentId", agentName: "agentName", agentRole: "agentRole", primaryColor: "primaryColor", accentColor: "accentColor", welcomeMessage: "welcomeMessage", placeholderText: "placeholderText", position: "position", width: "width", height: "height", showMinimizeButton: "showMinimizeButton", showTimestamps: "showTimestamps", enableFileUpload: "enableFileUpload", enableSpeech: "enableSpeech", showPoweredBy: "showPoweredBy" }, outputs: { messageSent: "messageSent", widgetOpened: "widgetOpened", widgetClosed: "widgetClosed" }, ngImport: i0, template: '', isInline: true });
|
|
59
|
-
}
|
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ChatWidgetComponent, decorators: [{
|
|
61
|
-
type: Component,
|
|
62
|
-
args: [{ selector: 'nerd-chat-widget', template: '' }]
|
|
63
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { apikey: [{
|
|
64
|
-
type: Input
|
|
65
|
-
}], agentId: [{
|
|
66
|
-
type: Input
|
|
67
|
-
}], agentName: [{
|
|
68
|
-
type: Input
|
|
69
|
-
}], agentRole: [{
|
|
70
|
-
type: Input
|
|
71
|
-
}], primaryColor: [{
|
|
72
|
-
type: Input
|
|
73
|
-
}], accentColor: [{
|
|
74
|
-
type: Input
|
|
75
|
-
}], welcomeMessage: [{
|
|
76
|
-
type: Input
|
|
77
|
-
}], placeholderText: [{
|
|
78
|
-
type: Input
|
|
79
|
-
}], position: [{
|
|
80
|
-
type: Input
|
|
81
|
-
}], width: [{
|
|
82
|
-
type: Input
|
|
83
|
-
}], height: [{
|
|
84
|
-
type: Input
|
|
85
|
-
}], showMinimizeButton: [{
|
|
86
|
-
type: Input
|
|
87
|
-
}], showTimestamps: [{
|
|
88
|
-
type: Input
|
|
89
|
-
}], enableFileUpload: [{
|
|
90
|
-
type: Input
|
|
91
|
-
}], enableSpeech: [{
|
|
92
|
-
type: Input
|
|
93
|
-
}], showPoweredBy: [{
|
|
94
|
-
type: Input
|
|
95
|
-
}], messageSent: [{
|
|
96
|
-
type: Output
|
|
97
|
-
}], widgetOpened: [{
|
|
98
|
-
type: Output
|
|
99
|
-
}], widgetClosed: [{
|
|
100
|
-
type: Output
|
|
101
|
-
}] } });
|
|
102
|
-
|
|
103
|
-
// Define custom elements when module is imported
|
|
104
|
-
defineCustomElements();
|
|
105
|
-
class NerdChatWidgetModule {
|
|
106
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NerdChatWidgetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
107
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: NerdChatWidgetModule, declarations: [ChatWidgetComponent], imports: [CommonModule], exports: [ChatWidgetComponent] });
|
|
108
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NerdChatWidgetModule, imports: [CommonModule] });
|
|
109
|
-
}
|
|
110
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NerdChatWidgetModule, decorators: [{
|
|
111
|
-
type: NgModule,
|
|
112
|
-
args: [{
|
|
113
|
-
declarations: [
|
|
114
|
-
ChatWidgetComponent
|
|
115
|
-
],
|
|
116
|
-
imports: [
|
|
117
|
-
CommonModule
|
|
118
|
-
],
|
|
119
|
-
exports: [
|
|
120
|
-
ChatWidgetComponent
|
|
121
|
-
],
|
|
122
|
-
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
|
123
|
-
}]
|
|
124
|
-
}] });
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Generated bundle index. Do not edit.
|
|
128
|
-
*/
|
|
129
|
-
|
|
130
|
-
export { ChatWidgetComponent, NerdChatWidgetModule };
|
|
131
|
-
//# sourceMappingURL=nerdagent-chat-widget-angular.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nerdagent-chat-widget-angular.mjs","sources":["../../src/lib/chat-widget.component.ts","../../src/lib/chat-widget.module.ts","../../src/nerdagent-chat-widget-angular.ts"],"sourcesContent":["import { Component, Input, Output, EventEmitter, ElementRef, AfterViewInit, Renderer2 } from '@angular/core';\nimport { WidgetPosition } from './chat-widget.types';\n\n@Component({\n selector: 'nerd-chat-widget',\n template: '',\n styles: []\n})\nexport class ChatWidgetComponent implements AfterViewInit {\n constructor(\n private elementRef: ElementRef,\n private renderer: Renderer2\n ) {}\n @Input() apikey: string = '';\n @Input() agentId: string = '';\n @Input() agentName: string = 'Support Agent';\n @Input() agentRole: string = 'Customer Support';\n @Input() primaryColor: string = '#2d3e50';\n @Input() accentColor: string = '#4e8cff';\n @Input() welcomeMessage: string = 'Hi! How can I help?';\n @Input() placeholderText: string = 'Type your message...';\n @Input() position: WidgetPosition = 'bottom-right';\n @Input() width: string = '350';\n @Input() height: string = '500';\n @Input() showMinimizeButton: boolean = true;\n @Input() showTimestamps: boolean = true;\n @Input() enableFileUpload: boolean = false;\n @Input() enableSpeech: boolean = false;\n @Input() showPoweredBy: boolean = true;\n\n @Output() messageSent = new EventEmitter<{ message: string; timestamp: Date }>();\n @Output() widgetOpened = new EventEmitter<void>();\n @Output() widgetClosed = new EventEmitter<void>();\n\n ngAfterViewInit() {\n // Set properties directly on the web component element\n const element = this.elementRef.nativeElement as any;\n \n // Set properties (not attributes) for the web component\n element.apikey = this.apikey || '';\n element.agentId = this.agentId || '';\n element.agentName = this.agentName || '';\n element.agentRole = this.agentRole || '';\n element.primaryColor = this.primaryColor || '';\n element.accentColor = this.accentColor || '';\n element.welcomeMessage = this.welcomeMessage || '';\n element.placeholderText = this.placeholderText || '';\n element.position = this.position || '';\n element.width = this.width || '';\n element.height = this.height || '';\n element.showMinimizeButton = this.showMinimizeButton;\n element.showTimestamps = this.showTimestamps;\n element.enableFileUpload = this.enableFileUpload;\n element.enableSpeech = this.enableSpeech;\n element.showPoweredBy = this.showPoweredBy;\n \n console.log('[Angular Wrapper] Set properties on web component:', {\n apikey: element.apikey,\n agentId: element.agentId\n });\n }\n}\n","import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ChatWidgetComponent } from './chat-widget.component';\n\n// Import and define custom elements\nimport { defineCustomElements } from 'nerdagent-chat-widget/loader';\n\n// Define custom elements when module is imported\ndefineCustomElements();\n\n@NgModule({\n declarations: [\n ChatWidgetComponent\n ],\n imports: [\n CommonModule\n ],\n exports: [\n ChatWidgetComponent\n ],\n schemas: [CUSTOM_ELEMENTS_SCHEMA]\n})\nexport class NerdChatWidgetModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAQa,mBAAmB,CAAA;AAEpB,IAAA,UAAA;AACA,IAAA,QAAA;IAFV,WAAA,CACU,UAAsB,EACtB,QAAmB,EAAA;QADnB,IAAA,CAAA,UAAU,GAAV,UAAU;QACV,IAAA,CAAA,QAAQ,GAAR,QAAQ;IACf;IACM,MAAM,GAAW,EAAE;IACnB,OAAO,GAAW,EAAE;IACpB,SAAS,GAAW,eAAe;IACnC,SAAS,GAAW,kBAAkB;IACtC,YAAY,GAAW,SAAS;IAChC,WAAW,GAAW,SAAS;IAC/B,cAAc,GAAW,qBAAqB;IAC9C,eAAe,GAAW,sBAAsB;IAChD,QAAQ,GAAmB,cAAc;IACzC,KAAK,GAAW,KAAK;IACrB,MAAM,GAAW,KAAK;IACtB,kBAAkB,GAAY,IAAI;IAClC,cAAc,GAAY,IAAI;IAC9B,gBAAgB,GAAY,KAAK;IACjC,YAAY,GAAY,KAAK;IAC7B,aAAa,GAAY,IAAI;AAE5B,IAAA,WAAW,GAAG,IAAI,YAAY,EAAwC;AACtE,IAAA,YAAY,GAAG,IAAI,YAAY,EAAQ;AACvC,IAAA,YAAY,GAAG,IAAI,YAAY,EAAQ;IAEjD,eAAe,GAAA;;AA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AA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,EAAA,YAAA,EAAA,CAV7B,mBAAmB,CAAA,EAAA,OAAA,EAAA,CAGnB,YAAY,aAGZ,mBAAmB,CAAA,EAAA,CAAA;AAIV,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAP7B,YAAY,CAAA,EAAA,CAAA;;4FAOH,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAZhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP;AACD,qBAAA;oBACD,OAAO,EAAE,CAAC,sBAAsB;AACjC,iBAAA;;;ACrBD;;AAEG;;;;"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { EventEmitter, ElementRef, AfterViewInit, Renderer2 } from '@angular/core';
|
|
2
|
-
import { WidgetPosition } from './chat-widget.types';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ChatWidgetComponent implements AfterViewInit {
|
|
5
|
-
private elementRef;
|
|
6
|
-
private renderer;
|
|
7
|
-
constructor(elementRef: ElementRef, renderer: Renderer2);
|
|
8
|
-
apikey: string;
|
|
9
|
-
agentId: string;
|
|
10
|
-
agentName: string;
|
|
11
|
-
agentRole: string;
|
|
12
|
-
primaryColor: string;
|
|
13
|
-
accentColor: string;
|
|
14
|
-
welcomeMessage: string;
|
|
15
|
-
placeholderText: string;
|
|
16
|
-
position: WidgetPosition;
|
|
17
|
-
width: string;
|
|
18
|
-
height: string;
|
|
19
|
-
showMinimizeButton: boolean;
|
|
20
|
-
showTimestamps: boolean;
|
|
21
|
-
enableFileUpload: boolean;
|
|
22
|
-
enableSpeech: boolean;
|
|
23
|
-
showPoweredBy: boolean;
|
|
24
|
-
messageSent: EventEmitter<{
|
|
25
|
-
message: string;
|
|
26
|
-
timestamp: Date;
|
|
27
|
-
}>;
|
|
28
|
-
widgetOpened: EventEmitter<void>;
|
|
29
|
-
widgetClosed: EventEmitter<void>;
|
|
30
|
-
ngAfterViewInit(): void;
|
|
31
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ChatWidgetComponent, never>;
|
|
32
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ChatWidgetComponent, "nerd-chat-widget", never, { "apikey": { "alias": "apikey"; "required": false; }; "agentId": { "alias": "agentId"; "required": false; }; "agentName": { "alias": "agentName"; "required": false; }; "agentRole": { "alias": "agentRole"; "required": false; }; "primaryColor": { "alias": "primaryColor"; "required": false; }; "accentColor": { "alias": "accentColor"; "required": false; }; "welcomeMessage": { "alias": "welcomeMessage"; "required": false; }; "placeholderText": { "alias": "placeholderText"; "required": false; }; "position": { "alias": "position"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "showMinimizeButton": { "alias": "showMinimizeButton"; "required": false; }; "showTimestamps": { "alias": "showTimestamps"; "required": false; }; "enableFileUpload": { "alias": "enableFileUpload"; "required": false; }; "enableSpeech": { "alias": "enableSpeech"; "required": false; }; "showPoweredBy": { "alias": "showPoweredBy"; "required": false; }; }, { "messageSent": "messageSent"; "widgetOpened": "widgetOpened"; "widgetClosed": "widgetClosed"; }, never, never, false, never>;
|
|
33
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./chat-widget.component";
|
|
3
|
-
import * as i2 from "@angular/common";
|
|
4
|
-
export declare class NerdChatWidgetModule {
|
|
5
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NerdChatWidgetModule, never>;
|
|
6
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NerdChatWidgetModule, [typeof i1.ChatWidgetComponent], [typeof i2.CommonModule], [typeof i1.ChatWidgetComponent]>;
|
|
7
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<NerdChatWidgetModule>;
|
|
8
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export type WidgetPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
2
|
-
export interface ChatWidgetConfig {
|
|
3
|
-
apikey?: string;
|
|
4
|
-
agentId?: string;
|
|
5
|
-
agentName?: string;
|
|
6
|
-
agentRole?: string;
|
|
7
|
-
primaryColor?: string;
|
|
8
|
-
accentColor?: string;
|
|
9
|
-
welcomeMessage?: string;
|
|
10
|
-
placeholderText?: string;
|
|
11
|
-
position?: WidgetPosition;
|
|
12
|
-
width?: string;
|
|
13
|
-
height?: string;
|
|
14
|
-
showMinimizeButton?: boolean;
|
|
15
|
-
showTimestamps?: boolean;
|
|
16
|
-
enableFileUpload?: boolean;
|
|
17
|
-
enableSpeech?: boolean;
|
|
18
|
-
showPoweredBy?: boolean;
|
|
19
|
-
}
|
|
20
|
-
export interface ChatWidgetEvents {
|
|
21
|
-
messageSent: CustomEvent<{
|
|
22
|
-
message: string;
|
|
23
|
-
timestamp: Date;
|
|
24
|
-
}>;
|
|
25
|
-
widgetOpened: CustomEvent<void>;
|
|
26
|
-
widgetClosed: CustomEvent<void>;
|
|
27
|
-
}
|