@ethora/chat-component-rn 26.8.2 → 26.8.4

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 (547) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +27 -1
  3. package/lib/commonjs/assets/EmptyChatIllustration.js +7 -6
  4. package/lib/commonjs/assets/EmptyChatIllustration.js.map +1 -1
  5. package/lib/commonjs/assets/icons.js +2 -2
  6. package/lib/commonjs/assets/icons.js.map +1 -1
  7. package/lib/commonjs/components/AuthForms/Login.js +23 -8
  8. package/lib/commonjs/components/AuthForms/Login.js.map +1 -1
  9. package/lib/commonjs/components/ContextMenu/ContextMenuComponents.js +12 -4
  10. package/lib/commonjs/components/ContextMenu/ContextMenuComponents.js.map +1 -1
  11. package/lib/commonjs/components/DropdownMenu/DropdownMenu.js +16 -9
  12. package/lib/commonjs/components/DropdownMenu/DropdownMenu.js.map +1 -1
  13. package/lib/commonjs/components/ExampleComponents/CustomMessage.js +25 -7
  14. package/lib/commonjs/components/ExampleComponents/CustomMessage.js.map +1 -1
  15. package/lib/commonjs/components/ExampleComponents/CustomTypingIndicatorExamples.js +18 -6
  16. package/lib/commonjs/components/ExampleComponents/CustomTypingIndicatorExamples.js.map +1 -1
  17. package/lib/commonjs/components/Header/HeaderRoomList.js +9 -6
  18. package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
  19. package/lib/commonjs/components/InputComponents/Search.js +13 -4
  20. package/lib/commonjs/components/InputComponents/Search.js.map +1 -1
  21. package/lib/commonjs/components/MainComponents/ChatHeader.js +9 -3
  22. package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
  23. package/lib/commonjs/components/MainComponents/ChatRoom.js +6 -3
  24. package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
  25. package/lib/commonjs/components/MainComponents/ChatWrapper.js +8 -6
  26. package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
  27. package/lib/commonjs/components/MainComponents/LanguageSelectorModal.js +37 -10
  28. package/lib/commonjs/components/MainComponents/LanguageSelectorModal.js.map +1 -1
  29. package/lib/commonjs/components/MainComponents/MediaMessage.js +43 -19
  30. package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
  31. package/lib/commonjs/components/MainComponents/MessageList.js +9 -3
  32. package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
  33. package/lib/commonjs/components/MainComponents/RNStyled.js +12 -4
  34. package/lib/commonjs/components/MainComponents/RNStyled.js.map +1 -1
  35. package/lib/commonjs/components/MainComponents/ReduxWrapper.js +61 -7
  36. package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
  37. package/lib/commonjs/components/MainComponents/RoomList.js +12 -9
  38. package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
  39. package/lib/commonjs/components/MainComponents/Select.js +29 -8
  40. package/lib/commonjs/components/MainComponents/Select.js.map +1 -1
  41. package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +24 -13
  42. package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
  43. package/lib/commonjs/components/MessageBubble/BottomReplyContainer.js +24 -8
  44. package/lib/commonjs/components/MessageBubble/BottomReplyContainer.js.map +1 -1
  45. package/lib/commonjs/components/MessageBubble/Message.js +46 -24
  46. package/lib/commonjs/components/MessageBubble/Message.js.map +1 -1
  47. package/lib/commonjs/components/MessageBubble/MessageInteractions.js +15 -4
  48. package/lib/commonjs/components/MessageBubble/MessageInteractions.js.map +1 -1
  49. package/lib/commonjs/components/MessageBubble/MessageReaction.js +10 -5
  50. package/lib/commonjs/components/MessageBubble/MessageReaction.js.map +1 -1
  51. package/lib/commonjs/components/Modals/AddMembersModal/AddMembersModal.js +1 -5
  52. package/lib/commonjs/components/Modals/AddMembersModal/AddMembersModal.js.map +1 -1
  53. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +42 -27
  54. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  55. package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +77 -24
  56. package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
  57. package/lib/commonjs/components/Modals/ChatProfileModal/DeleteChatModal.js +5 -7
  58. package/lib/commonjs/components/Modals/ChatProfileModal/DeleteChatModal.js.map +1 -1
  59. package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +18 -14
  60. package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -1
  61. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +20 -9
  62. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  63. package/lib/commonjs/components/Modals/ModalHeaderComponent.js +8 -2
  64. package/lib/commonjs/components/Modals/ModalHeaderComponent.js.map +1 -1
  65. package/lib/commonjs/components/Modals/ModalWrapper/ModalWrapper.js +8 -8
  66. package/lib/commonjs/components/Modals/ModalWrapper/ModalWrapper.js.map +1 -1
  67. package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js +1 -5
  68. package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js.map +1 -1
  69. package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +18 -15
  70. package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
  71. package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js +14 -9
  72. package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -1
  73. package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +3 -7
  74. package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
  75. package/lib/commonjs/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js +8 -6
  76. package/lib/commonjs/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js.map +1 -1
  77. package/lib/commonjs/components/Modals/SettingsModals/Referrals/Referrals.js +7 -2
  78. package/lib/commonjs/components/Modals/SettingsModals/Referrals/Referrals.js.map +1 -1
  79. package/lib/commonjs/components/Modals/SettingsModals/SharedStyledComponents.js +7 -3
  80. package/lib/commonjs/components/Modals/SettingsModals/SharedStyledComponents.js.map +1 -1
  81. package/lib/commonjs/components/Modals/SettingsModals/Visibility/RadioInput.js +10 -6
  82. package/lib/commonjs/components/Modals/SettingsModals/Visibility/RadioInput.js.map +1 -1
  83. package/lib/commonjs/components/Modals/SettingsModals/Visibility/VisibilityModal.js +7 -6
  84. package/lib/commonjs/components/Modals/SettingsModals/Visibility/VisibilityModal.js.map +1 -1
  85. package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js +3 -1
  86. package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
  87. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +18 -15
  88. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  89. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +145 -9
  90. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  91. package/lib/commonjs/components/Modals/styledModalComponents.js +60 -16
  92. package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
  93. package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +16 -10
  94. package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
  95. package/lib/commonjs/components/RoomComponents/styled/LastAudioMessage.js +6 -2
  96. package/lib/commonjs/components/RoomComponents/styled/LastAudioMessage.js.map +1 -1
  97. package/lib/commonjs/components/RoomComponents/styled/StyledRoomComponents.js +6 -0
  98. package/lib/commonjs/components/RoomComponents/styled/StyledRoomComponents.js.map +1 -1
  99. package/lib/commonjs/components/Thread/ThreadWrapper.js +9 -2
  100. package/lib/commonjs/components/Thread/ThreadWrapper.js.map +1 -1
  101. package/lib/commonjs/components/Toast/Toast.js +3 -1
  102. package/lib/commonjs/components/Toast/Toast.js.map +1 -1
  103. package/lib/commonjs/components/styled/AudioMessage.js +16 -11
  104. package/lib/commonjs/components/styled/AudioMessage.js.map +1 -1
  105. package/lib/commonjs/components/styled/Button.js +18 -9
  106. package/lib/commonjs/components/styled/Button.js.map +1 -1
  107. package/lib/commonjs/components/styled/DateLabel.js +8 -5
  108. package/lib/commonjs/components/styled/DateLabel.js.map +1 -1
  109. package/lib/commonjs/components/styled/MediaModal.js +27 -21
  110. package/lib/commonjs/components/styled/MediaModal.js.map +1 -1
  111. package/lib/commonjs/components/styled/RoomListComponents/index.js +60 -38
  112. package/lib/commonjs/components/styled/RoomListComponents/index.js.map +1 -1
  113. package/lib/commonjs/components/styled/SendInput.js +13 -8
  114. package/lib/commonjs/components/styled/SendInput.js.map +1 -1
  115. package/lib/commonjs/components/styled/StyledComponents.js +67 -23
  116. package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
  117. package/lib/commonjs/components/styled/StyledInput.js +32 -18
  118. package/lib/commonjs/components/styled/StyledInput.js.map +1 -1
  119. package/lib/commonjs/components/styled/StyledInputComponents/CustomTypingIndicator.js +13 -8
  120. package/lib/commonjs/components/styled/StyledInputComponents/CustomTypingIndicator.js.map +1 -1
  121. package/lib/commonjs/components/styled/StyledInputComponents/MediaComponents.js +20 -9
  122. package/lib/commonjs/components/styled/StyledInputComponents/MediaComponents.js.map +1 -1
  123. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +39 -18
  124. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  125. package/lib/commonjs/components/styled/TreadLabel.js +6 -3
  126. package/lib/commonjs/components/styled/TreadLabel.js.map +1 -1
  127. package/lib/commonjs/context/MessageNotificationContext.js +14 -3
  128. package/lib/commonjs/context/MessageNotificationContext.js.map +1 -1
  129. package/lib/commonjs/helpers/getChatBackground.js +4 -1
  130. package/lib/commonjs/helpers/getChatBackground.js.map +1 -1
  131. package/lib/commonjs/helpers/getDateLabelColor.js +3 -1
  132. package/lib/commonjs/helpers/getDateLabelColor.js.map +1 -1
  133. package/lib/commonjs/helpers/getIconColor.js +4 -1
  134. package/lib/commonjs/helpers/getIconColor.js.map +1 -1
  135. package/lib/commonjs/helpers/getSenderNameColor.js +3 -1
  136. package/lib/commonjs/helpers/getSenderNameColor.js.map +1 -1
  137. package/lib/commonjs/helpers/markdownParser.js +27 -5
  138. package/lib/commonjs/helpers/markdownParser.js.map +1 -1
  139. package/lib/commonjs/helpers/parseMessageBody.js +82 -24
  140. package/lib/commonjs/helpers/parseMessageBody.js.map +1 -1
  141. package/lib/commonjs/helpers/preferencesStorage.js +44 -0
  142. package/lib/commonjs/helpers/preferencesStorage.js.map +1 -0
  143. package/lib/commonjs/hooks/useCustomTypingIndicator.js +7 -3
  144. package/lib/commonjs/hooks/useCustomTypingIndicator.js.map +1 -1
  145. package/lib/commonjs/hooks/useLogout.js +10 -3
  146. package/lib/commonjs/hooks/useLogout.js.map +1 -1
  147. package/lib/commonjs/hooks/useTheme.js +35 -0
  148. package/lib/commonjs/hooks/useTheme.js.map +1 -0
  149. package/lib/commonjs/i18n/strings.js +60 -0
  150. package/lib/commonjs/i18n/strings.js.map +1 -1
  151. package/lib/commonjs/main.js +88 -0
  152. package/lib/commonjs/main.js.map +1 -1
  153. package/lib/commonjs/networking/api-requests/push.api.js +130 -45
  154. package/lib/commonjs/networking/api-requests/push.api.js.map +1 -1
  155. package/lib/commonjs/networking/api-requests/rooms.api.js +13 -0
  156. package/lib/commonjs/networking/api-requests/rooms.api.js.map +1 -1
  157. package/lib/commonjs/roomStore/chatSettingsSlice.js +17 -4
  158. package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
  159. package/lib/commonjs/services/pushRegistration.js +261 -0
  160. package/lib/commonjs/services/pushRegistration.js.map +1 -0
  161. package/lib/commonjs/services/pushSubscriptionService.js +0 -24
  162. package/lib/commonjs/services/pushSubscriptionService.js.map +1 -1
  163. package/lib/commonjs/theme/index.js +38 -0
  164. package/lib/commonjs/theme/index.js.map +1 -0
  165. package/lib/commonjs/theme/styled.d.js +4 -0
  166. package/lib/commonjs/theme/styled.d.js.map +1 -0
  167. package/lib/commonjs/theme/theme.js +161 -0
  168. package/lib/commonjs/theme/theme.js.map +1 -0
  169. package/lib/commonjs/version.js +1 -1
  170. package/lib/module/assets/EmptyChatIllustration.js +7 -6
  171. package/lib/module/assets/EmptyChatIllustration.js.map +1 -1
  172. package/lib/module/assets/icons.js +1 -1
  173. package/lib/module/assets/icons.js.map +1 -1
  174. package/lib/module/components/AuthForms/Login.js +23 -8
  175. package/lib/module/components/AuthForms/Login.js.map +1 -1
  176. package/lib/module/components/ContextMenu/ContextMenuComponents.js +12 -4
  177. package/lib/module/components/ContextMenu/ContextMenuComponents.js.map +1 -1
  178. package/lib/module/components/DropdownMenu/DropdownMenu.js +16 -9
  179. package/lib/module/components/DropdownMenu/DropdownMenu.js.map +1 -1
  180. package/lib/module/components/ExampleComponents/CustomMessage.js +25 -7
  181. package/lib/module/components/ExampleComponents/CustomMessage.js.map +1 -1
  182. package/lib/module/components/ExampleComponents/CustomTypingIndicatorExamples.js +18 -6
  183. package/lib/module/components/ExampleComponents/CustomTypingIndicatorExamples.js.map +1 -1
  184. package/lib/module/components/Header/HeaderRoomList.js +9 -6
  185. package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
  186. package/lib/module/components/InputComponents/Search.js +13 -4
  187. package/lib/module/components/InputComponents/Search.js.map +1 -1
  188. package/lib/module/components/MainComponents/ChatHeader.js +9 -3
  189. package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
  190. package/lib/module/components/MainComponents/ChatRoom.js +6 -3
  191. package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
  192. package/lib/module/components/MainComponents/ChatWrapper.js +8 -6
  193. package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
  194. package/lib/module/components/MainComponents/LanguageSelectorModal.js +37 -10
  195. package/lib/module/components/MainComponents/LanguageSelectorModal.js.map +1 -1
  196. package/lib/module/components/MainComponents/MediaMessage.js +42 -19
  197. package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
  198. package/lib/module/components/MainComponents/MessageList.js +9 -3
  199. package/lib/module/components/MainComponents/MessageList.js.map +1 -1
  200. package/lib/module/components/MainComponents/RNStyled.js +12 -4
  201. package/lib/module/components/MainComponents/RNStyled.js.map +1 -1
  202. package/lib/module/components/MainComponents/ReduxWrapper.js +64 -10
  203. package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
  204. package/lib/module/components/MainComponents/RoomList.js +12 -9
  205. package/lib/module/components/MainComponents/RoomList.js.map +1 -1
  206. package/lib/module/components/MainComponents/Select.js +29 -8
  207. package/lib/module/components/MainComponents/Select.js.map +1 -1
  208. package/lib/module/components/Menu/HeaderRoomListMenu.js +24 -13
  209. package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
  210. package/lib/module/components/MessageBubble/BottomReplyContainer.js +24 -8
  211. package/lib/module/components/MessageBubble/BottomReplyContainer.js.map +1 -1
  212. package/lib/module/components/MessageBubble/Message.js +47 -25
  213. package/lib/module/components/MessageBubble/Message.js.map +1 -1
  214. package/lib/module/components/MessageBubble/MessageInteractions.js +15 -4
  215. package/lib/module/components/MessageBubble/MessageInteractions.js.map +1 -1
  216. package/lib/module/components/MessageBubble/MessageReaction.js +10 -5
  217. package/lib/module/components/MessageBubble/MessageReaction.js.map +1 -1
  218. package/lib/module/components/Modals/AddMembersModal/AddMembersModal.js +2 -6
  219. package/lib/module/components/Modals/AddMembersModal/AddMembersModal.js.map +1 -1
  220. package/lib/module/components/Modals/AttachSheet/AttachSheet.js +42 -27
  221. package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  222. package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +79 -26
  223. package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
  224. package/lib/module/components/Modals/ChatProfileModal/DeleteChatModal.js +6 -8
  225. package/lib/module/components/Modals/ChatProfileModal/DeleteChatModal.js.map +1 -1
  226. package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +18 -16
  227. package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -1
  228. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +20 -9
  229. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  230. package/lib/module/components/Modals/ModalHeaderComponent.js +8 -2
  231. package/lib/module/components/Modals/ModalHeaderComponent.js.map +1 -1
  232. package/lib/module/components/Modals/ModalWrapper/ModalWrapper.js +10 -10
  233. package/lib/module/components/Modals/ModalWrapper/ModalWrapper.js.map +1 -1
  234. package/lib/module/components/Modals/NewChatModal/ModalContent.js +2 -6
  235. package/lib/module/components/Modals/NewChatModal/ModalContent.js.map +1 -1
  236. package/lib/module/components/Modals/NewChatModal/NewChatModal.js +18 -15
  237. package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
  238. package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js +14 -9
  239. package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -1
  240. package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +4 -8
  241. package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
  242. package/lib/module/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js +8 -6
  243. package/lib/module/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js.map +1 -1
  244. package/lib/module/components/Modals/SettingsModals/Referrals/Referrals.js +7 -2
  245. package/lib/module/components/Modals/SettingsModals/Referrals/Referrals.js.map +1 -1
  246. package/lib/module/components/Modals/SettingsModals/SharedStyledComponents.js +7 -3
  247. package/lib/module/components/Modals/SettingsModals/SharedStyledComponents.js.map +1 -1
  248. package/lib/module/components/Modals/SettingsModals/Visibility/RadioInput.js +10 -6
  249. package/lib/module/components/Modals/SettingsModals/Visibility/RadioInput.js.map +1 -1
  250. package/lib/module/components/Modals/SettingsModals/Visibility/VisibilityModal.js +7 -6
  251. package/lib/module/components/Modals/SettingsModals/Visibility/VisibilityModal.js.map +1 -1
  252. package/lib/module/components/Modals/UserProfileModal/EditUserModal.js +3 -2
  253. package/lib/module/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
  254. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +18 -15
  255. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  256. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +148 -12
  257. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  258. package/lib/module/components/Modals/styledModalComponents.js +59 -15
  259. package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
  260. package/lib/module/components/RoomComponents/ChatRoomItem.js +16 -10
  261. package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
  262. package/lib/module/components/RoomComponents/styled/LastAudioMessage.js +6 -2
  263. package/lib/module/components/RoomComponents/styled/LastAudioMessage.js.map +1 -1
  264. package/lib/module/components/RoomComponents/styled/StyledRoomComponents.js +6 -0
  265. package/lib/module/components/RoomComponents/styled/StyledRoomComponents.js.map +1 -1
  266. package/lib/module/components/Thread/ThreadWrapper.js +9 -2
  267. package/lib/module/components/Thread/ThreadWrapper.js.map +1 -1
  268. package/lib/module/components/Toast/Toast.js +3 -1
  269. package/lib/module/components/Toast/Toast.js.map +1 -1
  270. package/lib/module/components/styled/AudioMessage.js +16 -11
  271. package/lib/module/components/styled/AudioMessage.js.map +1 -1
  272. package/lib/module/components/styled/Button.js +17 -9
  273. package/lib/module/components/styled/Button.js.map +1 -1
  274. package/lib/module/components/styled/DateLabel.js +8 -5
  275. package/lib/module/components/styled/DateLabel.js.map +1 -1
  276. package/lib/module/components/styled/MediaModal.js +29 -23
  277. package/lib/module/components/styled/MediaModal.js.map +1 -1
  278. package/lib/module/components/styled/RoomListComponents/index.js +62 -39
  279. package/lib/module/components/styled/RoomListComponents/index.js.map +1 -1
  280. package/lib/module/components/styled/SendInput.js +13 -8
  281. package/lib/module/components/styled/SendInput.js.map +1 -1
  282. package/lib/module/components/styled/StyledComponents.js +67 -23
  283. package/lib/module/components/styled/StyledComponents.js.map +1 -1
  284. package/lib/module/components/styled/StyledInput.js +32 -18
  285. package/lib/module/components/styled/StyledInput.js.map +1 -1
  286. package/lib/module/components/styled/StyledInputComponents/CustomTypingIndicator.js +13 -8
  287. package/lib/module/components/styled/StyledInputComponents/CustomTypingIndicator.js.map +1 -1
  288. package/lib/module/components/styled/StyledInputComponents/MediaComponents.js +20 -9
  289. package/lib/module/components/styled/StyledInputComponents/MediaComponents.js.map +1 -1
  290. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +39 -18
  291. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  292. package/lib/module/components/styled/TreadLabel.js +6 -3
  293. package/lib/module/components/styled/TreadLabel.js.map +1 -1
  294. package/lib/module/context/MessageNotificationContext.js +14 -3
  295. package/lib/module/context/MessageNotificationContext.js.map +1 -1
  296. package/lib/module/helpers/getChatBackground.js +5 -1
  297. package/lib/module/helpers/getChatBackground.js.map +1 -1
  298. package/lib/module/helpers/getDateLabelColor.js +4 -1
  299. package/lib/module/helpers/getDateLabelColor.js.map +1 -1
  300. package/lib/module/helpers/getIconColor.js +5 -1
  301. package/lib/module/helpers/getIconColor.js.map +1 -1
  302. package/lib/module/helpers/getSenderNameColor.js +4 -1
  303. package/lib/module/helpers/getSenderNameColor.js.map +1 -1
  304. package/lib/module/helpers/markdownParser.js +27 -5
  305. package/lib/module/helpers/markdownParser.js.map +1 -1
  306. package/lib/module/helpers/parseMessageBody.js +82 -24
  307. package/lib/module/helpers/parseMessageBody.js.map +1 -1
  308. package/lib/module/helpers/preferencesStorage.js +36 -0
  309. package/lib/module/helpers/preferencesStorage.js.map +1 -0
  310. package/lib/module/hooks/useCustomTypingIndicator.js +8 -3
  311. package/lib/module/hooks/useCustomTypingIndicator.js.map +1 -1
  312. package/lib/module/hooks/useLogout.js +10 -3
  313. package/lib/module/hooks/useLogout.js.map +1 -1
  314. package/lib/module/hooks/useTheme.js +30 -0
  315. package/lib/module/hooks/useTheme.js.map +1 -0
  316. package/lib/module/i18n/strings.js +60 -0
  317. package/lib/module/i18n/strings.js.map +1 -1
  318. package/lib/module/main.js +4 -0
  319. package/lib/module/main.js.map +1 -1
  320. package/lib/module/networking/api-requests/push.api.js +119 -45
  321. package/lib/module/networking/api-requests/push.api.js.map +1 -1
  322. package/lib/module/networking/api-requests/rooms.api.js +12 -0
  323. package/lib/module/networking/api-requests/rooms.api.js.map +1 -1
  324. package/lib/module/roomStore/chatSettingsSlice.js +14 -3
  325. package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
  326. package/lib/module/services/pushRegistration.js +250 -0
  327. package/lib/module/services/pushRegistration.js.map +1 -0
  328. package/lib/module/services/pushSubscriptionService.js +0 -24
  329. package/lib/module/services/pushSubscriptionService.js.map +1 -1
  330. package/lib/module/theme/index.js +7 -0
  331. package/lib/module/theme/index.js.map +1 -0
  332. package/lib/module/theme/styled.d.js +6 -0
  333. package/lib/module/theme/styled.d.js.map +1 -0
  334. package/lib/module/theme/theme.js +156 -0
  335. package/lib/module/theme/theme.js.map +1 -0
  336. package/lib/module/version.js +1 -1
  337. package/lib/typescript/assets/EmptyChatIllustration.d.ts +1 -0
  338. package/lib/typescript/assets/EmptyChatIllustration.d.ts.map +1 -1
  339. package/lib/typescript/assets/icons.d.ts +8 -0
  340. package/lib/typescript/assets/icons.d.ts.map +1 -1
  341. package/lib/typescript/components/AuthForms/Login.d.ts.map +1 -1
  342. package/lib/typescript/components/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  343. package/lib/typescript/components/ExampleComponents/CustomMessage.d.ts.map +1 -1
  344. package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
  345. package/lib/typescript/components/InputComponents/Search.d.ts.map +1 -1
  346. package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
  347. package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
  348. package/lib/typescript/components/MainComponents/ChatWrapper.d.ts.map +1 -1
  349. package/lib/typescript/components/MainComponents/LanguageSelectorModal.d.ts.map +1 -1
  350. package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
  351. package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
  352. package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts.map +1 -1
  353. package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
  354. package/lib/typescript/components/MainComponents/Select.d.ts.map +1 -1
  355. package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
  356. package/lib/typescript/components/MessageBubble/BottomReplyContainer.d.ts.map +1 -1
  357. package/lib/typescript/components/MessageBubble/Message.d.ts.map +1 -1
  358. package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts.map +1 -1
  359. package/lib/typescript/components/MessageBubble/MessageReaction.d.ts.map +1 -1
  360. package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
  361. package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
  362. package/lib/typescript/components/Modals/ChatProfileModal/DeleteChatModal.d.ts.map +1 -1
  363. package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +1 -1
  364. package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
  365. package/lib/typescript/components/Modals/ModalHeaderComponent.d.ts.map +1 -1
  366. package/lib/typescript/components/Modals/ModalWrapper/ModalWrapper.d.ts.map +1 -1
  367. package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts.map +1 -1
  368. package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts.map +1 -1
  369. package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts.map +1 -1
  370. package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts.map +1 -1
  371. package/lib/typescript/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.d.ts.map +1 -1
  372. package/lib/typescript/components/Modals/SettingsModals/Referrals/Referrals.d.ts.map +1 -1
  373. package/lib/typescript/components/Modals/SettingsModals/SharedStyledComponents.d.ts +2 -2
  374. package/lib/typescript/components/Modals/SettingsModals/SharedStyledComponents.d.ts.map +1 -1
  375. package/lib/typescript/components/Modals/SettingsModals/Visibility/RadioInput.d.ts.map +1 -1
  376. package/lib/typescript/components/Modals/SettingsModals/Visibility/VisibilityModal.d.ts.map +1 -1
  377. package/lib/typescript/components/Modals/UserProfileModal/EditUserModal.d.ts.map +1 -1
  378. package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
  379. package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
  380. package/lib/typescript/components/Modals/styledModalComponents.d.ts +2 -0
  381. package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
  382. package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
  383. package/lib/typescript/components/RoomComponents/styled/LastAudioMessage.d.ts.map +1 -1
  384. package/lib/typescript/components/RoomComponents/styled/StyledRoomComponents.d.ts.map +1 -1
  385. package/lib/typescript/components/Thread/ThreadWrapper.d.ts.map +1 -1
  386. package/lib/typescript/components/styled/AudioMessage.d.ts.map +1 -1
  387. package/lib/typescript/components/styled/Button.d.ts.map +1 -1
  388. package/lib/typescript/components/styled/DateLabel.d.ts.map +1 -1
  389. package/lib/typescript/components/styled/MediaModal.d.ts +2 -2
  390. package/lib/typescript/components/styled/MediaModal.d.ts.map +1 -1
  391. package/lib/typescript/components/styled/RoomListComponents/index.d.ts.map +1 -1
  392. package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
  393. package/lib/typescript/components/styled/StyledComponents.d.ts.map +1 -1
  394. package/lib/typescript/components/styled/StyledInput.d.ts.map +1 -1
  395. package/lib/typescript/components/styled/StyledInputComponents/MediaComponents.d.ts.map +1 -1
  396. package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
  397. package/lib/typescript/components/styled/TreadLabel.d.ts.map +1 -1
  398. package/lib/typescript/context/MessageNotificationContext.d.ts.map +1 -1
  399. package/lib/typescript/helpers/getAvatarColor.d.ts +1 -1
  400. package/lib/typescript/helpers/getChatBackground.d.ts.map +1 -1
  401. package/lib/typescript/helpers/getDateLabelColor.d.ts +3 -7
  402. package/lib/typescript/helpers/getDateLabelColor.d.ts.map +1 -1
  403. package/lib/typescript/helpers/getIconColor.d.ts +4 -7
  404. package/lib/typescript/helpers/getIconColor.d.ts.map +1 -1
  405. package/lib/typescript/helpers/getSenderNameColor.d.ts +3 -7
  406. package/lib/typescript/helpers/getSenderNameColor.d.ts.map +1 -1
  407. package/lib/typescript/helpers/markdownParser.d.ts +8 -1
  408. package/lib/typescript/helpers/markdownParser.d.ts.map +1 -1
  409. package/lib/typescript/helpers/parseMessageBody.d.ts +8 -1
  410. package/lib/typescript/helpers/parseMessageBody.d.ts.map +1 -1
  411. package/lib/typescript/helpers/preferencesStorage.d.ts +11 -0
  412. package/lib/typescript/helpers/preferencesStorage.d.ts.map +1 -0
  413. package/lib/typescript/hooks/useCustomTypingIndicator.d.ts +2 -0
  414. package/lib/typescript/hooks/useCustomTypingIndicator.d.ts.map +1 -1
  415. package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
  416. package/lib/typescript/hooks/useTheme.d.ts +16 -0
  417. package/lib/typescript/hooks/useTheme.d.ts.map +1 -0
  418. package/lib/typescript/i18n/strings.d.ts.map +1 -1
  419. package/lib/typescript/main.d.ts +9 -0
  420. package/lib/typescript/main.d.ts.map +1 -1
  421. package/lib/typescript/networking/api-requests/push.api.d.ts +46 -3
  422. package/lib/typescript/networking/api-requests/push.api.d.ts.map +1 -1
  423. package/lib/typescript/networking/api-requests/rooms.api.d.ts +1 -0
  424. package/lib/typescript/networking/api-requests/rooms.api.d.ts.map +1 -1
  425. package/lib/typescript/roomStore/chatSettingsSlice.d.ts +12 -1
  426. package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
  427. package/lib/typescript/services/pushRegistration.d.ts +21 -0
  428. package/lib/typescript/services/pushRegistration.d.ts.map +1 -0
  429. package/lib/typescript/services/pushSubscriptionService.d.ts +0 -4
  430. package/lib/typescript/services/pushSubscriptionService.d.ts.map +1 -1
  431. package/lib/typescript/theme/index.d.ts +5 -0
  432. package/lib/typescript/theme/index.d.ts.map +1 -0
  433. package/lib/typescript/theme/theme.d.ts +127 -0
  434. package/lib/typescript/theme/theme.d.ts.map +1 -0
  435. package/lib/typescript/types/models/room.model.d.ts +1 -0
  436. package/lib/typescript/types/models/room.model.d.ts.map +1 -1
  437. package/lib/typescript/types/types.d.ts +42 -0
  438. package/lib/typescript/types/types.d.ts.map +1 -1
  439. package/lib/typescript/version.d.ts +1 -1
  440. package/package.json +2 -2
  441. package/src/assets/EmptyChatIllustration.tsx +7 -5
  442. package/src/assets/icons.tsx +24 -0
  443. package/src/components/AuthForms/Login.tsx +11 -9
  444. package/src/components/ContextMenu/ContextMenuComponents.tsx +4 -4
  445. package/src/components/DropdownMenu/DropdownMenu.tsx +14 -6
  446. package/src/components/ExampleComponents/CustomMessage.tsx +9 -8
  447. package/src/components/ExampleComponents/CustomTypingIndicatorExamples.tsx +6 -6
  448. package/src/components/Header/HeaderRoomList.tsx +11 -6
  449. package/src/components/InputComponents/Search.tsx +7 -4
  450. package/src/components/MainComponents/ChatHeader.tsx +9 -3
  451. package/src/components/MainComponents/ChatRoom.tsx +5 -2
  452. package/src/components/MainComponents/ChatWrapper.tsx +8 -6
  453. package/src/components/MainComponents/LanguageSelectorModal.tsx +33 -7
  454. package/src/components/MainComponents/MediaMessage.tsx +37 -18
  455. package/src/components/MainComponents/MessageList.tsx +13 -3
  456. package/src/components/MainComponents/RNStyled.tsx +4 -4
  457. package/src/components/MainComponents/ReduxWrapper.tsx +67 -10
  458. package/src/components/MainComponents/RoomList.tsx +13 -7
  459. package/src/components/MainComponents/Select.tsx +13 -8
  460. package/src/components/Menu/HeaderRoomListMenu.tsx +30 -13
  461. package/src/components/MessageBubble/BottomReplyContainer.tsx +16 -11
  462. package/src/components/MessageBubble/Message.tsx +48 -25
  463. package/src/components/MessageBubble/MessageInteractions.tsx +17 -4
  464. package/src/components/MessageBubble/MessageReaction.tsx +9 -4
  465. package/src/components/Modals/AddMembersModal/AddMembersModal.tsx +2 -2
  466. package/src/components/Modals/AttachSheet/AttachSheet.tsx +57 -23
  467. package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +63 -25
  468. package/src/components/Modals/ChatProfileModal/DeleteChatModal.tsx +6 -4
  469. package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +18 -14
  470. package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +14 -9
  471. package/src/components/Modals/ModalHeaderComponent.tsx +9 -2
  472. package/src/components/Modals/ModalWrapper/ModalWrapper.tsx +14 -6
  473. package/src/components/Modals/NewChatModal/ModalContent.tsx +2 -2
  474. package/src/components/Modals/NewChatModal/NewChatModal.tsx +19 -15
  475. package/src/components/Modals/ProfileHeader/ProfileMenu.tsx +15 -8
  476. package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +2 -3
  477. package/src/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.tsx +8 -6
  478. package/src/components/Modals/SettingsModals/Referrals/Referrals.tsx +5 -3
  479. package/src/components/Modals/SettingsModals/SharedStyledComponents.ts +4 -4
  480. package/src/components/Modals/SettingsModals/Visibility/RadioInput.tsx +9 -5
  481. package/src/components/Modals/SettingsModals/Visibility/VisibilityModal.tsx +7 -7
  482. package/src/components/Modals/UserProfileModal/EditUserModal.tsx +3 -1
  483. package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +19 -15
  484. package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +171 -9
  485. package/src/components/Modals/styledModalComponents.tsx +23 -15
  486. package/src/components/RoomComponents/ChatRoomItem.tsx +19 -10
  487. package/src/components/RoomComponents/styled/LastAudioMessage.tsx +4 -2
  488. package/src/components/RoomComponents/styled/StyledRoomComponents.ts +2 -0
  489. package/src/components/Thread/ThreadWrapper.tsx +6 -5
  490. package/src/components/Toast/Toast.tsx +1 -1
  491. package/src/components/styled/AudioMessage.tsx +12 -9
  492. package/src/components/styled/Button.tsx +15 -8
  493. package/src/components/styled/DateLabel.tsx +7 -3
  494. package/src/components/styled/MediaModal.tsx +30 -25
  495. package/src/components/styled/RoomListComponents/index.tsx +60 -35
  496. package/src/components/styled/SendInput.tsx +23 -8
  497. package/src/components/styled/StyledComponents.ts +30 -23
  498. package/src/components/styled/StyledInput.tsx +35 -21
  499. package/src/components/styled/StyledInputComponents/CustomTypingIndicator.tsx +8 -8
  500. package/src/components/styled/StyledInputComponents/MediaComponents.tsx +20 -7
  501. package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +15 -19
  502. package/src/components/styled/TreadLabel.tsx +9 -3
  503. package/src/context/MessageNotificationContext.tsx +18 -4
  504. package/src/helpers/getChatBackground.ts +3 -1
  505. package/src/helpers/getDateLabelColor.ts +5 -3
  506. package/src/helpers/getIconColor.ts +6 -3
  507. package/src/helpers/getSenderNameColor.ts +5 -3
  508. package/src/helpers/markdownParser.tsx +29 -5
  509. package/src/helpers/parseMessageBody.tsx +79 -26
  510. package/src/helpers/preferencesStorage.ts +40 -0
  511. package/src/hooks/useCustomTypingIndicator.tsx +7 -3
  512. package/src/hooks/useLogout.tsx +10 -3
  513. package/src/hooks/useTheme.ts +41 -0
  514. package/src/i18n/strings.ts +60 -0
  515. package/src/main.ts +33 -0
  516. package/src/networking/api-requests/push.api.ts +185 -62
  517. package/src/networking/api-requests/rooms.api.ts +9 -0
  518. package/src/roomStore/chatSettingsSlice.ts +24 -2
  519. package/src/services/pushRegistration.ts +369 -0
  520. package/src/services/pushSubscriptionService.ts +0 -34
  521. package/src/theme/index.ts +10 -0
  522. package/src/theme/styled.d.ts +9 -0
  523. package/src/theme/theme.ts +277 -0
  524. package/src/types/models/room.model.ts +1 -0
  525. package/src/types/types.ts +47 -0
  526. package/src/version.ts +1 -1
  527. package/lib/commonjs/context/PushNotificationProvider.js +0 -79
  528. package/lib/commonjs/context/PushNotificationProvider.js.map +0 -1
  529. package/lib/commonjs/hooks/usePushNotifications.js +0 -110
  530. package/lib/commonjs/hooks/usePushNotifications.js.map +0 -1
  531. package/lib/commonjs/services/pushNotifications.js +0 -143
  532. package/lib/commonjs/services/pushNotifications.js.map +0 -1
  533. package/lib/module/context/PushNotificationProvider.js +0 -79
  534. package/lib/module/context/PushNotificationProvider.js.map +0 -1
  535. package/lib/module/hooks/usePushNotifications.js +0 -106
  536. package/lib/module/hooks/usePushNotifications.js.map +0 -1
  537. package/lib/module/services/pushNotifications.js +0 -130
  538. package/lib/module/services/pushNotifications.js.map +0 -1
  539. package/lib/typescript/context/PushNotificationProvider.d.ts +0 -2
  540. package/lib/typescript/context/PushNotificationProvider.d.ts.map +0 -1
  541. package/lib/typescript/hooks/usePushNotifications.d.ts +0 -5
  542. package/lib/typescript/hooks/usePushNotifications.d.ts.map +0 -1
  543. package/lib/typescript/services/pushNotifications.d.ts +0 -10
  544. package/lib/typescript/services/pushNotifications.d.ts.map +0 -1
  545. package/src/context/PushNotificationProvider.tsx +0 -78
  546. package/src/hooks/usePushNotifications.ts +0 -131
  547. package/src/services/pushNotifications.ts +0 -170
