isometrik-plugin-chat-sdk 1.0.8 → 1.3.13

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 (253) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/attachment-preview_22.cjs.entry.js +10 -9
  3. package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
  4. package/dist/cjs/audio-bubble_4.cjs.entry.js +1 -1
  5. package/dist/cjs/chat-assets-e32e80c0.js +73 -0
  6. package/dist/cjs/chat-assets-e32e80c0.js.map +1 -0
  7. package/dist/cjs/chat-tile_3.cjs.entry.js +1 -1
  8. package/dist/cjs/forward-memebers.cjs.entry.js +1 -1
  9. package/dist/cjs/isometrik-webchat.cjs.js +1 -1
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/login-page_3.cjs.entry.js +23 -13
  12. package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
  13. package/dist/cjs/member-add.cjs.entry.js +1 -1
  14. package/dist/cjs/new-chat-sidebar.cjs.entry.js +1 -1
  15. package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +6 -7
  16. package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -1
  17. package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +12 -12
  18. package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -1
  19. package/dist/collection/components/my-component/web-chat/WebChat.js +39 -6
  20. package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -1
  21. package/dist/collection/components/my-component/web-chat/shell-render.js +4 -2
  22. package/dist/collection/components/my-component/web-chat/shell-render.js.map +1 -1
  23. package/dist/collection/components/theme-provider.js +9 -9
  24. package/dist/collection/components/theme-provider.js.map +1 -1
  25. package/dist/collection/constants/chat-assets.js +39 -123
  26. package/dist/components/ChatSidebar.js +2 -2
  27. package/dist/components/ChatSidebar.js.map +1 -1
  28. package/dist/components/WebChat.js +15 -4
  29. package/dist/components/WebChat.js.map +1 -1
  30. package/dist/components/WebChatBody.js +9 -8
  31. package/dist/components/WebChatBody.js.map +1 -1
  32. package/dist/components/chat-assets.js +34 -82
  33. package/dist/components/chat-assets.js.map +1 -1
  34. package/dist/components/theme-provider2.js +9 -9
  35. package/dist/components/theme-provider2.js.map +1 -1
  36. package/dist/esm/attachment-preview_22.entry.js +10 -9
  37. package/dist/esm/attachment-preview_22.entry.js.map +1 -1
  38. package/dist/esm/audio-bubble_4.entry.js +1 -1
  39. package/dist/esm/chat-assets-4dfb1106.js +38 -0
  40. package/dist/esm/chat-assets-4dfb1106.js.map +1 -0
  41. package/dist/esm/chat-tile_3.entry.js +1 -1
  42. package/dist/esm/forward-memebers.entry.js +1 -1
  43. package/dist/esm/isometrik-webchat.js +1 -1
  44. package/dist/esm/loader.js +1 -1
  45. package/dist/esm/login-page_3.entry.js +23 -13
  46. package/dist/esm/login-page_3.entry.js.map +1 -1
  47. package/dist/esm/member-add.entry.js +1 -1
  48. package/dist/esm/new-chat-sidebar.entry.js +1 -1
  49. package/dist/isometrik-webchat/isometrik-webchat.css +1 -1
  50. package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
  51. package/dist/isometrik-webchat/isometrik-webchat.esm.js.map +1 -1
  52. package/dist/isometrik-webchat/{p-188b2631.entry.js → p-0085b397.entry.js} +2 -2
  53. package/dist/isometrik-webchat/{p-ab5e1e85.entry.js → p-1ad1127f.entry.js} +2 -2
  54. package/dist/isometrik-webchat/p-6d9f8cec.entry.js +2 -0
  55. package/dist/isometrik-webchat/p-6d9f8cec.entry.js.map +1 -0
  56. package/dist/isometrik-webchat/{p-b44f0bd1.entry.js → p-6ec350aa.entry.js} +2 -2
  57. package/dist/isometrik-webchat/p-6ffeb379.entry.js +2 -0
  58. package/dist/isometrik-webchat/p-6ffeb379.entry.js.map +1 -0
  59. package/dist/isometrik-webchat/{p-e589ff24.entry.js → p-71cc96a3.entry.js} +2 -2
  60. package/dist/isometrik-webchat/{p-ff8f6bd2.entry.js → p-b8cef5e4.entry.js} +2 -2
  61. package/dist/isometrik-webchat/p-d424871c.js +2 -0
  62. package/dist/isometrik-webchat/p-d424871c.js.map +1 -0
  63. package/dist/types/components/ChatUIComponent/ChatSidebar/ChatSidebar.d.ts +2 -1
  64. package/dist/types/components/ChatUIComponent/WebChatBody/WebChatBody.d.ts +2 -2
  65. package/dist/types/components/theme-provider.d.ts +3 -2
  66. package/dist/types/components.d.ts +26 -8
  67. package/package.json +53 -10
  68. package/readme.md +428 -0
  69. package/dist/cjs/chat-assets-ff067e4d.js +0 -121
  70. package/dist/cjs/chat-assets-ff067e4d.js.map +0 -1
  71. package/dist/collection/assets/ExcelDocument.js +0 -2
  72. package/dist/collection/assets/IsometrikLogo.js +0 -38
  73. package/dist/collection/assets/Moon.svg +0 -1
  74. package/dist/collection/assets/New-Chat.svg +0 -5
  75. package/dist/collection/assets/NoChatPlaceholder.js +0 -16
  76. package/dist/collection/assets/NoContactsPlaceholder.js +0 -9
  77. package/dist/collection/assets/NoMessagePlaceholder.svg +0 -13
  78. package/dist/collection/assets/PdfDocument.js +0 -2
  79. package/dist/collection/assets/ProfilePlaceholder.js +0 -1
  80. package/dist/collection/assets/SelectChatPlaceholder.js +0 -13
  81. package/dist/collection/assets/Sun.svg +0 -1
  82. package/dist/collection/assets/add-user.svg +0 -6
  83. package/dist/collection/assets/attachment.svg +0 -4
  84. package/dist/collection/assets/avatar.svg +0 -1
  85. package/dist/collection/assets/block-user.svg +0 -4
  86. package/dist/collection/assets/camera-add.svg +0 -4
  87. package/dist/collection/assets/camera.svg +0 -17
  88. package/dist/collection/assets/cancel.svg +0 -12
  89. package/dist/collection/assets/chatBG.png +0 -0
  90. package/dist/collection/assets/chatdefaultbg.svg +0 -6140
  91. package/dist/collection/assets/clear-chat.svg +0 -4
  92. package/dist/collection/assets/close.svg +0 -4
  93. package/dist/collection/assets/dark-theme.svg +0 -12
  94. package/dist/collection/assets/delete.svg +0 -8
  95. package/dist/collection/assets/doc.png +0 -0
  96. package/dist/collection/assets/documents.svg +0 -15
  97. package/dist/collection/assets/doublecheck.svg +0 -1
  98. package/dist/collection/assets/download.svg +0 -4
  99. package/dist/collection/assets/drop-down.svg +0 -5
  100. package/dist/collection/assets/edit.svg +0 -4
  101. package/dist/collection/assets/equalizer.svg +0 -1
  102. package/dist/collection/assets/excel.svg +0 -2
  103. package/dist/collection/assets/forward.svg +0 -4
  104. package/dist/collection/assets/group-cast.svg +0 -1
  105. package/dist/collection/assets/group.svg +0 -13
  106. package/dist/collection/assets/imagePlaceholder.png +0 -0
  107. package/dist/collection/assets/imagePlaceholder.svg +0 -2
  108. package/dist/collection/assets/info.svg +0 -4
  109. package/dist/collection/assets/left-arrow.svg +0 -4
  110. package/dist/collection/assets/link.svg +0 -1
  111. package/dist/collection/assets/login.svg +0 -3051
  112. package/dist/collection/assets/logout.svg +0 -5
  113. package/dist/collection/assets/message-outline.svg +0 -5
  114. package/dist/collection/assets/message.svg +0 -1
  115. package/dist/collection/assets/microphone.svg +0 -2
  116. package/dist/collection/assets/new_group.svg +0 -9
  117. package/dist/collection/assets/odt-file.png +0 -0
  118. package/dist/collection/assets/onboarding.webp +0 -0
  119. package/dist/collection/assets/paper.svg +0 -5
  120. package/dist/collection/assets/pause.svg +0 -4
  121. package/dist/collection/assets/pdf.svg +0 -11
  122. package/dist/collection/assets/photos.svg +0 -4
  123. package/dist/collection/assets/play.svg +0 -19
  124. package/dist/collection/assets/profilePlaceholderImage.png +0 -0
  125. package/dist/collection/assets/reply.svg +0 -4
  126. package/dist/collection/assets/rtf.png +0 -0
  127. package/dist/collection/assets/search.svg +0 -4
  128. package/dist/collection/assets/send.svg +0 -4
  129. package/dist/collection/assets/singlecheck.svg +0 -1
  130. package/dist/collection/assets/smile.svg +0 -2
  131. package/dist/collection/assets/three-dots.svg +0 -5
  132. package/dist/collection/assets/txt.png +0 -0
  133. package/dist/collection/assets/videoPlaceholder.svg +0 -4
  134. package/dist/collection/assets/videoThumbnail.svg +0 -1
  135. package/dist/collection/components/ChatUIComponent/AudioBubble.js +0 -315
  136. package/dist/collection/components/ChatUIComponent/BlockChatList.js +0 -177
  137. package/dist/collection/components/ChatUIComponent/ForwardMessageList.js +0 -152
  138. package/dist/collection/components/ChatUIComponent/GroupCast.js +0 -461
  139. package/dist/collection/components/ChatUIComponent/shared/attachment-preview.js +0 -230
  140. package/dist/collection/components/ChatUIComponent/shared/chat-loading-placeholder.js +0 -70
  141. package/dist/collection/components/ChatUIComponent/shared/confirm-dialog.js +0 -51
  142. package/dist/collection/components/ChatUIComponent/shared/contact-info.js +0 -255
  143. package/dist/collection/components/ChatUIComponent/shared/context-menu.js +0 -112
  144. package/dist/collection/components/ChatUIComponent/shared/delete-message.js +0 -49
  145. package/dist/collection/components/ChatUIComponent/shared/document-message.js +0 -161
  146. package/dist/collection/components/ChatUIComponent/shared/forward-message.js +0 -139
  147. package/dist/collection/components/ChatUIComponent/shared/group-chat-contacts.js +0 -201
  148. package/dist/collection/components/ChatUIComponent/shared/group-info.js +0 -170
  149. package/dist/collection/components/ChatUIComponent/shared/image-message.js +0 -156
  150. package/dist/collection/components/ChatUIComponent/shared/incoming-text-message-bubble.js +0 -98
  151. package/dist/collection/components/ChatUIComponent/shared/link-preview.js +0 -125
  152. package/dist/collection/components/ChatUIComponent/shared/media-gallery.js +0 -152
  153. package/dist/collection/components/ChatUIComponent/shared/message-body-render.js +0 -19
  154. package/dist/collection/components/ChatUIComponent/shared/message-bubble.js +0 -189
  155. package/dist/collection/components/ChatUIComponent/shared/message-date-pill.js +0 -86
  156. package/dist/collection/components/ChatUIComponent/shared/message-info.js +0 -188
  157. package/dist/collection/components/ChatUIComponent/shared/message-search.js +0 -125
  158. package/dist/collection/components/ChatUIComponent/shared/new-chat-sidebar.js +0 -181
  159. package/dist/collection/components/ChatUIComponent/shared/outgoing-text-message-bubble.js +0 -98
  160. package/dist/collection/components/ChatUIComponent/shared/profile-avatar.js +0 -136
  161. package/dist/collection/components/ChatUIComponent/shared/profile-info.js +0 -220
  162. package/dist/collection/components/ChatUIComponent/shared/reply-block.js +0 -162
  163. package/dist/collection/components/ChatUIComponent/shared/reply-message-container.js +0 -193
  164. package/dist/collection/components/ChatUIComponent/shared/share-popup.js +0 -69
  165. package/dist/collection/components/ChatUIComponent/shared/spinner-loader.js +0 -74
  166. package/dist/collection/components/ChatUIComponent/shared/toast-notification.js +0 -106
  167. package/dist/collection/components/ChatUIComponent/shared/video-message.js +0 -165
  168. package/dist/collection/components/my-component/my-component.e2e.js +0 -25
  169. package/dist/collection/components/my-component/my-component.spec.js +0 -34
  170. package/dist/collection/components/my-component/web-chat/web-chat-split.spec.js +0 -40
  171. package/dist/collection/lib/chat/chat.spec.js +0 -28
  172. package/dist/collection/lib/custom-ui/custom-ui.spec.js +0 -49
  173. package/dist/collection/lib/message-body-segments.spec.js +0 -21
  174. package/dist/collection/lib/message-dedup.spec.js +0 -17
  175. package/dist/collection/lib/mqtt/mqtt.spec.js +0 -39
  176. package/dist/collection/utils/utils.spec.js +0 -15
  177. package/dist/esm/chat-assets-95633770.js +0 -86
  178. package/dist/esm/chat-assets-95633770.js.map +0 -1
  179. package/dist/isometrik-webchat/assets/ExcelDocument.js +0 -2
  180. package/dist/isometrik-webchat/assets/IsometrikLogo.js +0 -38
  181. package/dist/isometrik-webchat/assets/Moon.svg +0 -1
  182. package/dist/isometrik-webchat/assets/New-Chat.svg +0 -5
  183. package/dist/isometrik-webchat/assets/NoChatPlaceholder.js +0 -16
  184. package/dist/isometrik-webchat/assets/NoContactsPlaceholder.js +0 -9
  185. package/dist/isometrik-webchat/assets/NoMessagePlaceholder.svg +0 -13
  186. package/dist/isometrik-webchat/assets/PdfDocument.js +0 -2
  187. package/dist/isometrik-webchat/assets/ProfilePlaceholder.js +0 -1
  188. package/dist/isometrik-webchat/assets/SelectChatPlaceholder.js +0 -13
  189. package/dist/isometrik-webchat/assets/Sun.svg +0 -1
  190. package/dist/isometrik-webchat/assets/add-user.svg +0 -6
  191. package/dist/isometrik-webchat/assets/attachment.svg +0 -4
  192. package/dist/isometrik-webchat/assets/avatar.svg +0 -1
  193. package/dist/isometrik-webchat/assets/block-user.svg +0 -4
  194. package/dist/isometrik-webchat/assets/camera-add.svg +0 -4
  195. package/dist/isometrik-webchat/assets/camera.svg +0 -17
  196. package/dist/isometrik-webchat/assets/cancel.svg +0 -12
  197. package/dist/isometrik-webchat/assets/chatBG.png +0 -0
  198. package/dist/isometrik-webchat/assets/chatdefaultbg.svg +0 -6140
  199. package/dist/isometrik-webchat/assets/clear-chat.svg +0 -4
  200. package/dist/isometrik-webchat/assets/close.svg +0 -4
  201. package/dist/isometrik-webchat/assets/dark-theme.svg +0 -12
  202. package/dist/isometrik-webchat/assets/delete.svg +0 -8
  203. package/dist/isometrik-webchat/assets/doc.png +0 -0
  204. package/dist/isometrik-webchat/assets/documents.svg +0 -15
  205. package/dist/isometrik-webchat/assets/doublecheck.svg +0 -1
  206. package/dist/isometrik-webchat/assets/download.svg +0 -4
  207. package/dist/isometrik-webchat/assets/drop-down.svg +0 -5
  208. package/dist/isometrik-webchat/assets/edit.svg +0 -4
  209. package/dist/isometrik-webchat/assets/equalizer.svg +0 -1
  210. package/dist/isometrik-webchat/assets/excel.svg +0 -2
  211. package/dist/isometrik-webchat/assets/forward.svg +0 -4
  212. package/dist/isometrik-webchat/assets/group-cast.svg +0 -1
  213. package/dist/isometrik-webchat/assets/group.svg +0 -13
  214. package/dist/isometrik-webchat/assets/imagePlaceholder.png +0 -0
  215. package/dist/isometrik-webchat/assets/imagePlaceholder.svg +0 -2
  216. package/dist/isometrik-webchat/assets/info.svg +0 -4
  217. package/dist/isometrik-webchat/assets/left-arrow.svg +0 -4
  218. package/dist/isometrik-webchat/assets/link.svg +0 -1
  219. package/dist/isometrik-webchat/assets/login.svg +0 -3051
  220. package/dist/isometrik-webchat/assets/logout.svg +0 -5
  221. package/dist/isometrik-webchat/assets/message-outline.svg +0 -5
  222. package/dist/isometrik-webchat/assets/message.svg +0 -1
  223. package/dist/isometrik-webchat/assets/microphone.svg +0 -2
  224. package/dist/isometrik-webchat/assets/new_group.svg +0 -9
  225. package/dist/isometrik-webchat/assets/odt-file.png +0 -0
  226. package/dist/isometrik-webchat/assets/onboarding.webp +0 -0
  227. package/dist/isometrik-webchat/assets/paper.svg +0 -5
  228. package/dist/isometrik-webchat/assets/pause.svg +0 -4
  229. package/dist/isometrik-webchat/assets/pdf.svg +0 -11
  230. package/dist/isometrik-webchat/assets/photos.svg +0 -4
  231. package/dist/isometrik-webchat/assets/play.svg +0 -19
  232. package/dist/isometrik-webchat/assets/profilePlaceholderImage.png +0 -0
  233. package/dist/isometrik-webchat/assets/reply.svg +0 -4
  234. package/dist/isometrik-webchat/assets/rtf.png +0 -0
  235. package/dist/isometrik-webchat/assets/search.svg +0 -4
  236. package/dist/isometrik-webchat/assets/send.svg +0 -4
  237. package/dist/isometrik-webchat/assets/singlecheck.svg +0 -1
  238. package/dist/isometrik-webchat/assets/smile.svg +0 -2
  239. package/dist/isometrik-webchat/assets/three-dots.svg +0 -5
  240. package/dist/isometrik-webchat/assets/txt.png +0 -0
  241. package/dist/isometrik-webchat/assets/videoPlaceholder.svg +0 -4
  242. package/dist/isometrik-webchat/assets/videoThumbnail.svg +0 -1
  243. package/dist/isometrik-webchat/p-4bad6da9.entry.js +0 -2
  244. package/dist/isometrik-webchat/p-4bad6da9.entry.js.map +0 -1
  245. package/dist/isometrik-webchat/p-8c73a5d5.entry.js +0 -2
  246. package/dist/isometrik-webchat/p-8c73a5d5.entry.js.map +0 -1
  247. package/dist/isometrik-webchat/p-d6f0838c.js +0 -2
  248. package/dist/isometrik-webchat/p-d6f0838c.js.map +0 -1
  249. /package/dist/isometrik-webchat/{p-188b2631.entry.js.map → p-0085b397.entry.js.map} +0 -0
  250. /package/dist/isometrik-webchat/{p-ab5e1e85.entry.js.map → p-1ad1127f.entry.js.map} +0 -0
  251. /package/dist/isometrik-webchat/{p-b44f0bd1.entry.js.map → p-6ec350aa.entry.js.map} +0 -0
  252. /package/dist/isometrik-webchat/{p-e589ff24.entry.js.map → p-71cc96a3.entry.js.map} +0 -0
  253. /package/dist/isometrik-webchat/{p-ff8f6bd2.entry.js.map → p-b8cef5e4.entry.js.map} +0 -0
