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
@@ -15,7 +15,7 @@ const groupMembers = require('./group-members-5a82ec8a.js');
15
15
  const groupcast$1 = require('./groupcast-c93d4a7d.js');
16
16
  const sendMedia = require('./send-media-37e09e83.js');
17
17
  const client = require('./client-80851676.js');
18
- const toast = require('./toast-f810e550.js');
18
+ const toast = require('./toast-75ef0607.js');
19
19
  const groupMembers$1 = require('./group-members-1205fc4c.js');
20
20
  const index$1 = require('./index-66f98408.js');
21
21
  require('./destroy-chat-7ae8fc99.js');
@@ -1785,9 +1785,24 @@ function createMqttContext(host) {
1785
1785
  * - inbound messages processed on a per-host serial queue
1786
1786
  */
1787
1787
  /** Soft REST merge while MQTT is down OR zombie-connected (looks up, drops msgs). */
1788
- const SOFT_GAP_FILL_MS = 10000;
1788
+ const SOFT_GAP_FILL_MS = 15000;
1789
+ function chatBodyNearBottom(host, thresholdPx = 100) {
1790
+ var _a, _b;
1791
+ try {
1792
+ const body = (_b = (_a = host.chatBodyRef) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('.chat-body');
1793
+ if (!body)
1794
+ return true;
1795
+ return body.scrollHeight - body.scrollTop - body.clientHeight <= thresholdPx;
1796
+ }
1797
+ catch (_c) {
1798
+ return true;
1799
+ }
1800
+ }
1789
1801
  function hostAppendInboundMessage(host, parsedMessage) {
1802
+ const pin = chatBodyNearBottom(host);
1790
1803
  host.allMessages = appendUniqueById(host.allMessages, parsedMessage);
1804
+ if (pin)
1805
+ host.isScrollToBottom = true;
1791
1806
  void hostPersistMessages(host);
1792
1807
  }
1793
1808
  /**