@mckit/chat 20.0.3 → 20.0.4

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.
@@ -4,14 +4,15 @@ import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i2 from 'primeng/image';
6
6
  import { ImageModule } from 'primeng/image';
7
- import * as i2$1 from '@angular/forms';
8
- import { FormsModule } from '@angular/forms';
9
- import * as i3 from 'primeng/avatar';
10
- import { AvatarModule } from 'primeng/avatar';
11
- import * as i4 from 'primeng/button';
7
+ import { Subject } from 'rxjs';
8
+ import * as i1$1 from '@angular/forms';
9
+ import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
10
+ import * as i2$1 from 'primeng/button';
12
11
  import { ButtonModule } from 'primeng/button';
13
- import * as i5 from 'primeng/inputtext';
12
+ import * as i3 from 'primeng/inputtext';
14
13
  import { InputTextModule } from 'primeng/inputtext';
14
+ import * as i1$2 from 'primeng/avatar';
15
+ import { AvatarModule } from 'primeng/avatar';
15
16
 
16
17
  var MCMessageChatType;
17
18
  (function (MCMessageChatType) {
@@ -21,6 +22,7 @@ var MCMessageChatType;
21
22
  MCMessageChatType["AUDIO"] = "audio";
22
23
  MCMessageChatType["FILE"] = "file";
23
24
  MCMessageChatType["EMPTY"] = "empty";
25
+ MCMessageChatType["THINKING"] = "thinking";
24
26
  })(MCMessageChatType || (MCMessageChatType = {}));
25
27
  var MCMessageChatSide;
26
28
  (function (MCMessageChatSide) {
@@ -38,6 +40,25 @@ class MCMessageChat {
38
40
  class MCConversation {
39
41
  id;
40
42
  messages = [];
43
+ user;
44
+ }
45
+
46
+ var MCEventChatType;
47
+ (function (MCEventChatType) {
48
+ MCEventChatType["TYPING"] = "typing";
49
+ MCEventChatType["SEND_MESSAGE"] = "send_message";
50
+ })(MCEventChatType || (MCEventChatType = {}));
51
+ class MCEventChat {
52
+ type;
53
+ data;
54
+ }
55
+
56
+ class MCUserChat {
57
+ id;
58
+ firstname;
59
+ lastname;
60
+ photo;
61
+ online;
41
62
  }
42
63
 
43
64
  class MCBaseMessageComponent {
@@ -107,8 +128,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
107
128
  args: [{ selector: 'mc-chat-empty', imports: [CommonModule], template: "<div class=\"flex flex-col items-center justify-center h-full text-gray-500 dark:text-gray-400\">\n <div class=\"w-16 h-16 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center mb-4\">\n <i class=\"pi pi-comments text-3xl\"></i>\n </div>\n <p class=\"text-lg font-medium\">No messages yet</p>\n <p class=\"text-sm\">Start the conversation by sending a message.</p>\n</div>" }]
108
129
  }] });
109
130
 
131
+ class MCThinkingComponent extends MCBaseMessageComponent {
132
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MCThinkingComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
133
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.4", type: MCThinkingComponent, isStandalone: true, selector: "mc-chat-thinking", usesInheritance: true, ngImport: i0, template: "<div class=\"flex items-center space-x-1 bg-gray-100 dark:bg-gray-800 rounded-lg p-3 w-fit\">\n <div class=\"w-2 h-2 bg-gray-400 rounded-full animate-bounce [animation-delay:-0.3s]\"></div>\n <div class=\"w-2 h-2 bg-gray-400 rounded-full animate-bounce [animation-delay:-0.15s]\"></div>\n <div class=\"w-2 h-2 bg-gray-400 rounded-full animate-bounce\"></div>\n</div>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
134
+ }
135
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MCThinkingComponent, decorators: [{
136
+ type: Component,
137
+ args: [{ selector: 'mc-chat-thinking', imports: [CommonModule], template: "<div class=\"flex items-center space-x-1 bg-gray-100 dark:bg-gray-800 rounded-lg p-3 w-fit\">\n <div class=\"w-2 h-2 bg-gray-400 rounded-full animate-bounce [animation-delay:-0.3s]\"></div>\n <div class=\"w-2 h-2 bg-gray-400 rounded-full animate-bounce [animation-delay:-0.15s]\"></div>\n <div class=\"w-2 h-2 bg-gray-400 rounded-full animate-bounce\"></div>\n</div>" }]
138
+ }] });
139
+
110
140
  class MCChatService {
111
141
  registry = new Map();
142
+ eventSubject = new Subject();
112
143
  constructor() {
113
144
  this.register(MCMessageChatType.TEXT, MCMessageTextComponent);
114
145
  this.register(MCMessageChatType.IMAGE, MCMessageImageComponent);
@@ -116,6 +147,7 @@ class MCChatService {
116
147
  this.register(MCMessageChatType.AUDIO, MCMessageAudioComponent);
117
148
  this.register(MCMessageChatType.FILE, MCMessageFileComponent);
118
149
  this.register(MCMessageChatType.EMPTY, MCChatEmptyComponent);
150
+ this.register(MCMessageChatType.THINKING, MCThinkingComponent);
119
151
  }
120
152
  register(type, component) {
121
153
  this.registry.set(type, component);
@@ -123,6 +155,12 @@ class MCChatService {
123
155
  getComponent(type) {
124
156
  return this.registry.get(type);
125
157
  }
158
+ sendEvent(event) {
159
+ this.eventSubject.next(event);
160
+ }
161
+ onEvent() {
162
+ return this.eventSubject.asObservable();
163
+ }
126
164
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MCChatService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
127
165
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MCChatService, providedIn: 'root' });
128
166
  }
@@ -133,6 +171,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
133
171
  }]
134
172
  }], ctorParameters: () => [] });
135
173
 
