@memberjunction/ng-chat 1.1.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.
@@ -0,0 +1,70 @@
1
+ import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter } from '@angular/core';
2
+ import { MarkdownService } from 'ngx-markdown';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ChatWelcomeQuestion {
5
+ topLine: string;
6
+ bottomLine: string;
7
+ prompt: string;
8
+ }
9
+ export declare class ChatMessage {
10
+ message: string;
11
+ senderName: string;
12
+ senderType: 'user' | 'ai';
13
+ id?: any;
14
+ constructor(message: string, senderName: string, senderType: 'user' | 'ai', id?: any);
15
+ }
16
+ export declare class ChatComponent implements AfterViewInit {
17
+ private markdownService;
18
+ private cd;
19
+ InitialMessage: string;
20
+ Messages: ChatMessage[];
21
+ /**
22
+ * Optional, provide this to show an image for the AI. If not provided, a default robot icon will be shown.
23
+ */
24
+ AIImageURL: string;
25
+ AILargeImageURL: string;
26
+ /**
27
+ * Optional, provide up to 4 welcome questions with example prompts.
28
+ * These will be shown to the user when the chat is first opened and there are no messages.
29
+ */
30
+ WelcomeQuestions: ChatWelcomeQuestion[];
31
+ /**
32
+ * Optional, provide a prompt for the user when they click the clear all messages button.
33
+ */
34
+ ClearAllMessagesPrompt: string;
35
+ /**
36
+ * Set this to enable/disable sending of a message. Whenever the input is empty, this field will be
37
+ * ignored and the send button will be disabled.
38
+ */
39
+ AllowSend: boolean;
40
+ InternalAllowSend: boolean;
41
+ /**
42
+ * The placeholder text for the input field
43
+ */
44
+ Placeholder: string;
45
+ private _ShowWaitingIndicator;
46
+ get ShowWaitingIndicator(): boolean;
47
+ set ShowWaitingIndicator(value: boolean);
48
+ ngAfterViewInit(): void;
49
+ MessageAdded: EventEmitter<ChatMessage>;
50
+ ClearChatRequested: EventEmitter<void>;
51
+ private messagesContainer;
52
+ theInput: ElementRef | undefined;
53
+ currentMessage: string;
54
+ showingClearAllDialog: boolean;
55
+ constructor(markdownService: MarkdownService, cd: ChangeDetectorRef);
56
+ SendCurrentMessage(): void;
57
+ handleInputChange(event: any): void;
58
+ protected resizeTextInput(): void;
59
+ SendMessage(message: string, senderName: string, senderType: 'user' | 'ai', id: any, fireEvent?: boolean): void;
60
+ SendUserMessage(message: string): void;
61
+ HandleClearChat(): void;
62
+ ClearAllMessages(): void;
63
+ protected FocusTextArea(): void;
64
+ protected AppendMessage(message: ChatMessage, fireEvent?: boolean): Promise<void>;
65
+ protected ScrollMessagesToBottom(animate?: boolean): void;
66
+ ShowScrollToBottomButton: boolean;
67
+ handleCheckScroll(): void;
68
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatComponent, never>;
69
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChatComponent, "mj-chat", never, { "InitialMessage": { "alias": "InitialMessage"; "required": false; }; "Messages": { "alias": "Messages"; "required": false; }; "AIImageURL": { "alias": "AIImageURL"; "required": false; }; "AILargeImageURL": { "alias": "AILargeImageURL"; "required": false; }; "WelcomeQuestions": { "alias": "WelcomeQuestions"; "required": false; }; "ClearAllMessagesPrompt": { "alias": "ClearAllMessagesPrompt"; "required": false; }; "AllowSend": { "alias": "AllowSend"; "required": false; }; "Placeholder": { "alias": "Placeholder"; "required": false; }; "ShowWaitingIndicator": { "alias": "ShowWaitingIndicator"; "required": false; }; }, { "MessageAdded": "MessageAdded"; "ClearChatRequested": "ClearChatRequested"; }, never, never, false, never>;
70
+ }
@@ -0,0 +1,408 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
11
+ import { LogError } from '@memberjunction/core';
12
+ import * as i0 from "@angular/core";
13
+ import * as i1 from "ngx-markdown";
14
+ import * as i2 from "@angular/forms";
15
+ import * as i3 from "@memberjunction/ng-container-directives";
16
+ import * as i4 from "@progress/kendo-angular-indicators";
17
+ import * as i5 from "@progress/kendo-angular-buttons";
18
+ import * as i6 from "@progress/kendo-angular-dialog";
19
+ const _c0 = ["messagesContainer"];
20
+ const _c1 = ["theInput"];
21
+ function ChatComponent_Conditional_1_Conditional_2_Template(rf, ctx) { if (rf & 1) {
22
+ i0.ɵɵelement(0, "img", 15);
23
+ } if (rf & 2) {
24
+ const ctx_r6 = i0.ɵɵnextContext(2);
25
+ i0.ɵɵproperty("src", ctx_r6.AILargeImageURL, i0.ɵɵsanitizeUrl);
26
+ } }
27
+ function ChatComponent_Conditional_1_Conditional_7_Template(rf, ctx) { if (rf & 1) {
28
+ const _r12 = i0.ɵɵgetCurrentView();
29
+ i0.ɵɵelementStart(0, "div", 20);
30
+ i0.ɵɵlistener("click", function ChatComponent_Conditional_1_Conditional_7_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r12); const ctx_r11 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r11.SendUserMessage(ctx_r11.WelcomeQuestions[0].prompt)); });
31
+ i0.ɵɵelementStart(1, "span", 21);
32
+ i0.ɵɵtext(2);
33
+ i0.ɵɵelementEnd();
34
+ i0.ɵɵelementStart(3, "span");
35
+ i0.ɵɵtext(4);
36
+ i0.ɵɵelementEnd()();
37
+ } if (rf & 2) {
38
+ const ctx_r7 = i0.ɵɵnextContext(2);
39
+ i0.ɵɵadvance(2);
40
+ i0.ɵɵtextInterpolate(ctx_r7.WelcomeQuestions[0].topLine);
41
+ i0.ɵɵadvance(2);
42
+ i0.ɵɵtextInterpolate(ctx_r7.WelcomeQuestions[0].bottomLine);
43
+ } }
44
+ function ChatComponent_Conditional_1_Conditional_8_Template(rf, ctx) { if (rf & 1) {
45
+ const _r14 = i0.ɵɵgetCurrentView();
46
+ i0.ɵɵelementStart(0, "div", 20);
47
+ i0.ɵɵlistener("click", function ChatComponent_Conditional_1_Conditional_8_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r14); const ctx_r13 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r13.SendUserMessage(ctx_r13.WelcomeQuestions[1].prompt)); });
48
+ i0.ɵɵelementStart(1, "span", 21);
49
+ i0.ɵɵtext(2);
50
+ i0.ɵɵelementEnd();
51
+ i0.ɵɵelementStart(3, "span");
52
+ i0.ɵɵtext(4);
53
+ i0.ɵɵelementEnd()();
54
+ } if (rf & 2) {
55
+ const ctx_r8 = i0.ɵɵnextContext(2);
56
+ i0.ɵɵadvance(2);
57
+ i0.ɵɵtextInterpolate(ctx_r8.WelcomeQuestions[1].topLine);
58
+ i0.ɵɵadvance(2);
59
+ i0.ɵɵtextInterpolate(ctx_r8.WelcomeQuestions[1].bottomLine);
60
+ } }
61
+ function ChatComponent_Conditional_1_Conditional_10_Template(rf, ctx) { if (rf & 1) {
62
+ const _r16 = i0.ɵɵgetCurrentView();
63
+ i0.ɵɵelementStart(0, "div", 20);
64
+ i0.ɵɵlistener("click", function ChatComponent_Conditional_1_Conditional_10_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r16); const ctx_r15 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r15.SendUserMessage(ctx_r15.WelcomeQuestions[2].prompt)); });
65
+ i0.ɵɵelementStart(1, "span", 21);
66
+ i0.ɵɵtext(2);
67
+ i0.ɵɵelementEnd();
68
+ i0.ɵɵelementStart(3, "span");
69
+ i0.ɵɵtext(4);
70
+ i0.ɵɵelementEnd()();
71
+ } if (rf & 2) {
72
+ const ctx_r9 = i0.ɵɵnextContext(2);
73
+ i0.ɵɵadvance(2);
74
+ i0.ɵɵtextInterpolate(ctx_r9.WelcomeQuestions[2].topLine);
75
+ i0.ɵɵadvance(2);
76
+ i0.ɵɵtextInterpolate(ctx_r9.WelcomeQuestions[2].bottomLine);
77
+ } }
78
+ function ChatComponent_Conditional_1_Conditional_11_Template(rf, ctx) { if (rf & 1) {
79
+ const _r18 = i0.ɵɵgetCurrentView();
80
+ i0.ɵɵelementStart(0, "div", 20);
81
+ i0.ɵɵlistener("click", function ChatComponent_Conditional_1_Conditional_11_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r18); const ctx_r17 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r17.SendUserMessage(ctx_r17.WelcomeQuestions[3].prompt)); });
82
+ i0.ɵɵelementStart(1, "span", 21);
83
+ i0.ɵɵtext(2);
84
+ i0.ɵɵelementEnd();
85
+ i0.ɵɵelementStart(3, "span");
86
+ i0.ɵɵtext(4);
87
+ i0.ɵɵelementEnd()();
88
+ } if (rf & 2) {
89
+ const ctx_r10 = i0.ɵɵnextContext(2);
90
+ i0.ɵɵadvance(2);
91
+ i0.ɵɵtextInterpolate(ctx_r10.WelcomeQuestions[3].topLine);
92
+ i0.ɵɵadvance(2);
93
+ i0.ɵɵtextInterpolate(ctx_r10.WelcomeQuestions[3].bottomLine);
94
+ } }
95
+ function ChatComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
96
+ i0.ɵɵelementStart(0, "div", 13)(1, "div", 14);
97
+ i0.ɵɵtemplate(2, ChatComponent_Conditional_1_Conditional_2_Template, 1, 1, "img", 15);
98
+ i0.ɵɵelementStart(3, "div", 16);
99
+ i0.ɵɵtext(4, "What can I help with today?");
100
+ i0.ɵɵelementEnd()();
101
+ i0.ɵɵelementStart(5, "div", 17)(6, "div", 18);
102
+ i0.ɵɵtemplate(7, ChatComponent_Conditional_1_Conditional_7_Template, 5, 2, "div", 19)(8, ChatComponent_Conditional_1_Conditional_8_Template, 5, 2, "div", 19);
103
+ i0.ɵɵelementEnd();
104
+ i0.ɵɵelementStart(9, "div", 18);
105
+ i0.ɵɵtemplate(10, ChatComponent_Conditional_1_Conditional_10_Template, 5, 2, "div", 19)(11, ChatComponent_Conditional_1_Conditional_11_Template, 5, 2, "div", 19);
106
+ i0.ɵɵelementEnd()()();
107
+ } if (rf & 2) {
108
+ const ctx_r0 = i0.ɵɵnextContext();
109
+ i0.ɵɵadvance(2);
110
+ i0.ɵɵconditional(2, ctx_r0.AILargeImageURL ? 2 : -1);
111
+ i0.ɵɵadvance(5);
112
+ i0.ɵɵconditional(7, ctx_r0.WelcomeQuestions.length > 0 ? 7 : -1);
113
+ i0.ɵɵadvance();
114
+ i0.ɵɵconditional(8, ctx_r0.WelcomeQuestions.length > 1 ? 8 : -1);
115
+ i0.ɵɵadvance(2);
116
+ i0.ɵɵconditional(10, ctx_r0.WelcomeQuestions.length > 2 ? 10 : -1);
117
+ i0.ɵɵadvance();
118
+ i0.ɵɵconditional(11, ctx_r0.WelcomeQuestions.length > 3 ? 11 : -1);
119
+ } }
120
+ function ChatComponent_Conditional_6_Template(rf, ctx) { if (rf & 1) {
121
+ const _r20 = i0.ɵɵgetCurrentView();
122
+ i0.ɵɵelementStart(0, "span", 22);
123
+ i0.ɵɵlistener("click", function ChatComponent_Conditional_6_Template_span_click_0_listener() { i0.ɵɵrestoreView(_r20); const ctx_r19 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r19.ScrollMessagesToBottom()); });
124
+ i0.ɵɵelementEnd();
125
+ } }
126
+ function ChatComponent_Conditional_8_Template(rf, ctx) { if (rf & 1) {
127
+ i0.ɵɵelement(0, "kendo-loader", 23);
128
+ } }
129
+ function ChatComponent_Conditional_17_Template(rf, ctx) { if (rf & 1) {
130
+ const _r22 = i0.ɵɵgetCurrentView();
131
+ i0.ɵɵelementStart(0, "kendo-dialog")(1, "p");
132
+ i0.ɵɵtext(2);
133
+ i0.ɵɵelementEnd();
134
+ i0.ɵɵelementStart(3, "kendo-dialog-actions")(4, "button", 24);
135
+ i0.ɵɵlistener("click", function ChatComponent_Conditional_17_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r22); const ctx_r21 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r21.HandleClearChat()); });
136
+ i0.ɵɵtext(5, "Yes");
137
+ i0.ɵɵelementEnd();
138
+ i0.ɵɵelementStart(6, "button", 25);
139
+ i0.ɵɵlistener("click", function ChatComponent_Conditional_17_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r22); const ctx_r23 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r23.showingClearAllDialog = false); });
140
+ i0.ɵɵtext(7, "No");
141
+ i0.ɵɵelementEnd()()();
142
+ } if (rf & 2) {
143
+ const ctx_r5 = i0.ɵɵnextContext();
144
+ i0.ɵɵadvance(2);
145
+ i0.ɵɵtextInterpolate(ctx_r5.ClearAllMessagesPrompt);
146
+ } }
147
+ export class ChatWelcomeQuestion {
148
+ constructor() {
149
+ this.topLine = "";
150
+ this.bottomLine = "";
151
+ this.prompt = "";
152
+ }
153
+ }
154
+ export class ChatMessage {
155
+ constructor(message, senderName, senderType, id = null) {
156
+ this.senderType = 'user';
157
+ this.message = message;
158
+ this.senderName = senderName;
159
+ this.senderType = senderType;
160
+ this.id = id;
161
+ }
162
+ }
163
+ export class ChatComponent {
164
+ get ShowWaitingIndicator() {
165
+ return this._ShowWaitingIndicator;
166
+ }
167
+ set ShowWaitingIndicator(value) {
168
+ var _a;
169
+ this._ShowWaitingIndicator = value;
170
+ (_a = this.cd) === null || _a === void 0 ? void 0 : _a.detectChanges(); // Manually trigger change detection
171
+ if (!value) {
172
+ this.FocusTextArea();
173
+ }
174
+ }
175
+ ngAfterViewInit() {
176
+ this.FocusTextArea();
177
+ }
178
+ constructor(markdownService, cd) {
179
+ this.markdownService = markdownService;
180
+ this.cd = cd;
181
+ this.InitialMessage = '';
182
+ this.Messages = [];
183
+ /**
184
+ * Optional, provide this to show an image for the AI. If not provided, a default robot icon will be shown.
185
+ */
186
+ this.AIImageURL = '';
187
+ this.AILargeImageURL = '';
188
+ /**
189
+ * Optional, provide up to 4 welcome questions with example prompts.
190
+ * These will be shown to the user when the chat is first opened and there are no messages.
191
+ */
192
+ this.WelcomeQuestions = [];
193
+ /**
194
+ * Optional, provide a prompt for the user when they click the clear all messages button.
195
+ */
196
+ this.ClearAllMessagesPrompt = 'Are you sure you want to clear all messages?';
197
+ /**
198
+ * Set this to enable/disable sending of a message. Whenever the input is empty, this field will be
199
+ * ignored and the send button will be disabled.
200
+ */
201
+ this.AllowSend = true;
202
+ this.InternalAllowSend = true;
203
+ /**
204
+ * The placeholder text for the input field
205
+ */
206
+ this.Placeholder = 'Type a message...';
207
+ this._ShowWaitingIndicator = false;
208
+ this.MessageAdded = new EventEmitter();
209
+ this.ClearChatRequested = new EventEmitter();
210
+ this.currentMessage = '';
211
+ this.showingClearAllDialog = false;
212
+ this.ShowScrollToBottomButton = false;
213
+ }
214
+ SendCurrentMessage() {
215
+ if (this.currentMessage.trim() !== '') {
216
+ this.SendMessage(this.currentMessage, 'User', 'user', null);
217
+ this.currentMessage = ''; // Clear the input field
218
+ }
219
+ }
220
+ handleInputChange(event) {
221
+ var _a;
222
+ const val = (_a = this.theInput) === null || _a === void 0 ? void 0 : _a.nativeElement.value;
223
+ this.InternalAllowSend = this.AllowSend && (val ? val.length > 0 : false);
224
+ this.resizeTextInput();
225
+ }
226
+ resizeTextInput() {
227
+ var _a;
228
+ try {
229
+ const textarea = (_a = this.theInput) === null || _a === void 0 ? void 0 : _a.nativeElement;
230
+ if (textarea) {
231
+ textarea.style.height = 'auto'; // Reset height to recalculate
232
+ textarea.style.height = `${textarea.scrollHeight}px`; // Set to scrollHeight
233
+ }
234
+ }
235
+ catch (e) {
236
+ LogError(e);
237
+ }
238
+ }
239
+ SendMessage(message, senderName, senderType, id, fireEvent = true) {
240
+ const newMessage = new ChatMessage(message, senderName, senderType, id);
241
+ this.AppendMessage(newMessage, fireEvent);
242
+ }
243
+ SendUserMessage(message) {
244
+ this.SendMessage(message, 'User', 'user', null);
245
+ }
246
+ HandleClearChat() {
247
+ this.ClearChatRequested.emit();
248
+ }
249
+ ClearAllMessages() {
250
+ this.Messages = [];
251
+ this.messagesContainer.nativeElement.innerHTML = `<span>${this.InitialMessage}</span>`;
252
+ this.ScrollMessagesToBottom();
253
+ this.cd.detectChanges(); // Manually trigger change detection
254
+ this.FocusTextArea();
255
+ this.showingClearAllDialog = false;
256
+ }
257
+ FocusTextArea() {
258
+ setTimeout(() => { var _a; return (_a = this.theInput) === null || _a === void 0 ? void 0 : _a.nativeElement.focus(); }, 0); // use a timeout to ensure that angular has updated the DOM
259
+ }
260
+ AppendMessage(message, fireEvent = true) {
261
+ return __awaiter(this, void 0, void 0, function* () {
262
+ const messageWrapElement = document.createElement('div');
263
+ messageWrapElement.className = "chat-message-wrap";
264
+ const imageElement = document.createElement('span');
265
+ if (message.senderType === 'ai') {
266
+ if (this.AIImageURL) {
267
+ const img = document.createElement('img');
268
+ img.src = this.AIImageURL;
269
+ img.style.maxWidth = '24px';
270
+ imageElement.appendChild(img);
271
+ }
272
+ else
273
+ imageElement.classList.add('fa-solid', 'fa-robot');
274
+ }
275
+ else {
276
+ imageElement.classList.add('fa-solid', 'fa-user');
277
+ }
278
+ imageElement.classList.add("chat-message-image");
279
+ messageWrapElement.appendChild(imageElement);
280
+ const messageElement = document.createElement('div');
281
+ messageElement.innerHTML = yield this.markdownService.parse(message.message);
282
+ messageElement.className = "chat-message";
283
+ if (message.senderType === 'ai') {
284
+ messageElement.classList.add('chat-message-ai');
285
+ }
286
+ messageWrapElement.appendChild(messageElement);
287
+ this.Messages.push(message);
288
+ if (this.Messages.length === 1) {
289
+ // clear out the default message
290
+ this.messagesContainer.nativeElement.innerHTML = '';
291
+ }
292
+ this.messagesContainer.nativeElement.appendChild(messageWrapElement);
293
+ if (fireEvent)
294
+ this.MessageAdded.emit(message);
295
+ this.ScrollMessagesToBottom(false);
296
+ this.cd.detectChanges(); // Manually trigger change detection
297
+ });
298
+ }
299
+ ScrollMessagesToBottom(animate = true) {
300
+ try {
301
+ if (animate) {
302
+ const element = this.messagesContainer.nativeElement;
303
+ element.scrollTo({
304
+ top: element.scrollHeight,
305
+ behavior: 'smooth' // This enables the smooth scrolling
306
+ });
307
+ }
308
+ else {
309
+ this.messagesContainer.nativeElement.scrollTop = this.messagesContainer.nativeElement.scrollHeight;
310
+ }
311
+ }
312
+ catch (err) { }
313
+ }
314
+ handleCheckScroll() {
315
+ const element = this.messagesContainer.nativeElement;
316
+ if (element.scrollHeight - element.scrollTop > element.clientHeight) {
317
+ this.ShowScrollToBottomButton = true;
318
+ }
319
+ else {
320
+ this.ShowScrollToBottomButton = false;
321
+ }
322
+ }
323
+ }
324
+ ChatComponent.ɵfac = function ChatComponent_Factory(t) { return new (t || ChatComponent)(i0.ɵɵdirectiveInject(i1.MarkdownService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
325
+ ChatComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ChatComponent, selectors: [["mj-chat"]], viewQuery: function ChatComponent_Query(rf, ctx) { if (rf & 1) {
326
+ i0.ɵɵviewQuery(_c0, 7);
327
+ i0.ɵɵviewQuery(_c1, 5);
328
+ } if (rf & 2) {
329
+ let _t;
330
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.messagesContainer = _t.first);
331
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.theInput = _t.first);
332
+ } }, inputs: { InitialMessage: "InitialMessage", Messages: "Messages", AIImageURL: "AIImageURL", AILargeImageURL: "AILargeImageURL", WelcomeQuestions: "WelcomeQuestions", ClearAllMessagesPrompt: "ClearAllMessagesPrompt", AllowSend: "AllowSend", Placeholder: "Placeholder", ShowWaitingIndicator: "ShowWaitingIndicator" }, outputs: { MessageAdded: "MessageAdded", ClearChatRequested: "ClearChatRequested" }, decls: 18, vars: 10, consts: [["mjFillContainer", "", 1, "chat-wrapper"], ["class", "welcome-wrapper"], [1, "chat-messages", 3, "scroll"], ["messagesContainer", ""], ["class", "scroll-to-bottom fas fa-arrow-down"], [1, "chat-input-area"], ["type", "converging-spinner", "class", "loader"], [1, "text-area-wrapper"], [3, "ngModel", "disabled", "placeholder", "ngModelChange", "input", "keyup.enter"], ["theInput", ""], ["kendoButton", "", 3, "disabled", "click"], ["title", "Clear Chat", 1, "fa-solid", "fa-trash-can"], ["title", "Send Message", 1, "fas", "fa-solid", "fa-arrow-up"], [1, "welcome-wrapper"], [1, "welcome-message"], [3, "src"], [1, "welcome-header-text"], [1, "welcome-suggested-questions"], [1, "welcome-suggested-questions-col"], ["class", "welcome-question"], [1, "welcome-question", 3, "click"], [1, "welcome-question-header"], [1, "scroll-to-bottom", "fas", "fa-arrow-down", 3, "click"], ["type", "converging-spinner", 1, "loader"], ["kendoButton", "", "themeColor", "primary", 3, "click"], ["kendoButton", "", 3, "click"]], template: function ChatComponent_Template(rf, ctx) { if (rf & 1) {
333
+ i0.ɵɵelementStart(0, "div", 0);
334
+ i0.ɵɵtemplate(1, ChatComponent_Conditional_1_Template, 12, 5, "div", 1);
335
+ i0.ɵɵelementStart(2, "div", 2, 3);
336
+ i0.ɵɵlistener("scroll", function ChatComponent_Template_div_scroll_2_listener() { return ctx.handleCheckScroll(); });
337
+ i0.ɵɵelementStart(4, "span");
338
+ i0.ɵɵtext(5);
339
+ i0.ɵɵelementEnd()();
340
+ i0.ɵɵtemplate(6, ChatComponent_Conditional_6_Template, 1, 0, "span", 4);
341
+ i0.ɵɵelementStart(7, "div", 5);
342
+ i0.ɵɵtemplate(8, ChatComponent_Conditional_8_Template, 1, 0, "kendo-loader", 6);
343
+ i0.ɵɵelementStart(9, "div", 7)(10, "textarea", 8, 9);
344
+ i0.ɵɵtwoWayListener("ngModelChange", function ChatComponent_Template_textarea_ngModelChange_10_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.currentMessage, $event) || (ctx.currentMessage = $event); return $event; });
345
+ i0.ɵɵlistener("input", function ChatComponent_Template_textarea_input_10_listener($event) { return ctx.handleInputChange($event); })("keyup.enter", function ChatComponent_Template_textarea_keyup_enter_10_listener() { return ctx.SendCurrentMessage(); });
346
+ i0.ɵɵtext(12, " ");
347
+ i0.ɵɵelementEnd()();
348
+ i0.ɵɵelementStart(13, "button", 10);
349
+ i0.ɵɵlistener("click", function ChatComponent_Template_button_click_13_listener() { return ctx.showingClearAllDialog = true; });
350
+ i0.ɵɵelement(14, "span", 11);
351
+ i0.ɵɵelementEnd();
352
+ i0.ɵɵelementStart(15, "button", 10);
353
+ i0.ɵɵlistener("click", function ChatComponent_Template_button_click_15_listener() { return ctx.SendCurrentMessage(); });
354
+ i0.ɵɵelement(16, "span", 12);
355
+ i0.ɵɵelementEnd()()();
356
+ i0.ɵɵtemplate(17, ChatComponent_Conditional_17_Template, 8, 1, "kendo-dialog");
357
+ } if (rf & 2) {
358
+ i0.ɵɵadvance();
359
+ i0.ɵɵconditional(1, ctx.Messages.length === 0 && !ctx.ShowWaitingIndicator ? 1 : -1);
360
+ i0.ɵɵadvance(4);
361
+ i0.ɵɵtextInterpolate(ctx.InitialMessage);
362
+ i0.ɵɵadvance();
363
+ i0.ɵɵconditional(6, ctx.ShowScrollToBottomButton ? 6 : -1);
364
+ i0.ɵɵadvance(2);
365
+ i0.ɵɵconditional(8, ctx.ShowWaitingIndicator ? 8 : -1);
366
+ i0.ɵɵadvance(2);
367
+ i0.ɵɵtwoWayProperty("ngModel", ctx.currentMessage);
368
+ i0.ɵɵproperty("disabled", ctx.ShowWaitingIndicator)("placeholder", ctx.Placeholder);
369
+ i0.ɵɵadvance(3);
370
+ i0.ɵɵproperty("disabled", ctx.Messages.length === 0 || ctx.ShowWaitingIndicator);
371
+ i0.ɵɵadvance(2);
372
+ i0.ɵɵproperty("disabled", !ctx.InternalAllowSend || ctx.currentMessage.length === 0 || ctx.ShowWaitingIndicator);
373
+ i0.ɵɵadvance(2);
374
+ i0.ɵɵconditional(17, ctx.showingClearAllDialog ? 17 : -1);
375
+ } }, dependencies: [i2.DefaultValueAccessor, i2.NgControlStatus, i2.NgModel, i3.FillContainer, i4.LoaderComponent, i5.ButtonComponent, i6.DialogComponent, i6.DialogActionsComponent], styles: [".loader[_ngcontent-%COMP%] {\n position: absolute;\n left: 0px;\n}\n\n.chat-wrapper[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n position: relative; \n\n}\n\n.chat-messages[_ngcontent-%COMP%] {\n overflow-y: auto; \n\n overflow-x: hidden; \n\n \n\n margin-bottom: 5px;\n\n margin-top: 2px; \n\n\n flex: 1;\n}\n\n\n\n.chat-messages[_ngcontent-%COMP%]::-webkit-scrollbar {\n width: 0;\n background: transparent; \n\n}\n\n\n\n.chat-messages[_ngcontent-%COMP%]:hover::-webkit-scrollbar {\n width: 12px; \n\n background-color: #f0f0f0; \n\n\n}\n\n\n\n.chat-messages[_ngcontent-%COMP%]:hover::-webkit-scrollbar-thumb {\n background-color: #888; \n\n opacity: 0.5; \n\n}\n\n\n\n.chat-messages[_ngcontent-%COMP%]:hover::-webkit-scrollbar-thumb {\n border-radius: 10px;\n}\n\n\n\n.chat-messages[_ngcontent-%COMP%]:hover::-webkit-scrollbar-thumb:hover {\n background: #555; \n\n}\n\n\n.chat-messages[_ngcontent-%COMP%] {\n scrollbar-width: thin; \n\n scrollbar-color: #888 #f0f0f0; \n\n}\n \n\n\n\n.chat-input-area[_ngcontent-%COMP%] {\n background: #fff;\n display: flex;\n justify-content: center;\n align-items: center;\n padding-top: 12px;\n min-height: 35px;\n margin-bottom: 15px;\n}\n.chat-input-area[_ngcontent-%COMP%] > button[_ngcontent-%COMP%] {\n vertical-align: top;\n width: 30px;\n height: 30px;\n margin-top: 3px;\n border-radius: 12px;\n}\n.chat-input-area[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]:first-of-type {\n margin-left: -40px;\n}\n.chat-input-area[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]:last-child {\n margin-left: -65px;\n}\n\n.text-area-wrapper[_ngcontent-%COMP%] {\n padding: 3px;\n border: solid 1px rgba(0, 0, 0, 0.08) ;\n border-radius: 15px;\n\n margin-top: 4px;\n margin-right: -1px;\n min-height: 42px;\n max-height: 100%; \n\n\n overflow: hidden; \n align-items: center;\n\n \n\n max-width: 710px; \n width: 75%; \n\n padding-right: 90px; \n\n} \n.text-area-wrapper[_ngcontent-%COMP%] > textarea[_ngcontent-%COMP%] {\n border: 0;\n outline: 0;\n resize: none;\n\n min-height: 20px; \n\n\n width: 100%;\n overflow-y: hidden; \n\n\n font-family: S\u00F6hne, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, Ubuntu, Cantarell, \"Noto Sans\", sans-serif, \"Helvetica Neue\", Arial, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n font-size: 1rem;\n\n margin-left: 7px;\n margin-top: 7px;\n margin-bottom: 5px;\n}\n\n.text-area-wrapper[_ngcontent-%COMP%] > textarea[_ngcontent-%COMP%]:disabled {\n background-color: white;\n}\n\n\n .chat-message-wrap {\n display: flex;\n align-items: flex-start; \n\n margin-bottom: 10px;\n margin-right: 10px;\n}\n\n .chat-message-image {\n margin-top: 12px;\n font-size: 24px; \n\n margin-right: 10px; \n\n width: 50px;\n flex-shrink: 0; \n \n}\n\n\n\n .chat-message {\n padding-left: 7px;\n padding-right: 7px;\n margin-bottom: 10px;\n border-radius: 5px;\n background-color: rgb(255, 255, 240);\n box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n word-wrap: break-word;\n}\n\n .chat-message-ai {\n background-color: rgb(230, 246, 253);\n}\n\n.scroll-to-bottom[_ngcontent-%COMP%] {\n position: absolute; \n\n left: 50%; \n\n transform: translateX(-50%); \n\n bottom: 100px; \n\n z-index: 1000; \n\n border-radius: 50%;\n width: 35px;\n height: 35px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 22px;\n background-color: #f8f8f8;\n box-shadow: 0px 0px 5px rgba(0,0,0,0.3); \n\n cursor: pointer;\n}\n\n\n\n\n\n.welcome-wrapper[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n height: 100%;\n width: 100%;\n overflow: hidden;\n}\n\n.welcome-message[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n overflow: hidden;\n height: 100%;\n}\n\n\n.welcome-message[_ngcontent-%COMP%] img[_ngcontent-%COMP%] {\n width: 120px;\n height: 50px;\n margin-bottom: 20px; \n\n}\n\n.welcome-header-text[_ngcontent-%COMP%] {\n font-size: larger;\n font-weight: bold;\n}\n\n\n\n.welcome-suggested-questions[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-content: center;\n}\n.welcome-suggested-questions-col[_ngcontent-%COMP%] {\n display: flex;\n}\n\n\n\n.welcome-question[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column; \n\n align-items: left;;\n width: 300px; \n justify-content: space-between;\n margin: 5px; \n\n border: solid 1px rgba(41, 28, 28, 0.08);\n border-radius: 15px;\n padding: 10px;\n cursor: pointer;\n}\n\n.welcome-question[_ngcontent-%COMP%]:hover {\n background-color: rgba(0, 0, 0, 0.05);\n}\n\n\n.welcome-question-header[_ngcontent-%COMP%] {\n font-size: 12pt;\n font-weight: bold;\n display: block; \n\n}\n\n\n\n.welcome-question[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:not(.welcome-question-header) {\n font-weight: normal;\n font-size: 10pt;\n}"] });
376
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ChatComponent, [{
377
+ type: Component,
378
+ args: [{ selector: 'mj-chat', template: "<div mjFillContainer class=\"chat-wrapper\">\n @if(Messages.length === 0 && !ShowWaitingIndicator) {\n <div class=\"welcome-wrapper\">\n <div class='welcome-message'>\n @if(AILargeImageURL) {\n <img [src]=\"AILargeImageURL\"/>\n }\n <div class=\"welcome-header-text\">What can I help with today?</div>\n </div>\n <div class='welcome-suggested-questions'>\n <div class=\"welcome-suggested-questions-col\">\n @if (WelcomeQuestions.length > 0) {\n <div class=\"welcome-question\" (click)=\"SendUserMessage(WelcomeQuestions[0].prompt)\">\n <span class=\"welcome-question-header\">{{WelcomeQuestions[0].topLine}}</span>\n <span>{{WelcomeQuestions[0].bottomLine}}</span>\n </div>\n }\n @if (WelcomeQuestions.length > 1) {\n <div class=\"welcome-question\" (click)=\"SendUserMessage(WelcomeQuestions[1].prompt)\">\n <span class=\"welcome-question-header\">{{WelcomeQuestions[1].topLine}}</span>\n <span>{{WelcomeQuestions[1].bottomLine}}</span>\n </div> \n }\n </div>\n <div class=\"welcome-suggested-questions-col\">\n @if (WelcomeQuestions.length > 2) {\n <div class=\"welcome-question\" (click)=\"SendUserMessage(WelcomeQuestions[2].prompt)\">\n <span class=\"welcome-question-header\">{{WelcomeQuestions[2].topLine}}</span>\n <span>{{WelcomeQuestions[2].bottomLine}}</span>\n </div> \n }\n @if (WelcomeQuestions.length > 3) {\n <div class=\"welcome-question\" (click)=\"SendUserMessage(WelcomeQuestions[3].prompt)\">\n <span class=\"welcome-question-header\">{{WelcomeQuestions[3].topLine}}</span>\n <span>{{WelcomeQuestions[3].bottomLine}}</span>\n </div> \n }\n </div>\n </div>\n </div> \n }\n\n <div class=\"chat-messages\" \n #messagesContainer \n (scroll)=\"handleCheckScroll()\">\n <!-- messages go here -->\n <span>{{InitialMessage}}</span>\n </div>\n @if (ShowScrollToBottomButton) {\n <span class=\"scroll-to-bottom fas fa-arrow-down\" (click)=\"ScrollMessagesToBottom()\"></span>\n }\n\n <div class = \"chat-input-area\">\n @if (ShowWaitingIndicator) {\n <kendo-loader type=\"converging-spinner\" class=\"loader\"></kendo-loader>\n }\n <div class=\"text-area-wrapper\">\n <textarea #theInput \n [(ngModel)]=\"currentMessage\" \n [disabled]=\"ShowWaitingIndicator\" \n [placeholder]=\"Placeholder\" \n (input)=\"handleInputChange($event)\"\n (keyup.enter)=\"SendCurrentMessage()\" >\n </textarea>\n </div>\n <button kendoButton \n [disabled]=\"Messages.length === 0 || ShowWaitingIndicator\"\n (click)=\"showingClearAllDialog = true\">\n <span class=\"fa-solid fa-trash-can\" title=\"Clear Chat\">\n </span>\n </button>\n <button kendoButton\n [disabled]=\"!InternalAllowSend || currentMessage.length === 0 || ShowWaitingIndicator\" \n (click)=\"SendCurrentMessage()\">\n <span class=\"fas fa-solid fa-arrow-up\" title=\"Send Message\"></span>\n </button>\n </div>\n</div>\n@if (showingClearAllDialog) {\n <kendo-dialog>\n <p>{{ClearAllMessagesPrompt}}</p>\n <kendo-dialog-actions>\n <button kendoButton (click)=\"HandleClearChat()\" themeColor=\"primary\">Yes</button>\n <button kendoButton (click)=\"showingClearAllDialog = false\">No</button>\n </kendo-dialog-actions>\n </kendo-dialog>\n}\n", styles: [".loader {\n position: absolute;\n left: 0px;\n}\n\n.chat-wrapper {\n display: flex;\n flex-direction: column;\n position: relative; /* Add this line if the wrapper needs to be a reference point */\n}\n\n.chat-messages {\n overflow-y: auto; /* enable scrolling if the content overflows */\n overflow-x: hidden; /* hide horizontal scrollbar */\n /* border: solid 1px rgba(0, 0, 0, 0.08); */\n margin-bottom: 5px;\n\n margin-top: 2px; /* align it with the top of converation history exactly*/\n\n flex: 1;\n}\n\n/* Hide scrollbar for Chrome, Safari and Opera */\n.chat-messages::-webkit-scrollbar {\n width: 0;\n background: transparent; /* Optional: just make scrollbar invisible */\n}\n\n/* Optional: Show scrollbar on hover */\n.chat-messages:hover::-webkit-scrollbar {\n width: 12px; /* Adjust the width of the scrollbar here */\n background-color: #f0f0f0; /* Adjust the background color of the scrollbar here */\n\n}\n\n/* Handle on hover */\n.chat-messages:hover::-webkit-scrollbar-thumb {\n background-color: #888; /* Adjust the color of the scrollbar handle here */\n opacity: 0.5; /* Adjust the opacity of the scrollbar handle here */\n}\n\n/* Handle rounded corners */\n.chat-messages:hover::-webkit-scrollbar-thumb {\n border-radius: 10px;\n}\n\n/* Optional: handle's hover effect */\n.chat-messages:hover::-webkit-scrollbar-thumb:hover {\n background: #555; /* Adjust hover color here */\n}\n/* Works on Firefox */\n.chat-messages {\n scrollbar-width: thin; /* \"auto\" or \"thin\" */\n scrollbar-color: #888 #f0f0f0; /* thumb and track color */\n}\n \n\n\n\n.chat-input-area {\n background: #fff;\n display: flex;\n justify-content: center;\n align-items: center;\n padding-top: 12px;\n min-height: 35px;\n margin-bottom: 15px;\n}\n.chat-input-area > button {\n vertical-align: top;\n width: 30px;\n height: 30px;\n margin-top: 3px;\n border-radius: 12px;\n}\n.chat-input-area > button:first-of-type {\n margin-left: -40px;\n}\n.chat-input-area > button:last-child {\n margin-left: -65px;\n}\n\n.text-area-wrapper {\n padding: 3px;\n border: solid 1px rgba(0, 0, 0, 0.08) ;\n border-radius: 15px;\n\n margin-top: 4px;\n margin-right: -1px;\n min-height: 42px;\n max-height: 100%; /* Prevent it from growing beyond the container */\n\n overflow: hidden; \n align-items: center;\n\n /*combined width and padding is 800*/\n max-width: 710px; \n width: 75%; /*take up 75% but no more than 710px*/\n padding-right: 90px; /* Space for the buttons */\n} \n.text-area-wrapper > textarea {\n border: 0;\n outline: 0;\n resize: none;\n\n min-height: 20px; /* Initial height */\n\n width: 100%;\n overflow-y: hidden; /* Hide scrollbar */\n\n font-family: S\u00F6hne, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, Ubuntu, Cantarell, \"Noto Sans\", sans-serif, \"Helvetica Neue\", Arial, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n font-size: 1rem;\n\n margin-left: 7px;\n margin-top: 7px;\n margin-bottom: 5px;\n}\n\n.text-area-wrapper > textarea:disabled {\n background-color: white;\n}\n\n\n::ng-deep .chat-message-wrap {\n display: flex;\n align-items: flex-start; /* Align items to the top */\n margin-bottom: 10px;\n margin-right: 10px;\n}\n\n::ng-deep .chat-message-image {\n margin-top: 12px;\n font-size: 24px; /* Adjust size as necessary */\n margin-right: 10px; /* Space between the icon and the message text */\n width: 50px;\n flex-shrink: 0; /* Prevents the icon from shrinking */ \n}\n\n/* Styling for dynamic markdown content and message differentiation */\n::ng-deep .chat-message {\n padding-left: 7px;\n padding-right: 7px;\n margin-bottom: 10px;\n border-radius: 5px;\n background-color: rgb(255, 255, 240);\n box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n word-wrap: break-word;\n}\n\n::ng-deep .chat-message-ai {\n background-color: rgb(230, 246, 253);\n}\n\n.scroll-to-bottom {\n position: absolute; /* Or absolute, depending on your layout specifics */\n left: 50%; /* Start from the middle of the container */\n transform: translateX(-50%); /* Move it back by half of its own width to truly center it */\n bottom: 100px; /* Adjust based on the height of your input area */\n z-index: 1000; /* Make sure it's above all other content */\n border-radius: 50%;\n width: 35px;\n height: 35px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 22px;\n background-color: #f8f8f8;\n box-shadow: 0px 0px 5px rgba(0,0,0,0.3); /* Optional: Adds a subtle shadow for better visibility */\n cursor: pointer;\n}\n\n\n\n/* Center the welcome message vertically and horizontally */\n.welcome-wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n height: 100%;\n width: 100%;\n overflow: hidden;\n}\n\n.welcome-message {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n overflow: hidden;\n height: 100%;\n}\n\n\n.welcome-message img {\n width: 120px;\n height: 50px;\n margin-bottom: 20px; /* Adds some space between the image and the text below */\n}\n\n.welcome-header-text {\n font-size: larger;\n font-weight: bold;\n}\n\n/* Position the welcome-suggested-questions at the bottom of its container */\n.welcome-suggested-questions {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-content: center;\n}\n.welcome-suggested-questions-col {\n display: flex;\n}\n\n/* Flex layout for questions, two per row */\n.welcome-question {\n display: flex;\n flex-direction: column; /* Stack the header and text vertically */\n align-items: left;;\n width: 300px; \n justify-content: space-between;\n margin: 5px; /* Adds some space around each question */\n border: solid 1px rgba(41, 28, 28, 0.08);\n border-radius: 15px;\n padding: 10px;\n cursor: pointer;\n}\n\n.welcome-question:hover {\n background-color: rgba(0, 0, 0, 0.05);\n}\n\n\n.welcome-question-header {\n font-size: 12pt;\n font-weight: bold;\n display: block; /* Ensures the header is on its own line */\n}\n\n/* Non-bold text for the content below the header */\n.welcome-question span:not(.welcome-question-header) {\n font-weight: normal;\n font-size: 10pt;\n}\n"] }]
379
+ }], () => [{ type: i1.MarkdownService }, { type: i0.ChangeDetectorRef }], { InitialMessage: [{
380
+ type: Input
381
+ }], Messages: [{
382
+ type: Input
383
+ }], AIImageURL: [{
384
+ type: Input
385
+ }], AILargeImageURL: [{
386
+ type: Input
387
+ }], WelcomeQuestions: [{
388
+ type: Input
389
+ }], ClearAllMessagesPrompt: [{
390
+ type: Input
391
+ }], AllowSend: [{
392
+ type: Input
393
+ }], Placeholder: [{
394
+ type: Input
395
+ }], ShowWaitingIndicator: [{
396
+ type: Input
397
+ }], MessageAdded: [{
398
+ type: Output
399
+ }], ClearChatRequested: [{
400
+ type: Output
401
+ }], messagesContainer: [{
402
+ type: ViewChild,
403
+ args: ['messagesContainer', { static: true }]
404
+ }], theInput: [{
405
+ type: ViewChild,
406
+ args: ['theInput']
407
+ }] }); })();
408
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ChatComponent, { className: "ChatComponent", filePath: "src/lib/chat/chat.component.ts", lineNumber: 30 }); })();
@@ -0,0 +1,14 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./chat/chat.component";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "@angular/forms";
5
+ import * as i4 from "@memberjunction/ng-container-directives";
6
+ import * as i5 from "@progress/kendo-angular-indicators";
7
+ import * as i6 from "@progress/kendo-angular-buttons";
8
+ import * as i7 from "@progress/kendo-angular-dialog";
9
+ import * as i8 from "ngx-markdown";
10
+ export declare class ChatModule {
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatModule, never>;
12
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ChatModule, [typeof i1.ChatComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i4.ContainerDirectivesModule, typeof i5.IndicatorsModule, typeof i6.ButtonsModule, typeof i7.DialogModule, typeof i8.MarkdownModule], [typeof i1.ChatComponent]>;
13
+ static ɵinj: i0.ɵɵInjectorDeclaration<ChatModule>;
14
+ }
@@ -0,0 +1,50 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { FormsModule } from '@angular/forms';
4
+ // Markdown
5
+ import { MarkdownModule } from 'ngx-markdown';
6
+ // LOCAL
7
+ import { ChatComponent } from './chat/chat.component';
8
+ import { ContainerDirectivesModule } from '@memberjunction/ng-container-directives';
9
+ import { IndicatorsModule } from '@progress/kendo-angular-indicators';
10
+ import { ButtonsModule } from '@progress/kendo-angular-buttons';
11
+ import { DialogModule } from '@progress/kendo-angular-dialog';
12
+ import * as i0 from "@angular/core";
13
+ import * as i1 from "ngx-markdown";
14
+ export class ChatModule {
15
+ }
16
+ ChatModule.ɵfac = function ChatModule_Factory(t) { return new (t || ChatModule)(); };
17
+ ChatModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: ChatModule });
18
+ ChatModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
19
+ FormsModule,
20
+ ContainerDirectivesModule,
21
+ IndicatorsModule,
22
+ ButtonsModule,
23
+ DialogModule,
24
+ MarkdownModule.forRoot()] });
25
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ChatModule, [{
26
+ type: NgModule,
27
+ args: [{
28
+ declarations: [
29
+ ChatComponent
30
+ ],
31
+ imports: [
32
+ CommonModule,
33
+ FormsModule,
34
+ ContainerDirectivesModule,
35
+ IndicatorsModule,
36
+ ButtonsModule,
37
+ DialogModule,
38
+ MarkdownModule.forRoot()
39
+ ],
40
+ exports: [
41
+ ChatComponent
42
+ ]
43
+ }]
44
+ }], null, null); })();
45
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(ChatModule, { declarations: [ChatComponent], imports: [CommonModule,
46
+ FormsModule,
47
+ ContainerDirectivesModule,
48
+ IndicatorsModule,
49
+ ButtonsModule,
50
+ DialogModule, i1.MarkdownModule], exports: [ChatComponent] }); })();
@@ -0,0 +1,2 @@
1
+ export * from './lib/chat/chat.component';
2
+ export * from './lib/module';
@@ -0,0 +1,5 @@
1
+ /*
2
+ * Public API Surface
3
+ */
4
+ export * from './lib/chat/chat.component';
5
+ export * from './lib/module';
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@memberjunction/ng-chat",
3
+ "version": "1.1.0",
4
+ "description": "MemberJunction: Reusable Chat Component - can be used for AI or peer to peer chat applications.",
5
+ "main": "./dist/public-api.js",
6
+ "typings": "./dist/public-api.d.ts",
7
+ "files": [
8
+ "/dist"
9
+ ],
10
+ "scripts": {
11
+ "test": "echo \"Error: no test specified\" && exit 1",
12
+ "build": "ngc"
13
+ },
14
+ "keywords": [],
15
+ "author": "",
16
+ "license": "ISC",
17
+ "devDependencies": {
18
+ "@angular/compiler": "~17.2.2",
19
+ "@angular/compiler-cli": "~17.2.2"
20
+ },
21
+ "peerDependencies": {
22
+ "@angular/common": "~17.2.2",
23
+ "@angular/core": "~17.2.2",
24
+ "@angular/forms": "~17.2.2"
25
+ },
26
+ "dependencies": {
27
+ "@memberjunction/codegen-lib": "1.2.0",
28
+ "@memberjunction/ng-container-directives": "1.2.0",
29
+ "@progress/kendo-angular-indicators": "~15.1.0",
30
+ "@progress/kendo-angular-buttons": "~15.1.0",
31
+ "@progress/kendo-angular-dialog": "~15.1.0",
32
+ "tslib": "^2.3.0",
33
+ "ngx-markdown": "^17.1.1"
34
+ },
35
+ "sideEffects": false
36
+ }