isometrik-plugin-chat-sdk 2.0.19 → 2.0.21
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/dist/cjs/{app-globals-170f9e71.js → app-globals-2824b330.js} +3 -3
- package/dist/cjs/{app-globals-170f9e71.js.map → app-globals-2824b330.js.map} +1 -1
- package/dist/cjs/attachment-preview_22.cjs.entry.js +114 -141
- package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
- package/dist/cjs/audio-bubble_4.cjs.entry.js +1 -1
- package/dist/cjs/{chat-assets-686620e7.js → chat-assets-8c4dc04f.js} +22 -3
- package/dist/cjs/chat-assets-8c4dc04f.js.map +1 -0
- package/dist/cjs/chat-tile_3.cjs.entry.js +1 -1
- package/dist/cjs/forward-memebers.cjs.entry.js +1 -1
- package/dist/cjs/{groupcast-4239cbfc.js → groupcast-8441b4df.js} +2 -2
- package/dist/cjs/{groupcast-4239cbfc.js.map → groupcast-8441b4df.js.map} +1 -1
- package/dist/cjs/{groupcast-3cb44a25.js → groupcast-f24da720.js} +14 -4
- package/dist/cjs/groupcast-f24da720.js.map +1 -0
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/isometrik-webchat.cjs.js +6 -6
- package/dist/cjs/loader.cjs.js +6 -6
- package/dist/cjs/login-page_3.cjs.entry.js +7 -7
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/cjs/member-add.cjs.entry.js +2 -2
- package/dist/cjs/new-chat-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/{runtime-controls-99f378d4.js → runtime-controls-cfc8fc31.js} +3 -3
- package/dist/cjs/{runtime-controls-99f378d4.js.map → runtime-controls-cfc8fc31.js.map} +1 -1
- package/dist/cjs/send-media-4ee967d4.js +1194 -0
- package/dist/cjs/send-media-4ee967d4.js.map +1 -0
- package/dist/collection/api/groupcast.js +13 -3
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +102 -100
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +25 -47
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/GroupCast/GroupCast.js +3 -16
- package/dist/collection/components/ChatUIComponent/shared/GroupCast/GroupCast.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/message-info/message-info.js +10 -4
- package/dist/collection/components/ChatUIComponent/shared/message-info/message-info.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/public-send.js +4 -4
- package/dist/collection/components/my-component/web-chat/public-send.js.map +1 -1
- package/dist/collection/constants/chat-assets.js +21 -2
- package/dist/collection/lib/chat/document-thumbnail.js +433 -0
- package/dist/collection/lib/chat/document-thumbnail.js.map +1 -0
- package/dist/collection/lib/chat/index.js +1 -1
- package/dist/collection/lib/chat/index.js.map +1 -1
- package/dist/collection/lib/chat/send-media.js +348 -25
- package/dist/collection/lib/chat/send-media.js.map +1 -1
- package/dist/components/ChatFooter.js +25 -47
- package/dist/components/ChatFooter.js.map +1 -1
- package/dist/components/ChatSidebar.js +78 -73
- package/dist/components/ChatSidebar.js.map +1 -1
- package/dist/components/GroupCast2.js +3 -16
- package/dist/components/GroupCast2.js.map +1 -1
- package/dist/components/WebChat.js +4 -4
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/WebChatBody.js +1 -1
- package/dist/components/chat-assets.js +21 -2
- package/dist/components/chat-assets.js.map +1 -1
- package/dist/components/groupcast.js +13 -3
- package/dist/components/groupcast.js.map +1 -1
- package/dist/components/message-info2.js +10 -4
- package/dist/components/message-info2.js.map +1 -1
- package/dist/components/send-media.js +780 -26
- package/dist/components/send-media.js.map +1 -1
- package/dist/esm/{app-globals-15a6ef50.js → app-globals-e3f4717b.js} +3 -3
- package/dist/esm/{app-globals-15a6ef50.js.map → app-globals-e3f4717b.js.map} +1 -1
- package/dist/esm/attachment-preview_22.entry.js +114 -141
- package/dist/esm/attachment-preview_22.entry.js.map +1 -1
- package/dist/esm/audio-bubble_4.entry.js +1 -1
- package/dist/esm/{chat-assets-bb056958.js → chat-assets-27beb552.js} +22 -3
- package/dist/esm/chat-assets-27beb552.js.map +1 -0
- package/dist/esm/chat-tile_3.entry.js +1 -1
- package/dist/esm/forward-memebers.entry.js +1 -1
- package/dist/esm/{groupcast-ea2466c8.js → groupcast-5fb19ec3.js} +2 -2
- package/dist/esm/{groupcast-ea2466c8.js.map → groupcast-5fb19ec3.js.map} +1 -1
- package/dist/esm/{groupcast-cc10c6a4.js → groupcast-f96c1d9e.js} +14 -4
- package/dist/esm/groupcast-f96c1d9e.js.map +1 -0
- package/dist/esm/index.js +5 -5
- package/dist/esm/isometrik-webchat.js +6 -6
- package/dist/esm/loader.js +6 -6
- package/dist/esm/login-page_3.entry.js +7 -7
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/esm/member-add.entry.js +2 -2
- package/dist/esm/new-chat-sidebar.entry.js +1 -1
- package/dist/esm/{runtime-controls-8a22625e.js → runtime-controls-ff81e90a.js} +3 -3
- package/dist/esm/{runtime-controls-8a22625e.js.map → runtime-controls-ff81e90a.js.map} +1 -1
- package/dist/esm/send-media-58e7145b.js +1166 -0
- package/dist/esm/send-media-58e7145b.js.map +1 -0
- package/dist/isometrik-webchat/index.esm.js +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js.map +1 -1
- package/dist/isometrik-webchat/{p-fd6ce589.entry.js → p-09980c53.entry.js} +2 -2
- package/dist/isometrik-webchat/p-352b589e.entry.js +2 -0
- package/dist/isometrik-webchat/p-352b589e.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-3b3dc33e.js +2 -0
- package/dist/isometrik-webchat/p-3b3dc33e.js.map +1 -0
- package/dist/isometrik-webchat/{p-ffbbe278.entry.js → p-44da28d3.entry.js} +2 -2
- package/dist/isometrik-webchat/p-6f5037b2.js +2 -0
- package/dist/isometrik-webchat/p-6f5037b2.js.map +1 -0
- package/dist/isometrik-webchat/{p-6fc95e0e.js → p-78fb47c4.js} +2 -2
- package/dist/isometrik-webchat/{p-3120b9d3.entry.js → p-a9efcf1c.entry.js} +2 -2
- package/dist/isometrik-webchat/p-b0baa9ad.entry.js +2 -0
- package/dist/isometrik-webchat/p-b0baa9ad.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-c08055fe.js → p-b385ac4b.js} +2 -2
- package/dist/isometrik-webchat/p-c06ad586.js +2 -0
- package/dist/isometrik-webchat/p-c06ad586.js.map +1 -0
- package/dist/isometrik-webchat/p-d758e431.js +2 -0
- package/dist/isometrik-webchat/{p-c49de274.entry.js → p-d864bb9f.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-39b626ed.entry.js → p-f7d05551.entry.js} +2 -2
- package/dist/types/components/ChatUIComponent/ChatSidebar/ChatSidebar.d.ts +3 -2
- package/dist/types/components.d.ts +17 -17
- package/dist/types/js.d.ts +3 -0
- package/dist/types/lib/chat/document-thumbnail.d.ts +38 -0
- package/dist/types/lib/chat/index.d.ts +1 -1
- package/dist/types/lib/chat/send-media.d.ts +58 -1
- package/package.json +1 -1
- package/dist/cjs/chat-assets-686620e7.js.map +0 -1
- package/dist/cjs/groupcast-3cb44a25.js.map +0 -1
- package/dist/cjs/send-media-7c865c19.js +0 -438
- package/dist/cjs/send-media-7c865c19.js.map +0 -1
- package/dist/esm/chat-assets-bb056958.js.map +0 -1
- package/dist/esm/groupcast-cc10c6a4.js.map +0 -1
- package/dist/esm/send-media-5527ee9f.js +0 -412
- package/dist/esm/send-media-5527ee9f.js.map +0 -1
- package/dist/isometrik-webchat/p-1db79cfb.js +0 -2
- package/dist/isometrik-webchat/p-4671fe73.js +0 -2
- package/dist/isometrik-webchat/p-4671fe73.js.map +0 -1
- package/dist/isometrik-webchat/p-643457b8.js +0 -2
- package/dist/isometrik-webchat/p-643457b8.js.map +0 -1
- package/dist/isometrik-webchat/p-a5707f12.js +0 -2
- package/dist/isometrik-webchat/p-a5707f12.js.map +0 -1
- package/dist/isometrik-webchat/p-a9380fb3.entry.js +0 -2
- package/dist/isometrik-webchat/p-a9380fb3.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-fc3fd090.entry.js +0 -2
- package/dist/isometrik-webchat/p-fc3fd090.entry.js.map +0 -1
- /package/dist/isometrik-webchat/{p-fd6ce589.entry.js.map → p-09980c53.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-ffbbe278.entry.js.map → p-44da28d3.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-6fc95e0e.js.map → p-78fb47c4.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-3120b9d3.entry.js.map → p-a9efcf1c.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-c08055fe.js.map → p-b385ac4b.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-1db79cfb.js.map → p-d758e431.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-c49de274.entry.js.map → p-d864bb9f.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-39b626ed.entry.js.map → p-f7d05551.entry.js.map} +0 -0
|
@@ -18,8 +18,10 @@ import { needsAdminTransferBeforeLeave } from "../../../lib/group-admin-leave";
|
|
|
18
18
|
import { drawerDialogService } from "../../../lib/drawer";
|
|
19
19
|
import { postGroupCast } from "../../../api/groupcast.js";
|
|
20
20
|
import { formatUnixTimestamp } from "../../../utils/unixTimeConverter.js";
|
|
21
|
-
import { debounce, clearAll } from "../../../lib/helpers";
|
|
22
|
-
import {
|
|
21
|
+
import { debounce, clearAll } from "../../../lib/helpers.js";
|
|
22
|
+
import { isPdfAttachment } from "../../../lib/chat/preview-kind";
|
|
23
|
+
import { ATTACHMENT_BODY_PLACEHOLDER } from "../../../lib/chat/send-media";
|
|
24
|
+
import { New_Chat, Three_Dots, New_Group, Logout, Left_Arrow } from "../../../constants/chat-assets.js";
|
|
23
25
|
export class ChatSidebar {
|
|
24
26
|
constructor() {
|
|
25
27
|
this.toggleMoreMenu = (e) => {
|
|
@@ -185,7 +187,7 @@ export class ChatSidebar {
|
|
|
185
187
|
const mediaExtension = file.name.split('.').pop();
|
|
186
188
|
const res = await ChatSDK.getInstance().user.getPresignedurlCreate({
|
|
187
189
|
userIdentifier: this.userMetaData.userIdentifier,
|
|
188
|
-
mediaExtension,
|
|
190
|
+
mediaExtension: mediaExtension || '',
|
|
189
191
|
});
|
|
190
192
|
// Upload file to presigned URL
|
|
191
193
|
await fetch(res.presignedUrl, {
|
|
@@ -303,10 +305,10 @@ export class ChatSidebar {
|
|
|
303
305
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
304
306
|
if ((((_a = a === null || a === void 0 ? void 0 : a.lastMessageDetails) === null || _a === void 0 ? void 0 : _a.action) == 'chatMessageSent' || ((_b = a === null || a === void 0 ? void 0 : a.lastMessageDetails) === null || _b === void 0 ? void 0 : _b.action) == 'forward') &&
|
|
305
307
|
(((_c = a === null || a === void 0 ? void 0 : a.lastMessageDetails) === null || _c === void 0 ? void 0 : _c.body) === '' || ((_d = a === null || a === void 0 ? void 0 : a.lastMessageDetails) === null || _d === void 0 ? void 0 : _d.action) === 'clearConversation'))
|
|
306
|
-
return;
|
|
308
|
+
return 0;
|
|
307
309
|
if ((((_e = b === null || b === void 0 ? void 0 : b.lastMessageDetails) === null || _e === void 0 ? void 0 : _e.action) == 'chatMessageSent' || ((_f = b === null || b === void 0 ? void 0 : b.lastMessageDetails) === null || _f === void 0 ? void 0 : _f.action) == 'forward') &&
|
|
308
310
|
(((_g = b === null || b === void 0 ? void 0 : b.lastMessageDetails) === null || _g === void 0 ? void 0 : _g.body) === '' || ((_h = b === null || b === void 0 ? void 0 : b.lastMessageDetails) === null || _h === void 0 ? void 0 : _h.action) === 'clearConversation'))
|
|
309
|
-
return;
|
|
311
|
+
return 0;
|
|
310
312
|
const timeA = ((_j = a === null || a === void 0 ? void 0 : a.lastMessageDetails) === null || _j === void 0 ? void 0 : _j.action) === 'membersAdd' ? (_k = a === null || a === void 0 ? void 0 : a.lastMessageDetails) === null || _k === void 0 ? void 0 : _k.sentAt : ((_l = a === null || a === void 0 ? void 0 : a.lastMessageDetails) === null || _l === void 0 ? void 0 : _l.updatedAt) || ((_m = a === null || a === void 0 ? void 0 : a.lastMessageDetails) === null || _m === void 0 ? void 0 : _m.sentAt) || (a === null || a === void 0 ? void 0 : a.updatedAt) || 0;
|
|
311
313
|
const timeB = ((_o = b === null || b === void 0 ? void 0 : b.lastMessageDetails) === null || _o === void 0 ? void 0 : _o.action) === 'membersAdd' ? (_p = b === null || b === void 0 ? void 0 : b.lastMessageDetails) === null || _p === void 0 ? void 0 : _p.sentAt : ((_q = b === null || b === void 0 ? void 0 : b.lastMessageDetails) === null || _q === void 0 ? void 0 : _q.updatedAt) || ((_r = b === null || b === void 0 ? void 0 : b.lastMessageDetails) === null || _r === void 0 ? void 0 : _r.sentAt) || (b === null || b === void 0 ? void 0 : b.updatedAt) || 0;
|
|
312
314
|
return timeB - timeA;
|
|
@@ -358,7 +360,7 @@ export class ChatSidebar {
|
|
|
358
360
|
const currentCount = this.unreadCounts[conversationId] || 0;
|
|
359
361
|
this.unreadCounts = Object.assign(Object.assign({}, this.unreadCounts), { [conversationId]: currentCount + count });
|
|
360
362
|
// Update the conversation list to reflect the new message
|
|
361
|
-
this.conversationList = this.conversationList.map(conversation => {
|
|
363
|
+
this.conversationList = this.conversationList.map((conversation) => {
|
|
362
364
|
if (conversation.conversationId === conversationId) {
|
|
363
365
|
return Object.assign(Object.assign({}, conversation), { unreadMessagesCount: currentCount + count, lastMessageDetails: Object.assign(Object.assign({}, conversation.lastMessageDetails), { updatedAt: Date.now() }) });
|
|
364
366
|
}
|
|
@@ -371,7 +373,7 @@ export class ChatSidebar {
|
|
|
371
373
|
const selectedConversation = event.detail;
|
|
372
374
|
const selectedConvoId = selectedConversation.conversationId;
|
|
373
375
|
this.selectedConversationID = selectedConvoId;
|
|
374
|
-
this.conversationList = this.sortedConversationList.map(conversation => {
|
|
376
|
+
this.conversationList = this.sortedConversationList.map((conversation) => {
|
|
375
377
|
if (conversation.conversationId === selectedConvoId) {
|
|
376
378
|
return Object.assign(Object.assign({}, conversation), { unreadMessagesCount: 0 });
|
|
377
379
|
}
|
|
@@ -410,19 +412,32 @@ export class ChatSidebar {
|
|
|
410
412
|
}));
|
|
411
413
|
}
|
|
412
414
|
}
|
|
415
|
+
attachmentLooksLikeDocument(att) {
|
|
416
|
+
if (!att)
|
|
417
|
+
return false;
|
|
418
|
+
if (att.mediaType === 3)
|
|
419
|
+
return true;
|
|
420
|
+
if (isPdfAttachment({ mimeType: att.mimeType, name: att.name || att.nameWithExtension }))
|
|
421
|
+
return true;
|
|
422
|
+
const mime = String(att.mimeType || '').toLowerCase();
|
|
423
|
+
return mime.startsWith('application/') || mime.startsWith('text/');
|
|
424
|
+
}
|
|
413
425
|
getMediaType(tile) {
|
|
414
|
-
var _a;
|
|
415
426
|
const details = tile === null || tile === void 0 ? void 0 : tile.lastMessageDetails;
|
|
416
427
|
const attachments = details === null || details === void 0 ? void 0 : details.attachments;
|
|
417
428
|
if (attachments === null || attachments === void 0 ? void 0 : attachments.length) {
|
|
418
|
-
const
|
|
419
|
-
|
|
429
|
+
const last = attachments[attachments.length - 1];
|
|
430
|
+
const mimeType = String((last === null || last === void 0 ? void 0 : last.mimeType) || '').toLowerCase();
|
|
431
|
+
if (mimeType.startsWith('video/') || mimeType.includes('video'))
|
|
420
432
|
return 2;
|
|
421
|
-
if (
|
|
433
|
+
if (this.attachmentLooksLikeDocument(last))
|
|
434
|
+
return 3;
|
|
435
|
+
if (mimeType.startsWith('image/'))
|
|
422
436
|
return 1;
|
|
423
|
-
if (mimeType.includes('audio'))
|
|
437
|
+
if (mimeType.startsWith('audio/') || mimeType.includes('audio'))
|
|
424
438
|
return 4;
|
|
425
|
-
|
|
439
|
+
if ((last === null || last === void 0 ? void 0 : last.mediaType) === 3)
|
|
440
|
+
return 3;
|
|
426
441
|
return 3;
|
|
427
442
|
}
|
|
428
443
|
const body = (details === null || details === void 0 ? void 0 : details.body) || '';
|
|
@@ -446,14 +461,18 @@ export class ChatSidebar {
|
|
|
446
461
|
return (last === null || last === void 0 ? void 0 : last.name) || (last === null || last === void 0 ? void 0 : last.nameWithExtension) || 'Document';
|
|
447
462
|
}
|
|
448
463
|
getMessageBody(tile, userMetaData) {
|
|
449
|
-
var _a, _b
|
|
464
|
+
var _a, _b;
|
|
450
465
|
const details = tile === null || tile === void 0 ? void 0 : tile.lastMessageDetails;
|
|
451
466
|
if (!(details === null || details === void 0 ? void 0 : details.body))
|
|
452
467
|
return '';
|
|
453
468
|
const { senderId, senderName, body, attachments, metaData } = details;
|
|
454
469
|
const sender = senderId === (userMetaData === null || userMetaData === void 0 ? void 0 : userMetaData.userId) ? 'You' : senderName || '';
|
|
455
470
|
const caption = String((_b = (_a = metaData === null || metaData === void 0 ? void 0 : metaData.caption) !== null && _a !== void 0 ? _a : metaData === null || metaData === void 0 ? void 0 : metaData.captionMessage) !== null && _b !== void 0 ? _b : '').trim();
|
|
456
|
-
|
|
471
|
+
const bodyStr = String(body || '');
|
|
472
|
+
const isMultipleAttachment = bodyStr === ATTACHMENT_BODY_PLACEHOLDER ||
|
|
473
|
+
String((details === null || details === void 0 ? void 0 : details.customType) || '') === ATTACHMENT_BODY_PLACEHOLDER;
|
|
474
|
+
// Multiple: show caption from meta only; body is API placeholder or non-caption payload
|
|
475
|
+
let messageContent = isMultipleAttachment ? caption || '' : caption || bodyStr;
|
|
457
476
|
// Body placeholder (API non-empty) — never show AttachmentMessage:* as preview text
|
|
458
477
|
if (!caption && String(body || '').startsWith('AttachmentMessage:')) {
|
|
459
478
|
if (body === 'AttachmentMessage:Image')
|
|
@@ -463,13 +482,39 @@ export class ChatSidebar {
|
|
|
463
482
|
else if (body === 'AttachmentMessage:File' || body === 'AttachmentMessage:Audio' || body === 'AttachmentMessage:Doc') {
|
|
464
483
|
messageContent = 'Document';
|
|
465
484
|
}
|
|
485
|
+
else if (body === 'AttachmentMessage:Multiple') {
|
|
486
|
+
if (attachments === null || attachments === void 0 ? void 0 : attachments.length) {
|
|
487
|
+
const last = attachments[attachments.length - 1];
|
|
488
|
+
if (this.attachmentLooksLikeDocument(last)) {
|
|
489
|
+
messageContent = (last === null || last === void 0 ? void 0 : last.name) || (last === null || last === void 0 ? void 0 : last.nameWithExtension) || 'Document';
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
const mimeType = String((last === null || last === void 0 ? void 0 : last.mimeType) || '').toLowerCase();
|
|
493
|
+
if (mimeType.startsWith('video/') || mimeType.includes('video'))
|
|
494
|
+
messageContent = 'Video';
|
|
495
|
+
else if (mimeType.startsWith('image/'))
|
|
496
|
+
messageContent = 'Image';
|
|
497
|
+
else if (mimeType.startsWith('audio/') || mimeType.includes('audio'))
|
|
498
|
+
messageContent = 'Audio';
|
|
499
|
+
else
|
|
500
|
+
messageContent = 'Attachment';
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
else {
|
|
504
|
+
messageContent = 'Attachment';
|
|
505
|
+
}
|
|
506
|
+
}
|
|
466
507
|
else if (attachments === null || attachments === void 0 ? void 0 : attachments.length) {
|
|
467
|
-
const
|
|
468
|
-
|
|
508
|
+
const last = attachments[attachments.length - 1];
|
|
509
|
+
const mimeType = String((last === null || last === void 0 ? void 0 : last.mimeType) || '').toLowerCase();
|
|
510
|
+
if (this.attachmentLooksLikeDocument(last)) {
|
|
511
|
+
messageContent = (last === null || last === void 0 ? void 0 : last.name) || (last === null || last === void 0 ? void 0 : last.nameWithExtension) || 'Document';
|
|
512
|
+
}
|
|
513
|
+
else if (mimeType.startsWith('video/') || mimeType.includes('video'))
|
|
469
514
|
messageContent = 'Video';
|
|
470
|
-
else if (mimeType.
|
|
515
|
+
else if (mimeType.startsWith('image/'))
|
|
471
516
|
messageContent = 'Image';
|
|
472
|
-
else if (mimeType.includes('audio'))
|
|
517
|
+
else if (mimeType.startsWith('audio/') || mimeType.includes('audio'))
|
|
473
518
|
messageContent = 'Audio';
|
|
474
519
|
else
|
|
475
520
|
messageContent = 'Document';
|
|
@@ -541,7 +586,7 @@ export class ChatSidebar {
|
|
|
541
586
|
const previewText = this.getLastMessageText(tile, this.userMetaData) || '';
|
|
542
587
|
const unreadCount = (_a = this.unreadCounts[conversationId]) !== null && _a !== void 0 ? _a : ((tile === null || tile === void 0 ? void 0 : tile.unreadMessagesCount) > 0 ? tile.unreadMessagesCount : 0);
|
|
543
588
|
const isTyping = !!(this.isTyping && this.typingConversationId === conversationId);
|
|
544
|
-
const typingUserName = tile.isGroup ? this.typingUserName :
|
|
589
|
+
const typingUserName = tile.isGroup ? this.typingUserName : undefined;
|
|
545
590
|
const customTag = (_b = this.customParts) === null || _b === void 0 ? void 0 : _b.chatTile;
|
|
546
591
|
if (customTag) {
|
|
547
592
|
return h(customTag, {
|
|
@@ -737,29 +782,14 @@ export class ChatSidebar {
|
|
|
737
782
|
}
|
|
738
783
|
async createGroupConversation() {
|
|
739
784
|
try {
|
|
740
|
-
const
|
|
741
|
-
|
|
742
|
-
readEvents: true,
|
|
743
|
-
pushNotifications: true,
|
|
744
|
-
members: this.selectedGroupUserIds,
|
|
745
|
-
isGroup: true,
|
|
746
|
-
conversationType: 0,
|
|
747
|
-
conversationTitle: this.groupInfo.title,
|
|
748
|
-
conversationImageUrl: this.groupInfo.imageUrl,
|
|
749
|
-
};
|
|
785
|
+
const imageUrl = (this.groupInfo.imageUrl || '').trim();
|
|
786
|
+
const paramsForCreateConversation = Object.assign({ typingEvents: true, readEvents: true, pushNotifications: true, members: this.selectedGroupUserIds, isGroup: true, conversationType: 0, conversationTitle: this.groupInfo.title }, (imageUrl ? { conversationImageUrl: imageUrl } : {}));
|
|
750
787
|
const res = await ChatSDK.getInstance().Conversation.postConversation(paramsForCreateConversation);
|
|
751
788
|
// Add the new group conversation to the list
|
|
752
|
-
const newConversation = {
|
|
753
|
-
conversationId: res.conversationId,
|
|
754
|
-
lastMessageDetails: {
|
|
789
|
+
const newConversation = Object.assign({ conversationId: res.conversationId, lastMessageDetails: {
|
|
755
790
|
updatedAt: Date.now(),
|
|
756
791
|
body: '',
|
|
757
|
-
},
|
|
758
|
-
unreadMessagesCount: 0,
|
|
759
|
-
isGroup: true,
|
|
760
|
-
conversationTitle: this.groupInfo.title,
|
|
761
|
-
conversationImageUrl: this.groupInfo.imageUrl,
|
|
762
|
-
};
|
|
792
|
+
}, unreadMessagesCount: 0, isGroup: true, conversationTitle: this.groupInfo.title }, (imageUrl ? { conversationImageUrl: imageUrl } : {}));
|
|
763
793
|
this.conversationList = [newConversation, ...this.conversationList];
|
|
764
794
|
// this.sortConversations();
|
|
765
795
|
this.selectedConversationID = res.conversationId;
|
|
@@ -777,7 +807,6 @@ export class ChatSidebar {
|
|
|
777
807
|
const { conversationTitle, imageFile, selectedUserIds, isGroupCast, selectedUsers } = event.detail;
|
|
778
808
|
try {
|
|
779
809
|
this.isGroupCreationLoading = true;
|
|
780
|
-
// Empty → profile-avatar group fallback (avoid broken X placeholder CDN asset).
|
|
781
810
|
let conversationImageUrl = '';
|
|
782
811
|
if (imageFile) {
|
|
783
812
|
try {
|
|
@@ -801,18 +830,9 @@ export class ChatSidebar {
|
|
|
801
830
|
return;
|
|
802
831
|
}
|
|
803
832
|
}
|
|
804
|
-
const
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
pushNotifications: true,
|
|
808
|
-
members: selectedUserIds,
|
|
809
|
-
isGroup: true,
|
|
810
|
-
conversationType: 1,
|
|
811
|
-
conversationTitle,
|
|
812
|
-
conversationImageUrl,
|
|
813
|
-
searchableTags: [conversationTitle],
|
|
814
|
-
};
|
|
815
|
-
const members = selectedUserIds.map(id => {
|
|
833
|
+
const trimmedImageUrl = conversationImageUrl.trim();
|
|
834
|
+
const paramsForCreateConversation = Object.assign(Object.assign({ typingEvents: true, readEvents: true, pushNotifications: true, members: selectedUserIds, isGroup: true, conversationType: 1, conversationTitle }, (trimmedImageUrl ? { conversationImageUrl: trimmedImageUrl } : {})), { searchableTags: [conversationTitle] });
|
|
835
|
+
const members = selectedUserIds.map((id) => {
|
|
816
836
|
const user = selectedUsers === null || selectedUsers === void 0 ? void 0 : selectedUsers.find((u) => (u === null || u === void 0 ? void 0 : u.userId) === id);
|
|
817
837
|
return {
|
|
818
838
|
newConversationTypingEvents: true,
|
|
@@ -824,16 +844,9 @@ export class ChatSidebar {
|
|
|
824
844
|
userName: (user === null || user === void 0 ? void 0 : user.userName) || id,
|
|
825
845
|
};
|
|
826
846
|
});
|
|
827
|
-
const paramsForCreateGroupCastConversation = {
|
|
828
|
-
groupcastTitle: conversationTitle,
|
|
829
|
-
groupcastImageUrl: conversationImageUrl,
|
|
830
|
-
searchableTags: [conversationTitle],
|
|
831
|
-
metaData: { description: 'groupcast created',
|
|
847
|
+
const paramsForCreateGroupCastConversation = Object.assign(Object.assign({ groupcastTitle: conversationTitle }, (trimmedImageUrl ? { groupcastImageUrl: trimmedImageUrl } : {})), { searchableTags: [conversationTitle], metaData: { description: 'groupcast created',
|
|
832
848
|
members: selectedUsers
|
|
833
|
-
},
|
|
834
|
-
customType: 'groupcast',
|
|
835
|
-
members,
|
|
836
|
-
};
|
|
849
|
+
}, customType: 'groupcast', members });
|
|
837
850
|
if (isGroupCast) {
|
|
838
851
|
const res = await postGroupCast(paramsForCreateGroupCastConversation);
|
|
839
852
|
this.selectedConversationID = res.groupcastId;
|
|
@@ -849,25 +862,17 @@ export class ChatSidebar {
|
|
|
849
862
|
}
|
|
850
863
|
else {
|
|
851
864
|
const res = await ChatSDK.getInstance().Conversation.postConversation(paramsForCreateConversation);
|
|
852
|
-
const newConversation = {
|
|
853
|
-
conversationId: res.conversationId,
|
|
854
|
-
lastMessageDetails: {
|
|
865
|
+
const newConversation = Object.assign(Object.assign({ conversationId: res.conversationId, lastMessageDetails: {
|
|
855
866
|
updatedAt: Date.now(),
|
|
856
867
|
body: '',
|
|
857
|
-
},
|
|
858
|
-
unreadMessagesCount: 0,
|
|
859
|
-
isGroup: true,
|
|
860
|
-
conversationTitle,
|
|
861
|
-
conversationImageUrl,
|
|
862
|
-
members: selectedUserIds,
|
|
863
|
-
};
|
|
868
|
+
}, unreadMessagesCount: 0, isGroup: true, conversationTitle }, (trimmedImageUrl ? { conversationImageUrl: trimmedImageUrl } : {})), { members: selectedUserIds });
|
|
864
869
|
this.conversationList = [newConversation, ...this.conversationList];
|
|
865
870
|
this.selectedConversationID = res.conversationId;
|
|
866
871
|
// Keep header avatar in sync immediately (details fetch can lag / omit image).
|
|
867
872
|
conversationStore.updateConversationDetails({
|
|
868
873
|
conversationId: res.conversationId,
|
|
869
874
|
conversationTitle,
|
|
870
|
-
conversationImageUrl:
|
|
875
|
+
conversationImageUrl: trimmedImageUrl || '',
|
|
871
876
|
isGroup: true,
|
|
872
877
|
});
|
|
873
878
|
const url = new URL(window.location.href);
|
|
@@ -939,7 +944,7 @@ export class ChatSidebar {
|
|
|
939
944
|
try {
|
|
940
945
|
this.isLoading = true;
|
|
941
946
|
await ChatSDK.getInstance().Conversation.deleteConversationLeave({ conversationId });
|
|
942
|
-
this.conversationList = this.conversationList.filter(conversation => conversation.conversationId !== conversationId);
|
|
947
|
+
this.conversationList = this.conversationList.filter((conversation) => conversation.conversationId !== conversationId);
|
|
943
948
|
// this.sortConversations();
|
|
944
949
|
const url = new URL(window.location.href);
|
|
945
950
|
url.searchParams.delete('conversation');
|
|
@@ -967,7 +972,7 @@ export class ChatSidebar {
|
|
|
967
972
|
handleMessageReadStatusUpdate(event) {
|
|
968
973
|
const { conversationId, isRead, isDelivered } = event.detail;
|
|
969
974
|
// Update the conversation list to reflect new read status
|
|
970
|
-
this.conversationList = this.conversationList.map(conversation => {
|
|
975
|
+
this.conversationList = this.conversationList.map((conversation) => {
|
|
971
976
|
if (conversation.conversationId === conversationId) {
|
|
972
977
|
return Object.assign(Object.assign({}, conversation), { lastMessageDetails: Object.assign(Object.assign({}, conversation.lastMessageDetails), { readByAll: isRead, deliveredToAll: isDelivered }) });
|
|
973
978
|
}
|
|
@@ -1002,7 +1007,7 @@ export class ChatSidebar {
|
|
|
1002
1007
|
"resolved": "boolean",
|
|
1003
1008
|
"references": {}
|
|
1004
1009
|
},
|
|
1005
|
-
"required":
|
|
1010
|
+
"required": true,
|
|
1006
1011
|
"optional": false,
|
|
1007
1012
|
"docs": {
|
|
1008
1013
|
"tags": [],
|
|
@@ -1055,7 +1060,7 @@ export class ChatSidebar {
|
|
|
1055
1060
|
"resolved": "boolean",
|
|
1056
1061
|
"references": {}
|
|
1057
1062
|
},
|
|
1058
|
-
"required":
|
|
1063
|
+
"required": true,
|
|
1059
1064
|
"optional": false,
|
|
1060
1065
|
"docs": {
|
|
1061
1066
|
"tags": [],
|
|
@@ -1072,7 +1077,7 @@ export class ChatSidebar {
|
|
|
1072
1077
|
"resolved": "boolean",
|
|
1073
1078
|
"references": {}
|
|
1074
1079
|
},
|
|
1075
|
-
"required":
|
|
1080
|
+
"required": true,
|
|
1076
1081
|
"optional": false,
|
|
1077
1082
|
"docs": {
|
|
1078
1083
|
"tags": [],
|
|
@@ -1161,7 +1166,7 @@ export class ChatSidebar {
|
|
|
1161
1166
|
"resolved": "boolean",
|
|
1162
1167
|
"references": {}
|
|
1163
1168
|
},
|
|
1164
|
-
"required":
|
|
1169
|
+
"required": true,
|
|
1165
1170
|
"optional": false,
|
|
1166
1171
|
"docs": {
|
|
1167
1172
|
"tags": [],
|
|
@@ -1178,7 +1183,7 @@ export class ChatSidebar {
|
|
|
1178
1183
|
"resolved": "boolean",
|
|
1179
1184
|
"references": {}
|
|
1180
1185
|
},
|
|
1181
|
-
"required":
|
|
1186
|
+
"required": true,
|
|
1182
1187
|
"optional": false,
|
|
1183
1188
|
"docs": {
|
|
1184
1189
|
"tags": [],
|
|
@@ -1195,7 +1200,7 @@ export class ChatSidebar {
|
|
|
1195
1200
|
"resolved": "string",
|
|
1196
1201
|
"references": {}
|
|
1197
1202
|
},
|
|
1198
|
-
"required":
|
|
1203
|
+
"required": true,
|
|
1199
1204
|
"optional": false,
|
|
1200
1205
|
"docs": {
|
|
1201
1206
|
"tags": [],
|
|
@@ -1212,7 +1217,7 @@ export class ChatSidebar {
|
|
|
1212
1217
|
"resolved": "string",
|
|
1213
1218
|
"references": {}
|
|
1214
1219
|
},
|
|
1215
|
-
"required":
|
|
1220
|
+
"required": true,
|
|
1216
1221
|
"optional": false,
|
|
1217
1222
|
"docs": {
|
|
1218
1223
|
"tags": [],
|
|
@@ -1229,7 +1234,7 @@ export class ChatSidebar {
|
|
|
1229
1234
|
"resolved": "string",
|
|
1230
1235
|
"references": {}
|
|
1231
1236
|
},
|
|
1232
|
-
"required":
|
|
1237
|
+
"required": true,
|
|
1233
1238
|
"optional": false,
|
|
1234
1239
|
"docs": {
|
|
1235
1240
|
"tags": [],
|
|
@@ -1246,7 +1251,7 @@ export class ChatSidebar {
|
|
|
1246
1251
|
"resolved": "(conversationId: string) => void",
|
|
1247
1252
|
"references": {}
|
|
1248
1253
|
},
|
|
1249
|
-
"required":
|
|
1254
|
+
"required": true,
|
|
1250
1255
|
"optional": false,
|
|
1251
1256
|
"docs": {
|
|
1252
1257
|
"tags": [],
|
|
@@ -1261,7 +1266,7 @@ export class ChatSidebar {
|
|
|
1261
1266
|
"resolved": "(searchTag: string) => void",
|
|
1262
1267
|
"references": {}
|
|
1263
1268
|
},
|
|
1264
|
-
"required":
|
|
1269
|
+
"required": true,
|
|
1265
1270
|
"optional": false,
|
|
1266
1271
|
"docs": {
|
|
1267
1272
|
"tags": [],
|
|
@@ -1293,7 +1298,7 @@ export class ChatSidebar {
|
|
|
1293
1298
|
"resolved": "boolean",
|
|
1294
1299
|
"references": {}
|
|
1295
1300
|
},
|
|
1296
|
-
"required":
|
|
1301
|
+
"required": true,
|
|
1297
1302
|
"optional": false,
|
|
1298
1303
|
"docs": {
|
|
1299
1304
|
"tags": [],
|
|
@@ -1310,7 +1315,7 @@ export class ChatSidebar {
|
|
|
1310
1315
|
"resolved": "string",
|
|
1311
1316
|
"references": {}
|
|
1312
1317
|
},
|
|
1313
|
-
"required":
|
|
1318
|
+
"required": true,
|
|
1314
1319
|
"optional": false,
|
|
1315
1320
|
"docs": {
|
|
1316
1321
|
"tags": [],
|
|
@@ -1327,7 +1332,7 @@ export class ChatSidebar {
|
|
|
1327
1332
|
"resolved": "string",
|
|
1328
1333
|
"references": {}
|
|
1329
1334
|
},
|
|
1330
|
-
"required":
|
|
1335
|
+
"required": true,
|
|
1331
1336
|
"optional": false,
|
|
1332
1337
|
"docs": {
|
|
1333
1338
|
"tags": [],
|
|
@@ -1354,24 +1359,21 @@ export class ChatSidebar {
|
|
|
1354
1359
|
"reflect": false
|
|
1355
1360
|
},
|
|
1356
1361
|
"isConversationLoading": {
|
|
1357
|
-
"type": "
|
|
1362
|
+
"type": "boolean",
|
|
1358
1363
|
"mutable": false,
|
|
1359
1364
|
"complexType": {
|
|
1360
|
-
"original": "
|
|
1361
|
-
"resolved": "
|
|
1362
|
-
"references": {
|
|
1363
|
-
"Boolean": {
|
|
1364
|
-
"location": "global",
|
|
1365
|
-
"id": "global::Boolean"
|
|
1366
|
-
}
|
|
1367
|
-
}
|
|
1365
|
+
"original": "boolean",
|
|
1366
|
+
"resolved": "boolean",
|
|
1367
|
+
"references": {}
|
|
1368
1368
|
},
|
|
1369
|
-
"required":
|
|
1369
|
+
"required": true,
|
|
1370
1370
|
"optional": false,
|
|
1371
1371
|
"docs": {
|
|
1372
1372
|
"tags": [],
|
|
1373
1373
|
"text": ""
|
|
1374
|
-
}
|
|
1374
|
+
},
|
|
1375
|
+
"attribute": "is-conversation-loading",
|
|
1376
|
+
"reflect": false
|
|
1375
1377
|
},
|
|
1376
1378
|
"hasMoreConversations": {
|
|
1377
1379
|
"type": "boolean",
|
|
@@ -1381,7 +1383,7 @@ export class ChatSidebar {
|
|
|
1381
1383
|
"resolved": "boolean",
|
|
1382
1384
|
"references": {}
|
|
1383
1385
|
},
|
|
1384
|
-
"required":
|
|
1386
|
+
"required": true,
|
|
1385
1387
|
"optional": false,
|
|
1386
1388
|
"docs": {
|
|
1387
1389
|
"tags": [],
|
|
@@ -1398,7 +1400,7 @@ export class ChatSidebar {
|
|
|
1398
1400
|
"resolved": "number",
|
|
1399
1401
|
"references": {}
|
|
1400
1402
|
},
|
|
1401
|
-
"required":
|
|
1403
|
+
"required": true,
|
|
1402
1404
|
"optional": false,
|
|
1403
1405
|
"docs": {
|
|
1404
1406
|
"tags": [],
|