nerdagent-chat-widget-angular 1.0.26 → 1.0.27
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/dist/README.md +115 -0
- package/dist/esm2022/index.mjs +4 -0
- package/dist/esm2022/lib/chat-widget.component.mjs +99 -0
- package/dist/esm2022/lib/chat-widget.module.mjs +29 -0
- package/dist/esm2022/lib/chat-widget.types.mjs +2 -0
- package/dist/esm2022/nerdagent-chat-widget-angular.mjs +5 -0
- package/dist/fesm2022/nerdagent-chat-widget-angular.mjs +131 -0
- package/dist/fesm2022/nerdagent-chat-widget-angular.mjs.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/lib/chat-widget.component.d.ts +33 -0
- package/dist/lib/chat-widget.module.d.ts +8 -0
- package/dist/lib/chat-widget.types.d.ts +27 -0
- package/package.json +16 -19
package/dist/README.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# NerdAgent Chat Widget for Angular
|
|
2
|
+
|
|
3
|
+
A customizable chat widget component for Angular applications.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install nerdagent-chat-widget-angular
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### 1. Import the Module
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { NgModule } from '@angular/core';
|
|
17
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
18
|
+
import { NerdChatWidgetModule } from 'nerdagent-chat-widget-angular';
|
|
19
|
+
|
|
20
|
+
@NgModule({
|
|
21
|
+
imports: [
|
|
22
|
+
BrowserModule,
|
|
23
|
+
NerdChatWidgetModule
|
|
24
|
+
],
|
|
25
|
+
})
|
|
26
|
+
export class AppModule { }
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 2. Use the Component
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<nerd-chat-widget
|
|
33
|
+
[apikey]="'your-api-key'"
|
|
34
|
+
[agent-id]="'your-agent-id'"
|
|
35
|
+
[agent-name]="'Support Agent'"
|
|
36
|
+
[agent-role]="'Customer Support'"
|
|
37
|
+
[primary-color]="'#2d3e50'"
|
|
38
|
+
[accent-color]="'#4e8cff'"
|
|
39
|
+
[welcome-message]="'Hi! How can I help you today?'"
|
|
40
|
+
[placeholder-text]="'Type your message...'"
|
|
41
|
+
[position]="'bottom-right'"
|
|
42
|
+
[width]="'350'"
|
|
43
|
+
[height]="'500'"
|
|
44
|
+
[show-minimize-button]="true"
|
|
45
|
+
[show-timestamps]="true"
|
|
46
|
+
[enable-file-upload]="false"
|
|
47
|
+
[enable-speech]="false"
|
|
48
|
+
[show-powered-by]="true"
|
|
49
|
+
(messageSent)="onMessageSent($event)"
|
|
50
|
+
(widgetOpened)="onWidgetOpened()"
|
|
51
|
+
(widgetClosed)="onWidgetClosed()">
|
|
52
|
+
</nerd-chat-widget>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 3. Handle Events
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { Component } from '@angular/core';
|
|
59
|
+
|
|
60
|
+
@Component({
|
|
61
|
+
selector: 'app-root',
|
|
62
|
+
templateUrl: './app.component.html'
|
|
63
|
+
})
|
|
64
|
+
export class AppComponent {
|
|
65
|
+
onMessageSent(event: { message: string; timestamp: Date }) {
|
|
66
|
+
console.log('Message sent:', event);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
onWidgetOpened() {
|
|
70
|
+
console.log('Widget opened');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
onWidgetClosed() {
|
|
74
|
+
console.log('Widget closed');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Properties
|
|
80
|
+
|
|
81
|
+
| Property | Type | Default | Description |
|
|
82
|
+
|----------|------|---------|-------------|
|
|
83
|
+
| `apikey` | `string` | - | API key for authentication |
|
|
84
|
+
| `agent-id` | `string` | - | Agent ID to connect to |
|
|
85
|
+
| `token` | `string` | - | JWT token for authentication |
|
|
86
|
+
| `agentName` | `string` | `'Support Agent'` | Name of the support agent |
|
|
87
|
+
| `agentRole` | `string` | `'Customer Support'` | Role/title of the agent |
|
|
88
|
+
| `primaryColor` | `string` | `'#2d3e50'` | Primary color theme |
|
|
89
|
+
| `accentColor` | `string` | `'#4e8cff'` | Accent color theme |
|
|
90
|
+
| `welcomeMessage` | `string` | `'Hi! How can I help?'` | Initial welcome message |
|
|
91
|
+
| `placeholderText` | `string` | `'Type your message...'` | Input placeholder text |
|
|
92
|
+
| `position` | `'bottom-right' \| 'bottom-left' \| 'top-right' \| 'top-left'` | `'bottom-right'` | Widget position on screen |
|
|
93
|
+
| `width` | `string` | `'350'` | Widget width in pixels |
|
|
94
|
+
| `height` | `string` | `'500'` | Widget height in pixels |
|
|
95
|
+
| `showMinimizeButton` | `boolean` | `true` | Show minimize/maximize button |
|
|
96
|
+
| `showTimestamps` | `boolean` | `true` | Show message timestamps |
|
|
97
|
+
| `enableFileUpload` | `boolean` | `false` | Enable file upload feature |
|
|
98
|
+
| `enableSpeech` | `boolean` | `false` | Enable speech recognition |
|
|
99
|
+
| `showPoweredBy` | `boolean` | `true` | Show "Powered by" branding |
|
|
100
|
+
|
|
101
|
+
## Events
|
|
102
|
+
|
|
103
|
+
| Event | Type | Description |
|
|
104
|
+
|-------|------|-------------|
|
|
105
|
+
| `messageSent` | `{ message: string; timestamp: Date }` | Fired when user sends a message |
|
|
106
|
+
| `widgetOpened` | `void` | Fired when widget is opened |
|
|
107
|
+
| `widgetClosed` | `void` | Fired when widget is closed |
|
|
108
|
+
|
|
109
|
+
## TypeScript Support
|
|
110
|
+
|
|
111
|
+
Full TypeScript definitions are included.
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
MIT
|
|
@@ -0,0 +1,4 @@
|
|
|
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
|
|
@@ -0,0 +1,99 @@
|
|
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hhdC13aWRnZXQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi9jaGF0LXdpZGdldC5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBd0MsTUFBTSxlQUFlLENBQUM7O0FBUTdHLE1BQU0sT0FBTyxtQkFBbUI7SUFFcEI7SUFDQTtJQUZWLFlBQ1UsVUFBc0IsRUFDdEIsUUFBbUI7UUFEbkIsZUFBVSxHQUFWLFVBQVUsQ0FBWTtRQUN0QixhQUFRLEdBQVIsUUFBUSxDQUFXO0lBQzFCLENBQUM7SUFDSyxNQUFNLEdBQVcsRUFBRSxDQUFDO0lBQ3BCLE9BQU8sR0FBVyxFQUFFLENBQUM7SUFDckIsU0FBUyxHQUFXLGVBQWUsQ0FBQztJQUNwQyxTQUFTLEdBQVcsa0JBQWtCLENBQUM7SUFDdkMsWUFBWSxHQUFXLFNBQVMsQ0FBQztJQUNqQyxXQUFXLEdBQVcsU0FBUyxDQUFDO0lBQ2hDLGNBQWMsR0FBVyxxQkFBcUIsQ0FBQztJQUMvQyxlQUFlLEdBQVcsc0JBQXNCLENBQUM7SUFDakQsUUFBUSxHQUFtQixjQUFjLENBQUM7SUFDMUMsS0FBSyxHQUFXLEtBQUssQ0FBQztJQUN0QixNQUFNLEdBQ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V0dG9uO1xuICAgIGVsZW1lbnQuc2hvd1RpbWVzdGFtcHMgPSB0aGlzLnNob3dUaW1lc3RhbXBzO1xuICAgIGVsZW1lbnQuZW5hYmxlRmlsZVVwbG9hZCA9IHRoaXMuZW5hYmxlRmlsZVVwbG9hZDtcbiAgICBlbGVtZW50LmVuYWJsZVNwZWVjaCA9IHRoaXMuZW5hYmxlU3BlZWNoO1xuICAgIGVsZW1lbnQuc2hvd1Bvd2VyZWRCeSA9IHRoaXMuc2hvd1Bvd2VyZWRCeTtcbiAgICBcbiAgICBjb25zb2xlLmxvZygnW0FuZ3VsYXIgV3JhcHBlcl0gU2V0IHByb3BlcnRpZXMgb24gd2ViIGNvbXBvbmVudDonLCB7XG4gICAgICBhcGlrZXk6IGVsZW1lbnQuYXBpa2V5LFxuICAgICAgYWdlbnRJZDogZWxlbWVudC5hZ2VudElkXG4gICAgfSk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -0,0 +1,29 @@
|
|
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hhdC13aWRnZXQubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi9jaGF0LXdpZGdldC5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxzQkFBc0IsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNqRSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDL0MsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFFOUQsb0NBQW9DO0FBQ3BDLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLDhCQUE4QixDQUFDOztBQUVwRSxpREFBaUQ7QUFDakQsb0JBQW9CLEVBQUUsQ0FBQztBQWN2QixNQUFNLE9BQU8sb0JBQW9CO3dHQUFwQixvQkFBb0I7eUdBQXBCLG9CQUFvQixpQkFWN0IsbUJBQW1CLGFBR25CLFlBQVksYUFHWixtQkFBbUI7eUdBSVYsb0JBQW9C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2ZW50cyB7XG4gIG1lc3NhZ2VTZW50OiBDdXN0b21FdmVudDx7IG1lc3NhZ2U6IHN0cmluZzsgdGltZXN0YW1wOiBEYXRlIH0+O1xuICB3aWRnZXRPcGVuZWQ6IEN1c3RvbUV2ZW50PHZvaWQ+O1xuICB3aWRnZXRDbG9zZWQ6IEN1c3RvbUV2ZW50PHZvaWQ+O1xufVxuIl19
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './index';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmVyZGFnZW50LWNoYXQtd2lkZ2V0LWFuZ3VsYXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbmVyZGFnZW50LWNoYXQtd2lkZ2V0LWFuZ3VsYXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG4iXX0=
|
|
@@ -0,0 +1,131 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,G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ES,WAAW,EAAA,CAAA;sBAApB;gBACS,YAAY,EAAA,CAAA;sBAArB;gBACS,YAAY,EAAA,CAAA;sBAArB;;;ACzBH;AACA,oBAAoB,EAAE;MAcT,oBAAoB,CAAA;wGAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAApB,IAAA,OAAA,IAAA,GAAA,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
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nerdagent-chat-widget-angular",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"description": "NerdAgent Chat Widget for Angular",
|
|
5
5
|
"main": "dist/fesm2022/nerdagent-chat-widget-angular.mjs",
|
|
6
|
-
"module": "fesm2022/nerdagent-chat-widget-angular.mjs",
|
|
6
|
+
"module": "dist/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
|
+
},
|
|
11
15
|
"keywords": [
|
|
12
16
|
"angular",
|
|
13
17
|
"chat",
|
|
@@ -22,26 +26,19 @@
|
|
|
22
26
|
"@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
|
|
23
27
|
},
|
|
24
28
|
"dependencies": {
|
|
25
|
-
"nerdagent-chat-widget": "^1.0.5"
|
|
26
|
-
|
|
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"
|
|
27
37
|
},
|
|
28
38
|
"repository": {
|
|
29
39
|
"type": "git",
|
|
30
40
|
"url": "https://github.com/nerdagent/chat-widget.git",
|
|
31
41
|
"directory": "packages/angular"
|
|
32
42
|
},
|
|
33
|
-
"gitHead": "
|
|
34
|
-
|
|
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
|
-
}
|
|
43
|
+
"gitHead": "a56e9c37c719d12188589585aac8515aa14c6315"
|
|
44
|
+
}
|