@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
@@ -0,0 +1,73 @@
1
+ import { CometChat } from "@cometchat/chat-sdk-react-native";
2
+ import { Platform } from 'react-native'
3
+ import { MessageTypeConstants } from "../constants/UIKitConstants";
4
+ import { CometChatUIEventHandler } from "./CometChatUIEventHandler/CometChatUIEventHandler";
5
+ import { MessageEvents } from "./messages";
6
+
7
+ export class ListenerInitializer {
8
+ private static messageListenerId = `ListenerInitializer_listener`;
9
+
10
+ public static attachListeners() {
11
+ CometChat.addMessageListener(
12
+ this.messageListenerId,
13
+ this.getMessageListenerObject()
14
+ );
15
+ }
16
+
17
+ public static detachListeners() {
18
+ CometChat.removeMessageListener(this.messageListenerId);
19
+ }
20
+
21
+ private static getMessageListenerObject() {
22
+ return new CometChat.MessageListener({
23
+ onTextMessageReceived: (textMessage: CometChat.TextMessage) => {
24
+ CometChatUIEventHandler.emitMessageEvent(MessageEvents.onTextMessageReceived, textMessage);
25
+ },
26
+ onMediaMessageReceived: (mediaMessage: CometChat.MediaMessage) => {
27
+ CometChatUIEventHandler.emitMessageEvent(MessageEvents.onMediaMessageReceived, mediaMessage);
28
+ },
29
+ onCustomMessageReceived: (customMessage: CometChat.CustomMessage) => {
30
+ CometChatUIEventHandler.emitMessageEvent(MessageEvents.onCustomMessageReceived, customMessage);
31
+ },
32
+ onTypingStarted: (typingIndicator: CometChat.TypingIndicator) => {
33
+ CometChatUIEventHandler.emitMessageEvent(MessageEvents.onTypingStarted, typingIndicator);
34
+ },
35
+ onTypingEnded: (typingIndicator: CometChat.TypingIndicator) => {
36
+ CometChatUIEventHandler.emitMessageEvent(MessageEvents.onTypingEnded, typingIndicator);
37
+ },
38
+ onMessagesDelivered: (messageReceipt: CometChat.MessageReceipt) => {
39
+ CometChatUIEventHandler.emitMessageEvent(MessageEvents.onMessagesDelivered, messageReceipt);
40
+ },
41
+ onMessagesRead: (messageReceipt: CometChat.MessageReceipt) => {
42
+ CometChatUIEventHandler.emitMessageEvent(MessageEvents.onMessagesRead, messageReceipt);
43
+ },
44
+ onMessageEdited: (message: CometChat.BaseMessage) => {
45
+ CometChatUIEventHandler.emitMessageEvent(MessageEvents.onMessageEdited, message);
46
+ },
47
+ onMessageDeleted: (message: CometChat.BaseMessage) => {
48
+ CometChatUIEventHandler.emitMessageEvent(MessageEvents.onMessageDeleted, message);
49
+ },
50
+ onTransientMessageReceived: (message: CometChat.TransientMessage) => {
51
+ CometChatUIEventHandler.emitMessageEvent(MessageEvents.onTransientMessageReceived, message);
52
+ },
53
+ onInteractiveMessageReceived: (
54
+ message: CometChat.InteractiveMessage
55
+ ) => {
56
+ switch (message.getType()) {
57
+ case MessageTypeConstants.form:
58
+ CometChatUIEventHandler.emitMessageEvent(MessageEvents.onFormMessageReceived, message);
59
+ break;
60
+ case MessageTypeConstants.card:
61
+ CometChatUIEventHandler.emitMessageEvent(MessageEvents.onCardMessageReceived, message);
62
+ break;
63
+ default:
64
+ CometChatUIEventHandler.emitMessageEvent(MessageEvents.onCustomInteractiveMessageReceived, message);
65
+ break;
66
+ }
67
+ },
68
+ onInteractionGoalCompleted: (reciept: CometChat.InteractionReceipt) => {
69
+ CometChatUIEventHandler.emitMessageEvent(MessageEvents.onInteractionGoalCompleted, reciept);
70
+ }
71
+ });
72
+ }
73
+ }
@@ -8,4 +8,18 @@ export enum MessageEvents {
8
8
  ccMarkMessageAsRead = "ccMarkMessageAsRead",
9
9
  ccMessageError = "ccMessageError",
10
10
  ccActiveChatChanged = "ccActiveChatChanged",
11
+ onTextMessageReceived = "onTextMessageReceived",
12
+ onMediaMessageReceived = "onMediaMessageReceived",
13
+ onCustomMessageReceived = "onCustomMessageReceived",
14
+ onTypingStarted = "onTypingStarted",
15
+ onTypingEnded = "onTypingEnded",
16
+ onMessagesDelivered = "onMessagesDelivered",
17
+ onMessagesRead = "onMessagesRead",
18
+ onMessageEdited = "onMessageEdited",
19
+ onMessageDeleted = "onMessageDeleted",
20
+ onTransientMessageReceived = "onTransientMessageReceived",
21
+ onFormMessageReceived = "onFormMessageReceived",
22
+ onCardMessageReceived = "onCardMessageReceived",
23
+ onInteractionGoalCompleted = "onInteractionGoalCompleted",
24
+ onCustomInteractiveMessageReceived = "onCustomInteractiveMessageReceived",
11
25
  }
