@cometchat/chat-uikit-react-native 4.3.25 → 5.0.0

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 (1184) hide show
  1. package/README.md +2 -3
  2. package/android/.gradle/7.4/checksums/checksums.lock +0 -0
  3. package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
  4. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  5. package/android/.gradle/7.4/gc.properties +0 -0
  6. package/android/.gradle/vcs-1/gc.properties +0 -0
  7. package/android/.settings/org.eclipse.buildship.core.prefs +2 -0
  8. package/android/src/main/AndroidManifest.xml +0 -6
  9. package/android/src/main/java/com/reactnativecometchatuikit/CometChatSoundModule.java +29 -44
  10. package/android/src/main/java/com/reactnativecometchatuikit/FileManager.java +172 -28
  11. package/android/src/main/java/com/reactnativecometchatuikit/SoundPlayer.java +43 -15
  12. package/ios/CometchatUiKit.mm +27 -14
  13. package/ios/FileManager.m +134 -20
  14. package/ios/SoundPlayer.m +32 -5
  15. package/package.json +18 -59
  16. package/react-native-cometchat-ui-kit.podspec +16 -0
  17. package/src/CometChatConversations/CometChatConversations.tsx +1520 -1293
  18. package/src/CometChatConversations/Skeleton.tsx +186 -0
  19. package/src/CometChatConversations/index.ts +7 -21
  20. package/src/CometChatConversations/resources/index.ts +22 -36
  21. package/src/CometChatConversations/style.ts +230 -60
  22. package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +1032 -659
  23. package/src/CometChatGroupMembers/Skeleton.tsx +197 -0
  24. package/src/CometChatGroupMembers/index.ts +2 -8
  25. package/src/CometChatGroupMembers/resources/index.ts +3 -14
  26. package/src/CometChatGroupMembers/style.ts +530 -22
  27. package/src/CometChatGroups/CometChatGroups.tsx +509 -550
  28. package/src/CometChatGroups/GroupsStyle.ts +179 -109
  29. package/src/CometChatGroups/Skeleton.tsx +238 -0
  30. package/src/CometChatGroups/index.ts +3 -11
  31. package/src/CometChatGroups/resources/index.ts +17 -24
  32. package/src/CometChatGroups/style.ts +15 -16
  33. package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +730 -1058
  34. package/src/CometChatMessageComposer/index.ts +4 -8
  35. package/src/CometChatMessageComposer/resources/index.ts +21 -31
  36. package/src/CometChatMessageComposer/styles.tsx +152 -0
  37. package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +370 -482
  38. package/src/CometChatMessageHeader/index.ts +3 -15
  39. package/src/CometChatMessageHeader/listners.ts +50 -26
  40. package/src/CometChatMessageHeader/styles.ts +57 -10
  41. package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +333 -316
  42. package/src/CometChatMessageInformation/Skeleton.tsx +143 -0
  43. package/src/CometChatMessageInformation/index.ts +5 -9
  44. package/src/CometChatMessageInformation/resources/index.ts +1 -4
  45. package/src/CometChatMessageInformation/styles.ts +147 -16
  46. package/src/CometChatMessageList/CometChatMessageList.tsx +2464 -2076
  47. package/src/CometChatMessageList/Skeleton.tsx +98 -0
  48. package/src/CometChatMessageList/index.ts +5 -12
  49. package/src/CometChatMessageList/resources/index.ts +13 -20
  50. package/src/CometChatMessageList/style.ts +989 -51
  51. package/src/CometChatThreadHeader/CometChatThreadHeader.tsx +274 -0
  52. package/src/CometChatThreadHeader/Header.tsx +47 -0
  53. package/src/CometChatThreadHeader/index.ts +8 -0
  54. package/src/CometChatThreadHeader/resources/index.ts +14 -0
  55. package/src/CometChatThreadHeader/style.ts +70 -0
  56. package/src/CometChatUsers/CometChatUsers.tsx +436 -122
  57. package/src/CometChatUsers/Skeleton.tsx +210 -0
  58. package/src/CometChatUsers/index.ts +3 -11
  59. package/src/CometChatUsers/style.ts +184 -0
  60. package/src/calls/CallEvents.ts +9 -9
  61. package/src/calls/CallUtils.ts +102 -31
  62. package/src/calls/CallingConfiguration.ts +23 -4
  63. package/src/calls/CallingExtension.tsx +43 -40
  64. package/src/calls/CallingExtensionDecorator.tsx +418 -0
  65. package/src/calls/CallingPackage.ts +11 -12
  66. package/src/calls/CometChatCallBubble/CometChatCallBubble.tsx +121 -52
  67. package/src/calls/CometChatCallBubble/index.ts +8 -13
  68. package/src/calls/CometChatCallBubble/resources/index.ts +1 -8
  69. package/src/calls/CometChatCallBubble/styles.ts +155 -22
  70. package/src/calls/CometChatCallButtons/CometChatCallButtonConfiguration.ts +19 -36
  71. package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +321 -323
  72. package/src/calls/CometChatCallButtons/index.ts +9 -11
  73. package/src/calls/CometChatCallButtons/style.ts +34 -12
  74. package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +571 -376
  75. package/src/calls/CometChatCallLogs/Skeleton.tsx +227 -0
  76. package/src/calls/CometChatCallLogs/index.ts +5 -15
  77. package/src/calls/CometChatCallLogs/resources/index.ts +20 -31
  78. package/src/calls/CometChatCallLogs/style.ts +207 -18
  79. package/src/calls/CometChatIncomingCall/CometChatIncomingCall.tsx +278 -222
  80. package/src/calls/CometChatIncomingCall/index.ts +7 -9
  81. package/src/calls/CometChatIncomingCall/resources/index.ts +3 -12
  82. package/src/calls/CometChatIncomingCall/style.ts +75 -0
  83. package/src/calls/CometChatOngoingCall/CometChatOngoingCall.tsx +74 -56
  84. package/src/calls/CometChatOngoingCall/index.ts +3 -7
  85. package/src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx +225 -176
  86. package/src/calls/CometChatOutgoingCall/OutgoingCallConfiguration.ts +31 -31
  87. package/src/calls/CometChatOutgoingCall/index.ts +5 -11
  88. package/src/calls/CometChatOutgoingCall/resources/index.ts +1 -4
  89. package/src/calls/CometChatOutgoingCall/styles.ts +58 -0
  90. package/src/calls/index.ts +14 -88
  91. package/src/calls/resources/index.ts +1 -8
  92. package/src/extensions/CollaborativeBubble/CometChatCollaborativeBubble.tsx +72 -96
  93. package/src/extensions/CollaborativeBubble/resources/index.ts +2 -4
  94. package/src/extensions/CollaborativeBubble/style.ts +112 -0
  95. package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtension.tsx +21 -35
  96. package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.tsx +246 -189
  97. package/src/extensions/CollaborativeDocument/index.ts +2 -8
  98. package/src/extensions/CollaborativeDocument/resources/index.ts +4 -6
  99. package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtension.tsx +25 -35
  100. package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.tsx +323 -197
  101. package/src/extensions/CollaborativeWhiteboard/index.ts +2 -8
  102. package/src/extensions/CollaborativeWhiteboard/resources/index.ts +4 -6
  103. package/src/extensions/ExtensionConstants.tsx +3 -4
  104. package/src/extensions/ExtensionModerator.tsx +47 -47
  105. package/src/extensions/LinkPreview/LinkPreviewBubble.tsx +187 -116
  106. package/src/extensions/LinkPreview/LinkPreviewExtension.tsx +22 -0
  107. package/src/extensions/LinkPreview/LinkPreviewExtensionDecorator.tsx +94 -0
  108. package/src/extensions/LinkPreview/index.ts +6 -16
  109. package/src/extensions/LinkPreview/resources/index.ts +1 -4
  110. package/src/extensions/LinkPreview/style.ts +100 -0
  111. package/src/extensions/MessageTranslation/MessageTranslationBubble.tsx +112 -116
  112. package/src/extensions/MessageTranslation/MessageTranslationDecorator.tsx +238 -154
  113. package/src/extensions/MessageTranslation/MessageTranslationExtension.tsx +7 -25
  114. package/src/extensions/MessageTranslation/index.ts +3 -5
  115. package/src/extensions/MessageTranslation/resources/index.ts +2 -3
  116. package/src/extensions/Polls/Header.tsx +56 -21
  117. package/src/extensions/Polls/Polls.tsx +368 -332
  118. package/src/extensions/Polls/PollsBubble.tsx +250 -205
  119. package/src/extensions/Polls/PollsConfigurations.ts +0 -9
  120. package/src/extensions/Polls/PollsDecorator.tsx +164 -72
  121. package/src/extensions/Polls/PollsExtension.tsx +5 -12
  122. package/src/extensions/Polls/index.ts +6 -8
  123. package/src/extensions/Polls/resources/index.ts +6 -12
  124. package/src/extensions/Polls/style.ts +185 -1
  125. package/src/extensions/Stickers/CometChatStickerKeyboard/CometChatStickerKeyboard.tsx +249 -115
  126. package/src/extensions/Stickers/CometChatStickerKeyboard/Skeleton.tsx +167 -0
  127. package/src/extensions/Stickers/CometChatStickerKeyboard/StickerKeyboardConfiguration.ts +2 -6
  128. package/src/extensions/Stickers/CometChatStickerKeyboard/hooks.ts +58 -64
  129. package/src/extensions/Stickers/CometChatStickerKeyboard/index.ts +2 -3
  130. package/src/extensions/Stickers/CometChatStickerKeyboard/style.ts +67 -41
  131. package/src/extensions/Stickers/StickerConfiguration.ts +5 -9
  132. package/src/extensions/Stickers/StickersBubble.tsx +22 -46
  133. package/src/extensions/Stickers/StickersExtension.ts +5 -6
  134. package/src/extensions/Stickers/StickersExtensionDecorator.tsx +307 -103
  135. package/src/extensions/Stickers/index.ts +7 -9
  136. package/src/extensions/Stickers/resources/index.ts +1 -4
  137. package/src/extensions/Stickers/style.ts +53 -0
  138. package/src/extensions/ThumbnailGeneration/ThumbnailGenerationDecorator.tsx +83 -64
  139. package/src/extensions/ThumbnailGeneration/ThumbnailGenerationExtension.tsx +5 -25
  140. package/src/extensions/ThumbnailGeneration/index.ts +1 -3
  141. package/src/extensions/ThumbnailGeneration/resources/index.ts +1 -4
  142. package/src/extensions/index.ts +11 -50
  143. package/src/index.ts +194 -688
  144. package/src/shared/CometChatUiKit/CometChatUIKit.ts +342 -486
  145. package/src/shared/CometChatUiKit/CometChatUIKitHelper.ts +147 -117
  146. package/src/shared/CometChatUiKit/UIKitSettings.ts +38 -38
  147. package/src/shared/CometChatUiKit/index.ts +2 -6
  148. package/src/shared/assets/images/index.ts +13 -29
  149. package/src/shared/base/BaseStyle.ts +9 -8
  150. package/src/shared/base/BorderStyle.ts +4 -4
  151. package/src/shared/base/FontStyle.ts +25 -3
  152. package/src/shared/base/ShadowStyle.ts +1 -1
  153. package/src/shared/base/Types.ts +45 -26
  154. package/src/shared/base/index.ts +7 -25
  155. package/src/shared/base/vars.ts +5 -5
  156. package/src/shared/constants/UIKitConstants.ts +322 -294
  157. package/src/shared/events/CometChatMessageEvents/index.ts +83 -87
  158. package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +260 -238
  159. package/src/shared/events/CometChatUIEventHandler/Listener.ts +412 -377
  160. package/src/shared/events/CometChatUIEvents.ts +15 -16
  161. package/src/shared/events/ListenerInitializer.ts +79 -80
  162. package/src/shared/events/conversations.ts +2 -2
  163. package/src/shared/events/groups.ts +8 -8
  164. package/src/shared/events/index.ts +6 -6
  165. package/src/shared/events/messages.ts +26 -29
  166. package/src/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.tsx +191 -121
  167. package/src/shared/formatters/CometChatMentionsFormatter/MentionTextStyle.ts +3 -3
  168. package/src/shared/formatters/CometChatMentionsFormatter/index.ts +3 -6
  169. package/src/shared/formatters/CometChatTextFormatter.ts +15 -14
  170. package/src/shared/formatters/CometChatUrlsFormatter/index.tsx +127 -131
  171. package/src/shared/formatters/index.ts +7 -8
  172. package/src/shared/framework/ChatConfigurator.ts +3 -4
  173. package/src/shared/framework/DataSource.ts +225 -92
  174. package/src/shared/framework/DataSourceDecorator.tsx +316 -233
  175. package/src/shared/framework/ExtensionsDataSource.tsx +8 -11
  176. package/src/shared/framework/MessageDataSource.tsx +1556 -857
  177. package/src/shared/framework/index.ts +8 -6
  178. package/src/shared/framework/resources/index.ts +37 -57
  179. package/src/shared/helper/Toast.tsx +20 -18
  180. package/src/shared/helper/dateHelper.ts +138 -0
  181. package/src/shared/helper/functions.js +1 -1
  182. package/src/shared/helper/helperFunctions.ts +71 -19
  183. package/src/shared/helper/types/index.ts +49 -15
  184. package/src/shared/helper/useKeyboard.tsx +12 -23
  185. package/src/shared/icons/Icon.tsx +73 -0
  186. package/src/shared/icons/components/ListItemCheck.tsx +18 -0
  187. package/src/shared/icons/components/StickerBase-icon.tsx +16 -0
  188. package/src/shared/icons/components/account-circle-fill.tsx +26 -0
  189. package/src/shared/icons/components/account-circle.tsx +11 -0
  190. package/src/shared/icons/components/activity.tsx +20 -0
  191. package/src/shared/icons/components/add-a-photo-fill.tsx +26 -0
  192. package/src/shared/icons/components/add-a-photo.tsx +11 -0
  193. package/src/shared/icons/components/add-box-fill.tsx +26 -0
  194. package/src/shared/icons/components/add-box.tsx +11 -0
  195. package/src/shared/icons/components/add-call-fill.tsx +26 -0
  196. package/src/shared/icons/components/add-call.tsx +11 -0
  197. package/src/shared/icons/components/add-circle-fill.tsx +11 -0
  198. package/src/shared/icons/components/add-circle.tsx +11 -0
  199. package/src/shared/icons/components/add-comment-fill.tsx +26 -0
  200. package/src/shared/icons/components/add-comment.tsx +11 -0
  201. package/src/shared/icons/components/add-fill.tsx +26 -0
  202. package/src/shared/icons/components/add-reaction-fill.tsx +26 -0
  203. package/src/shared/icons/components/add-reaction.tsx +11 -0
  204. package/src/shared/icons/components/add.tsx +11 -0
  205. package/src/shared/icons/components/ai-conversation-summary-fill.tsx +13 -0
  206. package/src/shared/icons/components/ai-conversation-summary.tsx +13 -0
  207. package/src/shared/icons/components/ai-fill.tsx +11 -0
  208. package/src/shared/icons/components/ai-suggest-reply-fill.tsx +13 -0
  209. package/src/shared/icons/components/ai-suggest-reply.tsx +20 -0
  210. package/src/shared/icons/components/ai.tsx +12 -0
  211. package/src/shared/icons/components/alternate-email-fill.tsx +26 -0
  212. package/src/shared/icons/components/alternate-email.tsx +11 -0
  213. package/src/shared/icons/components/animals-&-nature.tsx +18 -0
  214. package/src/shared/icons/components/archive-fill.tsx +26 -0
  215. package/src/shared/icons/components/archive.tsx +11 -0
  216. package/src/shared/icons/components/arrow-back-fill.tsx +26 -0
  217. package/src/shared/icons/components/arrow-back.tsx +11 -0
  218. package/src/shared/icons/components/arrow-forward-fill.tsx +26 -0
  219. package/src/shared/icons/components/arrow-forward.tsx +11 -0
  220. package/src/shared/icons/components/attach-file-fill.tsx +26 -0
  221. package/src/shared/icons/components/attach-file.tsx +11 -0
  222. package/src/shared/icons/components/audio-file-type.tsx +36 -0
  223. package/src/shared/icons/components/bar-chart-fill.tsx +11 -0
  224. package/src/shared/icons/components/bar-chart.tsx +11 -0
  225. package/src/shared/icons/components/base-icon.tsx +16 -0
  226. package/src/shared/icons/components/bedtime-fill.tsx +26 -0
  227. package/src/shared/icons/components/bedtime.tsx +11 -0
  228. package/src/shared/icons/components/block-fill.tsx +26 -0
  229. package/src/shared/icons/components/block.tsx +11 -0
  230. package/src/shared/icons/components/bookmark-add-fill.tsx +26 -0
  231. package/src/shared/icons/components/bookmark-add.tsx +11 -0
  232. package/src/shared/icons/components/bookmark-fill.tsx +26 -0
  233. package/src/shared/icons/components/bookmark.tsx +11 -0
  234. package/src/shared/icons/components/calendar-add-on-fill.tsx +26 -0
  235. package/src/shared/icons/components/calendar-add-on.tsx +11 -0
  236. package/src/shared/icons/components/calendar-today-fill.tsx +26 -0
  237. package/src/shared/icons/components/calendar-today.tsx +11 -0
  238. package/src/shared/icons/components/call-end-fill.tsx +26 -0
  239. package/src/shared/icons/components/call-end.tsx +11 -0
  240. package/src/shared/icons/components/call-fill.tsx +26 -0
  241. package/src/shared/icons/components/call-log-fill.tsx +26 -0
  242. package/src/shared/icons/components/call-log.tsx +11 -0
  243. package/src/shared/icons/components/call-made-fill.tsx +26 -0
  244. package/src/shared/icons/components/call-made.tsx +11 -0
  245. package/src/shared/icons/components/call-missed-fill.tsx +26 -0
  246. package/src/shared/icons/components/call-missed-outgoing-fill.tsx +26 -0
  247. package/src/shared/icons/components/call-missed-outgoing.tsx +11 -0
  248. package/src/shared/icons/components/call-missed.tsx +11 -0
  249. package/src/shared/icons/components/call-received-fill.tsx +26 -0
  250. package/src/shared/icons/components/call-received.tsx +11 -0
  251. package/src/shared/icons/components/call.tsx +11 -0
  252. package/src/shared/icons/components/cancel-fill.tsx +26 -0
  253. package/src/shared/icons/components/cancel.tsx +11 -0
  254. package/src/shared/icons/components/change-circle-fill.tsx +11 -0
  255. package/src/shared/icons/components/change-circle.tsx +11 -0
  256. package/src/shared/icons/components/chat-bot-fill.tsx +13 -0
  257. package/src/shared/icons/components/chat-bot.tsx +17 -0
  258. package/src/shared/icons/components/chat-fill.tsx +26 -0
  259. package/src/shared/icons/components/chat.tsx +11 -0
  260. package/src/shared/icons/components/check-circle-fill.tsx +11 -0
  261. package/src/shared/icons/components/check-circle.tsx +11 -0
  262. package/src/shared/icons/components/check-fill.tsx +26 -0
  263. package/src/shared/icons/components/check.tsx +11 -0
  264. package/src/shared/icons/components/chevron-left-fill.tsx +26 -0
  265. package/src/shared/icons/components/chevron-left.tsx +11 -0
  266. package/src/shared/icons/components/chevron-right-fill.tsx +26 -0
  267. package/src/shared/icons/components/chevron-right.tsx +11 -0
  268. package/src/shared/icons/components/close-fill.tsx +26 -0
  269. package/src/shared/icons/components/close.tsx +11 -0
  270. package/src/shared/icons/components/collaborative-document-fill.tsx +17 -0
  271. package/src/shared/icons/components/collaborative-document-icon.tsx +11 -0
  272. package/src/shared/icons/components/collaborative-document.tsx +13 -0
  273. package/src/shared/icons/components/collaborative-whiteboard-fill.tsx +15 -0
  274. package/src/shared/icons/components/collaborative-whiteboard-icon.tsx +15 -0
  275. package/src/shared/icons/components/collaborative-whiteboard.tsx +12 -0
  276. package/src/shared/icons/components/content-copy-fill.tsx +26 -0
  277. package/src/shared/icons/components/content-copy.tsx +11 -0
  278. package/src/shared/icons/components/crop-fill.tsx +26 -0
  279. package/src/shared/icons/components/crop.tsx +11 -0
  280. package/src/shared/icons/components/delete-fill.tsx +26 -0
  281. package/src/shared/icons/components/delete.tsx +11 -0
  282. package/src/shared/icons/components/description-fill.tsx +26 -0
  283. package/src/shared/icons/components/description.tsx +11 -0
  284. package/src/shared/icons/components/document-file-type.tsx +38 -0
  285. package/src/shared/icons/components/done-all-fill.tsx +26 -0
  286. package/src/shared/icons/components/done-all.tsx +11 -0
  287. package/src/shared/icons/components/download-fill.tsx +26 -0
  288. package/src/shared/icons/components/download.tsx +11 -0
  289. package/src/shared/icons/components/edit-calendar-fill.tsx +26 -0
  290. package/src/shared/icons/components/edit-calendar.tsx +11 -0
  291. package/src/shared/icons/components/edit-fill.tsx +26 -0
  292. package/src/shared/icons/components/edit-square-fill.tsx +11 -0
  293. package/src/shared/icons/components/edit-square.tsx +11 -0
  294. package/src/shared/icons/components/edit.tsx +11 -0
  295. package/src/shared/icons/components/empty-state.tsx +82 -0
  296. package/src/shared/icons/components/error-fill.tsx +34 -0
  297. package/src/shared/icons/components/error-state.tsx +92 -0
  298. package/src/shared/icons/components/error.tsx +11 -0
  299. package/src/shared/icons/components/event-available-fill.tsx +11 -0
  300. package/src/shared/icons/components/event-available.tsx +11 -0
  301. package/src/shared/icons/components/event-fill.tsx +26 -0
  302. package/src/shared/icons/components/event.tsx +11 -0
  303. package/src/shared/icons/components/favorite-fill.tsx +26 -0
  304. package/src/shared/icons/components/favorite.tsx +11 -0
  305. package/src/shared/icons/components/filter-list-fill.tsx +26 -0
  306. package/src/shared/icons/components/filter-list-off-fill.tsx +26 -0
  307. package/src/shared/icons/components/filter-list-off.tsx +11 -0
  308. package/src/shared/icons/components/filter-list.tsx +11 -0
  309. package/src/shared/icons/components/flags.tsx +13 -0
  310. package/src/shared/icons/components/flip-camera-ios-fill.tsx +26 -0
  311. package/src/shared/icons/components/flip-camera-ios.tsx +11 -0
  312. package/src/shared/icons/components/food-&-drink.tsx +18 -0
  313. package/src/shared/icons/components/forward-fill.tsx +26 -0
  314. package/src/shared/icons/components/forward.tsx +11 -0
  315. package/src/shared/icons/components/gif-fill.tsx +13 -0
  316. package/src/shared/icons/components/gif.tsx +12 -0
  317. package/src/shared/icons/components/graphic-eq-fill.tsx +11 -0
  318. package/src/shared/icons/components/graphic-eq.tsx +11 -0
  319. package/src/shared/icons/components/group-add.tsx +11 -0
  320. package/src/shared/icons/components/group-fill.tsx +26 -0
  321. package/src/shared/icons/components/group.tsx +11 -0
  322. package/src/shared/icons/components/help-fill.tsx +26 -0
  323. package/src/shared/icons/components/help.tsx +11 -0
  324. package/src/shared/icons/components/history-fill.tsx +26 -0
  325. package/src/shared/icons/components/history.tsx +11 -0
  326. package/src/shared/icons/components/image-file-type.tsx +35 -0
  327. package/src/shared/icons/components/incoming-audio-fill.tsx +11 -0
  328. package/src/shared/icons/components/incoming-audio.tsx +13 -0
  329. package/src/shared/icons/components/incoming-video-fill.tsx +28 -0
  330. package/src/shared/icons/components/incoming-video.tsx +15 -0
  331. package/src/shared/icons/components/info-fill.tsx +26 -0
  332. package/src/shared/icons/components/info.tsx +11 -0
  333. package/src/shared/icons/components/keep-fill.tsx +26 -0
  334. package/src/shared/icons/components/keep-off-fill.tsx +26 -0
  335. package/src/shared/icons/components/keep-off.tsx +11 -0
  336. package/src/shared/icons/components/keep.tsx +11 -0
  337. package/src/shared/icons/components/keyboard-arrow-down-fill.tsx +26 -0
  338. package/src/shared/icons/components/keyboard-arrow-down.tsx +11 -0
  339. package/src/shared/icons/components/keyboard-arrow-up-fill.tsx +26 -0
  340. package/src/shared/icons/components/keyboard-arrow-up.tsx +11 -0
  341. package/src/shared/icons/components/keyboard-fill.tsx +26 -0
  342. package/src/shared/icons/components/keyboard.tsx +11 -0
  343. package/src/shared/icons/components/language-fill.tsx +26 -0
  344. package/src/shared/icons/components/language.tsx +11 -0
  345. package/src/shared/icons/components/link-fill.tsx +26 -0
  346. package/src/shared/icons/components/link.tsx +11 -0
  347. package/src/shared/icons/components/loading-fill.tsx +12 -0
  348. package/src/shared/icons/components/loading.tsx +12 -0
  349. package/src/shared/icons/components/location-on-fill.tsx +26 -0
  350. package/src/shared/icons/components/location-on.tsx +11 -0
  351. package/src/shared/icons/components/lock-fill.tsx +26 -0
  352. package/src/shared/icons/components/lock-open-fill.tsx +26 -0
  353. package/src/shared/icons/components/lock-open.tsx +11 -0
  354. package/src/shared/icons/components/lock.tsx +11 -0
  355. package/src/shared/icons/components/logout-fill.tsx +11 -0
  356. package/src/shared/icons/components/logout.tsx +11 -0
  357. package/src/shared/icons/components/mail-fill.tsx +26 -0
  358. package/src/shared/icons/components/mail.tsx +11 -0
  359. package/src/shared/icons/components/mic-fill.tsx +26 -0
  360. package/src/shared/icons/components/mic-off-fill.tsx +26 -0
  361. package/src/shared/icons/components/mic-off.tsx +11 -0
  362. package/src/shared/icons/components/mic.tsx +11 -0
  363. package/src/shared/icons/components/missed-video-call-fill.tsx +26 -0
  364. package/src/shared/icons/components/missed-video-call.tsx +11 -0
  365. package/src/shared/icons/components/mood-fill.tsx +26 -0
  366. package/src/shared/icons/components/mood.tsx +11 -0
  367. package/src/shared/icons/components/more-vert-fill.tsx +26 -0
  368. package/src/shared/icons/components/more-vert.tsx +11 -0
  369. package/src/shared/icons/components/near-me-fill.tsx +11 -0
  370. package/src/shared/icons/components/near-me.tsx +11 -0
  371. package/src/shared/icons/components/no-photography-fill.tsx +26 -0
  372. package/src/shared/icons/components/no-photography.tsx +11 -0
  373. package/src/shared/icons/components/notifications-fill.tsx +26 -0
  374. package/src/shared/icons/components/notifications-off-fill.tsx +26 -0
  375. package/src/shared/icons/components/notifications-off.tsx +11 -0
  376. package/src/shared/icons/components/notifications.tsx +11 -0
  377. package/src/shared/icons/components/objects.tsx +20 -0
  378. package/src/shared/icons/components/outgoing-audio-fill.tsx +15 -0
  379. package/src/shared/icons/components/outgoing-audio.tsx +15 -0
  380. package/src/shared/icons/components/outgoing-video-fill.tsx +28 -0
  381. package/src/shared/icons/components/outgoing-video.tsx +15 -0
  382. package/src/shared/icons/components/pause-fill.tsx +26 -0
  383. package/src/shared/icons/components/pause.tsx +11 -0
  384. package/src/shared/icons/components/pdf-file-type.tsx +36 -0
  385. package/src/shared/icons/components/person-add-fill.tsx +26 -0
  386. package/src/shared/icons/components/person-add.tsx +11 -0
  387. package/src/shared/icons/components/person-fill.tsx +26 -0
  388. package/src/shared/icons/components/person-off.tsx +16 -0
  389. package/src/shared/icons/components/person.tsx +11 -0
  390. package/src/shared/icons/components/phone-in-talk-fill.tsx +26 -0
  391. package/src/shared/icons/components/phone-in-talk.tsx +11 -0
  392. package/src/shared/icons/components/phone-incoming-fill.tsx +11 -0
  393. package/src/shared/icons/components/phone-incoming.tsx +11 -0
  394. package/src/shared/icons/components/phone-missed-fill.tsx +26 -0
  395. package/src/shared/icons/components/phone-missed.tsx +11 -0
  396. package/src/shared/icons/components/phone-outgoing-fill.tsx +15 -0
  397. package/src/shared/icons/components/phone-outgoing.tsx +15 -0
  398. package/src/shared/icons/components/photo-camera-fill.tsx +26 -0
  399. package/src/shared/icons/components/photo-camera.tsx +11 -0
  400. package/src/shared/icons/components/photo-fill.tsx +26 -0
  401. package/src/shared/icons/components/photo.tsx +11 -0
  402. package/src/shared/icons/components/play-arrow-fill.tsx +26 -0
  403. package/src/shared/icons/components/play-arrow.tsx +11 -0
  404. package/src/shared/icons/components/play-circle-fill.tsx +26 -0
  405. package/src/shared/icons/components/play-circle.tsx +11 -0
  406. package/src/shared/icons/components/poll-Icon.tsx +10 -0
  407. package/src/shared/icons/components/poll-fill.tsx +11 -0
  408. package/src/shared/icons/components/poll.tsx +11 -0
  409. package/src/shared/icons/components/presentation-file-type.tsx +38 -0
  410. package/src/shared/icons/components/rearrange-fill.tsx +13 -0
  411. package/src/shared/icons/components/rearrange.tsx +13 -0
  412. package/src/shared/icons/components/refresh-fill.tsx +26 -0
  413. package/src/shared/icons/components/refresh.tsx +11 -0
  414. package/src/shared/icons/components/reply-all-fill.tsx +26 -0
  415. package/src/shared/icons/components/reply-all.tsx +11 -0
  416. package/src/shared/icons/components/reply-fill.tsx +26 -0
  417. package/src/shared/icons/components/reply.tsx +11 -0
  418. package/src/shared/icons/components/retry-fill.tsx +11 -0
  419. package/src/shared/icons/components/retry.tsx +11 -0
  420. package/src/shared/icons/components/schedule-fill.tsx +26 -0
  421. package/src/shared/icons/components/schedule.tsx +11 -0
  422. package/src/shared/icons/components/screen-share-fill.tsx +26 -0
  423. package/src/shared/icons/components/screen-share.tsx +11 -0
  424. package/src/shared/icons/components/search-fill.tsx +26 -0
  425. package/src/shared/icons/components/search.tsx +11 -0
  426. package/src/shared/icons/components/send-fill.tsx +26 -0
  427. package/src/shared/icons/components/send.tsx +11 -0
  428. package/src/shared/icons/components/settings-fill.tsx +26 -0
  429. package/src/shared/icons/components/settings.tsx +11 -0
  430. package/src/shared/icons/components/share-fill.tsx +26 -0
  431. package/src/shared/icons/components/share.tsx +11 -0
  432. package/src/shared/icons/components/shield-fill.tsx +11 -0
  433. package/src/shared/icons/components/shield.tsx +11 -0
  434. package/src/shared/icons/components/smileys-&-people.tsx +18 -0
  435. package/src/shared/icons/components/spreadsheet-file-type.tsx +38 -0
  436. package/src/shared/icons/components/star-fill.tsx +26 -0
  437. package/src/shared/icons/components/star.tsx +11 -0
  438. package/src/shared/icons/components/sticker-fill.tsx +12 -0
  439. package/src/shared/icons/components/sticker.tsx +11 -0
  440. package/src/shared/icons/components/stop-circle-fill.tsx +26 -0
  441. package/src/shared/icons/components/stop-circle.tsx +11 -0
  442. package/src/shared/icons/components/stop-fill.tsx +26 -0
  443. package/src/shared/icons/components/stop-screen-share-fill.tsx +26 -0
  444. package/src/shared/icons/components/stop-screen-share.tsx +11 -0
  445. package/src/shared/icons/components/stop.tsx +11 -0
  446. package/src/shared/icons/components/subdirectory-arrow-left-fill.tsx +26 -0
  447. package/src/shared/icons/components/subdirectory-arrow-left.tsx +11 -0
  448. package/src/shared/icons/components/subdirectory-arrow-right-fill.tsx +26 -0
  449. package/src/shared/icons/components/subdirectory-arrow-right.tsx +11 -0
  450. package/src/shared/icons/components/sunny-fill.tsx +26 -0
  451. package/src/shared/icons/components/sunny.tsx +11 -0
  452. package/src/shared/icons/components/symbols.tsx +15 -0
  453. package/src/shared/icons/components/text-file-type.tsx +35 -0
  454. package/src/shared/icons/components/thumb-down-fill.tsx +26 -0
  455. package/src/shared/icons/components/thumb-down.tsx +11 -0
  456. package/src/shared/icons/components/thumb-up-fill.tsx +26 -0
  457. package/src/shared/icons/components/thumb-up.tsx +11 -0
  458. package/src/shared/icons/components/translate-fill.tsx +11 -0
  459. package/src/shared/icons/components/translate.tsx +11 -0
  460. package/src/shared/icons/components/travel-&-places.tsx +18 -0
  461. package/src/shared/icons/components/unknown-file-type.tsx +38 -0
  462. package/src/shared/icons/components/upload-fill.tsx +11 -0
  463. package/src/shared/icons/components/upload.tsx +11 -0
  464. package/src/shared/icons/components/user-empty-icon.tsx +26 -0
  465. package/src/shared/icons/components/video-call-fill.tsx +26 -0
  466. package/src/shared/icons/components/video-call.tsx +11 -0
  467. package/src/shared/icons/components/video-file-type.tsx +38 -0
  468. package/src/shared/icons/components/videocam-fill.tsx +26 -0
  469. package/src/shared/icons/components/videocam-off-fill.tsx +26 -0
  470. package/src/shared/icons/components/videocam-off.tsx +11 -0
  471. package/src/shared/icons/components/videocam.tsx +11 -0
  472. package/src/shared/icons/components/visibility-off-fill.tsx +11 -0
  473. package/src/shared/icons/components/visibility-off.tsx +11 -0
  474. package/src/shared/icons/components/volume-down-fill.tsx +26 -0
  475. package/src/shared/icons/components/volume-down.tsx +11 -0
  476. package/src/shared/icons/components/volume-mute-fill.tsx +26 -0
  477. package/src/shared/icons/components/volume-mute.tsx +11 -0
  478. package/src/shared/icons/components/volume-off-fill.tsx +26 -0
  479. package/src/shared/icons/components/volume-off.tsx +11 -0
  480. package/src/shared/icons/components/volume-up-fill.tsx +26 -0
  481. package/src/shared/icons/components/volume-up.tsx +11 -0
  482. package/src/shared/icons/components/warning-fill.tsx +26 -0
  483. package/src/shared/icons/components/warning.tsx +11 -0
  484. package/src/shared/icons/components/wifi-fill.tsx +26 -0
  485. package/src/shared/icons/components/wifi.tsx +11 -0
  486. package/src/shared/icons/components/zip-file-type.tsx +38 -0
  487. package/src/shared/icons/components/zoom-in-map-fill.tsx +26 -0
  488. package/src/shared/icons/components/zoom-in-map.tsx +11 -0
  489. package/src/shared/icons/components/zoom-out-map-fill.tsx +26 -0
  490. package/src/shared/icons/components/zoom-out-map.tsx +11 -0
  491. package/src/shared/icons/icon-mapping.tsx +620 -0
  492. package/src/shared/index.ts +116 -337
  493. package/src/shared/libs/ImageZoom/ReactNativeZoomableView.tsx +0 -1
  494. package/src/shared/libs/ImageZoom/ReactNativeZoomableViewWithGestures.tsx +19 -26
  495. package/src/shared/libs/ImageZoom/helper.ts +11 -27
  496. package/src/shared/libs/ImageZoom/index.tsx +4 -7
  497. package/src/shared/libs/ImageZoom/types/index.ts +7 -17
  498. package/src/shared/libs/VideoPlayer/VideoResizeMode.js +1 -1
  499. package/src/shared/modals/CometChatMessageOption.ts +11 -8
  500. package/src/shared/modals/CometChatMessageTemplate.ts +180 -140
  501. package/src/shared/modals/index.ts +2 -57
  502. package/src/shared/resources/CometChatLocalize/CometChatLocalize.ts +153 -151
  503. package/src/shared/resources/CometChatLocalize/index.ts +2 -8
  504. package/src/shared/resources/CometChatLocalize/resources/ar/translation.json +446 -316
  505. package/src/shared/resources/CometChatLocalize/resources/de/translation.json +446 -317
  506. package/src/shared/resources/CometChatLocalize/resources/en/translation.json +446 -316
  507. package/src/shared/resources/CometChatLocalize/resources/es/translation.json +446 -317
  508. package/src/shared/resources/CometChatLocalize/resources/fr/translation.json +445 -317
  509. package/src/shared/resources/CometChatLocalize/resources/hi/translation.json +446 -316
  510. package/src/shared/resources/CometChatLocalize/resources/hu/translation.json +445 -316
  511. package/src/shared/resources/CometChatLocalize/resources/lt/translation.json +446 -317
  512. package/src/shared/resources/CometChatLocalize/resources/ms/translation.json +446 -317
  513. package/src/shared/resources/CometChatLocalize/resources/pt/translation.json +446 -317
  514. package/src/shared/resources/CometChatLocalize/resources/ru/translation.json +446 -317
  515. package/src/shared/resources/CometChatLocalize/resources/sv/translation.json +446 -317
  516. package/src/shared/resources/CometChatLocalize/resources/zh/translation.json +446 -317
  517. package/src/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +445 -317
  518. package/src/shared/resources/CometChatSoundManager/index.ts +1 -2
  519. package/src/shared/resources/index.ts +1 -9
  520. package/src/shared/utils/CometChatMessageHelper/index.ts +16 -14
  521. package/src/shared/utils/CometChatMessagePreview/CometChatMessagePreview.tsx +50 -0
  522. package/src/shared/utils/CometChatMessagePreview/MessagePreviewStyle.js +1 -1
  523. package/src/shared/utils/CometChatMessagePreview/index.ts +1 -5
  524. package/src/shared/utils/CometChatMessagePreview/resources/index.ts +1 -4
  525. package/src/shared/utils/CometChatMessagePreview/style.ts +45 -0
  526. package/src/shared/utils/CommonUtils.ts +163 -172
  527. package/src/shared/utils/MessageUtils.tsx +349 -148
  528. package/src/shared/utils/NetworkUtils.tsx +32 -24
  529. package/src/shared/utils/PermissionUtil.ts +30 -30
  530. package/src/shared/utils/conversationUtils.ts +93 -86
  531. package/src/shared/utils/index.ts +4 -25
  532. package/src/shared/views/CometChatAICard/CometChatAICard.tsx +100 -66
  533. package/src/shared/views/CometChatAICard/resources/index.ts +2 -4
  534. package/src/shared/views/CometChatActionSheet/ActionItem.ts +12 -57
  535. package/src/shared/views/CometChatActionSheet/CometChatActionSheet.tsx +68 -249
  536. package/src/shared/views/CometChatActionSheet/hooks.ts +5 -3
  537. package/src/shared/views/CometChatActionSheet/index.ts +1 -4
  538. package/src/shared/views/CometChatActionSheet/resources/index.ts +5 -7
  539. package/src/shared/views/CometChatActionSheet/style.ts +2 -41
  540. package/src/shared/views/CometChatAudioBubble/AnimatedAudioWaves.tsx +131 -0
  541. package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +211 -189
  542. package/src/shared/views/CometChatAudioBubble/index.ts +10 -10
  543. package/src/shared/views/CometChatAudioBubble/resources/index.ts +2 -7
  544. package/src/shared/views/CometChatAudioBubble/style.ts +203 -27
  545. package/src/shared/views/CometChatAvatar/CometChatAvatar.tsx +46 -103
  546. package/src/shared/views/CometChatAvatar/index.ts +3 -9
  547. package/src/shared/views/CometChatAvatar/styles.ts +37 -24
  548. package/src/shared/views/CometChatBadge/CometChatBadge.tsx +46 -53
  549. package/src/shared/views/CometChatBadge/index.ts +4 -8
  550. package/src/shared/views/CometChatBadge/styles.ts +29 -16
  551. package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +164 -129
  552. package/src/shared/views/CometChatBottomSheet/index.ts +2 -5
  553. package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialog.tsx +174 -110
  554. package/src/shared/views/CometChatConfirmDialog/index.ts +2 -9
  555. package/src/shared/views/CometChatConfirmDialog/style.ts +121 -62
  556. package/src/shared/views/CometChatDate/CometChatDate.tsx +43 -169
  557. package/src/shared/views/CometChatDate/index.ts +4 -12
  558. package/src/shared/views/CometChatDate/styles.ts +36 -0
  559. package/src/shared/views/CometChatDateSeperator/CometChatDateSeparator.tsx +54 -0
  560. package/src/shared/views/CometChatDateSeperator/index.ts +6 -0
  561. package/src/shared/views/CometChatDateSeperator/styles.ts +52 -0
  562. package/src/shared/views/CometChatDeletedBubble/CometChatDeletedBubble.tsx +54 -0
  563. package/src/shared/views/CometChatDeletedBubble/index.ts +5 -0
  564. package/src/shared/views/CometChatDeletedBubble/styles.ts +42 -0
  565. package/src/shared/views/CometChatEmojiKeyboard/CometChatEmojiKeyboard.tsx +284 -205
  566. package/src/shared/views/CometChatEmojiKeyboard/Emoji.ts +1 -1
  567. package/src/shared/views/CometChatEmojiKeyboard/EmojiCategory.ts +1 -1
  568. package/src/shared/views/CometChatEmojiKeyboard/emojis.ts +169 -1405
  569. package/src/shared/views/CometChatEmojiKeyboard/index.ts +1 -3
  570. package/src/shared/views/CometChatEmojiKeyboard/resources/index.ts +8 -16
  571. package/src/shared/views/CometChatEmojiKeyboard/style.ts +72 -61
  572. package/src/shared/views/CometChatFileBubble/CometChatFileBubble.tsx +227 -167
  573. package/src/shared/views/CometChatFileBubble/index.ts +10 -6
  574. package/src/shared/views/CometChatFileBubble/resources/index.ts +1 -6
  575. package/src/shared/views/CometChatFileBubble/style.ts +120 -47
  576. package/src/shared/views/CometChatImageBubble/CometChatImageBubble.tsx +69 -252
  577. package/src/shared/views/CometChatImageBubble/CometChatImageLoader.tsx +183 -0
  578. package/src/shared/views/CometChatImageBubble/assets/index.ts +1 -5
  579. package/src/shared/views/CometChatImageBubble/index.ts +7 -9
  580. package/src/shared/views/CometChatImageViewerModal/ImageViewerModal.tsx +28 -43
  581. package/src/shared/views/CometChatImageViewerModal/index.tsx +1 -1
  582. package/src/shared/views/CometChatImageViewerModal/resources/index.ts +1 -2
  583. package/src/shared/views/CometChatList/CometChatList.tsx +696 -726
  584. package/src/shared/views/CometChatList/Header.tsx +271 -111
  585. package/src/shared/views/CometChatList/index.ts +7 -4
  586. package/src/shared/views/CometChatList/resources/index.ts +4 -13
  587. package/src/shared/views/CometChatList/styles.ts +59 -44
  588. package/src/shared/views/CometChatListItem/CometChatListItem.tsx +221 -261
  589. package/src/shared/views/CometChatListItem/index.ts +3 -15
  590. package/src/shared/views/CometChatListItem/style.ts +25 -29
  591. package/src/shared/views/CometChatMediaRecorder/AnimatingMic.tsx +129 -0
  592. package/src/shared/views/CometChatMediaRecorder/CometChatAudioPlayer.tsx +115 -0
  593. package/src/shared/views/CometChatMediaRecorder/CometChatAudioPreview/CometChatAudioPreview.tsx +233 -0
  594. package/src/shared/views/CometChatMediaRecorder/CometChatMediaRecorder.tsx +359 -284
  595. package/src/shared/views/CometChatMediaRecorder/Timer.tsx +83 -0
  596. package/src/shared/views/CometChatMediaRecorder/index.ts +4 -10
  597. package/src/shared/views/CometChatMediaRecorder/style.ts +69 -23
  598. package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +135 -126
  599. package/src/shared/views/CometChatMessageBubble/index.ts +2 -5
  600. package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +78 -105
  601. package/src/shared/views/CometChatMessageInput/index.ts +10 -3
  602. package/src/shared/views/CometChatMessageInput/styles.ts +2 -2
  603. package/src/shared/views/CometChatQuickReactions/CometChatQuickReactions.tsx +77 -71
  604. package/src/shared/views/CometChatQuickReactions/QuickReactionsStyle.tsx +33 -33
  605. package/src/shared/views/CometChatQuickReactions/index.ts +4 -5
  606. package/src/shared/views/CometChatQuickReactions/resources/index.ts +1 -2
  607. package/src/shared/views/CometChatReactionList/CometChatReactionList.tsx +477 -308
  608. package/src/shared/views/CometChatReactionList/ReactionListStyle.tsx +152 -64
  609. package/src/shared/views/CometChatReactionList/Skeleton.tsx +143 -0
  610. package/src/shared/views/CometChatReactionList/index.ts +6 -5
  611. package/src/shared/views/CometChatReactionList/resources/index.ts +1 -4
  612. package/src/shared/views/CometChatReactions/CometChatReactions.tsx +132 -172
  613. package/src/shared/views/CometChatReactions/index.ts +7 -14
  614. package/src/shared/views/CometChatReactions/style.ts +193 -41
  615. package/src/shared/views/CometChatReceipt/CometChatReceipt.tsx +85 -82
  616. package/src/shared/views/CometChatReceipt/index.ts +3 -11
  617. package/src/shared/views/CometChatReceipt/resources/blue-double-tick-icon.png +0 -0
  618. package/src/shared/views/CometChatReceipt/resources/error.png +0 -0
  619. package/src/shared/views/CometChatReceipt/resources/grey-double-tick-icon.png +0 -0
  620. package/src/shared/views/CometChatReceipt/resources/grey-tick-icon.png +0 -0
  621. package/src/shared/views/CometChatReceipt/resources/index.ts +5 -10
  622. package/src/shared/views/CometChatReceipt/resources/sending.png +0 -0
  623. package/src/shared/views/CometChatReceipt/style.ts +50 -9
  624. package/src/shared/views/CometChatStatusIndicator/CometChatStatusIndicator.tsx +67 -63
  625. package/src/shared/views/CometChatStatusIndicator/index.ts +6 -22
  626. package/src/shared/views/CometChatStatusIndicator/private.png +0 -0
  627. package/src/shared/views/CometChatStatusIndicator/protected.png +0 -0
  628. package/src/shared/views/CometChatStatusIndicator/styles.ts +59 -14
  629. package/src/shared/views/CometChatSuggestionList/CometChatSuggestionList.tsx +97 -56
  630. package/src/shared/views/CometChatSuggestionList/Skeleton.tsx +185 -0
  631. package/src/shared/views/CometChatSuggestionList/SuggestionItem.ts +44 -46
  632. package/src/shared/views/CometChatSuggestionList/index.ts +3 -7
  633. package/src/shared/views/CometChatSuggestionList/style.ts +69 -0
  634. package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +121 -96
  635. package/src/shared/views/CometChatTextBubble/index.ts +8 -7
  636. package/src/shared/views/CometChatTooltipMenu/CometChatTooltipMenu.tsx +202 -0
  637. package/src/shared/views/CometChatTooltipMenu/index.ts +4 -0
  638. package/src/shared/views/CometChatTooltipMenu/styles.ts +24 -0
  639. package/src/shared/views/CometChatVideoBubble/CometChatVideoBubble.tsx +175 -195
  640. package/src/shared/views/CometChatVideoBubble/index.ts +7 -9
  641. package/src/shared/views/CometChatVideoBubble/resources/index.ts +2 -7
  642. package/src/shared/views/CometChatVideoBubble/style.ts +101 -5
  643. package/src/shared/views/CometChatVideoPlayer/CometChatVideoPlayer.tsx +154 -91
  644. package/src/shared/views/CometChatVideoPlayer/index.tsx +1 -1
  645. package/src/shared/views/ErrorEmptyView/ErrorEmptyView.tsx +62 -0
  646. package/src/shared/views/index.ts +74 -218
  647. package/src/theme/CometChatThemeHelper.ts +427 -0
  648. package/src/theme/context.ts +20 -0
  649. package/src/theme/default/color/dark.ts +99 -0
  650. package/src/theme/default/color/light.ts +105 -0
  651. package/src/theme/default/index.ts +242 -0
  652. package/src/theme/default/resources/icons/Base_Icon.png +0 -0
  653. package/src/theme/default/resources/icons/collaborative_document_1x.png +0 -0
  654. package/src/theme/default/resources/icons/collaborative_document_2x.png +0 -0
  655. package/src/theme/default/resources/icons/collaborative_document_3x.png +0 -0
  656. package/src/theme/default/resources/icons/collaborative_whiteboard_1x.png +0 -0
  657. package/src/theme/default/resources/icons/collaborative_whiteboard_2x.png +0 -0
  658. package/src/theme/default/resources/icons/collaborative_whiteboard_3x.png +0 -0
  659. package/src/theme/default/resources/icons/dark_error_icon.png +0 -0
  660. package/src/theme/default/resources/icons/index.ts +19 -0
  661. package/src/theme/default/resources/icons/light_error_icon.png +0 -0
  662. package/src/theme/default/resources/icons/thread_replies.png +0 -0
  663. package/src/theme/default/spacing.ts +86 -0
  664. package/src/theme/default/typography.ts +184 -0
  665. package/src/theme/hook.ts +19 -0
  666. package/src/theme/index.ts +3 -0
  667. package/src/theme/provider.tsx +135 -0
  668. package/src/theme/type.ts +446 -0
  669. package/screenshots/logo.png +0 -0
  670. package/src/AI/AIAssistBot/AIAssistBotDecorator.tsx +0 -166
  671. package/src/AI/AIAssistBot/AIAssistBotExtension.tsx +0 -22
  672. package/src/AI/AIAssistBot/AIAssistBotStyle.ts +0 -43
  673. package/src/AI/AIAssistBot/AIAssistBotView.tsx +0 -297
  674. package/src/AI/AIAssistBot/configuration.ts +0 -23
  675. package/src/AI/AIAssistBot/resources/CloseIcon.png +0 -0
  676. package/src/AI/AIAssistBot/resources/index.ts +0 -6
  677. package/src/AI/AIBaseConfiguration.ts +0 -15
  678. package/src/AI/AIBaseStyle.ts +0 -58
  679. package/src/AI/AIConversationStarter/AIConversationStarter.ts +0 -19
  680. package/src/AI/AIConversationStarter/AIConversationStarterDecorator.tsx +0 -249
  681. package/src/AI/AIConversationStarter/AIConversationStarterStyle.ts +0 -14
  682. package/src/AI/AIConversationStarter/configuration.ts +0 -11
  683. package/src/AI/AIConversationStarter/style.ts +0 -74
  684. package/src/AI/AIConversationSummary/AIConversationSummaryDecorator.tsx +0 -179
  685. package/src/AI/AIConversationSummary/AIConversationSummaryExtension.ts +0 -21
  686. package/src/AI/AIConversationSummary/AIConversationSummaryStyle.tsx +0 -20
  687. package/src/AI/AIConversationSummary/AIConversationSummaryView.tsx +0 -195
  688. package/src/AI/AIConversationSummary/configuration.ts +0 -14
  689. package/src/AI/AIConversationSummary/resources/index.ts +0 -6
  690. package/src/AI/AIExtensionDataSource.ts +0 -18
  691. package/src/AI/AIOptionsStyle.ts +0 -14
  692. package/src/AI/AISmartReplies/AISmartReplies.ts +0 -19
  693. package/src/AI/AISmartReplies/AISmartRepliesDecorator.tsx +0 -306
  694. package/src/AI/AISmartReplies/AISmartRepliesStyle.ts +0 -16
  695. package/src/AI/AISmartReplies/configuration.ts +0 -12
  696. package/src/AI/CardView.tsx +0 -83
  697. package/src/AI/CardViewStyle.ts +0 -37
  698. package/src/AI/resources/ai-empty.png +0 -0
  699. package/src/AI/resources/ai-error.png +0 -0
  700. package/src/AI/resources/index.ts +0 -12
  701. package/src/AI/resources/spineer.png +0 -0
  702. package/src/AI/style.ts +0 -165
  703. package/src/AI/utils.ts +0 -39
  704. package/src/CometChatAddMembers/AddMembersConfiguration.tsx +0 -58
  705. package/src/CometChatAddMembers/CometChatAddMembers.tsx +0 -114
  706. package/src/CometChatAddMembers/index.ts +0 -10
  707. package/src/CometChatBannedMembers/BannedMembersConfiguration.tsx +0 -61
  708. package/src/CometChatBannedMembers/CometChatBannedMembers.tsx +0 -148
  709. package/src/CometChatBannedMembers/index.ts +0 -13
  710. package/src/CometChatBannedMembers/resources/clear.png +0 -0
  711. package/src/CometChatBannedMembers/resources/index.ts +0 -4
  712. package/src/CometChatContacts/CometChatContacts.tsx +0 -229
  713. package/src/CometChatContacts/ContactsConfiguration.tsx +0 -69
  714. package/src/CometChatContacts/ContactsStyle.ts +0 -60
  715. package/src/CometChatContacts/Header.tsx +0 -167
  716. package/src/CometChatContacts/index.ts +0 -13
  717. package/src/CometChatContacts/styles.ts +0 -105
  718. package/src/CometChatConversations/ConversationsConfiguration.ts +0 -226
  719. package/src/CometChatConversations/ConversationsStyle.ts +0 -88
  720. package/src/CometChatConversationsWithMessages/CometChatConversationsWithMessages.tsx +0 -229
  721. package/src/CometChatConversationsWithMessages/index.ts +0 -6
  722. package/src/CometChatConversationsWithMessages/resources/index.ts +0 -6
  723. package/src/CometChatConversationsWithMessages/resources/start.png +0 -0
  724. package/src/CometChatConversationsWithMessages/styles.ts +0 -15
  725. package/src/CometChatCreateGroup/CometChatCreateGroup.tsx +0 -382
  726. package/src/CometChatCreateGroup/CreateGroupConfiguration.ts +0 -36
  727. package/src/CometChatCreateGroup/Header.tsx +0 -60
  728. package/src/CometChatCreateGroup/index.ts +0 -15
  729. package/src/CometChatCreateGroup/resources/close.png +0 -0
  730. package/src/CometChatCreateGroup/resources/index.ts +0 -11
  731. package/src/CometChatCreateGroup/resources/rightTick.png +0 -0
  732. package/src/CometChatCreateGroup/resources/warning.png +0 -0
  733. package/src/CometChatCreateGroup/style.ts +0 -44
  734. package/src/CometChatDetails/CometChatDetails.tsx +0 -1026
  735. package/src/CometChatDetails/DetailsConfiguration.tsx +0 -72
  736. package/src/CometChatDetails/Header.tsx +0 -42
  737. package/src/CometChatDetails/index.ts +0 -19
  738. package/src/CometChatDetails/listners.ts +0 -109
  739. package/src/CometChatDetails/resources/close.png +0 -0
  740. package/src/CometChatDetails/resources/index.ts +0 -17
  741. package/src/CometChatDetails/styles.ts +0 -23
  742. package/src/CometChatGroupMembers/GroupMemberConfiguration.ts +0 -118
  743. package/src/CometChatGroupMembers/GroupMemberStyle.ts +0 -91
  744. package/src/CometChatGroupMembers/GroupScopeStyle.ts +0 -68
  745. package/src/CometChatGroups/GroupsConfiguration.ts +0 -93
  746. package/src/CometChatGroupsWithMessages/CometChatGroupsWithMessages.tsx +0 -231
  747. package/src/CometChatGroupsWithMessages/index.ts +0 -6
  748. package/src/CometChatGroupsWithMessages/resources/index.ts +0 -5
  749. package/src/CometChatGroupsWithMessages/resources/write.png +0 -0
  750. package/src/CometChatGroupsWithMessages/styles.ts +0 -15
  751. package/src/CometChatJoinProtectedGroup/CometChatJoinProtectedGroup.tsx +0 -268
  752. package/src/CometChatJoinProtectedGroup/Header.tsx +0 -52
  753. package/src/CometChatJoinProtectedGroup/JoinProtectedGroupConfiguration.ts +0 -30
  754. package/src/CometChatJoinProtectedGroup/index.ts +0 -15
  755. package/src/CometChatJoinProtectedGroup/resources/close.png +0 -0
  756. package/src/CometChatJoinProtectedGroup/resources/index.ts +0 -8
  757. package/src/CometChatJoinProtectedGroup/resources/rightTick.png +0 -0
  758. package/src/CometChatJoinProtectedGroup/style.ts +0 -11
  759. package/src/CometChatMessageComposer/MessageComposerConfiguration.tsx +0 -96
  760. package/src/CometChatMessageComposer/styles.ts +0 -28
  761. package/src/CometChatMessageHeader/MessageHeaderConfiguration.tsx +0 -62
  762. package/src/CometChatMessageHeader/resources/Back.png +0 -0
  763. package/src/CometChatMessageHeader/resources/index.ts +0 -11
  764. package/src/CometChatMessageHeader/resources/password.png +0 -0
  765. package/src/CometChatMessageHeader/resources/private.png +0 -0
  766. package/src/CometChatMessageInformation/MessageInformationConfiguration.tsx +0 -32
  767. package/src/CometChatMessageInformation/MessageInformationStyle.ts +0 -12
  768. package/src/CometChatMessageList/MessageListConfiguration.ts +0 -250
  769. package/src/CometChatMessageList/MessageListStyle.ts +0 -75
  770. package/src/CometChatMessages/CometChatMessages.tsx +0 -344
  771. package/src/CometChatMessages/MessageStyle.ts +0 -34
  772. package/src/CometChatMessages/MessagesConfiguration.ts +0 -55
  773. package/src/CometChatMessages/index.ts +0 -16
  774. package/src/CometChatMessages/resources/index.ts +0 -6
  775. package/src/CometChatMessages/resources/info.png +0 -0
  776. package/src/CometChatMessages/style.ts +0 -23
  777. package/src/CometChatTabs/CometChatTabs.tsx +0 -178
  778. package/src/CometChatTabs/CometChatTabsStyle.ts +0 -45
  779. package/src/CometChatTabs/TabItemStyle.ts +0 -55
  780. package/src/CometChatTabs/TabItems.ts +0 -11
  781. package/src/CometChatTabs/index.ts +0 -6
  782. package/src/CometChatThreadedMessages/CometChatThreadedMessages.tsx +0 -349
  783. package/src/CometChatThreadedMessages/Header.tsx +0 -57
  784. package/src/CometChatThreadedMessages/ThreadedMessagesConfiguration.ts +0 -45
  785. package/src/CometChatThreadedMessages/index.ts +0 -15
  786. package/src/CometChatThreadedMessages/resources/Back.png +0 -0
  787. package/src/CometChatThreadedMessages/resources/close.png +0 -0
  788. package/src/CometChatThreadedMessages/resources/index.ts +0 -20
  789. package/src/CometChatThreadedMessages/resources/password.png +0 -0
  790. package/src/CometChatThreadedMessages/resources/private.png +0 -0
  791. package/src/CometChatThreadedMessages/resources/right-arrow.png +0 -0
  792. package/src/CometChatThreadedMessages/style.ts +0 -29
  793. package/src/CometChatTransferOwnership/CometChatTransferOwnership.tsx +0 -145
  794. package/src/CometChatTransferOwnership/TransferOwnershipConfiguration.ts +0 -60
  795. package/src/CometChatTransferOwnership/index.ts +0 -14
  796. package/src/CometChatUsers/UsersConfiguration.tsx +0 -59
  797. package/src/CometChatUsers/UsersStyle.ts +0 -101
  798. package/src/CometChatUsersWithMessages/CometChatUsersWithMessages.tsx +0 -130
  799. package/src/CometChatUsersWithMessages/index.ts +0 -6
  800. package/src/CometChatUsersWithMessages/styles.ts +0 -15
  801. package/src/calls/CallingDetailsUtils.tsx +0 -158
  802. package/src/calls/CallingExtentionDecorator.tsx +0 -222
  803. package/src/calls/CometChatCallBubble/CallBubbleConfiguration.ts +0 -23
  804. package/src/calls/CometChatCallBubble/CallBubbleStyle.ts +0 -47
  805. package/src/calls/CometChatCallButtons/CallButtonStyle.ts +0 -35
  806. package/src/calls/CometChatCallButtons/resources/Call.png +0 -0
  807. package/src/calls/CometChatCallButtons/resources/Video.png +0 -0
  808. package/src/calls/CometChatCallButtons/resources/index.ts +0 -9
  809. package/src/calls/CometChatCallLogDetails/CallLogDetailsConfiguration.ts +0 -118
  810. package/src/calls/CometChatCallLogDetails/CallLogDetailsStyle.ts +0 -36
  811. package/src/calls/CometChatCallLogDetails/CometChatCallLogDetails.tsx +0 -309
  812. package/src/calls/CometChatCallLogDetails/index.ts +0 -23
  813. package/src/calls/CometChatCallLogDetails/resources/CloseIcon.png +0 -0
  814. package/src/calls/CometChatCallLogDetails/resources/index.ts +0 -5
  815. package/src/calls/CometChatCallLogDetails/style.ts +0 -15
  816. package/src/calls/CometChatCallLogHistory/CallLogHistoryConfiguration.ts +0 -67
  817. package/src/calls/CometChatCallLogHistory/CallLogHistoryStyle.ts +0 -46
  818. package/src/calls/CometChatCallLogHistory/CometChatCallLogHistory.tsx +0 -350
  819. package/src/calls/CometChatCallLogHistory/index.ts +0 -23
  820. package/src/calls/CometChatCallLogHistory/resources/Back.png +0 -0
  821. package/src/calls/CometChatCallLogHistory/resources/Call.png +0 -0
  822. package/src/calls/CometChatCallLogHistory/resources/Info.png +0 -0
  823. package/src/calls/CometChatCallLogHistory/resources/Selection.png +0 -0
  824. package/src/calls/CometChatCallLogHistory/resources/Spineer.png +0 -0
  825. package/src/calls/CometChatCallLogHistory/resources/Video.png +0 -0
  826. package/src/calls/CometChatCallLogHistory/resources/check.png +0 -0
  827. package/src/calls/CometChatCallLogHistory/resources/incomingcall.png +0 -0
  828. package/src/calls/CometChatCallLogHistory/resources/incomingvideo.png +0 -0
  829. package/src/calls/CometChatCallLogHistory/resources/index.ts +0 -42
  830. package/src/calls/CometChatCallLogHistory/resources/missedcall.png +0 -0
  831. package/src/calls/CometChatCallLogHistory/resources/missedvideo.png +0 -0
  832. package/src/calls/CometChatCallLogHistory/resources/outgoingcall.png +0 -0
  833. package/src/calls/CometChatCallLogHistory/resources/outgoingvideo.png +0 -0
  834. package/src/calls/CometChatCallLogHistory/style.ts +0 -24
  835. package/src/calls/CometChatCallLogParticipants/CallLogParticipantsConfiguration.ts +0 -63
  836. package/src/calls/CometChatCallLogParticipants/CallLogParticipantsStyle.ts +0 -59
  837. package/src/calls/CometChatCallLogParticipants/CometChatCallLogParticipants.tsx +0 -221
  838. package/src/calls/CometChatCallLogParticipants/index.ts +0 -23
  839. package/src/calls/CometChatCallLogParticipants/resources/Back.png +0 -0
  840. package/src/calls/CometChatCallLogParticipants/resources/index.ts +0 -5
  841. package/src/calls/CometChatCallLogParticipants/style.ts +0 -24
  842. package/src/calls/CometChatCallLogRecordings/CallLogRecordingsConfiguration.ts +0 -65
  843. package/src/calls/CometChatCallLogRecordings/CallLogRecordingsStyle.ts +0 -63
  844. package/src/calls/CometChatCallLogRecordings/CometChatCallLogRecordings.tsx +0 -254
  845. package/src/calls/CometChatCallLogRecordings/index.ts +0 -23
  846. package/src/calls/CometChatCallLogRecordings/resources/Back.png +0 -0
  847. package/src/calls/CometChatCallLogRecordings/resources/download.png +0 -0
  848. package/src/calls/CometChatCallLogRecordings/resources/index.ts +0 -8
  849. package/src/calls/CometChatCallLogRecordings/style.ts +0 -24
  850. package/src/calls/CometChatCallLogs/CallLogsConfiguration.ts +0 -89
  851. package/src/calls/CometChatCallLogs/CallLogsStyle.ts +0 -95
  852. package/src/calls/CometChatCallLogsWithDetails/CallLogsWithDetailsConfiguration.ts +0 -10
  853. package/src/calls/CometChatCallLogsWithDetails/CometChatCallLogsWithDetails.tsx +0 -56
  854. package/src/calls/CometChatCallLogsWithDetails/index.ts +0 -5
  855. package/src/calls/CometChatCallLogsWithDetails/style.ts +0 -11
  856. package/src/calls/CometChatIncomingCall/IncomingCallStyle.ts +0 -75
  857. package/src/calls/CometChatIncomingCall/styles.ts +0 -10
  858. package/src/calls/CometChatOngoingCall/OngoingCallStyle.ts +0 -25
  859. package/src/calls/CometChatOutgoingCall/OutgoingCallStyle.ts +0 -39
  860. package/src/extensions/CollaborativeBubble/CollaborativeBubbleStyle.ts +0 -97
  861. package/src/extensions/CollaborativeBubble/styles.ts +0 -82
  862. package/src/extensions/CollaborativeDocument/CollaborativeDocumentConfiguration.tsx +0 -26
  863. package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardConfiguration.tsx +0 -26
  864. package/src/extensions/ImageModeration/ImageModerationDecorator.tsx +0 -82
  865. package/src/extensions/ImageModeration/ImageModerationExtension.tsx +0 -43
  866. package/src/extensions/ImageModeration/ImageModerationFilter.tsx +0 -145
  867. package/src/extensions/ImageModeration/index.ts +0 -18
  868. package/src/extensions/ImageModeration/resources/index.ts +0 -4
  869. package/src/extensions/ImageModeration/resources/unsafe.png +0 -0
  870. package/src/extensions/LinkPreview/LInkPreviewBubbleStyle.ts +0 -28
  871. package/src/extensions/LinkPreview/LinkPreviewConfiguration.ts +0 -27
  872. package/src/extensions/LinkPreview/LinkPreviewExtention.tsx +0 -25
  873. package/src/extensions/LinkPreview/LinkPreviewExtentionDecorator.tsx +0 -55
  874. package/src/extensions/SmartReplies/SmartRepliesDecorator.tsx +0 -144
  875. package/src/extensions/SmartReplies/SmartRepliesExtension.tsx +0 -52
  876. package/src/extensions/SmartReplies/SmartRepliesView.tsx +0 -213
  877. package/src/extensions/SmartReplies/index.ts +0 -7
  878. package/src/extensions/SmartReplies/resources/close.png +0 -0
  879. package/src/extensions/SmartReplies/resources/index.ts +0 -6
  880. package/src/extensions/Stickers/CometChatStickerKeyboard/StickerKeyboardStyle.ts +0 -52
  881. package/src/extensions/Stickers/StickerStyle.ts +0 -15
  882. package/src/extensions/TextModeration/TextModerationConfiguration.tsx +0 -25
  883. package/src/extensions/TextModeration/TextModerationExtension.tsx +0 -51
  884. package/src/extensions/TextModeration/TextModerationExtensionDecorator.tsx +0 -93
  885. package/src/extensions/TextModeration/index.ts +0 -6
  886. package/src/shared/CometChatContext.tsx +0 -43
  887. package/src/shared/helper/SwipeRow.js +0 -944
  888. package/src/shared/libs/CometChatCalendar/Calendars/BaseCalendar.tsx +0 -229
  889. package/src/shared/libs/CometChatCalendar/Calendars/DateSelectionCalendar.tsx +0 -90
  890. package/src/shared/libs/CometChatCalendar/Calendars/MultiDateSelectionCalendar.tsx +0 -108
  891. package/src/shared/libs/CometChatCalendar/Calendars/Providers.tsx +0 -27
  892. package/src/shared/libs/CometChatCalendar/Calendars/index.ts +0 -3
  893. package/src/shared/libs/CometChatCalendar/Components/Arrow.tsx +0 -46
  894. package/src/shared/libs/CometChatCalendar/Components/Day.tsx +0 -95
  895. package/src/shared/libs/CometChatCalendar/Components/Days.tsx +0 -110
  896. package/src/shared/libs/CometChatCalendar/Components/Month.tsx +0 -47
  897. package/src/shared/libs/CometChatCalendar/Components/Months.tsx +0 -79
  898. package/src/shared/libs/CometChatCalendar/Components/Title.tsx +0 -47
  899. package/src/shared/libs/CometChatCalendar/Components/Weekdays.tsx +0 -29
  900. package/src/shared/libs/CometChatCalendar/Components/index.ts +0 -7
  901. package/src/shared/libs/CometChatCalendar/Constants/View.ts +0 -4
  902. package/src/shared/libs/CometChatCalendar/Constants/index.ts +0 -1
  903. package/src/shared/libs/CometChatCalendar/Contexts/LocaleContext.tsx +0 -7
  904. package/src/shared/libs/CometChatCalendar/Contexts/ThemeContext.tsx +0 -7
  905. package/src/shared/libs/CometChatCalendar/Contexts/index.ts +0 -2
  906. package/src/shared/libs/CometChatCalendar/Entities/ArrowDirections.ts +0 -1
  907. package/src/shared/libs/CometChatCalendar/Entities/Calendar.ts +0 -26
  908. package/src/shared/libs/CometChatCalendar/Entities/Components.ts +0 -13
  909. package/src/shared/libs/CometChatCalendar/Entities/DateProperties.ts +0 -6
  910. package/src/shared/libs/CometChatCalendar/Entities/Locale.ts +0 -12
  911. package/src/shared/libs/CometChatCalendar/Entities/Theme.ts +0 -70
  912. package/src/shared/libs/CometChatCalendar/Entities/index.ts +0 -6
  913. package/src/shared/libs/CometChatCalendar/Hooks/index.ts +0 -1
  914. package/src/shared/libs/CometChatCalendar/Hooks/useSurroundingTimeUnits.ts +0 -63
  915. package/src/shared/libs/CometChatCalendar/Icons/BackArrow.png +0 -0
  916. package/src/shared/libs/CometChatCalendar/Icons/chevron-left-16.png +0 -0
  917. package/src/shared/libs/CometChatCalendar/Icons/index.ts +0 -7
  918. package/src/shared/libs/CometChatCalendar/Locales/index.ts +0 -4
  919. package/src/shared/libs/CometChatCalendar/Themes/Colors.ts +0 -31
  920. package/src/shared/libs/CometChatCalendar/Themes/DarkTheme.ts +0 -79
  921. package/src/shared/libs/CometChatCalendar/Themes/DefaultTheme.ts +0 -164
  922. package/src/shared/libs/CometChatCalendar/Themes/index.ts +0 -3
  923. package/src/shared/libs/CometChatCalendar/Utils/addOpacity.ts +0 -15
  924. package/src/shared/libs/CometChatCalendar/Utils/checkChangedProps.ts +0 -10
  925. package/src/shared/libs/CometChatCalendar/Utils/clamp.ts +0 -5
  926. package/src/shared/libs/CometChatCalendar/Utils/dateRange.ts +0 -23
  927. package/src/shared/libs/CometChatCalendar/Utils/getExtraDays.ts +0 -25
  928. package/src/shared/libs/CometChatCalendar/Utils/getSurroundingTimeUnits.ts +0 -20
  929. package/src/shared/libs/CometChatCalendar/Utils/index.ts +0 -6
  930. package/src/shared/libs/CometChatCalendar/index.ts +0 -5
  931. package/src/shared/libs/VideoPlayer/Video.js +0 -494
  932. package/src/shared/libs/VideoPlayerControls/OSSupport/PlatformSupport.tsx +0 -43
  933. package/src/shared/libs/VideoPlayerControls/OSSupport/TVOSSupport.tsx +0 -17
  934. package/src/shared/libs/VideoPlayerControls/OSSupport/index.tsx +0 -1
  935. package/src/shared/libs/VideoPlayerControls/VideoPlayer.tsx +0 -512
  936. package/src/shared/libs/VideoPlayerControls/assets/img/back.png +0 -0
  937. package/src/shared/libs/VideoPlayerControls/assets/img/bottom-vignette.png +0 -0
  938. package/src/shared/libs/VideoPlayerControls/assets/img/bottom-vignette@2x.png +0 -0
  939. package/src/shared/libs/VideoPlayerControls/assets/img/bottom-vignette@3x.png +0 -0
  940. package/src/shared/libs/VideoPlayerControls/assets/img/error-icon.png +0 -0
  941. package/src/shared/libs/VideoPlayerControls/assets/img/error-icon@2x.png +0 -0
  942. package/src/shared/libs/VideoPlayerControls/assets/img/error-icon@3x.png +0 -0
  943. package/src/shared/libs/VideoPlayerControls/assets/img/expand.png +0 -0
  944. package/src/shared/libs/VideoPlayerControls/assets/img/expand@2x.png +0 -0
  945. package/src/shared/libs/VideoPlayerControls/assets/img/expand@3x.png +0 -0
  946. package/src/shared/libs/VideoPlayerControls/assets/img/forward.png +0 -0
  947. package/src/shared/libs/VideoPlayerControls/assets/img/forward@2x.png +0 -0
  948. package/src/shared/libs/VideoPlayerControls/assets/img/forward@3x.png +0 -0
  949. package/src/shared/libs/VideoPlayerControls/assets/img/loader-icon.png +0 -0
  950. package/src/shared/libs/VideoPlayerControls/assets/img/loader-icon@2x.png +0 -0
  951. package/src/shared/libs/VideoPlayerControls/assets/img/loader-icon@3x.png +0 -0
  952. package/src/shared/libs/VideoPlayerControls/assets/img/pause.png +0 -0
  953. package/src/shared/libs/VideoPlayerControls/assets/img/pause@2x.png +0 -0
  954. package/src/shared/libs/VideoPlayerControls/assets/img/pause@3x.png +0 -0
  955. package/src/shared/libs/VideoPlayerControls/assets/img/play.png +0 -0
  956. package/src/shared/libs/VideoPlayerControls/assets/img/play@2x.png +0 -0
  957. package/src/shared/libs/VideoPlayerControls/assets/img/play@3x.png +0 -0
  958. package/src/shared/libs/VideoPlayerControls/assets/img/rewind.png +0 -0
  959. package/src/shared/libs/VideoPlayerControls/assets/img/rewind@2x.png +0 -0
  960. package/src/shared/libs/VideoPlayerControls/assets/img/rewind@3x.png +0 -0
  961. package/src/shared/libs/VideoPlayerControls/assets/img/shrink.png +0 -0
  962. package/src/shared/libs/VideoPlayerControls/assets/img/shrink@2x.png +0 -0
  963. package/src/shared/libs/VideoPlayerControls/assets/img/shrink@3x.png +0 -0
  964. package/src/shared/libs/VideoPlayerControls/assets/img/top-vignette.png +0 -0
  965. package/src/shared/libs/VideoPlayerControls/assets/img/top-vignette@2x.png +0 -0
  966. package/src/shared/libs/VideoPlayerControls/assets/img/top-vignette@3x.png +0 -0
  967. package/src/shared/libs/VideoPlayerControls/assets/img/volume.png +0 -0
  968. package/src/shared/libs/VideoPlayerControls/assets/img/volume@2x.png +0 -0
  969. package/src/shared/libs/VideoPlayerControls/assets/img/volume@3x.png +0 -0
  970. package/src/shared/libs/VideoPlayerControls/components/Back/Back.tsx +0 -28
  971. package/src/shared/libs/VideoPlayerControls/components/Back/index.ts +0 -1
  972. package/src/shared/libs/VideoPlayerControls/components/BottomControls.tsx +0 -142
  973. package/src/shared/libs/VideoPlayerControls/components/Control.tsx +0 -45
  974. package/src/shared/libs/VideoPlayerControls/components/Error/Error.tsx +0 -22
  975. package/src/shared/libs/VideoPlayerControls/components/Error/index.ts +0 -1
  976. package/src/shared/libs/VideoPlayerControls/components/Error/styles.ts +0 -21
  977. package/src/shared/libs/VideoPlayerControls/components/Fullscreen.tsx +0 -36
  978. package/src/shared/libs/VideoPlayerControls/components/Loader/Loader.tsx +0 -15
  979. package/src/shared/libs/VideoPlayerControls/components/Loader/index.ts +0 -1
  980. package/src/shared/libs/VideoPlayerControls/components/Loader/styles.ts +0 -16
  981. package/src/shared/libs/VideoPlayerControls/components/NullControl.tsx +0 -7
  982. package/src/shared/libs/VideoPlayerControls/components/Overlay.tsx +0 -23
  983. package/src/shared/libs/VideoPlayerControls/components/PlayPause/PlayPause.tsx +0 -109
  984. package/src/shared/libs/VideoPlayerControls/components/PlayPause/index.ts +0 -1
  985. package/src/shared/libs/VideoPlayerControls/components/PlayPause/styles.ts +0 -21
  986. package/src/shared/libs/VideoPlayerControls/components/Seekbar/Seekbar.tsx +0 -47
  987. package/src/shared/libs/VideoPlayerControls/components/Seekbar/index.ts +0 -1
  988. package/src/shared/libs/VideoPlayerControls/components/Seekbar/styles.ts +0 -37
  989. package/src/shared/libs/VideoPlayerControls/components/Timer/Timer.tsx +0 -28
  990. package/src/shared/libs/VideoPlayerControls/components/Timer/index.ts +0 -1
  991. package/src/shared/libs/VideoPlayerControls/components/Timer/styles.ts +0 -12
  992. package/src/shared/libs/VideoPlayerControls/components/Title.tsx +0 -35
  993. package/src/shared/libs/VideoPlayerControls/components/TopControls.tsx +0 -110
  994. package/src/shared/libs/VideoPlayerControls/components/Volume/Volume.tsx +0 -37
  995. package/src/shared/libs/VideoPlayerControls/components/Volume/index.ts +0 -1
  996. package/src/shared/libs/VideoPlayerControls/components/Volume/styles.ts +0 -31
  997. package/src/shared/libs/VideoPlayerControls/components/index.ts +0 -14
  998. package/src/shared/libs/VideoPlayerControls/components/styles.ts +0 -30
  999. package/src/shared/libs/VideoPlayerControls/hooks/index.ts +0 -3
  1000. package/src/shared/libs/VideoPlayerControls/hooks/useAnimations.ts +0 -68
  1001. package/src/shared/libs/VideoPlayerControls/hooks/useControlTimeout.tsx +0 -67
  1002. package/src/shared/libs/VideoPlayerControls/hooks/usePanResponders.tsx +0 -96
  1003. package/src/shared/libs/VideoPlayerControls/index.ts +0 -4
  1004. package/src/shared/libs/VideoPlayerControls/styles.ts +0 -19
  1005. package/src/shared/libs/VideoPlayerControls/types.ts +0 -290
  1006. package/src/shared/libs/VideoPlayerControls/utils.ts +0 -76
  1007. package/src/shared/libs/datePickerModal/DateTimePickerModal.android.js +0 -75
  1008. package/src/shared/libs/datePickerModal/DateTimePickerModal.ios.js +0 -363
  1009. package/src/shared/libs/datePickerModal/DateTimePickerModal.js +0 -9
  1010. package/src/shared/libs/datePickerModal/Modal.js +0 -180
  1011. package/src/shared/libs/datePickerModal/index.d.ts +0 -310
  1012. package/src/shared/libs/datePickerModal/index.js +0 -5
  1013. package/src/shared/libs/datePickerModal/utils.js +0 -25
  1014. package/src/shared/libs/luxon/src/datetime.js +0 -2422
  1015. package/src/shared/libs/luxon/src/duration.js +0 -990
  1016. package/src/shared/libs/luxon/src/errors.js +0 -61
  1017. package/src/shared/libs/luxon/src/impl/conversions.js +0 -206
  1018. package/src/shared/libs/luxon/src/impl/diff.js +0 -95
  1019. package/src/shared/libs/luxon/src/impl/digits.js +0 -75
  1020. package/src/shared/libs/luxon/src/impl/english.js +0 -233
  1021. package/src/shared/libs/luxon/src/impl/formats.js +0 -176
  1022. package/src/shared/libs/luxon/src/impl/formatter.js +0 -409
  1023. package/src/shared/libs/luxon/src/impl/invalid.js +0 -14
  1024. package/src/shared/libs/luxon/src/impl/locale.js +0 -542
  1025. package/src/shared/libs/luxon/src/impl/regexParser.js +0 -335
  1026. package/src/shared/libs/luxon/src/impl/tokenParser.js +0 -473
  1027. package/src/shared/libs/luxon/src/impl/util.js +0 -309
  1028. package/src/shared/libs/luxon/src/impl/zoneUtil.js +0 -30
  1029. package/src/shared/libs/luxon/src/info.js +0 -205
  1030. package/src/shared/libs/luxon/src/interval.js +0 -657
  1031. package/src/shared/libs/luxon/src/luxon.js +0 -26
  1032. package/src/shared/libs/luxon/src/package.json +0 -4
  1033. package/src/shared/libs/luxon/src/settings.js +0 -175
  1034. package/src/shared/libs/luxon/src/zone.js +0 -91
  1035. package/src/shared/libs/luxon/src/zones/IANAZone.js +0 -189
  1036. package/src/shared/libs/luxon/src/zones/fixedOffsetZone.js +0 -102
  1037. package/src/shared/libs/luxon/src/zones/invalidZone.js +0 -53
  1038. package/src/shared/libs/luxon/src/zones/systemZone.js +0 -61
  1039. package/src/shared/modals/CometChatCallLogDetailsOptions.ts +0 -23
  1040. package/src/shared/modals/CometChatCallLogDetailsTemplate.ts +0 -16
  1041. package/src/shared/modals/CometChatDetailsOption.ts +0 -24
  1042. package/src/shared/modals/CometChatDetailsTemplate.ts +0 -16
  1043. package/src/shared/modals/CometChatOptions.ts +0 -13
  1044. package/src/shared/modals/InteractiveData/InteractiveActions/APIAction.ts +0 -118
  1045. package/src/shared/modals/InteractiveData/InteractiveActions/CustomAction.ts +0 -19
  1046. package/src/shared/modals/InteractiveData/InteractiveActions/URLNavigationAction.ts +0 -34
  1047. package/src/shared/modals/InteractiveData/InteractiveActions/index.ts +0 -3
  1048. package/src/shared/modals/InteractiveData/InteractiveData/InteractiveCardData.ts +0 -69
  1049. package/src/shared/modals/InteractiveData/InteractiveData/InteractiveFormData.ts +0 -119
  1050. package/src/shared/modals/InteractiveData/InteractiveData/index.ts +0 -2
  1051. package/src/shared/modals/InteractiveData/InteractiveElements/BaseInputElement.ts +0 -102
  1052. package/src/shared/modals/InteractiveData/InteractiveElements/BaseInteractiveElement.ts +0 -45
  1053. package/src/shared/modals/InteractiveData/InteractiveElements/ButtonElement.ts +0 -61
  1054. package/src/shared/modals/InteractiveData/InteractiveElements/CheckboxElement.ts +0 -75
  1055. package/src/shared/modals/InteractiveData/InteractiveElements/DateTimeElement.ts +0 -103
  1056. package/src/shared/modals/InteractiveData/InteractiveElements/DropdownElement.ts +0 -83
  1057. package/src/shared/modals/InteractiveData/InteractiveElements/LabelElement.ts +0 -32
  1058. package/src/shared/modals/InteractiveData/InteractiveElements/OptionElement.ts +0 -39
  1059. package/src/shared/modals/InteractiveData/InteractiveElements/RadioButtonElement.ts +0 -76
  1060. package/src/shared/modals/InteractiveData/InteractiveElements/SingleSelectElement.ts +0 -76
  1061. package/src/shared/modals/InteractiveData/InteractiveElements/TextInputElement.ts +0 -101
  1062. package/src/shared/modals/InteractiveData/InteractiveElements/index.ts +0 -11
  1063. package/src/shared/modals/InteractiveData/InteractiveEntities/ActionEntity.ts +0 -41
  1064. package/src/shared/modals/InteractiveData/InteractiveEntities/ElementEntity.ts +0 -66
  1065. package/src/shared/modals/InteractiveData/InteractiveEntities/index.ts +0 -2
  1066. package/src/shared/modals/InteractiveData/InteractiveMessage/CardMessage.ts +0 -143
  1067. package/src/shared/modals/InteractiveData/InteractiveMessage/CustomInteractiveMessage.ts +0 -39
  1068. package/src/shared/modals/InteractiveData/InteractiveMessage/FormMessage.ts +0 -153
  1069. package/src/shared/modals/InteractiveData/InteractiveMessage/SchedulerMessage.ts +0 -150
  1070. package/src/shared/modals/InteractiveData/InteractiveMessage/index.ts +0 -4
  1071. package/src/shared/modals/InteractiveData/index.ts +0 -30
  1072. package/src/shared/resources/CometChatTheme/CometChatTheme.ts +0 -28
  1073. package/src/shared/resources/CometChatTheme/Palette.ts +0 -584
  1074. package/src/shared/resources/CometChatTheme/Typography.ts +0 -396
  1075. package/src/shared/resources/CometChatTheme/index.ts +0 -2
  1076. package/src/shared/utils/CometChatLiveReactions/CometChatLiveReaction.tsx +0 -124
  1077. package/src/shared/utils/CometChatLiveReactions/LiveReactionstyles.ts +0 -37
  1078. package/src/shared/utils/CometChatLiveReactions/index.ts +0 -1
  1079. package/src/shared/utils/CometChatLiveReactions/resources/heart.png +0 -0
  1080. package/src/shared/utils/CometChatLiveReactions/resources/index.ts +0 -5
  1081. package/src/shared/utils/CometChatLiveReactions/style.ts +0 -8
  1082. package/src/shared/utils/CometChatMessagePreview/CometChatMessagePreview.js +0 -109
  1083. package/src/shared/utils/CometChatMessagePreview/MessagePreviewConfiguration.js +0 -30
  1084. package/src/shared/utils/CometChatMessagePreview/style.js +0 -71
  1085. package/src/shared/utils/DetailsUtils/DetailsUtils.tsx +0 -399
  1086. package/src/shared/utils/DetailsUtils/resources/Back.png +0 -0
  1087. package/src/shared/utils/DetailsUtils/resources/banIcon.png +0 -0
  1088. package/src/shared/utils/DetailsUtils/resources/close.png +0 -0
  1089. package/src/shared/utils/DetailsUtils/resources/index.ts +0 -23
  1090. package/src/shared/utils/DetailsUtils/resources/kickIcon.png +0 -0
  1091. package/src/shared/utils/DetailsUtils/resources/password.png +0 -0
  1092. package/src/shared/utils/DetailsUtils/resources/private.png +0 -0
  1093. package/src/shared/utils/DetailsUtils/resources/right-arrow.png +0 -0
  1094. package/src/shared/utils/InteractiveMessageUtils.ts +0 -60
  1095. package/src/shared/utils/SchedulerUtils.ts +0 -198
  1096. package/src/shared/utils/TypeUtils.ts +0 -3
  1097. package/src/shared/views/CometChatActionSheet/ActionSheetStyle.ts +0 -61
  1098. package/src/shared/views/CometChatAudioBubble/AudioBubbleStyle.ts +0 -43
  1099. package/src/shared/views/CometChatAvatar/AvatarConfiguration.ts +0 -27
  1100. package/src/shared/views/CometChatAvatar/AvatarStyle.ts +0 -57
  1101. package/src/shared/views/CometChatAvatar/resources/default.jpg +0 -0
  1102. package/src/shared/views/CometChatAvatar/resources/index.ts +0 -5
  1103. package/src/shared/views/CometChatBadge/BadgeConfiguration.ts +0 -55
  1104. package/src/shared/views/CometChatBadge/BadgeStyle.ts +0 -39
  1105. package/src/shared/views/CometChatBottomSheet/style.ts +0 -50
  1106. package/src/shared/views/CometChatButton/CometChatButton.tsx +0 -76
  1107. package/src/shared/views/CometChatButton/CometChatButtonStyle.ts +0 -47
  1108. package/src/shared/views/CometChatButton/index.ts +0 -5
  1109. package/src/shared/views/CometChatButton/style.ts +0 -8
  1110. package/src/shared/views/CometChatCard/CometChatCard.tsx +0 -77
  1111. package/src/shared/views/CometChatCard/CometChatCardStyle.ts +0 -31
  1112. package/src/shared/views/CometChatCard/index.ts +0 -8
  1113. package/src/shared/views/CometChatCard/style.ts +0 -13
  1114. package/src/shared/views/CometChatCardBubble/CardBubbleStyle.tsx +0 -47
  1115. package/src/shared/views/CometChatCardBubble/CometChatCardBubble.tsx +0 -174
  1116. package/src/shared/views/CometChatCardBubble/index.tsx +0 -2
  1117. package/src/shared/views/CometChatCheckBox/CheckBoxStyle.tsx +0 -43
  1118. package/src/shared/views/CometChatCheckBox/CometChatCheckBox.tsx +0 -79
  1119. package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialogStyle.ts +0 -36
  1120. package/src/shared/views/CometChatDate/DateConfiguration.ts +0 -32
  1121. package/src/shared/views/CometChatDate/DateStyle.ts +0 -26
  1122. package/src/shared/views/CometChatDate/style.ts +0 -8
  1123. package/src/shared/views/CometChatDateTimePicker/CometChatDateTimePicker.tsx +0 -206
  1124. package/src/shared/views/CometChatDateTimePicker/DateTimePickerStyle.ts +0 -19
  1125. package/src/shared/views/CometChatDateTimePicker/index.ts +0 -3
  1126. package/src/shared/views/CometChatDropDown/CometChatDropDown.tsx +0 -127
  1127. package/src/shared/views/CometChatDropDown/DropDownStyle.tsx +0 -39
  1128. package/src/shared/views/CometChatDropDown/resources/downArrowIcon.png +0 -0
  1129. package/src/shared/views/CometChatDropDown/resources/index.js +0 -5
  1130. package/src/shared/views/CometChatEmojiKeyboard/EmojiKeyboardConfiguration.ts +0 -27
  1131. package/src/shared/views/CometChatEmojiKeyboard/EmojiKeyboardStyle.ts +0 -44
  1132. package/src/shared/views/CometChatFileBubble/FileBubbleStyle.ts +0 -58
  1133. package/src/shared/views/CometChatFormBubble/CometChatFormBubble.tsx +0 -542
  1134. package/src/shared/views/CometChatFormBubble/FormBubbleStyle.tsx +0 -96
  1135. package/src/shared/views/CometChatFormBubble/index.tsx +0 -2
  1136. package/src/shared/views/CometChatImageBubble/ImageBubbleStyle.ts +0 -34
  1137. package/src/shared/views/CometChatImageBubble/assets/default_image.png +0 -0
  1138. package/src/shared/views/CometChatLabel/CometChatLabel.tsx +0 -27
  1139. package/src/shared/views/CometChatLabel/LabelStyle.ts +0 -19
  1140. package/src/shared/views/CometChatList/resources/Back.png +0 -0
  1141. package/src/shared/views/CometChatList/resources/Search.png +0 -0
  1142. package/src/shared/views/CometChatListItem/ListItemConfiguration.tsx +0 -21
  1143. package/src/shared/views/CometChatListItem/ListItemStyle.ts +0 -47
  1144. package/src/shared/views/CometChatMediaRecorder/MediaRecorderStyle.ts +0 -63
  1145. package/src/shared/views/CometChatMessageBubble/MessageBubbleStyle.ts +0 -26
  1146. package/src/shared/views/CometChatPanel/CometChatPanel.tsx +0 -51
  1147. package/src/shared/views/CometChatPanel/PanelStyle.tsx +0 -43
  1148. package/src/shared/views/CometChatPanel/resources/CloseIcon.png +0 -0
  1149. package/src/shared/views/CometChatPanel/resources/index.ts +0 -6
  1150. package/src/shared/views/CometChatQuickReactions/QuickReactionsConfiguration.tsx +0 -13
  1151. package/src/shared/views/CometChatQuickView/CometChatQuickView.tsx +0 -66
  1152. package/src/shared/views/CometChatQuickView/QuickViewStyle.ts +0 -55
  1153. package/src/shared/views/CometChatRadioButton/CometChatRadioButton.tsx +0 -67
  1154. package/src/shared/views/CometChatRadioButton/RadioButtonStyle.tsx +0 -38
  1155. package/src/shared/views/CometChatReactionList/ReactionListConfiguration.tsx +0 -15
  1156. package/src/shared/views/CometChatReactions/ReactionsConfiguration.tsx +0 -13
  1157. package/src/shared/views/CometChatReactions/ReactionsStyle.tsx +0 -43
  1158. package/src/shared/views/CometChatReceipt/MessageConfiguration.ts +0 -65
  1159. package/src/shared/views/CometChatReceipt/ReceiptStyle.ts +0 -41
  1160. package/src/shared/views/CometChatSchedulerBubble/CometChatSchedulerBubble.tsx +0 -1519
  1161. package/src/shared/views/CometChatSchedulerBubble/index.ts +0 -3
  1162. package/src/shared/views/CometChatSchedulerBubble/styles.ts +0 -92
  1163. package/src/shared/views/CometChatSingleSelect/CometChatSingleSelect.tsx +0 -63
  1164. package/src/shared/views/CometChatSingleSelect/SingleStyle.tsx +0 -35
  1165. package/src/shared/views/CometChatStatusIndicator/StatusIndicatorConfiguration.ts +0 -25
  1166. package/src/shared/views/CometChatStatusIndicator/StatusIndicatorStyle.ts +0 -37
  1167. package/src/shared/views/CometChatSuggestionList/SuggestionListConfiguration.ts +0 -23
  1168. package/src/shared/views/CometChatTextBubble/TextBubbleStyle.ts +0 -37
  1169. package/src/shared/views/CometChatTextInput/CometChatTextInput.tsx +0 -67
  1170. package/src/shared/views/CometChatTextInput/TextInputStyle.tsx +0 -26
  1171. package/src/shared/views/CometChatTimeSlotSelector/CometChatTimeSlotSelector.tsx +0 -113
  1172. package/src/shared/views/CometChatTimeSlotSelector/index.ts +0 -3
  1173. package/src/shared/views/CometChatTimeSlotSelector/styles.ts +0 -30
  1174. package/src/shared/views/CometChatVideoBubble/VideoBubbleStyle.ts +0 -87
  1175. package/src/shared/views/SwipeRow/SwipeRow.tsx +0 -126
  1176. package/src/shared/views/SwipeRow/index.ts +0 -3
  1177. package/src/shared/views/SwipeRow/style.ts +0 -30
  1178. /package/src/{shared/assets/images → CometChatGroups/resources}/search.png +0 -0
  1179. /package/src/{CometChatDetails → CometChatThreadHeader}/resources/Back.png +0 -0
  1180. /package/src/{AI/AIConversationSummary → CometChatThreadHeader}/resources/close.png +0 -0
  1181. /package/src/{CometChatThreadedMessages → CometChatThreadHeader}/resources/more.png +0 -0
  1182. /package/src/{CometChatDetails → CometChatThreadHeader}/resources/password.png +0 -0
  1183. /package/src/{CometChatDetails → CometChatThreadHeader}/resources/private.png +0 -0
  1184. /package/src/{CometChatDetails → CometChatThreadHeader}/resources/right-arrow.png +0 -0
