isometrik-plugin-chat-sdk 1.3.19 → 2.0.1

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 (476) hide show
  1. package/dist/cjs/app-globals-61a8bfde.js +38 -0
  2. package/dist/cjs/app-globals-61a8bfde.js.map +1 -0
  3. package/dist/cjs/attachment-preview_22.cjs.entry.js +122 -44
  4. package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
  5. package/dist/cjs/audio-bubble_4.cjs.entry.js +38 -8
  6. package/dist/cjs/audio-bubble_4.cjs.entry.js.map +1 -1
  7. package/dist/cjs/chat-app.cjs.entry.js +2 -2
  8. package/dist/cjs/chat-app.cjs.entry.js.map +1 -1
  9. package/dist/cjs/{chat-creds-cf537d4b.js → chat-creds-2dbc4087.js} +3 -3
  10. package/dist/cjs/chat-creds-2dbc4087.js.map +1 -0
  11. package/dist/cjs/chat-document-message-bubble.cjs.entry.js +1 -1
  12. package/dist/cjs/chat-image-message-bubble.cjs.entry.js +1 -1
  13. package/dist/cjs/chat-video-message-bubble.cjs.entry.js +1 -1
  14. package/dist/cjs/client-80851676.js +482 -0
  15. package/dist/cjs/client-80851676.js.map +1 -0
  16. package/dist/cjs/{contracts-31632812.js → contracts-dfc84075.js} +2 -2
  17. package/dist/cjs/contracts-dfc84075.js.map +1 -0
  18. package/dist/cjs/destroy-chat-7ae8fc99.js +24 -0
  19. package/dist/cjs/destroy-chat-7ae8fc99.js.map +1 -0
  20. package/dist/cjs/doublecheck-c2461adc.js +36 -0
  21. package/dist/cjs/doublecheck-c2461adc.js.map +1 -0
  22. package/dist/cjs/{drawer-28cc94a4.js → drawer-811d2ce8.js} +2 -2
  23. package/dist/cjs/{drawer-28cc94a4.js.map → drawer-811d2ce8.js.map} +1 -1
  24. package/dist/cjs/forward-memebers.cjs.entry.js +2 -2
  25. package/dist/cjs/forward-message.cjs.entry.js +2 -2
  26. package/dist/cjs/group-chat-contacts.cjs.entry.js +2 -2
  27. package/dist/cjs/{group-members-73ad1074.js → group-members-5a82ec8a.js} +1 -125
  28. package/dist/cjs/group-members-5a82ec8a.js.map +1 -0
  29. package/dist/cjs/{helpers-8061ec7d.js → helpers-154861e9.js} +2 -2
  30. package/dist/cjs/{helpers-8061ec7d.js.map → helpers-154861e9.js.map} +1 -1
  31. package/dist/cjs/{index-1a26d11d.js → index-66f98408.js} +2 -2
  32. package/dist/cjs/index-66f98408.js.map +1 -0
  33. package/dist/cjs/index.cjs.js +55 -182
  34. package/dist/cjs/index.cjs.js.map +1 -1
  35. package/dist/cjs/isometrik-webchat.cjs.js +10 -2
  36. package/dist/cjs/isometrik-webchat.cjs.js.map +1 -1
  37. package/dist/cjs/loader.cjs.js +10 -2
  38. package/dist/cjs/loader.cjs.js.map +1 -1
  39. package/dist/cjs/login-page_3.cjs.entry.js +689 -369
  40. package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
  41. package/dist/cjs/media-gallery.cjs.entry.js +1 -1
  42. package/dist/cjs/media-limits-eba42629.js +165 -0
  43. package/dist/cjs/media-limits-eba42629.js.map +1 -0
  44. package/dist/cjs/member-add.cjs.entry.js +3 -3
  45. package/dist/cjs/message-bubble.cjs.entry.js +30 -8
  46. package/dist/cjs/message-bubble.cjs.entry.js.map +1 -1
  47. package/dist/cjs/my-component.cjs.entry.js +1 -1
  48. package/dist/cjs/new-chat-sidebar.cjs.entry.js +2 -2
  49. package/dist/cjs/reaction-container.cjs.entry.js +4 -4
  50. package/dist/cjs/runtime-controls-201c71ba.js +650 -0
  51. package/dist/cjs/runtime-controls-201c71ba.js.map +1 -0
  52. package/dist/cjs/send-media-14908d4b.js +375 -0
  53. package/dist/cjs/send-media-14908d4b.js.map +1 -0
  54. package/dist/cjs/signup-page.cjs.entry.js +1 -1
  55. package/dist/cjs/{toast-0bf1e688.js → toast-f810e550.js} +8 -8
  56. package/dist/cjs/toast-f810e550.js.map +1 -0
  57. package/dist/collection/collection-manifest.json +2 -1
  58. package/dist/collection/components/ChatUIComponent/ChatDocumentMessageBubble.js +1 -1
  59. package/dist/collection/components/ChatUIComponent/ChatImageMessageBubble.js +1 -1
  60. package/dist/collection/components/ChatUIComponent/ChatVideoMessageBubble.js +1 -1
  61. package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +61 -14
  62. package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
  63. package/dist/collection/components/ChatUIComponent/ReactionContainer.js +2 -2
  64. package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +7 -6
  65. package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -1
  66. package/dist/collection/components/ChatUIComponent/shared/attachment-preview/attachment-preview.js +39 -8
  67. package/dist/collection/components/ChatUIComponent/shared/attachment-preview/attachment-preview.js.map +1 -1
  68. package/dist/collection/components/ChatUIComponent/shared/document-message/document-message.js +53 -3
  69. package/dist/collection/components/ChatUIComponent/shared/document-message/document-message.js.map +1 -1
  70. package/dist/collection/components/ChatUIComponent/shared/forward-message/forward-message.js +2 -2
  71. package/dist/collection/components/ChatUIComponent/shared/image-message/image-message.js +19 -1
  72. package/dist/collection/components/ChatUIComponent/shared/image-message/image-message.js.map +1 -1
  73. package/dist/collection/components/ChatUIComponent/shared/incoming-text-message-bubble/incoming-text-message-bubble.js +1 -1
  74. package/dist/collection/components/ChatUIComponent/shared/message-bubble/message-bubble.js +47 -7
  75. package/dist/collection/components/ChatUIComponent/shared/message-bubble/message-bubble.js.map +1 -1
  76. package/dist/collection/components/ChatUIComponent/shared/message-date-pill/message-date-pill.js +1 -1
  77. package/dist/collection/components/ChatUIComponent/shared/new chat/new-chat.stories.js +1 -1
  78. package/dist/collection/components/ChatUIComponent/shared/outgoing-text-message-bubble/outgoing-text-message-bubble.js +19 -1
  79. package/dist/collection/components/ChatUIComponent/shared/outgoing-text-message-bubble/outgoing-text-message-bubble.js.map +1 -1
  80. package/dist/collection/components/ChatUIComponent/shared/reply-message-container/reply-message-container.js +1 -1
  81. package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.js +20 -2
  82. package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.js.map +1 -1
  83. package/dist/collection/components/my-component/my-component.js +1 -1
  84. package/dist/collection/components/my-component/web-chat/FLOW.js +1 -1
  85. package/dist/collection/components/my-component/web-chat/FLOW.js.map +1 -1
  86. package/dist/collection/components/my-component/web-chat/WebChat.js +113 -12
  87. package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -1
  88. package/dist/collection/components/my-component/web-chat/bootstrap.js +7 -0
  89. package/dist/collection/components/my-component/web-chat/bootstrap.js.map +1 -1
  90. package/dist/collection/components/my-component/web-chat/data-fetch.js +14 -5
  91. package/dist/collection/components/my-component/web-chat/data-fetch.js.map +1 -1
  92. package/dist/collection/components/my-component/web-chat/mqtt-host.js +133 -34
  93. package/dist/collection/components/my-component/web-chat/mqtt-host.js.map +1 -1
  94. package/dist/collection/components/my-component/web-chat/offline-host.js +212 -0
  95. package/dist/collection/components/my-component/web-chat/offline-host.js.map +1 -0
  96. package/dist/collection/components/my-component/web-chat/public-send.js +96 -21
  97. package/dist/collection/components/my-component/web-chat/public-send.js.map +1 -1
  98. package/dist/collection/components/my-component/web-chat/shell-render.js +47 -28
  99. package/dist/collection/components/my-component/web-chat/shell-render.js.map +1 -1
  100. package/dist/collection/components/theme-provider.js +114 -45
  101. package/dist/collection/components/theme-provider.js.map +1 -1
  102. package/dist/collection/constants/chat-creds.js +2 -2
  103. package/dist/collection/demos/custom-ui-demo-elements.js +2 -2
  104. package/dist/collection/demos/custom-ui-demo-elements.js.map +1 -1
  105. package/dist/collection/global/expose-sdk.js +29 -0
  106. package/dist/collection/global/expose-sdk.js.map +1 -0
  107. package/dist/collection/index.js +10 -141
  108. package/dist/collection/index.js.map +1 -1
  109. package/dist/collection/lib/chat/index.js +3 -0
  110. package/dist/collection/lib/chat/index.js.map +1 -1
  111. package/dist/collection/lib/chat/media-limits.js +21 -0
  112. package/dist/collection/lib/chat/media-limits.js.map +1 -0
  113. package/dist/collection/lib/chat/media-outbox.js +43 -0
  114. package/dist/collection/lib/chat/media-outbox.js.map +1 -0
  115. package/dist/collection/lib/chat/preview-kind.js +41 -0
  116. package/dist/collection/lib/chat/preview-kind.js.map +1 -0
  117. package/dist/collection/lib/chat/send-media.js +5 -2
  118. package/dist/collection/lib/chat/send-media.js.map +1 -1
  119. package/dist/collection/lib/custom-ui/contracts.js +1 -1
  120. package/dist/collection/lib/custom-ui/contracts.js.map +1 -1
  121. package/dist/collection/lib/custom-ui/index.js +1 -1
  122. package/dist/collection/lib/custom-ui/index.js.map +1 -1
  123. package/dist/collection/lib/custom-ui/public-api.js +1 -0
  124. package/dist/collection/lib/custom-ui/public-api.js.map +1 -1
  125. package/dist/collection/lib/destroy-chat.js +15 -16
  126. package/dist/collection/lib/destroy-chat.js.map +1 -0
  127. package/dist/collection/lib/mqtt/inbound-queue.js +17 -0
  128. package/dist/collection/lib/mqtt/inbound-queue.js.map +1 -0
  129. package/dist/collection/lib/mqtt/index.js +2 -1
  130. package/dist/collection/lib/mqtt/index.js.map +1 -1
  131. package/dist/collection/lib/mqtt/session.js +50 -6
  132. package/dist/collection/lib/mqtt/session.js.map +1 -1
  133. package/dist/collection/lib/offline/client.js +167 -0
  134. package/dist/collection/lib/offline/client.js.map +1 -0
  135. package/dist/collection/lib/offline/idb.js +181 -0
  136. package/dist/collection/lib/offline/idb.js.map +1 -0
  137. package/dist/collection/lib/offline/index.js +10 -0
  138. package/dist/collection/lib/offline/index.js.map +1 -0
  139. package/dist/collection/lib/offline/memory-db.js +64 -0
  140. package/dist/collection/lib/offline/memory-db.js.map +1 -0
  141. package/dist/collection/lib/offline/merge.js +24 -0
  142. package/dist/collection/lib/offline/merge.js.map +1 -0
  143. package/dist/collection/lib/offline/multitab.js +47 -0
  144. package/dist/collection/lib/offline/multitab.js.map +1 -0
  145. package/dist/collection/lib/offline/types.js +2 -0
  146. package/dist/collection/lib/offline/types.js.map +1 -0
  147. package/dist/collection/lib/toast.js +6 -6
  148. package/dist/collection/lib/toast.js.map +1 -1
  149. package/dist/collection/sdk/api.js +4 -0
  150. package/dist/collection/sdk/api.js.map +1 -0
  151. package/dist/collection/sdk/composition.js +43 -0
  152. package/dist/collection/sdk/composition.js.map +1 -0
  153. package/dist/collection/sdk/headless-api.js +37 -0
  154. package/dist/collection/sdk/headless-api.js.map +1 -0
  155. package/dist/collection/sdk/index.js +11 -0
  156. package/dist/collection/sdk/index.js.map +1 -0
  157. package/dist/collection/sdk/init.js +207 -0
  158. package/dist/collection/sdk/init.js.map +1 -0
  159. package/dist/collection/sdk/instance.js +63 -0
  160. package/dist/collection/sdk/instance.js.map +1 -0
  161. package/dist/collection/sdk/react-bridge.js +145 -0
  162. package/dist/collection/sdk/react-bridge.js.map +1 -0
  163. package/dist/collection/sdk/runtime-controls.js +54 -0
  164. package/dist/collection/sdk/runtime-controls.js.map +1 -0
  165. package/dist/collection/sdk/slots.js +57 -0
  166. package/dist/collection/sdk/slots.js.map +1 -0
  167. package/dist/collection/sdk/theme-tokens.js +99 -0
  168. package/dist/collection/sdk/theme-tokens.js.map +1 -0
  169. package/dist/collection/sdk/webchat-api.js +36 -0
  170. package/dist/collection/sdk/webchat-api.js.map +1 -0
  171. package/dist/collection/testing/chat-assets-mock.js +45 -0
  172. package/dist/collection/testing/chat-creds-mock.js +18 -0
  173. package/dist/collection/testing/emoji-picker-mock.js +2 -0
  174. package/dist/collection/testing/file-mock.js +1 -0
  175. package/dist/collection/testing/groupcast-mock.js +7 -0
  176. package/dist/collection/testing/helpers-mock.js +4 -0
  177. package/dist/collection/testing/iso-chat-sdk-mock.js +19 -0
  178. package/dist/collection/testing/toast-mock.js +2 -0
  179. package/dist/components/ChatFooter.js +62 -15
  180. package/dist/components/ChatFooter.js.map +1 -1
  181. package/dist/components/ChatSidebar.js +1 -1
  182. package/dist/components/{GroupCast.js → GroupCast2.js} +2 -2
  183. package/dist/components/GroupCast2.js.map +1 -0
  184. package/dist/components/WebChat.js +624 -305
  185. package/dist/components/WebChat.js.map +1 -1
  186. package/dist/components/WebChatBody.js +8 -7
  187. package/dist/components/WebChatBody.js.map +1 -1
  188. package/dist/components/attachment-preview2.js +40 -9
  189. package/dist/components/attachment-preview2.js.map +1 -1
  190. package/dist/components/chat-app.js +3 -3
  191. package/dist/components/chat-app.js.map +1 -1
  192. package/dist/components/chat-assets.js +1 -1
  193. package/dist/components/chat-creds.js +2 -2
  194. package/dist/components/chat-creds.js.map +1 -1
  195. package/dist/components/chat-document-message-bubble.js +1 -1
  196. package/dist/components/chat-image-message-bubble.js +1 -1
  197. package/dist/components/chat-tile2.js +1 -1
  198. package/dist/components/chat-video-message-bubble.js +1 -1
  199. package/dist/components/client.js +728 -0
  200. package/dist/components/client.js.map +1 -0
  201. package/dist/components/contact-info2.js +2 -117
  202. package/dist/components/contact-info2.js.map +1 -1
  203. package/dist/components/contracts.js +1 -1
  204. package/dist/components/contracts.js.map +1 -1
  205. package/dist/components/destroy-chat.js +14 -16
  206. package/dist/components/destroy-chat.js.map +1 -1
  207. package/dist/components/document-message2.js +35 -5
  208. package/dist/components/document-message2.js.map +1 -1
  209. package/dist/components/forward-message.js +2 -2
  210. package/dist/components/group-cast.js +1 -1
  211. package/dist/components/{groupcast2.js → groupcast.js} +1 -1
  212. package/dist/components/groupcast.js.map +1 -0
  213. package/dist/components/image-message2.js +3 -1
  214. package/dist/components/image-message2.js.map +1 -1
  215. package/dist/components/incoming-text-message-bubble2.js +1 -1
  216. package/dist/components/index.js +551 -60
  217. package/dist/components/index.js.map +1 -1
  218. package/dist/components/index2.js +1 -1
  219. package/dist/components/index2.js.map +1 -1
  220. package/dist/components/media-limits.js +24 -0
  221. package/dist/components/media-limits.js.map +1 -0
  222. package/dist/components/member-add.js +1 -1
  223. package/dist/components/message-bubble2.js +31 -7
  224. package/dist/components/message-bubble2.js.map +1 -1
  225. package/dist/components/message-date-pill2.js +1 -1
  226. package/dist/components/messages.js +131 -0
  227. package/dist/components/messages.js.map +1 -0
  228. package/dist/components/my-component.js +1 -1
  229. package/dist/components/outgoing-text-message-bubble2.js +3 -1
  230. package/dist/components/outgoing-text-message-bubble2.js.map +1 -1
  231. package/dist/components/preview-kind.js +30 -0
  232. package/dist/components/preview-kind.js.map +1 -0
  233. package/dist/components/reaction-container.js +2 -2
  234. package/dist/components/reply-message-container2.js +1 -1
  235. package/dist/components/theme-provider2.js +56 -44
  236. package/dist/components/theme-provider2.js.map +1 -1
  237. package/dist/components/theme-tokens.js +102 -0
  238. package/dist/components/theme-tokens.js.map +1 -0
  239. package/dist/components/toast.js +6 -6
  240. package/dist/components/toast.js.map +1 -1
  241. package/dist/components/video-message2.js +4 -2
  242. package/dist/components/video-message2.js.map +1 -1
  243. package/dist/esm/app-globals-2beecb81.js +36 -0
  244. package/dist/esm/app-globals-2beecb81.js.map +1 -0
  245. package/dist/esm/attachment-preview_22.entry.js +120 -42
  246. package/dist/esm/attachment-preview_22.entry.js.map +1 -1
  247. package/dist/esm/audio-bubble_4.entry.js +39 -9
  248. package/dist/esm/audio-bubble_4.entry.js.map +1 -1
  249. package/dist/esm/chat-app.entry.js +2 -2
  250. package/dist/esm/chat-app.entry.js.map +1 -1
  251. package/dist/esm/{chat-assets-e3173222.js → chat-assets-bb056958.js} +2 -2
  252. package/dist/esm/{chat-assets-e3173222.js.map → chat-assets-bb056958.js.map} +1 -1
  253. package/dist/esm/{chat-creds-5d0982fc.js → chat-creds-aafad4d0.js} +3 -3
  254. package/dist/esm/chat-creds-aafad4d0.js.map +1 -0
  255. package/dist/esm/chat-document-message-bubble.entry.js +1 -1
  256. package/dist/esm/chat-image-message-bubble.entry.js +1 -1
  257. package/dist/esm/chat-tile_3.entry.js +1 -1
  258. package/dist/esm/chat-video-message-bubble.entry.js +1 -1
  259. package/dist/esm/client-4a3e00da.js +477 -0
  260. package/dist/esm/client-4a3e00da.js.map +1 -0
  261. package/dist/esm/{contracts-614be4db.js → contracts-50f4ddae.js} +2 -2
  262. package/dist/esm/contracts-50f4ddae.js.map +1 -0
  263. package/dist/esm/destroy-chat-d0ee28d6.js +22 -0
  264. package/dist/esm/destroy-chat-d0ee28d6.js.map +1 -0
  265. package/dist/esm/doublecheck-261763ef.js +32 -0
  266. package/dist/esm/doublecheck-261763ef.js.map +1 -0
  267. package/dist/esm/{drawer-8f721119.js → drawer-74c188f1.js} +2 -2
  268. package/dist/esm/{drawer-8f721119.js.map → drawer-74c188f1.js.map} +1 -1
  269. package/dist/esm/forward-memebers.entry.js +3 -3
  270. package/dist/esm/forward-message.entry.js +2 -2
  271. package/dist/esm/group-chat-contacts.entry.js +2 -2
  272. package/dist/esm/{group-members-806fd7a2.js → group-members-05414da2.js} +2 -118
  273. package/dist/esm/group-members-05414da2.js.map +1 -0
  274. package/dist/esm/{groupcast-2ce7187f.js → groupcast-9c7d2a32.js} +2 -2
  275. package/dist/esm/{groupcast-2ce7187f.js.map → groupcast-9c7d2a32.js.map} +1 -1
  276. package/dist/esm/{helpers-4c6d09a7.js → helpers-f33b895c.js} +2 -2
  277. package/dist/esm/{helpers-4c6d09a7.js.map → helpers-f33b895c.js.map} +1 -1
  278. package/dist/esm/{index-beb184c6.js → index-4c865e34.js} +2 -2
  279. package/dist/esm/index-4c865e34.js.map +1 -0
  280. package/dist/esm/index.js +17 -171
  281. package/dist/esm/index.js.map +1 -1
  282. package/dist/esm/isometrik-webchat.js +10 -2
  283. package/dist/esm/isometrik-webchat.js.map +1 -1
  284. package/dist/esm/loader.js +10 -2
  285. package/dist/esm/loader.js.map +1 -1
  286. package/dist/esm/login-page_3.entry.js +672 -352
  287. package/dist/esm/login-page_3.entry.js.map +1 -1
  288. package/dist/esm/media-gallery.entry.js +1 -1
  289. package/dist/esm/media-limits-3fa07c09.js +152 -0
  290. package/dist/esm/media-limits-3fa07c09.js.map +1 -0
  291. package/dist/esm/member-add.entry.js +5 -5
  292. package/dist/esm/message-bubble.entry.js +30 -8
  293. package/dist/esm/message-bubble.entry.js.map +1 -1
  294. package/dist/esm/my-component.entry.js +1 -1
  295. package/dist/esm/new-chat-sidebar.entry.js +3 -3
  296. package/dist/esm/reaction-container.entry.js +4 -4
  297. package/dist/esm/runtime-controls-cf599fe2.js +623 -0
  298. package/dist/esm/runtime-controls-cf599fe2.js.map +1 -0
  299. package/dist/esm/send-media-917dcc2f.js +353 -0
  300. package/dist/esm/send-media-917dcc2f.js.map +1 -0
  301. package/dist/esm/signup-page.entry.js +1 -1
  302. package/dist/esm/{toast-d8ea763c.js → toast-533dd183.js} +8 -8
  303. package/dist/esm/toast-533dd183.js.map +1 -0
  304. package/dist/isometrik-webchat/index.esm.js +1 -1
  305. package/dist/isometrik-webchat/index.esm.js.map +1 -1
  306. package/dist/isometrik-webchat/isometrik-webchat.css +1 -1
  307. package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
  308. package/dist/isometrik-webchat/isometrik-webchat.esm.js.map +1 -1
  309. package/dist/isometrik-webchat/p-0731d488.js +2 -0
  310. package/dist/isometrik-webchat/p-0731d488.js.map +1 -0
  311. package/dist/isometrik-webchat/{p-a15092d9.entry.js → p-1854b156.entry.js} +2 -2
  312. package/dist/isometrik-webchat/p-1854b156.entry.js.map +1 -0
  313. package/dist/isometrik-webchat/{p-5fea3fd2.entry.js → p-2d3e8cd4.entry.js} +2 -2
  314. package/dist/isometrik-webchat/p-315eee9a.js +2 -0
  315. package/dist/isometrik-webchat/p-315eee9a.js.map +1 -0
  316. package/dist/isometrik-webchat/{p-e7f58d3f.entry.js → p-39b626ed.entry.js} +2 -2
  317. package/dist/isometrik-webchat/{p-eb1f3118.entry.js → p-3c70c22c.entry.js} +2 -2
  318. package/dist/isometrik-webchat/p-4cb54460.js +2 -0
  319. package/dist/isometrik-webchat/p-4cb54460.js.map +1 -0
  320. package/dist/isometrik-webchat/{p-f24cdbbb.js → p-5162774c.js} +1 -1
  321. package/dist/isometrik-webchat/p-5162774c.js.map +1 -0
  322. package/dist/isometrik-webchat/p-53ee98a7.entry.js +2 -0
  323. package/dist/isometrik-webchat/p-53ee98a7.entry.js.map +1 -0
  324. package/dist/isometrik-webchat/{p-5cbc1a16.entry.js → p-586f6978.entry.js} +2 -2
  325. package/dist/isometrik-webchat/{p-5f7eebbf.entry.js → p-5d243250.entry.js} +2 -2
  326. package/dist/isometrik-webchat/{p-23df1c24.js → p-5d98a8a0.js} +2 -2
  327. package/dist/isometrik-webchat/p-7f415f28.js +2 -0
  328. package/dist/isometrik-webchat/p-7f415f28.js.map +1 -0
  329. package/dist/isometrik-webchat/{p-d386acfe.js → p-7fd2c1ad.js} +1 -1
  330. package/dist/isometrik-webchat/p-7fd2c1ad.js.map +1 -0
  331. package/dist/isometrik-webchat/{p-e5884258.js → p-9982fa21.js} +2 -2
  332. package/dist/isometrik-webchat/{p-4db39c93.js → p-a5707f12.js} +2 -2
  333. package/dist/isometrik-webchat/{p-af775c83.entry.js → p-a876991d.entry.js} +2 -2
  334. package/dist/isometrik-webchat/{p-7b80b0b2.js → p-adc45831.js} +1 -1
  335. package/dist/isometrik-webchat/p-adc45831.js.map +1 -0
  336. package/dist/isometrik-webchat/p-ae168135.js +2 -0
  337. package/dist/isometrik-webchat/p-ae168135.js.map +1 -0
  338. package/dist/isometrik-webchat/{p-a6897edc.js → p-b1330793.js} +1 -1
  339. package/dist/isometrik-webchat/p-b1330793.js.map +1 -0
  340. package/dist/isometrik-webchat/p-b61d6c0c.entry.js +2 -0
  341. package/dist/isometrik-webchat/p-b61d6c0c.entry.js.map +1 -0
  342. package/dist/isometrik-webchat/p-b667a9fc.js +2 -0
  343. package/dist/isometrik-webchat/p-b667a9fc.js.map +1 -0
  344. package/dist/isometrik-webchat/p-b857775d.entry.js +2 -0
  345. package/dist/isometrik-webchat/p-bdcdf1c5.js +2 -0
  346. package/dist/isometrik-webchat/p-bdcdf1c5.js.map +1 -0
  347. package/dist/isometrik-webchat/p-c0c19621.entry.js +2 -0
  348. package/dist/isometrik-webchat/{p-064d6200.entry.js → p-ca47d693.entry.js} +2 -2
  349. package/dist/isometrik-webchat/p-d720cf14.entry.js +2 -0
  350. package/dist/isometrik-webchat/{p-53695fc6.entry.js.map → p-d720cf14.entry.js.map} +1 -1
  351. package/dist/isometrik-webchat/{p-5c22ee37.entry.js → p-d892b4d4.entry.js} +2 -2
  352. package/dist/isometrik-webchat/{p-7eb12da3.js → p-dd62bd69.js} +2 -2
  353. package/dist/isometrik-webchat/p-eb54f75d.js +2 -0
  354. package/dist/isometrik-webchat/p-eb54f75d.js.map +1 -0
  355. package/dist/isometrik-webchat/p-f1fbf3be.entry.js +2 -0
  356. package/dist/isometrik-webchat/p-f1fbf3be.entry.js.map +1 -0
  357. package/dist/isometrik-webchat/p-fb705915.entry.js +2 -0
  358. package/dist/isometrik-webchat/p-fb705915.entry.js.map +1 -0
  359. package/dist/isometrik-webchat/{p-2f6bb0a4.entry.js → p-fd6ce589.entry.js} +2 -2
  360. package/dist/isometrik-webchat/p-fdd327f5.entry.js +2 -0
  361. package/dist/types/components/ChatUIComponent/Footer/ChatFooter.d.ts +1 -0
  362. package/dist/types/components/ChatUIComponent/shared/attachment-preview/attachment-preview.d.ts +2 -0
  363. package/dist/types/components/ChatUIComponent/shared/document-message/document-message.d.ts +5 -0
  364. package/dist/types/components/ChatUIComponent/shared/image-message/image-message.d.ts +1 -0
  365. package/dist/types/components/ChatUIComponent/shared/message-bubble/message-bubble.d.ts +3 -0
  366. package/dist/types/components/ChatUIComponent/shared/outgoing-text-message-bubble/outgoing-text-message-bubble.d.ts +1 -0
  367. package/dist/types/components/ChatUIComponent/shared/video-message/video-message.d.ts +1 -0
  368. package/dist/types/components/my-component/web-chat/FLOW.d.ts +1 -1
  369. package/dist/types/components/my-component/web-chat/mqtt-host.d.ts +5 -0
  370. package/dist/types/components/my-component/web-chat/offline-host.d.ts +22 -0
  371. package/dist/types/components/theme-provider.d.ts +22 -27
  372. package/dist/types/components.d.ts +84 -11
  373. package/dist/types/demos/custom-ui-demo-elements.d.ts +1 -1
  374. package/dist/types/global/expose-sdk.d.ts +1 -0
  375. package/dist/types/index.d.ts +3 -44
  376. package/dist/types/lib/chat/index.d.ts +3 -0
  377. package/dist/types/lib/chat/media-limits.d.ts +11 -0
  378. package/dist/types/lib/chat/media-outbox.d.ts +8 -0
  379. package/dist/types/lib/chat/preview-kind.d.ts +30 -0
  380. package/dist/types/lib/custom-ui/contracts.d.ts +1 -1
  381. package/dist/types/lib/custom-ui/index.d.ts +1 -1
  382. package/dist/types/lib/custom-ui/public-api.d.ts +1 -1
  383. package/dist/types/lib/destroy-chat.d.ts +2 -0
  384. package/dist/types/lib/mqtt/inbound-queue.d.ts +7 -0
  385. package/dist/types/lib/mqtt/index.d.ts +2 -1
  386. package/dist/types/lib/mqtt/session.d.ts +22 -0
  387. package/dist/types/lib/offline/client.d.ts +44 -0
  388. package/dist/types/lib/offline/idb.d.ts +36 -0
  389. package/dist/types/lib/offline/index.d.ts +10 -0
  390. package/dist/types/lib/offline/memory-db.d.ts +20 -0
  391. package/dist/types/lib/offline/merge.d.ts +3 -0
  392. package/dist/types/lib/offline/multitab.d.ts +13 -0
  393. package/dist/types/lib/offline/types.d.ts +63 -0
  394. package/dist/types/sdk/api.d.ts +3 -0
  395. package/dist/types/sdk/composition.d.ts +32 -0
  396. package/dist/types/sdk/headless-api.d.ts +37 -0
  397. package/dist/types/sdk/index.d.ts +10 -0
  398. package/dist/types/sdk/init.d.ts +87 -0
  399. package/dist/types/sdk/instance.d.ts +15 -0
  400. package/dist/types/sdk/react-bridge.d.ts +64 -0
  401. package/dist/types/sdk/runtime-controls.d.ts +14 -0
  402. package/dist/types/sdk/slots.d.ts +15 -0
  403. package/dist/types/sdk/theme-tokens.d.ts +22 -0
  404. package/dist/types/sdk/webchat-api.d.ts +22 -0
  405. package/docs/ARCHITECTURE.md +272 -0
  406. package/docs/CUSTOMIZATION.md +236 -0
  407. package/docs/INTEGRATION.md +286 -0
  408. package/docs/RELIABILITY.md +51 -0
  409. package/docs/theme-tokens.template.css +72 -0
  410. package/package.json +8 -2
  411. package/readme.md +38 -17
  412. package/dist/cjs/app-globals-3a1e7e63.js +0 -7
  413. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  414. package/dist/cjs/chat-creds-cf537d4b.js.map +0 -1
  415. package/dist/cjs/contracts-31632812.js.map +0 -1
  416. package/dist/cjs/destroy-chat-be25dec7.js +0 -26
  417. package/dist/cjs/destroy-chat-be25dec7.js.map +0 -1
  418. package/dist/cjs/doublecheck-997afc94.js +0 -7
  419. package/dist/cjs/doublecheck-997afc94.js.map +0 -1
  420. package/dist/cjs/group-members-73ad1074.js.map +0 -1
  421. package/dist/cjs/index-1a26d11d.js.map +0 -1
  422. package/dist/cjs/toast-0bf1e688.js.map +0 -1
  423. package/dist/components/GroupCast.js.map +0 -1
  424. package/dist/components/groupcast2.js.map +0 -1
  425. package/dist/esm/app-globals-0f993ce5.js +0 -5
  426. package/dist/esm/app-globals-0f993ce5.js.map +0 -1
  427. package/dist/esm/chat-creds-5d0982fc.js.map +0 -1
  428. package/dist/esm/contracts-614be4db.js.map +0 -1
  429. package/dist/esm/destroy-chat-e2ebe165.js +0 -24
  430. package/dist/esm/destroy-chat-e2ebe165.js.map +0 -1
  431. package/dist/esm/doublecheck-5e208ef0.js +0 -5
  432. package/dist/esm/doublecheck-5e208ef0.js.map +0 -1
  433. package/dist/esm/group-members-806fd7a2.js.map +0 -1
  434. package/dist/esm/index-beb184c6.js.map +0 -1
  435. package/dist/esm/toast-d8ea763c.js.map +0 -1
  436. package/dist/isometrik-webchat/p-01fd0eb4.entry.js +0 -2
  437. package/dist/isometrik-webchat/p-01fd0eb4.entry.js.map +0 -1
  438. package/dist/isometrik-webchat/p-0f9c3f95.entry.js +0 -2
  439. package/dist/isometrik-webchat/p-0f9c3f95.entry.js.map +0 -1
  440. package/dist/isometrik-webchat/p-1c53e658.js +0 -2
  441. package/dist/isometrik-webchat/p-1c53e658.js.map +0 -1
  442. package/dist/isometrik-webchat/p-1df58381.entry.js +0 -2
  443. package/dist/isometrik-webchat/p-1df58381.entry.js.map +0 -1
  444. package/dist/isometrik-webchat/p-3c690532.entry.js +0 -2
  445. package/dist/isometrik-webchat/p-3c690532.entry.js.map +0 -1
  446. package/dist/isometrik-webchat/p-3c8cbd5f.js +0 -2
  447. package/dist/isometrik-webchat/p-3c8cbd5f.js.map +0 -1
  448. package/dist/isometrik-webchat/p-4e762019.js +0 -2
  449. package/dist/isometrik-webchat/p-4e762019.js.map +0 -1
  450. package/dist/isometrik-webchat/p-53695fc6.entry.js +0 -2
  451. package/dist/isometrik-webchat/p-7b80b0b2.js.map +0 -1
  452. package/dist/isometrik-webchat/p-9924b1bf.entry.js +0 -2
  453. package/dist/isometrik-webchat/p-a15092d9.entry.js.map +0 -1
  454. package/dist/isometrik-webchat/p-a6897edc.js.map +0 -1
  455. package/dist/isometrik-webchat/p-b2bf55b1.entry.js +0 -2
  456. package/dist/isometrik-webchat/p-bfecfa97.entry.js +0 -2
  457. package/dist/isometrik-webchat/p-d386acfe.js.map +0 -1
  458. package/dist/isometrik-webchat/p-e1255160.js +0 -2
  459. package/dist/isometrik-webchat/p-e1255160.js.map +0 -1
  460. package/dist/isometrik-webchat/p-f24cdbbb.js.map +0 -1
  461. /package/dist/isometrik-webchat/{p-5fea3fd2.entry.js.map → p-2d3e8cd4.entry.js.map} +0 -0
  462. /package/dist/isometrik-webchat/{p-e7f58d3f.entry.js.map → p-39b626ed.entry.js.map} +0 -0
  463. /package/dist/isometrik-webchat/{p-eb1f3118.entry.js.map → p-3c70c22c.entry.js.map} +0 -0
  464. /package/dist/isometrik-webchat/{p-5cbc1a16.entry.js.map → p-586f6978.entry.js.map} +0 -0
  465. /package/dist/isometrik-webchat/{p-5f7eebbf.entry.js.map → p-5d243250.entry.js.map} +0 -0
  466. /package/dist/isometrik-webchat/{p-23df1c24.js.map → p-5d98a8a0.js.map} +0 -0
  467. /package/dist/isometrik-webchat/{p-e5884258.js.map → p-9982fa21.js.map} +0 -0
  468. /package/dist/isometrik-webchat/{p-4db39c93.js.map → p-a5707f12.js.map} +0 -0
  469. /package/dist/isometrik-webchat/{p-af775c83.entry.js.map → p-a876991d.entry.js.map} +0 -0
  470. /package/dist/isometrik-webchat/{p-bfecfa97.entry.js.map → p-b857775d.entry.js.map} +0 -0
  471. /package/dist/isometrik-webchat/{p-9924b1bf.entry.js.map → p-c0c19621.entry.js.map} +0 -0
  472. /package/dist/isometrik-webchat/{p-064d6200.entry.js.map → p-ca47d693.entry.js.map} +0 -0
  473. /package/dist/isometrik-webchat/{p-5c22ee37.entry.js.map → p-d892b4d4.entry.js.map} +0 -0
  474. /package/dist/isometrik-webchat/{p-7eb12da3.js.map → p-dd62bd69.js.map} +0 -0
  475. /package/dist/isometrik-webchat/{p-2f6bb0a4.entry.js.map → p-fd6ce589.entry.js.map} +0 -0
  476. /package/dist/isometrik-webchat/{p-b2bf55b1.entry.js.map → p-fdd327f5.entry.js.map} +0 -0