@@ -8,10 +8,17 @@ import { AudioBubbleStyleInterface } from "../views/CometChatAudioBubble";
8
8
  import { FileBubbleStyleInterface } from "../views/CometChatFileBubble";
9
9
  import { ImageBubbleStyleInterface } from "../views/CometChatImageBubble";
10
10
  import { VideoBubbleStyleInterface } from "../views/CometChatVideoBubble";
11
+ import { CometChatMessageComposerActionInterface } from "../helper/types";
12
+ import { AIOptionsStyle } from "../../AI/AIOptionsStyle";
13
+ import { CardMessage, FormMessage } from "../modals/InteractiveData";
14
+ import { FormBubbleStyle } from "../views/CometChatFormBubble/FormBubbleStyle";
15
+ import { CardBubbleStyle } from "../views/CometChatCardBubble/CardBubbleStyle";
11
16
 
12
17
  export interface DataSource {
13
18
  //message options based on types
14
19
  getTextMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group: CometChat.Group): Array<CometChatMessageOption>
20
+ getFormMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group: CometChat.Group): Array<CometChatMessageOption>
21
+ getCardMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group: CometChat.Group): Array<CometChatMessageOption>
15
22
  getAudioMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group: CometChat.Group): Array<CometChatMessageOption>
16
23
  getVideoMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group: CometChat.Group): Array<CometChatMessageOption>
17
24
  getImageMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group: CometChat.Group): Array<CometChatMessageOption>
