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
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const runtimeControls = require('./runtime-controls-
|
|
4
|
-
const
|
|
3
|
+
const runtimeControls = require('./runtime-controls-b5a3836e.js');
|
|
4
|
+
const groupcast = require('./groupcast-5e3d49c4.js');
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Expose public SDK helpers on window for www demos / script-tag hosts.
|
|
@@ -20,7 +20,7 @@ function appGlobalScript () {
|
|
|
20
20
|
w.destroyChat = runtimeControls.destroyIsometrikWebchat;
|
|
21
21
|
w.isometrikWebchatApi = runtimeControls.isometrikWebchatApi;
|
|
22
22
|
w.createWebChatApi = runtimeControls.createWebChatApi;
|
|
23
|
-
w.THEME_TOKEN_NAMES =
|
|
23
|
+
w.THEME_TOKEN_NAMES = groupcast.THEME_TOKEN_NAMES;
|
|
24
24
|
w.mountReactInSlot = runtimeControls.mountReactInSlot;
|
|
25
25
|
w.defineReactCustomPart = runtimeControls.defineReactCustomPart;
|
|
26
26
|
w.unmountReactSlot = runtimeControls.unmountReactSlot;
|
|
@@ -35,4 +35,4 @@ const globalScripts = appGlobalScript;
|
|
|
35
35
|
|
|
36
36
|
exports.globalScripts = globalScripts;
|
|
37
37
|
|
|
38
|
-
//# sourceMappingURL=app-globals-
|
|
38
|
+
//# sourceMappingURL=app-globals-dba84d07.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"app-globals-
|
|
1
|
+
{"file":"app-globals-dba84d07.js","mappings":";;;;;AAAA;;;;;IAwBE,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO;IAC1C,MAAM,CAAC,GAAG,MAAa,CAAC;IACxB,CAAC,CAAC,0BAA0B,GAAGA,0CAA0B,CAAC;IAC1D,CAAC,CAAC,uBAAuB,GAAGC,uCAAuB,CAAC;IACpD,CAAC,CAAC,sBAAsB,GAAGC,sCAAsB,CAAC;IAClD,CAAC,CAAC,sBAAsB,GAAGC,sCAAsB,CAAC;IAClD,CAAC,CAAC,uBAAuB,GAAGC,uCAAuB,CAAC;IACpD,CAAC,CAAC,cAAc,GAAGJ,0CAA0B,CAAC;IAC9C,CAAC,CAAC,WAAW,GAAGC,uCAAuB,CAAC;IACxC,CAAC,CAAC,mBAAmB,GAAGI,mCAAmB,CAAC;IAC5C,CAAC,CAAC,gBAAgB,GAAGC,gCAAgB,CAAC;IACtC,CAAC,CAAC,iBAAiB,GAAGC,2BAAiB,CAAC;IACxC,CAAC,CAAC,gBAAgB,GAAGC,gCAAgB,CAAC;IACtC,CAAC,CAAC,qBAAqB,GAAGC,qCAAqB,CAAC;IAChD,CAAC,CAAC,gBAAgB,GAAGC,gCAAgB,CAAC;IACtC,CAAC,CAAC,eAAe,GAAGC,+BAAe,CAAC;IACpC,CAAC,CAAC,gBAAgB,GAAGC,gCAAgB,CAAC;IACtC,CAAC,CAAC,WAAW,GAAGC,2BAAW,CAAC;IAC5B,CAAC,CAAC,oBAAoB,GAAGC,oCAAoB,CAAC;IAC9C,CAAC,CAAC,cAAc,GAAGC,8BAAc,CAAC;AACpC;;AC3CY,MAAC,aAAa,GAAG;;;;","names":["initializeIsometrikWebchat","destroyIsometrikWebchat","ensureIsometrikWebchat","retainIsometrikWebchat","releaseIsometrikWebchat","isometrikWebchatApi","createWebChatApi","THEME_TOKEN_NAMES","mountReactInSlot","defineReactCustomPart","unmountReactSlot","switchChatTheme","applyCustomTheme","toggleTheme","resolveThemeProvider","resolveWebChat"],"sources":["src/global/expose-sdk.ts","@stencil/core/internal/app-globals"],"sourcesContent":["/**\n * Expose public SDK helpers on window for www demos / script-tag hosts.\n * Bundlers should prefer named ESM imports from the package entry.\n */\nimport {\n initializeIsometrikWebchat,\n destroyIsometrikWebchat,\n ensureIsometrikWebchat,\n retainIsometrikWebchat,\n releaseIsometrikWebchat,\n mountReactInSlot,\n defineReactCustomPart,\n unmountReactSlot,\n createWebChatApi,\n isometrikWebchatApi,\n THEME_TOKEN_NAMES,\n switchChatTheme,\n applyCustomTheme,\n toggleTheme,\n resolveThemeProvider,\n resolveWebChat,\n} from '../sdk';\n\nexport default function () {\n if (typeof window === 'undefined') return;\n const w = window as any;\n w.initializeIsometrikWebchat = initializeIsometrikWebchat;\n w.destroyIsometrikWebchat = destroyIsometrikWebchat;\n w.ensureIsometrikWebchat = ensureIsometrikWebchat;\n w.retainIsometrikWebchat = retainIsometrikWebchat;\n w.releaseIsometrikWebchat = releaseIsometrikWebchat;\n w.initializeChat = initializeIsometrikWebchat;\n w.destroyChat = destroyIsometrikWebchat;\n w.isometrikWebchatApi = isometrikWebchatApi;\n w.createWebChatApi = createWebChatApi;\n w.THEME_TOKEN_NAMES = THEME_TOKEN_NAMES;\n w.mountReactInSlot = mountReactInSlot;\n w.defineReactCustomPart = defineReactCustomPart;\n w.unmountReactSlot = unmountReactSlot;\n w.switchChatTheme = switchChatTheme;\n w.applyCustomTheme = applyCustomTheme;\n w.toggleTheme = toggleTheme;\n w.resolveThemeProvider = resolveThemeProvider;\n w.resolveWebChat = resolveWebChat;\n}\n","import appGlobalScript from '/Users/3embed/Desktop/isometrik-webchat/src/global/expose-sdk.ts';\nexport const globalScripts = appGlobalScript;\n"],"version":3}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-f624fc47.js');
|
|
6
6
|
const chatAssets = require('./chat-assets-686620e7.js');
|
|
7
7
|
const cancel = require('./cancel-1ffd86d3.js');
|
|
8
|
-
const
|
|
8
|
+
const sendMedia = require('./send-media-2c02bba7.js');
|
|
9
9
|
const doublecheck = require('./doublecheck-c2461adc.js');
|
|
10
10
|
const index_m = require('./index.m-ff115b26.js');
|
|
11
11
|
const drawer = require('./drawer-811d2ce8.js');
|
|
@@ -582,30 +582,38 @@ const ChatSidebar = class {
|
|
|
582
582
|
return (last === null || last === void 0 ? void 0 : last.name) || (last === null || last === void 0 ? void 0 : last.nameWithExtension) || 'Document';
|
|
583
583
|
}
|
|
584
584
|
getMessageBody(tile, userMetaData) {
|
|
585
|
-
var _a;
|
|
585
|
+
var _a, _b, _c;
|
|
586
586
|
const details = tile === null || tile === void 0 ? void 0 : tile.lastMessageDetails;
|
|
587
587
|
if (!(details === null || details === void 0 ? void 0 : details.body))
|
|
588
588
|
return '';
|
|
589
|
-
const { senderId, senderName, body, attachments } = details;
|
|
589
|
+
const { senderId, senderName, body, attachments, metaData } = details;
|
|
590
590
|
const sender = senderId === (userMetaData === null || userMetaData === void 0 ? void 0 : userMetaData.userId) ? 'You' : senderName || '';
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
else if (mimeType === null || mimeType === void 0 ? void 0 : mimeType.includes('image'))
|
|
591
|
+
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();
|
|
592
|
+
let messageContent = caption || body;
|
|
593
|
+
// Body placeholder (API non-empty) — never show AttachmentMessage:* as preview text
|
|
594
|
+
if (!caption && String(body || '').startsWith('AttachmentMessage:')) {
|
|
595
|
+
if (body === 'AttachmentMessage:Image')
|
|
597
596
|
messageContent = 'Image';
|
|
598
|
-
else if (
|
|
599
|
-
messageContent = '
|
|
600
|
-
else
|
|
597
|
+
else if (body === 'AttachmentMessage:Video')
|
|
598
|
+
messageContent = 'Video';
|
|
599
|
+
else if (body === 'AttachmentMessage:File' || body === 'AttachmentMessage:Audio' || body === 'AttachmentMessage:Doc') {
|
|
601
600
|
messageContent = 'Document';
|
|
601
|
+
}
|
|
602
|
+
else if (attachments === null || attachments === void 0 ? void 0 : attachments.length) {
|
|
603
|
+
const mimeType = ((_c = attachments[attachments.length - 1]) === null || _c === void 0 ? void 0 : _c.mimeType) || '';
|
|
604
|
+
if (mimeType.includes('video'))
|
|
605
|
+
messageContent = 'Video';
|
|
606
|
+
else if (mimeType.includes('image'))
|
|
607
|
+
messageContent = 'Image';
|
|
608
|
+
else if (mimeType.includes('audio'))
|
|
609
|
+
messageContent = 'Audio';
|
|
610
|
+
else
|
|
611
|
+
messageContent = 'Document';
|
|
612
|
+
}
|
|
613
|
+
else {
|
|
614
|
+
messageContent = 'Attachment';
|
|
615
|
+
}
|
|
602
616
|
}
|
|
603
|
-
else if (body === 'AttachmentMessage:Image')
|
|
604
|
-
messageContent = 'Image';
|
|
605
|
-
else if (body === 'AttachmentMessage:Video')
|
|
606
|
-
messageContent = 'Video';
|
|
607
|
-
else if (body === 'AttachmentMessage:File' || body === 'AttachmentMessage:Audio')
|
|
608
|
-
messageContent = 'Document';
|
|
609
617
|
return (tile === null || tile === void 0 ? void 0 : tile.isGroup) ? `${sender}: ${messageContent}` : messageContent;
|
|
610
618
|
}
|
|
611
619
|
getLastMessageText(tile, userMetaData) {
|
|
@@ -4566,7 +4574,7 @@ const AttachmentPreview = class {
|
|
|
4566
4574
|
const files = Array.from(input.files || []);
|
|
4567
4575
|
if (!files.length)
|
|
4568
4576
|
return;
|
|
4569
|
-
const room = Math.max(0,
|
|
4577
|
+
const room = Math.max(0, sendMedia.MAX_MEDIA_PER_MESSAGE - this.items().length);
|
|
4570
4578
|
const accepted = files.slice(0, room);
|
|
4571
4579
|
if (!accepted.length) {
|
|
4572
4580
|
input.value = '';
|
|
@@ -4577,7 +4585,7 @@ const AttachmentPreview = class {
|
|
|
4577
4585
|
fileTypes: accepted.map(f => f.type.split('/')[0]),
|
|
4578
4586
|
totalFiles: accepted.length,
|
|
4579
4587
|
rejected: Math.max(0, files.length - accepted.length),
|
|
4580
|
-
maxPerMessage:
|
|
4588
|
+
maxPerMessage: sendMedia.MAX_MEDIA_PER_MESSAGE,
|
|
4581
4589
|
});
|
|
4582
4590
|
input.value = '';
|
|
4583
4591
|
};
|
|
@@ -4770,7 +4778,7 @@ const AttachmentPreview = class {
|
|
|
4770
4778
|
e.stopPropagation();
|
|
4771
4779
|
this.attachmentRemoved.emit(i);
|
|
4772
4780
|
} }, "\u00D7")));
|
|
4773
|
-
}), list.length <
|
|
4781
|
+
}), list.length < sendMedia.MAX_MEDIA_PER_MESSAGE ? (index.h("button", { class: "thumb add-thumb", type: "button", title: `Add (max ${sendMedia.MAX_MEDIA_PER_MESSAGE})`, "aria-label": "Add", onClick: this.openAddFiles }, "+")) : null, index.h("input", { class: "add-input", type: "file", multiple: true, accept: ".jpg,.jpeg,.png,.gif,.webp,.bmp,.heic,.mp4,.mov,.webm,.mkv,.mp3,.wav,.m4a,.aac,.ogg,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.rtf", ref: el => (this.addInputRef = el), onChange: this.onAddFiles }))), index.h("p", { class: "limit-hint" }, list.length, "/", sendMedia.MAX_MEDIA_PER_MESSAGE, " files \u00B7 send together as one message"))) : null));
|
|
4774
4782
|
}
|
|
4775
4783
|
get el() { return index.getElement(this); }
|
|
4776
4784
|
static get watchers() { return {
|
|
@@ -4884,10 +4892,10 @@ const ChatFooter = class {
|
|
|
4884
4892
|
return;
|
|
4885
4893
|
this.showCamera = false;
|
|
4886
4894
|
const existing = Array.isArray(this.attachmentDetails) ? this.attachmentDetails : [];
|
|
4887
|
-
const { accepted, rejected } =
|
|
4895
|
+
const { accepted, rejected } = sendMedia.takeMediaFiles(incoming, existing.length);
|
|
4888
4896
|
if (rejected > 0 || !accepted.length) {
|
|
4889
4897
|
toast.showToast({
|
|
4890
|
-
message:
|
|
4898
|
+
message: sendMedia.mediaLimitToastMessage(rejected || incoming.length, sendMedia.MAX_MEDIA_PER_MESSAGE),
|
|
4891
4899
|
type: 'warning',
|
|
4892
4900
|
position: 'bottom-right',
|
|
4893
4901
|
});
|
|
@@ -5431,10 +5439,10 @@ const ChatFooter = class {
|
|
|
5431
5439
|
}
|
|
5432
5440
|
}
|
|
5433
5441
|
async sendMediaMessage(conversationId) {
|
|
5434
|
-
var _a;
|
|
5442
|
+
var _a, _b;
|
|
5435
5443
|
this.changeMessageSendingState(true);
|
|
5436
5444
|
let messageId = Date.now().toString() + Math.random() * 100;
|
|
5437
|
-
const files =
|
|
5445
|
+
const files = sendMedia.takeMediaFiles(this.attachmentDetails || [], 0).accepted;
|
|
5438
5446
|
if (!files.length) {
|
|
5439
5447
|
this.changeMessageSendingState(false);
|
|
5440
5448
|
return;
|
|
@@ -5449,7 +5457,7 @@ const ChatFooter = class {
|
|
|
5449
5457
|
}));
|
|
5450
5458
|
const localAttachments = this.mediaPreviews
|
|
5451
5459
|
.filter(p => files.includes(p.file))
|
|
5452
|
-
.slice(0,
|
|
5460
|
+
.slice(0, sendMedia.MAX_MEDIA_PER_MESSAGE)
|
|
5453
5461
|
.map(preview => ({
|
|
5454
5462
|
name: preview.file.name,
|
|
5455
5463
|
size: preview.file.size,
|
|
@@ -5465,8 +5473,9 @@ const ChatFooter = class {
|
|
|
5465
5473
|
: files[0].type.startsWith('audio/')
|
|
5466
5474
|
? 'AttachmentMessage:Audio'
|
|
5467
5475
|
: 'AttachmentMessage:File'
|
|
5468
|
-
:
|
|
5469
|
-
const
|
|
5476
|
+
: sendMedia.ATTACHMENT_BODY_PLACEHOLDER;
|
|
5477
|
+
const caption = ((_a = this.messageBody) === null || _a === void 0 ? void 0 : _a.trim()) || '';
|
|
5478
|
+
const localMessage = Object.assign(Object.assign({}, this.createLocalMessage(sendMedia.attachmentBodyForApi(caption), localAttachments, messageId)), { customType, metaData: sendMedia.buildReplyMetaData(this.replyMessage, caption) });
|
|
5470
5479
|
try {
|
|
5471
5480
|
await this.updateConversationListOnMessageSend(localMessage);
|
|
5472
5481
|
}
|
|
@@ -5482,7 +5491,7 @@ const ChatFooter = class {
|
|
|
5482
5491
|
try {
|
|
5483
5492
|
let resForPresignedUrl;
|
|
5484
5493
|
if (this.isGroupcast) {
|
|
5485
|
-
resForPresignedUrl = await groupcast.getPresignedUrlForGroupcastMedia((
|
|
5494
|
+
resForPresignedUrl = await groupcast.getPresignedUrlForGroupcastMedia((_b = this.userMetaData) === null || _b === void 0 ? void 0 : _b.userIdentifier, attachments === null || attachments === void 0 ? void 0 : attachments.mimeType);
|
|
5486
5495
|
}
|
|
5487
5496
|
else {
|
|
5488
5497
|
resForPresignedUrl = await index_m.M.getInstance().message.postMessagesPresignedurls(payload);
|
|
@@ -5508,7 +5517,7 @@ const ChatFooter = class {
|
|
|
5508
5517
|
}
|
|
5509
5518
|
}
|
|
5510
5519
|
async uploadAndSendMedia(presignedUrls, attachments, conversationId, oldMessageId) {
|
|
5511
|
-
var _a, _b, _c;
|
|
5520
|
+
var _a, _b, _c, _d;
|
|
5512
5521
|
const allPayloads = [];
|
|
5513
5522
|
const uploadPromises = presignedUrls.map(async (urlDetails, index) => {
|
|
5514
5523
|
let mediaId, mediaUrl, thumbnailUrl, mediaPresignedUrl;
|
|
@@ -5546,7 +5555,7 @@ const ChatFooter = class {
|
|
|
5546
5555
|
});
|
|
5547
5556
|
await Promise.all(uploadPromises);
|
|
5548
5557
|
// One attachment → typed; 2–5 together → Multiple (same message)
|
|
5549
|
-
let customType =
|
|
5558
|
+
let customType = sendMedia.ATTACHMENT_BODY_PLACEHOLDER;
|
|
5550
5559
|
if ((attachments === null || attachments === void 0 ? void 0 : attachments.length) === 1 && ((_a = attachments[0]) === null || _a === void 0 ? void 0 : _a.mimeType)) {
|
|
5551
5560
|
if (attachments[0].mimeType.startsWith('image/')) {
|
|
5552
5561
|
customType = 'AttachmentMessage:Image';
|
|
@@ -5561,20 +5570,22 @@ const ChatFooter = class {
|
|
|
5561
5570
|
customType = 'AttachmentMessage:Doc';
|
|
5562
5571
|
}
|
|
5563
5572
|
}
|
|
5573
|
+
const caption = ((_b = this.messageBody) === null || _b === void 0 ? void 0 : _b.trim()) || '';
|
|
5564
5574
|
let payload = {
|
|
5565
5575
|
showInConversation: true,
|
|
5566
5576
|
messageType: this.replyMessage ? 2 : 0,
|
|
5567
|
-
parentMessageId: (
|
|
5577
|
+
parentMessageId: (_c = this.replyMessage) === null || _c === void 0 ? void 0 : _c.messageId,
|
|
5568
5578
|
encrypted: false,
|
|
5569
5579
|
conversationId,
|
|
5570
|
-
body
|
|
5580
|
+
// API rejects empty body; caption text or placeholder. Real caption also in metaData.caption
|
|
5581
|
+
body: sendMedia.attachmentBodyForApi(caption),
|
|
5571
5582
|
customType: customType,
|
|
5572
5583
|
attachments: allPayloads,
|
|
5573
5584
|
deviceId: this.deviceId,
|
|
5574
5585
|
metaData: this.getReplyMetadata(),
|
|
5575
5586
|
};
|
|
5576
5587
|
let payloadForGroupcastMessage = Object.assign(Object.assign({}, payload), { hideNewConversationsForSender: false, groupcastId: this.groupcastId, notifyOnCompletion: true, sendPushForNewConversationCreated: true });
|
|
5577
|
-
if (((
|
|
5588
|
+
if (((_d = this.mentionUserList) === null || _d === void 0 ? void 0 : _d.length) > 0) {
|
|
5578
5589
|
payload['mentionedUsers'] = this.mentionUserList;
|
|
5579
5590
|
}
|
|
5580
5591
|
try {
|
|
@@ -5603,12 +5614,7 @@ const ChatFooter = class {
|
|
|
5603
5614
|
}
|
|
5604
5615
|
}
|
|
5605
5616
|
getReplyMetadata() {
|
|
5606
|
-
|
|
5607
|
-
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]) && {
|
|
5608
|
-
parentMessageName: this.replyMessage.attachments[0].name,
|
|
5609
|
-
parentMessageMediaUrl: this.replyMessage.attachments[0].mediaUrl,
|
|
5610
|
-
parentMessageType: this.replyMessage.attachments[0].mimeType,
|
|
5611
|
-
})), (((_k = this.messageBody) === null || _k === void 0 ? void 0 : _k.trim()) && { captionMessage: this.messageBody.trim() }));
|
|
5617
|
+
return sendMedia.buildReplyMetaData(this.replyMessage, this.messageBody);
|
|
5612
5618
|
}
|
|
5613
5619
|
revokePreviewSrc(src) {
|
|
5614
5620
|
if (src && typeof src === 'string' && src.startsWith('blob:')) {
|
|
@@ -5641,7 +5647,7 @@ const ChatFooter = class {
|
|
|
5641
5647
|
const webChat = index$1.findWebChatHost(this.el);
|
|
5642
5648
|
const hasCustomReply = (webChat ? index$1.hasNamedSlot(webChat, 'reply-preview') : false) || index$1.hasNamedSlot(this.el, 'reply-preview');
|
|
5643
5649
|
const showAttachment = this.attachmentDetails || this.showCamera;
|
|
5644
|
-
return (index.h(index.Host, { key: '
|
|
5650
|
+
return (index.h(index.Host, { key: '6c328d3d5562019950250196d7e4593eae013505', class: { 'attachment-open': !!showAttachment } }, index.h("div", { key: 'eec2aa6aa2a8bd5f671df68c5cbef98874bcdf13', class: "chat-footer-container" }, showAttachment ? (index.h("slot", { name: "attachment-preview" }, index.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 }))) : (index.h(index.Fragment, null, hasCustomReply ? index.h("slot", { name: "reply-preview" }) : null, index.h("slot", { name: "composer-input" }, !hasCustomReply && this.replyMessage ? (index.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)
|
|
5645
5651
|
? 'You'
|
|
5646
5652
|
: (_f = (_e = this.replyMessage) === null || _e === void 0 ? void 0 : _e.senderInfo) === null || _f === void 0 ? void 0 : _f.userName, onIconClick: this.handleremoveReplyMessage })) : null, index.h("div", { class: "composer-wrap", key: this.inputKey, ref: el => (this.composerWrapRef = el) }, this.showEmojiPicker ? (index.h("div", { class: "emoji-panel", style: this.emojiPanelStyle }, index.h("div", { class: "emoji-panel-header" }, index.h("span", null, "Emoji"), index.h("button", { class: "emoji-panel-close", type: "button", "aria-label": "Close", onClick: this.handleEmojiToggle }, "\u00D7")), index.h("emoji-picker", { class: "emoji-picker light", ref: this.bindEmojiPicker }))) : null, index.h("div", { class: { composer: true, recording: this.isRecording } }, this.isRecording ? (index.h("div", { class: "rec-body" }, index.h("div", { class: "rec-left" }, index.h("button", { class: "rec-icon-btn danger", type: "button", title: "Delete recording", "aria-label": "Delete recording", onClick: this.handleRecDelete }, index.h("img", { class: "theme-icon", src: chatAssets.Delete, alt: "" })), index.h("div", { class: "rec-timer-wrap" }, index.h("span", { class: { 'rec-dot': true, live: !this.isPaused } }), index.h("span", { class: "rec-timer" }, this.formatRecTime(this.recordingSeconds)))), index.h("div", { class: "rec-wave" }, index.h("audio-bubble", { liveRecord: true, audioProgressColor: "#2563eb", audioWaveColor: "#2563eb", ref: el => (this.recBubble = el), onRecordingProgress: this.onRecordingProgress, onRecordingError: this.onRecordingError })), index.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 }, index.h("img", { class: "theme-icon", src: this.isPaused ? PlayIcon : PauseIcon, alt: "" })), index.h("button", { class: "rec-send", type: "button", title: "Send voice note", "aria-label": "Send voice note", onClick: this.handleRecSend }, index.h("img", { src: chatAssets.Send, alt: "" })))) : (index.h(index.Fragment, null, index.h("div", { class: "attach-wrap" }, index.h("button", { class: "icon-btn", type: "button", title: "Attach file", "aria-label": "Attach", onClick: this.handleAttachClick }, index.h("img", { src: chatAssets.Attachment, alt: "" })), this.showAttachMenu ? (index.h("div", { class: "attach-menu", style: this.attachMenuStyle }, index.h("button", { class: "attach-opt", type: "button", onClick: this.pickDocument }, index.h("span", { class: "attach-opt-icon attach-opt-icon--doc" }, index.h("img", { src: DocumentsIcon, alt: "" })), index.h("span", null, "Document")), index.h("button", { class: "attach-opt", type: "button", onClick: this.pickPhotos }, index.h("span", { class: "attach-opt-icon attach-opt-icon--photos" }, index.h("img", { class: "theme-icon", src: PhotosIcon, alt: "" })), index.h("span", null, "Photos & videos")), index.h("button", { class: "attach-opt", type: "button", onClick: this.pickCamera }, index.h("span", { class: "attach-opt-icon attach-opt-icon--camera" }, index.h("img", { class: "theme-icon", src: CameraIcon, alt: "" })), index.h("span", null, "Camera")))) : null), index.h("button", { class: "icon-btn", type: "button", title: "Emojis", "aria-label": "Emojis", onClick: this.handleEmojiToggle }, index.h("img", { src: chatAssets.Smile, alt: "" })), index.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 }), index.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 }), index.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() ? (index.h("button", { class: "icon-btn", type: "button", title: "Send", "aria-label": "Send", onClick: this.handleSendMessage }, index.h("img", { src: chatAssets.Send, alt: "" }))) : (index.h("button", { class: "icon-btn", type: "button", title: "Voice note", "aria-label": "Voice note", onClick: this.handleMicClick }, index.h("img", { src: chatAssets.Microphone, alt: "" })))))))))))));
|
|
5647
5653
|
}
|
|
@@ -6059,7 +6065,7 @@ const ContactInfo = class {
|
|
|
6059
6065
|
});
|
|
6060
6066
|
};
|
|
6061
6067
|
this.onPreviewError = (att) => {
|
|
6062
|
-
const urls =
|
|
6068
|
+
const urls = sendMedia.mediaPreviewUrls(att);
|
|
6063
6069
|
const key = this.previewKey(att);
|
|
6064
6070
|
const i = this.previewTry[key] || 0;
|
|
6065
6071
|
if (i + 1 >= urls.length)
|
|
@@ -6183,7 +6189,7 @@ const ContactInfo = class {
|
|
|
6183
6189
|
return String((att === null || att === void 0 ? void 0 : att.mediaId) || (att === null || att === void 0 ? void 0 : att.mediaUrl) || (att === null || att === void 0 ? void 0 : att.name) || '');
|
|
6184
6190
|
}
|
|
6185
6191
|
shownSrc(att) {
|
|
6186
|
-
const urls =
|
|
6192
|
+
const urls = sendMedia.mediaPreviewUrls(att);
|
|
6187
6193
|
const i = this.previewTry[this.previewKey(att)] || 0;
|
|
6188
6194
|
return urls[i] || urls[0] || '';
|
|
6189
6195
|
}
|
|
@@ -6195,7 +6201,7 @@ const ContactInfo = class {
|
|
|
6195
6201
|
return mime.startsWith('video/') || Number(att === null || att === void 0 ? void 0 : att.mediaType) === 1;
|
|
6196
6202
|
}
|
|
6197
6203
|
docIcon(doc) {
|
|
6198
|
-
const kind =
|
|
6204
|
+
const kind = sendMedia.docIconKind(doc);
|
|
6199
6205
|
if (kind === 'excel')
|
|
6200
6206
|
return ExcelIcon;
|
|
6201
6207
|
if (kind === 'pdf')
|
|
@@ -6212,7 +6218,7 @@ const ContactInfo = class {
|
|
|
6212
6218
|
return ((_a = body.match(/https?:\/\/\S+/)) === null || _a === void 0 ? void 0 : _a[0]) || body;
|
|
6213
6219
|
}
|
|
6214
6220
|
extractAttachments() {
|
|
6215
|
-
const { media, docs } =
|
|
6221
|
+
const { media, docs } = sendMedia.splitSharedMessages(this.allAttachments);
|
|
6216
6222
|
const byTime = (a, b) => Number(b.date || 0) - Number(a.date || 0);
|
|
6217
6223
|
this.mediaItems = media.sort(byTime);
|
|
6218
6224
|
this.docItems = docs.sort(byTime);
|
|
@@ -6744,6 +6750,7 @@ const MessageInfo = class {
|
|
|
6744
6750
|
this.closePopup();
|
|
6745
6751
|
}
|
|
6746
6752
|
previewText() {
|
|
6753
|
+
var _a, _b, _c, _d;
|
|
6747
6754
|
if (this.messagePreviewText)
|
|
6748
6755
|
return this.messagePreviewText;
|
|
6749
6756
|
const msg = this.selectedMessage;
|
|
@@ -6755,8 +6762,11 @@ const MessageInfo = class {
|
|
|
6755
6762
|
if (names.length > 1)
|
|
6756
6763
|
return `${names[0]} +${names.length - 1}`;
|
|
6757
6764
|
}
|
|
6765
|
+
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();
|
|
6766
|
+
if (caption)
|
|
6767
|
+
return caption;
|
|
6758
6768
|
const body = (msg === null || msg === void 0 ? void 0 : msg.body) || '';
|
|
6759
|
-
// API stores
|
|
6769
|
+
// API stores placeholder in body for media; never show AttachmentMessage:* as caption
|
|
6760
6770
|
if (String(body).startsWith('AttachmentMessage:'))
|
|
6761
6771
|
return (atts === null || atts === void 0 ? void 0 : atts.length) ? 'Attachment' : '';
|
|
6762
6772
|
return body || '';
|
|
@@ -6782,7 +6792,7 @@ const MessageInfo = class {
|
|
|
6782
6792
|
render() {
|
|
6783
6793
|
const delivery = this.deliveryUserList || [];
|
|
6784
6794
|
const read = this.readUserList || [];
|
|
6785
|
-
return (index.h("div", { key: '
|
|
6795
|
+
return (index.h("div", { key: '15534a0fe80ad1217c5c2a019a4813e1608f37c8', class: "panel" }, index.h("div", { key: '8f08235eaebfbdba93e55057757df87fa89706d0', class: "header" }, index.h("button", { key: '91103e164515d053ab65b065ad9dc8db1cf5b039', class: "close-btn", type: "button", "aria-label": "Close", title: "Close", onClick: () => this.close() }, index.h("img", { key: '98012318009e835dc4222119006683dd14a81e48', class: "theme-icon", src: cancel.CancelIcon, alt: "" })), index.h("h2", { key: '1b3a94852dbddeef83f77a2dce3466f5920410f6' }, "Message info")), index.h("div", { key: '7e3c519f90230ecddeeb0924a7339d74db2f28e1', class: "body" }, index.h("div", { key: '42564e2ce9b2ff3a92c2d31f3b5bc0d335d41202', class: "preview-wrap" }, index.h("div", { key: '7b214c585a3f0dc755b0ff81784c0d23a6f56aae', class: "preview-bubble" }, index.h("p", { key: 'd9bf371af35246bb670f31b7b5152bc82ec62dd3', class: "preview-text" }, this.previewText()), index.h("div", { key: 'a3dcec58517c5a3c723ea344b841d7691db58ee5', class: "preview-meta" }, index.h("span", { key: '339ed86bbfa72631ffe524c0efc79e866b6cece0' }, this.bubbleTime())))), index.h("div", { key: 'ed5ed44d437196b2fcc40a93403b4c22b83b919e', class: "status-list" }, index.h("div", { key: '99be39d6f81967144b6ccb5447079cc482462537', class: "status-row" }, this.ticksIcon('read'), index.h("div", { key: '674639bcded02dfb98e01f15605168e4a589fe69', class: "status-content" }, index.h("div", { key: 'fae1044cea5ae180717e618e04e80fb7c3b6f566', class: "status-title" }, "Read"), index.h("p", { key: 'b9c30d7a41667bfa2e53d32b121c3f3c7bf932b6', class: "status-time" }, this.formatTime(this.messageReadTime)), read.map(u => (index.h("div", { class: "user-row" }, index.h("profile-avatar", { src: u.userProfileImageUrl || '', name: u.userName || '', size: "2rem" }), index.h("span", { class: "user-name" }, u.userName)))))), index.h("div", { key: 'faad423c5a626523aa8118d5bd5ff801390a22b5', class: "status-row" }, this.ticksIcon('delivered'), index.h("div", { key: '20cfad1d4981ece333bd294045f61d14ef25cdd7', class: "status-content" }, index.h("div", { key: '8b258a21f5697e2318f66efcebbf984573091b47', class: "status-title" }, "Delivered"), index.h("p", { key: '666b4c16bc9432d38dbb01369ecf6d23cef381ba', class: "status-time" }, this.formatTime(this.messageDeliveryTime)), delivery.map(u => (index.h("div", { class: "user-row" }, index.h("profile-avatar", { src: u.userProfileImageUrl || '', name: u.userName || '', size: "2rem" }), index.h("span", { class: "user-name" }, u.userName))))))))));
|
|
6786
6796
|
}
|
|
6787
6797
|
};
|
|
6788
6798
|
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); }";
|
|
@@ -7304,6 +7314,8 @@ const WebChatBody = class {
|
|
|
7304
7314
|
};
|
|
7305
7315
|
this.renderAttachmentMessage = (message, isSelf) => {
|
|
7306
7316
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
7317
|
+
// Caption from metaData.caption (Flutter/Swift); never show AttachmentMessage:* body placeholders
|
|
7318
|
+
const caption = sendMedia.attachmentCaption(message);
|
|
7307
7319
|
// Common props for all message types
|
|
7308
7320
|
const commonOutgoingProps = {
|
|
7309
7321
|
time: message === null || message === void 0 ? void 0 : message.sentAt,
|
|
@@ -7313,7 +7325,7 @@ const WebChatBody = class {
|
|
|
7313
7325
|
deliveryStatus: (message === null || message === void 0 ? void 0 : message.deliveryStatus) || '',
|
|
7314
7326
|
textColor: 'var(--text-outgoing-message)',
|
|
7315
7327
|
timeColor: 'var(--text-outgoing-time)',
|
|
7316
|
-
message:
|
|
7328
|
+
message: caption,
|
|
7317
7329
|
mentionedUsers: message === null || message === void 0 ? void 0 : message.mentionedUsers,
|
|
7318
7330
|
bgColor: 'var(--bg-outgoing-message)',
|
|
7319
7331
|
borderRadius: '6px 6px 0 6px',
|
|
@@ -7324,7 +7336,7 @@ const WebChatBody = class {
|
|
|
7324
7336
|
isSelf: isSelf,
|
|
7325
7337
|
textColor: 'var(--text-incoming-message)',
|
|
7326
7338
|
timeColor: 'var(--text-incoming-time)',
|
|
7327
|
-
message:
|
|
7339
|
+
message: caption,
|
|
7328
7340
|
mentionedUsers: message === null || message === void 0 ? void 0 : message.mentionedUsers,
|
|
7329
7341
|
bgColor: 'var(--bg-incoming-message)',
|
|
7330
7342
|
borderRadius: '6px 6px 6px 0',
|
|
@@ -7748,7 +7760,7 @@ const WebChatBody = class {
|
|
|
7748
7760
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
7749
7761
|
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);
|
|
7750
7762
|
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'));
|
|
7751
|
-
return (index.h("div", { key: '
|
|
7763
|
+
return (index.h("div", { key: 'fcb897b1540131642caba826fe6551d06a7ac9c9', class: `chat-body ${this.isChatBodyUnscrollable ? 'unscrollable' : null}` }, this.showScrollButton || this.newMessageNotification && (index.h("div", { key: '1232ce848507a42e5dbd73708f57b10966511f6c', onClick: this.scrollToBottom, style: {
|
|
7752
7764
|
position: 'sticky',
|
|
7753
7765
|
top: '90%',
|
|
7754
7766
|
left: '95%',
|
|
@@ -7762,7 +7774,7 @@ const WebChatBody = class {
|
|
|
7762
7774
|
cursor: 'pointer',
|
|
7763
7775
|
boxShadow: '0 2px 5px rgba(0,0,0,0.2)',
|
|
7764
7776
|
zIndex: '100',
|
|
7765
|
-
} }, ((_f = this.newMessageNotification) === null || _f === void 0 ? void 0 : _f.count) > 0 && (index.h("div", { key: '
|
|
7777
|
+
} }, ((_f = this.newMessageNotification) === null || _f === void 0 ? void 0 : _f.count) > 0 && (index.h("div", { key: 'f37caffdf257d82abefde7490978fc107d8befb5', style: {
|
|
7766
7778
|
position: 'absolute',
|
|
7767
7779
|
bottom: '22px',
|
|
7768
7780
|
right: '-2px',
|
|
@@ -7776,7 +7788,7 @@ const WebChatBody = class {
|
|
|
7776
7788
|
justifyContent: 'center',
|
|
7777
7789
|
fontSize: '12px',
|
|
7778
7790
|
padding: '0 4px',
|
|
7779
|
-
} })), index.h("svg", { key: '
|
|
7791
|
+
} })), index.h("svg", { key: '07567e171c2f415dab0e3c87b1e42cb9ae994c9d', width: "20px", height: "30px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.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 && (index.h("div", { key: 'dd06f9a496736731adf73db4eb68ed9bffdaf7a4', style: {
|
|
7780
7792
|
display: 'flex',
|
|
7781
7793
|
flexDirection: 'column',
|
|
7782
7794
|
alignItems: 'center',
|
|
@@ -7786,7 +7798,7 @@ const WebChatBody = class {
|
|
|
7786
7798
|
textAlign: 'center',
|
|
7787
7799
|
color: 'var(--text-secondary-color)',
|
|
7788
7800
|
marginTop: '20px',
|
|
7789
|
-
} }, index.h("img", { key: '
|
|
7801
|
+
} }, index.h("img", { key: '7a3a75d2fd64671ce5384180794169356d524d07', src: NoMessagePlaceholder, alt: "No messages", style: { width: '200px', height: '200px' } }), index.h("div", { key: '3cc5745e16a98a047c4633e4fc5c5b0bfcfc1b5c', style: { display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '10px' } }, index.h("span", { key: 'febc50bf7352f62d97443f8518611a662712b9c3', style: { fontSize: '24px', color: 'var(--text-primary-color)' } }, "No messages"), index.h("span", { key: '80e42faea0eb8ea092b8499ba3d9833033de45e5', style: { fontSize: '16px', color: 'var(--text-secondary-color)' } }, "Send a \"Hi\" and make someone's day brighter!")))), this.isMessagesLoading && (index.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 &&
|
|
7790
7802
|
((_h = this.userMetaData) === null || _h === void 0 ? void 0 : _h.userId) &&
|
|
7791
7803
|
(() => {
|
|
7792
7804
|
const total = this.allMessages.length;
|