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
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React → WebChat bridge (no React dependency in this package).
|
|
3
|
+
*
|
|
4
|
+
* Hosts pass their own `createElement` + `createRoot` so the core SDK stays
|
|
5
|
+
* framework-agnostic.
|
|
6
|
+
*
|
|
7
|
+
* 1) Panels (slots): mountReactInSlot → HTMLElement for `slots['profile-rail']`
|
|
8
|
+
* 2) Rows/overlays (customParts): defineReactCustomPart → CE tag for customParts
|
|
9
|
+
*/
|
|
10
|
+
import type { WebChatSlotName } from '../lib/custom-ui';
|
|
11
|
+
export type ReactLike = {
|
|
12
|
+
createElement: (type: any, props: any, ...children: any[]) => any;
|
|
13
|
+
};
|
|
14
|
+
export type ReactRootLike = {
|
|
15
|
+
render: (node: any) => void;
|
|
16
|
+
unmount: () => void;
|
|
17
|
+
};
|
|
18
|
+
export type CreateRootLike = (container: Element) => ReactRootLike;
|
|
19
|
+
/**
|
|
20
|
+
* Wrap a React component as a custom element for `customParts`.
|
|
21
|
+
* SDK assigns props (conversation, onSelect, …); we re-render React.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* import { createElement } from 'react';
|
|
25
|
+
* import { createRoot } from 'react-dom/client';
|
|
26
|
+
* defineReactCustomPart('app-chat-tile', MyTile, {
|
|
27
|
+
* react: { createElement },
|
|
28
|
+
* createRoot,
|
|
29
|
+
* propKeys: ['conversation', 'isSelected', 'unreadCount', 'previewText', 'onSelect'],
|
|
30
|
+
* });
|
|
31
|
+
* initializeIsometrikWebchat({ customParts: { chatTile: 'app-chat-tile' }, … });
|
|
32
|
+
*/
|
|
33
|
+
export declare function defineReactCustomPart(tag: string, Component: any, opts: {
|
|
34
|
+
react: ReactLike;
|
|
35
|
+
createRoot: CreateRootLike;
|
|
36
|
+
/** Prop names the SDK writes on the CE (see lib/custom-ui/contracts.ts). */
|
|
37
|
+
propKeys: string[];
|
|
38
|
+
/** Static props merged into every render. */
|
|
39
|
+
extraProps?: Record<string, unknown>;
|
|
40
|
+
}): string;
|
|
41
|
+
export type ReactSlotHost = HTMLElement & {
|
|
42
|
+
updateProps: (props: Record<string, unknown>) => void;
|
|
43
|
+
unmount: () => void;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Mount a React component into a slot host for panel overrides.
|
|
47
|
+
* Pass the returned element in `slots: { 'profile-rail': el }`.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* const rail = mountReactInSlot('profile-rail', MyProfileRail, {
|
|
51
|
+
* react: { createElement },
|
|
52
|
+
* createRoot,
|
|
53
|
+
* props: { userId: '…' },
|
|
54
|
+
* });
|
|
55
|
+
* initializeIsometrikWebchat({ slots: { 'profile-rail': rail }, … });
|
|
56
|
+
* // later: rail.updateProps({ badge: 3 }); rail.unmount();
|
|
57
|
+
*/
|
|
58
|
+
export declare function mountReactInSlot(slotName: WebChatSlotName, Component: any, opts: {
|
|
59
|
+
react: ReactLike;
|
|
60
|
+
createRoot: CreateRootLike;
|
|
61
|
+
props?: Record<string, unknown>;
|
|
62
|
+
className?: string;
|
|
63
|
+
}): ReactSlotHost;
|
|
64
|
+
export declare function unmountReactSlot(host: HTMLElement | null | undefined): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme / sidebar controls — instance-first (no bare querySelector in happy path).
|
|
3
|
+
*/
|
|
4
|
+
export declare function customChatSidebar(props: {
|
|
5
|
+
isChatFilter?: boolean;
|
|
6
|
+
}, from?: Element | null): void;
|
|
7
|
+
export declare function switchChatTheme(theme: 'dark' | 'light', from?: Element | null): void;
|
|
8
|
+
export declare function applyCustomTheme(customTheme: {
|
|
9
|
+
themePath?: string;
|
|
10
|
+
themeObject?: {
|
|
11
|
+
[key: string]: string;
|
|
12
|
+
};
|
|
13
|
+
}, from?: Element | null): void;
|
|
14
|
+
export declare function toggleTheme(from?: Element | null): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework-agnostic slot helpers.
|
|
3
|
+
* React / Angular / Vue / vanilla all end up calling these with real HTMLElements.
|
|
4
|
+
*
|
|
5
|
+
* Note: avoid `instanceof HTMLElement` — it fails across jsdom realms in Jest.
|
|
6
|
+
*/
|
|
7
|
+
import type { WebChatSlotName } from '../lib/custom-ui';
|
|
8
|
+
/** Attach (or replace) a named slot on <web-chat>. */
|
|
9
|
+
export declare function setWebChatSlot(chatComponent: HTMLElement | null | undefined, slotName: WebChatSlotName, element: HTMLElement): HTMLElement | null;
|
|
10
|
+
/** Remove host content for a named slot. */
|
|
11
|
+
export declare function clearWebChatSlot(chatComponent: HTMLElement | null | undefined, slotName: WebChatSlotName): void;
|
|
12
|
+
/** Create a plain wrapper element ready to receive framework content (e.g. React portal target). */
|
|
13
|
+
export declare function createSlotHost(slotName: WebChatSlotName, className?: string): HTMLElement;
|
|
14
|
+
/** Attach many slots at once (same shape as initialize props.slots). */
|
|
15
|
+
export declare function setWebChatSlots(chatComponent: HTMLElement | null | undefined, slots?: Partial<Record<WebChatSlotName, HTMLElement>>): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public theme token catalog for host apps.
|
|
3
|
+
* Pass values via initializeIsometrikWebchat({ theme: { ... } }) or a CSS file (themeUrl).
|
|
4
|
+
*
|
|
5
|
+
* Apply order: package defaults → themeUrl stylesheet → theme object (wins).
|
|
6
|
+
*
|
|
7
|
+
* Legacy aliases (*-color) still appear in older UI; set both when overriding colors
|
|
8
|
+
* if you need full coverage until those call sites are normalized.
|
|
9
|
+
*/
|
|
10
|
+
export declare const THEME_TOKEN_NAMES: readonly ["--font-primary", "--text-2", "--text-4", "--text-6", "--text-8", "--text-10", "--text-12", "--text-14", "--text-16", "--text-18", "--text-20", "--text-22", "--text-24", "--fw-400", "--fw-500", "--fw-600", "--fw-700", "--bg-primary", "--bg-secondary", "--bg-tertiary", "--bg-input", "--bg-row-hover", "--text-primary", "--text-secondary", "--text-tertiary", "--text-on-brand", "--brand", "--brand-soft", "--brand-muted", "--border", "--border-subtle", "--success", "--danger", "--hover-overlay", "--overlay", "--focus-ring", "--icon", "--svg-icon-filter", "--rail-width", "--control", "--avatar", "--rounded-8", "--rounded-12", "--rounded-full", "--bg-primary-color", "--bg-secondary-color", "--bg-primary-light", "--text-primary-color", "--text-secondary-color", "--text-tertiary-color", "--text-success-color", "--text-danger-color", "--text-warning-color", "--text-info-color", "--text-last-seen"];
|
|
11
|
+
export type ThemeTokenName = (typeof THEME_TOKEN_NAMES)[number];
|
|
12
|
+
/** Host-provided overrides. Keys should be CSS custom property names (with leading --). */
|
|
13
|
+
export type ThemeTokenMap = Partial<Record<ThemeTokenName, string>> & {
|
|
14
|
+
[cssVar: `--${string}`]: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
/** Map short keys → canonical CSS vars (hosts may omit the leading --). */
|
|
17
|
+
export declare function normalizeThemeObject(input?: Record<string, string> | null): Record<string, string>;
|
|
18
|
+
/**
|
|
19
|
+
* Apply theme object as inline CSS variables on a host element.
|
|
20
|
+
* Scoped to the chat root so multiple embeds don't fight over <html>.
|
|
21
|
+
*/
|
|
22
|
+
export declare function applyThemeObjectToElement(el: HTMLElement | null | undefined, theme?: Record<string, string> | null): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bound actions/events for a live <web-chat> instance.
|
|
3
|
+
* No REST imports — safe for unit tests without ChatSDK.
|
|
4
|
+
*/
|
|
5
|
+
import { WEB_CHAT_PUBLIC_EVENTS, WEB_CHAT_PUBLIC_METHODS } from '../lib/custom-ui';
|
|
6
|
+
import type { WebChatPublicEvent } from '../lib/custom-ui';
|
|
7
|
+
export type WebChatApi = {
|
|
8
|
+
selectConversation: (conversationId: string | null) => Promise<void>;
|
|
9
|
+
sendText: (body: string, conversationId?: string) => Promise<unknown>;
|
|
10
|
+
sendMedia: (files: File[] | FileList, conversationId?: string, caption?: string) => Promise<unknown>;
|
|
11
|
+
setReply: (message: any | null) => Promise<void>;
|
|
12
|
+
clearReply: () => Promise<void>;
|
|
13
|
+
loadMoreMessages: () => Promise<void>;
|
|
14
|
+
loadMoreConversations: () => Promise<void>;
|
|
15
|
+
getChatState: () => Promise<Record<string, unknown>>;
|
|
16
|
+
setCustomParts: (parts: Record<string, string>) => Promise<unknown>;
|
|
17
|
+
on: (event: WebChatPublicEvent, handler: (ev: Event) => void) => () => void;
|
|
18
|
+
methods: typeof WEB_CHAT_PUBLIC_METHODS;
|
|
19
|
+
events: typeof WEB_CHAT_PUBLIC_EVENTS;
|
|
20
|
+
};
|
|
21
|
+
/** Bind public methods/events to a mounted <web-chat> element. */
|
|
22
|
+
export declare function createWebChatApi(chatComponent: HTMLElement | null | undefined): WebChatApi | null;
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
# Architecture & implementation guide
|
|
2
|
+
|
|
3
|
+
Generic map of how Isometrik WebChat is structured, how a host app should integrate it, and where to change behavior when extending the SDK.
|
|
4
|
+
|
|
5
|
+
**New to the team?** Start here:
|
|
6
|
+
|
|
7
|
+
- Markdown: [WHY-WE-BUILT-IT-THIS-WAY.md](./WHY-WE-BUILT-IT-THIS-WAY.md)
|
|
8
|
+
- HTML (open in browser): [index.html](./index.html) → [why.html](./why.html)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## ADR: Stencil-only runtime
|
|
13
|
+
|
|
14
|
+
**Status:** Accepted (complete)
|
|
15
|
+
|
|
16
|
+
**Decision:** Production UI and Storybook catalog run on **Stencil** only. Lit / `src/presentational/` / `src/stories/` have been **removed**.
|
|
17
|
+
|
|
18
|
+
**Rules:**
|
|
19
|
+
1. Do **not** import from deleted `stories/` or `presentational/` paths. Enforced by `check:stencil-boundary` + `check:presentational-imports` (both target **0**).
|
|
20
|
+
2. New UI = Stencil under `src/components/ChatUIComponent/`.
|
|
21
|
+
3. Public customization stays host-driven (`customParts` / slots / events) — see [CUSTOMIZATION.md](./CUSTOMIZATION.md).
|
|
22
|
+
4. `WebChat.tsx` stays a thin shell; business logic in `web-chat/*` and `src/lib/*`.
|
|
23
|
+
5. **Storybook** demos Stencil tags via `src/components/**/*.stories.*` (no Lit).
|
|
24
|
+
|
|
25
|
+
**Public API snapshot (do not break without major version):**
|
|
26
|
+
- Bootstrap: `initializeIsometrikWebchat` (alias `initializeChat`), `destroyIsometrikWebchat`, theme helpers, `customChatSidebar`
|
|
27
|
+
- Props: credentials, `slots`, `customParts`, `theme` / `themeUrl`, `show*` region flags
|
|
28
|
+
- Instance API: `chat.api` via `createWebChatApi`; headless: `isometrikWebchatApi`
|
|
29
|
+
- Events: `WEB_CHAT_PUBLIC_EVENTS` in `src/lib/custom-ui/public-api.ts`
|
|
30
|
+
- Methods: `WEB_CHAT_PUBLIC_METHODS` (includes `sendText`, `sendMedia`, `setCustomParts`, …)
|
|
31
|
+
- Guides: [INTEGRATION.md](./INTEGRATION.md), [CUSTOMIZATION.md](./CUSTOMIZATION.md), [theme-tokens.template.css](./theme-tokens.template.css)
|
|
32
|
+
- Theme: scoped to `theme-provider` (opt-in `mirrorToDocument`); runtime helpers resolve via instance store
|
|
33
|
+
- Demos: `/sdk-demos.html`, `/react-host-demo.html` (after `npm start`)
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 1. Product shape
|
|
38
|
+
|
|
39
|
+
WebChat is a **web-component SDK**, not a full-stack app.
|
|
40
|
+
|
|
41
|
+
- **Consumers** install the package and call `initializeChat(props)`.
|
|
42
|
+
- **Contributors** work in `src/`; `npm start` serves the `www/` demo; `npm run build` emits `dist/`.
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
┌──────────────────────────────────────────────────────────┐
|
|
46
|
+
│ Host application (your product) │
|
|
47
|
+
│ auth → credentials → initializeChat() → destroyChat() │
|
|
48
|
+
└────────────────────────────┬─────────────────────────────┘
|
|
49
|
+
│
|
|
50
|
+
┌────────────────────────────▼─────────────────────────────┐
|
|
51
|
+
│ isometrik-webchat │
|
|
52
|
+
│ theme-provider → web-chat (Stencil) │
|
|
53
|
+
│ bootstrap · mqtt · navigation · conversation ops │
|
|
54
|
+
│ ChatUIComponent (Stencil UI) │
|
|
55
|
+
└───────────────┬──────────────────────────┬───────────────┘
|
|
56
|
+
│ │
|
|
57
|
+
▼ ▼
|
|
58
|
+
Isometrik REST MQTT broker (WSS)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 2. How to use (consumer)
|
|
64
|
+
|
|
65
|
+
### Required integration steps
|
|
66
|
+
|
|
67
|
+
1. Authenticate the end user on **your** backend.
|
|
68
|
+
2. Obtain Isometrik `userToken`, `isometrikUserId`, and project credentials.
|
|
69
|
+
3. Provide a sized DOM container.
|
|
70
|
+
4. Call `initializeChat({ containerId, ...creds })`.
|
|
71
|
+
5. Call `destroyChat()` on logout or when unmounting the chat surface.
|
|
72
|
+
|
|
73
|
+
### Minimal contract
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
initializeChat({
|
|
77
|
+
containerId: string; // optional — defaults to body
|
|
78
|
+
licenseKey: string;
|
|
79
|
+
appSecret: string;
|
|
80
|
+
userSecret: string;
|
|
81
|
+
userToken: string;
|
|
82
|
+
isometrikUserId: string;
|
|
83
|
+
accountId: string;
|
|
84
|
+
projectId: string;
|
|
85
|
+
keysetId: string;
|
|
86
|
+
baseUrl?: string;
|
|
87
|
+
hostUrl?: string;
|
|
88
|
+
defaultTheme?: 'light' | 'dark';
|
|
89
|
+
themeUrl?: string;
|
|
90
|
+
});
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Framework pattern
|
|
94
|
+
|
|
95
|
+
Any SPA framework follows the same lifecycle:
|
|
96
|
+
|
|
97
|
+
| Framework hook | Call |
|
|
98
|
+
|----------------|------|
|
|
99
|
+
| Mount / `useEffect` | `initializeChat(...)` |
|
|
100
|
+
| Unmount / cleanup | `destroyChat()` |
|
|
101
|
+
|
|
102
|
+
Chat is **client-only** (DOM + WebSocket). Do not initialize on the server.
|
|
103
|
+
|
|
104
|
+
Full consumer docs live in the root [README](../readme.md).
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## 3. How to implement features (contributor)
|
|
109
|
+
|
|
110
|
+
### Decide which layer to touch
|
|
111
|
+
|
|
112
|
+
| Goal | Touch |
|
|
113
|
+
|------|--------|
|
|
114
|
+
| Change mount / public API | `src/index.ts` |
|
|
115
|
+
| Startup order / first load | `…/web-chat/bootstrap.ts` |
|
|
116
|
+
| Incoming realtime events | `…/mqtt-bridge.ts` → `src/lib/mqtt/dispatch.ts` |
|
|
117
|
+
| Open chat / URL behavior | `…/navigation.ts` |
|
|
118
|
+
| Clear, delete, block, delete-message | `…/conversation-ops.ts` |
|
|
119
|
+
| Fetch conversations / messages | `src/lib/chat/` |
|
|
120
|
+
| Sidebar layout / chrome | Stencil `ChatUIComponent/` |
|
|
121
|
+
| Sidebar data / pagination | smart component `ChatUIComponent/ChatSidebar/` |
|
|
122
|
+
| Shared bubble / toast / tile | `ChatUIComponent/shared/` |
|
|
123
|
+
| Toast / dialogs | `src/lib/toast.ts`, `src/lib/drawer.ts` |
|
|
124
|
+
| REST one-offs | `src/api/` |
|
|
125
|
+
| Reactive shared state | `src/store/` |
|
|
126
|
+
|
|
127
|
+
### Smart vs presentational UI
|
|
128
|
+
|
|
129
|
+
- **Smart** (`src/components/ChatUIComponent/*`): Stencil with props, stores, API/SDK calls, custom events.
|
|
130
|
+
- **Presentational:** Stencil under `shared/` (paint-only).
|
|
131
|
+
- **Custom UI**: `customParts` with SDK props/callbacks; slots = layout only; events/methods = headless. See [CUSTOMIZATION.md](./CUSTOMIZATION.md).
|
|
132
|
+
|
|
133
|
+
Pattern: smart Stencil tag owns data; shared Stencil paints UI.
|
|
134
|
+
|
|
135
|
+
### Freeze: no Lit
|
|
136
|
+
|
|
137
|
+
Lit is not a dependency. Do not add Lit UI.
|
|
138
|
+
|
|
139
|
+
### Adding a new MQTT action
|
|
140
|
+
|
|
141
|
+
1. Parse payload in `lib/mqtt/parse.ts` if needed.
|
|
142
|
+
2. Handle the action in `lib/mqtt/dispatch.ts`.
|
|
143
|
+
3. Expose any UI updates through the context built in `mqtt-bridge.ts`.
|
|
144
|
+
4. Keep `WebChat.tsx` as wiring only — avoid dumping new business logic into the shell.
|
|
145
|
+
|
|
146
|
+
### Adding a new conversation mutation
|
|
147
|
+
|
|
148
|
+
Prefer `conversation-ops.ts` (or `lib/chat`) over inlining SDK calls inside render methods.
|
|
149
|
+
|
|
150
|
+
### Local demo vs published package
|
|
151
|
+
|
|
152
|
+
| Path | Role |
|
|
153
|
+
|------|------|
|
|
154
|
+
| `src/` | Edit here |
|
|
155
|
+
| `www/` | Dev playground from `npm start` |
|
|
156
|
+
| `www/build/` | Generated — do not hand-edit |
|
|
157
|
+
| `dist/` | What npm consumers get |
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## 4. Runtime flow
|
|
162
|
+
|
|
163
|
+
### MQTT realtime
|
|
164
|
+
|
|
165
|
+
- `MqttSession` — connect / subscribe / teardown (idempotent; listens to `offline` + `reconnect`)
|
|
166
|
+
- Auto-reconnect via mqtt.js (`reconnectPeriod` ~2s) — **not** disabled
|
|
167
|
+
- On each connect: `resubscribe()` + soft **gap-fill** (merge messages, no thread wipe)
|
|
168
|
+
- While offline: light REST poll on the open conversation only
|
|
169
|
+
- Inbound events run on a **serial queue** per host (no raced `@State` updates)
|
|
170
|
+
|
|
171
|
+
### Offline / reliability (`src/lib/offline`)
|
|
172
|
+
|
|
173
|
+
- IndexedDB `isometrik-webchat-v1` (memory fallback)
|
|
174
|
+
- Cache conversations + messages; hydrate on boot / chat open
|
|
175
|
+
- Text **outbox** + flush on `online` / MQTT connect
|
|
176
|
+
- Multi-tab via `BroadcastChannel`
|
|
177
|
+
- See [RELIABILITY.md](./RELIABILITY.md)
|
|
178
|
+
|
|
179
|
+
### Startup (`bootstrap`)
|
|
180
|
+
|
|
181
|
+
1. Resolve device id
|
|
182
|
+
2. Initialize Chat SDK with credentials
|
|
183
|
+
3. Connect MQTT session
|
|
184
|
+
4. Load user details
|
|
185
|
+
5. If URL/deep-link has a conversation or groupcast → load that thread
|
|
186
|
+
6. Load unread counts into store
|
|
187
|
+
7. Load conversation list
|
|
188
|
+
8. Hide loading state
|
|
189
|
+
|
|
190
|
+
### Realtime
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
MQTT message
|
|
194
|
+
→ MqttSession onMessage
|
|
195
|
+
→ mqtt-bridge context
|
|
196
|
+
→ dispatchMqttMessage
|
|
197
|
+
→ update @State / stores
|
|
198
|
+
→ Stencil re-render
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Opening a chat
|
|
202
|
+
|
|
203
|
+
User selects a conversation in the sidebar → navigation helpers update selection / URL → shell loads messages + attachments → body/footer render the thread.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## 5. Folder map (source)
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
src/
|
|
211
|
+
├── index.ts Public SDK API
|
|
212
|
+
├── components/
|
|
213
|
+
│ ├── chat-main.tsx Dev host (<chat-app>)
|
|
214
|
+
│ ├── theme-provider.tsx
|
|
215
|
+
│ ├── Login.tsx / Signup.tsx
|
|
216
|
+
│ ├── my-component/web-chat/
|
|
217
|
+
│ │ ├── WebChat.tsx Shell
|
|
218
|
+
│ │ ├── bootstrap.ts
|
|
219
|
+
│ │ ├── mqtt-bridge.ts
|
|
220
|
+
│ │ ├── navigation.ts
|
|
221
|
+
│ │ ├── conversation-ops.ts
|
|
222
|
+
│ │ ├── WebchatRightSide.tsx
|
|
223
|
+
│ │ └── FLOW.ts In-repo flow pointer
|
|
224
|
+
│ └── ChatUIComponent/ Stencil UI + shared/
|
|
225
|
+
├── lib/chat/ REST/session helpers
|
|
226
|
+
├── lib/mqtt/ Realtime pipeline
|
|
227
|
+
├── api/ Extra REST helpers
|
|
228
|
+
├── store/ Stencil stores
|
|
229
|
+
└── constants/ Config / copy (dev creds local only)
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## 6. Key web-component tags
|
|
235
|
+
|
|
236
|
+
| Tag | Role |
|
|
237
|
+
|-----|------|
|
|
238
|
+
| `chat-app` | Local demo host |
|
|
239
|
+
| `theme-provider` | Theme CSS / mode |
|
|
240
|
+
| `web-chat` | Main chat shell |
|
|
241
|
+
| Sidebar / body / header / footer tags | Chat surfaces |
|
|
242
|
+
| Right sidebar | Contact / profile / media |
|
|
243
|
+
|
|
244
|
+
Always check the smart component’s render output when wiring events.
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## 7. Testing checklist after structural changes
|
|
249
|
+
|
|
250
|
+
- [ ] `initializeChat` mounts and fills the container
|
|
251
|
+
- [ ] Conversation list loads
|
|
252
|
+
- [ ] Open DM + group conversation
|
|
253
|
+
- [ ] Send text / image / file
|
|
254
|
+
- [ ] MQTT: receive message while chat open and while on another thread
|
|
255
|
+
- [ ] Unread badge updates
|
|
256
|
+
- [ ] `destroyChat` disconnects MQTT and removes DOM
|
|
257
|
+
- [ ] Mobile layout (≤768px)
|
|
258
|
+
- [ ] Theme switch light/dark
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## 8. Design rules (keep the architecture healthy)
|
|
263
|
+
|
|
264
|
+
1. **Shell stays thin** — `WebChat.tsx` wires; modules own logic.
|
|
265
|
+
2. **One place per concern** — MQTT dispatch, bootstrap, ops, fetches.
|
|
266
|
+
3. **No secrets in published artifacts** — consumers pass credentials.
|
|
267
|
+
4. **Idempotent mount** — re-init destroys the previous instance.
|
|
268
|
+
5. **Cleanup on disconnect** — timers, MQTT, listeners.
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
See also: root [README](../readme.md) for install, API, theming, and security.
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# Customization (production guide)
|
|
2
|
+
|
|
3
|
+
**Host paints UI**, **SDK keeps chat functionality** (REST, MQTT, send, select, reply, …).
|
|
4
|
+
|
|
5
|
+
| Priority | Mechanism | Use when |
|
|
6
|
+
|----------|-----------|----------|
|
|
7
|
+
| **1 — Primary** | `customParts` | Custom bubbles, tiles, rows, overlays — SDK passes **props + callbacks** |
|
|
8
|
+
| **2 — Secondary** | Named **slots** | Replace whole **layout panels** (no per-row props) |
|
|
9
|
+
| **3 — Advanced** | Events + methods | Fully headless chrome (own sidebar + composer) |
|
|
10
|
+
|
|
11
|
+
Default Isometrik UI remains when you pass nothing.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Quick start (recommended)
|
|
16
|
+
|
|
17
|
+
Set `customParts` **only on `<web-chat>`** (prop or `setCustomParts()`). The shell
|
|
18
|
+
forwards tags to `web-chat-body` / `chat-side-bar`. Do not `querySelector` children
|
|
19
|
+
to assign parts — that fights Stencil re-renders.
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
import {
|
|
23
|
+
initializeChat,
|
|
24
|
+
defineReactiveCustomPart,
|
|
25
|
+
} from 'isometrik-webchat';
|
|
26
|
+
|
|
27
|
+
defineReactiveCustomPart(
|
|
28
|
+
'my-chat-tile',
|
|
29
|
+
['conversation', 'isSelected', 'unreadCount', 'previewText', 'onSelect'],
|
|
30
|
+
el => {
|
|
31
|
+
const c = el.conversation || {};
|
|
32
|
+
el.innerHTML = `<b>${c.conversationTitle || ''}</b> ${c.metaData?.orderId || ''}`;
|
|
33
|
+
el.onclick = () => el.onSelect?.(c.conversationId);
|
|
34
|
+
},
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
defineReactiveCustomPart(
|
|
38
|
+
'my-message-bubble',
|
|
39
|
+
['message', 'isSelf', 'status', 'onReply', 'onForward', 'onDelete', 'onTap'],
|
|
40
|
+
el => {
|
|
41
|
+
const m = el.message || {};
|
|
42
|
+
el.innerHTML = `
|
|
43
|
+
<div style="text-align:${el.isSelf ? 'right' : 'left'}">
|
|
44
|
+
<div>${m.body || m.customType || '[media]'}</div>
|
|
45
|
+
<small>${el.status || ''}</small>
|
|
46
|
+
<button data-a="reply">Reply</button>
|
|
47
|
+
</div>`;
|
|
48
|
+
el.querySelector('[data-a=reply]')?.addEventListener('click', e => {
|
|
49
|
+
e.stopPropagation();
|
|
50
|
+
el.onReply?.(m);
|
|
51
|
+
});
|
|
52
|
+
el.onclick = () => el.onTap?.(m);
|
|
53
|
+
},
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const { chatComponent } = initializeChat({
|
|
57
|
+
// …creds
|
|
58
|
+
customParts: {
|
|
59
|
+
chatTile: 'my-chat-tile',
|
|
60
|
+
messageBubble: 'my-message-bubble',
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`defineReactiveCustomPart` adds property setters so SDK updates re-paint. You can also ship your own CE with a `.render()` method — `applyCustomPartProps` calls it.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## `customParts` catalog
|
|
70
|
+
|
|
71
|
+
| Key | Contract | Notes |
|
|
72
|
+
|-----|----------|--------|
|
|
73
|
+
| `chatTile` | `ChatTileProps` | Conversation list row; `conversation.metaData` |
|
|
74
|
+
| `messageBubble` | `MessageBubbleProps` | All message types; host renders media/text |
|
|
75
|
+
| `groupcastTile` | `GroupcastTileProps` | Falls back to `chatTile` if unset |
|
|
76
|
+
| `messageDatePill` | `MessageDatePillProps` | Date separators |
|
|
77
|
+
| `searchResult` | `SearchResultProps` | Message search hits |
|
|
78
|
+
| `memberRow` | `MemberRowProps` | Contact/group member rows |
|
|
79
|
+
| `forwardDialog` | `OverlayDialogProps` | Forward picker |
|
|
80
|
+
| `addMember` | `OverlayDialogProps` | Add member dialog |
|
|
81
|
+
| `mediaGallery` | `MediaGalleryProps` | Lightbox |
|
|
82
|
+
| `contextMenu` | `ContextMenuProps` | Right-click menu |
|
|
83
|
+
| `blockList` | `BlockListProps` | Blocked users |
|
|
84
|
+
| `toast` | `ToastPartProps` | Toasts via `showToast` |
|
|
85
|
+
|
|
86
|
+
### Message bubble callbacks (SDK owns behavior)
|
|
87
|
+
|
|
88
|
+
| Callback | SDK action |
|
|
89
|
+
|----------|------------|
|
|
90
|
+
| `onTap` | Opens actions sheet |
|
|
91
|
+
| `onReply` | Sets reply target |
|
|
92
|
+
| `onForward` | Forward dialog |
|
|
93
|
+
| `onDelete` | Delete dialog |
|
|
94
|
+
| `onInfo` | Read/delivery info (self) |
|
|
95
|
+
|
|
96
|
+
### Chat tile callbacks
|
|
97
|
+
|
|
98
|
+
| Callback | SDK action |
|
|
99
|
+
|----------|------------|
|
|
100
|
+
| `onSelect(conversationId)` | Opens that conversation |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Slots (layout only)
|
|
105
|
+
|
|
106
|
+
Do **not** expect per-message props inside `slot="messages"` — use `customParts.messageBubble`.
|
|
107
|
+
|
|
108
|
+
Whole regions: `sidebar`, `header`, `messages`, `composer`, `empty`, `right-panel`, `boot-loader`
|
|
109
|
+
Finer: `profile-rail`, `conversation-list`, `profile-page`, `group-cast`, `reply-preview`, `attachment-preview`, `composer-input`, `contact-info`, `profile-info`, `message-search`
|
|
110
|
+
Overlays (clone or `customParts`): `forward-dialog`, `add-member`, `message-info`, `media-gallery`, `context-menu`, `block-list`, `toast`
|
|
111
|
+
|
|
112
|
+
### Region matrix (all major panels)
|
|
113
|
+
|
|
114
|
+
Same rule for `profile-rail`, `sidebar`, `conversation-list`, `profile-page`, `group-cast`, `header`, `messages`, `composer`, `empty`, `right-panel`, `boot-loader`:
|
|
115
|
+
|
|
116
|
+
| `show*` flag | named slot | Result |
|
|
117
|
+
|--------------|------------|--------|
|
|
118
|
+
| `false` | anything | Hidden (flag wins) |
|
|
119
|
+
| `true` / default | provided | Host element |
|
|
120
|
+
| `true` / default | omitted | SDK default |
|
|
121
|
+
|
|
122
|
+
**Show flags:** `showProfileSidebar` / `showProfileRail`, `showHeader`, `showComposer`, `showEmptyState`, `showConversationList`, `showRightPanel`, `showChatWallpaper`, `groupcastEnabled`
|
|
123
|
+
|
|
124
|
+
```js
|
|
125
|
+
initializeIsometrikWebchat({
|
|
126
|
+
// …creds
|
|
127
|
+
showProfileSidebar: true,
|
|
128
|
+
showHeader: true,
|
|
129
|
+
slots: { 'profile-rail': myRailElement }, // omit for default
|
|
130
|
+
});
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Full integration (React / Angular / Vue / theme / APIs): [INTEGRATION.md](./INTEGRATION.md)
|
|
134
|
+
|
|
135
|
+
```html
|
|
136
|
+
<web-chat>
|
|
137
|
+
<div slot="empty">Start a conversation</div>
|
|
138
|
+
</web-chat>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Advanced: headless events + methods
|
|
144
|
+
|
|
145
|
+
### Events
|
|
146
|
+
|
|
147
|
+
`chatReady`, `conversationsChange`, `messagesChange`, `conversationSelect`, `replyChange`, `chatError`, plus existing unread / not-found / read-status events.
|
|
148
|
+
|
|
149
|
+
### Methods
|
|
150
|
+
|
|
151
|
+
| Method | Purpose |
|
|
152
|
+
|--------|---------|
|
|
153
|
+
| `selectConversation(id \| null)` | Open / clear thread |
|
|
154
|
+
| `sendText(body, conversationId?)` | Send text (honors reply) |
|
|
155
|
+
| `sendMedia(files, conversationId?, caption?)` | Presign → upload → post (honors reply) |
|
|
156
|
+
| `setReply` / `clearReply` | Reply target |
|
|
157
|
+
| `loadMoreMessages` / `loadMoreConversations` | Pagination |
|
|
158
|
+
| `getChatState()` | Snapshot |
|
|
159
|
+
|
|
160
|
+
```js
|
|
161
|
+
chatComponent.addEventListener('conversationsChange', e => {
|
|
162
|
+
renderMySidebar(e.detail.conversations);
|
|
163
|
+
});
|
|
164
|
+
await chatComponent.selectConversation(id);
|
|
165
|
+
await chatComponent.sendText('hello');
|
|
166
|
+
await chatComponent.sendMedia(fileInput.files, id, 'caption');
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
`sendMedia` is for **conversations** (same path as the default composer). Groupcast media still uses the built-in groupcast UI.
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## React / Next.js
|
|
174
|
+
|
|
175
|
+
1. Mount chat only on the **client** (`'use client'` / dynamic `ssr: false`).
|
|
176
|
+
2. `customElements.define` / `defineReactiveCustomPart` in `useEffect` (browser only).
|
|
177
|
+
3. Pass `customParts` into `initializeChat` — tags are strings, not React components.
|
|
178
|
+
4. Read **properties** on your CE (`el.conversation`), not HTML attributes — Isometrik objects are not serializable to attributes.
|
|
179
|
+
|
|
180
|
+
```tsx
|
|
181
|
+
'use client';
|
|
182
|
+
import { useEffect } from 'react';
|
|
183
|
+
import { initializeChat, defineReactiveCustomPart } from 'isometrik-webchat';
|
|
184
|
+
|
|
185
|
+
export function ChatIsland(props) {
|
|
186
|
+
useEffect(() => {
|
|
187
|
+
defineReactiveCustomPart('app-chat-tile', ['conversation', 'onSelect'], el => {
|
|
188
|
+
/* paint */
|
|
189
|
+
});
|
|
190
|
+
const instance = initializeChat({ ...props, customParts: { chatTile: 'app-chat-tile' } });
|
|
191
|
+
return () => instance?.destroy?.();
|
|
192
|
+
}, []);
|
|
193
|
+
return <div id="isometrik-chat-root" />;
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Same pattern works in Vue/Angular: register CEs once, pass tag names.
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Multi-instance
|
|
202
|
+
|
|
203
|
+
Always resolve parts from the owning host (`findWebChatHost(el)`). Do not assume a single `document.querySelector('web-chat')`.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Local demo
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
npm start
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
- Guide page: [/custom-ui-demo.html](http://localhost:3333/custom-ui-demo.html)
|
|
214
|
+
- Live: [/?demoCustomUi=1](http://localhost:3333/?demoCustomUi=1) — demo tile/bubble + empty slot + console event log
|
|
215
|
+
|
|
216
|
+
### Storybook (UI catalog)
|
|
217
|
+
|
|
218
|
+
Storybook demos **Stencil** tags only (no Lit).
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
npm run build
|
|
222
|
+
npm run storybook
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Look under **Stencil/** in the sidebar. New UI: implement in Stencil → add a `*.stories.js` next to it.
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Production checklist
|
|
230
|
+
|
|
231
|
+
- [ ] Register CE tags before `initializeChat`
|
|
232
|
+
- [ ] CEs re-paint on prop updates (setters or `.render()`)
|
|
233
|
+
- [ ] Use `onSelect` / `onReply` / … — do not re-implement APIs
|
|
234
|
+
- [ ] Headless composer: `sendText` + `sendMedia`
|
|
235
|
+
- [ ] Listen to `chatError` for failed sends
|
|
236
|
+
- [ ] Client-only mount in SSR frameworks
|