@cometchat/chat-uikit-react-native 4.0.1 → 4.1.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 (376) hide show
  1. package/README.md +1 -1
  2. package/android/.gradle/7.4/checksums/checksums.lock +0 -0
  3. package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
  4. package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
  5. package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
  6. package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
  7. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  8. package/android/.gradle/7.4/gc.properties +0 -0
  9. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  10. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  11. package/android/.gradle/vcs-1/gc.properties +0 -0
  12. package/android/.idea/gradle.xml +13 -0
  13. package/android/.idea/misc.xml +9 -0
  14. package/android/.idea/vcs.xml +6 -0
  15. package/android/src/main/java/com/reactnativecometchatuikit/{RNSoundModule.java → CometChatSoundModule.java} +22 -22
  16. package/android/src/main/java/com/reactnativecometchatuikit/CometchatUiKitPackage.java +1 -1
  17. package/ios/{RNSound.h → CometChatSoundModule.h} +1 -1
  18. package/ios/{RNSound.m → CometChatSoundModule.m} +2 -2
  19. package/lib/CometChatConversations/ConversationsConfiguration.d.ts +1 -0
  20. package/lib/CometChatDetails/DetailsConfiguration.d.ts +1 -0
  21. package/lib/CometChatGroupMembers/GroupMemberConfiguration.d.ts +1 -0
  22. package/lib/CometChatGroups/GroupsConfiguration.d.ts +1 -0
  23. package/lib/CometChatMessageComposer/CometChatMessageComposer.js +1 -7
  24. package/lib/CometChatMessageComposer/CometChatMessageComposer.js.map +1 -1
  25. package/lib/CometChatMessageHeader/MessageHeaderConfiguration.d.ts +1 -0
  26. package/lib/CometChatMessageList/CometChatMessageList.js +18 -49
  27. package/lib/CometChatMessageList/CometChatMessageList.js.map +1 -1
  28. package/lib/CometChatMessageList/MessageListConfiguration.d.ts +1 -0
  29. package/lib/CometChatMessages/MessagesConfiguration.d.ts +1 -0
  30. package/lib/CometChatTabs/TabItems.d.ts +1 -0
  31. package/lib/CometChatThreadedMessages/ThreadedMessagesConfiguration.d.ts +1 -0
  32. package/lib/calls/CometChatCallDetails/CallDetailsConfiguration.d.ts +1 -0
  33. package/lib/calls/CometChatCallHistory/CallHistoryConfiguration.d.ts +1 -0
  34. package/lib/calls/CometChatIncomingCall/CometChatIncomingCall.js +3 -3
  35. package/lib/calls/CometChatIncomingCall/CometChatIncomingCall.js.map +1 -1
  36. package/lib/extensions/ImageModeration/ImageModerationDecorator.d.ts +1 -0
  37. package/lib/extensions/ImageModeration/ImageModerationFilter.js +4 -4
  38. package/lib/extensions/ImageModeration/ImageModerationFilter.js.map +1 -1
  39. package/lib/extensions/LinkPreview/LinkPreviewExtentionDecorator.d.ts +1 -0
  40. package/lib/extensions/MessageTranslation/MessageTranslationDecorator.d.ts +1 -0
  41. package/lib/extensions/SmartReplies/SmartRepliesDecorator.js +1 -1
  42. package/lib/extensions/SmartReplies/SmartRepliesDecorator.js.map +1 -1
  43. package/lib/extensions/Stickers/StickersExtensionDecorator.d.ts +1 -1
  44. package/lib/extensions/Stickers/StickersExtensionDecorator.js +2 -4
  45. package/lib/extensions/Stickers/StickersExtensionDecorator.js.map +1 -1
  46. package/lib/extensions/TextModeration/TextModerationExtensionDecorator.d.ts +1 -0
  47. package/lib/index.d.ts +0 -13
  48. package/lib/index.js +0 -14
  49. package/lib/index.js.map +1 -1
  50. package/lib/shared/CometChatUiKit/CometChatUIKit.d.ts +0 -2
  51. package/lib/shared/CometChatUiKit/CometChatUIKit.js +2 -13
  52. package/lib/shared/CometChatUiKit/CometChatUIKit.js.map +1 -1
  53. package/lib/shared/CometChatUiKit/UIKitSettings.d.ts +1 -5
  54. package/lib/shared/CometChatUiKit/UIKitSettings.js +1 -3
  55. package/lib/shared/CometChatUiKit/UIKitSettings.js.map +1 -1
  56. package/lib/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.js +0 -2
  57. package/lib/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.js.map +1 -1
  58. package/lib/shared/events/CometChatUIEventHandler/Listener.d.ts +1 -3
  59. package/lib/shared/events/CometChatUIEventHandler/Listener.js +1 -4
  60. package/lib/shared/events/CometChatUIEventHandler/Listener.js.map +1 -1
  61. package/lib/shared/events/CometChatUIEvents.d.ts +1 -2
  62. package/lib/shared/events/CometChatUIEvents.js +0 -1
  63. package/lib/shared/events/CometChatUIEvents.js.map +1 -1
  64. package/lib/shared/framework/DataSource.d.ts +2 -1
  65. package/lib/shared/framework/DataSourceDecorator.d.ts +2 -1
  66. package/lib/shared/framework/DataSourceDecorator.js +2 -2
  67. package/lib/shared/framework/DataSourceDecorator.js.map +1 -1
  68. package/lib/shared/framework/MessageDataSource.d.ts +1 -1
  69. package/lib/shared/framework/MessageDataSource.js +2 -2
  70. package/lib/shared/framework/MessageDataSource.js.map +1 -1
  71. package/lib/shared/helper/types/index.d.ts +1 -0
  72. package/lib/shared/modals/CometChatDetailsOption.d.ts +1 -0
  73. package/lib/shared/modals/CometChatMessageOption.d.ts +1 -0
  74. package/lib/shared/modals/CometChatMessageTemplate.d.ts +1 -0
  75. package/lib/shared/resources/CometChatLocalize/CometChatLocalize.d.ts +153 -230
  76. package/lib/shared/resources/CometChatLocalize/resources/ar/translation.json +0 -4
  77. package/lib/shared/resources/CometChatLocalize/resources/de/translation.json +0 -4
  78. package/lib/shared/resources/CometChatLocalize/resources/en/translation.json +0 -4
  79. package/lib/shared/resources/CometChatLocalize/resources/es/translation.json +0 -4
  80. package/lib/shared/resources/CometChatLocalize/resources/fr/translation.json +0 -4
  81. package/lib/shared/resources/CometChatLocalize/resources/hi/translation.json +0 -4
  82. package/lib/shared/resources/CometChatLocalize/resources/lt/translation.json +0 -4
  83. package/lib/shared/resources/CometChatLocalize/resources/ms/translation.json +0 -4
  84. package/lib/shared/resources/CometChatLocalize/resources/pt/translation.json +0 -4
  85. package/lib/shared/resources/CometChatLocalize/resources/ru/translation.json +0 -4
  86. package/lib/shared/resources/CometChatLocalize/resources/sv/translation.json +0 -4
  87. package/lib/shared/resources/CometChatLocalize/resources/zh/translation.json +0 -4
  88. package/lib/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +0 -4
  89. package/package.json +3 -3
  90. package/src/AI/AIAssistBot/AIAssistBotDecorator.tsx +164 -0
  91. package/src/AI/AIAssistBot/AIAssistBotExtension.tsx +22 -0
  92. package/src/AI/AIAssistBot/AIAssistBotStyle.ts +43 -0
  93. package/src/AI/AIAssistBot/AIAssistBotView.tsx +294 -0
  94. package/src/AI/AIAssistBot/configuration.ts +22 -0
  95. package/src/AI/AIAssistBot/resources/index.ts +5 -0
  96. package/src/AI/{configuration.ts → AIBaseConfiguration.ts} +3 -6
  97. package/src/AI/AIBaseStyle.ts +58 -0
  98. package/src/AI/AIConversationStarter/AIConversationStarter.ts +5 -19
  99. package/src/AI/AIConversationStarter/AIConversationStarterDecorator.tsx +145 -132
  100. package/src/AI/AIConversationStarter/AIConversationStarterStyle.ts +11 -6
  101. package/src/AI/AIConversationStarter/configuration.ts +10 -17
  102. package/src/AI/AIConversationSummary/AIConversationSummaryDecorator.tsx +175 -0
  103. package/src/AI/AIConversationSummary/AIConversationSummaryExtension.ts +21 -0
  104. package/src/AI/AIConversationSummary/AIConversationSummaryStyle.tsx +20 -0
  105. package/src/AI/AIConversationSummary/AIConversationSummaryView.tsx +190 -0
  106. package/src/AI/AIConversationSummary/configuration.ts +14 -0
  107. package/src/AI/AIConversationSummary/resources/close.png +0 -0
  108. package/src/AI/AIConversationSummary/resources/index.ts +5 -0
  109. package/src/AI/AIExtensionDataSource.ts +17 -12
  110. package/src/AI/AIOptionsStyle.ts +14 -0
  111. package/src/AI/AISmartReplies/AISmartReplies.ts +6 -15
  112. package/src/AI/AISmartReplies/AISmartRepliesDecorator.tsx +302 -0
  113. package/src/AI/AISmartReplies/AISmartRepliesStyle.ts +1 -1
  114. package/src/AI/AISmartReplies/configuration.ts +4 -11
  115. package/src/AI/resources/index.ts +0 -2
  116. package/src/AI/utils.ts +3 -3
  117. package/src/CometChatConversations/CometChatConversations.tsx +56 -46
  118. package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +118 -5
  119. package/src/CometChatMessageComposer/MessageComposerConfiguration.tsx +3 -0
  120. package/src/CometChatMessageComposer/resources/index.ts +2 -0
  121. package/src/CometChatMessageComposer/styles.ts +1 -4
  122. package/src/CometChatMessageHeader/listners.ts +5 -4
  123. package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +35 -35
  124. package/src/CometChatMessageList/CometChatMessageList.tsx +284 -166
  125. package/src/CometChatMessages/CometChatMessages.tsx +8 -16
  126. package/src/CometChatMessages/MessagesConfiguration.ts +2 -2
  127. package/src/CometChatTabs/CometChatTabs.tsx +1 -1
  128. package/src/calls/CallUtils.ts +106 -45
  129. package/src/calls/CallingDetailsUtils.tsx +133 -15
  130. package/src/calls/CallingPackage.ts +16 -2
  131. package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +9 -10
  132. package/src/calls/CometChatCallLogDetails/CallLogDetailsConfiguration.ts +116 -0
  133. package/src/calls/CometChatCallLogDetails/CallLogDetailsStyle.ts +36 -0
  134. package/src/calls/CometChatCallLogDetails/CometChatCallLogDetails.tsx +308 -0
  135. package/src/calls/CometChatCallLogDetails/index.ts +12 -0
  136. package/src/calls/CometChatCallLogDetails/resources/CloseIcon.png +0 -0
  137. package/src/calls/{CometChatCallDetails → CometChatCallLogDetails}/style.ts +1 -0
  138. package/src/calls/{CometChatCallHistory/CallHistoryConfiguration.ts → CometChatCallLogHistory/CallLogHistoryConfiguration.ts} +15 -27
  139. package/src/calls/CometChatCallLogHistory/CallLogHistoryStyle.ts +46 -0
  140. package/src/calls/CometChatCallLogHistory/CometChatCallLogHistory.tsx +337 -0
  141. package/src/calls/CometChatCallLogHistory/index.ts +12 -0
  142. package/src/calls/CometChatCallLogHistory/resources/incomingcall.png +0 -0
  143. package/src/calls/CometChatCallLogHistory/resources/incomingvideo.png +0 -0
  144. package/src/calls/CometChatCallLogHistory/resources/index.ts +29 -0
  145. package/src/calls/CometChatCallLogHistory/resources/missedcall.png +0 -0
  146. package/src/calls/CometChatCallLogHistory/resources/missedvideo.png +0 -0
  147. package/src/calls/CometChatCallLogHistory/resources/outgoingcall.png +0 -0
  148. package/src/calls/CometChatCallLogHistory/resources/outgoingvideo.png +0 -0
  149. package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/style.ts +2 -1
  150. package/src/calls/CometChatCallLogParticipants/CallLogParticipantsConfiguration.ts +61 -0
  151. package/src/calls/CometChatCallLogParticipants/CallLogParticipantsStyle.ts +59 -0
  152. package/src/calls/CometChatCallLogParticipants/CometChatCallLogParticipants.tsx +220 -0
  153. package/src/calls/CometChatCallLogParticipants/index.ts +12 -0
  154. package/src/calls/CometChatCallLogParticipants/resources/Back.png +0 -0
  155. package/src/calls/CometChatCallLogParticipants/resources/index.ts +4 -0
  156. package/src/calls/CometChatCallLogParticipants/style.ts +24 -0
  157. package/src/calls/CometChatCallLogRecordings/CallLogRecordingsConfiguration.ts +63 -0
  158. package/src/calls/CometChatCallLogRecordings/CallLogRecordingsStyle.ts +63 -0
  159. package/src/calls/CometChatCallLogRecordings/CometChatCallLogRecordings.tsx +253 -0
  160. package/src/calls/CometChatCallLogRecordings/index.ts +12 -0
  161. package/src/calls/CometChatCallLogRecordings/resources/Back.png +0 -0
  162. package/src/calls/CometChatCallLogRecordings/resources/download.png +0 -0
  163. package/src/calls/CometChatCallLogRecordings/resources/index.ts +6 -0
  164. package/src/calls/CometChatCallLogRecordings/style.ts +24 -0
  165. package/src/calls/CometChatCallLogs/CallLogsConfiguration.ts +87 -0
  166. package/src/calls/CometChatCallLogs/CallLogsStyle.ts +95 -0
  167. package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +482 -0
  168. package/src/calls/CometChatCallLogs/index.ts +12 -0
  169. package/src/calls/CometChatCallLogs/resources/Back.png +0 -0
  170. package/src/calls/CometChatCallLogs/resources/Info.png +0 -0
  171. package/src/calls/CometChatCallLogs/resources/Selection.png +0 -0
  172. package/src/calls/CometChatCallLogs/resources/Spinner.png +0 -0
  173. package/src/calls/CometChatCallLogs/resources/check.png +0 -0
  174. package/src/calls/CometChatCallLogs/resources/incomingcall.png +0 -0
  175. package/src/calls/CometChatCallLogs/resources/incomingvideo.png +0 -0
  176. package/src/calls/CometChatCallLogs/resources/index.ts +25 -0
  177. package/src/calls/CometChatCallLogs/resources/missedcall.png +0 -0
  178. package/src/calls/CometChatCallLogs/resources/missedvideo.png +0 -0
  179. package/src/calls/CometChatCallLogs/resources/outgoingcall.png +0 -0
  180. package/src/calls/CometChatCallLogs/resources/outgoingvideo.png +0 -0
  181. package/src/calls/CometChatCallLogs/style.ts +24 -0
  182. package/src/calls/CometChatCallLogsWithDetails/CallLogsWithDetailsConfiguration.ts +9 -0
  183. package/src/calls/{CometChatCallHistoryWithDetails/CometChatCallHistoryWithDetails.tsx → CometChatCallLogsWithDetails/CometChatCallLogsWithDetails.tsx} +17 -16
  184. package/src/calls/CometChatCallLogsWithDetails/index.ts +7 -0
  185. package/src/calls/index.ts +40 -1
  186. package/src/calls/resources/index.ts +3 -1
  187. package/src/calls/resources/nextarrow.png +0 -0
  188. package/src/extensions/SmartReplies/SmartRepliesDecorator.tsx +6 -14
  189. package/src/extensions/Stickers/StickersExtensionDecorator.tsx +1 -1
  190. package/src/extensions/ThumbnailGeneration/ThumbnailGenerationDecorator.tsx +5 -3
  191. package/src/extensions/ThumbnailGeneration/resources/empty.png +0 -0
  192. package/src/extensions/ThumbnailGeneration/resources/index.ts +5 -0
  193. package/src/index.ts +134 -17
  194. package/src/shared/CometChatUiKit/CometChatUIKit.ts +175 -63
  195. package/src/shared/CometChatUiKit/UIKitSettings.ts +2 -2
  196. package/src/shared/constants/UIKitConstants.ts +81 -47
  197. package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +47 -3
  198. package/src/shared/events/CometChatUIEventHandler/Listener.ts +61 -2
  199. package/src/shared/events/ListenerInitializer.ts +73 -0
  200. package/src/shared/events/messages.ts +14 -0
  201. package/src/shared/framework/DataSource.ts +15 -0
  202. package/src/shared/framework/DataSourceDecorator.tsx +40 -0
  203. package/src/shared/framework/MessageDataSource.tsx +87 -4
  204. package/src/shared/index.ts +48 -0
  205. package/src/shared/modals/CometChatCallLogDetailsOptions.ts +23 -0
  206. package/src/shared/modals/CometChatCallLogDetailsTemplate.ts +16 -0
  207. package/src/shared/modals/InteractiveData/InteractiveActions/APIAction.ts +118 -0
  208. package/src/shared/modals/InteractiveData/InteractiveActions/CustomAction.ts +19 -0
  209. package/src/shared/modals/InteractiveData/InteractiveActions/URLNavigationAction.ts +34 -0
  210. package/src/shared/modals/InteractiveData/InteractiveActions/index.ts +3 -0
  211. package/src/shared/modals/InteractiveData/InteractiveData/InteractiveCardData.ts +69 -0
  212. package/src/shared/modals/InteractiveData/InteractiveData/InteractiveFormData.ts +119 -0
  213. package/src/shared/modals/InteractiveData/InteractiveData/index.ts +2 -0
  214. package/src/shared/modals/InteractiveData/InteractiveElements/BaseInputElement.ts +102 -0
  215. package/src/shared/modals/InteractiveData/InteractiveElements/BaseInteractiveElement.ts +45 -0
  216. package/src/shared/modals/InteractiveData/InteractiveElements/ButtonElement.ts +61 -0
  217. package/src/shared/modals/InteractiveData/InteractiveElements/CheckboxElement.ts +75 -0
  218. package/src/shared/modals/InteractiveData/InteractiveElements/DropdownElement.ts +83 -0
  219. package/src/shared/modals/InteractiveData/InteractiveElements/LabelElement.ts +32 -0
  220. package/src/shared/modals/InteractiveData/InteractiveElements/OptionElement.ts +39 -0
  221. package/src/shared/modals/InteractiveData/InteractiveElements/RadioButtonElement.ts +76 -0
  222. package/src/shared/modals/InteractiveData/InteractiveElements/SingleSelectElement.ts +76 -0
  223. package/src/shared/modals/InteractiveData/InteractiveElements/TextInputElement.ts +101 -0
  224. package/src/shared/modals/InteractiveData/InteractiveElements/index.ts +10 -0
  225. package/src/shared/modals/InteractiveData/InteractiveEntities/ActionEntity.ts +41 -0
  226. package/src/shared/modals/InteractiveData/InteractiveEntities/ElementEntity.ts +64 -0
  227. package/src/shared/modals/InteractiveData/InteractiveEntities/index.ts +2 -0
  228. package/src/shared/modals/InteractiveData/InteractiveMessage/CardMessage.ts +142 -0
  229. package/src/shared/modals/InteractiveData/InteractiveMessage/CustomInteractiveMessage.ts +38 -0
  230. package/src/shared/modals/InteractiveData/InteractiveMessage/FormMessage.ts +152 -0
  231. package/src/shared/modals/InteractiveData/InteractiveMessage/index.ts +3 -0
  232. package/src/shared/modals/InteractiveData/index.ts +28 -0
  233. package/src/shared/modals/index.ts +23 -0
  234. package/src/shared/resources/CometChatLocalize/resources/ar/translation.json +22 -5
  235. package/src/shared/resources/CometChatLocalize/resources/de/translation.json +22 -5
  236. package/src/shared/resources/CometChatLocalize/resources/en/translation.json +24 -7
  237. package/src/shared/resources/CometChatLocalize/resources/es/translation.json +22 -5
  238. package/src/shared/resources/CometChatLocalize/resources/fr/translation.json +22 -5
  239. package/src/shared/resources/CometChatLocalize/resources/hi/translation.json +22 -5
  240. package/src/shared/resources/CometChatLocalize/resources/lt/translation.json +22 -5
  241. package/src/shared/resources/CometChatLocalize/resources/ms/translation.json +22 -5
  242. package/src/shared/resources/CometChatLocalize/resources/pt/translation.json +22 -5
  243. package/src/shared/resources/CometChatLocalize/resources/ru/translation.json +22 -5
  244. package/src/shared/resources/CometChatLocalize/resources/sv/translation.json +22 -5
  245. package/src/shared/resources/CometChatLocalize/resources/zh/translation.json +22 -4
  246. package/src/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +22 -5
  247. package/src/shared/resources/CometChatSoundManager/CometChatSoundManager.js +2 -2
  248. package/src/shared/resources/CometChatSoundManager/sound.js +35 -35
  249. package/src/shared/resources/CometChatTheme/Palette.ts +16 -0
  250. package/src/shared/utils/DetailsUtils/DetailsUtils.tsx +1 -1
  251. package/src/shared/utils/InteractiveMessageUtils.ts +20 -0
  252. package/src/shared/utils/NetworkUtils.tsx +20 -0
  253. package/src/shared/utils/conversationUtils.ts +9 -6
  254. package/src/shared/views/CometChatAICard/CometChatAICard.tsx +71 -0
  255. package/src/shared/views/CometChatAICard/resources/errormessage.png +0 -0
  256. package/src/shared/views/CometChatAICard/resources/index.ts +4 -0
  257. package/src/shared/views/CometChatAICard/resources/nomessage.png +0 -0
  258. package/src/shared/views/CometChatActionSheet/ActionSheetStyle.ts +4 -0
  259. package/src/shared/views/CometChatActionSheet/CometChatActionSheet.tsx +11 -7
  260. package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +56 -47
  261. package/src/shared/views/CometChatBottomSheet/style.ts +0 -2
  262. package/src/shared/views/CometChatButton/CometChatButton.tsx +32 -22
  263. package/src/shared/views/CometChatCardBubble/CardBubbleStyle.tsx +47 -0
  264. package/src/shared/views/CometChatCardBubble/CometChatCardBubble.tsx +173 -0
  265. package/src/shared/views/CometChatCardBubble/index.tsx +1 -0
  266. package/src/shared/views/CometChatCheckBox/CheckBoxStyle.tsx +43 -0
  267. package/src/shared/views/CometChatCheckBox/CometChatCheckBox.tsx +79 -0
  268. package/src/shared/views/CometChatDate/CometChatDate.tsx +9 -6
  269. package/src/shared/views/CometChatDate/DateConfiguration.ts +4 -0
  270. package/src/shared/views/CometChatDate/style.ts +1 -1
  271. package/src/shared/views/CometChatDropDown/CometChatDropDown.tsx +126 -0
  272. package/src/shared/views/CometChatDropDown/DropDownStyle.tsx +39 -0
  273. package/src/shared/views/CometChatDropDown/resources/downArrowIcon.png +0 -0
  274. package/src/shared/views/CometChatDropDown/resources/index.js +5 -0
  275. package/src/shared/views/CometChatFormBubble/CometChatFormBubble.tsx +464 -0
  276. package/src/shared/views/CometChatFormBubble/FormBubbleStyle.tsx +91 -0
  277. package/src/shared/views/CometChatFormBubble/index.tsx +1 -0
  278. package/src/shared/views/CometChatImageBubble/CometChatImageBubble.tsx +13 -5
  279. package/src/shared/views/CometChatImageBubble/ImageBubbleStyle.ts +14 -3
  280. package/src/shared/views/CometChatLabel/CometChatLabel.tsx +27 -0
  281. package/src/shared/views/CometChatLabel/LabelStyle.ts +19 -0
  282. package/src/shared/views/CometChatListItem/CometChatListItem.tsx +31 -19
  283. package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +5 -4
  284. package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +1 -2
  285. package/src/shared/views/CometChatPanel/CometChatPanel.tsx +51 -0
  286. package/src/shared/views/CometChatPanel/PanelStyle.tsx +43 -0
  287. package/src/shared/views/CometChatPanel/resources/CloseIcon.png +0 -0
  288. package/src/shared/views/CometChatPanel/resources/index.ts +5 -0
  289. package/src/shared/views/CometChatQuickView/CometChatQuickView.tsx +66 -0
  290. package/src/shared/views/CometChatQuickView/QuickViewStyle.ts +55 -0
  291. package/src/shared/views/CometChatRadioButton/CometChatRadioButton.tsx +67 -0
  292. package/src/shared/views/CometChatRadioButton/RadioButtonStyle.tsx +38 -0
  293. package/src/shared/views/CometChatSingleSelect/CometChatSingleSelect.tsx +63 -0
  294. package/src/shared/views/CometChatSingleSelect/SingleStyle.tsx +35 -0
  295. package/src/shared/views/CometChatTextInput/CometChatTextInput.tsx +67 -0
  296. package/src/shared/views/CometChatTextInput/TextInputStyle.tsx +26 -0
  297. package/src/shared/views/index.ts +7 -1
  298. package/lib/AI/AIConversationStarter/AIConversationStarter.d.ts +0 -12
  299. package/lib/AI/AIConversationStarter/AIConversationStarter.js +0 -31
  300. package/lib/AI/AIConversationStarter/AIConversationStarter.js.map +0 -1
  301. package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.d.ts +0 -25
  302. package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.js +0 -175
  303. package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.js.map +0 -1
  304. package/lib/AI/AIConversationStarter/AIConversationStarterStyle.d.ts +0 -4
  305. package/lib/AI/AIConversationStarter/AIConversationStarterStyle.js +0 -8
  306. package/lib/AI/AIConversationStarter/AIConversationStarterStyle.js.map +0 -1
  307. package/lib/AI/AIConversationStarter/configuration.d.ts +0 -14
  308. package/lib/AI/AIConversationStarter/configuration.js +0 -16
  309. package/lib/AI/AIConversationStarter/configuration.js.map +0 -1
  310. package/lib/AI/AIConversationStarter/style.d.ts +0 -31
  311. package/lib/AI/AIConversationStarter/style.js +0 -62
  312. package/lib/AI/AIConversationStarter/style.js.map +0 -1
  313. package/lib/AI/AIEnabler.d.ts +0 -10
  314. package/lib/AI/AIEnabler.js +0 -102
  315. package/lib/AI/AIEnabler.js.map +0 -1
  316. package/lib/AI/AIEnablerDecorator.d.ts +0 -43
  317. package/lib/AI/AIEnablerDecorator.js +0 -251
  318. package/lib/AI/AIEnablerDecorator.js.map +0 -1
  319. package/lib/AI/AIExtensionDataSource.d.ts +0 -6
  320. package/lib/AI/AIExtensionDataSource.js +0 -10
  321. package/lib/AI/AIExtensionDataSource.js.map +0 -1
  322. package/lib/AI/AISmartReplies/AISmartReplies.d.ts +0 -10
  323. package/lib/AI/AISmartReplies/AISmartReplies.js +0 -23
  324. package/lib/AI/AISmartReplies/AISmartReplies.js.map +0 -1
  325. package/lib/AI/AISmartReplies/AISmartRepliesDecorator.d.ts +0 -7
  326. package/lib/AI/AISmartReplies/AISmartRepliesDecorator.js +0 -12
  327. package/lib/AI/AISmartReplies/AISmartRepliesDecorator.js.map +0 -1
  328. package/lib/AI/AISmartReplies/AISmartRepliesStyle.d.ts +0 -12
  329. package/lib/AI/AISmartReplies/AISmartRepliesStyle.js +0 -15
  330. package/lib/AI/AISmartReplies/AISmartRepliesStyle.js.map +0 -1
  331. package/lib/AI/AISmartReplies/configuration.d.ts +0 -14
  332. package/lib/AI/AISmartReplies/configuration.js +0 -16
  333. package/lib/AI/AISmartReplies/configuration.js.map +0 -1
  334. package/lib/AI/CardView.d.ts +0 -19
  335. package/lib/AI/CardView.js +0 -45
  336. package/lib/AI/CardView.js.map +0 -1
  337. package/lib/AI/CardViewStyle.d.ts +0 -29
  338. package/lib/AI/CardViewStyle.js +0 -36
  339. package/lib/AI/CardViewStyle.js.map +0 -1
  340. package/lib/AI/configuration.d.ts +0 -14
  341. package/lib/AI/configuration.js +0 -16
  342. package/lib/AI/configuration.js.map +0 -1
  343. package/lib/AI/resources/index.d.ts +0 -5
  344. package/lib/AI/resources/index.js +0 -6
  345. package/lib/AI/resources/index.js.map +0 -1
  346. package/lib/AI/style.d.ts +0 -115
  347. package/lib/AI/style.js +0 -139
  348. package/lib/AI/style.js.map +0 -1
  349. package/lib/AI/utils.d.ts +0 -38
  350. package/lib/AI/utils.js +0 -28
  351. package/lib/AI/utils.js.map +0 -1
  352. package/src/AI/AIEnabler.ts +0 -115
  353. package/src/AI/AIEnablerDecorator.tsx +0 -324
  354. package/src/AI/AISmartReplies/AISmartRepliesDecorator.ts +0 -18
  355. package/src/calls/CometChatCallDetails/CallDetailsConfiguration.ts +0 -68
  356. package/src/calls/CometChatCallDetails/CallDetailsStyle.ts +0 -52
  357. package/src/calls/CometChatCallDetails/CometChatCallDetails.tsx +0 -268
  358. package/src/calls/CometChatCallDetails/index.ts +0 -9
  359. package/src/calls/CometChatCallHistory/CallHistoryStyle.ts +0 -34
  360. package/src/calls/CometChatCallHistory/CometChatCallHistory.tsx +0 -422
  361. package/src/calls/CometChatCallHistory/index.ts +0 -9
  362. package/src/calls/CometChatCallHistory/resources/index.ts +0 -17
  363. package/src/calls/CometChatCallHistoryWithDetails/HistoryWithDetailsConfiguration.ts +0 -7
  364. package/src/calls/CometChatCallHistoryWithDetails/HistoryWithDetailsStyle.ts +0 -3
  365. package/src/calls/CometChatCallHistoryWithDetails/index.ts +0 -8
  366. /package/src/{calls/CometChatCallDetails → AI/AIAssistBot}/resources/CloseIcon.png +0 -0
  367. /package/src/{AI → CometChatMessageComposer}/resources/ai.png +0 -0
  368. /package/src/calls/{CometChatCallDetails → CometChatCallLogDetails}/resources/index.ts +0 -0
  369. /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Back.png +0 -0
  370. /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Call.png +0 -0
  371. /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Info.png +0 -0
  372. /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Selection.png +0 -0
  373. /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Spineer.png +0 -0
  374. /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Video.png +0 -0
  375. /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/check.png +0 -0
  376. /package/src/calls/{CometChatCallHistoryWithDetails → CometChatCallLogsWithDetails}/style.ts +0 -0
