@posiwise/messaging-module 0.0.98 → 0.0.99
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.
|
@@ -1,130 +1,175 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { AppBaseComponent } from
|
|
4
|
-
import { MailBoxService, ProfileService,
|
|
5
|
-
import {
|
|
6
|
-
import { ConfirmDialogService } from
|
|
7
|
-
import * as i2 from
|
|
8
|
-
import * as i3 from
|
|
9
|
-
import * as i4 from
|
|
10
|
-
import * as i1 from
|
|
11
|
-
import * as i6 from
|
|
12
|
-
import * as i7 from
|
|
13
|
-
import * as i8 from
|
|
14
|
-
import * as i9 from
|
|
15
|
-
import * as i10 from
|
|
16
|
-
import * as i11 from
|
|
17
|
-
import * as i12 from
|
|
18
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectorRef, DoCheck, ElementRef, Injector, OnDestroy, OnInit } from "@angular/core";
|
|
3
|
+
import { AppBaseComponent } from "@posiwise/app-base-component";
|
|
4
|
+
import { MailBoxService, ProfileService, ScriptLoaderService, WebsocketService } from "@posiwise/common-services";
|
|
5
|
+
import { ATTACHMENT_TYPE, ChatUser, Conversation } from "@posiwise/common-utilities";
|
|
6
|
+
import { ConfirmDialogService } from "@posiwise/shared-components";
|
|
7
|
+
import * as i2 from "@angular/common";
|
|
8
|
+
import * as i3 from "@posiwise/pipes";
|
|
9
|
+
import * as i4 from "@angular/forms";
|
|
10
|
+
import * as i1 from "@angular/router";
|
|
11
|
+
import * as i6 from "primeng/progressspinner";
|
|
12
|
+
import * as i7 from "primeng/autocomplete";
|
|
13
|
+
import * as i8 from "@ctrl/ngx-emoji-mart";
|
|
14
|
+
import * as i9 from "@ctrl/ngx-emoji-mart/ngx-emoji";
|
|
15
|
+
import * as i10 from "ngx-file-drop";
|
|
16
|
+
import * as i11 from "ngx-infinite-scroll";
|
|
17
|
+
import * as i12 from "@angular/cdk/scrolling";
|
|
19
18
|
interface MessageChatUser {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
avatar?: {
|
|
20
|
+
url: string;
|
|
21
|
+
}[];
|
|
22
|
+
id?: number;
|
|
23
|
+
firstName?: string;
|
|
24
|
+
slug?: string;
|
|
25
|
+
email?: string;
|
|
26
|
+
avatarUrl?: string;
|
|
27
|
+
lastActive?: Date;
|
|
28
|
+
name?: string;
|
|
30
29
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
ObjectKeys: {
|
|
43
|
-
(o: object): string[];
|
|
44
|
-
(o: {}): string[];
|
|
45
|
-
};
|
|
46
|
-
showEmoji: boolean;
|
|
47
|
-
selectedConversationId: number;
|
|
48
|
-
currentConversation: Conversation;
|
|
49
|
-
currentUser: MessageChatUser;
|
|
50
|
-
currentUserImg: string;
|
|
51
|
-
private pristineConversation;
|
|
52
|
-
private isDrift;
|
|
53
|
-
private readonly units;
|
|
54
|
-
private initialLoad;
|
|
55
|
-
private selectedIndex;
|
|
56
|
-
private totalMessages;
|
|
57
|
-
private currentThreads;
|
|
58
|
-
conversations: Conversation[];
|
|
59
|
-
otherUser: ChatUser;
|
|
60
|
-
messagesGroupedByDate: {};
|
|
61
|
-
searchText: string;
|
|
62
|
-
recipients: any[];
|
|
63
|
-
files: any[];
|
|
64
|
-
attachedFiles: {
|
|
65
|
-
name: string;
|
|
66
|
-
size: string;
|
|
67
|
-
}[];
|
|
68
|
-
isChatLoading: boolean;
|
|
69
|
-
currentPage: number;
|
|
70
|
-
isLoaded: boolean;
|
|
71
|
-
throttle: number;
|
|
72
|
-
scrollUpDistance: number;
|
|
73
|
-
scrollDistance: number;
|
|
74
|
-
subscriptionId: number;
|
|
75
|
-
ATTACHMENT_TYPE: typeof ATTACHMENT_TYPE;
|
|
76
|
-
constructor(elRef: ElementRef, // NOSONAR
|
|
77
|
-
mailboxService: MailBoxService, profileService: ProfileService, socketService: WebsocketService, scriptLoader: ScriptLoaderService, injector: Injector, cdr: ChangeDetectorRef, confirmDialog: ConfirmDialogService);
|
|
78
|
-
onImgError(event: Event, fallbackSrc: string): void;
|
|
79
|
-
onUp(_ev: any, conversationId: any): void;
|
|
80
|
-
ngOnInit(): void;
|
|
81
|
-
private filterConversations;
|
|
82
|
-
ngDoCheck(): void;
|
|
83
|
-
ngOnDestroy(): void;
|
|
84
|
-
private parseConversation;
|
|
85
|
-
private activateThread;
|
|
86
|
-
private checkIfNewConversation;
|
|
87
|
-
onParticipantClick(conversation: any): void;
|
|
88
|
-
private newParticipant;
|
|
89
|
-
private setActive;
|
|
90
|
-
search(searchTxt: any): void;
|
|
91
|
-
private listenToNewMessage;
|
|
92
|
-
getMessage(messageId: any, reload?: boolean): void;
|
|
93
|
-
private loadMore;
|
|
94
|
-
private clearUnreadCount;
|
|
95
|
-
onSendMessage(): void;
|
|
96
|
-
private markAsRead;
|
|
97
|
-
private transform;
|
|
98
|
-
dropped(files: any): void;
|
|
99
|
-
onRemoveAttachment(item: any): void;
|
|
100
|
-
fileOver(_event: any): void;
|
|
101
|
-
onEmojiSelect($event: any): void;
|
|
102
|
-
fileChangeListener($event: any): void;
|
|
103
|
-
toggleSidebar(): void;
|
|
104
|
-
trackByMessageId(_index: any, item: any): any;
|
|
105
|
-
trackConversationKey(conversation: Conversation): string | number;
|
|
106
|
-
private animateOnScroll;
|
|
107
|
-
private getMessageType;
|
|
108
|
-
private getExtension;
|
|
109
|
-
recipientSearch(): void;
|
|
110
|
-
onMemberSelection(member: any): void;
|
|
111
|
-
onDeleteMessage(message: any): void;
|
|
112
|
-
private waitForJQuery;
|
|
113
|
-
private loadJQueryForChatbox;
|
|
114
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ChatBoxComponent, never>;
|
|
115
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ChatBoxComponent, "ng-component", never, {}, {}, never, never, false, never>;
|
|
30
|
+
interface Message {
|
|
31
|
+
id: number;
|
|
32
|
+
body: string;
|
|
33
|
+
createdAt: Date;
|
|
34
|
+
formattedDate?: string;
|
|
35
|
+
messageType?: string;
|
|
36
|
+
created_at: string;
|
|
37
|
+
attachment?: {
|
|
38
|
+
url: string;
|
|
39
|
+
};
|
|
40
|
+
conversationId?: number;
|
|
116
41
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
42
|
+
interface Conversation$1 {
|
|
43
|
+
id: number | null;
|
|
44
|
+
unreadCount: number;
|
|
45
|
+
latestMessage: Message;
|
|
46
|
+
type: string;
|
|
47
|
+
participants: MessageChatUser[];
|
|
48
|
+
createdAt: Date | null;
|
|
49
|
+
from: MessageChatUser;
|
|
50
|
+
to: MessageChatUser;
|
|
51
|
+
}
|
|
52
|
+
interface Attachment {
|
|
53
|
+
name: string;
|
|
54
|
+
size: string;
|
|
55
|
+
}
|
|
56
|
+
interface Recipient {
|
|
57
|
+
id: number;
|
|
58
|
+
slug: string;
|
|
59
|
+
email: string;
|
|
60
|
+
}
|
|
61
|
+
interface ExtendedConversation {
|
|
62
|
+
datetime?: string;
|
|
63
|
+
id: number;
|
|
64
|
+
mailbox_type: number;
|
|
65
|
+
latest_message: {
|
|
66
|
+
created_at: string;
|
|
67
|
+
};
|
|
68
|
+
subject: string;
|
|
69
|
+
participants: string[];
|
|
70
|
+
created_at: string;
|
|
71
|
+
unread_count: number;
|
|
72
|
+
from?: string;
|
|
73
|
+
to?: string;
|
|
122
74
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
75
|
+
declare namespace chatbox_component_d_exports {
|
|
76
|
+
export { ChatBoxComponent };
|
|
77
|
+
}
|
|
78
|
+
export declare class ChatBoxComponent extends AppBaseComponent implements OnInit, OnDestroy, DoCheck {
|
|
79
|
+
private elRef;
|
|
80
|
+
private readonly mailboxService;
|
|
81
|
+
private readonly profileService;
|
|
82
|
+
private readonly socketService;
|
|
83
|
+
private readonly scriptLoader;
|
|
84
|
+
private readonly cdr;
|
|
85
|
+
private readonly confirmDialog;
|
|
86
|
+
messageInputRef: ElementRef;
|
|
87
|
+
isFileUploading: boolean;
|
|
88
|
+
ObjectKeys: {
|
|
89
|
+
(o: object): string[];
|
|
90
|
+
(o: {}): string[];
|
|
91
|
+
};
|
|
92
|
+
showEmoji: boolean;
|
|
93
|
+
selectedConversationId: number;
|
|
94
|
+
currentConversation: Conversation;
|
|
95
|
+
currentUser: MessageChatUser;
|
|
96
|
+
currentUserImg: string;
|
|
97
|
+
private pristineConversation;
|
|
98
|
+
private isDrift;
|
|
99
|
+
private readonly units;
|
|
100
|
+
private initialLoad;
|
|
101
|
+
private selectedIndex;
|
|
102
|
+
private totalMessages;
|
|
103
|
+
private currentThreads;
|
|
104
|
+
conversations: Conversation[];
|
|
105
|
+
otherUser: ChatUser;
|
|
106
|
+
messagesGroupedByDate: {};
|
|
107
|
+
searchText: string;
|
|
108
|
+
recipients: any[];
|
|
109
|
+
files: any[];
|
|
110
|
+
attachedFiles: {
|
|
111
|
+
name: string;
|
|
112
|
+
size: string;
|
|
113
|
+
}[];
|
|
114
|
+
isChatLoading: boolean;
|
|
115
|
+
currentPage: number;
|
|
116
|
+
isLoaded: boolean;
|
|
117
|
+
throttle: number;
|
|
118
|
+
scrollUpDistance: number;
|
|
119
|
+
scrollDistance: number;
|
|
120
|
+
subscriptionId: number;
|
|
121
|
+
ATTACHMENT_TYPE: typeof ATTACHMENT_TYPE;
|
|
122
|
+
constructor(elRef: ElementRef // NOSONAR
|
|
123
|
+
, mailboxService: MailBoxService, profileService: ProfileService, socketService: WebsocketService, scriptLoader: ScriptLoaderService, injector: Injector, cdr: ChangeDetectorRef, confirmDialog: ConfirmDialogService);
|
|
124
|
+
onImgError(event: Event, fallbackSrc: string): void;
|
|
125
|
+
onUp(_ev: any, conversationId: any): void;
|
|
126
|
+
ngOnInit(): void;
|
|
127
|
+
private filterConversations;
|
|
128
|
+
ngDoCheck(): void;
|
|
129
|
+
ngOnDestroy(): void;
|
|
130
|
+
private parseConversation;
|
|
131
|
+
private activateThread;
|
|
132
|
+
private checkIfNewConversation;
|
|
133
|
+
onParticipantClick(conversation: any): void;
|
|
134
|
+
private newParticipant;
|
|
135
|
+
private setActive;
|
|
136
|
+
search(searchTxt: any): void;
|
|
137
|
+
private listenToNewMessage;
|
|
138
|
+
getMessage(messageId: any, reload?: boolean): void;
|
|
139
|
+
private loadMore;
|
|
140
|
+
private clearUnreadCount;
|
|
141
|
+
onSendMessage(): void;
|
|
142
|
+
private markAsRead;
|
|
143
|
+
private transform;
|
|
144
|
+
dropped(files: any): void;
|
|
145
|
+
onRemoveAttachment(item: any): void;
|
|
146
|
+
fileOver(_event: any): void;
|
|
147
|
+
onEmojiSelect($event: any): void;
|
|
148
|
+
fileChangeListener($event: any): void;
|
|
149
|
+
toggleSidebar(): void;
|
|
150
|
+
trackByMessageId(_index: any, item: any): any;
|
|
151
|
+
trackConversationKey(conversation: Conversation): string | number;
|
|
152
|
+
private animateOnScroll;
|
|
153
|
+
private getMessageType;
|
|
154
|
+
private getExtension;
|
|
155
|
+
recipientSearch(): void;
|
|
156
|
+
onMemberSelection(member: any): void;
|
|
157
|
+
onDeleteMessage(message: any): void;
|
|
158
|
+
private waitForJQuery;
|
|
159
|
+
private loadJQueryForChatbox;
|
|
160
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatBoxComponent, never>;
|
|
161
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ChatBoxComponent, "ng-component", never, {}, {}, never, never, false, never>;
|
|
162
|
+
}
|
|
163
|
+
declare namespace messaging_routing_module_d_exports {
|
|
164
|
+
export { MessageRoutingModule };
|
|
165
|
+
}
|
|
166
|
+
declare class MessageRoutingModule {
|
|
167
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MessageRoutingModule, never>;
|
|
168
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MessageRoutingModule, never, [typeof i1.RouterModule], [typeof i1.RouterModule]>;
|
|
169
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<MessageRoutingModule>;
|
|
128
170
|
}
|
|
129
|
-
|
|
130
|
-
|
|
171
|
+
export declare class MessagingModule {
|
|
172
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MessagingModule, never>;
|
|
173
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MessagingModule, [typeof ChatBoxComponent], [typeof i2.CommonModule, typeof i3.PipesModule, typeof i4.FormsModule, typeof MessageRoutingModule, typeof i6.ProgressSpinnerModule, typeof i7.AutoCompleteModule, typeof i8.PickerModule, typeof i9.EmojiModule, typeof i10.NgxFileDropModule, typeof i11.InfiniteScrollModule, typeof i12.ScrollingModule], [typeof i1.RouterModule, typeof ChatBoxComponent]>;
|
|
174
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<MessagingModule>;
|
|
175
|
+
}
|