isometrik-plugin-chat-sdk 2.0.4 → 2.0.5
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-61a8bfde.js → app-globals-dba84d07.js} +4 -4
- package/dist/cjs/{app-globals-61a8bfde.js.map → app-globals-dba84d07.js.map} +1 -1
- package/dist/cjs/attachment-preview_22.cjs.entry.js +65 -53
- package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
- package/dist/cjs/{send-media-14908d4b.js → groupcast-5e3d49c4.js} +1 -127
- package/dist/cjs/groupcast-5e3d49c4.js.map +1 -0
- package/dist/cjs/index.cjs.js +9 -9
- package/dist/cjs/isometrik-webchat.cjs.js +4 -4
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/login-page_3.cjs.entry.js +43 -42
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/cjs/{runtime-controls-201c71ba.js → runtime-controls-b5a3836e.js} +21 -21
- package/dist/cjs/{runtime-controls-201c71ba.js.map → runtime-controls-b5a3836e.js.map} +1 -1
- package/dist/cjs/send-media-2c02bba7.js +319 -0
- package/dist/cjs/send-media-2c02bba7.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +25 -17
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +15 -16
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +9 -6
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/message-info/message-info.js +6 -2
- package/dist/collection/components/ChatUIComponent/shared/message-info/message-info.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/offline-host.js +7 -6
- package/dist/collection/components/my-component/web-chat/offline-host.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/public-send.js +3 -3
- package/dist/collection/components/my-component/web-chat/public-send.js.map +1 -1
- 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 +30 -5
- package/dist/collection/lib/chat/send-media.js.map +1 -1
- package/dist/components/ChatFooter.js +15 -16
- package/dist/components/ChatFooter.js.map +1 -1
- package/dist/components/ChatSidebar.js +25 -17
- package/dist/components/ChatSidebar.js.map +1 -1
- package/dist/components/WebChat.js +10 -8
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/WebChatBody.js +9 -6
- package/dist/components/WebChatBody.js.map +1 -1
- package/dist/components/client.js +1 -121
- package/dist/components/client.js.map +1 -1
- package/dist/components/index.js +3 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/message-info2.js +6 -2
- package/dist/components/message-info2.js.map +1 -1
- package/dist/components/send-media.js +150 -0
- package/dist/components/send-media.js.map +1 -0
- package/dist/esm/{app-globals-2beecb81.js → app-globals-8fea092d.js} +3 -3
- package/dist/esm/{app-globals-2beecb81.js.map → app-globals-8fea092d.js.map} +1 -1
- package/dist/esm/attachment-preview_22.entry.js +54 -42
- package/dist/esm/attachment-preview_22.entry.js.map +1 -1
- package/dist/esm/{send-media-917dcc2f.js → groupcast-58a59d64.js} +2 -122
- package/dist/esm/groupcast-58a59d64.js.map +1 -0
- package/dist/esm/index.js +4 -4
- package/dist/esm/isometrik-webchat.js +4 -4
- package/dist/esm/loader.js +4 -4
- package/dist/esm/login-page_3.entry.js +10 -9
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/esm/{runtime-controls-cf599fe2.js → runtime-controls-c5ba5009.js} +3 -3
- package/dist/esm/{runtime-controls-cf599fe2.js.map → runtime-controls-c5ba5009.js.map} +1 -1
- package/dist/esm/send-media-588837c7.js +296 -0
- package/dist/esm/send-media-588837c7.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/p-1953573d.js +2 -0
- package/dist/isometrik-webchat/p-1953573d.js.map +1 -0
- package/dist/isometrik-webchat/p-1a6e6524.js +2 -0
- package/dist/isometrik-webchat/p-1a6e6524.js.map +1 -0
- package/dist/isometrik-webchat/p-70f66001.js +2 -0
- package/dist/isometrik-webchat/{p-0731d488.js.map → p-70f66001.js.map} +1 -1
- package/dist/isometrik-webchat/p-8816acc1.js +2 -0
- package/dist/isometrik-webchat/p-92eec03b.entry.js +2 -0
- package/dist/isometrik-webchat/p-92eec03b.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-b16c3db0.entry.js +2 -0
- package/dist/isometrik-webchat/p-b16c3db0.entry.js.map +1 -0
- package/dist/types/components/ChatUIComponent/Footer/ChatFooter.d.ts +2 -22
- package/dist/types/lib/chat/index.d.ts +1 -1
- package/dist/types/lib/chat/send-media.d.ts +8 -0
- package/package.json +2 -1
- package/dist/cjs/media-limits-eba42629.js +0 -165
- package/dist/cjs/media-limits-eba42629.js.map +0 -1
- package/dist/cjs/send-media-14908d4b.js.map +0 -1
- package/dist/esm/media-limits-3fa07c09.js +0 -152
- package/dist/esm/media-limits-3fa07c09.js.map +0 -1
- package/dist/esm/send-media-917dcc2f.js.map +0 -1
- package/dist/isometrik-webchat/p-0731d488.js +0 -2
- package/dist/isometrik-webchat/p-7d4cc4e3.entry.js +0 -2
- package/dist/isometrik-webchat/p-7d4cc4e3.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-7f415f28.js +0 -2
- package/dist/isometrik-webchat/p-bdcdf1c5.js +0 -2
- package/dist/isometrik-webchat/p-bdcdf1c5.js.map +0 -1
- package/dist/isometrik-webchat/p-dc2bf17e.entry.js +0 -2
- package/dist/isometrik-webchat/p-dc2bf17e.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-eb54f75d.js +0 -2
- package/dist/isometrik-webchat/p-eb54f75d.js.map +0 -1
- /package/dist/isometrik-webchat/{p-7f415f28.js.map → p-8816acc1.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, a as createEvent, h, g as getElement, F as Fragment, f as Host } from './index-bc463197.js';
|
|
2
2
|
import { N as New_Group, c as Group_cast, d as Left_Arrow, e as New_Chat, T as Three_Dots, f as Logout, a as Search, A as Add_User, I as Info, g as CloseButton, h as Clear_Chat, B as Block_User, i as Icon_Doc, j as Icon_Excel, k as Icon_Rtf, l as Icon_Txt, m as Smile, S as Send, D as Delete, n as Attachment, M as Microphone, o as Camera_Add, E as Edit, p as Dark_Theme, q as Message, R as Reply, F as Forward } from './chat-assets-bb056958.js';
|
|
3
3
|
import { C as CancelIcon } from './cancel-4f6541af.js';
|
|
4
|
-
import { M as MAX_MEDIA_PER_MESSAGE, t as takeMediaFiles,
|
|
4
|
+
import { M as MAX_MEDIA_PER_MESSAGE, t as takeMediaFiles, j as mediaLimitToastMessage, A as ATTACHMENT_BODY_PLACEHOLDER, h as attachmentBodyForApi, g as buildReplyMetaData, l as mediaPreviewUrls, n as docIconKind, o as splitSharedMessages, q as attachmentCaption } from './send-media-588837c7.js';
|
|
5
5
|
import { i as isPdfAttachment, D as DoubleCheck } from './doublecheck-261763ef.js';
|
|
6
6
|
import { M } from './index.m-8c70037f.js';
|
|
7
7
|
import { d as drawerDialogService } from './drawer-74c188f1.js';
|
|
@@ -578,30 +578,38 @@ const ChatSidebar = class {
|
|
|
578
578
|
return (last === null || last === void 0 ? void 0 : last.name) || (last === null || last === void 0 ? void 0 : last.nameWithExtension) || 'Document';
|
|
579
579
|
}
|
|
580
580
|
getMessageBody(tile, userMetaData) {
|
|
581
|
-
var _a;
|
|
581
|
+
var _a, _b, _c;
|
|
582
582
|
const details = tile === null || tile === void 0 ? void 0 : tile.lastMessageDetails;
|
|
583
583
|
if (!(details === null || details === void 0 ? void 0 : details.body))
|
|
584
584
|
return '';
|
|
585
|
-
const { senderId, senderName, body, attachments } = details;
|
|
585
|
+
const { senderId, senderName, body, attachments, metaData } = details;
|
|
586
586
|
const sender = senderId === (userMetaData === null || userMetaData === void 0 ? void 0 : userMetaData.userId) ? 'You' : senderName || '';
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
else if (mimeType === null || mimeType === void 0 ? void 0 : mimeType.includes('image'))
|
|
587
|
+
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();
|
|
588
|
+
let messageContent = caption || body;
|
|
589
|
+
// Body placeholder (API non-empty) — never show AttachmentMessage:* as preview text
|
|
590
|
+
if (!caption && String(body || '').startsWith('AttachmentMessage:')) {
|
|
591
|
+
if (body === 'AttachmentMessage:Image')
|
|
593
592
|
messageContent = 'Image';
|
|
594
|
-
else if (
|
|
595
|
-
messageContent = '
|
|
596
|
-
else
|
|
593
|
+
else if (body === 'AttachmentMessage:Video')
|
|
594
|
+
messageContent = 'Video';
|
|
595
|
+
else if (body === 'AttachmentMessage:File' || body === 'AttachmentMessage:Audio' || body === 'AttachmentMessage:Doc') {
|
|
597
596
|
messageContent = 'Document';
|
|
597
|
+
}
|
|
598
|
+
else if (attachments === null || attachments === void 0 ? void 0 : attachments.length) {
|
|
599
|
+
const mimeType = ((_c = attachments[attachments.length - 1]) === null || _c === void 0 ? void 0 : _c.mimeType) || '';
|
|
600
|
+
if (mimeType.includes('video'))
|
|
601
|
+
messageContent = 'Video';
|
|
602
|
+
else if (mimeType.includes('image'))
|
|
603
|
+
messageContent = 'Image';
|
|
604
|
+
else if (mimeType.includes('audio'))
|
|
605
|
+
messageContent = 'Audio';
|
|
606
|
+
else
|
|
607
|
+
messageContent = 'Document';
|
|
608
|
+
}
|
|
609
|
+
else {
|
|
610
|
+
messageContent = 'Attachment';
|
|
611
|
+
}
|
|
598
612
|
}
|
|
599
|
-
else if (body === 'AttachmentMessage:Image')
|
|
600
|
-
messageContent = 'Image';
|
|
601
|
-
else if (body === 'AttachmentMessage:Video')
|
|
602
|
-
messageContent = 'Video';
|
|
603
|
-
else if (body === 'AttachmentMessage:File' || body === 'AttachmentMessage:Audio')
|
|
604
|
-
messageContent = 'Document';
|
|
605
613
|
return (tile === null || tile === void 0 ? void 0 : tile.isGroup) ? `${sender}: ${messageContent}` : messageContent;
|
|
606
614
|
}
|
|
607
615
|
getLastMessageText(tile, userMetaData) {
|
|
@@ -5427,7 +5435,7 @@ const ChatFooter = class {
|
|
|
5427
5435
|
}
|
|
5428
5436
|
}
|
|
5429
5437
|
async sendMediaMessage(conversationId) {
|
|
5430
|
-
var _a;
|
|
5438
|
+
var _a, _b;
|
|
5431
5439
|
this.changeMessageSendingState(true);
|
|
5432
5440
|
let messageId = Date.now().toString() + Math.random() * 100;
|
|
5433
5441
|
const files = takeMediaFiles(this.attachmentDetails || [], 0).accepted;
|
|
@@ -5461,8 +5469,9 @@ const ChatFooter = class {
|
|
|
5461
5469
|
: files[0].type.startsWith('audio/')
|
|
5462
5470
|
? 'AttachmentMessage:Audio'
|
|
5463
5471
|
: 'AttachmentMessage:File'
|
|
5464
|
-
:
|
|
5465
|
-
const
|
|
5472
|
+
: ATTACHMENT_BODY_PLACEHOLDER;
|
|
5473
|
+
const caption = ((_a = this.messageBody) === null || _a === void 0 ? void 0 : _a.trim()) || '';
|
|
5474
|
+
const localMessage = Object.assign(Object.assign({}, this.createLocalMessage(attachmentBodyForApi(caption), localAttachments, messageId)), { customType, metaData: buildReplyMetaData(this.replyMessage, caption) });
|
|
5466
5475
|
try {
|
|
5467
5476
|
await this.updateConversationListOnMessageSend(localMessage);
|
|
5468
5477
|
}
|
|
@@ -5478,7 +5487,7 @@ const ChatFooter = class {
|
|
|
5478
5487
|
try {
|
|
5479
5488
|
let resForPresignedUrl;
|
|
5480
5489
|
if (this.isGroupcast) {
|
|
5481
|
-
resForPresignedUrl = await getPresignedUrlForGroupcastMedia((
|
|
5490
|
+
resForPresignedUrl = await getPresignedUrlForGroupcastMedia((_b = this.userMetaData) === null || _b === void 0 ? void 0 : _b.userIdentifier, attachments === null || attachments === void 0 ? void 0 : attachments.mimeType);
|
|
5482
5491
|
}
|
|
5483
5492
|
else {
|
|
5484
5493
|
resForPresignedUrl = await M.getInstance().message.postMessagesPresignedurls(payload);
|
|
@@ -5504,7 +5513,7 @@ const ChatFooter = class {
|
|
|
5504
5513
|
}
|
|
5505
5514
|
}
|
|
5506
5515
|
async uploadAndSendMedia(presignedUrls, attachments, conversationId, oldMessageId) {
|
|
5507
|
-
var _a, _b, _c;
|
|
5516
|
+
var _a, _b, _c, _d;
|
|
5508
5517
|
const allPayloads = [];
|
|
5509
5518
|
const uploadPromises = presignedUrls.map(async (urlDetails, index) => {
|
|
5510
5519
|
let mediaId, mediaUrl, thumbnailUrl, mediaPresignedUrl;
|
|
@@ -5542,7 +5551,7 @@ const ChatFooter = class {
|
|
|
5542
5551
|
});
|
|
5543
5552
|
await Promise.all(uploadPromises);
|
|
5544
5553
|
// One attachment → typed; 2–5 together → Multiple (same message)
|
|
5545
|
-
let customType =
|
|
5554
|
+
let customType = ATTACHMENT_BODY_PLACEHOLDER;
|
|
5546
5555
|
if ((attachments === null || attachments === void 0 ? void 0 : attachments.length) === 1 && ((_a = attachments[0]) === null || _a === void 0 ? void 0 : _a.mimeType)) {
|
|
5547
5556
|
if (attachments[0].mimeType.startsWith('image/')) {
|
|
5548
5557
|
customType = 'AttachmentMessage:Image';
|
|
@@ -5557,20 +5566,22 @@ const ChatFooter = class {
|
|
|
5557
5566
|
customType = 'AttachmentMessage:Doc';
|
|
5558
5567
|
}
|
|
5559
5568
|
}
|
|
5569
|
+
const caption = ((_b = this.messageBody) === null || _b === void 0 ? void 0 : _b.trim()) || '';
|
|
5560
5570
|
let payload = {
|
|
5561
5571
|
showInConversation: true,
|
|
5562
5572
|
messageType: this.replyMessage ? 2 : 0,
|
|
5563
|
-
parentMessageId: (
|
|
5573
|
+
parentMessageId: (_c = this.replyMessage) === null || _c === void 0 ? void 0 : _c.messageId,
|
|
5564
5574
|
encrypted: false,
|
|
5565
5575
|
conversationId,
|
|
5566
|
-
body
|
|
5576
|
+
// API rejects empty body; caption text or placeholder. Real caption also in metaData.caption
|
|
5577
|
+
body: attachmentBodyForApi(caption),
|
|
5567
5578
|
customType: customType,
|
|
5568
5579
|
attachments: allPayloads,
|
|
5569
5580
|
deviceId: this.deviceId,
|
|
5570
5581
|
metaData: this.getReplyMetadata(),
|
|
5571
5582
|
};
|
|
5572
5583
|
let payloadForGroupcastMessage = Object.assign(Object.assign({}, payload), { hideNewConversationsForSender: false, groupcastId: this.groupcastId, notifyOnCompletion: true, sendPushForNewConversationCreated: true });
|
|
5573
|
-
if (((
|
|
5584
|
+
if (((_d = this.mentionUserList) === null || _d === void 0 ? void 0 : _d.length) > 0) {
|
|
5574
5585
|
payload['mentionedUsers'] = this.mentionUserList;
|
|
5575
5586
|
}
|
|
5576
5587
|
try {
|
|
@@ -5599,12 +5610,7 @@ const ChatFooter = class {
|
|
|
5599
5610
|
}
|
|
5600
5611
|
}
|
|
5601
5612
|
getReplyMetadata() {
|
|
5602
|
-
|
|
5603
|
-
return Object.assign(Object.assign({ parentMessageId: (_a = this.replyMessage) === null || _a === void 0 ? void 0 : _a.messageId, parentMessage: (_b = this.replyMessage) === null || _b === void 0 ? void 0 : _b.body, parentMessageTime: (_c = this.replyMessage) === null || _c === void 0 ? void 0 : _c.sentAt, parentMessageSenderId: (_e = (_d = this.replyMessage) === null || _d === void 0 ? void 0 : _d.senderInfo) === null || _e === void 0 ? void 0 : _e.userId, parentMessageSenderName: (_g = (_f = this.replyMessage) === null || _f === void 0 ? void 0 : _f.senderInfo) === null || _g === void 0 ? void 0 : _g.userName }, (((_j = (_h = this.replyMessage) === null || _h === void 0 ? void 0 : _h.attachments) === null || _j === void 0 ? void 0 : _j[0]) && {
|
|
5604
|
-
parentMessageName: this.replyMessage.attachments[0].name,
|
|
5605
|
-
parentMessageMediaUrl: this.replyMessage.attachments[0].mediaUrl,
|
|
5606
|
-
parentMessageType: this.replyMessage.attachments[0].mimeType,
|
|
5607
|
-
})), (((_k = this.messageBody) === null || _k === void 0 ? void 0 : _k.trim()) && { captionMessage: this.messageBody.trim() }));
|
|
5613
|
+
return buildReplyMetaData(this.replyMessage, this.messageBody);
|
|
5608
5614
|
}
|
|
5609
5615
|
revokePreviewSrc(src) {
|
|
5610
5616
|
if (src && typeof src === 'string' && src.startsWith('blob:')) {
|
|
@@ -5637,7 +5643,7 @@ const ChatFooter = class {
|
|
|
5637
5643
|
const webChat = findWebChatHost(this.el);
|
|
5638
5644
|
const hasCustomReply = (webChat ? hasNamedSlot(webChat, 'reply-preview') : false) || hasNamedSlot(this.el, 'reply-preview');
|
|
5639
5645
|
const showAttachment = this.attachmentDetails || this.showCamera;
|
|
5640
|
-
return (h(Host, { key: '
|
|
5646
|
+
return (h(Host, { key: '6c328d3d5562019950250196d7e4593eae013505', class: { 'attachment-open': !!showAttachment } }, h("div", { key: 'eec2aa6aa2a8bd5f671df68c5cbef98874bcdf13', class: "chat-footer-container" }, showAttachment ? (h("slot", { name: "attachment-preview" }, h("attachment-preview", { showCamera: this.showCamera, onClose: this.handleClearAttachment, width: "150px", height: "150px", bgColor: "var(--bg-primary-light)", padding: "3px", margin: "10px 0 0 0", contentType: contentType, content: this.mediaPreviews, onSend: this.handleSendMessage, "onfile-uploaded": this.handleFileUpload, "onattachment-removed": this.handleRemoveAttachment, "oncamera-retake": this.handleCameraRetake, key: this.inputKey, inputValue: this.messageBody, "oninput-change": this.handleInputChange, backgroundColor: "var(--bg-primary-color)", containerBoxShadow: "none", inputFontColor: "var(--text-primary-color)", inputBorderRadius: "10px", conversationDetails: this.conversationDetails, userMetaData: this.userMetaData }))) : (h(Fragment, null, hasCustomReply ? h("slot", { name: "reply-preview" }) : null, h("slot", { name: "composer-input" }, !hasCustomReply && this.replyMessage ? (h("reply-block", { messageBody: (_a = this.replyMessage) === null || _a === void 0 ? void 0 : _a.body, messageInfo: this.replyMessage, senderName: ((_b = this.userMetaData) === null || _b === void 0 ? void 0 : _b.userId) === ((_d = (_c = this.replyMessage) === null || _c === void 0 ? void 0 : _c.senderInfo) === null || _d === void 0 ? void 0 : _d.userId)
|
|
5641
5647
|
? 'You'
|
|
5642
5648
|
: (_f = (_e = this.replyMessage) === null || _e === void 0 ? void 0 : _e.senderInfo) === null || _f === void 0 ? void 0 : _f.userName, onIconClick: this.handleremoveReplyMessage })) : null, h("div", { class: "composer-wrap", key: this.inputKey, ref: el => (this.composerWrapRef = el) }, this.showEmojiPicker ? (h("div", { class: "emoji-panel", style: this.emojiPanelStyle }, h("div", { class: "emoji-panel-header" }, h("span", null, "Emoji"), h("button", { class: "emoji-panel-close", type: "button", "aria-label": "Close", onClick: this.handleEmojiToggle }, "\u00D7")), h("emoji-picker", { class: "emoji-picker light", ref: this.bindEmojiPicker }))) : null, h("div", { class: { composer: true, recording: this.isRecording } }, this.isRecording ? (h("div", { class: "rec-body" }, h("div", { class: "rec-left" }, h("button", { class: "rec-icon-btn danger", type: "button", title: "Delete recording", "aria-label": "Delete recording", onClick: this.handleRecDelete }, h("img", { class: "theme-icon", src: Delete, alt: "" })), h("div", { class: "rec-timer-wrap" }, h("span", { class: { 'rec-dot': true, live: !this.isPaused } }), h("span", { class: "rec-timer" }, this.formatRecTime(this.recordingSeconds)))), h("div", { class: "rec-wave" }, h("audio-bubble", { liveRecord: true, audioProgressColor: "#2563eb", audioWaveColor: "#2563eb", ref: el => (this.recBubble = el), onRecordingProgress: this.onRecordingProgress, onRecordingError: this.onRecordingError })), h("button", { class: { 'rec-icon-btn': true, 'rec-toggle': true, pause: !this.isPaused }, type: "button", title: this.isPaused ? 'Resume recording' : 'Pause recording', "aria-label": this.isPaused ? 'Resume recording' : 'Pause recording', onClick: this.handleRecPauseToggle }, h("img", { class: "theme-icon", src: this.isPaused ? PlayIcon : PauseIcon, alt: "" })), h("button", { class: "rec-send", type: "button", title: "Send voice note", "aria-label": "Send voice note", onClick: this.handleRecSend }, h("img", { src: Send, alt: "" })))) : (h(Fragment, null, h("div", { class: "attach-wrap" }, h("button", { class: "icon-btn", type: "button", title: "Attach file", "aria-label": "Attach", onClick: this.handleAttachClick }, h("img", { src: Attachment, alt: "" })), this.showAttachMenu ? (h("div", { class: "attach-menu", style: this.attachMenuStyle }, h("button", { class: "attach-opt", type: "button", onClick: this.pickDocument }, h("span", { class: "attach-opt-icon attach-opt-icon--doc" }, h("img", { src: DocumentsIcon, alt: "" })), h("span", null, "Document")), h("button", { class: "attach-opt", type: "button", onClick: this.pickPhotos }, h("span", { class: "attach-opt-icon attach-opt-icon--photos" }, h("img", { class: "theme-icon", src: PhotosIcon, alt: "" })), h("span", null, "Photos & videos")), h("button", { class: "attach-opt", type: "button", onClick: this.pickCamera }, h("span", { class: "attach-opt-icon attach-opt-icon--camera" }, h("img", { class: "theme-icon", src: CameraIcon, alt: "" })), h("span", null, "Camera")))) : null), h("button", { class: "icon-btn", type: "button", title: "Emojis", "aria-label": "Emojis", onClick: this.handleEmojiToggle }, h("img", { src: Smile, alt: "" })), h("input", { class: "file-input", type: "file", multiple: true, accept: ".jpg,.jpeg,.png,.gif,.webp,.bmp,.heic,.mp4,.mov,.webm,.mkv,.mp3,.wav,.m4a,.aac,.ogg", ref: el => (this.mediaInputRef = el), onChange: this.handleNativeFileChange }), h("input", { class: "file-input", type: "file", multiple: true, accept: ".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.rtf,application/*", ref: el => (this.docInputRef = el), onChange: this.handleNativeFileChange }), h("textarea", { class: "composer-input", rows: 1, placeholder: "Type a message", value: this.messageBody, ref: el => (this.inputRef = el), onInput: this.handleComposerInput, onKeyDown: this.handleComposerKeyDown }), this.messageBody.trim() ? (h("button", { class: "icon-btn", type: "button", title: "Send", "aria-label": "Send", onClick: this.handleSendMessage }, h("img", { src: Send, alt: "" }))) : (h("button", { class: "icon-btn", type: "button", title: "Voice note", "aria-label": "Voice note", onClick: this.handleMicClick }, h("img", { src: Microphone, alt: "" })))))))))))));
|
|
5643
5649
|
}
|
|
@@ -6740,6 +6746,7 @@ const MessageInfo = class {
|
|
|
6740
6746
|
this.closePopup();
|
|
6741
6747
|
}
|
|
6742
6748
|
previewText() {
|
|
6749
|
+
var _a, _b, _c, _d;
|
|
6743
6750
|
if (this.messagePreviewText)
|
|
6744
6751
|
return this.messagePreviewText;
|
|
6745
6752
|
const msg = this.selectedMessage;
|
|
@@ -6751,8 +6758,11 @@ const MessageInfo = class {
|
|
|
6751
6758
|
if (names.length > 1)
|
|
6752
6759
|
return `${names[0]} +${names.length - 1}`;
|
|
6753
6760
|
}
|
|
6761
|
+
const caption = String((_d = (_b = (_a = msg === null || msg === void 0 ? void 0 : msg.metaData) === null || _a === void 0 ? void 0 : _a.caption) !== null && _b !== void 0 ? _b : (_c = msg === null || msg === void 0 ? void 0 : msg.metaData) === null || _c === void 0 ? void 0 : _c.captionMessage) !== null && _d !== void 0 ? _d : '').trim();
|
|
6762
|
+
if (caption)
|
|
6763
|
+
return caption;
|
|
6754
6764
|
const body = (msg === null || msg === void 0 ? void 0 : msg.body) || '';
|
|
6755
|
-
// API stores
|
|
6765
|
+
// API stores placeholder in body for media; never show AttachmentMessage:* as caption
|
|
6756
6766
|
if (String(body).startsWith('AttachmentMessage:'))
|
|
6757
6767
|
return (atts === null || atts === void 0 ? void 0 : atts.length) ? 'Attachment' : '';
|
|
6758
6768
|
return body || '';
|
|
@@ -6778,7 +6788,7 @@ const MessageInfo = class {
|
|
|
6778
6788
|
render() {
|
|
6779
6789
|
const delivery = this.deliveryUserList || [];
|
|
6780
6790
|
const read = this.readUserList || [];
|
|
6781
|
-
return (h("div", { key: '
|
|
6791
|
+
return (h("div", { key: '15534a0fe80ad1217c5c2a019a4813e1608f37c8', class: "panel" }, h("div", { key: '8f08235eaebfbdba93e55057757df87fa89706d0', class: "header" }, h("button", { key: '91103e164515d053ab65b065ad9dc8db1cf5b039', class: "close-btn", type: "button", "aria-label": "Close", title: "Close", onClick: () => this.close() }, h("img", { key: '98012318009e835dc4222119006683dd14a81e48', class: "theme-icon", src: CancelIcon, alt: "" })), h("h2", { key: '1b3a94852dbddeef83f77a2dce3466f5920410f6' }, "Message info")), h("div", { key: '7e3c519f90230ecddeeb0924a7339d74db2f28e1', class: "body" }, h("div", { key: '42564e2ce9b2ff3a92c2d31f3b5bc0d335d41202', class: "preview-wrap" }, h("div", { key: '7b214c585a3f0dc755b0ff81784c0d23a6f56aae', class: "preview-bubble" }, h("p", { key: 'd9bf371af35246bb670f31b7b5152bc82ec62dd3', class: "preview-text" }, this.previewText()), h("div", { key: 'a3dcec58517c5a3c723ea344b841d7691db58ee5', class: "preview-meta" }, h("span", { key: '339ed86bbfa72631ffe524c0efc79e866b6cece0' }, this.bubbleTime())))), h("div", { key: 'ed5ed44d437196b2fcc40a93403b4c22b83b919e', class: "status-list" }, h("div", { key: '99be39d6f81967144b6ccb5447079cc482462537', class: "status-row" }, this.ticksIcon('read'), h("div", { key: '674639bcded02dfb98e01f15605168e4a589fe69', class: "status-content" }, h("div", { key: 'fae1044cea5ae180717e618e04e80fb7c3b6f566', class: "status-title" }, "Read"), h("p", { key: 'b9c30d7a41667bfa2e53d32b121c3f3c7bf932b6', class: "status-time" }, this.formatTime(this.messageReadTime)), read.map(u => (h("div", { class: "user-row" }, h("profile-avatar", { src: u.userProfileImageUrl || '', name: u.userName || '', size: "2rem" }), h("span", { class: "user-name" }, u.userName)))))), h("div", { key: 'faad423c5a626523aa8118d5bd5ff801390a22b5', class: "status-row" }, this.ticksIcon('delivered'), h("div", { key: '20cfad1d4981ece333bd294045f61d14ef25cdd7', class: "status-content" }, h("div", { key: '8b258a21f5697e2318f66efcebbf984573091b47', class: "status-title" }, "Delivered"), h("p", { key: '666b4c16bc9432d38dbb01369ecf6d23cef381ba', class: "status-time" }, this.formatTime(this.messageDeliveryTime)), delivery.map(u => (h("div", { class: "user-row" }, h("profile-avatar", { src: u.userProfileImageUrl || '', name: u.userName || '', size: "2rem" }), h("span", { class: "user-name" }, u.userName))))))))));
|
|
6782
6792
|
}
|
|
6783
6793
|
};
|
|
6784
6794
|
MessageInfo.style = ":host {\n display: block;\n height: var(--h-full);\n width: var(--w-full);\n font-family: var(--font-primary);\n color: var(--text-primary);\n }\n .panel {\n display: flex;\n flex-direction: column;\n height: var(--h-full);\n background: var(--bg-primary);\n }\n .header {\n height: var(--rail-width);\n padding: 0 var(--space-16);\n background: var(--bg-primary);\n border-bottom: 1px solid var(--border);\n display: flex;\n align-items: center;\n gap: var(--gap-16);\n flex-shrink: 0;\n box-sizing: border-box;\n }\n .header h2 {\n margin: 0;\n font-size: var(--text-16);\n font-weight: var(--fw-600);\n color: var(--text-primary);\n }\n .close-btn {\n border: none;\n background: transparent;\n cursor: pointer;\n width: var(--icon-lg);\n height: var(--icon-lg);\n border-radius: var(--rounded-full);\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--icon);\n padding: 0;\n }\n .close-btn:hover {\n background: var(--hover-overlay);\n color: var(--text-primary);\n }\n .close-btn img {\n width: var(--icon-sm);\n height: var(--icon-sm);\n display: block;\n }\n .body {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n background: var(--bg-tertiary);\n display: flex;\n flex-direction: column;\n }\n .preview-wrap {\n padding: var(--space-16);\n background: var(--bg-secondary);\n border-bottom: 1px solid var(--border);\n display: flex;\n justify-content: flex-end;\n box-sizing: border-box;\n }\n .preview-bubble {\n background: var(--brand);\n color: var(--text-on-brand);\n border-radius: var(--rounded-12) var(--rounded-12) var(--rounded-2) var(--rounded-12);\n padding: var(--gap-10) var(--space-16);\n max-width: 20rem;\n box-shadow: 0 1px 2px var(--overlay);\n box-sizing: border-box;\n }\n .preview-text {\n margin: 0;\n font-size: var(--text-14);\n line-height: 1.5;\n word-break: break-word;\n white-space: pre-wrap;\n }\n .preview-meta {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n margin-top: var(--gap-4);\n font-size: var(--text-10);\n color: var(--text-on-brand);\n opacity: 0.85;\n }\n .status-list {\n background: var(--bg-primary);\n box-shadow: 0 1px 2px var(--overlay);\n }\n .status-row {\n display: flex;\n align-items: flex-start;\n gap: var(--space-16);\n padding: var(--space-16);\n border-bottom: 1px solid var(--border-subtle);\n box-sizing: border-box;\n }\n .status-row:last-child {\n border-bottom: none;\n }\n .status-row:hover {\n background: var(--hover-overlay);\n }\n .status-icon {\n flex-shrink: 0;\n margin-top: var(--gap-2);\n width: var(--icon-md);\n height: var(--icon-md);\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--text-tertiary);\n -webkit-mask: var(--tick-mask) center / contain no-repeat;\n mask: var(--tick-mask) center / contain no-repeat;\n }\n .status-icon.read {\n background-color: var(--brand);\n }\n .status-icon.delivered {\n background-color: var(--text-tertiary);\n }\n .status-content {\n flex: 1;\n min-width: 0;\n }\n .status-title {\n font-size: var(--text-14);\n font-weight: var(--fw-600);\n color: var(--text-primary);\n }\n .status-time {\n margin: var(--gap-2) 0 0;\n font-size: var(--text-12);\n color: var(--text-tertiary);\n }\n .user-row {\n display: flex;\n align-items: center;\n gap: var(--space-8);\n margin-top: var(--space-8);\n }\n .user-name {\n font-size: var(--text-14);\n color: var(--text-primary);\n }\n .theme-icon { filter: var(--svg-icon-filter); }";
|
|
@@ -7300,6 +7310,8 @@ const WebChatBody = class {
|
|
|
7300
7310
|
};
|
|
7301
7311
|
this.renderAttachmentMessage = (message, isSelf) => {
|
|
7302
7312
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
7313
|
+
// Caption from metaData.caption (Flutter/Swift); never show AttachmentMessage:* body placeholders
|
|
7314
|
+
const caption = attachmentCaption(message);
|
|
7303
7315
|
// Common props for all message types
|
|
7304
7316
|
const commonOutgoingProps = {
|
|
7305
7317
|
time: message === null || message === void 0 ? void 0 : message.sentAt,
|
|
@@ -7309,7 +7321,7 @@ const WebChatBody = class {
|
|
|
7309
7321
|
deliveryStatus: (message === null || message === void 0 ? void 0 : message.deliveryStatus) || '',
|
|
7310
7322
|
textColor: 'var(--text-outgoing-message)',
|
|
7311
7323
|
timeColor: 'var(--text-outgoing-time)',
|
|
7312
|
-
message:
|
|
7324
|
+
message: caption,
|
|
7313
7325
|
mentionedUsers: message === null || message === void 0 ? void 0 : message.mentionedUsers,
|
|
7314
7326
|
bgColor: 'var(--bg-outgoing-message)',
|
|
7315
7327
|
borderRadius: '6px 6px 0 6px',
|
|
@@ -7320,7 +7332,7 @@ const WebChatBody = class {
|
|
|
7320
7332
|
isSelf: isSelf,
|
|
7321
7333
|
textColor: 'var(--text-incoming-message)',
|
|
7322
7334
|
timeColor: 'var(--text-incoming-time)',
|
|
7323
|
-
message:
|
|
7335
|
+
message: caption,
|
|
7324
7336
|
mentionedUsers: message === null || message === void 0 ? void 0 : message.mentionedUsers,
|
|
7325
7337
|
bgColor: 'var(--bg-incoming-message)',
|
|
7326
7338
|
borderRadius: '6px 6px 6px 0',
|
|
@@ -7744,7 +7756,7 @@ const WebChatBody = class {
|
|
|
7744
7756
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
7745
7757
|
const currentConversation = (_a = this.conversationList) === null || _a === void 0 ? void 0 : _a.find(conversation => (conversation === null || conversation === void 0 ? void 0 : conversation.conversationId) === this.selectedConversationId);
|
|
7746
7758
|
const shouldShowPlaceholder = ((_b = this.allMessages) === null || _b === void 0 ? void 0 : _b.length) === 1 && ((_d = (_c = this.allMessages) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.action) !== 'clearConversation' && ((_e = this.allMessages) === null || _e === void 0 ? void 0 : _e.some(message => (message === null || message === void 0 ? void 0 : message.action) === 'clearConversation'));
|
|
7747
|
-
return (h("div", { key: '
|
|
7759
|
+
return (h("div", { key: 'fcb897b1540131642caba826fe6551d06a7ac9c9', class: `chat-body ${this.isChatBodyUnscrollable ? 'unscrollable' : null}` }, this.showScrollButton || this.newMessageNotification && (h("div", { key: '1232ce848507a42e5dbd73708f57b10966511f6c', onClick: this.scrollToBottom, style: {
|
|
7748
7760
|
position: 'sticky',
|
|
7749
7761
|
top: '90%',
|
|
7750
7762
|
left: '95%',
|
|
@@ -7758,7 +7770,7 @@ const WebChatBody = class {
|
|
|
7758
7770
|
cursor: 'pointer',
|
|
7759
7771
|
boxShadow: '0 2px 5px rgba(0,0,0,0.2)',
|
|
7760
7772
|
zIndex: '100',
|
|
7761
|
-
} }, ((_f = this.newMessageNotification) === null || _f === void 0 ? void 0 : _f.count) > 0 && (h("div", { key: '
|
|
7773
|
+
} }, ((_f = this.newMessageNotification) === null || _f === void 0 ? void 0 : _f.count) > 0 && (h("div", { key: 'f37caffdf257d82abefde7490978fc107d8befb5', style: {
|
|
7762
7774
|
position: 'absolute',
|
|
7763
7775
|
bottom: '22px',
|
|
7764
7776
|
right: '-2px',
|
|
@@ -7772,7 +7784,7 @@ const WebChatBody = class {
|
|
|
7772
7784
|
justifyContent: 'center',
|
|
7773
7785
|
fontSize: '12px',
|
|
7774
7786
|
padding: '0 4px',
|
|
7775
|
-
} })), h("svg", { key: '
|
|
7787
|
+
} })), h("svg", { key: '07567e171c2f415dab0e3c87b1e42cb9ae994c9d', width: "20px", height: "30px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '919b12ffce28266d6f7a1de58876488f2b4cec59', d: "M12 5V19M12 19L19 12M12 19L5 12", stroke: "var(--text-primary-color)", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })))), shouldShowPlaceholder && (h("div", { key: 'dd06f9a496736731adf73db4eb68ed9bffdaf7a4', style: {
|
|
7776
7788
|
display: 'flex',
|
|
7777
7789
|
flexDirection: 'column',
|
|
7778
7790
|
alignItems: 'center',
|
|
@@ -7782,7 +7794,7 @@ const WebChatBody = class {
|
|
|
7782
7794
|
textAlign: 'center',
|
|
7783
7795
|
color: 'var(--text-secondary-color)',
|
|
7784
7796
|
marginTop: '20px',
|
|
7785
|
-
} }, h("img", { key: '
|
|
7797
|
+
} }, h("img", { key: '7a3a75d2fd64671ce5384180794169356d524d07', src: NoMessagePlaceholder, alt: "No messages", style: { width: '200px', height: '200px' } }), h("div", { key: '3cc5745e16a98a047c4633e4fc5c5b0bfcfc1b5c', style: { display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '10px' } }, h("span", { key: 'febc50bf7352f62d97443f8518611a662712b9c3', style: { fontSize: '24px', color: 'var(--text-primary-color)' } }, "No messages"), h("span", { key: '80e42faea0eb8ea092b8499ba3d9833033de45e5', style: { fontSize: '16px', color: 'var(--text-secondary-color)' } }, "Send a \"Hi\" and make someone's day brighter!")))), this.isMessagesLoading && (h("spinner-loader", { key: '31c0a6c01075d2cc291a8f26cb59cacdf4c05f7d', height: "20px", width: "20px", spinTime: "1s", spinnerPrimaryColor: "#000", spinnerSecondaryColor: "var(--bg-grey-color)", spinnerBorderWidth: "3px" })), ((_g = this.allMessages) === null || _g === void 0 ? void 0 : _g.length) > 0 &&
|
|
7786
7798
|
((_h = this.userMetaData) === null || _h === void 0 ? void 0 : _h.userId) &&
|
|
7787
7799
|
(() => {
|
|
7788
7800
|
const total = this.allMessages.length;
|