@@ -0,0 +1,261 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.installPushTokenHook = exports.getRegisteredPushTokens = exports.getRegisteredPushToken = exports.__resetPushRegistrationForTests = void 0;
7
+ exports.registerPushToken = registerPushToken;
8
+ exports.releasePushRegistration = releasePushRegistration;
9
+ exports.unregisterPushToken = unregisterPushToken;
10
+ var _roomStore = require("../roomStore");
11
+ var _push = require("../networking/api-requests/push.api");
12
+ var _devLogger = require("../utils/devLogger");
13
+ const slotOf = tokenType => tokenType === 'apns-voip' ? 'voip' : 'chat';
14
+ const SLOTS = ['chat', 'voip'];
15
+ const HOOK_RETRY_MS = 30_000;
16
+ const held = new Map();
17
+ const registered = new Map();
18
+ let inflight = null;
19
+ let unwatch = null;
20
+ let hookIdentity = null;
21
+ let hookFailedAt = 0;
22
+ const readSession = () => {
23
+ const slice = _roomStore.store.getState().chatSettingStore;
24
+ const user = slice?.user;
25
+ const config = slice?.config;
26
+ return {
27
+ authToken: String(user?.token || ''),
28
+ appId: String(config?.appId || user?.appId || '').trim(),
29
+ xmppUsername: String(user?.xmppUsername || ''),
30
+ projectName: String(config?.projectName || '').trim(),
31
+ gatewayUrl: String(config?.pushNotifications?.apiUrl || '').trim(),
32
+ // Off by config (host) or by the user's Settings toggle.
33
+ pushDisabled: config?.pushNotifications?.enabled === false || slice?.pushEnabled === false
34
+ };
35
+ };
36
+ const isGateway = session => !!session.gatewayUrl;
37
+ const isReady = session => !!session.authToken && (isGateway(session) ? !!session.xmppUsername && !!session.projectName : !!session.appId);
38
+ const sameRegistration = (token, current, session) => !!current && current.token === token.token && current.tokenType === token.tokenType && current.gateway === isGateway(session) && current.appId === session.appId && current.xmppUsername === session.xmppUsername;
39
+ const slotsNeedingRegistration = session => SLOTS.filter(slot => {
40
+ const token = held.get(slot);
41
+ return !!token && !sameRegistration(token, registered.get(slot), session);
42
+ });
43
+ const releaseOnServer = async (current, authToken) => {
44
+ if (current.gateway || !authToken) {
45
+ return;
46
+ }
47
+ await (0, _push.unregisterPushSubscription)({
48
+ appId: current.appId,
49
+ token: current.token,
50
+ authToken
51
+ });
52
+ };
53
+ const registerOne = async (token, session) => {
54
+ if (isGateway(session)) {
55
+ if (!session.projectName) {
56
+ throw new _push.PushRegistrationError('registerPushToken: config.projectName is required when ' + 'pushNotifications.apiUrl points at a push gateway.');
57
+ }
58
+ await (0, _push.subscribeToPushGateway)({
59
+ apiUrl: session.gatewayUrl,
60
+ token: token.token,
61
+ userJid: session.xmppUsername,
62
+ projectName: session.projectName,
63
+ authToken: session.authToken
64
+ });
65
+ } else {
66
+ if (!session.appId) {
67
+ throw new _push.PushRegistrationError('registerPushToken: an app id is required — set config.appId ' + 'or sign in with a user that carries one.');
68
+ }
69
+ await (0, _push.registerPushSubscription)({
70
+ appId: session.appId,
71
+ token: token.token,
72
+ tokenType: token.tokenType,
73
+ authToken: session.authToken
74
+ });
75
+ }
76
+ registered.set(slotOf(token.tokenType), {
77
+ ...token,
78
+ appId: session.appId,
79
+ xmppUsername: session.xmppUsername,
80
+ gateway: isGateway(session)
81
+ });
82
+ (0, _devLogger.pushLog)('rn', `push: ${token.tokenType} token registered` + (isGateway(session) ? ' (gateway)' : ` for app ${session.appId}`));
83
+ };
84
+ const registerNow = () => {
85
+ if (inflight) {
86
+ return inflight;
87
+ }
88
+ inflight = (async () => {
89
+ const session = readSession();
90
+ if (session.pushDisabled || !session.authToken) {
91
+ return;
92
+ }
93
+ if (isGateway(session) && !session.xmppUsername) {
94
+ return;
95
+ }
96
+ for (const slot of slotsNeedingRegistration(session)) {
97
+ const token = held.get(slot);
98
+ const previous = registered.get(slot);
99
+ if (previous && previous.xmppUsername === session.xmppUsername) {
100
+ registered.delete(slot);
101
+ await releaseOnServer(previous, session.authToken).catch(error => (0, _devLogger.pushLog)('warn', 'push: releasing the replaced token failed', error));
102
+ }
103
+ await registerOne(token, session);
104
+ }
105
+ })().finally(() => {
106
+ inflight = null;
107
+ });
108
+ return inflight;
109
+ };
110
+ const runTokenHook = session => {
111
+ const hook = _roomStore.store.getState().chatSettingStore?.config?.pushNotifications?.getPushTokens;
112
+ const identity = session.xmppUsername || session.appId;
113
+ if (!hook || !identity || hookIdentity === identity) {
114
+ return;
115
+ }
116
+ if (Date.now() - hookFailedAt < HOOK_RETRY_MS) {
117
+ return;
118
+ }
119
+ hookIdentity = identity;
120
+ (async () => {
121
+ const result = await hook();
122
+ const list = Array.isArray(result) ? result : result ? [result] : [];
123
+ for (const entry of list) {
124
+ if (typeof entry?.token !== 'string' || !entry.token.trim()) {
125
+ continue;
126
+ }
127
+ hold(entry.token.trim(), entry.tokenType);
128
+ }
129
+ await registerNow();
130
+ })().catch(error => {
131
+ hookIdentity = null;
132
+ hookFailedAt = Date.now();
133
+ (0, _devLogger.pushLog)('warn', 'push: getPushTokens failed; will retry', error);
134
+ });
135
+ };
136
+ const hold = (token, tokenType) => {
137
+ const resolved = tokenType ?? (0, _push.detectPushTokenType)(token);
138
+ const entry = {
139
+ token,
140
+ tokenType: resolved
141
+ };
142
+ held.set(slotOf(resolved), entry);
143
+ return entry;
144
+ };
145
+ const ensureWatching = () => {
146
+ if (unwatch) {
147
+ return;
148
+ }
149
+ unwatch = _roomStore.store.subscribe(() => {
150
+ const session = readSession();
151
+ if (!session.authToken) {
152
+ hookIdentity = null;
153
+ return;
154
+ }
155
+ if (session.pushDisabled) {
156
+ // Switched off (Settings toggle or config): take the device off the
157
+ // backend but keep the tokens, so switching back on re-registers
158
+ // without the host doing anything. `registered` empties at once,
159
+ // so later store updates do not repeat the release.
160
+ if (registered.size > 0) {
161
+ releasePushRegistration().catch(() => undefined);
162
+ }
163
+ return;
164
+ }
165
+ if (!isReady(session)) {
166
+ return;
167
+ }
168
+ runTokenHook(session);
169
+ if (slotsNeedingRegistration(session).length === 0) {
170
+ return;
171
+ }
172
+ registerNow().catch(error => {
173
+ (0, _devLogger.pushLog)('warn', 'push: deferred token registration failed', error);
174
+ });
175
+ });
176
+ };
177
+ const installPushTokenHook = () => {
178
+ ensureWatching();
179
+ const session = readSession();
180
+ if (session.authToken && !session.pushDisabled && isReady(session)) {
181
+ runTokenHook(session);
182
+ }
183
+ };
184
+ exports.installPushTokenHook = installPushTokenHook;
185
+ async function registerPushToken(token, options) {
186
+ if (typeof token !== 'string' || !token.trim()) {
187
+ throw new TypeError('registerPushToken: token must be a non-empty string');
188
+ }
189
+ hold(token.trim(), options?.tokenType);
190
+ ensureWatching();
191
+ const session = readSession();
192
+ if (session.pushDisabled) {
193
+ return 'disabled';
194
+ }
195
+ if (!session.authToken || isGateway(session) && !session.xmppUsername) {
196
+ return 'deferred';
197
+ }
198
+ await registerNow();
199
+ return 'registered';
200
+ }
201
+ async function releasePushRegistration() {
202
+ const current = Array.from(registered.values());
203
+ registered.clear();
204
+ hookIdentity = null;
205
+ const session = readSession();
206
+ if (!current.length || !session.authToken) {
207
+ return;
208
+ }
209
+ await Promise.all(current.map(entry => releaseOnServer(entry, session.authToken).then(() => (0, _devLogger.pushLog)('rn', `push: ${entry.tokenType} token released for app ${entry.appId}`)).catch(error => (0, _devLogger.pushLog)('warn', 'push: releasing the token on logout failed', error))));
210
+ }
211
+ async function unregisterPushToken(options) {
212
+ const slots = options?.tokenType ? [slotOf(options.tokenType)] : SLOTS;
213
+ const toRelease = [];
214
+ for (const slot of slots) {
215
+ held.delete(slot);
216
+ const current = registered.get(slot);
217
+ if (current) {
218
+ registered.delete(slot);
219
+ toRelease.push(current);
220
+ }
221
+ }
222
+ const session = readSession();
223
+ const removable = toRelease.filter(entry => !entry.gateway);
224
+ if (!removable.length) {
225
+ return 'forgotten';
226
+ }
227
+ if (!session.authToken) {
228
+ (0, _devLogger.pushLog)('warn', 'push: unregisterPushToken called without a session; the backend still holds the token');
229
+ return 'forgotten';
230
+ }
231
+ const results = await Promise.allSettled(removable.map(entry => releaseOnServer(entry, session.authToken)));
232
+ const failure = results.find(r => r.status === 'rejected');
233
+ if (failure) {
234
+ throw failure.reason;
235
+ }
236
+ return 'unregistered';
237
+ }
238
+ const getRegisteredPushToken = () => {
239
+ const chat = held.get('chat');
240
+ return chat ? {
241
+ ...chat
242
+ } : null;
243
+ };
244
+ exports.getRegisteredPushToken = getRegisteredPushToken;
245
+ const getRegisteredPushTokens = () => SLOTS.map(slot => held.get(slot)).filter(t => !!t).map(t => ({
246
+ ...t
247
+ }));
248
+ exports.getRegisteredPushTokens = getRegisteredPushTokens;
249
+ const __resetPushRegistrationForTests = () => {
250
+ held.clear();
251
+ registered.clear();
252
+ inflight = null;
253
+ hookIdentity = null;
254
+ hookFailedAt = 0;
255
+ if (unwatch) {
256
+ unwatch();
257
+ unwatch = null;
258
+ }
259
+ };
260
+ exports.__resetPushRegistrationForTests = __resetPushRegistrationForTests;
261
+ //# sourceMappingURL=pushRegistration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_roomStore","require","_push","_devLogger","slotOf","tokenType","SLOTS","HOOK_RETRY_MS","held","Map","registered","inflight","unwatch","hookIdentity","hookFailedAt","readSession","slice","store","getState","chatSettingStore","user","config","authToken","String","token","appId","trim","xmppUsername","projectName","gatewayUrl","pushNotifications","apiUrl","pushDisabled","enabled","pushEnabled","isGateway","session","isReady","sameRegistration","current","gateway","slotsNeedingRegistration","filter","slot","get","releaseOnServer","unregisterPushSubscription","registerOne","PushRegistrationError","subscribeToPushGateway","userJid","registerPushSubscription","set","pushLog","registerNow","previous","delete","catch","error","finally","runTokenHook","hook","getPushTokens","identity","Date","now","result","list","Array","isArray","entry","hold","resolved","detectPushTokenType","ensureWatching","subscribe","size","releasePushRegistration","undefined","length","installPushTokenHook","exports","registerPushToken","options","TypeError","from","values","clear","Promise","all","map","then","unregisterPushToken","slots","toRelease","push","removable","results","allSettled","failure","find","r","status","reason","getRegisteredPushToken","chat","getRegisteredPushTokens","t","__resetPushRegistrationForTests"],"sourceRoot":"../../../src","sources":["services/pushRegistration.ts"],"mappings":";;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAQA,IAAAE,UAAA,GAAAF,OAAA;AAyBA,MAAMG,MAAM,GAAIC,SAAwB,IACtCA,SAAS,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM;AAC7C,MAAMC,KAAa,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;AAiBtC,MAAMC,aAAa,GAAG,MAAM;AAE5B,MAAMC,IAAI,GAAG,IAAIC,GAAG,CAA4B,CAAC;AACjD,MAAMC,UAAU,GAAG,IAAID,GAAG,CAA2B,CAAC;AACtD,IAAIE,QAA8B,GAAG,IAAI;AACzC,IAAIC,OAA4B,GAAG,IAAI;AACvC,IAAIC,YAA2B,GAAG,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AAC,KAAM;EAAE,GAAGA;AAAE,CAAC,CAAC,CAAC;AAAC1B,OAAA,CAAAyB,uBAAA,GAAAA,uBAAA;AAErB,MAAME,+BAA+B,GAAGA,CAAA,KAAY;EACzDpG,IAAI,CAAC+E,KAAK,CAAC,CAAC;EACZ7E,UAAU,CAAC6E,KAAK,CAAC,CAAC;EAClB5E,QAAQ,GAAG,IAAI;EACfE,YAAY,GAAG,IAAI;EACnBC,YAAY,GAAG,CAAC;EAChB,IAAIF,OAAO,EAAE;IACXA,OAAO,CAAC,CAAC;IACTA,OAAO,GAAG,IAAI;EAChB;AACF,CAAC;AAACqE,OAAA,CAAA2B,+BAAA,GAAAA,+BAAA","ignoreList":[]}
@@ -5,14 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.pushSubscriptionService = exports.PushSubscriptionService = void 0;
7
7
  var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