@@ -1,950 +1,1649 @@
1
1
  import React from "react";
2
- //@ts-ignore
3
2
  import { CometChat } from "@cometchat/chat-sdk-react-native";
4
- import { CometChatMessageTypes, GroupMemberScope, MessageCategoryConstants, MessageOptionConstants, MessageTypeConstants } from "../constants/UIKitConstants";
3
+ import {
4
+ CometChatMentionsFormatter,
5
+ CometChatTextFormatter,
6
+ CometChatUIKit,
7
+ CometChatUrlsFormatter,
8
+ } from "../..";
9
+ import { CometChatTheme } from "../../theme/type";
10
+ import {
11
+ AdditionalAttachmentOptionsParams,
12
+ AdditionalAuxiliaryHeaderOptionsParams,
13
+ AdditionalAuxiliaryOptionsParams,
14
+ AdditionalParams,
15
+ MessageBubbleAlignmentType,
16
+ } from "../base/Types";
17
+ import {
18
+ CometChatMessageTypes,
19
+ GroupMemberScope,
20
+ MentionsTargetElement,
21
+ MessageCategoryConstants,
22
+ MessageOptionConstants,
23
+ MessageTypeConstants,
24
+ } from "../constants/UIKitConstants";
25
+ import { CometChatMessageComposerAction } from "../helper/types";
26
+ import { Icon } from "../icons/Icon";
5
27
  import { CometChatMessageOption } from "../modals/CometChatMessageOption";