@@ -74,7 +74,7 @@ export const CometChatMessages = (props: CometChatMessagesInterface) => {
74
74
  const { theme } = useContext(CometChatContext);
75
75
 
76
76
  //calcualted styles and configurations
77
- const _messageStyles = new MessageStyle({
77
+ const _messagesStyles = new MessageStyle({
78
78
  backgroundColor: theme.palette.getBackgroundColor(),
79
79
  ...messagesStyle
80
80
  });
@@ -118,16 +118,16 @@ export const CometChatMessages = (props: CometChatMessagesInterface) => {
118
118
  }, [showComponent]);
119
119
 
120
120
  useEffect(() => {
121
- CometChat.addMessageListener(
121
+ CometChatUIEventHandler.addMessageListener(
122
122
  msgListenerId,
123
- new CometChat.MessageListener({
123
+ {
124
124
  onTransientMessageReceived: (transientMessage) => {
125
125
  const { reaction, type } = transientMessage['data'];
126
126
  if (type == MetadataConstants.liveReaction) {
127
127
  setShowLiveReaction(!showLiveReaction);
128
128
  }
129
129
  },
130
- })
130
+ }
131
131
  );
132
132
 
133
133
  CometChat.getLoggedinUser().then(user => {
@@ -210,10 +210,8 @@ export const CometChatMessages = (props: CometChatMessagesInterface) => {
210
210
  return (
211
211
  <View style={Style.appBarStyle}>
212
212
  {
213
- ChatConfigurator.dataSource.getAuxiliaryHeaderAppbarOptions(user, group, theme)
214
- }
215
- {
216
- AuxilaryAppBarOptions && <AuxilaryAppBarOptions group={groupObject} user={userObject} />
213
+ AuxilaryAppBarOptions ? <AuxilaryAppBarOptions group={groupObject} user={userObject} />
214
+ : ChatConfigurator.dataSource.getAuxiliaryHeaderAppbarOptions(user, group, theme)
217
215
  }
218
216
  {
219
217
  !hideDetails && (
@@ -235,17 +233,10 @@ export const CometChatMessages = (props: CometChatMessagesInterface) => {
235
233
  width,
236
234
  border,
237
235
  borderRadius
238
- } = _messageStyles;
236
+ } = _messagesStyles;
239
237
 
240
238
  return <View style={[
241
239
  Style.container,
242
- showComponent == ComponentNames.Details ||
243
- showComponent == ComponentNames.Thread
244
- ? {}
245
- : {
246
- paddingStart: 8,
247
- paddingEnd: 8
248
- },
249
240
  { backgroundColor, height, width, ...border, borderRadius }
250
241
  ]
251
242
  }>
@@ -300,6 +291,7 @@ export const CometChatMessages = (props: CometChatMessagesInterface) => {
300
291
  emptyStateText={localize("NO_MESSAGES_FOUND")}
301
292
  errorStateText={localize("SOMETHING_WRONG")}
302
293
  dateSeperatorPattern={_listConfiguration.dateSeperatorPattern}
294
+ disableSoundForMessages={disableSoundForMessages}
303
295
  onThreadRepliesPress={(msg, view) => {
304
296
  threadedMessageInfo.current = { message: msg, view }
305
297
  setShowComponent(ComponentNames.Thread);
@@ -21,7 +21,7 @@ export interface MessagesConfigurationInterface {
21
21
  disableSoundForMessages?: boolean,
22
22
  customSoundForIncomingMessage?: string,
23
23
  customSoundForOutgoingMessage?: string,
24
- messageStyle?: MessageStyleInterface,
24
+ messagesStyle?: MessageStyleInterface,
25
25
  AuxilaryAppBarOptions?: (props:{user?: CometChat.User, group?: CometChat.Group}) => JSX.Element
26
26
  }
27
27
 
@@ -41,7 +41,7 @@ export class MessagesConfiguration implements MessagesConfigurationInterface {
41
41
  disableSoundForMessages?: boolean
42
42
  customSoundForIncomingMessage?: string
43
43
  customSoundForOutgoingMessage?: string
44
- messageStyle?: MessageStyleInterface
44
+ messagesStyle?: MessageStyleInterface
45
45
  AuxilaryAppBarOptions?: (props:{user?: CometChat.User, group?: CometChat.Group}) => JSX.Element
46
46
 
47
47
  constructor(props: MessagesConfigurationInterface) {
@@ -166,7 +166,7 @@ export const CometChatTabs = (props: CometChatTabsInterface) => {
166
166
 
167
167
  return (
168
168
  <View style={{ flex: 1 }}>
169
- <View style={{display: tabAlignment == 'bottom' ? "none" : "flex"}}>
169
+ <View style={{display: tabAlignment == 'bottom' ? "none" : "flex", margin: 15, marginTop: 0}}>
170
170
  {
171
171
  tabAlignment == "top" && <TabsList />
172
172
  }
@@ -15,57 +15,118 @@ export class CallUtils {
15
15
  initiator: CometChat.User,
16
16
  loggedInUser: CometChat.User
17
17
  ): boolean {
18
- return initiator.getUid() == loggedInUser.getUid();
18
+ return initiator.getUid() == loggedInUser?.getUid();
19
19
  }
20
20
 
21
21
  static getCallStatus(
22
22
  message: CometChat.BaseMessage,
23
23
  loggedInUser: CometChat.User
24
24
  ): string {
25
- if (!(message instanceof CometChat.Call)) return '';
26
- let call = message as CometChat.Call;
27
- let callMessageText = '';
28
- let initiator = call.getCallInitiator();
29
- switch (call.getStatus()) {
30
- case CALL_INITIATED:
31
- if (this.isInitiator(initiator, loggedInUser)) {
32
- callMessageText = `${localize('OUTGOING_CALL')}`;
33
- } else {
34
- callMessageText = `${localize('INCOMING_CALL')}`;
35
- }
36
- break;
37
- case CALL_ONGOING:
38
- callMessageText = `${localize('CALL_ACCEPTED')}`;
39
- break;
40
- case CALL_ENDED:
41
- callMessageText = `${localize('CALL_ENDED')}`;
42
- break;
43
- case CALL_UNANSWERED:
44
- if (this.isInitiator(initiator, loggedInUser)) {
45
- callMessageText = `${localize('CALL_UNANSWERED')}`;
46
- } else {
47
- callMessageText = `${localize('CALL_MISSED')}`;
48
- }
49
- break;
50
- case CALL_CANCELLED:
51
- if (this.isInitiator(initiator, loggedInUser)) {
52
- callMessageText = `${localize('CALL_CANCELLED')}`;
53
- } else {
54
- callMessageText = `${localize('CALL_MISSED')}`;
55
- }
56
- break;
57
- case CALL_REJECTED:
58
- case CALL_BUSY:
59
- if (this.isInitiator(initiator, loggedInUser)) {
60
- callMessageText = `${localize('CALL_REJECTED')}`;
61
- } else {
62
- callMessageText = `${localize('CALL_MISSED')}`;
63
- }
64
- break;
65
- }
66
- if (callMessageText == undefined || callMessageText == "undefined")
25
+ try {
26
+ // if (!(message instanceof CometChat.Call)) return '';
27
+ let call = message as CometChat.Call;
28
+ let callMessageText = '';
29
+ let initiator = (call?.getCallInitiator && call?.getCallInitiator()) || call.getInitiator();
30
+ switch (call.getStatus()) {
31
+ case CALL_INITIATED:
32
+ if (this.isInitiator(initiator, loggedInUser)) {
33
+ callMessageText = `${localize(`OUTGOING_CALL`)}`;
34
+ } else {
35
+ callMessageText = `${localize(`INCOMING_CALL`)}`;
36
+ }
37
+ break;
38
+ case CALL_ONGOING:
39
+ callMessageText = `${localize(`ONGOING_CALL`)}`;
40
+ break;
41
+ case CALL_ENDED:
42
+ if (this.isInitiator(initiator, loggedInUser)) {
43
+ callMessageText = `${localize(`OUTGOING_CALL`)}`;
44
+ } else {
45
+ callMessageText = `${localize(`INCOMING_CALL`)}`;
46
+ }
47
+ break;
48
+ case CALL_BUSY:
49
+ case CALL_UNANSWERED:
50
+ if (this.isInitiator(initiator, loggedInUser)) {
51
+ callMessageText = `${localize('UNANSWERED_CALL')}`;
52
+ } else {
53
+ callMessageText = `${localize('MISSED_CALL')}`;
54
+ }
55
+ break;
56
+ case CALL_CANCELLED:
57
+ if (this.isInitiator(initiator, loggedInUser)) {
58
+ callMessageText = `${localize('CANCELLED_CALL')}`;
59
+ } else {
60
+ callMessageText = `${localize('MISSED_CALL')}`;
61
+ }
62
+ break;
63
+ case CALL_REJECTED:
64
+ if (this.isInitiator(initiator, loggedInUser)) {
65
+ callMessageText = `${localize('REJECTED_CALL')}`;
66
+ } else {
67
+ callMessageText = `${localize('MISSED_CALL')}`;
68
+ }
69
+ break;
70
+ }
71
+ if (callMessageText == undefined || callMessageText == "undefined")
67
72
  console.log(message, loggedInUser);
68
-
69
- return callMessageText;
73
+
74
+ return callMessageText;
75
+ } catch (e) {
76
+ console.log("__CATCH", e)
77
+ return "";
78
+ }
79
+ }
80
+
81
+ static isMissedCall(call: CometChat.Call, loggedInUser: CometChat.User) {
82
+ const callStatus: any = call.getStatus();
83
+ if (this.isInitiator(call.getInitiator(), loggedInUser)) {
84
+ return callStatus === CALL_UNANSWERED;
85
+ } else {
86
+ return [
87
+ CALL_BUSY,
88
+ CALL_UNANSWERED,
89
+ CALL_REJECTED,
90
+ CALL_CANCELLED,
91
+ ].includes(callStatus);
92
+ }
93
+ }
94
+
95
+ static convertMinutesToHoursMinutesSeconds(minutes: number): string {
96
+ const hours = Math.floor(minutes / 60);
97
+ const remainingMinutes = Math.floor(minutes % 60);
98
+ const seconds = Math.floor((minutes - Math.floor(minutes)) * 60);
99
+ let hoursString = "";
100
+ let minutesString = "";
101
+ let secondsString = "";
102
+ if (hours > 0) {
103
+ hoursString = `${hours}h`;
104
+ }
105
+ if (remainingMinutes > 0) {
106
+ minutesString = `${remainingMinutes}m`;
107
+ }
108
+ if (seconds >= 0) {
109
+ secondsString = `${seconds}s`;
110
+ }
111
+ return hoursString ? `${hoursString} ${minutesString} ${secondsString}` : minutesString ? `${minutesString} ${secondsString}` : secondsString;
112
+ }
113
+ static convertSecondsToHoursMinutesSeconds(seconds: number): string {
114
+ const hours = Math.floor(seconds / 3600);
115
+ const remainingMinutes = Math.floor((seconds % 3600) / 60);
116
+ const remainingSeconds = Math.floor((seconds % 3600) % 60);
117
+ let hoursString = "";
118
+ let minutesString = "";
119
+ let secondsString = "";
120
+ if (hours > 0) {
121
+ hoursString = `${hours}h`;
122
+ }
123
+ if (remainingMinutes > 0) {
124
+ minutesString = `${remainingMinutes}m`;
125
+ }
126
+ if (remainingSeconds >= 0) {
127
+ secondsString = `${remainingSeconds}s`;
128
+ }
129
+ return hoursString ? `${hoursString} ${minutesString} ${secondsString}` : minutesString ? `${minutesString} ${secondsString}` : secondsString;
70
130
  }
131
+
71
132
  }
@@ -1,39 +1,157 @@
1
1
  import React from "react";
2
+ import { View, Text, Image } from "react-native";
2
3
  import { CometChat } from "@cometchat/chat-sdk-react-native"
3
- import { CometChatDetailsTemplate } from "../shared"
4
+ import { CometChatCallLogDetailsTemplate, CometChatDate, CometChatListItem, CometChatTheme, localize } from "../shared"
4
5
  import { CometChatCallButtons } from "./CometChatCallButtons";
6
+ import { CallUtils } from "./CallUtils";
7
+ import { NextArrowIcon } from "./resources";
5
8
 
6
9
  export class CallingDetailsUtils {
7
10
 
8
- static getDefaultDetailsTemplates(message: CometChat.BaseMessage, loggedInUser: CometChat.User, user?: CometChat.User, group?: CometChat.Group): Array<CometChatDetailsTemplate> {
11
+ static getDefaultDetailsTemplates(callLog: any, loggedInUser: CometChat.User, theme: CometChatTheme): Array<CometChatCallLogDetailsTemplate> {
12
+
9
13
  return [
10
- this.getPrimaryDetailsTemplate(message, loggedInUser, user, group)
14
+ this.getPrimaryDetailsTemplate(callLog, loggedInUser, theme)
11
15
  ]
12
16
  }
13
17
 
14
- static getPrimaryDetailsTemplate(message: CometChat.BaseMessage, loggedInUser: CometChat.User, user?: CometChat.User, group?: CometChat.Group): CometChatDetailsTemplate {
18
+ static getPrimaryDetailsTemplate(callLog: any, loggedInUser: CometChat.User, theme: CometChatTheme): CometChatCallLogDetailsTemplate {
19
+
20
+ let user = callLog?.getReceiverType() == "user" ? loggedInUser?.getUid() === callLog?.getInitiator()?.getUid() ? callLog.getReceiver() : callLog?.getInitiator() : undefined
21
+ let group = callLog?.getReceiverType() == "group" ? loggedInUser?.getUid() === callLog?.getInitiator()?.getUid() ? callLog.getReceiver() : callLog?.getInitiator() : undefined
22
+
23
+
24
+ function subtitleView(): JSX.Element {
25
+ return (
26
+ <View style={{ padding: 10 }}>
27
+ <CometChatDate
28
+ timeStamp={callLog['initiatedAt'] * 1000}
29
+ pattern={"dayDateFormat"}
30
+ style={{ textColor: theme.palette.getAccent(), textFont: theme.typography.title2 }}
31
+ />
32
+ <View style={{ marginTop: 2, flexDirection: "row", justifyContent: "space-between" }}>
33
+ <View style={{ flexDirection: "row" }}>
34
+ <CometChatDate timeStamp={callLog['initiatedAt'] * 1000} pattern={'timeFormat'} style={{ textColor: theme.palette.getAccent600(), textFont: theme.typography.subtitle1 }} />
35
+ <Text style={[{ marginHorizontal: 10, color: theme.palette.getAccent() }, theme.typography.subtitle1]}>
36
+ {
37
+ CallUtils.getCallStatus(callLog as CometChat.Call, loggedInUser)
38
+ }
39
+ </Text>
40
+ </View>
41
+ <Text style={[{ marginHorizontal: 10, color: theme.palette.getAccent() }, theme.typography.subtitle1]}>{CallUtils.convertMinutesToHoursMinutesSeconds(callLog['totalDurationInMinutes'])}</Text>
42
+ </View>
43
+ </View>
44
+ )
45
+ }
46
+
47
+ let options = [{
48
+ id: 'lastCall',
49
+ CustomView: () => (
50
+ <View style={{ marginHorizontal: 10, marginVertical: 20 }}>
51
+ <CometChatListItem
52
+ id={user ? user['uid'] : group ? group['guid'] : undefined}
53
+ SubtitleView={() => subtitleView()}
54
+ listItemStyle={{ backgroundColor: theme.palette.getAccent100(), borderRadius: 10 }}
55
+ />
56
+ </View>
57
+ )
58
+ }
59
+ ];
60
+
61
+ user && options.unshift({
62
+ id: "controls",
63
+ CustomView: () => <View
64
+ style={{ marginHorizontal: 2 }}
65
+ >
66
+ <CometChatCallButtons
67
+ group={group}
68
+ user={user}
69
+ callButtonStyle={{
70
+ width: "100%"
71
+ }}
72
+ />
73
+ </View>
74
+ });
75
+
15
76
  return {
16
77
  id: "callControls",
17
78
  hideItemSeparator: true,
18
79
  hideSectionSeparator: true,
19
- options: [
20
- {
21
- id: "controls",
22
- CustomView: () => <CometChatCallButtons
23
- group={group}
24
- user={user}
25
- />
26
- }
27
- ]
80
+ options: [...options]
28
81
  }
29
82
  }
30
83
 
31
- static getSecondaryDetailsTemplate(message: CometChat.BaseMessage, loggedInUser: CometChat.User, user?: CometChat.User, group?: CometChat.Group): CometChatDetailsTemplate {
84
+ static getSecondaryDetailsTemplate(callLog: any, loggedInUser: CometChat.User, theme: CometChatTheme): CometChatCallLogDetailsTemplate {
85
+ let options = [{
86
+ title: localize("CALL_HISTORY"),
87
+ id: 'history',
88
+ CustomView: () => (
89
+ <View style={{ marginHorizontal: 10, borderBottomLeftRadius: 10, borderBottomRightRadius: 10, overflow: "hidden", borderTopWidth: .5, borderColor: theme.palette.getAccent400() }}>
90
+ <CometChatListItem
91
+ id={'history'}
92
+ SubtitleView={() => (
93
+ <View style={{ flexDirection: "row", justifyContent: "space-between", alignItems: "center", padding: 10 }}>
94
+ <Text style={[{ color: theme.palette.getAccent() }, theme.typography.title2]}>{localize("CALL_HISTORY")}</Text>
95
+ <Image source={NextArrowIcon} style={{ height: 16, width: 16, alignSelf: "center", tintColor: theme.palette.getPrimary() }} />
96
+ </View>
97
+ )}
98
+ listItemStyle={{ backgroundColor: theme.palette.getAccent100(), height: 50 }}
99
+ />
100
+ </View>
101
+ )
102
+ }];
103
+
104
+ let recordingObj = {
105
+ title: localize("RECORDINGS"),
106
+ id: 'recordings',
107
+ CustomView: () => (
108
+ <View style={{ marginHorizontal: 10, overflow: "hidden", borderTopWidth: .5, borderColor: theme.palette.getAccent400() }}>
109
+ <CometChatListItem
110
+ id={'recordings'}
111
+ SubtitleView={() => (
112
+ <View style={{ flexDirection: "row", justifyContent: "space-between", alignItems: "center", padding: 10 }}>
113
+ <Text style={[{ color: theme.palette.getAccent() }, theme.typography.title2]}>{localize("RECORDINGS")}</Text>
114
+ <View style={{ flexDirection: "row" }}>
115
+ <Text style={[{ color: theme.palette.getAccent(), marginRight: 5 }, theme.typography.title2]}>{callLog?.recordings?.length}</Text>
116
+ <Image source={NextArrowIcon} style={{ height: 16, width: 16, alignSelf: "center", tintColor: theme.palette.getPrimary() }} />
117
+ </View>
118
+ </View>
119
+ )}
120
+ listItemStyle={{ backgroundColor: theme.palette.getAccent100(), height: 50 }}
121
+ />
122
+ </View>
123
+ )
124
+ }
125
+ callLog?.recordings?.length && options.unshift(recordingObj);
126
+
127
+ let participantsObj = {
128
+ title: localize("PARTICIPANTS"),
129
+ id: 'participants',
130
+ CustomView: () => (
131
+ <View style={{ marginHorizontal: 10, borderTopLeftRadius: 10, borderTopRightRadius: 10, overflow: "hidden" }}>
132
+ <CometChatListItem
133
+ id={'participants'}
134
+ SubtitleView={() => (
135
+ <View style={{ flexDirection: "row", justifyContent: "space-between", alignItems: "center", padding: 10 }}>
136
+ <Text style={[{ color: theme.palette.getAccent() }, theme.typography.title2]}>{localize("PARTICIPANTS")}</Text>
137
+ <View style={{ flexDirection: "row" }}>
138
+ <Text style={[{ color: theme.palette.getAccent(), marginRight: 5 }, theme.typography.title2]}>{callLog?.participants?.length}</Text>
139
+ <Image source={NextArrowIcon} style={{ height: 16, width: 16, alignSelf: "center", tintColor: theme.palette.getPrimary() }} />
140
+ </View>
141
+ </View>
142
+ )}
143
+ listItemStyle={{ backgroundColor: theme.palette.getAccent100(), height: 50 }}
144
+ />
145
+ </View>
146
+ )
147
+ }
148
+ options.unshift(participantsObj);
149
+
32
150
  return {
33
151
  id: "callInfo",
34
152
  hideItemSeparator: true,
35
153
  hideSectionSeparator: true,
36
- options: []
154
+ options: [...options]
37
155
  };
38
156
  }
39
157
  }
@@ -1,6 +1,20 @@
1
+ declare const require: any;
1
2
 
2
- const isCallingPackageInstalled = window["CometChatCalling"]?.["isCallingComponentInstalled"];
3
- const CometChatCalls = window["CometChatCalling"]?.['CometChatCalls'];
3
+ let isCallingPackageInstalled, CometChatCalls;
4
+
5
+ try {
6
+ // Attempt to require the package
7
+ CometChatCalls = require('@cometchat/calls-sdk-react-native')?.CometChatCalls;
8
+ isCallingPackageInstalled = true;
9
+
10
+ // If no error is thrown, the package is installed
11
+ // console.log('calls sdk is installed.');
12
+
13
+ } catch (error) {
14
+ isCallingPackageInstalled = false;
15
+ // If an error is thrown, the package is not installed
16
+ // console.log('calls sdk is not installed.');
17
+ }
4
18
 
5
19
  export const CallingPackage = {
6
20
  isCallingPackageInstalled,
@@ -131,10 +131,10 @@ export const CometChatCallButtons = (props: CometChatCallButtonsInterface) => {
131
131
  }
132
132
 
133
133
  const checkActiveCallAndDoAction = () => {
134
-
135
- setDisableButton(true);
136
-
137
- return true;
134
+
135
+ setDisableButton(true);
136
+
137
+ return true;
138
138
  }
139
139
 
140
140
  const makeCall = (type) => {
@@ -164,17 +164,16 @@ export const CometChatCallButtons = (props: CometChatCallButtonsInterface) => {
164
164
  })
165
165
  customMessage.setCustomData(customData);
166
166
  CometChatUIKit.sendCustomMessage(
167
- customMessage,
168
- (res) => {
167
+ customMessage)
168
+ .then((res) => {
169
169
  outGoingCall.current = res as CometChat.CustomMessage
170
170
  setShowOutgoingCallScreen(true);
171
171
  CometChatUIEventHandler.emitCallEvent(CallUIEvents.ccOutgoingCall, { call: res });
172
- },
173
- (rej) => {
172
+ })
173
+ .catch((rej) => {
174
174
  console.log("custom msg error", rej);
175
175
  onError && onError(rej);
176
- }
177
- );
176
+ });
178
177
  } else {
179
178
  var receiverType = user ? CometChat.RECEIVER_TYPE.USER : group ? CometChat.RECEIVER_TYPE.GROUP : undefined
180
179
  if (!receiverID || !receiverType)
@@ -0,0 +1,116 @@
1
+ import { AvatarStyleInterface, CometChatDetailsTemplate, ImageType } from "../../shared"
2
+ import { CometChat } from '@cometchat/chat-sdk-react-native'
3
+ import { CallLogDetailsStyleInterface } from "./CallLogDetailsStyle"
4
+ import { CallLogHistoryConfiguration } from "../CometChatCallLogHistory";
5
+ import { CallLogParticipantsConfiguration } from "../CometChatCallLogParticipants";
6
+ import { CallLogRecordingsConfiguration } from "../CometChatCallLogRecordings/CallLogRecordingsConfiguration";
7
+
8
+ export interface CallLogDetailsConfigurationInterface {
9
+ /**
10
+ * toggle visibility of close button
11
+ */
12
+ showCloseButton?: boolean,
13
+ /**
14
+ * This will change the close button icon
15
+ */
16
+ closeButtonIconImage?: ImageType,
17
+ /**
18
+ * toggle the profile view
19
+ */
20
+ hideProfile?: boolean,
21
+ /**
22
+ * Pass the custom profile view here.
23
+ */
24
+ CustomProfileView?: (props: { user?: CometChat.User }) => JSX.Element,
25
+ /**
26
+ * List of templates tobe shown
27
+ */
28
+ data?: (props: { message: CometChat.BaseMessage, user?: CometChat.User, group?: CometChat.Group }) => CometChatDetailsTemplate[],
29
+ /**
30
+ * call back for error
31
+ */
32
+ onError?: (e: CometChat.CometChatException) => void,
33
+ /**
34
+ * custom functionality on back press
35
+ */
36
+ onBack?: () => void,
37
+ /**
38
+ * Style object for Avatar
39
+ */
40
+ avatarStyle?: AvatarStyleInterface,
41
+ /**
42
+ * Style object for CallLogDetails
43
+ */
44
+ callLogDetailsStyle?: CallLogDetailsStyleInterface,
45
+ /**
46
+ * Configuration for call history.
47
+ */
48
+ callLogHistoryConfiguration?: CallLogHistoryConfiguration;
49
+ /**
50
+ * Configuration for call log participants.
51
+ */
52
+ callLogParticipantsConfiguration?: CallLogParticipantsConfiguration;
53
+ /**
54
+ * Configuration for call log recordings.
55
+ */
56
+ callLogRecordingsConfiguration?: CallLogRecordingsConfiguration;
57
+ }
58
+
59
+ export class CallLogDetailsConfiguration implements CallLogDetailsConfigurationInterface {
60
+ /**
61
+ * toggle visibility of close button
62
+ */
63
+ showCloseButton?: boolean
64
+ /**
65
+ * This will change the close button icon
66
+ */
67
+ closeButtonIconImage?: ImageType
68
+ /**
69
+ * toggle the profile view
70
+ */
71
+ hideProfile?: boolean
72
+ /**
73
+ * Pass the custom profile view here.
74
+ */
75
+ CustomProfileView?: (props: { user?: CometChat.User }) => JSX.Element
76
+ /**
77
+ * List of templates tobe shown
78
+ */
79
+ data?: (props: { message: CometChat.BaseMessage; user?: CometChat.User; group?: CometChat.Group }) => CometChatDetailsTemplate[]
80
+ /**
81
+ * call back for error
82
+ */
83
+ onError?: (e: CometChat.CometChatException) => void
84
+ /**
85
+ * custom functionality on back press
86
+ */
87
+ onBack?: () => void
88
+ /**
89
+ * Style object for Avatar
90
+ */
91
+ avatarStyle?: AvatarStyleInterface
92
+ /**
93
+ * Style object for CallLogDetails
94
+ */
95
+ callLogDetailsStyle?: CallLogDetailsStyleInterface
96
+ /**
97
+ * Configuration for call history.
98
+ */
99
+ callLogHistoryConfiguration?: CallLogHistoryConfiguration
100
+ /**
101
+ * Configuration for call log participants.
102
+ */
103
+ callLogParticipantsConfiguration?: CallLogParticipantsConfiguration
104
+ /**
105
+ * Configuration for call log recordings.
106
+ */
107
+ callLogRecordingsConfiguration?: CallLogRecordingsConfiguration
108
+
109
+ constructor(props: CallLogDetailsConfigurationInterface) {
110
+ if (props) {
111
+ for (const [key, value] of Object.entries(props)) {
112
+ this[key] = value;
113
+ }
114
+ }
115
+ }
116
+ }
@@ -0,0 +1,36 @@
1
+ import { BaseStyle, BaseStyleInterface, FontStyleInterface } from "../../shared";
2
+
3
+ export interface CallLogDetailsStyleInterface extends BaseStyleInterface {
4
+ titleFont?: FontStyleInterface,
5
+ titleColor?: string,
6
+ closeIconTint?: string,
7
+ }
8
+
9
+ export class CallLogDetailsStyle extends BaseStyle {
10
+ titleFont?: FontStyleInterface
11
+ titleColor?: string
12
+ closeIconTint?: string
13
+
14
+ constructor({
15
+ titleFont,
16
+ titleColor,
17
+ closeIconTint,
18
+ backgroundColor,
19
+ border,
20
+ borderRadius,
21
+ height,
22
+ width,
23
+ }: CallLogDetailsStyleInterface) {
24
+ super({
25
+ backgroundColor,
26
+ border,
27
+ borderRadius,
28
+ height,
29
+ width,
30
+ });
31
+ this.titleFont = titleFont;
32
+ this.titleColor = titleColor;
33
+ this.closeIconTint = closeIconTint;
34
+
35
+ }
36
+ }