@volo/abp.ng.chat 5.0.0-rc.1 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/config/package.json +5 -5
- package/esm2020/config/chat-config.module.mjs +36 -0
- package/esm2020/config/components/chat-icon.component.mjs +79 -0
- package/esm2020/config/enums/index.mjs +3 -0
- package/esm2020/config/enums/policy-names.mjs +2 -0
- package/esm2020/config/enums/route-names.mjs +2 -0
- package/esm2020/config/providers/index.mjs +3 -0
- package/esm2020/config/providers/nav-item.provider.mjs +19 -0
- package/esm2020/config/providers/route.provider.mjs +20 -0
- package/esm2020/config/public-api.mjs +6 -0
- package/esm2020/config/services/chat-config.service.mjs +97 -0
- package/esm2020/config/volo-abp.ng.chat-config.mjs +5 -0
- package/esm2020/lib/chat-routing.module.mjs +39 -0
- package/esm2020/lib/chat.module.mjs +32 -0
- package/esm2020/lib/components/chat-contacts.component.mjs +111 -0
- package/esm2020/lib/components/chat.component.mjs +223 -0
- package/esm2020/lib/components/conversation-avatar.component.mjs +85 -0
- package/esm2020/lib/components/index.mjs +4 -0
- package/esm2020/lib/enums/chat-message-side.mjs +6 -0
- package/esm2020/lib/models/chat-contact-dto.mjs +12 -0
- package/esm2020/lib/models/chat-conversation-dto.mjs +12 -0
- package/esm2020/lib/models/chat-message-dto.mjs +12 -0
- package/esm2020/lib/models/chat-target-user-info.mjs +12 -0
- package/esm2020/lib/models/get-contacts-input.mjs +12 -0
- package/esm2020/lib/models/get-conversation-input.mjs +7 -0
- package/esm2020/lib/models/mark-conversation-as-read-input.mjs +12 -0
- package/esm2020/lib/models/send-message-input.mjs +12 -0
- package/esm2020/lib/services/contact.service.mjs +20 -0
- package/esm2020/lib/services/conversation.service.mjs +26 -0
- package/esm2020/proxy/lib/index.mjs +5 -0
- package/esm2020/proxy/lib/proxy/volo/chat/conversations/conversation.service.mjs +34 -0
- package/esm2020/proxy/lib/proxy/volo/chat/conversations/index.mjs +3 -0
- package/esm2020/proxy/lib/proxy/volo/chat/conversations/models.mjs +2 -0
- package/esm2020/proxy/lib/proxy/volo/chat/messages/chat-message-side.enum.mjs +8 -0
- package/esm2020/proxy/lib/proxy/volo/chat/messages/index.mjs +3 -0
- package/esm2020/proxy/lib/proxy/volo/chat/messages/models.mjs +2 -0
- package/esm2020/proxy/lib/proxy/volo/chat/settings/index.mjs +3 -0
- package/esm2020/proxy/lib/proxy/volo/chat/settings/models.mjs +2 -0
- package/esm2020/proxy/lib/proxy/volo/chat/settings/settings.service.mjs +24 -0
- package/esm2020/proxy/lib/proxy/volo/chat/users/contact.service.mjs +28 -0
- package/esm2020/proxy/lib/proxy/volo/chat/users/index.mjs +3 -0
- package/esm2020/proxy/lib/proxy/volo/chat/users/models.mjs +2 -0
- package/esm2020/proxy/public-api.mjs +2 -0
- package/esm2020/proxy/volo-abp.ng.chat-proxy.mjs +5 -0
- package/esm2020/public-api.mjs +3 -0
- package/esm2020/volo-abp.ng.chat.mjs +5 -0
- package/fesm2015/{volo-abp.ng.chat-config.js → volo-abp.ng.chat-config.mjs} +37 -38
- package/fesm2015/volo-abp.ng.chat-config.mjs.map +1 -0
- package/fesm2015/{volo-abp.ng.chat-proxy.js → volo-abp.ng.chat-proxy.mjs} +12 -12
- package/fesm2015/volo-abp.ng.chat-proxy.mjs.map +1 -0
- package/fesm2015/volo-abp.ng.chat.mjs +504 -0
- package/fesm2015/volo-abp.ng.chat.mjs.map +1 -0
- package/fesm2020/volo-abp.ng.chat-config.mjs +236 -0
- package/fesm2020/volo-abp.ng.chat-config.mjs.map +1 -0
- package/fesm2020/volo-abp.ng.chat-proxy.mjs +92 -0
- package/fesm2020/volo-abp.ng.chat-proxy.mjs.map +1 -0
- package/fesm2020/volo-abp.ng.chat.mjs +519 -0
- package/fesm2020/volo-abp.ng.chat.mjs.map +1 -0
- package/package.json +35 -10
- package/proxy/package.json +5 -5
- package/proxy/src/lib/proxy/README.md +17 -0
- package/bundles/volo-abp.ng.chat-config.umd.js +0 -1
- package/bundles/volo-abp.ng.chat-proxy.umd.js +0 -1
- package/bundles/volo-abp.ng.chat.umd.js +0 -1
- package/esm2015/config/chat-config.module.js +0 -1
- package/esm2015/config/components/chat-icon.component.js +0 -1
- package/esm2015/config/enums/index.js +0 -1
- package/esm2015/config/enums/policy-names.js +0 -1
- package/esm2015/config/enums/route-names.js +0 -1
- package/esm2015/config/providers/index.js +0 -1
- package/esm2015/config/providers/nav-item.provider.js +0 -1
- package/esm2015/config/providers/route.provider.js +0 -1
- package/esm2015/config/public-api.js +0 -1
- package/esm2015/config/services/chat-config.service.js +0 -1
- package/esm2015/config/volo-abp.ng.chat-config.js +0 -1
- package/esm2015/lib/chat-routing.module.js +0 -1
- package/esm2015/lib/chat.module.js +0 -1
- package/esm2015/lib/components/chat-contacts.component.js +0 -1
- package/esm2015/lib/components/chat.component.js +0 -1
- package/esm2015/lib/components/conversation-avatar.component.js +0 -1
- package/esm2015/lib/components/index.js +0 -1
- package/esm2015/lib/enums/chat-message-side.js +0 -1
- package/esm2015/lib/models/chat-contact-dto.js +0 -1
- package/esm2015/lib/models/chat-conversation-dto.js +0 -1
- package/esm2015/lib/models/chat-message-dto.js +0 -1
- package/esm2015/lib/models/chat-target-user-info.js +0 -1
- package/esm2015/lib/models/get-contacts-input.js +0 -1
- package/esm2015/lib/models/get-conversation-input.js +0 -1
- package/esm2015/lib/models/mark-conversation-as-read-input.js +0 -1
- package/esm2015/lib/models/send-message-input.js +0 -1
- package/esm2015/lib/services/contact.service.js +0 -1
- package/esm2015/lib/services/conversation.service.js +0 -1
- package/esm2015/proxy/lib/index.js +0 -1
- package/esm2015/proxy/lib/proxy/volo/chat/conversations/conversation.service.js +0 -1
- package/esm2015/proxy/lib/proxy/volo/chat/conversations/index.js +0 -1
- package/esm2015/proxy/lib/proxy/volo/chat/conversations/models.js +0 -1
- package/esm2015/proxy/lib/proxy/volo/chat/messages/chat-message-side.enum.js +0 -1
- package/esm2015/proxy/lib/proxy/volo/chat/messages/index.js +0 -1
- package/esm2015/proxy/lib/proxy/volo/chat/messages/models.js +0 -1
- package/esm2015/proxy/lib/proxy/volo/chat/settings/index.js +0 -1
- package/esm2015/proxy/lib/proxy/volo/chat/settings/models.js +0 -1
- package/esm2015/proxy/lib/proxy/volo/chat/settings/settings.service.js +0 -1
- package/esm2015/proxy/lib/proxy/volo/chat/users/contact.service.js +0 -1
- package/esm2015/proxy/lib/proxy/volo/chat/users/index.js +0 -1
- package/esm2015/proxy/lib/proxy/volo/chat/users/models.js +0 -1
- package/esm2015/proxy/public-api.js +0 -1
- package/esm2015/proxy/volo-abp.ng.chat-proxy.js +0 -1
- package/esm2015/public-api.js +0 -1
- package/esm2015/volo-abp.ng.chat.js +0 -1
- package/fesm2015/volo-abp.ng.chat.js +0 -525
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"volo-abp.ng.chat.mjs","sources":["../../../../packages/chat/src/lib/enums/chat-message-side.ts","../../../../packages/chat/src/lib/services/conversation.service.ts","../../../../packages/chat/src/lib/services/contact.service.ts","../../../../packages/chat/src/lib/models/chat-contact-dto.ts","../../../../packages/chat/src/lib/components/conversation-avatar.component.ts","../../../../packages/chat/src/lib/components/chat-contacts.component.ts","../../../../packages/chat/src/lib/components/chat-contacts.component.html","../../../../packages/chat/src/lib/components/chat.component.ts","../../../../packages/chat/src/lib/components/chat.component.html","../../../../packages/chat/src/lib/chat-routing.module.ts","../../../../packages/chat/src/lib/chat.module.ts","../../../../packages/chat/src/volo-abp.ng.chat.ts"],"sourcesContent":["export enum ChatMessageSide {\r\n Sender = 1,\r\n Receiver = 2,\r\n}\r\n","import { RestService } from '@abp/ng.core';\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport { SendMessageInput } from '../models/send-message-input';\r\nimport { GetConversationInput } from '../models/get-conversation-input';\r\nimport { MarkConversationAsReadInput } from '../models/mark-conversation-as-read-input';\r\nimport { ChatConversationDto } from '../models/chat-conversation-dto';\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class ConversationService {\r\n apiName = 'Chat';\r\n\r\n constructor(private restService: RestService) {}\r\n\r\n sendMessageByInput(body: SendMessageInput): Observable<void> {\r\n return this.restService.request(\r\n { url: '/api/chat/conversation/send-message', method: 'POST', body },\r\n { apiName: this.apiName }\r\n );\r\n }\r\n getConversationByInput(params = {} as GetConversationInput): Observable<ChatConversationDto> {\r\n return this.restService.request(\r\n { url: '/api/chat/conversation/conversation', method: 'GET', params },\r\n { apiName: this.apiName }\r\n );\r\n }\r\n markConversationAsReadByInput(body: MarkConversationAsReadInput): Observable<void> {\r\n return this.restService.request(\r\n { url: '/api/chat/conversation/mark-conversation-as-read', method: 'POST', body },\r\n { apiName: this.apiName }\r\n );\r\n }\r\n}\r\n","import { RestService } from '@abp/ng.core';\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport { GetContactsInput } from '../models/get-contacts-input';\r\nimport { ChatContactDto } from '../models/chat-contact-dto';\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class ContactService {\r\n apiName = 'Chat';\r\n\r\n constructor(private restService: RestService) {}\r\n\r\n getContactsByInput(params = {} as GetContactsInput): Observable<ChatContactDto[]> {\r\n return this.restService.request(\r\n { url: '/api/chat/contact/contacts', method: 'GET', params },\r\n { apiName: this.apiName }\r\n );\r\n }\r\n}\r\n","export class ChatContactDto {\r\n userId: string;\r\n name: string;\r\n surname: string;\r\n username: string;\r\n lastMessageSide: number;\r\n lastMessage: string;\r\n lastMessageDate: Date | string;\r\n unreadMessageCount: number;\r\n\r\n constructor(initialValues: Partial<ChatContactDto> = {}) {\r\n if (initialValues) {\r\n for (const key in initialValues) {\r\n if (initialValues.hasOwnProperty(key)) {\r\n this[key] = initialValues[key];\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","import { Component, OnInit, Input } from '@angular/core';\r\nimport { ChatContactDto } from '../models/chat-contact-dto';\r\n\r\nconst avatarStyles = [\r\n { color: '#ffffff', backgroundColor: '#3cb160' },\r\n { color: '#ffffff', backgroundColor: '#c373cc' },\r\n { color: '#ffffff', backgroundColor: '#2b78b3' },\r\n { color: '#ffffff', backgroundColor: '#6ac79a' },\r\n { color: '#ffffff', backgroundColor: '#aeb140' },\r\n { color: '#ffffff', backgroundColor: '#b773c0' },\r\n { color: '#ffffff', backgroundColor: '#e16d7a' },\r\n { color: '#ffffff', backgroundColor: '#ffac2a' },\r\n { color: '#ffffff', backgroundColor: '#21bbc7' },\r\n { color: '#ffffff', backgroundColor: '#59ab95' },\r\n];\r\n\r\n@Component({\r\n selector: 'abp-conversation-avatar',\r\n template: `<div\r\n class=\"avatar mx-auto rounded-circle\"\r\n [class.small]=\"isSmall\"\r\n [ngStyle]=\"avatarBgStyle\"\r\n >\r\n {{ avatarText }}\r\n </div>`,\r\n styles: [\r\n `\r\n .avatar {\r\n height: 40px;\r\n width: 40px;\r\n line-height: 40px;\r\n font-size: 16px;\r\n font-weight: 700;\r\n text-align: center;\r\n text-transform: uppercase;\r\n }\r\n\r\n .avatar.small {\r\n height: 27px;\r\n width: 27px;\r\n line-height: 27px;\r\n font-size: 14px;\r\n }\r\n `,\r\n ],\r\n})\r\nexport class ConversationAvatarComponent {\r\n @Input()\r\n contact: ChatContactDto;\r\n\r\n @Input()\r\n small: boolean | string;\r\n\r\n get avatarText(): string {\r\n if (!this.contact || !this.contact.username) return;\r\n if (this.contact.name && this.contact.surname)\r\n return this.contact.name[0] + this.contact.surname[0];\r\n if (this.contact.name) return this.contact.name.slice(0, 2);\r\n return this.contact.username.slice(0, 2);\r\n }\r\n\r\n get avatarBgStyle() {\r\n if (!this.contact || !this.contact.username) return;\r\n\r\n let hash = 0;\r\n for (let i = 0; i < this.contact.username.length; i++) {\r\n hash = this.contact.username.charCodeAt(i) + ((hash << 5) - hash);\r\n }\r\n return avatarStyles[Math.abs(hash % 10)];\r\n }\r\n\r\n get isSmall() {\r\n return typeof this.small === 'string' || this.small;\r\n }\r\n}\r\n","import { SubscriptionService, trackBy } from '@abp/ng.core';\r\nimport { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core';\r\nimport { ChatConfigService, ChatMessage } from '@volo/abp.ng.chat/config';\r\nimport { ChatMessageSide } from '../enums/chat-message-side';\r\nimport { ChatContactDto } from '../models/chat-contact-dto';\r\nimport { ContactService } from '../services/contact.service';\r\n\r\n@Component({\r\n selector: 'abp-chat-contacts',\r\n templateUrl: 'chat-contacts.component.html',\r\n styles: [\r\n `\r\n .messages-box {\r\n overflow-y: scroll;\r\n max-height: calc(100vh - 254.34px);\r\n }\r\n `,\r\n ],\r\n providers: [SubscriptionService],\r\n})\r\nexport class ChatContactsComponent implements OnInit, OnDestroy {\r\n @Output()\r\n selected = new EventEmitter<ChatContactDto>();\r\n allContacts: ChatContactDto[] = [];\r\n selectedContact = {} as ChatContactDto;\r\n filter = '';\r\n\r\n getContactName = getContactName;\r\n trackByUserId = trackBy<ChatContactDto>('userId');\r\n\r\n get contacts(): ChatContactDto[] {\r\n return this.allContacts\r\n .filter((contact) => contact.lastMessage)\r\n .sort((a, b) =>\r\n new Date(a.lastMessageDate).valueOf() > new Date(b.lastMessageDate).valueOf() ? -1 : 1\r\n );\r\n }\r\n\r\n get otherContacts(): ChatContactDto[] {\r\n return this.allContacts.filter((contact) => !contact.lastMessage);\r\n }\r\n\r\n constructor(\r\n private contactService: ContactService,\r\n private chatConfigService: ChatConfigService,\r\n private subscription: SubscriptionService\r\n ) {}\r\n\r\n private listenToNewMessages() {\r\n this.subscription.addOne(this.chatConfigService.message$, (message = {} as ChatMessage) => {\r\n const index = this.allContacts.findIndex((cont) => cont.userId === message.senderUserId);\r\n\r\n const contact = {\r\n userId: message.senderUserId,\r\n username: message.senderUsername,\r\n name: message.senderName,\r\n surname: message.senderSurname,\r\n lastMessage: message.text,\r\n unreadMessageCount: 1,\r\n lastMessageDate: new Date(),\r\n lastMessageSide: ChatMessageSide.Receiver,\r\n };\r\n\r\n if (index > -1) {\r\n this.allContacts[index] = {\r\n ...contact,\r\n unreadMessageCount:\r\n this.selectedContact.userId === this.allContacts[index].userId\r\n ? 0\r\n : this.allContacts[index].unreadMessageCount + 1,\r\n };\r\n } else if (!this.filter) {\r\n this.allContacts.push(contact);\r\n }\r\n });\r\n }\r\n\r\n ngOnInit() {\r\n this.get(() => {\r\n this.selectContact(this.allContacts.length ? this.allContacts[0] : ({} as ChatContactDto));\r\n this.listenToNewMessages();\r\n });\r\n }\r\n\r\n ngOnDestroy() {}\r\n\r\n get(onSuccess?: Function) {\r\n this.contactService\r\n .getContactsByInput({ includeOtherContacts: !!this.filter, filter: this.filter })\r\n .subscribe((res) => {\r\n if (!res.length) return;\r\n\r\n this.allContacts = res;\r\n if (onSuccess) onSuccess();\r\n });\r\n }\r\n\r\n selectContact(contact: ChatContactDto) {\r\n this.selectedContact = contact;\r\n this.selected.emit(contact);\r\n }\r\n\r\n changeLastMessageOfSelectedContact(message: string) {\r\n this.selectedContact.lastMessage = message;\r\n this.selectedContact.lastMessageDate = new Date();\r\n\r\n const index = this.allContacts.findIndex(\r\n (contact) => contact.userId === this.selectedContact.userId\r\n );\r\n\r\n this.allContacts[index] = this.selectedContact;\r\n }\r\n\r\n markSelectedContactAsRead() {\r\n this.selectedContact.unreadMessageCount = 0;\r\n }\r\n}\r\n\r\nexport function getContactName({ name, surname, username }: ChatContactDto) {\r\n if (!name && !surname) return username;\r\n\r\n return `${name || ''} ${surname || ''}`;\r\n}\r\n","<div class=\"border-end\">\r\n <div class=\"p-3 bg-light border-bottom\">\r\n <div class=\"form-row\">\r\n <div class=\"col\">\r\n <input\r\n id=\"contacts-filter\"\r\n type=\"search\"\r\n class=\"form-control form-control-sm\"\r\n autocomplete=\"off\"\r\n spellcheck=\"false\"\r\n [(ngModel)]=\"filter\"\r\n [placeholder]=\"'Chat::SearchInContacts' | abpLocalization\"\r\n [attr.aria-label]=\"'Chat::SearchInContacts' | abpLocalization\"\r\n (input.debounce)=\"get()\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"messages-box m-0 p-0\">\r\n <div class=\"list-group rounded-0\" id=\"contact-list\">\r\n <ng-container\r\n *ngFor=\"let contact of contacts; let i = index; trackBy: trackByUserId\"\r\n [ngTemplateOutlet]=\"contactTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: contact, index: i }\"\r\n >\r\n </ng-container>\r\n <div\r\n *ngIf=\"otherContacts.length\"\r\n class=\"list-group-item px-2 py-1 bg-light text-muted text-center font-size-sm text-uppercase border-start-0 border-end-0\"\r\n >\r\n <small>{{ 'Chat::OtherContacts' | abpLocalization }}</small>\r\n </div>\r\n <ng-container\r\n *ngFor=\"let contact of otherContacts; let i = index; trackBy: trackByUserId\"\r\n [ngTemplateOutlet]=\"contactTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: contact, index: i }\"\r\n >\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #contactTemplate let-contact let-i=\"index\">\r\n <a\r\n (click)=\"selectContact(contact)\"\r\n class=\"chat-contact list-group-item list-group-item-action px-4 rounded-0 border-start-0 pointer {{\r\n selectedContact.userId === contact.userId ? 'active text-white' : ''\r\n }}\"\r\n ><div class=\"media\">\r\n <abp-conversation-avatar [contact]=\"contact\"></abp-conversation-avatar>\r\n <div class=\"media-body ms-2 d-none d-md-block\">\r\n <div class=\"d-flex align-items-center justify-content-between mb-1\">\r\n <h6 class=\"mb-0\">\r\n <small *ngIf=\"contact.unreadMessageCount\" class=\"badge badge-success me-1\">{{\r\n contact.unreadMessageCount\r\n }}</small\r\n >{{ getContactName(contact) }}\r\n </h6>\r\n <small class=\"small font-weight-bold last-message-date\">{{\r\n contact.lastMessageDate | date\r\n }}</small>\r\n </div>\r\n <p class=\"mb-0 text-small last-message\">\r\n {{\r\n contact.lastMessage?.length > 24\r\n ? (contact.lastMessage | slice: 0:23) + '...'\r\n : contact.lastMessage\r\n }}\r\n </p>\r\n </div>\r\n </div>\r\n </a>\r\n</ng-template>\r\n","import { ConfigStateService, HttpWaitService, trackBy } from '@abp/ng.core';\r\nimport { AfterViewInit, Component, ElementRef, OnDestroy, ViewChild } from '@angular/core';\r\nimport { ChatConfigService, ChatMessage } from '@volo/abp.ng.chat/config';\r\nimport { fromEvent, Subject } from 'rxjs';\r\nimport { debounceTime, finalize, takeUntil } from 'rxjs/operators';\r\nimport { ChatMessageSide } from '../enums/chat-message-side';\r\nimport { ChatContactDto } from '../models/chat-contact-dto';\r\nimport { ChatMessageDto } from '../models/chat-message-dto';\r\nimport { ConversationService } from '../services/conversation.service';\r\nimport { ChatContactsComponent, getContactName } from './chat-contacts.component';\r\n\r\nconst now = new Date();\r\nconst today = new Date(now.getFullYear(), now.getMonth(), now.getDate()).valueOf();\r\n\r\n@Component({\r\n selector: 'abp-chat',\r\n templateUrl: 'chat.component.html',\r\n styles: [\r\n `\r\n .chat-box {\r\n height: calc(100vh - 390px);\r\n overflow-y: scroll;\r\n }\r\n\r\n .message-date {\r\n position: absolute;\r\n opacity: 0.35;\r\n width: 100px;\r\n top: 1px;\r\n }\r\n\r\n .message-date.left {\r\n left: -110px;\r\n text-align: right;\r\n }\r\n\r\n .message-date.right {\r\n right: -110px;\r\n }\r\n `,\r\n ],\r\n})\r\nexport class ChatComponent implements AfterViewInit, OnDestroy {\r\n selectedContact = {} as ChatContactDto;\r\n unreadMessageCount = 0;\r\n userMessages = new Map<string, ChatMessageDto[]>();\r\n chatMessageSide = ChatMessageSide;\r\n message: string;\r\n sendOnEnter: boolean;\r\n loading: boolean;\r\n pagingLoading: boolean;\r\n allMessagesLoaded: boolean;\r\n\r\n @ViewChild('chatBox', { static: false })\r\n chatBoxRef: ElementRef<HTMLDivElement>;\r\n\r\n @ViewChild(ChatContactsComponent, { static: false })\r\n chatContactsComponent: ChatContactsComponent;\r\n\r\n trackByMessageDate = trackBy<ChatMessageDto>('messageDate');\r\n\r\n destroy$ = new Subject();\r\n\r\n get contactName(): string {\r\n return getContactName(this.selectedContact || ({} as ChatContactDto));\r\n }\r\n\r\n get selectedContactMessages(): ChatMessageDto[] {\r\n return this.userMessages.get(this.selectedContact.userId) || [];\r\n }\r\n\r\n constructor(\r\n private conversationService: ConversationService,\r\n private chatConfigService: ChatConfigService,\r\n private configState: ConfigStateService,\r\n private httpWaitService: HttpWaitService\r\n ) {\r\n this.httpWaitService.addFilter([\r\n {\r\n method: 'POST',\r\n endpoint: '/api/chat/conversation/send-message',\r\n },\r\n {\r\n method: 'GET',\r\n endpoint: '/api/chat/contact/contacts',\r\n },\r\n ]);\r\n }\r\n\r\n private listenToChatBoxScroll() {\r\n fromEvent(this.chatBoxRef.nativeElement, 'scroll')\r\n .pipe(debounceTime(150), takeUntil(this.destroy$))\r\n .subscribe(this.onScroll);\r\n }\r\n\r\n private listenToNewMessages() {\r\n this.chatConfigService.message$\r\n .pipe(takeUntil(this.destroy$))\r\n .subscribe(({ senderUserId, text } = {} as ChatMessage) => {\r\n if (!this.userMessages.has(senderUserId)) return;\r\n\r\n const isSelected = this.selectedContact.userId === senderUserId;\r\n this.userMessages.get(senderUserId).push({\r\n message: text,\r\n messageDate: new Date(),\r\n side: ChatMessageSide.Receiver,\r\n isRead: isSelected,\r\n readDate: isSelected ? new Date() : null,\r\n });\r\n this.scrollToEnd();\r\n });\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.sendOnEnter =\r\n (\r\n this.configState.getSetting('Volo.Chat.Messaging.SendMessageOnEnter') || ''\r\n ).toLowerCase() !== 'false';\r\n\r\n this.listenToChatBoxScroll();\r\n this.listenToNewMessages();\r\n }\r\n\r\n ngOnDestroy() {\r\n this.destroy$.next();\r\n this.destroy$.complete();\r\n }\r\n\r\n getConversation(scrollToEnd: boolean) {\r\n this.allMessagesLoaded = false;\r\n this.conversationService\r\n .getConversationByInput({\r\n skipCount: 0,\r\n maxResultCount: 50,\r\n targetUserId: this.selectedContact.userId,\r\n })\r\n .subscribe((res) => {\r\n this.userMessages.set(this.selectedContact.userId, res.messages.reverse());\r\n if (scrollToEnd) this.scrollToEnd();\r\n if (this.selectedContact.unreadMessageCount) this.markConversationAsRead();\r\n });\r\n }\r\n\r\n send() {\r\n if (!this.message || this.loading) return;\r\n\r\n this.unreadMessageCount = 0;\r\n this.loading = true;\r\n this.conversationService\r\n .sendMessageByInput({ message: this.message, targetUserId: this.selectedContact.userId })\r\n .pipe(finalize(() => (this.loading = false)))\r\n .subscribe(() => {\r\n this.chatContactsComponent.changeLastMessageOfSelectedContact(this.message);\r\n\r\n if (!this.userMessages.has(this.selectedContact.userId)) {\r\n this.userMessages.set(this.selectedContact.userId, []);\r\n }\r\n\r\n this.userMessages.get(this.selectedContact.userId).push({\r\n message: this.message,\r\n isRead: true,\r\n readDate: now,\r\n messageDate: now,\r\n side: ChatMessageSide.Sender,\r\n });\r\n\r\n this.message = '';\r\n this.scrollToEnd();\r\n });\r\n }\r\n\r\n markConversationAsRead() {\r\n this.conversationService\r\n .markConversationAsReadByInput({ targetUserId: this.selectedContact.userId })\r\n .subscribe(() => {\r\n this.chatContactsComponent.markSelectedContactAsRead();\r\n this.selectedContact.unreadMessageCount = 0;\r\n setTimeout(() => (this.unreadMessageCount = 0), 5000);\r\n });\r\n }\r\n\r\n sendWithEnter(event: KeyboardEvent) {\r\n if (!this.sendOnEnter) return;\r\n\r\n event.preventDefault();\r\n this.send();\r\n }\r\n\r\n onSelectContact(contact: ChatContactDto) {\r\n this.selectedContact = contact;\r\n this.unreadMessageCount = contact.unreadMessageCount;\r\n this.scrollToEnd();\r\n\r\n if (this.userMessages.has(contact.userId) || !contact.lastMessage) {\r\n if (contact.unreadMessageCount) this.markConversationAsRead();\r\n return;\r\n }\r\n this.getConversation(true);\r\n }\r\n\r\n getDateFormat(date: string | Date): string {\r\n date = new Date(date);\r\n const messageDay = new Date(date.getFullYear(), date.getMonth(), date.getDate()).valueOf();\r\n\r\n if (messageDay === today) return 'shortTime';\r\n\r\n return 'short';\r\n }\r\n\r\n scrollToEnd() {\r\n setTimeout(() => {\r\n const { offsetTop } = (document.querySelector('.unread-message-count-badge-wrapper') ||\r\n {}) as HTMLDivElement;\r\n\r\n this.chatBoxRef.nativeElement.scrollTo({\r\n top: offsetTop ? offsetTop - 60 : this.chatBoxRef.nativeElement.scrollHeight,\r\n });\r\n }, 0);\r\n }\r\n\r\n onScroll = (event: Event) => {\r\n if (\r\n this.allMessagesLoaded ||\r\n this.pagingLoading ||\r\n !this.selectedContact.lastMessage ||\r\n this.chatBoxRef.nativeElement.scrollTop > 250 ||\r\n this.selectedContactMessages.length % 50 !== 0\r\n ) {\r\n event.preventDefault();\r\n return;\r\n }\r\n\r\n this.pagingLoading = true;\r\n this.conversationService\r\n .getConversationByInput({\r\n skipCount: this.selectedContactMessages.length,\r\n maxResultCount: 50,\r\n targetUserId: this.selectedContact.userId,\r\n })\r\n .pipe(finalize(() => (this.pagingLoading = false)))\r\n .subscribe((res) => {\r\n if (!res.messages.length) {\r\n this.allMessagesLoaded = true;\r\n return;\r\n }\r\n this.userMessages.get(this.selectedContact.userId).unshift(...res.messages.reverse());\r\n });\r\n };\r\n}\r\n","<div class=\"row entry-row\">\r\n <div class=\"col-auto\"></div>\r\n <div class=\"col-lg-auto ps-lg-0\"></div>\r\n <div class=\"col\">\r\n <div class=\"text-lg-end pt-2\" id=\"AbpContentToolbar\"></div>\r\n </div>\r\n</div>\r\n\r\n<div id=\"chat_wrapper\">\r\n <div class=\"container-fluid\">\r\n <div class=\"row rounded-lg overflow-hidden shadow bor der\">\r\n <div class=\"col-3 col-md-5 col-lg-4 px-0\">\r\n <abp-chat-contacts (selected)=\"onSelectContact($event)\"></abp-chat-contacts>\r\n </div>\r\n\r\n <!-- Chat Box-->\r\n <div class=\"col-9 col-md-7 col-lg-8 px-0\">\r\n <div class=\"p-3 bg-light border-bottom\">\r\n <div class=\"form-row\">\r\n <div class=\"col\">\r\n <div class=\"form-row\">\r\n <div class=\"col-auto\">\r\n <abp-conversation-avatar\r\n small\r\n [contact]=\"selectedContact\"\r\n ></abp-conversation-avatar>\r\n </div>\r\n <div class=\"col pt-1\" style=\"line-height: 1.2\">\r\n <strong id=\"conversation-title\" class=\"font-weight-bold\">{{ contactName }}</strong\r\n ><br />\r\n <small id=\"conversation-info\"></small>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div #chatBox id=\"chat-conversation-wrapper\" class=\"chat-box m-0 p-0\">\r\n <div class=\"chat-box-container p-4\" [id]=\"'chat-conversation'\">\r\n <ng-container\r\n *ngFor=\"\r\n let message of selectedContactMessages;\r\n let i = index;\r\n trackBy: trackByMessageDate\r\n \"\r\n >\r\n <div\r\n *ngIf=\"selectedContactMessages.length - unreadMessageCount === i\"\r\n class=\"row justify-content-center unread-message-count-badge-wrapper\"\r\n >\r\n <h3>\r\n <span class=\"badge badge-info\">\r\n <ng-container *ngIf=\"unreadMessageCount === 1; else moreThanOne\">\r\n {{ 'Chat::YouHaveAnUnreadMessage' | abpLocalization }}\r\n </ng-container>\r\n\r\n <ng-template #moreThanOne>\r\n {{\r\n 'Chat::YouHave{0}UnreadMessages' | abpLocalization: '' + unreadMessageCount\r\n }}\r\n </ng-template>\r\n </span>\r\n </h3>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"{ isSender: message.side === chatMessageSide.Sender } as data\"\r\n class=\"media w-75 mw-65 w-lp-auto mb-2\"\r\n [class.ms-auto]=\"data.isSender\"\r\n >\r\n <div class=\"media-body position-relative\">\r\n <div\r\n class=\"shadow rounded py-3 px-4 mb-1 {{\r\n data.isSender ? 'bg-primary' : 'bg-light'\r\n }}\"\r\n >\r\n <p\r\n class=\"text-small mb-0 {{ data.isSender ? 'text-white' : 'text-muted' }}\"\r\n [innerHTML]=\"message.message\"\r\n ></p>\r\n </div>\r\n <p\r\n class=\"message-date small text-muted m-0 {{ data.isSender ? 'left' : 'right' }}\"\r\n >\r\n {{ message.messageDate | date: getDateFormat(message.messageDate) }}\r\n </p>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n\r\n <!-- Typing area -->\r\n <div *ngIf=\"selectedContact?.userId\" id=\"send-message-form\" class=\"bg-light border-top m-0\">\r\n <div class=\"p-3\">\r\n <textarea\r\n id=\"chat-message-box\"\r\n name=\"message\"\r\n type=\"text\"\r\n [placeholder]=\"'Chat::TypeMessage' | abpLocalization\"\r\n class=\"form-control rounded py-2 bg-white\"\r\n [(ngModel)]=\"message\"\r\n (keydown.enter)=\"sendWithEnter($event)\"\r\n ></textarea>\r\n <div class=\"form-checkbox float-start mt-3\">\r\n <input\r\n type=\"checkbox\"\r\n class=\"form-check-input me-1\"\r\n id=\"send-on-enter\"\r\n [(ngModel)]=\"sendOnEnter\"\r\n />\r\n <label class=\"form-check-label\" for=\"send-on-enter\">{{\r\n 'Chat::SendOnEnter' | abpLocalization\r\n }}</label>\r\n </div>\r\n <div class=\"mt-2 text-end\">\r\n <button\r\n [disabled]=\"!message\"\r\n (click)=\"send()\"\r\n id=\"send-message-button\"\r\n type=\"button\"\r\n class=\"btn btn-primary px-3\"\r\n >\r\n {{ 'Chat::Send' | abpLocalization }}\r\n <i *ngIf=\"!loading; else loadingIcon\" class=\"fa fa-paper-plane ms-2\"></i>\r\n\r\n <ng-template #loadingIcon>\r\n <i class=\"fas fa-spinner fa-spin ms-2\"></i>\r\n </ng-template>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n","import {\r\n AuthGuard,\r\n PermissionGuard,\r\n ReplaceableComponents,\r\n ReplaceableRouteContainerComponent,\r\n RouterOutletComponent,\r\n} from '@abp/ng.core';\r\nimport { NgModule } from '@angular/core';\r\nimport { RouterModule, Routes } from '@angular/router';\r\nimport { ChatComponent } from './components/chat.component';\r\n\r\nconst routes: Routes = [\r\n {\r\n path: '',\r\n component: RouterOutletComponent,\r\n canActivate: [AuthGuard, PermissionGuard],\r\n children: [\r\n {\r\n path: '',\r\n component: ReplaceableRouteContainerComponent,\r\n data: {\r\n requiredPolicy: 'Chat.Messaging',\r\n replaceableComponent: {\r\n defaultComponent: ChatComponent,\r\n key: 'Chat.ChatComponent',\r\n } as ReplaceableComponents.RouteData<ChatComponent>,\r\n },\r\n },\r\n ],\r\n },\r\n];\r\n\r\n@NgModule({\r\n imports: [RouterModule.forChild(routes)],\r\n exports: [RouterModule],\r\n})\r\nexport class ChatRoutingModule {}\r\n","import { CoreModule, LazyModuleFactory } from '@abp/ng.core';\r\nimport { ThemeSharedModule } from '@abp/ng.theme.shared';\r\nimport { ModuleWithProviders, NgModule, NgModuleFactory } from '@angular/core';\r\nimport { ChatRoutingModule } from './chat-routing.module';\r\nimport { ChatContactsComponent } from './components/chat-contacts.component';\r\nimport { ChatComponent } from './components/chat.component';\r\nimport { ConversationAvatarComponent } from './components/conversation-avatar.component';\r\n\r\nconst declarations = [ChatComponent, ChatContactsComponent, ConversationAvatarComponent];\r\n\r\n@NgModule({\r\n declarations,\r\n imports: [CoreModule, ThemeSharedModule, ChatRoutingModule],\r\n exports: [...declarations],\r\n})\r\nexport class ChatModule {\r\n static forChild(): ModuleWithProviders<ChatModule> {\r\n return {\r\n ngModule: ChatModule,\r\n providers: [],\r\n };\r\n }\r\n\r\n static forLazy(): NgModuleFactory<ChatModule> {\r\n return new LazyModuleFactory(ChatModule.forChild());\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,yDAAU,CAAA;IACV,6DAAY,CAAA;AACd,CAAC,EAHW,eAAe,KAAf,eAAe;;MCSd,mBAAmB;IAG9B,YAAoB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;QAF5C,YAAO,GAAG,MAAM,CAAC;KAE+B;IAEhD,kBAAkB,CAAC,IAAsB;QACvC,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAC7B,EAAE,GAAG,EAAE,qCAAqC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAA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,UAAU,YAHZ,CAAC,UAAU,EAAE,iBAAiB,EAAE,iBAAiB,CAAC;2FAGhD,UAAU;kBALtB,QAAQ;mBAAC;oBACR,YAAY;oBACZ,OAAO,EAAE,CAAC,UAAU,EAAE,iBAAiB,EAAE,iBAAiB,CAAC;oBAC3D,OAAO,EAAE,CAAC,GAAG,YAAY,CAAC;iBAC3B;;;ACdD;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volo/abp.ng.chat",
|
|
3
|
-
"version": "5.
|
|
4
|
-
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^12.2.0",
|
|
6
|
-
"@angular/core": "^12.2.0"
|
|
7
|
-
},
|
|
3
|
+
"version": "5.1.1",
|
|
8
4
|
"dependencies": {
|
|
9
5
|
"tslib": "^2.3.0"
|
|
10
6
|
},
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"fesm2015": "fesm2015/volo-abp.ng.chat.
|
|
7
|
+
"module": "fesm2015/volo-abp.ng.chat.mjs",
|
|
8
|
+
"es2020": "fesm2020/volo-abp.ng.chat.mjs",
|
|
9
|
+
"esm2020": "esm2020/volo-abp.ng.chat.mjs",
|
|
10
|
+
"fesm2020": "fesm2020/volo-abp.ng.chat.mjs",
|
|
11
|
+
"fesm2015": "fesm2015/volo-abp.ng.chat.mjs",
|
|
16
12
|
"typings": "volo-abp.ng.chat.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
"./package.json": {
|
|
15
|
+
"default": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./volo-abp.ng.chat.d.ts",
|
|
19
|
+
"esm2020": "./esm2020/volo-abp.ng.chat.mjs",
|
|
20
|
+
"es2020": "./fesm2020/volo-abp.ng.chat.mjs",
|
|
21
|
+
"es2015": "./fesm2015/volo-abp.ng.chat.mjs",
|
|
22
|
+
"node": "./fesm2015/volo-abp.ng.chat.mjs",
|
|
23
|
+
"default": "./fesm2020/volo-abp.ng.chat.mjs"
|
|
24
|
+
},
|
|
25
|
+
"./config": {
|
|
26
|
+
"types": "./config/volo-abp.ng.chat-config.d.ts",
|
|
27
|
+
"esm2020": "./esm2020/config/volo-abp.ng.chat-config.mjs",
|
|
28
|
+
"es2020": "./fesm2020/volo-abp.ng.chat-config.mjs",
|
|
29
|
+
"es2015": "./fesm2015/volo-abp.ng.chat-config.mjs",
|
|
30
|
+
"node": "./fesm2015/volo-abp.ng.chat-config.mjs",
|
|
31
|
+
"default": "./fesm2020/volo-abp.ng.chat-config.mjs"
|
|
32
|
+
},
|
|
33
|
+
"./proxy": {
|
|
34
|
+
"types": "./proxy/volo-abp.ng.chat-proxy.d.ts",
|
|
35
|
+
"esm2020": "./esm2020/proxy/volo-abp.ng.chat-proxy.mjs",
|
|
36
|
+
"es2020": "./fesm2020/volo-abp.ng.chat-proxy.mjs",
|
|
37
|
+
"es2015": "./fesm2015/volo-abp.ng.chat-proxy.mjs",
|
|
38
|
+
"node": "./fesm2015/volo-abp.ng.chat-proxy.mjs",
|
|
39
|
+
"default": "./fesm2020/volo-abp.ng.chat-proxy.mjs"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
17
42
|
"sideEffects": false
|
|
18
43
|
}
|
package/proxy/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"fesm2015": "../fesm2015/volo-abp.ng.chat-proxy.
|
|
2
|
+
"module": "../fesm2015/volo-abp.ng.chat-proxy.mjs",
|
|
3
|
+
"es2020": "../fesm2020/volo-abp.ng.chat-proxy.mjs",
|
|
4
|
+
"esm2020": "../esm2020/proxy/volo-abp.ng.chat-proxy.mjs",
|
|
5
|
+
"fesm2020": "../fesm2020/volo-abp.ng.chat-proxy.mjs",
|
|
6
|
+
"fesm2015": "../fesm2015/volo-abp.ng.chat-proxy.mjs",
|
|
7
7
|
"typings": "volo-abp.ng.chat-proxy.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"name": "@volo/abp.ng.chat/proxy"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Proxy Generation Output
|
|
2
|
+
|
|
3
|
+
This directory includes the output of the latest proxy generation.
|
|
4
|
+
The files and folders in it will be overwritten when proxy generation is run again.
|
|
5
|
+
Therefore, please do not place your own content in this folder.
|
|
6
|
+
|
|
7
|
+
In addition, `generate-proxy.json` works like a lock file.
|
|
8
|
+
It includes information used by the proxy generator, so please do not delete or modify it.
|
|
9
|
+
|
|
10
|
+
Finally, the name of the files and folders should not be changed for two reasons:
|
|
11
|
+
- Proxy generator will keep creating them at those paths and you will have multiple copies of the same content.
|
|
12
|
+
- ABP Suite generates files which include imports from this folder.
|
|
13
|
+
|
|
14
|
+
> **Important Notice:** If you are building a module and are planning to publish to npm,
|
|
15
|
+
> some of the generated proxies are likely to be exported from public-api.ts file. In such a case,
|
|
16
|
+
> please make sure you export files directly and not from barrel exports. In other words,
|
|
17
|
+
> do not include index.ts exports in your public-api.ts exports.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@abp/ng.theme.shared"),require("@angular/core"),require("@angular/router"),require("rxjs"),require("rxjs/operators"),require("@microsoft/signalr"),require("@abp/ng.core"),require("angular-oauth2-oidc"),require("@angular/common")):"function"==typeof define&&define.amd?define("@volo/abp.ng.chat/config",["exports","@abp/ng.theme.shared","@angular/core","@angular/router","rxjs","rxjs/operators","@microsoft/signalr","@abp/ng.core","angular-oauth2-oidc","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).volo=e.volo||{},e.volo.abp=e.volo.abp||{},e.volo.abp.ng=e.volo.abp.ng||{},e.volo.abp.ng.chat=e.volo.abp.ng.chat||{},e.volo.abp.ng.chat.config={}),e.i4,e.ng.core,e.ng.router,e.rxjs,e.rxjs.operators,e.signalR,e.i1,e.i3$1,e.ng.common)}(this,(function(e,t,n,r,o,i,a,s,c,u){"use strict";function p(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var g=p(t),l=p(n),h=p(r),d=p(a),f=p(s),v=p(c),m=p(u),b=function(){function e(e,t,n,r,i,a,s){var c=this;this.restService=e,this.router=t,this.oAuthService=n,this.navItems=r,this.permissionService=i,this.configState=a,this.environmentService=s,this.apiName="Chat",this.message$=new o.Subject,this.unreadMessagesCount=0,this.handleMessage=function(e){c.message$.next(e)},this.listenToAppConfig()}return Object.defineProperty(e.prototype,"isChatEnabled",{get:function(){return"false"!==(this.configState.getFeature("Chat.Enable")||"").toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"signalRUrl",{get:function(){var e,t,n=this.environmentService.getEnvironment().apis;return(null===(e=n[this.apiName])||void 0===e?void 0:e.signalRUrl)||(null===(t=n[this.apiName])||void 0===t?void 0:t.url)||n.default.url},enumerable:!1,configurable:!0}),e.prototype.listenToAppConfig=function(){var e=this;this.configState.createOnUpdateStream((function(e){return e})).subscribe((function(){var t=e.configState.getOne("currentUser");e.isChatEnabled?t.isAuthenticated&&e.permissionService.getGrantedPolicy("Chat.Messaging")?(e.initSignalR(t),e.setTotalUnreadMessageCount()):e.connection&&e.connection.stop():e.toggleChat()}))},e.prototype.toggleChat=function(){var e=this;!this.isChatEnabled&&this.connection&&this.connection.stop(),this.navItems.patchItem("Chat.ChatIconComponent",{visible:function(){return e.isChatEnabled}})},e.prototype.initSignalR=function(e){var t=this;this.conectedUserId!==e.id&&(this.connection&&this.connection.stop(),this.connection=(new d.HubConnectionBuilder).withUrl(this.signalRUrl+"/signalr-hubs/chat",{accessTokenFactory:function(){return t.oAuthService.getAccessToken()}}).build(),this.connection.on("ReceiveMessage",this.handleMessage),this.connection.start().then((function(){t.conectedUserId=e.id})).catch((function(e){return console.error(e.toString())})))},e.prototype.setTotalUnreadMessageCount=function(){var e=this;"/chat"!==this.router.url&&this.restService.request({url:"/api/chat/contact/total-unread-message-count",method:"GET"},{apiName:this.apiName}).subscribe((function(t){return e.unreadMessagesCount=t}))},e}();b.ɵfac=l.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:l,type:b,deps:[{token:f.RestService},{token:h.Router},{token:v.OAuthService},{token:g.NavItemsService},{token:f.PermissionService},{token:f.ConfigStateService},{token:f.EnvironmentService}],target:l.ɵɵFactoryTarget.Injectable}),b.ɵprov=l.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.0",ngImport:l,type:b,providedIn:"root"}),l.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:l,type:b,decorators:[{type:n.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:f.RestService},{type:h.Router},{type:v.OAuthService},{type:g.NavItemsService},{type:f.PermissionService},{type:f.ConfigStateService},{type:f.EnvironmentService}]}});var y=function(){function e(e,t,n){this.chatConfigService=e,this.toaster=t,this.router=n,this.subscription=new o.Subscription,this.listenToMessages(),this.listenToRouterEvents()}return e.prototype.listenToMessages=function(){var e=this;this.subscription.add(this.chatConfigService.message$.pipe(i.filter((function(){return"/chat"!==e.router.url}))).subscribe((function(t){var n=t.senderName,r=t.senderSurname,o=t.senderUsername,i=t.text,a="<strong>"+(""+(n?n+(" "+r||""):o))+"</strong>: "+(i.length>50?i.substring(0,49)+"...":i);e.chatConfigService.unreadMessagesCount++,e.toaster.info(a,"Chat::NewChatMessage",{tapToDismiss:!0})})))},e.prototype.listenToRouterEvents=function(){var e=this;this.subscription.add(this.router.events.pipe(i.filter((function(e){return e instanceof r.NavigationEnd&&"/chat"===e.url}))).subscribe((function(){return e.chatConfigService.unreadMessagesCount=0})))},e.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},e}();y.ɵfac=l.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:l,type:y,deps:[{token:b},{token:g.ToasterService},{token:h.Router}],target:l.ɵɵFactoryTarget.Component}),y.ɵcmp=l.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.0",type:y,selector:"abp-chat-icon",ngImport:l,template:'<div class="position-relative">\n <a routerLink="/chat"\n ><i class="fas fa-envelope fa-lg"></i>\n <span *ngIf="chatConfigService.unreadMessagesCount" class="badge badge-primary">{{\n chatConfigService.unreadMessagesCount\n }}</span></a\n >\n </div>',isInline:!0,styles:["\n a {\n color: inherit;\n }\n\n .badge {\n position: absolute;\n right: -10px;\n top: -8px;\n }\n "],directives:[{type:h.RouterLinkWithHref,selector:"a[routerLink],area[routerLink]",inputs:["routerLink","target","queryParams","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state","relativeTo"]},{type:m.NgIf,selector:"[ngIf]",inputs:["ngIf","ngIfThen","ngIfElse"]}]}),l.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:l,type:y,decorators:[{type:n.Component,args:[{selector:"abp-chat-icon",template:'<div class="position-relative">\n <a routerLink="/chat"\n ><i class="fas fa-envelope fa-lg"></i>\n <span *ngIf="chatConfigService.unreadMessagesCount" class="badge badge-primary">{{\n chatConfigService.unreadMessagesCount\n }}</span></a\n >\n </div>',styles:["\n a {\n color: inherit;\n }\n\n .badge {\n position: absolute;\n right: -10px;\n top: -8px;\n }\n "]}]}],ctorParameters:function(){return[{type:b},{type:g.ToasterService},{type:h.Router}]}});var C=[{provide:n.APP_INITIALIZER,useFactory:I,deps:[t.NavItemsService],multi:!0}];function I(e){return function(){e.addItems([{id:"Chat.ChatIconComponent",requiredPolicy:"Chat.Messaging",component:y,order:99.99}])}}var S=[{provide:n.APP_INITIALIZER,useFactory:M,deps:[s.RoutesService],multi:!0}];function M(e){return function(){e.add([{path:"/chat",name:"Chat",requiredPolicy:"Chat.Messaging",layout:"application",iconClass:"fas fa-envelope",invisible:!0}])}}var T=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[S,C,{provide:n.APP_INITIALIZER,deps:[b,c.OAuthService],multi:!0,useFactory:s.noop}]}},e}();T.ɵfac=l.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:l,type:T,deps:[],target:l.ɵɵFactoryTarget.NgModule}),T.ɵmod=l.ɵɵngDeclareNgModule({minVersion:"12.0.0",version:"12.2.0",ngImport:l,type:T,declarations:[y],imports:[s.CoreModule]}),T.ɵinj=l.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"12.2.0",ngImport:l,type:T,imports:[[s.CoreModule]]}),l.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:l,type:T,decorators:[{type:n.NgModule,args:[{imports:[s.CoreModule],declarations:[y],entryComponents:[y]}]}]}),e.CHAT_NAV_ITEM_PROVIDERS=C,e.CHAT_ROUTE_PROVIDERS=S,e.ChatConfigModule=T,e.ChatConfigService=b,e.ChatIconComponent=y,e.configureNavItems=I,e.configureRoutes=M,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@abp/ng.core")):"function"==typeof define&&define.amd?define("@volo/abp.ng.chat/proxy",["exports","@angular/core","@abp/ng.core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).volo=e.volo||{},e.volo.abp=e.volo.abp||{},e.volo.abp.ng=e.volo.abp.ng||{},e.volo.abp.ng.chat=e.volo.abp.ng.chat||{},e.volo.abp.ng.chat.proxy={}),e.ng.core,e.i1)}(this,(function(e,t,r){"use strict";function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n,o=a(t),i=a(r),s=function(e){var t=this;this.restService=e,this.apiName="Chat",this.getConversation=function(e){return t.restService.request({method:"GET",url:"/api/chat/conversation/conversation",params:{targetUserId:e.targetUserId,skipCount:e.skipCount,maxResultCount:e.maxResultCount}},{apiName:t.apiName})},this.markConversationAsRead=function(e){return t.restService.request({method:"POST",url:"/api/chat/conversation/mark-conversation-as-read",body:e},{apiName:t.apiName})},this.sendMessage=function(e){return t.restService.request({method:"POST",url:"/api/chat/conversation/send-message",body:e},{apiName:t.apiName})}};s.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:o,type:s,deps:[{token:i.RestService}],target:o.ɵɵFactoryTarget.Injectable}),s.ɵprov=o.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.0",ngImport:o,type:s,providedIn:"root"}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:o,type:s,decorators:[{type:t.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:i.RestService}]}}),e.ChatMessageSide=void 0,(n=e.ChatMessageSide||(e.ChatMessageSide={}))[n.Sender=1]="Sender",n[n.Receiver=2]="Receiver";var c=r.mapEnumToOptions(e.ChatMessageSide),p=function(e){var t=this;this.restService=e,this.apiName="Chat",this.setSendOnEnterSetting=function(e){return t.restService.request({method:"POST",url:"/api/chat/settings/send-on-enter",body:e},{apiName:t.apiName})}};p.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:o,type:p,deps:[{token:i.RestService}],target:o.ɵɵFactoryTarget.Injectable}),p.ɵprov=o.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.0",ngImport:o,type:p,providedIn:"root"}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:o,type:p,decorators:[{type:t.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:i.RestService}]}});var u=function(e){var t=this;this.restService=e,this.apiName="Chat",this.getContacts=function(e){return t.restService.request({method:"GET",url:"/api/chat/contact/contacts",params:{filter:e.filter,includeOtherContacts:e.includeOtherContacts}},{apiName:t.apiName})},this.getTotalUnreadMessageCount=function(){return t.restService.request({method:"GET",url:"/api/chat/contact/total-unread-message-count"},{apiName:t.apiName})}};u.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:o,type:u,deps:[{token:i.RestService}],target:o.ɵɵFactoryTarget.Injectable}),u.ɵprov=o.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.0",ngImport:o,type:u,providedIn:"root"}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:o,type:u,decorators:[{type:t.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:i.RestService}]}}),e.ContactService=u,e.ConversationService=s,e.SettingsService=p,e.chatMessageSideOptions=c,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@abp/ng.core"),require("@abp/ng.theme.shared"),require("@angular/core"),require("@angular/router"),require("rxjs"),require("rxjs/operators"),require("@volo/abp.ng.chat/config"),require("@angular/common"),require("@angular/forms")):"function"==typeof define&&define.amd?define("@volo/abp.ng.chat",["exports","@abp/ng.core","@abp/ng.theme.shared","@angular/core","@angular/router","rxjs","rxjs/operators","@volo/abp.ng.chat/config","@angular/common","@angular/forms"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).volo=e.volo||{},e.volo.abp=e.volo.abp||{},e.volo.abp.ng=e.volo.abp.ng||{},e.volo.abp.ng.chat={}),e.i3,e.ng_theme_shared,e.ng.core,e.ng.router,e.rxjs,e.rxjs.operators,e.volo.abp.ng.chat.config,e.ng.common,e.ng.forms)}(this,(function(e,t,n,a,o,s,r,c,i,l){"use strict";function p(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var d=p(t),g=p(a),u=p(o),m=p(c),f=p(i),h=p(l);Object.create;function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var a,o,s=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(a=s.next()).done;)r.push(a.value)}catch(e){o={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return r}function y(e,t,n){if(n||2===arguments.length)for(var a,o=0,s=t.length;o<s;o++)!a&&o in t||(a||(a=Array.prototype.slice.call(t,0,o)),a[o]=t[o]);return e.concat(a||Array.prototype.slice.call(t))}var C;Object.create;!function(e){e[e.Sender=1]="Sender",e[e.Receiver=2]="Receiver"}(C||(C={}));var b=function(){function e(e){this.restService=e,this.apiName="Chat"}return e.prototype.getContactsByInput=function(e){return void 0===e&&(e={}),this.restService.request({url:"/api/chat/contact/contacts",method:"GET",params:e},{apiName:this.apiName})},e}();b.ɵfac=g.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:b,deps:[{token:d.RestService}],target:g.ɵɵFactoryTarget.Injectable}),b.ɵprov=g.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:b,providedIn:"root"}),g.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:b,decorators:[{type:a.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:d.RestService}]}});var x=[{color:"#ffffff",backgroundColor:"#3cb160"},{color:"#ffffff",backgroundColor:"#c373cc"},{color:"#ffffff",backgroundColor:"#2b78b3"},{color:"#ffffff",backgroundColor:"#6ac79a"},{color:"#ffffff",backgroundColor:"#aeb140"},{color:"#ffffff",backgroundColor:"#b773c0"},{color:"#ffffff",backgroundColor:"#e16d7a"},{color:"#ffffff",backgroundColor:"#ffac2a"},{color:"#ffffff",backgroundColor:"#21bbc7"},{color:"#ffffff",backgroundColor:"#59ab95"}],M=function(){function e(){}return Object.defineProperty(e.prototype,"avatarText",{get:function(){if(this.contact&&this.contact.username)return this.contact.name&&this.contact.surname?this.contact.name[0]+this.contact.surname[0]:this.contact.name?this.contact.name.slice(0,2):this.contact.username.slice(0,2)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"avatarBgStyle",{get:function(){if(this.contact&&this.contact.username){for(var e=0,t=0;t<this.contact.username.length;t++)e=this.contact.username.charCodeAt(t)+((e<<5)-e);return x[Math.abs(e%10)]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSmall",{get:function(){return"string"==typeof this.small||this.small},enumerable:!1,configurable:!0}),e}();M.ɵfac=g.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:M,deps:[],target:g.ɵɵFactoryTarget.Component}),M.ɵcmp=g.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.0",type:M,selector:"abp-conversation-avatar",inputs:{contact:"contact",small:"small"},ngImport:g,template:'<div\n class="avatar mx-auto rounded-circle"\n [class.small]="isSmall"\n [ngStyle]="avatarBgStyle"\n >\n {{ avatarText }}\n </div>',isInline:!0,styles:["\n .avatar {\n height: 40px;\n width: 40px;\n line-height: 40px;\n font-size: 16px;\n font-weight: 700;\n text-align: center;\n text-transform: uppercase;\n }\n\n .avatar.small {\n height: 27px;\n width: 27px;\n line-height: 27px;\n font-size: 14px;\n }\n "],directives:[{type:f.NgStyle,selector:"[ngStyle]",inputs:["ngStyle"]}]}),g.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:M,decorators:[{type:a.Component,args:[{selector:"abp-conversation-avatar",template:'<div\n class="avatar mx-auto rounded-circle"\n [class.small]="isSmall"\n [ngStyle]="avatarBgStyle"\n >\n {{ avatarText }}\n </div>',styles:["\n .avatar {\n height: 40px;\n width: 40px;\n line-height: 40px;\n font-size: 16px;\n font-weight: 700;\n text-align: center;\n text-transform: uppercase;\n }\n\n .avatar.small {\n height: 27px;\n width: 27px;\n line-height: 27px;\n font-size: 14px;\n }\n "]}]}],propDecorators:{contact:[{type:a.Input}],small:[{type:a.Input}]}});var I=function(){function e(e,n,o){this.contactService=e,this.chatConfigService=n,this.subscription=o,this.selected=new a.EventEmitter,this.allContacts=[],this.selectedContact={},this.filter="",this.getContactName=S,this.trackByUserId=t.trackBy("userId")}return Object.defineProperty(e.prototype,"contacts",{get:function(){return this.allContacts.filter((function(e){return e.lastMessage})).sort((function(e,t){return new Date(e.lastMessageDate).valueOf()>new Date(t.lastMessageDate).valueOf()?-1:1}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"otherContacts",{get:function(){return this.allContacts.filter((function(e){return!e.lastMessage}))},enumerable:!1,configurable:!0}),e.prototype.listenToNewMessages=function(){var e=this;this.subscription.addOne(this.chatConfigService.message$,(function(t){void 0===t&&(t={});var n=e.allContacts.findIndex((function(e){return e.userId===t.senderUserId})),a={userId:t.senderUserId,username:t.senderUsername,name:t.senderName,surname:t.senderSurname,lastMessage:t.text,unreadMessageCount:1,lastMessageDate:new Date,lastMessageSide:C.Receiver};n>-1?e.allContacts[n]=Object.assign(Object.assign({},a),{unreadMessageCount:e.selectedContact.userId===e.allContacts[n].userId?0:e.allContacts[n].unreadMessageCount+1}):e.filter||e.allContacts.push(a)}))},e.prototype.ngOnInit=function(){var e=this;this.get((function(){e.selectContact(e.allContacts.length?e.allContacts[0]:{}),e.listenToNewMessages()}))},e.prototype.ngOnDestroy=function(){},e.prototype.get=function(e){var t=this;this.contactService.getContactsByInput({includeOtherContacts:!!this.filter,filter:this.filter}).subscribe((function(n){n.length&&(t.allContacts=n,e&&e())}))},e.prototype.selectContact=function(e){this.selectedContact=e,this.selected.emit(e)},e.prototype.changeLastMessageOfSelectedContact=function(e){var t=this;this.selectedContact.lastMessage=e,this.selectedContact.lastMessageDate=new Date;var n=this.allContacts.findIndex((function(e){return e.userId===t.selectedContact.userId}));this.allContacts[n]=this.selectedContact},e.prototype.markSelectedContactAsRead=function(){this.selectedContact.unreadMessageCount=0},e}();function S(e){var t=e.name,n=e.surname,a=e.username;return t||n?(t||"")+" "+(n||""):a}I.ɵfac=g.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:I,deps:[{token:b},{token:m.ChatConfigService},{token:d.SubscriptionService}],target:g.ɵɵFactoryTarget.Component}),I.ɵcmp=g.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.0",type:I,selector:"abp-chat-contacts",outputs:{selected:"selected"},providers:[t.SubscriptionService],ngImport:g,template:'<div class="border-end">\n <div class="p-3 bg-light border-bottom">\n <div class="form-row">\n <div class="col">\n <input\n id="contacts-filter"\n type="search"\n class="form-control form-control-sm"\n autocomplete="off"\n spellcheck="false"\n [(ngModel)]="filter"\n [placeholder]="\'Chat::SearchInContacts\' | abpLocalization"\n [attr.aria-label]="\'Chat::SearchInContacts\' | abpLocalization"\n (input.debounce)="get()"\n />\n </div>\n </div>\n </div>\n\n <div class="messages-box m-0 p-0">\n <div class="list-group rounded-0" id="contact-list">\n <ng-container\n *ngFor="let contact of contacts; let i = index; trackBy: trackByUserId"\n [ngTemplateOutlet]="contactTemplate"\n [ngTemplateOutletContext]="{ $implicit: contact, index: i }"\n >\n </ng-container>\n <div\n *ngIf="otherContacts.length"\n class="list-group-item px-2 py-1 bg-light text-muted text-center font-size-sm text-uppercase border-start-0 border-end-0"\n >\n <small>{{ \'Chat::OtherContacts\' | abpLocalization }}</small>\n </div>\n <ng-container\n *ngFor="let contact of otherContacts; let i = index; trackBy: trackByUserId"\n [ngTemplateOutlet]="contactTemplate"\n [ngTemplateOutletContext]="{ $implicit: contact, index: i }"\n >\n </ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #contactTemplate let-contact let-i="index">\n <a\n (click)="selectContact(contact)"\n class="chat-contact list-group-item list-group-item-action px-4 rounded-0 border-start-0 pointer {{\n selectedContact.userId === contact.userId ? \'active text-white\' : \'\'\n }}"\n ><div class="media">\n <abp-conversation-avatar [contact]="contact"></abp-conversation-avatar>\n <div class="media-body ms-2 d-none d-md-block">\n <div class="d-flex align-items-center justify-content-between mb-1">\n <h6 class="mb-0">\n <small *ngIf="contact.unreadMessageCount" class="badge badge-success me-1">{{\n contact.unreadMessageCount\n }}</small\n >{{ getContactName(contact) }}\n </h6>\n <small class="small font-weight-bold last-message-date">{{\n contact.lastMessageDate | date\n }}</small>\n </div>\n <p class="mb-0 text-small last-message">\n {{\n contact.lastMessage?.length > 24\n ? (contact.lastMessage | slice: 0:23) + \'...\'\n : contact.lastMessage\n }}\n </p>\n </div>\n </div>\n </a>\n</ng-template>\n',styles:["\n .messages-box {\n overflow-y: scroll;\n max-height: calc(100vh - 254.34px);\n }\n "],components:[{type:M,selector:"abp-conversation-avatar",inputs:["contact","small"]}],directives:[{type:h.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{type:h.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{type:h.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]},{type:d.InputEventDebounceDirective,selector:"[input.debounce]",inputs:["debounce"],outputs:["input.debounce"]},{type:f.NgForOf,selector:"[ngFor][ngForOf]",inputs:["ngForOf","ngForTrackBy","ngForTemplate"]},{type:f.NgTemplateOutlet,selector:"[ngTemplateOutlet]",inputs:["ngTemplateOutletContext","ngTemplateOutlet"]},{type:f.NgIf,selector:"[ngIf]",inputs:["ngIf","ngIfThen","ngIfElse"]}],pipes:{abpLocalization:d.LocalizationPipe,date:f.DatePipe,slice:f.SlicePipe}}),g.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:I,decorators:[{type:a.Component,args:[{selector:"abp-chat-contacts",templateUrl:"chat-contacts.component.html",styles:["\n .messages-box {\n overflow-y: scroll;\n max-height: calc(100vh - 254.34px);\n }\n "],providers:[t.SubscriptionService]}]}],ctorParameters:function(){return[{type:b},{type:m.ChatConfigService},{type:d.SubscriptionService}]},propDecorators:{selected:[{type:a.Output}]}});var D=function(){function e(e){this.restService=e,this.apiName="Chat"}return e.prototype.sendMessageByInput=function(e){return this.restService.request({url:"/api/chat/conversation/send-message",method:"POST",body:e},{apiName:this.apiName})},e.prototype.getConversationByInput=function(e){return void 0===e&&(e={}),this.restService.request({url:"/api/chat/conversation/conversation",method:"GET",params:e},{apiName:this.apiName})},e.prototype.markConversationAsReadByInput=function(e){return this.restService.request({url:"/api/chat/conversation/mark-conversation-as-read",method:"POST",body:e},{apiName:this.apiName})},e}();D.ɵfac=g.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:D,deps:[{token:d.RestService}],target:g.ɵɵFactoryTarget.Injectable}),D.ɵprov=g.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:D,providedIn:"root"}),g.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:D,decorators:[{type:a.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:d.RestService}]}});var k=new Date,T=new Date(k.getFullYear(),k.getMonth(),k.getDate()).valueOf(),w=function(){function e(e,n,a,o){var c=this;this.conversationService=e,this.chatConfigService=n,this.configState=a,this.httpWaitService=o,this.selectedContact={},this.unreadMessageCount=0,this.userMessages=new Map,this.chatMessageSide=C,this.trackByMessageDate=t.trackBy("messageDate"),this.destroy$=new s.Subject,this.onScroll=function(e){c.allMessagesLoaded||c.pagingLoading||!c.selectedContact.lastMessage||c.chatBoxRef.nativeElement.scrollTop>250||c.selectedContactMessages.length%50!=0?e.preventDefault():(c.pagingLoading=!0,c.conversationService.getConversationByInput({skipCount:c.selectedContactMessages.length,maxResultCount:50,targetUserId:c.selectedContact.userId}).pipe(r.finalize((function(){return c.pagingLoading=!1}))).subscribe((function(e){var t;e.messages.length?(t=c.userMessages.get(c.selectedContact.userId)).unshift.apply(t,y([],v(e.messages.reverse()))):c.allMessagesLoaded=!0})))},this.httpWaitService.addFilter([{method:"POST",endpoint:"/api/chat/conversation/send-message"},{method:"GET",endpoint:"/api/chat/contact/contacts"}])}return Object.defineProperty(e.prototype,"contactName",{get:function(){return S(this.selectedContact||{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedContactMessages",{get:function(){return this.userMessages.get(this.selectedContact.userId)||[]},enumerable:!1,configurable:!0}),e.prototype.listenToChatBoxScroll=function(){s.fromEvent(this.chatBoxRef.nativeElement,"scroll").pipe(r.debounceTime(150),r.takeUntil(this.destroy$)).subscribe(this.onScroll)},e.prototype.listenToNewMessages=function(){var e=this;this.chatConfigService.message$.pipe(r.takeUntil(this.destroy$)).subscribe((function(t){var n=void 0===t?{}:t,a=n.senderUserId,o=n.text;if(e.userMessages.has(a)){var s=e.selectedContact.userId===a;e.userMessages.get(a).push({message:o,messageDate:new Date,side:C.Receiver,isRead:s,readDate:s?new Date:null}),e.scrollToEnd()}}))},e.prototype.ngAfterViewInit=function(){this.sendOnEnter="false"!==(this.configState.getSetting("Volo.Chat.Messaging.SendMessageOnEnter")||"").toLowerCase(),this.listenToChatBoxScroll(),this.listenToNewMessages()},e.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},e.prototype.getConversation=function(e){var t=this;this.allMessagesLoaded=!1,this.conversationService.getConversationByInput({skipCount:0,maxResultCount:50,targetUserId:this.selectedContact.userId}).subscribe((function(n){t.userMessages.set(t.selectedContact.userId,n.messages.reverse()),e&&t.scrollToEnd(),t.selectedContact.unreadMessageCount&&t.markConversationAsRead()}))},e.prototype.send=function(){var e=this;this.message&&!this.loading&&(this.unreadMessageCount=0,this.loading=!0,this.conversationService.sendMessageByInput({message:this.message,targetUserId:this.selectedContact.userId}).pipe(r.finalize((function(){return e.loading=!1}))).subscribe((function(){e.chatContactsComponent.changeLastMessageOfSelectedContact(e.message),e.userMessages.has(e.selectedContact.userId)||e.userMessages.set(e.selectedContact.userId,[]),e.userMessages.get(e.selectedContact.userId).push({message:e.message,isRead:!0,readDate:k,messageDate:k,side:C.Sender}),e.message="",e.scrollToEnd()})))},e.prototype.markConversationAsRead=function(){var e=this;this.conversationService.markConversationAsReadByInput({targetUserId:this.selectedContact.userId}).subscribe((function(){e.chatContactsComponent.markSelectedContactAsRead(),e.selectedContact.unreadMessageCount=0,setTimeout((function(){return e.unreadMessageCount=0}),5e3)}))},e.prototype.sendWithEnter=function(e){this.sendOnEnter&&(e.preventDefault(),this.send())},e.prototype.onSelectContact=function(e){this.selectedContact=e,this.unreadMessageCount=e.unreadMessageCount,this.scrollToEnd(),!this.userMessages.has(e.userId)&&e.lastMessage?this.getConversation(!0):e.unreadMessageCount&&this.markConversationAsRead()},e.prototype.getDateFormat=function(e){return e=new Date(e),new Date(e.getFullYear(),e.getMonth(),e.getDate()).valueOf()===T?"shortTime":"short"},e.prototype.scrollToEnd=function(){var e=this;setTimeout((function(){var t=(document.querySelector(".unread-message-count-badge-wrapper")||{}).offsetTop;e.chatBoxRef.nativeElement.scrollTo({top:t?t-60:e.chatBoxRef.nativeElement.scrollHeight})}),0)},e}();w.ɵfac=g.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:w,deps:[{token:D},{token:m.ChatConfigService},{token:d.ConfigStateService},{token:d.HttpWaitService}],target:g.ɵɵFactoryTarget.Component}),w.ɵcmp=g.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.0",type:w,selector:"abp-chat",viewQueries:[{propertyName:"chatBoxRef",first:!0,predicate:["chatBox"],descendants:!0},{propertyName:"chatContactsComponent",first:!0,predicate:I,descendants:!0}],ngImport:g,template:'<div class="row entry-row">\n <div class="col-auto"></div>\n <div class="col-lg-auto ps-lg-0"></div>\n <div class="col">\n <div class="text-lg-end pt-2" id="AbpContentToolbar"></div>\n </div>\n</div>\n\n<div id="chat_wrapper">\n <div class="container-fluid">\n <div class="row rounded-lg overflow-hidden shadow bor der">\n <div class="col-3 col-md-5 col-lg-4 px-0">\n <abp-chat-contacts (selected)="onSelectContact($event)"></abp-chat-contacts>\n </div>\n\n \x3c!-- Chat Box--\x3e\n <div class="col-9 col-md-7 col-lg-8 px-0">\n <div class="p-3 bg-light border-bottom">\n <div class="form-row">\n <div class="col">\n <div class="form-row">\n <div class="col-auto">\n <abp-conversation-avatar\n small\n [contact]="selectedContact"\n ></abp-conversation-avatar>\n </div>\n <div class="col pt-1" style="line-height: 1.2">\n <strong id="conversation-title" class="font-weight-bold">{{ contactName }}</strong\n ><br />\n <small id="conversation-info"></small>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div #chatBox id="chat-conversation-wrapper" class="chat-box m-0 p-0">\n <div class="chat-box-container p-4" [id]="\'chat-conversation\'">\n <ng-container\n *ngFor="\n let message of selectedContactMessages;\n let i = index;\n trackBy: trackByMessageDate\n "\n >\n <div\n *ngIf="selectedContactMessages.length - unreadMessageCount === i"\n class="row justify-content-center unread-message-count-badge-wrapper"\n >\n <h3>\n <span class="badge badge-info">\n <ng-container *ngIf="unreadMessageCount === 1; else moreThanOne">\n {{ \'Chat::YouHaveAnUnreadMessage\' | abpLocalization }}\n </ng-container>\n\n <ng-template #moreThanOne>\n {{\n \'Chat::YouHave{0}UnreadMessages\' | abpLocalization: \'\' + unreadMessageCount\n }}\n </ng-template>\n </span>\n </h3>\n </div>\n\n <div\n *ngIf="{ isSender: message.side === chatMessageSide.Sender } as data"\n class="media w-75 mw-65 w-lp-auto mb-2"\n [class.ms-auto]="data.isSender"\n >\n <div class="media-body position-relative">\n <div\n class="shadow rounded py-3 px-4 mb-1 {{\n data.isSender ? \'bg-primary\' : \'bg-light\'\n }}"\n >\n <p\n class="text-small mb-0 {{ data.isSender ? \'text-white\' : \'text-muted\' }}"\n [innerHTML]="message.message"\n ></p>\n </div>\n <p\n class="message-date small text-muted m-0 {{ data.isSender ? \'left\' : \'right\' }}"\n >\n {{ message.messageDate | date: getDateFormat(message.messageDate) }}\n </p>\n </div>\n </div>\n </ng-container>\n </div>\n </div>\n\n \x3c!-- Typing area --\x3e\n <div *ngIf="selectedContact?.userId" id="send-message-form" class="bg-light border-top m-0">\n <div class="p-3">\n <textarea\n id="chat-message-box"\n name="message"\n type="text"\n [placeholder]="\'Chat::TypeMessage\' | abpLocalization"\n class="form-control rounded py-2 bg-white"\n [(ngModel)]="message"\n (keydown.enter)="sendWithEnter($event)"\n ></textarea>\n <div class="form-checkbox float-start mt-3">\n <input\n type="checkbox"\n class="form-check-input me-1"\n id="send-on-enter"\n [(ngModel)]="sendOnEnter"\n />\n <label class="form-check-label" for="send-on-enter">{{\n \'Chat::SendOnEnter\' | abpLocalization\n }}</label>\n </div>\n <div class="mt-2 text-end">\n <button\n [disabled]="!message"\n (click)="send()"\n id="send-message-button"\n type="button"\n class="btn btn-primary px-3"\n >\n {{ \'Chat::Send\' | abpLocalization }}\n <i *ngIf="!loading; else loadingIcon" class="fa fa-paper-plane ms-2"></i>\n\n <ng-template #loadingIcon>\n <i class="fas fa-spinner fa-spin ms-2"></i>\n </ng-template>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n',styles:["\n .chat-box {\n height: calc(100vh - 390px);\n overflow-y: scroll;\n }\n\n .message-date {\n position: absolute;\n opacity: 0.35;\n width: 100px;\n top: 1px;\n }\n\n .message-date.left {\n left: -110px;\n text-align: right;\n }\n\n .message-date.right {\n right: -110px;\n }\n "],components:[{type:I,selector:"abp-chat-contacts",outputs:["selected"]},{type:M,selector:"abp-conversation-avatar",inputs:["contact","small"]}],directives:[{type:f.NgForOf,selector:"[ngFor][ngForOf]",inputs:["ngForOf","ngForTrackBy","ngForTemplate"]},{type:f.NgIf,selector:"[ngIf]",inputs:["ngIf","ngIfThen","ngIfElse"]},{type:h.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{type:h.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{type:h.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]},{type:h.CheckboxControlValueAccessor,selector:"input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]"}],pipes:{abpLocalization:d.LocalizationPipe,date:f.DatePipe}}),g.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:w,decorators:[{type:a.Component,args:[{selector:"abp-chat",templateUrl:"chat.component.html",styles:["\n .chat-box {\n height: calc(100vh - 390px);\n overflow-y: scroll;\n }\n\n .message-date {\n position: absolute;\n opacity: 0.35;\n width: 100px;\n top: 1px;\n }\n\n .message-date.left {\n left: -110px;\n text-align: right;\n }\n\n .message-date.right {\n right: -110px;\n }\n "]}]}],ctorParameters:function(){return[{type:D},{type:m.ChatConfigService},{type:d.ConfigStateService},{type:d.HttpWaitService}]},propDecorators:{chatBoxRef:[{type:a.ViewChild,args:["chatBox",{static:!1}]}],chatContactsComponent:[{type:a.ViewChild,args:[I,{static:!1}]}]}});var O=[{path:"",component:t.DynamicLayoutComponent,canActivate:[t.AuthGuard,t.PermissionGuard],children:[{path:"",component:t.ReplaceableRouteContainerComponent,data:{requiredPolicy:"Chat.Messaging",replaceableComponent:{defaultComponent:w,key:"Chat.ChatComponent"}}}]}],N=function(){};N.ɵfac=g.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:N,deps:[],target:g.ɵɵFactoryTarget.NgModule}),N.ɵmod=g.ɵɵngDeclareNgModule({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:N,imports:[u.RouterModule],exports:[o.RouterModule]}),N.ɵinj=g.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:N,imports:[[o.RouterModule.forChild(O)],o.RouterModule]}),g.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:N,decorators:[{type:a.NgModule,args:[{imports:[o.RouterModule.forChild(O)],exports:[o.RouterModule]}]}]});var j=[w,I,M],B=function(){function e(){}return e.forChild=function(){return{ngModule:e,providers:[]}},e.forLazy=function(){return new t.LazyModuleFactory(e.forChild())},e}();B.ɵfac=g.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:B,deps:[],target:g.ɵɵFactoryTarget.NgModule}),B.ɵmod=g.ɵɵngDeclareNgModule({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:B,declarations:[w,I,M],imports:[t.CoreModule,n.ThemeSharedModule,N],exports:[w,I,M]}),B.ɵinj=g.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:B,imports:[[t.CoreModule,n.ThemeSharedModule,N]]}),g.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:g,type:B,decorators:[{type:a.NgModule,args:[{declarations:j,imports:[t.CoreModule,n.ThemeSharedModule,N],exports:y([],v(j))}]}]}),e.ChatComponent=w,e.ChatContactsComponent=I,e.ChatModule=B,e.ConversationAvatarComponent=M,e.getContactName=S,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{CoreModule,noop}from"@abp/ng.core";import{NgModule,APP_INITIALIZER}from"@angular/core";import{ChatIconComponent}from"./components/chat-icon.component";import{CHAT_NAV_ITEM_PROVIDERS}from"./providers/nav-item.provider";import{CHAT_ROUTE_PROVIDERS}from"./providers/route.provider";import{ChatConfigService}from"./services/chat-config.service";import{OAuthService}from"angular-oauth2-oidc";import*as i0 from"@angular/core";export class ChatConfigModule{static forRoot(){return{ngModule:ChatConfigModule,providers:[CHAT_ROUTE_PROVIDERS,CHAT_NAV_ITEM_PROVIDERS,{provide:APP_INITIALIZER,deps:[ChatConfigService,OAuthService],multi:!0,useFactory:noop}]}}}ChatConfigModule.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatConfigModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule}),ChatConfigModule.ɵmod=i0.ɵɵngDeclareNgModule({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatConfigModule,declarations:[ChatIconComponent],imports:[CoreModule]}),ChatConfigModule.ɵinj=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatConfigModule,imports:[[CoreModule]]}),i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatConfigModule,decorators:[{type:NgModule,args:[{imports:[CoreModule],declarations:[ChatIconComponent],entryComponents:[ChatIconComponent]}]}]});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ToasterService}from"@abp/ng.theme.shared";import{Component}from"@angular/core";import{NavigationEnd,Router}from"@angular/router";import{Subscription}from"rxjs";import{filter}from"rxjs/operators";import{ChatConfigService}from"../services/chat-config.service";import*as i0 from"@angular/core";import*as i1 from"../services/chat-config.service";import*as i2 from"@abp/ng.theme.shared";import*as i3 from"@angular/router";import*as i4 from"@angular/common";export class ChatIconComponent{constructor(e,t,n){this.chatConfigService=e,this.toaster=t,this.router=n,this.subscription=new Subscription,this.listenToMessages(),this.listenToRouterEvents()}listenToMessages(){this.subscription.add(this.chatConfigService.message$.pipe(filter(()=>"/chat"!==this.router.url)).subscribe(e=>{const{senderName:t,senderSurname:n,senderUsername:r,text:i}=e,o=`<strong>${""+(t?t+(" "+n||""):r)}</strong>: ${i.length>50?i.substring(0,49)+"...":i}`;this.chatConfigService.unreadMessagesCount++,this.toaster.info(o,"Chat::NewChatMessage",{tapToDismiss:!0})}))}listenToRouterEvents(){this.subscription.add(this.router.events.pipe(filter(e=>e instanceof NavigationEnd&&"/chat"===e.url)).subscribe(()=>this.chatConfigService.unreadMessagesCount=0))}ngOnDestroy(){this.subscription.unsubscribe()}}ChatIconComponent.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatIconComponent,deps:[{token:i1.ChatConfigService},{token:i2.ToasterService},{token:i3.Router}],target:i0.ɵɵFactoryTarget.Component}),ChatIconComponent.ɵcmp=i0.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.0",type:ChatIconComponent,selector:"abp-chat-icon",ngImport:i0,template:'<div class="position-relative">\n <a routerLink="/chat"\n ><i class="fas fa-envelope fa-lg"></i>\n <span *ngIf="chatConfigService.unreadMessagesCount" class="badge badge-primary">{{\n chatConfigService.unreadMessagesCount\n }}</span></a\n >\n </div>',isInline:!0,styles:["\n a {\n color: inherit;\n }\n\n .badge {\n position: absolute;\n right: -10px;\n top: -8px;\n }\n "],directives:[{type:i3.RouterLinkWithHref,selector:"a[routerLink],area[routerLink]",inputs:["routerLink","target","queryParams","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state","relativeTo"]},{type:i4.NgIf,selector:"[ngIf]",inputs:["ngIf","ngIfThen","ngIfElse"]}]}),i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatIconComponent,decorators:[{type:Component,args:[{selector:"abp-chat-icon",template:'<div class="position-relative">\n <a routerLink="/chat"\n ><i class="fas fa-envelope fa-lg"></i>\n <span *ngIf="chatConfigService.unreadMessagesCount" class="badge badge-primary">{{\n chatConfigService.unreadMessagesCount\n }}</span></a\n >\n </div>',styles:["\n a {\n color: inherit;\n }\n\n .badge {\n position: absolute;\n right: -10px;\n top: -8px;\n }\n "]}]}],ctorParameters:function(){return[{type:i1.ChatConfigService},{type:i2.ToasterService},{type:i3.Router}]}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./policy-names";export*from"./route-names";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./nav-item.provider";export*from"./route.provider";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{NavItemsService}from"@abp/ng.theme.shared";import{APP_INITIALIZER}from"@angular/core";import{ChatIconComponent}from"../components/chat-icon.component";export const CHAT_NAV_ITEM_PROVIDERS=[{provide:APP_INITIALIZER,useFactory:configureNavItems,deps:[NavItemsService],multi:!0}];export function configureNavItems(o){return()=>{o.addItems([{id:"Chat.ChatIconComponent",requiredPolicy:"Chat.Messaging",component:ChatIconComponent,order:99.99}])}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{RoutesService}from"@abp/ng.core";import{APP_INITIALIZER}from"@angular/core";export const CHAT_ROUTE_PROVIDERS=[{provide:APP_INITIALIZER,useFactory:configureRoutes,deps:[RoutesService],multi:!0}];export function configureRoutes(e){return()=>{e.add([{path:"/chat",name:"Chat",requiredPolicy:"Chat.Messaging",layout:"application",iconClass:"fas fa-envelope",invisible:!0}])}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./enums";export*from"./providers";export*from"./chat-config.module";export*from"./components/chat-icon.component";export*from"./services/chat-config.service";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ConfigStateService,EnvironmentService,PermissionService,RestService}from"@abp/ng.core";import{NavItemsService}from"@abp/ng.theme.shared";import{Injectable}from"@angular/core";import{Router}from"@angular/router";import*as signalR from"@microsoft/signalr";import{OAuthService}from"angular-oauth2-oidc";import{Subject}from"rxjs";import*as i0 from"@angular/core";import*as i1 from"@abp/ng.core";import*as i2 from"@angular/router";import*as i3 from"angular-oauth2-oidc";import*as i4 from"@abp/ng.theme.shared";const permission="Chat.Messaging";export class ChatConfigService{constructor(e,t,i,n,r,o,s){this.restService=e,this.router=t,this.oAuthService=i,this.navItems=n,this.permissionService=r,this.configState=o,this.environmentService=s,this.apiName="Chat",this.message$=new Subject,this.unreadMessagesCount=0,this.handleMessage=e=>{this.message$.next(e)},this.listenToAppConfig()}get isChatEnabled(){return"false"!==(this.configState.getFeature("Chat.Enable")||"").toLowerCase()}get signalRUrl(){var e,t;const{apis:i}=this.environmentService.getEnvironment();return(null===(e=i[this.apiName])||void 0===e?void 0:e.signalRUrl)||(null===(t=i[this.apiName])||void 0===t?void 0:t.url)||i.default.url}listenToAppConfig(){this.configState.createOnUpdateStream(e=>e).subscribe(()=>{const e=this.configState.getOne("currentUser");this.isChatEnabled?e.isAuthenticated&&this.permissionService.getGrantedPolicy(permission)?(this.initSignalR(e),this.setTotalUnreadMessageCount()):this.connection&&this.connection.stop():this.toggleChat()})}toggleChat(){!this.isChatEnabled&&this.connection&&this.connection.stop(),this.navItems.patchItem("Chat.ChatIconComponent",{visible:()=>this.isChatEnabled})}initSignalR(e){this.conectedUserId!==e.id&&(this.connection&&this.connection.stop(),this.connection=(new signalR.HubConnectionBuilder).withUrl(this.signalRUrl+"/signalr-hubs/chat",{accessTokenFactory:()=>this.oAuthService.getAccessToken()}).build(),this.connection.on("ReceiveMessage",this.handleMessage),this.connection.start().then(()=>{this.conectedUserId=e.id}).catch(e=>console.error(e.toString())))}setTotalUnreadMessageCount(){"/chat"!==this.router.url&&this.restService.request({url:"/api/chat/contact/total-unread-message-count",method:"GET"},{apiName:this.apiName}).subscribe(e=>this.unreadMessagesCount=e)}}ChatConfigService.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatConfigService,deps:[{token:i1.RestService},{token:i2.Router},{token:i3.OAuthService},{token:i4.NavItemsService},{token:i1.PermissionService},{token:i1.ConfigStateService},{token:i1.EnvironmentService}],target:i0.ɵɵFactoryTarget.Injectable}),ChatConfigService.ɵprov=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatConfigService,providedIn:"root"}),i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatConfigService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:i1.RestService},{type:i2.Router},{type:i3.OAuthService},{type:i4.NavItemsService},{type:i1.PermissionService},{type:i1.ConfigStateService},{type:i1.EnvironmentService}]}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./public-api";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{AuthGuard,DynamicLayoutComponent,PermissionGuard,ReplaceableRouteContainerComponent}from"@abp/ng.core";import{NgModule}from"@angular/core";import{RouterModule}from"@angular/router";import{ChatComponent}from"./components/chat.component";import*as i0 from"@angular/core";import*as i1 from"@angular/router";const routes=[{path:"",component:DynamicLayoutComponent,canActivate:[AuthGuard,PermissionGuard],children:[{path:"",component:ReplaceableRouteContainerComponent,data:{requiredPolicy:"Chat.Messaging",replaceableComponent:{defaultComponent:ChatComponent,key:"Chat.ChatComponent"}}}]}];export class ChatRoutingModule{}ChatRoutingModule.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatRoutingModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule}),ChatRoutingModule.ɵmod=i0.ɵɵngDeclareNgModule({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatRoutingModule,imports:[i1.RouterModule],exports:[RouterModule]}),ChatRoutingModule.ɵinj=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatRoutingModule,imports:[[RouterModule.forChild(routes)],RouterModule]}),i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatRoutingModule,decorators:[{type:NgModule,args:[{imports:[RouterModule.forChild(routes)],exports:[RouterModule]}]}]});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{CoreModule,LazyModuleFactory}from"@abp/ng.core";import{ThemeSharedModule}from"@abp/ng.theme.shared";import{NgModule}from"@angular/core";import{ChatRoutingModule}from"./chat-routing.module";import{ChatContactsComponent}from"./components/chat-contacts.component";import{ChatComponent}from"./components/chat.component";import{ConversationAvatarComponent}from"./components/conversation-avatar.component";import*as i0 from"@angular/core";const declarations=[ChatComponent,ChatContactsComponent,ConversationAvatarComponent];export class ChatModule{static forChild(){return{ngModule:ChatModule,providers:[]}}static forLazy(){return new LazyModuleFactory(ChatModule.forChild())}}ChatModule.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule}),ChatModule.ɵmod=i0.ɵɵngDeclareNgModule({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatModule,declarations:[ChatComponent,ChatContactsComponent,ConversationAvatarComponent],imports:[CoreModule,ThemeSharedModule,ChatRoutingModule],exports:[ChatComponent,ChatContactsComponent,ConversationAvatarComponent]}),ChatModule.ɵinj=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatModule,imports:[[CoreModule,ThemeSharedModule,ChatRoutingModule]]}),i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatModule,decorators:[{type:NgModule,args:[{declarations:declarations,imports:[CoreModule,ThemeSharedModule,ChatRoutingModule],exports:[...declarations]}]}]});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{SubscriptionService,trackBy}from"@abp/ng.core";import{Component,EventEmitter,Output}from"@angular/core";import{ChatConfigService}from"@volo/abp.ng.chat/config";import{ChatMessageSide}from"../enums/chat-message-side";import{ContactService}from"../services/contact.service";import*as i0 from"@angular/core";import*as i1 from"../services/contact.service";import*as i2 from"@volo/abp.ng.chat/config";import*as i3 from"@abp/ng.core";import*as i4 from"./conversation-avatar.component";import*as i5 from"@angular/forms";import*as i6 from"@angular/common";export class ChatContactsComponent{constructor(t,e,n){this.contactService=t,this.chatConfigService=e,this.subscription=n,this.selected=new EventEmitter,this.allContacts=[],this.selectedContact={},this.filter="",this.getContactName=getContactName,this.trackByUserId=trackBy("userId")}get contacts(){return this.allContacts.filter(t=>t.lastMessage).sort((t,e)=>new Date(t.lastMessageDate).valueOf()>new Date(e.lastMessageDate).valueOf()?-1:1)}get otherContacts(){return this.allContacts.filter(t=>!t.lastMessage)}listenToNewMessages(){this.subscription.addOne(this.chatConfigService.message$,(t={})=>{const e=this.allContacts.findIndex(e=>e.userId===t.senderUserId),n={userId:t.senderUserId,username:t.senderUsername,name:t.senderName,surname:t.senderSurname,lastMessage:t.text,unreadMessageCount:1,lastMessageDate:new Date,lastMessageSide:ChatMessageSide.Receiver};e>-1?this.allContacts[e]=Object.assign(Object.assign({},n),{unreadMessageCount:this.selectedContact.userId===this.allContacts[e].userId?0:this.allContacts[e].unreadMessageCount+1}):this.filter||this.allContacts.push(n)})}ngOnInit(){this.get(()=>{this.selectContact(this.allContacts.length?this.allContacts[0]:{}),this.listenToNewMessages()})}ngOnDestroy(){}get(t){this.contactService.getContactsByInput({includeOtherContacts:!!this.filter,filter:this.filter}).subscribe(e=>{e.length&&(this.allContacts=e,t&&t())})}selectContact(t){this.selectedContact=t,this.selected.emit(t)}changeLastMessageOfSelectedContact(t){this.selectedContact.lastMessage=t,this.selectedContact.lastMessageDate=new Date;const e=this.allContacts.findIndex(t=>t.userId===this.selectedContact.userId);this.allContacts[e]=this.selectedContact}markSelectedContactAsRead(){this.selectedContact.unreadMessageCount=0}}ChatContactsComponent.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatContactsComponent,deps:[{token:i1.ContactService},{token:i2.ChatConfigService},{token:i3.SubscriptionService}],target:i0.ɵɵFactoryTarget.Component}),ChatContactsComponent.ɵcmp=i0.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.0",type:ChatContactsComponent,selector:"abp-chat-contacts",outputs:{selected:"selected"},providers:[SubscriptionService],ngImport:i0,template:'<div class="border-end">\n <div class="p-3 bg-light border-bottom">\n <div class="form-row">\n <div class="col">\n <input\n id="contacts-filter"\n type="search"\n class="form-control form-control-sm"\n autocomplete="off"\n spellcheck="false"\n [(ngModel)]="filter"\n [placeholder]="\'Chat::SearchInContacts\' | abpLocalization"\n [attr.aria-label]="\'Chat::SearchInContacts\' | abpLocalization"\n (input.debounce)="get()"\n />\n </div>\n </div>\n </div>\n\n <div class="messages-box m-0 p-0">\n <div class="list-group rounded-0" id="contact-list">\n <ng-container\n *ngFor="let contact of contacts; let i = index; trackBy: trackByUserId"\n [ngTemplateOutlet]="contactTemplate"\n [ngTemplateOutletContext]="{ $implicit: contact, index: i }"\n >\n </ng-container>\n <div\n *ngIf="otherContacts.length"\n class="list-group-item px-2 py-1 bg-light text-muted text-center font-size-sm text-uppercase border-start-0 border-end-0"\n >\n <small>{{ \'Chat::OtherContacts\' | abpLocalization }}</small>\n </div>\n <ng-container\n *ngFor="let contact of otherContacts; let i = index; trackBy: trackByUserId"\n [ngTemplateOutlet]="contactTemplate"\n [ngTemplateOutletContext]="{ $implicit: contact, index: i }"\n >\n </ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #contactTemplate let-contact let-i="index">\n <a\n (click)="selectContact(contact)"\n class="chat-contact list-group-item list-group-item-action px-4 rounded-0 border-start-0 pointer {{\n selectedContact.userId === contact.userId ? \'active text-white\' : \'\'\n }}"\n ><div class="media">\n <abp-conversation-avatar [contact]="contact"></abp-conversation-avatar>\n <div class="media-body ms-2 d-none d-md-block">\n <div class="d-flex align-items-center justify-content-between mb-1">\n <h6 class="mb-0">\n <small *ngIf="contact.unreadMessageCount" class="badge badge-success me-1">{{\n contact.unreadMessageCount\n }}</small\n >{{ getContactName(contact) }}\n </h6>\n <small class="small font-weight-bold last-message-date">{{\n contact.lastMessageDate | date\n }}</small>\n </div>\n <p class="mb-0 text-small last-message">\n {{\n contact.lastMessage?.length > 24\n ? (contact.lastMessage | slice: 0:23) + \'...\'\n : contact.lastMessage\n }}\n </p>\n </div>\n </div>\n </a>\n</ng-template>\n',styles:["\n .messages-box {\n overflow-y: scroll;\n max-height: calc(100vh - 254.34px);\n }\n "],components:[{type:i4.ConversationAvatarComponent,selector:"abp-conversation-avatar",inputs:["contact","small"]}],directives:[{type:i5.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{type:i5.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{type:i5.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]},{type:i3.InputEventDebounceDirective,selector:"[input.debounce]",inputs:["debounce"],outputs:["input.debounce"]},{type:i6.NgForOf,selector:"[ngFor][ngForOf]",inputs:["ngForOf","ngForTrackBy","ngForTemplate"]},{type:i6.NgTemplateOutlet,selector:"[ngTemplateOutlet]",inputs:["ngTemplateOutletContext","ngTemplateOutlet"]},{type:i6.NgIf,selector:"[ngIf]",inputs:["ngIf","ngIfThen","ngIfElse"]}],pipes:{abpLocalization:i3.LocalizationPipe,date:i6.DatePipe,slice:i6.SlicePipe}}),i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatContactsComponent,decorators:[{type:Component,args:[{selector:"abp-chat-contacts",templateUrl:"chat-contacts.component.html",styles:["\n .messages-box {\n overflow-y: scroll;\n max-height: calc(100vh - 254.34px);\n }\n "],providers:[SubscriptionService]}]}],ctorParameters:function(){return[{type:i1.ContactService},{type:i2.ChatConfigService},{type:i3.SubscriptionService}]},propDecorators:{selected:[{type:Output}]}});export function getContactName({name:t,surname:e,username:n}){return t||e?`${t||""} ${e||""}`:n}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ConfigStateService,HttpWaitService,trackBy}from"@abp/ng.core";import{Component,ElementRef,ViewChild}from"@angular/core";import{ChatConfigService}from"@volo/abp.ng.chat/config";import{fromEvent,Subject}from"rxjs";import{debounceTime,finalize,takeUntil}from"rxjs/operators";import{ChatMessageSide}from"../enums/chat-message-side";import{ConversationService}from"../services/conversation.service";import{ChatContactsComponent,getContactName}from"./chat-contacts.component";import*as i0 from"@angular/core";import*as i1 from"../services/conversation.service";import*as i2 from"@volo/abp.ng.chat/config";import*as i3 from"@abp/ng.core";import*as i4 from"./chat-contacts.component";import*as i5 from"./conversation-avatar.component";import*as i6 from"@angular/common";import*as i7 from"@angular/forms";const now=new Date,today=new Date(now.getFullYear(),now.getMonth(),now.getDate()).valueOf();export class ChatComponent{constructor(e,t,n,s){this.conversationService=e,this.chatConfigService=t,this.configState=n,this.httpWaitService=s,this.selectedContact={},this.unreadMessageCount=0,this.userMessages=new Map,this.chatMessageSide=ChatMessageSide,this.trackByMessageDate=trackBy("messageDate"),this.destroy$=new Subject,this.onScroll=e=>{this.allMessagesLoaded||this.pagingLoading||!this.selectedContact.lastMessage||this.chatBoxRef.nativeElement.scrollTop>250||this.selectedContactMessages.length%50!=0?e.preventDefault():(this.pagingLoading=!0,this.conversationService.getConversationByInput({skipCount:this.selectedContactMessages.length,maxResultCount:50,targetUserId:this.selectedContact.userId}).pipe(finalize(()=>this.pagingLoading=!1)).subscribe(e=>{e.messages.length?this.userMessages.get(this.selectedContact.userId).unshift(...e.messages.reverse()):this.allMessagesLoaded=!0}))},this.httpWaitService.addFilter([{method:"POST",endpoint:"/api/chat/conversation/send-message"},{method:"GET",endpoint:"/api/chat/contact/contacts"}])}get contactName(){return getContactName(this.selectedContact||{})}get selectedContactMessages(){return this.userMessages.get(this.selectedContact.userId)||[]}listenToChatBoxScroll(){fromEvent(this.chatBoxRef.nativeElement,"scroll").pipe(debounceTime(150),takeUntil(this.destroy$)).subscribe(this.onScroll)}listenToNewMessages(){this.chatConfigService.message$.pipe(takeUntil(this.destroy$)).subscribe(({senderUserId:e,text:t}={})=>{if(!this.userMessages.has(e))return;const n=this.selectedContact.userId===e;this.userMessages.get(e).push({message:t,messageDate:new Date,side:ChatMessageSide.Receiver,isRead:n,readDate:n?new Date:null}),this.scrollToEnd()})}ngAfterViewInit(){this.sendOnEnter="false"!==(this.configState.getSetting("Volo.Chat.Messaging.SendMessageOnEnter")||"").toLowerCase(),this.listenToChatBoxScroll(),this.listenToNewMessages()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}getConversation(e){this.allMessagesLoaded=!1,this.conversationService.getConversationByInput({skipCount:0,maxResultCount:50,targetUserId:this.selectedContact.userId}).subscribe(t=>{this.userMessages.set(this.selectedContact.userId,t.messages.reverse()),e&&this.scrollToEnd(),this.selectedContact.unreadMessageCount&&this.markConversationAsRead()})}send(){this.message&&!this.loading&&(this.unreadMessageCount=0,this.loading=!0,this.conversationService.sendMessageByInput({message:this.message,targetUserId:this.selectedContact.userId}).pipe(finalize(()=>this.loading=!1)).subscribe(()=>{this.chatContactsComponent.changeLastMessageOfSelectedContact(this.message),this.userMessages.has(this.selectedContact.userId)||this.userMessages.set(this.selectedContact.userId,[]),this.userMessages.get(this.selectedContact.userId).push({message:this.message,isRead:!0,readDate:now,messageDate:now,side:ChatMessageSide.Sender}),this.message="",this.scrollToEnd()}))}markConversationAsRead(){this.conversationService.markConversationAsReadByInput({targetUserId:this.selectedContact.userId}).subscribe(()=>{this.chatContactsComponent.markSelectedContactAsRead(),this.selectedContact.unreadMessageCount=0,setTimeout(()=>this.unreadMessageCount=0,5e3)})}sendWithEnter(e){this.sendOnEnter&&(e.preventDefault(),this.send())}onSelectContact(e){this.selectedContact=e,this.unreadMessageCount=e.unreadMessageCount,this.scrollToEnd(),!this.userMessages.has(e.userId)&&e.lastMessage?this.getConversation(!0):e.unreadMessageCount&&this.markConversationAsRead()}getDateFormat(e){e=new Date(e);return new Date(e.getFullYear(),e.getMonth(),e.getDate()).valueOf()===today?"shortTime":"short"}scrollToEnd(){setTimeout(()=>{const{offsetTop:e}=document.querySelector(".unread-message-count-badge-wrapper")||{};this.chatBoxRef.nativeElement.scrollTo({top:e?e-60:this.chatBoxRef.nativeElement.scrollHeight})},0)}}ChatComponent.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatComponent,deps:[{token:i1.ConversationService},{token:i2.ChatConfigService},{token:i3.ConfigStateService},{token:i3.HttpWaitService}],target:i0.ɵɵFactoryTarget.Component}),ChatComponent.ɵcmp=i0.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.0",type:ChatComponent,selector:"abp-chat",viewQueries:[{propertyName:"chatBoxRef",first:!0,predicate:["chatBox"],descendants:!0},{propertyName:"chatContactsComponent",first:!0,predicate:ChatContactsComponent,descendants:!0}],ngImport:i0,template:'<div class="row entry-row">\n <div class="col-auto"></div>\n <div class="col-lg-auto ps-lg-0"></div>\n <div class="col">\n <div class="text-lg-end pt-2" id="AbpContentToolbar"></div>\n </div>\n</div>\n\n<div id="chat_wrapper">\n <div class="container-fluid">\n <div class="row rounded-lg overflow-hidden shadow bor der">\n <div class="col-3 col-md-5 col-lg-4 px-0">\n <abp-chat-contacts (selected)="onSelectContact($event)"></abp-chat-contacts>\n </div>\n\n \x3c!-- Chat Box--\x3e\n <div class="col-9 col-md-7 col-lg-8 px-0">\n <div class="p-3 bg-light border-bottom">\n <div class="form-row">\n <div class="col">\n <div class="form-row">\n <div class="col-auto">\n <abp-conversation-avatar\n small\n [contact]="selectedContact"\n ></abp-conversation-avatar>\n </div>\n <div class="col pt-1" style="line-height: 1.2">\n <strong id="conversation-title" class="font-weight-bold">{{ contactName }}</strong\n ><br />\n <small id="conversation-info"></small>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div #chatBox id="chat-conversation-wrapper" class="chat-box m-0 p-0">\n <div class="chat-box-container p-4" [id]="\'chat-conversation\'">\n <ng-container\n *ngFor="\n let message of selectedContactMessages;\n let i = index;\n trackBy: trackByMessageDate\n "\n >\n <div\n *ngIf="selectedContactMessages.length - unreadMessageCount === i"\n class="row justify-content-center unread-message-count-badge-wrapper"\n >\n <h3>\n <span class="badge badge-info">\n <ng-container *ngIf="unreadMessageCount === 1; else moreThanOne">\n {{ \'Chat::YouHaveAnUnreadMessage\' | abpLocalization }}\n </ng-container>\n\n <ng-template #moreThanOne>\n {{\n \'Chat::YouHave{0}UnreadMessages\' | abpLocalization: \'\' + unreadMessageCount\n }}\n </ng-template>\n </span>\n </h3>\n </div>\n\n <div\n *ngIf="{ isSender: message.side === chatMessageSide.Sender } as data"\n class="media w-75 mw-65 w-lp-auto mb-2"\n [class.ms-auto]="data.isSender"\n >\n <div class="media-body position-relative">\n <div\n class="shadow rounded py-3 px-4 mb-1 {{\n data.isSender ? \'bg-primary\' : \'bg-light\'\n }}"\n >\n <p\n class="text-small mb-0 {{ data.isSender ? \'text-white\' : \'text-muted\' }}"\n [innerHTML]="message.message"\n ></p>\n </div>\n <p\n class="message-date small text-muted m-0 {{ data.isSender ? \'left\' : \'right\' }}"\n >\n {{ message.messageDate | date: getDateFormat(message.messageDate) }}\n </p>\n </div>\n </div>\n </ng-container>\n </div>\n </div>\n\n \x3c!-- Typing area --\x3e\n <div *ngIf="selectedContact?.userId" id="send-message-form" class="bg-light border-top m-0">\n <div class="p-3">\n <textarea\n id="chat-message-box"\n name="message"\n type="text"\n [placeholder]="\'Chat::TypeMessage\' | abpLocalization"\n class="form-control rounded py-2 bg-white"\n [(ngModel)]="message"\n (keydown.enter)="sendWithEnter($event)"\n ></textarea>\n <div class="form-checkbox float-start mt-3">\n <input\n type="checkbox"\n class="form-check-input me-1"\n id="send-on-enter"\n [(ngModel)]="sendOnEnter"\n />\n <label class="form-check-label" for="send-on-enter">{{\n \'Chat::SendOnEnter\' | abpLocalization\n }}</label>\n </div>\n <div class="mt-2 text-end">\n <button\n [disabled]="!message"\n (click)="send()"\n id="send-message-button"\n type="button"\n class="btn btn-primary px-3"\n >\n {{ \'Chat::Send\' | abpLocalization }}\n <i *ngIf="!loading; else loadingIcon" class="fa fa-paper-plane ms-2"></i>\n\n <ng-template #loadingIcon>\n <i class="fas fa-spinner fa-spin ms-2"></i>\n </ng-template>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n',styles:["\n .chat-box {\n height: calc(100vh - 390px);\n overflow-y: scroll;\n }\n\n .message-date {\n position: absolute;\n opacity: 0.35;\n width: 100px;\n top: 1px;\n }\n\n .message-date.left {\n left: -110px;\n text-align: right;\n }\n\n .message-date.right {\n right: -110px;\n }\n "],components:[{type:i4.ChatContactsComponent,selector:"abp-chat-contacts",outputs:["selected"]},{type:i5.ConversationAvatarComponent,selector:"abp-conversation-avatar",inputs:["contact","small"]}],directives:[{type:i6.NgForOf,selector:"[ngFor][ngForOf]",inputs:["ngForOf","ngForTrackBy","ngForTemplate"]},{type:i6.NgIf,selector:"[ngIf]",inputs:["ngIf","ngIfThen","ngIfElse"]},{type:i7.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{type:i7.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{type:i7.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]},{type:i7.CheckboxControlValueAccessor,selector:"input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]"}],pipes:{abpLocalization:i3.LocalizationPipe,date:i6.DatePipe}}),i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ChatComponent,decorators:[{type:Component,args:[{selector:"abp-chat",templateUrl:"chat.component.html",styles:["\n .chat-box {\n height: calc(100vh - 390px);\n overflow-y: scroll;\n }\n\n .message-date {\n position: absolute;\n opacity: 0.35;\n width: 100px;\n top: 1px;\n }\n\n .message-date.left {\n left: -110px;\n text-align: right;\n }\n\n .message-date.right {\n right: -110px;\n }\n "]}]}],ctorParameters:function(){return[{type:i1.ConversationService},{type:i2.ChatConfigService},{type:i3.ConfigStateService},{type:i3.HttpWaitService}]},propDecorators:{chatBoxRef:[{type:ViewChild,args:["chatBox",{static:!1}]}],chatContactsComponent:[{type:ViewChild,args:[ChatContactsComponent,{static:!1}]}]}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Component,Input}from"@angular/core";import{ChatContactDto}from"../models/chat-contact-dto";import*as i0 from"@angular/core";import*as i1 from"@angular/common";const avatarStyles=[{color:"#ffffff",backgroundColor:"#3cb160"},{color:"#ffffff",backgroundColor:"#c373cc"},{color:"#ffffff",backgroundColor:"#2b78b3"},{color:"#ffffff",backgroundColor:"#6ac79a"},{color:"#ffffff",backgroundColor:"#aeb140"},{color:"#ffffff",backgroundColor:"#b773c0"},{color:"#ffffff",backgroundColor:"#e16d7a"},{color:"#ffffff",backgroundColor:"#ffac2a"},{color:"#ffffff",backgroundColor:"#21bbc7"},{color:"#ffffff",backgroundColor:"#59ab95"}];export class ConversationAvatarComponent{get avatarText(){if(this.contact&&this.contact.username)return this.contact.name&&this.contact.surname?this.contact.name[0]+this.contact.surname[0]:this.contact.name?this.contact.name.slice(0,2):this.contact.username.slice(0,2)}get avatarBgStyle(){if(!this.contact||!this.contact.username)return;let t=0;for(let n=0;n<this.contact.username.length;n++)t=this.contact.username.charCodeAt(n)+((t<<5)-t);return avatarStyles[Math.abs(t%10)]}get isSmall(){return"string"==typeof this.small||this.small}}ConversationAvatarComponent.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ConversationAvatarComponent,deps:[],target:i0.ɵɵFactoryTarget.Component}),ConversationAvatarComponent.ɵcmp=i0.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.0",type:ConversationAvatarComponent,selector:"abp-conversation-avatar",inputs:{contact:"contact",small:"small"},ngImport:i0,template:'<div\n class="avatar mx-auto rounded-circle"\n [class.small]="isSmall"\n [ngStyle]="avatarBgStyle"\n >\n {{ avatarText }}\n </div>',isInline:!0,styles:["\n .avatar {\n height: 40px;\n width: 40px;\n line-height: 40px;\n font-size: 16px;\n font-weight: 700;\n text-align: center;\n text-transform: uppercase;\n }\n\n .avatar.small {\n height: 27px;\n width: 27px;\n line-height: 27px;\n font-size: 14px;\n }\n "],directives:[{type:i1.NgStyle,selector:"[ngStyle]",inputs:["ngStyle"]}]}),i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ConversationAvatarComponent,decorators:[{type:Component,args:[{selector:"abp-conversation-avatar",template:'<div\n class="avatar mx-auto rounded-circle"\n [class.small]="isSmall"\n [ngStyle]="avatarBgStyle"\n >\n {{ avatarText }}\n </div>',styles:["\n .avatar {\n height: 40px;\n width: 40px;\n line-height: 40px;\n font-size: 16px;\n font-weight: 700;\n text-align: center;\n text-transform: uppercase;\n }\n\n .avatar.small {\n height: 27px;\n width: 27px;\n line-height: 27px;\n font-size: 14px;\n }\n "]}]}],propDecorators:{contact:[{type:Input}],small:[{type:Input}]}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./chat.component";export*from"./chat-contacts.component";export*from"./conversation-avatar.component";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var ChatMessageSide;!function(e){e[e.Sender=1]="Sender",e[e.Receiver=2]="Receiver"}(ChatMessageSide||(ChatMessageSide={}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export class ChatContactDto{constructor(t={}){if(t)for(const o in t)t.hasOwnProperty(o)&&(this[o]=t[o])}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export class ChatConversationDto{constructor(o={}){if(o)for(const t in o)o.hasOwnProperty(t)&&(this[t]=o[t])}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export class ChatMessageDto{constructor(s={}){if(s)for(const t in s)s.hasOwnProperty(t)&&(this[t]=s[t])}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export class ChatTargetUserInfo{constructor(r={}){if(r)for(const t in r)r.hasOwnProperty(t)&&(this[t]=r[t])}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export class GetContactsInput{constructor(t={}){if(t)for(const o in t)t.hasOwnProperty(o)&&(this[o]=t[o])}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{PagedResultRequestDto}from"@abp/ng.core";export class GetConversationInput extends PagedResultRequestDto{constructor(e={}){super(e)}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export class MarkConversationAsReadInput{constructor(o={}){if(o)for(const r in o)o.hasOwnProperty(r)&&(this[r]=o[r])}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export class SendMessageInput{constructor(s={}){if(s)for(const t in s)s.hasOwnProperty(t)&&(this[t]=s[t])}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{RestService}from"@abp/ng.core";import{Injectable}from"@angular/core";import*as i0 from"@angular/core";import*as i1 from"@abp/ng.core";export class ContactService{constructor(e){this.restService=e,this.apiName="Chat"}getContactsByInput(e={}){return this.restService.request({url:"/api/chat/contact/contacts",method:"GET",params:e},{apiName:this.apiName})}}ContactService.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ContactService,deps:[{token:i1.RestService}],target:i0.ɵɵFactoryTarget.Injectable}),ContactService.ɵprov=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ContactService,providedIn:"root"}),i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ContactService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:i1.RestService}]}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{RestService}from"@abp/ng.core";import{Injectable}from"@angular/core";import*as i0 from"@angular/core";import*as i1 from"@abp/ng.core";export class ConversationService{constructor(e){this.restService=e,this.apiName="Chat"}sendMessageByInput(e){return this.restService.request({url:"/api/chat/conversation/send-message",method:"POST",body:e},{apiName:this.apiName})}getConversationByInput(e={}){return this.restService.request({url:"/api/chat/conversation/conversation",method:"GET",params:e},{apiName:this.apiName})}markConversationAsReadByInput(e){return this.restService.request({url:"/api/chat/conversation/mark-conversation-as-read",method:"POST",body:e},{apiName:this.apiName})}}ConversationService.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ConversationService,deps:[{token:i1.RestService}],target:i0.ɵɵFactoryTarget.Injectable}),ConversationService.ɵprov=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ConversationService,providedIn:"root"}),i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ConversationService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:i1.RestService}]}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./proxy/volo/chat/conversations";export*from"./proxy/volo/chat/messages";export*from"./proxy/volo/chat/settings";export*from"./proxy/volo/chat/users";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{RestService}from"@abp/ng.core";import{Injectable}from"@angular/core";import*as i0 from"@angular/core";import*as i1 from"@abp/ng.core";export class ConversationService{constructor(e){this.restService=e,this.apiName="Chat",this.getConversation=e=>this.restService.request({method:"GET",url:"/api/chat/conversation/conversation",params:{targetUserId:e.targetUserId,skipCount:e.skipCount,maxResultCount:e.maxResultCount}},{apiName:this.apiName}),this.markConversationAsRead=e=>this.restService.request({method:"POST",url:"/api/chat/conversation/mark-conversation-as-read",body:e},{apiName:this.apiName}),this.sendMessage=e=>this.restService.request({method:"POST",url:"/api/chat/conversation/send-message",body:e},{apiName:this.apiName})}}ConversationService.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ConversationService,deps:[{token:i1.RestService}],target:i0.ɵɵFactoryTarget.Injectable}),ConversationService.ɵprov=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ConversationService,providedIn:"root"}),i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ConversationService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:i1.RestService}]}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./conversation.service";export*from"./models";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{mapEnumToOptions}from"@abp/ng.core";export var ChatMessageSide;!function(e){e[e.Sender=1]="Sender",e[e.Receiver=2]="Receiver"}(ChatMessageSide||(ChatMessageSide={}));export const chatMessageSideOptions=mapEnumToOptions(ChatMessageSide);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./chat-message-side.enum";export*from"./models";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./models";export*from"./settings.service";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{RestService}from"@abp/ng.core";import{Injectable}from"@angular/core";import*as i0 from"@angular/core";import*as i1 from"@abp/ng.core";export class SettingsService{constructor(e){this.restService=e,this.apiName="Chat",this.setSendOnEnterSetting=e=>this.restService.request({method:"POST",url:"/api/chat/settings/send-on-enter",body:e},{apiName:this.apiName})}}SettingsService.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:SettingsService,deps:[{token:i1.RestService}],target:i0.ɵɵFactoryTarget.Injectable}),SettingsService.ɵprov=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:SettingsService,providedIn:"root"}),i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:SettingsService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:i1.RestService}]}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{RestService}from"@abp/ng.core";import{Injectable}from"@angular/core";import*as i0 from"@angular/core";import*as i1 from"@abp/ng.core";export class ContactService{constructor(e){this.restService=e,this.apiName="Chat",this.getContacts=e=>this.restService.request({method:"GET",url:"/api/chat/contact/contacts",params:{filter:e.filter,includeOtherContacts:e.includeOtherContacts}},{apiName:this.apiName}),this.getTotalUnreadMessageCount=()=>this.restService.request({method:"GET",url:"/api/chat/contact/total-unread-message-count"},{apiName:this.apiName})}}ContactService.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ContactService,deps:[{token:i1.RestService}],target:i0.ɵɵFactoryTarget.Injectable}),ContactService.ɵprov=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ContactService,providedIn:"root"}),i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.0",ngImport:i0,type:ContactService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:i1.RestService}]}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./contact.service";export*from"./models";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./lib/index";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./public-api";
|
package/esm2015/public-api.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./lib/chat.module";export*from"./lib/components";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./public-api";
|