@@ -1,84 +1,89 @@
1
1
  import { h } from "@stencil/core";
2
+ import { applyThemeObjectToElement, normalizeThemeObject } from "../sdk/theme-tokens";
2
3
  export class ThemeProvider {
3
4
  constructor() {
5
+ this.stylesheetId = `isometrik-theme-stylesheet-${Math.random().toString(36).slice(2, 9)}`;
4
6
  this.themePath = undefined;
5
7
  this.mode = 'light';
8
+ this.themeObject = undefined;
9
+ this.mirrorToDocument = false;
6
10
  this.styleElement = null;
7
11
  }
8
- /**
9
- * Watch for changes to the theme path and update the stylesheet
10
- */
11
12
  handleThemePathChange(newPath) {
12
13
  if (newPath) {
13
14
  this.loadThemeFromPath(newPath);
14
15
  }
15
16
  }
16
- /**
17
- * Watch for changes to theme mode
18
- */
19
17
  handleModeChange(newMode) {
20
18
  this.updateThemeClass(newMode);
21
19
  }
22
- /**
23
- * Component lifecycle method that runs once after the component is first connected to the DOM
24
- */
20
+ handleThemeObjectChange(next) {
21
+ this.applyThemeObject(next);
22
+ }
23
+ handleMirrorChange() {
24
+ this.updateThemeClass(this.mode);
25
+ }
25
26
  componentDidLoad() {
26
- // Load theme from path if provided
27
27
  if (this.themePath) {
28
28
  this.loadThemeFromPath(this.themePath);
29
29
  }
30
- // Set initial theme class
31
30
  this.updateThemeClass(this.mode);
31
+ this.applyThemeObject(this.themeObject);
32
+ }
33
+ disconnectedCallback() {
34
+ var _a;
35
+ if ((_a = this.styleElement) === null || _a === void 0 ? void 0 : _a.parentNode) {
36
+ this.styleElement.parentNode.removeChild(this.styleElement);
37
+ this.styleElement = null;
38
+ }
39
+ if (this.mirrorToDocument) {
40
+ document.documentElement.classList.remove('theme-light', 'theme-dark');
41
+ }
32
42
  }
33
- /**
34
- * Update the theme class on the document body
35
- */
43
+ applyThemeObject(theme) {
44
+ applyThemeObjectToElement(this.hostElement, theme || null);
45
+ }
46
+ /** Mode class on this host only — CSS vars inherit into <web-chat> shadow. */
36
47
  updateThemeClass(mode) {
37
- // Remove existing theme classes
38
- document.documentElement.classList.remove('theme-light', 'theme-dark');
39
- // Add the appropriate class
40
- document.documentElement.classList.add(`theme-${mode}`);
41
- // Dispatch a theme change event
42
- const themeChangeEvent = new CustomEvent('themechange', {
43
- detail: { mode },
48
+ this.hostElement.classList.remove('theme-light', 'theme-dark');
49
+ this.hostElement.classList.add(`theme-${mode}`);
50
+ if (this.mirrorToDocument) {
51
+ document.documentElement.classList.remove('theme-light', 'theme-dark');
52
+ document.documentElement.classList.add(`theme-${mode}`);
53
+ }
54
+ this.hostElement.dispatchEvent(new CustomEvent('themechange', {
55
+ detail: { mode, scoped: !this.mirrorToDocument },
44
56
  bubbles: true,
45
- composed: true
46
- });
47
- this.hostElement.dispatchEvent(themeChangeEvent);
57
+ composed: true,
58
+ }));
48
59
  }
49
- /**
50
- * Load a theme from a CSS file path
51
- */
52
60
  loadThemeFromPath(path) {
53
- // Remove any existing stylesheet if it exists
54
- if (this.styleElement) {
55
- document.head.removeChild(this.styleElement);
61
+ var _a;
62
+ if ((_a = this.styleElement) === null || _a === void 0 ? void 0 : _a.parentNode) {
63
+ this.styleElement.parentNode.removeChild(this.styleElement);
56
64
  }
57
- // Create a new link element for the CSS file
58
65
  this.styleElement = document.createElement('link');
59
66
  this.styleElement.rel = 'stylesheet';
60
67
  this.styleElement.href = path;
61
- // Add an ID to make it easier to find and remove later if needed
62
- this.styleElement.id = 'isometrik-theme-stylesheet';
63
- // Append the stylesheet to the document head
68
+ this.styleElement.id = this.stylesheetId;
69
+ this.styleElement.setAttribute('data-isometrik-theme', '1');
64
70
  document.head.appendChild(this.styleElement);
65
71
  }
66
- /**
67
- * Public method to toggle between light and dark themes
68
- */
69
72
  async toggleTheme() {
70
73
  this.mode = this.mode === 'light' ? 'dark' : 'light';
71
74
  return this.mode;
72
75
  }
73
- /**
74
- * Public method to set theme explicitly
75
- */
76
76
  async setTheme(mode) {
77
77
  this.mode = mode;
78
78
  return this.mode;
79
79
  }
80
+ async setThemeObject(theme) {
81
+ const normalized = normalizeThemeObject(theme || undefined);
82
+ applyThemeObjectToElement(this.hostElement, normalized);
83
+ return normalized;
84
+ }
80
85
  render() {
81
- return (h("div", { key: '437b7df4e9fb82384b7c7eedf6438fd3585f3827', class: `theme-provider-container theme-${this.mode}` }, h("slot", { key: '43c375abcf9c6bcbed267a5a436ab1bc329933d6' })));
86
+ return (h("div", { key: 'eda588f5d70658cdbb4d2c112b87e967e26851f4', class: `theme-provider-container theme-${this.mode}` }, h("slot", { key: '1c0c507b5f4380353fb5af4332f1873eecd84d5c' })));
82
87
  }
83
88
  static get is() { return "theme-provider"; }
84
89
  static get encapsulation() { return "shadow"; }
@@ -96,7 +101,7 @@ export class ThemeProvider {
96
101
  "optional": false,
97
102
  "docs": {
98
103
  "tags": [],
99
- "text": "Path to the CSS theme file"
104
+ "text": "Path / URL to a CSS theme file (CDN or local)."
100
105
  },
101
106
  "attribute": "theme-path",
102
107
  "reflect": false
@@ -113,11 +118,44 @@ export class ThemeProvider {
113
118
  "optional": false,
114
119
  "docs": {
115
120
  "tags": [],
116
- "text": "Current theme mode"
121
+ "text": "light | dark \u2014 drives `.theme-*` class on this host only (scoped)."
117
122
  },
118
123
  "attribute": "mode",
119
124
  "reflect": true,
120
125
  "defaultValue": "'light'"
126
+ },
127
+ "themeObject": {
128
+ "type": "unknown",
129
+ "mutable": false,
130
+ "complexType": {
131
+ "original": "{ [key: string]: string }",
132
+ "resolved": "{ [key: string]: string; }",
133
+ "references": {}
134
+ },
135
+ "required": false,
136
+ "optional": true,
137
+ "docs": {
138
+ "tags": [],
139
+ "text": "Inline CSS variable overrides. Keys may be `--brand` or `brand`.\nApplied on this host so values inherit into nested shadow trees."
140
+ }
141
+ },
142
+ "mirrorToDocument": {
143
+ "type": "boolean",
144
+ "mutable": false,
145
+ "complexType": {
146
+ "original": "boolean",
147
+ "resolved": "boolean",
148
+ "references": {}
149
+ },
150
+ "required": false,
151
+ "optional": false,
152
+ "docs": {
153
+ "tags": [],
154
+ "text": "When true, also mirror mode onto <html> (legacy). Default false so\nembeds do not restyle the host page or fight sibling chats."
155
+ },
156
+ "attribute": "mirror-to-document",
157
+ "reflect": false,
158
+ "defaultValue": "false"
121
159
  }
122
160
  };
123
161
  }
@@ -141,7 +179,7 @@ export class ThemeProvider {
141
179
  "return": "Promise<\"dark\" | \"light\">"
142
180
  },
143
181
  "docs": {
144
- "text": "Public method to toggle between light and dark themes",
182
+ "text": "",
145
183
  "tags": []
146
184
  }
147
185
  },