6
28
  import { CometChatMessageTemplate } from "../modals/CometChatMessageTemplate";
7
- import { DataSource } from "./DataSource";
8
29
  import { localize } from "../resources/CometChatLocalize";
9
- import { CometChatTextBubble } from "../views/CometChatTextBubble"
10
- import { CometChatVideoBubble, VideoBubbleStyleInterface } from "../views/CometChatVideoBubble";
11
- import { CometChatTheme } from "../resources/CometChatTheme";
12
- import { CometChatImageBubble, ImageBubbleStyleInterface } from "../views/CometChatImageBubble";
13
- import { AudioBubbleStyleInterface, CometChatAudioBubble } from "../views/CometChatAudioBubble";
14
- import { CometChatFileBubble, FileBubbleStyleInterface } from "../views/CometChatFileBubble";
15
- import { ChatConfigurator } from "./ChatConfigurator";
16
- import { CometChatMessageComposerActionInterface } from "../helper/types";
17
- import { ICONS } from "./resources";
18
30
  import { CometChatConversationUtils } from "../utils/conversationUtils";
19
- import { AIOptionsStyle } from "../../AI/AIOptionsStyle";
20
- import { CometChatFormBubble, CometChatCardBubble, CometChatSchedulerBubble } from "../views";
21
- import { CardMessage, FormMessage, SchedulerMessage } from "../modals/InteractiveData";
22
- import { FormBubbleStyle } from "../views/CometChatFormBubble/FormBubbleStyle";
23
- import { CardBubbleStyle } from "../views/CometChatCardBubble/CardBubbleStyle";
24
- import { SchedulerBubbleStyles } from "../views/CometChatSchedulerBubble";
25
- import { TextStyle, View } from "react-native";
31
+ import { CometChatAudioBubble } from "../views/CometChatAudioBubble";
32
+ import { CometChatDeletedBubble } from "../views/CometChatDeletedBubble";
33
+ import { CometChatFileBubble } from "../views/CometChatFileBubble";
34
+ import { CometChatImageBubble } from "../views/CometChatImageBubble";
35
+ import { CometChatTextBubble } from "../views/CometChatTextBubble";
36
+ import { CometChatVideoBubble } from "../views/CometChatVideoBubble";
37
+ import { ChatConfigurator } from "./ChatConfigurator";
38
+ import { DataSource } from "./DataSource";
26
39
  import { CommonUtils } from "../utils/CommonUtils";
