@ethora/chat-component-rn 26.10.4 → 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.
- package/CHANGELOG.md +8 -0
- package/README.md +15 -0
- package/app.plugin.js +2 -0
- package/lib/commonjs/assets/icons.js +2 -2
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/MainComponents/AlbumGrid.js +152 -0
- package/lib/commonjs/components/MainComponents/AlbumGrid.js.map +1 -0
- package/lib/commonjs/components/MainComponents/ChatRoom.js +2 -2
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MediaMessage.js +199 -123
- package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MediaUploadOverlay.js +109 -0
- package/lib/commonjs/components/MainComponents/MediaUploadOverlay.js.map +1 -0
- package/lib/commonjs/components/MessageBubble/MediaCaption.js +51 -0
- package/lib/commonjs/components/MessageBubble/MediaCaption.js.map +1 -0
- package/lib/commonjs/components/MessageBubble/Message.js +40 -1
- package/lib/commonjs/components/MessageBubble/Message.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/MessageInteractions.js +2 -1
- package/lib/commonjs/components/MessageBubble/MessageInteractions.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +75 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/LastMessageItem.js +20 -4
- package/lib/commonjs/components/RoomComponents/LastMessageItem.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastAudioMessage.js +3 -2
- package/lib/commonjs/components/RoomComponents/styled/LastAudioMessage.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js +3 -2
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js +3 -2
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js +3 -2
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/commonjs/components/Thread/ThreadWrapper.js +3 -2
- package/lib/commonjs/components/Thread/ThreadWrapper.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/ActiveCallBar.js +61 -16
- package/lib/commonjs/components/VideoCalls/ActiveCallBar.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/CallIcons.js +41 -16
- package/lib/commonjs/components/VideoCalls/CallIcons.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/VideoCallOverlay.js +183 -9
- package/lib/commonjs/components/VideoCalls/VideoCallOverlay.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js +40 -15
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/callSessionController.js +49 -26
- package/lib/commonjs/components/VideoCalls/callSessionController.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/callUiStore.js +33 -4
- package/lib/commonjs/components/VideoCalls/callUiStore.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/livekitRuntime.js +9 -1
- package/lib/commonjs/components/VideoCalls/livekitRuntime.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/useCallKeep.js +197 -28
- package/lib/commonjs/components/VideoCalls/useCallKeep.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/useOngoingCallNotification.js +88 -0
- package/lib/commonjs/components/VideoCalls/useOngoingCallNotification.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/usePipTile.js +232 -0
- package/lib/commonjs/components/VideoCalls/usePipTile.js.map +1 -0
- package/lib/commonjs/components/styled/MediaFilePreview.js +60 -47
- package/lib/commonjs/components/styled/MediaFilePreview.js.map +1 -1
- package/lib/commonjs/components/styled/MessageImage.js +16 -6
- package/lib/commonjs/components/styled/MessageImage.js.map +1 -1
- package/lib/commonjs/components/styled/SendInput.js +99 -68
- package/lib/commonjs/components/styled/SendInput.js.map +1 -1
- package/lib/commonjs/components/styled/VideoMessage.js +24 -10
- package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
- package/lib/commonjs/context/xmppProvider.js +46 -0
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/e2ee/fileEnvelope.js +6 -0
- package/lib/commonjs/e2ee/fileEnvelope.js.map +1 -1
- package/lib/commonjs/e2ee/sealedBody.js +32 -2
- package/lib/commonjs/e2ee/sealedBody.js.map +1 -1
- package/lib/commonjs/helpers/albumLayout.js +150 -0
- package/lib/commonjs/helpers/albumLayout.js.map +1 -0
- package/lib/commonjs/helpers/attachments.js +255 -0
- package/lib/commonjs/helpers/attachments.js.map +1 -0
- package/lib/commonjs/helpers/caption.js +214 -0
- package/lib/commonjs/helpers/caption.js.map +1 -0
- package/lib/commonjs/helpers/createMainMessageForThread.js +5 -1
- package/lib/commonjs/helpers/createMainMessageForThread.js.map +1 -1
- package/lib/commonjs/helpers/createMessageFromXml.js +19 -5
- package/lib/commonjs/helpers/createMessageFromXml.js.map +1 -1
- package/lib/commonjs/helpers/fileKind.js +40 -0
- package/lib/commonjs/helpers/fileKind.js.map +1 -0
- package/lib/commonjs/helpers/getDataFromXml.js +6 -1
- package/lib/commonjs/helpers/getDataFromXml.js.map +1 -1
- package/lib/commonjs/helpers/mapWithConcurrency.js +41 -0
- package/lib/commonjs/helpers/mapWithConcurrency.js.map +1 -0
- package/lib/commonjs/helpers/mediaLimits.js +33 -0
- package/lib/commonjs/helpers/mediaLimits.js.map +1 -0
- package/lib/commonjs/helpers/mediaSendRetry.js +64 -0
- package/lib/commonjs/helpers/mediaSendRetry.js.map +1 -0
- package/lib/commonjs/helpers/mediaWireData.js +62 -0
- package/lib/commonjs/helpers/mediaWireData.js.map +1 -0
- package/lib/commonjs/helpers/mentionSpans.js +19 -0
- package/lib/commonjs/helpers/mentionSpans.js.map +1 -0
- package/lib/commonjs/helpers/mimeToExtension.js +45 -0
- package/lib/commonjs/helpers/mimeToExtension.js.map +1 -1
- package/lib/commonjs/helpers/readReceipts.js +173 -0
- package/lib/commonjs/helpers/readReceipts.js.map +1 -0
- package/lib/commonjs/helpers/repairFilenameEncoding.js +79 -0
- package/lib/commonjs/helpers/repairFilenameEncoding.js.map +1 -0
- package/lib/commonjs/helpers/safeJson.js +18 -0
- package/lib/commonjs/helpers/safeJson.js.map +1 -0
- package/lib/commonjs/helpers/updateMessagesTillLast.js +3 -1
- package/lib/commonjs/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/commonjs/hooks/useSendMessage.js +384 -193
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +144 -0
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/networking/api-requests/auth.api.js +62 -3
- package/lib/commonjs/networking/api-requests/auth.api.js.map +1 -1
- package/lib/commonjs/networking/stanzaHandlers.js +100 -3
- package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
- package/lib/commonjs/networking/xmpp/handleStanzas.xmpp.js +4 -2
- package/lib/commonjs/networking/xmpp/handleStanzas.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/sendDisplayedMarker.xmpp.js +28 -0
- package/lib/commonjs/networking/xmpp/sendDisplayedMarker.xmpp.js.map +1 -0
- package/lib/commonjs/networking/xmpp/sendMediaMessage.xmpp.js +53 -2
- package/lib/commonjs/networking/xmpp/sendMediaMessage.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/sendReceivedReceipt.xmpp.js +28 -0
- package/lib/commonjs/networking/xmpp/sendReceivedReceipt.xmpp.js.map +1 -0
- package/lib/commonjs/networking/xmppClient.js +64 -0
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/persistence.js +78 -5
- package/lib/commonjs/roomStore/persistence.js.map +1 -1
- package/lib/commonjs/roomStore/roomHeapSlice.js +4 -0
- package/lib/commonjs/roomStore/roomHeapSlice.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +114 -1
- package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
- package/lib/commonjs/types/models/attachment.model.js +2 -0
- package/lib/commonjs/types/models/attachment.model.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/module/assets/icons.js +1 -1
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/MainComponents/AlbumGrid.js +146 -0
- package/lib/module/components/MainComponents/AlbumGrid.js.map +1 -0
- package/lib/module/components/MainComponents/ChatRoom.js +2 -2
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/MediaMessage.js +200 -124
- package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/module/components/MainComponents/MediaUploadOverlay.js +104 -0
- package/lib/module/components/MainComponents/MediaUploadOverlay.js.map +1 -0
- package/lib/module/components/MessageBubble/MediaCaption.js +46 -0
- package/lib/module/components/MessageBubble/MediaCaption.js.map +1 -0
- package/lib/module/components/MessageBubble/Message.js +44 -5
- package/lib/module/components/MessageBubble/Message.js.map +1 -1
- package/lib/module/components/MessageBubble/MessageInteractions.js +2 -1
- package/lib/module/components/MessageBubble/MessageInteractions.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +75 -0
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/module/components/RoomComponents/LastMessageItem.js +20 -4
- package/lib/module/components/RoomComponents/LastMessageItem.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastAudioMessage.js +3 -2
- package/lib/module/components/RoomComponents/styled/LastAudioMessage.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js +3 -2
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js +3 -2
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js +3 -2
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/module/components/Thread/ThreadWrapper.js +3 -2
- package/lib/module/components/Thread/ThreadWrapper.js.map +1 -1
- package/lib/module/components/VideoCalls/ActiveCallBar.js +63 -18
- package/lib/module/components/VideoCalls/ActiveCallBar.js.map +1 -1
- package/lib/module/components/VideoCalls/CallIcons.js +38 -15
- package/lib/module/components/VideoCalls/CallIcons.js.map +1 -1
- package/lib/module/components/VideoCalls/VideoCallOverlay.js +185 -11
- package/lib/module/components/VideoCalls/VideoCallOverlay.js.map +1 -1
- package/lib/module/components/VideoCalls/VideoCallSession.js +41 -16
- package/lib/module/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/module/components/VideoCalls/callSessionController.js +46 -24
- package/lib/module/components/VideoCalls/callSessionController.js.map +1 -1
- package/lib/module/components/VideoCalls/callUiStore.js +30 -3
- package/lib/module/components/VideoCalls/callUiStore.js.map +1 -1
- package/lib/module/components/VideoCalls/livekitRuntime.js +9 -1
- package/lib/module/components/VideoCalls/livekitRuntime.js.map +1 -1
- package/lib/module/components/VideoCalls/useCallKeep.js +198 -29
- package/lib/module/components/VideoCalls/useCallKeep.js.map +1 -1
- package/lib/module/components/VideoCalls/useOngoingCallNotification.js +84 -0
- package/lib/module/components/VideoCalls/useOngoingCallNotification.js.map +1 -0
- package/lib/module/components/VideoCalls/usePipTile.js +228 -0
- package/lib/module/components/VideoCalls/usePipTile.js.map +1 -0
- package/lib/module/components/styled/MediaFilePreview.js +61 -48
- package/lib/module/components/styled/MediaFilePreview.js.map +1 -1
- package/lib/module/components/styled/MessageImage.js +16 -6
- package/lib/module/components/styled/MessageImage.js.map +1 -1
- package/lib/module/components/styled/SendInput.js +99 -68
- package/lib/module/components/styled/SendInput.js.map +1 -1
- package/lib/module/components/styled/VideoMessage.js +24 -10
- package/lib/module/components/styled/VideoMessage.js.map +1 -1
- package/lib/module/context/xmppProvider.js +46 -0
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/e2ee/fileEnvelope.js +1 -1
- package/lib/module/e2ee/fileEnvelope.js.map +1 -1
- package/lib/module/e2ee/sealedBody.js +32 -2
- package/lib/module/e2ee/sealedBody.js.map +1 -1
- package/lib/module/helpers/albumLayout.js +143 -0
- package/lib/module/helpers/albumLayout.js.map +1 -0
- package/lib/module/helpers/attachments.js +245 -0
- package/lib/module/helpers/attachments.js.map +1 -0
- package/lib/module/helpers/caption.js +207 -0
- package/lib/module/helpers/caption.js.map +1 -0
- package/lib/module/helpers/createMainMessageForThread.js +5 -1
- package/lib/module/helpers/createMainMessageForThread.js.map +1 -1
- package/lib/module/helpers/createMessageFromXml.js +20 -6
- package/lib/module/helpers/createMessageFromXml.js.map +1 -1
- package/lib/module/helpers/fileKind.js +34 -0
- package/lib/module/helpers/fileKind.js.map +1 -0
- package/lib/module/helpers/getDataFromXml.js +6 -1
- package/lib/module/helpers/getDataFromXml.js.map +1 -1
- package/lib/module/helpers/mapWithConcurrency.js +37 -0
- package/lib/module/helpers/mapWithConcurrency.js.map +1 -0
- package/lib/module/helpers/mediaLimits.js +27 -0
- package/lib/module/helpers/mediaLimits.js.map +1 -0
- package/lib/module/helpers/mediaSendRetry.js +55 -0
- package/lib/module/helpers/mediaSendRetry.js.map +1 -0
- package/lib/module/helpers/mediaWireData.js +58 -0
- package/lib/module/helpers/mediaWireData.js.map +1 -0
- package/lib/module/helpers/mentionSpans.js +14 -0
- package/lib/module/helpers/mentionSpans.js.map +1 -0
- package/lib/module/helpers/mimeToExtension.js +43 -0
- package/lib/module/helpers/mimeToExtension.js.map +1 -1
- package/lib/module/helpers/readReceipts.js +160 -0
- package/lib/module/helpers/readReceipts.js.map +1 -0
- package/lib/module/helpers/repairFilenameEncoding.js +74 -0
- package/lib/module/helpers/repairFilenameEncoding.js.map +1 -0
- package/lib/module/helpers/safeJson.js +13 -0
- package/lib/module/helpers/safeJson.js.map +1 -0
- package/lib/module/helpers/updateMessagesTillLast.js +3 -1
- package/lib/module/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/module/hooks/useSendMessage.js +387 -195
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/i18n/strings.js +144 -0
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/main.js.map +1 -1
- package/lib/module/networking/api-requests/auth.api.js +62 -3
- package/lib/module/networking/api-requests/auth.api.js.map +1 -1
- package/lib/module/networking/stanzaHandlers.js +97 -4
- package/lib/module/networking/stanzaHandlers.js.map +1 -1
- package/lib/module/networking/xmpp/handleStanzas.xmpp.js +5 -3
- package/lib/module/networking/xmpp/handleStanzas.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/sendDisplayedMarker.xmpp.js +25 -0
- package/lib/module/networking/xmpp/sendDisplayedMarker.xmpp.js.map +1 -0
- package/lib/module/networking/xmpp/sendMediaMessage.xmpp.js +53 -2
- package/lib/module/networking/xmpp/sendMediaMessage.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/sendReceivedReceipt.xmpp.js +25 -0
- package/lib/module/networking/xmpp/sendReceivedReceipt.xmpp.js.map +1 -0
- package/lib/module/networking/xmppClient.js +64 -0
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/persistence.js +78 -5
- package/lib/module/roomStore/persistence.js.map +1 -1
- package/lib/module/roomStore/roomHeapSlice.js +4 -0
- package/lib/module/roomStore/roomHeapSlice.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +109 -0
- package/lib/module/roomStore/roomsSlice.js.map +1 -1
- package/lib/module/types/models/attachment.model.js +2 -0
- package/lib/module/types/models/attachment.model.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/assets/icons.d.ts +6 -1
- package/lib/typescript/assets/icons.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/AlbumGrid.d.ts +21 -0
- package/lib/typescript/components/MainComponents/AlbumGrid.d.ts.map +1 -0
- package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MediaUploadOverlay.d.ts +17 -0
- package/lib/typescript/components/MainComponents/MediaUploadOverlay.d.ts.map +1 -0
- package/lib/typescript/components/MessageBubble/MediaCaption.d.ts +12 -0
- package/lib/typescript/components/MessageBubble/MediaCaption.d.ts.map +1 -0
- package/lib/typescript/components/MessageBubble/Message.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts.map +1 -1
- package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/LastMessageItem.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastAudioMessage.d.ts +2 -0
- package/lib/typescript/components/RoomComponents/styled/LastAudioMessage.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts +2 -0
- package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts +2 -0
- package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts +2 -0
- package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts.map +1 -1
- package/lib/typescript/components/Thread/ThreadWrapper.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/ActiveCallBar.d.ts +9 -3
- package/lib/typescript/components/VideoCalls/ActiveCallBar.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/CallIcons.d.ts +9 -0
- package/lib/typescript/components/VideoCalls/CallIcons.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/VideoCallOverlay.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/callSessionController.d.ts +7 -0
- package/lib/typescript/components/VideoCalls/callSessionController.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/callUiStore.d.ts +13 -0
- package/lib/typescript/components/VideoCalls/callUiStore.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/livekitRuntime.d.ts +5 -0
- package/lib/typescript/components/VideoCalls/livekitRuntime.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/useCallKeep.d.ts +12 -0
- package/lib/typescript/components/VideoCalls/useCallKeep.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/useOngoingCallNotification.d.ts +10 -0
- package/lib/typescript/components/VideoCalls/useOngoingCallNotification.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/usePipTile.d.ts +46 -0
- package/lib/typescript/components/VideoCalls/usePipTile.d.ts.map +1 -0
- package/lib/typescript/components/styled/MediaFilePreview.d.ts.map +1 -1
- package/lib/typescript/components/styled/MessageImage.d.ts +10 -0
- package/lib/typescript/components/styled/MessageImage.d.ts.map +1 -1
- package/lib/typescript/components/styled/SendInput.d.ts +7 -1
- package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
- package/lib/typescript/components/styled/VideoMessage.d.ts +7 -0
- package/lib/typescript/components/styled/VideoMessage.d.ts.map +1 -1
- package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
- package/lib/typescript/e2ee/fileEnvelope.d.ts +1 -1
- package/lib/typescript/e2ee/fileEnvelope.d.ts.map +1 -1
- package/lib/typescript/e2ee/sealedBody.d.ts +16 -0
- package/lib/typescript/e2ee/sealedBody.d.ts.map +1 -1
- package/lib/typescript/helpers/albumLayout.d.ts +66 -0
- package/lib/typescript/helpers/albumLayout.d.ts.map +1 -0
- package/lib/typescript/helpers/attachments.d.ts +55 -0
- package/lib/typescript/helpers/attachments.d.ts.map +1 -0
- package/lib/typescript/helpers/caption.d.ts +64 -0
- package/lib/typescript/helpers/caption.d.ts.map +1 -0
- package/lib/typescript/helpers/createMainMessageForThread.d.ts.map +1 -1
- package/lib/typescript/helpers/createMessageFromXml.d.ts.map +1 -1
- package/lib/typescript/helpers/fileKind.d.ts +20 -0
- package/lib/typescript/helpers/fileKind.d.ts.map +1 -0
- package/lib/typescript/helpers/getDataFromXml.d.ts.map +1 -1
- package/lib/typescript/helpers/mapWithConcurrency.d.ts +9 -0
- package/lib/typescript/helpers/mapWithConcurrency.d.ts.map +1 -0
- package/lib/typescript/helpers/mediaLimits.d.ts +13 -0
- package/lib/typescript/helpers/mediaLimits.d.ts.map +1 -0
- package/lib/typescript/helpers/mediaSendRetry.d.ts +26 -0
- package/lib/typescript/helpers/mediaSendRetry.d.ts.map +1 -0
- package/lib/typescript/helpers/mediaWireData.d.ts +16 -0
- package/lib/typescript/helpers/mediaWireData.d.ts.map +1 -0
- package/lib/typescript/helpers/mentionSpans.d.ts +8 -0
- package/lib/typescript/helpers/mentionSpans.d.ts.map +1 -0
- package/lib/typescript/helpers/mimeToExtension.d.ts +7 -0
- package/lib/typescript/helpers/mimeToExtension.d.ts.map +1 -1
- package/lib/typescript/helpers/readReceipts.d.ts +82 -0
- package/lib/typescript/helpers/readReceipts.d.ts.map +1 -0
- package/lib/typescript/helpers/repairFilenameEncoding.d.ts +12 -0
- package/lib/typescript/helpers/repairFilenameEncoding.d.ts.map +1 -0
- package/lib/typescript/helpers/safeJson.d.ts +2 -0
- package/lib/typescript/helpers/safeJson.d.ts.map +1 -0
- package/lib/typescript/helpers/updateMessagesTillLast.d.ts.map +1 -1
- package/lib/typescript/hooks/useSendMessage.d.ts +2 -1
- package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/main.d.ts +1 -1
- package/lib/typescript/main.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/auth.api.d.ts +2 -0
- package/lib/typescript/networking/api-requests/auth.api.d.ts.map +1 -1
- package/lib/typescript/networking/stanzaHandlers.d.ts +7 -3
- package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/handleStanzas.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/sendDisplayedMarker.xmpp.d.ts +3 -0
- package/lib/typescript/networking/xmpp/sendDisplayedMarker.xmpp.d.ts.map +1 -0
- package/lib/typescript/networking/xmpp/sendMediaMessage.xmpp.d.ts +12 -0
- package/lib/typescript/networking/xmpp/sendMediaMessage.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/sendReceivedReceipt.xmpp.d.ts +3 -0
- package/lib/typescript/networking/xmpp/sendReceivedReceipt.xmpp.d.ts.map +1 -0
- package/lib/typescript/networking/xmppClient.d.ts +15 -0
- package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
- package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomHeapSlice.d.ts +22 -1
- package/lib/typescript/roomStore/roomHeapSlice.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts +67 -3
- package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
- package/lib/typescript/types/models/attachment.model.d.ts +52 -0
- package/lib/typescript/types/models/attachment.model.d.ts.map +1 -0
- package/lib/typescript/types/models/message.model.d.ts +26 -0
- package/lib/typescript/types/models/message.model.d.ts.map +1 -1
- package/lib/typescript/types/models/modal.model.d.ts +7 -0
- package/lib/typescript/types/models/modal.model.d.ts.map +1 -1
- package/lib/typescript/types/models/room.model.d.ts +2 -0
- package/lib/typescript/types/models/room.model.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +69 -1
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +4 -1
- package/plugins/notification-service/Info.plist +31 -0
- package/plugins/notification-service/NotificationService.swift +82 -0
- package/plugins/withNotificationServiceExtension.js +137 -0
- package/src/assets/icons.tsx +20 -2
- package/src/components/MainComponents/AlbumGrid.tsx +183 -0
- package/src/components/MainComponents/ChatRoom.tsx +4 -2
- package/src/components/MainComponents/MediaMessage.tsx +246 -130
- package/src/components/MainComponents/MediaUploadOverlay.tsx +102 -0
- package/src/components/MessageBubble/MediaCaption.tsx +45 -0
- package/src/components/MessageBubble/Message.tsx +71 -3
- package/src/components/MessageBubble/MessageInteractions.tsx +2 -1
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +64 -0
- package/src/components/RoomComponents/LastMessageItem.tsx +15 -4
- package/src/components/RoomComponents/styled/LastAudioMessage.tsx +6 -3
- package/src/components/RoomComponents/styled/LastMessageFile.tsx +6 -2
- package/src/components/RoomComponents/styled/LastMessagePhoto.tsx +6 -2
- package/src/components/RoomComponents/styled/LastMessageVideo.tsx +6 -2
- package/src/components/Thread/ThreadWrapper.tsx +5 -9
- package/src/components/VideoCalls/ActiveCallBar.tsx +56 -10
- package/src/components/VideoCalls/CallIcons.tsx +36 -12
- package/src/components/VideoCalls/VideoCallOverlay.tsx +205 -8
- package/src/components/VideoCalls/VideoCallSession.tsx +45 -13
- package/src/components/VideoCalls/callSessionController.ts +51 -20
- package/src/components/VideoCalls/callUiStore.ts +33 -3
- package/src/components/VideoCalls/livekitRuntime.ts +13 -0
- package/src/components/VideoCalls/useCallKeep.ts +204 -33
- package/src/components/VideoCalls/useOngoingCallNotification.ts +113 -0
- package/src/components/VideoCalls/usePipTile.ts +214 -0
- package/src/components/styled/MediaFilePreview.tsx +49 -34
- package/src/components/styled/MessageImage.tsx +21 -5
- package/src/components/styled/SendInput.tsx +101 -87
- package/src/components/styled/VideoMessage.tsx +34 -9
- package/src/context/xmppProvider.tsx +32 -0
- package/src/e2ee/fileEnvelope.ts +1 -1
- package/src/e2ee/sealedBody.ts +44 -5
- package/src/helpers/albumLayout.ts +207 -0
- package/src/helpers/attachments.ts +316 -0
- package/src/helpers/caption.ts +283 -0
- package/src/helpers/createMainMessageForThread.ts +6 -1
- package/src/helpers/createMessageFromXml.ts +21 -5
- package/src/helpers/fileKind.ts +38 -0
- package/src/helpers/getDataFromXml.ts +5 -1
- package/src/helpers/mapWithConcurrency.ts +32 -0
- package/src/helpers/mediaLimits.ts +27 -0
- package/src/helpers/mediaSendRetry.ts +59 -0
- package/src/helpers/mediaWireData.ts +57 -0
- package/src/helpers/mentionSpans.ts +17 -0
- package/src/helpers/mimeToExtension.ts +51 -0
- package/src/helpers/readReceipts.ts +219 -0
- package/src/helpers/repairFilenameEncoding.ts +82 -0
- package/src/helpers/safeJson.ts +11 -0
- package/src/helpers/updateMessagesTillLast.tsx +2 -1
- package/src/hooks/useSendMessage.tsx +448 -249
- package/src/i18n/strings.ts +144 -0
- package/src/main.ts +3 -0
- package/src/networking/api-requests/auth.api.ts +60 -3
- package/src/networking/stanzaHandlers.ts +91 -2
- package/src/networking/xmpp/handleStanzas.xmpp.ts +6 -2
- package/src/networking/xmpp/sendDisplayedMarker.xmpp.ts +31 -0
- package/src/networking/xmpp/sendMediaMessage.xmpp.ts +60 -3
- package/src/networking/xmpp/sendReceivedReceipt.xmpp.ts +31 -0
- package/src/networking/xmppClient.ts +48 -0
- package/src/roomStore/persistence.ts +94 -3
- package/src/roomStore/roomHeapSlice.ts +23 -1
- package/src/roomStore/roomsSlice.ts +112 -1
- package/src/types/models/attachment.model.ts +51 -0
- package/src/types/models/message.model.ts +29 -0
- package/src/types/models/modal.model.ts +7 -0
- package/src/types/models/room.model.ts +2 -0
- package/src/types/types.ts +83 -1
- package/src/version.ts +1 -1
- package/lib/commonjs/components/VideoCalls/useDraggable.js +0 -59
- package/lib/commonjs/components/VideoCalls/useDraggable.js.map +0 -1
- package/lib/module/components/VideoCalls/useDraggable.js +0 -55
- package/lib/module/components/VideoCalls/useDraggable.js.map +0 -1
- package/lib/typescript/components/VideoCalls/useDraggable.d.ts +0 -19
- package/lib/typescript/components/VideoCalls/useDraggable.d.ts.map +0 -1
- package/src/components/VideoCalls/useDraggable.ts +0 -46
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { Animated, PanResponder } from 'react-native';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The small video tile of a call, Telegram-style: drag it anywhere and it
|
|
8
|
+
* snaps to the nearest corner when released (a flick carries it towards
|
|
9
|
+
* the flick), pinch it to switch between a small and a large size.
|
|
10
|
+
*
|
|
11
|
+
* Positions are kept per corner rather than per pixel, so the tile stays
|
|
12
|
+
* glued to its corner when the stage changes size (rotation, iPad split
|
|
13
|
+
* view) or the tile itself changes size.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export const PIP_TILE_SIZES = {
|
|
17
|
+
small: {
|
|
18
|
+
width: 104,
|
|
19
|
+
height: 148
|
|
20
|
+
},
|
|
21
|
+
large: {
|
|
22
|
+
width: 156,
|
|
23
|
+
height: 222
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const MARGIN = 12;
|
|
27
|
+
// How far a flick carries the tile before picking a corner, in ms of velocity.
|
|
28
|
+
const FLICK_PROJECTION_MS = 160;
|
|
29
|
+
// Pinch past these ratios to change size; in between keeps the current one.
|
|
30
|
+
const GROW_RATIO = 1.12;
|
|
31
|
+
const SHRINK_RATIO = 0.9;
|
|
32
|
+
const SPRING = {
|
|
33
|
+
useNativeDriver: false,
|
|
34
|
+
damping: 20,
|
|
35
|
+
stiffness: 220,
|
|
36
|
+
mass: 0.8
|
|
37
|
+
};
|
|
38
|
+
const touchDistance = touches => {
|
|
39
|
+
const [a, b] = touches;
|
|
40
|
+
return Math.hypot(a.pageX - b.pageX, a.pageY - b.pageY);
|
|
41
|
+
};
|
|
42
|
+
export const usePipTile = ({
|
|
43
|
+
topInset = 0
|
|
44
|
+
} = {}) => {
|
|
45
|
+
const [stage, setStage] = useState(null);
|
|
46
|
+
const [size, setSize] = useState('small');
|
|
47
|
+
const stageRef = useRef(null);
|
|
48
|
+
const sizeRef = useRef('small');
|
|
49
|
+
const cornerRef = useRef({
|
|
50
|
+
right: true,
|
|
51
|
+
bottom: false
|
|
52
|
+
});
|
|
53
|
+
const topInsetRef = useRef(topInset);
|
|
54
|
+
topInsetRef.current = topInset;
|
|
55
|
+
const position = useRef(new Animated.ValueXY({
|
|
56
|
+
x: 0,
|
|
57
|
+
y: 0
|
|
58
|
+
})).current;
|
|
59
|
+
const width = useRef(new Animated.Value(PIP_TILE_SIZES.small.width)).current;
|
|
60
|
+
const height = useRef(new Animated.Value(PIP_TILE_SIZES.small.height)).current;
|
|
61
|
+
const pinchScale = useRef(new Animated.Value(1)).current;
|
|
62
|
+
// Where the tile rests, i.e. where a drag starts from.
|
|
63
|
+
const restRef = useRef({
|
|
64
|
+
x: 0,
|
|
65
|
+
y: 0
|
|
66
|
+
});
|
|
67
|
+
const gestureRef = useRef({
|
|
68
|
+
pinching: false,
|
|
69
|
+
startDistance: 0,
|
|
70
|
+
scale: 1
|
|
71
|
+
});
|
|
72
|
+
const cornerPoint = useCallback((corner, tileSize) => {
|
|
73
|
+
const area = stageRef.current;
|
|
74
|
+
if (!area) {
|
|
75
|
+
return {
|
|
76
|
+
x: 0,
|
|
77
|
+
y: 0
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const tile = PIP_TILE_SIZES[tileSize];
|
|
81
|
+
const top = MARGIN + topInsetRef.current;
|
|
82
|
+
return {
|
|
83
|
+
x: corner.right ? Math.max(MARGIN, area.width - tile.width - MARGIN) : MARGIN,
|
|
84
|
+
y: corner.bottom ? Math.max(top, area.height - tile.height - MARGIN) : top
|
|
85
|
+
};
|
|
86
|
+
}, []);
|
|
87
|
+
const settle = useCallback(animated => {
|
|
88
|
+
const tileSize = sizeRef.current;
|
|
89
|
+
const target = cornerPoint(cornerRef.current, tileSize);
|
|
90
|
+
const tile = PIP_TILE_SIZES[tileSize];
|
|
91
|
+
restRef.current = target;
|
|
92
|
+
if (!animated) {
|
|
93
|
+
position.setValue(target);
|
|
94
|
+
width.setValue(tile.width);
|
|
95
|
+
height.setValue(tile.height);
|
|
96
|
+
pinchScale.setValue(1);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
Animated.parallel([Animated.spring(position, {
|
|
100
|
+
...SPRING,
|
|
101
|
+
toValue: target
|
|
102
|
+
}), Animated.spring(width, {
|
|
103
|
+
...SPRING,
|
|
104
|
+
toValue: tile.width
|
|
105
|
+
}), Animated.spring(height, {
|
|
106
|
+
...SPRING,
|
|
107
|
+
toValue: tile.height
|
|
108
|
+
}), Animated.spring(pinchScale, {
|
|
109
|
+
...SPRING,
|
|
110
|
+
toValue: 1
|
|
111
|
+
})]).start();
|
|
112
|
+
}, [cornerPoint, position, width, height, pinchScale]);
|
|
113
|
+
const onStageLayout = useCallback(event => {
|
|
114
|
+
const {
|
|
115
|
+
width: w,
|
|
116
|
+
height: h
|
|
117
|
+
} = event.nativeEvent.layout;
|
|
118
|
+
const prev = stageRef.current;
|
|
119
|
+
if (prev && prev.width === w && prev.height === h) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
stageRef.current = {
|
|
123
|
+
width: w,
|
|
124
|
+
height: h
|
|
125
|
+
};
|
|
126
|
+
setStage(stageRef.current);
|
|
127
|
+
settle(false);
|
|
128
|
+
}, [settle]);
|
|
129
|
+
|
|
130
|
+
// The safe-area inset arrives after the first layout on some devices.
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (stageRef.current) {
|
|
133
|
+
settle(false);
|
|
134
|
+
}
|
|
135
|
+
}, [topInset, settle]);
|
|
136
|
+
const panHandlers = useMemo(() => PanResponder.create({
|
|
137
|
+
// Two fingers are always ours (pinch); one finger only once it
|
|
138
|
+
// moves, so a tap still reaches the tile's onPress (swap videos).
|
|
139
|
+
onStartShouldSetPanResponderCapture: event => event.nativeEvent.touches.length >= 2,
|
|
140
|
+
// Own the touch from the start when the tile has no tap target
|
|
141
|
+
// (nothing to swap): an ancestor outside the call Modal would take
|
|
142
|
+
// it otherwise, and the move-capture below would never be asked.
|
|
143
|
+
onStartShouldSetPanResponder: () => true,
|
|
144
|
+
onMoveShouldSetPanResponderCapture: (event, gesture) => event.nativeEvent.touches.length >= 2 || Math.abs(gesture.dx) > 4 || Math.abs(gesture.dy) > 4,
|
|
145
|
+
// Never hand the tile over to the swipe-to-minimize of the screen.
|
|
146
|
+
onPanResponderTerminationRequest: () => false,
|
|
147
|
+
onPanResponderGrant: () => {
|
|
148
|
+
position.stopAnimation();
|
|
149
|
+
width.stopAnimation();
|
|
150
|
+
height.stopAnimation();
|
|
151
|
+
pinchScale.stopAnimation();
|
|
152
|
+
gestureRef.current = {
|
|
153
|
+
pinching: false,
|
|
154
|
+
startDistance: 0,
|
|
155
|
+
scale: 1
|
|
156
|
+
};
|
|
157
|
+
},
|
|
158
|
+
onPanResponderMove: (event, gesture) => {
|
|
159
|
+
const touches = event.nativeEvent.touches;
|
|
160
|
+
const state = gestureRef.current;
|
|
161
|
+
if (touches.length >= 2) {
|
|
162
|
+
const distance = touchDistance(touches);
|
|
163
|
+
if (!state.pinching || state.startDistance <= 0) {
|
|
164
|
+
state.pinching = true;
|
|
165
|
+
state.startDistance = distance;
|
|
166
|
+
} else {
|
|
167
|
+
state.scale = Math.min(1.8, Math.max(0.6, distance / state.startDistance));
|
|
168
|
+
pinchScale.setValue(state.scale);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
position.setValue({
|
|
172
|
+
x: restRef.current.x + gesture.dx,
|
|
173
|
+
y: restRef.current.y + gesture.dy
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
onPanResponderRelease: (_event, gesture) => {
|
|
177
|
+
const area = stageRef.current;
|
|
178
|
+
const state = gestureRef.current;
|
|
179
|
+
if (state.pinching) {
|
|
180
|
+
const next = state.scale >= GROW_RATIO ? 'large' : state.scale <= SHRINK_RATIO ? 'small' : sizeRef.current;
|
|
181
|
+
if (next !== sizeRef.current) {
|
|
182
|
+
// Keep the size the finger left it at, then let the spring
|
|
183
|
+
// carry it to the new one, so the tile doesn't jump.
|
|
184
|
+
const from = PIP_TILE_SIZES[sizeRef.current];
|
|
185
|
+
width.setValue(from.width * state.scale);
|
|
186
|
+
height.setValue(from.height * state.scale);
|
|
187
|
+
pinchScale.setValue(1);
|
|
188
|
+
sizeRef.current = next;
|
|
189
|
+
setSize(next);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (area) {
|
|
193
|
+
const tile = PIP_TILE_SIZES[sizeRef.current];
|
|
194
|
+
const centerX = restRef.current.x + gesture.dx + gesture.vx * FLICK_PROJECTION_MS + tile.width / 2;
|
|
195
|
+
const centerY = restRef.current.y + gesture.dy + gesture.vy * FLICK_PROJECTION_MS + tile.height / 2;
|
|
196
|
+
cornerRef.current = {
|
|
197
|
+
right: centerX > area.width / 2,
|
|
198
|
+
bottom: centerY > area.height / 2
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
settle(true);
|
|
202
|
+
},
|
|
203
|
+
onPanResponderTerminate: () => settle(true)
|
|
204
|
+
}).panHandlers, [position, width, height, pinchScale, settle]);
|
|
205
|
+
return {
|
|
206
|
+
/** Put on the area the tile moves within. */
|
|
207
|
+
onStageLayout,
|
|
208
|
+
panHandlers,
|
|
209
|
+
size,
|
|
210
|
+
/** Hidden until the stage is measured, so it never flashes at 0,0. */
|
|
211
|
+
style: {
|
|
212
|
+
position: 'absolute',
|
|
213
|
+
left: 0,
|
|
214
|
+
top: 0,
|
|
215
|
+
width,
|
|
216
|
+
height,
|
|
217
|
+
opacity: stage ? 1 : 0,
|
|
218
|
+
transform: [{
|
|
219
|
+
translateX: position.x
|
|
220
|
+
}, {
|
|
221
|
+
translateY: position.y
|
|
222
|
+
}, {
|
|
223
|
+
scale: pinchScale
|
|
224
|
+
}]
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
//# sourceMappingURL=usePipTile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useEffect","useMemo","useRef","useState","Animated","PanResponder","PIP_TILE_SIZES","small","width","height","large","MARGIN","FLICK_PROJECTION_MS","GROW_RATIO","SHRINK_RATIO","SPRING","useNativeDriver","damping","stiffness","mass","touchDistance","touches","a","b","Math","hypot","pageX","pageY","usePipTile","topInset","stage","setStage","size","setSize","stageRef","sizeRef","cornerRef","right","bottom","topInsetRef","current","position","ValueXY","x","y","Value","pinchScale","restRef","gestureRef","pinching","startDistance","scale","cornerPoint","corner","tileSize","area","tile","top","max","settle","animated","target","setValue","parallel","spring","toValue","start","onStageLayout","event","w","h","nativeEvent","layout","prev","panHandlers","create","onStartShouldSetPanResponderCapture","length","onStartShouldSetPanResponder","onMoveShouldSetPanResponderCapture","gesture","abs","dx","dy","onPanResponderTerminationRequest","onPanResponderGrant","stopAnimation","onPanResponderMove","state","distance","min","onPanResponderRelease","_event","next","from","centerX","vx","centerY","vy","onPanResponderTerminate","style","left","opacity","transform","translateX","translateY"],"sourceRoot":"../../../../src","sources":["components/VideoCalls/usePipTile.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACzE,SAASC,QAAQ,EAAqBC,YAAY,QAAQ,cAAc;;AAExE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,MAAMC,cAAsE,GAAG;EACpFC,KAAK,EAAE;IAAEC,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAE;EAAI,CAAC;EAClCC,KAAK,EAAE;IAAEF,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAE;EAAI;AACnC,CAAC;AAED,MAAME,MAAM,GAAG,EAAE;AACjB;AACA,MAAMC,mBAAmB,GAAG,GAAG;AAC/B;AACA,MAAMC,UAAU,GAAG,IAAI;AACvB,MAAMC,YAAY,GAAG,GAAG;AAYxB,MAAMC,MAAM,GAAG;EAAEC,eAAe,EAAE,KAAK;EAAEC,OAAO,EAAE,EAAE;EAAEC,SAAS,EAAE,GAAG;EAAEC,IAAI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AC;IACd,CAAC;IACDwC,uBAAuB,EAAEA,CAAA,KAAMxC,MAAM,CAAC,IAAI;EAC5C,CAAC,CAAC,CAACe,WAAW,EAChB,CAACjC,QAAQ,EAAEjC,KAAK,EAAEC,MAAM,EAAEqC,UAAU,EAAEa,MAAM,CAC9C,CAAC;EAED,OAAO;IACL;IACAQ,aAAa;IACbO,WAAW;IACX1C,IAAI;IACJ;IACAoE,KAAK,EAAE;MACL3D,QAAQ,EAAE,UAAmB;MAC7B4D,IAAI,EAAE,CAAC;MACP5C,GAAG,EAAE,CAAC;MACNjD,KAAK;MACLC,MAAM;MACN6F,OAAO,EAAExE,KAAK,GAAG,CAAC,GAAG,CAAC;MACtByE,SAAS,EAAE,CACT;QAAEC,UAAU,EAAE/D,QAAQ,CAACE;MAAE,CAAC,EAC1B;QAAE8D,UAAU,EAAEhE,QAAQ,CAACG;MAAE,CAAC,EAC1B;QAAEO,KAAK,EAAEL;MAAW,CAAC;IAEzB;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { View, Text, StyleSheet, Modal, TouchableOpacity, SafeAreaView } from 'react-native';
|
|
3
|
+
import { View, Text, StyleSheet, Modal, TouchableOpacity, SafeAreaView, ScrollView } from 'react-native';
|
|
4
4
|
import { MediaContainer, MediaImage } from './StyledInputComponents/StyledInputComponents';
|
|
5
5
|
import { FileIcon } from '../../assets/icons';
|
|
6
6
|
import { RemoveButton, RemoveButtonText } from './StyledComponents';
|
|
7
7
|
import { useState } from 'react';
|
|
8
8
|
import { useVideoPlayer, VideoView } from 'expo-video';
|
|
9
|
+
import { useT } from '../../i18n/useT';
|
|
9
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
11
|
const VideoThumb = ({
|
|
11
12
|
uri,
|
|
@@ -53,53 +54,65 @@ export const MediaFilePreview = ({
|
|
|
53
54
|
handleRemoveImage
|
|
54
55
|
}) => {
|
|
55
56
|
const [previewUri, setPreviewUri] = useState(null);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
57
|
+
const t = useT();
|
|
58
|
+
|
|
59
|
+
// The tray holds up to ten files, so it scrolls sideways rather than wrap.
|
|
60
|
+
return /*#__PURE__*/_jsx(ScrollView, {
|
|
61
|
+
horizontal: true,
|
|
62
|
+
showsHorizontalScrollIndicator: false,
|
|
63
|
+
keyboardShouldPersistTaps: "handled",
|
|
64
|
+
testID: "media-tray",
|
|
65
|
+
children: /*#__PURE__*/_jsxs(MediaContainer, {
|
|
66
|
+
children: [filePreviews.map((file, index) => {
|
|
67
|
+
const isImage = file.type?.startsWith('image');
|
|
68
|
+
const isVideo = file.type?.startsWith('video');
|
|
69
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
70
|
+
children: [isImage ? /*#__PURE__*/_jsx(MediaImage, {
|
|
71
|
+
source: {
|
|
72
|
+
uri: file.uri
|
|
73
|
+
}
|
|
74
|
+
}) : isVideo ? /*#__PURE__*/_jsx(VideoThumb, {
|
|
75
|
+
uri: file.uri,
|
|
76
|
+
onPress: () => setPreviewUri(file.uri)
|
|
77
|
+
}) : /*#__PURE__*/_jsx(View, {
|
|
78
|
+
style: {
|
|
79
|
+
width: 70,
|
|
80
|
+
height: 70,
|
|
81
|
+
borderRadius: 8
|
|
82
|
+
},
|
|
83
|
+
children: /*#__PURE__*/_jsx(FileIcon, {
|
|
84
|
+
width: 70,
|
|
85
|
+
height: 70
|
|
86
|
+
})
|
|
87
|
+
}), /*#__PURE__*/_jsx(RemoveButton, {
|
|
88
|
+
testID: `media-tray-remove-${index}`,
|
|
89
|
+
accessibilityRole: "button",
|
|
90
|
+
accessibilityLabel: t('attachment.remove'),
|
|
91
|
+
onPress: () => handleRemoveImage(index),
|
|
92
|
+
children: /*#__PURE__*/_jsx(RemoveButtonText, {
|
|
93
|
+
children: "\xD7"
|
|
94
|
+
})
|
|
95
|
+
})]
|
|
96
|
+
}, `${file.name}_${index}`);
|
|
97
|
+
}), /*#__PURE__*/_jsx(Modal, {
|
|
98
|
+
visible: !!previewUri,
|
|
99
|
+
animationType: "fade",
|
|
100
|
+
transparent: true,
|
|
101
|
+
children: /*#__PURE__*/_jsxs(SafeAreaView, {
|
|
102
|
+
style: styles.modalContainer,
|
|
103
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
104
|
+
style: styles.closeButton,
|
|
105
|
+
onPress: () => setPreviewUri(null),
|
|
106
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
107
|
+
style: styles.closeText,
|
|
108
|
+
children: "\u2715"
|
|
109
|
+
})
|
|
110
|
+
}), previewUri && /*#__PURE__*/_jsx(FullscreenPreviewVideo, {
|
|
111
|
+
uri: previewUri
|
|
112
|
+
})]
|
|
113
|
+
})
|
|
114
|
+
})]
|
|
115
|
+
})
|
|
103
116
|
});
|
|
104
117
|
};
|
|
105
118
|
const styles = StyleSheet.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","Text","StyleSheet","Modal","TouchableOpacity","SafeAreaView","MediaContainer","MediaImage","FileIcon","RemoveButton","RemoveButtonText","useState","useVideoPlayer","VideoView","jsx","_jsx","jsxs","_jsxs","VideoThumb","uri","onPress","player","p","muted","activeOpacity","style","styles","videoThumb","children","absoluteFill","contentFit","nativeControls","surfaceType","pointerEvents","playOverlay","playIcon","FullscreenPreviewVideo","play","fullVideo","MediaFilePreview","filePreviews","handleRemoveImage","previewUri","setPreviewUri","map","file","index","isImage","type","startsWith","isVideo","source","width","height","borderRadius","name","visible","animationType","transparent","modalContainer","closeButton","closeText","create","overflow","backgroundColor","justifyContent","alignItems","fontSize","color","flex","position","top","right","zIndex","fontWeight"],"sourceRoot":"../../../../src","sources":["components/styled/MediaFilePreview.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,IAAI,EAAEC,UAAU,EAAEC,KAAK,EAAEC,gBAAgB,EAAEC,YAAY,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["View","Text","StyleSheet","Modal","TouchableOpacity","SafeAreaView","ScrollView","MediaContainer","MediaImage","FileIcon","RemoveButton","RemoveButtonText","useState","useVideoPlayer","VideoView","useT","jsx","_jsx","jsxs","_jsxs","VideoThumb","uri","onPress","player","p","muted","activeOpacity","style","styles","videoThumb","children","absoluteFill","contentFit","nativeControls","surfaceType","pointerEvents","playOverlay","playIcon","FullscreenPreviewVideo","play","fullVideo","MediaFilePreview","filePreviews","handleRemoveImage","previewUri","setPreviewUri","t","horizontal","showsHorizontalScrollIndicator","keyboardShouldPersistTaps","testID","map","file","index","isImage","type","startsWith","isVideo","source","width","height","borderRadius","accessibilityRole","accessibilityLabel","name","visible","animationType","transparent","modalContainer","closeButton","closeText","create","overflow","backgroundColor","justifyContent","alignItems","fontSize","color","flex","position","top","right","zIndex","fontWeight"],"sourceRoot":"../../../../src","sources":["components/styled/MediaFilePreview.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,IAAI,EAAEC,UAAU,EAAEC,KAAK,EAAEC,gBAAgB,EAAEC,YAAY,EAAEC,UAAU,QAAQ,cAAc;AACx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,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVC,YAAY,EAAE,CAAC;IACfW,QAAQ,EAAE,QAAQ;IAClBC,eAAe,EAAE;EACnB,CAAC;EACDrC,WAAW,EAAE;IACX,GAAGlC,UAAU,CAAC6B,YAAY;IAC1B2C,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBF,eAAe,EAAE;EACnB,CAAC;EACDpC,QAAQ,EAAE;IACRuC,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAE;EACT,CAAC;EACDT,cAAc,EAAE;IACdU,IAAI,EAAE,CAAC;IACPL,eAAe,EAAE,MAAM;IACvBC,cAAc,EAAE;EAClB,CAAC;EACDL,WAAW,EAAE;IACXU,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,EAAE;IACPC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVvB,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVC,YAAY,EAAE,EAAE;IAChBY,eAAe,EAAE,uBAAuB;IACxCC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDL,SAAS,EAAE;IACTM,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAE,MAAM;IACbM,UAAU,EAAE;EACd,CAAC;EACD3C,SAAS,EAAE;IACTmB,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -18,7 +18,9 @@ const CustomMessageImage = ({
|
|
|
18
18
|
fileName,
|
|
19
19
|
originalName,
|
|
20
20
|
mimetype,
|
|
21
|
-
locationPreview
|
|
21
|
+
locationPreview,
|
|
22
|
+
tile,
|
|
23
|
+
onOpen
|
|
22
24
|
}) => {
|
|
23
25
|
// Preview first, original only as a fallback — mirrors the web client,
|
|
24
26
|
// where the <img> src is the preview and `fileURL` is reserved for the
|
|
@@ -27,10 +29,11 @@ const CustomMessageImage = ({
|
|
|
27
29
|
const [loading, setLoading] = useState(true);
|
|
28
30
|
// Start with a neutral box; swap to the real aspect ratio once the
|
|
29
31
|
// image's natural dimensions are known so it's shown scaled, not cropped.
|
|
30
|
-
const [
|
|
32
|
+
const [measured, setDims] = useState(defaultMediaDims());
|
|
33
|
+
const dims = tile ?? measured;
|
|
31
34
|
const dispatch = useDispatch();
|
|
32
35
|
useEffect(() => {
|
|
33
|
-
if (!displayURL) {
|
|
36
|
+
if (!displayURL || tile) {
|
|
34
37
|
return;
|
|
35
38
|
}
|
|
36
39
|
let active = true;
|
|
@@ -50,8 +53,12 @@ const CustomMessageImage = ({
|
|
|
50
53
|
return () => {
|
|
51
54
|
active = false;
|
|
52
55
|
};
|
|
53
|
-
}, [displayURL]);
|
|
56
|
+
}, [displayURL, tile]);
|
|
54
57
|
const handleOpen = () => {
|
|
58
|
+
if (onOpen) {
|
|
59
|
+
onOpen();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
55
62
|
dispatch(setActiveFile({
|
|
56
63
|
fileName,
|
|
57
64
|
fileURL,
|
|
@@ -61,7 +68,10 @@ const CustomMessageImage = ({
|
|
|
61
68
|
dispatch(setActiveModal(MODAL_TYPES.FILE_PREVIEW));
|
|
62
69
|
};
|
|
63
70
|
return /*#__PURE__*/_jsx(Container, {
|
|
64
|
-
style: {
|
|
71
|
+
style: tile ? {
|
|
72
|
+
width: dims.width,
|
|
73
|
+
borderRadius: 0
|
|
74
|
+
} : {
|
|
65
75
|
width: dims.width
|
|
66
76
|
},
|
|
67
77
|
children: /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
@@ -87,7 +97,7 @@ const CustomMessageImage = ({
|
|
|
87
97
|
style: {
|
|
88
98
|
width: dims.width,
|
|
89
99
|
height: dims.height,
|
|
90
|
-
borderRadius: 10,
|
|
100
|
+
borderRadius: tile ? 0 : 10,
|
|
91
101
|
backgroundColor: 'rgba(0, 0, 0, 0)'
|
|
92
102
|
},
|
|
93
103
|
onLoadEnd: () => setLoading(false),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useState","isSecureFileUrl","requestFileTokenRecovery","pushLog","Container","useDispatch","setActiveFile","setActiveModal","MODAL_TYPES","ActivityIndicator","Image","TouchableOpacity","View","defaultMediaDims","fitMediaDimensions","jsx","_jsx","jsxs","_jsxs","maskToken","url","replace","FALLBACK_IMAGE","CustomMessageImage","fileURL","fileName","originalName","mimetype","locationPreview","displayURL","loading","setLoading","
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","isSecureFileUrl","requestFileTokenRecovery","pushLog","Container","useDispatch","setActiveFile","setActiveModal","MODAL_TYPES","ActivityIndicator","Image","TouchableOpacity","View","defaultMediaDims","fitMediaDimensions","jsx","_jsx","jsxs","_jsxs","maskToken","url","replace","FALLBACK_IMAGE","CustomMessageImage","fileURL","fileName","originalName","mimetype","locationPreview","tile","onOpen","displayURL","loading","setLoading","measured","setDims","dims","dispatch","active","getSize","w","h","error","message","String","handleOpen","FILE_PREVIEW","style","width","borderRadius","children","onPress","activeOpacity","position","height","alignItems","justifyContent","zIndex","size","color","source","uri","backgroundColor","onLoadEnd","onError","event","usingPreview","nativeEvent","resizeMode"],"sourceRoot":"../../../../src","sources":["components/styled/MessageImage.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SACEC,eAAe,EACfC,wBAAwB,QACnB,6BAA6B;AACpC,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,SAAS,QAAQ,yCAAyC;AACnE,SAASC,WAAW,QAAQ,aAAa;AACzC,SACEC,aAAa,EACbC,cAAc,QACT,mCAAmC;AAC1C,SAASC,WAAW,QAAQ,qCAAqC;AACjE,SAASC,iBAAiB,EAAEC,KAAK,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AAC/E,SACEC,gBAAgB,EAChBC,kBAAkB,QAEb,+BAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAA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