@cometchat/chat-uikit-react-native 4.0.1 → 4.0.2

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 (235) 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 +2 -2
  90. package/src/AI/AIConversationStarter/AIConversationStarterDecorator.tsx +3 -4
  91. package/src/CometChatConversations/CometChatConversations.tsx +56 -46
  92. package/src/CometChatMessageHeader/listners.ts +5 -4
  93. package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +35 -35
  94. package/src/CometChatMessageList/CometChatMessageList.tsx +251 -142
  95. package/src/CometChatMessages/CometChatMessages.tsx +4 -3
  96. package/src/CometChatTabs/CometChatTabs.tsx +1 -1
  97. package/src/extensions/SmartReplies/SmartRepliesDecorator.tsx +3 -9
  98. package/src/index.ts +59 -17
  99. package/src/shared/CometChatUiKit/CometChatUIKit.ts +98 -10
  100. package/src/shared/constants/UIKitConstants.ts +81 -47
  101. package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +46 -2
  102. package/src/shared/events/CometChatUIEventHandler/Listener.ts +61 -2
  103. package/src/shared/events/ListenerInitializer.ts +73 -0
  104. package/src/shared/events/messages.ts +14 -0
  105. package/src/shared/framework/DataSource.ts +11 -0
  106. package/src/shared/framework/DataSourceDecorator.tsx +35 -0
  107. package/src/shared/framework/MessageDataSource.tsx +83 -3
  108. package/src/shared/index.ts +44 -0
  109. package/src/shared/modals/InteractiveData/InteractiveActions/APIAction.ts +118 -0
  110. package/src/shared/modals/InteractiveData/InteractiveActions/CustomAction.ts +19 -0
  111. package/src/shared/modals/InteractiveData/InteractiveActions/URLNavigationAction.ts +34 -0
  112. package/src/shared/modals/InteractiveData/InteractiveActions/index.ts +3 -0
  113. package/src/shared/modals/InteractiveData/InteractiveData/InteractiveCardData.ts +69 -0
  114. package/src/shared/modals/InteractiveData/InteractiveData/InteractiveFormData.ts +119 -0
  115. package/src/shared/modals/InteractiveData/InteractiveData/index.ts +2 -0
  116. package/src/shared/modals/InteractiveData/InteractiveElements/BaseInputElement.ts +102 -0
  117. package/src/shared/modals/InteractiveData/InteractiveElements/BaseInteractiveElement.ts +45 -0
  118. package/src/shared/modals/InteractiveData/InteractiveElements/ButtonElement.ts +61 -0
  119. package/src/shared/modals/InteractiveData/InteractiveElements/CheckboxElement.ts +75 -0
  120. package/src/shared/modals/InteractiveData/InteractiveElements/DropdownElement.ts +83 -0
  121. package/src/shared/modals/InteractiveData/InteractiveElements/LabelElement.ts +32 -0
  122. package/src/shared/modals/InteractiveData/InteractiveElements/OptionElement.ts +39 -0
  123. package/src/shared/modals/InteractiveData/InteractiveElements/RadioButtonElement.ts +76 -0
  124. package/src/shared/modals/InteractiveData/InteractiveElements/SingleSelectElement.ts +76 -0
  125. package/src/shared/modals/InteractiveData/InteractiveElements/TextInputElement.ts +101 -0
  126. package/src/shared/modals/InteractiveData/InteractiveElements/index.ts +10 -0
  127. package/src/shared/modals/InteractiveData/InteractiveEntities/ActionEntity.ts +41 -0
  128. package/src/shared/modals/InteractiveData/InteractiveEntities/ElementEntity.ts +64 -0
  129. package/src/shared/modals/InteractiveData/InteractiveEntities/index.ts +2 -0
  130. package/src/shared/modals/InteractiveData/InteractiveMessage/CardMessage.ts +142 -0
  131. package/src/shared/modals/InteractiveData/InteractiveMessage/CustomInteractiveMessage.ts +38 -0
  132. package/src/shared/modals/InteractiveData/InteractiveMessage/FormMessage.ts +152 -0
  133. package/src/shared/modals/InteractiveData/InteractiveMessage/index.ts +3 -0
  134. package/src/shared/modals/InteractiveData/index.ts +28 -0
  135. package/src/shared/modals/index.ts +19 -0
  136. package/src/shared/resources/CometChatLocalize/resources/ar/translation.json +4 -1
  137. package/src/shared/resources/CometChatLocalize/resources/de/translation.json +4 -1
  138. package/src/shared/resources/CometChatLocalize/resources/en/translation.json +4 -1
  139. package/src/shared/resources/CometChatLocalize/resources/es/translation.json +4 -1
  140. package/src/shared/resources/CometChatLocalize/resources/fr/translation.json +4 -1
  141. package/src/shared/resources/CometChatLocalize/resources/hi/translation.json +4 -1
  142. package/src/shared/resources/CometChatLocalize/resources/lt/translation.json +4 -1
  143. package/src/shared/resources/CometChatLocalize/resources/ms/translation.json +4 -1
  144. package/src/shared/resources/CometChatLocalize/resources/pt/translation.json +4 -1
  145. package/src/shared/resources/CometChatLocalize/resources/ru/translation.json +4 -1
  146. package/src/shared/resources/CometChatLocalize/resources/sv/translation.json +4 -1
  147. package/src/shared/resources/CometChatLocalize/resources/zh/translation.json +4 -1
  148. package/src/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +4 -1
  149. package/src/shared/resources/CometChatSoundManager/CometChatSoundManager.js +2 -2
  150. package/src/shared/resources/CometChatSoundManager/sound.js +35 -35
  151. package/src/shared/utils/InteractiveMessageUtils.ts +20 -0
  152. package/src/shared/utils/NetworkUtils.tsx +20 -0
  153. package/src/shared/utils/conversationUtils.ts +9 -6
  154. package/src/shared/views/CometChatButton/CometChatButton.tsx +32 -22
  155. package/src/shared/views/CometChatCardBubble/CardBubbleStyle.tsx +47 -0
  156. package/src/shared/views/CometChatCardBubble/CometChatCardBubble.tsx +173 -0
  157. package/src/shared/views/CometChatCardBubble/index.tsx +1 -0
  158. package/src/shared/views/CometChatCheckBox/CheckBoxStyle.tsx +43 -0
  159. package/src/shared/views/CometChatCheckBox/CometChatCheckBox.tsx +79 -0
  160. package/src/shared/views/CometChatDate/CometChatDate.tsx +2 -3
  161. package/src/shared/views/CometChatDropDown/CometChatDropDown.tsx +126 -0
  162. package/src/shared/views/CometChatDropDown/DropDownStyle.tsx +39 -0
  163. package/src/shared/views/CometChatDropDown/resources/downArrowIcon.png +0 -0
  164. package/src/shared/views/CometChatDropDown/resources/index.js +5 -0
  165. package/src/shared/views/CometChatFormBubble/CometChatFormBubble.tsx +464 -0
  166. package/src/shared/views/CometChatFormBubble/FormBubbleStyle.tsx +91 -0
  167. package/src/shared/views/CometChatFormBubble/index.tsx +1 -0
  168. package/src/shared/views/CometChatImageBubble/CometChatImageBubble.tsx +13 -5
  169. package/src/shared/views/CometChatImageBubble/ImageBubbleStyle.ts +14 -3
  170. package/src/shared/views/CometChatLabel/CometChatLabel.tsx +27 -0
  171. package/src/shared/views/CometChatLabel/LabelStyle.ts +19 -0
  172. package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +5 -4
  173. package/src/shared/views/CometChatQuickView/CometChatQuickView.tsx +66 -0
  174. package/src/shared/views/CometChatQuickView/QuickViewStyle.ts +55 -0
  175. package/src/shared/views/CometChatRadioButton/CometChatRadioButton.tsx +67 -0
  176. package/src/shared/views/CometChatRadioButton/RadioButtonStyle.tsx +38 -0
  177. package/src/shared/views/CometChatSingleSelect/CometChatSingleSelect.tsx +63 -0
  178. package/src/shared/views/CometChatSingleSelect/SingleStyle.tsx +35 -0
  179. package/src/shared/views/CometChatTextInput/CometChatTextInput.tsx +67 -0
  180. package/src/shared/views/CometChatTextInput/TextInputStyle.tsx +26 -0
  181. package/src/shared/views/index.ts +7 -1
  182. package/lib/AI/AIConversationStarter/AIConversationStarter.d.ts +0 -12
  183. package/lib/AI/AIConversationStarter/AIConversationStarter.js +0 -31
  184. package/lib/AI/AIConversationStarter/AIConversationStarter.js.map +0 -1
  185. package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.d.ts +0 -25
  186. package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.js +0 -175
  187. package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.js.map +0 -1
  188. package/lib/AI/AIConversationStarter/AIConversationStarterStyle.d.ts +0 -4
  189. package/lib/AI/AIConversationStarter/AIConversationStarterStyle.js +0 -8
  190. package/lib/AI/AIConversationStarter/AIConversationStarterStyle.js.map +0 -1
  191. package/lib/AI/AIConversationStarter/configuration.d.ts +0 -14
  192. package/lib/AI/AIConversationStarter/configuration.js +0 -16
  193. package/lib/AI/AIConversationStarter/configuration.js.map +0 -1
  194. package/lib/AI/AIConversationStarter/style.d.ts +0 -31
  195. package/lib/AI/AIConversationStarter/style.js +0 -62
  196. package/lib/AI/AIConversationStarter/style.js.map +0 -1
  197. package/lib/AI/AIEnabler.d.ts +0 -10
  198. package/lib/AI/AIEnabler.js +0 -102
  199. package/lib/AI/AIEnabler.js.map +0 -1
  200. package/lib/AI/AIEnablerDecorator.d.ts +0 -43
  201. package/lib/AI/AIEnablerDecorator.js +0 -251
  202. package/lib/AI/AIEnablerDecorator.js.map +0 -1
  203. package/lib/AI/AIExtensionDataSource.d.ts +0 -6
  204. package/lib/AI/AIExtensionDataSource.js +0 -10
  205. package/lib/AI/AIExtensionDataSource.js.map +0 -1
  206. package/lib/AI/AISmartReplies/AISmartReplies.d.ts +0 -10
  207. package/lib/AI/AISmartReplies/AISmartReplies.js +0 -23
  208. package/lib/AI/AISmartReplies/AISmartReplies.js.map +0 -1
  209. package/lib/AI/AISmartReplies/AISmartRepliesDecorator.d.ts +0 -7
  210. package/lib/AI/AISmartReplies/AISmartRepliesDecorator.js +0 -12
  211. package/lib/AI/AISmartReplies/AISmartRepliesDecorator.js.map +0 -1
  212. package/lib/AI/AISmartReplies/AISmartRepliesStyle.d.ts +0 -12
  213. package/lib/AI/AISmartReplies/AISmartRepliesStyle.js +0 -15
  214. package/lib/AI/AISmartReplies/AISmartRepliesStyle.js.map +0 -1
  215. package/lib/AI/AISmartReplies/configuration.d.ts +0 -14
  216. package/lib/AI/AISmartReplies/configuration.js +0 -16
  217. package/lib/AI/AISmartReplies/configuration.js.map +0 -1
  218. package/lib/AI/CardView.d.ts +0 -19
  219. package/lib/AI/CardView.js +0 -45
  220. package/lib/AI/CardView.js.map +0 -1
  221. package/lib/AI/CardViewStyle.d.ts +0 -29
  222. package/lib/AI/CardViewStyle.js +0 -36
  223. package/lib/AI/CardViewStyle.js.map +0 -1
  224. package/lib/AI/configuration.d.ts +0 -14
  225. package/lib/AI/configuration.js +0 -16
  226. package/lib/AI/configuration.js.map +0 -1
  227. package/lib/AI/resources/index.d.ts +0 -5
  228. package/lib/AI/resources/index.js +0 -6
  229. package/lib/AI/resources/index.js.map +0 -1
  230. package/lib/AI/style.d.ts +0 -115
  231. package/lib/AI/style.js +0 -139
  232. package/lib/AI/style.js.map +0 -1
  233. package/lib/AI/utils.d.ts +0 -38
  234. package/lib/AI/utils.js +0 -28
  235. package/lib/AI/utils.js.map +0 -1
