@ethora/chat-component-rn 26.5.21 → 26.6.11

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 (372) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +3 -3
  3. package/index.js +1 -1
  4. package/lib/commonjs/components/MainComponents/ChatHeader.js +20 -8
  5. package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
  6. package/lib/commonjs/components/MainComponents/ChatWrapper.js +17 -0
  7. package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
  8. package/lib/commonjs/components/MainComponents/LanguageSelectorButton.js +62 -0
  9. package/lib/commonjs/components/MainComponents/LanguageSelectorButton.js.map +1 -0
  10. package/lib/commonjs/components/MainComponents/LanguageSelectorModal.js +253 -0
  11. package/lib/commonjs/components/MainComponents/LanguageSelectorModal.js.map +1 -0
  12. package/lib/commonjs/components/MainComponents/MediaMessage.js +7 -1
  13. package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
  14. package/lib/commonjs/components/MainComponents/RoomList.js +23 -9
  15. package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
  16. package/lib/commonjs/components/MessageBubble/Message.js +72 -11
  17. package/lib/commonjs/components/MessageBubble/Message.js.map +1 -1
  18. package/lib/commonjs/components/MessageBubble/MessageTranslate.js +160 -0
  19. package/lib/commonjs/components/MessageBubble/MessageTranslate.js.map +1 -0
  20. package/lib/commonjs/components/MessageBubble/TranslatedMessageBody.js +59 -0
  21. package/lib/commonjs/components/MessageBubble/TranslatedMessageBody.js.map +1 -0
  22. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +3 -3
  23. package/lib/commonjs/components/UsersList/UsersList.js +3 -1
  24. package/lib/commonjs/components/UsersList/UsersList.js.map +1 -1
  25. package/lib/commonjs/components/VideoCalls/CallButtons.js +159 -0
  26. package/lib/commonjs/components/VideoCalls/CallButtons.js.map +1 -0
  27. package/lib/commonjs/components/VideoCalls/CallIcons.js +328 -0
  28. package/lib/commonjs/components/VideoCalls/CallIcons.js.map +1 -0
  29. package/lib/commonjs/components/VideoCalls/VideoCallOverlay.js +550 -0
  30. package/lib/commonjs/components/VideoCalls/VideoCallOverlay.js.map +1 -0
  31. package/lib/commonjs/components/VideoCalls/VideoCallSession.js +636 -0
  32. package/lib/commonjs/components/VideoCalls/VideoCallSession.js.map +1 -0
  33. package/lib/commonjs/components/VideoCalls/livekitRuntime.js +91 -0
  34. package/lib/commonjs/components/VideoCalls/livekitRuntime.js.map +1 -0
  35. package/lib/commonjs/components/VideoCalls/useCallKeep.js +215 -0
  36. package/lib/commonjs/components/VideoCalls/useCallKeep.js.map +1 -0
  37. package/lib/commonjs/components/styled/AudioMessage.js +91 -33
  38. package/lib/commonjs/components/styled/AudioMessage.js.map +1 -1
  39. package/lib/commonjs/components/styled/RoomListComponents/index.js +13 -1
  40. package/lib/commonjs/components/styled/RoomListComponents/index.js.map +1 -1
  41. package/lib/commonjs/components/styled/SendInput.js +83 -49
  42. package/lib/commonjs/components/styled/SendInput.js.map +1 -1
  43. package/lib/commonjs/components/styled/StyledComponents.js +9 -4
  44. package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
  45. package/lib/commonjs/components/styled/StyledInputComponents/Composing.js +2 -0
  46. package/lib/commonjs/components/styled/StyledInputComponents/Composing.js.map +1 -1
  47. package/lib/commonjs/components/styled/VideoMessage.js +110 -26
  48. package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
  49. package/lib/commonjs/context/xmppProvider.js +10 -3
  50. package/lib/commonjs/context/xmppProvider.js.map +1 -1
  51. package/lib/commonjs/helpers/callLogMessage.js +162 -0
  52. package/lib/commonjs/helpers/callLogMessage.js.map +1 -0
  53. package/lib/commonjs/helpers/callPush.js +61 -0
  54. package/lib/commonjs/helpers/callPush.js.map +1 -0
  55. package/lib/commonjs/helpers/constants/LANGUAGE_OPTIONS.js +24 -12
  56. package/lib/commonjs/helpers/constants/LANGUAGE_OPTIONS.js.map +1 -1
  57. package/lib/commonjs/helpers/createUserNameFromSetUser.js +51 -2
  58. package/lib/commonjs/helpers/createUserNameFromSetUser.js.map +1 -1
  59. package/lib/commonjs/helpers/getDataFromXml.js +19 -1
  60. package/lib/commonjs/helpers/getDataFromXml.js.map +1 -1
  61. package/lib/commonjs/helpers/incomingCallFromPush.js +74 -0
  62. package/lib/commonjs/helpers/incomingCallFromPush.js.map +1 -0
  63. package/lib/commonjs/helpers/insertMessageWithDelimiter.js +13 -1
  64. package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
  65. package/lib/commonjs/helpers/isUnresolvedSenderId.js +32 -0
  66. package/lib/commonjs/helpers/isUnresolvedSenderId.js.map +1 -0
  67. package/lib/commonjs/hooks/useChatSettingState.js +2 -0
  68. package/lib/commonjs/hooks/useChatSettingState.js.map +1 -1
  69. package/lib/commonjs/hooks/useMessageTranslation.js +51 -0
  70. package/lib/commonjs/hooks/useMessageTranslation.js.map +1 -0
  71. package/lib/commonjs/hooks/usePushNotifications.js +13 -3
  72. package/lib/commonjs/hooks/usePushNotifications.js.map +1 -1
  73. package/lib/commonjs/hooks/useSendMessage.js +14 -4
  74. package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
  75. package/lib/commonjs/i18n/strings.js +1308 -0
  76. package/lib/commonjs/i18n/strings.js.map +1 -0
  77. package/lib/commonjs/i18n/useT.js +60 -0
  78. package/lib/commonjs/i18n/useT.js.map +1 -0
  79. package/lib/commonjs/main.js +44 -0
  80. package/lib/commonjs/main.js.map +1 -1
  81. package/lib/commonjs/networking/api-requests/auth.api.js +81 -52
  82. package/lib/commonjs/networking/api-requests/auth.api.js.map +1 -1
  83. package/lib/commonjs/networking/api-requests/push.api.js +34 -5
  84. package/lib/commonjs/networking/api-requests/push.api.js.map +1 -1
  85. package/lib/commonjs/networking/api-requests/rooms.api.js +108 -0
  86. package/lib/commonjs/networking/api-requests/rooms.api.js.map +1 -1
  87. package/lib/commonjs/networking/callTokenStanza.js +531 -0
  88. package/lib/commonjs/networking/callTokenStanza.js.map +1 -0
  89. package/lib/commonjs/networking/outboundQueue.js.map +1 -1
  90. package/lib/commonjs/networking/stanzaHandlers.js +75 -8
  91. package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
  92. package/lib/commonjs/networking/xmpp/handleStanzas.xmpp.js +47 -11
  93. package/lib/commonjs/networking/xmpp/handleStanzas.xmpp.js.map +1 -1
  94. package/lib/commonjs/networking/xmpp/sendTextMessage.xmpp.js +2 -1
  95. package/lib/commonjs/networking/xmpp/sendTextMessage.xmpp.js.map +1 -1
  96. package/lib/commonjs/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.js +42 -5
  97. package/lib/commonjs/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.js.map +1 -1
  98. package/lib/commonjs/networking/xmppClient.js +78 -16
  99. package/lib/commonjs/networking/xmppClient.js.map +1 -1
  100. package/lib/commonjs/roomStore/callSlice.js +144 -0
  101. package/lib/commonjs/roomStore/callSlice.js.map +1 -0
  102. package/lib/commonjs/roomStore/chatSettingsSlice.js +8 -2
  103. package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
  104. package/lib/commonjs/roomStore/index.js +7 -1
  105. package/lib/commonjs/roomStore/index.js.map +1 -1
  106. package/lib/commonjs/roomStore/persistence.js +69 -5
  107. package/lib/commonjs/roomStore/persistence.js.map +1 -1
  108. package/lib/commonjs/roomStore/roomsSlice.js +136 -6
  109. package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
  110. package/lib/commonjs/utils/translateModePolicy.js +33 -0
  111. package/lib/commonjs/utils/translateModePolicy.js.map +1 -0
  112. package/lib/module/components/MainComponents/ChatHeader.js +20 -8
  113. package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
  114. package/lib/module/components/MainComponents/ChatWrapper.js +17 -0
  115. package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
  116. package/lib/module/components/MainComponents/LanguageSelectorButton.js +57 -0
  117. package/lib/module/components/MainComponents/LanguageSelectorButton.js.map +1 -0
  118. package/lib/module/components/MainComponents/LanguageSelectorModal.js +246 -0
  119. package/lib/module/components/MainComponents/LanguageSelectorModal.js.map +1 -0
  120. package/lib/module/components/MainComponents/MediaMessage.js +7 -1
  121. package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
  122. package/lib/module/components/MainComponents/RoomList.js +23 -9
  123. package/lib/module/components/MainComponents/RoomList.js.map +1 -1
  124. package/lib/module/components/MessageBubble/Message.js +73 -12
  125. package/lib/module/components/MessageBubble/Message.js.map +1 -1
  126. package/lib/module/components/MessageBubble/MessageTranslate.js +155 -0
  127. package/lib/module/components/MessageBubble/MessageTranslate.js.map +1 -0
  128. package/lib/module/components/MessageBubble/TranslatedMessageBody.js +53 -0
  129. package/lib/module/components/MessageBubble/TranslatedMessageBody.js.map +1 -0
  130. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +3 -3
  131. package/lib/module/components/UsersList/UsersList.js +3 -1
  132. package/lib/module/components/UsersList/UsersList.js.map +1 -1
  133. package/lib/module/components/VideoCalls/CallButtons.js +154 -0
  134. package/lib/module/components/VideoCalls/CallButtons.js.map +1 -0
  135. package/lib/module/components/VideoCalls/CallIcons.js +309 -0
  136. package/lib/module/components/VideoCalls/CallIcons.js.map +1 -0
  137. package/lib/module/components/VideoCalls/VideoCallOverlay.js +544 -0
  138. package/lib/module/components/VideoCalls/VideoCallOverlay.js.map +1 -0
  139. package/lib/module/components/VideoCalls/VideoCallSession.js +630 -0
  140. package/lib/module/components/VideoCalls/VideoCallSession.js.map +1 -0
  141. package/lib/module/components/VideoCalls/livekitRuntime.js +83 -0
  142. package/lib/module/components/VideoCalls/livekitRuntime.js.map +1 -0
  143. package/lib/module/components/VideoCalls/useCallKeep.js +210 -0
  144. package/lib/module/components/VideoCalls/useCallKeep.js.map +1 -0
  145. package/lib/module/components/styled/AudioMessage.js +91 -33
  146. package/lib/module/components/styled/AudioMessage.js.map +1 -1
  147. package/lib/module/components/styled/RoomListComponents/index.js +13 -1
  148. package/lib/module/components/styled/RoomListComponents/index.js.map +1 -1
  149. package/lib/module/components/styled/SendInput.js +83 -49
  150. package/lib/module/components/styled/SendInput.js.map +1 -1
  151. package/lib/module/components/styled/StyledComponents.js +9 -4
  152. package/lib/module/components/styled/StyledComponents.js.map +1 -1
  153. package/lib/module/components/styled/StyledInputComponents/Composing.js +2 -0
  154. package/lib/module/components/styled/StyledInputComponents/Composing.js.map +1 -1
  155. package/lib/module/components/styled/VideoMessage.js +111 -27
  156. package/lib/module/components/styled/VideoMessage.js.map +1 -1
  157. package/lib/module/context/xmppProvider.js +11 -4
  158. package/lib/module/context/xmppProvider.js.map +1 -1
  159. package/lib/module/helpers/callLogMessage.js +152 -0
  160. package/lib/module/helpers/callLogMessage.js.map +1 -0
  161. package/lib/module/helpers/callPush.js +55 -0
  162. package/lib/module/helpers/callPush.js.map +1 -0
  163. package/lib/module/helpers/constants/LANGUAGE_OPTIONS.js +24 -12
  164. package/lib/module/helpers/constants/LANGUAGE_OPTIONS.js.map +1 -1
  165. package/lib/module/helpers/createUserNameFromSetUser.js +49 -1
  166. package/lib/module/helpers/createUserNameFromSetUser.js.map +1 -1
  167. package/lib/module/helpers/getDataFromXml.js +20 -1
  168. package/lib/module/helpers/getDataFromXml.js.map +1 -1
  169. package/lib/module/helpers/incomingCallFromPush.js +70 -0
  170. package/lib/module/helpers/incomingCallFromPush.js.map +1 -0
  171. package/lib/module/helpers/insertMessageWithDelimiter.js +13 -1
  172. package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
  173. package/lib/module/helpers/isUnresolvedSenderId.js +27 -0
  174. package/lib/module/helpers/isUnresolvedSenderId.js.map +1 -0
  175. package/lib/module/hooks/useChatSettingState.js +2 -0
  176. package/lib/module/hooks/useChatSettingState.js.map +1 -1
  177. package/lib/module/hooks/useMessageTranslation.js +46 -0
  178. package/lib/module/hooks/useMessageTranslation.js.map +1 -0
  179. package/lib/module/hooks/usePushNotifications.js +13 -3
  180. package/lib/module/hooks/usePushNotifications.js.map +1 -1
  181. package/lib/module/hooks/useSendMessage.js +15 -5
  182. package/lib/module/hooks/useSendMessage.js.map +1 -1
  183. package/lib/module/i18n/strings.js +1300 -0
  184. package/lib/module/i18n/strings.js.map +1 -0
  185. package/lib/module/i18n/useT.js +55 -0
  186. package/lib/module/i18n/useT.js.map +1 -0
  187. package/lib/module/main.js +7 -1
  188. package/lib/module/main.js.map +1 -1
  189. package/lib/module/networking/api-requests/auth.api.js +80 -51
  190. package/lib/module/networking/api-requests/auth.api.js.map +1 -1
  191. package/lib/module/networking/api-requests/push.api.js +35 -5
  192. package/lib/module/networking/api-requests/push.api.js.map +1 -1
  193. package/lib/module/networking/api-requests/rooms.api.js +109 -1
  194. package/lib/module/networking/api-requests/rooms.api.js.map +1 -1
  195. package/lib/module/networking/callTokenStanza.js +526 -0
  196. package/lib/module/networking/callTokenStanza.js.map +1 -0
  197. package/lib/module/networking/outboundQueue.js.map +1 -1
  198. package/lib/module/networking/stanzaHandlers.js +76 -9
  199. package/lib/module/networking/stanzaHandlers.js.map +1 -1
  200. package/lib/module/networking/xmpp/handleStanzas.xmpp.js +48 -11
  201. package/lib/module/networking/xmpp/handleStanzas.xmpp.js.map +1 -1
  202. package/lib/module/networking/xmpp/sendTextMessage.xmpp.js +1 -1
  203. package/lib/module/networking/xmpp/sendTextMessage.xmpp.js.map +1 -1
  204. package/lib/module/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.js +43 -5
  205. package/lib/module/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.js.map +1 -1
  206. package/lib/module/networking/xmppClient.js +78 -16
  207. package/lib/module/networking/xmppClient.js.map +1 -1
  208. package/lib/module/roomStore/callSlice.js +130 -0
  209. package/lib/module/roomStore/callSlice.js.map +1 -0
  210. package/lib/module/roomStore/chatSettingsSlice.js +6 -1
  211. package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
  212. package/lib/module/roomStore/index.js +6 -1
  213. package/lib/module/roomStore/index.js.map +1 -1
  214. package/lib/module/roomStore/persistence.js +69 -5
  215. package/lib/module/roomStore/persistence.js.map +1 -1
  216. package/lib/module/roomStore/roomsSlice.js +134 -5
  217. package/lib/module/roomStore/roomsSlice.js.map +1 -1
  218. package/lib/module/utils/translateModePolicy.js +27 -0
  219. package/lib/module/utils/translateModePolicy.js.map +1 -0
  220. package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
  221. package/lib/typescript/components/MainComponents/ChatWrapper.d.ts.map +1 -1
  222. package/lib/typescript/components/MainComponents/LanguageSelectorButton.d.ts +12 -0
  223. package/lib/typescript/components/MainComponents/LanguageSelectorButton.d.ts.map +1 -0
  224. package/lib/typescript/components/MainComponents/LanguageSelectorModal.d.ts +31 -0
  225. package/lib/typescript/components/MainComponents/LanguageSelectorModal.d.ts.map +1 -0
  226. package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
  227. package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
  228. package/lib/typescript/components/MessageBubble/Message.d.ts.map +1 -1
  229. package/lib/typescript/components/MessageBubble/MessageTranslate.d.ts +44 -0
  230. package/lib/typescript/components/MessageBubble/MessageTranslate.d.ts.map +1 -0
  231. package/lib/typescript/components/MessageBubble/TranslatedMessageBody.d.ts +24 -0
  232. package/lib/typescript/components/MessageBubble/TranslatedMessageBody.d.ts.map +1 -0
  233. package/lib/typescript/components/UsersList/UsersList.d.ts.map +1 -1
  234. package/lib/typescript/components/VideoCalls/CallButtons.d.ts +16 -0
  235. package/lib/typescript/components/VideoCalls/CallButtons.d.ts.map +1 -0
  236. package/lib/typescript/components/VideoCalls/CallIcons.d.ts +30 -0
  237. package/lib/typescript/components/VideoCalls/CallIcons.d.ts.map +1 -0
  238. package/lib/typescript/components/VideoCalls/VideoCallOverlay.d.ts +10 -0
  239. package/lib/typescript/components/VideoCalls/VideoCallOverlay.d.ts.map +1 -0
  240. package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts +38 -0
  241. package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts.map +1 -0
  242. package/lib/typescript/components/VideoCalls/livekitRuntime.d.ts +52 -0
  243. package/lib/typescript/components/VideoCalls/livekitRuntime.d.ts.map +1 -0
  244. package/lib/typescript/components/VideoCalls/useCallKeep.d.ts +32 -0
  245. package/lib/typescript/components/VideoCalls/useCallKeep.d.ts.map +1 -0
  246. package/lib/typescript/components/styled/AudioMessage.d.ts.map +1 -1
  247. package/lib/typescript/components/styled/RoomListComponents/index.d.ts.map +1 -1
  248. package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
  249. package/lib/typescript/components/styled/StyledComponents.d.ts.map +1 -1
  250. package/lib/typescript/components/styled/StyledInputComponents/Composing.d.ts.map +1 -1
  251. package/lib/typescript/components/styled/VideoMessage.d.ts +2 -0
  252. package/lib/typescript/components/styled/VideoMessage.d.ts.map +1 -1
  253. package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
  254. package/lib/typescript/helpers/callLogMessage.d.ts +34 -0
  255. package/lib/typescript/helpers/callLogMessage.d.ts.map +1 -0
  256. package/lib/typescript/helpers/callPush.d.ts +23 -0
  257. package/lib/typescript/helpers/callPush.d.ts.map +1 -0
  258. package/lib/typescript/helpers/constants/LANGUAGE_OPTIONS.d.ts +14 -0
  259. package/lib/typescript/helpers/constants/LANGUAGE_OPTIONS.d.ts.map +1 -1
  260. package/lib/typescript/helpers/createUserNameFromSetUser.d.ts +33 -1
  261. package/lib/typescript/helpers/createUserNameFromSetUser.d.ts.map +1 -1
  262. package/lib/typescript/helpers/getDataFromXml.d.ts.map +1 -1
  263. package/lib/typescript/helpers/incomingCallFromPush.d.ts +14 -0
  264. package/lib/typescript/helpers/incomingCallFromPush.d.ts.map +1 -0
  265. package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts.map +1 -1
  266. package/lib/typescript/helpers/isUnresolvedSenderId.d.ts +2 -0
  267. package/lib/typescript/helpers/isUnresolvedSenderId.d.ts.map +1 -0
  268. package/lib/typescript/hooks/useChatSettingState.d.ts +2 -1
  269. package/lib/typescript/hooks/useChatSettingState.d.ts.map +1 -1
  270. package/lib/typescript/hooks/useMessageTranslation.d.ts +25 -0
  271. package/lib/typescript/hooks/useMessageTranslation.d.ts.map +1 -0
  272. package/lib/typescript/hooks/usePushNotifications.d.ts.map +1 -1
  273. package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
  274. package/lib/typescript/i18n/strings.d.ts +16 -0
  275. package/lib/typescript/i18n/strings.d.ts.map +1 -0
  276. package/lib/typescript/i18n/useT.d.ts +34 -0
  277. package/lib/typescript/i18n/useT.d.ts.map +1 -0
  278. package/lib/typescript/main.d.ts +6 -1
  279. package/lib/typescript/main.d.ts.map +1 -1
  280. package/lib/typescript/networking/api-requests/auth.api.d.ts +27 -1
  281. package/lib/typescript/networking/api-requests/auth.api.d.ts.map +1 -1
  282. package/lib/typescript/networking/api-requests/push.api.d.ts.map +1 -1
  283. package/lib/typescript/networking/api-requests/rooms.api.d.ts +3 -0
  284. package/lib/typescript/networking/api-requests/rooms.api.d.ts.map +1 -1
  285. package/lib/typescript/networking/callTokenStanza.d.ts +14 -0
  286. package/lib/typescript/networking/callTokenStanza.d.ts.map +1 -0
  287. package/lib/typescript/networking/outboundQueue.d.ts +1 -0
  288. package/lib/typescript/networking/outboundQueue.d.ts.map +1 -1
  289. package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
  290. package/lib/typescript/networking/xmpp/handleStanzas.xmpp.d.ts.map +1 -1
  291. package/lib/typescript/networking/xmpp/sendTextMessage.xmpp.d.ts +10 -0
  292. package/lib/typescript/networking/xmpp/sendTextMessage.xmpp.d.ts.map +1 -1
  293. package/lib/typescript/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.d.ts +16 -1
  294. package/lib/typescript/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.d.ts.map +1 -1
  295. package/lib/typescript/networking/xmppClient.d.ts +1 -1
  296. package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
  297. package/lib/typescript/roomStore/callSlice.d.ts +39 -0
  298. package/lib/typescript/roomStore/callSlice.d.ts.map +1 -0
  299. package/lib/typescript/roomStore/chatSettingsSlice.d.ts +10 -1
  300. package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
  301. package/lib/typescript/roomStore/index.d.ts +4 -0
  302. package/lib/typescript/roomStore/index.d.ts.map +1 -1
  303. package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
  304. package/lib/typescript/roomStore/roomsSlice.d.ts +6 -1
  305. package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
  306. package/lib/typescript/types/models/language.model.d.ts +1 -1
  307. package/lib/typescript/types/models/language.model.d.ts.map +1 -1
  308. package/lib/typescript/types/models/message.model.d.ts +7 -0
  309. package/lib/typescript/types/models/message.model.d.ts.map +1 -1
  310. package/lib/typescript/types/types.d.ts +135 -1
  311. package/lib/typescript/types/types.d.ts.map +1 -1
  312. package/lib/typescript/utils/translateModePolicy.d.ts +20 -0
  313. package/lib/typescript/utils/translateModePolicy.d.ts.map +1 -0
  314. package/package.json +20 -4
  315. package/src/components/MainComponents/ChatHeader.tsx +30 -9
  316. package/src/components/MainComponents/ChatWrapper.tsx +15 -0
  317. package/src/components/MainComponents/LanguageSelectorButton.tsx +53 -0
  318. package/src/components/MainComponents/LanguageSelectorModal.tsx +276 -0
  319. package/src/components/MainComponents/MediaMessage.tsx +5 -0
  320. package/src/components/MainComponents/RoomList.tsx +27 -9
  321. package/src/components/MessageBubble/Message.tsx +109 -17
  322. package/src/components/MessageBubble/MessageTranslate.tsx +182 -0
  323. package/src/components/MessageBubble/TranslatedMessageBody.tsx +59 -0
  324. package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +3 -3
  325. package/src/components/UsersList/UsersList.tsx +3 -1
  326. package/src/components/VideoCalls/CallButtons.tsx +171 -0
  327. package/src/components/VideoCalls/CallIcons.tsx +246 -0
  328. package/src/components/VideoCalls/VideoCallOverlay.tsx +627 -0
  329. package/src/components/VideoCalls/VideoCallSession.tsx +675 -0
  330. package/src/components/VideoCalls/livekitRuntime.ts +100 -0
  331. package/src/components/VideoCalls/useCallKeep.ts +252 -0
  332. package/src/components/styled/AudioMessage.tsx +97 -37
  333. package/src/components/styled/RoomListComponents/index.tsx +15 -3
  334. package/src/components/styled/SendInput.tsx +94 -51
  335. package/src/components/styled/StyledComponents.ts +9 -6
  336. package/src/components/styled/StyledInputComponents/Composing.tsx +7 -1
  337. package/src/components/styled/VideoMessage.tsx +114 -20
  338. package/src/context/xmppProvider.tsx +14 -1
  339. package/src/helpers/callLogMessage.ts +174 -0
  340. package/src/helpers/callPush.ts +90 -0
  341. package/src/helpers/constants/LANGUAGE_OPTIONS.ts +20 -5
  342. package/src/helpers/createUserNameFromSetUser.ts +68 -2
  343. package/src/helpers/getDataFromXml.ts +40 -4
  344. package/src/helpers/incomingCallFromPush.ts +83 -0
  345. package/src/helpers/insertMessageWithDelimiter.ts +27 -9
  346. package/src/helpers/isUnresolvedSenderId.ts +25 -0
  347. package/src/hooks/useChatSettingState.tsx +4 -0
  348. package/src/hooks/useMessageTranslation.ts +70 -0
  349. package/src/hooks/usePushNotifications.ts +15 -3
  350. package/src/hooks/useSendMessage.tsx +18 -5
  351. package/src/i18n/strings.ts +1322 -0
  352. package/src/i18n/useT.ts +56 -0
  353. package/src/main.ts +18 -1
  354. package/src/networking/api-requests/auth.api.ts +79 -44
  355. package/src/networking/api-requests/push.api.ts +39 -8
  356. package/src/networking/api-requests/rooms.api.ts +109 -1
  357. package/src/networking/callTokenStanza.ts +636 -0
  358. package/src/networking/outboundQueue.ts +1 -0
  359. package/src/networking/stanzaHandlers.ts +74 -15
  360. package/src/networking/xmpp/handleStanzas.xmpp.ts +52 -11
  361. package/src/networking/xmpp/sendTextMessage.xmpp.ts +1 -1
  362. package/src/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.ts +41 -5
  363. package/src/networking/xmppClient.ts +97 -28
  364. package/src/roomStore/callSlice.ts +190 -0
  365. package/src/roomStore/chatSettingsSlice.ts +16 -0
  366. package/src/roomStore/index.ts +5 -0
  367. package/src/roomStore/persistence.ts +103 -3
  368. package/src/roomStore/roomsSlice.ts +149 -4
  369. package/src/types/models/language.model.ts +17 -1
  370. package/src/types/models/message.model.ts +9 -0
  371. package/src/types/types.ts +142 -2
  372. package/src/utils/translateModePolicy.ts +31 -0
