@muraai/mnl-chat 0.2.0-alpha-6116399 → 0.2.0-alpha-9e96598

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.
Files changed (41) hide show
  1. package/fesm2022/muraai-mnl-chat.mjs +41 -41
  2. package/fesm2022/muraai-mnl-chat.mjs.map +1 -1
  3. package/package.json +3 -3
  4. package/types/muraai-mnl-chat.d.ts +456 -0
  5. package/index.d.ts +0 -5
  6. package/lib/chat.module.d.ts +0 -24
  7. package/lib/components/ng-chat/ng-chat.component.d.ts +0 -132
  8. package/lib/components/ng-chat-friends-list/ng-chat-friends-list.component.d.ts +0 -53
  9. package/lib/components/ng-chat-options/ng-chat-options.component.d.ts +0 -12
  10. package/lib/components/ng-chat-window/ng-chat-window.component.d.ts +0 -67
  11. package/lib/core/chat-adapter.d.ts +0 -15
  12. package/lib/core/chat-controller.d.ts +0 -6
  13. package/lib/core/chat-group-adapter.d.ts +0 -4
  14. package/lib/core/chat-option.d.ts +0 -9
  15. package/lib/core/chat-participant-status-descriptor.d.ts +0 -3
  16. package/lib/core/chat-participant-status.enum.d.ts +0 -6
  17. package/lib/core/chat-participant-type.enum.d.ts +0 -4
  18. package/lib/core/chat-participant.d.ts +0 -21
  19. package/lib/core/default-file-upload-adapter.d.ts +0 -14
  20. package/lib/core/file-upload-adapter.d.ts +0 -5
  21. package/lib/core/group.d.ts +0 -13
  22. package/lib/core/guid.d.ts +0 -3
  23. package/lib/core/localization.d.ts +0 -15
  24. package/lib/core/message-counter.d.ts +0 -10
  25. package/lib/core/message-type.enum.d.ts +0 -5
  26. package/lib/core/message.d.ts +0 -10
  27. package/lib/core/paged-history-chat-adapter.d.ts +0 -10
  28. package/lib/core/participant-metadata.d.ts +0 -3
  29. package/lib/core/participant-response.d.ts +0 -6
  30. package/lib/core/scroll-direction.enum.d.ts +0 -4
  31. package/lib/core/theme.enum.d.ts +0 -5
  32. package/lib/core/user.d.ts +0 -10
  33. package/lib/core/window.d.ts +0 -13
  34. package/lib/firstLetter.pipe.d.ts +0 -7
  35. package/lib/material.module.d.ts +0 -17
  36. package/lib/pipes/emojify.pipe.d.ts +0 -7
  37. package/lib/pipes/group-message-display-name.pipe.d.ts +0 -9
  38. package/lib/pipes/linkfy.pipe.d.ts +0 -7
  39. package/lib/pipes/sanitize.pipe.d.ts +0 -10
  40. package/lib/services/chat.service.d.ts +0 -6
  41. package/public-api.d.ts +0 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muraai/mnl-chat",
3
- "version": "0.2.0-alpha-6116399",
3
+ "version": "0.2.0-alpha-9e96598",
4
4
  "type": "module",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^19.0.0",
@@ -10,13 +10,13 @@
10
10
  "tslib": "^2.3.0"
11
11
  },
12
12
  "module": "fesm2022/muraai-mnl-chat.mjs",
13
- "typings": "index.d.ts",
13
+ "typings": "types/muraai-mnl-chat.d.ts",
14
14
  "exports": {
15
15
  "./package.json": {
16
16
  "default": "./package.json"
17
17
  },
18
18
  ".": {
19
- "types": "./index.d.ts",
19
+ "types": "./types/muraai-mnl-chat.d.ts",
20
20
  "default": "./fesm2022/muraai-mnl-chat.mjs"
21
21
  }
22
22
  },
