isometrik-plugin-chat-sdk 2.0.16 → 2.0.17
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-95486d77.js → app-globals-170f9e71.js} +3 -3
- package/dist/cjs/{app-globals-95486d77.js.map → app-globals-170f9e71.js.map} +1 -1
- package/dist/cjs/attachment-preview_22.cjs.entry.js +135 -46
- package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
- package/dist/cjs/contracts-dfc84075.js.map +1 -1
- package/dist/cjs/{drawer-960b3f5d.js → drawer-00a2323a.js} +2 -2
- package/dist/cjs/{drawer-960b3f5d.js.map → drawer-00a2323a.js.map} +1 -1
- package/dist/cjs/forward-memebers.cjs.entry.js +15 -9
- package/dist/cjs/forward-memebers.cjs.entry.js.map +1 -1
- package/dist/cjs/{group-members-1205fc4c.js → group-members-b3bea06e.js} +5 -5
- package/dist/cjs/{group-members-1205fc4c.js.map → group-members-b3bea06e.js.map} +1 -1
- package/dist/cjs/{groupcast-c93d4a7d.js → groupcast-3cb44a25.js} +16 -16
- package/dist/cjs/{groupcast-c93d4a7d.js.map → groupcast-3cb44a25.js.map} +1 -1
- package/dist/cjs/{groupcast-5e3d49c4.js → groupcast-4239cbfc.js} +7 -7
- package/dist/cjs/{groupcast-5e3d49c4.js.map → groupcast-4239cbfc.js.map} +1 -1
- package/dist/cjs/{index-66f98408.js → index-3411923c.js} +2 -1
- package/dist/cjs/index-3411923c.js.map +1 -0
- package/dist/cjs/index.cjs.js +7 -6
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/isometrik-webchat.cjs.js +9 -8
- package/dist/cjs/isometrik-webchat.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +9 -8
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/local-notification-bdd04d7a.js +259 -0
- package/dist/cjs/local-notification-bdd04d7a.js.map +1 -0
- package/dist/cjs/login-page_3.cjs.entry.js +62 -28
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/cjs/media-gallery.cjs.entry.js +1 -1
- package/dist/cjs/member-add.cjs.entry.js +5 -6
- package/dist/cjs/member-add.cjs.entry.js.map +1 -1
- package/dist/cjs/{message-reaction-8f93a048.js → message-reaction-82a4f93c.js} +5 -5
- package/dist/cjs/{message-reaction-8f93a048.js.map → message-reaction-82a4f93c.js.map} +1 -1
- package/dist/cjs/reaction-container.cjs.entry.js +3 -4
- package/dist/cjs/reaction-container.cjs.entry.js.map +1 -1
- package/dist/cjs/{runtime-controls-959fe6ed.js → runtime-controls-99f378d4.js} +9 -4
- package/dist/cjs/runtime-controls-99f378d4.js.map +1 -0
- package/dist/cjs/{send-media-2dadbb03.js → send-media-7c865c19.js} +13 -11
- package/dist/cjs/send-media-7c865c19.js.map +1 -0
- package/dist/cjs/signup-page.cjs.entry.js +2 -2
- package/dist/cjs/spinner-loader.cjs.entry.js +1 -1
- package/dist/cjs/{index.m-ff115b26.js → toast-91093c84.js} +156 -1
- package/dist/cjs/{index.m-ff115b26.js.map → toast-91093c84.js.map} +1 -1
- package/dist/cjs/toast-notification.cjs.entry.js +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +22 -8
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js +10 -4
- package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/chat-tile/chat-tile.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js +64 -3
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/new chat/new-chat.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/spinner-loader/spinner-loader.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/toast-notification/toast-notification.js +3 -3
- package/dist/collection/components/Login.js +1 -1
- package/dist/collection/components/Signup.js +2 -2
- package/dist/collection/components/my-component/web-chat/WebChat.js +61 -2
- package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/offline-host.js +11 -0
- package/dist/collection/components/my-component/web-chat/offline-host.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/public-send.js +10 -0
- package/dist/collection/components/my-component/web-chat/public-send.js.map +1 -1
- package/dist/collection/components/theme-provider.js +1 -1
- package/dist/collection/lib/chat/conversation-notifications.js +26 -0
- package/dist/collection/lib/chat/conversation-notifications.js.map +1 -0
- package/dist/collection/lib/chat/index.js +3 -0
- package/dist/collection/lib/chat/index.js.map +1 -1
- package/dist/collection/lib/chat/local-notification.js +118 -0
- package/dist/collection/lib/chat/local-notification.js.map +1 -0
- package/dist/collection/lib/chat/message-notification.js +134 -0
- package/dist/collection/lib/chat/message-notification.js.map +1 -0
- package/dist/collection/lib/chat/send-media.js +3 -1
- package/dist/collection/lib/chat/send-media.js.map +1 -1
- package/dist/collection/lib/custom-ui/contracts.js.map +1 -1
- package/dist/collection/lib/custom-ui/index.js.map +1 -1
- package/dist/collection/lib/mqtt/dispatch.js +17 -1
- package/dist/collection/lib/mqtt/dispatch.js.map +1 -1
- package/dist/collection/sdk/init.js +5 -0
- package/dist/collection/sdk/init.js.map +1 -1
- package/dist/components/ChatFooter.js +21 -8
- package/dist/components/ChatFooter.js.map +1 -1
- package/dist/components/GroupCast2.js +1 -1
- package/dist/components/Login.js +1 -1
- package/dist/components/WebChat.js +39 -1
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/contact-info2.js +87 -5
- package/dist/components/contact-info2.js.map +1 -1
- package/dist/components/context-menu2.js +1 -1
- package/dist/components/contracts.js.map +1 -1
- package/dist/components/forward-memebers.js +10 -4
- package/dist/components/forward-memebers.js.map +1 -1
- package/dist/components/index.js +5 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/index2.js +1 -1
- package/dist/components/index2.js.map +1 -1
- package/dist/components/local-notification.js +254 -0
- package/dist/components/local-notification.js.map +1 -0
- package/dist/components/media-gallery.js +1 -1
- package/dist/components/send-media.js +3 -1
- package/dist/components/send-media.js.map +1 -1
- package/dist/components/signup-page.js +2 -2
- package/dist/components/spinner-loader2.js +1 -1
- package/dist/components/theme-provider2.js +1 -1
- package/dist/components/toast-notification.js +3 -3
- package/dist/esm/{app-globals-879c137f.js → app-globals-15a6ef50.js} +3 -3
- package/dist/esm/{app-globals-879c137f.js.map → app-globals-15a6ef50.js.map} +1 -1
- package/dist/esm/attachment-preview_22.entry.js +107 -18
- package/dist/esm/attachment-preview_22.entry.js.map +1 -1
- package/dist/esm/contracts-50f4ddae.js.map +1 -1
- package/dist/esm/{drawer-d54c2f10.js → drawer-7de04622.js} +2 -2
- package/dist/esm/{drawer-d54c2f10.js.map → drawer-7de04622.js.map} +1 -1
- package/dist/esm/forward-memebers.entry.js +13 -7
- package/dist/esm/forward-memebers.entry.js.map +1 -1
- package/dist/esm/{group-members-d603f29f.js → group-members-36cf9395.js} +2 -2
- package/dist/esm/{group-members-d603f29f.js.map → group-members-36cf9395.js.map} +1 -1
- package/dist/esm/{groupcast-9c7d2a32.js → groupcast-cc10c6a4.js} +2 -2
- package/dist/esm/{groupcast-9c7d2a32.js.map → groupcast-cc10c6a4.js.map} +1 -1
- package/dist/esm/{groupcast-58a59d64.js → groupcast-ea2466c8.js} +3 -3
- package/dist/esm/{groupcast-58a59d64.js.map → groupcast-ea2466c8.js.map} +1 -1
- package/dist/esm/{index-4c865e34.js → index-142896ce.js} +2 -2
- package/dist/esm/index-142896ce.js.map +1 -0
- package/dist/esm/index.js +8 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/isometrik-webchat.js +9 -8
- package/dist/esm/isometrik-webchat.js.map +1 -1
- package/dist/esm/loader.js +9 -8
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/local-notification-4c1e166d.js +254 -0
- package/dist/esm/local-notification-4c1e166d.js.map +1 -0
- package/dist/esm/login-page_3.entry.js +45 -11
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/esm/media-gallery.entry.js +1 -1
- package/dist/esm/member-add.entry.js +5 -6
- package/dist/esm/member-add.entry.js.map +1 -1
- package/dist/esm/{message-reaction-0a2bb115.js → message-reaction-0d2ef75f.js} +2 -2
- package/dist/esm/{message-reaction-0a2bb115.js.map → message-reaction-0d2ef75f.js.map} +1 -1
- package/dist/esm/reaction-container.entry.js +3 -4
- package/dist/esm/reaction-container.entry.js.map +1 -1
- package/dist/esm/{runtime-controls-6b7c852a.js → runtime-controls-8a22625e.js} +9 -4
- package/dist/esm/runtime-controls-8a22625e.js.map +1 -0
- package/dist/esm/{send-media-ac360d8e.js → send-media-5527ee9f.js} +5 -3
- package/dist/esm/send-media-5527ee9f.js.map +1 -0
- package/dist/esm/signup-page.entry.js +2 -2
- package/dist/esm/spinner-loader.entry.js +1 -1
- package/dist/esm/{index.m-8c70037f.js → toast-a1531088.js} +156 -2
- package/dist/esm/{index.m-8c70037f.js.map → toast-a1531088.js.map} +1 -1
- package/dist/esm/toast-notification.entry.js +3 -3
- package/dist/isometrik-webchat/index.esm.js +1 -1
- package/dist/isometrik-webchat/index.esm.js.map +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js.map +1 -1
- package/dist/isometrik-webchat/{p-586f6978.entry.js → p-08ba6153.entry.js} +2 -2
- package/dist/isometrik-webchat/p-1db79cfb.js +2 -0
- package/dist/isometrik-webchat/p-343f50b4.js +7 -0
- package/dist/isometrik-webchat/p-343f50b4.js.map +1 -0
- package/dist/isometrik-webchat/{p-5d98a8a0.js → p-4671fe73.js} +2 -2
- package/dist/isometrik-webchat/{p-ca47d693.entry.js → p-52a575c0.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-b1330793.js → p-54267fe0.js} +2 -2
- package/dist/isometrik-webchat/p-54267fe0.js.map +1 -0
- package/dist/isometrik-webchat/p-5b965e04.js +2 -0
- package/dist/isometrik-webchat/p-5b965e04.js.map +1 -0
- package/dist/isometrik-webchat/p-5d1877d1.entry.js +2 -0
- package/dist/isometrik-webchat/{p-ba6de4e2.entry.js.map → p-5d1877d1.entry.js.map} +1 -1
- package/dist/isometrik-webchat/p-643457b8.js +2 -0
- package/dist/isometrik-webchat/p-643457b8.js.map +1 -0
- package/dist/isometrik-webchat/p-6fc95e0e.js +2 -0
- package/dist/isometrik-webchat/p-6fc95e0e.js.map +1 -0
- package/dist/isometrik-webchat/{p-d6fd2dd7.entry.js → p-925da2c0.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-1dc52239.js → p-925decda.js} +2 -2
- package/dist/isometrik-webchat/p-adc45831.js.map +1 -1
- package/dist/isometrik-webchat/p-bf71ce5e.entry.js +2 -0
- package/dist/isometrik-webchat/p-bf71ce5e.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-1953573d.js → p-c08055fe.js} +2 -2
- package/dist/isometrik-webchat/p-c49de274.entry.js +2 -0
- package/dist/isometrik-webchat/{p-6024bf2a.entry.js.map → p-c49de274.entry.js.map} +1 -1
- package/dist/isometrik-webchat/{p-04fdbd0a.js → p-c591fa45.js} +2 -2
- package/dist/isometrik-webchat/{p-9db196a4.entry.js → p-cbb1179b.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-46e0048e.js → p-dab06d54.js} +2 -2
- package/dist/isometrik-webchat/p-e5ffe038.entry.js +2 -0
- package/dist/isometrik-webchat/p-e5ffe038.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-ffbbe278.entry.js +2 -0
- package/dist/isometrik-webchat/p-ffbbe278.entry.js.map +1 -0
- package/dist/types/components/ChatUIComponent/shared/contact-info/contact-info.d.ts +5 -0
- package/dist/types/components/my-component/web-chat/WebChat.d.ts +21 -0
- package/dist/types/components.d.ts +36 -0
- package/dist/types/lib/chat/conversation-notifications.d.ts +12 -0
- package/dist/types/lib/chat/index.d.ts +3 -0
- package/dist/types/lib/chat/local-notification.d.ts +39 -0
- package/dist/types/lib/chat/message-notification.d.ts +37 -0
- package/dist/types/lib/chat/send-media.d.ts +3 -0
- package/dist/types/lib/custom-ui/contracts.d.ts +10 -0
- package/dist/types/lib/custom-ui/index.d.ts +6 -1
- package/dist/types/sdk/init.d.ts +21 -0
- package/docs/CUSTOMIZATION.md +30 -0
- package/docs/INTEGRATION.md +20 -4
- package/package.json +1 -1
- package/dist/cjs/index-66f98408.js.map +0 -1
- package/dist/cjs/runtime-controls-959fe6ed.js.map +0 -1
- package/dist/cjs/send-media-2dadbb03.js.map +0 -1
- package/dist/cjs/toast-75ef0607.js +0 -159
- package/dist/cjs/toast-75ef0607.js.map +0 -1
- package/dist/esm/index-4c865e34.js.map +0 -1
- package/dist/esm/runtime-controls-6b7c852a.js.map +0 -1
- package/dist/esm/send-media-ac360d8e.js.map +0 -1
- package/dist/esm/toast-45ac7913.js +0 -157
- package/dist/esm/toast-45ac7913.js.map +0 -1
- package/dist/isometrik-webchat/p-0c06a021.js +0 -2
- package/dist/isometrik-webchat/p-0c06a021.js.map +0 -1
- package/dist/isometrik-webchat/p-217b9dc2.js +0 -2
- package/dist/isometrik-webchat/p-217b9dc2.js.map +0 -1
- package/dist/isometrik-webchat/p-30855ba7.js +0 -2
- package/dist/isometrik-webchat/p-30855ba7.js.map +0 -1
- package/dist/isometrik-webchat/p-39b6adef.entry.js +0 -2
- package/dist/isometrik-webchat/p-39b6adef.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-57d958b8.entry.js +0 -2
- package/dist/isometrik-webchat/p-57d958b8.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-6024bf2a.entry.js +0 -2
- package/dist/isometrik-webchat/p-79d1a171.js +0 -2
- package/dist/isometrik-webchat/p-7af9a7f3.entry.js +0 -2
- package/dist/isometrik-webchat/p-7af9a7f3.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-8f17345f.js +0 -7
- package/dist/isometrik-webchat/p-8f17345f.js.map +0 -1
- package/dist/isometrik-webchat/p-b1330793.js.map +0 -1
- package/dist/isometrik-webchat/p-ba6de4e2.entry.js +0 -2
- /package/dist/isometrik-webchat/{p-586f6978.entry.js.map → p-08ba6153.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-79d1a171.js.map → p-1db79cfb.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-5d98a8a0.js.map → p-4671fe73.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-ca47d693.entry.js.map → p-52a575c0.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-d6fd2dd7.entry.js.map → p-925da2c0.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-1dc52239.js.map → p-925decda.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-1953573d.js.map → p-c08055fe.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-04fdbd0a.js.map → p-c591fa45.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-9db196a4.entry.js.map → p-cbb1179b.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-46e0048e.js.map → p-dab06d54.js.map} +0 -0
|
@@ -15,6 +15,7 @@ import { M } from './index.m.js';
|
|
|
15
15
|
import { c as createStore, g as groupMembersStore } from './group-members.js';
|
|
16
16
|
import { b as getGroupcastMessage, r as removeGroupcastMember, d as deleteGroupCast } from './groupcast.js';
|
|
17
17
|
import { a as attachmentBodyForApi, p as prepareMediaAttachments, u as uploadAndPostMediaMessage, i as isAttachmentBodyPlaceholder, d as buildLocalMediaAttachments, c as customTypeFromMime, A as ATTACHMENT_BODY_PLACEHOLDER, b as buildReplyMetaData } from './send-media.js';
|
|
18
|
+
import { f as findConversationForPush, s as showLocalMessageNotification, m as messagePushContextFrom, w as withHostMessagePushFields } from './local-notification.js';
|
|
18
19
|
import { t as takeMediaFiles, M as MAX_MEDIA_PER_MESSAGE, m as mediaLimitToastMessage } from './media-limits.js';
|
|
19
20
|
import { j as getOfflineClient, k as mergeMessagesById, l as isBrowserOnline, i as initializeChatSdk, f as fetchUserDetails, a as fetchConversationsPage, m as mergeUniqueConversations, c as fetchGroupcastDetails, b as fetchConversationDetails, d as fetchGroupcastMembersPage, e as fetchGroupcastContactsPage, s as sortConversationsByLatestMessage, g as resolveRegionMode } from './client.js';
|
|
20
21
|
import { f as fetchMessagesPage, s as searchMessages, b as fetchLinkMessages, c as fetchMediaCount, d as fetchMediaAttachments, m as markConversationRead } from './messages.js';
|
|
@@ -413,7 +414,7 @@ function handleLifecycleMqtt(parsedMessage, ctx) {
|
|
|
413
414
|
* Actions are handled in named sections below — search for ACTION: <name>.
|
|
414
415
|
*/
|
|
415
416
|
async function dispatchMqttMessage(parsedMessage, ctx) {
|
|
416
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
|
|
417
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12;
|
|
417
418
|
if (!parsedMessage || !parsedMessage.action)
|
|
418
419
|
return;
|
|
419
420
|
handleLifecycleMqtt(parsedMessage, ctx);
|
|
@@ -878,6 +879,20 @@ async function dispatchMqttMessage(parsedMessage, ctx) {
|
|
|
878
879
|
if ((totalUnreadConversation === null || totalUnreadConversation === void 0 ? void 0 : totalUnreadConversation.length) > 0) {
|
|
879
880
|
unreadCountStore.updateTotalUnreadCount(totalUnreadConversation === null || totalUnreadConversation === void 0 ? void 0 : totalUnreadConversation.length);
|
|
880
881
|
}
|
|
882
|
+
// Local inbound alert (host can disable / customize via init props).
|
|
883
|
+
const conversation = findConversationForPush(parsedMessage.conversationId, ctx.allConversationList, ctx.conversationMetaData);
|
|
884
|
+
const pushMuted = ((_10 = conversation === null || conversation === void 0 ? void 0 : conversation.config) === null || _10 === void 0 ? void 0 : _10.pushNotifications) === false;
|
|
885
|
+
if (!pushMuted && ((_11 = parsedMessage === null || parsedMessage === void 0 ? void 0 : parsedMessage.events) === null || _11 === void 0 ? void 0 : _11.sendPushNotification) !== false) {
|
|
886
|
+
showLocalMessageNotification(parsedMessage, {
|
|
887
|
+
pushCtx: messagePushContextFrom({
|
|
888
|
+
userMetaData: {
|
|
889
|
+
userName: parsedMessage.senderName || ((_12 = parsedMessage.senderInfo) === null || _12 === void 0 ? void 0 : _12.userName),
|
|
890
|
+
},
|
|
891
|
+
conversation,
|
|
892
|
+
}),
|
|
893
|
+
conversationPushEnabled: true,
|
|
894
|
+
});
|
|
895
|
+
}
|
|
881
896
|
}
|
|
882
897
|
}
|
|
883
898
|
|
|
@@ -1057,6 +1072,10 @@ async function sendOutboxItem(host, item) {
|
|
|
1057
1072
|
if (!files.length)
|
|
1058
1073
|
throw new Error('Media outbox item has no files');
|
|
1059
1074
|
const attachments = prepareMediaAttachments(files);
|
|
1075
|
+
const pushContext = messagePushContextFrom({
|
|
1076
|
+
userMetaData: host.userMetaData,
|
|
1077
|
+
conversation: findConversationForPush(item.conversationId, host.allConversationList, host.conversationMetaData),
|
|
1078
|
+
});
|
|
1060
1079
|
const apiId = await uploadAndPostMediaMessage({
|
|
1061
1080
|
conversationId: item.conversationId,
|
|
1062
1081
|
deviceId,
|
|
@@ -1066,6 +1085,7 @@ async function sendOutboxItem(host, item) {
|
|
|
1066
1085
|
replyMessage: item.parentMessageId
|
|
1067
1086
|
? { messageId: item.parentMessageId }
|
|
1068
1087
|
: null,
|
|
1088
|
+
pushContext,
|
|
1069
1089
|
});
|
|
1070
1090
|
if (apiId && item.conversationId === host.selectedConversationId) {
|
|
1071
1091
|
host.allMessages = (host.allMessages || []).map((m) => m.messageId === item.localId
|
|
@@ -1086,6 +1106,10 @@ async function sendOutboxItem(host, item) {
|
|
|
1086
1106
|
body: item.body,
|
|
1087
1107
|
metaData: item.metaData || {},
|
|
1088
1108
|
};
|
|
1109
|
+
withHostMessagePushFields(payload, messagePushContextFrom({
|
|
1110
|
+
userMetaData: host.userMetaData,
|
|
1111
|
+
conversation: findConversationForPush(item.conversationId, host.allConversationList, host.conversationMetaData),
|
|
1112
|
+
}), host);
|
|
1089
1113
|
const res = await M.getInstance().message.postMessages(payload);
|
|
1090
1114
|
const apiId = res === null || res === void 0 ? void 0 : res.messageId;
|
|
1091
1115
|
if (apiId && item.conversationId === host.selectedConversationId) {
|
|
@@ -1492,6 +1516,12 @@ async function hostGetGroupCastContacts(host, skip = 0) {
|
|
|
1492
1516
|
/**
|
|
1493
1517
|
* Public sendText / sendMedia implementations for <web-chat>.
|
|
1494
1518
|
*/
|
|
1519
|
+
function pushContextFor(host, conversationId) {
|
|
1520
|
+
return messagePushContextFrom({
|
|
1521
|
+
userMetaData: host.userMetaData,
|
|
1522
|
+
conversation: findConversationForPush(conversationId, host.allConversationList, null),
|
|
1523
|
+
});
|
|
1524
|
+
}
|
|
1495
1525
|
async function hostSendText(host, body, conversationId) {
|
|
1496
1526
|
var _a, _b, _c;
|
|
1497
1527
|
const text = (body || '').trim();
|
|
@@ -1549,6 +1579,7 @@ async function hostSendText(host, body, conversationId) {
|
|
|
1549
1579
|
body: text,
|
|
1550
1580
|
metaData: localMessage.metaData || {},
|
|
1551
1581
|
};
|
|
1582
|
+
withHostMessagePushFields(payload, pushContextFor(host, id), host);
|
|
1552
1583
|
const res = await M.getInstance().message.postMessages(payload);
|
|
1553
1584
|
const apiId = res === null || res === void 0 ? void 0 : res.messageId;
|
|
1554
1585
|
if (apiId) {
|
|
@@ -1639,6 +1670,7 @@ async function hostSendMedia(host, files, conversationId, caption) {
|
|
|
1639
1670
|
attachments,
|
|
1640
1671
|
replyMessage: reply,
|
|
1641
1672
|
caption,
|
|
1673
|
+
pushContext: pushContextFor(host, id),
|
|
1642
1674
|
});
|
|
1643
1675
|
if (apiId) {
|
|
1644
1676
|
host.allMessages = host.allMessages.map(m => m.messageId === localId
|
|
@@ -2838,6 +2870,9 @@ const WebChat = /*@__PURE__*/ proxyCustomElement(class WebChat extends HTMLEleme
|
|
|
2838
2870
|
this.showConversationList = true;
|
|
2839
2871
|
this.showRightPanel = true;
|
|
2840
2872
|
this.showMqttStatus = true;
|
|
2873
|
+
this.enablePushNotifications = true;
|
|
2874
|
+
this.enableLocalNotifications = true;
|
|
2875
|
+
this.onLocalNotification = undefined;
|
|
2841
2876
|
this.unreadConversations = [];
|
|
2842
2877
|
this.allLinks = undefined;
|
|
2843
2878
|
this.allLinksCount = undefined;
|
|
@@ -3283,6 +3318,9 @@ const WebChat = /*@__PURE__*/ proxyCustomElement(class WebChat extends HTMLEleme
|
|
|
3283
3318
|
"showConversationList": [4, "show-conversation-list"],
|
|
3284
3319
|
"showRightPanel": [4, "show-right-panel"],
|
|
3285
3320
|
"showMqttStatus": [4, "show-mqtt-status"],
|
|
3321
|
+
"enablePushNotifications": [4, "enable-push-notifications"],
|
|
3322
|
+
"enableLocalNotifications": [4, "enable-local-notifications"],
|
|
3323
|
+
"onLocalNotification": [16],
|
|
3286
3324
|
"isChatFilter": [4, "is-chat-filter"],
|
|
3287
3325
|
"isAllChatButton": [4, "is-all-chat-button"],
|
|
3288
3326
|
"isSidebarHeaderLabel": [4, "is-sidebar-header-label"],
|