174
+ class MCWritingComponent {
175
+ input = new FormControl('', { nonNullable: true });
176
+ chatService = inject(MCChatService);
177
+ onClickSend() {
178
+ if (!this.input.value.trim())
179
+ return;
180
+ this.chatService.sendEvent({
181
+ type: MCEventChatType.SEND_MESSAGE,
182
+ data: this.input.value
183
+ });
184
+ this.input.reset();
185
+ }
186
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MCWritingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
187
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.4", type: MCWritingComponent, isStandalone: true, selector: "mc-writing-conversation", ngImport: i0, template: "<div class=\"p-4 bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700\">\n <div class=\"flex gap-2\">\n <input pInputText type=\"text\" class=\"flex-1 w-full\" placeholder=\"Type a message...\" [formControl]=\"input\"\n (keydown.enter)=\"onClickSend()\" />\n\n <p-button icon=\"pi pi-send\" (onClick)=\"onClickSend()\" styleClass=\"p-button-rounded p-button-primary\">\n </p-button>\n </div>\n</div>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i3.InputText, selector: "[pInputText]", inputs: ["pSize", "variant", "fluid", "invalid"] }] });
188
+ }
189
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MCWritingComponent, decorators: [{
190
+ type: Component,
191
+ args: [{ selector: 'mc-writing-conversation', imports: [CommonModule, FormsModule, ReactiveFormsModule, ButtonModule, InputTextModule], template: "<div class=\"p-4 bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700\">\n <div class=\"flex gap-2\">\n <input pInputText type=\"text\" class=\"flex-1 w-full\" placeholder=\"Type a message...\" [formControl]=\"input\"\n (keydown.enter)=\"onClickSend()\" />\n\n <p-button icon=\"pi pi-send\" (onClick)=\"onClickSend()\" styleClass=\"p-button-rounded p-button-primary\">\n </p-button>\n </div>\n</div>" }]
192
+ }] });
193
+
194
+ class MCUserHeaderChatComponent {
195
+ user = input.required(...(ngDevMode ? [{ debugName: "user" }] : []));
196
+ getInitials() {
197
+ const initials = ((this.user().firstname?.charAt(0) ?? '') + (this.user().lastname?.charAt(0) ?? '')).toUpperCase();
198
+ return initials ? initials : 'A1';
199
+ }
200
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MCUserHeaderChatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
201
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: MCUserHeaderChatComponent, isStandalone: true, selector: "mc-user-header-chat", inputs: { user: { classPropertyName: "user", publicName: "user", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex items-center p-4 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800\">\n @if (user().photo && user().photo != '' && user().photo != null) {\n <p-avatar [image]=\"user().photo\" shape=\"circle\" size=\"large\" class=\"mr-3\" />\n } @else {\n <p-avatar [label]=\"getInitials()\" shape=\"circle\" size=\"large\" class=\"mr-3\" />\n }\n <div>\n <h2 class=\"text-lg font-semibold text-gray-800 dark:text-white\">{{ user().firstname }} {{ user().lastname }}\n </h2>\n @if (user().online) {\n <p class=\"text-sm text-green-500 flex items-center\">\n <span class=\"w-2 h-2 rounded-full bg-green-500 mr-2\"></span>\n Online\n </p>\n }\n </div>\n</div>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AvatarModule }, { kind: "component", type: i1$2.Avatar, selector: "p-avatar", inputs: ["label", "icon", "image", "size", "shape", "styleClass", "ariaLabel", "ariaLabelledBy"], outputs: ["onImageError"] }] });
202
+ }
203
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MCUserHeaderChatComponent, decorators: [{
204
+ type: Component,
205
+ args: [{ selector: 'mc-user-header-chat', imports: [CommonModule, AvatarModule], template: "<div class=\"flex items-center p-4 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800\">\n @if (user().photo && user().photo != '' && user().photo != null) {\n <p-avatar [image]=\"user().photo\" shape=\"circle\" size=\"large\" class=\"mr-3\" />\n } @else {\n <p-avatar [label]=\"getInitials()\" shape=\"circle\" size=\"large\" class=\"mr-3\" />\n }\n <div>\n <h2 class=\"text-lg font-semibold text-gray-800 dark:text-white\">{{ user().firstname }} {{ user().lastname }}\n </h2>\n @if (user().online) {\n <p class=\"text-sm text-green-500 flex items-center\">\n <span class=\"w-2 h-2 rounded-full bg-green-500 mr-2\"></span>\n Online\n </p>\n }\n </div>\n</div>" }]
206
+ }] });
207
+
136
208
  class MCConversationComponent {
137
209
  conversation = input.required(...(ngDevMode ? [{ debugName: "conversation" }] : []));
138
210
  chatService = inject(MCChatService);
@@ -157,11 +229,11 @@ class MCConversationComponent {
157
229
  this.newMessage = '';
158
230
  }
159
231
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MCConversationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
160
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: MCConversationComponent, isStandalone: true, selector: "mc-conversation", inputs: { conversation: { classPropertyName: "conversation", publicName: "conversation", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"flex flex-col h-full bg-white dark:bg-gray-900 rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700\">\n <!-- Header -->\n <div class=\"flex items-center p-4 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800\">\n <p-avatar image=\"https://primefaces.org/cdn/primeng/images/demo/avatar/amyelsner.png\" shape=\"circle\"\n size=\"large\" styleClass=\"mr-3\">\n </p-avatar>\n <div>\n <h2 class=\"text-lg font-semibold text-gray-800 dark:text-white\">Amy Elsner</h2>\n <p class=\"text-sm text-green-500 flex items-center\">\n <span class=\"w-2 h-2 rounded-full bg-green-500 mr-2\"></span>\n Online\n </p>\n </div>\n </div>\n\n <!-- Messages Body -->\n <div class=\"flex-1 overflow-y-auto p-4 space-y-4 bg-gray-50 dark:bg-gray-900\">\n <!-- Message Item -->\n @for (msg of conversation().messages; track $index) {\n <div class=\"mb-3\">\n <ng-container *ngComponentOutlet=\"getComponent(msg.type); inputs: { message: msg }\"></ng-container>\n </div>\n }\n </div>\n\n <!-- Footer / Input Area -->\n <div class=\"p-4 bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700\">\n <div class=\"flex gap-2\">\n <input pInputText type=\"text\" class=\"flex-1 w-full\" placeholder=\"Type a message...\" [(ngModel)]=\"newMessage\"\n (keydown.enter)=\"sendMessage()\" />\n\n <p-button icon=\"pi pi-send\" (onClick)=\"sendMessage()\" styleClass=\"p-button-rounded p-button-primary\">\n </p-button>\n </div>\n </div>\n</div>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AvatarModule }, { kind: "component", type: i3.Avatar, selector: "p-avatar", inputs: ["label", "icon", "image", "size", "shape", "styleClass", "ariaLabel", "ariaLabelledBy"], outputs: ["onImageError"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i4.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i5.InputText, selector: "[pInputText]", inputs: ["pSize", "variant", "fluid", "invalid"] }] });
232
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: MCConversationComponent, isStandalone: true, selector: "mc-conversation", inputs: { conversation: { classPropertyName: "conversation", publicName: "conversation", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"flex flex-col h-full bg-white dark:bg-gray-900 rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700\">\n <!-- Header -->\n @if (conversation() && conversation()!.user) {\n <mc-user-header-chat [user]=\"conversation()!.user!\" />\n }\n\n <!-- Messages Body -->\n <div class=\"flex-1 overflow-y-auto p-4 space-y-4 bg-gray-50 dark:bg-gray-900\">\n <!-- Message Item -->\n @for (msg of conversation().messages; track $index) {\n <div class=\"mb-3\">\n <ng-container *ngComponentOutlet=\"getComponent(msg.type); inputs: { message: msg }\"></ng-container>\n </div>\n }\n </div>\n\n <!-- Footer / Input Area -->\n <mc-writing-conversation />\n\n</div>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "component", type: MCUserHeaderChatComponent, selector: "mc-user-header-chat", inputs: ["user"] }, { kind: "component", type: MCWritingComponent, selector: "mc-writing-conversation" }] });
161
233
  }
162
234
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MCConversationComponent, decorators: [{
163
235
  type: Component,
164
- args: [{ selector: 'mc-conversation', imports: [CommonModule, FormsModule, AvatarModule, ButtonModule, InputTextModule], template: "<div\n class=\"flex flex-col h-full bg-white dark:bg-gray-900 rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700\">\n <!-- Header -->\n <div class=\"flex items-center p-4 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800\">\n <p-avatar image=\"https://primefaces.org/cdn/primeng/images/demo/avatar/amyelsner.png\" shape=\"circle\"\n size=\"large\" styleClass=\"mr-3\">\n </p-avatar>\n <div>\n <h2 class=\"text-lg font-semibold text-gray-800 dark:text-white\">Amy Elsner</h2>\n <p class=\"text-sm text-green-500 flex items-center\">\n <span class=\"w-2 h-2 rounded-full bg-green-500 mr-2\"></span>\n Online\n </p>\n </div>\n </div>\n\n <!-- Messages Body -->\n <div class=\"flex-1 overflow-y-auto p-4 space-y-4 bg-gray-50 dark:bg-gray-900\">\n <!-- Message Item -->\n @for (msg of conversation().messages; track $index) {\n <div class=\"mb-3\">\n <ng-container *ngComponentOutlet=\"getComponent(msg.type); inputs: { message: msg }\"></ng-container>\n </div>\n }\n </div>\n\n <!-- Footer / Input Area -->\n <div class=\"p-4 bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700\">\n <div class=\"flex gap-2\">\n <input pInputText type=\"text\" class=\"flex-1 w-full\" placeholder=\"Type a message...\" [(ngModel)]=\"newMessage\"\n (keydown.enter)=\"sendMessage()\" />\n\n <p-button icon=\"pi pi-send\" (onClick)=\"sendMessage()\" styleClass=\"p-button-rounded p-button-primary\">\n </p-button>\n </div>\n </div>\n</div>" }]
236
+ args: [{ selector: 'mc-conversation', imports: [CommonModule, MCUserHeaderChatComponent, MCWritingComponent], template: "<div\n class=\"flex flex-col h-full bg-white dark:bg-gray-900 rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700\">\n <!-- Header -->\n @if (conversation() && conversation()!.user) {\n <mc-user-header-chat [user]=\"conversation()!.user!\" />\n }\n\n <!-- Messages Body -->\n <div class=\"flex-1 overflow-y-auto p-4 space-y-4 bg-gray-50 dark:bg-gray-900\">\n <!-- Message Item -->\n @for (msg of conversation().messages; track $index) {\n <div class=\"mb-3\">\n <ng-container *ngComponentOutlet=\"getComponent(msg.type); inputs: { message: msg }\"></ng-container>\n </div>\n }\n </div>\n\n <!-- Footer / Input Area -->\n <mc-writing-conversation />\n\n</div>" }]
165
237
  }] });
166
238
 
167
239
  /*
@@ -175,5 +247,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
175
247
  * Generated bundle index. Do not edit.
176
248
  */
177
249
 
178
- export { MCBaseMessageComponent, MCChatEmptyComponent, MCChatService, MCConversation, MCConversationComponent, MCMessageAudioComponent, MCMessageChat, MCMessageChatSide, MCMessageChatType, MCMessageFileComponent, MCMessageImageComponent, MCMessageTextComponent, MCMessageVideoComponent };
250
+ export { MCBaseMessageComponent, MCChatEmptyComponent, MCChatService, MCConversation, MCConversationComponent, MCEventChat, MCEventChatType, MCMessageAudioComponent, MCMessageChat, MCMessageChatSide, MCMessageChatType, MCMessageFileComponent, MCMessageImageComponent, MCMessageTextComponent, MCMessageVideoComponent, MCThinkingComponent, MCUserChat, MCUserHeaderChatComponent, MCWritingComponent };
179
251
  //# sourceMappingURL=mckit-chat.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mckit-chat.mjs","sources":["../../../../projects/mckit/chat/src/lib/entities/message.ts","../../../../projects/mckit/chat/src/lib/entities/conversation.ts","../../../../projects/mckit/chat/src/lib/messages/base-message.component.ts","../../../../projects/mckit/chat/src/lib/messages/text/text.component.ts","../../../../projects/mckit/chat/src/lib/messages/text/text.component.html","../../../../projects/mckit/chat/src/lib/messages/image/image.component.ts","../../../../projects/mckit/chat/src/lib/messages/image/image.component.html","../../../../projects/mckit/chat/src/lib/messages/video/video.component.ts","../../../../projects/mckit/chat/src/lib/messages/video/video.component.html","../../../../projects/mckit/chat/src/lib/messages/audio/audio.component.ts","../../../../projects/mckit/chat/src/lib/messages/audio/audio.component.html","../../../../projects/mckit/chat/src/lib/messages/file/file.component.ts","../../../../projects/mckit/chat/src/lib/messages/file/file.component.html","../../../../projects/mckit/chat/src/lib/messages/empty/empty.component.ts","../../../../projects/mckit/chat/src/lib/messages/empty/empty.component.html","../../../../projects/mckit/chat/src/lib/services/chat.service.ts","../../../../projects/mckit/chat/src/lib/components/conversation/conversation.component.ts","../../../../projects/mckit/chat/src/lib/components/conversation/conversation.component.html","../../../../projects/mckit/chat/src/public-api.ts","../../../../projects/mckit/chat/src/mckit-chat.ts"],"sourcesContent":["export enum MCMessageChatType {\n TEXT = 'text',\n IMAGE = 'image',\n VIDEO = 'video',\n AUDIO = 'audio',\n FILE = 'file',\n EMPTY = 'empty'\n}\n\nexport enum MCMessageChatSide {\n LEFT = 'left',\n RIGHT = 'right'\n}\n\nexport class MCMessageChat {\n id?: string | number;\n type!: string;\n side!: MCMessageChatSide;\n content?: any;\n createdAt?: string;\n}","import { MCMessageChat } from \"./message\";\n\nexport class MCConversation {\n id?: string;\n messages: MCMessageChat[] = [];\n}","import { Component, input } from '@angular/core';\nimport { MCMessageChat } from '../entities/message';\n\n@Component({\n selector: 'mc-base-message',\n template: ''\n})\nexport class MCBaseMessageComponent {\n message = input.required<MCMessageChat>();\n}\n","import { Component } from '@angular/core';\nimport { MCBaseMessageComponent } from '../base-message.component';\nimport { CommonModule } from '@angular/common';\n\n@Component({\n selector: 'mc-message-text',\n imports: [CommonModule],\n templateUrl: './text.component.html',\n styleUrl: './text.component.css'\n})\nexport class MCMessageTextComponent extends MCBaseMessageComponent {\n\n}\n","<div class=\"flex w-full\"\n [ngClass]=\"{'justify-end': message().side !== 'left', 'justify-start': message().side === 'left'}\">\n\n <div class=\"max-w-[70%] flex flex-col\"\n [ngClass]=\"{'items-end': message().side !== 'left', 'items-start': message().side === 'left'}\">\n\n <div class=\"p-3 rounded-lg shadow-sm\" [ngClass]=\"{\n 'bg-blue-600 text-white rounded-br-none': message().side !== 'left',\n 'bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-200 border border-gray-200 dark:border-gray-700 rounded-bl-none': message().id === '1'\n }\">\n <p class=\"text-sm\">{{ message().content }}</p>\n </div>\n <span class=\"text-xs text-gray-400 mt-1 px-1\">\n {{ message().createdAt | date:'shortTime' }}\n </span>\n </div>\n</div>","import { CommonModule } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { ImageModule } from 'primeng/image';\nimport { MCBaseMessageComponent } from '../base-message.component';\n\n@Component({\n selector: 'mc-message-image',\n imports: [CommonModule, ImageModule],\n templateUrl: './image.component.html',\n styleUrl: './image.component.css'\n})\nexport class MCMessageImageComponent extends MCBaseMessageComponent {\n\n}\n","<div class=\"flex w-full\"\n [ngClass]=\"{'justify-end': message().side !== 'left', 'justify-start': message().side === 'left'}\">\n\n <div class=\"max-w-[70%] flex flex-col\"\n [ngClass]=\"{'items-end': message().side !== 'left', 'items-start': message().side === 'left'}\">\n\n <div class=\"rounded-lg shadow-sm overflow-hidden\" [ngClass]=\"{\n 'rounded-br-none': message().side !== 'left',\n 'rounded-bl-none': message().side === 'left'\n }\">\n <p-image [src]=\"message().content\" [alt]=\"'Image'\" [preview]=\"true\" width=\"250\">\n </p-image>\n </div>\n <span class=\"text-xs text-gray-400 mt-1 px-1\">\n {{ message().createdAt | date:'shortTime' }}\n </span>\n </div>\n</div>","import { CommonModule } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { MCBaseMessageComponent } from '../base-message.component';\n\n@Component({\n selector: 'mc-message-video',\n imports: [CommonModule],\n templateUrl: './video.component.html',\n styleUrl: './video.component.css'\n})\nexport class MCMessageVideoComponent extends MCBaseMessageComponent {\n\n}\n","<div class=\"flex w-full\"\n [ngClass]=\"{'justify-end': message().side !== 'left', 'justify-start': message().side === 'left'}\">\n\n <div class=\"max-w-[70%] flex flex-col\"\n [ngClass]=\"{'items-end': message().side !== 'left', 'items-start': message().side === 'left'}\">\n\n <div class=\"rounded-lg shadow-sm overflow-hidden\" [ngClass]=\"{\n 'rounded-br-none': message().side !== 'left',\n 'rounded-bl-none': message().side === 'left'\n }\">\n <video [src]=\"message().content\" controls width=\"250\" class=\"block\">\n </video>\n </div>\n <span class=\"text-xs text-gray-400 mt-1 px-1\">\n {{ message().createdAt | date:'shortTime' }}\n </span>\n </div>\n</div>","import { CommonModule } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { MCBaseMessageComponent } from '../base-message.component';\n\n@Component({\n selector: 'mc-message-audio',\n imports: [CommonModule],\n templateUrl: './audio.component.html',\n styleUrl: './audio.component.css'\n})\nexport class MCMessageAudioComponent extends MCBaseMessageComponent {\n\n}\n","<div class=\"flex w-full\"\n [ngClass]=\"{'justify-end': message().side !== 'left', 'justify-start': message().side === 'left'}\">\n\n <div class=\"max-w-[70%] flex flex-col\"\n [ngClass]=\"{'items-end': message().side !== 'left', 'items-start': message().side === 'left'}\">\n\n <div class=\"rounded-lg shadow-sm overflow-hidden\" [ngClass]=\"{\n 'rounded-br-none': message().side !== 'left',\n 'rounded-bl-none': message().side === 'left'\n }\">\n <audio [src]=\"message().content\" controls class=\"block w-[250px]\">\n </audio>\n </div>\n <span class=\"text-xs text-gray-400 mt-1 px-1\">\n {{ message().createdAt | date:'shortTime' }}\n </span>\n </div>\n</div>","import { CommonModule } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { MCBaseMessageComponent } from '../base-message.component';\n\n@Component({\n selector: 'mc-message-file',\n imports: [CommonModule],\n templateUrl: './file.component.html',\n styleUrl: './file.component.css'\n})\nexport class MCMessageFileComponent extends MCBaseMessageComponent {\n\n}\n","<div class=\"flex w-full\"\n [ngClass]=\"{'justify-end': message().side !== 'left', 'justify-start': message().side === 'left'}\">\n\n <div class=\"max-w-[70%] flex flex-col\"\n [ngClass]=\"{'items-end': message().side !== 'left', 'items-start': message().side === 'left'}\">\n\n <div class=\"rounded-lg shadow-sm p-3 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 flex items-center gap-3\"\n [ngClass]=\"{\n 'rounded-br-none': message().side !== 'left',\n 'rounded-bl-none': message().side === 'left'\n }\">\n\n <div\n class=\"w-10 h-10 rounded bg-gray-100 dark:bg-gray-700 flex items-center justify-center text-gray-500 dark:text-gray-400\">\n <i class=\"pi pi-file text-xl\"></i>\n </div>\n\n <div class=\"flex flex-col overflow-hidden\">\n <span class=\"text-sm font-medium truncate text-gray-900 dark:text-gray-100 max-w-[150px]\">\n Attached File\n </span>\n <a [href]=\"message().content\" target=\"_blank\"\n class=\"text-xs text-blue-500 hover:text-blue-600 hover:underline flex items-center gap-1\">\n <span>Download</span>\n <i class=\"pi pi-external-link text-[10px]\"></i>\n </a>\n </div>\n </div>\n <span class=\"text-xs text-gray-400 mt-1 px-1\">\n {{ message().createdAt | date:'shortTime' }}\n </span>\n </div>\n</div>","import { CommonModule } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { MCBaseMessageComponent } from '../base-message.component';\n\n@Component({\n selector: 'mc-chat-empty',\n imports: [CommonModule],\n templateUrl: './empty.component.html',\n styleUrl: './empty.component.css'\n})\nexport class MCChatEmptyComponent extends MCBaseMessageComponent {\n\n}\n","<div class=\"flex flex-col items-center justify-center h-full text-gray-500 dark:text-gray-400\">\n <div class=\"w-16 h-16 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center mb-4\">\n <i class=\"pi pi-comments text-3xl\"></i>\n </div>\n <p class=\"text-lg font-medium\">No messages yet</p>\n <p class=\"text-sm\">Start the conversation by sending a message.</p>\n</div>","import { Injectable, Type } from '@angular/core';\nimport { MCBaseMessageComponent } from '../messages/base-message.component';\nimport { MCMessageChatType } from '../entities/message';\nimport { MCMessageTextComponent } from '../messages/text/text.component';\nimport { MCMessageImageComponent } from '../messages/image/image.component';\nimport { MCMessageVideoComponent } from '../messages/video/video.component';\nimport { MCMessageAudioComponent } from '../messages/audio/audio.component';\nimport { MCMessageFileComponent } from '../messages/file/file.component';\nimport { MCChatEmptyComponent } from '../../public-api';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class MCChatService {\n\n private registry = new Map<string, Type<MCBaseMessageComponent>>();\n\n constructor() {\n this.register(MCMessageChatType.TEXT, MCMessageTextComponent);\n this.register(MCMessageChatType.IMAGE, MCMessageImageComponent);\n this.register(MCMessageChatType.VIDEO, MCMessageVideoComponent);\n this.register(MCMessageChatType.AUDIO, MCMessageAudioComponent);\n this.register(MCMessageChatType.FILE, MCMessageFileComponent);\n this.register(MCMessageChatType.EMPTY, MCChatEmptyComponent);\n }\n\n register(type: string, component: Type<MCBaseMessageComponent>) {\n this.registry.set(type, component);\n }\n\n getComponent(type: string): Type<MCBaseMessageComponent> | undefined {\n return this.registry.get(type);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { Component, inject, input, Type } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { AvatarModule } from 'primeng/avatar';\nimport { ButtonModule } from 'primeng/button';\nimport { InputTextModule } from 'primeng/inputtext';\nimport { MCMessageChat, MCMessageChatSide, MCMessageChatType } from '../../entities/message';\nimport { MCChatService } from '../../services/chat.service';\nimport { MCBaseMessageComponent } from '../../messages/base-message.component';\nimport { MCConversation } from '../../entities/conversation';\n\n@Component({\n selector: 'mc-conversation',\n imports: [CommonModule, FormsModule, AvatarModule, ButtonModule, InputTextModule],\n templateUrl: './conversation.component.html',\n styleUrl: './conversation.component.css'\n})\nexport class MCConversationComponent {\n\n conversation = input.required<MCConversation>();\n\n chatService = inject(MCChatService);\n\n newMessage: string = '';\n\n // Let's pretend we have a currentUserId = 1.\n currentUserId = 1;\n\n getComponent(type: string): Type<MCBaseMessageComponent> {\n return this.chatService.getComponent(type) ?? MCBaseMessageComponent;\n }\n\n sendMessage() {\n if (!this.newMessage.trim()) return;\n\n const message: MCMessageChat = {\n id: Date.now().toString(),\n type: MCMessageChatType.TEXT,\n content: this.newMessage,\n createdAt: new Date().toISOString(),\n side: MCMessageChatSide.RIGHT,\n };\n\n // Ideally we would push to a service, but for now just local array\n this.conversation().messages.push(message);\n this.newMessage = '';\n }\n}\n","<div\n class=\"flex flex-col h-full bg-white dark:bg-gray-900 rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700\">\n <!-- Header -->\n <div class=\"flex items-center p-4 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800\">\n <p-avatar image=\"https://primefaces.org/cdn/primeng/images/demo/avatar/amyelsner.png\" shape=\"circle\"\n size=\"large\" styleClass=\"mr-3\">\n </p-avatar>\n <div>\n <h2 class=\"text-lg font-semibold text-gray-800 dark:text-white\">Amy Elsner</h2>\n <p class=\"text-sm text-green-500 flex items-center\">\n <span class=\"w-2 h-2 rounded-full bg-green-500 mr-2\"></span>\n Online\n </p>\n </div>\n </div>\n\n <!-- Messages Body -->\n <div class=\"flex-1 overflow-y-auto p-4 space-y-4 bg-gray-50 dark:bg-gray-900\">\n <!-- Message Item -->\n @for (msg of conversation().messages; track $index) {\n <div class=\"mb-3\">\n <ng-container *ngComponentOutlet=\"getComponent(msg.type); inputs: { message: msg }\"></ng-container>\n </div>\n }\n </div>\n\n <!-- Footer / Input Area -->\n <div class=\"p-4 bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700\">\n <div class=\"flex gap-2\">\n <input pInputText type=\"text\" class=\"flex-1 w-full\" placeholder=\"Type a message...\" [(ngModel)]=\"newMessage\"\n (keydown.enter)=\"sendMessage()\" />\n\n <p-button icon=\"pi pi-send\" (onClick)=\"sendMessage()\" styleClass=\"p-button-rounded p-button-primary\">\n </p-button>\n </div>\n </div>\n</div>","/*\n * Public API Surface of chat\n */\n\n/**\n * Entities\n */\nexport * from './lib/entities/message';\nexport * from './lib/entities/conversation';\n\n/**\n * Messages\n */\nexport * from './lib/messages/base-message.component';\nexport * from './lib/messages/text/text.component';\nexport * from './lib/messages/image/image.component';\nexport * from './lib/messages/video/video.component';\nexport * from './lib/messages/audio/audio.component';\nexport * from './lib/messages/file/file.component';\nexport * from './lib/messages/empty/empty.component';\n\n/**\n * Components\n */\nexport * from './lib/components/conversation/conversation.component';\n\n/**\n * Services\n */\nexport * from './lib/services/chat.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2"],"mappings":";;;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,iBAAiB,EAAA;AACzB,IAAA,iBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,iBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACnB,CAAC,EAPW,iBAAiB,KAAjB,iBAAiB,GAAA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A,aAAA,EAAA,WAAA,EAAA,OAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,EAAA,SAAA,EAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,eAAe,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,EAAA,OAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAIrE,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBANnC,SAAS;+BACE,iBAAiB,EAAA,OAAA,EAClB,CAAC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,CAAC,EAAA,QAAA,EAAA,yrDAAA,EAAA;;;AEbnF;;AAEG;AAEH;;AAEG;;ACNH;;AAEG;;;;"}
1
+ {"version":3,"file":"mckit-chat.mjs","sources":["../../../../projects/mckit/chat/src/lib/entities/message.ts","../../../../projects/mckit/chat/src/lib/entities/conversation.ts","../../../../projects/mckit/chat/src/lib/entities/event.ts","../../../../projects/mckit/chat/src/lib/entities/user.ts","../../../../projects/mckit/chat/src/lib/messages/base-message.component.ts","../../../../projects/mckit/chat/src/lib/messages/text/text.component.ts","../../../../projects/mckit/chat/src/lib/messages/text/text.component.html","../../../../projects/mckit/chat/src/lib/messages/image/image.component.ts","../../../../projects/mckit/chat/src/lib/messages/image/image.component.html","../../../../projects/mckit/chat/src/lib/messages/video/video.component.ts","../../../../projects/mckit/chat/src/lib/messages/video/video.component.html","../../../../projects/mckit/chat/src/lib/messages/audio/audio.component.ts","../../../../projects/mckit/chat/src/lib/messages/audio/audio.component.html","../../../../projects/mckit/chat/src/lib/messages/file/file.component.ts","../../../../projects/mckit/chat/src/lib/messages/file/file.component.html","../../../../projects/mckit/chat/src/lib/messages/empty/empty.component.ts","../../../../projects/mckit/chat/src/lib/messages/empty/empty.component.html","../../../../projects/mckit/chat/src/lib/messages/thinking/thinking.component.ts","../../../../projects/mckit/chat/src/lib/messages/thinking/thinking.component.html","../../../../projects/mckit/chat/src/lib/services/chat.service.ts","../../../../projects/mckit/chat/src/lib/components/writing/writing.component.ts","../../../../projects/mckit/chat/src/lib/components/writing/writing.component.html","../../../../projects/mckit/chat/src/lib/components/user-header/user-header.component.ts","../../../../projects/mckit/chat/src/lib/components/user-header/user-header.component.html","../../../../projects/mckit/chat/src/lib/components/conversation/conversation.component.ts","../../../../projects/mckit/chat/src/lib/components/conversation/conversation.component.html","../../../../projects/mckit/chat/src/public-api.ts","../../../../projects/mckit/chat/src/mckit-chat.ts"],"sourcesContent":["export enum MCMessageChatType {\n TEXT = 'text',\n IMAGE = 'image',\n VIDEO = 'video',\n AUDIO = 'audio',\n FILE = 'file',\n EMPTY = 'empty',\n THINKING = 'thinking'\n}\n\nexport enum MCMessageChatSide {\n LEFT = 'left',\n RIGHT = 'right'\n}\n\nexport class MCMessageChat {\n id?: string | number;\n type!: string;\n side!: MCMessageChatSide;\n content?: any;\n createdAt?: string;\n}","import { MCMessageChat } from \"./message\";\nimport { MCUserChat } from \"./user\";\n\nexport class MCConversation {\n id?: string;\n messages: MCMessageChat[] = [];\n user?: MCUserChat;\n}","export enum MCEventChatType {\n TYPING = 'typing',\n SEND_MESSAGE = 'send_message'\n}\n\nexport class MCEventChat {\n type!: MCEventChatType | string;\n data?: any;\n}","export class MCUserChat {\n id?: string;\n firstname?: string;\n lastname?: string;\n photo?: string;\n online?: boolean;\n}","import { Component, input } from '@angular/core';\nimport { MCMessageChat } from '../entities/message';\n\n@Component({\n selector: 'mc-base-message',\n template: ''\n})\nexport class MCBaseMessageComponent {\n message = input.required<MCMessageChat>();\n}\n","import { Component } from '@angular/core';\nimport { MCBaseMessageComponent } from '../base-message.component';\nimport { CommonModule } from '@angular/common';\n\n@Component({\n selector: 'mc-message-text',\n imports: [CommonModule],\n templateUrl: './text.component.html',\n styleUrl: './text.component.css'\n})\nexport class MCMessageTextComponent extends MCBaseMessageComponent {\n\n}\n","<div class=\"flex w-full\"\n [ngClass]=\"{'justify-end': message().side !== 'left', 'justify-start': message().side === 'left'}\">\n\n <div class=\"max-w-[70%] flex flex-col\"\n [ngClass]=\"{'items-end': message().side !== 'left', 'items-start': message().side === 'left'}\">\n\n <div class=\"p-3 rounded-lg shadow-sm\" [ngClass]=\"{\n 'bg-blue-600 text-white rounded-br-none': message().side !== 'left',\n 'bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-200 border border-gray-200 dark:border-gray-700 rounded-bl-none': message().id === '1'\n }\">\n <p class=\"text-sm\">{{ message().content }}</p>\n </div>\n <span class=\"text-xs text-gray-400 mt-1 px-1\">\n {{ message().createdAt | date:'shortTime' }}\n </span>\n </div>\n</div>","import { CommonModule } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { ImageModule } from 'primeng/image';\nimport { MCBaseMessageComponent } from '../base-message.component';\n\n@Component({\n selector: 'mc-message-image',\n imports: [CommonModule, ImageModule],\n templateUrl: './image.component.html',\n styleUrl: './image.component.css'\n})\nexport class MCMessageImageComponent extends MCBaseMessageComponent {\n\n}\n","<div class=\"flex w-full\"\n [ngClass]=\"{'justify-end': message().side !== 'left', 'justify-start': message().side === 'left'}\">\n\n <div class=\"max-w-[70%] flex flex-col\"\n [ngClass]=\"{'items-end': message().side !== 'left', 'items-start': message().side === 'left'}\">\n\n <div class=\"rounded-lg shadow-sm overflow-hidden\" [ngClass]=\"{\n 'rounded-br-none': message().side !== 'left',\n 'rounded-bl-none': message().side === 'left'\n }\">\n <p-image [src]=\"message().content\" [alt]=\"'Image'\" [preview]=\"true\" width=\"250\">\n </p-image>\n </div>\n <span class=\"text-xs text-gray-400 mt-1 px-1\">\n {{ message().createdAt | date:'shortTime' }}\n </span>\n </div>\n</div>","import { CommonModule } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { MCBaseMessageComponent } from '../base-message.component';\n\n@Component({\n selector: 'mc-message-video',\n imports: [CommonModule],\n templateUrl: './video.component.html',\n styleUrl: './video.component.css'\n})\nexport class MCMessageVideoComponent extends MCBaseMessageComponent {\n\n}\n","<div class=\"flex w-full\"\n [ngClass]=\"{'justify-end': message().side !== 'left', 'justify-start': message().side === 'left'}\">\n\n <div class=\"max-w-[70%] flex flex-col\"\n [ngClass]=\"{'items-end': message().side !== 'left', 'items-start': message().side === 'left'}\">\n\n <div class=\"rounded-lg shadow-sm overflow-hidden\" [ngClass]=\"{\n 'rounded-br-none': message().side !== 'left',\n 'rounded-bl-none': message().side === 'left'\n }\">\n <video [src]=\"message().content\" controls width=\"250\" class=\"block\">\n </video>\n </div>\n <span class=\"text-xs text-gray-400 mt-1 px-1\">\n {{ message().createdAt | date:'shortTime' }}\n </span>\n </div>\n</div>","import { CommonModule } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { MCBaseMessageComponent } from '../base-message.component';\n\n@Component({\n selector: 'mc-message-audio',\n imports: [CommonModule],\n templateUrl: './audio.component.html',\n styleUrl: './audio.component.css'\n})\nexport class MCMessageAudioComponent extends MCBaseMessageComponent {\n\n}\n","<div class=\"flex w-full\"\n [ngClass]=\"{'justify-end': message().side !== 'left', 'justify-start': message().side === 'left'}\">\n\n <div class=\"max-w-[70%] flex flex-col\"\n [ngClass]=\"{'items-end': message().side !== 'left', 'items-start': message().side === 'left'}\">\n\n <div class=\"rounded-lg shadow-sm overflow-hidden\" [ngClass]=\"{\n 'rounded-br-none': message().side !== 'left',\n 'rounded-bl-none': message().side === 'left'\n }\">\n <audio [src]=\"message().content\" controls class=\"block w-[250px]\">\n </audio>\n </div>\n <span class=\"text-xs text-gray-400 mt-1 px-1\">\n {{ message().createdAt | date:'shortTime' }}\n </span>\n </div>\n</div>","import { CommonModule } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { MCBaseMessageComponent } from '../base-message.component';\n\n@Component({\n selector: 'mc-message-file',\n imports: [CommonModule],\n templateUrl: './file.component.html',\n styleUrl: './file.component.css'\n})\nexport class MCMessageFileComponent extends MCBaseMessageComponent {\n\n}\n","<div class=\"flex w-full\"\n [ngClass]=\"{'justify-end': message().side !== 'left', 'justify-start': message().side === 'left'}\">\n\n <div class=\"max-w-[70%] flex flex-col\"\n [ngClass]=\"{'items-end': message().side !== 'left', 'items-start': message().side === 'left'}\">\n\n <div class=\"rounded-lg shadow-sm p-3 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 flex items-center gap-3\"\n [ngClass]=\"{\n 'rounded-br-none': message().side !== 'left',\n 'rounded-bl-none': message().side === 'left'\n }\">\n\n <div\n class=\"w-10 h-10 rounded bg-gray-100 dark:bg-gray-700 flex items-center justify-center text-gray-500 dark:text-gray-400\">\n <i class=\"pi pi-file text-xl\"></i>\n </div>\n\n <div class=\"flex flex-col overflow-hidden\">\n <span class=\"text-sm font-medium truncate text-gray-900 dark:text-gray-100 max-w-[150px]\">\n Attached File\n </span>\n <a [href]=\"message().content\" target=\"_blank\"\n class=\"text-xs text-blue-500 hover:text-blue-600 hover:underline flex items-center gap-1\">\n <span>Download</span>\n <i class=\"pi pi-external-link text-[10px]\"></i>\n </a>\n </div>\n </div>\n <span class=\"text-xs text-gray-400 mt-1 px-1\">\n {{ message().createdAt | date:'shortTime' }}\n </span>\n </div>\n</div>","import { CommonModule } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { MCBaseMessageComponent } from '../base-message.component';\n\n@Component({\n selector: 'mc-chat-empty',\n imports: [CommonModule],\n templateUrl: './empty.component.html',\n styleUrl: './empty.component.css'\n})\nexport class MCChatEmptyComponent extends MCBaseMessageComponent {\n\n}\n","<div class=\"flex flex-col items-center justify-center h-full text-gray-500 dark:text-gray-400\">\n <div class=\"w-16 h-16 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center mb-4\">\n <i class=\"pi pi-comments text-3xl\"></i>\n </div>\n <p class=\"text-lg font-medium\">No messages yet</p>\n <p class=\"text-sm\">Start the conversation by sending a message.</p>\n</div>","import { CommonModule } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { MCBaseMessageComponent } from '../base-message.component';\n\n@Component({\n selector: 'mc-chat-thinking',\n imports: [CommonModule],\n templateUrl: './thinking.component.html',\n styleUrl: './thinking.component.css'\n})\nexport class MCThinkingComponent extends MCBaseMessageComponent {\n\n}\n","<div class=\"flex items-center space-x-1 bg-gray-100 dark:bg-gray-800 rounded-lg p-3 w-fit\">\n <div class=\"w-2 h-2 bg-gray-400 rounded-full animate-bounce [animation-delay:-0.3s]\"></div>\n <div class=\"w-2 h-2 bg-gray-400 rounded-full animate-bounce [animation-delay:-0.15s]\"></div>\n <div class=\"w-2 h-2 bg-gray-400 rounded-full animate-bounce\"></div>\n</div>","import { Injectable, Type } from '@angular/core';\nimport { MCBaseMessageComponent } from '../messages/base-message.component';\nimport { MCMessageChatType } from '../entities/message';\nimport { MCMessageTextComponent } from '../messages/text/text.component';\nimport { MCMessageImageComponent } from '../messages/image/image.component';\nimport { MCMessageVideoComponent } from '../messages/video/video.component';\nimport { MCMessageAudioComponent } from '../messages/audio/audio.component';\nimport { MCMessageFileComponent } from '../messages/file/file.component';\nimport { Subject } from 'rxjs';\nimport { MCEventChat } from '../entities/event';\nimport { MCChatEmptyComponent } from '../messages/empty/empty.component';\nimport { MCThinkingComponent } from '../messages/thinking/thinking.component';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class MCChatService {\n\n private registry = new Map<string, Type<MCBaseMessageComponent>>();\n\n private eventSubject = new Subject<MCEventChat>();\n\n constructor() {\n this.register(MCMessageChatType.TEXT, MCMessageTextComponent);\n this.register(MCMessageChatType.IMAGE, MCMessageImageComponent);\n this.register(MCMessageChatType.VIDEO, MCMessageVideoComponent);\n this.register(MCMessageChatType.AUDIO, MCMessageAudioComponent);\n this.register(MCMessageChatType.FILE, MCMessageFileComponent);\n this.register(MCMessageChatType.EMPTY, MCChatEmptyComponent);\n this.register(MCMessageChatType.THINKING, MCThinkingComponent);\n }\n\n register(type: string, component: Type<MCBaseMessageComponent>) {\n this.registry.set(type, component);\n }\n\n getComponent(type: string): Type<MCBaseMessageComponent> | undefined {\n return this.registry.get(type);\n }\n\n sendEvent(event: MCEventChat) {\n this.eventSubject.next(event);\n }\n\n onEvent() {\n return this.eventSubject.asObservable();\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { Component, inject } from '@angular/core';\nimport { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { ButtonModule } from 'primeng/button';\nimport { InputTextModule } from 'primeng/inputtext';\nimport { MCChatService } from '../../services/chat.service';\nimport { MCEventChatType } from '../../entities/event';\n\n@Component({\n selector: 'mc-writing-conversation',\n imports: [CommonModule, FormsModule, ReactiveFormsModule, ButtonModule, InputTextModule],\n templateUrl: './writing.component.html',\n styleUrl: './writing.component.css'\n})\nexport class MCWritingComponent {\n\n input = new FormControl<string>('', { nonNullable: true });\n\n chatService = inject(MCChatService);\n\n onClickSend() {\n if (!this.input.value.trim()) return;\n\n this.chatService.sendEvent({\n type: MCEventChatType.SEND_MESSAGE,\n data: this.input.value\n });\n\n this.input.reset();\n }\n}\n","<div class=\"p-4 bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700\">\n <div class=\"flex gap-2\">\n <input pInputText type=\"text\" class=\"flex-1 w-full\" placeholder=\"Type a message...\" [formControl]=\"input\"\n (keydown.enter)=\"onClickSend()\" />\n\n <p-button icon=\"pi pi-send\" (onClick)=\"onClickSend()\" styleClass=\"p-button-rounded p-button-primary\">\n </p-button>\n </div>\n</div>","import { CommonModule } from '@angular/common';\nimport { Component, input } from '@angular/core';\nimport { AvatarModule } from 'primeng/avatar';\nimport { MCUserChat } from '../../entities/user';\n\n@Component({\n selector: 'mc-user-header-chat',\n imports: [CommonModule, AvatarModule],\n templateUrl: './user-header.component.html',\n styleUrl: './user-header.component.css'\n})\nexport class MCUserHeaderChatComponent {\n user = input.required<MCUserChat>();\n\n getInitials(): string {\n const initials = ((this.user().firstname?.charAt(0) ?? '') + (this.user().lastname?.charAt(0) ?? '')).toUpperCase();\n return initials ? initials : 'A1';\n }\n}\n","<div class=\"flex items-center p-4 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800\">\n @if (user().photo && user().photo != '' && user().photo != null) {\n <p-avatar [image]=\"user().photo\" shape=\"circle\" size=\"large\" class=\"mr-3\" />\n } @else {\n <p-avatar [label]=\"getInitials()\" shape=\"circle\" size=\"large\" class=\"mr-3\" />\n }\n <div>\n <h2 class=\"text-lg font-semibold text-gray-800 dark:text-white\">{{ user().firstname }} {{ user().lastname }}\n </h2>\n @if (user().online) {\n <p class=\"text-sm text-green-500 flex items-center\">\n <span class=\"w-2 h-2 rounded-full bg-green-500 mr-2\"></span>\n Online\n </p>\n }\n </div>\n</div>","import { CommonModule } from '@angular/common';\nimport { Component, inject, input, Type } from '@angular/core';\nimport { MCMessageChat, MCMessageChatSide, MCMessageChatType } from '../../entities/message';\nimport { MCChatService } from '../../services/chat.service';\nimport { MCBaseMessageComponent } from '../../messages/base-message.component';\nimport { MCConversation } from '../../entities/conversation';\nimport { MCWritingComponent } from '../writing/writing.component';\nimport { MCUserHeaderChatComponent } from '../user-header/user-header.component';\n\n@Component({\n selector: 'mc-conversation',\n imports: [CommonModule, MCUserHeaderChatComponent, MCWritingComponent],\n templateUrl: './conversation.component.html',\n styleUrl: './conversation.component.css'\n})\nexport class MCConversationComponent {\n\n conversation = input.required<MCConversation>();\n\n chatService = inject(MCChatService);\n\n newMessage: string = '';\n\n // Let's pretend we have a currentUserId = 1.\n currentUserId = 1;\n\n getComponent(type: string): Type<MCBaseMessageComponent> {\n return this.chatService.getComponent(type) ?? MCBaseMessageComponent;\n }\n\n sendMessage() {\n if (!this.newMessage.trim()) return;\n\n const message: MCMessageChat = {\n id: Date.now().toString(),\n type: MCMessageChatType.TEXT,\n content: this.newMessage,\n createdAt: new Date().toISOString(),\n side: MCMessageChatSide.RIGHT,\n };\n\n // Ideally we would push to a service, but for now just local array\n this.conversation().messages.push(message);\n this.newMessage = '';\n }\n}\n","<div\n class=\"flex flex-col h-full bg-white dark:bg-gray-900 rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700\">\n <!-- Header -->\n @if (conversation() && conversation()!.user) {\n <mc-user-header-chat [user]=\"conversation()!.user!\" />\n }\n\n <!-- Messages Body -->\n <div class=\"flex-1 overflow-y-auto p-4 space-y-4 bg-gray-50 dark:bg-gray-900\">\n <!-- Message Item -->\n @for (msg of conversation().messages; track $index) {\n <div class=\"mb-3\">\n <ng-container *ngComponentOutlet=\"getComponent(msg.type); inputs: { message: msg }\"></ng-container>\n </div>\n }\n </div>\n\n <!-- Footer / Input Area -->\n <mc-writing-conversation />\n\n</div>","/*\n * Public API Surface of chat\n */\n\n/**\n * Entities\n */\nexport * from './lib/entities/message';\nexport * from './lib/entities/conversation';\nexport * from './lib/entities/event';\nexport * from './lib/entities/user';\n\n/**\n * Messages\n */\nexport * from './lib/messages/base-message.component';\nexport * from './lib/messages/text/text.component';\nexport * from './lib/messages/image/image.component';\nexport * from './lib/messages/video/video.component';\nexport * from './lib/messages/audio/audio.component';\nexport * from './lib/messages/file/file.component';\nexport * from './lib/messages/empty/empty.component';\nexport * from './lib/messages/thinking/thinking.component';\n\n/**\n * Components\n */\nexport * from './lib/components/conversation/conversation.component';\nexport * from './lib/components/user-header/user-header.component';\nexport * from './lib/components/writing/writing.component';\n\n/**\n * Services\n */\nexport * from './lib/services/chat.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,iBAAiB,EAAA;AACzB,IAAA,iBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,iBAAA,CAAA,MAAA,CAAA,GAAA,MAA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EAAA,0BAAA,EAAA,2BAAA,EAAA,kCAAA,CAAA,EAAA,QAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,yBAAyB,kFAAE,kBAAkB,EAAA,QAAA,EAAA,yBAAA,EAAA,CAAA,EAAA,CAAA;;2FAI1D,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBANnC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,WAClB,CAAC,YAAY,EAAE,yBAAyB,EAAE,kBAAkB,CAAC,EAAA,QAAA,EAAA,mvBAAA,EAAA;;;AEXxE;;AAEG;AAEH;;AAEG;;ACNH;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Type } from '@angular/core';
3
+ import * as rxjs from 'rxjs';
4
+ import { FormControl } from '@angular/forms';
3
5
 
4
6
  declare enum MCMessageChatType {
5
7
  TEXT = "text",
@@ -7,7 +9,8 @@ declare enum MCMessageChatType {
7
9
  VIDEO = "video",
8
10
  AUDIO = "audio",
9
11
  FILE = "file",
10
- EMPTY = "empty"
12
+ EMPTY = "empty",
13
+ THINKING = "thinking"
11
14
  }
12
15
  declare enum MCMessageChatSide {
13
16
  LEFT = "left",
@@ -21,9 +24,27 @@ declare class MCMessageChat {
21
24
  createdAt?: string;
22
25
  }
23
26
 
27
+ declare class MCUserChat {
28
+ id?: string;
29
+ firstname?: string;
30
+ lastname?: string;
31
+ photo?: string;
32
+ online?: boolean;
33
+ }
34
+
24
35
  declare class MCConversation {
25
36
  id?: string;
26
37
  messages: MCMessageChat[];
38
+ user?: MCUserChat;
39
+ }
40
+
41
+ declare enum MCEventChatType {
42
+ TYPING = "typing",
43
+ SEND_MESSAGE = "send_message"
44
+ }
45
+ declare class MCEventChat {
46
+ type: MCEventChatType | string;
47
+ data?: any;
27
48
  }
28
49
 
29
50
  declare class MCBaseMessageComponent {
@@ -62,11 +83,19 @@ declare class MCChatEmptyComponent extends MCBaseMessageComponent {
62
83
  static ɵcmp: i0.ɵɵComponentDeclaration<MCChatEmptyComponent, "mc-chat-empty", never, {}, {}, never, never, true, never>;
63
84
  }
64
85
 
86
+ declare class MCThinkingComponent extends MCBaseMessageComponent {
87
+ static ɵfac: i0.ɵɵFactoryDeclaration<MCThinkingComponent, never>;
88
+ static ɵcmp: i0.ɵɵComponentDeclaration<MCThinkingComponent, "mc-chat-thinking", never, {}, {}, never, never, true, never>;
89
+ }
90
+
65
91
  declare class MCChatService {
66
92
  private registry;
93
+ private eventSubject;
67
94
  constructor();
68
95
  register(type: string, component: Type<MCBaseMessageComponent>): void;
69
96
  getComponent(type: string): Type<MCBaseMessageComponent> | undefined;
97
+ sendEvent(event: MCEventChat): void;
98
+ onEvent(): rxjs.Observable<MCEventChat>;
70
99
  static ɵfac: i0.ɵɵFactoryDeclaration<MCChatService, never>;
71
100
  static ɵprov: i0.ɵɵInjectableDeclaration<MCChatService>;
72
101
  }
@@ -82,4 +111,19 @@ declare class MCConversationComponent {
82
111
  static ɵcmp: i0.ɵɵComponentDeclaration<MCConversationComponent, "mc-conversation", never, { "conversation": { "alias": "conversation"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
83
112
  }
84
113
 
85
- export { MCBaseMessageComponent, MCChatEmptyComponent, MCChatService, MCConversation, MCConversationComponent, MCMessageAudioComponent, MCMessageChat, MCMessageChatSide, MCMessageChatType, MCMessageFileComponent, MCMessageImageComponent, MCMessageTextComponent, MCMessageVideoComponent };
114
+ declare class MCUserHeaderChatComponent {
115
+ user: i0.InputSignal<MCUserChat>;
116
+ getInitials(): string;
117
+ static ɵfac: i0.ɵɵFactoryDeclaration<MCUserHeaderChatComponent, never>;
118
+ static ɵcmp: i0.ɵɵComponentDeclaration<MCUserHeaderChatComponent, "mc-user-header-chat", never, { "user": { "alias": "user"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
119
+ }
120
+
121
+ declare class MCWritingComponent {
122
+ input: FormControl<string>;
123
+ chatService: MCChatService;
124
+ onClickSend(): void;
125
+ static ɵfac: i0.ɵɵFactoryDeclaration<MCWritingComponent, never>;
126
+ static ɵcmp: i0.ɵɵComponentDeclaration<MCWritingComponent, "mc-writing-conversation", never, {}, {}, never, never, true, never>;
127
+ }
128
+
129
+ export { MCBaseMessageComponent, MCChatEmptyComponent, MCChatService, MCConversation, MCConversationComponent, MCEventChat, MCEventChatType, MCMessageAudioComponent, MCMessageChat, MCMessageChatSide, MCMessageChatType, MCMessageFileComponent, MCMessageImageComponent, MCMessageTextComponent, MCMessageVideoComponent, MCThinkingComponent, MCUserChat, MCUserHeaderChatComponent, MCWritingComponent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mckit/chat",
3
- "version": "20.0.3",
3
+ "version": "20.0.4",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.3.0",
6
6
  "@angular/core": "^20.3.0"