@@ -25,6 +32,8 @@ export interface DataSource {
25
32
  getDeleteMessageBubble(message: CometChat.BaseMessage, theme: CometChatTheme): JSX.Element
26
33
  getVideoMessageBubble(videoUrl: string, thumbnailUrl: string, message: CometChat.MediaMessage, theme: CometChatTheme, videoBubbleStyle: VideoBubbleStyleInterface)
27
34
  getTextMessageBubble(messageText: string, message: CometChat.TextMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element
35
+ getFormMessageBubble(message: FormMessage, theme: CometChatTheme, style?: FormBubbleStyle, onSubmitClick?: (data: any) => void): JSX.Element
36
+ getCardMessageBubble(message: CardMessage, theme: CometChatTheme, style?: CardBubbleStyle, onSubmitClick?: (data: any) => void): JSX.Element
28
37
  getImageMessageBubble(imageUrl: string,caption: string,style: ImageBubbleStyleInterface,message: CometChat.MediaMessage, theme: CometChatTheme): JSX.Element
29
38
  getAudioMessageBubble(audioUrl: string, title: string, style: AudioBubbleStyleInterface, message: CometChat.MediaMessage, theme: CometChatTheme): JSX.Element
30
39
  getFileMessageBubble(fileUrl: string,title: string,style: FileBubbleStyleInterface, message: CometChat.MediaMessage , theme: CometChatTheme): JSX.Element
@@ -33,6 +42,8 @@ export interface DataSource {
33
42
 
34
43
  //content views
35
44
  getTextMessageContentView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element
45
+ getFormMessageContentView(message: FormMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element
46
+ getCardMessageContentView(message: CardMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element
36
47
  getAudioMessageContentView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element
37
48
  getVideoMessageContentView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element
38
49
  getImageMessageContentView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element
@@ -41,6 +52,8 @@ export interface DataSource {
41
52
 
42
53
  //templates
43
54
  getTextMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate
55
+ getFormMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate
56
+ getCardMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate
44
57
  getAudioMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate
45
58
  getVideoMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate
46
59
  getImageMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate
@@ -69,4 +82,6 @@ export interface DataSource {
69
82
  getLastConversationMessage(conversation : CometChat.Conversation): string
70
83
 
71
84
  getAuxiliaryHeaderAppbarOptions(user?: CometChat.User, group?: CometChat.Group, theme?: CometChatTheme): JSX.Element
85
+
86
+ getAIOptions(user: CometChat.User | null, group: CometChat.Group | null, theme: CometChatTheme, id?: Map<String, any>, AIOptionsStyle?: AIOptionsStyle): Array<(CometChatMessageComposerActionInterface | CometChatMessageOption)>
72
87
  }
@@ -1,8 +1,12 @@
1
+ import { AIOptionsStyle } from "../../AI/AIOptionsStyle";
1
2
  import { MessageBubbleAlignmentType } from "../constants/UIKitConstants";
2
3
  import { CometChatMessageComposerActionInterface } from "../helper/types";
3
4
  import { CometChatMessageOption, CometChatMessageTemplate } from "../modals";
5
+ import { CardMessage, FormMessage } from "../modals/InteractiveData";
4
6
  import { CometChatTheme } from "../resources/CometChatTheme";
5
7
  import { VideoBubbleStyleInterface, ImageBubbleStyleInterface, AudioBubbleStyleInterface, FileBubbleStyleInterface } from "../views";
8
+ import { CardBubbleStyle } from "../views/CometChatCardBubble/CardBubbleStyle";
9
+ import { FormBubbleStyle } from "../views/CometChatFormBubble/FormBubbleStyle";
6
10
  import { DataSource } from "./DataSource";
7
11
  import { CometChat } from "@cometchat/chat-sdk-react-native";
8
12
 
@@ -22,6 +26,14 @@ export class DataSourceDecorator implements DataSource {
22
26
  return this.dataSource.getTextMessageOptions(loggedInUser, messageObject, group)
23
27
  }
24
28
 
29
+ getFormMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group: CometChat.Group): CometChatMessageOption[] {
30
+ return this.dataSource.getFormMessageOptions(loggedInUser, messageObject, group)
31
+ }
32
+
33
+ getCardMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group: CometChat.Group): CometChatMessageOption[] {
34
+ return this.dataSource.getCardMessageOptions(loggedInUser, messageObject, group)
35
+ }
36
+
25
37
  getAudioMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group: CometChat.Group): CometChatMessageOption[] {
26
38
  return this.dataSource.getAudioMessageOptions(loggedInUser, messageObject, group)
27
39
  }
@@ -62,6 +74,14 @@ export class DataSourceDecorator implements DataSource {
62
74
  return this.dataSource.getTextMessageBubble(messageText, message, alignment, theme);
63
75
  }
64
76
 
77
+ getFormMessageBubble(message: FormMessage, theme: CometChatTheme, style?: FormBubbleStyle, onSubmitClick?: (data: any) => void) {
78
+ return this.dataSource.getFormMessageBubble(message, theme, style, onSubmitClick);
79
+ }
80
+
81
+ getCardMessageBubble(message: CardMessage, theme: CometChatTheme, style?: CardBubbleStyle, onSubmitClick?: (data: any) => void) {
82
+ return this.dataSource.getCardMessageBubble(message, theme, style, onSubmitClick);
83
+ }
84
+
65
85
  getImageMessageBubble(imageUrl: string, caption: string, style: ImageBubbleStyleInterface, message: CometChat.MediaMessage, theme: CometChatTheme) {
66
86
  return this.dataSource.getImageMessageBubble(imageUrl, caption, style, message, theme);
67
87
  }
@@ -82,6 +102,14 @@ export class DataSourceDecorator implements DataSource {
82
102
  return this.dataSource.getTextMessageContentView(message, alignment, theme);
83
103
  }
84
104
 
105
+ getFormMessageContentView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme) {
106
+ return this.dataSource.getFormMessageContentView(message, alignment, theme);
107
+ }
108
+
109
+ getCardMessageContentView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme) {
110
+ return this.dataSource.getCardMessageContentView(message, alignment, theme);
111
+ }
112
+
85
113
  getAudioMessageContentView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme) {
86
114
  return this.dataSource.getAudioMessageContentView(message, alignment, theme);
87
115
  }
