@ethora/chat-component-rn 26.10.5 → 26.10.6

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 (365) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +15 -0
  3. package/app.plugin.js +2 -0
  4. package/lib/commonjs/assets/icons.js +2 -2
  5. package/lib/commonjs/assets/icons.js.map +1 -1
  6. package/lib/commonjs/components/MainComponents/AlbumGrid.js +152 -0
  7. package/lib/commonjs/components/MainComponents/AlbumGrid.js.map +1 -0
  8. package/lib/commonjs/components/MainComponents/ChatRoom.js +2 -2
  9. package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
  10. package/lib/commonjs/components/MainComponents/MediaMessage.js +199 -123
  11. package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
  12. package/lib/commonjs/components/MainComponents/MediaUploadOverlay.js +109 -0
  13. package/lib/commonjs/components/MainComponents/MediaUploadOverlay.js.map +1 -0
  14. package/lib/commonjs/components/MessageBubble/MediaCaption.js +51 -0
  15. package/lib/commonjs/components/MessageBubble/MediaCaption.js.map +1 -0
  16. package/lib/commonjs/components/MessageBubble/Message.js +40 -1
  17. package/lib/commonjs/components/MessageBubble/Message.js.map +1 -1
  18. package/lib/commonjs/components/MessageBubble/MessageInteractions.js +2 -1
  19. package/lib/commonjs/components/MessageBubble/MessageInteractions.js.map +1 -1
  20. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +75 -0
  21. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  22. package/lib/commonjs/components/RoomComponents/LastMessageItem.js +20 -4
  23. package/lib/commonjs/components/RoomComponents/LastMessageItem.js.map +1 -1
  24. package/lib/commonjs/components/RoomComponents/styled/LastAudioMessage.js +3 -2
  25. package/lib/commonjs/components/RoomComponents/styled/LastAudioMessage.js.map +1 -1
  26. package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js +3 -2
  27. package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
  28. package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js +3 -2
  29. package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
  30. package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js +3 -2
  31. package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
  32. package/lib/commonjs/components/Thread/ThreadWrapper.js +3 -2
  33. package/lib/commonjs/components/Thread/ThreadWrapper.js.map +1 -1
  34. package/lib/commonjs/components/styled/MediaFilePreview.js +60 -47
  35. package/lib/commonjs/components/styled/MediaFilePreview.js.map +1 -1
  36. package/lib/commonjs/components/styled/MessageImage.js +16 -6
  37. package/lib/commonjs/components/styled/MessageImage.js.map +1 -1
  38. package/lib/commonjs/components/styled/SendInput.js +99 -68
  39. package/lib/commonjs/components/styled/SendInput.js.map +1 -1
  40. package/lib/commonjs/components/styled/VideoMessage.js +24 -10
  41. package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
  42. package/lib/commonjs/context/xmppProvider.js +46 -0
  43. package/lib/commonjs/context/xmppProvider.js.map +1 -1
  44. package/lib/commonjs/e2ee/fileEnvelope.js +6 -0
  45. package/lib/commonjs/e2ee/fileEnvelope.js.map +1 -1
  46. package/lib/commonjs/e2ee/sealedBody.js +32 -2
  47. package/lib/commonjs/e2ee/sealedBody.js.map +1 -1
  48. package/lib/commonjs/helpers/albumLayout.js +150 -0
  49. package/lib/commonjs/helpers/albumLayout.js.map +1 -0
  50. package/lib/commonjs/helpers/attachments.js +255 -0
  51. package/lib/commonjs/helpers/attachments.js.map +1 -0
  52. package/lib/commonjs/helpers/caption.js +214 -0
  53. package/lib/commonjs/helpers/caption.js.map +1 -0
  54. package/lib/commonjs/helpers/createMainMessageForThread.js +5 -1
  55. package/lib/commonjs/helpers/createMainMessageForThread.js.map +1 -1
  56. package/lib/commonjs/helpers/createMessageFromXml.js +19 -5
  57. package/lib/commonjs/helpers/createMessageFromXml.js.map +1 -1
  58. package/lib/commonjs/helpers/fileKind.js +40 -0
  59. package/lib/commonjs/helpers/fileKind.js.map +1 -0
  60. package/lib/commonjs/helpers/getDataFromXml.js +6 -1
  61. package/lib/commonjs/helpers/getDataFromXml.js.map +1 -1
  62. package/lib/commonjs/helpers/mapWithConcurrency.js +41 -0
  63. package/lib/commonjs/helpers/mapWithConcurrency.js.map +1 -0
  64. package/lib/commonjs/helpers/mediaLimits.js +33 -0
  65. package/lib/commonjs/helpers/mediaLimits.js.map +1 -0
  66. package/lib/commonjs/helpers/mediaSendRetry.js +64 -0
  67. package/lib/commonjs/helpers/mediaSendRetry.js.map +1 -0
  68. package/lib/commonjs/helpers/mediaWireData.js +62 -0
  69. package/lib/commonjs/helpers/mediaWireData.js.map +1 -0
  70. package/lib/commonjs/helpers/mentionSpans.js +19 -0
  71. package/lib/commonjs/helpers/mentionSpans.js.map +1 -0
  72. package/lib/commonjs/helpers/mimeToExtension.js +45 -0
  73. package/lib/commonjs/helpers/mimeToExtension.js.map +1 -1
  74. package/lib/commonjs/helpers/readReceipts.js +173 -0
  75. package/lib/commonjs/helpers/readReceipts.js.map +1 -0
  76. package/lib/commonjs/helpers/repairFilenameEncoding.js +79 -0
  77. package/lib/commonjs/helpers/repairFilenameEncoding.js.map +1 -0
  78. package/lib/commonjs/helpers/safeJson.js +18 -0
  79. package/lib/commonjs/helpers/safeJson.js.map +1 -0
  80. package/lib/commonjs/hooks/useSendMessage.js +384 -193
  81. package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
  82. package/lib/commonjs/i18n/strings.js +96 -0
  83. package/lib/commonjs/i18n/strings.js.map +1 -1
  84. package/lib/commonjs/networking/api-requests/auth.api.js +62 -3
  85. package/lib/commonjs/networking/api-requests/auth.api.js.map +1 -1
  86. package/lib/commonjs/networking/stanzaHandlers.js +100 -3
  87. package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
  88. package/lib/commonjs/networking/xmpp/handleStanzas.xmpp.js +4 -2
  89. package/lib/commonjs/networking/xmpp/handleStanzas.xmpp.js.map +1 -1
  90. package/lib/commonjs/networking/xmpp/sendDisplayedMarker.xmpp.js +28 -0
  91. package/lib/commonjs/networking/xmpp/sendDisplayedMarker.xmpp.js.map +1 -0
  92. package/lib/commonjs/networking/xmpp/sendMediaMessage.xmpp.js +53 -2
  93. package/lib/commonjs/networking/xmpp/sendMediaMessage.xmpp.js.map +1 -1
  94. package/lib/commonjs/networking/xmpp/sendReceivedReceipt.xmpp.js +28 -0
  95. package/lib/commonjs/networking/xmpp/sendReceivedReceipt.xmpp.js.map +1 -0
  96. package/lib/commonjs/networking/xmppClient.js +64 -0
  97. package/lib/commonjs/networking/xmppClient.js.map +1 -1
  98. package/lib/commonjs/roomStore/persistence.js +78 -5
  99. package/lib/commonjs/roomStore/persistence.js.map +1 -1
  100. package/lib/commonjs/roomStore/roomHeapSlice.js +4 -0
  101. package/lib/commonjs/roomStore/roomHeapSlice.js.map +1 -1
  102. package/lib/commonjs/roomStore/roomsSlice.js +114 -1
  103. package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
  104. package/lib/commonjs/types/models/attachment.model.js +2 -0
  105. package/lib/commonjs/types/models/attachment.model.js.map +1 -0
  106. package/lib/commonjs/version.js +1 -1
  107. package/lib/module/assets/icons.js +1 -1
  108. package/lib/module/assets/icons.js.map +1 -1
  109. package/lib/module/components/MainComponents/AlbumGrid.js +146 -0
  110. package/lib/module/components/MainComponents/AlbumGrid.js.map +1 -0
  111. package/lib/module/components/MainComponents/ChatRoom.js +2 -2
  112. package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
  113. package/lib/module/components/MainComponents/MediaMessage.js +200 -124
  114. package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
  115. package/lib/module/components/MainComponents/MediaUploadOverlay.js +104 -0
  116. package/lib/module/components/MainComponents/MediaUploadOverlay.js.map +1 -0
  117. package/lib/module/components/MessageBubble/MediaCaption.js +46 -0
  118. package/lib/module/components/MessageBubble/MediaCaption.js.map +1 -0
  119. package/lib/module/components/MessageBubble/Message.js +44 -5
  120. package/lib/module/components/MessageBubble/Message.js.map +1 -1
  121. package/lib/module/components/MessageBubble/MessageInteractions.js +2 -1
  122. package/lib/module/components/MessageBubble/MessageInteractions.js.map +1 -1
  123. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +75 -0
  124. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  125. package/lib/module/components/RoomComponents/LastMessageItem.js +20 -4
  126. package/lib/module/components/RoomComponents/LastMessageItem.js.map +1 -1
  127. package/lib/module/components/RoomComponents/styled/LastAudioMessage.js +3 -2
  128. package/lib/module/components/RoomComponents/styled/LastAudioMessage.js.map +1 -1
  129. package/lib/module/components/RoomComponents/styled/LastMessageFile.js +3 -2
  130. package/lib/module/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
  131. package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js +3 -2
  132. package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
  133. package/lib/module/components/RoomComponents/styled/LastMessageVideo.js +3 -2
  134. package/lib/module/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
  135. package/lib/module/components/Thread/ThreadWrapper.js +3 -2
  136. package/lib/module/components/Thread/ThreadWrapper.js.map +1 -1
  137. package/lib/module/components/styled/MediaFilePreview.js +61 -48
  138. package/lib/module/components/styled/MediaFilePreview.js.map +1 -1
  139. package/lib/module/components/styled/MessageImage.js +16 -6
  140. package/lib/module/components/styled/MessageImage.js.map +1 -1
  141. package/lib/module/components/styled/SendInput.js +99 -68
  142. package/lib/module/components/styled/SendInput.js.map +1 -1
  143. package/lib/module/components/styled/VideoMessage.js +24 -10
  144. package/lib/module/components/styled/VideoMessage.js.map +1 -1
  145. package/lib/module/context/xmppProvider.js +46 -0
  146. package/lib/module/context/xmppProvider.js.map +1 -1
  147. package/lib/module/e2ee/fileEnvelope.js +1 -1
  148. package/lib/module/e2ee/fileEnvelope.js.map +1 -1
  149. package/lib/module/e2ee/sealedBody.js +32 -2
  150. package/lib/module/e2ee/sealedBody.js.map +1 -1
  151. package/lib/module/helpers/albumLayout.js +143 -0
  152. package/lib/module/helpers/albumLayout.js.map +1 -0
  153. package/lib/module/helpers/attachments.js +245 -0
  154. package/lib/module/helpers/attachments.js.map +1 -0
  155. package/lib/module/helpers/caption.js +207 -0
  156. package/lib/module/helpers/caption.js.map +1 -0
  157. package/lib/module/helpers/createMainMessageForThread.js +5 -1
  158. package/lib/module/helpers/createMainMessageForThread.js.map +1 -1
  159. package/lib/module/helpers/createMessageFromXml.js +20 -6
  160. package/lib/module/helpers/createMessageFromXml.js.map +1 -1
  161. package/lib/module/helpers/fileKind.js +34 -0
  162. package/lib/module/helpers/fileKind.js.map +1 -0
  163. package/lib/module/helpers/getDataFromXml.js +6 -1
  164. package/lib/module/helpers/getDataFromXml.js.map +1 -1
  165. package/lib/module/helpers/mapWithConcurrency.js +37 -0
  166. package/lib/module/helpers/mapWithConcurrency.js.map +1 -0
  167. package/lib/module/helpers/mediaLimits.js +27 -0
  168. package/lib/module/helpers/mediaLimits.js.map +1 -0
  169. package/lib/module/helpers/mediaSendRetry.js +55 -0
  170. package/lib/module/helpers/mediaSendRetry.js.map +1 -0
  171. package/lib/module/helpers/mediaWireData.js +58 -0
  172. package/lib/module/helpers/mediaWireData.js.map +1 -0
  173. package/lib/module/helpers/mentionSpans.js +14 -0
  174. package/lib/module/helpers/mentionSpans.js.map +1 -0
  175. package/lib/module/helpers/mimeToExtension.js +43 -0
  176. package/lib/module/helpers/mimeToExtension.js.map +1 -1
  177. package/lib/module/helpers/readReceipts.js +160 -0
  178. package/lib/module/helpers/readReceipts.js.map +1 -0
  179. package/lib/module/helpers/repairFilenameEncoding.js +74 -0
  180. package/lib/module/helpers/repairFilenameEncoding.js.map +1 -0
  181. package/lib/module/helpers/safeJson.js +13 -0
  182. package/lib/module/helpers/safeJson.js.map +1 -0
  183. package/lib/module/hooks/useSendMessage.js +387 -195
  184. package/lib/module/hooks/useSendMessage.js.map +1 -1
  185. package/lib/module/i18n/strings.js +96 -0
  186. package/lib/module/i18n/strings.js.map +1 -1
  187. package/lib/module/networking/api-requests/auth.api.js +62 -3
  188. package/lib/module/networking/api-requests/auth.api.js.map +1 -1
  189. package/lib/module/networking/stanzaHandlers.js +97 -4
  190. package/lib/module/networking/stanzaHandlers.js.map +1 -1
  191. package/lib/module/networking/xmpp/handleStanzas.xmpp.js +5 -3
  192. package/lib/module/networking/xmpp/handleStanzas.xmpp.js.map +1 -1
  193. package/lib/module/networking/xmpp/sendDisplayedMarker.xmpp.js +25 -0
  194. package/lib/module/networking/xmpp/sendDisplayedMarker.xmpp.js.map +1 -0
  195. package/lib/module/networking/xmpp/sendMediaMessage.xmpp.js +53 -2
  196. package/lib/module/networking/xmpp/sendMediaMessage.xmpp.js.map +1 -1
  197. package/lib/module/networking/xmpp/sendReceivedReceipt.xmpp.js +25 -0
  198. package/lib/module/networking/xmpp/sendReceivedReceipt.xmpp.js.map +1 -0
  199. package/lib/module/networking/xmppClient.js +64 -0
  200. package/lib/module/networking/xmppClient.js.map +1 -1
  201. package/lib/module/roomStore/persistence.js +78 -5
  202. package/lib/module/roomStore/persistence.js.map +1 -1
  203. package/lib/module/roomStore/roomHeapSlice.js +4 -0
  204. package/lib/module/roomStore/roomHeapSlice.js.map +1 -1
  205. package/lib/module/roomStore/roomsSlice.js +109 -0
  206. package/lib/module/roomStore/roomsSlice.js.map +1 -1
  207. package/lib/module/types/models/attachment.model.js +2 -0
  208. package/lib/module/types/models/attachment.model.js.map +1 -0
  209. package/lib/module/version.js +1 -1
  210. package/lib/typescript/assets/icons.d.ts +6 -1
  211. package/lib/typescript/assets/icons.d.ts.map +1 -1
  212. package/lib/typescript/components/MainComponents/AlbumGrid.d.ts +21 -0
  213. package/lib/typescript/components/MainComponents/AlbumGrid.d.ts.map +1 -0
  214. package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
  215. package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
  216. package/lib/typescript/components/MainComponents/MediaUploadOverlay.d.ts +17 -0
  217. package/lib/typescript/components/MainComponents/MediaUploadOverlay.d.ts.map +1 -0
  218. package/lib/typescript/components/MessageBubble/MediaCaption.d.ts +12 -0
  219. package/lib/typescript/components/MessageBubble/MediaCaption.d.ts.map +1 -0
  220. package/lib/typescript/components/MessageBubble/Message.d.ts.map +1 -1
  221. package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts.map +1 -1
  222. package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
  223. package/lib/typescript/components/RoomComponents/LastMessageItem.d.ts.map +1 -1
  224. package/lib/typescript/components/RoomComponents/styled/LastAudioMessage.d.ts +2 -0
  225. package/lib/typescript/components/RoomComponents/styled/LastAudioMessage.d.ts.map +1 -1
  226. package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts +2 -0
  227. package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts.map +1 -1
  228. package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts +2 -0
  229. package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts.map +1 -1
  230. package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts +2 -0
  231. package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts.map +1 -1
  232. package/lib/typescript/components/Thread/ThreadWrapper.d.ts.map +1 -1
  233. package/lib/typescript/components/styled/MediaFilePreview.d.ts.map +1 -1
  234. package/lib/typescript/components/styled/MessageImage.d.ts +10 -0
  235. package/lib/typescript/components/styled/MessageImage.d.ts.map +1 -1
  236. package/lib/typescript/components/styled/SendInput.d.ts +7 -1
  237. package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
  238. package/lib/typescript/components/styled/VideoMessage.d.ts +7 -0
  239. package/lib/typescript/components/styled/VideoMessage.d.ts.map +1 -1
  240. package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
  241. package/lib/typescript/e2ee/fileEnvelope.d.ts +1 -1
  242. package/lib/typescript/e2ee/fileEnvelope.d.ts.map +1 -1
  243. package/lib/typescript/e2ee/sealedBody.d.ts +16 -0
  244. package/lib/typescript/e2ee/sealedBody.d.ts.map +1 -1
  245. package/lib/typescript/helpers/albumLayout.d.ts +66 -0
  246. package/lib/typescript/helpers/albumLayout.d.ts.map +1 -0
  247. package/lib/typescript/helpers/attachments.d.ts +55 -0
  248. package/lib/typescript/helpers/attachments.d.ts.map +1 -0
  249. package/lib/typescript/helpers/caption.d.ts +64 -0
  250. package/lib/typescript/helpers/caption.d.ts.map +1 -0
  251. package/lib/typescript/helpers/createMainMessageForThread.d.ts.map +1 -1
  252. package/lib/typescript/helpers/createMessageFromXml.d.ts.map +1 -1
  253. package/lib/typescript/helpers/fileKind.d.ts +20 -0
  254. package/lib/typescript/helpers/fileKind.d.ts.map +1 -0
  255. package/lib/typescript/helpers/getDataFromXml.d.ts.map +1 -1
  256. package/lib/typescript/helpers/mapWithConcurrency.d.ts +9 -0
  257. package/lib/typescript/helpers/mapWithConcurrency.d.ts.map +1 -0
  258. package/lib/typescript/helpers/mediaLimits.d.ts +13 -0
  259. package/lib/typescript/helpers/mediaLimits.d.ts.map +1 -0
  260. package/lib/typescript/helpers/mediaSendRetry.d.ts +26 -0
  261. package/lib/typescript/helpers/mediaSendRetry.d.ts.map +1 -0
  262. package/lib/typescript/helpers/mediaWireData.d.ts +16 -0
  263. package/lib/typescript/helpers/mediaWireData.d.ts.map +1 -0
  264. package/lib/typescript/helpers/mentionSpans.d.ts +8 -0
  265. package/lib/typescript/helpers/mentionSpans.d.ts.map +1 -0
  266. package/lib/typescript/helpers/mimeToExtension.d.ts +7 -0
  267. package/lib/typescript/helpers/mimeToExtension.d.ts.map +1 -1
  268. package/lib/typescript/helpers/readReceipts.d.ts +82 -0
  269. package/lib/typescript/helpers/readReceipts.d.ts.map +1 -0
  270. package/lib/typescript/helpers/repairFilenameEncoding.d.ts +12 -0
  271. package/lib/typescript/helpers/repairFilenameEncoding.d.ts.map +1 -0
  272. package/lib/typescript/helpers/safeJson.d.ts +2 -0
  273. package/lib/typescript/helpers/safeJson.d.ts.map +1 -0
  274. package/lib/typescript/hooks/useSendMessage.d.ts +2 -1
  275. package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
  276. package/lib/typescript/i18n/strings.d.ts.map +1 -1
  277. package/lib/typescript/networking/api-requests/auth.api.d.ts +2 -0
  278. package/lib/typescript/networking/api-requests/auth.api.d.ts.map +1 -1
  279. package/lib/typescript/networking/stanzaHandlers.d.ts +7 -3
  280. package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
  281. package/lib/typescript/networking/xmpp/handleStanzas.xmpp.d.ts.map +1 -1
  282. package/lib/typescript/networking/xmpp/sendDisplayedMarker.xmpp.d.ts +3 -0
  283. package/lib/typescript/networking/xmpp/sendDisplayedMarker.xmpp.d.ts.map +1 -0
  284. package/lib/typescript/networking/xmpp/sendMediaMessage.xmpp.d.ts +12 -0
  285. package/lib/typescript/networking/xmpp/sendMediaMessage.xmpp.d.ts.map +1 -1
  286. package/lib/typescript/networking/xmpp/sendReceivedReceipt.xmpp.d.ts +3 -0
  287. package/lib/typescript/networking/xmpp/sendReceivedReceipt.xmpp.d.ts.map +1 -0
  288. package/lib/typescript/networking/xmppClient.d.ts +15 -0
  289. package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
  290. package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
  291. package/lib/typescript/roomStore/roomHeapSlice.d.ts +22 -1
  292. package/lib/typescript/roomStore/roomHeapSlice.d.ts.map +1 -1
  293. package/lib/typescript/roomStore/roomsSlice.d.ts +67 -3
  294. package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
  295. package/lib/typescript/types/models/attachment.model.d.ts +52 -0
  296. package/lib/typescript/types/models/attachment.model.d.ts.map +1 -0
  297. package/lib/typescript/types/models/message.model.d.ts +26 -0
  298. package/lib/typescript/types/models/message.model.d.ts.map +1 -1
  299. package/lib/typescript/types/models/modal.model.d.ts +7 -0
  300. package/lib/typescript/types/models/modal.model.d.ts.map +1 -1
  301. package/lib/typescript/types/models/room.model.d.ts +2 -0
  302. package/lib/typescript/types/models/room.model.d.ts.map +1 -1
  303. package/lib/typescript/types/types.d.ts +29 -1
  304. package/lib/typescript/types/types.d.ts.map +1 -1
  305. package/lib/typescript/version.d.ts +1 -1
  306. package/package.json +4 -1
  307. package/plugins/notification-service/Info.plist +31 -0
  308. package/plugins/notification-service/NotificationService.swift +82 -0
  309. package/plugins/withNotificationServiceExtension.js +137 -0
  310. package/src/assets/icons.tsx +20 -2
  311. package/src/components/MainComponents/AlbumGrid.tsx +183 -0
  312. package/src/components/MainComponents/ChatRoom.tsx +4 -2
  313. package/src/components/MainComponents/MediaMessage.tsx +246 -130
  314. package/src/components/MainComponents/MediaUploadOverlay.tsx +102 -0
  315. package/src/components/MessageBubble/MediaCaption.tsx +45 -0
  316. package/src/components/MessageBubble/Message.tsx +71 -3
  317. package/src/components/MessageBubble/MessageInteractions.tsx +2 -1
  318. package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +64 -0
  319. package/src/components/RoomComponents/LastMessageItem.tsx +15 -4
  320. package/src/components/RoomComponents/styled/LastAudioMessage.tsx +6 -3
  321. package/src/components/RoomComponents/styled/LastMessageFile.tsx +6 -2
  322. package/src/components/RoomComponents/styled/LastMessagePhoto.tsx +6 -2
  323. package/src/components/RoomComponents/styled/LastMessageVideo.tsx +6 -2
  324. package/src/components/Thread/ThreadWrapper.tsx +5 -9
  325. package/src/components/styled/MediaFilePreview.tsx +49 -34
  326. package/src/components/styled/MessageImage.tsx +21 -5
  327. package/src/components/styled/SendInput.tsx +101 -87
  328. package/src/components/styled/VideoMessage.tsx +34 -9
  329. package/src/context/xmppProvider.tsx +32 -0
  330. package/src/e2ee/fileEnvelope.ts +1 -1
  331. package/src/e2ee/sealedBody.ts +44 -5
  332. package/src/helpers/albumLayout.ts +207 -0
  333. package/src/helpers/attachments.ts +316 -0
  334. package/src/helpers/caption.ts +283 -0
  335. package/src/helpers/createMainMessageForThread.ts +6 -1
  336. package/src/helpers/createMessageFromXml.ts +21 -5
  337. package/src/helpers/fileKind.ts +38 -0
  338. package/src/helpers/getDataFromXml.ts +5 -1
  339. package/src/helpers/mapWithConcurrency.ts +32 -0
  340. package/src/helpers/mediaLimits.ts +27 -0
  341. package/src/helpers/mediaSendRetry.ts +59 -0
  342. package/src/helpers/mediaWireData.ts +57 -0
  343. package/src/helpers/mentionSpans.ts +17 -0
  344. package/src/helpers/mimeToExtension.ts +51 -0
  345. package/src/helpers/readReceipts.ts +219 -0
  346. package/src/helpers/repairFilenameEncoding.ts +82 -0
  347. package/src/helpers/safeJson.ts +11 -0
  348. package/src/hooks/useSendMessage.tsx +448 -249
  349. package/src/i18n/strings.ts +96 -0
  350. package/src/networking/api-requests/auth.api.ts +60 -3
  351. package/src/networking/stanzaHandlers.ts +91 -2
  352. package/src/networking/xmpp/handleStanzas.xmpp.ts +6 -2
  353. package/src/networking/xmpp/sendDisplayedMarker.xmpp.ts +31 -0
  354. package/src/networking/xmpp/sendMediaMessage.xmpp.ts +60 -3
  355. package/src/networking/xmpp/sendReceivedReceipt.xmpp.ts +31 -0
  356. package/src/networking/xmppClient.ts +48 -0
  357. package/src/roomStore/persistence.ts +94 -3
  358. package/src/roomStore/roomHeapSlice.ts +23 -1
  359. package/src/roomStore/roomsSlice.ts +112 -1
  360. package/src/types/models/attachment.model.ts +51 -0
  361. package/src/types/models/message.model.ts +29 -0
  362. package/src/types/models/modal.model.ts +7 -0
  363. package/src/types/models/room.model.ts +2 -0
  364. package/src/types/types.ts +35 -1
  365. package/src/version.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MediaFilePreview.d.ts","sourceRoot":"","sources":["../../../../src/components/styled/MediaFilePreview.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,UAAU,qBAAqB;IAC7B,YAAY,EAAE,SAAS,EAAE,CAAC;IAC1B,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AA6CD,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CA0CtD,CAAC"}
