isometrik-plugin-chat-sdk 2.0.17 → 2.0.19
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/attachment-preview_22.cjs.entry.js +7 -32
- package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
- package/dist/cjs/{client-80851676.js → client-fef5fd3d.js} +29 -1
- package/dist/cjs/client-fef5fd3d.js.map +1 -0
- package/dist/cjs/{group-members-5a82ec8a.js → group-members-cef1198e.js} +29 -1
- package/dist/cjs/group-members-cef1198e.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/login-page_3.cjs.entry.js +56 -17
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js +4 -4
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/data-fetch.js +9 -3
- 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 +16 -3
- package/dist/collection/components/my-component/web-chat/event-handlers.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/mutations.js +7 -2
- package/dist/collection/components/my-component/web-chat/mutations.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/offline-host.js +21 -5
- package/dist/collection/components/my-component/web-chat/offline-host.js.map +1 -1
- package/dist/collection/lib/mqtt/dispatch.js +3 -3
- package/dist/collection/lib/mqtt/dispatch.js.map +1 -1
- package/dist/collection/lib/offline/client.js +11 -0
- package/dist/collection/lib/offline/client.js.map +1 -1
- package/dist/collection/lib/offline/idb.js +11 -0
- package/dist/collection/lib/offline/idb.js.map +1 -1
- package/dist/collection/lib/offline/memory-db.js +6 -0
- package/dist/collection/lib/offline/memory-db.js.map +1 -1
- package/dist/components/WebChat.js +55 -16
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/client.js +28 -0
- package/dist/components/client.js.map +1 -1
- package/dist/components/contact-info2.js +5 -5
- package/dist/components/contact-info2.js.map +1 -1
- package/dist/esm/attachment-preview_22.entry.js +5 -30
- package/dist/esm/attachment-preview_22.entry.js.map +1 -1
- package/dist/esm/{client-4a3e00da.js → client-de7fbead.js} +29 -1
- package/dist/esm/client-de7fbead.js.map +1 -0
- package/dist/esm/{group-members-05414da2.js → group-members-7909941c.js} +28 -2
- package/dist/esm/group-members-7909941c.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/login-page_3.entry.js +56 -17
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/isometrik-webchat/index.esm.js +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
- package/dist/isometrik-webchat/p-5cfb953d.js +2 -0
- package/dist/isometrik-webchat/p-5cfb953d.js.map +1 -0
- package/dist/isometrik-webchat/p-a9380fb3.entry.js +2 -0
- package/dist/isometrik-webchat/{p-e5ffe038.entry.js.map → p-a9380fb3.entry.js.map} +1 -1
- package/dist/isometrik-webchat/p-f0d4687f.js +2 -0
- package/dist/isometrik-webchat/p-f0d4687f.js.map +1 -0
- package/dist/isometrik-webchat/{p-bf71ce5e.entry.js → p-fc3fd090.entry.js} +2 -2
- package/dist/isometrik-webchat/p-fc3fd090.entry.js.map +1 -0
- package/dist/types/components/my-component/web-chat/offline-host.d.ts +2 -0
- package/dist/types/lib/offline/client.d.ts +2 -0
- package/dist/types/lib/offline/idb.d.ts +2 -0
- package/dist/types/lib/offline/memory-db.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/client-80851676.js.map +0 -1
- package/dist/cjs/group-members-5a82ec8a.js.map +0 -1
- package/dist/esm/client-4a3e00da.js.map +0 -1
- package/dist/esm/group-members-05414da2.js.map +0 -1
- package/dist/isometrik-webchat/p-ae168135.js +0 -2
- package/dist/isometrik-webchat/p-ae168135.js.map +0 -1
- package/dist/isometrik-webchat/p-b667a9fc.js +0 -2
- package/dist/isometrik-webchat/p-b667a9fc.js.map +0 -1
- package/dist/isometrik-webchat/p-bf71ce5e.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-e5ffe038.entry.js +0 -2
|
@@ -14,7 +14,7 @@ const index$1 = require('./index-3411923c.js');
|
|
|
14
14
|
const localNotification = require('./local-notification-bdd04d7a.js');
|
|
15
15
|
const groupcast = require('./groupcast-3cb44a25.js');
|
|
16
16
|
const IsometrikLogo = require('./IsometrikLogo-9e642f65.js');
|
|
17
|
-
const groupMembers = require('./group-members-
|
|
17
|
+
const groupMembers = require('./group-members-cef1198e.js');
|
|
18
18
|
const groupAdminLeave = require('./group-admin-leave-b5cfdb33.js');
|
|
19
19
|
const content = require('./content-ebca062a.js');
|
|
20
20
|
const messageBodyRender = require('./message-body-render-7c7a026e.js');
|
|
@@ -89,31 +89,6 @@ function normalizeGroupTitle(raw, max = 100) {
|
|
|
89
89
|
.slice(0, max);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
/**
|
|
93
|
-
* Flutter `updateConversationNotifications` parity —
|
|
94
|
-
* PATCH /chat/conversation/settings with pushNotifications.
|
|
95
|
-
*/
|
|
96
|
-
/** Pure — body shape for ChatSDK.conversation.patchSettings. */
|
|
97
|
-
function buildConversationNotificationsPatch(args) {
|
|
98
|
-
const conversationId = String(args.conversationId || '').trim();
|
|
99
|
-
if (!conversationId) {
|
|
100
|
-
throw new Error('conversationId is required');
|
|
101
|
-
}
|
|
102
|
-
return Object.assign(Object.assign({ conversationId, pushNotifications: args.pushNotifications === true }, (typeof args.typingEvents === 'boolean' ? { typingEvents: args.typingEvents } : {})), (typeof args.readEvents === 'boolean' ? { readEvents: args.readEvents } : {}));
|
|
103
|
-
}
|
|
104
|
-
/** Mute / unmute remote + local push for a conversation (member setting). */
|
|
105
|
-
async function updateConversationNotifications(conversationId, pushNotifications) {
|
|
106
|
-
const body = buildConversationNotificationsPatch({ conversationId, pushNotifications });
|
|
107
|
-
return toast.M.getInstance().Conversation.patchSettings(body);
|
|
108
|
-
}
|
|
109
|
-
/** Merge pushNotifications into a conversation / details object. */
|
|
110
|
-
function withConversationPushFlag(conversation, pushNotifications) {
|
|
111
|
-
if (!conversation || typeof conversation !== 'object')
|
|
112
|
-
return conversation;
|
|
113
|
-
const prevConfig = conversation.config && typeof conversation.config === 'object' ? conversation.config : {};
|
|
114
|
-
return Object.assign(Object.assign({}, conversation), { config: Object.assign(Object.assign({}, prevConfig), { pushNotifications }) });
|
|
115
|
-
}
|
|
116
|
-
|
|
117
92
|
const NewChat = class {
|
|
118
93
|
constructor(hostRef) {
|
|
119
94
|
index.registerInstance(this, hostRef);
|
|
@@ -6534,9 +6509,9 @@ const ContactInfo = class {
|
|
|
6534
6509
|
this.pushNotificationsSaving = true;
|
|
6535
6510
|
this.pushNotificationsEnabled = next;
|
|
6536
6511
|
try {
|
|
6537
|
-
await updateConversationNotifications(conversationId, next);
|
|
6512
|
+
await groupMembers.updateConversationNotifications(conversationId, next);
|
|
6538
6513
|
if (this.conversationMetaData && typeof this.conversationMetaData === 'object') {
|
|
6539
|
-
this.conversationMetaData = withConversationPushFlag(this.conversationMetaData, next);
|
|
6514
|
+
this.conversationMetaData = groupMembers.withConversationPushFlag(this.conversationMetaData, next);
|
|
6540
6515
|
}
|
|
6541
6516
|
this.el.dispatchEvent(new CustomEvent('conversation-updated', {
|
|
6542
6517
|
bubbles: true,
|
|
@@ -6544,7 +6519,7 @@ const ContactInfo = class {
|
|
|
6544
6519
|
detail: { conversationId, type: 'settings', value: { pushNotifications: next } },
|
|
6545
6520
|
}));
|
|
6546
6521
|
toast.showToast({
|
|
6547
|
-
message: next ? '
|
|
6522
|
+
message: next ? 'Chat unmuted' : 'Chat muted',
|
|
6548
6523
|
type: 'success',
|
|
6549
6524
|
position: 'bottom-right',
|
|
6550
6525
|
});
|
|
@@ -6716,9 +6691,9 @@ const ContactInfo = class {
|
|
|
6716
6691
|
const canManage = this.isSelfAdmin() && !isSelf;
|
|
6717
6692
|
const menuOpen = this.memberMenuUserId === m.userId;
|
|
6718
6693
|
return (index.h("div", { class: "member", "data-member-id": m.userId }, index.h("profile-avatar", { src: m.userProfileImageUrl || '', name: m.userName || '?', size: "2.25rem" }), index.h("div", { class: "member-text" }, index.h("p", { class: "member-name" }, index.h("span", null, isSelf ? 'You' : m.userName), m.isAdmin ? index.h("span", { class: "member-badge" }, "Admin") : null), m.userIdentifier || ((_b = m.metaData) === null || _b === void 0 ? void 0 : _b.status) ? (index.h("p", { class: "member-sub" }, ((_c = m.metaData) === null || _c === void 0 ? void 0 : _c.status) || m.userIdentifier)) : null), canManage ? (index.h("div", { class: "member-more-wrap" }, index.h("button", { type: "button", class: "member-more-btn", "aria-label": "Member actions", "aria-expanded": menuOpen ? 'true' : 'false', onClick: e => this.toggleMemberMenu(m.userId, e) }, "\u22EE"), menuOpen ? (index.h("div", { class: "member-menu", role: "menu" }, m.isAdmin ? (index.h("button", { type: "button", role: "menuitem", onClick: () => this.confirmRemoveAdmin(m) }, content.WEB_CONTENT.CHAT.GROUP_INFO.GROUP_MEMBERS.REMOVE_ADMIN)) : (index.h("button", { type: "button", role: "menuitem", onClick: () => this.confirmMakeAdmin(m) }, content.WEB_CONTENT.CHAT.GROUP_INFO.GROUP_MEMBERS.MAKE_ADMIN)), index.h("button", { type: "button", class: "danger", role: "menuitem", onClick: () => this.confirmRemoveMember(m) }, content.WEB_CONTENT.CHAT.GROUP_INFO.GROUP_MEMBERS.REMOVE_MEMBER))) : null)) : null));
|
|
6719
|
-
}))) : null, !this.isGroupcast ? (index.h("div", { class: "card" }, index.h("div", { class: "pref-row" }, index.h("div", { class: "pref-copy" }, index.h("p", { class: "pref-title" }, "
|
|
6720
|
-
? '
|
|
6721
|
-
: '
|
|
6694
|
+
}))) : null, !this.isGroupcast ? (index.h("div", { class: "card" }, index.h("div", { class: "pref-row" }, index.h("div", { class: "pref-copy" }, index.h("p", { class: "pref-title" }, "Mute notifications"), index.h("p", { class: "pref-sub" }, this.pushNotificationsEnabled
|
|
6695
|
+
? 'Off — you still get alerts for this chat'
|
|
6696
|
+
: 'On — alerts muted for this chat')), index.h("button", { type: "button", class: "switch", role: "switch", "aria-checked": this.pushNotificationsEnabled ? 'false' : 'true', "aria-label": "Mute chat notifications", disabled: this.pushNotificationsSaving, onClick: () => this.togglePushNotifications() }, index.h("span", { class: "switch-knob" }))))) : null, index.h("div", { class: "card actions" }, index.h("button", { class: "action", type: "button", onClick: this.confirmClearChat }, index.h("span", { class: "action-icon", style: { ['--action-mask']: `url(${ClearChatIcon})` } }), "Clear chat"), index.h("button", { class: "action danger", type: "button", onClick: this.confirmDeleteChat }, index.h("span", { class: "action-icon", style: { ['--action-mask']: `url(${DeleteIcon})` } }), "Delete chat"), isGroup ? (index.h("button", { class: "action", type: "button", onClick: this.confirmExitGroup }, index.h("span", { class: "action-icon", style: { ['--action-mask']: `url(${LogoutIcon})` } }), "Exit group")) : null))));
|
|
6722
6697
|
}
|
|
6723
6698
|
get el() { return index.getElement(this); }
|
|
6724
6699
|
static get watchers() { return {
|