nerdagent-chat-widget 1.0.0
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 +257 -0
- package/dist/angular/index.d.ts +38 -0
- package/dist/angular/index.js +5 -0
- package/dist/angular/index.js.map +1 -0
- package/dist/angular/nerd-chat-widget.d.ts +11 -0
- package/dist/angular/nerd-chat-widget.js +289 -0
- package/dist/angular/nerd-chat-widget.js.map +1 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
- package/dist/cjs/index-CURqjGGU.js +1471 -0
- package/dist/cjs/index-CURqjGGU.js.map +1 -0
- package/dist/cjs/index.cjs.js +235 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +14 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/nerd-chat-widget.cjs.entry.js +9 -0
- package/dist/cjs/nerd-chat-widget.entry.cjs.js.map +1 -0
- package/dist/cjs/nerdagent-chat-widget.cjs.js +26 -0
- package/dist/cjs/nerdagent-chat-widget.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/chat-widget/chat-widget.js +808 -0
- package/dist/collection/components/chat-widget/chat-widget.js.map +1 -0
- package/dist/collection/components/chat-widget/chat-widget.scss +420 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/script.js +323 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +1514 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/nerd-chat-widget.d.ts +11 -0
- package/dist/components/nerd-chat-widget.js +9 -0
- package/dist/components/nerd-chat-widget.js.map +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +6 -0
- package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
- package/dist/esm/index-Dlv_7oUh.js +1444 -0
- package/dist/esm/index-Dlv_7oUh.js.map +1 -0
- package/dist/esm/index.js +233 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +12 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/nerd-chat-widget.entry.js +3 -0
- package/dist/esm/nerd-chat-widget.entry.js.map +1 -0
- package/dist/esm/nerdagent-chat-widget.js +22 -0
- package/dist/esm/nerdagent-chat-widget.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/nerdagent-chat-widget/index.esm.js +2 -0
- package/dist/nerdagent-chat-widget/index.esm.js.map +1 -0
- package/dist/nerdagent-chat-widget/loader.esm.js.map +1 -0
- package/dist/nerdagent-chat-widget/nerd-chat-widget.entry.esm.js.map +1 -0
- package/dist/nerdagent-chat-widget/nerdagent-chat-widget.esm.js +2 -0
- package/dist/nerdagent-chat-widget/nerdagent-chat-widget.esm.js.map +1 -0
- package/dist/nerdagent-chat-widget/p-395fe7e7.entry.js +2 -0
- package/dist/nerdagent-chat-widget/p-395fe7e7.entry.js.map +1 -0
- package/dist/nerdagent-chat-widget/p-DQuL1Twl.js +2 -0
- package/dist/nerdagent-chat-widget/p-DQuL1Twl.js.map +1 -0
- package/dist/nerdagent-chat-widget/p-Dlv_7oUh.js +3 -0
- package/dist/nerdagent-chat-widget/p-Dlv_7oUh.js.map +1 -0
- package/dist/react/index.d.ts +38 -0
- package/dist/react/index.js +5 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/nerd-chat-widget.d.ts +11 -0
- package/dist/react/nerd-chat-widget.js +289 -0
- package/dist/react/nerd-chat-widget.js.map +1 -0
- package/dist/types/components/chat-widget/chat-widget.d.ts +95 -0
- package/dist/types/components.d.ts +251 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +1730 -0
- package/dist/vue/index.d.ts +38 -0
- package/dist/vue/index.js +5 -0
- package/dist/vue/index.js.map +1 -0
- package/dist/vue/nerd-chat-widget.d.ts +11 -0
- package/dist/vue/nerd-chat-widget.js +289 -0
- package/dist/vue/nerd-chat-widget.js.map +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +76 -0
|
@@ -0,0 +1,808 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
export class ChatWidget {
|
|
3
|
+
constructor() {
|
|
4
|
+
// Configuration props
|
|
5
|
+
this.config = {};
|
|
6
|
+
this.agentName = 'Support Agent';
|
|
7
|
+
this.agentRole = 'Customer Support';
|
|
8
|
+
this.agentAvatar = 'https://ui-avatars.com/api/?name=Agent&background=2d3e50&color=ffffff&size=44';
|
|
9
|
+
this.primaryColor = '#2d3e50';
|
|
10
|
+
this.accentColor = '#4e8cff';
|
|
11
|
+
this.welcomeMessage = 'Hi! How can I help you today?';
|
|
12
|
+
this.position = 'bottom-right';
|
|
13
|
+
this.showMinimizeButton = true;
|
|
14
|
+
this.enableFileUpload = false;
|
|
15
|
+
this.enableSpeech = false;
|
|
16
|
+
this.showTimestamps = true;
|
|
17
|
+
this.apiEndpoint = '';
|
|
18
|
+
this.apiKey = '';
|
|
19
|
+
this.placeholderText = 'Type your message...';
|
|
20
|
+
this.thankYouMessage = 'Thank you for chatting with us!';
|
|
21
|
+
this.showPoweredBy = true;
|
|
22
|
+
this.poweredByLogo = 'https://innovationincubator.com/wp-content/uploads/2023/05/Innovation-Incubator-logo.png';
|
|
23
|
+
this.poweredByText = 'Powered by';
|
|
24
|
+
this.poweredByBrand = 'NerdAgent';
|
|
25
|
+
this.poweredByColor = '#4e8cff';
|
|
26
|
+
this.width = 350;
|
|
27
|
+
this.height = 500;
|
|
28
|
+
this.fontFamily = 'Segoe UI, Arial, sans-serif';
|
|
29
|
+
// State
|
|
30
|
+
this.messages = [];
|
|
31
|
+
this.isMinimized = false;
|
|
32
|
+
this.isTyping = false;
|
|
33
|
+
this.inputValue = '';
|
|
34
|
+
this.isChatOpen = true;
|
|
35
|
+
this.currentPosition = 'bottom-right';
|
|
36
|
+
this.messageIdCounter = 0;
|
|
37
|
+
}
|
|
38
|
+
componentDidLoad() {
|
|
39
|
+
// Initialize position
|
|
40
|
+
this.currentPosition = this.position;
|
|
41
|
+
// Load Font Awesome if not already loaded
|
|
42
|
+
this.loadFontAwesome();
|
|
43
|
+
// Add welcome message
|
|
44
|
+
if (this.getConfig().welcomeMessage) {
|
|
45
|
+
setTimeout(() => {
|
|
46
|
+
this.addMessage(this.getConfig().welcomeMessage, false);
|
|
47
|
+
}, 500);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
configChanged() {
|
|
51
|
+
// React to config changes - Stencil automatically re-renders when @Prop changes
|
|
52
|
+
// No need to manually trigger re-render
|
|
53
|
+
}
|
|
54
|
+
positionChanged() {
|
|
55
|
+
// Force re-render when position changes
|
|
56
|
+
console.log('Position changed to:', this.position);
|
|
57
|
+
this.currentPosition = this.position;
|
|
58
|
+
// Debug: Check what styles are applied
|
|
59
|
+
setTimeout(() => {
|
|
60
|
+
const widgetEl = this.el.shadowRoot.querySelector('.chat-widget');
|
|
61
|
+
if (widgetEl) {
|
|
62
|
+
console.log('Widget classes:', widgetEl.className);
|
|
63
|
+
console.log('Widget inline styles:', widgetEl.style.cssText);
|
|
64
|
+
console.log('Widget computed styles:', {
|
|
65
|
+
position: window.getComputedStyle(widgetEl).position,
|
|
66
|
+
top: window.getComputedStyle(widgetEl).top,
|
|
67
|
+
right: window.getComputedStyle(widgetEl).right,
|
|
68
|
+
bottom: window.getComputedStyle(widgetEl).bottom,
|
|
69
|
+
left: window.getComputedStyle(widgetEl).left
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}, 100);
|
|
73
|
+
}
|
|
74
|
+
getConfig() {
|
|
75
|
+
return Object.assign({ agentName: this.agentName, agentRole: this.agentRole, agentAvatar: this.agentAvatar, primaryColor: this.primaryColor, accentColor: this.accentColor, welcomeMessage: this.welcomeMessage, position: this.position, showMinimizeButton: this.showMinimizeButton, enableFileUpload: this.enableFileUpload, enableSpeech: this.enableSpeech, showTimestamps: this.showTimestamps, apiEndpoint: this.apiEndpoint, apiKey: this.apiKey, placeholderText: this.placeholderText, thankYouMessage: this.thankYouMessage, showPoweredBy: this.showPoweredBy, poweredByLogo: this.poweredByLogo, poweredByText: this.poweredByText, poweredByBrand: this.poweredByBrand, poweredByColor: this.poweredByColor, width: this.width, height: this.height, fontFamily: this.fontFamily }, this.config);
|
|
76
|
+
}
|
|
77
|
+
loadFontAwesome() {
|
|
78
|
+
if (!document.getElementById('fa-cdn-stencil')) {
|
|
79
|
+
const link = document.createElement('link');
|
|
80
|
+
link.id = 'fa-cdn-stencil';
|
|
81
|
+
link.rel = 'stylesheet';
|
|
82
|
+
link.href = 'https://use.fontawesome.com/releases/v6.4.2/css/all.css';
|
|
83
|
+
link.crossOrigin = 'anonymous';
|
|
84
|
+
document.head.appendChild(link);
|
|
85
|
+
console.log('Loading FontAwesome...');
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
console.log('FontAwesome already loaded');
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
addMessage(text, isUser = false) {
|
|
92
|
+
const message = {
|
|
93
|
+
id: `msg-${++this.messageIdCounter}`,
|
|
94
|
+
text,
|
|
95
|
+
isUser,
|
|
96
|
+
timestamp: new Date()
|
|
97
|
+
};
|
|
98
|
+
this.messages = [...this.messages, message];
|
|
99
|
+
}
|
|
100
|
+
async sendMessage() {
|
|
101
|
+
const text = this.inputValue.trim();
|
|
102
|
+
if (!text)
|
|
103
|
+
return;
|
|
104
|
+
this.addMessage(text, true);
|
|
105
|
+
this.inputValue = '';
|
|
106
|
+
// Emit event
|
|
107
|
+
this.messageSent.emit({ message: text, widget: this.el });
|
|
108
|
+
// Handle API or simulate response
|
|
109
|
+
const config = this.getConfig();
|
|
110
|
+
if (config.apiEndpoint) {
|
|
111
|
+
await this.sendToAPI(text);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
this.simulateResponse();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
async sendToAPI(message) {
|
|
118
|
+
const config = this.getConfig();
|
|
119
|
+
this.isTyping = true;
|
|
120
|
+
try {
|
|
121
|
+
const response = await fetch(config.apiEndpoint, {
|
|
122
|
+
method: 'POST',
|
|
123
|
+
headers: Object.assign({ 'Content-Type': 'application/json' }, (config.apiKey && { 'Authorization': `Bearer ${config.apiKey}` })),
|
|
124
|
+
body: JSON.stringify({
|
|
125
|
+
message,
|
|
126
|
+
timestamp: new Date().toISOString(),
|
|
127
|
+
sessionId: this.getSessionId()
|
|
128
|
+
})
|
|
129
|
+
});
|
|
130
|
+
const data = await response.json();
|
|
131
|
+
this.isTyping = false;
|
|
132
|
+
if (data.response) {
|
|
133
|
+
this.addMessage(data.response, false);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
this.isTyping = false;
|
|
138
|
+
this.addMessage('Sorry, I encountered an error. Please try again.', false);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
simulateResponse() {
|
|
142
|
+
const responses = [
|
|
143
|
+
"Thanks for your message! How can I help you further?",
|
|
144
|
+
"I understand. Let me assist you with that.",
|
|
145
|
+
"That's a great question! Let me help you.",
|
|
146
|
+
"I'm here to help! Could you provide more details?"
|
|
147
|
+
];
|
|
148
|
+
this.isTyping = true;
|
|
149
|
+
setTimeout(() => {
|
|
150
|
+
this.isTyping = false;
|
|
151
|
+
const response = responses[Math.floor(Math.random() * responses.length)];
|
|
152
|
+
this.addMessage(response, false);
|
|
153
|
+
}, 1500);
|
|
154
|
+
}
|
|
155
|
+
toggleMinimize() {
|
|
156
|
+
this.isMinimized = !this.isMinimized;
|
|
157
|
+
if (this.isMinimized) {
|
|
158
|
+
this.widgetClosed.emit({ widget: this.el });
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
this.widgetOpened.emit({ widget: this.el });
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
closeWidget() {
|
|
165
|
+
this.isChatOpen = false;
|
|
166
|
+
this.widgetClosed.emit({ widget: this.el });
|
|
167
|
+
}
|
|
168
|
+
openWidget() {
|
|
169
|
+
this.isChatOpen = true;
|
|
170
|
+
this.isMinimized = false;
|
|
171
|
+
this.widgetOpened.emit({ widget: this.el });
|
|
172
|
+
}
|
|
173
|
+
handleKeyPress(event) {
|
|
174
|
+
if (event.key === 'Enter') {
|
|
175
|
+
this.sendMessage();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
handleInputChange(event) {
|
|
179
|
+
const target = event.target;
|
|
180
|
+
this.inputValue = target.value;
|
|
181
|
+
}
|
|
182
|
+
getSessionId() {
|
|
183
|
+
let sessionId = localStorage.getItem('nerd-chat-session');
|
|
184
|
+
if (!sessionId) {
|
|
185
|
+
sessionId = 'session-' + Math.random().toString(36).substr(2, 9);
|
|
186
|
+
localStorage.setItem('nerd-chat-session', sessionId);
|
|
187
|
+
}
|
|
188
|
+
return sessionId;
|
|
189
|
+
}
|
|
190
|
+
formatTime(date) {
|
|
191
|
+
return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
|
|
192
|
+
}
|
|
193
|
+
render() {
|
|
194
|
+
const config = this.getConfig();
|
|
195
|
+
console.log('Rendering with position:', this.currentPosition);
|
|
196
|
+
// Get position styles directly
|
|
197
|
+
const getPositionStyles = () => {
|
|
198
|
+
switch (this.currentPosition) {
|
|
199
|
+
case 'bottom-left':
|
|
200
|
+
return { bottom: '20px', left: '20px', top: 'auto', right: 'auto' };
|
|
201
|
+
case 'top-right':
|
|
202
|
+
return { top: '20px', right: '20px', bottom: 'auto', left: 'auto' };
|
|
203
|
+
case 'top-left':
|
|
204
|
+
return { top: '20px', left: '20px', bottom: 'auto', right: 'auto' };
|
|
205
|
+
case 'bottom-right':
|
|
206
|
+
default:
|
|
207
|
+
return { bottom: '20px', right: '20px', top: 'auto', left: 'auto' };
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
const widgetClasses = {
|
|
211
|
+
'chat-widget': true,
|
|
212
|
+
'minimized': this.isMinimized,
|
|
213
|
+
'hidden': !this.isChatOpen
|
|
214
|
+
};
|
|
215
|
+
return (h(Host, null, h("div", { class: widgetClasses, style: Object.assign({ '--primary-color': config.primaryColor || '#2d3e50', '--accent-color': config.accentColor || '#4e8cff', '--widget-width': `${config.width || 350}px`, '--widget-height': `${config.height || 500}px`, '--font-family': config.fontFamily || 'Segoe UI, Arial, sans-serif' }, getPositionStyles()) }, h("div", { class: "chat-header" }, h("div", { class: "agent-info" }, h("img", { src: config.agentAvatar, alt: "Agent", class: "agent-avatar" }), h("div", { class: "agent-details" }, h("h4", null, config.agentName), h("p", null, config.agentRole))), h("div", { class: "controls" }, config.showMinimizeButton && (h("button", { class: "control-btn minimize-btn", onClick: () => this.toggleMinimize(), title: this.isMinimized ? 'Maximize' : 'Minimize' }, this.isMinimized ? '🔼' : '🔽')), h("button", { class: "control-btn close-btn", onClick: () => this.closeWidget(), title: "Close" }, "\u00D7"))), h("div", { class: "messages-container" }, this.messages.map(message => (h("div", { key: message.id, class: `message ${message.isUser ? 'user' : 'agent'}` }, h("img", { src: message.isUser ? 'https://ui-avatars.com/api/?name=User&background=4e8cff&color=ffffff&size=28' : config.agentAvatar, alt: message.isUser ? 'User' : 'Agent', class: "message-avatar" }), h("div", { class: "message-content" }, h("div", { class: "message-text" }, message.text), config.showTimestamps && (h("div", { class: "message-time" }, this.formatTime(message.timestamp))))))), this.isTyping && (h("div", { class: "typing-indicator" }, h("span", null, config.agentName, " is typing"), h("div", { class: "typing-dots" }, h("div", { class: "dot" }), h("div", { class: "dot" }), h("div", { class: "dot" }))))), h("div", { class: "input-container" }, h("input", { type: "text", class: "message-input", placeholder: config.placeholderText || 'Type your message...', value: this.inputValue, onInput: (e) => this.handleInputChange(e), onKeyPress: (e) => this.handleKeyPress(e) }), h("button", { class: "send-btn", onClick: () => this.sendMessage() }, h("i", { class: "fas fa-paper-plane" }), h("span", { class: "fallback-icon" }, "\u27A4")), config.enableFileUpload && (h("button", { class: "feature-btn file-upload" }, h("i", { class: "fas fa-paperclip" }), h("span", { class: "fallback-icon" }, "\uD83D\uDCCE"))), config.enableSpeech && (h("button", { class: "feature-btn speech" }, h("i", { class: "fas fa-microphone" }), h("span", { class: "fallback-icon" }, "\uD83C\uDFA4")))), h("div", { class: "tabs" }, h("div", { class: "tab active" }, h("i", { class: "fas fa-comment-dots" }), h("span", null, "Chat")), h("div", { class: "tab" }, h("i", { class: "fas fa-microphone" }), h("span", null, "Voice")), h("div", { class: "tab" }, h("i", { class: "fas fa-clock" }), h("span", null, "History"))), config.showPoweredBy && (h("div", { class: "powered-by" }, h("img", { src: config.poweredByLogo, alt: "Powered By Logo" }), config.poweredByText, " ", h("span", { style: { color: config.poweredByColor } }, config.poweredByBrand))), h("div", { class: "minimize-icon", onClick: () => this.isChatOpen ? this.toggleMinimize() : this.openWidget() }, "\uD83D\uDCAC"))));
|
|
216
|
+
}
|
|
217
|
+
static get is() { return "nerd-chat-widget"; }
|
|
218
|
+
static get encapsulation() { return "shadow"; }
|
|
219
|
+
static get originalStyleUrls() {
|
|
220
|
+
return {
|
|
221
|
+
"$": ["chat-widget.scss"]
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
static get styleUrls() {
|
|
225
|
+
return {
|
|
226
|
+
"$": ["chat-widget.css"]
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
static get properties() {
|
|
230
|
+
return {
|
|
231
|
+
"config": {
|
|
232
|
+
"type": "unknown",
|
|
233
|
+
"attribute": "config",
|
|
234
|
+
"mutable": false,
|
|
235
|
+
"complexType": {
|
|
236
|
+
"original": "ChatWidgetConfig",
|
|
237
|
+
"resolved": "ChatWidgetConfig",
|
|
238
|
+
"references": {
|
|
239
|
+
"ChatWidgetConfig": {
|
|
240
|
+
"location": "local",
|
|
241
|
+
"path": "/Users/ragesh/Workspace/IIA/NerdsAgent/nerdagent-chat-ui-builder/src/components/chat-widget/chat-widget.tsx",
|
|
242
|
+
"id": "src/components/chat-widget/chat-widget.tsx::ChatWidgetConfig"
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"required": false,
|
|
247
|
+
"optional": false,
|
|
248
|
+
"docs": {
|
|
249
|
+
"tags": [],
|
|
250
|
+
"text": ""
|
|
251
|
+
},
|
|
252
|
+
"getter": false,
|
|
253
|
+
"setter": false,
|
|
254
|
+
"defaultValue": "{}"
|
|
255
|
+
},
|
|
256
|
+
"agentName": {
|
|
257
|
+
"type": "string",
|
|
258
|
+
"attribute": "agent-name",
|
|
259
|
+
"mutable": false,
|
|
260
|
+
"complexType": {
|
|
261
|
+
"original": "string",
|
|
262
|
+
"resolved": "string",
|
|
263
|
+
"references": {}
|
|
264
|
+
},
|
|
265
|
+
"required": false,
|
|
266
|
+
"optional": false,
|
|
267
|
+
"docs": {
|
|
268
|
+
"tags": [],
|
|
269
|
+
"text": ""
|
|
270
|
+
},
|
|
271
|
+
"getter": false,
|
|
272
|
+
"setter": false,
|
|
273
|
+
"reflect": false,
|
|
274
|
+
"defaultValue": "'Support Agent'"
|
|
275
|
+
},
|
|
276
|
+
"agentRole": {
|
|
277
|
+
"type": "string",
|
|
278
|
+
"attribute": "agent-role",
|
|
279
|
+
"mutable": false,
|
|
280
|
+
"complexType": {
|
|
281
|
+
"original": "string",
|
|
282
|
+
"resolved": "string",
|
|
283
|
+
"references": {}
|
|
284
|
+
},
|
|
285
|
+
"required": false,
|
|
286
|
+
"optional": false,
|
|
287
|
+
"docs": {
|
|
288
|
+
"tags": [],
|
|
289
|
+
"text": ""
|
|
290
|
+
},
|
|
291
|
+
"getter": false,
|
|
292
|
+
"setter": false,
|
|
293
|
+
"reflect": false,
|
|
294
|
+
"defaultValue": "'Customer Support'"
|
|
295
|
+
},
|
|
296
|
+
"agentAvatar": {
|
|
297
|
+
"type": "string",
|
|
298
|
+
"attribute": "agent-avatar",
|
|
299
|
+
"mutable": false,
|
|
300
|
+
"complexType": {
|
|
301
|
+
"original": "string",
|
|
302
|
+
"resolved": "string",
|
|
303
|
+
"references": {}
|
|
304
|
+
},
|
|
305
|
+
"required": false,
|
|
306
|
+
"optional": false,
|
|
307
|
+
"docs": {
|
|
308
|
+
"tags": [],
|
|
309
|
+
"text": ""
|
|
310
|
+
},
|
|
311
|
+
"getter": false,
|
|
312
|
+
"setter": false,
|
|
313
|
+
"reflect": false,
|
|
314
|
+
"defaultValue": "'https://ui-avatars.com/api/?name=Agent&background=2d3e50&color=ffffff&size=44'"
|
|
315
|
+
},
|
|
316
|
+
"primaryColor": {
|
|
317
|
+
"type": "string",
|
|
318
|
+
"attribute": "primary-color",
|
|
319
|
+
"mutable": false,
|
|
320
|
+
"complexType": {
|
|
321
|
+
"original": "string",
|
|
322
|
+
"resolved": "string",
|
|
323
|
+
"references": {}
|
|
324
|
+
},
|
|
325
|
+
"required": false,
|
|
326
|
+
"optional": false,
|
|
327
|
+
"docs": {
|
|
328
|
+
"tags": [],
|
|
329
|
+
"text": ""
|
|
330
|
+
},
|
|
331
|
+
"getter": false,
|
|
332
|
+
"setter": false,
|
|
333
|
+
"reflect": false,
|
|
334
|
+
"defaultValue": "'#2d3e50'"
|
|
335
|
+
},
|
|
336
|
+
"accentColor": {
|
|
337
|
+
"type": "string",
|
|
338
|
+
"attribute": "accent-color",
|
|
339
|
+
"mutable": false,
|
|
340
|
+
"complexType": {
|
|
341
|
+
"original": "string",
|
|
342
|
+
"resolved": "string",
|
|
343
|
+
"references": {}
|
|
344
|
+
},
|
|
345
|
+
"required": false,
|
|
346
|
+
"optional": false,
|
|
347
|
+
"docs": {
|
|
348
|
+
"tags": [],
|
|
349
|
+
"text": ""
|
|
350
|
+
},
|
|
351
|
+
"getter": false,
|
|
352
|
+
"setter": false,
|
|
353
|
+
"reflect": false,
|
|
354
|
+
"defaultValue": "'#4e8cff'"
|
|
355
|
+
},
|
|
356
|
+
"welcomeMessage": {
|
|
357
|
+
"type": "string",
|
|
358
|
+
"attribute": "welcome-message",
|
|
359
|
+
"mutable": false,
|
|
360
|
+
"complexType": {
|
|
361
|
+
"original": "string",
|
|
362
|
+
"resolved": "string",
|
|
363
|
+
"references": {}
|
|
364
|
+
},
|
|
365
|
+
"required": false,
|
|
366
|
+
"optional": false,
|
|
367
|
+
"docs": {
|
|
368
|
+
"tags": [],
|
|
369
|
+
"text": ""
|
|
370
|
+
},
|
|
371
|
+
"getter": false,
|
|
372
|
+
"setter": false,
|
|
373
|
+
"reflect": false,
|
|
374
|
+
"defaultValue": "'Hi! How can I help you today?'"
|
|
375
|
+
},
|
|
376
|
+
"position": {
|
|
377
|
+
"type": "string",
|
|
378
|
+
"attribute": "position",
|
|
379
|
+
"mutable": false,
|
|
380
|
+
"complexType": {
|
|
381
|
+
"original": "WidgetPosition",
|
|
382
|
+
"resolved": "\"bottom-left\" | \"bottom-right\" | \"top-left\" | \"top-right\"",
|
|
383
|
+
"references": {
|
|
384
|
+
"WidgetPosition": {
|
|
385
|
+
"location": "local",
|
|
386
|
+
"path": "/Users/ragesh/Workspace/IIA/NerdsAgent/nerdagent-chat-ui-builder/src/components/chat-widget/chat-widget.tsx",
|
|
387
|
+
"id": "src/components/chat-widget/chat-widget.tsx::WidgetPosition"
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
"required": false,
|
|
392
|
+
"optional": false,
|
|
393
|
+
"docs": {
|
|
394
|
+
"tags": [],
|
|
395
|
+
"text": ""
|
|
396
|
+
},
|
|
397
|
+
"getter": false,
|
|
398
|
+
"setter": false,
|
|
399
|
+
"reflect": false,
|
|
400
|
+
"defaultValue": "'bottom-right'"
|
|
401
|
+
},
|
|
402
|
+
"showMinimizeButton": {
|
|
403
|
+
"type": "boolean",
|
|
404
|
+
"attribute": "show-minimize-button",
|
|
405
|
+
"mutable": false,
|
|
406
|
+
"complexType": {
|
|
407
|
+
"original": "boolean",
|
|
408
|
+
"resolved": "boolean",
|
|
409
|
+
"references": {}
|
|
410
|
+
},
|
|
411
|
+
"required": false,
|
|
412
|
+
"optional": false,
|
|
413
|
+
"docs": {
|
|
414
|
+
"tags": [],
|
|
415
|
+
"text": ""
|
|
416
|
+
},
|
|
417
|
+
"getter": false,
|
|
418
|
+
"setter": false,
|
|
419
|
+
"reflect": false,
|
|
420
|
+
"defaultValue": "true"
|
|
421
|
+
},
|
|
422
|
+
"enableFileUpload": {
|
|
423
|
+
"type": "boolean",
|
|
424
|
+
"attribute": "enable-file-upload",
|
|
425
|
+
"mutable": false,
|
|
426
|
+
"complexType": {
|
|
427
|
+
"original": "boolean",
|
|
428
|
+
"resolved": "boolean",
|
|
429
|
+
"references": {}
|
|
430
|
+
},
|
|
431
|
+
"required": false,
|
|
432
|
+
"optional": false,
|
|
433
|
+
"docs": {
|
|
434
|
+
"tags": [],
|
|
435
|
+
"text": ""
|
|
436
|
+
},
|
|
437
|
+
"getter": false,
|
|
438
|
+
"setter": false,
|
|
439
|
+
"reflect": false,
|
|
440
|
+
"defaultValue": "false"
|
|
441
|
+
},
|
|
442
|
+
"enableSpeech": {
|
|
443
|
+
"type": "boolean",
|
|
444
|
+
"attribute": "enable-speech",
|
|
445
|
+
"mutable": false,
|
|
446
|
+
"complexType": {
|
|
447
|
+
"original": "boolean",
|
|
448
|
+
"resolved": "boolean",
|
|
449
|
+
"references": {}
|
|
450
|
+
},
|
|
451
|
+
"required": false,
|
|
452
|
+
"optional": false,
|
|
453
|
+
"docs": {
|
|
454
|
+
"tags": [],
|
|
455
|
+
"text": ""
|
|
456
|
+
},
|
|
457
|
+
"getter": false,
|
|
458
|
+
"setter": false,
|
|
459
|
+
"reflect": false,
|
|
460
|
+
"defaultValue": "false"
|
|
461
|
+
},
|
|
462
|
+
"showTimestamps": {
|
|
463
|
+
"type": "boolean",
|
|
464
|
+
"attribute": "show-timestamps",
|
|
465
|
+
"mutable": false,
|
|
466
|
+
"complexType": {
|
|
467
|
+
"original": "boolean",
|
|
468
|
+
"resolved": "boolean",
|
|
469
|
+
"references": {}
|
|
470
|
+
},
|
|
471
|
+
"required": false,
|
|
472
|
+
"optional": false,
|
|
473
|
+
"docs": {
|
|
474
|
+
"tags": [],
|
|
475
|
+
"text": ""
|
|
476
|
+
},
|
|
477
|
+
"getter": false,
|
|
478
|
+
"setter": false,
|
|
479
|
+
"reflect": false,
|
|
480
|
+
"defaultValue": "true"
|
|
481
|
+
},
|
|
482
|
+
"apiEndpoint": {
|
|
483
|
+
"type": "string",
|
|
484
|
+
"attribute": "api-endpoint",
|
|
485
|
+
"mutable": false,
|
|
486
|
+
"complexType": {
|
|
487
|
+
"original": "string",
|
|
488
|
+
"resolved": "string",
|
|
489
|
+
"references": {}
|
|
490
|
+
},
|
|
491
|
+
"required": false,
|
|
492
|
+
"optional": false,
|
|
493
|
+
"docs": {
|
|
494
|
+
"tags": [],
|
|
495
|
+
"text": ""
|
|
496
|
+
},
|
|
497
|
+
"getter": false,
|
|
498
|
+
"setter": false,
|
|
499
|
+
"reflect": false,
|
|
500
|
+
"defaultValue": "''"
|
|
501
|
+
},
|
|
502
|
+
"apiKey": {
|
|
503
|
+
"type": "string",
|
|
504
|
+
"attribute": "api-key",
|
|
505
|
+
"mutable": false,
|
|
506
|
+
"complexType": {
|
|
507
|
+
"original": "string",
|
|
508
|
+
"resolved": "string",
|
|
509
|
+
"references": {}
|
|
510
|
+
},
|
|
511
|
+
"required": false,
|
|
512
|
+
"optional": false,
|
|
513
|
+
"docs": {
|
|
514
|
+
"tags": [],
|
|
515
|
+
"text": ""
|
|
516
|
+
},
|
|
517
|
+
"getter": false,
|
|
518
|
+
"setter": false,
|
|
519
|
+
"reflect": false,
|
|
520
|
+
"defaultValue": "''"
|
|
521
|
+
},
|
|
522
|
+
"placeholderText": {
|
|
523
|
+
"type": "string",
|
|
524
|
+
"attribute": "placeholder-text",
|
|
525
|
+
"mutable": false,
|
|
526
|
+
"complexType": {
|
|
527
|
+
"original": "string",
|
|
528
|
+
"resolved": "string",
|
|
529
|
+
"references": {}
|
|
530
|
+
},
|
|
531
|
+
"required": false,
|
|
532
|
+
"optional": false,
|
|
533
|
+
"docs": {
|
|
534
|
+
"tags": [],
|
|
535
|
+
"text": ""
|
|
536
|
+
},
|
|
537
|
+
"getter": false,
|
|
538
|
+
"setter": false,
|
|
539
|
+
"reflect": false,
|
|
540
|
+
"defaultValue": "'Type your message...'"
|
|
541
|
+
},
|
|
542
|
+
"thankYouMessage": {
|
|
543
|
+
"type": "string",
|
|
544
|
+
"attribute": "thank-you-message",
|
|
545
|
+
"mutable": false,
|
|
546
|
+
"complexType": {
|
|
547
|
+
"original": "string",
|
|
548
|
+
"resolved": "string",
|
|
549
|
+
"references": {}
|
|
550
|
+
},
|
|
551
|
+
"required": false,
|
|
552
|
+
"optional": false,
|
|
553
|
+
"docs": {
|
|
554
|
+
"tags": [],
|
|
555
|
+
"text": ""
|
|
556
|
+
},
|
|
557
|
+
"getter": false,
|
|
558
|
+
"setter": false,
|
|
559
|
+
"reflect": false,
|
|
560
|
+
"defaultValue": "'Thank you for chatting with us!'"
|
|
561
|
+
},
|
|
562
|
+
"showPoweredBy": {
|
|
563
|
+
"type": "boolean",
|
|
564
|
+
"attribute": "show-powered-by",
|
|
565
|
+
"mutable": false,
|
|
566
|
+
"complexType": {
|
|
567
|
+
"original": "boolean",
|
|
568
|
+
"resolved": "boolean",
|
|
569
|
+
"references": {}
|
|
570
|
+
},
|
|
571
|
+
"required": false,
|
|
572
|
+
"optional": false,
|
|
573
|
+
"docs": {
|
|
574
|
+
"tags": [],
|
|
575
|
+
"text": ""
|
|
576
|
+
},
|
|
577
|
+
"getter": false,
|
|
578
|
+
"setter": false,
|
|
579
|
+
"reflect": false,
|
|
580
|
+
"defaultValue": "true"
|
|
581
|
+
},
|
|
582
|
+
"poweredByLogo": {
|
|
583
|
+
"type": "string",
|
|
584
|
+
"attribute": "powered-by-logo",
|
|
585
|
+
"mutable": false,
|
|
586
|
+
"complexType": {
|
|
587
|
+
"original": "string",
|
|
588
|
+
"resolved": "string",
|
|
589
|
+
"references": {}
|
|
590
|
+
},
|
|
591
|
+
"required": false,
|
|
592
|
+
"optional": false,
|
|
593
|
+
"docs": {
|
|
594
|
+
"tags": [],
|
|
595
|
+
"text": ""
|
|
596
|
+
},
|
|
597
|
+
"getter": false,
|
|
598
|
+
"setter": false,
|
|
599
|
+
"reflect": false,
|
|
600
|
+
"defaultValue": "'https://innovationincubator.com/wp-content/uploads/2023/05/Innovation-Incubator-logo.png'"
|
|
601
|
+
},
|
|
602
|
+
"poweredByText": {
|
|
603
|
+
"type": "string",
|
|
604
|
+
"attribute": "powered-by-text",
|
|
605
|
+
"mutable": false,
|
|
606
|
+
"complexType": {
|
|
607
|
+
"original": "string",
|
|
608
|
+
"resolved": "string",
|
|
609
|
+
"references": {}
|
|
610
|
+
},
|
|
611
|
+
"required": false,
|
|
612
|
+
"optional": false,
|
|
613
|
+
"docs": {
|
|
614
|
+
"tags": [],
|
|
615
|
+
"text": ""
|
|
616
|
+
},
|
|
617
|
+
"getter": false,
|
|
618
|
+
"setter": false,
|
|
619
|
+
"reflect": false,
|
|
620
|
+
"defaultValue": "'Powered by'"
|
|
621
|
+
},
|
|
622
|
+
"poweredByBrand": {
|
|
623
|
+
"type": "string",
|
|
624
|
+
"attribute": "powered-by-brand",
|
|
625
|
+
"mutable": false,
|
|
626
|
+
"complexType": {
|
|
627
|
+
"original": "string",
|
|
628
|
+
"resolved": "string",
|
|
629
|
+
"references": {}
|
|
630
|
+
},
|
|
631
|
+
"required": false,
|
|
632
|
+
"optional": false,
|
|
633
|
+
"docs": {
|
|
634
|
+
"tags": [],
|
|
635
|
+
"text": ""
|
|
636
|
+
},
|
|
637
|
+
"getter": false,
|
|
638
|
+
"setter": false,
|
|
639
|
+
"reflect": false,
|
|
640
|
+
"defaultValue": "'NerdAgent'"
|
|
641
|
+
},
|
|
642
|
+
"poweredByColor": {
|
|
643
|
+
"type": "string",
|
|
644
|
+
"attribute": "powered-by-color",
|
|
645
|
+
"mutable": false,
|
|
646
|
+
"complexType": {
|
|
647
|
+
"original": "string",
|
|
648
|
+
"resolved": "string",
|
|
649
|
+
"references": {}
|
|
650
|
+
},
|
|
651
|
+
"required": false,
|
|
652
|
+
"optional": false,
|
|
653
|
+
"docs": {
|
|
654
|
+
"tags": [],
|
|
655
|
+
"text": ""
|
|
656
|
+
},
|
|
657
|
+
"getter": false,
|
|
658
|
+
"setter": false,
|
|
659
|
+
"reflect": false,
|
|
660
|
+
"defaultValue": "'#4e8cff'"
|
|
661
|
+
},
|
|
662
|
+
"width": {
|
|
663
|
+
"type": "number",
|
|
664
|
+
"attribute": "width",
|
|
665
|
+
"mutable": false,
|
|
666
|
+
"complexType": {
|
|
667
|
+
"original": "number",
|
|
668
|
+
"resolved": "number",
|
|
669
|
+
"references": {}
|
|
670
|
+
},
|
|
671
|
+
"required": false,
|
|
672
|
+
"optional": false,
|
|
673
|
+
"docs": {
|
|
674
|
+
"tags": [],
|
|
675
|
+
"text": ""
|
|
676
|
+
},
|
|
677
|
+
"getter": false,
|
|
678
|
+
"setter": false,
|
|
679
|
+
"reflect": false,
|
|
680
|
+
"defaultValue": "350"
|
|
681
|
+
},
|
|
682
|
+
"height": {
|
|
683
|
+
"type": "number",
|
|
684
|
+
"attribute": "height",
|
|
685
|
+
"mutable": false,
|
|
686
|
+
"complexType": {
|
|
687
|
+
"original": "number",
|
|
688
|
+
"resolved": "number",
|
|
689
|
+
"references": {}
|
|
690
|
+
},
|
|
691
|
+
"required": false,
|
|
692
|
+
"optional": false,
|
|
693
|
+
"docs": {
|
|
694
|
+
"tags": [],
|
|
695
|
+
"text": ""
|
|
696
|
+
},
|
|
697
|
+
"getter": false,
|
|
698
|
+
"setter": false,
|
|
699
|
+
"reflect": false,
|
|
700
|
+
"defaultValue": "500"
|
|
701
|
+
},
|
|
702
|
+
"fontFamily": {
|
|
703
|
+
"type": "string",
|
|
704
|
+
"attribute": "font-family",
|
|
705
|
+
"mutable": false,
|
|
706
|
+
"complexType": {
|
|
707
|
+
"original": "string",
|
|
708
|
+
"resolved": "string",
|
|
709
|
+
"references": {}
|
|
710
|
+
},
|
|
711
|
+
"required": false,
|
|
712
|
+
"optional": false,
|
|
713
|
+
"docs": {
|
|
714
|
+
"tags": [],
|
|
715
|
+
"text": ""
|
|
716
|
+
},
|
|
717
|
+
"getter": false,
|
|
718
|
+
"setter": false,
|
|
719
|
+
"reflect": false,
|
|
720
|
+
"defaultValue": "'Segoe UI, Arial, sans-serif'"
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
static get states() {
|
|
725
|
+
return {
|
|
726
|
+
"messages": {},
|
|
727
|
+
"isMinimized": {},
|
|
728
|
+
"isTyping": {},
|
|
729
|
+
"inputValue": {},
|
|
730
|
+
"isChatOpen": {},
|
|
731
|
+
"currentPosition": {}
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
static get events() {
|
|
735
|
+
return [{
|
|
736
|
+
"method": "messageSent",
|
|
737
|
+
"name": "messageSent",
|
|
738
|
+
"bubbles": true,
|
|
739
|
+
"cancelable": true,
|
|
740
|
+
"composed": true,
|
|
741
|
+
"docs": {
|
|
742
|
+
"tags": [],
|
|
743
|
+
"text": ""
|
|
744
|
+
},
|
|
745
|
+
"complexType": {
|
|
746
|
+
"original": "{ message: string; widget: HTMLElement }",
|
|
747
|
+
"resolved": "{ message: string; widget: HTMLElement; }",
|
|
748
|
+
"references": {
|
|
749
|
+
"HTMLElement": {
|
|
750
|
+
"location": "global",
|
|
751
|
+
"id": "global::HTMLElement"
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
}, {
|
|
756
|
+
"method": "widgetOpened",
|
|
757
|
+
"name": "widgetOpened",
|
|
758
|
+
"bubbles": true,
|
|
759
|
+
"cancelable": true,
|
|
760
|
+
"composed": true,
|
|
761
|
+
"docs": {
|
|
762
|
+
"tags": [],
|
|
763
|
+
"text": ""
|
|
764
|
+
},
|
|
765
|
+
"complexType": {
|
|
766
|
+
"original": "{ widget: HTMLElement }",
|
|
767
|
+
"resolved": "{ widget: HTMLElement; }",
|
|
768
|
+
"references": {
|
|
769
|
+
"HTMLElement": {
|
|
770
|
+
"location": "global",
|
|
771
|
+
"id": "global::HTMLElement"
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
}, {
|
|
776
|
+
"method": "widgetClosed",
|
|
777
|
+
"name": "widgetClosed",
|
|
778
|
+
"bubbles": true,
|
|
779
|
+
"cancelable": true,
|
|
780
|
+
"composed": true,
|
|
781
|
+
"docs": {
|
|
782
|
+
"tags": [],
|
|
783
|
+
"text": ""
|
|
784
|
+
},
|
|
785
|
+
"complexType": {
|
|
786
|
+
"original": "{ widget: HTMLElement }",
|
|
787
|
+
"resolved": "{ widget: HTMLElement; }",
|
|
788
|
+
"references": {
|
|
789
|
+
"HTMLElement": {
|
|
790
|
+
"location": "global",
|
|
791
|
+
"id": "global::HTMLElement"
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
}];
|
|
796
|
+
}
|
|
797
|
+
static get elementRef() { return "el"; }
|
|
798
|
+
static get watchers() {
|
|
799
|
+
return [{
|
|
800
|
+
"propName": "config",
|
|
801
|
+
"methodName": "configChanged"
|
|
802
|
+
}, {
|
|
803
|
+
"propName": "position",
|
|
804
|
+
"methodName": "positionChanged"
|
|
805
|
+
}];
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
//# sourceMappingURL=chat-widget.js.map
|