@@ -102,6 +130,14 @@ export class DataSourceDecorator implements DataSource {
102
130
  return this.dataSource.getTextMessageTemplate(theme)
103
131
  }
104
132
 
133
+ getFormMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate {
134
+ return this.dataSource.getFormMessageTemplate(theme)
135
+ }
136
+
137
+ getCardMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate {
138
+ return this.dataSource.getCardMessageTemplate(theme)
139
+ }
140
+
105
141
  getAudioMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate {
106
142
  return this.dataSource.getAudioMessageTemplate(theme)
107
143
  }
@@ -161,4 +197,8 @@ export class DataSourceDecorator implements DataSource {
161
197
  getAuxiliaryHeaderAppbarOptions(user?: CometChat.User, group?: CometChat.Group, theme?: CometChatTheme) {
162
198
  return this.dataSource.getAuxiliaryHeaderAppbarOptions(user, group, theme);
163
199
  }
200
+
201
+ getAIOptions(user: CometChat.User | null, group: CometChat.Group | null, theme: CometChatTheme, id?: Map<String, any>, AIOptionsStyle?: AIOptionsStyle): (CometChatMessageComposerActionInterface | CometChatMessageOption)[] {
202
+ return this.dataSource.getAIOptions(user, group, theme, id, AIOptionsStyle);
203
+ }
164
204
  }
@@ -16,6 +16,11 @@ import { ChatConfigurator } from "./ChatConfigurator";
16
16
  import { CometChatMessageComposerActionInterface } from "../helper/types";
17
17
  import { ICONS } from "./resources";
18
18
  import { CometChatConversationUtils } from "../utils/conversationUtils";
19
+ import { AIOptionsStyle } from "../../AI/AIOptionsStyle";
20
+ import { CometChatFormBubble, CometChatCardBubble } from "../views";
21
+ import { CardMessage, FormMessage } from "../modals/InteractiveData";
22
+ import { FormBubbleStyle } from "../views/CometChatFormBubble/FormBubbleStyle";
23
+ import { CardBubbleStyle } from "../views/CometChatCardBubble/CardBubbleStyle";
19
24
 