@@ -0,0 +1,627 @@
1
+ import React, {
2
+ FC,
3
+ useCallback,
4
+ useEffect,
5
+ useMemo,
6
+ useRef,
7
+ useState,
8
+ } from 'react';
9
+ import {
10
+ Animated,
11
+ BackHandler,
12
+ Easing,
13
+ Modal,
14
+ Platform,
15
+ StyleSheet,
16
+ Text,
17
+ TouchableOpacity,
18
+ Vibration,
19
+ View,
20
+ } from 'react-native';
21
+ import { useDispatch, useSelector } from 'react-redux';
22
+ import { RootState, store } from '../../roomStore';
23
+ import {
24
+ acceptIncomingCall,
25
+ declineIncomingCall,
26
+ endCall,
27
+ resetCall,
28
+ setCallError,
29
+ setCallPhase,
30
+ } from '../../roomStore/callSlice';
31
+ import { addRoomMessage } from '../../roomStore/roomsSlice';
32
+ import { buildLocalCallLogMessage } from '../../helpers/callLogMessage';
33
+ import { useChatSettingState } from '../../hooks/useChatSettingState';
34
+ import {
35
+ CallSignalState,
36
+ sendCallStateSignal,
37
+ } from '../../networking/callTokenStanza';
38
+ import { VideoCallSession } from './VideoCallSession';
39
+ import { ProfileImagePlaceholder } from '../MainComponents/ProfileImagePlaceholder';
40
+ import {
41
+ AudioCallIcon,
42
+ HangUpIcon,
43
+ VideoCallIcon,
44
+ } from './CallIcons';
45
+ import { VideoCallIcons } from '../../types/types';
46
+ import { useT } from '../../i18n/useT';
47
+ import { useCallKeep } from './useCallKeep';
48
+
49
+ const DEFAULT_PRIMARY = '#0052CD';
50
+ const TEXT_PRIMARY = '#141414';
51
+ const TEXT_MUTED = '#8c8c8c';
52
+ const DANGER = '#E53935';
53
+ const ACCEPT = '#10B981';
54
+
55
+ // Stop the dial UI sitting forever when the server never broadcasts a
56
+ // call-token (offline peer, backend error, etc). 30s matches the typical
57
+ // PSTN ring window.
58
+ const OUTGOING_CALL_TIMEOUT_MS = 30000;
59
+
60
+ // Ring pattern for an incoming call: wait, buzz, pause, buzz... Android
61
+ // loops this from index 0, iOS ignores the pattern and just vibrates.
62
+ const RING_VIBRATION_PATTERN = [0, 700, 900];
63
+
64
+ const hexToRgba = (hex: string, alpha: number): string => {
65
+ let value = String(hex || DEFAULT_PRIMARY).trim();
66
+ if (value.startsWith('#')) {value = value.slice(1);}
67
+ if (value.length === 3) {
68
+ value = value
69
+ .split('')
70
+ .map((ch) => ch + ch)
71
+ .join('');
72
+ }
73
+ if (value.length !== 6) {return `rgba(0, 82, 205, ${alpha})`;}
74
+ const num = parseInt(value, 16);
75
+ const r = (num >> 16) & 255;
76
+ const g = (num >> 8) & 255;
77
+ const b = num & 255;
78
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
79
+ };
80
+
81
+ /**
82
+ * The expanding rings behind the avatar on the ring screen. Web does this
83
+ * with a CSS @keyframes; RN needs a real Animated loop. `useNativeDriver`
84
+ * keeps it on the UI thread so the pulse doesn't stutter while the JS
85
+ * thread is busy connecting to LiveKit.
86
+ */
87
+ const PulseRing: FC<{ color: string; delay: number }> = ({ color, delay }) => {
88
+ const progress = useRef(new Animated.Value(0)).current;
89
+
90
+ useEffect(() => {
91
+ const animation = Animated.loop(
92
+ Animated.sequence([
93
+ Animated.delay(delay),
94
+ Animated.timing(progress, {
95
+ toValue: 1,
96
+ duration: 1800,
97
+ easing: Easing.out(Easing.ease),
98
+ useNativeDriver: true,
99
+ }),
100
+ Animated.timing(progress, {
101
+ toValue: 0,
102
+ duration: 0,
103
+ useNativeDriver: true,
104
+ }),
105
+ ])
106
+ );
107
+ animation.start();
108
+ return () => animation.stop();
109
+ }, [progress, delay]);
110
+
111
+ return (
112
+ <Animated.View
113
+ pointerEvents="none"
114
+ style={[
115
+ styles.pulseRing,
116
+ {
117
+ borderColor: color,
118
+ opacity: progress.interpolate({
119
+ inputRange: [0, 0.7, 1],
120
+ outputRange: [0.55, 0, 0],
121
+ }),
122
+ transform: [
123
+ {
124
+ scale: progress.interpolate({
125
+ inputRange: [0, 0.7, 1],
126
+ outputRange: [0.92, 1.4, 0.92],
127
+ }),
128
+ },
129
+ ],
130
+ },
131
+ ]}
132
+ />
133
+ );
134
+ };
135
+
136
+ interface RingingCardProps {
137
+ title: string;
138
+ subtitle: string;
139
+ roomName: string | null;
140
+ kind: 'audio' | 'video';
141
+ variant: 'incoming' | 'outgoing' | 'error';
142
+ primaryColor: string;
143
+ errorMessage?: string | null;
144
+ icons?: VideoCallIcons;
145
+ onAccept?: () => void;
146
+ onDecline?: () => void;
147
+ onHangup?: () => void;
148
+ onDismiss?: () => void;
149
+ }
150
+
151
+ const RingingCard: FC<RingingCardProps> = ({
152
+ title,
153
+ subtitle,
154
+ roomName,
155
+ kind,
156
+ variant,
157
+ primaryColor,
158
+ errorMessage,
159
+ icons,
160
+ onAccept,
161
+ onDecline,
162
+ onHangup,
163
+ onDismiss,
164
+ }) => {
165
+ const t = useT();
166
+
167
+ return (
168
+ <View style={styles.ringingCard}>
169
+ <Text style={styles.ringingTitle}>{title}</Text>
170
+
171
+ <View style={styles.avatarWrap}>
172
+ {variant !== 'error' && (
173
+ <>
174
+ <PulseRing color={hexToRgba(primaryColor, 0.45)} delay={0} />
175
+ <PulseRing color={hexToRgba(primaryColor, 0.3)} delay={900} />
176
+ </>
177
+ )}
178
+ <ProfileImagePlaceholder name={roomName || 'Call'} size={120} />
179
+ </View>
180
+
181
+ <View style={styles.ringingIdentity}>
182
+ <Text style={styles.ringingName}>
183
+ {roomName ||
184
+ (variant === 'incoming' ? t('call.unknownCaller') : t('call.title'))}
185
+ </Text>
186
+ <View style={styles.ringingSubtitleRow}>
187
+ {kind === 'audio' ? (
188
+ <AudioCallIcon color={TEXT_MUTED} size={16} />
189
+ ) : (
190
+ <VideoCallIcon color={TEXT_MUTED} size={16} />
191
+ )}
192
+ <Text style={styles.ringingSubtitle}>{subtitle}</Text>
193
+ </View>
194
+ </View>
195
+
196
+ {!!errorMessage && (
197
+ <View style={styles.errorBox}>
198
+ <Text style={styles.errorBoxText}>{errorMessage}</Text>
199
+ </View>
200
+ )}
201
+
202
+ <View style={styles.ringingActions}>
203
+ {variant === 'incoming' && (
204
+ <>
205
+ <TouchableOpacity
206
+ accessibilityRole="button"
207
+ accessibilityLabel={t('call.action.decline')}
208
+ onPress={onDecline}
209
+ style={[styles.circleAction, { backgroundColor: DANGER }]}
210
+ >
211
+ {icons?.decline ?? <HangUpIcon color="#FFFFFF" />}
212
+ </TouchableOpacity>
213
+ <TouchableOpacity
214
+ accessibilityRole="button"
215
+ accessibilityLabel={t('call.action.accept')}
216
+ onPress={onAccept}
217
+ style={[styles.circleAction, { backgroundColor: ACCEPT }]}
218
+ >
219
+ {icons?.accept ??
220
+ (kind === 'audio' ? (
221
+ <AudioCallIcon color="#FFFFFF" />
222
+ ) : (
223
+ <VideoCallIcon color="#FFFFFF" />
224
+ ))}
225
+ </TouchableOpacity>
226
+ </>
227
+ )}
228
+
229
+ {variant === 'outgoing' && (
230
+ <TouchableOpacity
231
+ accessibilityRole="button"
232
+ accessibilityLabel={t('call.action.cancel')}
233
+ onPress={onHangup}
234
+ style={[styles.circleAction, { backgroundColor: DANGER }]}
235
+ >
236
+ {icons?.hangup ?? <HangUpIcon color="#FFFFFF" />}
237
+ </TouchableOpacity>
238
+ )}
239
+
240
+ {variant === 'error' && (
241
+ <TouchableOpacity
242
+ accessibilityRole="button"
243
+ onPress={onDismiss}
244
+ style={[styles.dismissButton, { backgroundColor: primaryColor }]}
245
+ >
246
+ <Text style={styles.dismissText}>{t('call.action.dismiss')}</Text>
247
+ </TouchableOpacity>
248
+ )}
249
+ </View>
250
+ </View>
251
+ );
252
+ };
253
+
254
+ /**
255
+ * Call orchestration surface. Mounted once, above the chat, by XmppProvider,
256
+ * so an incoming call rings on whatever screen the user happens to be on
257
+ * rather than only inside <Chat>. Renders nothing while `call.phase` is
258
+ * 'idle'.
259
+ */
260
+ export const VideoCallOverlay: FC = () => {
261
+ const dispatch = useDispatch();
262
+ const call = useSelector((state: RootState) => state.call);
263
+ const { config } = useChatSettingState();
264
+ const t = useT();
265
+
266
+ const videoCallsConfig = config?.videoCalls;
267
+ const enabled = videoCallsConfig?.enabled === true;
268
+ const livekitUrl = (videoCallsConfig?.livekitUrl || '').trim();
269
+ const primaryColor = config?.colors?.primary || DEFAULT_PRIMARY;
270
+
271
+ const isOpen = enabled && call.phase !== 'idle';
272
+
273
+ // Native incoming-call screen where the host installed react-native-
274
+ // callkeep. No-op otherwise, the in-app ring screen below is the
275
+ // fallback and always renders.
276
+ useCallKeep();
277
+
278
+ const [minimized, setMinimized] = useState(false);
279
+
280
+ const canRenderSession =
281
+ !!call.token &&
282
+ (call.phase === 'connecting' || call.phase === 'in-call') &&
283
+ !!livekitUrl;
284
+ const isMinimized = minimized && canRenderSession;
285
+
286
+ // Reset the minimized flag whenever the call ends, so the next call
287
+ // opens full-screen.
288
+ useEffect(() => {
289
+ if (call.phase === 'idle') {setMinimized(false);}
290
+ }, [call.phase]);
291
+
292
+ // Give up on an unanswered outgoing dial.
293
+ useEffect(() => {
294
+ if (call.phase !== 'requesting' || call.direction !== 'outgoing') {
295
+ return;
296
+ }
297
+ const timer = setTimeout(() => {
298
+ dispatch(setCallError(t('call.error.noAnswerTimeout')));
299
+ }, OUTGOING_CALL_TIMEOUT_MS);
300
+ return () => clearTimeout(timer);
301
+ }, [call.phase, call.direction, call.startedAt, dispatch, t]);
302
+
303
+ // Buzz while an incoming call is ringing. The ring screen is already on
304
+ // top, so this is the only alert needed when the app is in the
305
+ // foreground; a backgrounded/killed app is handled by the call push.
306
+ useEffect(() => {
307
+ const isRinging =
308
+ call.direction === 'incoming' && call.phase === 'ringing-incoming';
309
+ if (!isRinging) {return;}
310
+ Vibration.vibrate(RING_VIBRATION_PATTERN, true);
311
+ return () => Vibration.cancel();
312
+ }, [call.direction, call.phase]);
313
+
314
+ const terminateCall = useCallback(
315
+ (state: CallSignalState) => {
316
+ // Write a local "call ended" log entry BEFORE endCall() wipes the
317
+ // call slice. The authoritative entry is a server call-state
318
+ // broadcast, but that isn't guaranteed to arrive, so we synthesize
319
+ // our own. It's deduped against any server copy by callId in
320
+ // addRoomMessage.
321
+ const snap = store.getState().call;
322
+ if (snap.roomJid && (snap.callId || snap.connectedAt)) {
323
+ const durationMs = snap.connectedAt
324
+ ? Math.max(0, Date.now() - snap.connectedAt)
325
+ : 0;
326
+ dispatch(
327
+ addRoomMessage({
328
+ roomJID: snap.roomJid,
329
+ message: buildLocalCallLogMessage({
330
+ callId: snap.callId || '',
331
+ direction:
332
+ snap.direction === 'incoming' ? 'incoming' : 'outgoing',
333
+ durationMs,
334
+ kind: snap.kind === 'audio' ? 'audio' : 'video',
335
+ selfXmppUsername:
336
+ store.getState().chatSettingStore.user?.xmppUsername || '',
337
+ }),
338
+ })
339
+ );
340
+ }
341
+ sendCallStateSignal(state);
342
+ dispatch(endCall());
343
+ },
344
+ [dispatch]
345
+ );
346
+
347
+ const declineCall = useCallback(() => {
348
+ sendCallStateSignal('declined');
349
+ dispatch(declineIncomingCall());
350
+ }, [dispatch]);
351
+
352
+ const hangupCurrent = useCallback(() => {
353
+ if (call.direction === 'incoming' && call.phase === 'ringing-incoming') {
354
+ declineCall();
355
+ } else if (call.phase === 'error') {
356
+ dispatch(resetCall());
357
+ } else {
358
+ terminateCall(call.phase === 'requesting' ? 'cancelled' : 'ended');
359
+ }
360
+ }, [call.direction, call.phase, declineCall, terminateCall, dispatch]);
361
+
362
+ // Android hardware back = hang up, the RN equivalent of the web Esc
363
+ // handler. A minimized panel shouldn't swallow back: the user is using
364
+ // the app underneath it.
365
+ useEffect(() => {
366
+ if (!isOpen || isMinimized || Platform.OS !== 'android') {return;}
367
+ const subscription = BackHandler.addEventListener(
368
+ 'hardwareBackPress',
369
+ () => {
370
+ hangupCurrent();
371
+ return true;
372
+ }
373
+ );
374
+ return () => subscription.remove();
375
+ }, [isOpen, isMinimized, hangupCurrent]);
376
+
377
+ const ringingHeader = useMemo(() => {
378
+ if (call.direction === 'incoming') {
379
+ return call.kind === 'audio'
380
+ ? t('call.incomingAudio')
381
+ : t('call.incomingVideo');
382
+ }
383
+ if (call.phase === 'requesting') {return t('call.calling');}
384
+ if (call.phase === 'connecting') {return t('call.connecting');}
385
+ if (call.phase === 'error') {return t('call.failed');}
386
+ return t('call.title');
387
+ }, [call.direction, call.phase, call.kind, t]);
388
+
389
+ const ringingSubtitle = useMemo(() => {
390
+ if (call.direction === 'incoming') {
391
+ return call.kind === 'audio' ? t('call.audioCall') : t('call.videoCall');
392
+ }
393
+ if (call.phase === 'connecting') {return t('call.connectingToRoom');}
394
+ if (call.phase === 'error') {return t('call.tryAgainLater');}
395
+ return call.kind === 'audio' ? t('call.audioCall') : t('call.videoCall');
396
+ }, [call.direction, call.kind, call.phase, t]);
397
+
398
+ if (!isOpen) {
399
+ return null;
400
+ }
401
+
402
+ const showIncomingDecision =
403
+ call.direction === 'incoming' && call.phase === 'ringing-incoming';
404
+
405
+ // The minimized session is NOT a Modal: a modal is by definition on top
406
+ // of everything and swallows touches, which is the opposite of what
407
+ // minimize is for (keep talking, keep using the chat). It renders as a
408
+ // floating absolutely-positioned bar instead.
409
+ if (canRenderSession && isMinimized) {
410
+ return (
411
+ <View style={styles.floatingPanel} pointerEvents="box-none">
412
+ <VideoCallSession
413
+ token={call.token as string}
414
+ livekitUrl={livekitUrl}
415
+ kind={call.kind}
416
+ peerName={call.roomName}
417
+ primaryColor={primaryColor}
418
+ icons={videoCallsConfig?.icons}
419
+ startWithCameraOn={videoCallsConfig?.startWithCameraOn}
420
+ startWithMicOn={videoCallsConfig?.startWithMicOn}
421
+ minimized
422
+ onToggleMinimize={() => setMinimized((m) => !m)}
423
+ onConnected={() => dispatch(setCallPhase('in-call'))}
424
+ onError={(message) => dispatch(setCallError(message))}
425
+ onHangup={() => terminateCall('ended')}
426
+ />
427
+ </View>
428
+ );
429
+ }
430
+
431
+ return (
432
+ <Modal
433
+ visible
434
+ transparent
435
+ animationType="fade"
436
+ statusBarTranslucent
437
+ onRequestClose={hangupCurrent}
438
+ >
439
+ <View style={styles.backdrop}>
440
+ {canRenderSession ? (
441
+ <View
442
+ style={
443
+ call.kind === 'audio' ? styles.audioSessionCard : styles.sessionCard
444
+ }
445
+ >
446
+ <VideoCallSession
447
+ token={call.token as string}
448
+ livekitUrl={livekitUrl}
449
+ kind={call.kind}
450
+ peerName={call.roomName}
451
+ primaryColor={primaryColor}
452
+ icons={videoCallsConfig?.icons}
453
+ startWithCameraOn={videoCallsConfig?.startWithCameraOn}
454
+ startWithMicOn={videoCallsConfig?.startWithMicOn}
455
+ minimized={false}
456
+ onToggleMinimize={() => setMinimized((m) => !m)}
457
+ onConnected={() => dispatch(setCallPhase('in-call'))}
458
+ onError={(message) => dispatch(setCallError(message))}
459
+ onHangup={() => terminateCall('ended')}
460
+ />
461
+ </View>
462
+ ) : showIncomingDecision ? (
463
+ <RingingCard
464
+ title={ringingHeader}
465
+ subtitle={ringingSubtitle}
466
+ roomName={call.roomName}
467
+ kind={call.kind}
468
+ variant="incoming"
469
+ primaryColor={primaryColor}
470
+ icons={videoCallsConfig?.icons}
471
+ onAccept={() => dispatch(acceptIncomingCall())}
472
+ onDecline={declineCall}
473
+ />
474
+ ) : call.phase === 'error' ? (
475
+ <RingingCard
476
+ title={ringingHeader}
477
+ subtitle={ringingSubtitle}
478
+ roomName={call.roomName}
479
+ kind={call.kind}
480
+ variant="error"
481
+ primaryColor={primaryColor}
482
+ errorMessage={
483
+ call.error ||
484
+ (!livekitUrl ? t('call.error.missingLivekitUrl') : null)
485
+ }
486
+ onDismiss={() => dispatch(resetCall())}
487
+ />
488
+ ) : (
489
+ <RingingCard
490
+ title={ringingHeader}
491
+ subtitle={ringingSubtitle}
492
+ roomName={call.roomName}
493
+ kind={call.kind}
494
+ variant="outgoing"
495
+ primaryColor={primaryColor}
496
+ icons={videoCallsConfig?.icons}
497
+ onHangup={() => terminateCall('cancelled')}
498
+ />
499
+ )}
500
+ </View>
501
+ </Modal>
502
+ );
503
+ };
504
+
505
+ const styles = StyleSheet.create({
506
+ backdrop: {
507
+ flex: 1,
508
+ backgroundColor: 'rgba(0, 0, 0, 0.5)',
509
+ alignItems: 'center',
510
+ justifyContent: 'center',
511
+ padding: 16,
512
+ },
513
+ sessionCard: {
514
+ width: '100%',
515
+ height: '100%',
516
+ borderRadius: 24,
517
+ backgroundColor: '#fff',
518
+ overflow: 'hidden',
519
+ },
520
+ // Audio calls don't need the full video canvas: a fixed tall card leaves
521
+ // a dead gap around the avatar and strands the controls far from
522
+ // anything else, so this one shrink-wraps its content.
523
+ audioSessionCard: {
524
+ width: '100%',
525
+ maxHeight: 600,
526
+ flexGrow: 0,
527
+ flexShrink: 1,
528
+ minHeight: 420,
529
+ borderRadius: 24,
530
+ backgroundColor: '#fff',
531
+ overflow: 'hidden',
532
+ },
533
+ floatingPanel: {
534
+ position: 'absolute',
535
+ right: 16,
536
+ bottom: 24,
537
+ left: 16,
538
+ zIndex: 1001,
539
+ elevation: 12,
540
+ },
541
+ ringingCard: {
542
+ width: '100%',
543
+ maxWidth: 420,
544
+ padding: 32,
545
+ borderRadius: 24,
546
+ backgroundColor: '#fff',
547
+ alignItems: 'center',
548
+ gap: 24,
549
+ },
550
+ ringingTitle: {
551
+ fontSize: 14,
552
+ color: TEXT_MUTED,
553
+ letterSpacing: 0.2,
554
+ },
555
+ avatarWrap: {
556
+ width: 160,
557
+ height: 160,
558
+ alignItems: 'center',
559
+ justifyContent: 'center',
560
+ },
561
+ pulseRing: {
562
+ position: 'absolute',
563
+ width: 160,
564
+ height: 160,
565
+ borderRadius: 80,
566
+ borderWidth: 2,
567
+ },
568
+ ringingIdentity: {
569
+ alignItems: 'center',
570
+ gap: 4,
571
+ },
572
+ ringingName: {
573
+ fontSize: 24,
574
+ color: TEXT_PRIMARY,
575
+ textAlign: 'center',
576
+ },
577
+ ringingSubtitleRow: {
578
+ flexDirection: 'row',
579
+ alignItems: 'center',
580
+ gap: 6,
581
+ },
582
+ ringingSubtitle: {
583
+ color: TEXT_MUTED,
584
+ fontSize: 14,
585
+ },
586
+ errorBox: {
587
+ width: '100%',
588
+ paddingVertical: 8,
589
+ paddingHorizontal: 12,
590
+ borderRadius: 12,
591
+ backgroundColor: 'rgba(229, 57, 53, 0.06)',
592
+ borderWidth: 1,
593
+ borderColor: 'rgba(229, 57, 53, 0.18)',
594
+ },
595
+ errorBoxText: {
596
+ color: DANGER,
597
+ fontSize: 14,
598
+ textAlign: 'center',
599
+ },
600
+ ringingActions: {
601
+ flexDirection: 'row',
602
+ gap: 24,
603
+ marginTop: 4,
604
+ alignItems: 'center',
605
+ justifyContent: 'center',
606
+ },
607
+ circleAction: {
608
+ width: 56,
609
+ height: 56,
610
+ borderRadius: 28,
611
+ alignItems: 'center',
612
+ justifyContent: 'center',
613
+ },
614
+ dismissButton: {
615
+ minWidth: 120,
616
+ paddingHorizontal: 20,
617
+ paddingVertical: 12,
618
+ borderRadius: 12,
619
+ alignItems: 'center',
620
+ },
621
+ dismissText: {
622
+ color: '#fff',
623
+ fontSize: 15,
624
+ },
625
+ });
626
+
627
+ export default VideoCallOverlay;