@@ -270,5 +270,8 @@
270
270
  "READ": "اقرأ",
271
271
  "No_RECIPIENT": "لا يوجد مستلم",
272
272
  "RECEIPT_INFORMATION": "معلومات الاستلام",
273
- "MESSAGE": "رسالة"
273
+ "MESSAGE": "رسالة",
274
+ "FORM_COMPLETION_MESSAGE": "شكرًا لك على ملء النموذج.",
275
+ "FORM":"نموذج",
276
+ "CARD":"بطاقة"
274
277
  }
@@ -270,5 +270,8 @@
270
270
  "READ": "Lesen",
271
271
  "No_RECIPIENT": "Kein Empfänger",
272
272
  "RECEIPT_INFORMATION": "Informationen zum Zahlungseingang",
273
- "MESSAGE": "Nachricht"
273
+ "MESSAGE": "Nachricht",
274
+ "FORM_COMPLETION_MESSAGE": "Vielen Dank für das Ausfüllen des Formulars.",
275
+ "FORM":"Formular",
276
+ "CARD":"Karte"
274
277
  }
@@ -270,5 +270,8 @@
270
270
  "READ": "Read",
271
271
  "No_RECIPIENT": "No Recipient",
272
272
  "RECEIPT_INFORMATION": "Receipt Information",
