@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,294 @@
1
+ import React, { useContext, useState, useEffect, useCallback } from 'react'
2
+ import { CometChat } from "@cometchat/chat-sdk-react-native";
3
+ import { View, Text, TextInput, Dimensions, TouchableOpacity, Image, FlatList } from 'react-native'
4
+ import { AIAssistBotConfiguration } from './configuration';
5
+ import { CometChatBottomSheet, CometChatContext, CometChatContextType, CometChatDate, CometChatListItem, CometChatReceipt, CometChatTextBubble, CometChatTheme, localize } from '../../shared';
6
+ import { CloseIcon } from './resources';
7
+ import { ICONS } from '../../shared/framework/resources';
8
+ import { ICONS as MessageIcons } from '../../shared/assets/images';
9
+ import { getUnixTimestamp } from '../../shared/utils/CometChatMessageHelper';
10
+ import { CometChatMessageBubble } from '../../shared/views/CometChatMessageBubble';
11
+ import { MessageBubbleAlignmentType, ReceiverTypeConstants } from '../../shared/constants/UIKitConstants';
12
+ import { AIBotMessageBubbleStyle, AISenderMessageBubbleStyle } from './AIAssistBotStyle';
13
+
14
+ interface AIAssistBotViewProps {
15
+ title: string;
16
+ configuration: AIAssistBotConfiguration;
17
+ closeCallback: () => void,
18
+ bot: CometChat.User,
19
+ sender: CometChat.User,
20
+ onSend: (question: string, bot: CometChat.User) => Promise<any>
21
+ }
22
+
23
+ const AIAssistBotView = (props: AIAssistBotViewProps) => {
24
+ const { height } = Dimensions.get('window');
25
+ const { title, bot, sender, closeCallback, configuration, onSend } = props;
26
+ const { theme } = useContext<CometChatContextType>(CometChatContext);
27
+
28
+ const [question, setQuestion] = useState("");
29
+ const [messages, setMessages] = useState([]);
30
+
31
+ const style = {
32
+ titleColor: configuration?.style?.titleColor || theme.palette.getAccent(),
33
+ titleFont: configuration?.style?.titleFont || theme.typography.name,
34
+ closeIconTint: configuration?.style?.closeIconTint || theme.palette.getAccent(),
35
+ sendIconTint: configuration?.style?.sendIconTint || question ? theme.palette.getPrimary() : theme.palette.getAccent600(),
36
+ messageInputStyle: configuration?.messageInputStyle || {},
37
+ subtitleColor: configuration?.style?.subtitleColor || theme.palette.getAccent500(),
38
+ subtitleFont: configuration?.style?.subtitleFont || theme.typography.subtitle2,
39
+ ...configuration?.style
40
+ };
41
+
42
+ const {
43
+ titleColor,
44
+ titleFont,
45
+ closeIconTint,
46
+ sendIconTint,
47
+ subtitleColor,
48
+ subtitleFont
49
+ } = style;
50
+
51
+ useEffect(() => {
52
+ let botFirstMessage = "";
53
+ if (configuration?.botFirstMessageText) {
54
+ botFirstMessage = configuration.botFirstMessageText(bot);
55
+ } else {
56
+ botFirstMessage = localize("COMETCHAT_BOT_FIRST_MESSAGE");
57
+ }
58
+
59
+ const message = new CometChat.TextMessage(
60
+ sender?.getUid(),
61
+ botFirstMessage,
62
+ ReceiverTypeConstants.user
63
+ );
64
+ message.setSentAt(getUnixTimestamp());
65
+ message.setMuid(String(getUnixTimestamp()));
66
+ message.setSender(bot);
67
+
68
+ let newMessages = [...messages];
69
+ newMessages.unshift(message);
70
+
71
+ setMessages(newMessages);
72
+
73
+ }, [])
74
+
75
+ const onClose = () => {
76
+ closeCallback && closeCallback()
77
+ }
78
+
79
+ const onChangeText = (value: string) => {
80
+ setQuestion(value)
81
+ }
82
+
83
+ const onMsgSend = () => {
84
+ if (!question) return;
85
+ if (messages[0]?.sender?.getUid() === sender?.getUid()) return;
86
+
87
+ let newMessages = [...messages];
88
+
89
+ const MUID = String(getUnixTimestamp());
90
+ const message = new CometChat.TextMessage(
91
+ bot.getUid(),
92
+ question,
93
+ ReceiverTypeConstants.user
94
+ );
95
+ message.setSentAt(getUnixTimestamp());
96
+ message.setMuid(MUID);
97
+ message.setSender(sender);
98
+ message.setStatus("WAIT");
99
+
100
+ newMessages.unshift(message);
101
+ setMessages(newMessages);
102
+
103
+ onSend(question, bot)
104
+ .then(botReply => {
105
+ const message = new CometChat.TextMessage(
106
+ sender?.getUid(),
107
+ botReply,
108
+ ReceiverTypeConstants.user
109
+ );
110
+ message.setSentAt(getUnixTimestamp());
111
+ message.setMuid(String(getUnixTimestamp()));
112
+ message.setSender(bot);
113
+ message.setStatus(undefined);
114
+
115
+ const messageList = newMessages.map((message) => {
116
+ if (message.getMuid() === MUID) {
117
+ message.setStatus(undefined);
118
+ }
119
+ return message;
120
+ });
121
+
122
+ messageList.unshift(message);
123
+ setMessages(messageList);
124
+ })
125
+ .catch(err => {
126
+ const messageList = newMessages.map((message) => {
127
+ if (message.getMuid() === MUID) {
128
+ message.setStatus("ERROR");
129
+ }
130
+ return message;
131
+ });
132
+ setMessages(messageList);
133
+ });
134
+
135
+ setQuestion("")
136
+ }
137
+
138
+ const RenderMessageItem = ({ item, index }) => {
139
+ const contentView = (message: any,
140
+ theme: CometChatTheme,
141
+ alignment: MessageBubbleAlignmentType,
142
+ configuration: AIAssistBotConfiguration): JSX.Element => {
143
+ let style: AIBotMessageBubbleStyle | AISenderMessageBubbleStyle = {};
144
+
145
+ if (alignment === "right") {
146
+ style = configuration?.senderMessageBubbleStyle || {};
147
+ } else {
148
+ style = configuration?.botMessageBubbleStyle || {};
149
+ }
150
+
151
+ const defaultStyle: any = {
152
+ textFont: style?.textFont || theme.typography.text1,
153
+ borderRadius: style?.borderRadius || 12,
154
+ width: style?.width || "100%",
155
+ };
156
+ if (alignment === "right") {
157
+ defaultStyle["textColor"] = style?.textColor || theme.palette.getSecondary();
158
+ defaultStyle["backgroundColor"] = style?.backgroundColor || theme.palette.getPrimary()
159
+ } else {
160
+ defaultStyle["textColor"] = style?.textColor || theme.palette.getAccent();
161
+ defaultStyle["backgroundColor"] = style?.backgroundColor || theme.palette.getSecondary()
162
+ }
163
+
164
+ return (
165
+ <CometChatTextBubble
166
+ text={item.text}
167
+ style={defaultStyle}
168
+ textContainerStyle={defaultStyle}
169
+ />
170
+ )
171
+ }
172
+ function getBubbleAlignment(
173
+ message: any,
174
+ sender: CometChat.User
175
+ ): MessageBubbleAlignmentType {
176
+ if (message.sender?.getUid() === sender?.getUid()) {
177
+ return "right";
178
+ } else {
179
+ return "left";
180
+ }
181
+ }
182
+ function getMessageBubbleStyle(message: CometChat.TextMessage, theme: CometChatTheme, sender: CometChat.User, configuration: AIAssistBotConfiguration): any {
183
+ if (message.sender?.getUid() === sender?.getUid()) {
184
+ const style = configuration?.senderMessageBubbleStyle || {};
185
+ return {
186
+ background: style.backgroundColor || theme.palette.getPrimary(),
187
+ borderRadius: style.borderRadius || 12,
188
+ border: style.border || undefined,
189
+ }
190
+ } else {
191
+ const style = configuration?.botMessageBubbleStyle || {};
192
+ if (configuration?.botMessageBubbleStyle) {
193
+ return configuration?.botMessageBubbleStyle;
194
+ }
195
+ return {
196
+ background: style.backgroundColor || theme.palette.getSecondary(),
197
+ borderRadius: style.borderRadius || 12,
198
+ border: style.border || undefined,
199
+ };
200
+ }
201
+ };
202
+
203
+ const getFooterView = (item: CometChat.BaseMessage, bubbleAlignment: MessageBubbleAlignmentType): JSX.Element => {
204
+
205
+ let isSender = (item.getSender()?.getUid() || item['sender']['uid']) == (sender?.getUid() || sender['uid']);
206
+
207
+ return <View style={[{ flexDirection: "row", justifyContent: bubbleAlignment === "right" ? "flex-end" : "flex-start" }]}>
208
+ <CometChatDate
209
+ timeStamp={((item.getDeletedAt() || item.getReadAt() || item.getDeliveredAt() || item.getSentAt()) * 1000)}
210
+ style={{ textColor: theme?.palette?.getAccent600() }}
211
+ pattern={"timeFormat"}
212
+ />
213
+ {
214
+ isSender ?
215
+ <CometChatReceipt
216
+ receipt={item.getStatus()}
217
+ waitIcon={configuration?.loadingIconURL || MessageIcons.WAITING}
218
+ errorIcon={configuration?.errorIconURL || MessageIcons.ERROR_TICK}
219
+ /> :
220
+ null
221
+ }
222
+ </View>
223
+ }
224
+
225
+ return (
226
+ <View style={{ marginBottom: 15, marginHorizontal: 2 }} key={index}>
227
+ <CometChatMessageBubble
228
+ id={`${item.id}`}
229
+ ContentView={() => contentView(item, theme, getBubbleAlignment(item, sender), configuration)}
230
+ FooterView={() => getFooterView(item, getBubbleAlignment(item, sender))}
231
+ alignment={getBubbleAlignment(item, sender)}
232
+ style={getMessageBubbleStyle(item, theme, sender, configuration)}
233
+ />
234
+ </View>
235
+ )
236
+ }
237
+
238
+ const keyExtractor = useCallback((item) => `${item.getMuid()}`, [])
239
+
240
+ return (
241
+ <CometChatBottomSheet
242
+ onClose={onClose}
243
+ style={{
244
+ lineHeight: 15,
245
+ borderRadius: 20
246
+ }}
247
+ >
248
+ <View style={{ height: height * .5, }}>
249
+ <CometChatListItem
250
+ id={bot.getUid()}
251
+ title={title || bot.getName()}
252
+ avatarStyle={configuration?.avatarStyle}
253
+ avatarName={title || bot.getName()}
254
+ avatarURL={bot.getAvatar() ? { uri: bot.getAvatar() } : undefined}
255
+ SubtitleView={() => <Text style={[{ color: subtitleColor }, subtitleFont]}>{localize("COMETCHAT_ASK_BOT_SUBTITLE")}</Text>}
256
+ TailView={() => <TouchableOpacity onPress={onClose}>
257
+ <Image style={{ width: 20, height: 20, tintColor: closeIconTint }} source={configuration?.closeIconURL || CloseIcon} />
258
+ </TouchableOpacity>}
259
+ listItemStyle={{
260
+ titleColor, titleFont,
261
+ }}
262
+ />
263
+ <View style={{ flex: 1 }}>
264
+ <FlatList
265
+ inverted={true}
266
+ data={messages}
267
+ keyExtractor={keyExtractor}
268
+ renderItem={RenderMessageItem}
269
+ />
270
+ </View>
271
+ <View style={{
272
+ flexDirection: "row", alignItems: "center", justifyContent: "center", paddingTop: 10,
273
+ borderTopWidth: 1, borderColor: style?.messageInputStyle?.dividerTint || theme.palette.getAccent200()
274
+ }}>
275
+ <TextInput
276
+ placeholder={localize('ENTER_YOUR_MESSAGE_HERE')}
277
+ placeholderTextColor={style?.messageInputStyle?.placeholderTextColor}
278
+ value={question}
279
+ style={[{
280
+ padding: 8, flex: 1, borderWidth: 1, borderColor: theme.palette.getAccent500(), borderRadius: 20,
281
+ marginLeft: 10, color: style.messageInputStyle.textColor,
282
+ }, style.messageInputStyle.placeholderTextFont, style.messageInputStyle.textFont]}
283
+ onChangeText={onChangeText}
284
+ />
285
+ <TouchableOpacity activeOpacity={!question && 1} onPress={onMsgSend}>
286
+ <Image style={{ width: 30, height: 30, tintColor: sendIconTint, marginHorizontal: 10 }} source={configuration?.sendIconURL || ICONS.SEND} />
287
+ </TouchableOpacity>
288
+ </View>
289
+ </View>
290
+ </CometChatBottomSheet>
291
+ )
292
+ }
293
+
294
+ export default AIAssistBotView
@@ -0,0 +1,22 @@
1
+ import { CometChat } from '@cometchat/chat-sdk-react-native'
2
+ import { AIAssistBotStyle, AIBotMessageBubbleStyle, AISenderMessageBubbleStyle } from './AIAssistBotStyle';
3
+ import { ICONS } from '../../shared/assets/images';
4
+ import { AvatarStyle, CometChatMessageInputStyleInterface } from '../../shared';
5
+
6
+ export class AIAssistBotConfiguration {
7
+ apiConfiguration?: (bot: CometChat.User, user?: CometChat.User, group?: CometChat.Group) => Promise<Object>;
8
+ title: (bot: CometChat.User) => string;
9
+ botFirstMessageText: (bot: CometChat.User) => string;
10
+ closeIconURL: string;
11
+ sendIconURL: string;
12
+ botMessageBubbleStyle: AIBotMessageBubbleStyle;
13
+ senderMessageBubbleStyle: AISenderMessageBubbleStyle;
14
+ avatarStyle?: AvatarStyle;
15
+ messageInputStyle?: CometChatMessageInputStyleInterface;
16
+ style: AIAssistBotStyle;
17
+ loadingIconURL?: string = ICONS.WAITING;
18
+ errorIconURL?: string = ICONS.ERROR_TICK;
19
+ constructor(props: Partial<AIAssistBotConfiguration>) {
20
+ Object.assign(this, props);
21
+ }
22
+ }
@@ -0,0 +1,5 @@
1
+ import CloseIcon from "./CloseIcon.png";
2
+
3
+ export {
4
+ CloseIcon
5
+ }
@@ -1,17 +1,14 @@
1
- import { CardStyle, CardViewStyle } from "./CardViewStyle";
2
1
  import {CometChat} from '@cometchat/chat-sdk-react-native'
