@arthakosh/chat-widget 0.2.23 → 0.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/all-chats/all-chats.component.mjs +4 -4
- package/esm2022/lib/chat-launcher/chat-launcher.component.mjs +6 -3
- package/esm2022/lib/chat-window/chat-window.component.mjs +15 -13
- package/fesm2022/arthakosh-chat-widget.mjs +21 -16
- package/fesm2022/arthakosh-chat-widget.mjs.map +1 -1
- package/lib/chat-launcher/chat-launcher.component.d.ts +1 -0
- package/lib/chat-window/chat-window.component.d.ts +4 -2
- package/package.json +1 -1
|
@@ -210,10 +210,11 @@ class ChatWindowComponent {
|
|
|
210
210
|
this.header = 'Chat';
|
|
211
211
|
this.metadata = '';
|
|
212
212
|
this.chatUsers = [];
|
|
213
|
-
this.
|
|
213
|
+
this.showActions = true;
|
|
214
214
|
this.mode = 'floating';
|
|
215
215
|
this.theme = 'light';
|
|
216
216
|
this.onArchive = new EventEmitter();
|
|
217
|
+
this.onClose = new EventEmitter();
|
|
217
218
|
this.refreshRoom = input(false);
|
|
218
219
|
// @Input() currentUser: any;
|
|
219
220
|
this.chatService = inject(ChatService);
|
|
@@ -296,23 +297,19 @@ class ChatWindowComponent {
|
|
|
296
297
|
const content = this.newMessage.trim();
|
|
297
298
|
if (!content)
|
|
298
299
|
return;
|
|
299
|
-
this.chatService
|
|
300
|
-
.sendMessage(this.chatRoomId, {
|
|
300
|
+
this.chatService.sendMessage(this.chatRoomId, {
|
|
301
301
|
senderId: this.chatService.currentUser().userId,
|
|
302
302
|
senderName: this.chatService.currentUser().name,
|
|
303
303
|
content,
|
|
304
304
|
replyToMessageId: this.replyTo?.replyToMessageId ?? null,
|
|
305
305
|
createdBy: this.chatService.currentUser().userId
|
|
306
|
-
})
|
|
307
|
-
.subscribe(() => {
|
|
306
|
+
}).subscribe(() => {
|
|
308
307
|
this.newMessage = '';
|
|
309
308
|
this.replyTo = null;
|
|
310
309
|
});
|
|
311
310
|
}
|
|
312
311
|
addUserToRoom() {
|
|
313
|
-
this.chatService
|
|
314
|
-
.addUserToRoom(this.chatRoomId, this.selectedUser?.user_id, this.selectedUser?.full_name, this.chatService.currentUser().userId)
|
|
315
|
-
.subscribe((res) => {
|
|
312
|
+
this.chatService.addUserToRoom(this.chatRoomId, this.selectedUser?.user_id, this.selectedUser?.full_name, this.chatService.currentUser().userId).subscribe((res) => {
|
|
316
313
|
});
|
|
317
314
|
}
|
|
318
315
|
toggleMinimize() {
|
|
@@ -355,8 +352,11 @@ class ChatWindowComponent {
|
|
|
355
352
|
toggleUsers() {
|
|
356
353
|
this.showUsers = !this.showUsers;
|
|
357
354
|
}
|
|
355
|
+
closeChat() {
|
|
356
|
+
this.onClose.emit();
|
|
357
|
+
}
|
|
358
358
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ChatWindowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
359
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: ChatWindowComponent, isStandalone: true, selector: "app-chat-window", inputs: { chatRoomId: { classPropertyName: "chatRoomId", publicName: "chatRoomId", isSignal: false, isRequired: false, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: false, isRequired: false, transformFunction: null }, metadata: { classPropertyName: "metadata", publicName: "metadata", isSignal: false, isRequired: false, transformFunction: null }, chatUsers: { classPropertyName: "chatUsers", publicName: "chatUsers", isSignal: false, isRequired: false, transformFunction: null }, addUserAllowed: { classPropertyName: "addUserAllowed", publicName: "addUserAllowed", isSignal: false, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: false, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: false, isRequired: false, transformFunction: null }, refreshRoom: { classPropertyName: "refreshRoom", publicName: "refreshRoom", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onArchive: "onArchive" }, providers: [MessageService], viewQueries: [{ propertyName: "messagesContainer", first: true, predicate: ["messagesContainer"], descendants: true }, { propertyName: "reactionOverlay", first: true, predicate: ["reactionOverlay"], descendants: true }], ngImport: i0, template: "<p-toast></p-toast>\r\n\r\n<div class=\"chat-window\" [class.minimized]=\"minimized\" [class.floating]=\"mode === 'floating'\"\r\n [class.fullscreen]=\"mode === 'fullscreen'\" [class.dark]=\"theme === 'dark'\">\r\n <div class=\"chat-header\">\r\n <div style=\"display: flex; flex-direction: column;\">\r\n <div class=\"title\">\r\n <span>{{ header }}</span>\r\n <span *ngIf=\"users().length\">({{ users().length }} {{ users().length == 1 ? 'participant' :\r\n 'participants'}})</span>\r\n </div>\r\n <div>\r\n <span>{{ metadata }}</span>\r\n </div>\r\n </div>\r\n <div class=\"header-actions\">\r\n <button pButton icon=\"pi pi-users\" (click)=\"toggleUsers()\" style=\"font-size: 0.5rem\" pTooltip=\"Toogle Users\"></button>\r\n <button pButton [icon]=\"minimized ? 'pi pi-plus' : 'pi pi-minus'\" (click)=\"toggleMinimize()\" style=\"font-size: 0.5rem\" pTooltip=\"Hide/Show\"></button>\r\n <button pButton icon=\"pi pi-trash\" (click)=\"archiveChat()\" style=\"font-size: 0.5rem\" pTooltip=\"Archive\"></button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"chat-body\" *ngIf=\"!minimized\">\r\n <div class=\"chat-layout\" [class.users-hidden]=\"!showUsers\">\r\n <div class=\"chat-main\" [class.fullscreen]=\"mode === 'fullscreen'\" [class.floating]=\"mode === 'floating'\">\r\n <div class=\"messages\" #messagesContainer [class.loading]=\"loading\">\r\n <div *ngFor=\"let msg of messages(); trackBy: trackById\" class=\"message-row\"\r\n [ngClass]=\"{ outgoing: msg.senderId === chatService.currentUser().userId, incoming: msg.senderId !== chatService.currentUser().userId }\">\r\n <div class=\"message-bubble\">\r\n <div class=\"message-meta\">\r\n <span class=\"sender\">\r\n <!-- *ngIf=\"msg.senderId !== chatService.currentUser().userId\" -->\r\n {{ msg.senderName }}\r\n </span>\r\n <!-- <span class=\"time\">\r\n {{ msg.createdAt | date: 'shortTime' }}\r\n </span> -->\r\n </div>\r\n\r\n <!-- MESSAGE TEXT -->\r\n <div class=\"message-content\">\r\n {{ msg.content }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"input-area\">\r\n <div class=\"reply-banner\" *ngIf=\"replyTo\">\r\n <span>Replying to: {{ replyTo.content | slice: 0:50 }}</span>\r\n <button pButton icon=\"pi pi-times\" class=\"p-button-text p-button-sm\" (click)=\"clearReply()\"></button>\r\n </div>\r\n\r\n <textarea pInputTextarea [(ngModel)]=\"newMessage\" rows=\"2\" autoResize=\"true\" placeholder=\"Type a message\"\r\n (keyup.enter)=\"send()\">\r\n </textarea>\r\n\r\n <div class=\"input-actions\">\r\n <button pButton icon=\"pi pi-send\" label=\"Send\" (click)=\"send()\"></button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"chat-sidebar\">\r\n <div class=\"section-title\">Users</div>\r\n <div class=\"user-list\">\r\n <div class=\"user-row\" *ngFor=\"let u of users()\">\r\n <p-avatar [label]=\"u.username[0]\"></p-avatar>\r\n <span>{{ u.username }}</span>\r\n </div>\r\n </div>\r\n @if(addUserAllowed) {\r\n <div class=\"user-list-add\">\r\n <p-dropdown [options]=\"chatService.userList()\" [(ngModel)]=\"selectedUser\" optionLabel=\"full_name\"\r\n placeholder=\"Select User\" />\r\n <div style=\"margin-top: 2em;\">\r\n <button pButton icon=\"pi pi-plus\" label=\"Add\" (click)=\"addUserToRoom()\"></button>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [".chat-window{width:35vw;max-width:95vw;display:flex;flex-direction:column;background:#fff;border-radius:16px;box-shadow:0 8px 30px #0000001f;overflow:visible;font-size:14px;font-family:Inter,system-ui,sans-serif}.chat-window.minimized{height:auto}.chat-header{display:flex;align-items:center;justify-content:space-between;background:#4f6ef7;color:#fff;padding:10px 14px}.chat-header .title{display:flex;flex-direction:row;gap:6px}.chat-header .title span{font-weight:600;font-size:14px}.chat-header .title small{font-size:11px;opacity:.85}.chat-body{display:flex;flex:1;background:#f5f7fb}.chat-layout{display:flex;flex:1;width:100%;overflow:hidden}.chat-layout.users-hidden .chat-sidebar{transform:translate(100%);opacity:0;pointer-events:none;width:0!important}.chat-layout.users-hidden .chat-main{flex:1 1 100%}.chat-main{flex:1;display:flex;flex-direction:column;background:#f5f7fb;height:70vh}.messages{flex:1;padding:16px 14px;overflow-y:auto;scroll-behavior:smooth}.message-row{display:flex;margin-bottom:14px;animation:messageIn .25s ease-out;position:relative;overflow:visible;padding-top:28px}@keyframes messageIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.message-row.incoming{justify-content:flex-start}.message-row.incoming .reaction-bar{left:12px}.message-row.outgoing{justify-content:flex-end}.message-row.outgoing .reaction-bar{right:12px;left:auto}.message-bubble{position:relative;max-width:72%;padding:10px 14px;border-radius:16px;font-size:14px;line-height:1.45;word-break:break-word;overflow:visible}.message-row.incoming .message-bubble{background:#fff;color:#111;border-top-left-radius:6px;box-shadow:0 3px 10px #0000000f;overflow:visible}.message-bubble:after{content:\"\";position:absolute;bottom:-6px;right:8px}.message-row.incoming .message-bubble:after{content:\"\";position:absolute;left:-6px;top:12px;width:0;height:0;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:6px solid #ffffff}.message-row.outgoing .message-bubble{background:#4f6ef7;color:#fff;border-top-right-radius:6px;overflow:visible}.message-row.outgoing .message-bubble:after{content:\"\";position:absolute;right:-6px;top:12px;width:0;height:0;border-top:6px solid transparent;border-bottom:6px solid transparent;border-left:6px solid #4f6ef7}.message-meta{display:flex;justify-content:flex-end;font-size:10px;opacity:.6;margin-bottom:4px}.typing-indicator{display:inline-flex;align-items:center;gap:4px;padding:8px 12px;background:#fff;border-radius:14px;box-shadow:0 2px 6px #00000014}.typing-indicator span{width:6px;height:6px;background:#999;border-radius:50%;animation:typingDots 1.4s infinite ease-in-out both}.typing-indicator span:nth-child(1){animation-delay:0s}.typing-indicator span:nth-child(2){animation-delay:.2s}.typing-indicator span:nth-child(3){animation-delay:.4s}@keyframes typingDots{0%{transform:translateY(0);opacity:.4}50%{transform:translateY(-4px);opacity:1}to{transform:translateY(0);opacity:.4}}.input-area{background:#fff;padding:10px;border:1px solid #e5e7eb;display:flex;flex-direction:row;justify-content:space-between;gap:5px}.input-area textarea{max-height:60px;overflow:hidden;width:-webkit-fill-available}.reply-banner{background:#eef2ff;border-left:3px solid #4f6ef7;padding:6px 8px;font-size:12px;border-radius:8px;margin-bottom:6px;display:flex;justify-content:space-between}.input-actions{display:flex;justify-content:flex-end;margin-top:6px}.input-actions button{background:#4f6ef7;color:#fff;border-radius:999px;padding:0 16px}.chat-sidebar{background:#fff;border-left:1px solid #e5e7eb;box-shadow:-4px 0 10px #0000000d;display:flex;flex-direction:column}.section-title{font-weight:600;font-size:13px;padding:10px;border-bottom:1px solid #e5e7eb}.user-list{flex:1;overflow-y:auto;padding:8px;max-height:20em}.user-row{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:8px}.user-row:hover{background:#f1f5f9}.user-list-add{padding:10px;border-top:1px solid #e5e7eb}.header-actions{display:flex;align-items:center;gap:6px}.header-actions .p-button{width:32px;height:32px;padding:0;border-radius:50%;background:#ffffff26}.header-actions .p-button:hover{background:#ffffff40}.chat-header{min-height:48px}.header-actions{flex-shrink:0}.header-actions .p-button{transition:background .2s ease,transform .1s ease}.header-actions .p-button:active{transform:scale(.92)}.reaction-bar{position:absolute;top:0;left:12px;transform:translateY(-100%);background:#fff;border-radius:20px;padding:4px 8px;display:none;box-shadow:0 2px 8px #0003;z-index:9999}.message-bubble:hover .reaction-bar{display:flex}.reaction-bar span{cursor:pointer;font-size:16px}.reaction-summary{margin-top:4px;display:flex;gap:6px}.reaction-chip{background:#f1f1f1;padding:2px 6px;border-radius:12px;font-size:12px;position:relative}.reaction-users-tooltip{position:absolute;bottom:130%;left:50%;transform:translate(-50%);white-space:nowrap;background:#222;color:#fff;padding:4px 8px;border-radius:6px;z-index:10000;bottom:calc(100% + 6px)}.message-row,.message-bubble,.reaction-summary{overflow:visible!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$1.SlicePipe, name: "slice" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ToastModule }, { kind: "component", type: i3.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "ngmodule", type: AvatarModule }, { kind: "component", type: i5.Avatar, selector: "p-avatar", inputs: ["label", "icon", "image", "size", "shape", "style", "styleClass", "ariaLabel", "ariaLabelledBy"], outputs: ["onImageError"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i6.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: InputTextareaModule }, { kind: "directive", type: i7.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize", "variant"], outputs: ["onResize"] }, { kind: "ngmodule", type: ChipModule }, { kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i8.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "autoShowPanelOnPrintableCharacterKeyDown", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: OverlayPanelModule }] }); }
|
|
359
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: ChatWindowComponent, isStandalone: true, selector: "app-chat-window", inputs: { chatRoomId: { classPropertyName: "chatRoomId", publicName: "chatRoomId", isSignal: false, isRequired: false, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: false, isRequired: false, transformFunction: null }, metadata: { classPropertyName: "metadata", publicName: "metadata", isSignal: false, isRequired: false, transformFunction: null }, chatUsers: { classPropertyName: "chatUsers", publicName: "chatUsers", isSignal: false, isRequired: false, transformFunction: null }, showActions: { classPropertyName: "showActions", publicName: "showActions", isSignal: false, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: false, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: false, isRequired: false, transformFunction: null }, refreshRoom: { classPropertyName: "refreshRoom", publicName: "refreshRoom", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onArchive: "onArchive", onClose: "onClose" }, providers: [MessageService], viewQueries: [{ propertyName: "messagesContainer", first: true, predicate: ["messagesContainer"], descendants: true }, { propertyName: "reactionOverlay", first: true, predicate: ["reactionOverlay"], descendants: true }], ngImport: i0, template: "<p-toast></p-toast>\r\n\r\n<div [class.dark]=\"theme === 'dark'\" [class.floating]=\"mode === 'floating'\" [class.fullscreen]=\"mode === 'fullscreen'\"\r\n [class.minimized]=\"minimized\" class=\"chat-window\">\r\n <div class=\"chat-header\">\r\n <div style=\"display: flex; flex-direction: column;\">\r\n <div class=\"title\">\r\n <span>{{ header }}</span>\r\n <span *ngIf=\"users().length\">({{ users().length }} {{\r\n users().length == 1 ? 'participant' :\r\n 'participants'\r\n }})</span>\r\n </div>\r\n <div>\r\n <span>{{ metadata }}</span>\r\n </div>\r\n </div>\r\n <div class=\"header-actions\">\r\n <button (click)=\"toggleUsers()\" appendTo=\"body\" icon=\"pi pi-users\" pButton pTooltip=\"Toogle Users\"\r\n style=\"font-size: 0.5rem\"></button>\r\n @if (showActions) {\r\n <button (click)=\"toggleMinimize()\" [icon]=\"minimized ? 'pi pi-plus' : 'pi pi-minus'\" appendTo=\"body\"\r\n pButton pTooltip=\"Hide/Show\" style=\"font-size: 0.5rem\"></button>\r\n <button (click)=\"archiveChat()\" appendTo=\"body\" icon=\"pi pi-trash\" pButton pTooltip=\"Archive\"\r\n style=\"font-size: 0.5rem\"></button>\r\n <button (click)=\"closeChat()\" appendTo=\"body\" icon=\"pi pi-times\" pButton pTooltip=\"Close\"\r\n style=\"font-size: 0.5rem\"></button>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"!minimized\" class=\"chat-body\">\r\n <div [class.users-hidden]=\"!showUsers\" class=\"chat-layout\">\r\n <div [class.floating]=\"mode === 'floating'\" [class.fullscreen]=\"mode === 'fullscreen'\" class=\"chat-main\">\r\n <div #messagesContainer [class.loading]=\"loading\" class=\"messages\">\r\n <div *ngFor=\"let msg of messages(); trackBy: trackById\"\r\n [ngClass]=\"{ outgoing: msg.senderId === chatService.currentUser().userId, incoming: msg.senderId !== chatService.currentUser().userId }\"\r\n class=\"message-row\">\r\n <div class=\"message-bubble\">\r\n <div class=\"message-meta\">\r\n <span class=\"sender\">\r\n <!-- *ngIf=\"msg.senderId !== chatService.currentUser().userId\" -->\r\n {{ msg.senderName }}\r\n </span>\r\n <!-- <span class=\"time\">\r\n {{ msg.createdAt | date: 'shortTime' }}\r\n </span> -->\r\n </div>\r\n\r\n <!-- MESSAGE TEXT -->\r\n <div class=\"message-content\">\r\n {{ msg.content }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"input-area\">\r\n <div *ngIf=\"replyTo\" class=\"reply-banner\">\r\n <span>Replying to: {{ replyTo.content | slice: 0:50 }}</span>\r\n <button (click)=\"clearReply()\" class=\"p-button-text p-button-sm\" icon=\"pi pi-times\"\r\n pButton></button>\r\n </div>\r\n\r\n <textarea (keyup.enter)=\"send()\" [(ngModel)]=\"newMessage\" autoResize=\"true\" pInputTextarea\r\n placeholder=\"Type a message\"\r\n rows=\"2\">\r\n </textarea>\r\n\r\n <div class=\"input-actions\">\r\n <button (click)=\"send()\" icon=\"pi pi-send\" label=\"Send\" pButton></button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"chat-sidebar\">\r\n <div class=\"section-title\">Users</div>\r\n <div class=\"user-list\">\r\n <div *ngFor=\"let u of users()\" class=\"user-row\">\r\n <p-avatar [label]=\"u.username[0]\"></p-avatar>\r\n <span>{{ u.username }}</span>\r\n </div>\r\n </div>\r\n @if (showActions) {\r\n <div class=\"user-list-add\">\r\n <p-dropdown [(ngModel)]=\"selectedUser\" [options]=\"chatService.userList()\"\r\n optionLabel=\"full_name\"\r\n placeholder=\"Select User\"/>\r\n <div style=\"margin-top: 2em;\">\r\n <button (click)=\"addUserToRoom()\" icon=\"pi pi-plus\" label=\"Add\" pButton></button>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [".chat-window{width:35vw;max-width:95vw;display:flex;flex-direction:column;background:#fff;border-radius:16px;box-shadow:0 8px 30px #0000001f;overflow:visible;font-size:14px;font-family:Inter,system-ui,sans-serif}.chat-window.minimized{height:auto}.chat-header{display:flex;align-items:center;justify-content:space-between;background:#4f6ef7;color:#fff;padding:10px 14px}.chat-header .title{display:flex;flex-direction:row;gap:6px}.chat-header .title span{font-weight:600;font-size:14px}.chat-header .title small{font-size:11px;opacity:.85}.chat-body{display:flex;flex:1;background:#f5f7fb}.chat-layout{display:flex;flex:1;width:100%;overflow:hidden}.chat-layout.users-hidden .chat-sidebar{transform:translate(100%);opacity:0;pointer-events:none;width:0!important}.chat-layout.users-hidden .chat-main{flex:1 1 100%}.chat-main{flex:1;display:flex;flex-direction:column;background:#f5f7fb;height:70vh}.messages{flex:1;padding:16px 14px;overflow-y:auto;scroll-behavior:smooth}.message-row{display:flex;margin-bottom:14px;animation:messageIn .25s ease-out;position:relative;overflow:visible;padding-top:28px}@keyframes messageIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.message-row.incoming{justify-content:flex-start}.message-row.incoming .reaction-bar{left:12px}.message-row.outgoing{justify-content:flex-end}.message-row.outgoing .reaction-bar{right:12px;left:auto}.message-bubble{position:relative;max-width:72%;padding:10px 14px;border-radius:16px;font-size:14px;line-height:1.45;word-break:break-word;overflow:visible}.message-row.incoming .message-bubble{background:#fff;color:#111;border-top-left-radius:6px;box-shadow:0 3px 10px #0000000f;overflow:visible}.message-bubble:after{content:\"\";position:absolute;bottom:-6px;right:8px}.message-row.incoming .message-bubble:after{content:\"\";position:absolute;left:-6px;top:12px;width:0;height:0;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:6px solid #ffffff}.message-row.outgoing .message-bubble{background:#4f6ef7;color:#fff;border-top-right-radius:6px;overflow:visible}.message-row.outgoing .message-bubble:after{content:\"\";position:absolute;right:-6px;top:12px;width:0;height:0;border-top:6px solid transparent;border-bottom:6px solid transparent;border-left:6px solid #4f6ef7}.message-meta{display:flex;justify-content:flex-end;font-size:10px;opacity:.6;margin-bottom:4px}.typing-indicator{display:inline-flex;align-items:center;gap:4px;padding:8px 12px;background:#fff;border-radius:14px;box-shadow:0 2px 6px #00000014}.typing-indicator span{width:6px;height:6px;background:#999;border-radius:50%;animation:typingDots 1.4s infinite ease-in-out both}.typing-indicator span:nth-child(1){animation-delay:0s}.typing-indicator span:nth-child(2){animation-delay:.2s}.typing-indicator span:nth-child(3){animation-delay:.4s}@keyframes typingDots{0%{transform:translateY(0);opacity:.4}50%{transform:translateY(-4px);opacity:1}to{transform:translateY(0);opacity:.4}}.input-area{background:#fff;padding:10px;border:1px solid #e5e7eb;display:flex;flex-direction:row;justify-content:space-between;gap:5px}.input-area textarea{max-height:60px;overflow:hidden;width:-webkit-fill-available}.reply-banner{background:#eef2ff;border-left:3px solid #4f6ef7;padding:6px 8px;font-size:12px;border-radius:8px;margin-bottom:6px;display:flex;justify-content:space-between}.input-actions{display:flex;justify-content:flex-end;margin-top:6px}.input-actions button{background:#4f6ef7;color:#fff;border-radius:999px;padding:0 16px}.chat-sidebar{background:#fff;border-left:1px solid #e5e7eb;box-shadow:-4px 0 10px #0000000d;display:flex;flex-direction:column}.section-title{font-weight:600;font-size:13px;padding:10px;border-bottom:1px solid #e5e7eb}.user-list{flex:1;overflow-y:auto;padding:8px;max-height:20em}.user-row{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:8px}.user-row:hover{background:#f1f5f9}.user-list-add{padding:10px;border-top:1px solid #e5e7eb}.header-actions{display:flex;align-items:center;gap:6px}.header-actions .p-button{width:32px;height:32px;padding:0;border-radius:50%;background:#ffffff26}.header-actions .p-button:hover{background:#ffffff40}.chat-header{min-height:48px}.header-actions{flex-shrink:0}.header-actions .p-button{transition:background .2s ease,transform .1s ease}.header-actions .p-button:active{transform:scale(.92)}.reaction-bar{position:absolute;top:0;left:12px;transform:translateY(-100%);background:#fff;border-radius:20px;padding:4px 8px;display:none;box-shadow:0 2px 8px #0003;z-index:9999}.message-bubble:hover .reaction-bar{display:flex}.reaction-bar span{cursor:pointer;font-size:16px}.reaction-summary{margin-top:4px;display:flex;gap:6px}.reaction-chip{background:#f1f1f1;padding:2px 6px;border-radius:12px;font-size:12px;position:relative}.reaction-users-tooltip{position:absolute;bottom:130%;left:50%;transform:translate(-50%);white-space:nowrap;background:#222;color:#fff;padding:4px 8px;border-radius:6px;z-index:10000;bottom:calc(100% + 6px)}.message-row,.message-bubble,.reaction-summary{overflow:visible!important}.p-tooltip{z-index:9999!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$1.SlicePipe, name: "slice" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ToastModule }, { kind: "component", type: i3.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "ngmodule", type: AvatarModule }, { kind: "component", type: i5.Avatar, selector: "p-avatar", inputs: ["label", "icon", "image", "size", "shape", "style", "styleClass", "ariaLabel", "ariaLabelledBy"], outputs: ["onImageError"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i6.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: InputTextareaModule }, { kind: "directive", type: i7.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize", "variant"], outputs: ["onResize"] }, { kind: "ngmodule", type: ChipModule }, { kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i8.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "autoShowPanelOnPrintableCharacterKeyDown", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: OverlayPanelModule }] }); }
|
|
360
360
|
}
|
|
361
361
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ChatWindowComponent, decorators: [{
|
|
362
362
|
type: Component,
|
|
@@ -371,7 +371,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
371
371
|
ChipModule,
|
|
372
372
|
DropdownModule,
|
|
373
373
|
OverlayPanelModule
|
|
374
|
-
], providers: [MessageService], template: "<p-toast></p-toast>\r\n\r\n<div class=\"chat-window\" [class.minimized]=\"minimized\" [class.floating]=\"mode === 'floating'\"\r\n [class.fullscreen]=\"mode === 'fullscreen'\" [class.dark]=\"theme === 'dark'\">\r\n <div class=\"chat-header\">\r\n <div style=\"display: flex; flex-direction: column;\">\r\n <div class=\"title\">\r\n <span>{{ header }}</span>\r\n <span *ngIf=\"users().length\">({{ users().length }} {{ users().length == 1 ? 'participant' :\r\n 'participants'}})</span>\r\n </div>\r\n <div>\r\n <span>{{ metadata }}</span>\r\n </div>\r\n </div>\r\n <div class=\"header-actions\">\r\n <button pButton icon=\"pi pi-users\" (click)=\"toggleUsers()\" style=\"font-size: 0.5rem\" pTooltip=\"Toogle Users\"></button>\r\n <button pButton [icon]=\"minimized ? 'pi pi-plus' : 'pi pi-minus'\" (click)=\"toggleMinimize()\" style=\"font-size: 0.5rem\" pTooltip=\"Hide/Show\"></button>\r\n <button pButton icon=\"pi pi-trash\" (click)=\"archiveChat()\" style=\"font-size: 0.5rem\" pTooltip=\"Archive\"></button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"chat-body\" *ngIf=\"!minimized\">\r\n <div class=\"chat-layout\" [class.users-hidden]=\"!showUsers\">\r\n <div class=\"chat-main\" [class.fullscreen]=\"mode === 'fullscreen'\" [class.floating]=\"mode === 'floating'\">\r\n <div class=\"messages\" #messagesContainer [class.loading]=\"loading\">\r\n <div *ngFor=\"let msg of messages(); trackBy: trackById\" class=\"message-row\"\r\n [ngClass]=\"{ outgoing: msg.senderId === chatService.currentUser().userId, incoming: msg.senderId !== chatService.currentUser().userId }\">\r\n <div class=\"message-bubble\">\r\n <div class=\"message-meta\">\r\n <span class=\"sender\">\r\n <!-- *ngIf=\"msg.senderId !== chatService.currentUser().userId\" -->\r\n {{ msg.senderName }}\r\n </span>\r\n <!-- <span class=\"time\">\r\n {{ msg.createdAt | date: 'shortTime' }}\r\n </span> -->\r\n </div>\r\n\r\n <!-- MESSAGE TEXT -->\r\n <div class=\"message-content\">\r\n {{ msg.content }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"input-area\">\r\n <div class=\"reply-banner\" *ngIf=\"replyTo\">\r\n <span>Replying to: {{ replyTo.content | slice: 0:50 }}</span>\r\n <button pButton icon=\"pi pi-times\" class=\"p-button-text p-button-sm\" (click)=\"clearReply()\"></button>\r\n </div>\r\n\r\n <textarea pInputTextarea [(ngModel)]=\"newMessage\" rows=\"2\" autoResize=\"true\" placeholder=\"Type a message\"\r\n (keyup.enter)=\"send()\">\r\n </textarea>\r\n\r\n <div class=\"input-actions\">\r\n <button pButton icon=\"pi pi-send\" label=\"Send\" (click)=\"send()\"></button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"chat-sidebar\">\r\n <div class=\"section-title\">Users</div>\r\n <div class=\"user-list\">\r\n <div class=\"user-row\" *ngFor=\"let u of users()\">\r\n <p-avatar [label]=\"u.username[0]\"></p-avatar>\r\n <span>{{ u.username }}</span>\r\n </div>\r\n </div>\r\n @if(addUserAllowed) {\r\n <div class=\"user-list-add\">\r\n <p-dropdown [options]=\"chatService.userList()\" [(ngModel)]=\"selectedUser\" optionLabel=\"full_name\"\r\n placeholder=\"Select User\" />\r\n <div style=\"margin-top: 2em;\">\r\n <button pButton icon=\"pi pi-plus\" label=\"Add\" (click)=\"addUserToRoom()\"></button>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [".chat-window{width:35vw;max-width:95vw;display:flex;flex-direction:column;background:#fff;border-radius:16px;box-shadow:0 8px 30px #0000001f;overflow:visible;font-size:14px;font-family:Inter,system-ui,sans-serif}.chat-window.minimized{height:auto}.chat-header{display:flex;align-items:center;justify-content:space-between;background:#4f6ef7;color:#fff;padding:10px 14px}.chat-header .title{display:flex;flex-direction:row;gap:6px}.chat-header .title span{font-weight:600;font-size:14px}.chat-header .title small{font-size:11px;opacity:.85}.chat-body{display:flex;flex:1;background:#f5f7fb}.chat-layout{display:flex;flex:1;width:100%;overflow:hidden}.chat-layout.users-hidden .chat-sidebar{transform:translate(100%);opacity:0;pointer-events:none;width:0!important}.chat-layout.users-hidden .chat-main{flex:1 1 100%}.chat-main{flex:1;display:flex;flex-direction:column;background:#f5f7fb;height:70vh}.messages{flex:1;padding:16px 14px;overflow-y:auto;scroll-behavior:smooth}.message-row{display:flex;margin-bottom:14px;animation:messageIn .25s ease-out;position:relative;overflow:visible;padding-top:28px}@keyframes messageIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.message-row.incoming{justify-content:flex-start}.message-row.incoming .reaction-bar{left:12px}.message-row.outgoing{justify-content:flex-end}.message-row.outgoing .reaction-bar{right:12px;left:auto}.message-bubble{position:relative;max-width:72%;padding:10px 14px;border-radius:16px;font-size:14px;line-height:1.45;word-break:break-word;overflow:visible}.message-row.incoming .message-bubble{background:#fff;color:#111;border-top-left-radius:6px;box-shadow:0 3px 10px #0000000f;overflow:visible}.message-bubble:after{content:\"\";position:absolute;bottom:-6px;right:8px}.message-row.incoming .message-bubble:after{content:\"\";position:absolute;left:-6px;top:12px;width:0;height:0;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:6px solid #ffffff}.message-row.outgoing .message-bubble{background:#4f6ef7;color:#fff;border-top-right-radius:6px;overflow:visible}.message-row.outgoing .message-bubble:after{content:\"\";position:absolute;right:-6px;top:12px;width:0;height:0;border-top:6px solid transparent;border-bottom:6px solid transparent;border-left:6px solid #4f6ef7}.message-meta{display:flex;justify-content:flex-end;font-size:10px;opacity:.6;margin-bottom:4px}.typing-indicator{display:inline-flex;align-items:center;gap:4px;padding:8px 12px;background:#fff;border-radius:14px;box-shadow:0 2px 6px #00000014}.typing-indicator span{width:6px;height:6px;background:#999;border-radius:50%;animation:typingDots 1.4s infinite ease-in-out both}.typing-indicator span:nth-child(1){animation-delay:0s}.typing-indicator span:nth-child(2){animation-delay:.2s}.typing-indicator span:nth-child(3){animation-delay:.4s}@keyframes typingDots{0%{transform:translateY(0);opacity:.4}50%{transform:translateY(-4px);opacity:1}to{transform:translateY(0);opacity:.4}}.input-area{background:#fff;padding:10px;border:1px solid #e5e7eb;display:flex;flex-direction:row;justify-content:space-between;gap:5px}.input-area textarea{max-height:60px;overflow:hidden;width:-webkit-fill-available}.reply-banner{background:#eef2ff;border-left:3px solid #4f6ef7;padding:6px 8px;font-size:12px;border-radius:8px;margin-bottom:6px;display:flex;justify-content:space-between}.input-actions{display:flex;justify-content:flex-end;margin-top:6px}.input-actions button{background:#4f6ef7;color:#fff;border-radius:999px;padding:0 16px}.chat-sidebar{background:#fff;border-left:1px solid #e5e7eb;box-shadow:-4px 0 10px #0000000d;display:flex;flex-direction:column}.section-title{font-weight:600;font-size:13px;padding:10px;border-bottom:1px solid #e5e7eb}.user-list{flex:1;overflow-y:auto;padding:8px;max-height:20em}.user-row{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:8px}.user-row:hover{background:#f1f5f9}.user-list-add{padding:10px;border-top:1px solid #e5e7eb}.header-actions{display:flex;align-items:center;gap:6px}.header-actions .p-button{width:32px;height:32px;padding:0;border-radius:50%;background:#ffffff26}.header-actions .p-button:hover{background:#ffffff40}.chat-header{min-height:48px}.header-actions{flex-shrink:0}.header-actions .p-button{transition:background .2s ease,transform .1s ease}.header-actions .p-button:active{transform:scale(.92)}.reaction-bar{position:absolute;top:0;left:12px;transform:translateY(-100%);background:#fff;border-radius:20px;padding:4px 8px;display:none;box-shadow:0 2px 8px #0003;z-index:9999}.message-bubble:hover .reaction-bar{display:flex}.reaction-bar span{cursor:pointer;font-size:16px}.reaction-summary{margin-top:4px;display:flex;gap:6px}.reaction-chip{background:#f1f1f1;padding:2px 6px;border-radius:12px;font-size:12px;position:relative}.reaction-users-tooltip{position:absolute;bottom:130%;left:50%;transform:translate(-50%);white-space:nowrap;background:#222;color:#fff;padding:4px 8px;border-radius:6px;z-index:10000;bottom:calc(100% + 6px)}.message-row,.message-bubble,.reaction-summary{overflow:visible!important}\n"] }]
|
|
374
|
+
], providers: [MessageService], template: "<p-toast></p-toast>\r\n\r\n<div [class.dark]=\"theme === 'dark'\" [class.floating]=\"mode === 'floating'\" [class.fullscreen]=\"mode === 'fullscreen'\"\r\n [class.minimized]=\"minimized\" class=\"chat-window\">\r\n <div class=\"chat-header\">\r\n <div style=\"display: flex; flex-direction: column;\">\r\n <div class=\"title\">\r\n <span>{{ header }}</span>\r\n <span *ngIf=\"users().length\">({{ users().length }} {{\r\n users().length == 1 ? 'participant' :\r\n 'participants'\r\n }})</span>\r\n </div>\r\n <div>\r\n <span>{{ metadata }}</span>\r\n </div>\r\n </div>\r\n <div class=\"header-actions\">\r\n <button (click)=\"toggleUsers()\" appendTo=\"body\" icon=\"pi pi-users\" pButton pTooltip=\"Toogle Users\"\r\n style=\"font-size: 0.5rem\"></button>\r\n @if (showActions) {\r\n <button (click)=\"toggleMinimize()\" [icon]=\"minimized ? 'pi pi-plus' : 'pi pi-minus'\" appendTo=\"body\"\r\n pButton pTooltip=\"Hide/Show\" style=\"font-size: 0.5rem\"></button>\r\n <button (click)=\"archiveChat()\" appendTo=\"body\" icon=\"pi pi-trash\" pButton pTooltip=\"Archive\"\r\n style=\"font-size: 0.5rem\"></button>\r\n <button (click)=\"closeChat()\" appendTo=\"body\" icon=\"pi pi-times\" pButton pTooltip=\"Close\"\r\n style=\"font-size: 0.5rem\"></button>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"!minimized\" class=\"chat-body\">\r\n <div [class.users-hidden]=\"!showUsers\" class=\"chat-layout\">\r\n <div [class.floating]=\"mode === 'floating'\" [class.fullscreen]=\"mode === 'fullscreen'\" class=\"chat-main\">\r\n <div #messagesContainer [class.loading]=\"loading\" class=\"messages\">\r\n <div *ngFor=\"let msg of messages(); trackBy: trackById\"\r\n [ngClass]=\"{ outgoing: msg.senderId === chatService.currentUser().userId, incoming: msg.senderId !== chatService.currentUser().userId }\"\r\n class=\"message-row\">\r\n <div class=\"message-bubble\">\r\n <div class=\"message-meta\">\r\n <span class=\"sender\">\r\n <!-- *ngIf=\"msg.senderId !== chatService.currentUser().userId\" -->\r\n {{ msg.senderName }}\r\n </span>\r\n <!-- <span class=\"time\">\r\n {{ msg.createdAt | date: 'shortTime' }}\r\n </span> -->\r\n </div>\r\n\r\n <!-- MESSAGE TEXT -->\r\n <div class=\"message-content\">\r\n {{ msg.content }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"input-area\">\r\n <div *ngIf=\"replyTo\" class=\"reply-banner\">\r\n <span>Replying to: {{ replyTo.content | slice: 0:50 }}</span>\r\n <button (click)=\"clearReply()\" class=\"p-button-text p-button-sm\" icon=\"pi pi-times\"\r\n pButton></button>\r\n </div>\r\n\r\n <textarea (keyup.enter)=\"send()\" [(ngModel)]=\"newMessage\" autoResize=\"true\" pInputTextarea\r\n placeholder=\"Type a message\"\r\n rows=\"2\">\r\n </textarea>\r\n\r\n <div class=\"input-actions\">\r\n <button (click)=\"send()\" icon=\"pi pi-send\" label=\"Send\" pButton></button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"chat-sidebar\">\r\n <div class=\"section-title\">Users</div>\r\n <div class=\"user-list\">\r\n <div *ngFor=\"let u of users()\" class=\"user-row\">\r\n <p-avatar [label]=\"u.username[0]\"></p-avatar>\r\n <span>{{ u.username }}</span>\r\n </div>\r\n </div>\r\n @if (showActions) {\r\n <div class=\"user-list-add\">\r\n <p-dropdown [(ngModel)]=\"selectedUser\" [options]=\"chatService.userList()\"\r\n optionLabel=\"full_name\"\r\n placeholder=\"Select User\"/>\r\n <div style=\"margin-top: 2em;\">\r\n <button (click)=\"addUserToRoom()\" icon=\"pi pi-plus\" label=\"Add\" pButton></button>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [".chat-window{width:35vw;max-width:95vw;display:flex;flex-direction:column;background:#fff;border-radius:16px;box-shadow:0 8px 30px #0000001f;overflow:visible;font-size:14px;font-family:Inter,system-ui,sans-serif}.chat-window.minimized{height:auto}.chat-header{display:flex;align-items:center;justify-content:space-between;background:#4f6ef7;color:#fff;padding:10px 14px}.chat-header .title{display:flex;flex-direction:row;gap:6px}.chat-header .title span{font-weight:600;font-size:14px}.chat-header .title small{font-size:11px;opacity:.85}.chat-body{display:flex;flex:1;background:#f5f7fb}.chat-layout{display:flex;flex:1;width:100%;overflow:hidden}.chat-layout.users-hidden .chat-sidebar{transform:translate(100%);opacity:0;pointer-events:none;width:0!important}.chat-layout.users-hidden .chat-main{flex:1 1 100%}.chat-main{flex:1;display:flex;flex-direction:column;background:#f5f7fb;height:70vh}.messages{flex:1;padding:16px 14px;overflow-y:auto;scroll-behavior:smooth}.message-row{display:flex;margin-bottom:14px;animation:messageIn .25s ease-out;position:relative;overflow:visible;padding-top:28px}@keyframes messageIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.message-row.incoming{justify-content:flex-start}.message-row.incoming .reaction-bar{left:12px}.message-row.outgoing{justify-content:flex-end}.message-row.outgoing .reaction-bar{right:12px;left:auto}.message-bubble{position:relative;max-width:72%;padding:10px 14px;border-radius:16px;font-size:14px;line-height:1.45;word-break:break-word;overflow:visible}.message-row.incoming .message-bubble{background:#fff;color:#111;border-top-left-radius:6px;box-shadow:0 3px 10px #0000000f;overflow:visible}.message-bubble:after{content:\"\";position:absolute;bottom:-6px;right:8px}.message-row.incoming .message-bubble:after{content:\"\";position:absolute;left:-6px;top:12px;width:0;height:0;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:6px solid #ffffff}.message-row.outgoing .message-bubble{background:#4f6ef7;color:#fff;border-top-right-radius:6px;overflow:visible}.message-row.outgoing .message-bubble:after{content:\"\";position:absolute;right:-6px;top:12px;width:0;height:0;border-top:6px solid transparent;border-bottom:6px solid transparent;border-left:6px solid #4f6ef7}.message-meta{display:flex;justify-content:flex-end;font-size:10px;opacity:.6;margin-bottom:4px}.typing-indicator{display:inline-flex;align-items:center;gap:4px;padding:8px 12px;background:#fff;border-radius:14px;box-shadow:0 2px 6px #00000014}.typing-indicator span{width:6px;height:6px;background:#999;border-radius:50%;animation:typingDots 1.4s infinite ease-in-out both}.typing-indicator span:nth-child(1){animation-delay:0s}.typing-indicator span:nth-child(2){animation-delay:.2s}.typing-indicator span:nth-child(3){animation-delay:.4s}@keyframes typingDots{0%{transform:translateY(0);opacity:.4}50%{transform:translateY(-4px);opacity:1}to{transform:translateY(0);opacity:.4}}.input-area{background:#fff;padding:10px;border:1px solid #e5e7eb;display:flex;flex-direction:row;justify-content:space-between;gap:5px}.input-area textarea{max-height:60px;overflow:hidden;width:-webkit-fill-available}.reply-banner{background:#eef2ff;border-left:3px solid #4f6ef7;padding:6px 8px;font-size:12px;border-radius:8px;margin-bottom:6px;display:flex;justify-content:space-between}.input-actions{display:flex;justify-content:flex-end;margin-top:6px}.input-actions button{background:#4f6ef7;color:#fff;border-radius:999px;padding:0 16px}.chat-sidebar{background:#fff;border-left:1px solid #e5e7eb;box-shadow:-4px 0 10px #0000000d;display:flex;flex-direction:column}.section-title{font-weight:600;font-size:13px;padding:10px;border-bottom:1px solid #e5e7eb}.user-list{flex:1;overflow-y:auto;padding:8px;max-height:20em}.user-row{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:8px}.user-row:hover{background:#f1f5f9}.user-list-add{padding:10px;border-top:1px solid #e5e7eb}.header-actions{display:flex;align-items:center;gap:6px}.header-actions .p-button{width:32px;height:32px;padding:0;border-radius:50%;background:#ffffff26}.header-actions .p-button:hover{background:#ffffff40}.chat-header{min-height:48px}.header-actions{flex-shrink:0}.header-actions .p-button{transition:background .2s ease,transform .1s ease}.header-actions .p-button:active{transform:scale(.92)}.reaction-bar{position:absolute;top:0;left:12px;transform:translateY(-100%);background:#fff;border-radius:20px;padding:4px 8px;display:none;box-shadow:0 2px 8px #0003;z-index:9999}.message-bubble:hover .reaction-bar{display:flex}.reaction-bar span{cursor:pointer;font-size:16px}.reaction-summary{margin-top:4px;display:flex;gap:6px}.reaction-chip{background:#f1f1f1;padding:2px 6px;border-radius:12px;font-size:12px;position:relative}.reaction-users-tooltip{position:absolute;bottom:130%;left:50%;transform:translate(-50%);white-space:nowrap;background:#222;color:#fff;padding:4px 8px;border-radius:6px;z-index:10000;bottom:calc(100% + 6px)}.message-row,.message-bubble,.reaction-summary{overflow:visible!important}.p-tooltip{z-index:9999!important}\n"] }]
|
|
375
375
|
}], ctorParameters: () => [], propDecorators: { chatRoomId: [{
|
|
376
376
|
type: Input
|
|
377
377
|
}], header: [{
|
|
@@ -380,7 +380,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
380
380
|
type: Input
|
|
381
381
|
}], chatUsers: [{
|
|
382
382
|
type: Input
|
|
383
|
-
}],
|
|
383
|
+
}], showActions: [{
|
|
384
384
|
type: Input
|
|
385
385
|
}], mode: [{
|
|
386
386
|
type: Input
|
|
@@ -388,6 +388,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
388
388
|
type: Input
|
|
389
389
|
}], onArchive: [{
|
|
390
390
|
type: Output
|
|
391
|
+
}], onClose: [{
|
|
392
|
+
type: Output
|
|
391
393
|
}], messagesContainer: [{
|
|
392
394
|
type: ViewChild,
|
|
393
395
|
args: ['messagesContainer']
|
|
@@ -458,12 +460,15 @@ class ChatLauncherComponent {
|
|
|
458
460
|
setActive(i) {
|
|
459
461
|
this.activeIndex.set(i);
|
|
460
462
|
}
|
|
463
|
+
closeAll() {
|
|
464
|
+
this.openWindows.set([]);
|
|
465
|
+
}
|
|
461
466
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ChatLauncherComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
462
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: ChatLauncherComponent, isStandalone: true, selector: "app-chat-launcher", inputs: { roomId: { classPropertyName: "roomId", publicName: "roomId", isSignal: true, isRequired: false, transformFunction: null }, roomHeader: { classPropertyName: "roomHeader", publicName: "roomHeader", isSignal: true, isRequired: false, transformFunction: null }, metadata: { classPropertyName: "metadata", publicName: "metadata", isSignal: true, isRequired: false, transformFunction: null }, user: { classPropertyName: "user", publicName: "user", isSignal: true, isRequired: false, transformFunction: null }, userList: { classPropertyName: "userList", publicName: "userList", isSignal: true, isRequired: false, transformFunction: null }, chatUsers: { classPropertyName: "chatUsers", publicName: "chatUsers", isSignal: true, isRequired: false, transformFunction: null } }, providers: [MessageService], ngImport: i0, template: "<div class=\"chat-float-wrapper\">\r\n <p-tabView [activeIndex]=\"activeIndex()\" (activeIndexChange)=\"setActive($event)\" [scrollable]=\"true\"\r\n class=\"chat-tabview\">\r\n <p-tabPanel *ngFor=\"let w of openWindows(); let i = index\" [header]=\"w.header\">\r\n <ng-template pTemplate=\"content\">\r\n <app-chat-window mode=\"floating\" theme=\"light\" [chatRoomId]=\"w.roomId\" [header]=\"w.header\"\r\n [metadata]=\"w.metadata\" (onArchive)=\"closeWindow($event)\">\r\n </app-chat-window>\r\n </ng-template>\r\n </p-tabPanel>\r\n </p-tabView>\r\n</div>", styles: ["@charset \"UTF-8\";.chat-float-wrapper{position:fixed!important;bottom:16px!important;right:16px!important;z-index:99999;pointer-events:auto}:host{position:fixed;right:16px;bottom:16px;z-index:2147483647;font-family:Arial,sans-serif}:host,:host *{box-sizing:border-box}:host{isolation:isolate}.chat-tabview{width:100%;height:100%}:host ::ng-deep .p-tabview{height:100%;display:flex;flex-direction:column}:host ::ng-deep .p-tabview-nav{flex-shrink:0}:host ::ng-deep .p-tabview-panels{flex:1;overflow:hidden}:host ::ng-deep .p-tabview-panel{height:100%}:host ::ng-deep app-chat-window{display:block;height:100%}.chat-tabview ::ng-deep .p-tabview-nav{background:transparent;border:none;display:flex;gap:8px;padding:6px 4px}.chat-tabview ::ng-deep .p-tabview-nav li{border:none}.chat-tabview ::ng-deep .p-tabview-nav li .p-tabview-nav-link{border:none;border-radius:18px;padding:6px 14px;font-size:13px;font-weight:500;color:#555;box-shadow:0 1px 4px #00000014;transition:all .2s ease}.chat-tabview ::ng-deep .p-tabview-nav li .p-tabview-nav-link:hover{color:#1a73e8}.chat-tabview ::ng-deep .p-tabview-nav li.p-highlight .p-tabview-nav-link{background:#1a73e8;color:#fff;box-shadow:0 4px 10px #1a73e859}.chat-tabview ::ng-deep .p-tabview-ink-bar{display:none}.chat-tabview ::ng-deep .p-tabview-panels{padding:0;border:none;background:transparent}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: ChatWindowComponent, selector: "app-chat-window", inputs: ["chatRoomId", "header", "metadata", "chatUsers", "
|
|
467
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: ChatLauncherComponent, isStandalone: true, selector: "app-chat-launcher", inputs: { roomId: { classPropertyName: "roomId", publicName: "roomId", isSignal: true, isRequired: false, transformFunction: null }, roomHeader: { classPropertyName: "roomHeader", publicName: "roomHeader", isSignal: true, isRequired: false, transformFunction: null }, metadata: { classPropertyName: "metadata", publicName: "metadata", isSignal: true, isRequired: false, transformFunction: null }, user: { classPropertyName: "user", publicName: "user", isSignal: true, isRequired: false, transformFunction: null }, userList: { classPropertyName: "userList", publicName: "userList", isSignal: true, isRequired: false, transformFunction: null }, chatUsers: { classPropertyName: "chatUsers", publicName: "chatUsers", isSignal: true, isRequired: false, transformFunction: null } }, providers: [MessageService], ngImport: i0, template: "<div class=\"chat-float-wrapper\">\r\n <p-tabView [activeIndex]=\"activeIndex()\" (activeIndexChange)=\"setActive($event)\" [scrollable]=\"true\"\r\n class=\"chat-tabview\">\r\n <p-tabPanel *ngFor=\"let w of openWindows(); let i = index\" [header]=\"w.header\">\r\n <ng-template pTemplate=\"content\">\r\n <app-chat-window mode=\"floating\" theme=\"light\" [chatRoomId]=\"w.roomId\" [header]=\"w.header\"\r\n [metadata]=\"w.metadata\" (onArchive)=\"closeWindow($event)\" (close)=\"closeAll()\">\r\n </app-chat-window>\r\n </ng-template>\r\n </p-tabPanel>\r\n </p-tabView>\r\n</div>", styles: ["@charset \"UTF-8\";.chat-float-wrapper{position:fixed!important;bottom:16px!important;right:16px!important;z-index:99999;pointer-events:auto}:host{position:fixed;right:16px;bottom:16px;z-index:2147483647;font-family:Arial,sans-serif}:host,:host *{box-sizing:border-box}:host{isolation:isolate}.chat-tabview{width:100%;height:100%}:host ::ng-deep .p-tabview{height:100%;display:flex;flex-direction:column}:host ::ng-deep .p-tabview-nav{flex-shrink:0}:host ::ng-deep .p-tabview-panels{flex:1;overflow:hidden}:host ::ng-deep .p-tabview-panel{height:100%}:host ::ng-deep app-chat-window{display:block;height:100%}.chat-tabview ::ng-deep .p-tabview-nav{background:transparent;border:none;display:flex;gap:8px;padding:6px 4px}.chat-tabview ::ng-deep .p-tabview-nav li{border:none}.chat-tabview ::ng-deep .p-tabview-nav li .p-tabview-nav-link{border:none;border-radius:18px;padding:6px 14px;font-size:13px;font-weight:500;color:#555;box-shadow:0 1px 4px #00000014;transition:all .2s ease}.chat-tabview ::ng-deep .p-tabview-nav li .p-tabview-nav-link:hover{color:#1a73e8}.chat-tabview ::ng-deep .p-tabview-nav li.p-highlight .p-tabview-nav-link{background:#1a73e8;color:#fff;box-shadow:0 4px 10px #1a73e859}.chat-tabview ::ng-deep .p-tabview-ink-bar{display:none}.chat-tabview ::ng-deep .p-tabview-panels{padding:0;border:none;background:transparent}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: ChatWindowComponent, selector: "app-chat-window", inputs: ["chatRoomId", "header", "metadata", "chatUsers", "showActions", "mode", "theme", "refreshRoom"], outputs: ["onArchive", "onClose"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "directive", type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "ngmodule", type: ToastModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: TabViewModule }, { kind: "component", type: i3$1.TabView, selector: "p-tabView", inputs: ["style", "styleClass", "controlClose", "scrollable", "activeIndex", "selectOnFocus", "nextButtonAriaLabel", "prevButtonAriaLabel", "autoHideButtons", "tabindex"], outputs: ["onChange", "onClose", "activeIndexChange"] }, { kind: "component", type: i3$1.TabPanel, selector: "p-tabPanel", inputs: ["closable", "headerStyle", "headerStyleClass", "cache", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "selected", "disabled", "header", "leftIcon", "rightIcon"] }] }); }
|
|
463
468
|
}
|
|
464
469
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ChatLauncherComponent, decorators: [{
|
|
465
470
|
type: Component,
|
|
466
|
-
args: [{ selector: 'app-chat-launcher', standalone: true, imports: [CommonModule, ChatWindowComponent, DropdownModule, ButtonModule, ToastModule, FormsModule, TabViewModule], providers: [MessageService], encapsulation: ViewEncapsulation.Emulated, template: "<div class=\"chat-float-wrapper\">\r\n <p-tabView [activeIndex]=\"activeIndex()\" (activeIndexChange)=\"setActive($event)\" [scrollable]=\"true\"\r\n class=\"chat-tabview\">\r\n <p-tabPanel *ngFor=\"let w of openWindows(); let i = index\" [header]=\"w.header\">\r\n <ng-template pTemplate=\"content\">\r\n <app-chat-window mode=\"floating\" theme=\"light\" [chatRoomId]=\"w.roomId\" [header]=\"w.header\"\r\n [metadata]=\"w.metadata\" (onArchive)=\"closeWindow($event)\">\r\n </app-chat-window>\r\n </ng-template>\r\n </p-tabPanel>\r\n </p-tabView>\r\n</div>", styles: ["@charset \"UTF-8\";.chat-float-wrapper{position:fixed!important;bottom:16px!important;right:16px!important;z-index:99999;pointer-events:auto}:host{position:fixed;right:16px;bottom:16px;z-index:2147483647;font-family:Arial,sans-serif}:host,:host *{box-sizing:border-box}:host{isolation:isolate}.chat-tabview{width:100%;height:100%}:host ::ng-deep .p-tabview{height:100%;display:flex;flex-direction:column}:host ::ng-deep .p-tabview-nav{flex-shrink:0}:host ::ng-deep .p-tabview-panels{flex:1;overflow:hidden}:host ::ng-deep .p-tabview-panel{height:100%}:host ::ng-deep app-chat-window{display:block;height:100%}.chat-tabview ::ng-deep .p-tabview-nav{background:transparent;border:none;display:flex;gap:8px;padding:6px 4px}.chat-tabview ::ng-deep .p-tabview-nav li{border:none}.chat-tabview ::ng-deep .p-tabview-nav li .p-tabview-nav-link{border:none;border-radius:18px;padding:6px 14px;font-size:13px;font-weight:500;color:#555;box-shadow:0 1px 4px #00000014;transition:all .2s ease}.chat-tabview ::ng-deep .p-tabview-nav li .p-tabview-nav-link:hover{color:#1a73e8}.chat-tabview ::ng-deep .p-tabview-nav li.p-highlight .p-tabview-nav-link{background:#1a73e8;color:#fff;box-shadow:0 4px 10px #1a73e859}.chat-tabview ::ng-deep .p-tabview-ink-bar{display:none}.chat-tabview ::ng-deep .p-tabview-panels{padding:0;border:none;background:transparent}\n"] }]
|
|
471
|
+
args: [{ selector: 'app-chat-launcher', standalone: true, imports: [CommonModule, ChatWindowComponent, DropdownModule, ButtonModule, ToastModule, FormsModule, TabViewModule], providers: [MessageService], encapsulation: ViewEncapsulation.Emulated, template: "<div class=\"chat-float-wrapper\">\r\n <p-tabView [activeIndex]=\"activeIndex()\" (activeIndexChange)=\"setActive($event)\" [scrollable]=\"true\"\r\n class=\"chat-tabview\">\r\n <p-tabPanel *ngFor=\"let w of openWindows(); let i = index\" [header]=\"w.header\">\r\n <ng-template pTemplate=\"content\">\r\n <app-chat-window mode=\"floating\" theme=\"light\" [chatRoomId]=\"w.roomId\" [header]=\"w.header\"\r\n [metadata]=\"w.metadata\" (onArchive)=\"closeWindow($event)\" (close)=\"closeAll()\">\r\n </app-chat-window>\r\n </ng-template>\r\n </p-tabPanel>\r\n </p-tabView>\r\n</div>", styles: ["@charset \"UTF-8\";.chat-float-wrapper{position:fixed!important;bottom:16px!important;right:16px!important;z-index:99999;pointer-events:auto}:host{position:fixed;right:16px;bottom:16px;z-index:2147483647;font-family:Arial,sans-serif}:host,:host *{box-sizing:border-box}:host{isolation:isolate}.chat-tabview{width:100%;height:100%}:host ::ng-deep .p-tabview{height:100%;display:flex;flex-direction:column}:host ::ng-deep .p-tabview-nav{flex-shrink:0}:host ::ng-deep .p-tabview-panels{flex:1;overflow:hidden}:host ::ng-deep .p-tabview-panel{height:100%}:host ::ng-deep app-chat-window{display:block;height:100%}.chat-tabview ::ng-deep .p-tabview-nav{background:transparent;border:none;display:flex;gap:8px;padding:6px 4px}.chat-tabview ::ng-deep .p-tabview-nav li{border:none}.chat-tabview ::ng-deep .p-tabview-nav li .p-tabview-nav-link{border:none;border-radius:18px;padding:6px 14px;font-size:13px;font-weight:500;color:#555;box-shadow:0 1px 4px #00000014;transition:all .2s ease}.chat-tabview ::ng-deep .p-tabview-nav li .p-tabview-nav-link:hover{color:#1a73e8}.chat-tabview ::ng-deep .p-tabview-nav li.p-highlight .p-tabview-nav-link{background:#1a73e8;color:#fff;box-shadow:0 4px 10px #1a73e859}.chat-tabview ::ng-deep .p-tabview-ink-bar{display:none}.chat-tabview ::ng-deep .p-tabview-panels{padding:0;border:none;background:transparent}\n"] }]
|
|
467
472
|
}], ctorParameters: () => [] });
|
|
468
473
|
|
|
469
474
|
class AllChatsComponent {
|
|
@@ -528,10 +533,10 @@ class AllChatsComponent {
|
|
|
528
533
|
this.activeRoomMetadata.set(room.Metadata);
|
|
529
534
|
setTimeout(() => {
|
|
530
535
|
this.showMessages = true;
|
|
531
|
-
},
|
|
536
|
+
}, 500);
|
|
532
537
|
}
|
|
533
538
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AllChatsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
534
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
539
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: AllChatsComponent, isStandalone: true, selector: "app-all-chats", inputs: { user: { classPropertyName: "user", publicName: "user", isSignal: true, isRequired: false, transformFunction: null }, roomId: { classPropertyName: "roomId", publicName: "roomId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { newRoomLoaded: "newRoomLoaded" }, ngImport: i0, template: "<div class=\"chat-page\">\r\n <!-- LEFT SIDEBAR : CHAT ROOMS -->\r\n <aside class=\"chat-sidebar glass\">\r\n <div class=\"sidebar-header\">\r\n <h3>Chat Rooms</h3>\r\n </div>\r\n <ul class=\"room-list\">\r\n <li (click)=\"selectRoom(room)\" *ngFor=\"let room of rooms;\" [class.active]=\"activeRoomId() === room.ChatRoomId\"\r\n class=\"room-item\">\r\n <div class=\"room-avatar\">\r\n <p-avatar [label]=\"room.ChatRoomName[0]\"></p-avatar>\r\n </div>\r\n <div class=\"room-info\">\r\n <span class=\"room-name\">{{ room.ChatRoomName }}</span>\r\n <span class=\"room-name\">{{ room.Metadata }}</span>\r\n </div>\r\n </li>\r\n </ul>\r\n </aside>\r\n <!-- RIGHT PANEL : CHAT WINDOW -->\r\n @if (showMessages) {\r\n <section *ngIf=\"showMessages\" @roomSwitch class=\"chat-main glass\">\r\n <app-chat-window [chatRoomId]=\"activeRoomId()\" [header]=\"activeRoomHeader()\" [metadata]=\"activeRoomMetadata()\" [showActions]=\"false\"\r\n mode=\"fullscreen\" theme=\"light\">\r\n </app-chat-window>\r\n </section>\r\n } @else {\r\n <section class=\"chat-main glass loading-container\">\r\n <div class=\"spinner\"></div>\r\n <p>Loading messages\u2026</p>\r\n </section>\r\n }\r\n\r\n</div>", styles: [":root{--glass-bg: rgba(255, 255, 255, .75);--glass-border: rgba(255, 255, 255, .25);--primary: #5b6dff;--text-dark: #1c1e21;--text-muted: #65676b}*{box-sizing:border-box;font-family:Segoe UI,system-ui,-apple-system,BlinkMacSystemFont}.chat-page{display:flex;height:100vh;padding:16px;gap:16px;background:linear-gradient(135deg,#e9efff,#f6f7fb)}.glass{background:var(--glass-bg);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-radius:18px;border:1px solid var(--glass-border);box-shadow:0 20px 40px #00000014,inset 0 1px #fff6}.chat-sidebar{width:300px;display:flex;flex-direction:column;overflow:hidden}.sidebar-header{padding:18px 20px;font-size:18px;font-weight:700;color:var(--text-dark);border-bottom:1px solid rgba(0,0,0,.06)}.room-list{list-style:none;overflow-y:auto;padding:6px}.room-item{display:flex;align-items:center;gap:14px;padding:12px 14px;border-radius:14px;cursor:pointer;transition:all .25s ease;margin-bottom:6px}.room-item:hover{background:#5b6dff14}.room-item.active{background:#5b6dff26;box-shadow:inset 0 0 0 1px #5b6dff40}.room-avatar p-avatar{width:44px;height:44px;border-radius:50%;background:linear-gradient(135deg,#5b6dff,#7a89ff);color:#fff;font-weight:700;display:flex;align-items:center;justify-content:center}.room-info{display:flex;flex-direction:column;overflow:hidden}.room-name{font-size:14px;font-weight:600;color:var(--text-dark);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.room-info span:last-child{font-size:12px;color:var(--text-muted)}.chat-main{flex:1;display:flex;flex-direction:column;overflow:hidden;position:relative}.chat-main:after{content:\"\";position:absolute;inset:0;border-radius:18px;pointer-events:none;box-shadow:inset 0 0 0 1px #fff3}.room-item:hover{transform:translateY(-1px)}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%}.spinner{width:40px;height:40px;border:4px solid rgba(0,0,0,.1);border-top-color:#4f46e5;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ToastModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "ngmodule", type: AvatarModule }, { kind: "component", type: i5.Avatar, selector: "p-avatar", inputs: ["label", "icon", "image", "size", "shape", "style", "styleClass", "ariaLabel", "ariaLabelledBy"], outputs: ["onImageError"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: InputTextareaModule }, { kind: "ngmodule", type: ChipModule }, { kind: "ngmodule", type: DropdownModule }, { kind: "ngmodule", type: OverlayPanelModule }, { kind: "component", type: ChatWindowComponent, selector: "app-chat-window", inputs: ["chatRoomId", "header", "metadata", "chatUsers", "showActions", "mode", "theme", "refreshRoom"], outputs: ["onArchive", "onClose"] }], animations: [
|
|
535
540
|
trigger('roomSwitch', [
|
|
536
541
|
transition(':enter', [
|
|
537
542
|
style({ opacity: 0, transform: 'translateX(24px)' }),
|
|
@@ -567,7 +572,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
567
572
|
animate('200ms ease-in', style({ opacity: 0, transform: 'translateX(-24px)' }))
|
|
568
573
|
])
|
|
569
574
|
])
|
|
570
|
-
], template: "<div class=\"chat-page\">\r\n <!-- LEFT SIDEBAR : CHAT ROOMS -->\r\n <aside class=\"chat-sidebar glass\">\r\n <div class=\"sidebar-header\">\r\n <h3>Chat Rooms</h3>\r\n </div>\r\n <ul class=\"room-list\">\r\n <li *ngFor=\"let room of rooms;\"
|
|
575
|
+
], template: "<div class=\"chat-page\">\r\n <!-- LEFT SIDEBAR : CHAT ROOMS -->\r\n <aside class=\"chat-sidebar glass\">\r\n <div class=\"sidebar-header\">\r\n <h3>Chat Rooms</h3>\r\n </div>\r\n <ul class=\"room-list\">\r\n <li (click)=\"selectRoom(room)\" *ngFor=\"let room of rooms;\" [class.active]=\"activeRoomId() === room.ChatRoomId\"\r\n class=\"room-item\">\r\n <div class=\"room-avatar\">\r\n <p-avatar [label]=\"room.ChatRoomName[0]\"></p-avatar>\r\n </div>\r\n <div class=\"room-info\">\r\n <span class=\"room-name\">{{ room.ChatRoomName }}</span>\r\n <span class=\"room-name\">{{ room.Metadata }}</span>\r\n </div>\r\n </li>\r\n </ul>\r\n </aside>\r\n <!-- RIGHT PANEL : CHAT WINDOW -->\r\n @if (showMessages) {\r\n <section *ngIf=\"showMessages\" @roomSwitch class=\"chat-main glass\">\r\n <app-chat-window [chatRoomId]=\"activeRoomId()\" [header]=\"activeRoomHeader()\" [metadata]=\"activeRoomMetadata()\" [showActions]=\"false\"\r\n mode=\"fullscreen\" theme=\"light\">\r\n </app-chat-window>\r\n </section>\r\n } @else {\r\n <section class=\"chat-main glass loading-container\">\r\n <div class=\"spinner\"></div>\r\n <p>Loading messages\u2026</p>\r\n </section>\r\n }\r\n\r\n</div>", styles: [":root{--glass-bg: rgba(255, 255, 255, .75);--glass-border: rgba(255, 255, 255, .25);--primary: #5b6dff;--text-dark: #1c1e21;--text-muted: #65676b}*{box-sizing:border-box;font-family:Segoe UI,system-ui,-apple-system,BlinkMacSystemFont}.chat-page{display:flex;height:100vh;padding:16px;gap:16px;background:linear-gradient(135deg,#e9efff,#f6f7fb)}.glass{background:var(--glass-bg);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-radius:18px;border:1px solid var(--glass-border);box-shadow:0 20px 40px #00000014,inset 0 1px #fff6}.chat-sidebar{width:300px;display:flex;flex-direction:column;overflow:hidden}.sidebar-header{padding:18px 20px;font-size:18px;font-weight:700;color:var(--text-dark);border-bottom:1px solid rgba(0,0,0,.06)}.room-list{list-style:none;overflow-y:auto;padding:6px}.room-item{display:flex;align-items:center;gap:14px;padding:12px 14px;border-radius:14px;cursor:pointer;transition:all .25s ease;margin-bottom:6px}.room-item:hover{background:#5b6dff14}.room-item.active{background:#5b6dff26;box-shadow:inset 0 0 0 1px #5b6dff40}.room-avatar p-avatar{width:44px;height:44px;border-radius:50%;background:linear-gradient(135deg,#5b6dff,#7a89ff);color:#fff;font-weight:700;display:flex;align-items:center;justify-content:center}.room-info{display:flex;flex-direction:column;overflow:hidden}.room-name{font-size:14px;font-weight:600;color:var(--text-dark);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.room-info span:last-child{font-size:12px;color:var(--text-muted)}.chat-main{flex:1;display:flex;flex-direction:column;overflow:hidden;position:relative}.chat-main:after{content:\"\";position:absolute;inset:0;border-radius:18px;pointer-events:none;box-shadow:inset 0 0 0 1px #fff3}.room-item:hover{transform:translateY(-1px)}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%}.spinner{width:40px;height:40px;border:4px solid rgba(0,0,0,.1);border-top-color:#4f46e5;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}\n"] }]
|
|
571
576
|
}], ctorParameters: () => [], propDecorators: { newRoomLoaded: [{
|
|
572
577
|
type: Output
|
|
573
578
|
}] } });
|