8
- var _push = require("../networking/api-requests/push.api");
9
8
  var _subscribeToRoomMessages = require("../networking/xmpp/subscribeToRoomMessages.xmpp");
10
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
10
  const SUBSCRIBED_ROOMS_KEY = 'ethora_subscribed_rooms';
12
11
  class PushSubscriptionService {
13
12
  subscribedRooms = new Set();
14
- isPushSubscribed = false;
15
- lastSubscriptionKey = null;
16
13
  isInitialized = false;
17
14
  async loadSubscribedRoomsFromStorage() {
18
15
  if (this.isInitialized) {
@@ -37,25 +34,6 @@ class PushSubscriptionService {
37
34
  console.error('[PushService] Failed to save subscribed rooms to storage:', error);
38
35
  }
39
36
  }
40
- async subscribeToPush(fcmToken, user, projectName) {
41
- const walletAddress = user.defaultWallet?.walletAddress || user.walletAddress;
42
- const subscriptionKey = `${fcmToken}_${walletAddress}`;
43
- if (this.isPushSubscribed && this.lastSubscriptionKey === subscriptionKey) {
44
- console.log('⚠️ Push already subscribed with this token, skipping...');
45
- return;
46
- }
47
- try {
48
- const userJid = user.xmppUsername || '';
49
- if (!userJid) {
50
- throw new Error('User JID is required for push subscription');
51
- }
52
- await (0, _push.subscribeToPushNotifications)(fcmToken, userJid, projectName);
53
- this.isPushSubscribed = true;
54
- this.lastSubscriptionKey = subscriptionKey;
55
- } catch (error) {
56
- console.error('Failed to subscribe to push after all retries:', error);
57
- }
58
- }
59
37
  async subscribeToRoom(client, roomJID, userNick) {
60
38
  await this.loadSubscribedRoomsFromStorage();
61
39
  if (this.subscribedRooms.has(roomJID)) {
@@ -99,8 +77,6 @@ class PushSubscriptionService {
99
77
  }
100
78
  async reset() {
101
79
  this.subscribedRooms.clear();
102
- this.isPushSubscribed = false;
103
- this.lastSubscriptionKey = null;
104
80
  this.isInitialized = false;
105
81
  try {
106
82
  await _asyncStorage.default.removeItem(SUBSCRIBED_ROOMS_KEY);
@@ -1 +1 @@
1
- {"version":3,"names":["_asyncStorage","_interopRequireDefault","require","_push","_subscribeToRoomMessages","e","__esModule","default","SUBSCRIBED_ROOMS_KEY","PushSubscriptionService","subscribedRooms","Set","isPushSubscribed","lastSubscriptionKey","isInitialized","loadSubscribedRoomsFromStorage","storedRooms","AsyncStorage","getItem","roomsArray","JSON","parse","error","console","saveSubscribedRoomsToStorage","Array","from","setItem","stringify","subscribeToPush","fcmToken","user","projectName","walletAddress","defaultWallet","subscriptionKey","log","userJid","xmppUsername","Error","subscribeToPushNotifications","subscribeToRoom","client","roomJID","userNick","has","result","subscribeToRoomMessages","add","warn","subscribeToRooms","roomJIDs","concurrency","successful","failed","pending","filter","jid","length","i","batch","slice","results","Promise","allSettled","map","r","status","value","reset","clear","removeItem","isRoomSubscribed","getSubscribedRooms","exports","pushSubscriptionService"],"sourceRoot":"../../../src","sources":["services/pushSubscriptionService.ts"],"mappings":";;;;;;AAEA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,wBAAA,GAAAF,OAAA;AAA0F,SAAAD,uBAAAI,CAAA,WA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IAAI,CAACC,mBAAmB,GAAG,IAAI;IAC/B,IAAI,CAACC,aAAa,GAAG,KAAK;IAE1B,IAAI;MACF,MAAMG,qBAAY,CAACsD,UAAU,CAAC/D,oBAAoB,CAAC;MACnDe,OAAO,CAACa,GAAG,CAAC,qDAAqD,CAAC;IACpE,CAAC,CAAC,OAAOd,KAAK,EAAE;MACdC,OAAO,CAACD,KAAK,CAAC,8DAA8D,EAAEA,KAAK,CAAC;IACtF;EACF;EAEAkD,gBAAgBA,CAAC7B,OAAe,EAAW;IACzC,OAAO,IAAI,CAACjC,eAAe,CAACmC,GAAG,CAACF,OAAO,CAAC;EAC1C;EAEA8B,kBAAkBA,CAAA,EAAa;IAC7B,OAAOhD,KAAK,CAACC,IAAI,CAAC,IAAI,CAAChB,eAAe,CAAC;EACzC;AACF;AAACgE,OAAA,CAAAjE,uBAAA,GAAAA,uBAAA;AAEM,MAAMkE,uBAAuB,GAAAD,OAAA,CAAAC,uBAAA,GAAG,IAAIlE,uBAAuB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_asyncStorage","_interopRequireDefault","require","_subscribeToRoomMessages","e","__esModule","default","SUBSCRIBED_ROOMS_KEY","PushSubscriptionService","subscribedRooms","Set","isInitialized","loadSubscribedRoomsFromStorage","storedRooms","AsyncStorage","getItem","roomsArray","JSON","parse","error","console","saveSubscribedRoomsToStorage","Array","from","setItem","stringify","subscribeToRoom","client","roomJID","userNick","has","result","subscribeToRoomMessages","add","warn","subscribeToRooms","roomJIDs","concurrency","successful","failed","pending","filter","jid","length","i","batch","slice","results","Promise","allSettled","map","r","status","value","log","reset","clear","removeItem","isRoomSubscribed","getSubscribedRooms","exports","pushSubscriptionService"],"sourceRoot":"../../../src","sources":["services/pushSubscriptionService.ts"],"mappings":";;;;;;AACA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAD,OAAA;AAA0F,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,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,IAAIJ,OAAO,EAAE;QACvB,IAAII,CAAC,CAACC,MAAM,KAAK,WAAW,IAAID,CAAC,CAACE,KAAK,EAAE;UACvCf,UAAU,EAAE;QACd,CAAC,MAAM;UACLC,MAAM,EAAE;QACV;MACF;IACF;IAEAnB,OAAO,CAACkC,GAAG,CAAC,yBAAyBhB,UAAU,sBAAsBC,MAAM,SAAS,CAAC;EACvF;EAEA,MAAMgB,KAAKA,CAAA,EAAkB;IAC3B,IAAI,CAAC9C,eAAe,CAAC+C,KAAK,CAAC,CAAC;IAC5B,IAAI,CAAC7C,aAAa,GAAG,KAAK;IAE1B,IAAI;MACF,MAAMG,qBAAY,CAAC2C,UAAU,CAAClD,oBAAoB,CAAC;MACnDa,OAAO,CAACkC,GAAG,CAAC,qDAAqD,CAAC;IACpE,CAAC,CAAC,OAAOnC,KAAK,EAAE;MACdC,OAAO,CAACD,KAAK,CAAC,8DAA8D,EAAEA,KAAK,CAAC;IACtF;EACF;EAEAuC,gBAAgBA,CAAC9B,OAAe,EAAW;IACzC,OAAO,IAAI,CAACnB,eAAe,CAACqB,GAAG,CAACF,OAAO,CAAC;EAC1C;EAEA+B,kBAAkBA,CAAA,EAAa;IAC7B,OAAOrC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACd,eAAe,CAAC;EACzC;AACF;AAACmD,OAAA,CAAApD,uBAAA,GAAAA,uBAAA;AAEM,MAAMqD,uBAAuB,GAAAD,OAAA,CAAAC,uBAAA,GAAG,IAAIrD,uBAAuB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "DARK_THEME", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _theme.DARK_THEME;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "LIGHT_THEME", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _theme.LIGHT_THEME;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "isDarkTheme", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _theme.isDarkTheme;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "resolveTheme", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _theme.resolveTheme;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "useTheme", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _useTheme.useTheme;
34
+ }
35
+ });
36
+ var _theme = require("./theme");
37
+ var _useTheme = require("../hooks/useTheme");
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_theme","require","_useTheme"],"sourceRoot":"../../../src","sources":["theme/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AAOA,IAAAC,SAAA,GAAAD,OAAA","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ require("styled-components/native");
4
+ //# sourceMappingURL=styled.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["require"],"sourceRoot":"../../../src","sources":["theme/styled.d.ts"],"mappings":";;AAEAA,OAAA","ignoreList":[]}
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.resolveTheme = exports.isDarkTheme = exports.applyThemePreference = exports.LIGHT_THEME = exports.DARK_THEME = void 0;
7
+ var _reactNative = require("react-native");
8
+ /** @format */
9
+
10
+ /**
11
+ * Chat theme.
12
+ *
13
+ * One palette object drives every surface, text and accent colour in the
14
+ * component. The light palette is the historical look (all the previously
15
+ * hard-coded values live here now). The dark palette is enabled by
16
+ * `config.dark = true`; any of its entries can be overridden through
17
+ * `config.darkColors`, and anything not overridden falls back to the
18
+ * DARK_THEME default.
19
+ *
20
+ * Resolution order:
21
+ * light: LIGHT_THEME ← config.colors (primary/secondary/icon…) ← messageColor ← backgroundChat.color
22
+ * dark: DARK_THEME ← config.darkColors
23
+ *
24
+ * In dark mode the light-only knobs (`colors`, `messageColor`,
25
+ * `backgroundChat.color`) are deliberately NOT applied: they were tuned
26
+ * against white surfaces and would produce unreadable bubbles on a dark
27
+ * ground. Hosts that want brand colours in the dark theme pass them via
28
+ * `darkColors`. `colors.avatar` is the one exception — it is a brand
29
+ * colour that reads fine on either ground — see getAvatarColor.
30
+ */
31
+
32
+ /** Everything in the palette can be overridden per entry. */
33
+
34
+ const DEFAULT_PRIMARY = '#0052CD';
35
+ const LIGHT_THEME = exports.LIGHT_THEME = {
36
+ primary: DEFAULT_PRIMARY,
37
+ secondary: '#141414',
38
+ icon: DEFAULT_PRIMARY,
39
+ senderName: DEFAULT_PRIMARY,
40
+ dateLabel: DEFAULT_PRIMARY,
41
+ listBackground: '#E8EDF2',
42
+ chatBackground: '#F3F6FC',
43
+ surface: '#FFFFFF',
44
+ surfaceSecondary: '#F5F7F9',
45
+ surfaceHighlight: '#0052CD0D',
46
+ text: '#141414',
47
+ textSecondary: '#8C8C8C',
48
+ textMuted: '#999999',
49
+ textOnPrimary: '#FFFFFF',
50
+ border: '#E5E7EB',
51
+ divider: '#C6CFDA',
52
+ shadow: '#101828',
53
+ overlay: 'rgba(0, 0, 0, 0.3)',
54
+ messageBackground: '#FFFFFF',
55
+ messageBackgroundUser: '#D1E7FF',
56
+ messageText: '#333333',
57
+ messageTextUser: '#333333',
58
+ systemMessageBackground: '#F5F5F5',
59
+ danger: '#E53935',
60
+ success: '#22C55E'
61
+ };
62
+ const DARK_THEME = exports.DARK_THEME = {
63
+ primary: '#4C8DFF',
64
+ secondary: '#F2F4F7',
65
+ icon: '#4C8DFF',
66
+ senderName: '#7FB0FF',
67
+ dateLabel: '#7FB0FF',
68
+ listBackground: '#0F1216',
69
+ chatBackground: '#141A21',
70
+ surface: '#1C2430',
71
+ surfaceSecondary: '#26303D',
72
+ surfaceHighlight: '#4C8DFF26',
73
+ text: '#F2F4F7',
74
+ textSecondary: '#A0A8B3',
75
+ textMuted: '#7A8391',
76
+ textOnPrimary: '#FFFFFF',
77
+ border: '#2F3A47',
78
+ divider: '#2F3A47',
79
+ shadow: '#000000',
80
+ overlay: 'rgba(0, 0, 0, 0.6)',
81
+ messageBackground: '#1F2833',
82
+ messageBackgroundUser: '#1E3A5F',
83
+ messageText: '#F2F4F7',
84
+ messageTextUser: '#F2F4F7',
85
+ systemMessageBackground: '#26303D',
86
+ danger: '#F87171',
87
+ success: '#4ADE80'
88
+ };
89
+
90
+ /** The subset of IConfig the theme depends on (kept structural so the
91
+ * helpers can be called with partial configs in tests). */
92
+
93
+ /** The OS appearance right now — the fallback when a caller has no hook. */
94
+ // Optional chaining on `Appearance` itself: tests that mock react-native
95
+ // partially leave it undefined, and a missing module must read as light.
96
+ const systemIsDark = () => _reactNative.Appearance?.getColorScheme?.() === 'dark';
97
+ const isDarkTheme = (config, systemDark = systemIsDark()) => config?.dark === 'system' ? systemDark : config?.dark === true;
98
+ exports.isDarkTheme = isDarkTheme;
99
+ const pick = (...values) => values.find(v => v !== undefined && v !== null && v !== '');
100
+ const stripUndefined = o => Object.fromEntries(Object.entries(o).filter(([, v]) => v !== undefined && v !== null && v !== ''));
101
+
102
+ /**
103
+ * Build the effective palette for a config. Pure; memoize at the call
104
+ * site (useTheme does).
105
+ */
106
+ const resolveTheme = (config, systemDark) => {
107
+ if (isDarkTheme(config, systemDark)) {
108
+ const overrides = stripUndefined(config?.darkColors ?? {});
109
+ const primary = pick(overrides.primary, DARK_THEME.primary);
110
+ return {
111
+ ...DARK_THEME,
112
+ // Accents that historically fell back to `primary` keep doing so
113
+ // when only `primary` is overridden.
114
+ icon: pick(overrides.icon, overrides.primary, DARK_THEME.icon),
115
+ senderName: pick(overrides.senderName, overrides.primary, DARK_THEME.senderName),
116
+ dateLabel: pick(overrides.dateLabel, overrides.primary, DARK_THEME.dateLabel),
117
+ ...overrides,
118
+ primary,
119
+ dark: true,
120
+ statusBarStyle: 'light-content'
121
+ };
122
+ }
123
+ const c = config?.colors;
124
+ const primary = pick(c?.primary, LIGHT_THEME.primary);
125
+ return {
126
+ ...LIGHT_THEME,
127
+ primary,
128
+ secondary: pick(c?.secondary, LIGHT_THEME.secondary),
129
+ icon: pick(c?.icon, c?.primary, LIGHT_THEME.icon),
130
+ senderName: pick(c?.senderName, c?.primary, LIGHT_THEME.senderName),
131
+ dateLabel: pick(c?.dateLabel, c?.primary, LIGHT_THEME.dateLabel),
132
+ chatBackground: pick(config?.backgroundChat?.color, LIGHT_THEME.chatBackground),
133
+ messageBackground: pick(config?.messageColor?.backgroundMessage, LIGHT_THEME.messageBackground),
134
+ messageBackgroundUser: pick(config?.messageColor?.backgroundMessageUser, LIGHT_THEME.messageBackgroundUser),
135
+ messageText: pick(config?.messageColor?.color, LIGHT_THEME.messageText),
136
+ messageTextUser: pick(config?.messageColor?.colorUser, LIGHT_THEME.messageTextUser),
137
+ dark: false,
138
+ statusBarStyle: 'dark-content'
139
+ };
140
+ };
141
+
142
+ /** In-app appearance choice from Settings; `undefined` = follow the host's config.dark. */
143
+ exports.resolveTheme = resolveTheme;
144
+ /**
145
+ * Fold the user's in-app appearance choice into a config: the choice wins
146
+ * over the host's `dark` (a host that wants to lock the theme hides the
147
+ * setting with `settings.hideAppearance`). Returns the same object when
148
+ * nothing changes, so memoised consumers do not re-render.
149
+ */
150
+ const applyThemePreference = (config, preference) => {
151
+ if (!preference || !config) {
152
+ return config;
153
+ }
154
+ const dark = preference === 'system' ? 'system' : preference === 'dark';
155
+ return config.dark === dark ? config : {
156
+ ...config,
157
+ dark
158
+ };
159
+ };
160
+ exports.applyThemePreference = applyThemePreference;
161
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","DEFAULT_PRIMARY","LIGHT_THEME","exports","primary","secondary","icon","senderName","dateLabel","listBackground","chatBackground","surface","surfaceSecondary","surfaceHighlight","text","textSecondary","textMuted","textOnPrimary","border","divider","shadow","overlay","messageBackground","messageBackgroundUser","messageText","messageTextUser","systemMessageBackground","danger","success","DARK_THEME","systemIsDark","Appearance","getColorScheme","isDarkTheme","config","systemDark","dark","pick","values","find","v","undefined","stripUndefined","o","Object","fromEntries","entries","filter","resolveTheme","overrides","darkColors","statusBarStyle","c","colors","backgroundChat","color","messageColor","backgroundMessage","backgroundMessageUser","colorUser","applyThemePreference","preference"],"sourceRoot":"../../../src","sources":["theme/theme.ts"],"mappings":";;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AAFA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA4DA;;AAUA,MAAMC,eAAe,GAAG,SAAS;AAE1B,MAAMC,WAA4B,GAAAC,OAAA,CAAAD,WAAA,GAAG;EAC1CE,OAAO,EAAEH,eAAe;EACxBI,SAAS,EAAE,SAAS;EACpBC,IAAI,EAAEL,eAAe;EACrBM,UAAU,EAAEN,eAAe;EAC3BO,SAAS,EAAEP,eAAe;EAE1BQ,cAAc,EAAE,SAAS;EACzBC,cAAc,EAAE,SAAS;EACzBC,OAAO,EAAE,SAAS;EAClBC,gBAAgB,EAAE,SAAS;EAC3BC,gBAAgB,EAAE,WAAW;EAE7BC,IAAI,EAAE,SAAS;EACfC,aAAa,EAAE,SAAS;EACxBC,SAAS,EAAE,SAAS;EACpBC,aAAa,EAAE,SAAS;EAExBC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAE,oBAAoB;EAE7BC,iBAAiB,EAAE,SAAS;EAC5BC,qBAAqB,EAAE,SAAS;EAChCC,WAAW,EAAE,SAAS;EACtBC,eAAe,EAAE,SAAS;EAC1BC,uBAAuB,EAAE,SAAS;EAElCC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAE;AACX,CAAC;AAEM,MAAMC,UAA2B,GAAA1B,OAAA,CAAA0B,UAAA,GAAG;EACz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AAM,CAACE,IAAI,KAAKA,IAAI,GAAGF,MAAM,GAAG;IAAE,GAAGA,MAAM;IAAEE;EAAK,CAAC;AAC5D,CAAC;AAACjC,OAAA,CAAAyD,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -6,5 +6,5 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.ETHORA_CHAT_COMPONENT_VERSION = void 0;
7
7
  // Generated by scripts/sync-version.mjs on `npm version`.
8
8
  // Edit package.json's version instead of this file.
9
- const ETHORA_CHAT_COMPONENT_VERSION = exports.ETHORA_CHAT_COMPONENT_VERSION = '26.8.2';
9
+ const ETHORA_CHAT_COMPONENT_VERSION = exports.ETHORA_CHAT_COMPONENT_VERSION = '26.8.4';
10
10
  //# sourceMappingURL=version.js.map
@@ -9,7 +9,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
9
  export const EmptyChatIllustration = ({
10
10
  width = 240,
11
11
  height = 153,
12
- color = '#0052CD'
12
+ color = '#0052CD',
13
+ panelColor
13
14
  }) => /*#__PURE__*/_jsxs(Svg, {
14
15
  viewBox: "0 0 2481 1578",
15
16
  width: width,
@@ -19,19 +20,19 @@ export const EmptyChatIllustration = ({
19
20
  fill: color,
20
21
  d: "M1711 206h493c.16 51.98.16 51.98 1 315 4.67-23.34 4.67-23.34 5.62-31.53.12-.99.24-1.98.37-2.99 1.28-11.1 2.05-22.23 2.77-33.37.33-4.96.67-9.92 1-14.87l.51-7.5c.7-10.42 1.45-20.83 2.23-31.25.18-2.48.37-4.97.55-7.46.11-1.5.22-3 .34-4.5.09-1.27.19-2.54.28-3.85.35-3.91.82-7.79 1.33-11.68 3.41 1.93 6.74 3.83 10 6l.48-3.92c3.67-28.04 3.67-28.04 13.52-36.08 5.73-3.29 10.94-3.89 17.3-2.5 5.81 1.71 10.53 4.13 13.92 9.39 7.28 13.63 2.91 29.13-1.22 43.11.46-.32.46-.32 2.81-1.94C2280 384 2280 384 2283 383c-1.08 17.11-2.51 34.18-4.06 51.25-.09 1.04-.19 2.09-.29 3.17-.89 9.86-1.78 19.72-2.69 29.57l-1.77 19.51c-.09 1.06-.19 2.13-.29 3.22-1.04 11.6-2 23.2-2.75 34.83-.06 1.01-.13 2.02-.2 3.07-.3 4.74-.59 9.49-.85 14.25-2.46 41.87-2.46 41.87-16.29 54.82-.82.8-1.65 1.6-2.5 2.43a269 269 0 0 1-11.15 10.21c-4 3.48-7.77 7.15-11.5 10.92-.66.65-1.31 1.31-1.99 1.98-2.06 2.07-4.11 4.14-6.17 6.21-1.41 1.41-2.82 2.82-4.23 4.24-3.42 3.44-6.85 6.88-10.27 10.32 7.2 4.47 14.39 8.91 21.81 13l2.3 1.27c6.86 3.76 13.8 7.31 20.83 10.72 2.12 1.04 4.23 2.1 6.33 3.15 12.6 6.24 25.62 11.08 38.84 15.82 3.65 1.31 7.27 2.67 10.89 4.04-3.12 2.08-5.29 2.71-8.91 3.59l-3.68.9c-1.32.32-2.65.63-3.98.95l-4.07.99c-3.58.88-7.15 1.74-10.73 2.6-5.72 1.38-11.45 2.78-17.17 4.17-2.01.49-4.01.97-6.01 1.45-1.21.29-2.42.59-3.67.89-1.07.26-2.14.52-3.24.78-2.54.68-2.54.68-4.54 1.68 16.02 24.43 32.15 48.79 48.54 72.97 5.61 8.27 11.19 16.54 16.46 25.03-2.54 2.58-4.95 4.84-8 6.81-.66.44-1.32.88-2 1.33-2.53 1.09-3.45.82-6-.14-1.39-1.5-1.39-1.5-2.66-3.47q-.72-1.11-1.47-2.25c-.53-.82-1.05-1.65-1.58-2.49-.56-.86-1.12-1.72-1.7-2.6-1.22-1.87-2.43-3.74-3.63-5.62-3.23-5.01-6.49-10-9.74-14.99-.67-1.03-1.34-2.06-2.04-3.13-7.25-11.13-14.67-22.14-22.12-33.14l-3.69-5.46c-1.67-2.47-3.34-4.93-5.01-7.4-3.48-5.13-6.93-10.29-10.36-15.45-7.04 8.56-13.56 17.48-20.11 26.42-1.91 2.61-3.84 5.22-5.77 7.82-.62.85-1.25 1.7-1.9 2.58l-3.6 4.86c-2.39 3.24-4.74 6.46-6.89 9.86L2186 773h-2l2-32h-475Z"
21
22
  }), /*#__PURE__*/_jsx(Path, {
22
- fill: "#f3f3f3",
23
+ fill: panelColor ?? '#f3f3f3',
23
24
  d: "M1711 836h493v535h-493Z"
24
25
  }), /*#__PURE__*/_jsx(Path, {
25
- fill: "#f1f1f1",
26
+ fill: panelColor ?? '#f1f1f1',
26
27
  d: "M1009 836h493v535h-493Z"
27
28
  }), /*#__PURE__*/_jsx(Path, {
28
- fill: "#f0f0f0",
29
+ fill: panelColor ?? '#f0f0f0',
29
30
  d: "M307 836h493v535H307Z"
30
31
  }), /*#__PURE__*/_jsx(Path, {
31
- fill: "#f1f1f1",
32
+ fill: panelColor ?? '#f1f1f1',
32
33
  d: "M1009 206h493v535h-493Z"
33
34
  }), /*#__PURE__*/_jsx(Path, {
34
- fill: "#f3f3f3",
35
+ fill: panelColor ?? '#f3f3f3',
35
36
  d: "M307 206h493v535H307Z"
36
37
  }), /*#__PURE__*/_jsx(Path, {
37
38
  fill: "#e3ebf6",
@@ -1 +1 @@
1
- {"version":3,"names":["React","Svg","Path","jsx","_jsx","jsxs","_jsxs","EmptyChatIllustration","width","height","color","viewBox","fill","children","d"],"sourceRoot":"../../../src","sources":["assets/EmptyChatIllustration.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,GAAG,IAAIC,IAAI,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAS7C;AACA;AACA;AACA,OAAO,MAAMC,qBAA2D,GAAGA,CAAC;EAC1EC,KAAK,GAAG,GAAG;EACXC,MAAM,GAAG,GAAG;EACZC,KAAK,GAAG;AACV,CAAC,kBACCJ,KAAA,CAACL,GAAG;EAACU,OAAO,EAAC,eAAe;EAACH,KAAK,EAAEA,KAAM;EAACC,MAAM,EAAEA,MAAO;EAACG,IAAI,EAAC,M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8nD,CAAE,CAAC,eACxpDV,IAAA,CAACF,IAAI;IAACU,IAAI,EAAC,SAAS;IAACE,CAAC,EAAC;EAAq/E,CAAE,CAAC,eAC/gFV,IAAA,CAACF,IAAI;IAACU,IAAI,EAAC,SAAS;IAACE,CAAC,EAAC;EAAk5B,CAAE,CAAC,eAC56BV,IAAA,CAACF,IAAI;IAACU,IAAI,EAAC,SAAS;IAACE,CAAC,EAAC;EAAi+B,CAAE,CAAC,eAC3/BV,IAAA,CAACF,IAAI;IAACU,IAAI,EAAC,SAAS;IAACE,CAAC,EAAC;EAAokC,CAAE,CAAC,eAC9lCV,IAAA,CAACF,IAAI;IAACU,IAAI,EAAC,SAAS;IAACE,CAAC,EAAC;EAAyjC,CAAE,CAAC,eACnlCV,IAAA,CAACF,IAAI;IAACU,IAAI,EAAC,SAAS;IAACE,CAAC,EAAC;EAAy+C,CAAE,CAAC,eACngDV,IAAA,CAACF,IAAI;IAACU,IAAI,EAAC,SAAS;IAACE,CAAC,EAAC;EAA09B,CAAE,CAAC,eACp/BV,IAAA,CAACF,IAAI;IAACU,IAAI,EAAC,SAAS;IAACE,CAAC,EAAC;EAAuf,CAAE,CAAC,eACjhBV,IAAA,CAACF,IAAI;IAACU,IAAI,EAAC,SAAS;IAACE,CAAC,EAAC;EAAgS,CAAE,CAAC,eAC1TV,IAAA,CAACF,IAAI;IAACU,IAAI,EAAC,SAAS;IAACE,CAAC,EAAC;EAAoG,CAAE,CAAC,eAC9HV,IAAA,CAACF,IAAI;IAACU,IAAI,EAAC,SAAS;IAACE,CAAC,EAAC;EAA+U,CAAE,CAAC,eACzWV,IAAA,CAACF,IAAI;IAACU,IAAI,EAAC,SAAS;IAACE,CAAC,EAAC;EAA0C,CAAE,CAAC;AAAA,CACjE,CACN;AAED,eAAeP,qBAAqB","ignoreList":[]}
1
+ {"version":3,"names":["React","Svg","Path","jsx","_jsx","jsxs","_jsxs","EmptyChatIllustration","width","height","color","panelColor","viewBox","fill","children","d"],"sourceRoot":"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