isometrik-plugin-chat-sdk 2.0.7 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/cjs/attachment-preview_22.cjs.entry.js +46 -15
  2. package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
  3. package/dist/cjs/login-page_3.cjs.entry.js +17 -2
  4. package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
  5. package/dist/cjs/member-add.cjs.entry.js +1 -1
  6. package/dist/cjs/reaction-container.cjs.entry.js +1 -1
  7. package/dist/cjs/toast-75ef0607.js +159 -0
  8. package/dist/cjs/toast-75ef0607.js.map +1 -0
  9. package/dist/cjs/toast-notification.cjs.entry.js +21 -15
  10. package/dist/cjs/toast-notification.cjs.entry.js.map +1 -1
  11. package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js +21 -3
  12. package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js.map +1 -1
  13. package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +14 -11
  14. package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -1
  15. package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js +10 -1
  16. package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js.map +1 -1
  17. package/dist/collection/components/ChatUIComponent/shared/toast-notification/toast-notification.js +32 -26
  18. package/dist/collection/components/ChatUIComponent/shared/toast-notification/toast-notification.js.map +1 -1
  19. package/dist/collection/components/my-component/web-chat/mqtt-host.js +16 -1
  20. package/dist/collection/components/my-component/web-chat/mqtt-host.js.map +1 -1
  21. package/dist/collection/lib/friendly-toast-message.js +38 -0
  22. package/dist/collection/lib/friendly-toast-message.js.map +1 -0
  23. package/dist/collection/lib/toast.js +76 -21
  24. package/dist/collection/lib/toast.js.map +1 -1
  25. package/dist/components/WebChat.js +16 -1
  26. package/dist/components/WebChat.js.map +1 -1
  27. package/dist/components/WebChatBody.js +14 -11
  28. package/dist/components/WebChatBody.js.map +1 -1
  29. package/dist/components/WebChatHeader.js +21 -3
  30. package/dist/components/WebChatHeader.js.map +1 -1
  31. package/dist/components/contact-info2.js +11 -1
  32. package/dist/components/contact-info2.js.map +1 -1
  33. package/dist/components/toast-notification.js +21 -15
  34. package/dist/components/toast-notification.js.map +1 -1
  35. package/dist/components/toast.js +112 -21
  36. package/dist/components/toast.js.map +1 -1
  37. package/dist/esm/attachment-preview_22.entry.js +47 -16
  38. package/dist/esm/attachment-preview_22.entry.js.map +1 -1
  39. package/dist/esm/login-page_3.entry.js +17 -2
  40. package/dist/esm/login-page_3.entry.js.map +1 -1
  41. package/dist/esm/member-add.entry.js +1 -1
  42. package/dist/esm/reaction-container.entry.js +1 -1
  43. package/dist/esm/toast-45ac7913.js +157 -0
  44. package/dist/esm/toast-45ac7913.js.map +1 -0
  45. package/dist/esm/toast-notification.entry.js +21 -15
  46. package/dist/esm/toast-notification.entry.js.map +1 -1
  47. package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
  48. package/dist/isometrik-webchat/p-0c06a021.js +2 -0
  49. package/dist/isometrik-webchat/p-0c06a021.js.map +1 -0
  50. package/dist/isometrik-webchat/{p-76341adb.entry.js → p-6024bf2a.entry.js} +2 -2
  51. package/dist/isometrik-webchat/p-63ff4eea.entry.js +2 -0
  52. package/dist/isometrik-webchat/p-63ff4eea.entry.js.map +1 -0
  53. package/dist/isometrik-webchat/p-9f036163.entry.js +2 -0
  54. package/dist/isometrik-webchat/p-9f036163.entry.js.map +1 -0
  55. package/dist/isometrik-webchat/{p-2195b0c0.entry.js → p-ba6de4e2.entry.js} +2 -2
  56. package/dist/isometrik-webchat/p-d6fd2dd7.entry.js +2 -0
  57. package/dist/isometrik-webchat/p-d6fd2dd7.entry.js.map +1 -0
  58. package/dist/types/components/ChatUIComponent/Header/WebChatHeader.d.ts +1 -0
  59. package/dist/types/components/ChatUIComponent/shared/contact-info/contact-info.d.ts +1 -0
  60. package/dist/types/lib/friendly-toast-message.d.ts +5 -0
  61. package/dist/types/lib/toast.d.ts +1 -0
  62. package/package.json +1 -1
  63. package/dist/cjs/toast-f810e550.js +0 -68
  64. package/dist/cjs/toast-f810e550.js.map +0 -1
  65. package/dist/esm/toast-533dd183.js +0 -66
  66. package/dist/esm/toast-533dd183.js.map +0 -1
  67. package/dist/isometrik-webchat/p-4cb54460.js +0 -2
  68. package/dist/isometrik-webchat/p-4cb54460.js.map +0 -1
  69. package/dist/isometrik-webchat/p-84424caa.entry.js +0 -2
  70. package/dist/isometrik-webchat/p-84424caa.entry.js.map +0 -1
  71. package/dist/isometrik-webchat/p-e1d632b0.entry.js +0 -2
  72. package/dist/isometrik-webchat/p-e1d632b0.entry.js.map +0 -1
  73. package/dist/isometrik-webchat/p-ff023d39.entry.js +0 -2
  74. package/dist/isometrik-webchat/p-ff023d39.entry.js.map +0 -1
  75. /package/dist/isometrik-webchat/{p-76341adb.entry.js.map → p-6024bf2a.entry.js.map} +0 -0
  76. /package/dist/isometrik-webchat/{p-2195b0c0.entry.js.map → p-ba6de4e2.entry.js.map} +0 -0
@@ -11,7 +11,7 @@ import { c as createStore, g as groupMembersStore } from './group-members-05414d
11
11
  import { d as getGroupcastMessage, r as removeGroupcastMember, e as deleteGroupCast } from './groupcast-9c7d2a32.js';
12
12
  import { t as takeMediaFiles, M as MAX_MEDIA_PER_MESSAGE, j as attachmentBodyForApi, p as prepareMediaAttachments, u as uploadAndPostMediaMessage, k as isAttachmentBodyPlaceholder, f as fetchMessagesPage, s as searchMessages, b as fetchLinkMessages, c as fetchMediaCount, d as fetchMediaAttachments, l as mediaLimitToastMessage, n as buildLocalMediaAttachments, h as customTypeFromMime, A as ATTACHMENT_BODY_PLACEHOLDER, i as buildReplyMetaData, m as markConversationRead } from './send-media-a946c6dd.js';
13
13
  import { g as getOfflineClient, m as mergeMessagesById, i as isBrowserOnline } from './client-4a3e00da.js';
14
- import { s as showToast } from './toast-533dd183.js';
14
+ import { s as showToast } from './toast-45ac7913.js';
15
15
  import { r as removeConversationMember, g as getConversationEligibleMembers } from './group-members-d603f29f.js';
16
16
  import { h as hasNamedSlot } from './index-4c865e34.js';
17
17
  import './destroy-chat-d0ee28d6.js';
@@ -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 = 10000;
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
  /**