@@ -0,0 +1,456 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, ElementRef, OnInit, QueryList, PipeTransform, OnChanges, OnDestroy, SimpleChanges, ModuleWithProviders } from '@angular/core';
3
+ import { AppConfigService } from '@muraai/mnl-commons';
4
+ import * as i13 from '@angular/common/http';
5
+ import { HttpClient } from '@angular/common/http';
6
+ import { Observable } from 'rxjs';
7
+ import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
8
+ import * as i1 from '@angular/material/button';
9
+ import { MatButtonModule } from '@angular/material/button';
10
+ import * as i2 from '@angular/material/form-field';
11
+ import * as i3 from '@angular/material/icon';
12
+ import * as i4 from '@angular/material/input';
13
+ import * as i5 from '@angular/forms';
14
+ import * as i6 from '@angular/material/menu';
15
+ import * as i7 from '@angular/material/list';
16
+ import * as i8 from '@angular/material/card';
17
+ import * as i9 from '@angular/material/tooltip';
18
+ import * as i11 from '@angular/common';
19
+
20
+ declare enum MessageType {
21
+ Text = 1,
22
+ File = 2,
23
+ Image = 3
24
+ }
25
+
26
+ declare class Message {
27
+ type?: MessageType;
28
+ fromId: any;
29
+ toId: any;
30
+ message: string;
31
+ dateSent?: Date;
32
+ dateSeen?: Date;
33
+ additionalParameter?: Object;
34
+ }
35
+
36
+ declare class ParticipantMetadata {
37
+ totalUnreadMessages: number;
38
+ }
39
+
40
+ declare enum ChatParticipantStatus {
41
+ Online = 0,
42
+ Busy = 1,
43
+ Away = 2,
44
+ Offline = 3
45
+ }
46
+
47
+ declare enum ChatParticipantType {
48
+ User = 0,
49
+ Group = 1
50
+ }
51
+
52
+ interface IChatParticipant {
53
+ readonly participantType: ChatParticipantType;
54
+ readonly id: any;
55
+ readonly status: ChatParticipantStatus;
56
+ readonly avatar: string | null;
57
+ readonly displayName: string;
58
+ readonly metadata?: IMetadata;
59
+ readonly showMetadataInTitle?: IMetadataInTitle;
60
+ }
61
+ interface IMetadata {
62
+ primary?: string;
63
+ secondary?: string;
64
+ tertiary?: string;
65
+ }
66
+ interface IMetadataInTitle {
67
+ primary?: boolean;
68
+ secondary?: boolean;
69
+ tertiary?: boolean;
70
+ }
71
+
72
+ declare class ParticipantResponse {
73
+ participant: IChatParticipant;
74
+ metadata: ParticipantMetadata;
75
+ }
76
+
77
+ declare abstract class ChatAdapter {
78
+ abstract listFriends(): Observable<ParticipantResponse[]>;
79
+ abstract getMessageHistory(destinataryId: any): Observable<Message[]>;
80
+ abstract sendMessage(message: Message): void;
81
+ onFriendsListChanged(participantsResponse: ParticipantResponse[]): void;
82
+ onMessageReceived(participant: IChatParticipant, message: Message): void;
83
+ /** @internal */
84
+ friendsListChangedHandler: (participantsResponse: ParticipantResponse[]) => void;
85
+ /** @internal */
86
+ messageReceivedHandler: (participant: IChatParticipant, message: Message) => void;
87
+ }
88
+
89
+ declare class User implements IChatParticipant {
90
+ readonly participantType: ChatParticipantType;
91
+ id: any;
92
+ displayName: string;
93
+ status: ChatParticipantStatus;
94
+ avatar: string;
95
+ }
96
+
97
+ declare class Group implements IChatParticipant {
98
+ constructor(participants: User[]);
99
+ id: string;
100
+ chattingTo: User[];
101
+ readonly participantType: ChatParticipantType;
102
+ status: ChatParticipantStatus;
103
+ avatar: string | null;
104
+ displayName: string;
105
+ }
106
+
107
+ interface IChatGroupAdapter {
108
+ groupCreated(group: Group): void;
109
+ }
110
+
111
+ declare class Window {
112
+ constructor(participant: IChatParticipant, isLoadingHistory: boolean, isCollapsed: boolean);
113
+ participant: IChatParticipant;
114
+ messages: Message[];
115
+ newMessage?: string;
116
+ isCollapsed?: boolean;
117
+ isLoadingHistory: boolean;
118
+ hasFocus: boolean;
119
+ hasMoreMessages: boolean;
120
+ historyPage: number;
121
+ }
122
+
123
+ interface Localization {
124
+ title: string;
125
+ messagePlaceholder: string;
126
+ searchPlaceholder: string;
127
+ statusDescription: StatusDescription;
128
+ browserNotificationTitle: string;
129
+ loadMessageHistoryPlaceholder: string;
130
+ }
131
+ interface StatusDescription {
132
+ online: string;
133
+ busy: string;
134
+ away: string;
135
+ offline: string;
136
+ [key: string]: string;
137
+ }
138
+
139
+ interface IChatController {
140
+ triggerOpenChatWindow(user: User): void;
141
+ triggerCloseChatWindow(userId: any): void;
142
+ triggerToggleChatWindowVisibility(userId: any): void;
143
+ }
144
+
145
+ interface IFileUploadAdapter {
146
+ uploadFile(file: File, participantId: any): Observable<Message>;
147
+ }
148
+
149
+ declare enum Theme {
150
+ Custom = "custom-theme",
151
+ Light = "light-theme",
152
+ Dark = "dark-theme"
153
+ }
154
+
155
+ interface IChatOption {
156
+ isActive: boolean;
157
+ displayLabel: string;
158
+ chattingTo: Window;
159
+ action?: (chattingTo: Window) => void;
160
+ validateContext: (participant: IChatParticipant) => boolean;
161
+ }
162
+
163
+ declare enum ScrollDirection {
164
+ Top = 0,
165
+ Bottom = 1
166
+ }
167
+
168
+ declare function chatParticipantStatusDescriptor(status: ChatParticipantStatus, localization: Localization): string;
169
+
170
+ declare class NgChatWindowComponent {
171
+ constructor();
172
+ fileUploadAdapter: IFileUploadAdapter;
173
+ window: Window;
174
+ userId: any;
175
+ localization: Localization;
176
+ showOptions: boolean;
177
+ emojisEnabled: boolean;
178
+ linkfyEnabled: boolean;
179
+ showMessageDate: boolean;
180
+ messageDatePipeFormat: string;
181
+ hasPagedHistory: boolean;
182
+ onChatWindowClosed: EventEmitter<{
183
+ closedWindow: Window;
184
+ closedViaEscapeKey: boolean;
185
+ }>;
186
+ onMessagesSeen: EventEmitter<Message[]>;
187
+ onMessageSent: EventEmitter<Message>;
188
+ onTabTriggered: EventEmitter<{
189
+ triggeringWindow: Window;
190
+ shiftKeyPressed: boolean;
191
+ }>;
192
+ onOptionTriggered: EventEmitter<IChatOption>;
193
+ onLoadHistoryTriggered: EventEmitter<Window>;
194
+ chatMessages: any;
195
+ nativeFileInput: ElementRef;
196
+ chatWindowInput: any;
197
+ fileUploadersInUse: string[];
198
+ ChatParticipantType: typeof ChatParticipantType;
199
+ ChatParticipantStatus: typeof ChatParticipantStatus;
200
+ MessageType: typeof MessageType;
201
+ chatParticipantStatusDescriptor: typeof chatParticipantStatusDescriptor;
202
+ defaultWindowOptions(currentWindow: Window): IChatOption[];
203
+ isAvatarVisible(window: Window, message: Message, index: number): boolean;
204
+ getChatWindowAvatar(participant: IChatParticipant, message: Message): string | null;
205
+ isUploadingFile(window: Window): boolean;
206
+ getUniqueFileUploadInstanceId(window: Window): string;
207
+ unreadMessagesTotal(window: Window): string;
208
+ scrollChatWindow(window: Window, direction: ScrollDirection): void;
209
+ activeOptionTrackerChange(option: IChatOption): void;
210
+ triggerNativeFileUpload(window: Window): void;
211
+ toggleWindowFocus(window: Window): void;
212
+ markMessagesAsRead(messages: Message[]): void;
213
+ fetchMessageHistory(window: Window): void;
214
+ onCloseChatWindow(): void;
215
+ onChatInputTyped(event: any, window: Window): void;
216
+ onChatWindowClicked(window: Window): void;
217
+ private clearInUseFileUploader;
218
+ onFileChosen(window: Window): void;
219
+ getParticipantTooltip(participant: IChatParticipant): string;
220
+ getMetadataDisplay(participant: IChatParticipant): string;
221
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgChatWindowComponent, never>;
222
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgChatWindowComponent, "ng-chat-window", never, { "fileUploadAdapter": { "alias": "fileUploadAdapter"; "required": false; }; "window": { "alias": "window"; "required": false; }; "userId": { "alias": "userId"; "required": false; }; "localization": { "alias": "localization"; "required": false; }; "showOptions": { "alias": "showOptions"; "required": false; }; "emojisEnabled": { "alias": "emojisEnabled"; "required": false; }; "linkfyEnabled": { "alias": "linkfyEnabled"; "required": false; }; "showMessageDate": { "alias": "showMessageDate"; "required": false; }; "messageDatePipeFormat": { "alias": "messageDatePipeFormat"; "required": false; }; "hasPagedHistory": { "alias": "hasPagedHistory"; "required": false; }; }, { "onChatWindowClosed": "onChatWindowClosed"; "onMessagesSeen": "onMessagesSeen"; "onMessageSent": "onMessageSent"; "onTabTriggered": "onTabTriggered"; "onOptionTriggered": "onOptionTriggered"; "onLoadHistoryTriggered": "onLoadHistoryTriggered"; }, never, never, false, never>;
223
+ }
224
+
225
+ declare class NgChat implements OnInit, IChatController {
226
+ private _httpClient;
227
+ constructor(_httpClient: HttpClient);
228
+ ChatParticipantType: typeof ChatParticipantType;
229
+ ChatParticipantStatus: typeof ChatParticipantStatus;
230
+ MessageType: typeof MessageType;
231
+ private _isDisabled;
232
+ get isDisabled(): boolean;
233
+ set isDisabled(value: boolean);
234
+ adapter: ChatAdapter;
235
+ groupAdapter: IChatGroupAdapter;
236
+ userId: any;
237
+ isCollapsed: boolean;
238
+ maximizeWindowOnNewMessage: boolean;
239
+ pollFriendsList: boolean;
240
+ pollingInterval: number;
241
+ historyEnabled: boolean;
242
+ emojisEnabled: boolean;
243
+ linkfyEnabled: boolean;
244
+ audioEnabled: boolean;
245
+ searchEnabled: boolean;
246
+ audioSource: string;
247
+ persistWindowsState: boolean;
248
+ title: string;
249
+ messagePlaceholder: string;
250
+ searchPlaceholder: string;
251
+ browserNotificationsEnabled: boolean;
252
+ browserNotificationIconSource: string;
253
+ browserNotificationTitle: string;
254
+ historyPageSize: number;
255
+ localization: Localization;
256
+ hideFriendsList: boolean;
257
+ hideFriendsListOnUnsupportedViewport: boolean;
258
+ fileUploadUrl: string;
259
+ theme: Theme;
260
+ customTheme: string;
261
+ messageDatePipeFormat: string;
262
+ showMessageDate: boolean;
263
+ isViewportOnMobileEnabled: boolean;
264
+ fileUploadAdapter: IFileUploadAdapter;
265
+ onParticipantClicked: EventEmitter<IChatParticipant>;
266
+ onParticipantChatOpened: EventEmitter<IChatParticipant>;
267
+ onParticipantChatClosed: EventEmitter<IChatParticipant>;
268
+ onMessagesSeen: EventEmitter<Message[]>;
269
+ onCloseWindowClicked: EventEmitter<boolean>;
270
+ searchInputChanged: EventEmitter<string>;
271
+ private browserNotificationsBootstrapped;
272
+ hasPagedHistory: boolean;
273
+ private statusDescription;
274
+ private audioFile;
275
+ participants: IChatParticipant[];
276
+ participantsResponse: ParticipantResponse[];
277
+ participantsInteractedWith: IChatParticipant[];
278
+ currentActiveOption: IChatOption | null;
279
+ private pollingIntervalWindowInstance;
280
+ private get localStorageKey();
281
+ windowSizeFactor: number;
282
+ friendsListWidth: number;
283
+ private viewPortTotalArea;
284
+ unsupportedViewport: boolean;
285
+ windows: Window[];
286
+ isBootstrapped: boolean;
287
+ chatWindows: QueryList<NgChatWindowComponent>;
288
+ ngOnInit(): void;
289
+ onResize(event: any): void;
290
+ private NormalizeWindows;
291
+ private bootstrapChat;
292
+ private activateFriendListFetch;
293
+ private initializeBrowserNotifications;
294
+ private initializeDefaultText;
295
+ private initializeTheme;
296
+ private fetchFriendsList;
297
+ fetchMessageHistory(window: Window): void;
298
+ private onFetchMessageHistoryLoaded;
299
+ private onFriendsListChanged;
300
+ private onMessageReceived;
301
+ onParticipantClickedFromFriendsList(participant: IChatParticipant): void;
302
+ private cancelOptionPrompt;
303
+ onOptionPromptCanceled(): void;
304
+ onOptionPromptConfirmed(event: any): void;
305
+ private confirmNewGroup;
306
+ private openChatWindow;
307
+ private focusOnWindow;
308
+ private assertMessageType;
309
+ markMessagesAsRead(messages: Message[]): void;
310
+ private bufferAudioFile;
311
+ private emitMessageSound;
312
+ private emitBrowserNotification;
313
+ private updateWindowsState;
314
+ private restoreWindowsState;
315
+ private getClosestWindow;
316
+ private closeWindow;
317
+ private getChatWindowComponentInstance;
318
+ private scrollChatWindow;
319
+ onWindowMessagesSeen(messagesSeen: Message[]): void;
320
+ onWindowChatClosed(payload: {
321
+ closedWindow: Window;
322
+ closedViaEscapeKey: boolean;
323
+ }): void;
324
+ onWindowTabTriggered(payload: {
325
+ triggeringWindow: Window;
326
+ shiftKeyPressed: boolean;
327
+ }): void;
328
+ onWindowMessageSent(messageSent: Message): void;
329
+ onWindowOptionTriggered(option: IChatOption): void;
330
+ triggerOpenChatWindow(user: User): void;
331
+ triggerCloseChatWindow(userId: any): void;
332
+ triggerToggleChatWindowVisibility(userId: any): void;
333
+ onCloseWindowClick(click: boolean): void;
334
+ onSearchInputChanged(value: string): void;
335
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgChat, never>;
336
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgChat, "mnl-chat", never, { "isDisabled": { "alias": "isDisabled"; "required": false; }; "adapter": { "alias": "adapter"; "required": false; }; "groupAdapter": { "alias": "groupAdapter"; "required": false; }; "userId": { "alias": "userId"; "required": false; }; "isCollapsed": { "alias": "isCollapsed"; "required": false; }; "maximizeWindowOnNewMessage": { "alias": "maximizeWindowOnNewMessage"; "required": false; }; "pollFriendsList": { "alias": "pollFriendsList"; "required": false; }; "pollingInterval": { "alias": "pollingInterval"; "required": false; }; "historyEnabled": { "alias": "historyEnabled"; "required": false; }; "emojisEnabled": { "alias": "emojisEnabled"; "required": false; }; "linkfyEnabled": { "alias": "linkfyEnabled"; "required": false; }; "audioEnabled": { "alias": "audioEnabled"; "required": false; }; "searchEnabled": { "alias": "searchEnabled"; "required": false; }; "audioSource": { "alias": "audioSource"; "required": false; }; "persistWindowsState": { "alias": "persistWindowsState"; "required": false; }; "title": { "alias": "title"; "required": false; }; "messagePlaceholder": { "alias": "messagePlaceholder"; "required": false; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; }; "browserNotificationsEnabled": { "alias": "browserNotificationsEnabled"; "required": false; }; "browserNotificationIconSource": { "alias": "browserNotificationIconSource"; "required": false; }; "browserNotificationTitle": { "alias": "browserNotificationTitle"; "required": false; }; "historyPageSize": { "alias": "historyPageSize"; "required": false; }; "localization": { "alias": "localization"; "required": false; }; "hideFriendsList": { "alias": "hideFriendsList"; "required": false; }; "hideFriendsListOnUnsupportedViewport": { "alias": "hideFriendsListOnUnsupportedViewport"; "required": false; }; "fileUploadUrl": { "alias": "fileUploadUrl"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "customTheme": { "alias": "customTheme"; "required": false; }; "messageDatePipeFormat": { "alias": "messageDatePipeFormat"; "required": false; }; "showMessageDate": { "alias": "showMessageDate"; "required": false; }; "isViewportOnMobileEnabled": { "alias": "isViewportOnMobileEnabled"; "required": false; }; "fileUploadAdapter": { "alias": "fileUploadAdapter"; "required": false; }; }, { "onParticipantClicked": "onParticipantClicked"; "onParticipantChatOpened": "onParticipantChatOpened"; "onParticipantChatClosed": "onParticipantChatClosed"; "onMessagesSeen": "onMessagesSeen"; "onCloseWindowClicked": "onCloseWindowClicked"; "searchInputChanged": "searchInputChanged"; }, never, never, false, never>;
337
+ }
338
+
339
+ declare class EmojifyPipe implements PipeTransform {
340
+ transform(message: string, pipeEnabled: boolean): string;
341
+ static ɵfac: i0.ɵɵFactoryDeclaration<EmojifyPipe, never>;
342
+ static ɵpipe: i0.ɵɵPipeDeclaration<EmojifyPipe, "emojify", false>;
343
+ }
344
+
345
+ declare class LinkfyPipe implements PipeTransform {
346
+ transform(message: string, pipeEnabled: boolean): string;
347
+ static ɵfac: i0.ɵɵFactoryDeclaration<LinkfyPipe, never>;
348
+ static ɵpipe: i0.ɵɵPipeDeclaration<LinkfyPipe, "linkfy", false>;
349
+ }
350
+
351
+ declare class SanitizePipe implements PipeTransform {
352
+ protected sanitizer: DomSanitizer;
353
+ constructor(sanitizer: DomSanitizer);
354
+ transform(url: string): SafeResourceUrl;
355
+ static ɵfac: i0.ɵɵFactoryDeclaration<SanitizePipe, never>;
356
+ static ɵpipe: i0.ɵɵPipeDeclaration<SanitizePipe, "sanitize", false>;
357
+ }
358
+
359
+ declare class GroupMessageDisplayNamePipe implements PipeTransform {
360
+ transform(participant: IChatParticipant, message: Message): string;
361
+ static ɵfac: i0.ɵɵFactoryDeclaration<GroupMessageDisplayNamePipe, never>;
362
+ static ɵpipe: i0.ɵɵPipeDeclaration<GroupMessageDisplayNamePipe, "groupMessageDisplayName", false>;
363
+ }
364
+
365
+ declare class NgChatOptionsComponent {
366
+ constructor();
367
+ options: IChatOption[];
368
+ activeOptionTracker: IChatOption;
369
+ activeOptionTrackerChange: EventEmitter<IChatOption>;
370
+ onOptionClicked(option: IChatOption): void;
371
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgChatOptionsComponent, never>;
372
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgChatOptionsComponent, "ng-chat-options", never, { "options": { "alias": "options"; "required": false; }; "activeOptionTracker": { "alias": "activeOptionTracker"; "required": false; }; }, { "activeOptionTrackerChange": "activeOptionTrackerChange"; }, never, never, false, never>;
373
+ }
374
+
375
+ declare class NgChatFriendsListComponent implements OnChanges, OnInit, OnDestroy {
376
+ constructor();
377
+ participants: IChatParticipant[];
378
+ participantsResponse: ParticipantResponse[];
379
+ participantsInteractedWith: IChatParticipant[];
380
+ windows: Window[];
381
+ userId: any;
382
+ localization: Localization;
383
+ shouldDisplay: boolean;
384
+ isCollapsed: boolean;
385
+ searchEnabled: boolean;
386
+ currentActiveOption: IChatOption | null;
387
+ onParticipantClicked: EventEmitter<IChatParticipant>;
388
+ onOptionPromptCanceled: EventEmitter<any>;
389
+ onOptionPromptConfirmed: EventEmitter<any>;
390
+ hideFriendsList: boolean;
391
+ onCloseWindowClick: EventEmitter<boolean>;
392
+ searchInputChanged: EventEmitter<any>;
393
+ private searchInputSubject;
394
+ selectedUsersFromFriendsList: User[];
395
+ searchInput: string;
396
+ private destroy$;
397
+ ChatParticipantStatus: typeof ChatParticipantStatus;
398
+ chatParticipantStatusDescriptor: typeof chatParticipantStatusDescriptor;
399
+ ngOnInit(): void;
400
+ ngOnChanges(changes: SimpleChanges): void;
401
+ get filteredParticipants(): IChatParticipant[];
402
+ isUserSelectedFromFriendsList(user: User): boolean;
403
+ unreadMessagesTotalByParticipant(participant: IChatParticipant): string;
404
+ cleanUpUserSelection: () => any[];
405
+ onChatTitleClicked(): void;
406
+ onFriendsListCheckboxChange(selectedUser: User, isChecked: boolean): void;
407
+ onUserClick(clickedUser: User): void;
408
+ onFriendsListActionCancelClicked(): void;
409
+ onFriendsListActionConfirmClicked(): void;
410
+ onCloseWindow(): void;
411
+ onSearchInputChange(value: string): void;
412
+ initializeSearchInputListener(): void;
413
+ ngOnDestroy(): void;
414
+ getParticipantTooltip(participant: IChatParticipant): string;
415
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgChatFriendsListComponent, never>;
416
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgChatFriendsListComponent, "ng-chat-friends-list", never, { "participants": { "alias": "participants"; "required": false; }; "participantsResponse": { "alias": "participantsResponse"; "required": false; }; "participantsInteractedWith": { "alias": "participantsInteractedWith"; "required": false; }; "windows": { "alias": "windows"; "required": false; }; "userId": { "alias": "userId"; "required": false; }; "localization": { "alias": "localization"; "required": false; }; "shouldDisplay": { "alias": "shouldDisplay"; "required": false; }; "isCollapsed": { "alias": "isCollapsed"; "required": false; }; "searchEnabled": { "alias": "searchEnabled"; "required": false; }; "currentActiveOption": { "alias": "currentActiveOption"; "required": false; }; "hideFriendsList": { "alias": "hideFriendsList"; "required": false; }; }, { "onParticipantClicked": "onParticipantClicked"; "onOptionPromptCanceled": "onOptionPromptCanceled"; "onOptionPromptConfirmed": "onOptionPromptConfirmed"; "onCloseWindowClick": "onCloseWindowClick"; "searchInputChanged": "searchInputChanged"; }, never, never, false, never>;
417
+ }
418
+
419
+ declare class FirstLetterPipe implements PipeTransform {
420
+ transform(value: string): string;
421
+ static ɵfac: i0.ɵɵFactoryDeclaration<FirstLetterPipe, never>;
422
+ static ɵpipe: i0.ɵɵPipeDeclaration<FirstLetterPipe, "firstLetterPipe", false>;
423
+ }
424
+
425
+ declare function modules(): (typeof MatButtonModule)[];
426
+ declare class ChatMaterialModule {
427
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatMaterialModule, never>;
428
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ChatMaterialModule, never, [typeof i1.MatButtonModule, typeof i2.MatFormFieldModule, typeof i3.MatIconModule, typeof i4.MatInputModule, typeof i5.FormsModule, typeof i5.ReactiveFormsModule, typeof i6.MatMenuModule, typeof i7.MatListModule, typeof i8.MatCardModule, typeof i9.MatTooltipModule], [typeof i1.MatButtonModule, typeof i2.MatFormFieldModule, typeof i3.MatIconModule, typeof i4.MatInputModule, typeof i5.FormsModule, typeof i5.ReactiveFormsModule, typeof i6.MatMenuModule, typeof i7.MatListModule, typeof i8.MatCardModule, typeof i9.MatTooltipModule]>;
429
+ static ɵinj: i0.ɵɵInjectorDeclaration<ChatMaterialModule>;
430
+ }
431
+
432
+ declare class ChatModule {
433
+ static forRoot(): ModuleWithProviders<ChatModule>;
434
+ static forChild(): ModuleWithProviders<ChatModule>;
435
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatModule, never>;
436
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ChatModule, [typeof NgChat, typeof EmojifyPipe, typeof LinkfyPipe, typeof SanitizePipe, typeof GroupMessageDisplayNamePipe, typeof NgChatOptionsComponent, typeof NgChatFriendsListComponent, typeof NgChatWindowComponent, typeof FirstLetterPipe], [typeof ChatMaterialModule, typeof i11.CommonModule, typeof i5.FormsModule, typeof i13.HttpClientModule], [typeof NgChat]>;
437
+ static ɵinj: i0.ɵɵInjectorDeclaration<ChatModule>;
438
+ }
439
+ declare function loadConfig(config: AppConfigService): () => Promise<any>;
440
+
441
+ declare class ChatService {
442
+ constructor();
443
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatService, never>;
444
+ static ɵprov: i0.ɵɵInjectableDeclaration<ChatService>;
445
+ }
446
+
447
+ /**
448
+ * @description Chat Adapter decorator class that adds pagination to load the history of messagesr.
449
+ * You will need an existing @see ChatAdapter implementation
450
+ */
451
+ declare abstract class PagedHistoryChatAdapter extends ChatAdapter {
452
+ abstract getMessageHistoryByPage(destinataryId: any, size: number, page: number): Observable<Message[]>;
453
+ }
454
+
455
+ export { ChatAdapter, ChatMaterialModule, ChatModule, ChatParticipantStatus, ChatParticipantType, ChatService, Group, Message, MessageType, NgChat, PagedHistoryChatAdapter, ParticipantMetadata, ParticipantResponse, Theme, User, Window, loadConfig, modules };
456
+ export type { IChatController, IChatGroupAdapter, IChatOption, IChatParticipant, IFileUploadAdapter, IMetadata, IMetadataInTitle, Localization, StatusDescription };
package/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@muraai/mnl-chat" />
5
- export * from './public-api';
@@ -1,24 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import { AppConfigService } from '@muraai/mnl-commons';
3
- import * as i0 from "@angular/core";
4
- import * as i1 from "./components/ng-chat/ng-chat.component";
5
- import * as i2 from "./pipes/emojify.pipe";
6
- import * as i3 from "./pipes/linkfy.pipe";
7
- import * as i4 from "./pipes/sanitize.pipe";
8
- import * as i5 from "./pipes/group-message-display-name.pipe";
9
- import * as i6 from "./components/ng-chat-options/ng-chat-options.component";
10
- import * as i7 from "./components/ng-chat-friends-list/ng-chat-friends-list.component";
11
- import * as i8 from "./components/ng-chat-window/ng-chat-window.component";
12
- import * as i9 from "./firstLetter.pipe";
13
- import * as i10 from "./material.module";
14
- import * as i11 from "@angular/common";
15
- import * as i12 from "@angular/forms";
16
- import * as i13 from "@angular/common/http";
17
- export declare class ChatModule {
18
- static forRoot(): ModuleWithProviders<ChatModule>;
19
- static forChild(): ModuleWithProviders<ChatModule>;
20
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatModule, never>;
21
- static ɵmod: i0.ɵɵNgModuleDeclaration<ChatModule, [typeof i1.NgChat, typeof i2.EmojifyPipe, typeof i3.LinkfyPipe, typeof i4.SanitizePipe, typeof i5.GroupMessageDisplayNamePipe, typeof i6.NgChatOptionsComponent, typeof i7.NgChatFriendsListComponent, typeof i8.NgChatWindowComponent, typeof i9.FirstLetterPipe], [typeof i10.ChatMaterialModule, typeof i11.CommonModule, typeof i12.FormsModule, typeof i13.HttpClientModule], [typeof i1.NgChat]>;
22
- static ɵinj: i0.ɵɵInjectorDeclaration<ChatModule>;
23
- }
24
- export declare function loadConfig(config: AppConfigService): () => Promise<any>;
@@ -1,132 +0,0 @@
1
- import { OnInit, QueryList, EventEmitter } from '@angular/core';
2
- import { HttpClient } from '@angular/common/http';
3
- import { ChatAdapter } from '../../core/chat-adapter';
4
- import { IChatGroupAdapter } from '../../core/chat-group-adapter';
5
- import { User } from "../../core/user";
6
- import { ParticipantResponse } from "../../core/participant-response";
7
- import { Message } from "../../core/message";
8
- import { MessageType } from "../../core/message-type.enum";
9
- import { Window } from "../../core/window";
10
- import { ChatParticipantStatus } from "../../core/chat-participant-status.enum";
11
- import { Localization } from '../../core/localization';
12
- import { IChatController } from '../../core/chat-controller';
13
- import { IFileUploadAdapter } from '../../core/file-upload-adapter';
14
- import { Theme } from '../../core/theme.enum';
15
- import { IChatOption } from '../../core/chat-option';
16
- import { ChatParticipantType } from "../../core/chat-participant-type.enum";
17
- import { IChatParticipant } from "../../core/chat-participant";
18
- import { NgChatWindowComponent } from '../ng-chat-window/ng-chat-window.component';
19
- import * as i0 from "@angular/core";
20
- export declare class NgChat implements OnInit, IChatController {
21
- private _httpClient;
22
- constructor(_httpClient: HttpClient);
23
- ChatParticipantType: typeof ChatParticipantType;
24
- ChatParticipantStatus: typeof ChatParticipantStatus;
25
- MessageType: typeof MessageType;
26
- private _isDisabled;
27
- get isDisabled(): boolean;
28
- set isDisabled(value: boolean);
29
- adapter: ChatAdapter;
30
- groupAdapter: IChatGroupAdapter;
31
- userId: any;
32
- isCollapsed: boolean;
33
- maximizeWindowOnNewMessage: boolean;
34
- pollFriendsList: boolean;
35
- pollingInterval: number;
36
- historyEnabled: boolean;
37
- emojisEnabled: boolean;
38
- linkfyEnabled: boolean;
39
- audioEnabled: boolean;
40
- searchEnabled: boolean;
41
- audioSource: string;
42
- persistWindowsState: boolean;
43
- title: string;
44
- messagePlaceholder: string;
45
- searchPlaceholder: string;
46
- browserNotificationsEnabled: boolean;
47
- browserNotificationIconSource: string;
48
- browserNotificationTitle: string;
49
- historyPageSize: number;
50
- localization: Localization;
51
- hideFriendsList: boolean;
52
- hideFriendsListOnUnsupportedViewport: boolean;
53
- fileUploadUrl: string;
54
- theme: Theme;
55
- customTheme: string;
56
- messageDatePipeFormat: string;
57
- showMessageDate: boolean;
58
- isViewportOnMobileEnabled: boolean;
59
- fileUploadAdapter: IFileUploadAdapter;
60
- onParticipantClicked: EventEmitter<IChatParticipant>;
61
- onParticipantChatOpened: EventEmitter<IChatParticipant>;
62
- onParticipantChatClosed: EventEmitter<IChatParticipant>;
63
- onMessagesSeen: EventEmitter<Message[]>;
64
- onCloseWindowClicked: EventEmitter<boolean>;
65
- searchInputChanged: EventEmitter<string>;
66
- private browserNotificationsBootstrapped;
67
- hasPagedHistory: boolean;
68
- private statusDescription;
69
- private audioFile;
70
- participants: IChatParticipant[];
71
- participantsResponse: ParticipantResponse[];
72
- participantsInteractedWith: IChatParticipant[];
73
- currentActiveOption: IChatOption | null;
74
- private pollingIntervalWindowInstance;
75
- private get localStorageKey();
76
- windowSizeFactor: number;
77
- friendsListWidth: number;
78
- private viewPortTotalArea;
79
- unsupportedViewport: boolean;
80
- windows: Window[];
81
- isBootstrapped: boolean;
82
- chatWindows: QueryList<NgChatWindowComponent>;
83
- ngOnInit(): void;
84
- onResize(event: any): void;
85
- private NormalizeWindows;
86
- private bootstrapChat;
87
- private activateFriendListFetch;
88
- private initializeBrowserNotifications;
89
- private initializeDefaultText;
90
- private initializeTheme;
91
- private fetchFriendsList;
92
- fetchMessageHistory(window: Window): void;
93
- private onFetchMessageHistoryLoaded;
94
- private onFriendsListChanged;
95
- private onMessageReceived;
96
- onParticipantClickedFromFriendsList(participant: IChatParticipant): void;
97
- private cancelOptionPrompt;
98
- onOptionPromptCanceled(): void;
99
- onOptionPromptConfirmed(event: any): void;
100
- private confirmNewGroup;
101
- private openChatWindow;
102
- private focusOnWindow;
103
- private assertMessageType;
104
- markMessagesAsRead(messages: Message[]): void;
105
- private bufferAudioFile;
106
- private emitMessageSound;
107
- private emitBrowserNotification;
108
- private updateWindowsState;
109
- private restoreWindowsState;
110
- private getClosestWindow;
111
- private closeWindow;
112
- private getChatWindowComponentInstance;
113
- private scrollChatWindow;
114
- onWindowMessagesSeen(messagesSeen: Message[]): void;
115
- onWindowChatClosed(payload: {
116
- closedWindow: Window;
117
- closedViaEscapeKey: boolean;
118
- }): void;
119
- onWindowTabTriggered(payload: {
120
- triggeringWindow: Window;
121
- shiftKeyPressed: boolean;
122
- }): void;
123
- onWindowMessageSent(messageSent: Message): void;
124
- onWindowOptionTriggered(option: IChatOption): void;
125
- triggerOpenChatWindow(user: User): void;
126
- triggerCloseChatWindow(userId: any): void;
127
- triggerToggleChatWindowVisibility(userId: any): void;
128
- onCloseWindowClick(click: boolean): void;
129
- onSearchInputChanged(value: string): void;
130
- static ɵfac: i0.ɵɵFactoryDeclaration<NgChat, never>;
131
- static ɵcmp: i0.ɵɵComponentDeclaration<NgChat, "mnl-chat", never, { "isDisabled": { "alias": "isDisabled"; "required": false; }; "adapter": { "alias": "adapter"; "required": false; }; "groupAdapter": { "alias": "groupAdapter"; "required": false; }; "userId": { "alias": "userId"; "required": false; }; "isCollapsed": { "alias": "isCollapsed"; "required": false; }; "maximizeWindowOnNewMessage": { "alias": "maximizeWindowOnNewMessage"; "required": false; }; "pollFriendsList": { "alias": "pollFriendsList"; "required": false; }; "pollingInterval": { "alias": "pollingInterval"; "required": false; }; "historyEnabled": { "alias": "historyEnabled"; "required": false; }; "emojisEnabled": { "alias": "emojisEnabled"; "required": false; }; "linkfyEnabled": { "alias": "linkfyEnabled"; "required": false; }; "audioEnabled": { "alias": "audioEnabled"; "required": false; }; "searchEnabled": { "alias": "searchEnabled"; "required": false; }; "audioSource": { "alias": "audioSource"; "required": false; }; "persistWindowsState": { "alias": "persistWindowsState"; "required": false; }; "title": { "alias": "title"; "required": false; }; "messagePlaceholder": { "alias": "messagePlaceholder"; "required": false; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; }; "browserNotificationsEnabled": { "alias": "browserNotificationsEnabled"; "required": false; }; "browserNotificationIconSource": { "alias": "browserNotificationIconSource"; "required": false; }; "browserNotificationTitle": { "alias": "browserNotificationTitle"; "required": false; }; "historyPageSize": { "alias": "historyPageSize"; "required": false; }; "localization": { "alias": "localization"; "required": false; }; "hideFriendsList": { "alias": "hideFriendsList"; "required": false; }; "hideFriendsListOnUnsupportedViewport": { "alias": "hideFriendsListOnUnsupportedViewport"; "required": false; }; "fileUploadUrl": { "alias": "fileUploadUrl"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "customTheme": { "alias": "customTheme"; "required": false; }; "messageDatePipeFormat": { "alias": "messageDatePipeFormat"; "required": false; }; "showMessageDate": { "alias": "showMessageDate"; "required": false; }; "isViewportOnMobileEnabled": { "alias": "isViewportOnMobileEnabled"; "required": false; }; "fileUploadAdapter": { "alias": "fileUploadAdapter"; "required": false; }; }, { "onParticipantClicked": "onParticipantClicked"; "onParticipantChatOpened": "onParticipantChatOpened"; "onParticipantChatClosed": "onParticipantChatClosed"; "onMessagesSeen": "onMessagesSeen"; "onCloseWindowClicked": "onCloseWindowClicked"; "searchInputChanged": "searchInputChanged"; }, never, never, false, never>;
132
- }