@@ -162,7 +200,32 @@ export class ThemeProvider {
162
200
  "return": "Promise<\"dark\" | \"light\">"
163
201
  },
164
202
  "docs": {
165
- "text": "Public method to set theme explicitly",
203
+ "text": "",
204
+ "tags": []
205
+ }
206
+ },
207
+ "setThemeObject": {
208
+ "complexType": {
209
+ "signature": "(theme: { [key: string]: string; } | null) => Promise<Record<string, string>>",
210
+ "parameters": [{
211
+ "name": "theme",
212
+ "type": "{ [key: string]: string; }",
213
+ "docs": ""
214
+ }],
215
+ "references": {
216
+ "Promise": {
217
+ "location": "global",
218
+ "id": "global::Promise"
219
+ },
220
+ "Record": {
221
+ "location": "global",
222
+ "id": "global::Record"
223
+ }
224
+ },
225
+ "return": "Promise<Record<string, string>>"
226
+ },
227
+ "docs": {
228
+ "text": "",
166
229
  "tags": []
167
230
  }
168
231
  }
@@ -176,6 +239,12 @@ export class ThemeProvider {
176
239
  }, {
177
240
  "propName": "mode",
178
241
  "methodName": "handleModeChange"
242
+ }, {
243
+ "propName": "themeObject",
244
+ "methodName": "handleThemeObjectChange"
245
+ }, {
246
+ "propName": "mirrorToDocument",
247
+ "methodName": "handleMirrorChange"
179
248
  }];