27
- import { CometChatUIKit, CometChatMentionsFormatter, CometChatTextFormatter, CometChatUrlsFormatter, MentionTextStyle, CometChatUiKitConstants } from "../..";
28
- import { AdditionalBubbleStylingParams, MessageBubbleAlignmentType } from "../base/Types";
29
- import { MessageUtils } from "../utils/MessageUtils";
40
+ import { DimensionValue, ViewStyle } from "react-native";
30
41
 
31
42
  function isAudioMessage(message: CometChat.BaseMessage): message is CometChat.MediaMessage {
32
- return message.getCategory() == CometChat.CATEGORY_MESSAGE &&
33
- message.getType() == CometChat.MESSAGE_TYPE.AUDIO;
43
+ return (
44
+ message.getCategory() == CometChat.CATEGORY_MESSAGE &&
45
+ message.getType() == CometChat.MESSAGE_TYPE.AUDIO
46
+ );
34
47
  }
35
48
 
36
49
  function isVideoMessage(message: CometChat.BaseMessage): message is CometChat.MediaMessage {
37
- return message.getCategory() == CometChat.CATEGORY_MESSAGE &&
38
- message.getType() == CometChat.MESSAGE_TYPE.VIDEO;
50
+ return (
51
+ message.getCategory() == CometChat.CATEGORY_MESSAGE &&
52
+ message.getType() == CometChat.MESSAGE_TYPE.VIDEO
53
+ );
39
54
  }