273
- "MESSAGE": "Message"
273
+ "MESSAGE": "Message",
274
+ "FORM_COMPLETION_MESSAGE": "Thank you for filling out the form.",
275
+ "FORM":"Form",
276
+ "CARD":"Card"
274
277
  }
@@ -270,5 +270,8 @@
270
270
  "READ": "Leer",
271
271
  "No_RECIPIENT": "Sin destinatario",
272
272
  "RECEIPT_INFORMATION": "Información del recibo",
273
- "MESSAGE": "Mensaje"
273
+ "MESSAGE": "Mensaje",
274
+ "FORM_COMPLETION_MESSAGE": "Gracias por rellenar el formulario.",
275
+ "FORM":"Formulario",
276
+ "CARD":"Tarjeta"
274
277
  }
@@ -270,5 +270,8 @@
270
270
  "READ": "Lisez",
271
271
  "No_RECIPIENT": "Aucun destinataire",
272
272
  "RECEIPT_INFORMATION": "Informations sur le reçu",
273
- "MESSAGE": "Un message"
273
+ "MESSAGE": "Un message",
274
+ "FORM_COMPLETION_MESSAGE": "Merci d'avoir rempli le formulaire.",
275
+ "FORM":"Formulaire",
276
+ "CARD":"Carte"
274
277
  }
