isometrik-plugin-chat-sdk 1.3.18 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-globals-61a8bfde.js +38 -0
- package/dist/cjs/app-globals-61a8bfde.js.map +1 -0
- package/dist/cjs/attachment-preview_22.cjs.entry.js +122 -44
- package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
- package/dist/cjs/audio-bubble_4.cjs.entry.js +38 -8
- package/dist/cjs/audio-bubble_4.cjs.entry.js.map +1 -1
- package/dist/cjs/chat-app.cjs.entry.js +2 -2
- package/dist/cjs/chat-app.cjs.entry.js.map +1 -1
- package/dist/cjs/{chat-creds-cf537d4b.js → chat-creds-2dbc4087.js} +3 -3
- package/dist/cjs/chat-creds-2dbc4087.js.map +1 -0
- package/dist/cjs/chat-document-message-bubble.cjs.entry.js +1 -1
- package/dist/cjs/chat-image-message-bubble.cjs.entry.js +1 -1
- package/dist/cjs/chat-video-message-bubble.cjs.entry.js +1 -1
- package/dist/cjs/client-80851676.js +482 -0
- package/dist/cjs/client-80851676.js.map +1 -0
- package/dist/cjs/{contracts-31632812.js → contracts-dfc84075.js} +2 -2
- package/dist/cjs/contracts-dfc84075.js.map +1 -0
- package/dist/cjs/destroy-chat-7ae8fc99.js +24 -0
- package/dist/cjs/destroy-chat-7ae8fc99.js.map +1 -0
- package/dist/cjs/doublecheck-c2461adc.js +36 -0
- package/dist/cjs/doublecheck-c2461adc.js.map +1 -0
- package/dist/cjs/{drawer-28cc94a4.js → drawer-811d2ce8.js} +2 -2
- package/dist/cjs/{drawer-28cc94a4.js.map → drawer-811d2ce8.js.map} +1 -1
- package/dist/cjs/forward-memebers.cjs.entry.js +2 -2
- package/dist/cjs/forward-message.cjs.entry.js +2 -2
- package/dist/cjs/group-chat-contacts.cjs.entry.js +2 -2
- package/dist/cjs/{group-members-73ad1074.js → group-members-5a82ec8a.js} +1 -125
- package/dist/cjs/group-members-5a82ec8a.js.map +1 -0
- package/dist/cjs/{helpers-8061ec7d.js → helpers-154861e9.js} +2 -2
- package/dist/cjs/{helpers-8061ec7d.js.map → helpers-154861e9.js.map} +1 -1
- package/dist/cjs/{index-1a26d11d.js → index-66f98408.js} +2 -2
- package/dist/cjs/index-66f98408.js.map +1 -0
- package/dist/cjs/index.cjs.js +55 -182
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/isometrik-webchat.cjs.js +10 -2
- package/dist/cjs/isometrik-webchat.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +10 -2
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/login-page_3.cjs.entry.js +708 -376
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/cjs/media-gallery.cjs.entry.js +1 -1
- package/dist/cjs/media-limits-eba42629.js +165 -0
- package/dist/cjs/media-limits-eba42629.js.map +1 -0
- package/dist/cjs/member-add.cjs.entry.js +3 -3
- package/dist/cjs/message-bubble.cjs.entry.js +30 -8
- package/dist/cjs/message-bubble.cjs.entry.js.map +1 -1
- package/dist/cjs/my-component.cjs.entry.js +1 -1
- package/dist/cjs/new-chat-sidebar.cjs.entry.js +2 -2
- package/dist/cjs/reaction-container.cjs.entry.js +4 -4
- package/dist/cjs/runtime-controls-201c71ba.js +650 -0
- package/dist/cjs/runtime-controls-201c71ba.js.map +1 -0
- package/dist/cjs/send-media-14908d4b.js +375 -0
- package/dist/cjs/send-media-14908d4b.js.map +1 -0
- package/dist/cjs/signup-page.cjs.entry.js +1 -1
- package/dist/cjs/{toast-0bf1e688.js → toast-f810e550.js} +8 -8
- package/dist/cjs/toast-f810e550.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/ChatUIComponent/ChatDocumentMessageBubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/ChatImageMessageBubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/ChatVideoMessageBubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +61 -14
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/ReactionContainer.js +2 -2
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +7 -6
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/attachment-preview/attachment-preview.js +39 -8
- package/dist/collection/components/ChatUIComponent/shared/attachment-preview/attachment-preview.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/document-message/document-message.js +53 -3
- package/dist/collection/components/ChatUIComponent/shared/document-message/document-message.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/forward-message/forward-message.js +2 -2
- package/dist/collection/components/ChatUIComponent/shared/image-message/image-message.js +19 -1
- package/dist/collection/components/ChatUIComponent/shared/image-message/image-message.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/incoming-text-message-bubble/incoming-text-message-bubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/message-bubble/message-bubble.js +47 -7
- package/dist/collection/components/ChatUIComponent/shared/message-bubble/message-bubble.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/message-date-pill/message-date-pill.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/new chat/new-chat.stories.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/outgoing-text-message-bubble/outgoing-text-message-bubble.js +19 -1
- package/dist/collection/components/ChatUIComponent/shared/outgoing-text-message-bubble/outgoing-text-message-bubble.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/reply-message-container/reply-message-container.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.js +20 -2
- package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.js.map +1 -1
- package/dist/collection/components/my-component/my-component.js +1 -1
- package/dist/collection/components/my-component/web-chat/FLOW.js +1 -1
- package/dist/collection/components/my-component/web-chat/FLOW.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/WebChat.js +113 -12
- package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/bootstrap.js +7 -0
- package/dist/collection/components/my-component/web-chat/bootstrap.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/data-fetch.js +14 -5
- package/dist/collection/components/my-component/web-chat/data-fetch.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/mqtt-host.js +152 -41
- package/dist/collection/components/my-component/web-chat/mqtt-host.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/offline-host.js +212 -0
- package/dist/collection/components/my-component/web-chat/offline-host.js.map +1 -0
- package/dist/collection/components/my-component/web-chat/public-send.js +96 -21
- package/dist/collection/components/my-component/web-chat/public-send.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/shell-render.js +47 -28
- package/dist/collection/components/my-component/web-chat/shell-render.js.map +1 -1
- package/dist/collection/components/theme-provider.js +114 -45
- package/dist/collection/components/theme-provider.js.map +1 -1
- package/dist/collection/constants/chat-creds.js +2 -2
- package/dist/collection/demos/custom-ui-demo-elements.js +2 -2
- package/dist/collection/demos/custom-ui-demo-elements.js.map +1 -1
- package/dist/collection/global/expose-sdk.js +29 -0
- package/dist/collection/global/expose-sdk.js.map +1 -0
- package/dist/collection/index.js +10 -141
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/lib/chat/index.js +3 -0
- package/dist/collection/lib/chat/index.js.map +1 -1
- package/dist/collection/lib/chat/media-limits.js +21 -0
- package/dist/collection/lib/chat/media-limits.js.map +1 -0
- package/dist/collection/lib/chat/media-outbox.js +43 -0
- package/dist/collection/lib/chat/media-outbox.js.map +1 -0
- package/dist/collection/lib/chat/preview-kind.js +41 -0
- package/dist/collection/lib/chat/preview-kind.js.map +1 -0
- package/dist/collection/lib/chat/send-media.js +5 -2
- package/dist/collection/lib/chat/send-media.js.map +1 -1
- package/dist/collection/lib/custom-ui/contracts.js +1 -1
- package/dist/collection/lib/custom-ui/contracts.js.map +1 -1
- package/dist/collection/lib/custom-ui/index.js +1 -1
- package/dist/collection/lib/custom-ui/index.js.map +1 -1
- package/dist/collection/lib/custom-ui/public-api.js +1 -0
- package/dist/collection/lib/custom-ui/public-api.js.map +1 -1
- package/dist/collection/lib/destroy-chat.js +15 -16
- package/dist/collection/lib/destroy-chat.js.map +1 -0
- package/dist/collection/lib/mqtt/inbound-queue.js +17 -0
- package/dist/collection/lib/mqtt/inbound-queue.js.map +1 -0
- package/dist/collection/lib/mqtt/index.js +2 -1
- package/dist/collection/lib/mqtt/index.js.map +1 -1
- package/dist/collection/lib/mqtt/session.js +50 -6
- package/dist/collection/lib/mqtt/session.js.map +1 -1
- package/dist/collection/lib/offline/client.js +167 -0
- package/dist/collection/lib/offline/client.js.map +1 -0
- package/dist/collection/lib/offline/idb.js +181 -0
- package/dist/collection/lib/offline/idb.js.map +1 -0
- package/dist/collection/lib/offline/index.js +10 -0
- package/dist/collection/lib/offline/index.js.map +1 -0
- package/dist/collection/lib/offline/memory-db.js +64 -0
- package/dist/collection/lib/offline/memory-db.js.map +1 -0
- package/dist/collection/lib/offline/merge.js +24 -0
- package/dist/collection/lib/offline/merge.js.map +1 -0
- package/dist/collection/lib/offline/multitab.js +47 -0
- package/dist/collection/lib/offline/multitab.js.map +1 -0
- package/dist/collection/lib/offline/types.js +2 -0
- package/dist/collection/lib/offline/types.js.map +1 -0
- package/dist/collection/lib/toast.js +6 -6
- package/dist/collection/lib/toast.js.map +1 -1
- package/dist/collection/sdk/api.js +4 -0
- package/dist/collection/sdk/api.js.map +1 -0
- package/dist/collection/sdk/composition.js +43 -0
- package/dist/collection/sdk/composition.js.map +1 -0
- package/dist/collection/sdk/headless-api.js +37 -0
- package/dist/collection/sdk/headless-api.js.map +1 -0
- package/dist/collection/sdk/index.js +11 -0
- package/dist/collection/sdk/index.js.map +1 -0
- package/dist/collection/sdk/init.js +207 -0
- package/dist/collection/sdk/init.js.map +1 -0
- package/dist/collection/sdk/instance.js +63 -0
- package/dist/collection/sdk/instance.js.map +1 -0
- package/dist/collection/sdk/react-bridge.js +145 -0
- package/dist/collection/sdk/react-bridge.js.map +1 -0
- package/dist/collection/sdk/runtime-controls.js +54 -0
- package/dist/collection/sdk/runtime-controls.js.map +1 -0
- package/dist/collection/sdk/slots.js +57 -0
- package/dist/collection/sdk/slots.js.map +1 -0
- package/dist/collection/sdk/theme-tokens.js +99 -0
- package/dist/collection/sdk/theme-tokens.js.map +1 -0
- package/dist/collection/sdk/webchat-api.js +36 -0
- package/dist/collection/sdk/webchat-api.js.map +1 -0
- package/dist/collection/testing/chat-assets-mock.js +45 -0
- package/dist/collection/testing/chat-creds-mock.js +18 -0
- package/dist/collection/testing/emoji-picker-mock.js +2 -0
- package/dist/collection/testing/file-mock.js +1 -0
- package/dist/collection/testing/groupcast-mock.js +7 -0
- package/dist/collection/testing/helpers-mock.js +4 -0
- package/dist/collection/testing/iso-chat-sdk-mock.js +19 -0
- package/dist/collection/testing/toast-mock.js +2 -0
- package/dist/components/ChatFooter.js +62 -15
- package/dist/components/ChatFooter.js.map +1 -1
- package/dist/components/ChatSidebar.js +1 -1
- package/dist/components/{GroupCast.js → GroupCast2.js} +2 -2
- package/dist/components/GroupCast2.js.map +1 -0
- package/dist/components/WebChat.js +643 -312
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/WebChatBody.js +8 -7
- package/dist/components/WebChatBody.js.map +1 -1
- package/dist/components/attachment-preview2.js +40 -9
- package/dist/components/attachment-preview2.js.map +1 -1
- package/dist/components/chat-app.js +3 -3
- package/dist/components/chat-app.js.map +1 -1
- package/dist/components/chat-assets.js +1 -1
- package/dist/components/chat-creds.js +2 -2
- package/dist/components/chat-creds.js.map +1 -1
- package/dist/components/chat-document-message-bubble.js +1 -1
- package/dist/components/chat-image-message-bubble.js +1 -1
- package/dist/components/chat-tile2.js +1 -1
- package/dist/components/chat-video-message-bubble.js +1 -1
- package/dist/components/client.js +728 -0
- package/dist/components/client.js.map +1 -0
- package/dist/components/contact-info2.js +2 -117
- package/dist/components/contact-info2.js.map +1 -1
- package/dist/components/contracts.js +1 -1
- package/dist/components/contracts.js.map +1 -1
- package/dist/components/destroy-chat.js +14 -16
- package/dist/components/destroy-chat.js.map +1 -1
- package/dist/components/document-message2.js +35 -5
- package/dist/components/document-message2.js.map +1 -1
- package/dist/components/forward-message.js +2 -2
- package/dist/components/group-cast.js +1 -1
- package/dist/components/{groupcast2.js → groupcast.js} +1 -1
- package/dist/components/groupcast.js.map +1 -0
- package/dist/components/image-message2.js +3 -1
- package/dist/components/image-message2.js.map +1 -1
- package/dist/components/incoming-text-message-bubble2.js +1 -1
- package/dist/components/index.js +551 -60
- package/dist/components/index.js.map +1 -1
- package/dist/components/index2.js +1 -1
- package/dist/components/index2.js.map +1 -1
- package/dist/components/media-limits.js +24 -0
- package/dist/components/media-limits.js.map +1 -0
- package/dist/components/member-add.js +1 -1
- package/dist/components/message-bubble2.js +31 -7
- package/dist/components/message-bubble2.js.map +1 -1
- package/dist/components/message-date-pill2.js +1 -1
- package/dist/components/messages.js +131 -0
- package/dist/components/messages.js.map +1 -0
- package/dist/components/my-component.js +1 -1
- package/dist/components/outgoing-text-message-bubble2.js +3 -1
- package/dist/components/outgoing-text-message-bubble2.js.map +1 -1
- package/dist/components/preview-kind.js +30 -0
- package/dist/components/preview-kind.js.map +1 -0
- package/dist/components/reaction-container.js +2 -2
- package/dist/components/reply-message-container2.js +1 -1
- package/dist/components/theme-provider2.js +56 -44
- package/dist/components/theme-provider2.js.map +1 -1
- package/dist/components/theme-tokens.js +102 -0
- package/dist/components/theme-tokens.js.map +1 -0
- package/dist/components/toast.js +6 -6
- package/dist/components/toast.js.map +1 -1
- package/dist/components/video-message2.js +4 -2
- package/dist/components/video-message2.js.map +1 -1
- package/dist/esm/app-globals-2beecb81.js +36 -0
- package/dist/esm/app-globals-2beecb81.js.map +1 -0
- package/dist/esm/attachment-preview_22.entry.js +120 -42
- package/dist/esm/attachment-preview_22.entry.js.map +1 -1
- package/dist/esm/audio-bubble_4.entry.js +39 -9
- package/dist/esm/audio-bubble_4.entry.js.map +1 -1
- package/dist/esm/chat-app.entry.js +2 -2
- package/dist/esm/chat-app.entry.js.map +1 -1
- package/dist/esm/{chat-assets-e3173222.js → chat-assets-bb056958.js} +2 -2
- package/dist/esm/{chat-assets-e3173222.js.map → chat-assets-bb056958.js.map} +1 -1
- package/dist/esm/{chat-creds-5d0982fc.js → chat-creds-aafad4d0.js} +3 -3
- package/dist/esm/chat-creds-aafad4d0.js.map +1 -0
- package/dist/esm/chat-document-message-bubble.entry.js +1 -1
- package/dist/esm/chat-image-message-bubble.entry.js +1 -1
- package/dist/esm/chat-tile_3.entry.js +1 -1
- package/dist/esm/chat-video-message-bubble.entry.js +1 -1
- package/dist/esm/client-4a3e00da.js +477 -0
- package/dist/esm/client-4a3e00da.js.map +1 -0
- package/dist/esm/{contracts-614be4db.js → contracts-50f4ddae.js} +2 -2
- package/dist/esm/contracts-50f4ddae.js.map +1 -0
- package/dist/esm/destroy-chat-d0ee28d6.js +22 -0
- package/dist/esm/destroy-chat-d0ee28d6.js.map +1 -0
- package/dist/esm/doublecheck-261763ef.js +32 -0
- package/dist/esm/doublecheck-261763ef.js.map +1 -0
- package/dist/esm/{drawer-8f721119.js → drawer-74c188f1.js} +2 -2
- package/dist/esm/{drawer-8f721119.js.map → drawer-74c188f1.js.map} +1 -1
- package/dist/esm/forward-memebers.entry.js +3 -3
- package/dist/esm/forward-message.entry.js +2 -2
- package/dist/esm/group-chat-contacts.entry.js +2 -2
- package/dist/esm/{group-members-806fd7a2.js → group-members-05414da2.js} +2 -118
- package/dist/esm/group-members-05414da2.js.map +1 -0
- package/dist/esm/{groupcast-2ce7187f.js → groupcast-9c7d2a32.js} +2 -2
- package/dist/esm/{groupcast-2ce7187f.js.map → groupcast-9c7d2a32.js.map} +1 -1
- package/dist/esm/{helpers-4c6d09a7.js → helpers-f33b895c.js} +2 -2
- package/dist/esm/{helpers-4c6d09a7.js.map → helpers-f33b895c.js.map} +1 -1
- package/dist/esm/{index-beb184c6.js → index-4c865e34.js} +2 -2
- package/dist/esm/index-4c865e34.js.map +1 -0
- package/dist/esm/index.js +17 -171
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/isometrik-webchat.js +10 -2
- package/dist/esm/isometrik-webchat.js.map +1 -1
- package/dist/esm/loader.js +10 -2
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/login-page_3.entry.js +691 -359
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/esm/media-gallery.entry.js +1 -1
- package/dist/esm/media-limits-3fa07c09.js +152 -0
- package/dist/esm/media-limits-3fa07c09.js.map +1 -0
- package/dist/esm/member-add.entry.js +5 -5
- package/dist/esm/message-bubble.entry.js +30 -8
- package/dist/esm/message-bubble.entry.js.map +1 -1
- package/dist/esm/my-component.entry.js +1 -1
- package/dist/esm/new-chat-sidebar.entry.js +3 -3
- package/dist/esm/reaction-container.entry.js +4 -4
- package/dist/esm/runtime-controls-cf599fe2.js +623 -0
- package/dist/esm/runtime-controls-cf599fe2.js.map +1 -0
- package/dist/esm/send-media-917dcc2f.js +353 -0
- package/dist/esm/send-media-917dcc2f.js.map +1 -0
- package/dist/esm/signup-page.entry.js +1 -1
- package/dist/esm/{toast-d8ea763c.js → toast-533dd183.js} +8 -8
- package/dist/esm/toast-533dd183.js.map +1 -0
- package/dist/isometrik-webchat/index.esm.js +1 -1
- package/dist/isometrik-webchat/index.esm.js.map +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.css +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js.map +1 -1
- package/dist/isometrik-webchat/p-0731d488.js +2 -0
- package/dist/isometrik-webchat/p-0731d488.js.map +1 -0
- package/dist/isometrik-webchat/{p-a15092d9.entry.js → p-1854b156.entry.js} +2 -2
- package/dist/isometrik-webchat/p-1854b156.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-5fea3fd2.entry.js → p-2d3e8cd4.entry.js} +2 -2
- package/dist/isometrik-webchat/p-315eee9a.js +2 -0
- package/dist/isometrik-webchat/p-315eee9a.js.map +1 -0
- package/dist/isometrik-webchat/{p-e7f58d3f.entry.js → p-39b626ed.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-eb1f3118.entry.js → p-3c70c22c.entry.js} +2 -2
- package/dist/isometrik-webchat/p-4cb54460.js +2 -0
- package/dist/isometrik-webchat/p-4cb54460.js.map +1 -0
- package/dist/isometrik-webchat/{p-f24cdbbb.js → p-5162774c.js} +1 -1
- package/dist/isometrik-webchat/p-5162774c.js.map +1 -0
- package/dist/isometrik-webchat/p-53ee98a7.entry.js +2 -0
- package/dist/isometrik-webchat/p-53ee98a7.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-5cbc1a16.entry.js → p-586f6978.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-5f7eebbf.entry.js → p-5d243250.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-23df1c24.js → p-5d98a8a0.js} +2 -2
- package/dist/isometrik-webchat/p-7f415f28.js +2 -0
- package/dist/isometrik-webchat/p-7f415f28.js.map +1 -0
- package/dist/isometrik-webchat/{p-d386acfe.js → p-7fd2c1ad.js} +1 -1
- package/dist/isometrik-webchat/p-7fd2c1ad.js.map +1 -0
- package/dist/isometrik-webchat/{p-e5884258.js → p-9982fa21.js} +2 -2
- package/dist/isometrik-webchat/{p-4db39c93.js → p-a5707f12.js} +2 -2
- package/dist/isometrik-webchat/{p-af775c83.entry.js → p-a876991d.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-7b80b0b2.js → p-adc45831.js} +1 -1
- package/dist/isometrik-webchat/p-adc45831.js.map +1 -0
- package/dist/isometrik-webchat/p-ae168135.js +2 -0
- package/dist/isometrik-webchat/p-ae168135.js.map +1 -0
- package/dist/isometrik-webchat/{p-a6897edc.js → p-b1330793.js} +1 -1
- package/dist/isometrik-webchat/p-b1330793.js.map +1 -0
- package/dist/isometrik-webchat/p-b61d6c0c.entry.js +2 -0
- package/dist/isometrik-webchat/p-b61d6c0c.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-b667a9fc.js +2 -0
- package/dist/isometrik-webchat/p-b667a9fc.js.map +1 -0
- package/dist/isometrik-webchat/p-b857775d.entry.js +2 -0
- package/dist/isometrik-webchat/p-bdcdf1c5.js +2 -0
- package/dist/isometrik-webchat/p-bdcdf1c5.js.map +1 -0
- package/dist/isometrik-webchat/p-c0c19621.entry.js +2 -0
- package/dist/isometrik-webchat/{p-064d6200.entry.js → p-ca47d693.entry.js} +2 -2
- package/dist/isometrik-webchat/p-d720cf14.entry.js +2 -0
- package/dist/isometrik-webchat/{p-53695fc6.entry.js.map → p-d720cf14.entry.js.map} +1 -1
- package/dist/isometrik-webchat/{p-5c22ee37.entry.js → p-d892b4d4.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-7eb12da3.js → p-dd62bd69.js} +2 -2
- package/dist/isometrik-webchat/p-eb54f75d.js +2 -0
- package/dist/isometrik-webchat/p-eb54f75d.js.map +1 -0
- package/dist/isometrik-webchat/p-f1fbf3be.entry.js +2 -0
- package/dist/isometrik-webchat/p-f1fbf3be.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-fb705915.entry.js +2 -0
- package/dist/isometrik-webchat/p-fb705915.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-2f6bb0a4.entry.js → p-fd6ce589.entry.js} +2 -2
- package/dist/isometrik-webchat/p-fdd327f5.entry.js +2 -0
- package/dist/types/components/ChatUIComponent/Footer/ChatFooter.d.ts +1 -0
- package/dist/types/components/ChatUIComponent/shared/attachment-preview/attachment-preview.d.ts +2 -0
- package/dist/types/components/ChatUIComponent/shared/document-message/document-message.d.ts +5 -0
- package/dist/types/components/ChatUIComponent/shared/image-message/image-message.d.ts +1 -0
- package/dist/types/components/ChatUIComponent/shared/message-bubble/message-bubble.d.ts +3 -0
- package/dist/types/components/ChatUIComponent/shared/outgoing-text-message-bubble/outgoing-text-message-bubble.d.ts +1 -0
- package/dist/types/components/ChatUIComponent/shared/video-message/video-message.d.ts +1 -0
- package/dist/types/components/my-component/web-chat/FLOW.d.ts +1 -1
- package/dist/types/components/my-component/web-chat/mqtt-host.d.ts +13 -0
- package/dist/types/components/my-component/web-chat/offline-host.d.ts +22 -0
- package/dist/types/components/theme-provider.d.ts +22 -27
- package/dist/types/components.d.ts +84 -11
- package/dist/types/demos/custom-ui-demo-elements.d.ts +1 -1
- package/dist/types/global/expose-sdk.d.ts +1 -0
- package/dist/types/index.d.ts +3 -44
- package/dist/types/lib/chat/index.d.ts +3 -0
- package/dist/types/lib/chat/media-limits.d.ts +11 -0
- package/dist/types/lib/chat/media-outbox.d.ts +8 -0
- package/dist/types/lib/chat/preview-kind.d.ts +30 -0
- package/dist/types/lib/custom-ui/contracts.d.ts +1 -1
- package/dist/types/lib/custom-ui/index.d.ts +1 -1
- package/dist/types/lib/custom-ui/public-api.d.ts +1 -1
- package/dist/types/lib/destroy-chat.d.ts +2 -0
- package/dist/types/lib/mqtt/inbound-queue.d.ts +7 -0
- package/dist/types/lib/mqtt/index.d.ts +2 -1
- package/dist/types/lib/mqtt/session.d.ts +22 -0
- package/dist/types/lib/offline/client.d.ts +44 -0
- package/dist/types/lib/offline/idb.d.ts +36 -0
- package/dist/types/lib/offline/index.d.ts +10 -0
- package/dist/types/lib/offline/memory-db.d.ts +20 -0
- package/dist/types/lib/offline/merge.d.ts +3 -0
- package/dist/types/lib/offline/multitab.d.ts +13 -0
- package/dist/types/lib/offline/types.d.ts +63 -0
- package/dist/types/sdk/api.d.ts +3 -0
- package/dist/types/sdk/composition.d.ts +32 -0
- package/dist/types/sdk/headless-api.d.ts +37 -0
- package/dist/types/sdk/index.d.ts +10 -0
- package/dist/types/sdk/init.d.ts +87 -0
- package/dist/types/sdk/instance.d.ts +15 -0
- package/dist/types/sdk/react-bridge.d.ts +64 -0
- package/dist/types/sdk/runtime-controls.d.ts +14 -0
- package/dist/types/sdk/slots.d.ts +15 -0
- package/dist/types/sdk/theme-tokens.d.ts +22 -0
- package/dist/types/sdk/webchat-api.d.ts +22 -0
- package/docs/ARCHITECTURE.md +272 -0
- package/docs/CUSTOMIZATION.md +236 -0
- package/docs/INTEGRATION.md +286 -0
- package/docs/RELIABILITY.md +51 -0
- package/docs/theme-tokens.template.css +72 -0
- package/package.json +8 -2
- package/readme.md +38 -17
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/chat-creds-cf537d4b.js.map +0 -1
- package/dist/cjs/contracts-31632812.js.map +0 -1
- package/dist/cjs/destroy-chat-be25dec7.js +0 -26
- package/dist/cjs/destroy-chat-be25dec7.js.map +0 -1
- package/dist/cjs/doublecheck-997afc94.js +0 -7
- package/dist/cjs/doublecheck-997afc94.js.map +0 -1
- package/dist/cjs/group-members-73ad1074.js.map +0 -1
- package/dist/cjs/index-1a26d11d.js.map +0 -1
- package/dist/cjs/toast-0bf1e688.js.map +0 -1
- package/dist/components/GroupCast.js.map +0 -1
- package/dist/components/groupcast2.js.map +0 -1
- package/dist/esm/app-globals-0f993ce5.js +0 -5
- package/dist/esm/app-globals-0f993ce5.js.map +0 -1
- package/dist/esm/chat-creds-5d0982fc.js.map +0 -1
- package/dist/esm/contracts-614be4db.js.map +0 -1
- package/dist/esm/destroy-chat-e2ebe165.js +0 -24
- package/dist/esm/destroy-chat-e2ebe165.js.map +0 -1
- package/dist/esm/doublecheck-5e208ef0.js +0 -5
- package/dist/esm/doublecheck-5e208ef0.js.map +0 -1
- package/dist/esm/group-members-806fd7a2.js.map +0 -1
- package/dist/esm/index-beb184c6.js.map +0 -1
- package/dist/esm/toast-d8ea763c.js.map +0 -1
- package/dist/isometrik-webchat/p-01fd0eb4.entry.js +0 -2
- package/dist/isometrik-webchat/p-01fd0eb4.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-09fc122b.entry.js +0 -2
- package/dist/isometrik-webchat/p-09fc122b.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-1c53e658.js +0 -2
- package/dist/isometrik-webchat/p-1c53e658.js.map +0 -1
- package/dist/isometrik-webchat/p-1df58381.entry.js +0 -2
- package/dist/isometrik-webchat/p-1df58381.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-3c690532.entry.js +0 -2
- package/dist/isometrik-webchat/p-3c690532.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-3c8cbd5f.js +0 -2
- package/dist/isometrik-webchat/p-3c8cbd5f.js.map +0 -1
- package/dist/isometrik-webchat/p-4e762019.js +0 -2
- package/dist/isometrik-webchat/p-4e762019.js.map +0 -1
- package/dist/isometrik-webchat/p-53695fc6.entry.js +0 -2
- package/dist/isometrik-webchat/p-7b80b0b2.js.map +0 -1
- package/dist/isometrik-webchat/p-9924b1bf.entry.js +0 -2
- package/dist/isometrik-webchat/p-a15092d9.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-a6897edc.js.map +0 -1
- package/dist/isometrik-webchat/p-b2bf55b1.entry.js +0 -2
- package/dist/isometrik-webchat/p-bfecfa97.entry.js +0 -2
- package/dist/isometrik-webchat/p-d386acfe.js.map +0 -1
- package/dist/isometrik-webchat/p-e1255160.js +0 -2
- package/dist/isometrik-webchat/p-e1255160.js.map +0 -1
- package/dist/isometrik-webchat/p-f24cdbbb.js.map +0 -1
- /package/dist/isometrik-webchat/{p-5fea3fd2.entry.js.map → p-2d3e8cd4.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-e7f58d3f.entry.js.map → p-39b626ed.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-eb1f3118.entry.js.map → p-3c70c22c.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-5cbc1a16.entry.js.map → p-586f6978.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-5f7eebbf.entry.js.map → p-5d243250.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-23df1c24.js.map → p-5d98a8a0.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-e5884258.js.map → p-9982fa21.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-4db39c93.js.map → p-a5707f12.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-af775c83.entry.js.map → p-a876991d.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-bfecfa97.entry.js.map → p-b857775d.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-9924b1bf.entry.js.map → p-c0c19621.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-064d6200.entry.js.map → p-ca47d693.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-5c22ee37.entry.js.map → p-d892b4d4.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-7eb12da3.js.map → p-dd62bd69.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-2f6bb0a4.entry.js.map → p-fd6ce589.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-b2bf55b1.entry.js.map → p-fdd327f5.entry.js.map} +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Custom UI contract for <web-chat>.
|
|
5
5
|
*
|
|
6
|
-
* PRIMARY
|
|
6
|
+
* PRIMARY: customParts — host CE tags; SDK passes props + callbacks.
|
|
7
7
|
* SECONDARY: named slots — layout panels only (no per-row props).
|
|
8
8
|
* ADVANCED: events/methods — headless / full custom chrome.
|
|
9
9
|
*/
|
|
@@ -127,4 +127,4 @@ exports.getCustomPartTag = getCustomPartTag;
|
|
|
127
127
|
exports.hasNamedSlot = hasNamedSlot;
|
|
128
128
|
exports.resolveOverlayElement = resolveOverlayElement;
|
|
129
129
|
|
|
130
|
-
//# sourceMappingURL=index-
|
|
130
|
+
//# sourceMappingURL=index-66f98408.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"index-66f98408.js","mappings":";;AAAA;;;;;;;MAQa,cAAc,GAAG;;IAE5B,SAAS;IACT,cAAc;IACd,mBAAmB;IACnB,cAAc;IACd,YAAY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AAQ,GAAG,uBAAuB,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC/D,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAE9B,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,iBAAiB,EAAE,GAAG,IAAI,CAAC,CAAC;IAC9E,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAC/C,IAAI,IAAI,IAAI,YAAY,WAAW,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,OAAO,KAAK,MAAM,CAC9E,CAAC;IAC7B,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAE1B,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAgB,CAAC;IACrD,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC9B,OAAO,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC5C;;;;;;;;;;","names":[],"sources":["src/lib/custom-ui/index.ts"],"sourcesContent":["/**\n * Custom UI contract for <web-chat>.\n *\n * PRIMARY: customParts — host CE tags; SDK passes props + callbacks.\n * SECONDARY: named slots — layout panels only (no per-row props).\n * ADVANCED: events/methods — headless / full custom chrome.\n */\n\nexport const WEB_CHAT_SLOTS = [\n // shell / panels\n 'sidebar',\n 'profile-rail',\n 'conversation-list',\n 'profile-page',\n 'group-cast',\n 'header',\n 'messages',\n 'composer',\n 'composer-input',\n 'reply-preview',\n 'attachment-preview',\n 'empty',\n 'right-panel',\n 'contact-info',\n 'profile-info',\n 'message-search',\n 'boot-loader',\n // overlays\n 'forward-dialog',\n 'message-info',\n 'media-gallery',\n 'add-member',\n 'context-menu',\n 'block-list',\n 'toast',\n] as const;\n\nexport type WebChatSlotName = (typeof WEB_CHAT_SLOTS)[number];\n\n/** Custom element tags for repeating rows / drawer dialogs. */\nexport type WebChatCustomParts = {\n messageBubble?: string;\n chatTile?: string;\n groupcastTile?: string;\n messageDatePill?: string;\n searchResult?: string;\n memberRow?: string;\n /** New Chat / contact picker row. */\n contactRow?: string;\n /** Drawer dialogs (render outside <web-chat> shadow) */\n forwardDialog?: string;\n addMember?: string;\n mediaGallery?: string;\n contextMenu?: string;\n blockList?: string;\n toast?: string;\n};\n\nexport function hasNamedSlot(host: HTMLElement, name: string): boolean {\n return Array.from(host.children).some(node => {\n // Avoid `instanceof HTMLElement` — fails across jsdom realms in Jest.\n if (!node || node.nodeType !== 1) return false;\n const el = node as HTMLElement;\n if (el.getAttribute('slot') !== name) return false;\n if (el.tagName === 'SLOT') {\n return (el as HTMLSlotElement).assignedNodes({ flatten: true }).length > 0;\n }\n return true;\n });\n}\n\n/** Walk up (incl. shadow hosts) to the owning <web-chat>. */\nexport function findWebChatHost(from?: Element | null): HTMLElement | null {\n let node: Element | null = from || null;\n while (node) {\n if (node.tagName === 'WEB-CHAT') return node as HTMLElement;\n const root = node.getRootNode?.();\n if (root instanceof ShadowRoot) {\n node = root.host;\n continue;\n }\n node = node.parentElement;\n }\n return null;\n}\n\n/** Fallback only — prefer findWebChatHost(from) for multi-instance safety. */\nexport function getWebChatElement(): HTMLElement | null {\n if (typeof document === 'undefined') return null;\n return document.querySelector('web-chat');\n}\n\nexport function getCustomPartTag(\n part: keyof WebChatCustomParts,\n host?: Element | null,\n): string | undefined {\n const webChat = (findWebChatHost(host) || (!host ? getWebChatElement() : null)) as any;\n return webChat?.customParts?.[part];\n}\n\n/** Assign props and nudge CE to re-paint (calls `.render()` if present). */\nexport function applyCustomPartProps(el: HTMLElement, props?: Record<string, unknown>): HTMLElement {\n if (props) Object.assign(el, props);\n const anyEl = el as any;\n if (typeof anyEl.render === 'function') {\n try {\n anyEl.render();\n } catch {\n /* host CE render is best-effort */\n }\n }\n el.dispatchEvent(new CustomEvent('custompart-props', { detail: props, bubbles: false }));\n return el;\n}\n\n/** Create a host-registered CE for a customPart, or null. */\nexport function createCustomPartElement(\n part: keyof WebChatCustomParts,\n props?: Record<string, unknown>,\n host?: Element | null,\n): HTMLElement | null {\n const tag = getCustomPartTag(part, host);\n if (!tag || typeof document === 'undefined') return null;\n return applyCustomPartProps(document.createElement(tag), props);\n}\n\n/**\n * Resolve overlay UI for drawers / deep trees:\n * 1) customParts tag\n * 2) clone of light-DOM [slot=\"…\"] on <web-chat>\n */\nexport function resolveOverlayElement(\n slotName: WebChatSlotName,\n partKey: keyof WebChatCustomParts,\n props?: Record<string, unknown>,\n host?: Element | null,\n): HTMLElement | null {\n const fromPart = createCustomPartElement(partKey, props, host);\n if (fromPart) return fromPart;\n\n const webChat = findWebChatHost(host) || (!host ? getWebChatElement() : null);\n if (!webChat) return null;\n const slotted = Array.from(webChat.children).find(\n node => node instanceof HTMLElement && node.getAttribute('slot') === slotName && node.tagName !== 'SLOT',\n ) as HTMLElement | undefined;\n if (!slotted) return null;\n\n const clone = slotted.cloneNode(true) as HTMLElement;\n clone.removeAttribute('slot');\n return applyCustomPartProps(clone, props);\n}\n\nexport type {\n ChatReadyDetail,\n ConversationsChangeDetail,\n MessagesChangeDetail,\n SelectionChangeDetail,\n ReplyChangeDetail,\n ChatErrorDetail,\n WebChatPublicEvent,\n WebChatPublicMethod,\n} from './public-api';\nexport { WEB_CHAT_PUBLIC_EVENTS, WEB_CHAT_PUBLIC_METHODS } from './public-api';\nexport type {\n MessageDeliveryStatus,\n MessageBubbleProps,\n ChatTileProps,\n GroupcastTileProps,\n MessageDatePillProps,\n SearchResultProps,\n MemberRowProps,\n ContactRowProps,\n OverlayDialogProps,\n MediaGalleryProps,\n ContextMenuProps,\n BlockListProps,\n ToastPartProps,\n} from './contracts';\nexport { deriveMessageStatus } from './contracts';\nexport { defineReactiveCustomPart } from './define-part';\n"],"version":3}
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,37 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const index = require('./index-1a26d11d.js');
|
|
5
|
+
const index = require('./index-66f98408.js');
|
|
7
6
|
const utils = require('./utils-bcad3386.js');
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'messagesChange',
|
|
18
|
-
'conversationSelect',
|
|
19
|
-
'replyChange',
|
|
20
|
-
'chatError',
|
|
21
|
-
'unreadMessageCountUpdated',
|
|
22
|
-
'conversationNotFound',
|
|
23
|
-
'messageReadStatusUpdated',
|
|
24
|
-
];
|
|
25
|
-
/** Documented public @Method names on <web-chat>. */
|
|
26
|
-
const WEB_CHAT_PUBLIC_METHODS = [
|
|
27
|
-
'selectConversation',
|
|
28
|
-
'sendText',
|
|
29
|
-
'sendMedia',
|
|
30
|
-
'setReply',
|
|
31
|
-
'clearReply',
|
|
32
|
-
'loadMoreMessages',
|
|
33
|
-
'loadMoreConversations',
|
|
34
|
-
'getChatState',
|
|
35
|
-
];
|
|
7
|
+
const runtimeControls = require('./runtime-controls-201c71ba.js');
|
|
8
|
+
const contracts = require('./contracts-dfc84075.js');
|
|
9
|
+
const sendMedia = require('./send-media-14908d4b.js');
|
|
10
|
+
const client = require('./client-80851676.js');
|
|
11
|
+
require('./destroy-chat-7ae8fc99.js');
|
|
12
|
+
require('./media-limits-eba42629.js');
|
|
13
|
+
require('./index.m-ff115b26.js');
|
|
14
|
+
require('./chat-creds-2dbc4087.js');
|
|
15
|
+
require('./groupcast-c93d4a7d.js');
|
|
36
16
|
|
|
37
17
|
/**
|
|
38
18
|
* Tiny helper to define a reactive customPart CE.
|
|
@@ -69,166 +49,59 @@ function defineReactiveCustomPart(tag, propKeys, render) {
|
|
|
69
49
|
customElements.define(tag, ReactivePart);
|
|
70
50
|
}
|
|
71
51
|
|
|
72
|
-
function attachWebChatSlots(chatComponent, slots) {
|
|
73
|
-
if (!slots)
|
|
74
|
-
return;
|
|
75
|
-
Object.entries(slots).forEach(([name, el]) => {
|
|
76
|
-
if (!el)
|
|
77
|
-
return;
|
|
78
|
-
el.slot = name;
|
|
79
|
-
chatComponent.appendChild(el);
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
function getStoredComponents() {
|
|
83
|
-
if (typeof window === 'undefined')
|
|
84
|
-
return {};
|
|
85
|
-
window.__isometrikChatComponents = window.__isometrikChatComponents || {};
|
|
86
|
-
return window.__isometrikChatComponents;
|
|
87
|
-
}
|
|
88
|
-
/** Tear down existing chat instance (MQTT via disconnectedCallback, DOM). */
|
|
89
|
-
const destroyChat = function () {
|
|
90
|
-
destroyChat$1.destroyChatDom();
|
|
91
|
-
document.querySelectorAll('theme-provider').forEach(el => {
|
|
92
|
-
if (!el.querySelector('web-chat') && el.childNodes.length === 0) {
|
|
93
|
-
el.remove();
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
const initializeChat = function (props) {
|
|
98
|
-
if (!props.licenseKey ||
|
|
99
|
-
!props.appSecret ||
|
|
100
|
-
!props.userSecret ||
|
|
101
|
-
!props.userToken ||
|
|
102
|
-
!props.isometrikUserId ||
|
|
103
|
-
!props.projectId ||
|
|
104
|
-
!props.keysetId ||
|
|
105
|
-
!props.accountId) {
|
|
106
|
-
console.error('Missing required props to Initialize chat!');
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
// Idempotent: destroy previous instance before creating a new one
|
|
110
|
-
destroyChat();
|
|
111
|
-
const themeProvider = document.createElement('theme-provider');
|
|
112
|
-
if (props.defaultTheme) {
|
|
113
|
-
themeProvider.setAttribute('mode', props.defaultTheme);
|
|
114
|
-
}
|
|
115
|
-
if (props.themeUrl) {
|
|
116
|
-
themeProvider.setAttribute('theme-path', props.themeUrl);
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
themeProvider.setAttribute('theme-path', 'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css');
|
|
120
|
-
}
|
|
121
|
-
const chatComponent = document.createElement('web-chat');
|
|
122
|
-
chatComponent.baseUrl = (props === null || props === void 0 ? void 0 : props.baseUrl) || 'https://apis.isometrik.io';
|
|
123
|
-
chatComponent.hostUrl = (props === null || props === void 0 ? void 0 : props.hostUrl) || 'wss://connections.isometrik.io:2053/mqtt';
|
|
124
|
-
chatComponent.licenseKey = props.licenseKey;
|
|
125
|
-
chatComponent.appSecret = props.appSecret;
|
|
126
|
-
chatComponent.userSecret = props.userSecret;
|
|
127
|
-
chatComponent.userToken = props.userToken;
|
|
128
|
-
chatComponent.isometrikUserId = props.isometrikUserId;
|
|
129
|
-
chatComponent.projectId = props.projectId;
|
|
130
|
-
chatComponent.keysetId = props.keysetId;
|
|
131
|
-
chatComponent.accountId = props.accountId;
|
|
132
|
-
chatComponent.defaultTheme = props.defaultTheme || 'light';
|
|
133
|
-
chatComponent.themeUrl =
|
|
134
|
-
props.themeUrl ||
|
|
135
|
-
'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css';
|
|
136
|
-
chatComponent.style.width = '100%';
|
|
137
|
-
chatComponent.style.height = '100%';
|
|
138
|
-
if (props.customParts) {
|
|
139
|
-
chatComponent.customParts = props.customParts;
|
|
140
|
-
}
|
|
141
|
-
if (props.showProfileRail !== undefined) {
|
|
142
|
-
chatComponent.showProfileRail = props.showProfileRail;
|
|
143
|
-
}
|
|
144
|
-
if (props.showChatWallpaper !== undefined) {
|
|
145
|
-
chatComponent.showChatWallpaper = props.showChatWallpaper;
|
|
146
|
-
}
|
|
147
|
-
if (props.groupcastEnabled !== undefined) {
|
|
148
|
-
chatComponent.groupcastEnabled = props.groupcastEnabled;
|
|
149
|
-
}
|
|
150
|
-
attachWebChatSlots(chatComponent, props.slots);
|
|
151
|
-
themeProvider.appendChild(chatComponent);
|
|
152
|
-
themeProvider.style.width = '100%';
|
|
153
|
-
themeProvider.style.height = '100%';
|
|
154
|
-
themeProvider.style.display = 'block';
|
|
155
|
-
const container = props.containerId ? document.getElementById(props.containerId) : document.body;
|
|
156
|
-
if (container) {
|
|
157
|
-
container.appendChild(themeProvider);
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
console.error('Container with the specified ID not found. Appending to body instead.');
|
|
161
|
-
document.body.appendChild(themeProvider);
|
|
162
|
-
}
|
|
163
|
-
const stored = getStoredComponents();
|
|
164
|
-
stored.themeProvider = themeProvider;
|
|
165
|
-
stored.chatComponent = chatComponent;
|
|
166
|
-
return { themeProvider, chatComponent, destroy: destroyChat };
|
|
167
|
-
};
|
|
168
|
-
const customChatSidebar = function (props) {
|
|
169
|
-
const chatComponent = document.querySelector('web-chat');
|
|
170
|
-
if (!chatComponent) {
|
|
171
|
-
console.error('Isometrik chat is not initialized');
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
if (props.isChatFilter !== undefined) {
|
|
175
|
-
chatComponent.isChatFilter = props.isChatFilter;
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
const switchChatTheme = function (theme) {
|
|
179
|
-
const chatElements = document.getElementsByTagName('web-chat');
|
|
180
|
-
for (let i = 0; i < chatElements.length; i++) {
|
|
181
|
-
const chatWeb = chatElements[i];
|
|
182
|
-
chatWeb.defaultTheme = theme;
|
|
183
|
-
const themeProvider = getStoredComponents().themeProvider;
|
|
184
|
-
if (themeProvider) {
|
|
185
|
-
themeProvider.setAttribute('mode', theme);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
const applyCustomTheme = function (customTheme) {
|
|
190
|
-
const themeProvider = document.querySelector('theme-provider');
|
|
191
|
-
if (!themeProvider) {
|
|
192
|
-
console.error('Theme provider is not initialized');
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
if (customTheme.themePath) {
|
|
196
|
-
themeProvider.setAttribute('theme-path', customTheme.themePath);
|
|
197
|
-
}
|
|
198
|
-
if (customTheme.themeObject) {
|
|
199
|
-
themeProvider.themeObject = customTheme.themeObject;
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
const toggleTheme = function () {
|
|
203
|
-
const themeProvider = document.querySelector('theme-provider');
|
|
204
|
-
if (!themeProvider) {
|
|
205
|
-
console.error('Theme provider is not initialized');
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
themeProvider.toggleTheme();
|
|
209
|
-
};
|
|
210
52
|
if (typeof window !== 'undefined') {
|
|
211
|
-
window.
|
|
212
|
-
window.
|
|
213
|
-
window.
|
|
214
|
-
window.
|
|
215
|
-
window.
|
|
216
|
-
window.
|
|
53
|
+
window.initializeIsometrikWebchat = runtimeControls.initializeIsometrikWebchat;
|
|
54
|
+
window.destroyIsometrikWebchat = runtimeControls.destroyIsometrikWebchat;
|
|
55
|
+
window.initializeChat = runtimeControls.initializeIsometrikWebchat;
|
|
56
|
+
window.destroyChat = runtimeControls.destroyIsometrikWebchat;
|
|
57
|
+
window.isometrikWebchatApi = runtimeControls.isometrikWebchatApi;
|
|
58
|
+
window.chatSidebarProps = runtimeControls.customChatSidebar;
|
|
59
|
+
window.switchChatTheme = runtimeControls.switchChatTheme;
|
|
60
|
+
window.applyCustomTheme = runtimeControls.applyCustomTheme;
|
|
61
|
+
window.toggleTheme = runtimeControls.toggleTheme;
|
|
217
62
|
}
|
|
218
63
|
|
|
219
64
|
exports.WEB_CHAT_SLOTS = index.WEB_CHAT_SLOTS;
|
|
220
65
|
exports.applyCustomPartProps = index.applyCustomPartProps;
|
|
221
66
|
exports.findWebChatHost = index.findWebChatHost;
|
|
222
67
|
exports.format = utils.format;
|
|
68
|
+
exports.WEB_CHAT_PUBLIC_EVENTS = runtimeControls.WEB_CHAT_PUBLIC_EVENTS;
|
|
69
|
+
exports.WEB_CHAT_PUBLIC_METHODS = runtimeControls.WEB_CHAT_PUBLIC_METHODS;
|
|
70
|
+
exports.applyCustomTheme = runtimeControls.applyCustomTheme;
|
|
71
|
+
exports.buildWebchatSessionKey = runtimeControls.buildWebchatSessionKey;
|
|
72
|
+
exports.clearWebChatSlot = runtimeControls.clearWebChatSlot;
|
|
73
|
+
exports.createSlotHost = runtimeControls.createSlotHost;
|
|
74
|
+
exports.createWebChatApi = runtimeControls.createWebChatApi;
|
|
75
|
+
exports.customChatSidebar = runtimeControls.customChatSidebar;
|
|
76
|
+
exports.defineReactCustomPart = runtimeControls.defineReactCustomPart;
|
|
77
|
+
exports.destroyChat = runtimeControls.destroyChat;
|
|
78
|
+
exports.destroyIsometrikWebchat = runtimeControls.destroyIsometrikWebchat;
|
|
79
|
+
exports.ensureIsometrikWebchat = runtimeControls.ensureIsometrikWebchat;
|
|
80
|
+
exports.getChatStore = runtimeControls.getChatStore;
|
|
81
|
+
exports.initializeChat = runtimeControls.initializeChat;
|
|
82
|
+
exports.initializeIsometrikWebchat = runtimeControls.initializeIsometrikWebchat;
|
|
83
|
+
exports.isometrikWebchatApi = runtimeControls.isometrikWebchatApi;
|
|
84
|
+
exports.mountReactInSlot = runtimeControls.mountReactInSlot;
|
|
85
|
+
exports.releaseIsometrikWebchat = runtimeControls.releaseIsometrikWebchat;
|
|
86
|
+
exports.resolveThemeProvider = runtimeControls.resolveThemeProvider;
|
|
87
|
+
exports.resolveWebChat = runtimeControls.resolveWebChat;
|
|
88
|
+
exports.retainIsometrikWebchat = runtimeControls.retainIsometrikWebchat;
|
|
89
|
+
exports.setWebChatSlot = runtimeControls.setWebChatSlot;
|
|
90
|
+
exports.setWebChatSlots = runtimeControls.setWebChatSlots;
|
|
91
|
+
exports.switchChatTheme = runtimeControls.switchChatTheme;
|
|
92
|
+
exports.toggleTheme = runtimeControls.toggleTheme;
|
|
93
|
+
exports.unmountReactSlot = runtimeControls.unmountReactSlot;
|
|
223
94
|
exports.deriveMessageStatus = contracts.deriveMessageStatus;
|
|
224
|
-
exports.
|
|
225
|
-
exports.
|
|
226
|
-
exports.
|
|
227
|
-
exports.
|
|
95
|
+
exports.THEME_TOKEN_NAMES = sendMedia.THEME_TOKEN_NAMES;
|
|
96
|
+
exports.applyThemeObjectToElement = sendMedia.applyThemeObjectToElement;
|
|
97
|
+
exports.normalizeThemeObject = sendMedia.normalizeThemeObject;
|
|
98
|
+
exports.resolveProfileRailMode = sendMedia.resolveProfileRailMode;
|
|
99
|
+
exports.resolveRegionMode = sendMedia.resolveRegionMode;
|
|
100
|
+
exports.resolveShowProfileRailProp = sendMedia.resolveShowProfileRailProp;
|
|
101
|
+
exports.canUseIndexedDb = client.canUseIndexedDb;
|
|
102
|
+
exports.getOfflineClient = client.getOfflineClient;
|
|
103
|
+
exports.isBrowserOnline = client.isBrowserOnline;
|
|
104
|
+
exports.mergeMessagesById = client.mergeMessagesById;
|
|
228
105
|
exports.defineReactiveCustomPart = defineReactiveCustomPart;
|
|
229
|
-
exports.destroyChat = destroyChat;
|
|
230
|
-
exports.initializeChat = initializeChat;
|
|
231
|
-
exports.switchChatTheme = switchChatTheme;
|
|
232
|
-
exports.toggleTheme = toggleTheme;
|
|
233
106
|
|
|
234
107
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"index.cjs.js","mappings":";;;;;;;;;AAAA;;;;MAkCa,sBAAsB,GAAG;IACpC,WAAW;IACX,qBAAqB;IACrB,gBAAgB;IAChB,oBAAoB;IACpB,aAAa;IACb,WAAW;IACX,2BAA2B;IAC3B,sBAAsB;IACtB,0BAA0B;EACjB;AAIX;MACa,uBAAuB,GAAG;IACrC,oBAAoB;IACpB,UAAU;IACV,WAAW;IACX,UAAU;IACV,YAAY;IACZ,kBAAkB;IAClB,uBAAuB;IACvB,cAAc;;;ACzDhB;;;;SAIgB,wBAAwB,CACtC,GAAW,EACX,QAAkB,EAClB,MAAuD;IAEvD,IAAI,OAAO,cAAc,KAAK,WAAW,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC;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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;;;;;;;;;;;;;;;;;","names":["destroyChatDom"],"sources":["src/lib/custom-ui/public-api.ts","src/lib/custom-ui/define-part.ts","src/index.ts"],"sourcesContent":["/**\n * Public host-facing events + method contract for <web-chat>.\n * Slots/customParts = UI. These = data + actions (fully functional custom UI).\n */\n\nexport type ChatReadyDetail = {\n userMetaData: any;\n conversations: any[];\n};\n\nexport type ConversationsChangeDetail = {\n conversations: any[];\n};\n\nexport type MessagesChangeDetail = {\n conversationId: string | null;\n messages: any[];\n};\n\nexport type SelectionChangeDetail = {\n conversationId: string | null;\n conversation: any | null;\n};\n\nexport type ReplyChangeDetail = {\n replyMessage: any | null;\n};\n\nexport type ChatErrorDetail = {\n code: string;\n message: string;\n cause?: unknown;\n};\n\nexport const WEB_CHAT_PUBLIC_EVENTS = [\n 'chatReady',\n 'conversationsChange',\n 'messagesChange',\n 'conversationSelect',\n 'replyChange',\n 'chatError',\n 'unreadMessageCountUpdated',\n 'conversationNotFound',\n 'messageReadStatusUpdated',\n] as const;\n\nexport type WebChatPublicEvent = (typeof WEB_CHAT_PUBLIC_EVENTS)[number];\n\n/** Documented public @Method names on <web-chat>. */\nexport const WEB_CHAT_PUBLIC_METHODS = [\n 'selectConversation',\n 'sendText',\n 'sendMedia',\n 'setReply',\n 'clearReply',\n 'loadMoreMessages',\n 'loadMoreConversations',\n 'getChatState',\n] as const;\n\nexport type WebChatPublicMethod = (typeof WEB_CHAT_PUBLIC_METHODS)[number];\n","/**\n * Tiny helper to define a reactive customPart CE.\n * Hosts get property setters that re-call `render` when SDK updates props.\n */\nexport function defineReactiveCustomPart(\n tag: string,\n propKeys: string[],\n render: (el: HTMLElement & Record<string, any>) => void,\n): void {\n if (typeof customElements === 'undefined' || customElements.get(tag)) return;\n\n class ReactivePart extends HTMLElement {\n connectedCallback() {\n render(this as any);\n }\n }\n\n propKeys.forEach(key => {\n const store = `_${key}`;\n Object.defineProperty(ReactivePart.prototype, key, {\n get() {\n return (this as any)[store];\n },\n set(value) {\n if ((this as any)[store] === value) return;\n (this as any)[store] = value;\n if (this.isConnected) render(this as any);\n },\n configurable: true,\n });\n });\n\n // Optional: SDK applyCustomPartProps looks for .render()\n (ReactivePart.prototype as any).render = function renderMethod() {\n render(this);\n };\n\n customElements.define(tag, ReactivePart);\n}\n","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"],"version":3}
|
|
1
|
+
{"file":"index.cjs.js","mappings":";;;;;;;;;;;;;;;;AAAA;;;;SAIgB,wBAAwB,CACtC,GAAW,EACX,QAAkB,EAClB,MAAuD;IAEvD,IAAI,OAAO,cAAc,KAAK,WAAW,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO;IAE7E,MAAM,YAAa,SAAQ,WAAW;QACpC,iBAAiB;YACf,MAAM,CAAC,IAAW,CAAC,CAAC;SACrB;KACF;IAED,QAAQ,CAAC,OAAO,CAAC,GAAG;QAClB,MAAM,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;QACxB,MAAM,CAAC,cAAc,CAAC,YAAY,CAAC,SAAS,EAAE,GAAG,EAAE;YACjD,GAAG;gBACD,OAAQ,IAAY,CAAC,KAAK,CAAC,CAAC;aAC7B;YACD,GAAG,CAAC,KAAK;gBACP,IAAK,IAAY,CAAC,KAAK,CAAC,KAAK,KAAK;oBAAE,OAAO;gBAC1C,IAAY,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;gBAC7B,IAAI,IAAI,CAAC,WAAW;oBAAE,MAAM,CAAC,IAAW,CAAC,CAAC;aAC3C;YACD,YAAY,EAAE,IAAI;SACnB,CAAC,CAAC;KACJ,CAAC,CAAC;;IAGF,YAAY,CAAC,SAAiB,CAAC,MAAM,GAAG,SAAS,YAAY;QAC5D,MAAM,CAAC,IAAI,CAAC,CAAC;KACd,CAAC;IAEF,cAAc,CAAC,MAAM,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;AAC3C;;ACsEA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAChC,MAAc,CAAC,0BAA0B,GAAGA,0CAA0B,CAAC;IACvE,MAAc,CAAC,uBAAuB,GAAGC,uCAAuB,CAAC;IACjE,MAAc,CAAC,cAAc,GAAGD,0CAA0B,CAAC;IAC3D,MAAc,CAAC,WAAW,GAAGC,uCAAuB,CAAC;IACrD,MAAc,CAAC,mBAAmB,GAAGC,mCAAmB,CAAC;IACzD,MAAc,CAAC,gBAAgB,GAAGC,iCAAiB,CAAC;IACpD,MAAc,CAAC,eAAe,GAAGC,+BAAe,CAAC;IACjD,MAAc,CAAC,gBAAgB,GAAGC,gCAAgB,CAAC;IACnD,MAAc,CAAC,WAAW,GAAGC,2BAAW,CAAC;AAC5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["initializeIsometrikWebchat","destroyIsometrikWebchat","isometrikWebchatApi","customChatSidebar","switchChatTheme","applyCustomTheme","toggleTheme"],"sources":["src/lib/custom-ui/define-part.ts","src/index.ts"],"sourcesContent":["/**\n * Tiny helper to define a reactive customPart CE.\n * Hosts get property setters that re-call `render` when SDK updates props.\n */\nexport function defineReactiveCustomPart(\n tag: string,\n propKeys: string[],\n render: (el: HTMLElement & Record<string, any>) => void,\n): void {\n if (typeof customElements === 'undefined' || customElements.get(tag)) return;\n\n class ReactivePart extends HTMLElement {\n connectedCallback() {\n render(this as any);\n }\n }\n\n propKeys.forEach(key => {\n const store = `_${key}`;\n Object.defineProperty(ReactivePart.prototype, key, {\n get() {\n return (this as any)[store];\n },\n set(value) {\n if ((this as any)[store] === value) return;\n (this as any)[store] = value;\n if (this.isConnected) render(this as any);\n },\n configurable: true,\n });\n });\n\n // Optional: SDK applyCustomPartProps looks for .render()\n (ReactivePart.prototype as any).render = function renderMethod() {\n render(this);\n };\n\n customElements.define(tag, ReactivePart);\n}\n","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"],"version":3}
|