40
55
 
41
56
  function isFileMessage(message: CometChat.BaseMessage): message is CometChat.MediaMessage {
42
- return message.getCategory() == CometChat.CATEGORY_MESSAGE &&
43
- message.getType() == CometChat.MESSAGE_TYPE.FILE;
57
+ return (
58
+ message.getCategory() == CometChat.CATEGORY_MESSAGE &&
59
+ message.getType() == CometChat.MESSAGE_TYPE.FILE
60
+ );
44
61
  }
45
62
 
46
63
  function isActionMessage(message: CometChat.BaseMessage): message is CometChat.Action {
47
- return message.getCategory() == CometChat.CATEGORY_ACTION
64
+ return message.getCategory() == CometChat.CATEGORY_ACTION;
48
65
  }
49
66
 
50
67
  function isTextMessage(message: CometChat.BaseMessage): message is CometChat.TextMessage {
51
- return message.getCategory() == CometChat.CATEGORY_MESSAGE &&
52
- message.getType() == CometChat.MESSAGE_TYPE.TEXT
68
+ return (
69
+ message.getCategory() == CometChat.CATEGORY_MESSAGE &&
70
+ message.getType() == CometChat.MESSAGE_TYPE.TEXT
71
+ );
53
72
  }
54
73
 
55
74
  function isImageMessage(message: CometChat.BaseMessage): message is CometChat.MediaMessage {
56
- return message.getCategory() == CometChat.CATEGORY_MESSAGE &&
57
- message.getType() == CometChat.MESSAGE_TYPE.IMAGE
75
+ return (
76
+ message.getCategory() == CometChat.CATEGORY_MESSAGE &&
77
+ message.getType() == CometChat.MESSAGE_TYPE.IMAGE
78
+ );
58
79
  }
59
80
 
60
81
  function isDeletedMessage(message: CometChat.BaseMessage): boolean {
61
- return message.getDeletedBy() != null;
62
- }
63
-
64
- function isMessageSent(message: CometChat.BaseMessage): boolean {
65
- return message.getSentAt() ? true : false;
82
+ return message.getDeletedBy() != null;
66
83
  }
67
84
 