@@ -270,5 +270,8 @@
270
270
  "READ": "पढ़ें",
271
271
  "No_RECIPIENT": "कोई प्राप्तकर्ता नहीं",
272
272
  "RECEIPT_INFORMATION": "रसीद की जानकारी",
273
- "MESSAGE": "सन्देश"
273
+ "MESSAGE": "सन्देश",
274
+ "FORM_COMPLETION_MESSAGE": "फॉर्म भरने के लिए धन्यवाद।",
275
+ "FORM":"प्रपत्र",
276
+ "CARD":"कार्ड"
274
277
  }
@@ -270,5 +270,8 @@
270
270
  "READ": "Leggi",
271
271
  "No_RECIPIENT": "Nessun destinatario",
272
272
  "RECEIPT_INFORMATION": "Informazioni sulla ricevuta",
273
- "MESSAGE": "Messaggio"
273
+ "MESSAGE": "Messaggio",
274
+ "FORM_COMPLETION_MESSAGE": "Grazie per aver compilato il modulo.",
275
+ "FORM":"Modulo",
276
+ "CARD":"Carta"
274
277
  }
@@ -270,5 +270,8 @@
270
270
  "READ": "Baca",
271
271
  "No_RECIPIENT": "Tiada Penerima",
272
272
  "RECEIPT_INFORMATION": "Maklumat Resit",
273
- "MESSAGE": "Pesanan"
273
+ "MESSAGE": "Pesanan",
274
+ "FORM_COMPLETION_MESSAGE": "Terima kasih kerana mengisi borang.",
275
+ "FORM":"Borang",
276
+ "CARD":"Kad"
274
277
  }
@@ -270,5 +270,8 @@
270
270
  "READ": "Leia",
271
271
  "No_RECIPIENT": "Nenhum destinatário",
272
272
  "RECEIPT_INFORMATION": "Informações sobre o recibo",
273
- "MESSAGE": "Mensagem"
273
+ "MESSAGE": "Mensagem",
274
+ "FORM_COMPLETION_MESSAGE": "Obrigado por preencher o formulário.",
275
+ "FORM":"Formulário",
276
+ "CARD":"Cartão"
274
277
  }
@@ -270,5 +270,8 @@
270
270
  "READ": "Прочитайте",
271
271
  "No_RECIPIENT": "Нет получателя",
272
272
  "RECEIPT_INFORMATION": "Информация о чеке",
273
- "MESSAGE": "Послание"
273
+ "MESSAGE": "Послание",
274
+ "FORM_COMPLETION_MESSAGE": "Спасибо за заполнение формы.",
275
+ "FORM":"Форма",
276
+ "CARD":"Карточка"
274
277
  }
@@ -270,5 +270,8 @@
270
270
  "READ": "Läs",
271
271
  "No_RECIPIENT": "Ingen mottagare",
272
272
  "RECEIPT_INFORMATION": "Information om kvitto",
273
- "MESSAGE": "Meddelande"
273
+ "MESSAGE": "Meddelande",
274
+ "FORM_COMPLETION_MESSAGE": "Tack för att du fyller i formuläret.",
275
+ "FORM":"Formulär",
276
+ "CARD":"Kort"
274
277
  }
@@ -270,5 +270,8 @@
270
270
  "READ": "阅读",
271
271
  "No_RECIPIENT": "没有收件人",
272
272
  "RECEIPT_INFORMATION": "收据信息",
273
- "MESSAGE": "消息"
273
+ "MESSAGE": "消息",
274
+ "FORM_COMPLETION_MESSAGE": "感谢您填写表格。",
275
+ "FORM":"表格",
276
+ "CARD":"卡片"
274
277
  }
@@ -270,5 +270,8 @@
270
270
  "READ": "閱讀",
271
271
  "No_RECIPIENT": "沒有收件人",
272
272
  "RECEIPT_INFORMATION": "收據資料",
273
- "MESSAGE": "留言"
273
+ "MESSAGE": "留言",
274
+ "FORM_COMPLETION_MESSAGE": "感謝您填寫表格。",
275
+ "FORM":"表格",
276
+ "CARD":"卡"
274
277
  }
@@ -1,5 +1,5 @@
1
1
  import { Vibration, NativeModules } from 'react-native';