@@ -1,177 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { Component, Prop, State, h } from '@stencil/core';
8
- import ChatSDK from 'test-iso-chat-sdk';
9
- import { drawerDialogService } from '../../lib/drawer';
10
- import { debounce } from '../../lib/helpers';
11
- import './shared/spinner-loader';
12
- import './shared/profile-avatar';
13
- let BlockChatList = class BlockChatList {
14
- constructor() {
15
- this.blockUsers = [];
16
- this.isLoading = false;
17
- this.skip = 0;
18
- this.hasMore = false;
19
- this.paginationLoading = false;
20
- this.searchTerm = '';
21
- this.debouncedSearch = debounce((query) => {
22
- this.findBlokedUser(query, 0);
23
- }, 500);
24
- this.findBlokedUser = async (searchTag, skip = 0) => {
25
- var _a;
26
- if (skip === 0) {
27
- this.isLoading = true;
28
- this.blockUsers = [];
29
- }
30
- if (skip >= 20)
31
- this.paginationLoading = true;
32
- this.hasMore = true;
33
- this.skip = skip;
34
- try {
35
- const payload = { limit: 20, skip };
36
- if (searchTag)
37
- payload.searchTag = searchTag;
38
- const findRes = await ChatSDK.getInstance().user.getUserBlock(payload);
39
- if (findRes === null || findRes === void 0 ? void 0 : findRes.users) {
40
- this.blockUsers = skip === 0 ? [...findRes.users] : [...this.blockUsers, ...findRes.users];
41
- }
42
- if (((_a = findRes === null || findRes === void 0 ? void 0 : findRes.users) === null || _a === void 0 ? void 0 : _a.length) < payload.limit)
43
- this.hasMore = false;
44
- }
45
- catch (error) {
46
- if ((error === null || error === void 0 ? void 0 : error.status) === 404 || (error === null || error === void 0 ? void 0 : error.statusCode) === 404)
47
- this.hasMore = false;
48
- if (((error === null || error === void 0 ? void 0 : error.status) === 404 || (error === null || error === void 0 ? void 0 : error.statusCode) === 404) && searchTag != null)
49
- this.blockUsers = [];
50
- console.error(error);
51
- }
52
- finally {
53
- this.isLoading = false;
54
- this.paginationLoading = false;
55
- }
56
- };
57
- this.handleUnblockUser = async (conversationId) => {
58
- var _a;
59
- this.isLoading = true;
60
- try {
61
- await ChatSDK.getInstance().user.postUserUnblock({ opponentId: conversationId });
62
- this.blockUsers = (_a = this.blockUsers) === null || _a === void 0 ? void 0 : _a.filter(user => user.userId !== conversationId);
63
- }
64
- catch (error) {
65
- console.error(`Failed to unblock user with ID ${conversationId}:`, error);
66
- }
67
- finally {
68
- this.isLoading = false;
69
- drawerDialogService.closeDialog('confirm-dialog');
70
- }
71
- };
72
- this.onScroll = (event) => {
73
- const element = event.target;
74
- if (element.scrollHeight - element.scrollTop <= element.clientHeight + 10 &&
75
- this.hasMore &&
76
- !this.paginationLoading) {
77
- this.findBlokedUser(this.searchTerm || null, this.skip + 20);
78
- }
79
- };
80
- }
81
- async componentWillLoad() {
82
- await this.findBlokedUser();
83
- }
84
- unBlockUser(user) {
85
- drawerDialogService.openDialog('confirm-dialog', {
86
- title: `Unblock`,
87
- description: `Are you sure you want to unblock ${user.userName} ?`,
88
- handleConfirm: () => this.handleUnblockUser(user.userId),
89
- });
90
- }
91
- render() {
92
- var _a, _b;
93
- return (h("div", { class: "blocked-users-container" },
94
- h("div", { class: "header" },
95
- h("button", { class: "back-button", type: "button", onClick: () => { var _a; return (_a = this.goBack) === null || _a === void 0 ? void 0 : _a.call(this); } }, "\u2190"),
96
- h("h2", { style: { margin: '0', fontSize: '18px' } }, "Blocked Users")),
97
- h("div", { class: "search-container" },
98
- h("input", { class: "search-input", type: "text", placeholder: "Search users...", value: this.searchTerm, onInput: (e) => {
99
- this.searchTerm = e.target.value;
100
- this.debouncedSearch(this.searchTerm);
101
- } })),
102
- this.isLoading ? (h("div", { class: "loading-spinner" },
103
- h("spinner-loader", { height: "30px", width: "30px" }))) : ((_a = this.blockUsers) === null || _a === void 0 ? void 0 : _a.length) === 0 ? (h("div", { class: "empty-state" }, this.searchTerm
104
- ? `No users found matching "${this.searchTerm}".`
105
- : "You haven't blocked any users yet.")) : (h("div", { class: "users-list", onScroll: this.onScroll },
106
- (_b = this.blockUsers) === null || _b === void 0 ? void 0 :
107
- _b.map(user => (h("div", { class: "user-item" },
108
- h("div", { class: "user-info" },
109
- h("profile-avatar", { src: user.userProfileImageUrl || '', name: user.userName || '', size: "40px" }),
110
- h("div", null, user.userName)),
111
- h("button", { class: "unblock-button", type: "button", onClick: () => this.unBlockUser(user) }, "Unblock")))),
112
- this.paginationLoading ? (h("div", { class: "loading-spinner" },
113
- h("spinner-loader", { height: "24px", width: "24px" }))) : null))));
114
- }
115
- };
116
- __decorate([
117
- Prop()
118
- ], BlockChatList.prototype, "goBack", void 0);
119
- __decorate([
120
- State()
121
- ], BlockChatList.prototype, "blockUsers", void 0);
122
- __decorate([
123
- State()
124
- ], BlockChatList.prototype, "isLoading", void 0);
125
- __decorate([
126
- State()
127
- ], BlockChatList.prototype, "skip", void 0);
128
- __decorate([
129
- State()
130
- ], BlockChatList.prototype, "hasMore", void 0);
131
- __decorate([
132
- State()
133
- ], BlockChatList.prototype, "paginationLoading", void 0);
134
- __decorate([
135
- State()
136
- ], BlockChatList.prototype, "searchTerm", void 0);
137
- BlockChatList = __decorate([
138
- Component({
139
- tag: 'block-chat-list',
140
- shadow: true,
141
- styles: `
142
- :host { height: 96%; display: block; }
143
- .blocked-users-container {
144
- padding: 5px; height: 100%; display: flex; flex-direction: column;
145
- background: var(--bg-primary-color); color: var(--text-primary-color);
146
- }
147
- .header {
148
- display: flex; align-items: center; padding: 10px 0; margin-bottom: 12px;
149
- border-bottom: 1px solid var(--bg-grey-color);
150
- }
151
- .back-button {
152
- background: none; border: none; cursor: pointer; color: inherit; margin-right: 8px; font-size: 20px;
153
- }
154
- .search-container { margin-bottom: 12px; }
155
- .search-input {
156
- width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 8px;
157
- border: 1px solid var(--bg-secondary-color); background: var(--bg-secondary-color);
158
- color: var(--text-primary-color); outline: none;
159
- }
160
- .users-list { flex: 1; overflow-y: auto; }
161
- .user-item {
162
- display: flex; align-items: center; justify-content: space-between;
163
- padding: 10px 4px; border-bottom: 1px solid var(--bg-secondary-color);
164
- }
165
- .user-info { display: flex; align-items: center; gap: 10px; }
166
- .avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--bg-primary-light); }
167
- .unblock-button {
168
- border: none; border-radius: 6px; padding: 6px 10px; cursor: pointer;
169
- background: var(--bg-primary-light); color: var(--text-primary-color);
170
- }
171
- .empty-state, .loading-spinner {
172
- display: flex; align-items: center; justify-content: center; padding: 40px 16px; opacity: 0.75;
173
- }
174
- `,
175
- })
176
- ], BlockChatList);
177
- export { BlockChatList };
@@ -1,152 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { Component, h, State, Prop } from '@stencil/core';
8
- import ChatSDK from 'test-iso-chat-sdk';
9
- import './shared/searchable list/searchable-list';
10
- import { drawerDialogService } from '../../lib/drawer';
11
- let MemberAdd = class MemberAdd {
12
- constructor() {
13
- this.nonBlockedContacts = [];
14
- this.skip = 0;
15
- this.isNoContactsFound = false;
16
- this.hasMore = false;
17
- this.isLoading = false;
18
- this.paginationLoading = false;
19
- this.dialogData = {};
20
- this.getForwardMessageMemberList = async (searchTag, skip) => {
21
- var _a, _b;
22
- if (skip === 0) {
23
- this.isLoading = true;
24
- this.nonBlockedContacts = [];
25
- }
26
- if (skip >= 20) {
27
- this.paginationLoading = true;
28
- }
29
- this.hasMore = true;
30
- try {
31
- if (searchTag !== undefined && skip === undefined) {
32
- this.nonBlockedContacts = [];
33
- this.skip = 0;
34
- }
35
- const paramsForNonBlockedContacts = {
36
- sort: 1,
37
- limit: 20,
38
- skip: skip || this.skip,
39
- context: 'new_chat',
40
- };
41
- if (searchTag === null || searchTag === void 0 ? void 0 : searchTag.trim()) {
42
- // @ts-ignore
43
- paramsForNonBlockedContacts.searchTag = searchTag;
44
- }
45
- const res = await ChatSDK.getInstance().user.getUserNonblock(paramsForNonBlockedContacts);
46
- if (!(res === null || res === void 0 ? void 0 : res.users) || res.users.length === 0) {
47
- this.isNoContactsFound = (searchTag === null || searchTag === void 0 ? void 0 : searchTag.trim()) ? true : false; // Only show no results if there was a search
48
- }
49
- else {
50
- this.isNoContactsFound = false;
51
- const uniqueContacts = (_a = res === null || res === void 0 ? void 0 : res.users) === null || _a === void 0 ? void 0 : _a.filter(newContact => !this.nonBlockedContacts.some(existingContact => existingContact.userId === newContact.userId));
52
- this.nonBlockedContacts = [...this.nonBlockedContacts, ...uniqueContacts];
53
- this.skip += res.users.length;
54
- }
55
- if (((_b = res === null || res === void 0 ? void 0 : res.users) === null || _b === void 0 ? void 0 : _b.length) < paramsForNonBlockedContacts.limit) {
56
- this.hasMore = false;
57
- }
58
- }
59
- catch (error) {
60
- if ((error === null || error === void 0 ? void 0 : error.status) === 404 || (error === null || error === void 0 ? void 0 : error.statusCode) === 404) {
61
- this.hasMore = false;
62
- }
63
- if (((error === null || error === void 0 ? void 0 : error.status) === 404 || (error === null || error === void 0 ? void 0 : error.statusCode) === 404) && searchTag != null) {
64
- this.nonBlockedContacts = [];
65
- }
66
- }
67
- finally {
68
- this.isLoading = false;
69
- this.paginationLoading = false;
70
- }
71
- };
72
- this.postMessageForward = async (messageBody, userIds, conversationIds, attachments, customType) => {
73
- try {
74
- const requestBody = {
75
- messageType: 1,
76
- showInConversation: true,
77
- encrypted: false,
78
- body: messageBody,
79
- attachments: attachments,
80
- deviceId: this.dialogData.deviceId,
81
- customType: customType
82
- };
83
- if ((userIds === null || userIds === void 0 ? void 0 : userIds.length) > 0) {
84
- requestBody.userIds = userIds;
85
- }
86
- if ((conversationIds === null || conversationIds === void 0 ? void 0 : conversationIds.length) > 0) {
87
- requestBody.conversationIds = conversationIds;
88
- }
89
- await ChatSDK.getInstance().message.postMessagesForward(requestBody);
90
- }
91
- catch (error) {
92
- console.error('Error forwarding the message', error);
93
- }
94
- finally {
95
- drawerDialogService.closeDialog('forward-memebers');
96
- }
97
- };
98
- }
99
- async componentDidLoad() {
100
- await this.getForwardMessageMemberList(null, 0);
101
- }
102
- async sendMessageHandler(selectedContacts, dialogData) {
103
- var _a, _b, _c, _d, _e, _f;
104
- const allUserIds = [];
105
- const allConversationIds = [];
106
- selectedContacts === null || selectedContacts === void 0 ? void 0 : selectedContacts.forEach(contact => {
107
- const { userId, contactConversationId } = contact;
108
- if (userId)
109
- allUserIds.push(userId);
110
- if (contactConversationId)
111
- allConversationIds.push(contactConversationId);
112
- });
113
- if (dialogData === null || dialogData === void 0 ? void 0 : dialogData.message) {
114
- const parsedMessageBody = typeof ((_a = dialogData === null || dialogData === void 0 ? void 0 : dialogData.message) === null || _a === void 0 ? void 0 : _a.body) === 'string' ? (_b = dialogData.message) === null || _b === void 0 ? void 0 : _b.body : (_d = (_c = dialogData.message) === null || _c === void 0 ? void 0 : _c.body) === null || _d === void 0 ? void 0 : _d.messageBody;
115
- if ((allUserIds === null || allUserIds === void 0 ? void 0 : allUserIds.length) > 0 || (allConversationIds === null || allConversationIds === void 0 ? void 0 : allConversationIds.length) > 0) {
116
- await this.postMessageForward(parsedMessageBody, (allUserIds === null || allUserIds === void 0 ? void 0 : allUserIds.length) > 0 ? allUserIds : null, (allConversationIds === null || allConversationIds === void 0 ? void 0 : allConversationIds.length) > 0 ? allConversationIds : null, (_e = dialogData.message) === null || _e === void 0 ? void 0 : _e.attachments, (_f = dialogData.message) === null || _f === void 0 ? void 0 : _f.customType);
117
- }
118
- }
119
- }
120
- render() {
121
- return (h("searchable-list", { fontSize: "16px", label: "Forward message to", conversationList: this.dialogData.conversationList, contactList: this.nonBlockedContacts, getForwardMessageMemberList: this.getForwardMessageMemberList, isLoading: this.isLoading, hasMore: this.hasMore, skip: this.skip, paginationLoading: this.paginationLoading, onSend: (selectedContacts) => this.sendMessageHandler(selectedContacts, this.dialogData) }));
122
- }
123
- };
124
- __decorate([
125
- State()
126
- ], MemberAdd.prototype, "nonBlockedContacts", void 0);
127
- __decorate([
128
- State()
129
- ], MemberAdd.prototype, "skip", void 0);
130
- __decorate([
131
- State()
132
- ], MemberAdd.prototype, "isNoContactsFound", void 0);
133
- __decorate([
134
- State()
135
- ], MemberAdd.prototype, "hasMore", void 0);
136
- __decorate([
137
- State()
138
- ], MemberAdd.prototype, "isLoading", void 0);
139
- __decorate([
140
- State()
141
- ], MemberAdd.prototype, "paginationLoading", void 0);
142
- __decorate([
143
- Prop()
144
- ], MemberAdd.prototype, "dialogData", void 0);
145
- MemberAdd = __decorate([
146
- Component({
147
- tag: 'forward-memebers',
148
- styleUrl: '',
149
- shadow: true,
150
- })
151
- ], MemberAdd);
152
- export { MemberAdd };