68
85
  export class MessageDataSource implements DataSource {
69
-
70
- getEditOption(): CometChatMessageOption {
71
- return {
72
- id: MessageOptionConstants.editMessage,
73
- title: localize("EDIT"),
74
- icon: ICONS.EDIT
75
- }
86
+ getEditOption(theme: CometChatTheme): CometChatMessageOption {
87
+ return {
88
+ id: MessageOptionConstants.editMessage,
89
+ title: localize("EDIT"),
90
+ icon: (
91
+ <Icon
92
+ name='edit'
93
+ color={
94
+ theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.tintColor
95
+ }
96
+ height={theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.height}
97
+ width={theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.width}
98
+ containerStyle={
99
+ theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconContainerStyle
100
+ }
101
+ ></Icon>
102
+ ),
103
+ };
104
+ }
105
+
106
+ getDeleteOption(theme: CometChatTheme): CometChatMessageOption {
107
+ return {
108
+ id: MessageOptionConstants.deleteMessage,
109
+ title: localize("DELETE"),
110
+ icon: (
111
+ <Icon
112
+ name='delete'
113
+ color={theme.color.error}
114
+ height={theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.height}
115
+ width={theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.width}
116
+ containerStyle={
117
+ theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconContainerStyle
118
+ }
119
+ ></Icon>
120
+ ),
121
+ style: {
122
+ titleStyle: {
123
+ color: theme.color.error,
124
+ },
125
+ },
126
+ };
127
+ }
128
+ getReplyOption(theme: CometChatTheme): CometChatMessageOption {
129
+ return {
130
+ id: MessageOptionConstants.replyMessage,
131
+ title: localize("REPLY"),
132
+ icon: (
133
+ <Icon
134
+ name='reply'
135
+ color={
136
+ theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.tintColor
137
+ }
138
+ height={theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.height}
139
+ width={theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.width}
140
+ containerStyle={
141
+ theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconContainerStyle
142
+ }
143
+ ></Icon>
144
+ ),
145
+ };
146
+ }
147
+ getReplyInThreadOption(theme: CometChatTheme): CometChatMessageOption {
148
+ return {
149
+ id: MessageOptionConstants.replyInThread,
150
+ title: localize("REPLY_IN_THREAD"),
151
+ icon: (
152
+ <Icon
153
+ name='subdirectory-arrow-right'
154
+ color={
155
+ theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.tintColor
156
+ }
157
+ height={theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.height}
158
+ width={theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.width}
159
+ containerStyle={
160
+ theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconContainerStyle
161
+ }
162
+ ></Icon>
163
+ ),
164
+ };
165
+ }
166
+ getShareOption(theme: CometChatTheme): CometChatMessageOption {
167
+ return {
168
+ id: MessageOptionConstants.shareMessage,
169
+ title: localize("SHARE"),
170
+ icon: (
171
+ <Icon
172
+ name='share'
173
+ color={
174
+ theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.tintColor
175
+ }
176
+ height={theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.height}
177
+ width={theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.width}
178
+ containerStyle={
179
+ theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconContainerStyle
180
+ }
181
+ ></Icon>
182
+ ),
183
+ };
184
+ }
185
+ getCopyOption(theme: CometChatTheme): CometChatMessageOption {
186
+ return {
187
+ id: MessageOptionConstants.copyMessage,
188
+ title: localize("COPY"),
189
+ icon: (
190
+ <Icon
191
+ name='content-copy'
192
+ color={
193
+ theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.tintColor
194
+ }
195
+ height={theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.height}
196
+ width={theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.width}
197
+ containerStyle={
198
+ theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconContainerStyle
199
+ }
200
+ ></Icon>
201
+ ),
202
+ };
203
+ }
204
+ // getForwardOption(): CometChatMessageOption {
205
+ // return {
206
+ // id: MessageOptionConstants.forwardMessage,
207
+ // title: localize("FORWARD"),
208
+ // icon: ICONS.FORWARD
209
+ // }
210
+ // }
211
+ getInformationOption(theme: CometChatTheme): CometChatMessageOption {
212
+ return {
213
+ id: MessageOptionConstants.messageInformation,
214
+ title: localize("INFO"),
215
+ icon: (
216
+ <Icon
217
+ name='info'
218
+ color={
219
+ theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.tintColor
220
+ }
221
+ height={theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.height}
222
+ width={theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle?.width}
223
+ containerStyle={
224
+ theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconContainerStyle
225
+ }
226
+ ></Icon>
227
+ ),
228
+ };
229
+ }
230
+
231
+ getPrivateMessageOption(theme: CometChatTheme): CometChatMessageOption {
232
+ return {
233
+ id: MessageOptionConstants.sendMessagePrivately,
234
+ title: localize("MESSAGE_PRIVATELY"),
235
+ icon: (
236
+ <Icon
237
+ name='reply'
238
+ imageStyle={theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconStyle}
239
+ containerStyle={
240
+ theme.messageListStyles.messageOptionsStyles?.optionsItemStyle?.iconContainerStyle
241
+ }
242
+ ></Icon>
243
+ ),
244
+ };
245
+ }
246
+
247
+ isSentByMe(loggedInUser: CometChat.User, message: CometChat.BaseMessage) {
248
+ if (!loggedInUser) return false;
249
+ return loggedInUser.getUid() == message?.getSender()?.getUid();
250
+ }
251
+
252
+ getTextMessageOptions(
253
+ loggedInUser: CometChat.User,
254
+ messageObject: CometChat.BaseMessage,
255
+ theme: CometChatTheme,
256
+ group?: CometChat.Group,
257
+ additionalParams?: AdditionalParams
258
+ ): CometChatMessageOption[] {
259
+ let messageOptionList: CometChatMessageOption[] = [];
260
+
261
+ if (isDeletedMessage(messageObject)) return messageOptionList;
262
+
263
+ if (
264
+ this.validateOption(
265
+ loggedInUser,
266
+ messageObject,
267
+ MessageOptionConstants.replyInThread,
268
+ group,
269
+ additionalParams
270
+ )
271
+ ) {
272
+ messageOptionList.push(this.getReplyInThreadOption(theme));
76
273
  }
77
274
 
78
- getDeleteOption(): CometChatMessageOption {
79
- return {
80
- id: MessageOptionConstants.deleteMessage,
81
- title: localize("DELETE"),
82
- icon: ICONS.DELETE
83
- }
84
- }
85
- getReplyOption(): CometChatMessageOption {
86
- return {
87
- id: MessageOptionConstants.replyMessage,
88
- title: localize("REPLY"),
89
- icon: ICONS.REPLY
90
- }
91
- }
92
- getReplyInThreadOption(): CometChatMessageOption {
93
- return {
94
- id: MessageOptionConstants.replyInThread,
95
- title: localize("REPLY"),
96
- icon: ICONS.THREAD
97
- }
98
- }
99
- getShareOption(): CometChatMessageOption {
100
- return {
101
- id: MessageOptionConstants.shareMessage,
102
- title: localize("SHARE"),
103
- icon: ICONS.SHARE
104
- }
105
- }
106
- getCopyOption(): CometChatMessageOption {
107
- return {
108
- id: MessageOptionConstants.copyMessage,
109
- title: localize("COPY"),
110
- icon: ICONS.COPY
111
- }
112
- }
113
- // getForwardOption(): CometChatMessageOption {
114
- // return {
115
- // id: MessageOptionConstants.forwardMessage,
116
- // title: localize("FORWARD"),
117
- // icon: ICONS.FORWARD
118
- // }
119
- // }
120
- getInformationOption(): CometChatMessageOption {
121
- return {
122
- id: MessageOptionConstants.messageInformation,
123
- title: localize("INFO"),
124
- icon: ICONS.INFO
125
- }
275
+ if (
276
+ this.validateOption(
277
+ loggedInUser,
278
+ messageObject,
279
+ MessageOptionConstants.shareMessage,
280
+ group,
281
+ additionalParams
282
+ )
283
+ ) {
284
+ messageOptionList.push(this.getShareOption(theme));
126
285
  }
127
286
 
128
- getPrivateMessageOption(): CometChatMessageOption {
129
- return {
130
- id: MessageOptionConstants.sendMessagePrivately,
131
- title: localize('MESSAGE_PRIVATELY'),
132
- icon: ICONS.PRIVATE_MESSAGE
133
- }
287
+ if (
288
+ this.validateOption(
289
+ loggedInUser,
290
+ messageObject,
291
+ MessageOptionConstants.copyMessage,
292
+ group,
293
+ additionalParams
294
+ )
295
+ ) {
296
+ messageOptionList.push(this.getCopyOption(theme));
134
297
  }
135
298
 
136
- isSentByMe(loggedInUser: CometChat.User, message: CometChat.BaseMessage) {
137
- if (!loggedInUser) return false;
138
- return loggedInUser.getUid() == message?.getSender()?.getUid();
299
+ if (
300
+ this.validateOption(
301
+ loggedInUser,
302
+ messageObject,
303
+ MessageOptionConstants.editMessage,
304
+ group,
305
+ additionalParams
306
+ )
307
+ ) {
308
+ messageOptionList.push(this.getEditOption(theme));
139
309
  }
140
310
 
141
- getTextMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): CometChatMessageOption[] {
142
-
143
- let messageOptionList: CometChatMessageOption[] = [];
144
-
145
-
146
- if (isDeletedMessage(messageObject) || !isMessageSent(messageObject))
147
- return messageOptionList;
148
-
149
-
150
- if (this.validateOption(loggedInUser, messageObject, MessageOptionConstants.replyInThread, group)) {
151
- messageOptionList.push(this.getReplyInThreadOption());
152
- }
153
-
154
- if (this.validateOption(loggedInUser, messageObject, MessageOptionConstants.shareMessage, group)) {
155
- messageOptionList.push(this.getShareOption());
156
- }
157
-
158
- messageOptionList.push(this.getCopyOption());
159
-
160
- if (this.validateOption(loggedInUser, messageObject, MessageOptionConstants.editMessage, group)) {
161
- messageOptionList.push(this.getEditOption());
162
- }
163
-
164
- if (this.validateOption(loggedInUser, messageObject, MessageOptionConstants.messageInformation, group)) {
165
- messageOptionList.push(this.getInformationOption());
166
- }
167
-
168
- if (this.validateOption(loggedInUser, messageObject, MessageOptionConstants.deleteMessage, group)) {
169
- messageOptionList.push(this.getDeleteOption());
170
- }
171
-
172
- if (this.validateOption(loggedInUser, messageObject, MessageOptionConstants.sendMessagePrivately, group)) {
173
- messageOptionList.push(this.getPrivateMessageOption());
174
- }
175
-
176
- return messageOptionList;
177
- }
178
-
179
- getFormMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): CometChatMessageOption[] {
180
- let optionsList: Array<CometChatMessageOption> = [];
181
- if (!isDeletedMessage(messageObject) && isMessageSent(messageObject))
182
- optionsList.push(...ChatConfigurator.dataSource.getCommonOptions(loggedInUser, messageObject, group));
183
- return optionsList;
184
- }
185
-
186
- getSchedulerMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): CometChatMessageOption[] {
187
- let optionsList: Array<CometChatMessageOption> = [];
188
- if (!isDeletedMessage(messageObject) && isMessageSent(messageObject))
189
- optionsList.push(...ChatConfigurator.dataSource.getCommonOptions(loggedInUser, messageObject, group));
190
- return optionsList;
191
- }
192
-
193
- getCardMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): CometChatMessageOption[] {
194
- let optionsList: Array<CometChatMessageOption> = [];
195
- if (!isDeletedMessage(messageObject) && isMessageSent(messageObject))
196
- optionsList.push(...ChatConfigurator.dataSource.getCommonOptions(loggedInUser, messageObject, group));
197
- return optionsList;
198
- }
199
-
200
- getAudioMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): CometChatMessageOption[] {
201
- let optionsList: Array<CometChatMessageOption> = [];
202
- if (!isDeletedMessage(messageObject) && isMessageSent(messageObject))
203
- optionsList.push(...ChatConfigurator.dataSource.getCommonOptions(loggedInUser, messageObject, group));
204
- return optionsList;
205
- }
206
- getVideoMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): CometChatMessageOption[] {
207
- let optionsList: Array<CometChatMessageOption> = [];
208
- if (!isDeletedMessage(messageObject) && isMessageSent(messageObject))
209
- optionsList.push(...ChatConfigurator.dataSource.getCommonOptions(loggedInUser, messageObject, group));
210
- return optionsList
211
- }
212
- getImageMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): CometChatMessageOption[] {
213
- let optionsList: Array<CometChatMessageOption> = [];
214
- if (!isDeletedMessage(messageObject) && isMessageSent(messageObject))
215
- optionsList.push(...ChatConfigurator.dataSource.getCommonOptions(loggedInUser, messageObject, group));
216
- return optionsList;
217
- }
218
- getFileMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): CometChatMessageOption[] {
219
- let optionsList: Array<CometChatMessageOption> = [];
220
- if (!isDeletedMessage(messageObject) && isMessageSent(messageObject))
221
- optionsList.push(...ChatConfigurator.dataSource.getCommonOptions(loggedInUser, messageObject, group));
222
- return optionsList;
223
- }
224
- getMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): CometChatMessageOption[] {
225
- let optionsList: Array<CometChatMessageOption> = [];
226
- if (isDeletedMessage(messageObject) || !isMessageSent(messageObject))
227
- return optionsList;
228
- if (messageObject.getCategory() == MessageCategoryConstants.message) {
229
- let type: string = messageObject.getType();
230
- switch (type) {
231
- case MessageTypeConstants.audio:
232
- optionsList.push(...ChatConfigurator.dataSource.getAudioMessageOptions(loggedInUser, messageObject, group));
233
- break;
234
- case MessageTypeConstants.video:
235
- optionsList.push(...ChatConfigurator.dataSource.getVideoMessageOptions(loggedInUser, messageObject, group));
236
- break;
237
- case MessageTypeConstants.image:
238
- optionsList.push(...ChatConfigurator.dataSource.getImageMessageOptions(loggedInUser, messageObject, group));
239
- break;
240
- case MessageTypeConstants.text:
241
- optionsList.push(...ChatConfigurator.dataSource.getTextMessageOptions(loggedInUser, messageObject, group));
242
- break;
243
- case MessageTypeConstants.file:
244
- optionsList.push(...ChatConfigurator.dataSource.getFileMessageOptions(loggedInUser, messageObject, group));
245
- break;
246
- }
247
-
248
- }
249
- else if (messageObject.getCategory() == MessageCategoryConstants.custom) {
250
- optionsList.push(...ChatConfigurator.dataSource.getCommonOptions(loggedInUser, messageObject, group));
251
- } else if (messageObject.getCategory() == MessageCategoryConstants.interactive) {
252
- let type: string = messageObject.getType();
253
- switch (type) {
254
- case MessageTypeConstants.form:
255
- optionsList.push(...ChatConfigurator.dataSource.getFormMessageOptions(loggedInUser, messageObject, group));
256
- break;
257
- case MessageTypeConstants.card:
258
- optionsList.push(...ChatConfigurator.dataSource.getCardMessageOptions(loggedInUser, messageObject, group));
259
- break;
260
- case MessageTypeConstants.scheduler:
261
- optionsList.push(...ChatConfigurator.dataSource.getSchedulerMessageOptions(loggedInUser, messageObject, group));
262
- break;
263
- }
264
- }
265
- return optionsList;
311
+ if (
312
+ this.validateOption(
313
+ loggedInUser,
314
+ messageObject,
315
+ MessageOptionConstants.messageInformation,
316
+ group,
317
+ additionalParams
318
+ )
319
+ ) {
320
+ messageOptionList.push(this.getInformationOption(theme));
266
321
  }
267
322
 
323
+ if (
324
+ this.validateOption(
325
+ loggedInUser,
326
+ messageObject,
327
+ MessageOptionConstants.deleteMessage,
328
+ group,
329
+ additionalParams
330
+ )
331
+ ) {
332
+ messageOptionList.push(this.getDeleteOption(theme));
333
+ }
268
334
 
269
- private validateOption(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, optionId: string, group?: CometChat.Group | null): boolean {
270
-
271
- if (MessageOptionConstants.replyInThread === optionId && (!(messageObject as any).parentMessageId || (messageObject as any).parentMessageId === 0)) {
272
- return true;
273
- }
274
-
275
- if (MessageOptionConstants.shareMessage === optionId && (messageObject instanceof CometChat.TextMessage || messageObject instanceof CometChat.MediaMessage)) {
276
- return true;
277
- }
278
-
279
- if (MessageOptionConstants.copyMessage === optionId && messageObject instanceof CometChat.TextMessage) {
280
- return true;
281
- }
282
-
283
- let isSentByMe: boolean = this.isSentByMe(loggedInUser, messageObject);
284
-
285
- if (MessageOptionConstants.messageInformation === optionId && isSentByMe) {
286
- return true;
287
- }
288
-
289
- let memberIsNotParticipant: boolean | any = group && ((group as any).owner === (loggedInUser as any).uid || (group as any).scope !== GroupMemberScope.participant);
290
-
291
- if (MessageOptionConstants.deleteMessage === optionId && (isSentByMe || memberIsNotParticipant)) {
292
- return true;
293
- }
294
-
295
- if (MessageOptionConstants.editMessage === optionId && (isSentByMe || memberIsNotParticipant)) {
296
- return true;
297
- }
298
-
299
- if (MessageOptionConstants.copyMessage === optionId && messageObject instanceof CometChat.TextMessage) {
300
- return true;
301
- }
302
-
303
- if (MessageOptionConstants.sendMessagePrivately === optionId && group
304
- && loggedInUser.getUid() != messageObject.getSender()?.getUid()) {
305
- return true;
306
- }
307
-
308
- return false;
335
+ if (
336
+ this.validateOption(
337
+ loggedInUser,
338
+ messageObject,
339
+ MessageOptionConstants.sendMessagePrivately,
340
+ group,
341
+ additionalParams
342
+ )
343
+ ) {
344
+ messageOptionList.push(this.getPrivateMessageOption(theme));
309
345
  }
310
346
 
311
- getCommonOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): CometChatMessageOption[] {
312
- let messageOptionList: CometChatMessageOption[] = [];
347
+ return messageOptionList;
348
+ }
349
+
350
+ getAudioMessageOptions(
351
+ loggedInUser: CometChat.User,
352
+ messageObject: CometChat.BaseMessage,
353
+ theme: CometChatTheme,
354
+ group?: CometChat.Group,
355
+ additionalParams?: AdditionalParams
356
+ ): CometChatMessageOption[] {
357
+ let optionsList: Array<CometChatMessageOption> = [];
358
+ if (!isDeletedMessage(messageObject))
359
+ optionsList.push(
360
+ ...ChatConfigurator.dataSource.getCommonOptions(
361
+ loggedInUser,
362
+ messageObject,
363
+ theme,
364
+ group,
365
+ additionalParams
366
+ )
367
+ );
368
+ return optionsList;
369
+ }
370
+ getVideoMessageOptions(
371
+ loggedInUser: CometChat.User,
372
+ messageObject: CometChat.BaseMessage,
373
+ theme: CometChatTheme,
374
+ group?: CometChat.Group,
375
+ additionalParams?: AdditionalParams
376
+ ): CometChatMessageOption[] {
377
+ let optionsList: Array<CometChatMessageOption> = [];
378
+ if (!isDeletedMessage(messageObject))
379
+ optionsList.push(
380
+ ...ChatConfigurator.dataSource.getCommonOptions(
381
+ loggedInUser,
382
+ messageObject,
383
+ theme,
384
+ group,
385
+ additionalParams
386
+ )
387
+ );
388
+ return optionsList;
389
+ }
390
+ getImageMessageOptions(
391
+ loggedInUser: CometChat.User,
392
+ messageObject: CometChat.BaseMessage,
393
+ theme: CometChatTheme,
394
+ group?: CometChat.Group,
395
+ additionalParams?: AdditionalParams
396
+ ): CometChatMessageOption[] {
397
+ let optionsList: Array<CometChatMessageOption> = [];
398
+ if (!isDeletedMessage(messageObject))
399
+ optionsList.push(
400
+ ...ChatConfigurator.dataSource.getCommonOptions(
401
+ loggedInUser,
402
+ messageObject,
403
+ theme,
404
+ group,
405
+ additionalParams
406
+ )
407
+ );
408
+ return optionsList;
409
+ }
410
+ getFileMessageOptions(
411
+ loggedInUser: CometChat.User,
412
+ messageObject: CometChat.BaseMessage,
413
+ theme: CometChatTheme,
414
+ group?: CometChat.Group,
415
+ additionalParams?: AdditionalParams
416
+ ): CometChatMessageOption[] {
417
+ let optionsList: Array<CometChatMessageOption> = [];
418
+ if (!isDeletedMessage(messageObject))
419
+ optionsList.push(
420
+ ...ChatConfigurator.dataSource.getCommonOptions(
421
+ loggedInUser,
422
+ messageObject,
423
+ theme,
424
+ group,
425
+ additionalParams
426
+ )
427
+ );
428
+ return optionsList;
429
+ }
430
+ getMessageOptions(
431
+ loggedInUser: CometChat.User,
432
+ messageObject: CometChat.BaseMessage,
433
+ theme: CometChatTheme,
434
+ group?: CometChat.Group,
435
+ additionalParams?: AdditionalParams
436
+ ): CometChatMessageOption[] {
437
+ let optionsList: Array<CometChatMessageOption> = [];
438
+ if (isDeletedMessage(messageObject)) return optionsList;
439
+ if (messageObject.getCategory() == MessageCategoryConstants.message) {
440
+ let type: string = messageObject.getType();
441
+ switch (type) {
442
+ case MessageTypeConstants.audio:
443
+ optionsList.push(
444
+ ...ChatConfigurator.dataSource.getAudioMessageOptions(
445
+ loggedInUser,
446
+ messageObject,
447
+ theme,
448
+ group,
449
+ additionalParams
450
+ )
451
+ );
452
+ break;
453
+ case MessageTypeConstants.video:
454
+ optionsList.push(
455
+ ...ChatConfigurator.dataSource.getVideoMessageOptions(
456
+ loggedInUser,
457
+ messageObject,
458
+ theme,
459
+ group,
460
+ additionalParams
461
+ )
462
+ );
463
+ break;
464
+ case MessageTypeConstants.image:
465
+ optionsList.push(
466
+ ...ChatConfigurator.dataSource.getImageMessageOptions(
467
+ loggedInUser,
468
+ messageObject,
469
+ theme,
470
+ group,
471
+ additionalParams
472
+ )
473
+ );
474
+ break;
475
+ case MessageTypeConstants.text:
476
+ optionsList.push(
477
+ ...ChatConfigurator.dataSource.getTextMessageOptions(
478
+ loggedInUser,
479
+ messageObject,
480
+ theme,
481
+ group,
482
+ additionalParams
483
+ )
484
+ );
485
+ break;
486
+ case MessageTypeConstants.file:
487
+ optionsList.push(
488
+ ...ChatConfigurator.dataSource.getFileMessageOptions(
489
+ loggedInUser,
490
+ messageObject,
491
+ theme,
492
+ group,
493
+ additionalParams
494
+ )
495
+ );
496
+ break;
497
+ }
498
+ } else if (messageObject.getCategory() == MessageCategoryConstants.custom) {
499
+ optionsList.push(
500
+ ...ChatConfigurator.dataSource.getCommonOptions(
501
+ loggedInUser,
502
+ messageObject,
503
+ theme,
504
+ group,
505
+ additionalParams
506
+ )
507
+ );
508
+ } else if (messageObject.getCategory() == MessageCategoryConstants.interactive) {
509
+ let type: string = messageObject.getType();
510
+ //todo: unsupportedBubble
511
+ }
512
+ return optionsList;
513
+ }
514
+
515
+ private validateOption(
516
+ loggedInUser: CometChat.User,
517
+ messageObject: CometChat.BaseMessage,
518
+ optionId: string,
519
+ group?: CometChat.Group | null,
520
+ additionalParams?: AdditionalParams
521
+ ): boolean {
522
+ if (
523
+ MessageOptionConstants.replyInThread === optionId &&
524
+ (!messageObject.getParentMessageId() || messageObject.getParentMessageId() === 0) &&
525
+ !additionalParams?.hideReplyInThreadOption
526
+ ) {
527
+ return true;
528
+ }
313
529
 
314
- if (isDeletedMessage(messageObject) || !isMessageSent(messageObject)) return messageOptionList;
530
+ if (
531
+ MessageOptionConstants.shareMessage === optionId &&
532
+ (messageObject instanceof CometChat.TextMessage ||
533
+ messageObject instanceof CometChat.MediaMessage) &&
534
+ !additionalParams?.hideShareMessageOption
535
+ ) {
536
+ return true;
537
+ }
315
538
 
316
- if (this.validateOption(loggedInUser, messageObject, MessageOptionConstants.replyInThread, group)) {
317
- messageOptionList.push(this.getReplyInThreadOption());
318
- }
539
+ if (
540
+ MessageOptionConstants.copyMessage === optionId &&
541
+ messageObject instanceof CometChat.TextMessage &&
542
+ !additionalParams?.hideCopyMessageOption
543
+ ) {
544
+ return true;
545
+ }
319
546
 
320
- if (this.validateOption(loggedInUser, messageObject, MessageOptionConstants.shareMessage, group)) {
321
- messageOptionList.push(this.getShareOption());
322
- }
547
+ let isSentByMe: boolean = this.isSentByMe(loggedInUser, messageObject);
323
548
 
324
- if (this.validateOption(loggedInUser, messageObject, MessageOptionConstants.messageInformation, group)) {
325
- messageOptionList.push(this.getInformationOption());
326
- }
549
+ if (
550
+ MessageOptionConstants.messageInformation === optionId &&
551
+ isSentByMe &&
552
+ !additionalParams?.hideMessageInfoOption
553
+ ) {
554
+ return true;
555
+ }
327
556
 
328
- if (this.validateOption(loggedInUser, messageObject, MessageOptionConstants.deleteMessage, group)) {
329
- messageOptionList.push(this.getDeleteOption());
330
- }
557
+ let memberIsNotParticipant: boolean = !!(
558
+ group &&
559
+ (group.getOwner() === loggedInUser.getUid() ||
560
+ group.getScope() !== GroupMemberScope.participant)
561
+ );
562
+
563
+ if (
564
+ MessageOptionConstants.deleteMessage === optionId &&
565
+ (isSentByMe || memberIsNotParticipant) &&
566
+ !additionalParams?.hideDeleteMessageOption
567
+ ) {
568
+ return true;
569
+ }
331
570
 
332
- if (this.validateOption(loggedInUser, messageObject, MessageOptionConstants.sendMessagePrivately, group)) {
333
- messageOptionList.push(this.getPrivateMessageOption());
334
- }
571
+ if (
572
+ MessageOptionConstants.editMessage === optionId &&
573
+ (isSentByMe || memberIsNotParticipant) &&
574
+ !additionalParams?.hideEditMessageOption
575
+ ) {
576
+ return true;
577
+ }
335
578
 
336
- return messageOptionList;
579
+ if (
580
+ MessageOptionConstants.sendMessagePrivately === optionId &&
581
+ group &&
582
+ loggedInUser.getUid() != messageObject.getSender()?.getUid() &&
583
+ !additionalParams?.hideMessagePrivatelyOption
584
+ ) {
585
+ return true;
337
586
  }
338
587
 
588
+ return false;
589
+ }
590
+
591
+ getCommonOptions(
592
+ loggedInUser: CometChat.User,
593
+ messageObject: CometChat.BaseMessage,
594
+ theme: CometChatTheme,
595
+ group?: CometChat.Group,
596
+ additionalParams?: AdditionalParams
597
+ ): CometChatMessageOption[] {
598
+ let messageOptionList: CometChatMessageOption[] = [];
599
+
600
+ if (isDeletedMessage(messageObject)) return messageOptionList;
601
+
602
+ if (
603
+ this.validateOption(
604
+ loggedInUser,
605
+ messageObject,
606
+ MessageOptionConstants.replyInThread,
607
+ group,
608
+ additionalParams
609
+ )
610
+ ) {
611
+ messageOptionList.push(this.getReplyInThreadOption(theme));
612
+ }
339
613
 
614
+ if (
615
+ this.validateOption(
616
+ loggedInUser,
617
+ messageObject,
618
+ MessageOptionConstants.shareMessage,
619
+ group,
620
+ additionalParams
621
+ )
622
+ ) {
623
+ messageOptionList.push(this.getShareOption(theme));
624
+ }
340
625
 
341
- getGroupActionBubble(message: CometChat.BaseMessage, theme: CometChatTheme): JSX.Element | null {
342
- if (isActionMessage(message)) {
343
- const messageText = MessageUtils.getActionMessage(message);
344
- return <CometChatTextBubble
345
- text={messageText}
346
- textContainerStyle={{ marginStart: 4, marginEnd: 4 }}
347
- style={{
348
- backgroundColor: theme?.palette?.getAccent50(),
349
- textFont: {
350
- fontSize: theme?.typography?.subtitle2?.fontSize,
351
- fontWeight: theme?.typography?.subtitle2?.fontWeight,
352
- },
353
- textColor: theme?.palette?.getAccent600()
354
- }}
355
- />;
356
- }
357
- return null;
358
- }
359
-
360
- getBottomView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType): JSX.Element | null {
361
- return null;
362
- }
363
-
364
- getDeleteMessageBubble(message: CometChat.BaseMessage, theme: CometChatTheme): JSX.Element {
365
- return <View style={{ paddingBottom: 8, borderWidth: 1, borderStyle: "dashed", borderRadius: 8, borderColor: theme?.palette?.getAccent600() }}>
366
- <CometChatTextBubble
367
- textContainerStyle={{ marginStart: 4, marginEnd: 4 }}
368
- text={localize("MESSAGE_IS_DELETED")}
369
- style={{
370
- backgroundColor: "transparent",
371
- textFont: {
372
- fontSize: theme?.typography?.subtitle2?.fontSize,
373
- fontWeight: theme?.typography?.subtitle2?.fontWeight,
374
- },
375
- textColor: theme?.palette?.getAccent600()
376
- }}
377
- />
378
- </View>
379
- }
380
-
381
- getVideoMessageBubble(videoUrl: string, thumbnailUrl: string, message: CometChat.MediaMessage, theme: CometChatTheme, videoBubbleStyle: VideoBubbleStyleInterface) {
382
- if (isVideoMessage(message)) {
383
- return <CometChatVideoBubble
384
- videoUrl={videoUrl}
385
- thumbnailUrl={{ uri: thumbnailUrl }}
386
- style={{ height: 200, width: 200, borderRadius: 8, ...videoBubbleStyle }}
387
- />
388
- }
389
- return null;
390
- }
391
-
392
- getTextMessageBubble(messageText: string, message: CometChat.TextMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme, additionalParams?: AdditionalBubbleStylingParams): JSX.Element | null {
393
- let loggedInUser = CometChatUIKit.loggedInUser;
394
- if(loggedInUser) {
395
- let mentionedUsers = message.getMentionedUsers();
396
- let textFormatters = [...(additionalParams?.textFormatters ?? [])];
397
-
398
- let linksTextFormatter = ChatConfigurator.getDataSource().getUrlsFormatter(loggedInUser);
399
- linksTextFormatter.setMessage(message);
400
- linksTextFormatter.setId("ccDefaultUrlsFormatterId")
401
- textFormatters.push(linksTextFormatter);
402
-
403
- if (!additionalParams?.disableMentions && mentionedUsers && mentionedUsers.length ) {
404
-
405
- let mentionsTextFormatter = ChatConfigurator.getDataSource().getMentionsFormatter(loggedInUser);
406
- mentionsTextFormatter.setLoggedInUser(loggedInUser);
407
- mentionsTextFormatter.setId("ccDefaultMentionFormatterId")
408
- let isUserSentMessage = alignment === "right";
409
- if (isUserSentMessage) {
410
- mentionsTextFormatter.setMentionsStyle(
411
- new MentionTextStyle({
412
- loggedInUserTextStyle: {
413
- color: theme.palette.getTertiary(),
414
- ...theme.typography.title2,
415
- fontSize: 16
416
- } as TextStyle,
417
- textStyle: {
418
- color: theme.palette.getTertiary(),
419
- ...theme.typography.subtitle1,
420
- fontSize: 16
421
- } as TextStyle,
422
- })
423
- );
424
- } else {
425
- mentionsTextFormatter.setMentionsStyle(
426
- new MentionTextStyle({
427
- loggedInUserTextStyle: {
428
- color: theme.palette.getPrimary(),
429
- ...theme.typography.title2,
430
- fontSize: 16
431
- } as TextStyle,
432
- textStyle: {
433
- color: theme.palette.getPrimary(),
434
- ...theme.typography.subtitle1,
435
- fontSize: 16
436
- } as TextStyle,
437
- })
438
- );
439
- }
440
-
441
- textFormatters.push(mentionsTextFormatter);
442
-
443
- }
444
-
445
- let finalFormatters: any[] = [];
446
-
447
- let customerHasPassedUrlsFormatter;
448
-
449
- textFormatters.forEach(formatter => {
450
- if (formatter instanceof CometChatUrlsFormatter) {
451
- if (formatter.getId() !== "ccDefaultUrlsFormatterId") {
452
- customerHasPassedUrlsFormatter = true
453
- }
454
- }
455
- formatter.setMessage(message);
456
- let suggestionUsers = formatter.getSuggestionItems();
457
- suggestionUsers.length > 0 && formatter.setSuggestionItems(suggestionUsers);
458
- let _formatter = CommonUtils.clone(formatter);
459
- finalFormatters.push(_formatter);
460
- })
461
-
462
- if (customerHasPassedUrlsFormatter) {
463
- let customUrlsIndex = finalFormatters.findIndex((formatter: CometChatTextFormatter[]) => (formatter instanceof CometChatUrlsFormatter && formatter.getId() === "ccDefaultUrlsFormatterId"));
464
- if (customUrlsIndex > -1) {
465
- finalFormatters.splice(customUrlsIndex, 1);
466
- }
467
- }
468
-
469
- return <CometChatTextBubble
470
- text={messageText}
471
- style={{
472
- backgroundColor: "transparent",
473
- textFont: theme?.typography.body,
474
- textColor: alignment == "right" ? theme?.palette.getSecondary() : theme?.palette?.getAccent(),
475
- borderRadius: 8
476
- }}
477
- textFormatters={finalFormatters}
478
- />
626
+ if (
627
+ this.validateOption(
628
+ loggedInUser,
629
+ messageObject,
630
+ MessageOptionConstants.messageInformation,
631
+ group,
632
+ additionalParams
633
+ )
634
+ ) {
635
+ messageOptionList.push(this.getInformationOption(theme));
636
+ }
479
637
 
480
- }
481
- return null
638
+ if (
639
+ this.validateOption(
640
+ loggedInUser,
641
+ messageObject,
642
+ MessageOptionConstants.deleteMessage,
643
+ group,
644
+ additionalParams
645
+ )
646
+ ) {
647
+ messageOptionList.push(this.getDeleteOption(theme));
482
648
  }
483
649
 
484
- getFormMessageBubble(message: FormMessage, theme: CometChatTheme, style?: FormBubbleStyle, onSubmitClick?: (data: any) => void): JSX.Element {
485
- return <CometChatFormBubble
486
- message={message}
487
- onSubmitClick={onSubmitClick}
488
- style={style}
489
- />
650
+ if (
651
+ this.validateOption(
652
+ loggedInUser,
653
+ messageObject,
654
+ MessageOptionConstants.sendMessagePrivately,
655
+ group,
656
+ additionalParams
657
+ )
658
+ ) {
659
+ messageOptionList.push(this.getPrivateMessageOption(theme));
490
660
  }
491
661
 
492
- getSchedulerMessageBubble(message: SchedulerMessage, theme: CometChatTheme, style?: SchedulerBubbleStyles, onScheduleClick?: (data: any) => void): JSX.Element {
493
- return <CometChatSchedulerBubble
494
- schedulerMessage={message}
495
- onScheduleClick={onScheduleClick}
496
- style={style}
662
+ return messageOptionList;
663
+ }
664
+
665
+ getGroupActionBubble(message: CometChat.BaseMessage, theme: CometChatTheme): JSX.Element | null {
666
+ if (isActionMessage(message)) {
667
+ return (
668
+ <CometChatTextBubble
669
+ text={`${message.getMessage()}`}
670
+ textContainerStyle={theme.messageListStyles.groupActionBubbleStyles.textContainerStyle}
671
+ textStyle={theme.messageListStyles.groupActionBubbleStyles.textStyle}
497
672
  />
673
+ );
498
674
  }
499
-
500
- getCardMessageBubble(message: CardMessage, theme: CometChatTheme, style?: CardBubbleStyle, onSubmitClick?: (data: any) => void): JSX.Element {
501
- return <CometChatCardBubble
502
- message={message}
503
- onSubmitClick={onSubmitClick}
504
- style={style}
675
+ return null;
676
+ }
677
+
678
+ getBottomView(
679
+ message: CometChat.BaseMessage,
680
+ alignment: MessageBubbleAlignmentType
681
+ ): JSX.Element | null {
682
+ return null;
683
+ }
684
+
685
+ getDeleteMessageBubble(message: CometChat.BaseMessage, theme: CometChatTheme): JSX.Element {
686
+ let loggedInUser = CometChatUIKit.loggedInUser;
687
+
688
+ const _style =
689
+ loggedInUser && message.getSender().getUid() === loggedInUser.getUid()
690
+ ? theme.messageListStyles.outgoingMessageBubbleStyles
691
+ : theme.messageListStyles.incomingMessageBubbleStyles;
692
+ return <CometChatDeletedBubble style={_style?.deletedBubbleStyles} />;
693
+ }
694
+
695
+ getVideoMessageBubble(
696
+ videoUrl: string,
697
+ thumbnailUrl: string,
698
+ message: CometChat.MediaMessage,
699
+ theme: CometChatTheme
700
+ ): JSX.Element | null {
701
+ let loggedInUser = CometChatUIKit.loggedInUser;
702
+ if (isVideoMessage(message)) {
703
+ const _style =
704
+ message.getSender().getUid() === loggedInUser!.getUid()
705
+ ? theme.messageListStyles.outgoingMessageBubbleStyles?.videoBubbleStyles
706
+ : theme.messageListStyles.incomingMessageBubbleStyles?.videoBubbleStyles;
707
+ return (
708
+ <CometChatVideoBubble
709
+ videoUrl={videoUrl}
710
+ thumbnailUrl={{ uri: thumbnailUrl }}
711
+ imageStyle={_style?.imageStyle}
712
+ playIcon={_style?.playIcon}
713
+ playIconStyle={_style?.playIconStyle}
714
+ playIconContainerStyle={_style?.playIconContainerStyle}
715
+ placeholderImage={_style?.placeholderImage}
505
716
  />
717
+ );
718
+ }
719
+ return null;
720
+ }
721
+
722
+ getTextMessageBubble(
723
+ messageText: string,
724
+ message: CometChat.TextMessage,
725
+ alignment: MessageBubbleAlignmentType,
726
+ theme: CometChatTheme,
727
+ additionalParams?: AdditionalParams
728
+ ): JSX.Element {
729
+ let loggedInUser = CometChatUIKit.loggedInUser;
730
+ let mentionedUsers = message.getMentionedUsers();
731
+ let textFormatters = [...(additionalParams?.textFormatters || [])];
732
+ const isMessageSentByLoggedInUser = message.getSender().getUid() === loggedInUser!.getUid();
733
+ const _style: Partial<CometChatTheme["textBubbleStyles"]> = isMessageSentByLoggedInUser
734
+ ? (theme.messageListStyles.outgoingMessageBubbleStyles
735
+ .textBubbleStyles as CometChatTheme["textBubbleStyles"])
736
+ : (theme.messageListStyles.incomingMessageBubbleStyles
737
+ .textBubbleStyles as CometChatTheme["textBubbleStyles"]);
738
+
739
+ let linksTextFormatter = ChatConfigurator.getDataSource().getUrlsFormatter(loggedInUser!);
740
+ let mentionsTextFormatter = ChatConfigurator.getDataSource().getMentionsFormatter(
741
+ loggedInUser!
742
+ );
743
+ linksTextFormatter.setMessage(message);
744
+ linksTextFormatter.setId("ccDefaultUrlsFormatterId");
745
+ linksTextFormatter.setStyle({ linkTextColor: theme.color.receiveBubbleLink });
746
+ if (isMessageSentByLoggedInUser) {
747
+ linksTextFormatter.setStyle({ linkTextColor: theme.color.sendBubbleText });
506
748
  }
507
749
 
508
- getImageMessageBubble(imageUrl: string, caption: string, style: ImageBubbleStyleInterface, message: CometChat.MediaMessage, theme: CometChatTheme): JSX.Element | null {
509
- if (isImageMessage(message)) {
510
- return <CometChatImageBubble
511
- imageUrl={{ uri: imageUrl }}
512
- style={{ height: 200, width: 200, borderRadius: 8, ...style }}
513
- />
514
- }
515
- return null;
750
+ if (!additionalParams?.disableMentions && mentionedUsers && mentionedUsers.length) {
751
+ mentionsTextFormatter.setLoggedInUser(loggedInUser!);
752
+ mentionsTextFormatter.setMessage(message);
753
+ mentionsTextFormatter.setId("ccDefaultMentionFormatterId");
754
+ let isUserSentMessage = message.getSender().getUid() == loggedInUser!.getUid();
755
+ if (isUserSentMessage) {
756
+ mentionsTextFormatter.setMentionsStyle(_style?.mentionsStyle);
757
+ } else {
758
+ mentionsTextFormatter.setMentionsStyle(_style?.mentionsStyle);
759
+ }
760
+ mentionsTextFormatter.setTextStyle(_style?.textStyle);
516
761
  }
517
762
 
518
- getAudioMessageBubble(audioUrl: string, title: string, style: AudioBubbleStyleInterface, message: CometChat.MediaMessage, theme: CometChatTheme): JSX.Element | null {
519
- if (isAudioMessage(message)) {
520
- return <CometChatAudioBubble
521
- audioUrl={audioUrl}
522
- title={title}
523
- style={{ width: 200, borderRadius: 8, ...style }}
524
- />
525
- }
526
- return null;
763
+ let finalFormatters: CometChatTextFormatter[] = [];
764
+
765
+ let urlFormatterExists = false;
766
+ let mentionsFormatterExists = false;
767
+
768
+ for (const formatter of textFormatters) {
769
+ if (formatter instanceof CometChatUrlsFormatter) {
770
+ urlFormatterExists = true;
771
+ }
772
+
773
+ if (formatter instanceof CometChatMentionsFormatter) {
774
+ mentionsFormatterExists = true;
775
+ formatter.setMessage(message);
776
+ formatter.setTargetElement(MentionsTargetElement.textbubble);
777
+ formatter.setLoggedInUser(CometChatUIKit.loggedInUser!);
778
+ }
779
+ formatter.setMessage(message);
780
+ finalFormatters.push(CommonUtils.clone(formatter));
781
+ if (urlFormatterExists && mentionsFormatterExists) {
782
+ break;
783
+ }
527
784
  }
528
785
 
529
- getFileMessageBubble(fileUrl: string, title: string, style: FileBubbleStyleInterface, message: CometChat.MediaMessage, theme: CometChatTheme): JSX.Element | null {
530
- if (isFileMessage(message)) {
531
- return <CometChatFileBubble
532
- fileUrl={fileUrl}
533
- title={title}
534
- style={{ width: 200, ...style }}
535
- />
786
+ if (!urlFormatterExists) {
787
+ finalFormatters.push(linksTextFormatter);
788
+ }
789
+ if (!mentionsFormatterExists) {
790
+ finalFormatters.push(mentionsTextFormatter);
791
+ }
792
+ return (
793
+ <CometChatTextBubble
794
+ text={messageText}
795
+ textStyle={_style?.textStyle}
796
+ textFormatters={finalFormatters}
797
+ />
798
+ );
799
+ }
800
+
801
+ getImageMessageBubble(
802
+ imageUrl: string,
803
+ caption: string,
804
+ message: CometChat.MediaMessage,
805
+ theme: CometChatTheme
806
+ ): JSX.Element {
807
+ let loggedInUser = CometChatUIKit.loggedInUser;
808
+ if (isImageMessage(message)) {
809
+ const _style =
810
+ message.getSender().getUid() === loggedInUser!.getUid()
811
+ ? theme.messageListStyles.outgoingMessageBubbleStyles?.imageBubbleStyles
812
+ : theme.messageListStyles.incomingMessageBubbleStyles?.imageBubbleStyles;
813
+
814
+ return <CometChatImageBubble imageUrl={{ uri: imageUrl }} style={_style?.imageStyle} />;
815
+ }
816
+ return <></>;
817
+ }
818
+
819
+ getAudioMessageBubble(
820
+ audioUrl: string,
821
+ title: string,
822
+ style: any, //ToDoM: remove any
823
+ message: CometChat.MediaMessage,
824
+ theme: CometChatTheme
825
+ ): JSX.Element {
826
+ let loggedInUser = CometChatUIKit.loggedInUser;
827
+ if (isAudioMessage(message)) {
828
+ const _style =
829
+ message.getSender().getUid() === loggedInUser!.getUid()
830
+ ? theme.messageListStyles.outgoingMessageBubbleStyles?.audioBubbleStyles
831
+ : theme.messageListStyles.incomingMessageBubbleStyles?.audioBubbleStyles;
832
+ return (
833
+ <CometChatAudioBubble
834
+ audioUrl={audioUrl}
835
+ //title={title}
836
+ playViewContainerStyle={_style?.playViewContainerStyle}
837
+ playIconStyle={_style?.playIconStyle}
838
+ playIconContainerStyle={_style?.playIconContainerStyle}
839
+ waveStyle={_style?.waveStyle}
840
+ waveContainerStyle={_style?.waveContainerStyle}
841
+ playProgressTextStyle={_style?.playProgressTextStyle}
842
+ />
843
+ );
844
+ }
845
+ return <></>;
846
+ }
847
+
848
+ getFileMessageBubble(
849
+ fileUrl: string,
850
+ title: string,
851
+ style: any, //ToDoM: remove any
852
+ message: CometChat.MediaMessage,
853
+ theme: CometChatTheme
854
+ ): JSX.Element {
855
+ let loggedInUser = CometChatUIKit.loggedInUser;
856
+ if (isFileMessage(message)) {
857
+ const metaData = {
858
+ attachmentObject: message.getAttachment(),
859
+ timeStamp: message.getSentAt(),
860
+ };
861
+
862
+ let subtitle: string = "";
863
+
864
+ if (
865
+ metaData.attachmentObject &&
866
+ Object.keys(metaData.attachmentObject).length &&
867
+ metaData.timeStamp
868
+ ) {
869
+ const timestamp = metaData.timeStamp * 1000;
870
+ const date = new Date(timestamp);
871
+
872
+ // Format the date as "15 Oct, 2024"
873
+ const formattedDate = date
874
+ .toLocaleDateString("en-GB", {
875
+ day: "2-digit",
876
+ month: "short",
877
+ year: "numeric",
878
+ })
879
+ .replace(/(\w{3}) (\d{4})/, "$1, $2");
880
+
881
+ const attachmentObject = metaData.attachmentObject;
882
+ let fileSizeInKB, extension, fileType;
883
+ if (attachmentObject && Object.keys(attachmentObject).length) {
884
+ fileSizeInKB = Math.round(attachmentObject.getSize() / 1024);
885
+ extension =
886
+ attachmentObject.getExtension() && attachmentObject.getExtension().toUpperCase();
887
+ fileType = extension === "PDF" ? "PDF" : extension;
536
888
  }
537
- return null;
538
- }
539
- getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme, additionalParams?: AdditionalBubbleStylingParams): JSX.Element | null {
540
- return ChatConfigurator.dataSource.getTextMessageBubble(message.getText(), message, alignment, theme, additionalParams);
541
- }
542
- getFormMessageContentView(message: FormMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element {
543
- return ChatConfigurator.dataSource.getFormMessageBubble(message, theme);
544
- }
545
- getSchedulerMessageContentView(message: SchedulerMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element {
546
- return ChatConfigurator.dataSource.getSchedulerMessageBubble(message, theme);
547
- }
548
- getCardMessageContentView(message: CardMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element {
549
- return ChatConfigurator.dataSource.getCardMessageBubble(message, theme);
550
- }
551
- getAudioMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element | null {
552
- let attachment = message.getAttachment();
553
- return ChatConfigurator.dataSource.getAudioMessageBubble(attachment.getUrl(), attachment.getName(), {
554
- iconTint: theme?.palette?.getPrimary(),
555
- backgroundColor: "transparent",
556
- titleColor: theme?.palette.getAccent(),
557
- titleFont: theme?.typography.body,
558
- subtitleColor: theme?.palette.getAccent(),
559
- subtitleFont: theme?.typography.subtitle1,
560
- }, message, theme);
561
- }
562
- getVideoMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element | null {
563
- let attachment = message.getAttachment();
564
- return ChatConfigurator.dataSource.getVideoMessageBubble(
565
- attachment.getUrl(),
566
- '',
889
+ subtitle = `${formattedDate} • ${fileSizeInKB ? fileSizeInKB + " KB" : "----"} • ${
890
+ fileType ? fileType : "----"
891
+ }`;
892
+ }
893
+
894
+ const _style =
895
+ message.getSender().getUid() === loggedInUser!.getUid()
896
+ ? theme.messageListStyles.outgoingMessageBubbleStyles?.fileBubbleStyles
897
+ : theme.messageListStyles.incomingMessageBubbleStyles?.fileBubbleStyles;
898
+ return (
899
+ <CometChatFileBubble
900
+ fileUrl={fileUrl}
901
+ title={title}
902
+ titleStyle={_style?.titleStyle}
903
+ subtitleStyle={_style?.subtitleStyle}
904
+ downloadIcon={_style?.downloadIcon}
905
+ downloadIconStyle={_style?.downloadIconStyle}
906
+ subtitle={subtitle}
907
+ />
908
+ );
909
+ }
910
+ return <></>;
911
+ }
912
+ getTextMessageContentView(
913
+ message: CometChat.TextMessage,
914
+ alignment: MessageBubbleAlignmentType,
915
+ theme: CometChatTheme,
916
+ additionalParams?: AdditionalParams
917
+ ): JSX.Element {
918
+ return ChatConfigurator.dataSource.getTextMessageBubble(
919
+ message.getText(),
920
+ message,
921
+ alignment,
922
+ theme,
923
+ additionalParams
924
+ );
925
+ }
926
+ getAudioMessageContentView(
927
+ message: CometChat.MediaMessage,
928
+ alignment: MessageBubbleAlignmentType,
929
+ theme: CometChatTheme
930
+ ): JSX.Element {
931
+ let attachment = message.getAttachment();
932
+ return ChatConfigurator.dataSource.getAudioMessageBubble(
933
+ attachment.getUrl(),
934
+ attachment.getName(),
935
+ {},
936
+ message,
937
+ theme
938
+ );
939
+ }
940
+ getVideoMessageContentView(
941
+ message: CometChat.MediaMessage,
942
+ alignment: MessageBubbleAlignmentType,
943
+ theme: CometChatTheme
944
+ ): JSX.Element | null {
945
+ let attachment = message.getAttachment();
946
+ return ChatConfigurator.dataSource.getVideoMessageBubble(
947
+ attachment.getUrl(),
948
+ "",
949
+ message,
950
+ theme
951
+ );
952
+ }
953
+ getImageMessageContentView(
954
+ message: CometChat.MediaMessage,
955
+ alignment: MessageBubbleAlignmentType,
956
+ theme: CometChatTheme
957
+ ): JSX.Element | null {
958
+ let attachment = message.getAttachment();
959
+ let url: string = attachment.getUrl();
960
+ if (url == undefined) url = message["data"]["url"];
961
+
962
+ return ChatConfigurator.dataSource.getImageMessageBubble(
963
+ url,
964
+ attachment.getName(),
965
+ message,
966
+ theme
967
+ );
968
+ }
969
+ getFileMessageContentView(
970
+ message: CometChat.MediaMessage,
971
+ alignment: MessageBubbleAlignmentType,
972
+ theme: CometChatTheme
973
+ ): JSX.Element {
974
+ let attachment = message.getAttachment();
975
+ return ChatConfigurator.dataSource.getFileMessageBubble(
976
+ attachment.getUrl(),
977
+ attachment.getName(),
978
+ {},
979
+ message,
980
+ theme
981
+ );
982
+ }
983
+
984
+ getTextMessageTemplate(
985
+ theme: CometChatTheme,
986
+ additionalParams?: AdditionalParams
987
+ ): CometChatMessageTemplate {
988
+ return new CometChatMessageTemplate({
989
+ type: MessageTypeConstants.text,
990
+ category: MessageCategoryConstants.message,
991
+ ContentView: (message: CometChat.BaseMessage, _alignment: MessageBubbleAlignmentType) => {
992
+ if (isDeletedMessage(message)) {
993
+ return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
994
+ } else {
995
+ return ChatConfigurator.dataSource.getTextMessageContentView(
567
996
  message,
997
+ _alignment,
568
998
  theme,
569
- {
570
- backgroundColor: "transparent",
571
- playIconBackgroundColor: theme?.palette?.getAccent50(),
572
- playIconTint: theme?.palette.getPrimary(),
573
- }
999
+ additionalParams
1000
+ );
1001
+ }
1002
+ },
1003
+ options: (loggedInuser, message, theme, group) =>
1004
+ ChatConfigurator.dataSource.getTextMessageOptions(
1005
+ loggedInuser,
1006
+ message,
1007
+ theme,
1008
+ group,
1009
+ additionalParams
1010
+ ),
1011
+ BottomView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
1012
+ return ChatConfigurator.dataSource.getBottomView(message, alignment);
1013
+ },
1014
+ });
1015
+ }
1016
+
1017
+ getAudioMessageTemplate(
1018
+ theme: CometChatTheme,
1019
+ additionalParams?: AdditionalParams
1020
+ ): CometChatMessageTemplate {
1021
+ return new CometChatMessageTemplate({
1022
+ type: MessageTypeConstants.audio,
1023
+ category: MessageCategoryConstants.message,
1024
+ ContentView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
1025
+ if (isDeletedMessage(message)) {
1026
+ return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
1027
+ } else
1028
+ return ChatConfigurator.dataSource.getAudioMessageContentView(message, alignment, theme);
1029
+ },
1030
+ options: (loggedInuser, message, theme, group) =>
1031
+ ChatConfigurator.dataSource.getAudioMessageOptions(
1032
+ loggedInuser,
1033
+ message,
1034
+ theme,
1035
+ group,
1036
+ additionalParams
1037
+ ),
1038
+ BottomView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
1039
+ return ChatConfigurator.dataSource.getBottomView(message, alignment);
1040
+ },
1041
+ });
1042
+ }
1043
+ getVideoMessageTemplate(
1044
+ theme: CometChatTheme,
1045
+ additionalParams?: AdditionalParams
1046
+ ): CometChatMessageTemplate {
1047
+ return new CometChatMessageTemplate({
1048
+ type: MessageTypeConstants.video,
1049
+ category: MessageCategoryConstants.message,
1050
+ ContentView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
1051
+ if (isDeletedMessage(message)) {
1052
+ return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
1053
+ } else
1054
+ return ChatConfigurator.dataSource.getVideoMessageContentView(message, alignment, theme);
1055
+ },
1056
+ options: (loggedInuser, message, theme, group) =>
1057
+ ChatConfigurator.dataSource.getVideoMessageOptions(
1058
+ loggedInuser,
1059
+ message,
1060
+ theme,
1061
+ group,
1062
+ additionalParams
1063
+ ),
1064
+ BottomView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
1065
+ return ChatConfigurator.dataSource.getBottomView(message, alignment);
1066
+ },
1067
+ });
1068
+ }
1069
+ getImageMessageTemplate(
1070
+ theme: CometChatTheme,
1071
+ additionalParams?: AdditionalParams
1072
+ ): CometChatMessageTemplate {
1073
+ return new CometChatMessageTemplate({
1074
+ type: MessageTypeConstants.image,
1075
+ category: MessageCategoryConstants.message,
1076
+ ContentView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
1077
+ if (isDeletedMessage(message)) {
1078
+ return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
1079
+ } else
1080
+ return ChatConfigurator.dataSource.getImageMessageContentView(message, alignment, theme);
1081
+ },
1082
+ options: (loggedInuser, message, theme, group) =>
1083
+ ChatConfigurator.dataSource.getImageMessageOptions(
1084
+ loggedInuser,
1085
+ message,
1086
+ theme,
1087
+ group,
1088
+ additionalParams
1089
+ ),
1090
+ BottomView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
1091
+ return ChatConfigurator.dataSource.getBottomView(message, alignment);
1092
+ },
1093
+ });
1094
+ }
1095
+ getFileMessageTemplate(
1096
+ theme: CometChatTheme,
1097
+ additionalParams?: AdditionalParams
1098
+ ): CometChatMessageTemplate {
1099
+ return new CometChatMessageTemplate({
1100
+ type: MessageTypeConstants.file,
1101
+ category: MessageCategoryConstants.message,
1102
+ ContentView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
1103
+ if (isDeletedMessage(message)) {
1104
+ return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
1105
+ } else
1106
+ return ChatConfigurator.dataSource.getFileMessageContentView(message, alignment, theme);
1107
+ },
1108
+ options: (loggedInuser, message, theme, group) =>
1109
+ ChatConfigurator.dataSource.getFileMessageOptions(
1110
+ loggedInuser,
1111
+ message,
1112
+ theme,
1113
+ group,
1114
+ additionalParams
1115
+ ),
1116
+ BottomView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
1117
+ return ChatConfigurator.dataSource.getBottomView(message, alignment);
1118
+ },
1119
+ });
1120
+ }
1121
+
1122
+ getFormMessageTemplate(
1123
+ theme: CometChatTheme,
1124
+ additionalParams?: AdditionalParams
1125
+ ): CometChatMessageTemplate {
1126
+ return new CometChatMessageTemplate({
1127
+ type: MessageTypeConstants.form,
1128
+ category: MessageCategoryConstants.interactive,
1129
+ ContentView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
1130
+ const loggedInUser = CometChatUIKit.loggedInUser;
1131
+ const _style =
1132
+ loggedInUser && message.getSender().getUid() === loggedInUser.getUid()
1133
+ ? theme.messageListStyles.outgoingMessageBubbleStyles
1134
+ : theme.messageListStyles.incomingMessageBubbleStyles;
1135
+ return (
1136
+ <CometChatDeletedBubble
1137
+ text={localize("NOT_SUPPORTED") ?? "This message type is not supported"}
1138
+ style={_style?.deletedBubbleStyles}
1139
+ />
574
1140
  );
1141
+ },
1142
+ options: (loggedInuser, message, theme, group) => [],
1143
+ BottomView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
1144
+ return <></>;
1145
+ },
1146
+ });
1147
+ }
1148
+
1149
+ getSchedulerMessageTemplate(
1150
+ theme: CometChatTheme,
1151
+ additionalParams?: AdditionalParams
1152
+ ): CometChatMessageTemplate {
1153
+ return new CometChatMessageTemplate({
1154
+ type: MessageTypeConstants.scheduler,
1155
+ category: MessageCategoryConstants.interactive,
1156
+ ContentView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
1157
+ const loggedInUser = CometChatUIKit.loggedInUser;
1158
+ const _style =
1159
+ loggedInUser && message.getSender().getUid() === loggedInUser.getUid()
1160
+ ? theme.messageListStyles.outgoingMessageBubbleStyles
1161
+ : theme.messageListStyles.incomingMessageBubbleStyles;
1162
+ return (
1163
+ <CometChatDeletedBubble
1164
+ text={localize("NOT_SUPPORTED") ?? "This message type is not supported"}
1165
+ style={_style?.deletedBubbleStyles}
1166
+ />
1167
+ );
1168
+ },
1169
+ options: (loggedInuser, message, theme, group) => [],
1170
+ BottomView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
1171
+ return <></>;
1172
+ },
1173
+ });
1174
+ }
1175
+
1176
+ getCardMessageTemplate(
1177
+ theme: CometChatTheme,
1178
+ additionalParams?: AdditionalParams
1179
+ ): CometChatMessageTemplate {
1180
+ return new CometChatMessageTemplate({
1181
+ type: MessageTypeConstants.card,
1182
+ category: MessageCategoryConstants.interactive,
1183
+ ContentView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
1184
+ const loggedInUser = CometChatUIKit.loggedInUser;
1185
+ const _style =
1186
+ loggedInUser && message.getSender().getUid() === loggedInUser.getUid()
1187
+ ? theme.messageListStyles.outgoingMessageBubbleStyles
1188
+ : theme.messageListStyles.incomingMessageBubbleStyles;
1189
+ return (
1190
+ <CometChatDeletedBubble
1191
+ text={localize("NOT_SUPPORTED") ?? "This message type is not supported"}
1192
+ style={_style?.deletedBubbleStyles}
1193
+ />
1194
+ );
1195
+ },
1196
+ options: (loggedInuser, message, theme, group) => [],
1197
+ BottomView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
1198
+ return <></>;
1199
+ },
1200
+ });
1201
+ }
1202
+
1203
+ getGroupActionTemplate(
1204
+ theme: CometChatTheme,
1205
+ additionalParams?: AdditionalParams
1206
+ ): CometChatMessageTemplate {
1207
+ return new CometChatMessageTemplate({
1208
+ type: MessageTypeConstants.groupMember,
1209
+ category: MessageCategoryConstants.action,
1210
+ ContentView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
1211
+ return ChatConfigurator.dataSource.getGroupActionBubble(message, theme);
1212
+ },
1213
+ });
1214
+ }
1215
+
1216
+ getAllMessageTemplates(
1217
+ theme: CometChatTheme,
1218
+ additionalParams?: AdditionalParams
1219
+ ): CometChatMessageTemplate[] {
1220
+ return [
1221
+ ChatConfigurator.dataSource.getTextMessageTemplate(theme, additionalParams),
1222
+ ChatConfigurator.dataSource.getAudioMessageTemplate(theme, additionalParams),
1223
+ ChatConfigurator.dataSource.getVideoMessageTemplate(theme, additionalParams),
1224
+ ChatConfigurator.dataSource.getFileMessageTemplate(theme, additionalParams),
1225
+ ChatConfigurator.dataSource.getImageMessageTemplate(theme, additionalParams),
1226
+ ChatConfigurator.dataSource.getGroupActionTemplate(theme, additionalParams),
1227
+ ChatConfigurator.dataSource.getGroupActionTemplate(theme, additionalParams),
1228
+ ChatConfigurator.dataSource.getFormMessageTemplate(theme, additionalParams),
1229
+ ChatConfigurator.dataSource.getSchedulerMessageTemplate(theme, additionalParams),
1230
+ ChatConfigurator.dataSource.getCardMessageTemplate(theme, additionalParams),
1231
+ ];
1232
+ }
1233
+
1234
+ getMessageTemplate(
1235
+ messageType: string,
1236
+ MessageCategory: string,
1237
+ theme: CometChatTheme,
1238
+ additionalParams?: AdditionalParams
1239
+ ): CometChatMessageTemplate | null {
1240
+ // let _theme: CometChatTheme = useContext("theme") ???
1241
+ let template: CometChatMessageTemplate;
1242
+
1243
+ //in case of call message return undefined
1244
+ if (MessageCategory == MessageCategoryConstants.call) return null;
1245
+
1246
+ switch (messageType) {
1247
+ case MessageTypeConstants.text:
1248
+ template = ChatConfigurator.dataSource.getTextMessageTemplate(theme, additionalParams);
1249
+ break;
1250
+ case MessageTypeConstants.audio:
1251
+ template = ChatConfigurator.dataSource.getAudioMessageTemplate(theme, additionalParams);
1252
+ break;
1253
+ case MessageTypeConstants.video:
1254
+ template = ChatConfigurator.dataSource.getVideoMessageTemplate(theme, additionalParams);
1255
+ break;
1256
+ case MessageTypeConstants.groupActions:
1257
+ case MessageTypeConstants.groupMember:
1258
+ template = ChatConfigurator.dataSource.getGroupActionTemplate(theme, additionalParams);
1259
+ break;
1260
+ case MessageTypeConstants.file:
1261
+ template = ChatConfigurator.dataSource.getFileMessageTemplate(theme, additionalParams);
1262
+ break;
1263
+ case MessageTypeConstants.form:
1264
+ template = ChatConfigurator.dataSource.getFormMessageTemplate(theme, additionalParams);
1265
+ break;
1266
+ case MessageTypeConstants.scheduler:
1267
+ template = ChatConfigurator.dataSource.getSchedulerMessageTemplate(theme, additionalParams);
1268
+ break;
1269
+ case MessageTypeConstants.card:
1270
+ template = ChatConfigurator.dataSource.getCardMessageTemplate(theme, additionalParams);
1271
+ break;
1272
+ }
1273
+ return null;
1274
+ }
1275
+
1276
+ getAllMessageTypes(): string[] {
1277
+ return [
1278
+ CometChatMessageTypes.text,
1279
+ CometChatMessageTypes.image,
1280
+ CometChatMessageTypes.audio,
1281
+ CometChatMessageTypes.video,
1282
+ CometChatMessageTypes.file,
1283
+ MessageTypeConstants.groupActions,
1284
+ MessageTypeConstants.groupMember,
1285
+ MessageTypeConstants.form,
1286
+ MessageTypeConstants.card,
1287
+ MessageTypeConstants.scheduler,
1288
+ ];
1289
+ }
1290
+ getAllMessageCategories(): string[] {
1291
+ return [
1292
+ MessageCategoryConstants.message,
1293
+ MessageCategoryConstants.action,
1294
+ MessageCategoryConstants.interactive,
1295
+ ];
1296
+ }
1297
+ getAuxiliaryOptions(
1298
+ user: CometChat.User,
1299
+ group: CometChat.Group,
1300
+ id: Map<string, any>,
1301
+ additionalAuxiliaryParams?: AdditionalAuxiliaryOptionsParams
1302
+ ): JSX.Element[] {
1303
+ return [];
1304
+ }
1305
+ getAuxiliaryHeaderAppbarOptions(
1306
+ user?: CometChat.User,
1307
+ group?: CometChat.Group,
1308
+ additionalAuxiliaryHeaderOptionsParams?: AdditionalAuxiliaryHeaderOptionsParams
1309
+ ): JSX.Element | null {
1310
+ return null;
1311
+ }
1312
+ getId(): string {
1313
+ return "messageUtils";
1314
+ }
1315
+ getMessageTypeToSubtitle(messageType: string): string {
1316
+ let subtitle: string = messageType;
1317
+ switch (messageType) {
1318
+ case MessageTypeConstants.text:
1319
+ subtitle = localize("TEXT");
1320
+ break;
1321
+ case MessageTypeConstants.image:
1322
+ subtitle = localize("MESSAGE_IMAGE");
1323
+ break;
1324
+ case MessageTypeConstants.video:
1325
+ subtitle = localize("MESSAGE_VIDEO");
1326
+ break;
1327
+ case MessageTypeConstants.file:
1328
+ subtitle = localize("MESSAGE_FILE");
1329
+ break;
1330
+ case MessageTypeConstants.audio:
1331
+ subtitle = localize("MESSAGE_AUDIO");
1332
+ break;
1333
+ default:
1334
+ subtitle = messageType;
1335
+ break;
575
1336
  }
576
- getImageMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element | null {
577
- let attachment = message.getAttachment();
578
- let url: string = attachment.getUrl();
579
- if (url == undefined)
580
- url = message['data']['url'];
581
-
582
- return ChatConfigurator.dataSource.getImageMessageBubble(url, attachment.getName(), {
583
- backgroundColor: theme?.palette.getAccent50()
584
- }, message, theme);
585
- }
586
- getFileMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element | null {
587
- let attachment = message.getAttachment();
588
- return ChatConfigurator.dataSource.getFileMessageBubble(attachment.getUrl(), attachment.getName(),
589
- {
590
- iconTint: theme?.palette?.getPrimary(),
591
- backgroundColor: "transparent",
592
- titleColor: theme?.palette.getAccent(),
593
- titleFont: theme?.typography.body,
594
- subtitleColor: theme?.palette.getAccent(),
595
- subtitleFont: theme?.typography.subtitle1,
1337
+ return subtitle;
1338
+ }
1339
+ usersActionList = (
1340
+ theme: CometChatTheme,
1341
+ additionalAttachmentOptionsParams?: AdditionalAttachmentOptionsParams
1342
+ ) => {
1343
+ const attachmentOptions = [];
1344
+ if (!additionalAttachmentOptionsParams?.hideCameraOption) {
1345
+ attachmentOptions.push({
1346
+ id: MessageTypeConstants.takePhoto,
1347
+ title: localize("CAMERA"),
1348
+ icon: (
1349
+ <Icon
1350
+ name='photo-camera-fill'
1351
+ color={theme.color.primary}
1352
+ height={
1353
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1354
+ ?.height as DimensionValue
596
1355
  }
597
- , message, theme);
598
- }
599
-
600
- getTextMessageTemplate(theme: CometChatTheme, additionalParams?: AdditionalBubbleStylingParams): CometChatMessageTemplate {
601
- return new CometChatMessageTemplate({
602
- type: MessageTypeConstants.text,
603
- category: MessageCategoryConstants.message,
604
- ContentView: (message: CometChat.BaseMessage, _alignment?: MessageBubbleAlignmentType) => {
605
- if (isDeletedMessage(message)) {
606
- return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
607
- } else {
608
- return ChatConfigurator.dataSource.getTextMessageContentView(message, _alignment, theme, additionalParams);
609
- }
610
- },
611
- options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getTextMessageOptions(loggedInuser, message, group),
612
- BottomView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
613
- return ChatConfigurator.dataSource.getBottomView(message, alignment);
1356
+ width={
1357
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1358
+ ?.width as DimensionValue
614
1359
  }
615
- });
616
- }
617
-
618
- getFormMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate {
619
- return new CometChatMessageTemplate({
620
- type: MessageTypeConstants.form,
621
- category: MessageCategoryConstants.interactive,
622
- ContentView: (message: CometChat.BaseMessage, _alignment?: MessageBubbleAlignmentType) => {
623
- if (isDeletedMessage(message)) {
624
- return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
625
- } else {
626
- return ChatConfigurator.dataSource.getFormMessageContentView(message, _alignment, theme);
627
- }
628
- },
629
- options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getFormMessageOptions(loggedInuser, message, group),
630
- BottomView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
631
- return ChatConfigurator.dataSource.getBottomView(message, alignment);
1360
+ containerStyle={
1361
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle
1362
+ ?.iconContainerStyle as ViewStyle
632
1363
  }
633
- });
634
- }
635
-
636
- getSchedulerMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate {
637
- return new CometChatMessageTemplate({
638
- type: MessageTypeConstants.scheduler,
639
- category: MessageCategoryConstants.interactive,
640
- ContentView: (message: CometChat.BaseMessage, _alignment?: MessageBubbleAlignmentType) => {
641
- if (isDeletedMessage(message)) {
642
- return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
643
- } else {
644
- return ChatConfigurator.dataSource.getSchedulerMessageContentView(message, _alignment, theme);
645
- }
646
- },
647
- options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getSchedulerMessageOptions(loggedInuser, message, group),
648
- BottomView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
649
- return ChatConfigurator.dataSource.getBottomView(message, alignment);
1364
+ />
1365
+ ),
1366
+ onClick: null,
1367
+ });
1368
+ }
1369
+ if (!additionalAttachmentOptionsParams?.hideImageAttachmentOption) {
1370
+ attachmentOptions.push({
1371
+ id: MessageTypeConstants.image,
1372
+ title: localize("ATTACH_IMAGE"),
1373
+ icon: (
1374
+ <Icon
1375
+ name='photo-fill'
1376
+ color={theme.color.primary}
1377
+ height={
1378
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1379
+ ?.height as DimensionValue
650
1380
  }
651
- });
652
- }
653
-
654
- getCardMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate {
655
- return new CometChatMessageTemplate({
656
- type: MessageTypeConstants.card,
657
- category: MessageCategoryConstants.interactive,
658
- ContentView: (message: CometChat.BaseMessage, _alignment?: MessageBubbleAlignmentType) => {
659
- if (isDeletedMessage(message)) {
660
- return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
661
- } else {
662
- return ChatConfigurator.dataSource.getCardMessageContentView(message, _alignment, theme);
663
- }
664
- },
665
- options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getCardMessageOptions(loggedInuser, message, group),
666
- BottomView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
667
- return ChatConfigurator.dataSource.getBottomView(message, alignment);
1381
+ width={
1382
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1383
+ ?.width as DimensionValue
668
1384
  }
669
- });
670
- }
671
-
672
- getAudioMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate {
673
- return new CometChatMessageTemplate({
674
- type: MessageTypeConstants.audio,
675
- category: MessageCategoryConstants.message,
676
- ContentView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
677
- if (isDeletedMessage(message)) {
678
- return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
679
- } else
680
- return ChatConfigurator.dataSource.getAudioMessageContentView(message, alignment, theme);
681
- },
682
- options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getAudioMessageOptions(loggedInuser, message, group),
683
- BottomView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
684
- return ChatConfigurator.dataSource.getBottomView(message, alignment);
1385
+ containerStyle={
1386
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle
1387
+ ?.iconContainerStyle as ViewStyle
685
1388
  }
686
- })
687
- }
688
- getVideoMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate {
689
- return new CometChatMessageTemplate({
690
- type: MessageTypeConstants.video,
691
- category: MessageCategoryConstants.message,
692
- ContentView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
693
- if (isDeletedMessage(message)) {
694
- return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
695
- } else
696
- return ChatConfigurator.dataSource.getVideoMessageContentView(message, alignment, theme);
697
- },
698
- options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getVideoMessageOptions(loggedInuser, message, group),
699
- BottomView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
700
- return ChatConfigurator.dataSource.getBottomView(message, alignment);
1389
+ />
1390
+ ),
1391
+ onClick: null,
1392
+ });
1393
+ }
1394
+
1395
+ if (!additionalAttachmentOptionsParams?.hideVideoAttachmentOption) {
1396
+ attachmentOptions.push({
1397
+ id: MessageTypeConstants.video,
1398
+ title: localize("ATTACH_VIDEO"),
1399
+ icon: (
1400
+ <Icon
1401
+ name='videocam-fill'
1402
+ color={theme.color.primary}
1403
+ height={
1404
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1405
+ ?.height as DimensionValue
701
1406
  }
702
- })
703
- }
704
- getImageMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate {
705
- return new CometChatMessageTemplate({
706
- type: MessageTypeConstants.image,
707
- category: MessageCategoryConstants.message,
708
- ContentView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
709
- if (isDeletedMessage(message)) {
710
- return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
711
- } else
712
- return ChatConfigurator.dataSource.getImageMessageContentView(message, alignment, theme);
713
- },
714
- options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getImageMessageOptions(loggedInuser, message, group),
715
- BottomView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
716
- return ChatConfigurator.dataSource.getBottomView(message, alignment);
1407
+ width={
1408
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1409
+ ?.width as DimensionValue
717
1410
  }
718
- })
719
- }
720
- getFileMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate {
721
- return new CometChatMessageTemplate({
722
- type: MessageTypeConstants.file,
723
- category: MessageCategoryConstants.message,
724
- ContentView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
725
- if (isDeletedMessage(message)) {
726
- return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
727
- } else
728
- return ChatConfigurator.dataSource.getFileMessageContentView(message, alignment, theme);
729
- },
730
- options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getFileMessageOptions(loggedInuser, message, group),
731
- BottomView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
732
- return ChatConfigurator.dataSource.getBottomView(message, alignment);
1411
+ containerStyle={
1412
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle
1413
+ ?.iconContainerStyle as ViewStyle
733
1414
  }
734
- });
735
- }
736
- getGroupActionTemplate(theme: CometChatTheme): CometChatMessageTemplate {
737
- return new CometChatMessageTemplate({
738
- type: MessageTypeConstants.groupMember,
739
- category: MessageCategoryConstants.action,
740
- ContentView: (message: CometChat.BaseMessage,
741
- alignment?: MessageBubbleAlignmentType) => {
742
- return ChatConfigurator.dataSource.getGroupActionBubble(message, theme);
1415
+ />
1416
+ ),
1417
+ onClick: null,
1418
+ });
1419
+ }
1420
+
1421
+ if (!additionalAttachmentOptionsParams?.hideAudioAttachmentOption) {
1422
+ attachmentOptions.push({
1423
+ id: MessageTypeConstants.audio,
1424
+ title: localize("ATTACH_AUDIO"),
1425
+ icon: (
1426
+ <Icon
1427
+ name='play-circle-fill'
1428
+ color={theme.color.primary}
1429
+ height={
1430
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1431
+ ?.height as DimensionValue
743
1432
  }
744
- });
745
- }
746
-
747
- getAllMessageTemplates(theme: CometChatTheme, additionalParams?: AdditionalBubbleStylingParams): CometChatMessageTemplate[] | any[] {
748
- return [
749
- ChatConfigurator.dataSource.getTextMessageTemplate(theme, additionalParams),
750
- ChatConfigurator.dataSource.getFormMessageTemplate(theme),
751
- ChatConfigurator.dataSource.getSchedulerMessageTemplate(theme),
752
- ChatConfigurator.dataSource.getCardMessageTemplate(theme),
753
- ChatConfigurator.dataSource.getAudioMessageTemplate(theme),
754
- ChatConfigurator.dataSource.getVideoMessageTemplate(theme),
755
- ChatConfigurator.dataSource.getFileMessageTemplate(theme),
756
- ChatConfigurator.dataSource.getImageMessageTemplate(theme),
757
- ChatConfigurator.dataSource.getGroupActionTemplate(theme)
758
- ];
759
- }
760
-
761
- getMessageTemplate(messageType: string, MessageCategory: string, theme: CometChatTheme): CometChatMessageTemplate | null {
762
- // let _theme: CometChatTheme = useContext("theme") ???
763
- let template!: CometChatMessageTemplate | null;
764
-
765
- //in case of call message return undefined
766
- if (MessageCategory == MessageCategoryConstants.call) return template;
767
-
768
- switch (messageType) {
769
- case MessageTypeConstants.text:
770
- template = ChatConfigurator.dataSource.getTextMessageTemplate(theme)
771
- break;
772
- case MessageTypeConstants.audio:
773
- template = ChatConfigurator.dataSource.getAudioMessageTemplate(theme)
774
- break;
775
- case MessageTypeConstants.video:
776
- template = ChatConfigurator.dataSource.getVideoMessageTemplate(theme)
777
- break;
778
- case MessageTypeConstants.groupActions:
779
- case MessageTypeConstants.groupMember:
780
- template = ChatConfigurator.dataSource.getGroupActionTemplate(theme)
781
- break;
782
- case MessageTypeConstants.file:
783
- template = ChatConfigurator.dataSource.getFileMessageTemplate(theme)
784
- break;
785
- case MessageTypeConstants.form:
786
- template = ChatConfigurator.dataSource.getFormMessageTemplate(theme)
787
- break;
788
- case MessageTypeConstants.scheduler:
789
- template = ChatConfigurator.dataSource.getSchedulerMessageTemplate(theme)
790
- break;
791
- case MessageTypeConstants.card:
792
- template = ChatConfigurator.dataSource.getCardMessageTemplate(theme)
793
- break;
794
- }
795
- return template;
796
- }
797
-
798
- getAllMessageTypes(): string[] {
799
- return [
800
- CometChatMessageTypes.text,
801
- CometChatMessageTypes.image,
802
- CometChatMessageTypes.audio,
803
- CometChatMessageTypes.video,
804
- CometChatMessageTypes.file,
805
- MessageTypeConstants.groupActions,
806
- MessageTypeConstants.groupMember,
807
- MessageTypeConstants.form,
808
- MessageTypeConstants.card,
809
- MessageTypeConstants.scheduler
810
- ];
811
- }
812
- getAllMessageCategories(): string[] {
813
- return [MessageCategoryConstants.message, MessageCategoryConstants.action, MessageCategoryConstants.interactive];
814
- }
815
- getAuxiliaryOptions(user: CometChat.User, group: CometChat.Group, id: Map<string, any>, theme?: CometChatTheme): JSX.Element[] {
816
- return [];
817
- }
818
- getAuxiliaryHeaderAppbarOptions(user?: CometChat.User, group?: CometChat.Group): JSX.Element | null {
819
- return null;
820
- }
821
- getId(): string {
822
- return "messageUtils";
823
- }
824
- getMessageTypeToSubtitle(messageType: string): string {
825
- let subtitle: string = messageType;
826
- switch (messageType) {
827
- case MessageTypeConstants.text:
828
- subtitle = localize("TEXT");
829
- break;
830
- case MessageTypeConstants.image:
831
- subtitle = localize("MESSAGE_IMAGE");
832
- break;
833
- case MessageTypeConstants.video:
834
- subtitle = localize("MESSAGE_VIDEO");
835
- break;
836
- case MessageTypeConstants.file:
837
- subtitle = localize("MESSAGE_FILE");
838
- break;
839
- case MessageTypeConstants.audio:
840
- subtitle = localize("MESSAGE_AUDIO");
841
- break;
842
- default:
843
- subtitle = messageType;
844
- break;
845
- }
846
- return subtitle;
847
- }
848
- usersActionList = () => [
849
- {
850
- id: MessageTypeConstants.takePhoto,
851
- title: localize('TAKE_PHOTO'),
852
- iconUrl: ICONS.IMAGE,
853
- onClick: null,
854
- },
855
- {
856
- id: MessageTypeConstants.image,
857
- title: localize('ATTACH_IMAGE'),
858
- iconUrl: ICONS.IMAGE,
859
- onClick: null,
860
- },
861
- {
862
- id: MessageTypeConstants.audio,
863
- title: localize('ATTACH_AUDIO'),
864
- iconUrl: ICONS.AUDIO,
865
- onClick: null,
866
- },
867
- {
868
- id: MessageTypeConstants.video,
869
- title: localize('ATTACH_VIDEO'),
870
- iconUrl: ICONS.VIDEO,
871
- onClick: null,
872
- },
873
- {
874
- id: MessageTypeConstants.file,
875
- title: localize('ATTACH_FILE'),
876
- iconUrl: ICONS.FILE,
877
- onClick: null,
878
- },
879
- ];
880
- groupActionList = () => [
881
- {
882
- id: MessageTypeConstants.takePhoto,
883
- title: localize('TAKE_PHOTO'),
884
- iconUrl: ICONS.IMAGE,
885
- onClick: null,
886
- },
887
- {
888
- id: MessageTypeConstants.image,
889
- title: localize('ATTACH_IMAGE'),
890
- iconUrl: ICONS.IMAGE,
891
- onClick: null,
892
- },
893
- {
894
- id: MessageTypeConstants.audio,
895
- title: localize('ATTACH_AUDIO'),
896
- iconUrl: ICONS.AUDIO,
897
- onClick: null,
898
- },
899
- {
900
- id: MessageTypeConstants.video,
901
- title: localize('ATTACH_VIDEO'),
902
- iconUrl: ICONS.VIDEO,
903
- onClick: null,
904
- },
905
- {
906
- id: MessageTypeConstants.file,
907
- title: localize('ATTACH_FILE'),
908
- iconUrl: ICONS.FILE,
909
- onClick: null,
910
- },
911
- ];
912
- getAttachmentOptions(
913
- user?: any,
914
- group?: any,
915
- composerId?: any
916
- ): CometChatMessageComposerActionInterface[] {
917
- if (user) {
918
- return this.usersActionList();
919
- } else if (group) {
920
- return this.groupActionList();
921
- } else {
922
- return this.usersActionList();
923
- }
1433
+ width={
1434
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1435
+ ?.width as DimensionValue
1436
+ }
1437
+ containerStyle={
1438
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle
1439
+ ?.iconContainerStyle as ViewStyle
1440
+ }
1441
+ />
1442
+ ),
1443
+ onClick: null,
1444
+ });
924
1445
  }