3
2
  import { emptyIcon, errorIcon, loadingIcon } from "./resources";
4
- export class AIEnablerConfiguration {
5
- listStyle?: CardViewStyle;
6
- listItemStyle?:CardStyle;
7
- buttonIconURL?: string = "";
3
+ export class AIBaseConfiguration {
4
+ apiConfiguration?: (user?: CometChat.User, group?: CometChat.Group) => Promise<Object>;
8
5
  ErrorStateView?: (e?: CometChat.CometChatException) => JSX.Element;
9
6
  EmptyStateView?: () => JSX.Element;
10
7
  LoadingStateView?: () => JSX.Element;
11
8
  loadingIconURL?:string = loadingIcon;
12
9
  errorIconURL?:string = errorIcon;
13
10
  emptyIconURL?:string = emptyIcon;
14
- constructor(props: Partial<AIEnablerConfiguration>) {
11
+ constructor(props: Partial<AIBaseConfiguration>) {
15
12
  Object.assign(this, props);
16
13
  }
17
14
  }
@@ -0,0 +1,58 @@
1
+ import { BaseStyle, FontStyle } from "../shared";
2
+
3
+ export interface AIBaseStyleInterface extends BaseStyle {
4
+ emptyStateTextFont?: FontStyle;
5
+ emptyStateTextColor?: string;
6
+ loadingStateTextFont?: FontStyle;
7
+ loadingStateTextColor?: string;
8
+ errorStateTextFont?: FontStyle;
9
+ errorStateTextColor?: string;
10
+ loadingIconTint?: string;
11
+ emptyIconTint?: string;
12
+ errorIconTint?: string;
13
+ }
14
+
15
+ export class AIBaseStyle extends BaseStyle {
16
+ emptyStateTextFont?: FontStyle;
17
+ emptyStateTextColor?: string;
18
+ loadingStateTextFont?: FontStyle;
19
+ loadingStateTextColor?: string;
20
+ errorStateTextFont?: FontStyle;
21
+ errorStateTextColor?: string;
22
+ loadingIconTint?: string;
23
+ emptyIconTint?: string;
24
+ errorIconTint?: string;
25
+ constructor({
26
+ emptyIconTint,
27
+ emptyStateTextColor,
28
+ emptyStateTextFont,
29
+ errorIconTint,
30
+ errorStateTextColor,
31
+ errorStateTextFont,
32
+ loadingIconTint,
33
+ loadingStateTextColor,
34
+ loadingStateTextFont,
35
+ backgroundColor,
36
+ border,
37
+ borderRadius,
38
+ height,
39
+ width
40
+ }: AIBaseStyleInterface) {
41
+ super({
42
+ backgroundColor,
43
+ border,
44
+ borderRadius,
45
+ height,
46
+ width
47
+ })
48
+ this.emptyIconTint = emptyIconTint;
49
+ this.emptyStateTextColor = emptyStateTextColor;
50
+ this.emptyStateTextFont = emptyStateTextFont;
51
+ this.errorIconTint = errorIconTint;
52
+ this.errorStateTextColor = errorStateTextColor;
53
+ this.errorStateTextFont = errorStateTextFont;
54
+ this.loadingIconTint = loadingIconTint;
55
+ this.loadingStateTextColor = loadingStateTextColor;
56
+ this.loadingStateTextFont = loadingStateTextFont;
57
+ }
58
+ }
@@ -1,33 +1,19 @@
1
- import { AIConversationStarterDecorator } from "./AIConversationStarterDecorator";
2
- import { ExtensionsDataSource,ChatConfigurator } from "../../shared";
1
+ import { AIConversationStarterDecorator } from "./AIConversationStarterDecorator";
2
+ import { ChatConfigurator } from "../../shared";
3
3
  import { AIExtensionDataSource } from "../AIExtensionDataSource";
4
4
  import { AIConversationStarterConfiguration } from "./configuration";
5
- import { AIEnablerConfiguration } from "../configuration";
6
5
  export class AIConversationStarterExtension extends AIExtensionDataSource {
7
- configuration?:AIConversationStarterConfiguration;
8
- constructor(configuration?:AIConversationStarterConfiguration){
6
+ configuration?: AIConversationStarterConfiguration;
7
+ constructor(configuration?: AIConversationStarterConfiguration) {
9
8
  super()
10
9
  this.configuration = configuration
11
10
 
12
11
  }
13
12
  override addExtension(): void {
14
- ChatConfigurator.enable((dataSource: any) => new AIConversationStarterDecorator(dataSource,this.configuration));
13
+ ChatConfigurator.enable((dataSource: any) => new AIConversationStarterDecorator(dataSource, this.configuration));
15
14
  }
16
15
  override getExtensionId(): string {
17
16
  return "conversation-starter";
18
17
  }
19
- override enable(): void {
20
- this.addExtension()
21
- }
22
- override getConfiguration():AIConversationStarterConfiguration{
23
- return this.configuration
24
- }
25
- override setConfiguration(config?:AIEnablerConfiguration):void{
26
- this.configuration = {...this.configuration,...config}
27
- this.configuration.conversationStarterStyle = {
28
- ...this.configuration.conversationStarterStyle,
29
- ...(config?.listItemStyle || config?.listStyle)
30
- };
31
- };
32
18
 
33
19
  }