180
249
  }
181
250
  }
@@ -1 +1 @@
1
- {"version":3,"file":"theme-provider.js","sourceRoot":"","sources":["../../src/components/theme-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAMlF,MAAM,OAAO,aAAa;;;oBAWyC,OAAO;4BAKxB,IAAI;;IAEpD;;OAEG;IAEH,qBAAqB,CAAC,OAAe;QACnC,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IAED;;OAEG;IAEH,gBAAgB,CAAC,OAAyB;QACxC,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,mCAAmC;QACnC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzC,CAAC;QAED,0BAA0B;QAC1B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACK,gBAAgB,CAAC,IAAsB;QAC7C,gCAAgC;QAChC,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;QAEvE,4BAA4B;QAC5B,QAAQ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O,CACL,4DAAK,KAAK,EAAE,kCAAkC,IAAI,CAAC,IAAI,EAAE;YACvD,8DAAa,CACT,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h, State, Watch, Element, Method } from '@stencil/core';\n\n@Component({\n tag: 'theme-provider',\n shadow: true,\n})\nexport class ThemeProvider {\n @Element() hostElement: HTMLElement;\n \n /**\n * Path to the CSS theme file\n */\n @Prop() themePath: string;\n \n /**\n * Current theme mode\n */\n @Prop({ mutable: true, reflect: true }) mode: 'light' | 'dark' = 'light';\n \n /**\n * Internal stylesheet element reference\n */\n @State() styleElement: HTMLLinkElement | null = null;\n \n /**\n * Watch for changes to the theme path and update the stylesheet\n */\n @Watch('themePath')\n handleThemePathChange(newPath: string) {\n if (newPath) {\n this.loadThemeFromPath(newPath);\n }\n }\n \n /**\n * Watch for changes to theme mode\n */\n @Watch('mode')\n handleModeChange(newMode: 'light' | 'dark') {\n this.updateThemeClass(newMode);\n }\n \n /**\n * Component lifecycle method that runs once after the component is first connected to the DOM\n */\n componentDidLoad() {\n // Load theme from path if provided\n if (this.themePath) {\n this.loadThemeFromPath(this.themePath);\n }\n \n // Set initial theme class\n this.updateThemeClass(this.mode);\n }\n \n /**\n * Update the theme class on the document body\n */\n private updateThemeClass(mode: 'light' | 'dark') {\n // Remove existing theme classes\n document.documentElement.classList.remove('theme-light', 'theme-dark');\n \n // Add the appropriate class\n document.documentElement.classList.add(`theme-${mode}`);\n \n // Dispatch a theme change event\n const themeChangeEvent = new CustomEvent('themechange', {\n detail: { mode },\n bubbles: true,\n composed: true\n });\n this.hostElement.dispatchEvent(themeChangeEvent);\n }\n \n /**\n * Load a theme from a CSS file path\n */\n private loadThemeFromPath(path: string) {\n // Remove any existing stylesheet if it exists\n if (this.styleElement) {\n document.head.removeChild(this.styleElement);\n }\n \n // Create a new link element for the CSS file\n this.styleElement = document.createElement('link');\n this.styleElement.rel = 'stylesheet';\n this.styleElement.href = path;\n \n // Add an ID to make it easier to find and remove later if needed\n this.styleElement.id = 'isometrik-theme-stylesheet';\n \n // Append the stylesheet to the document head\n document.head.appendChild(this.styleElement);\n }\n \n /**\n * Public method to toggle between light and dark themes\n */\n @Method()\n async toggleTheme() {\n this.mode = this.mode === 'light' ? 'dark' : 'light';\n return this.mode;\n }\n \n /**\n * Public method to set theme explicitly\n */\n @Method()\n async setTheme(mode: 'light' | 'dark') {\n this.mode = mode;\n return this.mode;\n }\n \n render() {\n return (\n <div class={`theme-provider-container theme-${this.mode}`}>\n <slot></slot>\n </div>\n );\n }\n}"]}
1
+ {"version":3,"file":"theme-provider.js","sourceRoot":"","sources":["../../src/components/theme-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAMtF,MAAM,OAAO,aAAa;;QAuBhB,iBAAY,GAAG,8BAA8B,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;;oBAhB7B,OAAO;;gCAYpC,KAAK;4BAEO,IAAI;;IAKpD,qBAAqB,CAAC,OAAe;QACnC,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IAGD,gBAAgB,CAAC,OAAyB;QACxC,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAGD,uBAAuB,CAAC,IAAgC;QACtD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC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AAC,KAAuC;QAC1D,MAAM,UAAU,GAAG,oBAAoB,CAAC,KAAK,IAAI,SAAS,CAAC,CAAC;QAC5D,yBAAyB,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QACxD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM;QACJ,OAAO,CACL,4DAAK,KAAK,EAAE,kCAAkC,IAAI,CAAC,IAAI,EAAE;YACvD,8DAAa,CACT,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h, State, Watch, Element, Method } from '@stencil/core';\nimport { applyThemeObjectToElement, normalizeThemeObject } from '../sdk/theme-tokens';\n\n@Component({\n tag: 'theme-provider',\n shadow: true,\n})\nexport class ThemeProvider {\n @Element() hostElement: HTMLElement;\n\n /** Path / URL to a CSS theme file (CDN or local). */\n @Prop() themePath: string;\n\n /** light | dark — drives `.theme-*` class on this host only (scoped). */\n @Prop({ mutable: true, reflect: true }) mode: 'light' | 'dark' = 'light';\n\n /**\n * Inline CSS variable overrides. Keys may be `--brand` or `brand`.\n * Applied on this host so values inherit into nested shadow trees.\n */\n @Prop() themeObject?: { [key: string]: string };\n\n /**\n * When true, also mirror mode onto <html> (legacy). Default false so\n * embeds do not restyle the host page or fight sibling chats.\n */\n @Prop() mirrorToDocument: boolean = false;\n\n @State() styleElement: HTMLLinkElement | null = null;\n\n private stylesheetId = `isometrik-theme-stylesheet-${Math.random().toString(36).slice(2, 9)}`;\n\n @Watch('themePath')\n handleThemePathChange(newPath: string) {\n if (newPath) {\n this.loadThemeFromPath(newPath);\n }\n }\n\n @Watch('mode')\n handleModeChange(newMode: 'light' | 'dark') {\n this.updateThemeClass(newMode);\n }\n\n @Watch('themeObject')\n handleThemeObjectChange(next?: { [key: string]: string }) {\n this.applyThemeObject(next);\n }\n\n @Watch('mirrorToDocument')\n handleMirrorChange() {\n this.updateThemeClass(this.mode);\n }\n\n componentDidLoad() {\n if (this.themePath) {\n this.loadThemeFromPath(this.themePath);\n }\n this.updateThemeClass(this.mode);\n this.applyThemeObject(this.themeObject);\n }\n\n disconnectedCallback() {\n if (this.styleElement?.parentNode) {\n this.styleElement.parentNode.removeChild(this.styleElement);\n this.styleElement = null;\n }\n if (this.mirrorToDocument) {\n document.documentElement.classList.remove('theme-light', 'theme-dark');\n }\n }\n\n private applyThemeObject(theme?: { [key: string]: string }) {\n applyThemeObjectToElement(this.hostElement, theme || null);\n }\n\n /** Mode class on this host only — CSS vars inherit into <web-chat> shadow. */\n private updateThemeClass(mode: 'light' | 'dark') {\n this.hostElement.classList.remove('theme-light', 'theme-dark');\n this.hostElement.classList.add(`theme-${mode}`);\n\n if (this.mirrorToDocument) {\n document.documentElement.classList.remove('theme-light', 'theme-dark');\n document.documentElement.classList.add(`theme-${mode}`);\n }\n\n this.hostElement.dispatchEvent(\n new CustomEvent('themechange', {\n detail: { mode, scoped: !this.mirrorToDocument },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private loadThemeFromPath(path: string) {\n if (this.styleElement?.parentNode) {\n this.styleElement.parentNode.removeChild(this.styleElement);\n }\n\n this.styleElement = document.createElement('link');\n this.styleElement.rel = 'stylesheet';\n this.styleElement.href = path;\n this.styleElement.id = this.stylesheetId;\n this.styleElement.setAttribute('data-isometrik-theme', '1');\n document.head.appendChild(this.styleElement);\n }\n\n @Method()\n async toggleTheme() {\n this.mode = this.mode === 'light' ? 'dark' : 'light';\n return this.mode;\n }\n\n @Method()\n async setTheme(mode: 'light' | 'dark') {\n this.mode = mode;\n return this.mode;\n }\n\n @Method()\n async setThemeObject(theme: { [key: string]: string } | null) {\n const normalized = normalizeThemeObject(theme || undefined);\n applyThemeObjectToElement(this.hostElement, normalized);\n return normalized;\n }\n\n render() {\n return (\n <div class={`theme-provider-container theme-${this.mode}`}>\n <slot></slot>\n </div>\n );\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  // for fancy
2
2
  export const CHAT_CREDS = {
3
- userToken: 'SFMyNTY.g3QAAAACZAAEZGF0YW0AAAAYNjZmMjVkMWU3Zjc1NTkwMDM3MjNjN2QxZAAGc2lnbmVkbgYArMC7IpIB.ECtG8Fio6sLZbpNQcM1tFCZcVyCRPpFG9BwWMOEpCTA', // rounit
3
+ userToken: 'SFMyNTY.g3QAAAACZAAEZGF0YW0AAAAYNjZmMjVkMWU3Zjc1NTkwMDM3MjNjN2QxZAAGc2lnbmVkbgYArMC7IpIB.ECtG8Fio6sLZbpNQcM1tFCZcVyCRPpFG9BwWMOEpCTA',
4
4
 
5
5
  // appSecret : will be same for a single applicaton
6
6
  appSecret: 'SFMyNTY.g3QAAAACZAAEZGF0YXQAAAADbQAAAAlhY2NvdW50SWRtAAAAGDYxMjUwNDAzMDg4MDg1MDAwMWFhM2Y1Y20AAAAIa2V5c2V0SWRtAAAAJGFlYTkzY2YxLTY5MTYtNDA1MS1iM2I4LWRkMDAyMGViMTU3MW0AAAAJcHJvamVjdElkbQAAACQ3MjNjOTFlYS0xNTdkLTQ2YzMtYTljZS1iNWJiZGYwYmZjN2RkAAZzaWduZWRuBgDXqeZ4hgE.sbacYYKGfKuj-iJnkeV2rFlX6MFDtWOcoLcKL3uW8ic',
@@ -14,7 +14,7 @@ export const CHAT_CREDS = {
14
14
  keysetId: "aea93cf1-6916-4051-b3b8-dd0020eb1571",
15
15
  projectId: '723c91ea-157d-46c3-a9ce-b5bbdf0bfc7d',
16
16
  baseUrl: 'https://apis.isometrik.io',
17
- isometrikUserId: '66f25d1e7f7559003723c7d1' // rounit
17
+ isometrikUserId: '66f25d1e7f7559003723c7d1'
18
18
  };
19
19
 
20
20
  export const MQTT_CREDS = {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Demo customParts CEs for ?demoCustomUi=1 — Rounit-style props showcase.
2
+ * Demo customParts CEs for ?demoCustomUi=1 — props + callbacks showcase.
3
3
  * Property setters call render() so Stencil/Lit prop updates re-paint.
4
4
  */
5
5
  export function registerCustomUiDemoElements() {
@@ -159,7 +159,7 @@ export function buildDemoEmptySlot() {
159
159
  el.slot = 'empty';
160
160
  el.style.cssText =
161
161
  'height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;background:var(--bg-secondary-color);color:var(--text-primary-color);padding:24px;text-align:center';
162
- el.innerHTML = `<strong>Custom empty slot (layout-only)</strong><span style="opacity:.75">Rounit-first: tiles/bubbles use customParts props. Slots = panels.</span>`;
162
+ el.innerHTML = `<strong>Custom empty slot (layout-only)</strong><span style="opacity:.75">Tiles/bubbles use customParts props. Slots = panels.</span>`;
163
163
  return el;
164
164
  }
165
165
  /** Log public events so hosts can see the fully-functional data bus. */
@@ -1 +1 @@
1
- {"version":3,"file":"custom-ui-demo-elements.js","sourceRoot":"","sources":["../../src/demos/custom-ui-demo-elements.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,4BAA4B;IAC1C,IAAI,OAAO,cAAc,KAAK,WAAW;QAAE,OAAO;IAElD,MAAM,mBAAmB,GAAG,CAAC,KAAU,EAAE,IAAc,EAAE,EAAE;QACzD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACjB,MAAM,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;YACxB,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE;gBAChC,GAAG;oBACD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;gBACrB,CAAC;gBACD,GAAG,CAAC,KAAK;oBACP,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK;wBAAE,OAAO;oBAClC,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;oBACpB,IAAI,IAAI,CAAC,WAAW,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,UAAU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,iBAAiB,CAAC,SAAS,EAAE;YAC/C,SAAS;YACT,QAAQ;YACR,QAAQ;YACR,cAAc;YACd,qBAAqB;YACrB,gBAAgB;SACjB,CAAC,CAAC;QACH,cAAc,CAAC,MAAM,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,CAAC;IAClE,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACzC,EAAE,CAAC,IAAI,GAAG,OAAO,CAAC;IAClB,EAAE,CAAC,KAAK,CAAC,OAAO;QACd,sMAAsM,CAAC;IACzM,EAAE,CAAC,SAAS,GAAG,qJAAqJ,CAAC;IACrK,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,0BAA0B,CAAC,IAAiB;IAC1D,MAAM,GAAG,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,CAAQ,EAAE,EAAE;QACzC,MAAM,MAAM,GAAI,CAAiB,CAAC,MAAM,CAAC;QACzC,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,GAAG,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC,CAAC;IACF,CAAC,WAAW,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,OAAO,CAC9G,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAC/C,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Demo customParts CEs for ?demoCustomUi=1 — Rounit-style props showcase.\n * Property setters call render() so Stencil/Lit prop updates re-paint.\n */\nexport function registerCustomUiDemoElements() {\n if (typeof customElements === 'undefined') return;\n\n const defineReactiveProps = (proto: any, keys: string[]) => {\n keys.forEach(key => {\n const store = `_${key}`;\n Object.defineProperty(proto, key, {\n get() {\n return this[store];\n },\n set(value) {\n if (this[store] === value) return;\n this[store] = value;\n if (this.isConnected && typeof this.render === 'function') this.render();\n },\n configurable: true,\n });\n });\n };\n\n if (!customElements.get('demo-chat-tile')) {\n class DemoChatTile extends HTMLElement {\n onSelect: (conversationId: string) => void;\n\n connectedCallback() {\n this.render();\n this.onclick = () => {\n const c = (this as any).conversation || {};\n const id = c.conversationId || c.groupcastId;\n if (typeof this.onSelect === 'function' && id) this.onSelect(id);\n };\n }\n\n render() {\n const c = (this as any).conversation || {};\n const meta = c.metaData || {};\n const title = c.isGroup\n ? c.conversationTitle\n : c.groupcastTitle ||\n c.opponentDetails?.userName ||\n c.lastMessageDetails?.userName ||\n 'Chat';\n const preview = (this as any).previewText || c.lastMessageDetails?.body || c.lastMessageDetails?.customType || '';\n const unread = (this as any).unreadCount || c.unreadMessagesCount || '';\n const isSelected = !!(this as any).isSelected;\n const isTyping = !!(this as any).isTyping;\n const typingUserName = (this as any).typingUserName;\n\n this.style.display = 'block';\n this.style.padding = '12px 14px';\n this.style.margin = '4px 8px';\n this.style.borderRadius = '10px';\n this.style.cursor = 'pointer';\n this.style.border = isSelected\n ? '2px solid var(--bg-primary-light)'\n : '1px solid var(--bg-secondary-color)';\n this.style.background = isSelected\n ? 'var(--bg-primary-light)'\n : 'var(--bg-primary-color)';\n\n this.innerHTML = `\n <div style=\"display:flex;justify-content:space-between;gap:8px;align-items:flex-start\">\n <div>\n <div style=\"font-weight:600;color:var(--text-primary-color)\">${title || 'Untitled'}</div>\n ${meta.orderId ? `<div style=\"font-size:11px;color:var(--text-info-color);margin-top:2px\">Order #${meta.orderId}</div>` : ''}\n <div style=\"font-size:12px;color:var(--text-tertiary-color);margin-top:4px\">\n ${isTyping ? `typing${typingUserName ? `: ${typingUserName}` : '…'}` : `[demo tile] ${preview || 'No messages'}`}\n </div>\n </div>\n ${unread ? `<span style=\"background:var(--bg-primary-light);border-radius:999px;padding:2px 8px;font-size:11px\">${unread}</span>` : ''}\n </div>`;\n }\n }\n defineReactiveProps(DemoChatTile.prototype, [\n 'conversation',\n 'isSelected',\n 'userMetaData',\n 'unreadCount',\n 'previewText',\n 'isTyping',\n 'typingUserName',\n ]);\n customElements.define('demo-chat-tile', DemoChatTile);\n }\n\n if (!customElements.get('demo-message-bubble')) {\n class DemoMessageBubble extends HTMLElement {\n onTap: (message: any) => void;\n onReply: (message: any) => void;\n onForward: (message: any) => void;\n onDelete: (message: any) => void;\n onInfo: (message: any) => void;\n\n connectedCallback() {\n this.render();\n }\n\n render() {\n const m = (this as any).message || {};\n const meta = m.metaData || {};\n const isSelf = !!(this as any).isSelf;\n const status = (this as any).status || 'sent';\n const align = isSelf ? 'flex-end' : 'flex-start';\n const bg = isSelf ? 'var(--bg-outgoing-message)' : 'var(--bg-incoming-message)';\n this.style.display = 'flex';\n this.style.justifyContent = align;\n this.style.width = '100%';\n this.style.margin = '6px 0';\n\n this.innerHTML = `\n <div class=\"demo-bubble\" style=\"max-width:75%;padding:10px 12px;border-radius:12px;background:${bg};color:var(--text-primary-color)\">\n <div style=\"font-size:11px;opacity:.7;margin-bottom:4px\">demo · ${status}${meta.orderId ? ` · #${meta.orderId}` : ''}</div>\n <div style=\"cursor:pointer\" data-action=\"tap\">${m.body || m.customType || '[media/system]'}</div>\n <div style=\"margin-top:6px;display:flex;gap:8px;flex-wrap:wrap\">\n <button type=\"button\" data-action=\"reply\" style=\"font-size:11px;border:none;background:transparent;color:inherit;text-decoration:underline;cursor:pointer\">Reply</button>\n <button type=\"button\" data-action=\"forward\" style=\"font-size:11px;border:none;background:transparent;color:inherit;text-decoration:underline;cursor:pointer\">Forward</button>\n <button type=\"button\" data-action=\"delete\" style=\"font-size:11px;border:none;background:transparent;color:inherit;text-decoration:underline;cursor:pointer\">Delete</button>\n ${isSelf ? `<button type=\"button\" data-action=\"info\" style=\"font-size:11px;border:none;background:transparent;color:inherit;text-decoration:underline;cursor:pointer\">Info</button>` : ''}\n </div>\n </div>`;\n\n this.querySelector('.demo-bubble')?.addEventListener('click', (e: Event) => {\n const t = e.target as HTMLElement;\n const action = t?.dataset?.action;\n const msg = (this as any).message;\n if (action === 'reply') {\n e.stopPropagation();\n this.onReply?.(msg);\n return;\n }\n if (action === 'forward') {\n e.stopPropagation();\n this.onForward?.(msg);\n return;\n }\n if (action === 'delete') {\n e.stopPropagation();\n this.onDelete?.(msg);\n return;\n }\n if (action === 'info') {\n e.stopPropagation();\n this.onInfo?.(msg);\n return;\n }\n if (action === 'tap' || t?.classList?.contains('demo-bubble')) {\n this.onTap?.(msg);\n }\n });\n }\n }\n defineReactiveProps(DemoMessageBubble.prototype, [\n 'message',\n 'isSelf',\n 'status',\n 'userMetaData',\n 'conversationDetails',\n 'allAttachments',\n ]);\n customElements.define('demo-message-bubble', DemoMessageBubble);\n }\n}\n\nexport function buildDemoEmptySlot(): HTMLElement {\n const el = document.createElement('div');\n el.slot = 'empty';\n el.style.cssText =\n 'height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;background:var(--bg-secondary-color);color:var(--text-primary-color);padding:24px;text-align:center';\n el.innerHTML = `<strong>Custom empty slot (layout-only)</strong><span style=\"opacity:.75\">Rounit-first: tiles/bubbles use customParts props. Slots = panels.</span>`;\n return el;\n}\n\n/** Log public events so hosts can see the fully-functional data bus. */\nexport function attachCustomUiDemoEventLog(chat: HTMLElement) {\n const log = (name: string) => (e: Event) => {\n const detail = (e as CustomEvent).detail;\n // eslint-disable-next-line no-console\n console.log(`[web-chat:${name}]`, detail);\n };\n ['chatReady', 'conversationsChange', 'messagesChange', 'conversationSelect', 'replyChange', 'chatError'].forEach(\n name => chat.addEventListener(name, log(name)),\n );\n}\n"]}
1
+ {"version":3,"file":"custom-ui-demo-elements.js","sourceRoot":"","sources":["../../src/demos/custom-ui-demo-elements.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,4BAA4B;IAC1C,IAAI,OAAO,cAAc,KAAK,WAAW;QAAE,OAAO;IAElD,MAAM,mBAAmB,GAAG,CA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,CAAC,WAAW,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,OAAO,CAC9G,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAC/C,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Demo customParts CEs for ?demoCustomUi=1 — props + callbacks showcase.\n * Property setters call render() so Stencil/Lit prop updates re-paint.\n */\nexport function registerCustomUiDemoElements() {\n if (typeof customElements === 'undefined') return;\n\n const defineReactiveProps = (proto: any, keys: string[]) => {\n keys.forEach(key => {\n const store = `_${key}`;\n Object.defineProperty(proto, key, {\n get() {\n return this[store];\n },\n set(value) {\n if (this[store] === value) return;\n this[store] = value;\n if (this.isConnected && typeof this.render === 'function') this.render();\n },\n configurable: true,\n });\n });\n };\n\n if (!customElements.get('demo-chat-tile')) {\n class DemoChatTile extends HTMLElement {\n onSelect: (conversationId: string) => void;\n\n connectedCallback() {\n this.render();\n this.onclick = () => {\n const c = (this as any).conversation || {};\n const id = c.conversationId || c.groupcastId;\n if (typeof this.onSelect === 'function' && id) this.onSelect(id);\n };\n }\n\n render() {\n const c = (this as any).conversation || {};\n const meta = c.metaData || {};\n const title = c.isGroup\n ? c.conversationTitle\n : c.groupcastTitle ||\n c.opponentDetails?.userName ||\n c.lastMessageDetails?.userName ||\n 'Chat';\n const preview = (this as any).previewText || c.lastMessageDetails?.body || c.lastMessageDetails?.customType || '';\n const unread = (this as any).unreadCount || c.unreadMessagesCount || '';\n const isSelected = !!(this as any).isSelected;\n const isTyping = !!(this as any).isTyping;\n const typingUserName = (this as any).typingUserName;\n\n this.style.display = 'block';\n this.style.padding = '12px 14px';\n this.style.margin = '4px 8px';\n this.style.borderRadius = '10px';\n this.style.cursor = 'pointer';\n this.style.border = isSelected\n ? '2px solid var(--bg-primary-light)'\n : '1px solid var(--bg-secondary-color)';\n this.style.background = isSelected\n ? 'var(--bg-primary-light)'\n : 'var(--bg-primary-color)';\n\n this.innerHTML = `\n <div style=\"display:flex;justify-content:space-between;gap:8px;align-items:flex-start\">\n <div>\n <div style=\"font-weight:600;color:var(--text-primary-color)\">${title || 'Untitled'}</div>\n ${meta.orderId ? `<div style=\"font-size:11px;color:var(--text-info-color);margin-top:2px\">Order #${meta.orderId}</div>` : ''}\n <div style=\"font-size:12px;color:var(--text-tertiary-color);margin-top:4px\">\n ${isTyping ? `typing${typingUserName ? `: ${typingUserName}` : '…'}` : `[demo tile] ${preview || 'No messages'}`}\n </div>\n </div>\n ${unread ? `<span style=\"background:var(--bg-primary-light);border-radius:999px;padding:2px 8px;font-size:11px\">${unread}</span>` : ''}\n </div>`;\n }\n }\n defineReactiveProps(DemoChatTile.prototype, [\n 'conversation',\n 'isSelected',\n 'userMetaData',\n 'unreadCount',\n 'previewText',\n 'isTyping',\n 'typingUserName',\n ]);\n customElements.define('demo-chat-tile', DemoChatTile);\n }\n\n if (!customElements.get('demo-message-bubble')) {\n class DemoMessageBubble extends HTMLElement {\n onTap: (message: any) => void;\n onReply: (message: any) => void;\n onForward: (message: any) => void;\n onDelete: (message: any) => void;\n onInfo: (message: any) => void;\n\n connectedCallback() {\n this.render();\n }\n\n render() {\n const m = (this as any).message || {};\n const meta = m.metaData || {};\n const isSelf = !!(this as any).isSelf;\n const status = (this as any).status || 'sent';\n const align = isSelf ? 'flex-end' : 'flex-start';\n const bg = isSelf ? 'var(--bg-outgoing-message)' : 'var(--bg-incoming-message)';\n this.style.display = 'flex';\n this.style.justifyContent = align;\n this.style.width = '100%';\n this.style.margin = '6px 0';\n\n this.innerHTML = `\n <div class=\"demo-bubble\" style=\"max-width:75%;padding:10px 12px;border-radius:12px;background:${bg};color:var(--text-primary-color)\">\n <div style=\"font-size:11px;opacity:.7;margin-bottom:4px\">demo · ${status}${meta.orderId ? ` · #${meta.orderId}` : ''}</div>\n <div style=\"cursor:pointer\" data-action=\"tap\">${m.body || m.customType || '[media/system]'}</div>\n <div style=\"margin-top:6px;display:flex;gap:8px;flex-wrap:wrap\">\n <button type=\"button\" data-action=\"reply\" style=\"font-size:11px;border:none;background:transparent;color:inherit;text-decoration:underline;cursor:pointer\">Reply</button>\n <button type=\"button\" data-action=\"forward\" style=\"font-size:11px;border:none;background:transparent;color:inherit;text-decoration:underline;cursor:pointer\">Forward</button>\n <button type=\"button\" data-action=\"delete\" style=\"font-size:11px;border:none;background:transparent;color:inherit;text-decoration:underline;cursor:pointer\">Delete</button>\n ${isSelf ? `<button type=\"button\" data-action=\"info\" style=\"font-size:11px;border:none;background:transparent;color:inherit;text-decoration:underline;cursor:pointer\">Info</button>` : ''}\n </div>\n </div>`;\n\n this.querySelector('.demo-bubble')?.addEventListener('click', (e: Event) => {\n const t = e.target as HTMLElement;\n const action = t?.dataset?.action;\n const msg = (this as any).message;\n if (action === 'reply') {\n e.stopPropagation();\n this.onReply?.(msg);\n return;\n }\n if (action === 'forward') {\n e.stopPropagation();\n this.onForward?.(msg);\n return;\n }\n if (action === 'delete') {\n e.stopPropagation();\n this.onDelete?.(msg);\n return;\n }\n if (action === 'info') {\n e.stopPropagation();\n this.onInfo?.(msg);\n return;\n }\n if (action === 'tap' || t?.classList?.contains('demo-bubble')) {\n this.onTap?.(msg);\n }\n });\n }\n }\n defineReactiveProps(DemoMessageBubble.prototype, [\n 'message',\n 'isSelf',\n 'status',\n 'userMetaData',\n 'conversationDetails',\n 'allAttachments',\n ]);\n customElements.define('demo-message-bubble', DemoMessageBubble);\n }\n}\n\nexport function buildDemoEmptySlot(): HTMLElement {\n const el = document.createElement('div');\n el.slot = 'empty';\n el.style.cssText =\n 'height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;background:var(--bg-secondary-color);color:var(--text-primary-color);padding:24px;text-align:center';\n el.innerHTML = `<strong>Custom empty slot (layout-only)</strong><span style=\"opacity:.75\">Tiles/bubbles use customParts props. Slots = panels.</span>`;\n return el;\n}\n\n/** Log public events so hosts can see the fully-functional data bus. */\nexport function attachCustomUiDemoEventLog(chat: HTMLElement) {\n const log = (name: string) => (e: Event) => {\n const detail = (e as CustomEvent).detail;\n // eslint-disable-next-line no-console\n console.log(`[web-chat:${name}]`, detail);\n };\n ['chatReady', 'conversationsChange', 'messagesChange', 'conversationSelect', 'replyChange', 'chatError'].forEach(\n name => chat.addEventListener(name, log(name)),\n );\n}\n"]}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Expose public SDK helpers on window for www demos / script-tag hosts.
3
+ * Bundlers should prefer named ESM imports from the package entry.
4
+ */
5
+ import { initializeIsometrikWebchat, destroyIsometrikWebchat, ensureIsometrikWebchat, retainIsometrikWebchat, releaseIsometrikWebchat, mountReactInSlot, defineReactCustomPart, unmountReactSlot, createWebChatApi, isometrikWebchatApi, THEME_TOKEN_NAMES, switchChatTheme, applyCustomTheme, toggleTheme, resolveThemeProvider, resolveWebChat, } from "../sdk";
6
+ export default function () {
7
+ if (typeof window === 'undefined')
8
+ return;
9
+ const w = window;
10
+ w.initializeIsometrikWebchat = initializeIsometrikWebchat;
11
+ w.destroyIsometrikWebchat = destroyIsometrikWebchat;
12
+ w.ensureIsometrikWebchat = ensureIsometrikWebchat;
13
+ w.retainIsometrikWebchat = retainIsometrikWebchat;
14
+ w.releaseIsometrikWebchat = releaseIsometrikWebchat;
15
+ w.initializeChat = initializeIsometrikWebchat;
16
+ w.destroyChat = destroyIsometrikWebchat;
17
+ w.isometrikWebchatApi = isometrikWebchatApi;
18
+ w.createWebChatApi = createWebChatApi;
19
+ w.THEME_TOKEN_NAMES = THEME_TOKEN_NAMES;
20
+ w.mountReactInSlot = mountReactInSlot;
21
+ w.defineReactCustomPart = defineReactCustomPart;
22
+ w.unmountReactSlot = unmountReactSlot;
23
+ w.switchChatTheme = switchChatTheme;
24
+ w.applyCustomTheme = applyCustomTheme;
25
+ w.toggleTheme = toggleTheme;
26
+ w.resolveThemeProvider = resolveThemeProvider;
27
+ w.resolveWebChat = resolveWebChat;
28
+ }
29
+ //# sourceMappingURL=expose-sdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expose-sdk.js","sourceRoot":"","sources":["../../src/global/expose-sdk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,cAAc,GACf,MAAM,QAAQ,CAAC;AAEhB,MAAM,CAAC,OAAO;IACZ,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO;IAC1C,MAAM,CAAC,GAAG,MAAa,CAAC;IACxB,CAAC,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;IAC1D,CAAC,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;IACpD,CAAC,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;IAClD,CAAC,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;IAClD,CAAC,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;IACpD,CAAC,CAAC,cAAc,GAAG,0BAA0B,CAAC;IAC9C,CAAC,CAAC,WAAW,GAAG,uBAAuB,CAAC;IACxC,CAAC,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IAC5C,CAAC,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IACtC,CAAC,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IACxC,CAAC,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IACtC,CAAC,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;IAChD,CAAC,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IACtC,CAAC,CAAC,eAAe,GAAG,eAAe,CAAC;IACpC,CAAC,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IACtC,CAAC,CAAC,WAAW,GAAG,WAAW,CAAC;IAC5B,CAAC,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;IAC9C,CAAC,CAAC,cAAc,GAAG,cAAc,CAAC;AACpC,CAAC","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"]}
@@ -1,147 +1,16 @@
1
- import { destroyChatDom } from "./lib/destroy-chat";
2
1
  export { WEB_CHAT_SLOTS, WEB_CHAT_PUBLIC_EVENTS, WEB_CHAT_PUBLIC_METHODS, deriveMessageStatus, findWebChatHost, applyCustomPartProps, defineReactiveCustomPart, } from './lib/custom-ui';
3
2
  export { format } from './utils/utils';
4
- function attachWebChatSlots(chatComponent, slots) {
5
- if (!slots)
6
- return;
7
- Object.entries(slots).forEach(([name, el]) => {
8
- if (!el)
9
- return;
10
- el.slot = name;
11
- chatComponent.appendChild(el);
12
- });
13
- }
14
- function getStoredComponents() {
15
- if (typeof window === 'undefined')
16
- return {};
17
- window.__isometrikChatComponents = window.__isometrikChatComponents || {};
18
- return window.__isometrikChatComponents;
19
- }
20
- /** Tear down existing chat instance (MQTT via disconnectedCallback, DOM). */
21
- export const destroyChat = function () {
22
- destroyChatDom();
23
- document.querySelectorAll('theme-provider').forEach(el => {
24
- if (!el.querySelector('web-chat') && el.childNodes.length === 0) {
25
- el.remove();
26
- }
27
- });
28
- };
29
- export const initializeChat = function (props) {
30
- if (!props.licenseKey ||
31
- !props.appSecret ||
32
- !props.userSecret ||
33
- !props.userToken ||
34
- !props.isometrikUserId ||
35
- !props.projectId ||
36
- !props.keysetId ||
37
- !props.accountId) {
38
- console.error('Missing required props to Initialize chat!');
39
- return null;
40
- }
41
- // Idempotent: destroy previous instance before creating a new one
42
- destroyChat();
43
- const themeProvider = document.createElement('theme-provider');
44
- if (props.defaultTheme) {
45
- themeProvider.setAttribute('mode', props.defaultTheme);
46
- }
47
- if (props.themeUrl) {
48
- themeProvider.setAttribute('theme-path', props.themeUrl);
49
- }
50
- else {
51
- themeProvider.setAttribute('theme-path', 'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css');
52
- }
53
- const chatComponent = document.createElement('web-chat');
54
- chatComponent.baseUrl = (props === null || props === void 0 ? void 0 : props.baseUrl) || 'https://apis.isometrik.io';
55
- chatComponent.hostUrl = (props === null || props === void 0 ? void 0 : props.hostUrl) || 'wss://connections.isometrik.io:2053/mqtt';
56
- chatComponent.licenseKey = props.licenseKey;
57
- chatComponent.appSecret = props.appSecret;
58
- chatComponent.userSecret = props.userSecret;
59
- chatComponent.userToken = props.userToken;
60
- chatComponent.isometrikUserId = props.isometrikUserId;
61
- chatComponent.projectId = props.projectId;
62
- chatComponent.keysetId = props.keysetId;
63
- chatComponent.accountId = props.accountId;
64
- chatComponent.defaultTheme = props.defaultTheme || 'light';
65
- chatComponent.themeUrl =
66
- props.themeUrl ||
67
- 'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css';
68
- chatComponent.style.width = '100%';
69
- chatComponent.style.height = '100%';
70
- if (props.customParts) {
71
- chatComponent.customParts = props.customParts;
72
- }
73
- if (props.showProfileRail !== undefined) {
74
- chatComponent.showProfileRail = props.showProfileRail;
75
- }
76
- if (props.showChatWallpaper !== undefined) {
77
- chatComponent.showChatWallpaper = props.showChatWallpaper;
78
- }
79
- if (props.groupcastEnabled !== undefined) {
80
- chatComponent.groupcastEnabled = props.groupcastEnabled;
81
- }
82
- attachWebChatSlots(chatComponent, props.slots);
83
- themeProvider.appendChild(chatComponent);
84
- themeProvider.style.width = '100%';
85
- themeProvider.style.height = '100%';
86
- themeProvider.style.display = 'block';
87
- const container = props.containerId ? document.getElementById(props.containerId) : document.body;
88
- if (container) {
89
- container.appendChild(themeProvider);
90
- }
91
- else {
92
- console.error('Container with the specified ID not found. Appending to body instead.');
93
- document.body.appendChild(themeProvider);
94
- }
95
- const stored = getStoredComponents();
96
- stored.themeProvider = themeProvider;
97
- stored.chatComponent = chatComponent;
98
- return { themeProvider, chatComponent, destroy: destroyChat };
99
- };
100
- export const customChatSidebar = function (props) {
101
- const chatComponent = document.querySelector('web-chat');
102
- if (!chatComponent) {
103
- console.error('Isometrik chat is not initialized');
104
- return;
105
- }
106
- if (props.isChatFilter !== undefined) {
107
- chatComponent.isChatFilter = props.isChatFilter;
108
- }
109
- };
110
- export const switchChatTheme = function (theme) {
111
- const chatElements = document.getElementsByTagName('web-chat');
112
- for (let i = 0; i < chatElements.length; i++) {
113
- const chatWeb = chatElements[i];
114
- chatWeb.defaultTheme = theme;
115
- const themeProvider = getStoredComponents().themeProvider;
116
- if (themeProvider) {
117
- themeProvider.setAttribute('mode', theme);
118
- }
119
- }
120
- };
121
- export const applyCustomTheme = function (customTheme) {
122
- const themeProvider = document.querySelector('theme-provider');
123
- if (!themeProvider) {
124
- console.error('Theme provider is not initialized');
125
- return;
126
- }
127
- if (customTheme.themePath) {
128
- themeProvider.setAttribute('theme-path', customTheme.themePath);
129
- }
130
- if (customTheme.themeObject) {
131
- themeProvider.themeObject = customTheme.themeObject;
132
- }
133
- };
134
- export const toggleTheme = function () {
135
- const themeProvider = document.querySelector('theme-provider');
136
- if (!themeProvider) {
137
- console.error('Theme provider is not initialized');
138
- return;
139
- }
140
- themeProvider.toggleTheme();
141
- };
3
+ export { initializeIsometrikWebchat, destroyIsometrikWebchat, ensureIsometrikWebchat, retainIsometrikWebchat, releaseIsometrikWebchat, buildWebchatSessionKey, initializeChat, destroyChat, THEME_TOKEN_NAMES, normalizeThemeObject, applyThemeObjectToElement, resolveRegionMode, resolveProfileRailMode, resolveShowProfileRailProp, createWebChatApi, isometrikWebchatApi, setWebChatSlot, clearWebChatSlot, createSlotHost, setWebChatSlots, defineReactCustomPart, mountReactInSlot, unmountReactSlot, resolveThemeProvider, resolveWebChat, getChatStore, getOfflineClient, mergeMessagesById, isBrowserOnline, canUseIndexedDb, } from './sdk';
4
+ export { customChatSidebar, switchChatTheme, applyCustomTheme, toggleTheme, } from './sdk/runtime-controls';
5
+ import { initializeIsometrikWebchat, destroyIsometrikWebchat, } from "./sdk";
6
+ import { isometrikWebchatApi } from "./sdk/headless-api";
7
+ import { customChatSidebar, switchChatTheme, applyCustomTheme, toggleTheme, } from "./sdk/runtime-controls";
142
8
  if (typeof window !== 'undefined') {
143
- window.initializeChat = initializeChat;
144
- window.destroyChat = destroyChat;
9
+ window.initializeIsometrikWebchat = initializeIsometrikWebchat;
10
+ window.destroyIsometrikWebchat = destroyIsometrikWebchat;
11
+ window.initializeChat = initializeIsometrikWebchat;
12
+ window.destroyChat = destroyIsometrikWebchat;
13
+ window.isometrikWebchatApi = isometrikWebchatApi;
145
14
  window.chatSidebarProps = customChatSidebar;
146
15
  window.switchChatTheme = switchChatTheme;
147
16
  window.applyCustomTheme = applyCustomTheme;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAyBpD,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAmCvC,SAAS,kBAAkB,CACzB,aAA0B,EAC1B,KAAqD;IAErD,IAAI,CAAC,KAAK;QAAE,OAAO;IAClB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAkD,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE;QAC7F,IAAI,CAAC,EAAE;YAAE,OAAO;QAChB,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC;QACf,aAAa,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,mBAAmB;IAC1B,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,EAAE,CAAC;IAC5C,MAAc,CAAC,yBAAyB,GAAI,MAAc,CAAC,yBAAyB,IAAI,EAAE,CAAC;IAC5F,OAAQ,MAAc,CAAC,yBAAyB,CAAC;AACnD,CAAC;AAED,6EAA6E;AAC7E,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,cAAc,EAAE,CAAC;IACjB,QAAQ,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;QACvD,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC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,CAAC;IACjC,MAAc,CAAC,cAAc,GAAG,cAAc,CAAC;IAC/C,MAAc,CAAC,WAAW,GAAG,WAAW,CAAC;IACzC,MAAc,CAAC,gBAAgB,GAAG,iBAAiB,CAAC;IACpD,MAAc,CAAC,eAAe,GAAG,eAAe,CAAC;IACjD,MAAc,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IACnD,MAAc,CAAC,WAAW,GAAG,WAAW,CAAC;AAC5C,CAAC","sourcesContent":["import { destroyChatDom } from './lib/destroy-chat';\nimport type { WebChatSlotName, WebChatCustomParts } from './lib/custom-ui';\nexport type { WebChatSlotName, WebChatCustomParts } from './lib/custom-ui';\nexport type {\n ChatReadyDetail,\n ConversationsChangeDetail,\n MessagesChangeDetail,\n SelectionChangeDetail,\n ReplyChangeDetail,\n ChatErrorDetail,\n WebChatPublicEvent,\n WebChatPublicMethod,\n MessageDeliveryStatus,\n MessageBubbleProps,\n ChatTileProps,\n GroupcastTileProps,\n MessageDatePillProps,\n SearchResultProps,\n MemberRowProps,\n OverlayDialogProps,\n MediaGalleryProps,\n ContextMenuProps,\n BlockListProps,\n ToastPartProps,\n} from './lib/custom-ui';\nexport {\n WEB_CHAT_SLOTS,\n WEB_CHAT_PUBLIC_EVENTS,\n WEB_CHAT_PUBLIC_METHODS,\n deriveMessageStatus,\n findWebChatHost,\n applyCustomPartProps,\n defineReactiveCustomPart,\n} from './lib/custom-ui';\nexport { format } from './utils/utils';\n/**\n * Stencil-generated component types (full catalog).\n * Prefer the explicit custom-ui / InitializeChatProps exports above for host apps.\n * Lazy loader: `isometrik-webchat/loader`\n * Custom elements: `dist/components/` (dist-custom-elements output)\n */\nexport type * from './components.d.ts';\n\nexport type InitializeChatProps = {\n baseUrl?: string;\n hostUrl?: string;\n licenseKey: string;\n appSecret: string;\n userSecret: string;\n userToken: string;\n isometrikUserId: string;\n projectId: string;\n keysetId: string;\n accountId: string;\n defaultTheme?: 'dark' | 'light';\n themeUrl?: string;\n containerId?: string;\n /** Optional custom UI nodes — each gets `slot=\"<name>\"` and is appended to <web-chat>. */\n slots?: Partial<Record<WebChatSlotName, HTMLElement>>;\n /** Custom element tags for list rows / dialogs. See WebChatCustomParts. */\n customParts?: WebChatCustomParts;\n /** When false, hide the left profile icon rail. Default true. */\n showProfileRail?: boolean;\n /** When false, no doodle wallpaper behind messages. Default true. */\n showChatWallpaper?: boolean;\n /** When false, hide groupcast entry points. Default true. */\n groupcastEnabled?: boolean;\n};\n\nfunction attachWebChatSlots(\n chatComponent: HTMLElement,\n slots?: Partial<Record<WebChatSlotName, HTMLElement>>,\n) {\n if (!slots) return;\n (Object.entries(slots) as [WebChatSlotName, HTMLElement | undefined][]).forEach(([name, el]) => {\n if (!el) return;\n el.slot = name;\n chatComponent.appendChild(el);\n });\n}\n\nfunction getStoredComponents(): { themeProvider?: HTMLElement; chatComponent?: any } {\n if (typeof window === 'undefined') return {};\n (window as any).__isometrikChatComponents = (window as any).__isometrikChatComponents || {};\n return (window as any).__isometrikChatComponents;\n}\n\n/** Tear down existing chat instance (MQTT via disconnectedCallback, DOM). */\nexport const destroyChat = function () {\n destroyChatDom();\n document.querySelectorAll('theme-provider').forEach(el => {\n if (!el.querySelector('web-chat') && el.childNodes.length === 0) {\n el.remove();\n }\n });\n};\n\nexport const initializeChat = function (props: InitializeChatProps) {\n if (\n !props.licenseKey ||\n !props.appSecret ||\n !props.userSecret ||\n !props.userToken ||\n !props.isometrikUserId ||\n !props.projectId ||\n !props.keysetId ||\n !props.accountId\n ) {\n console.error('Missing required props to Initialize chat!');\n return null;\n }\n\n // Idempotent: destroy previous instance before creating a new one\n destroyChat();\n\n const themeProvider = document.createElement('theme-provider');\n\n if (props.defaultTheme) {\n themeProvider.setAttribute('mode', props.defaultTheme);\n }\n\n if (props.themeUrl) {\n themeProvider.setAttribute('theme-path', props.themeUrl);\n } else {\n themeProvider.setAttribute(\n 'theme-path',\n 'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css',\n );\n }\n\n const chatComponent = document.createElement('web-chat') as any;\n\n chatComponent.baseUrl = props?.baseUrl || 'https://apis.isometrik.io';\n chatComponent.hostUrl = props?.hostUrl || 'wss://connections.isometrik.io:2053/mqtt';\n chatComponent.licenseKey = props.licenseKey;\n chatComponent.appSecret = props.appSecret;\n chatComponent.userSecret = props.userSecret;\n chatComponent.userToken = props.userToken;\n chatComponent.isometrikUserId = props.isometrikUserId;\n chatComponent.projectId = props.projectId;\n chatComponent.keysetId = props.keysetId;\n chatComponent.accountId = props.accountId;\n chatComponent.defaultTheme = props.defaultTheme || 'light';\n chatComponent.themeUrl =\n props.themeUrl ||\n 'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css';\n\n chatComponent.style.width = '100%';\n chatComponent.style.height = '100%';\n\n if (props.customParts) {\n chatComponent.customParts = props.customParts;\n }\n\n if (props.showProfileRail !== undefined) {\n chatComponent.showProfileRail = props.showProfileRail;\n }\n\n if (props.showChatWallpaper !== undefined) {\n chatComponent.showChatWallpaper = props.showChatWallpaper;\n }\n\n if (props.groupcastEnabled !== undefined) {\n chatComponent.groupcastEnabled = props.groupcastEnabled;\n }\n\n attachWebChatSlots(chatComponent, props.slots);\n\n themeProvider.appendChild(chatComponent);\n themeProvider.style.width = '100%';\n themeProvider.style.height = '100%';\n themeProvider.style.display = 'block';\n\n const container = props.containerId ? document.getElementById(props.containerId) : document.body;\n if (container) {\n container.appendChild(themeProvider);\n } else {\n console.error('Container with the specified ID not found. Appending to body instead.');\n document.body.appendChild(themeProvider);\n }\n\n const stored = getStoredComponents();\n stored.themeProvider = themeProvider;\n stored.chatComponent = chatComponent;\n\n return { themeProvider, chatComponent, destroy: destroyChat };\n};\n\nexport const customChatSidebar = function (props: { isChatFilter?: boolean }) {\n const chatComponent = document.querySelector('web-chat') as any;\n if (!chatComponent) {\n console.error('Isometrik chat is not initialized');\n return;\n }\n\n if (props.isChatFilter !== undefined) {\n chatComponent.isChatFilter = props.isChatFilter;\n }\n};\n\nexport const switchChatTheme = function (theme: 'dark' | 'light') {\n const chatElements = document.getElementsByTagName('web-chat');\n\n for (let i = 0; i < chatElements.length; i++) {\n const chatWeb = chatElements[i] as any;\n chatWeb.defaultTheme = theme;\n\n const themeProvider = getStoredComponents().themeProvider;\n if (themeProvider) {\n themeProvider.setAttribute('mode', theme);\n }\n }\n};\n\nexport const applyCustomTheme = function (customTheme: {\n themePath?: string;\n themeObject?: { [key: string]: string };\n}) {\n const themeProvider = document.querySelector('theme-provider') as any;\n if (!themeProvider) {\n console.error('Theme provider is not initialized');\n return;\n }\n\n if (customTheme.themePath) {\n themeProvider.setAttribute('theme-path', customTheme.themePath);\n }\n\n if (customTheme.themeObject) {\n themeProvider.themeObject = customTheme.themeObject;\n }\n};\n\nexport const toggleTheme = function () {\n const themeProvider = document.querySelector('theme-provider') as any;\n if (!themeProvider) {\n console.error('Theme provider is not initialized');\n return;\n }\n\n themeProvider.toggleTheme();\n};\n\nif (typeof window !== 'undefined') {\n (window as any).initializeChat = initializeChat;\n (window as any).destroyChat = destroyChat;\n (window as any).chatSidebarProps = customChatSidebar;\n (window as any).switchChatTheme = switchChatTheme;\n (window as any).applyCustomTheme = applyCustomTheme;\n (window as any).toggleTheme = toggleTheme;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,EACjB,sBAAsB,EACtB,0BAA0B,EAC1B,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,eAAe,GAChB,MAAM,OAAO,CAAC;AAgBf,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAUhC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IACjC,MAAc,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;IACvE,MAAc,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;IACjE,MAAc,CAAC,cAAc,GAAG,0BAA0B,CAAC;IAC3D,MAAc,CAAC,WAAW,GAAG,uBAAuB,CAAC;IACrD,MAAc,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IACzD,MAAc,CAAC,gBAAgB,GAAG,iBAAiB,CAAC;IACpD,MAAc,CAAC,eAAe,GAAG,eAAe,CAAC;IACjD,MAAc,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IACnD,MAAc,CAAC,WAAW,GAAG,WAAW,CAAC;AAC5C,CAAC","sourcesContent":["export type { WebChatSlotName, WebChatCustomParts } from './lib/custom-ui';\nexport type {\n ChatReadyDetail,\n ConversationsChangeDetail,\n MessagesChangeDetail,\n SelectionChangeDetail,\n ReplyChangeDetail,\n ChatErrorDetail,\n WebChatPublicEvent,\n WebChatPublicMethod,\n MessageDeliveryStatus,\n MessageBubbleProps,\n ChatTileProps,\n GroupcastTileProps,\n MessageDatePillProps,\n SearchResultProps,\n MemberRowProps,\n OverlayDialogProps,\n MediaGalleryProps,\n ContextMenuProps,\n BlockListProps,\n ToastPartProps,\n} from './lib/custom-ui';\nexport {\n WEB_CHAT_SLOTS,\n WEB_CHAT_PUBLIC_EVENTS,\n WEB_CHAT_PUBLIC_METHODS,\n deriveMessageStatus,\n findWebChatHost,\n applyCustomPartProps,\n defineReactiveCustomPart,\n} from './lib/custom-ui';\nexport { format } from './utils/utils';\n\nexport {\n initializeIsometrikWebchat,\n destroyIsometrikWebchat,\n ensureIsometrikWebchat,\n retainIsometrikWebchat,\n releaseIsometrikWebchat,\n buildWebchatSessionKey,\n initializeChat,\n destroyChat,\n THEME_TOKEN_NAMES,\n normalizeThemeObject,\n applyThemeObjectToElement,\n resolveRegionMode,\n resolveProfileRailMode,\n resolveShowProfileRailProp,\n createWebChatApi,\n isometrikWebchatApi,\n setWebChatSlot,\n clearWebChatSlot,\n createSlotHost,\n setWebChatSlots,\n defineReactCustomPart,\n mountReactInSlot,\n unmountReactSlot,\n resolveThemeProvider,\n resolveWebChat,\n getChatStore,\n getOfflineClient,\n mergeMessagesById,\n isBrowserOnline,\n canUseIndexedDb,\n} from './sdk';\nexport type {\n IsometrikWebchatInitProps,\n InitializeChatProps,\n IsometrikWebchatInstance,\n ThemeTokenName,\n ThemeTokenMap,\n RegionMode,\n ProfileRailMode,\n WebChatApi,\n IsometrikWebchatApi,\n ReactLike,\n CreateRootLike,\n ReactSlotHost,\n} from './sdk';\n\nexport {\n customChatSidebar,\n switchChatTheme,\n applyCustomTheme,\n toggleTheme,\n} from './sdk/runtime-controls';\n\nimport {\n initializeIsometrikWebchat,\n destroyIsometrikWebchat,\n} from './sdk';\nimport { isometrikWebchatApi } from './sdk/headless-api';\nimport {\n customChatSidebar,\n switchChatTheme,\n applyCustomTheme,\n toggleTheme,\n} from './sdk/runtime-controls';\n\n/**\n * Stencil-generated component types (full catalog).\n * Prefer the explicit custom-ui / InitializeChatProps exports above for host apps.\n * Lazy loader: `isometrik-webchat/loader`\n * Custom elements: `dist/components/` (dist-custom-elements output)\n */\nexport type * from './components.d.ts';\n\nif (typeof window !== 'undefined') {\n (window as any).initializeIsometrikWebchat = initializeIsometrikWebchat;\n (window as any).destroyIsometrikWebchat = destroyIsometrikWebchat;\n (window as any).initializeChat = initializeIsometrikWebchat;\n (window as any).destroyChat = destroyIsometrikWebchat;\n (window as any).isometrikWebchatApi = isometrikWebchatApi;\n (window as any).chatSidebarProps = customChatSidebar;\n (window as any).switchChatTheme = switchChatTheme;\n (window as any).applyCustomTheme = applyCustomTheme;\n (window as any).toggleTheme = toggleTheme;\n}\n"]}
@@ -7,4 +7,7 @@ export { fetchMessagesPage, searchMessages, fetchLinkMessages, fetchMediaCount,
7
7
  export { initializeChatSdk, fetchUserDetails } from './session';
8
8
  export { fetchGroupcastDetails, fetchGroupcastMembersPage, fetchGroupcastContactsPage } from './groupcast';
9
9
  export { mediaTypeFromMime, customTypeFromMime, prepareMediaAttachments, buildLocalMediaAttachments, buildReplyMetaData, uploadAndPostMediaMessage, } from './send-media';
10
+ export { MAX_MEDIA_PER_MESSAGE, takeMediaFiles, mediaLimitToastMessage, } from './media-limits';
11
+ export { filesToOutboxMedia, outboxMediaToFiles, MAX_OUTBOX_MEDIA_BYTES } from './media-outbox';
12
+ export { isPdfAttachment, previewKindFromAttachment, deliveryUiState } from './preview-kind';
10
13
  //# sourceMappingURL=index.js.map