isometrik-plugin-chat-sdk 2.0.17 → 2.0.18

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.
Files changed (37) hide show
  1. package/dist/cjs/attachment-preview_22.cjs.entry.js +7 -32
  2. package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
  3. package/dist/cjs/{group-members-5a82ec8a.js → group-members-cef1198e.js} +29 -1
  4. package/dist/cjs/group-members-cef1198e.js.map +1 -0
  5. package/dist/cjs/login-page_3.cjs.entry.js +19 -6
  6. package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
  7. package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js +4 -4
  8. package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js.map +1 -1
  9. package/dist/collection/components/my-component/web-chat/event-handlers.js +16 -3
  10. package/dist/collection/components/my-component/web-chat/event-handlers.js.map +1 -1
  11. package/dist/collection/lib/mqtt/dispatch.js +3 -3
  12. package/dist/collection/lib/mqtt/dispatch.js.map +1 -1
  13. package/dist/components/WebChat.js +19 -6
  14. package/dist/components/WebChat.js.map +1 -1
  15. package/dist/components/contact-info2.js +5 -5
  16. package/dist/components/contact-info2.js.map +1 -1
  17. package/dist/esm/attachment-preview_22.entry.js +5 -30
  18. package/dist/esm/attachment-preview_22.entry.js.map +1 -1
  19. package/dist/esm/{group-members-05414da2.js → group-members-7909941c.js} +28 -2
  20. package/dist/esm/group-members-7909941c.js.map +1 -0
  21. package/dist/esm/login-page_3.entry.js +19 -6
  22. package/dist/esm/login-page_3.entry.js.map +1 -1
  23. package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
  24. package/dist/isometrik-webchat/p-5cfb953d.js +2 -0
  25. package/dist/isometrik-webchat/p-5cfb953d.js.map +1 -0
  26. package/dist/isometrik-webchat/p-a9380fb3.entry.js +2 -0
  27. package/dist/isometrik-webchat/{p-e5ffe038.entry.js.map → p-a9380fb3.entry.js.map} +1 -1
  28. package/dist/isometrik-webchat/p-ceb08a13.entry.js +2 -0
  29. package/dist/isometrik-webchat/p-ceb08a13.entry.js.map +1 -0
  30. package/package.json +1 -1
  31. package/dist/cjs/group-members-5a82ec8a.js.map +0 -1
  32. package/dist/esm/group-members-05414da2.js.map +0 -1
  33. package/dist/isometrik-webchat/p-b667a9fc.js +0 -2
  34. package/dist/isometrik-webchat/p-b667a9fc.js.map +0 -1
  35. package/dist/isometrik-webchat/p-bf71ce5e.entry.js +0 -2
  36. package/dist/isometrik-webchat/p-bf71ce5e.entry.js.map +0 -1
  37. 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-5a82ec8a.js');
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 ? 'Notifications on for this chat' : 'Notifications muted for this chat',
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" }, "Notifications"), index.h("p", { class: "pref-sub" }, this.pushNotificationsEnabled
6720
- ? 'Alerts on for new messages in this chat'
6721
- : 'Muted — you won’t get alerts for this chat')), index.h("button", { type: "button", class: "switch", role: "switch", "aria-checked": this.pushNotificationsEnabled ? 'true' : 'false', "aria-label": "Toggle 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))));
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 {