isometrik-plugin-chat-sdk 2.0.23 → 2.0.24
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-0e7848be.js → app-globals-f55c4dba.js} +4 -4
- package/dist/cjs/{app-globals-0e7848be.js.map → app-globals-f55c4dba.js.map} +1 -1
- package/dist/cjs/attachment-preview_23.cjs.entry.js +98 -97
- package/dist/cjs/attachment-preview_23.cjs.entry.js.map +1 -1
- package/dist/cjs/{chat-tile_3.cjs.entry.js → chat-tile_2.cjs.entry.js} +1 -66
- package/dist/cjs/chat-tile_2.cjs.entry.js.map +1 -0
- package/dist/cjs/forward-memebers.cjs.entry.js +24 -5
- package/dist/cjs/forward-memebers.cjs.entry.js.map +1 -1
- package/dist/cjs/groupcast-9456b0c7.js +356 -0
- package/dist/cjs/groupcast-9456b0c7.js.map +1 -0
- package/dist/cjs/index.cjs.js +9 -9
- package/dist/cjs/iso-group-info.cjs.entry.js +74 -0
- package/dist/cjs/iso-group-info.cjs.entry.js.map +1 -0
- package/dist/cjs/isometrik-webchat.cjs.js +5 -5
- package/dist/cjs/loader.cjs.js +5 -5
- package/dist/cjs/login-page_3.cjs.entry.js +177 -69
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/cjs/member-add.cjs.entry.js +23 -5
- package/dist/cjs/member-add.cjs.entry.js.map +1 -1
- package/dist/cjs/{runtime-controls-a70872fe.js → runtime-controls-6d4fd7ed.js} +8 -7
- package/dist/cjs/runtime-controls-6d4fd7ed.js.map +1 -0
- package/dist/cjs/{groupcast-bb393c81.js → session-d44ca719.js} +1 -20
- package/dist/cjs/session-d44ca719.js.map +1 -0
- package/dist/collection/api/groupcast.js +42 -4
- package/dist/collection/components/ChatUIComponent/AddMember.js +24 -5
- package/dist/collection/components/ChatUIComponent/AddMember.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +25 -2
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +58 -3
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js +15 -6
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js +24 -5
- package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/GroupCast/GroupCast.js +29 -110
- package/dist/collection/components/ChatUIComponent/shared/GroupCast/GroupCast.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js +4 -2
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/message-search/message-search.js +4 -4
- package/dist/collection/components/ChatUIComponent/shared/message-search/message-search.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/WebChat.js +49 -4
- package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/bootstrap.js +4 -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 +2 -2
- package/dist/collection/components/my-component/web-chat/data-fetch.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/event-handlers.js +23 -6
- package/dist/collection/components/my-component/web-chat/event-handlers.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/groupcast-draft.js +67 -0
- package/dist/collection/components/my-component/web-chat/groupcast-draft.js.map +1 -0
- package/dist/collection/components/my-component/web-chat/shell-render.js +2 -6
- package/dist/collection/components/my-component/web-chat/shell-render.js.map +1 -1
- package/dist/collection/lib/chat/groupcast.js +81 -1
- package/dist/collection/lib/chat/groupcast.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/components/ChatFooter.js +41 -5
- package/dist/components/ChatFooter.js.map +1 -1
- package/dist/components/ChatSidebar.js +26 -3
- package/dist/components/ChatSidebar.js.map +1 -1
- package/dist/components/{GroupCast2.js → GroupCast3.js} +21 -98
- package/dist/components/GroupCast3.js.map +1 -0
- package/dist/components/WebChat.js +172 -62
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/WebChatBody.js +2 -2
- package/dist/components/WebChatHeader.js +15 -6
- package/dist/components/WebChatHeader.js.map +1 -1
- package/dist/components/chat-app.js +1 -1
- package/dist/components/client.js +1 -17
- package/dist/components/client.js.map +1 -1
- package/dist/components/contact-info2.js +4 -2
- package/dist/components/contact-info2.js.map +1 -1
- package/dist/components/forward-memebers.js +24 -5
- package/dist/components/forward-memebers.js.map +1 -1
- package/dist/components/group-cast.js +1 -1
- package/dist/components/groupcast.js +94 -192
- package/dist/components/groupcast.js.map +1 -1
- package/dist/{esm/groupcast-c6da3918.js → components/groupcast2.js} +45 -7
- package/dist/components/groupcast2.js.map +1 -0
- package/dist/components/helpers.js +1 -1
- package/dist/components/index.js +3 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/member-add.js +24 -5
- package/dist/components/member-add.js.map +1 -1
- package/dist/components/message-search2.js +4 -4
- package/dist/components/message-search2.js.map +1 -1
- package/dist/esm/{app-globals-eba1ca0c.js → app-globals-5dd18915.js} +3 -3
- package/dist/esm/{app-globals-eba1ca0c.js.map → app-globals-5dd18915.js.map} +1 -1
- package/dist/esm/attachment-preview_23.entry.js +99 -98
- package/dist/esm/attachment-preview_23.entry.js.map +1 -1
- package/dist/esm/audio-bubble_4.entry.js +1 -1
- package/dist/esm/{chat-tile_3.entry.js → chat-tile_2.entry.js} +3 -67
- package/dist/esm/chat-tile_2.entry.js.map +1 -0
- package/dist/esm/forward-memebers.entry.js +24 -5
- package/dist/esm/forward-memebers.entry.js.map +1 -1
- package/dist/esm/group-chat-contacts.entry.js +1 -1
- package/dist/esm/groupcast-e32d3b10.js +331 -0
- package/dist/esm/groupcast-e32d3b10.js.map +1 -0
- package/dist/esm/{helpers-1632a4c7.js → helpers-d452bc0f.js} +2 -2
- package/dist/esm/{helpers-1632a4c7.js.map → helpers-d452bc0f.js.map} +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/iso-group-info.entry.js +70 -0
- package/dist/esm/iso-group-info.entry.js.map +1 -0
- package/dist/esm/isometrik-webchat.js +5 -5
- package/dist/esm/loader.js +5 -5
- package/dist/esm/login-page_3.entry.js +168 -60
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/esm/member-add.entry.js +25 -7
- package/dist/esm/member-add.entry.js.map +1 -1
- package/dist/esm/new-chat-sidebar.entry.js +1 -1
- package/dist/esm/{runtime-controls-bdb84aeb.js → runtime-controls-6dafba73.js} +3 -2
- package/dist/esm/runtime-controls-6dafba73.js.map +1 -0
- package/dist/esm/{groupcast-4f15b050.js → session-ed7217a7.js} +2 -18
- package/dist/esm/session-ed7217a7.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-056f6809.entry.js +2 -0
- package/dist/isometrik-webchat/p-056f6809.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-05b33578.js +2 -0
- package/dist/isometrik-webchat/{p-57f97cef.entry.js → p-0649db69.entry.js} +2 -2
- package/dist/isometrik-webchat/p-068abd0a.entry.js +2 -0
- package/dist/isometrik-webchat/p-068abd0a.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-22404d0d.entry.js +2 -0
- package/dist/isometrik-webchat/p-22404d0d.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-7d01ccbb.js +2 -0
- package/dist/isometrik-webchat/p-7d01ccbb.js.map +1 -0
- package/dist/isometrik-webchat/p-90c38a4e.entry.js +2 -0
- package/dist/isometrik-webchat/p-90c38a4e.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-0bb42151.entry.js → p-94f0c983.entry.js} +2 -2
- package/dist/isometrik-webchat/p-ac671eb5.js +2 -0
- package/dist/isometrik-webchat/p-ac671eb5.js.map +1 -0
- package/dist/isometrik-webchat/p-b884d9ee.entry.js +2 -0
- package/dist/isometrik-webchat/p-b884d9ee.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-c4333279.entry.js +2 -0
- package/dist/isometrik-webchat/p-c4333279.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-cce7d971.js +2 -0
- package/dist/isometrik-webchat/{p-a83932d4.js.map → p-cce7d971.js.map} +1 -1
- package/dist/isometrik-webchat/{p-02db2116.entry.js → p-ec03caec.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-3dca1e56.js → p-f97e3f6d.js} +2 -2
- package/dist/types/components/ChatUIComponent/AddMember.d.ts +1 -0
- package/dist/types/components/ChatUIComponent/Footer/ChatFooter.d.ts +3 -1
- package/dist/types/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.d.ts +3 -0
- package/dist/types/components/ChatUIComponent/shared/GroupCast/GroupCast.d.ts +2 -11
- package/dist/types/components/my-component/web-chat/WebChat.d.ts +23 -0
- package/dist/types/components/my-component/web-chat/groupcast-draft.d.ts +23 -0
- package/dist/types/components.d.ts +13 -2
- package/dist/types/lib/chat/groupcast.d.ts +66 -0
- package/dist/types/lib/chat/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/chat-tile_3.cjs.entry.js.map +0 -1
- package/dist/cjs/groupcast-bb393c81.js.map +0 -1
- package/dist/cjs/groupcast-e1e52bd1.js +0 -213
- package/dist/cjs/groupcast-e1e52bd1.js.map +0 -1
- package/dist/cjs/runtime-controls-a70872fe.js.map +0 -1
- package/dist/components/GroupCast2.js.map +0 -1
- package/dist/esm/chat-tile_3.entry.js.map +0 -1
- package/dist/esm/groupcast-4f15b050.js.map +0 -1
- package/dist/esm/groupcast-c6da3918.js.map +0 -1
- package/dist/esm/runtime-controls-bdb84aeb.js.map +0 -1
- package/dist/isometrik-webchat/p-03933431.entry.js +0 -2
- package/dist/isometrik-webchat/p-03933431.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-1f0e8230.entry.js +0 -2
- package/dist/isometrik-webchat/p-1f0e8230.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-3a0409fc.js +0 -2
- package/dist/isometrik-webchat/p-3a0409fc.js.map +0 -1
- package/dist/isometrik-webchat/p-46be73c5.js +0 -2
- package/dist/isometrik-webchat/p-46be73c5.js.map +0 -1
- package/dist/isometrik-webchat/p-605cb14e.entry.js +0 -2
- package/dist/isometrik-webchat/p-605cb14e.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-69d953cb.entry.js +0 -2
- package/dist/isometrik-webchat/p-69d953cb.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-6c5eb178.js +0 -2
- package/dist/isometrik-webchat/p-a83932d4.js +0 -2
- package/dist/isometrik-webchat/p-b0f6f9ab.entry.js +0 -2
- package/dist/isometrik-webchat/p-b0f6f9ab.entry.js.map +0 -1
- /package/dist/isometrik-webchat/{p-6c5eb178.js.map → p-05b33578.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-57f97cef.entry.js.map → p-0649db69.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-0bb42151.entry.js.map → p-94f0c983.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-02db2116.entry.js.map → p-ec03caec.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-3dca1e56.js.map → p-f97e3f6d.js.map} +0 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { h, Fragment, proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
|
|
2
|
+
import { s as showToast } from './toast.js';
|
|
3
|
+
import { g as getGroupcastUrlQuery, a as getDeviceID } from './helpers.js';
|
|
4
|
+
import { c as buildDraftGroupcastMeta, G as GROUPCAST_DRAFT_URL_ID, i as isGroupcastDraftId, d as createGroupcastFromDraft, D as DEFAULT_GROUPCAST_TITLE, e as DEFAULT_GROUPCAST_IMAGE_URL, f as fetchGroupcastDetails, a as fetchGroupcastMembersPage, b as fetchGroupcastContactsPage, r as removeFromMembersDetail } from './groupcast.js';
|
|
2
5
|
import { d as defineCustomElement$6 } from './spinner-loader2.js';
|
|
3
6
|
import { d as defineCustomElement$u } from './ChatSidebar.js';
|
|
4
|
-
import { d as defineCustomElement$p } from './
|
|
7
|
+
import { d as defineCustomElement$p } from './GroupCast3.js';
|
|
5
8
|
import { d as defineCustomElement$3 } from './WebChatHeader.js';
|
|
6
9
|
import { d as defineCustomElement$w } from './ChatFooter.js';
|
|
7
10
|
import { d as defineCustomElement$b } from './Profile.js';
|
|
@@ -10,19 +13,17 @@ import { w as withConversationPushFlag, d as defineCustomElement$s } from './con
|
|
|
10
13
|
import { d as defineCustomElement$2 } from './WebchatRightSide.js';
|
|
11
14
|
import { d as defineCustomElement$v } from './chat-loading-placeholder2.js';
|
|
12
15
|
import { drawerDialogService } from './drawer.js';
|
|
13
|
-
import { g as getDeviceID, a as getGroupcastUrlQuery } from './helpers.js';
|
|
14
16
|
import { M } from './index.m.js';
|
|
15
17
|
import { c as createStore } from './index3.js';
|
|
16
|
-
import { b as getGroupcastMessage, r as removeGroupcastMember, d as deleteGroupCast } from './
|
|
18
|
+
import { b as getGroupcastMessage, r as removeGroupcastMember, u as updateGroupCast, d as deleteGroupCast } from './groupcast2.js';
|
|
17
19
|
import { a as attachmentBodyForApi, p as prepareMediaAttachments, u as uploadAndPostMediaMessage, i as isAttachmentBodyPlaceholder, d as isSameNameUploadCancelledError, e as buildLocalMediaAttachments, f as attachmentBodyForOutgoing, r as resolveCustomTypeForUpload, b as buildReplyMetaData } from './send-media.js';
|
|
18
20
|
import { f as findConversationForPush, s as showLocalMessageNotification, m as messagePushContextFrom, w as withHostMessagePushFields } from './local-notification.js';
|
|
19
21
|
import { t as takeMediaFiles, M as MAX_MEDIA_PER_MESSAGE, m as mediaLimitToastMessage } from './media-limits.js';
|
|
20
|
-
import { g as getOfflineClient, m as mergeMessagesById,
|
|
22
|
+
import { g as getOfflineClient, m as mergeMessagesById, c as isBrowserOnline, i as initializeChatSdk, f as fetchUserDetails, a as resolveRegionMode } from './client.js';
|
|
21
23
|
import { s as storageQuotaStore } from './storage-quota2.js';
|
|
22
24
|
import { a as fetchStorageMedia } from './storage-quota.js';
|
|
23
25
|
import { n as normalizeConversationSearchTag, f as fetchConversationsPage, m as mergeUniqueConversations, b as filterConversationsBySearch, a as fetchConversationDetails, s as sortConversationsByLatestMessage } from './conversations.js';
|
|
24
26
|
import { f as fetchMessagesPage, s as searchMessages, b as fetchLinkMessages, c as fetchMediaCount, d as fetchMediaAttachments, m as markConversationRead } from './messages.js';
|
|
25
|
-
import { s as showToast } from './toast.js';
|
|
26
27
|
import { M as MQTT_CREDS, i as isometrikFlutterAppSecrets } from './chat-creds.js';
|
|
27
28
|
import { r as removeConversationMember, g as getConversationEligibleMembers } from './group-members.js';
|
|
28
29
|
import { g as groupMembersStore } from './prompt-exit-group.js';
|
|
@@ -923,6 +924,110 @@ function enqueueMqttTask(host, task) {
|
|
|
923
924
|
return next;
|
|
924
925
|
}
|
|
925
926
|
|
|
927
|
+
/** URL + conversation-select helpers — no Stencil, no API. */
|
|
928
|
+
function pushConversationUrl(conversationId) {
|
|
929
|
+
const url = new URL(window.location.href);
|
|
930
|
+
url.search = '';
|
|
931
|
+
if (conversationId)
|
|
932
|
+
url.searchParams.set('conversation', conversationId);
|
|
933
|
+
window.history.pushState({}, '', url);
|
|
934
|
+
}
|
|
935
|
+
function pushGroupcastUrl(groupcastId) {
|
|
936
|
+
const url = new URL(window.location.href);
|
|
937
|
+
url.search = '';
|
|
938
|
+
url.searchParams.set('groupcast', groupcastId);
|
|
939
|
+
window.history.pushState({}, '', url);
|
|
940
|
+
}
|
|
941
|
+
function clearChatUrls() {
|
|
942
|
+
const url = new URL(window.location.href);
|
|
943
|
+
url.searchParams.delete('conversation');
|
|
944
|
+
url.searchParams.delete('groupcast');
|
|
945
|
+
window.history.pushState({}, '', url.toString());
|
|
946
|
+
}
|
|
947
|
+
/** Sidebar preview meta when picking a conversation from the list. */
|
|
948
|
+
function metaFromConversationList(list, conversationId) {
|
|
949
|
+
const target = list === null || list === void 0 ? void 0 : list.find(c => (c === null || c === void 0 ? void 0 : c.conversationId) === conversationId);
|
|
950
|
+
if (!target)
|
|
951
|
+
return null;
|
|
952
|
+
return {
|
|
953
|
+
isGroup: target === null || target === void 0 ? void 0 : target.isGroup,
|
|
954
|
+
conversationImageUrl: (target === null || target === void 0 ? void 0 : target.isGroup) ? target === null || target === void 0 ? void 0 : target.conversationImageUrl : null,
|
|
955
|
+
conversationTitle: (target === null || target === void 0 ? void 0 : target.isGroup) ? target === null || target === void 0 ? void 0 : target.conversationTitle : null,
|
|
956
|
+
opponentDetails: Object.assign({}, target.opponentDetails),
|
|
957
|
+
};
|
|
958
|
+
}
|
|
959
|
+
function zeroUnreadInList(list, conversationId) {
|
|
960
|
+
return (list || []).map(conversation => {
|
|
961
|
+
if (conversation.conversationId === conversationId) {
|
|
962
|
+
conversation.unreadMessagesCount = 0;
|
|
963
|
+
}
|
|
964
|
+
return conversation;
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
function hostOpenDraftGroupcast(host, members) {
|
|
969
|
+
if (!(members === null || members === void 0 ? void 0 : members.length) || members.length < 2) {
|
|
970
|
+
showToast({
|
|
971
|
+
message: 'Select at least 2 recipients for a groupcast',
|
|
972
|
+
type: 'error',
|
|
973
|
+
position: 'bottom-right',
|
|
974
|
+
});
|
|
975
|
+
return;
|
|
976
|
+
}
|
|
977
|
+
host.draftGroupcast = { members };
|
|
978
|
+
host.conversationMetaData = buildDraftGroupcastMeta(members);
|
|
979
|
+
host.selectedConversationId = GROUPCAST_DRAFT_URL_ID;
|
|
980
|
+
host.allMessages = [];
|
|
981
|
+
host.groupcastCreateInFlight = null;
|
|
982
|
+
pushGroupcastUrl(GROUPCAST_DRAFT_URL_ID);
|
|
983
|
+
host.activeTab = 'GroupCast';
|
|
984
|
+
if (host.isMobileView)
|
|
985
|
+
host.showSidebar = false;
|
|
986
|
+
}
|
|
987
|
+
/** Resolves draft URL to a real groupcastId before sending. Single-flight. */
|
|
988
|
+
async function hostEnsureGroupcastCreated(host) {
|
|
989
|
+
var _a, _b, _c;
|
|
990
|
+
const { groupcastId } = getGroupcastUrlQuery();
|
|
991
|
+
const id = groupcastId || host.selectedConversationId;
|
|
992
|
+
if (!isGroupcastDraftId(id))
|
|
993
|
+
return id;
|
|
994
|
+
if (!((_b = (_a = host.draftGroupcast) === null || _a === void 0 ? void 0 : _a.members) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
995
|
+
throw new Error('No groupcast draft — pick recipients again');
|
|
996
|
+
}
|
|
997
|
+
if (!host.groupcastCreateInFlight) {
|
|
998
|
+
host.groupcastCreateInFlight = createGroupcastFromDraft(host.draftGroupcast.members, {
|
|
999
|
+
userName: (_c = host.userMetaData) === null || _c === void 0 ? void 0 : _c.userName,
|
|
1000
|
+
})
|
|
1001
|
+
.then(res => {
|
|
1002
|
+
var _a, _b, _c;
|
|
1003
|
+
const newId = res === null || res === void 0 ? void 0 : res.groupcastId;
|
|
1004
|
+
if (!newId)
|
|
1005
|
+
throw new Error('Groupcast create failed');
|
|
1006
|
+
host.draftGroupcast = null;
|
|
1007
|
+
pushGroupcastUrl(newId);
|
|
1008
|
+
host.selectedConversationId = newId;
|
|
1009
|
+
const created = {
|
|
1010
|
+
groupcastId: newId,
|
|
1011
|
+
groupcastTitle: DEFAULT_GROUPCAST_TITLE,
|
|
1012
|
+
groupcastImageUrl: DEFAULT_GROUPCAST_IMAGE_URL,
|
|
1013
|
+
membersCount: (_a = res === null || res === void 0 ? void 0 : res.membersCount) !== null && _a !== void 0 ? _a : (_b = host.conversationMetaData) === null || _b === void 0 ? void 0 : _b.membersCount,
|
|
1014
|
+
createdAt: Date.now(),
|
|
1015
|
+
customType: 'broadcast',
|
|
1016
|
+
metaData: (_c = host.conversationMetaData) === null || _c === void 0 ? void 0 : _c.metaData,
|
|
1017
|
+
};
|
|
1018
|
+
host.allGroupCastContacts = [created, ...(host.allGroupCastContacts || [])];
|
|
1019
|
+
host.conversationMetaData = Object.assign(Object.assign({}, host.conversationMetaData), { groupcastId: newId });
|
|
1020
|
+
host.groupcastCreateInFlight = null;
|
|
1021
|
+
return newId;
|
|
1022
|
+
})
|
|
1023
|
+
.catch(err => {
|
|
1024
|
+
host.groupcastCreateInFlight = null;
|
|
1025
|
+
throw err;
|
|
1026
|
+
});
|
|
1027
|
+
}
|
|
1028
|
+
return host.groupcastCreateInFlight;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
926
1031
|
const getTotalUnreadConversationsCount = async () => {
|
|
927
1032
|
const response = await M.getInstance().Conversation.getConversationUnreadCount();
|
|
928
1033
|
return response?.count;
|
|
@@ -1245,6 +1350,9 @@ async function bootstrapWebChat(host, generation) {
|
|
|
1245
1350
|
host.selectedConversationId = host.initialConversationIdFromURL;
|
|
1246
1351
|
const isGroupCast = new URLSearchParams(window.location.search).has('groupcast');
|
|
1247
1352
|
if (isGroupCast) {
|
|
1353
|
+
if (isGroupcastDraftId(host.initialConversationIdFromURL)) {
|
|
1354
|
+
return;
|
|
1355
|
+
}
|
|
1248
1356
|
await host.getGroupCastConversationDetails(host.initialConversationIdFromURL);
|
|
1249
1357
|
const messages = await getGroupcastMessage(host.initialConversationIdFromURL);
|
|
1250
1358
|
if (messages === null || messages === void 0 ? void 0 : messages.messages) {
|
|
@@ -1303,47 +1411,6 @@ async function bootstrapWebChat(host, generation) {
|
|
|
1303
1411
|
}
|
|
1304
1412
|
}
|
|
1305
1413
|
|
|
1306
|
-
/** URL + conversation-select helpers — no Stencil, no API. */
|
|
1307
|
-
function pushConversationUrl(conversationId) {
|
|
1308
|
-
const url = new URL(window.location.href);
|
|
1309
|
-
url.search = '';
|
|
1310
|
-
if (conversationId)
|
|
1311
|
-
url.searchParams.set('conversation', conversationId);
|
|
1312
|
-
window.history.pushState({}, '', url);
|
|
1313
|
-
}
|
|
1314
|
-
function pushGroupcastUrl(groupcastId) {
|
|
1315
|
-
const url = new URL(window.location.href);
|
|
1316
|
-
url.search = '';
|
|
1317
|
-
url.searchParams.set('groupcast', groupcastId);
|
|
1318
|
-
window.history.pushState({}, '', url);
|
|
1319
|
-
}
|
|
1320
|
-
function clearChatUrls() {
|
|
1321
|
-
const url = new URL(window.location.href);
|
|
1322
|
-
url.searchParams.delete('conversation');
|
|
1323
|
-
url.searchParams.delete('groupcast');
|
|
1324
|
-
window.history.pushState({}, '', url.toString());
|
|
1325
|
-
}
|
|
1326
|
-
/** Sidebar preview meta when picking a conversation from the list. */
|
|
1327
|
-
function metaFromConversationList(list, conversationId) {
|
|
1328
|
-
const target = list === null || list === void 0 ? void 0 : list.find(c => (c === null || c === void 0 ? void 0 : c.conversationId) === conversationId);
|
|
1329
|
-
if (!target)
|
|
1330
|
-
return null;
|
|
1331
|
-
return {
|
|
1332
|
-
isGroup: target === null || target === void 0 ? void 0 : target.isGroup,
|
|
1333
|
-
conversationImageUrl: (target === null || target === void 0 ? void 0 : target.isGroup) ? target === null || target === void 0 ? void 0 : target.conversationImageUrl : null,
|
|
1334
|
-
conversationTitle: (target === null || target === void 0 ? void 0 : target.isGroup) ? target === null || target === void 0 ? void 0 : target.conversationTitle : null,
|
|
1335
|
-
opponentDetails: Object.assign({}, target.opponentDetails),
|
|
1336
|
-
};
|
|
1337
|
-
}
|
|
1338
|
-
function zeroUnreadInList(list, conversationId) {
|
|
1339
|
-
return (list || []).map(conversation => {
|
|
1340
|
-
if (conversation.conversationId === conversationId) {
|
|
1341
|
-
conversation.unreadMessagesCount = 0;
|
|
1342
|
-
}
|
|
1343
|
-
return conversation;
|
|
1344
|
-
});
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
1414
|
/**
|
|
1348
1415
|
* Data-fetch helpers for <web-chat> — keep WebChat.tsx as a thin shell.
|
|
1349
1416
|
*/
|
|
@@ -1379,7 +1446,7 @@ async function hostGetConversations(host, skip = 0, searchTag = null, showLoader
|
|
|
1379
1446
|
}
|
|
1380
1447
|
}
|
|
1381
1448
|
async function hostGetGroupCastConversationDetails(host, groupcastId) {
|
|
1382
|
-
if (!groupcastId)
|
|
1449
|
+
if (!groupcastId || isGroupcastDraftId(groupcastId))
|
|
1383
1450
|
return;
|
|
1384
1451
|
try {
|
|
1385
1452
|
host.conversationMetaData = await fetchGroupcastDetails(groupcastId);
|
|
@@ -2202,14 +2269,23 @@ async function apiCreateDmConversation(selectedContactId, selectedContactName) {
|
|
|
2202
2269
|
* DOM / UI event bodies for <web-chat> — @Listen stays on the class, logic lives here.
|
|
2203
2270
|
*/
|
|
2204
2271
|
async function hostRemoveMemberClicked(host, event) {
|
|
2205
|
-
var _a;
|
|
2272
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2206
2273
|
const isGroupcast = event.detail.isGroupcast;
|
|
2207
2274
|
const memberToRemove = event.detail.userId;
|
|
2208
2275
|
const originalMembers = ((_a = host.conversationMetaData) === null || _a === void 0 ? void 0 : _a.members) || [];
|
|
2209
2276
|
const groupcastId = event.detail.conversationId;
|
|
2210
2277
|
try {
|
|
2211
2278
|
if (isGroupcast) {
|
|
2212
|
-
|
|
2279
|
+
const memberIds = Array.isArray(memberToRemove) ? memberToRemove : [memberToRemove];
|
|
2280
|
+
await removeGroupcastMember(groupcastId, memberIds);
|
|
2281
|
+
const existingDetail = (_c = (_b = host.conversationMetaData) === null || _b === void 0 ? void 0 : _b.metaData) === null || _c === void 0 ? void 0 : _c.membersDetail;
|
|
2282
|
+
const updatedDetail = removeFromMembersDetail(existingDetail, memberIds);
|
|
2283
|
+
const updatedMeta = Object.assign(Object.assign({}, (((_d = host.conversationMetaData) === null || _d === void 0 ? void 0 : _d.metaData) || {})), { membersDetail: updatedDetail });
|
|
2284
|
+
await updateGroupCast({ groupcastId, metaData: updatedMeta });
|
|
2285
|
+
host.conversationMetaData = Object.assign(Object.assign({}, host.conversationMetaData), { metaData: updatedMeta, members: (((_e = host.conversationMetaData) === null || _e === void 0 ? void 0 : _e.members) || []).filter((m) => !memberIds.includes(m.userId)), membersCount: updatedDetail.length });
|
|
2286
|
+
host.groupcastMembers = (host.groupcastMembers || []).filter((m) => !memberIds.includes(m.userId));
|
|
2287
|
+
void host.getGroupcastMembers(groupcastId);
|
|
2288
|
+
void ((_f = host.getGroupCastContacts) === null || _f === void 0 ? void 0 : _f.call(host));
|
|
2213
2289
|
}
|
|
2214
2290
|
else {
|
|
2215
2291
|
await removeConversationMember(host.selectedConversationId, memberToRemove);
|
|
@@ -2374,6 +2450,11 @@ async function hostSelectedConversationChange(host, newValue) {
|
|
|
2374
2450
|
const isGroupcast = url.searchParams.has('groupcast');
|
|
2375
2451
|
if (isGroupcast) {
|
|
2376
2452
|
const groupcastId = url.searchParams.get('groupcast');
|
|
2453
|
+
if (isGroupcastDraftId(groupcastId)) {
|
|
2454
|
+
host.isConversationLoading = false;
|
|
2455
|
+
host.emitSelectionChange();
|
|
2456
|
+
return;
|
|
2457
|
+
}
|
|
2377
2458
|
try {
|
|
2378
2459
|
host.isScrollToBottom = true;
|
|
2379
2460
|
host.isMessageLimitEnd = true;
|
|
@@ -2400,10 +2481,11 @@ async function hostSelectedConversationChange(host, newValue) {
|
|
|
2400
2481
|
const currentCount = unreadCountStore.getTotalUnreadCount();
|
|
2401
2482
|
unreadCountStore.updateTotalUnreadCount(Math.max(0, currentCount - 1));
|
|
2402
2483
|
}
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2484
|
+
if (!isGroupcastDraftId(newValue)) {
|
|
2485
|
+
void markConversationRead(newValue).catch(err => {
|
|
2486
|
+
console.warn('[webchat] markConversationRead failed', err);
|
|
2487
|
+
});
|
|
2488
|
+
}
|
|
2407
2489
|
host.emitSelectionChange();
|
|
2408
2490
|
}
|
|
2409
2491
|
else if (host.conversationDetailsInterval) {
|
|
@@ -2767,11 +2849,7 @@ function renderSidebarTab(host) {
|
|
|
2767
2849
|
const groupcastOn = host.groupcastEnabled !== false;
|
|
2768
2850
|
const tab = host.activeTab === 'GroupCast' && !groupcastOn ? 'Chat' : host.activeTab;
|
|
2769
2851
|
if (tab === 'GroupCast') {
|
|
2770
|
-
return renderRegion(host, 'group-cast', true, () => (h("group-cast", { isLoadingMore: host.isLoadingMoreGroupcast, groupCastData: host.allGroupCastContacts, userMetaData: host.userMetaData, onGroupcastTileSelected: (e) => host.handleChatSelect(e.detail)
|
|
2771
|
-
if (!(g === null || g === void 0 ? void 0 : g.groupcastId))
|
|
2772
|
-
return;
|
|
2773
|
-
host.allGroupCastContacts = [g, ...(host.allGroupCastContacts || [])];
|
|
2774
|
-
} })));
|
|
2852
|
+
return renderRegion(host, 'group-cast', true, () => (h("group-cast", { isLoadingMore: host.isLoadingMoreGroupcast, groupCastData: host.allGroupCastContacts, userMetaData: host.userMetaData, onGroupcastTileSelected: (e) => host.handleChatSelect(e.detail) })));
|
|
2775
2853
|
}
|
|
2776
2854
|
if (tab === 'Profile') {
|
|
2777
2855
|
return renderRegion(host, 'profile-page', true, () => (h("profile-page", { getUserDetails: host.getUserDetails, name: host.userMetaData.userName, profilePhotoUrl: host.userMetaData.userProfileImageUrl, closeDrawer: () => (host.activeTab = 'Chat'), toggleTheme: host.toggleTheme, defaultTheme: host.defaultTheme })));
|
|
@@ -2810,7 +2888,7 @@ function renderDefaultComposer(host) {
|
|
|
2810
2888
|
return h("p", { class: "blockMessageContainer" }, WEB_CONTENT.BLOCK_CHAT_MESSAGE);
|
|
2811
2889
|
}
|
|
2812
2890
|
const el = host.el;
|
|
2813
|
-
return (h("chat-footer", { userMetaData: host.userMetaData, updateAllMessages: host.updateAllMessages, changeMessageSendingState: host.changeMessageSendingState, changeScrollToBottomState: host.changeScrollToBottomState, refetchMessages: host.refetchMessages, allMessages: host.allMessages, selectedConversationId: host.selectedConversationId, replyMessage: host.replyMessage, handleremoveReplyMessage: host.handleremoveReplyMessage, conversationDetails: host.conversationMetaData, allConversationList: host.allConversationList, updateConversationListProp: host.updateConversationList },
|
|
2891
|
+
return (h("chat-footer", { userMetaData: host.userMetaData, updateAllMessages: host.updateAllMessages, changeMessageSendingState: host.changeMessageSendingState, changeScrollToBottomState: host.changeScrollToBottomState, refetchMessages: host.refetchMessages, allMessages: host.allMessages, selectedConversationId: host.selectedConversationId, replyMessage: host.replyMessage, handleremoveReplyMessage: host.handleremoveReplyMessage, conversationDetails: host.conversationMetaData, allConversationList: host.allConversationList, updateConversationListProp: host.updateConversationList, ensureGroupcastReady: host.ensureGroupcastReady },
|
|
2814
2892
|
hasNamedSlot(el, 'reply-preview') ? h("slot", { name: "reply-preview", slot: "reply-preview" }) : null,
|
|
2815
2893
|
hasNamedSlot(el, 'attachment-preview') ? h("slot", { name: "attachment-preview", slot: "attachment-preview" }) : null,
|
|
2816
2894
|
hasNamedSlot(el, 'composer-input') ? h("slot", { name: "composer-input", slot: "composer-input" }) : null));
|
|
@@ -2900,6 +2978,7 @@ const WebChat = /*@__PURE__*/ proxyCustomElement(class WebChat extends HTMLEleme
|
|
|
2900
2978
|
this.messageReadStatusUpdated = createEvent(this, "messageReadStatusUpdated", 7);
|
|
2901
2979
|
this.chatBodyRef = null;
|
|
2902
2980
|
this.conversationDetailsInterval = null;
|
|
2981
|
+
this.groupcastCreateInFlight = null;
|
|
2903
2982
|
this.mqttSession = new MqttSession();
|
|
2904
2983
|
this.boundCheckMobileView = () => this.checkMobileView();
|
|
2905
2984
|
this.mqttRefetchInterval = null;
|
|
@@ -2925,6 +3004,8 @@ const WebChat = /*@__PURE__*/ proxyCustomElement(class WebChat extends HTMLEleme
|
|
|
2925
3004
|
};
|
|
2926
3005
|
this.userTokenFromCookie = this.getCookie('userToken');
|
|
2927
3006
|
this.isometrikUserIdFromCookie = this.getCookie('isometrikUserId');
|
|
3007
|
+
// ─── Open chat / URL (navigation.ts) ───
|
|
3008
|
+
this.ensureGroupcastReady = () => hostEnsureGroupcastCreated(this);
|
|
2928
3009
|
/// for get user details start
|
|
2929
3010
|
// ─── Data fetch (thin wrappers → data-fetch.ts → lib/chat) ───
|
|
2930
3011
|
this.getUserDetails = async () => hostGetUserDetails(this);
|
|
@@ -3121,6 +3202,7 @@ const WebChat = /*@__PURE__*/ proxyCustomElement(class WebChat extends HTMLEleme
|
|
|
3121
3202
|
this.isLoadingMoreGroupcast = false;
|
|
3122
3203
|
this.hasMoreGroupcast = true;
|
|
3123
3204
|
this.groupcastMembers = [];
|
|
3205
|
+
this.draftGroupcast = null;
|
|
3124
3206
|
}
|
|
3125
3207
|
emitConversationsChange() {
|
|
3126
3208
|
this.conversationsChange.emit({ conversations: this.allConversationList });
|
|
@@ -3270,7 +3352,16 @@ const WebChat = /*@__PURE__*/ proxyCustomElement(class WebChat extends HTMLEleme
|
|
|
3270
3352
|
const groupcastId = urlParams.get('groupcast');
|
|
3271
3353
|
this.initialConversationIdFromURL = (_a = (isGroupcast ? groupcastId : conversationId)) !== null && _a !== void 0 ? _a : '';
|
|
3272
3354
|
this.isMobileView = window.innerWidth <= 768;
|
|
3273
|
-
|
|
3355
|
+
if (isGroupcast && isGroupcastDraftId(groupcastId)) {
|
|
3356
|
+
this.selectedConversationId = null;
|
|
3357
|
+
this.initialConversationIdFromURL = '';
|
|
3358
|
+
const url = new URL(window.location.href);
|
|
3359
|
+
url.searchParams.delete('groupcast');
|
|
3360
|
+
window.history.replaceState({}, '', url.pathname + url.search);
|
|
3361
|
+
}
|
|
3362
|
+
else {
|
|
3363
|
+
this.selectedConversationId = isGroupcast ? groupcastId : conversationId;
|
|
3364
|
+
}
|
|
3274
3365
|
if (this.isMobileView && (conversationId || groupcastId)) {
|
|
3275
3366
|
this.showSidebar = false;
|
|
3276
3367
|
}
|
|
@@ -3315,7 +3406,25 @@ const WebChat = /*@__PURE__*/ proxyCustomElement(class WebChat extends HTMLEleme
|
|
|
3315
3406
|
async setupMqttClient() {
|
|
3316
3407
|
return hostSetupMqttClient(this);
|
|
3317
3408
|
}
|
|
3318
|
-
|
|
3409
|
+
openDraftGroupcast(members) {
|
|
3410
|
+
hostOpenDraftGroupcast(this, members);
|
|
3411
|
+
}
|
|
3412
|
+
handleGroupcastDraftReady(event) {
|
|
3413
|
+
var _a;
|
|
3414
|
+
const members = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.members;
|
|
3415
|
+
if (members === null || members === void 0 ? void 0 : members.length)
|
|
3416
|
+
this.openDraftGroupcast(members);
|
|
3417
|
+
}
|
|
3418
|
+
handleGroupcastMembersChanged(event) {
|
|
3419
|
+
var _a;
|
|
3420
|
+
const { groupcastId, membersDetail } = event.detail || {};
|
|
3421
|
+
if (!groupcastId || groupcastId !== this.selectedConversationId)
|
|
3422
|
+
return;
|
|
3423
|
+
if (membersDetail) {
|
|
3424
|
+
this.conversationMetaData = Object.assign(Object.assign({}, this.conversationMetaData), { metaData: Object.assign(Object.assign({}, (((_a = this.conversationMetaData) === null || _a === void 0 ? void 0 : _a.metaData) || {})), { membersDetail }), membersCount: membersDetail.length });
|
|
3425
|
+
}
|
|
3426
|
+
void this.getGroupcastMembers(groupcastId);
|
|
3427
|
+
}
|
|
3319
3428
|
handleChatSelect(param) {
|
|
3320
3429
|
const conversationId = typeof param === 'string' ? param : param.groupcastId;
|
|
3321
3430
|
this.selectedConversationId = conversationId;
|
|
@@ -3598,6 +3707,7 @@ const WebChat = /*@__PURE__*/ proxyCustomElement(class WebChat extends HTMLEleme
|
|
|
3598
3707
|
"isLoadingMoreGroupcast": [32],
|
|
3599
3708
|
"hasMoreGroupcast": [32],
|
|
3600
3709
|
"groupcastMembers": [32],
|
|
3710
|
+
"draftGroupcast": [32],
|
|
3601
3711
|
"setCustomParts": [64],
|
|
3602
3712
|
"selectConversation": [64],
|
|
3603
3713
|
"setReply": [64],
|
|
@@ -3612,7 +3722,7 @@ const WebChat = /*@__PURE__*/ proxyCustomElement(class WebChat extends HTMLEleme
|
|
|
3612
3722
|
"deleteStorageMedia": [64],
|
|
3613
3723
|
"deleteConversationStorageMedia": [64],
|
|
3614
3724
|
"openStorageManagement": [64]
|
|
3615
|
-
}, [[0, "remove-member-clicked", "handleRemoveMemberClicked"], [0, "profile-clicked", "onProfileClick"], [0, "members-list-scrolled-to-bottom", "handleMembersListScrolledToBottom"], [0, "close-right-Sidebar", "handleContactInfo"], [0, "close-contact-info", "handleProfileInfo"], [0, "message-info-panel-change", "handleMessageInfoPanelChange"], [0, "open-right-Sidebar", "handleOpen"], [0, "get-links", "handleGetLinks"], [0, "groupExited", "handleGroupExited"], [0, "tagUserClick", "handleTaguserClick"], [0, "member-message-clicked", "handleMemberMessageClicked"], [16, "contact-action", "handleContactAction"], [0, "chat-tile-list-scrolled-to-bottom", "handleChatTileScrolledToBottom"], [0, "conversation-updated", "handleConversationUpdate"], [0, "groupcastScrolledToBottom", "handleGroupcastScroll"], [0, "delete-groupcast", "handleDeleteGroupcast"]], {
|
|
3725
|
+
}, [[0, "groupcast-draft-ready", "handleGroupcastDraftReady"], [0, "groupcast-members-changed", "handleGroupcastMembersChanged"], [0, "remove-member-clicked", "handleRemoveMemberClicked"], [0, "profile-clicked", "onProfileClick"], [0, "members-list-scrolled-to-bottom", "handleMembersListScrolledToBottom"], [0, "close-right-Sidebar", "handleContactInfo"], [0, "close-contact-info", "handleProfileInfo"], [0, "message-info-panel-change", "handleMessageInfoPanelChange"], [0, "open-right-Sidebar", "handleOpen"], [0, "get-links", "handleGetLinks"], [0, "groupExited", "handleGroupExited"], [0, "tagUserClick", "handleTaguserClick"], [0, "member-message-clicked", "handleMemberMessageClicked"], [16, "contact-action", "handleContactAction"], [0, "chat-tile-list-scrolled-to-bottom", "handleChatTileScrolledToBottom"], [0, "conversation-updated", "handleConversationUpdate"], [0, "groupcastScrolledToBottom", "handleGroupcastScroll"], [0, "delete-groupcast", "handleDeleteGroupcast"]], {
|
|
3616
3726
|
"isLoading": ["onLoadingChange"],
|
|
3617
3727
|
"allConversationList": ["onConversationListChange"],
|
|
3618
3728
|
"allMessages": ["onMessagesChange", "handlemessageAction"],
|