20
25
  function isAudioMessage(message: CometChat.BaseMessage): message is CometChat.MediaMessage {
21
26
  return message.getCategory() == CometChat.CATEGORY_MESSAGE &&
@@ -139,6 +144,21 @@ export class MessageDataSource implements DataSource {
139
144
 
140
145
  return [...msgOptions, ...optionsList];
141
146
  }
147
+
148
+ getFormMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group: CometChat.Group): CometChatMessageOption[] {
149
+ let optionsList: Array<CometChatMessageOption> = [];
150
+ if (!isDeletedMessage(messageObject))
151
+ optionsList.push(...ChatConfigurator.dataSource.getCommonOptions(loggedInUser, messageObject, group));
152
+ return optionsList;
153
+ }
154
+
155
+ getCardMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group: CometChat.Group): CometChatMessageOption[] {
156
+ let optionsList: Array<CometChatMessageOption> = [];
157
+ if (!isDeletedMessage(messageObject))
158
+ optionsList.push(...ChatConfigurator.dataSource.getCommonOptions(loggedInUser, messageObject, group));
159
+ return optionsList;
160
+ }
161
+
142
162
  getAudioMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group: CometChat.Group): CometChatMessageOption[] {
143
163
  let optionsList: Array<CometChatMessageOption> = [];
144
164
  if (!isDeletedMessage(messageObject))
@@ -194,7 +214,7 @@ export class MessageDataSource implements DataSource {
194
214
  let optionsList: Array<CometChatMessageOption> = [];
195
215
  let _isSentByMe = this.isSentByMe(loggedInUser, messageObject);
196
216
  let canDelete = false;
197
- if (group?.getScope() != undefined && group?.getScope() != GroupMemberScope.participant) {
217
+ if ((group?.getScope() != undefined && group?.getScope() != GroupMemberScope.participant) || _isSentByMe) {
198
218
  canDelete = true;
199
219
  }
200
220
  if (!messageObject.getParentMessageId()) {
@@ -284,6 +304,21 @@ export class MessageDataSource implements DataSource {
284
304
  />
285
305
  }
286
306
 
307
+ getFormMessageBubble(message: FormMessage, theme: CometChatTheme, style?: FormBubbleStyle, onSubmitClick?: (data: any) => void): JSX.Element {
308
+ return <CometChatFormBubble
309
+ message={message}
310
+ onSubmitClick={onSubmitClick}
311
+ style={style}
312
+ />
313
+ }
314
+ getCardMessageBubble(message: CardMessage, theme: CometChatTheme, style?: CardBubbleStyle, onSubmitClick?: (data: any) => void): JSX.Element {
315
+ return <CometChatCardBubble
316
+ message={message}
317
+ onSubmitClick={onSubmitClick}
318
+ style={style}
319
+ />
320
+ }
321
+
287
322
  getImageMessageBubble(imageUrl: string, caption: string, style: ImageBubbleStyleInterface, message: CometChat.MediaMessage, theme: CometChatTheme): JSX.Element {
288
323
  if (isImageMessage(message)) {
289
324
  return <CometChatImageBubble
@@ -318,6 +353,12 @@ export class MessageDataSource implements DataSource {
318
353
  getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element {
319
354
  return ChatConfigurator.dataSource.getTextMessageBubble(message.getText(), message, alignment, theme);
320
355
  }
356
+ getFormMessageContentView(message: FormMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element {
357
+ return ChatConfigurator.dataSource.getFormMessageBubble(message, theme);
358
+ }
359
+ getCardMessageContentView(message: CardMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element {
360
+ return ChatConfigurator.dataSource.getCardMessageBubble(message, theme);
361
+ }
321
362
  getAudioMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element {
322
363
  let attachment = message.getAttachment();
323
364
  return ChatConfigurator.dataSource.getAudioMessageBubble(attachment.getUrl(), attachment.getName(), {
@@ -382,6 +423,36 @@ export class MessageDataSource implements DataSource {
382
423
  });
383
424
  }
384
425
 
426
+ getFormMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate {
427
+ return new CometChatMessageTemplate({
428
+ type: MessageTypeConstants.form,
429
+ category: MessageCategoryConstants.interactive,
430
+ ContentView: (message: CometChat.BaseMessage, _alignment: MessageBubbleAlignmentType) => {
431
+ if (isDeletedMessage(message)) {
432
+ return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
433
+ } else {
434
+ return ChatConfigurator.dataSource.getFormMessageContentView(message, _alignment, theme);
435
+ }
436
+ },
437
+ options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getFormMessageOptions(loggedInuser, message, group),
438
+ });
439
+ }
440
+
441
+ getCardMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate {
442
+ return new CometChatMessageTemplate({
443
+ type: MessageTypeConstants.card,
444
+ category: MessageCategoryConstants.interactive,
445
+ ContentView: (message: CometChat.BaseMessage, _alignment: MessageBubbleAlignmentType) => {
446
+ if (isDeletedMessage(message)) {
447
+ return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
448
+ } else {
449
+ return ChatConfigurator.dataSource.getCardMessageContentView(message, _alignment, theme);
450
+ }
451
+ },
452
+ options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getCardMessageOptions(loggedInuser, message, group),
453
+ });
454
+ }
455
+
385
456
  getAudioMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate {
386
457
  return new CometChatMessageTemplate({
387
458
  type: MessageTypeConstants.audio,
@@ -448,6 +519,8 @@ export class MessageDataSource implements DataSource {
448
519
  getAllMessageTemplates(theme: CometChatTheme): CometChatMessageTemplate[] {
449
520
  return [
450
521
  ChatConfigurator.dataSource.getTextMessageTemplate(theme),
522
+ ChatConfigurator.dataSource.getFormMessageTemplate(theme),
523
+ ChatConfigurator.dataSource.getCardMessageTemplate(theme),
451
524
  ChatConfigurator.dataSource.getAudioMessageTemplate(theme),
452
525
  ChatConfigurator.dataSource.getVideoMessageTemplate(theme),
453
526
  ChatConfigurator.dataSource.getFileMessageTemplate(theme),
@@ -480,6 +553,12 @@ export class MessageDataSource implements DataSource {
480
553
  case MessageTypeConstants.file:
481
554
  template = ChatConfigurator.dataSource.getFileMessageTemplate(theme)
482
555
  break;
556
+ case MessageTypeConstants.form:
557
+ template = ChatConfigurator.dataSource.getFormMessageTemplate(theme)
558
+ break;
559
+ case MessageTypeConstants.card:
560
+ template = ChatConfigurator.dataSource.getCardMessageTemplate(theme)
561
+ break;
483
562
  }
484
563
  return template;
485
564
  }
@@ -492,11 +571,13 @@ export class MessageDataSource implements DataSource {
492
571
  CometChatMessageTypes.video,
493
572
  CometChatMessageTypes.file,
494
573
  MessageTypeConstants.groupActions,
495
- MessageTypeConstants.groupMember
574
+ MessageTypeConstants.groupMember,
575
+ MessageTypeConstants.form,
576
+ MessageTypeConstants.card
496
577
  ];
497
578
  }
498
579
  getAllMessageCategories(): string[] {
499
- return [MessageCategoryConstants.message, MessageCategoryConstants.action];
580
+ return [MessageCategoryConstants.message, MessageCategoryConstants.action, MessageCategoryConstants.interactive];
500
581
  }
501
582
  getAuxiliaryOptions(user: CometChat.User, group: CometChat.Group, id: Map<string, any>, theme?:CometChatTheme): JSX.Element[] {
502
583
  return [];
@@ -612,7 +693,9 @@ export class MessageDataSource implements DataSource {
612
693
  return null;
613
694
  }
614
695
 
615
-
696
+ getAIOptions(user: CometChat.User | null, group: CometChat.Group | null, theme: CometChatTheme, id?: Map<String, any>, AIOptionsStyle?: AIOptionsStyle) {
697
+ return [];
698
+ }
616
699
 
617
700
  getLastConversationMessage(conversation: CometChat.Conversation): string {
618
701
  return CometChatConversationUtils.getMessagePreview(conversation.getLastMessage());
@@ -24,6 +24,26 @@ import {
24
24
  CometChatMessageTemplate,
25
25
  CometChatDetailsTemplate,
26
26
  CometChatDetailsOption,
27
+ CometChatCallLogDetailsTemplate,
28
+ CometChatCallLogDetailsOption,
29
+ APIAction,
30
+ ActionEntity,
31
+ BaseInputElement,
32
+ BaseInteractiveElement,
33
+ ButtonElement,
34
+ CardMessage,
35
+ CheckboxElement,
36
+ CustomAction,
37
+ CustomInteractiveMessage,
38
+ DropdownElement,
39
+ ElementEntity,
40
+ FormMessage,
41
+ LabelElement,
42
+ OptionElement,
43
+ RadioButtonElement,
44
+ SingleSelectElement,
45
+ TextInputElement,
46
+ URLNavigationAction
27
47
  } from './modals';
28
48
  import { CometChatLocalize, localize } from './resources/CometChatLocalize';
29
49
  import { CometChatTheme, Palette, Typography } from './resources/CometChatTheme';
@@ -113,6 +133,10 @@ import {
113
133
  ReceiptConfigurationInterface,
114
134
  StatusIndicatorConfigurationInterface,
115
135
  StatusIndicatorStyleInterface,
136
+ CometChatFormBubble,
137
+ CometChatFormBubbleInterface,
138
+ CometChatCardBubble,
139
+ CometChatCardBubbleInterface
116
140
  } from './views';
117
141
 
118
142
  import {
@@ -192,6 +216,8 @@ export {
192
216
  CometChatMessageTemplate,
193
217
  CometChatDetailsTemplate,
194
218
  CometChatDetailsOption,
219
+ CometChatCallLogDetailsTemplate,
220
+ CometChatCallLogDetailsOption,
195
221
  //
196
222
  CometChatLocalize,
197
223
  localize,
@@ -259,4 +285,26 @@ export {
259
285
  CometChatMediaRecorderInterface,
260
286
  MediaRecorderStyleInterface,
261
287
  MediaRecorderStyle,
288
+ CometChatFormBubble,
289
+ CometChatFormBubbleInterface,
290
+ CometChatCardBubble,
291
+ CometChatCardBubbleInterface,
292
+ APIAction,
293
+ ActionEntity,
294
+ BaseInputElement,
295
+ BaseInteractiveElement,
296
+ ButtonElement,
297
+ CardMessage,
298
+ CheckboxElement,
299
+ CustomAction,
300
+ CustomInteractiveMessage,
301
+ DropdownElement,
302
+ ElementEntity,
303
+ FormMessage,
304
+ LabelElement,
305
+ OptionElement,
306
+ RadioButtonElement,
307
+ SingleSelectElement,
308
+ TextInputElement,
309
+ URLNavigationAction
262
310
  };
@@ -0,0 +1,23 @@
1
+ import { TextStyle } from 'react-native';
2
+ import { ImageType } from '../base';
3
+
4
+ export interface CometChatCallLogDetailsOption {
5
+ id?: string | number;
6
+ ///[title] passes title to option
7
+ title?: string;
8
+ ///to pass icon url
9
+ icon?: ImageType;
10
+ ///[titleStyle] styling property for [title]
11
+ titleStyle?: TextStyle;
12
+ backgroundColor?: string;
13
+ iconTint?: string;
14
+ ///to pass custom view to options
15
+ CustomView?: () => JSX.Element;
16
+ /// to pass tail component for detail option
17
+ Tail?:() => JSX.Element;
18
+ ///to pass height for details
19
+ height?: number;
20
+ ///[onClick] call function which takes 3 parameter , and one of user or group is populated at a time
21
+ onClick?: (callLog: any) => void;
22
+ }
23
+
@@ -0,0 +1,16 @@
1
+ import { TextStyle } from 'react-native';
2
+ import { FontStyleInterface } from '../base';
3
+ import { CometChatCallLogDetailsOption } from './CometChatCallLogDetailsOptions';
4
+
5
+ export interface CometChatCallLogDetailsTemplate {
6
+ id?: string | number;
7
+ title?: string;
8
+ titleColor?: string;
9
+ titleFont?: FontStyleInterface;
10
+ titleStyle?: TextStyle;
11
+ sectionSeparatorColor?: string;
12
+ itemSeparatorColor?: string;
13
+ hideSectionSeparator?: boolean;
14
+ hideItemSeparator?: boolean;
15
+ options?: CometChatCallLogDetailsOption[];
16
+ }
@@ -0,0 +1,118 @@
1
+ import { ButtonAction, HTTPSRequestMethods } from "../../../constants/UIKitConstants";
2
+
3
+ import { ActionEntity } from "../InteractiveEntities/ActionEntity";
4
+
5
+ /**
6
+ * Represents an API action that can be performed on a dynamic form.
7
+ */
8
+
9
+ export class APIAction extends ActionEntity {
10
+ /**
11
+ * The URL to which the API action should be performed.
12
+ */
13
+ private url: string;
14
+ /**
15
+ * The HTTP method to be used for the API action.
16
+ */
17
+ private method: string;
18
+ /**
19
+ * The payload to be sent with the API action.
20
+ */
21
+ private payload?: Object;
22
+ /**
23
+ * The headers to be sent with the API action.
24
+ */
25
+ private headers?: Object;
26
+ /**
27
+ * The key to be used to insert the data in the provided payload.
28
+ */
29
+ private dataKey?: string = "CometChatData";
30
+
31
+ /**
32
+ * Creates a new instance of the APIAction class.
33
+ * @param {string} url - The URL to which the API action should be performed.
34
+ * @param {string} method - The HTTP method to be used for the API action.
35
+ */
36
+ constructor(url: string, method: string) {
37
+ super(ButtonAction.apiAction);
38
+ this.url = url || "https://example.com";
39
+ this.method = method || HTTPSRequestMethods.POST;
40
+ }
41
+
42
+ /**
43
+ * Returns the URL to which the API action should be performed.
44
+ * @returns {string} The URL to which the API action should be performed.
45
+ */
46
+ getURL(): string {
47
+ return this.url;
48
+ }
49
+
50
+ /**
51
+ * Returns the HTTP method to be used for the API action.
52
+ * @returns {string} The HTTP method to be used for the API action.
53
+ */
54
+ getMethod(): string {
55
+ return this.method;
56
+ }
57
+
58
+ /**
59
+ * Returns the payload to be sent with the API action.
60
+ * @returns {Object} The payload to be sent with the API action.
61
+ */
62
+ getPayload(): Object | undefined {
63
+ return this.payload;
64
+ }
65
+
66
+ /**
67
+ * Sets the payload to be sent with the API action.
68
+ * @param {Object} payload - The payload to be sent with the API action.
69
+ */
70
+ setPayload(payload: Object): void {
71
+ this.payload = payload;
72
+ }
73
+
74
+ /**
75
+ * Returns the headers to be sent with the API action.
76
+ * @returns {Object} The headers to be sent with the API action.
77
+ */
78
+ getHeaders(): Object | undefined {
79
+ return this.headers;
80
+ }
81
+
82
+ /**
83
+ * Sets the headers to be sent with the API action.
84
+ * @param {Object} headers - The headers to be sent with the API action.
85
+ */
86
+ setHeaders(headers: Object): void {
87
+ this.headers = headers;
88
+ }
89
+
90
+ /**
91
+ * Returns the key to be used to insert the data in the provided payload.
92
+ * @returns {string} The key to be used to insert the data in the provided payload.
93
+ */
94
+ getDataKey(): string | undefined {
95
+ return this.dataKey;
96
+ }
97
+
98
+ /**
99
+ * Sets the key to be used to insert the data in the provided payload.
100
+ * @param {string} dataKey - The key to be used to insert the data in the provided payload.
101
+ */
102
+ setDataKey(dataKey: string): void {
103
+ this.dataKey = dataKey;
104
+ }
105
+
106
+ static fromJSON(json: any): APIAction {
107
+ const apiAction = new APIAction(json.url, json.method);
108
+
109
+ if (json.payload)
110
+ apiAction.setPayload(json.payload);
111
+ if (json.headers)
112
+ apiAction.setHeaders(json.headers);
113
+ if (json.dataKey)
114
+ apiAction.setDataKey(json.dataKey);
115
+
116
+ return apiAction;
117
+ }
118
+ }
@@ -0,0 +1,19 @@
1
+ import { ActionEntity } from "../InteractiveEntities/ActionEntity";
2
+ import { ButtonAction } from "../../../constants/UIKitConstants";
3
+
4
+ /**
5
+ * Represents a custom action entity.
6
+ */
7
+ export class CustomAction extends ActionEntity {
8
+ constructor() {
9
+ super(ButtonAction.custom);
10
+ }
11
+
12
+ /**
13
+ * Creates a new CustomAction object from a JSON object.
14
+ * @returns A new CustomAction object created from the JSON object.
15
+ */
16
+ static fromJSON(): CustomAction {
17
+ return new CustomAction();
18
+ }
19
+ }
@@ -0,0 +1,34 @@
1
+ import { ActionEntity } from "../InteractiveEntities/ActionEntity";
2
+ import { ButtonAction } from "../../../constants/UIKitConstants";
3
+
4
+ /**
5
+ * Represents a URL navigation action that can be performed on a dynamic form.
6
+ */
7
+
8
+ export class URLNavigationAction extends ActionEntity {
9
+ /**
10
+ * The URL to navigate to.
11
+ */
12
+ private url: string;
13
+
14
+ /**
15
+ * Creates a new instance of the URLNavigationAction class.
16
+ * @param {string} url - The URL to navigate to.
17
+ */
18
+ constructor(url: string) {
19
+ super(ButtonAction.urlNavigation);
20
+ this.url = url || "https://example.com";
21
+ }
22
+
23
+ /**
24
+ * Returns the URL to navigate to.
25
+ * @returns {string} The URL to navigate to.
26
+ */
27
+ getURL(): string {
28
+ return this.url;
29
+ }
30
+
31
+ static fromJSON(json: any): URLNavigationAction {
32
+ return new URLNavigationAction(json.url);
33
+ }
34
+ }