2
- const { RNSound } = NativeModules;
2
+ const { CometChatSoundModule } = NativeModules;
3
3
  import * as consts from '../../constants/UIKitConstants';
4
4
  import Sound from './sound';
5
5
  import {
@@ -22,7 +22,7 @@ export class CometChatSoundManager {
22
22
  static onPlay = async (resource, loop, isRequire) => {
23
23
  try {
24
24
  let otherAudioPlaying =
25
- await RNSound.checkOtherAudioPlaying();
25
+ await CometChatSoundModule.checkOtherAudioPlaying();
26
26
  if (otherAudioPlaying) {
27
27
  Vibration.vibrate(consts.PATTERN, loop);
28
28
  } else {
@@ -1,9 +1,9 @@
1
1
  import { NativeModules, NativeEventEmitter } from 'react-native';
2
- const {RNSound} = NativeModules ;
3
- var IsAndroid = RNSound.IsAndroid;
4
- var IsWindows = RNSound.IsWindows;
2
+ const {CometChatSoundModule} = NativeModules ;
3
+ var IsAndroid = CometChatSoundModule.IsAndroid;
4
+ var IsWindows = CometChatSoundModule.IsWindows;
5
5
  import resolveAssetSource from "react-native/Libraries/Image/resolveAssetSource";
6
- var eventEmitter = new NativeEventEmitter(RNSound);
6
+ var eventEmitter = new NativeEventEmitter(CometChatSoundModule);
7
7
 
8
8
  var nextKey = 0;
9
9
 
@@ -23,14 +23,14 @@ function setAndroidVolumes(sound) {
23
23
  const relativeVolume = calculateRelativeVolume(sound._volume, sound._pan);
24
24
  if (sound._pan < 0) {
25
25
  // left is louder
26
- RNSound.setVolume(sound._key, sound._volume, relativeVolume);
26
+ CometChatSoundModule.setVolume(sound._key, sound._volume, relativeVolume);
27
27
  } else {
28
28
  // right is louder
29
- RNSound.setVolume(sound._key, relativeVolume, sound._volume);
29
+ CometChatSoundModule.setVolume(sound._key, relativeVolume, sound._volume);
30
30
  }
31
31
  } else {
32
32
  // no panning, same volume on both channels
33
- RNSound.setVolume(sound._key, sound._volume, sound._volume);
33
+ CometChatSoundModule.setVolume(sound._key, sound._volume, sound._volume);
34
34
  }
35
35
  }
36
36
 
@@ -60,7 +60,7 @@ class Sound {
60
60
  this._numberOfLoops = 0;
61
61
  this._speed = 1;
62
62
  this._pitch = 1;
63
- RNSound.prepare(this._filename, this._key, options || {}, (error, props) => {
63
+ CometChatSoundModule.prepare(this._filename, this._key, options || {}, (error, props) => {
64
64
  if (props) {
65
65
  if (typeof props.duration === 'number') {
66
66
  this._duration = props.duration;
@@ -101,31 +101,31 @@ class Sound {
101
101
  }
102
102
  };
103
103
  static enable(enabled) {
104
- RNSound.enable(enabled);
104
+ CometChatSoundModule.enable(enabled);
105
105
  }
106
106
  static enableInSilenceMode(enabled) {
107
107
  if (!IsAndroid && !IsWindows) {
108
- RNSound.enableInSilenceMode(enabled);
108
+ CometChatSoundModule.enableInSilenceMode(enabled);
109
109
  }
110
110
  }
111
111
  static setActive(value) {
112
112
  if (!IsAndroid && !IsWindows) {
113
- RNSound.setActive(value);
113
+ CometChatSoundModule.setActive(value);
114
114
  }
115
115
  }
116
116
  static setCategory(value, mixWithOthers = false) {
117
117
  if (!IsWindows) {
118
- RNSound.setCategory(value, mixWithOthers);
118
+ CometChatSoundModule.setCategory(value, mixWithOthers);
119
119
  }
120
120
  }
121
121
  static setMode(value) {
122
122
  if (!IsAndroid && !IsWindows) {
123
- RNSound.setMode(value);
123
+ CometChatSoundModule.setMode(value);
124
124
  }
125
125
  }
126
126
  static setSpeakerPhone(value) {
127
127
  if (!IsAndroid && !IsWindows) {
128
- RNSound.setSpeakerPhone(value);
128
+ CometChatSoundModule.setSpeakerPhone(value);
129
129
  }
130
130
  }
131
131
  isLoaded() {
@@ -133,7 +133,7 @@ class Sound {
133
133
  }
134
134
  play(onEnd) {
135
135
  if (this._loaded) {
136
- RNSound.play(this._key, (successfully) => onEnd && onEnd(successfully));
136
+ CometChatSoundModule.play(this._key, (successfully) => onEnd && onEnd(successfully));
137
137
  } else {
138
138
  onEnd && onEnd(false);
139
139
  }
@@ -141,7 +141,7 @@ class Sound {
141
141
  }
142
142
  pause(callback) {
143
143
  if (this._loaded) {
144
- RNSound.pause(this._key, () => {
144
+ CometChatSoundModule.pause(this._key, () => {
145
145
  this._playing = false;
146
146
  callback && callback();
147
147
  });
@@ -150,7 +150,7 @@ class Sound {
150
150
  }
151
151
  stop(callback) {
152
152
  if (this._loaded) {
153
- RNSound.stop(this._key, () => {
153
+ CometChatSoundModule.stop(this._key, () => {
154
154
  this._playing = false;
155
155
  callback && callback();
156
156
  });
@@ -159,14 +159,14 @@ class Sound {
159
159
  }
160
160
  reset() {
161
161
  if (this._loaded && IsAndroid) {
162
- RNSound.reset(this._key);
162
+ CometChatSoundModule.reset(this._key);
163
163
  this._playing = false;
164
164
  }
165
165
  return this;
166
166
  }
167
167
  release() {
168
168
  if (this._loaded) {
169
- RNSound.release(this._key);
169
+ CometChatSoundModule.release(this._key);
170
170
  this._loaded = false;
171
171
  if (!IsWindows) {
172
172
  if (this.onPlaySubscription != null) {
@@ -201,7 +201,7 @@ class Sound {
201
201
  if (IsAndroid) {
202
202
  setAndroidVolumes(this);
203
203
  } else {
204
- RNSound.setVolume(this._key, value);
204
+ CometChatSoundModule.setVolume(this._key, value);
205
205
  }
206
206
  }
207
207
  return this;
@@ -214,20 +214,20 @@ class Sound {
214
214
  } else if (IsAndroid) {
215
215
  setAndroidVolumes(this);
216
216
  } else {
217
- RNSound.setPan(this._key, value);
217
+ CometChatSoundModule.setPan(this._key, value);
218
218
  }
219
219
  }
220
220
  return this;
221
221
  }
222
222
  getSystemVolume(callback) {
223
223
  if (!IsWindows) {
224
- RNSound.getSystemVolume(callback);
224
+ CometChatSoundModule.getSystemVolume(callback);
225
225
  }
226
226
  return this;
227
227
  }
228
228
  setSystemVolume(value) {
229
229
  if (IsAndroid) {
230
- RNSound.setSystemVolume(value);
230
+ CometChatSoundModule.setSystemVolume(value);
231
231
  }
232
232
  return this;
233
233
  }
@@ -241,9 +241,9 @@ class Sound {
241
241
  this._numberOfLoops = value;
242
242
  if (this._loaded) {
243
243
  if (IsAndroid || IsWindows) {
244
- RNSound.setLooping(this._key, !!value);
244
+ CometChatSoundModule.setLooping(this._key, !!value);
245
245
  } else {
246
- RNSound.setNumberOfLoops(this._key, value);
246
+ CometChatSoundModule.setNumberOfLoops(this._key, value);
247
247
  }
248
248
  }
249
249
  return this;
@@ -252,7 +252,7 @@ class Sound {
252
252
  this._speed = value;
253
253
  if (this._loaded) {
254
254
  if (!IsWindows) {
255
- RNSound.setSpeed(this._key, value);
255
+ CometChatSoundModule.setSpeed(this._key, value);
256
256
  }
257
257
  }
258
258
  return this;
@@ -261,26 +261,26 @@ class Sound {
261
261
  this._pitch = value;
262
262
  if (this._loaded) {
263
263
  if (IsAndroid) {
264
- RNSound.setPitch(this._key, value);
264
+ CometChatSoundModule.setPitch(this._key, value);
265
265
  }
266
266
  }
267
267
  return this;
268
268
  }
269
269
  getCurrentTime(callback) {
270
270
  if (this._loaded) {
271
- RNSound.getCurrentTime(this._key, callback);
271
+ CometChatSoundModule.getCurrentTime(this._key, callback);
272
272
  }
273
273
  }
274
274
  setCurrentTime(value) {
275
275
  if (this._loaded) {
276
- RNSound.setCurrentTime(this._key, value);
276
+ CometChatSoundModule.setCurrentTime(this._key, value);
277
277
  }
278
278
  return this;
279
279
  }
280
280
  // android only
281
281
  setSpeakerphoneOn(value) {
282
282
  if (IsAndroid) {
283
- RNSound.setSpeakerphoneOn(this._key, value);
283
+ CometChatSoundModule.setSpeakerphoneOn(this._key, value);
284
284
  }
285
285
  }
286
286
  isPlaying() {
@@ -288,7 +288,7 @@ class Sound {
288
288
  }
289
289
  async checkOtherAudioPlaying() {
290
290
  try{
291
- return await RNSound.checkOtherAudioPlaying();
291
+ return await CometChatSoundModule.checkOtherAudioPlaying();
292
292
  }
293
293
  catch(error){
294
294
  return false;
@@ -328,9 +328,9 @@ Sound.prototype.setCategory = function(value) {
328
328
  Sound.setCategory(value, false);
329
329
  }
330
330
 
331
- Sound.MAIN_BUNDLE = RNSound.MainBundlePath;
332
- Sound.DOCUMENT = RNSound.NSDocumentDirectory;
333
- Sound.LIBRARY = RNSound.NSLibraryDirectory;
334
- Sound.CACHES = RNSound.NSCachesDirectory;
331
+ Sound.MAIN_BUNDLE = CometChatSoundModule.MainBundlePath;
332
+ Sound.DOCUMENT = CometChatSoundModule.NSDocumentDirectory;
333
+ Sound.LIBRARY = CometChatSoundModule.NSLibraryDirectory;
334
+ Sound.CACHES = CometChatSoundModule.NSCachesDirectory;
335
335
 
336
336
  export default Sound;
@@ -0,0 +1,20 @@
1
+ import { MessageTypeConstants } from "../constants/UIKitConstants";
2
+ import { CardMessage, CustomInteractiveMessage, FormMessage } from "../modals/InteractiveData";
3
+
4
+ export class InteractiveMessageUtils {
5
+
6
+ static convertInteractiveMessage(item: any): any {
7
+ if (item.getDeletedBy() != null) {
8
+ return item;
9
+ }
10
+ switch (item.getType()) {
11
+ case MessageTypeConstants.form:
12
+ return FormMessage.fromJSON(item);
13
+ case MessageTypeConstants.card:
14
+ return CardMessage.fromJSON(item);
15
+ default:
16
+ return CustomInteractiveMessage.fromJSON(item);
17
+ }
18
+ }
19
+
20
+ }
@@ -0,0 +1,20 @@
1
+ export class CometChatNetworkUtils {
2
+
3
+ static async fetcher({ url, method, body, headers }: { url: string, method: string, body: any, headers: any }) {
4
+ try {
5
+ const res = await fetch(url, {
6
+ method: method,
7
+ body: JSON.stringify(body),
8
+ headers: {
9
+ "Content-Type": "application/json",
10
+ ...headers,
11
+ },
12
+ });
13
+ const json = await res.json();
14
+ return res;
15
+ } catch (error) {
16
+ throw error;
17
+ }
18
+ }
19
+
20
+ }
@@ -14,7 +14,7 @@ export class CometChatConversationUtils {
14
14
  return options;
15
15
  }
16
16
 
17
- static getLastMessage(conversation : CometChat.Conversation): CometChat.BaseMessage {
17
+ static getLastMessage(conversation: CometChat.Conversation): CometChat.BaseMessage {
18
18
  let msg = conversation.getLastMessage();
19
19
  if (!msg) {
20
20
  return undefined;
@@ -36,12 +36,12 @@ export class CometChatConversationUtils {
36
36
 
37
37
 
38
38
 
39
- static getMessagePreview = ( lastMessage: CometChat.BaseMessage):string => {
39
+ static getMessagePreview = (lastMessage: CometChat.BaseMessage): string => {
40
40
 
41
- if (lastMessage!=undefined) {
41
+ if (lastMessage != undefined) {
42
42
 
43
43
  if (lastMessage.getDeletedAt() !== undefined) {
44
- return localize("THIS_MESSAGE_DELETED");
44
+ return localize("THIS_MESSAGE_DELETED");
45
45
  }
46
46
 
47
47
  let groupText = "", msgText = "";
@@ -66,8 +66,11 @@ export class CometChatConversationUtils {
66
66
  } else if (lastMessage.getCategory() == CometChat.CATEGORY_CUSTOM as CometChat.MessageCategory) {
67
67
  msgText = lastMessage.getType();
68
68
  } else if (lastMessage.getCategory() == CometChat.CATEGORY_ACTION as CometChat.MessageCategory) {
69
- msgText =(lastMessage as CometChat.Action).getMessage();
70
- } else {
69
+ msgText = (lastMessage as CometChat.Action).getMessage();
70
+ } else if (lastMessage.getCategory() === CometChat.CATEGORY_INTERACTIVE) {
71
+ msgText = lastMessage.getType() === "form" ? `${localize('FORM')} 📋` : `${localize('CARD')} 🪧`;
72
+ }
73
+ else {
71
74
  msgText = lastMessage['metaData']?.pushNotification;
72
75
  }
73
76
  return (msgText)
@@ -1,5 +1,5 @@
1
1
  import React, { useContext } from 'react';
2
- import { View, TouchableOpacity, Text, Image } from "react-native";
2
+ import { View, TouchableOpacity, Text, Image, ActivityIndicator } from "react-native";
3
3
  import { ImageType } from '../../base';
4
4
  import { ButtonStyle, ButtonStyleInterface } from './CometChatButtonStyle';
5
5
  import { CometChatContext } from '../../CometChatContext';
@@ -10,7 +10,7 @@ export interface CometChatButtonInterface {
10
10
  iconUrl?: ImageType,
11
11
  style?: ButtonStyleInterface,
12
12
  onPress?: () => void,
13
-
13
+ isLoading?: boolean,
14
14
  }
15
15
 
16
16
  export const CometChatButton = (props: CometChatButtonInterface) => {
@@ -18,7 +18,8 @@ export const CometChatButton = (props: CometChatButtonInterface) => {
18
18
  iconUrl,
19
19
  onPress,
20
20
  style,
21
- text
21
+ text,
22
+ isLoading
22
23
  } = props;
23
24
 
24
25
  const { theme } = useContext(CometChatContext);
@@ -41,25 +42,34 @@ export const CometChatButton = (props: CometChatButtonInterface) => {
41
42
  });
42
43
 
43
44
  return (
44
- <TouchableOpacity onPress={onPress} style={{alignItems: "center", backgroundColor, borderRadius}}>
45
- <View style={[Style.container, { backgroundColor: iconBackgroundColor, borderRadius: iconCornerRadius, ...border }]}>
46
- <Image
47
- source={iconUrl}
48
- resizeMode="contain"
49
- style={{
50
- height,
51
- width,
52
- backgroundColor: iconBackgroundColor,
53
- borderRadius: iconCornerRadius,
54
- tintColor: iconTint,
55
- ...iconBorder,
56
- }} />
57
- </View>
58
- {
59
- text && <Text style={{
60
- color: textColor,
61
- ...textFont
62
- }}>{text}</Text>
45
+ <TouchableOpacity onPress={onPress} style={[{ alignItems: "center", backgroundColor, borderRadius }, !iconUrl && {
46
+ height, width, justifyContent: "center",
47
+ }]}>
48
+ {!isLoading ? <>
49
+ {Boolean(iconUrl) && <View style={[Style.container, { backgroundColor: iconBackgroundColor, borderRadius: iconCornerRadius, ...border }]}>
50
+ <Image
51
+ source={iconUrl}
52
+ resizeMode="contain"
53
+ style={{
54
+ height,
55
+ width,
56
+ backgroundColor: iconBackgroundColor,
57
+ borderRadius: iconCornerRadius,
58
+ tintColor: iconTint,
59
+ ...iconBorder,
60
+ }} />
61
+ </View>}
62
+ {
63
+ Boolean(text) && <Text style={{
64
+ color: textColor,
65
+ ...textFont
66
+ }}>{text}</Text>
67
+ }
68
+ </>
69
+ :
70
+ <View style={{ position: "absolute", alignSelf: "center" }}>
71
+ <ActivityIndicator size="small" color={textColor} />
72
+ </View>
63
73
  }
64
74
  </TouchableOpacity>
65
75
  )
@@ -0,0 +1,47 @@
1
+ import { BaseStyle, FontStyle } from "../../base";
2
+ import { ButtonStyleInterface } from "../CometChatButton";
3
+ import { ImageBubbleStyleInterface } from "../CometChatImageBubble";
4
+
5
+ export interface CardBubbleStyleInterface extends BaseStyle {
6
+ textFont?: FontStyle;
7
+ textColor?: string;
8
+ padding?: number;
9
+ buttonStyle?: ButtonStyleInterface;
10
+ imageStyle?: ImageBubbleStyleInterface;
11
+ imageResizeMode?: "cover" | "contain" | "stretch" | "repeat" | "center";
12
+ }
13
+
14
+ export class CardBubbleStyle extends BaseStyle {
15
+ textFont?: FontStyle;
16
+ textColor?: string;
17
+ padding?: number;
18
+ buttonStyle?: ButtonStyleInterface;
19
+ imageStyle?: ImageBubbleStyleInterface;
20
+ imageResizeMode?: "cover" | "contain" | "stretch" | "repeat" | "center";
21
+
22
+ constructor({
23
+ height = "auto",
24
+ width = "auto",
25
+ backgroundColor,
26
+ borderRadius,
27
+ textFont,
28
+ textColor,
29
+ padding,
30
+ buttonStyle,
31
+ imageStyle,
32
+ imageResizeMode = "cover",
33
+ }: CardBubbleStyleInterface) {
34
+ super({
35
+ backgroundColor,
36
+ borderRadius,
37
+ height,
38
+ width
39
+ });
40
+ this.textFont = textFont;
41
+ this.textColor = textColor;
42
+ this.padding = padding;
43
+ this.buttonStyle = buttonStyle;
44
+ this.imageStyle = imageStyle;
45
+ this.imageResizeMode = imageResizeMode;
46
+ }
47
+ }