isometrik-plugin-chat-sdk 2.0.12 → 2.0.14
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-c433d8a6.js → app-globals-95486d77.js} +2 -2
- package/dist/cjs/{app-globals-c433d8a6.js.map → app-globals-95486d77.js.map} +1 -1
- package/dist/cjs/attachment-preview_22.cjs.entry.js +65 -57
- package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
- package/dist/cjs/audio-bubble_4.cjs.entry.js +3 -2
- package/dist/cjs/audio-bubble_4.cjs.entry.js.map +1 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/isometrik-webchat.cjs.js +4 -4
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/login-page_3.cjs.entry.js +88 -35
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/cjs/{runtime-controls-95f6cb3b.js → runtime-controls-959fe6ed.js} +4 -2
- package/dist/cjs/runtime-controls-959fe6ed.js.map +1 -0
- package/dist/cjs/{send-media-37e09e83.js → send-media-2dadbb03.js} +98 -19
- package/dist/cjs/send-media-2dadbb03.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +53 -12
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +12 -32
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js +11 -6
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +5 -5
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/GroupCast/GroupCast.js +2 -2
- package/dist/collection/components/ChatUIComponent/shared/GroupCast/GroupCast.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.js +21 -2
- package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/WebChat.js +19 -0
- package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/data-fetch.js +13 -3
- package/dist/collection/components/my-component/web-chat/data-fetch.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/shell-render.js +1 -1
- package/dist/collection/components/my-component/web-chat/shell-render.js.map +1 -1
- package/dist/collection/lib/chat/index.js +1 -1
- package/dist/collection/lib/chat/index.js.map +1 -1
- package/dist/collection/lib/chat/send-media.js +96 -18
- package/dist/collection/lib/chat/send-media.js.map +1 -1
- package/dist/collection/lib/mqtt/dispatch.js +56 -31
- package/dist/collection/lib/mqtt/dispatch.js.map +1 -1
- package/dist/collection/lib/mqtt/index.js +1 -1
- package/dist/collection/lib/mqtt/index.js.map +1 -1
- package/dist/collection/lib/mqtt/types.js +17 -0
- package/dist/collection/lib/mqtt/types.js.map +1 -1
- package/dist/collection/sdk/init.js +2 -0
- package/dist/collection/sdk/init.js.map +1 -1
- package/dist/components/ChatFooter.js +12 -32
- package/dist/components/ChatFooter.js.map +1 -1
- package/dist/components/ChatSidebar.js +36 -12
- package/dist/components/ChatSidebar.js.map +1 -1
- package/dist/components/GroupCast2.js +2 -2
- package/dist/components/GroupCast2.js.map +1 -1
- package/dist/components/WebChat.js +88 -34
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/WebChatBody.js +6 -6
- package/dist/components/WebChatBody.js.map +1 -1
- package/dist/components/WebChatHeader.js +11 -6
- package/dist/components/WebChatHeader.js.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/send-media.js +97 -19
- package/dist/components/send-media.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-dfce8a5b.js → app-globals-879c137f.js} +2 -2
- package/dist/esm/{app-globals-dfce8a5b.js.map → app-globals-879c137f.js.map} +1 -1
- package/dist/esm/attachment-preview_22.entry.js +65 -57
- package/dist/esm/attachment-preview_22.entry.js.map +1 -1
- package/dist/esm/audio-bubble_4.entry.js +3 -2
- package/dist/esm/audio-bubble_4.entry.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/isometrik-webchat.js +4 -4
- package/dist/esm/loader.js +4 -4
- package/dist/esm/login-page_3.entry.js +88 -35
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/esm/{runtime-controls-ec6d5c75.js → runtime-controls-6b7c852a.js} +4 -2
- package/dist/esm/runtime-controls-6b7c852a.js.map +1 -0
- package/dist/esm/{send-media-a946c6dd.js → send-media-ac360d8e.js} +98 -20
- package/dist/esm/send-media-ac360d8e.js.map +1 -0
- package/dist/isometrik-webchat/index.esm.js +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-46dcd38f.js → p-217b9dc2.js} +2 -2
- package/dist/isometrik-webchat/p-217b9dc2.js.map +1 -0
- package/dist/isometrik-webchat/p-2c87c3fd.entry.js +2 -0
- package/dist/isometrik-webchat/p-2c87c3fd.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-30855ba7.js +2 -0
- package/dist/isometrik-webchat/p-30855ba7.js.map +1 -0
- package/dist/isometrik-webchat/{p-cc5b86e6.entry.js → p-3120b9d3.entry.js} +2 -2
- package/dist/isometrik-webchat/p-3120b9d3.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-63ff4eea.entry.js.map → p-5672fae7.entry.js} +2 -1
- package/dist/isometrik-webchat/p-5672fae7.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-79d1a171.js +2 -0
- package/dist/types/components/ChatUIComponent/ChatSidebar/ChatSidebar.d.ts +2 -0
- package/dist/types/components/ChatUIComponent/shared/video-message/video-message.d.ts +2 -0
- package/dist/types/components/my-component/web-chat/WebChat.d.ts +322 -0
- package/dist/types/components/my-component/web-chat/data-fetch.d.ts +14 -0
- package/dist/types/components.d.ts +24 -0
- package/dist/types/lib/chat/index.d.ts +1 -1
- package/dist/types/lib/chat/send-media.d.ts +21 -0
- package/dist/types/lib/mqtt/index.d.ts +1 -1
- package/dist/types/lib/mqtt/types.d.ts +11 -0
- package/dist/types/sdk/init.d.ts +7 -0
- package/package.json +1 -1
- package/dist/cjs/runtime-controls-95f6cb3b.js.map +0 -1
- package/dist/cjs/send-media-37e09e83.js.map +0 -1
- package/dist/components/urls.js +0 -5
- package/dist/components/urls.js.map +0 -1
- package/dist/esm/runtime-controls-ec6d5c75.js.map +0 -1
- package/dist/esm/send-media-a946c6dd.js.map +0 -1
- package/dist/isometrik-webchat/p-2d69086d.entry.js +0 -2
- package/dist/isometrik-webchat/p-2d69086d.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-3f355f9e.js +0 -2
- package/dist/isometrik-webchat/p-3f355f9e.js.map +0 -1
- package/dist/isometrik-webchat/p-46dcd38f.js.map +0 -1
- package/dist/isometrik-webchat/p-63ff4eea.entry.js +0 -2
- package/dist/isometrik-webchat/p-86be30fe.js +0 -2
- package/dist/isometrik-webchat/p-cc5b86e6.entry.js.map +0 -1
- /package/dist/isometrik-webchat/{p-86be30fe.js.map → p-79d1a171.js.map} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as s,d as a,e as o,r as n,a as t,b as i,c as r,m as f,f as d,u as e,s as p,g as m,t as c,h as u,j as w}from"./p-30855ba7.js";import{T as j}from"./p-1953573d.js";function b(){if(typeof window==="undefined")return;const b=window;b.initializeIsometrikWebchat=s;b.destroyIsometrikWebchat=a;b.ensureIsometrikWebchat=o;b.retainIsometrikWebchat=n;b.releaseIsometrikWebchat=t;b.initializeChat=s;b.destroyChat=a;b.isometrikWebchatApi=i;b.createWebChatApi=r;b.THEME_TOKEN_NAMES=j;b.mountReactInSlot=f;b.defineReactCustomPart=d;b.unmountReactSlot=e;b.switchChatTheme=p;b.applyCustomTheme=m;b.toggleTheme=c;b.resolveThemeProvider=u;b.resolveWebChat=w}const g=b;export{g};
|
|
2
|
+
//# sourceMappingURL=p-79d1a171.js.map
|
|
@@ -13,6 +13,8 @@ import '../shared/new-chat-sidebar/new-chat-sidebar';
|
|
|
13
13
|
export declare class ChatSidebar {
|
|
14
14
|
el: HTMLElement;
|
|
15
15
|
isMqttConnected: boolean;
|
|
16
|
+
/** When false, hide the MQTT connection status dot. Default true. */
|
|
17
|
+
showMqttStatus: boolean;
|
|
16
18
|
conversationList: any;
|
|
17
19
|
isChatFilter: boolean;
|
|
18
20
|
isAllChatButton: boolean;
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import '../../ChatUIComponent/shared/spinner-loader/spinner-loader';
|
|
3
|
+
import '../../ChatUIComponent/ChatSidebar/ChatSidebar';
|
|
4
|
+
import '../../ChatUIComponent/shared/GroupCast/GroupCast';
|
|
5
|
+
import '../../ChatUIComponent/Header/WebChatHeader';
|
|
6
|
+
import '../../ChatUIComponent/Footer/ChatFooter';
|
|
7
|
+
import '../../ChatUIComponent/ChatOwnProfile/Profile';
|
|
8
|
+
import '../../ChatUIComponent/shared/profile sidebar/profile-sidebar';
|
|
9
|
+
import '../../ChatUIComponent/shared/contact-info/contact-info';
|
|
10
|
+
import './WebchatRightSide';
|
|
11
|
+
import '../../ChatUIComponent/shared/chat-loading-placeholder/chat-loading-placeholder';
|
|
12
|
+
import type { WebChatCustomParts } from '../../../lib/custom-ui';
|
|
13
|
+
import type { ChatReadyDetail, ConversationsChangeDetail, MessagesChangeDetail, SelectionChangeDetail, ReplyChangeDetail, ChatErrorDetail } from '../../../lib/custom-ui/public-api';
|
|
14
|
+
import './FLOW';
|
|
15
|
+
/**
|
|
16
|
+
* <web-chat> shell — props/state, @Listen, render.
|
|
17
|
+
* Logic map: see FLOW.ts
|
|
18
|
+
* Custom UI: named slots (panels) + customParts (list item CE tags). See lib/custom-ui.
|
|
19
|
+
*/
|
|
20
|
+
export declare class WebChat {
|
|
21
|
+
el: HTMLElement;
|
|
22
|
+
/**
|
|
23
|
+
* Host CE tags for rows/overlays (messageBubble, chatTile, …).
|
|
24
|
+
* Set once on <web-chat> — shell forwards to body/sidebar. Do not poke child DOM.
|
|
25
|
+
* Prefer assign before appendChild, or call setCustomParts() after componentOnReady.
|
|
26
|
+
*/
|
|
27
|
+
customParts?: WebChatCustomParts;
|
|
28
|
+
name: string;
|
|
29
|
+
baseUrl: string;
|
|
30
|
+
licenseKey: string;
|
|
31
|
+
appSecret: string;
|
|
32
|
+
userSecret: string;
|
|
33
|
+
userToken: string;
|
|
34
|
+
themeUrl: string;
|
|
35
|
+
defaultTheme: string;
|
|
36
|
+
isometrikUserId: string;
|
|
37
|
+
projectId: string;
|
|
38
|
+
keysetId: string;
|
|
39
|
+
accountId: string;
|
|
40
|
+
conversationId: string;
|
|
41
|
+
hostUrl?: string;
|
|
42
|
+
/** When false, groupcast entry points are disabled. Default true. */
|
|
43
|
+
groupcastEnabled: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Show the left profile icon rail (Chat / Profile / Groupcast).
|
|
46
|
+
* - `false` → hidden (wins over a custom `slot="profile-rail"`)
|
|
47
|
+
* - `true` + `slot="profile-rail"` → host UI
|
|
48
|
+
* - `true` + no slot → default `<profile-sidebar>`
|
|
49
|
+
* Init alias: `showProfileSidebar` maps to this prop.
|
|
50
|
+
* Default true for backward compatibility.
|
|
51
|
+
*/
|
|
52
|
+
showProfileRail: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* When false, chat pane uses a flat surface (no doodle wallpaper).
|
|
55
|
+
* Default true for backward compatibility.
|
|
56
|
+
*/
|
|
57
|
+
showChatWallpaper: boolean;
|
|
58
|
+
/** When false, hide the conversation header. Default true. */
|
|
59
|
+
showHeader: boolean;
|
|
60
|
+
/** When false, hide the composer / footer. Default true. */
|
|
61
|
+
showComposer: boolean;
|
|
62
|
+
/** When false, hide the empty-state panel. Default true. */
|
|
63
|
+
showEmptyState: boolean;
|
|
64
|
+
/** When false, hide the conversation list (Chat tab). Default true. */
|
|
65
|
+
showConversationList: boolean;
|
|
66
|
+
/** When false, never show the right info rail. Default true. */
|
|
67
|
+
showRightPanel: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* When false, hide the MQTT connection status dot in the conversation list header.
|
|
70
|
+
* Default true so hosts/users can verify realtime without digging into logs.
|
|
71
|
+
*/
|
|
72
|
+
showMqttStatus: boolean;
|
|
73
|
+
unreadConversations: any;
|
|
74
|
+
allLinks: any;
|
|
75
|
+
allLinksCount: any;
|
|
76
|
+
isInitialized: boolean;
|
|
77
|
+
findUserId: any;
|
|
78
|
+
mqttClient: any;
|
|
79
|
+
mqttInitialized: boolean;
|
|
80
|
+
isMqttConnected: boolean;
|
|
81
|
+
allMessages: any;
|
|
82
|
+
selectConversationMessages: any;
|
|
83
|
+
userMetaData: any;
|
|
84
|
+
allConversationList: any;
|
|
85
|
+
conversationMetaData: any;
|
|
86
|
+
selctConversationMetaData: any;
|
|
87
|
+
isMessageLimitEnd: boolean;
|
|
88
|
+
skip: number;
|
|
89
|
+
isMessagesLoading: boolean;
|
|
90
|
+
isMessageSending: boolean;
|
|
91
|
+
deviceId: string;
|
|
92
|
+
isScrollToBottom: boolean;
|
|
93
|
+
isScrollToTop: boolean;
|
|
94
|
+
isConversationLoading: boolean;
|
|
95
|
+
isLoadingConversationList: boolean;
|
|
96
|
+
unreadConversationsCount: number;
|
|
97
|
+
isChatClosed: boolean;
|
|
98
|
+
isChatMinimized: boolean;
|
|
99
|
+
isSubscribedToTopic: boolean;
|
|
100
|
+
isMessageListenerAttached: boolean;
|
|
101
|
+
isInitialCallDone: boolean;
|
|
102
|
+
isTyping: boolean;
|
|
103
|
+
typingUserName: string;
|
|
104
|
+
selectedConversationId: string | null;
|
|
105
|
+
unreadMessageCount: any;
|
|
106
|
+
unreadMessageCountFromApi: any;
|
|
107
|
+
isLoading: boolean;
|
|
108
|
+
loadingProgress: number;
|
|
109
|
+
loadingStatus: string;
|
|
110
|
+
isLoadingMessage: boolean;
|
|
111
|
+
hasMoreConversations: boolean;
|
|
112
|
+
eligibleMembers: any[];
|
|
113
|
+
membersListSkip: number;
|
|
114
|
+
hasMoreEligibleMembers: boolean;
|
|
115
|
+
unreadMessageCountUpdated: EventEmitter;
|
|
116
|
+
conversationNotFound: EventEmitter;
|
|
117
|
+
/** Fired once bootstrap finishes (SDK ready for custom UI). */
|
|
118
|
+
chatReady: EventEmitter<ChatReadyDetail>;
|
|
119
|
+
/** Conversation list updates (REST + MQTT). */
|
|
120
|
+
conversationsChange: EventEmitter<ConversationsChangeDetail>;
|
|
121
|
+
/** Active thread messages updates. */
|
|
122
|
+
messagesChange: EventEmitter<MessagesChangeDetail>;
|
|
123
|
+
/** Selected conversation changed. */
|
|
124
|
+
conversationSelect: EventEmitter<SelectionChangeDetail>;
|
|
125
|
+
/** Reply-target changed (null = cleared). */
|
|
126
|
+
replyChange: EventEmitter<ReplyChangeDetail>;
|
|
127
|
+
/** Public error surface for host UIs. */
|
|
128
|
+
chatError: EventEmitter<ChatErrorDetail>;
|
|
129
|
+
isMobileView: boolean;
|
|
130
|
+
showSidebar: boolean;
|
|
131
|
+
isContactInfoOpen: boolean;
|
|
132
|
+
isProfileInfoOpen: boolean;
|
|
133
|
+
isOpenSearchBar: boolean;
|
|
134
|
+
isChatFilter: boolean;
|
|
135
|
+
isAllChatButton: boolean;
|
|
136
|
+
isSidebarHeaderLabel: boolean;
|
|
137
|
+
sidebarHeaderLabel: string;
|
|
138
|
+
isSidebarHeaderSearch: boolean;
|
|
139
|
+
sidebarColor: string;
|
|
140
|
+
sidebarSelectedColor: string;
|
|
141
|
+
messageSearchText: string;
|
|
142
|
+
searchedMessageDetails: any;
|
|
143
|
+
initialConversationIdFromURL: string;
|
|
144
|
+
allAttachments: any;
|
|
145
|
+
selectConverSationAttachments: any;
|
|
146
|
+
highlightedMessageId: string | null;
|
|
147
|
+
messageAction: {
|
|
148
|
+
action: string;
|
|
149
|
+
initiator: boolean;
|
|
150
|
+
};
|
|
151
|
+
replyMessage: any;
|
|
152
|
+
messageInfoPanel: {
|
|
153
|
+
open: boolean;
|
|
154
|
+
selectedMessage?: any;
|
|
155
|
+
messageDeliveryTime?: any;
|
|
156
|
+
messageReadTime?: any;
|
|
157
|
+
readUserList?: any[];
|
|
158
|
+
deliveryUserList?: any[];
|
|
159
|
+
pendingReadCount?: any;
|
|
160
|
+
pendingDeliveryCount?: any;
|
|
161
|
+
isGroup?: boolean;
|
|
162
|
+
isLoading?: boolean;
|
|
163
|
+
} | null;
|
|
164
|
+
loadingMediaGallery: boolean;
|
|
165
|
+
activeTab: string;
|
|
166
|
+
showRightSideBar: boolean;
|
|
167
|
+
conversationIdFromContactinfo: string;
|
|
168
|
+
private chatBodyRef;
|
|
169
|
+
private conversationDetailsInterval;
|
|
170
|
+
exitedGroupIds: Set<string>;
|
|
171
|
+
conversationCountSkip: number;
|
|
172
|
+
typingConversationId: string;
|
|
173
|
+
messageReadStatusUpdated: EventEmitter;
|
|
174
|
+
newMessageNotification: {
|
|
175
|
+
messageId: string;
|
|
176
|
+
count: number;
|
|
177
|
+
conversationId: string;
|
|
178
|
+
} | null;
|
|
179
|
+
isBlocked: boolean | string;
|
|
180
|
+
allGroupCastContacts: any;
|
|
181
|
+
toggleTheme: () => void;
|
|
182
|
+
groupcastSkip: number;
|
|
183
|
+
isLoadingMoreGroupcast: boolean;
|
|
184
|
+
hasMoreGroupcast: boolean;
|
|
185
|
+
groupcastMembers: any;
|
|
186
|
+
private mqttSession;
|
|
187
|
+
private boundCheckMobileView;
|
|
188
|
+
private mqttRefetchInterval;
|
|
189
|
+
/** How many successful MQTT connects this mount (0 = first, >0 = reconnect). Used by mqtt-host. */
|
|
190
|
+
mqttConnectCount: number;
|
|
191
|
+
private typingClearTimeout;
|
|
192
|
+
private initGeneration;
|
|
193
|
+
private chatReadyEmitted;
|
|
194
|
+
handleReplyMessage: (e: CustomEvent) => void;
|
|
195
|
+
handleremoveReplyMessage: () => void;
|
|
196
|
+
private emitConversationsChange;
|
|
197
|
+
private emitMessagesChange;
|
|
198
|
+
emitSelectionChange(): void;
|
|
199
|
+
private emitReplyChange;
|
|
200
|
+
private emitChatReadyOnce;
|
|
201
|
+
emitChatError(code: string, message: string, cause?: unknown): void;
|
|
202
|
+
onLoadingChange(isLoading: boolean): void;
|
|
203
|
+
onConversationListChange(): void;
|
|
204
|
+
onMessagesChange(): void;
|
|
205
|
+
onReplyMessageChange(): void;
|
|
206
|
+
/**
|
|
207
|
+
* Public: set customParts after the shell is ready (prop-style API).
|
|
208
|
+
* Hosts should prefer this over poking web-chat-body / chat-side-bar in the DOM.
|
|
209
|
+
*/
|
|
210
|
+
setCustomParts(parts: WebChatCustomParts): Promise<WebChatCustomParts>;
|
|
211
|
+
/** Public: open a conversation (or clear with null). */
|
|
212
|
+
selectConversation(conversationId: string | null): Promise<void>;
|
|
213
|
+
/** Public: set / clear reply target for next sendText. */
|
|
214
|
+
setReply(message: any | null): Promise<void>;
|
|
215
|
+
clearReply(): Promise<void>;
|
|
216
|
+
/** Public: send a text message in the active (or given) conversation. */
|
|
217
|
+
sendText(body: string, conversationId?: string): Promise<string>;
|
|
218
|
+
/**
|
|
219
|
+
* Public: send one or more media files in the active (or given) conversation.
|
|
220
|
+
* Uses the same presign → upload → postMessages path as the default composer.
|
|
221
|
+
*/
|
|
222
|
+
sendMedia(files: File[] | FileList, conversationId?: string, caption?: string): Promise<string>;
|
|
223
|
+
/** Public: paginate messages upward. */
|
|
224
|
+
loadMoreMessages(): Promise<void>;
|
|
225
|
+
/** Public: paginate conversation list. */
|
|
226
|
+
loadMoreConversations(): Promise<void>;
|
|
227
|
+
/** Public: snapshot of current SDK UI state. */
|
|
228
|
+
getChatState(): Promise<{
|
|
229
|
+
userMetaData: any;
|
|
230
|
+
conversations: any;
|
|
231
|
+
messages: any;
|
|
232
|
+
selectedConversationId: string;
|
|
233
|
+
conversationMetaData: any;
|
|
234
|
+
replyMessage: any;
|
|
235
|
+
isLoading: boolean;
|
|
236
|
+
isMqttConnected: boolean;
|
|
237
|
+
unreadConversationsCount: number;
|
|
238
|
+
}>;
|
|
239
|
+
handleMessageSearchTextChange: (e: CustomEvent<string>) => void;
|
|
240
|
+
getCookie: (name: string) => string;
|
|
241
|
+
userTokenFromCookie: string;
|
|
242
|
+
isometrikUserIdFromCookie: string;
|
|
243
|
+
get sessionUserToken(): string;
|
|
244
|
+
get sessionUserId(): string;
|
|
245
|
+
checkMobileView(): void;
|
|
246
|
+
componentWillLoad(): void;
|
|
247
|
+
componentDidLoad(): void;
|
|
248
|
+
updateLoading(progress: number, status: string): void;
|
|
249
|
+
disconnectedCallback(): void;
|
|
250
|
+
setupMqttClient(): Promise<void>;
|
|
251
|
+
handleChatSelect(param: string | {
|
|
252
|
+
groupcastId: string;
|
|
253
|
+
}): void;
|
|
254
|
+
handleBackButton(): void;
|
|
255
|
+
sortConversationsByLatestMessage(conversations: any[]): any[];
|
|
256
|
+
handleRemoveMemberClicked(event: any): Promise<void>;
|
|
257
|
+
onProfileClick(event: any): Promise<void>;
|
|
258
|
+
handleMembersListScrolledToBottom(event: any): Promise<void>;
|
|
259
|
+
handleContactInfo(event: CustomEvent): Promise<void>;
|
|
260
|
+
handleProfileInfo(event: CustomEvent): Promise<void>;
|
|
261
|
+
handleMessageInfoPanelChange(event: CustomEvent): void;
|
|
262
|
+
handleOpen(event: CustomEvent): Promise<void>;
|
|
263
|
+
getConversationId(selectedContactId: any, selectedContactName: any): Promise<void>;
|
|
264
|
+
handleGetLinks(event: CustomEvent): Promise<void>;
|
|
265
|
+
getUserDetails: () => Promise<void>;
|
|
266
|
+
getConversations: (skip?: number, searchTag?: string | null, showLoader?: boolean) => Promise<void>;
|
|
267
|
+
getGroupCastConversationDetails: (groupcastId?: string) => Promise<void>;
|
|
268
|
+
getUserConversationDetails: (conversationId?: string) => Promise<any>;
|
|
269
|
+
getMessages: (skip: number, conversationId?: string) => Promise<void>;
|
|
270
|
+
getMessageUnreadCount: () => Promise<void>;
|
|
271
|
+
getMessagesByQuery: (searchText: string) => Promise<void>;
|
|
272
|
+
getAllLinks: (selectedConversationIDForAttachments: any) => Promise<void>;
|
|
273
|
+
getGroupcastMembers: (groupcastId: any) => Promise<void>;
|
|
274
|
+
getAllLinksCount: (selectedConversationIDForAttachments: any) => Promise<void>;
|
|
275
|
+
getAllAttachments: (selectedConversationIDForAttachments: string, from?: string) => Promise<void>;
|
|
276
|
+
getGroupCastContacts: (skip?: number) => Promise<void>;
|
|
277
|
+
clearConversation: (conversationId?: string) => Promise<void>;
|
|
278
|
+
deleteConversation: (conversationId: string) => Promise<void>;
|
|
279
|
+
blockUser: (conversationId: string, userName: string) => Promise<void>;
|
|
280
|
+
unblockUser: (conversationId: string, userName: string) => Promise<void>;
|
|
281
|
+
changeScrollToBottomState: (newState: boolean) => void;
|
|
282
|
+
changeScrollToTopState: (newState: boolean) => void;
|
|
283
|
+
updateSkip: () => void;
|
|
284
|
+
updateAllMessages: (newMessages: any) => void;
|
|
285
|
+
refetchMessages: () => void;
|
|
286
|
+
changeMessageSendingState: (newState: boolean) => void;
|
|
287
|
+
getMessageAction: () => void;
|
|
288
|
+
deleteMessageFromSelf: (payload: {
|
|
289
|
+
conversationId: string;
|
|
290
|
+
messageIds: string;
|
|
291
|
+
}) => Promise<void>;
|
|
292
|
+
deleteMeassageFromEveryOne: (payload: {
|
|
293
|
+
conversationId: string;
|
|
294
|
+
messageIds: string;
|
|
295
|
+
}) => Promise<void>;
|
|
296
|
+
handleSkipChange(): void;
|
|
297
|
+
private typingTimeout;
|
|
298
|
+
handleTypingChange(): void;
|
|
299
|
+
handleChatOpen: () => void;
|
|
300
|
+
handleSelectedConversationChange(newValue: string | null): Promise<void>;
|
|
301
|
+
handlemessageAction(): Promise<void>;
|
|
302
|
+
handleSearchResultClick: (messageId: string) => Promise<void>;
|
|
303
|
+
handleGroupExited(event: CustomEvent): void;
|
|
304
|
+
handleTaguserClick(event: CustomEvent): void;
|
|
305
|
+
createConversation(selectedContactId: string, selectedContactName: string): Promise<void>;
|
|
306
|
+
handleContactAction(event: CustomEvent): void;
|
|
307
|
+
handleChatTileScrolledToBottom(): void;
|
|
308
|
+
handleCloseChat: () => void;
|
|
309
|
+
resetNewMessageNotification(): void;
|
|
310
|
+
handleConversationUpdate(event: CustomEvent): Promise<void>;
|
|
311
|
+
watchPropHandler(newValue: any): Promise<void>;
|
|
312
|
+
findBlokedUser(): Promise<void>;
|
|
313
|
+
updateConversationList: (updatedList: any[]) => any[];
|
|
314
|
+
handleGroupcastScroll(): void;
|
|
315
|
+
handleDeleteGroupcast(e: any): Promise<void>;
|
|
316
|
+
private renderBootLoader;
|
|
317
|
+
private renderBusyOverlay;
|
|
318
|
+
private renderLeftRail;
|
|
319
|
+
private renderChatPane;
|
|
320
|
+
private renderRightRail;
|
|
321
|
+
render(): any;
|
|
322
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Mutable host surface used by data-fetch helpers. */
|
|
2
|
+
export type WebChatDataHost = Record<string, any>;
|
|
3
|
+
export declare function hostGetUserDetails(host: WebChatDataHost): Promise<void>;
|
|
4
|
+
export declare function hostGetConversations(host: WebChatDataHost, skip?: number, searchTag?: string | null, showLoader?: boolean): Promise<void>;
|
|
5
|
+
export declare function hostGetGroupCastConversationDetails(host: WebChatDataHost, groupcastId?: string): Promise<void>;
|
|
6
|
+
export declare function hostGetUserConversationDetails(host: WebChatDataHost, conversationId?: string): Promise<any>;
|
|
7
|
+
export declare function hostGetMessages(host: WebChatDataHost, skip: number, conversationId?: string): Promise<void>;
|
|
8
|
+
export declare function hostGetMessageUnreadCount(host: WebChatDataHost): Promise<void>;
|
|
9
|
+
export declare function hostGetMessagesByQuery(host: WebChatDataHost, searchText: string): Promise<void>;
|
|
10
|
+
export declare function hostGetAllLinks(host: WebChatDataHost, conversationId: string): Promise<void>;
|
|
11
|
+
export declare function hostGetGroupcastMembers(host: WebChatDataHost, groupcastId: string): Promise<void>;
|
|
12
|
+
export declare function hostGetAllLinksCount(host: WebChatDataHost, conversationId: string): Promise<void>;
|
|
13
|
+
export declare function hostGetAllAttachments(host: WebChatDataHost, conversationId: string, from?: string): Promise<void>;
|
|
14
|
+
export declare function hostGetGroupCastContacts(host: WebChatDataHost, skip?: number): Promise<void>;
|
|
@@ -151,6 +151,10 @@ export namespace Components {
|
|
|
151
151
|
"isSidebarHeaderSearch": boolean;
|
|
152
152
|
"isTyping": boolean;
|
|
153
153
|
"onDeleteConversation": (conversationId: string) => void;
|
|
154
|
+
/**
|
|
155
|
+
* When false, hide the MQTT connection status dot. Default true.
|
|
156
|
+
*/
|
|
157
|
+
"showMqttStatus": boolean;
|
|
154
158
|
"sidebarColor": string;
|
|
155
159
|
"sidebarHeaderLabel": string;
|
|
156
160
|
"sidebarSelectedColor": string;
|
|
@@ -905,6 +909,10 @@ export namespace Components {
|
|
|
905
909
|
"messageType": number;
|
|
906
910
|
"padding": string;
|
|
907
911
|
"playing": boolean;
|
|
912
|
+
/**
|
|
913
|
+
* Poster / thumbnail frame (from attachment.thumbnailUrl).
|
|
914
|
+
*/
|
|
915
|
+
"poster": string;
|
|
908
916
|
"reactions": Record<string, string[]>;
|
|
909
917
|
"showReactionOnHover": boolean;
|
|
910
918
|
"textColor": string;
|
|
@@ -999,6 +1007,10 @@ export namespace Components {
|
|
|
999
1007
|
* When false, hide the conversation header. Default true.
|
|
1000
1008
|
*/
|
|
1001
1009
|
"showHeader": boolean;
|
|
1010
|
+
/**
|
|
1011
|
+
* When false, hide the MQTT connection status dot in the conversation list header. Default true so hosts/users can verify realtime without digging into logs.
|
|
1012
|
+
*/
|
|
1013
|
+
"showMqttStatus": boolean;
|
|
1002
1014
|
/**
|
|
1003
1015
|
* Show the left profile icon rail (Chat / Profile / Groupcast). - `false` → hidden (wins over a custom `slot="profile-rail"`) - `true` + `slot="profile-rail"` → host UI - `true` + no slot → default `<profile-sidebar>` Init alias: `showProfileSidebar` maps to this prop. Default true for backward compatibility.
|
|
1004
1016
|
*/
|
|
@@ -2089,6 +2101,10 @@ declare namespace LocalJSX {
|
|
|
2089
2101
|
"onChatTileSelected"?: (event: ChatSideBarCustomEvent<any>) => void;
|
|
2090
2102
|
"onDeleteConversation"?: (conversationId: string) => void;
|
|
2091
2103
|
"onGroupExited"?: (event: ChatSideBarCustomEvent<any>) => void;
|
|
2104
|
+
/**
|
|
2105
|
+
* When false, hide the MQTT connection status dot. Default true.
|
|
2106
|
+
*/
|
|
2107
|
+
"showMqttStatus"?: boolean;
|
|
2092
2108
|
"sidebarColor"?: string;
|
|
2093
2109
|
"sidebarHeaderLabel"?: string;
|
|
2094
2110
|
"sidebarSelectedColor"?: string;
|
|
@@ -2876,6 +2892,10 @@ declare namespace LocalJSX {
|
|
|
2876
2892
|
"onTagUserClick"?: (event: VideoMessageCustomEvent<{ userId?: string; userName?: string }>) => void;
|
|
2877
2893
|
"padding"?: string;
|
|
2878
2894
|
"playing"?: boolean;
|
|
2895
|
+
/**
|
|
2896
|
+
* Poster / thumbnail frame (from attachment.thumbnailUrl).
|
|
2897
|
+
*/
|
|
2898
|
+
"poster"?: string;
|
|
2879
2899
|
"reactions"?: Record<string, string[]>;
|
|
2880
2900
|
"showReactionOnHover"?: boolean;
|
|
2881
2901
|
"textColor"?: string;
|
|
@@ -2964,6 +2984,10 @@ declare namespace LocalJSX {
|
|
|
2964
2984
|
* When false, hide the conversation header. Default true.
|
|
2965
2985
|
*/
|
|
2966
2986
|
"showHeader"?: boolean;
|
|
2987
|
+
/**
|
|
2988
|
+
* When false, hide the MQTT connection status dot in the conversation list header. Default true so hosts/users can verify realtime without digging into logs.
|
|
2989
|
+
*/
|
|
2990
|
+
"showMqttStatus"?: boolean;
|
|
2967
2991
|
/**
|
|
2968
2992
|
* Show the left profile icon rail (Chat / Profile / Groupcast). - `false` → hidden (wins over a custom `slot="profile-rail"`) - `true` + `slot="profile-rail"` → host UI - `true` + no slot → default `<profile-sidebar>` Init alias: `showProfileSidebar` maps to this prop. Default true for backward compatibility.
|
|
2969
2993
|
*/
|
|
@@ -6,7 +6,7 @@ export { sortConversationsByLatestMessage, fetchConversationsPage, fetchConversa
|
|
|
6
6
|
export { fetchMessagesPage, markConversationRead, mergeMessagesById, searchMessages, fetchLinkMessages, fetchMediaCount, fetchMediaAttachments, filterMediaMessages, attachmentBucket, splitSharedMessages, mediaPreviewUrl, mediaPreviewUrls, docIconKind, } from './messages';
|
|
7
7
|
export { initializeChatSdk, fetchUserDetails, type ChatSdkInitConfig } from './session';
|
|
8
8
|
export { fetchGroupcastDetails, fetchGroupcastMembersPage, fetchGroupcastContactsPage } from './groupcast';
|
|
9
|
-
export { ATTACHMENT_BODY_PLACEHOLDER, mediaTypeFromMime, customTypeFromMime, isAttachmentBodyPlaceholder, attachmentCaption, attachmentBodyForApi, prepareMediaAttachments, buildLocalMediaAttachments, buildReplyMetaData, uploadAndPostMediaMessage, } from './send-media';
|
|
9
|
+
export { ATTACHMENT_BODY_PLACEHOLDER, mediaTypeFromMime, customTypeFromMime, isAttachmentBodyPlaceholder, attachmentCaption, attachmentBodyForApi, prepareMediaAttachments, buildLocalMediaAttachments, buildReplyMetaData, captureVideoThumbnailBlob, uploadPresignedMediaAttachment, uploadAndPostMediaMessage, } from './send-media';
|
|
10
10
|
export { MAX_MEDIA_PER_MESSAGE, takeMediaFiles, mediaLimitToastMessage, } from './media-limits';
|
|
11
11
|
export { filesToOutboxMedia, outboxMediaToFiles, MAX_OUTBOX_MEDIA_BYTES } from './media-outbox';
|
|
12
12
|
export { isPdfAttachment, previewKindFromAttachment, deliveryUiState } from './preview-kind';
|
|
@@ -33,5 +33,26 @@ export type UploadAndPostMediaArgs = {
|
|
|
33
33
|
caption?: string;
|
|
34
34
|
mentionedUsers?: any[];
|
|
35
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* Grab a JPEG frame from a local video File for thumbnailPresignedUrl upload.
|
|
38
|
+
* Mobile clients already send this; web must generate it client-side.
|
|
39
|
+
*/
|
|
40
|
+
export declare function captureVideoThumbnailBlob(file: File, seekSeconds?: number): Promise<Blob | null>;
|
|
41
|
+
/** PUT media (+ video thumbnail when thumbnailPresignedUrl is present). */
|
|
42
|
+
export declare function uploadPresignedMediaAttachment(opts: {
|
|
43
|
+
urlDetails: any;
|
|
44
|
+
attachment: PreparedMediaAttachment;
|
|
45
|
+
}): Promise<{
|
|
46
|
+
mediaId: string;
|
|
47
|
+
mediaUrl: string;
|
|
48
|
+
thumbnailUrl: string;
|
|
49
|
+
mediaType: number;
|
|
50
|
+
nameWithExtension: string;
|
|
51
|
+
name: string;
|
|
52
|
+
mimeType: string;
|
|
53
|
+
extension: string;
|
|
54
|
+
size: number;
|
|
55
|
+
attachmentType: number;
|
|
56
|
+
} | null>;
|
|
36
57
|
/** Presign → PUT files → postMessages. Returns API messageId. */
|
|
37
58
|
export declare function uploadAndPostMediaMessage(args: UploadAndPostMediaArgs): Promise<string | null>;
|
|
@@ -22,5 +22,5 @@ export { parseMqttPayload, buildUserMessageTopic } from './parse';
|
|
|
22
22
|
export { dispatchMqttMessage } from './dispatch';
|
|
23
23
|
export { enqueueMqttTask } from './inbound-queue';
|
|
24
24
|
export type { MqttChatContext } from './context';
|
|
25
|
-
export { MQTT_ACTIONS, STATUS_ONLY_ACTIONS, isStatusOnlyAction } from './types';
|
|
25
|
+
export { MQTT_ACTIONS, STATUS_ONLY_ACTIONS, SYSTEM_MEMBERSHIP_ACTIONS, isStatusOnlyAction, isSystemMembershipAction, mqttActorId, } from './types';
|
|
26
26
|
export type { MqttAction, MqttInboundMessage } from './types';
|
|
@@ -20,9 +20,20 @@ export declare const MQTT_ACTIONS: {
|
|
|
20
20
|
readonly reactionRemove: "reactionRemove";
|
|
21
21
|
readonly membersAdd: "membersAdd";
|
|
22
22
|
readonly membersRemove: "membersRemove";
|
|
23
|
+
/** Voluntary leave (backend / Flutter / Swift). Distinct from kick (`membersRemove`). */
|
|
24
|
+
readonly memberLeave: "memberLeave";
|
|
23
25
|
readonly addAdmin: "addAdmin";
|
|
24
26
|
readonly removeAdmin: "removeAdmin";
|
|
25
27
|
};
|
|
28
|
+
/** Membership / admin system events — append as pills; do not mark delivered. */
|
|
29
|
+
export declare const SYSTEM_MEMBERSHIP_ACTIONS: readonly string[];
|
|
30
|
+
export declare function isSystemMembershipAction(action: string | undefined): boolean;
|
|
31
|
+
/** Actor for leave/kick/add — backends vary between senderId / userId / initiatorId. */
|
|
32
|
+
export declare function mqttActorId(msg: {
|
|
33
|
+
senderId?: string;
|
|
34
|
+
userId?: string;
|
|
35
|
+
initiatorId?: string;
|
|
36
|
+
} | null | undefined): string | undefined;
|
|
26
37
|
export type MqttAction = (typeof MQTT_ACTIONS)[keyof typeof MQTT_ACTIONS] | string;
|
|
27
38
|
/** Actions that update delivery/read status only — do not append as new chat bubbles. */
|
|
28
39
|
export declare const STATUS_ONLY_ACTIONS: readonly string[];
|
package/dist/types/sdk/init.d.ts
CHANGED
|
@@ -42,6 +42,13 @@ export type IsometrikWebchatInitProps = {
|
|
|
42
42
|
showConversationList?: boolean;
|
|
43
43
|
/** When false, never show right info panel. Default true. */
|
|
44
44
|
showRightPanel?: boolean;
|
|
45
|
+
/** When false, hide conversation-list search. Default true. */
|
|
46
|
+
isSidebarHeaderSearch?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* When false, hide the MQTT green/red status dot in the conversation list header.
|
|
49
|
+
* Default true.
|
|
50
|
+
*/
|
|
51
|
+
showMqttStatus?: boolean;
|
|
45
52
|
};
|
|
46
53
|
/** @deprecated Use IsometrikWebchatInitProps */
|
|
47
54
|
export type InitializeChatProps = IsometrikWebchatInitProps;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"runtime-controls-95f6cb3b.js","mappings":";;;;;;;AAAA;;;;MAkCa,sBAAsB,GAAG;IACpC,WAAW;IACX,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a,CAAC,QAAQ,KAAK,UAAU,EAAE;YAChD,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SAC/B;QACD,OAAO;KACR;IACD,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;AACrD,CAAC;SAEe,gBAAgB,CAC9B,WAGC,EACD,IAAqB;IAErB,MAAM,aAAa,GAAG,oBAAoB,CAAC,IAAI,CAAQ,CAAC;IACxD,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACnD,OAAO;KACR;IAED,IAAI,WAAW,CAAC,SAAS,EAAE;QACzB,aAAa,CAAC,YAAY,CAAC,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;KACjE;IAED,IAAI,WAAW,CAAC,WAAW,EAAE;QAC3B,aAAa,CAAC,WAAW,GAAGvB,8BAAoB,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;KAC3E;AACH,CAAC;SAEe,WAAW,CAAC,IAAqB;IAC/C,MAAM,aAAa,GAAG,oBAAoB,CAAC,IAAI,CAAQ,CAAC;IACxD,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACnD,OAAO;KACR;IACD,IAAI,OAAO,aAAa,CAAC,WAAW,KAAK,UAAU,EAAE;QACnD,aAAa,CAAC,WAAW,EAAE,CAAC;KAC7B;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["findWebChatHost","normalizeThemeObject","destroyChatDom","resolveShowProfileRailProp","initializeChatSdk","fetchUserDetails","fetchConversationsPage","fetchConversationDetails","sortConversationsByLatestMessage","mergeUniqueConversations","fetchMessagesPage","markConversationRead","mergeMessagesById","searchMessages","fetchLinkMessages","fetchMediaCount","fetchMediaAttachments","filterMediaMessages","fetchGroupcastDetails","fetchGroupcastMembersPage","fetchGroupcastContactsPage","mediaTypeFromMime","customTypeFromMime","prepareMediaAttachments","buildReplyMetaData"],"sources":["src/lib/custom-ui/public-api.ts","src/sdk/webchat-api.ts","src/sdk/slots.ts","src/sdk/instance.ts","src/sdk/init.ts","src/sdk/headless-api.ts","src/sdk/react-bridge.ts","src/sdk/runtime-controls.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 'setCustomParts',\n] as const;\n\nexport type WebChatPublicMethod = (typeof WEB_CHAT_PUBLIC_METHODS)[number];\n","/**\n * Bound actions/events for a live <web-chat> instance.\n * No REST imports — safe for unit tests without ChatSDK.\n */\n\nimport { WEB_CHAT_PUBLIC_EVENTS, WEB_CHAT_PUBLIC_METHODS } from '../lib/custom-ui';\nimport type { WebChatPublicEvent, WebChatPublicMethod } from '../lib/custom-ui';\n\nexport type WebChatApi = {\n selectConversation: (conversationId: string | null) => Promise<void>;\n sendText: (body: string, conversationId?: string) => Promise<unknown>;\n sendMedia: (files: File[] | FileList, conversationId?: string, caption?: string) => Promise<unknown>;\n setReply: (message: any | null) => Promise<void>;\n clearReply: () => Promise<void>;\n loadMoreMessages: () => Promise<void>;\n loadMoreConversations: () => Promise<void>;\n getChatState: () => Promise<Record<string, unknown>>;\n setCustomParts: (parts: Record<string, string>) => Promise<unknown>;\n on: (event: WebChatPublicEvent, handler: (ev: Event) => void) => () => void;\n methods: typeof WEB_CHAT_PUBLIC_METHODS;\n events: typeof WEB_CHAT_PUBLIC_EVENTS;\n};\n\nfunction callMethod(el: any, name: WebChatPublicMethod | 'setCustomParts', ...args: any[]) {\n const fn = el?.[name];\n if (typeof fn !== 'function') {\n return Promise.reject(new Error(`[isometrik-webchat] method \"${name}\" is not available`));\n }\n return Promise.resolve(fn.apply(el, args));\n}\n\n/** Bind public methods/events to a mounted <web-chat> element. */\nexport function createWebChatApi(chatComponent: HTMLElement | null | undefined): WebChatApi | null {\n if (!chatComponent) return null;\n const el = chatComponent as any;\n\n return {\n selectConversation: id => callMethod(el, 'selectConversation', id),\n sendText: (body, conversationId) => callMethod(el, 'sendText', body, conversationId),\n sendMedia: (files, conversationId, caption) => callMethod(el, 'sendMedia', files, conversationId, caption),\n setReply: message => callMethod(el, 'setReply', message),\n clearReply: () => callMethod(el, 'clearReply'),\n loadMoreMessages: () => callMethod(el, 'loadMoreMessages'),\n loadMoreConversations: () => callMethod(el, 'loadMoreConversations'),\n getChatState: () => callMethod(el, 'getChatState'),\n setCustomParts: parts => callMethod(el, 'setCustomParts', parts),\n on(event, handler) {\n el.addEventListener(event, handler);\n return () => el.removeEventListener(event, handler);\n },\n methods: WEB_CHAT_PUBLIC_METHODS,\n events: WEB_CHAT_PUBLIC_EVENTS,\n };\n}\n","/**\n * Framework-agnostic slot helpers.\n * React / Angular / Vue / vanilla all end up calling these with real HTMLElements.\n *\n * Note: avoid `instanceof HTMLElement` — it fails across jsdom realms in Jest.\n */\n\nimport type { WebChatSlotName } from '../lib/custom-ui';\n\nfunction isElement(node: ChildNode | null | undefined): node is HTMLElement {\n return !!node && node.nodeType === 1;\n}\n\nfunction slotNameOf(el: HTMLElement): string | null {\n return el.getAttribute('slot') || el.slot || null;\n}\n\n/** Attach (or replace) a named slot on <web-chat>. */\nexport function setWebChatSlot(\n chatComponent: HTMLElement | null | undefined,\n slotName: WebChatSlotName,\n element: HTMLElement,\n): HTMLElement | null {\n if (!chatComponent || !element) return null;\n clearWebChatSlot(chatComponent, slotName);\n element.slot = slotName;\n element.setAttribute('slot', slotName);\n chatComponent.appendChild(element);\n return element;\n}\n\n/** Remove host content for a named slot. */\nexport function clearWebChatSlot(\n chatComponent: HTMLElement | null | undefined,\n slotName: WebChatSlotName,\n): void {\n if (!chatComponent) return;\n Array.from(chatComponent.children).forEach(node => {\n if (!isElement(node)) return;\n if (slotNameOf(node) === slotName) {\n node.remove();\n }\n });\n}\n\n/** Create a plain wrapper element ready to receive framework content (e.g. React portal target). */\nexport function createSlotHost(slotName: WebChatSlotName, className?: string): HTMLElement {\n const el = document.createElement('div');\n el.slot = slotName;\n el.setAttribute('slot', slotName);\n el.setAttribute('data-isometrik-slot', slotName);\n if (className) el.className = className;\n el.style.height = '100%';\n el.style.width = '100%';\n el.style.display = 'contents';\n return el;\n}\n\n/** Attach many slots at once (same shape as initialize props.slots). */\nexport function setWebChatSlots(\n chatComponent: HTMLElement | null | undefined,\n slots?: Partial<Record<WebChatSlotName, HTMLElement>>,\n): void {\n if (!chatComponent || !slots) return;\n (Object.entries(slots) as [WebChatSlotName, HTMLElement | undefined][]).forEach(([name, el]) => {\n if (el) setWebChatSlot(chatComponent, name, el);\n });\n}\n","/**\n * Last-mounted chat instance registry + resolvers.\n * Prefer explicit elements; fall back to store; querySelector is last resort.\n */\n\nimport { findWebChatHost } from '../lib/custom-ui';\n\nexport type StoredChatComponents = {\n themeProvider?: HTMLElement;\n chatComponent?: HTMLElement;\n};\n\nexport function getChatStore(): StoredChatComponents {\n if (typeof window === 'undefined') return {};\n (window as any).__isometrikChatComponents = (window as any).__isometrikChatComponents || {};\n return (window as any).__isometrikChatComponents;\n}\n\nexport function setChatStore(partial: StoredChatComponents): void {\n const store = getChatStore();\n if (partial.themeProvider !== undefined) store.themeProvider = partial.themeProvider;\n if (partial.chatComponent !== undefined) store.chatComponent = partial.chatComponent;\n}\n\nexport function clearChatStore(): void {\n if (typeof window === 'undefined') return;\n (window as any).__isometrikChatComponents = {};\n}\n\n/** Resolve <theme-provider> from an explicit node, store, or (last) DOM. */\nexport function resolveThemeProvider(from?: Element | null): HTMLElement | null {\n if (from) {\n const el = from as HTMLElement;\n if (el.tagName === 'THEME-PROVIDER') return el;\n const closest = el.closest?.('theme-provider');\n if (closest) return closest as HTMLElement;\n const host = findWebChatHost(el);\n if (host?.parentElement?.tagName === 'THEME-PROVIDER') {\n return host.parentElement;\n }\n }\n const stored = getChatStore().themeProvider;\n if (stored) return stored;\n if (typeof document === 'undefined') return null;\n return document.querySelector('theme-provider');\n}\n\n/** Resolve <web-chat> from an explicit node, store, or (last) DOM. */\nexport function resolveWebChat(from?: Element | null): HTMLElement | null {\n if (from) {\n const el = from as HTMLElement;\n if (el.tagName === 'WEB-CHAT') return el;\n const host = findWebChatHost(el);\n if (host) return host;\n }\n const stored = getChatStore().chatComponent;\n if (stored) return stored;\n if (typeof document === 'undefined') return null;\n return document.querySelector('web-chat');\n}\n","import { destroyChatDom } from '../lib/destroy-chat';\nimport type { WebChatSlotName, WebChatCustomParts } from '../lib/custom-ui';\nimport type { ThemeTokenMap } from './theme-tokens';\nimport { normalizeThemeObject } from './theme-tokens';\nimport { resolveShowProfileRailProp } from './composition';\nimport { createWebChatApi, type WebChatApi } from './webchat-api';\nimport { setWebChatSlots } from './slots';\nimport { clearChatStore, getChatStore, setChatStore } from './instance';\n\nconst DEFAULT_THEME_URL =\n 'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css';\n\nexport type IsometrikWebchatInitProps = {\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 /** CSS file from CDN or same-origin path. */\n themeUrl?: string;\n /** Inline CSS variable overrides (wins over themeUrl for same keys). */\n theme?: ThemeTokenMap;\n /** @deprecated Use `theme`. Kept for applyCustomTheme / older hosts. */\n themeObject?: Record<string, 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. */\n customParts?: WebChatCustomParts;\n /** When false, hide the left profile icon rail. Default true. */\n showProfileRail?: boolean;\n /** Alias of showProfileRail for clearer host DX. Default true. */\n showProfileSidebar?: 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 /** When false, hide conversation header. Default true. */\n showHeader?: boolean;\n /** When false, hide composer. Default true. */\n showComposer?: boolean;\n /** When false, hide empty state. Default true. */\n showEmptyState?: boolean;\n /** When false, hide conversation list. Default true. */\n showConversationList?: boolean;\n /** When false, never show right info panel. Default true. */\n showRightPanel?: boolean;\n};\n\n/** @deprecated Use IsometrikWebchatInitProps */\nexport type InitializeChatProps = IsometrikWebchatInitProps;\n\nexport type IsometrikWebchatInstance = {\n themeProvider: HTMLElement;\n chatComponent: HTMLElement;\n /** Bound actions/events for the live instance. */\n api: WebChatApi;\n /** Session key used by ensure/retain. */\n sessionKey: string;\n destroy: () => void;\n};\n\n/** Identity for reuse — same user + project + mount target → skip re-bootstrap. */\nexport function buildWebchatSessionKey(props: IsometrikWebchatInitProps): string {\n return [\n props.containerId || '__body__',\n props.isometrikUserId,\n props.userToken,\n props.projectId,\n props.accountId,\n props.keysetId,\n ].join('|');\n}\n\ntype RetainState = {\n count: number;\n sessionKey: string;\n instance: IsometrikWebchatInstance | null;\n pendingDestroy: ReturnType<typeof setTimeout> | null;\n};\n\nfunction getRetainState(): RetainState {\n if (typeof window === 'undefined') {\n return { count: 0, sessionKey: '', instance: null, pendingDestroy: null };\n }\n const w = window as any;\n if (!w.__isometrikChatRetain) {\n w.__isometrikChatRetain = {\n count: 0,\n sessionKey: '',\n instance: null,\n pendingDestroy: null,\n } as RetainState;\n }\n return w.__isometrikChatRetain;\n}\n\nfunction resolveThemeObject(props: IsometrikWebchatInitProps): Record<string, string> | undefined {\n const merged = { ...(props.themeObject || {}), ...(props.theme || {}) };\n const normalized = normalizeThemeObject(merged as Record<string, string>);\n return Object.keys(normalized).length ? normalized : undefined;\n}\n\nfunction applyOptionalBool(el: any, key: string, value: boolean | undefined) {\n if (value !== undefined) el[key] = value;\n}\n\nfunction isLiveInstance(instance: IsometrikWebchatInstance | null): boolean {\n if (!instance) return false;\n const { themeProvider, chatComponent } = instance;\n if (!themeProvider || !chatComponent) return false;\n // isConnected may be false in some test envs; also accept store match\n const store = getChatStore();\n return store.chatComponent === chatComponent && store.themeProvider === themeProvider;\n}\n\n/** Tear down existing chat instance (MQTT via disconnectedCallback, DOM). */\nexport function destroyIsometrikWebchat(): void {\n const retain = getRetainState();\n if (retain.pendingDestroy) {\n clearTimeout(retain.pendingDestroy);\n retain.pendingDestroy = null;\n }\n retain.count = 0;\n retain.sessionKey = '';\n retain.instance = null;\n\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 clearChatStore();\n}\n\n/** @deprecated Use destroyIsometrikWebchat */\nexport const destroyChat = destroyIsometrikWebchat;\n\n/**\n * Force mount: always tears down previous instance then creates a new one.\n * Prefer `retainIsometrikWebchat` / `ensureIsometrikWebchat` in React/SPA hosts\n * to avoid double bootstrap (Strict Mode / remount).\n */\nexport function initializeIsometrikWebchat(\n props: IsometrikWebchatInitProps,\n): IsometrikWebchatInstance | null {\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 destroyIsometrikWebchat();\n\n const sessionKey = buildWebchatSessionKey(props);\n const themeProvider = document.createElement('theme-provider') as any;\n const themeUrl = props.themeUrl || DEFAULT_THEME_URL;\n const themeObject = resolveThemeObject(props);\n\n if (props.defaultTheme) {\n themeProvider.setAttribute('mode', props.defaultTheme);\n }\n themeProvider.setAttribute('theme-path', themeUrl);\n if (themeObject) {\n themeProvider.themeObject = themeObject;\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 = themeUrl;\n\n chatComponent.style.width = '100%';\n chatComponent.style.height = '100%';\n\n if (props.customParts) {\n chatComponent.customParts = props.customParts;\n }\n\n applyOptionalBool(chatComponent, 'showProfileRail', resolveShowProfileRailProp(props));\n applyOptionalBool(chatComponent, 'showChatWallpaper', props.showChatWallpaper);\n applyOptionalBool(chatComponent, 'groupcastEnabled', props.groupcastEnabled);\n applyOptionalBool(chatComponent, 'showHeader', props.showHeader);\n applyOptionalBool(chatComponent, 'showComposer', props.showComposer);\n applyOptionalBool(chatComponent, 'showEmptyState', props.showEmptyState);\n applyOptionalBool(chatComponent, 'showConversationList', props.showConversationList);\n applyOptionalBool(chatComponent, 'showRightPanel', props.showRightPanel);\n\n setWebChatSlots(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 setChatStore({ themeProvider, chatComponent });\n\n const api = createWebChatApi(chatComponent)!;\n const instance: IsometrikWebchatInstance = {\n themeProvider,\n chatComponent,\n api,\n sessionKey,\n destroy: destroyIsometrikWebchat,\n };\n\n const retain = getRetainState();\n retain.instance = instance;\n retain.sessionKey = sessionKey;\n retain.count = Math.max(retain.count, 1);\n\n return instance;\n}\n\n/**\n * Reuse live instance when session key matches (same user/token/container).\n * Otherwise mounts fresh. Does not bump retain count — use `retainIsometrikWebchat` in React.\n */\nexport function ensureIsometrikWebchat(\n props: IsometrikWebchatInitProps,\n): IsometrikWebchatInstance | null {\n const retain = getRetainState();\n if (retain.pendingDestroy) {\n clearTimeout(retain.pendingDestroy);\n retain.pendingDestroy = null;\n }\n\n const key = buildWebchatSessionKey(props);\n if (retain.sessionKey === key && isLiveInstance(retain.instance)) {\n return retain.instance;\n }\n return initializeIsometrikWebchat(props);\n}\n\n/**\n * React / SPA friendly: acquire a chat instance.\n * Pair with `releaseIsometrikWebchat` in effect cleanup.\n * Survives React 18 Strict Mode double-mount without a second bootstrap.\n */\nexport function retainIsometrikWebchat(\n props: IsometrikWebchatInitProps,\n): IsometrikWebchatInstance | null {\n const retain = getRetainState();\n if (retain.pendingDestroy) {\n clearTimeout(retain.pendingDestroy);\n retain.pendingDestroy = null;\n }\n retain.count += 1;\n return ensureIsometrikWebchat(props);\n}\n\n/**\n * Release a retain from `retainIsometrikWebchat`.\n * Destroy is deferred so Strict Mode remount can cancel it.\n * @param delayMs default 0 (macrotask) — enough for React 18 Strict Mode\n */\nexport function releaseIsometrikWebchat(delayMs: number = 0): void {\n const retain = getRetainState();\n retain.count = Math.max(0, retain.count - 1);\n if (retain.count > 0) return;\n\n if (retain.pendingDestroy) clearTimeout(retain.pendingDestroy);\n retain.pendingDestroy = setTimeout(() => {\n retain.pendingDestroy = null;\n if (retain.count > 0) return;\n destroyIsometrikWebchat();\n }, delayMs);\n}\n\n/** @deprecated Use initializeIsometrikWebchat */\nexport const initializeChat = initializeIsometrikWebchat;\n","/**\n * Headless REST helpers — same paths the shell uses.\n * Call session.init before other methods when not mounting <web-chat>.\n */\n\nimport {\n fetchConversationsPage,\n fetchConversationDetails,\n sortConversationsByLatestMessage,\n mergeUniqueConversations,\n fetchMessagesPage,\n markConversationRead,\n mergeMessagesById,\n searchMessages,\n fetchLinkMessages,\n fetchMediaCount,\n fetchMediaAttachments,\n filterMediaMessages,\n initializeChatSdk,\n fetchUserDetails,\n fetchGroupcastDetails,\n fetchGroupcastMembersPage,\n fetchGroupcastContactsPage,\n mediaTypeFromMime,\n customTypeFromMime,\n prepareMediaAttachments,\n buildReplyMetaData,\n type ChatSdkInitConfig,\n} from '../lib/chat';\n\nexport const isometrikWebchatApi = {\n session: {\n init: (config: ChatSdkInitConfig) => initializeChatSdk(config),\n fetchUserDetails,\n },\n conversations: {\n list: fetchConversationsPage,\n details: fetchConversationDetails,\n sortByLatest: sortConversationsByLatestMessage,\n mergeUnique: mergeUniqueConversations,\n },\n messages: {\n list: fetchMessagesPage,\n markRead: markConversationRead,\n mergeById: mergeMessagesById,\n search: searchMessages,\n links: fetchLinkMessages,\n mediaCount: fetchMediaCount,\n mediaAttachments: fetchMediaAttachments,\n filterMedia: filterMediaMessages,\n },\n groupcast: {\n details: fetchGroupcastDetails,\n members: fetchGroupcastMembersPage,\n contacts: fetchGroupcastContactsPage,\n },\n media: {\n mediaTypeFromMime,\n customTypeFromMime,\n prepareMediaAttachments,\n buildReplyMetaData,\n },\n};\n\nexport type IsometrikWebchatApi = typeof isometrikWebchatApi;\n","/**\n * React → WebChat bridge (no React dependency in this package).\n *\n * Hosts pass their own `createElement` + `createRoot` so the core SDK stays\n * framework-agnostic.\n *\n * 1) Panels (slots): mountReactInSlot → HTMLElement for `slots['profile-rail']`\n * 2) Rows/overlays (customParts): defineReactCustomPart → CE tag for customParts\n */\n\nimport type { WebChatSlotName } from '../lib/custom-ui';\nimport { createSlotHost } from './slots';\n\nexport type ReactLike = {\n createElement: (type: any, props: any, ...children: any[]) => any;\n};\n\nexport type ReactRootLike = {\n render: (node: any) => void;\n unmount: () => void;\n};\n\nexport type CreateRootLike = (container: Element) => ReactRootLike;\n\ntype BridgeRootStore = {\n root: ReactRootLike;\n Component: any;\n extraProps?: Record<string, unknown>;\n};\n\nconst ROOT_KEY = '__isometrikReactBridge';\n\nfunction paint(store: BridgeRootStore, react: ReactLike, propsFromHost: Record<string, unknown>) {\n store.root.render(\n react.createElement(store.Component, {\n ...(store.extraProps || {}),\n ...propsFromHost,\n }),\n );\n}\n\n/**\n * Wrap a React component as a custom element for `customParts`.\n * SDK assigns props (conversation, onSelect, …); we re-render React.\n *\n * @example\n * import { createElement } from 'react';\n * import { createRoot } from 'react-dom/client';\n * defineReactCustomPart('app-chat-tile', MyTile, {\n * react: { createElement },\n * createRoot,\n * propKeys: ['conversation', 'isSelected', 'unreadCount', 'previewText', 'onSelect'],\n * });\n * initializeIsometrikWebchat({ customParts: { chatTile: 'app-chat-tile' }, … });\n */\nexport function defineReactCustomPart(\n tag: string,\n Component: any,\n opts: {\n react: ReactLike;\n createRoot: CreateRootLike;\n /** Prop names the SDK writes on the CE (see lib/custom-ui/contracts.ts). */\n propKeys: string[];\n /** Static props merged into every render. */\n extraProps?: Record<string, unknown>;\n },\n): string {\n if (typeof customElements === 'undefined') return tag;\n if (customElements.get(tag)) return tag;\n\n const { react, createRoot, propKeys, extraProps } = opts;\n\n class ReactPart extends HTMLElement {\n private _store: BridgeRootStore | null = null;\n\n connectedCallback() {\n if (!this._store) {\n this._store = { root: createRoot(this), Component, extraProps };\n }\n this.render();\n }\n\n disconnectedCallback() {\n try {\n this._store?.root.unmount();\n } catch {\n /* unmount is best-effort */\n }\n this._store = null;\n }\n\n /** Called by applyCustomPartProps after Object.assign. */\n render() {\n if (!this._store || !this.isConnected) return;\n const fromSetters: Record<string, unknown> = {};\n propKeys.forEach(key => {\n fromSetters[key] = (this as any)[`_${key}`];\n });\n paint(this._store, react, fromSetters);\n }\n }\n\n propKeys.forEach(key => {\n const store = `_${key}`;\n Object.defineProperty(ReactPart.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) (this as HTMLElement & { render: () => void }).render();\n },\n configurable: true,\n });\n });\n\n customElements.define(tag, ReactPart);\n return tag;\n}\n\nexport type ReactSlotHost = HTMLElement & {\n updateProps: (props: Record<string, unknown>) => void;\n unmount: () => void;\n};\n\n/**\n * Mount a React component into a slot host for panel overrides.\n * Pass the returned element in `slots: { 'profile-rail': el }`.\n *\n * @example\n * const rail = mountReactInSlot('profile-rail', MyProfileRail, {\n * react: { createElement },\n * createRoot,\n * props: { userId: '…' },\n * });\n * initializeIsometrikWebchat({ slots: { 'profile-rail': rail }, … });\n * // later: rail.updateProps({ badge: 3 }); rail.unmount();\n */\nexport function mountReactInSlot(\n slotName: WebChatSlotName,\n Component: any,\n opts: {\n react: ReactLike;\n createRoot: CreateRootLike;\n props?: Record<string, unknown>;\n className?: string;\n },\n): ReactSlotHost {\n const host = createSlotHost(slotName, opts.className) as ReactSlotHost;\n // display:contents can break React roots — use block for React mounts.\n host.style.display = 'block';\n host.style.height = '100%';\n\n const store: BridgeRootStore = {\n root: opts.createRoot(host),\n Component,\n extraProps: opts.props,\n };\n (host as any)[ROOT_KEY] = store;\n paint(store, opts.react, {});\n\n host.updateProps = (next: Record<string, unknown>) => {\n store.extraProps = { ...(store.extraProps || {}), ...next };\n paint(store, opts.react, {});\n };\n host.unmount = () => {\n try {\n store.root.unmount();\n } catch {\n /* ignore */\n }\n delete (host as any)[ROOT_KEY];\n };\n return host;\n}\n\nexport function unmountReactSlot(host: HTMLElement | null | undefined): void {\n if (!host) return;\n const anyHost = host as ReactSlotHost;\n if (typeof anyHost.unmount === 'function') {\n anyHost.unmount();\n return;\n }\n const store = (host as any)[ROOT_KEY] as BridgeRootStore | undefined;\n if (!store) return;\n try {\n store.root.unmount();\n } catch {\n /* ignore */\n }\n delete (host as any)[ROOT_KEY];\n}\n","/**\n * Theme / sidebar controls — instance-first (no bare querySelector in happy path).\n */\n\nimport { normalizeThemeObject } from './theme-tokens';\nimport { resolveThemeProvider, resolveWebChat } from './instance';\n\nexport function customChatSidebar(\n props: { isChatFilter?: boolean },\n from?: Element | null,\n): void {\n const chatComponent = resolveWebChat(from) as any;\n if (!chatComponent) {\n console.error('Isometrik chat is not initialized');\n return;\n }\n if (props.isChatFilter !== undefined) {\n chatComponent.isChatFilter = props.isChatFilter;\n }\n}\n\nexport function switchChatTheme(theme: 'dark' | 'light', from?: Element | null): void {\n const themeProvider = resolveThemeProvider(from) as any;\n const chat = resolveWebChat(from) as any;\n\n if (chat) {\n chat.defaultTheme = theme;\n }\n if (themeProvider) {\n themeProvider.setAttribute('mode', theme);\n if (typeof themeProvider.setTheme === 'function') {\n themeProvider.setTheme(theme);\n }\n return;\n }\n console.error('Theme provider is not initialized');\n}\n\nexport function applyCustomTheme(\n customTheme: {\n themePath?: string;\n themeObject?: { [key: string]: string };\n },\n from?: Element | null,\n): void {\n const themeProvider = resolveThemeProvider(from) 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 = normalizeThemeObject(customTheme.themeObject);\n }\n}\n\nexport function toggleTheme(from?: Element | null): void {\n const themeProvider = resolveThemeProvider(from) as any;\n if (!themeProvider) {\n console.error('Theme provider is not initialized');\n return;\n }\n if (typeof themeProvider.toggleTheme === 'function') {\n themeProvider.toggleTheme();\n }\n}\n"],"version":3}
|