1
+ {"version":3,"file":"MediaFilePreview.d.ts","sourceRoot":"","sources":["../../../../src/components/styled/MediaFilePreview.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI9C,UAAU,qBAAqB;IAC7B,YAAY,EAAE,SAAS,EAAE,CAAC;IAC1B,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AA6CD,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAwDtD,CAAC"}
@@ -17,6 +17,16 @@ interface CustomMessageImageProps {
17
17
  * route; rendering it inline is what left the bubbles blank.
18
18
  */
19
19
  locationPreview?: string;
20
+ /**
21
+ * Album mode: fill a tile of exactly this size (cover, square corners; the
22
+ * tile clips) instead of sizing itself to the picture.
23
+ */
24
+ tile?: {
25
+ width: number;
26
+ height: number;
27
+ };
28
+ /** Replaces the default "open this one file" tap, e.g. to open an album at an index. */
29
+ onOpen?: () => void;
20
30
  }
21
31
  declare const CustomMessageImage: React.FC<CustomMessageImageProps>;
22
32
  export default CustomMessageImage;
@@ -1 +1 @@
1
- {"version":3,"file":"MessageImage.d.ts","sourceRoot":"","sources":["../../../../src/components/styled/MessageImage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAoBnD,UAAU,uBAAuB;IAC/B,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AASD,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA8FzD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"MessageImage.d.ts","sourceRoot":"","sources":["../../../../src/components/styled/MessageImage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAoBnD,UAAU,uBAAuB;IAC/B,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,wFAAwF;IACxF,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AASD,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAuGzD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -5,7 +5,13 @@ interface SendInputProps {
5
5
  sendMessage: (message: string) => void;
6
6
  isLoading: boolean;
7
7
  editMessage?: string;
8
- sendMedia: (data: any, type: string) => void;
8
+ /**
9
+ * Sends one message carrying `data` (a file or the picked list). The typed
10
+ * text, when there is any, goes with it as the caption.
11
+ */
12
+ sendMedia: (data: any, type: string, caption?: {
13
+ text: string;
14
+ }) => unknown;
9
15
  config?: IConfig;
10
16
  onFocus?: () => void;
11
17
  onBlur?: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"SendInput.d.ts","sourceRoot":"","sources":["../../../../src/components/styled/SendInput.tsx"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,KAAmD,MAAM,OAAO,CAAC;AAMxE,OAAO,EAAE,OAAO,EAAa,MAAM,mBAAmB,CAAC;AA+EvD,UAAU,cAAc;IACtB,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAytBvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"SendInput.d.ts","sourceRoot":"","sources":["../../../../src/components/styled/SendInput.tsx"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,KAAmD,MAAM,OAAO,CAAC;AAMxE,OAAO,EAAE,OAAO,EAAa,MAAM,mBAAmB,CAAC;AAwEvD,UAAU,cAAc;IACtB,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA0uBvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -11,6 +11,13 @@ interface CustomMessageVideoProps {
11
11
  mimetype: string;
12
12
  /** The backend-generated poster frame (message.locationPreview). */
13
13
  previewURL?: string;
14
+ /** Album mode: fill a tile of exactly this size (square corners; the tile clips). */
15
+ tile?: {
16
+ width: number;
17
+ height: number;
18
+ };
19
+ /** Replaces the default "open this one file" tap, e.g. to open an album at an index. */
20
+ onOpen?: () => void;
14
21
  }
15
22
  declare const CustomMessageVideo: React.FC<CustomMessageVideoProps>;
16
23
  export default CustomMessageVideo;
@@ -1 +1 @@
1
- {"version":3,"file":"VideoMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/styled/VideoMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAmBnD,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAqGD,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA+BzD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"VideoMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/styled/VideoMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAmBnD,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,wFAAwF;IACxF,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAgHD,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAsCzD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"xmppProvider.d.ts","sourceRoot":"","sources":["../../../src/context/xmppProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,SAAS,EAQV,MAAM,OAAO,CAAC;AAIf,OAAO,UAEN,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,OAAO,EACP,uBAAuB,EAEvB,qBAAqB,E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,CAAC;IACjD,QAAQ,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC9B,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,gBAAgB,EAAE,CAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,YAAY,CAAC,EAAE,qBAAqB,KACjC,OAAO,CAAC,UAAU,CAAC,CAAC;CAC1B;AAID,UAAU,iBAAiB;IACzB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IAIjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAcD,iFAAiF;AACjF,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAEvD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAu2BpD,CAAC;AAEF,eAAO,MAAM,aAAa,uBAkBzB,CAAC;AAEF,iFAAiF;AACjF,wBAAgB,cAAc,SAE7B"}
@@ -1,5 +1,5 @@
1
1
  import { type Progress } from './fileCipher';
2
- export { parseSealedMediaBody } from './sealedBody';
2
+ export { parseSealedMediaBody, parseSealedMediaPayload } from './sealedBody';
3
3
  export interface FileEnvelopeMeta {
4
4
  mimetype: string;
5
5
  originalname: string;
@@ -1 +1 @@
1
- {"version":3,"file":"fileEnvelope.d.ts","sourceRoot":"","sources":["../../../src/e2ee/fileEnvelope.ts"],"names":[],"mappings":"AAQA,OAAO,EAGL,KAAK,QAAQ,EACd,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAMpD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,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CAAC,QAAQ,EAAE,UAAU,GAAG;IACxD,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,UAAU,CAAC;CACnB,CA0BA;AAED,wBAAsB,iBAAiB,CACrC,IAAI,EAAE;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EACzD,UAAU,CAAC,EAAE,QAAQ,GACpB,OAAO,CAAC,UAAU,CAAC,CAiBrB;AAED,wBAAsB,cAAc,CAClC,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,QAAQ,GACpB,OAAO,CAAC;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,CAAC,CAIxD"}
@@ -1,2 +1,18 @@
1
+ import type { IMentionSpan } from '../types/models/message.model';
2
+ /** What a sealed media <body> carries besides the keys. */
3
+ export interface SealedMediaPayload {
4
+ keys: string[];
5
+ /** The text typed with the files. Sealed here, never on <data>. */
6
+ caption?: string;
7
+ captionMentions?: IMentionSpan[];
8
+ }
9
+ /**
10
+ * Pulls the attachment keys (and the caption, when there is one) out of a
11
+ * decrypted media <body>: `{v:1,keys:[...],caption?,captionMentions?}`, which
12
+ * the sender writes in place of the usual literal "media". Undefined for
13
+ * anything else, so an ordinary media message falls through untouched.
14
+ */
15
+ export declare function parseSealedMediaPayload(body?: string): SealedMediaPayload | undefined;
16
+ /** The attachment keys out of a sealed media <body>; see parseSealedMediaPayload. */
1
17
  export declare function parseSealedMediaBody(body?: string): string[] | undefined;
2
18
  //# sourceMappingURL=sealedBody.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sealedBody.d.ts","sourceRoot":"","sources":["../../../src/e2ee/sealedBody.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAgBxE"}
1
+ {"version":3,"file":"sealedBody.d.ts","sourceRoot":"","sources":["../../../src/e2ee/sealedBody.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAGlE,2DAA2D;AAC3D,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,YAAY,EAAE,CAAC;CAClC;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,CAAC,EAAE,MAAM,GACZ,kBAAkB,GAAG,SAAS,CA+BhC;AAED,qFAAqF;AACrF,wBAAgB,oBAAoB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAExE"}
@@ -0,0 +1,66 @@
1
+ import type { ViewStyle } from 'react-native';
2
+ /**
3
+ * Geometry for a multi-media album bubble. Pure numbers and RN style objects,
4
+ * so AlbumGrid stays a dumb renderer and the rules are testable without a
5
+ * renderer.
6
+ *
7
+ * 1 item full width, 4:3
8
+ * 2 items side by side, 2:1 (square cells)
9
+ * 3 items one large cell on the left, two stacked on the right
10
+ * 4 items 2 x 2
11
+ * 5+ items 2 x 2 showing the first four, the last cell carries "+N"
12
+ */
13
+ /** Gap between neighbouring tiles. */
14
+ export declare const ALBUM_GAP = 3;
15
+ /** Radius of a tile corner that sits on the bubble's own corner. */
16
+ export declare const ALBUM_OUTER_RADIUS = 10;
17
+ /** Radius of every other tile corner, the ones that face a neighbour. */
18
+ export declare const ALBUM_INNER_RADIUS = 3;
19
+ export interface AlbumCellPlacement {
20
+ /** 0-based grid column and row of the tile's top-left cell. */
21
+ column: number;
22
+ row: number;
23
+ columnSpan: number;
24
+ rowSpan: number;
25
+ }
26
+ export type AlbumKind = 'full' | 'pair' | 'hero' | 'quad';
27
+ export interface AlbumLayout {
28
+ kind: AlbumKind;
29
+ /** Number of tiles actually drawn. */
30
+ visible: number;
31
+ /** Items folded into the "+N" overlay on the last visible tile. */
32
+ hidden: number;
33
+ /** Relative width of each grid column. */
34
+ columns: number[];
35
+ /** Relative height of each grid row. */
36
+ rows: number[];
37
+ /** Width divided by height of the whole grid. */
38
+ aspectRatio: number;
39
+ /** One entry per visible tile, in order. */
40
+ placements: AlbumCellPlacement[];
41
+ }
42
+ /** Layout for `count` media tiles. Counts below 1 are treated as 1. */
43
+ export declare const getAlbumLayout: (count: number) => AlbumLayout;
44
+ export interface AlbumFrame {
45
+ width: number;
46
+ height: number;
47
+ /** One absolutely positioned style per visible tile, in order. */
48
+ tiles: ViewStyle[];
49
+ }
50
+ /** Pixel frame of the grid and of every tile for a grid `width` wide. */
51
+ export declare const getAlbumFrame: (layout: AlbumLayout, width: number) => AlbumFrame;
52
+ /**
53
+ * Which corners of one tile lie on the bubble's outer edge. Only those get
54
+ * the large radius; corners that face a neighbour get the small inner one.
55
+ */
56
+ export interface TileCorners {
57
+ topLeft: boolean;
58
+ topRight: boolean;
59
+ bottomRight: boolean;
60
+ bottomLeft: boolean;
61
+ }
62
+ /** Outer-corner flags for the tile at `position` (0-based) of `layout`. */
63
+ export declare const getTileCorners: (layout: AlbumLayout, position: number) => TileCorners;
64
+ /** The four border radii of one tile, as RN style props. */
65
+ export declare const getTileBorderRadius: (layout: AlbumLayout, position: number) => Pick<ViewStyle, "borderTopLeftRadius" | "borderTopRightRadius" | "borderBottomRightRadius" | "borderBottomLeftRadius">;
66
+ //# sourceMappingURL=albumLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"albumLayout.d.ts","sourceRoot":"","sources":["../../../src/helpers/albumLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;;;;;;;;;GAUG;AAEH,sCAAsC;AACtC,eAAO,MAAM,SAAS,IAAI,CAAC;AAC3B,oEAAoE;AACpE,eAAO,MAAM,kBAA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C;AAEF,4DAA4D;AAC5D,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,WAAW,EACnB,UAAU,MAAM,KACf,IAAI,CACL,SAAS,EACP,qBAAqB,GACrB,sBAAsB,GACtB,yBAAyB,GACzB,wBAAwB,CAW3B,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { IAttachment, IMessage } from '../types/types';
2
+ /**
3
+ * Hard ceiling on how many attachments we will serialise into a stanza.
4
+ * The composer caps the picker far below this; this is the parser-side
5
+ * guard so a malformed or hostile stanza cannot make us render an
6
+ * unbounded grid.
7
+ */
8
+ export declare const MAX_ATTACHMENTS_PER_MESSAGE = 10;
9
+ /**
10
+ * Turns one raw wire/API object into an `IAttachment`, or null when there is
11
+ * nothing renderable in it. `location` is allowed to be empty: that is what
12
+ * an optimistic (still-uploading) attachment looks like.
13
+ */
14
+ export declare const normalizeAttachment: (raw: unknown) => IAttachment | null;
15
+ /** Accepts the parsed array, the raw JSON string, or junk. Never throws. */
16
+ export declare const parseAttachments: (raw: unknown) => IAttachment[];
17
+ /**
18
+ * The wire form: a JSON string on the `<data attachments="...">` attribute.
19
+ * Only the fields a receiver renders are sent - the stanza is already wide
20
+ * and every byte here is duplicated per attachment.
21
+ */
22
+ export declare const serializeAttachments: (attachments: IAttachment[]) => string;
23
+ /**
24
+ * The only supported way to read a media message's files.
25
+ *
26
+ * Order of truth: the multi-attach payload when present, otherwise the flat
27
+ * legacy fields synthesised into a single attachment. Every message that
28
+ * predates this feature - and every message from a client that does not
29
+ * speak it - takes the second path.
30
+ */
31
+ export declare const getMessageAttachments: (message?: (Pick<IMessage, "attachments" | "location" | "locationPreview" | "mimetype" | "originalName" | "fileName" | "size"> & {
32
+ duration?: unknown;
33
+ mediaDuration?: unknown;
34
+ }) | null) => IAttachment[];
35
+ /**
36
+ * True when the message carries a file: flagged `isMediafile`, or (older
37
+ * senders that never set the flag) with a real file URL or attachment. The
38
+ * one test every surface uses for "is this a media bubble".
39
+ */
40
+ export declare const isMediaMessage: (message?: (Partial<Pick<IMessage, "isDeleted" | "isMediafile" | "attachments">> & {
41
+ location?: unknown;
42
+ mimetype?: unknown;
43
+ originalName?: unknown;
44
+ fileName?: unknown;
45
+ locationPreview?: unknown;
46
+ }) | null) => boolean;
47
+ /**
48
+ * Maps one object from POST /files/ `results` to the attachment a sent
49
+ * message carries. Field names here follow the API's own spelling
50
+ * (`originalname`, `filename`), not the wire attribute names.
51
+ */
52
+ export declare const toUploadedAttachment: (raw: any) => IAttachment;
53
+ /** Name to show for an attachment, with the URL tail as the last resort. */
54
+ export declare const getAttachmentName: (attachment: IAttachment) => string;
55
+ //# sourceMappingURL=attachments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../../src/helpers/attachments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAWvD;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAsB9C;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,KAAK,OAAO,KAAG,WAAW,GAAG,IAuChE,CAAC;AAqEF,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,GAAI,KAAK,OAAO,KAAG,WAAW,EAQ1D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,aAAa,WAAW,EAAE,KAAG,MAY/D,CAAC;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAChC,UAAU,CAAA,IAAI,CACZ,QAAQ,EACN,aAAa,GACb,UAAU,GACV,iBAAiB,GACjB,UAAU,GACV,cAAc,GACd,UAAU,GACV,MAAM,CACT,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,IAAG,IAAI,KACzD,WAAW,EAwCb,CAAC;AAiBF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GACzB,UACI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,GAAG,aAAa,GAAG,aAAa,CAAC,CAAC,GAAG;IACtE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC,GACF,IAAI,KACP,OAMF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,GAAG,KAAG,WAsB9C,CAAC;AAEH,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,GAAI,YAAY,WAAW,KAAG,MAI/C,CAAC"}
@@ -0,0 +1,64 @@
1
+ import { IMentionSpan } from '../types/types';
2
+ /**
3
+ * The text typed with a set of attachments, sent as part of the media
4
+ * message itself (never as a separate text stanza).
5
+ *
6
+ * `mentions` index into `text`, the same way a text message's mention spans
7
+ * index into its body.
8
+ */
9
+ export interface CaptionInput {
10
+ text: string;
11
+ mentions?: IMentionSpan[];
12
+ }
13
+ export interface NormalizedCaption {
14
+ caption: string;
15
+ mentions?: IMentionSpan[];
16
+ }
17
+ /**
18
+ * Mention spans for a caption, checked against the caption text: a span that
19
+ * no longer reads "@Name" at its offset is dropped. Undefined when nothing is
20
+ * left, so a caption without mentions carries no empty attribute.
21
+ */
22
+ export declare const normalizeCaptionMentions: (value: unknown, caption: string) => IMentionSpan[] | undefined;
23
+ /**
24
+ * Turns what the composer typed into the caption that travels with the
25
+ * media. Undefined for blank text, which means "no caption".
26
+ */
27
+ export declare const normalizeCaptionInput: (input?: CaptionInput | null) => NormalizedCaption | undefined;
28
+ /** What a media message's text is, and the @-mention spans that index into it. */
29
+ export interface ResolvedCaption {
30
+ text: string;
31
+ mentions?: IMentionSpan[];
32
+ }
33
+ export interface CaptionOptions {
34
+ /**
35
+ * The caller already knows this is a media message (a thin `lastMessage`
36
+ * that only says so by its id). Otherwise it is read off the message.
37
+ */
38
+ isMedia?: boolean;
39
+ /** The message is sealed: only a caption that came out of the envelope counts. */
40
+ sealed?: boolean;
41
+ /** Extra names of the sender, which a body may merely echo. */
42
+ senderNames?: string[];
43
+ }
44
+ /**
45
+ * The text of a media message, from whichever format carried it. The one
46
+ * place that knows the formats, so every surface (bubble, room list preview,
47
+ * notification, reply quote, copy) agrees:
48
+ *
49
+ * 1. `caption` (+ `captionMentions`): what this SDK sends. The only source
50
+ * for a sealed message, whose caption comes out of the envelope.
51
+ * 2. The caption under another name on `<data>` (`captionText`, `text`,
52
+ * `message`, `description`, `title`) from other clients.
53
+ * 3. A real `body`: older clients and other SDKs put the text in the
54
+ * `<body>` of the media message itself. "media", the file's name or URL,
55
+ * the sender's own name or e-mail and generated labels are not text.
56
+ *
57
+ * Never derived for a sealed message, and never for a message with no file.
58
+ */
59
+ export declare const resolveMessageCaption: (message?: object | null, options?: CaptionOptions) => ResolvedCaption | undefined;
60
+ /** The caption a message carries, or undefined when it has none. */
61
+ export declare const getMessageCaption: (message?: object | null, options?: CaptionOptions) => string | undefined;
62
+ /** The mention spans of `getMessageCaption`'s text. */
63
+ export declare const getMessageCaptionMentions: (message?: object | null, options?: CaptionOptions) => IMentionSpan[] | undefined;
64
+ //# sourceMappingURL=caption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caption.d.ts","sourceRoot":"","sources":["../../../src/helpers/caption.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAK9C;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B;AAeD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GACnC,OAAO,OAAO,EACd,SAAS,MAAM,KACd,YAAY,EAAE,GAAG,SAMnB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAChC,QAAQ,YAAY,GAAG,IAAI,KAC1B,iBAAiB,GAAG,SAKtB,CAAC;AAEF,kFAAkF;AAClF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kFAAkF;IAClF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AA2ID;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,GAChC,UAAU,MAAM,GAAG,IAAI,EACvB,UAAS,cAAmB,KAC3B,eAAe,GAAG,SAiCpB,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,GAC5B,UAAU,MAAM,GAAG,IAAI,EACvB,UAAU,cAAc,KACvB,MAAM,GAAG,SAA0D,CAAC;AAEvE,uDAAuD;AACvD,eAAO,MAAM,yBAAyB,GACpC,UAAU,MAAM,GAAG,IAAI,EACvB,UAAU,cAAc,KACvB,YAAY,EAAE,GAAG,SAA8D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createMainMessageForThread.d.ts","sourceRoot":"","sources":["../../../src/helpers/createMainMessageForThread.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,eAAO,MAAM,0BAA0B,GAAI,SAAS,QAAQ,KAAG,MAoB9D,CAAC"}
1
+ {"version":3,"file":"createMainMessageForThread.d.ts","sourceRoot":"","sources":["../../../src/helpers/createMainMessageForThread.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,eAAO,MAAM,0BAA0B,GAAI,SAAS,QAAQ,KAAG,MAwB9D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createMessageFromXml.d.ts","sourceRoot":"","sources":["../../../src/helpers/createMessageFromXml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAK1C,UAAU,mBAAoB,SAAQ,QAAQ;IAC5C,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,GAC/B,KAAK,mBAAmB,EACxB,SAAS,GAAG,EACZ,eAAe,MAAM,EACrB,iBAAiB,MAAM,EACvB,oBAAoB,OAAO,KAC1B,OAAO,CAAC,QAAQ,CAmIlB,CAAC"}
1
+ {"version":3,"file":"createMessageFromXml.d.ts","sourceRoot":"","sources":["../../../src/helpers/createMessageFromXml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM1C,UAAU,mBAAoB,SAAQ,QAAQ;IAC5C,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,GAC/B,KAAK,mBAAmB,EACxB,SAAS,GAAG,EACZ,eAAe,MAAM,EACrB,iBAAiB,MAAM,EACvB,oBAAoB,OAAO,KAC1B,OAAO,CAAC,QAAQ,CAkJlB,CAAC"}
@@ -0,0 +1,20 @@
1
+ export type FileKind = 'image' | 'video' | 'audio' | 'file';
2
+ interface FileKindInput {
3
+ mimetype?: string | null;
4
+ name?: string | null;
5
+ url?: string | null;
6
+ duration?: number | string | null;
7
+ waveForm?: string | null;
8
+ originalName?: string | null;
9
+ }
10
+ /**
11
+ * Which card a file gets in a bubble. Mirrors the branches MediaMessage has
12
+ * always used for a single file (image, video, audio, octet-stream as a voice
13
+ * note, then the voice-message heuristics) so an album, a card stack and a
14
+ * lone file all agree on what a given file is.
15
+ */
16
+ export declare const getFileKind: (input: FileKindInput) => FileKind;
17
+ /** True for the kinds that sit in the picture/video album. */
18
+ export declare const isAlbumKind: (kind: FileKind) => boolean;
19
+ export {};
20
+ //# sourceMappingURL=fileKind.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileKind.d.ts","sourceRoot":"","sources":["../../../src/helpers/fileKind.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAE5D,UAAU,aAAa;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,aAAa,KAAG,QAclD,CAAC;AAEF,8DAA8D;AAC9D,eAAO,MAAM,WAAW,GAAI,MAAM,QAAQ,KAAG,OACP,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getDataFromXml.d.ts","sourceRoot":"","sources":["../../../src/helpers/getDataFromXml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAoDtD,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CAC5B;AACD,eAAO,MAAM,cAAc,GAAU,QAAQ,OAAO,KAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAyEjF,CAAC"}
1
+ {"version":3,"file":"getDataFromXml.d.ts","sourceRoot":"","sources":["../../../src/helpers/getDataFromXml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAqDtD,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CAC5B;AACD,eAAO,MAAM,cAAc,GAAU,QAAQ,OAAO,KAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CA4EjF,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Runs `worker` over `items` with at most `limit` calls in flight, and
3
+ * resolves with the results in INPUT order, whatever order the calls finish
4
+ * in. Workers that throw are reported as rejected entries instead of
5
+ * aborting the rest of the batch, so one failed upload never stops its
6
+ * siblings.
7
+ */
8
+ export declare function mapWithConcurrency<T, R>(items: readonly T[], limit: number, worker: (item: T, index: number) => Promise<R>): Promise<PromiseSettledResult<R>[]>;
9
+ //# sourceMappingURL=mapWithConcurrency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapWithConcurrency.d.ts","sourceRoot":"","sources":["../../../src/helpers/mapWithConcurrency.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAC3C,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAC7C,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC,CAoBpC"}
@@ -0,0 +1,13 @@
1
+ import type { IConfig } from '../types/types';
2
+ /** Hard client-side cap on a single upload. Mirrors the backend's body limit. */
3
+ export declare const MAX_MEDIA_BYTES: number;
4
+ /** The most files one message may carry (also the parser-side ceiling). */
5
+ export declare const MAX_MEDIA_FILES = 10;
6
+ /** Files per message the host allows: `attachments.maxFiles`, clamped to 1-10. */
7
+ export declare const mediaFileCap: (config?: Pick<IConfig, "attachments"> | null) => number;
8
+ /**
9
+ * Bytes allowed per file: the 50 MB upload cap, lowered by
10
+ * `attachments.maxSizeMB` when the host sets a smaller one.
11
+ */
12
+ export declare const mediaSizeLimit: (config?: Pick<IConfig, "attachments"> | null, override?: number) => number;
13
+ //# sourceMappingURL=mediaLimits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mediaLimits.d.ts","sourceRoot":"","sources":["../../../src/helpers/mediaLimits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,iFAAiF;AACjF,eAAO,MAAM,eAAe,QAAmB,CAAC;AAEhD,2EAA2E;AAC3E,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,kFAAkF;AAClF,eAAO,MAAM,YAAY,GAAI,SAAS,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,GAAG,IAAI,KAAG,MAI3E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,GACzB,SAAS,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,GAAG,IAAI,EAC5C,WAAW,MAAM,KAChB,MAIF,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Retry hooks for media messages whose uploads did not all land.
3
+ *
4
+ * The send closure lives inside useSendMessage, but the bubble that shows
5
+ * "Retry" on a tile is somewhere else in the tree and has no access to it.
6
+ * The send registers its retry runner under the message id while the
7
+ * message is unsent, and the bubble looks it up here. The runner is removed
8
+ * as soon as the message is delivered.
9
+ */
10
+ export type MediaRetryRunner = (indices?: number[]) => Promise<boolean>;
11
+ export declare const registerMediaRetry: (messageId: string, runner: MediaRetryRunner) => void;
12
+ export declare const unregisterMediaRetry: (messageId: string) => void;
13
+ export declare const hasMediaRetry: (messageId: string) => boolean;
14
+ /**
15
+ * Re-runs the uploads still missing for `messageId` (only `index` / `indices`
16
+ * when given), then sends the message once every file is in. Resolves to
17
+ * false when nothing is registered or the attempt did not deliver.
18
+ */
19
+ export declare const retryMediaSend: (messageId: string, index?: number | number[]) => Promise<boolean>;
20
+ /**
21
+ * Asks for one file of `messageId` to be retried. Requests made in the same
22
+ * tick are merged into one run: the runner takes a single run at a time, so
23
+ * a separate call per tile would drop every retry after the first.
24
+ */
25
+ export declare const requestMediaRetry: (messageId: string, index: number) => void;
26
+ //# sourceMappingURL=mediaSendRetry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mediaSendRetry.d.ts","sourceRoot":"","sources":["../../../src/helpers/mediaSendRetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAIxE,eAAO,MAAM,kBAAkB,GAAI,WAAW,MAAM,EAAE,QAAQ,gBAAgB,KAAG,IAEhF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,WAAW,MAAM,KAAG,IAExD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,WAAW,MAAM,KAAG,OAAiC,CAAC;AAEpF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GACzB,WAAW,MAAM,EACjB,QAAQ,MAAM,GAAG,MAAM,EAAE,KACxB,OAAO,CAAC,OAAO,CAKjB,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,WAAW,MAAM,EAAE,OAAO,MAAM,KAAG,IAYpE,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Normalises the media parts of a message's flat `<data>` attributes:
3
+ *
4
+ * - `attachments` (a JSON string on the wire) becomes the typed array, or is
5
+ * dropped when it decodes to nothing so the flat legacy fields win;
6
+ * - `caption` is kept only when it holds text, with `captionMentions` (JSON
7
+ * on the wire) checked against it;
8
+ * - in a sealed message (`clientEncrypted`) the caption attributes are
9
+ * always dropped: the only caption such a message may show is the one
10
+ * inside its encrypted body, which the caller lifts afterwards.
11
+ *
12
+ * Safe to apply twice, so the wrapped and the positional parsers can both
13
+ * call it.
14
+ */
15
+ export declare const normalizeMediaDataAttrs: (attrs: Record<string, any>) => Record<string, any>;
16
+ //# sourceMappingURL=mediaWireData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mediaWireData.d.ts","sourceRoot":"","sources":["../../../src/helpers/mediaWireData.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KACzB,MAAM,CAAC,MAAM,EAAE,GAAG,CAqCpB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { IMentionSpan } from '../types/models/message.model';
2
+ /**
3
+ * Keeps only the spans that still read "@Name" at their offset in `text`.
4
+ * RN does not render mentions; a caption's spans are stored (and checked) so
5
+ * they survive a round trip to a client that does.
6
+ */
7
+ export declare const validateMentionSpans: (text: string, spans: IMentionSpan[]) => IMentionSpan[];
8
+ //# sourceMappingURL=mentionSpans.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mentionSpans.d.ts","sourceRoot":"","sources":["../../../src/helpers/mentionSpans.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAC/B,MAAM,MAAM,EACZ,OAAO,YAAY,EAAE,KACpB,YAAY,EAMX,CAAC"}
@@ -1,3 +1,10 @@
1
+ /** A mimetype that says nothing: empty, or the storage's "could not sniff". */
2
+ export declare function isGenericMime(mime: string | undefined | null): boolean;
3
+ /**
4
+ * The mimetype a file name's extension stands for, for the pictures, videos,
5
+ * audio and PDFs a bubble can show. Undefined for anything else.
6
+ */
7
+ export declare function inferMimeFromName(name: string | undefined | null): string | undefined;
1
8
  /**
2
9
  * Returns true when the (mime, fileName, url) triple looks like an
3
10
  * audio payload — either by mime, by recognised extension on the
@@ -1 +1 @@
1
- {"version":3,"file":"mimeToExtension.d.ts","sourceRoot":"","sources":["../../../src/helpers/mimeToExtension.ts"],"names":[],"mappings":"AAkGA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAC/B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,EACxB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,EACnB,IAAI,CAAC,EAAE;IACL,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,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AAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,GAAG,OAAO,CAiBV;AAED,wBAAgB,iCAAiC,CAAC,IAAI,EAAE;IACtD,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,GAAG,MAAM,CAcT;AAED,wBAAgB,gCAAgC,CAAC,IAAI,EAAE;IACrD,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,GAAG,OAAO,CAgBV;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EACnC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAC9B,MAAM,CAKR"}
@@ -0,0 +1,82 @@
1
+ import type { IMessage, IRoom } from '../types/types';
2
+ export type ReceiptStatus = 'sent' | 'delivered' | 'seen';
3
+ /** Names listed in a "Read by" / "Delivered to" sheet before the rest become "+N". */
4
+ export declare const RECEIPT_NAME_LIMIT = 5;
5
+ /** Stanza ids of the receipt and marker frames (never chat messages). */
6
+ export declare const isReceiptMarkerId: (id: unknown) => boolean;
7
+ /**
8
+ * The message id that becomes this reader's read watermark, or null when
9
+ * nothing should be sent: no displayable message, the newest message is the
10
+ * reader's own (nothing to report), or a read boundary (the reader scrolled
11
+ * up) sits before every message. With a boundary the watermark is the newest
12
+ * message at or before it, so a scrolled-up reader never claims messages they
13
+ * did not reach.
14
+ */
15
+ export declare const getReadWatermarkMessageId: (room: Pick<IRoom, "messages"> | null | undefined, selfXmppUsername: string, boundaryTs?: number | null) => string | null;
16
+ /** The slice of the redux state the receipt rules read. */
17
+ export interface ReceiptStoreState {
18
+ chatSettingStore?: {
19
+ config?: {
20
+ disableLastRead?: boolean;
21
+ disableReadReceipts?: boolean;
22
+ } | null;
23
+ user?: {
24
+ xmppUsername?: string | null;
25
+ walletAddress?: string | null;
26
+ } | null;
27
+ } | null;
28
+ rooms: {
29
+ rooms: Record<string, IRoom>;
30
+ visibleRoomJID: string | null;
31
+ jumpWindow: {
32
+ roomJID: string;
33
+ } | null;
34
+ readBoundaries: Record<string, number>;
35
+ };
36
+ }
37
+ export declare const selfIdentity: (state: ReceiptStoreState) => string;
38
+ /**
39
+ * Watermark to send for `roomJid` right now, or null. Sends only while the
40
+ * room is the one on screen, never while an old-history jump window is open,
41
+ * and never when read markers are switched off (`disableLastRead` or
42
+ * `disableReadReceipts`).
43
+ */
44
+ export declare const computeReadWatermark: (state: ReceiptStoreState, roomJid: string) => string | null;
45
+ /**
46
+ * Other occupants whose read watermark sits at or after `messageId` in the
47
+ * room's list. Returns the shared empty array when there are none, so the
48
+ * selector result stays shallow-equal between store updates.
49
+ */
50
+ export declare const viewersAtOrAfter: (room: Pick<IRoom, "messages" | "lastDisplayedByUser"> | null | undefined, messageId: string, selfXmppUsername: string) => string[];
51
+ /** Selector form of viewersAtOrAfter, keyed by room and message. */
52
+ export declare const selectSeenBy: (state: {
53
+ rooms: {
54
+ rooms: Record<string, IRoom>;
55
+ };
56
+ }, roomJid: string, messageId: string, selfXmppUsername: string) => string[];
57
+ /**
58
+ * sent / delivered / seen for one of the reader's own messages. "seen" wins
59
+ * over "delivered", which wins over "sent". Only other occupants count.
60
+ */
61
+ export declare const deliveredToOthers: (message: Pick<IMessage, "receivedBy">, selfXmppUsername: string) => string[];
62
+ export declare const statusOf: (seenBy: string[], deliveredTo: string[]) => ReceiptStatus;
63
+ export declare const getReceiptStatus: (message: Pick<IMessage, "id" | "receivedBy">, room: Pick<IRoom, "messages" | "lastDisplayedByUser"> | null | undefined, selfXmppUsername: string) => {
64
+ status: ReceiptStatus;
65
+ seenBy: string[];
66
+ deliveredTo: string[];
67
+ };
68
+ /** Display name for a receipt entry: usersSet first, the raw username as the last resort. */
69
+ export declare const receiptNameFor: (usersSet: Record<string, any> | undefined, xmppUsername: string) => string;
70
+ /**
71
+ * Text for the tick's details sheet. Groups name the readers or recipients
72
+ * (capped, then "+N"); a 1:1 room only says Read / Delivered.
73
+ */
74
+ export declare const describeReceipt: ({ status, isGroup, seenBy, deliveredTo, nameOf, t, }: {
75
+ status: ReceiptStatus;
76
+ isGroup: boolean;
77
+ seenBy: string[];
78
+ deliveredTo: string[];
79
+ nameOf: (xmppUsername: string) => string;
80
+ t: (key: string, vars?: Record<string, string | number>) => string;
81
+ }) => string;
82
+ //# sourceMappingURL=readReceipts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readReceipts.d.ts","sourceRoot":"","sources":["../../../src/helpers/readReceipts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAatD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;AAE1D,sFAAsF;AACtF,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAIpC,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,GAAI,IAAI,OAAO,KAAG,OAG/C,CAAC;AAYF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,GACpC,MAAM,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,IAAI,GAAG,SAAS,EAChD,kBAAkB,MAAM,EACxB,aAAa,MAAM,GAAG,IAAI,KACzB,MAAM,GAAG,IAaX,CAAC;AAEF,2DAA2D;AAC3D,MAAM,WAAW,iBAAiB;IAChC,gBAA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AC,QAAQ,EAAE,YAAY,CAAC,EACrC,kBAAkB,MAAM,KACvB,MAAM,EAGN,CAAC;AAEJ,eAAO,MAAM,QAAQ,GAAI,QAAQ,MAAM,EAAE,EAAE,aAAa,MAAM,EAAE,KAAG,aACS,CAAC;AAE7E,eAAO,MAAM,gBAAgB,GAC3B,SAAS,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,YAAY,CAAC,EAC5C,MAAM,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,qBAAqB,CAAC,GAAG,IAAI,GAAG,SAAS,EACxE,kBAAkB,MAAM,KACvB;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAIlE,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,cAAc,GACzB,UAAU,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,EACzC,cAAc,MAAM,KACnB,MAGF,CAAC;AAQF;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,sDAO7B;IACD,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;CACpE,KAAG,MAcH,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Repairs file names the backend returns as UTF-8 bytes read as Latin-1
3
+ * (the classic multer/busboy `originalname` problem): "Список.pdf" arrives
4
+ * as "СпиÑок.pdf".
5
+ *
6
+ * Pure and conservative: a name is only replaced when every character fits
7
+ * in one byte, the bytes decode as strict UTF-8, the result differs, holds
8
+ * no replacement or control characters and contains at least one letter
9
+ * outside basic Latin. A correct name is returned untouched.
10
+ */
11
+ export declare const repairFilenameEncoding: (name: string) => string;
12
+ //# sourceMappingURL=repairFilenameEncoding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repairFilenameEncoding.d.ts","sourceRoot":"","sources":["../../../src/helpers/repairFilenameEncoding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAuDH,eAAO,MAAM,sBAAsB,GAAI,MAAM,MAAM,KAAG,MAiBrD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const safeJsonParse: <T>(rawValue: unknown, fallback: T) => T;
2
+ //# sourceMappingURL=safeJson.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safeJson.d.ts","sourceRoot":"","sources":["../../../src/helpers/safeJson.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,UAAU,OAAO,EAAE,UAAU,CAAC,KAAG,CAUjE,CAAC"}