isometrik-plugin-chat-sdk 2.0.7 → 2.0.8
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/attachment-preview_22.cjs.entry.js +45 -14
- package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
- package/dist/cjs/login-page_3.cjs.entry.js +16 -1
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js +21 -3
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +14 -11
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js +10 -1
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/mqtt-host.js +16 -1
- package/dist/collection/components/my-component/web-chat/mqtt-host.js.map +1 -1
- package/dist/components/WebChat.js +16 -1
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/WebChatBody.js +14 -11
- package/dist/components/WebChatBody.js.map +1 -1
- package/dist/components/WebChatHeader.js +21 -3
- package/dist/components/WebChatHeader.js.map +1 -1
- package/dist/components/contact-info2.js +11 -1
- package/dist/components/contact-info2.js.map +1 -1
- package/dist/esm/attachment-preview_22.entry.js +46 -15
- package/dist/esm/attachment-preview_22.entry.js.map +1 -1
- package/dist/esm/login-page_3.entry.js +16 -1
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
- package/dist/isometrik-webchat/p-35d9ecdc.entry.js +2 -0
- package/dist/isometrik-webchat/p-35d9ecdc.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-a119be75.entry.js +2 -0
- package/dist/isometrik-webchat/p-a119be75.entry.js.map +1 -0
- package/dist/types/components/ChatUIComponent/Header/WebChatHeader.d.ts +1 -0
- package/dist/types/components/ChatUIComponent/shared/contact-info/contact-info.d.ts +1 -0
- package/package.json +1 -1
- package/dist/isometrik-webchat/p-84424caa.entry.js +0 -2
- package/dist/isometrik-webchat/p-84424caa.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-ff023d39.entry.js +0 -2
- package/dist/isometrik-webchat/p-ff023d39.entry.js.map +0 -1
|
@@ -1781,9 +1781,24 @@ function createMqttContext(host) {
|
|
|
1781
1781
|
* - inbound messages processed on a per-host serial queue
|
|
1782
1782
|
*/
|
|
1783
1783
|
/** Soft REST merge while MQTT is down OR zombie-connected (looks up, drops msgs). */
|
|
1784
|
-
const SOFT_GAP_FILL_MS =
|
|
1784
|
+
const SOFT_GAP_FILL_MS = 15000;
|
|
1785
|
+
function chatBodyNearBottom(host, thresholdPx = 100) {
|
|
1786
|
+
var _a, _b;
|
|
1787
|
+
try {
|
|
1788
|
+
const body = (_b = (_a = host.chatBodyRef) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('.chat-body');
|
|
1789
|
+
if (!body)
|
|
1790
|
+
return true;
|
|
1791
|
+
return body.scrollHeight - body.scrollTop - body.clientHeight <= thresholdPx;
|
|
1792
|
+
}
|
|
1793
|
+
catch (_c) {
|
|
1794
|
+
return true;
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1785
1797
|
function hostAppendInboundMessage(host, parsedMessage) {
|
|
1798
|
+
const pin = chatBodyNearBottom(host);
|
|
1786
1799
|
host.allMessages = appendUniqueById(host.allMessages, parsedMessage);
|
|
1800
|
+
if (pin)
|
|
1801
|
+
host.isScrollToBottom = true;
|
|
1787
1802
|
void hostPersistMessages(host);
|
|
1788
1803
|
}
|
|
1789
1804
|
/**
|