925
- getAuxiliaryButtonOptions() {
926
- return null;
1446
+ if (!additionalAttachmentOptionsParams?.hideFileAttachmentOption) {
1447
+ attachmentOptions.push({
1448
+ id: MessageTypeConstants.file,
1449
+ title: localize("ATTACH_DOCUMENT"),
1450
+ icon: (
1451
+ <Icon
1452
+ name='description-fill'
1453
+ color={theme.color.primary}
1454
+ height={
1455
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1456
+ ?.height as DimensionValue
1457
+ }
1458
+ width={
1459
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1460
+ ?.width as DimensionValue
1461
+ }
1462
+ containerStyle={
1463
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle
1464
+ ?.iconContainerStyle as ViewStyle
1465
+ }
1466
+ />
1467
+ ),
1468
+ onClick: null,
1469
+ });
927
1470
  }
928
-
929
- getAIOptions(user: CometChat.User | null, group: CometChat.Group | null, theme: CometChatTheme, id?: Map<String, any>, AIOptionsStyle?: AIOptionsStyle) {
930
- return [];
1471
+ return attachmentOptions;
1472
+ };
1473
+ groupActionList = (
1474
+ theme: CometChatTheme,
1475
+ additionalAttachmentOptionsParams?: AdditionalAttachmentOptionsParams
1476
+ ) => {
1477
+ const attachmentOptions = [];
1478
+ if (!additionalAttachmentOptionsParams?.hideCameraOption) {
1479
+ attachmentOptions.push({
1480
+ id: MessageTypeConstants.takePhoto,
1481
+ title: localize("CAMERA"),
1482
+ icon: (
1483
+ <Icon
1484
+ name='photo-camera-fill'
1485
+ color={theme.color.primary}
1486
+ height={
1487
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1488
+ ?.height
1489
+ }
1490
+ width={
1491
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1492
+ ?.width
1493
+ }
1494
+ containerStyle={
1495
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle
1496
+ ?.iconContainerStyle
1497
+ }
1498
+ />
1499
+ ),
1500
+ onClick: null,
1501
+ });
1502
+ }
1503
+ if (!additionalAttachmentOptionsParams?.hideImageAttachmentOption) {
1504
+ attachmentOptions.push({
1505
+ id: MessageTypeConstants.image,
1506
+ title: localize("ATTACH_IMAGE"),
1507
+ icon: (
1508
+ <Icon
1509
+ name='photo-fill'
1510
+ color={theme.color.primary}
1511
+ height={
1512
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1513
+ ?.height
1514
+ }
1515
+ width={
1516
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1517
+ ?.width
1518
+ }
1519
+ containerStyle={
1520
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle
1521
+ ?.iconContainerStyle
1522
+ }
1523
+ />
1524
+ ),
1525
+ onClick: null,
1526
+ });
931
1527
  }
932
1528
 
933
- getLastConversationMessage(conversation: CometChat.Conversation): string {
934
- return CometChatConversationUtils.getMessagePreview(conversation.getLastMessage());
935
- };
936
-
937
- getAllTextFormatters(loggedInUser?: CometChat.User): CometChatTextFormatter[] {
938
- return [ChatConfigurator.getDataSource().getMentionsFormatter(loggedInUser),
939
- ChatConfigurator.getDataSource().getUrlsFormatter(loggedInUser)];
1529
+ if (!additionalAttachmentOptionsParams?.hideVideoAttachmentOption) {
1530
+ attachmentOptions.push({
1531
+ id: MessageTypeConstants.video,
1532
+ title: localize("ATTACH_VIDEO"),
1533
+ icon: (
1534
+ <Icon
1535
+ name='videocam-fill'
1536
+ color={theme.color.primary}
1537
+ height={
1538
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1539
+ ?.height
1540
+ }
1541
+ width={
1542
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1543
+ ?.width
1544
+ }
1545
+ containerStyle={
1546
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle
1547
+ ?.iconContainerStyle
1548
+ }
1549
+ />
1550
+ ),
1551
+ onClick: null,
1552
+ });
940
1553
  }
941
1554
 
942
- getMentionsFormatter(loggedInUser?: CometChat.User): CometChatMentionsFormatter {
943
- return new CometChatMentionsFormatter(loggedInUser);
1555
+ if (!additionalAttachmentOptionsParams?.hideAudioAttachmentOption) {
1556
+ attachmentOptions.push({
1557
+ id: MessageTypeConstants.audio,
1558
+ title: localize("ATTACH_AUDIO"),
1559
+ icon: (
1560
+ <Icon
1561
+ name='play-circle-fill'
1562
+ color={theme.color.primary}
1563
+ height={
1564
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1565
+ ?.height
1566
+ }
1567
+ width={
1568
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1569
+ ?.width
1570
+ }
1571
+ containerStyle={
1572
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle
1573
+ ?.iconContainerStyle
1574
+ }
1575
+ />
1576
+ ),
1577
+ onClick: null,
1578
+ });
1579
+ }
1580
+ if (!additionalAttachmentOptionsParams?.hideFileAttachmentOption) {
1581
+ attachmentOptions.push({
1582
+ id: MessageTypeConstants.file,
1583
+ title: localize("ATTACH_DOCUMENT"),
1584
+ icon: (
1585
+ <Icon
1586
+ name='description-fill'
1587
+ color={theme.color.primary}
1588
+ height={
1589
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1590
+ ?.height
1591
+ }
1592
+ width={
1593
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle?.iconStyle
1594
+ ?.width
1595
+ }
1596
+ containerStyle={
1597
+ theme.messageComposerStyles?.attachmentOptionsStyles?.optionsItemStyle
1598
+ ?.iconContainerStyle
1599
+ }
1600
+ />
1601
+ ),
1602
+ onClick: null,
1603
+ });
944
1604
  }
945
1605
 
946
- getUrlsFormatter(loggedInUser?: CometChat.User): CometChatUrlsFormatter {
947
- return new CometChatUrlsFormatter(loggedInUser);
1606
+ return attachmentOptions;
1607
+ };
1608
+
1609
+ getAttachmentOptions(
1610
+ theme: CometChatTheme,
1611
+ user?: any,
1612
+ group?: any,
1613
+ composerId?: any,
1614
+ additionalAttachmentOptionsParams?: AdditionalAttachmentOptionsParams
1615
+ ): CometChatMessageComposerAction[] {
1616
+ if (user) {
1617
+ return this.usersActionList(theme, additionalAttachmentOptionsParams);
1618
+ } else if (group) {
1619
+ return this.groupActionList(theme, additionalAttachmentOptionsParams);
1620
+ } else {
1621
+ return this.usersActionList(theme, additionalAttachmentOptionsParams);
948
1622
  }
1623
+ }
1624
+ getAuxiliaryButtonOptions() {
1625
+ return null;
1626
+ }
1627
+
1628
+ getLastConversationMessage(
1629
+ conversation: CometChat.Conversation,
1630
+ theme?: CometChatTheme
1631
+ ): string | JSX.Element {
1632
+ return CometChatConversationUtils.getMessagePreview(conversation.getLastMessage(), theme);
1633
+ }
1634
+
1635
+ getAllTextFormatters(loggedInUser?: CometChat.User): CometChatTextFormatter[] {
1636
+ return [
1637
+ ChatConfigurator.getDataSource().getMentionsFormatter(loggedInUser),
1638
+ ChatConfigurator.getDataSource().getUrlsFormatter(loggedInUser),
1639
+ ];
1640
+ }
949
1641
 
950
- }
1642
+ getMentionsFormatter(loggedInUser?: CometChat.User): CometChatMentionsFormatter {
1643
+ return new CometChatMentionsFormatter(loggedInUser);
1644
+ }
1645
+
1646
+ getUrlsFormatter(loggedInUser?: CometChat.User): CometChatUrlsFormatter {
1647
+ return new CometChatUrlsFormatter(loggedInUser);
1648
+ }
1649
+ }