stream-chat-react-native-core 5.28.1 → 5.29.0
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/lib/commonjs/components/Attachment/Attachment.js +2 -2
- package/lib/commonjs/components/Attachment/Attachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/AudioAttachment.js +247 -115
- package/lib/commonjs/components/Attachment/AudioAttachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js +30 -50
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js.map +1 -1
- package/lib/commonjs/components/Attachment/VideoThumbnail.js +3 -3
- package/lib/commonjs/components/Attachment/VideoThumbnail.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +43 -1
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js +24 -0
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js +6 -6
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +1 -1
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useMessageActions.js +4 -2
- package/lib/commonjs/components/Message/hooks/useMessageActions.js.map +1 -1
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js +55 -74
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/InputButtons.js +1 -1
- package/lib/commonjs/components/MessageInput/InputButtons.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +250 -43
- package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/commonjs/components/MessageInput/SendButton.js +9 -7
- package/lib/commonjs/components/MessageInput/SendButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecorder.js +221 -0
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecorder.js.map +1 -0
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingButton.js +121 -0
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingButton.js.map +1 -0
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.js +68 -0
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.js.map +1 -0
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingLockIndicator.js +75 -0
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingLockIndicator.js.map +1 -0
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.js +87 -0
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.js.map +1 -0
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingWaveform.js +47 -0
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingWaveform.js.map +1 -0
- package/lib/commonjs/components/MessageInput/hooks/useAudioController.js +452 -0
- package/lib/commonjs/components/MessageInput/hooks/useAudioController.js.map +1 -0
- package/lib/commonjs/components/MessageInput/utils/audioSampling.js +91 -0
- package/lib/commonjs/components/MessageInput/utils/audioSampling.js.map +1 -0
- package/lib/commonjs/components/MessageInput/utils/normalizeAudioLevel.js +18 -0
- package/lib/commonjs/components/MessageInput/utils/normalizeAudioLevel.js.map +1 -0
- package/lib/commonjs/components/ProgressControl/ProgressControl.js +57 -40
- package/lib/commonjs/components/ProgressControl/ProgressControl.js.map +1 -1
- package/lib/commonjs/components/ProgressControl/WaveProgressBar.js +162 -0
- package/lib/commonjs/components/ProgressControl/WaveProgressBar.js.map +1 -0
- package/lib/commonjs/components/Reply/Reply.js +45 -20
- package/lib/commonjs/components/Reply/Reply.js.map +1 -1
- package/lib/commonjs/components/index.js +66 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +23 -12
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +24 -0
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js +76 -28
- package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/utils/theme.js +62 -7
- package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/commonjs/i18n/en.json +2 -0
- package/lib/commonjs/i18n/es.json +2 -0
- package/lib/commonjs/i18n/fr.json +2 -0
- package/lib/commonjs/i18n/he.json +2 -0
- package/lib/commonjs/i18n/hi.json +2 -0
- package/lib/commonjs/i18n/it.json +2 -0
- package/lib/commonjs/i18n/ja.json +2 -0
- package/lib/commonjs/i18n/ko.json +2 -0
- package/lib/commonjs/i18n/nl.json +2 -0
- package/lib/commonjs/i18n/pt-BR.json +2 -0
- package/lib/commonjs/i18n/ru.json +2 -0
- package/lib/commonjs/i18n/tr.json +2 -0
- package/lib/commonjs/icons/ArrowLeft.js +27 -0
- package/lib/commonjs/icons/ArrowLeft.js.map +1 -0
- package/lib/commonjs/icons/ArrowUp.js +26 -0
- package/lib/commonjs/icons/ArrowUp.js.map +1 -0
- package/lib/commonjs/icons/Audio.js +24 -24
- package/lib/commonjs/icons/Audio.js.map +1 -1
- package/lib/commonjs/icons/CircleStop.js +27 -0
- package/lib/commonjs/icons/CircleStop.js.map +1 -0
- package/lib/commonjs/icons/Delete.js +17 -6
- package/lib/commonjs/icons/Delete.js.map +1 -1
- package/lib/commonjs/icons/Lock.js +30 -0
- package/lib/commonjs/icons/Lock.js.map +1 -0
- package/lib/commonjs/icons/Mic.js +30 -0
- package/lib/commonjs/icons/Mic.js.map +1 -0
- package/lib/commonjs/icons/Pause.js +15 -20
- package/lib/commonjs/icons/Pause.js.map +1 -1
- package/lib/commonjs/icons/Play.js +18 -10
- package/lib/commonjs/icons/Play.js.map +1 -1
- package/lib/commonjs/icons/SendCheck.js +30 -0
- package/lib/commonjs/icons/SendCheck.js.map +1 -0
- package/lib/commonjs/icons/SendRight.js +24 -6
- package/lib/commonjs/icons/SendRight.js.map +1 -1
- package/lib/commonjs/icons/SendUp.js +24 -6
- package/lib/commonjs/icons/SendUp.js.map +1 -1
- package/lib/commonjs/icons/Stop.js +19 -0
- package/lib/commonjs/icons/Stop.js.map +1 -0
- package/lib/commonjs/icons/index.js +77 -0
- package/lib/commonjs/icons/index.js.map +1 -1
- package/lib/commonjs/native.js +10 -1
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/utils/getTrimmedAttachmentTitle.js +11 -0
- package/lib/commonjs/utils/getTrimmedAttachmentTitle.js.map +1 -0
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Attachment.js +2 -2
- package/lib/module/components/Attachment/Attachment.js.map +1 -1
- package/lib/module/components/Attachment/AudioAttachment.js +247 -115
- package/lib/module/components/Attachment/AudioAttachment.js.map +1 -1
- package/lib/module/components/Attachment/FileAttachmentGroup.js +30 -50
- package/lib/module/components/Attachment/FileAttachmentGroup.js.map +1 -1
- package/lib/module/components/Attachment/VideoThumbnail.js +3 -3
- package/lib/module/components/Attachment/VideoThumbnail.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +43 -1
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +24 -0
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js +6 -6
- package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
- package/lib/module/components/Message/Message.js +1 -1
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageContent.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/module/components/Message/hooks/useMessageActions.js +4 -2
- package/lib/module/components/Message/hooks/useMessageActions.js.map +1 -1
- package/lib/module/components/MessageInput/FileUploadPreview.js +55 -74
- package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/InputButtons.js +1 -1
- package/lib/module/components/MessageInput/InputButtons.js.map +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +250 -43
- package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/module/components/MessageInput/SendButton.js +9 -7
- package/lib/module/components/MessageInput/SendButton.js.map +1 -1
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecorder.js +221 -0
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecorder.js.map +1 -0
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingButton.js +121 -0
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingButton.js.map +1 -0
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.js +68 -0
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.js.map +1 -0
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingLockIndicator.js +75 -0
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingLockIndicator.js.map +1 -0
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.js +87 -0
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.js.map +1 -0
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingWaveform.js +47 -0
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingWaveform.js.map +1 -0
- package/lib/module/components/MessageInput/hooks/useAudioController.js +452 -0
- package/lib/module/components/MessageInput/hooks/useAudioController.js.map +1 -0
- package/lib/module/components/MessageInput/utils/audioSampling.js +91 -0
- package/lib/module/components/MessageInput/utils/audioSampling.js.map +1 -0
- package/lib/module/components/MessageInput/utils/normalizeAudioLevel.js +18 -0
- package/lib/module/components/MessageInput/utils/normalizeAudioLevel.js.map +1 -0
- package/lib/module/components/ProgressControl/ProgressControl.js +57 -40
- package/lib/module/components/ProgressControl/ProgressControl.js.map +1 -1
- package/lib/module/components/ProgressControl/WaveProgressBar.js +162 -0
- package/lib/module/components/ProgressControl/WaveProgressBar.js.map +1 -0
- package/lib/module/components/Reply/Reply.js +45 -20
- package/lib/module/components/Reply/Reply.js.map +1 -1
- package/lib/module/components/index.js +66 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +23 -12
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +24 -0
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js +76 -28
- package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
- package/lib/module/contexts/themeContext/utils/theme.js +62 -7
- package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/module/i18n/en.json +2 -0
- package/lib/module/i18n/es.json +2 -0
- package/lib/module/i18n/fr.json +2 -0
- package/lib/module/i18n/he.json +2 -0
- package/lib/module/i18n/hi.json +2 -0
- package/lib/module/i18n/it.json +2 -0
- package/lib/module/i18n/ja.json +2 -0
- package/lib/module/i18n/ko.json +2 -0
- package/lib/module/i18n/nl.json +2 -0
- package/lib/module/i18n/pt-BR.json +2 -0
- package/lib/module/i18n/ru.json +2 -0
- package/lib/module/i18n/tr.json +2 -0
- package/lib/module/icons/ArrowLeft.js +27 -0
- package/lib/module/icons/ArrowLeft.js.map +1 -0
- package/lib/module/icons/ArrowUp.js +26 -0
- package/lib/module/icons/ArrowUp.js.map +1 -0
- package/lib/module/icons/Audio.js +24 -24
- package/lib/module/icons/Audio.js.map +1 -1
- package/lib/module/icons/CircleStop.js +27 -0
- package/lib/module/icons/CircleStop.js.map +1 -0
- package/lib/module/icons/Delete.js +17 -6
- package/lib/module/icons/Delete.js.map +1 -1
- package/lib/module/icons/Lock.js +30 -0
- package/lib/module/icons/Lock.js.map +1 -0
- package/lib/module/icons/Mic.js +30 -0
- package/lib/module/icons/Mic.js.map +1 -0
- package/lib/module/icons/Pause.js +15 -20
- package/lib/module/icons/Pause.js.map +1 -1
- package/lib/module/icons/Play.js +18 -10
- package/lib/module/icons/Play.js.map +1 -1
- package/lib/module/icons/SendCheck.js +30 -0
- package/lib/module/icons/SendCheck.js.map +1 -0
- package/lib/module/icons/SendRight.js +24 -6
- package/lib/module/icons/SendRight.js.map +1 -1
- package/lib/module/icons/SendUp.js +24 -6
- package/lib/module/icons/SendUp.js.map +1 -1
- package/lib/module/icons/Stop.js +19 -0
- package/lib/module/icons/Stop.js.map +1 -0
- package/lib/module/icons/index.js +77 -0
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/native.js +10 -1
- package/lib/module/native.js.map +1 -1
- package/lib/module/utils/getTrimmedAttachmentTitle.js +11 -0
- package/lib/module/utils/getTrimmedAttachmentTitle.js.map +1 -0
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/Attachment.d.ts.map +1 -1
- package/lib/typescript/components/Attachment/AudioAttachment.d.ts +3 -8
- package/lib/typescript/components/Attachment/AudioAttachment.d.ts.map +1 -1
- package/lib/typescript/components/Attachment/FileAttachmentGroup.d.ts.map +1 -1
- package/lib/typescript/components/Channel/Channel.d.ts.map +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +15 -3
- package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryVideoControl.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageContent.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageSimple.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/FileUploadPreview.d.ts +1 -1
- package/lib/typescript/components/MessageInput/FileUploadPreview.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/InputButtons.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/MessageInput.d.ts +1 -1
- package/lib/typescript/components/MessageInput/MessageInput.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/SendButton.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecorder.d.ts +51 -0
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecorder.d.ts.map +1 -0
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingButton.d.ts +43 -0
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingButton.d.ts.map +1 -0
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.d.ts +29 -0
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.d.ts.map +1 -0
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingLockIndicator.d.ts +22 -0
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingLockIndicator.d.ts.map +1 -0
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.d.ts +31 -0
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.d.ts.map +1 -0
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingWaveform.d.ts +19 -0
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingWaveform.d.ts.map +1 -0
- package/lib/typescript/components/MessageInput/hooks/useAudioController.d.ts +28 -0
- package/lib/typescript/components/MessageInput/hooks/useAudioController.d.ts.map +1 -0
- package/lib/typescript/components/MessageInput/utils/audioSampling.d.ts +11 -0
- package/lib/typescript/components/MessageInput/utils/audioSampling.d.ts.map +1 -0
- package/lib/typescript/components/MessageInput/utils/normalizeAudioLevel.d.ts +5 -0
- package/lib/typescript/components/MessageInput/utils/normalizeAudioLevel.d.ts.map +1 -0
- package/lib/typescript/components/ProgressControl/ProgressControl.d.ts +2 -2
- package/lib/typescript/components/ProgressControl/ProgressControl.d.ts.map +1 -1
- package/lib/typescript/components/ProgressControl/WaveProgressBar.d.ts +11 -0
- package/lib/typescript/components/ProgressControl/WaveProgressBar.d.ts.map +1 -0
- package/lib/typescript/components/Reply/Reply.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +6 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +70 -4
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts.map +1 -1
- package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +1 -1
- package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts.map +1 -1
- package/lib/typescript/contexts/messageInputContext/hooks/useMessageDetailsForState.d.ts.map +1 -1
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts +62 -7
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts.map +1 -1
- package/lib/typescript/i18n/en.json +2 -0
- package/lib/typescript/i18n/es.json +2 -0
- package/lib/typescript/i18n/fr.json +2 -0
- package/lib/typescript/i18n/he.json +2 -0
- package/lib/typescript/i18n/hi.json +2 -0
- package/lib/typescript/i18n/it.json +2 -0
- package/lib/typescript/i18n/ja.json +2 -0
- package/lib/typescript/i18n/ko.json +2 -0
- package/lib/typescript/i18n/nl.json +2 -0
- package/lib/typescript/i18n/pt-BR.json +2 -0
- package/lib/typescript/i18n/ru.json +2 -0
- package/lib/typescript/i18n/tr.json +2 -0
- package/lib/typescript/icons/ArrowLeft.d.ts +8 -0
- package/lib/typescript/icons/ArrowLeft.d.ts.map +1 -0
- package/lib/typescript/icons/ArrowUp.d.ts +9 -0
- package/lib/typescript/icons/ArrowUp.d.ts.map +1 -0
- package/lib/typescript/icons/Audio.d.ts.map +1 -1
- package/lib/typescript/icons/CircleStop.d.ts +8 -0
- package/lib/typescript/icons/CircleStop.d.ts.map +1 -0
- package/lib/typescript/icons/Delete.d.ts +5 -1
- package/lib/typescript/icons/Delete.d.ts.map +1 -1
- package/lib/typescript/icons/Lock.d.ts +9 -0
- package/lib/typescript/icons/Lock.d.ts.map +1 -0
- package/lib/typescript/icons/Mic.d.ts +8 -0
- package/lib/typescript/icons/Mic.d.ts.map +1 -0
- package/lib/typescript/icons/Pause.d.ts +3 -1
- package/lib/typescript/icons/Pause.d.ts.map +1 -1
- package/lib/typescript/icons/Play.d.ts +3 -1
- package/lib/typescript/icons/Play.d.ts.map +1 -1
- package/lib/typescript/icons/SendCheck.d.ts +8 -0
- package/lib/typescript/icons/SendCheck.d.ts.map +1 -0
- package/lib/typescript/icons/SendRight.d.ts +5 -1
- package/lib/typescript/icons/SendRight.d.ts.map +1 -1
- package/lib/typescript/icons/SendUp.d.ts +5 -1
- package/lib/typescript/icons/SendUp.d.ts.map +1 -1
- package/lib/typescript/icons/Stop.d.ts +4 -0
- package/lib/typescript/icons/Stop.d.ts.map +1 -0
- package/lib/typescript/icons/index.d.ts +7 -0
- package/lib/typescript/icons/index.d.ts.map +1 -1
- package/lib/typescript/native.d.ts +49 -0
- package/lib/typescript/native.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +6 -0
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/utils/Streami18n.d.ts +2 -0
- package/lib/typescript/utils/Streami18n.d.ts.map +1 -1
- package/lib/typescript/utils/getTrimmedAttachmentTitle.d.ts +2 -0
- package/lib/typescript/utils/getTrimmedAttachmentTitle.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/Attachment/Attachment.tsx +7 -2
- package/src/components/Attachment/AudioAttachment.tsx +223 -119
- package/src/components/Attachment/FileAttachmentGroup.tsx +35 -55
- package/src/components/Attachment/VideoThumbnail.tsx +1 -1
- package/src/components/Channel/Channel.tsx +32 -0
- package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +24 -0
- package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx +1 -1
- package/src/components/ImageGallery/__tests__/ImageGalleryVideoControl.test.tsx +2 -2
- package/src/components/ImageGallery/components/ImageGalleryVideoControl.tsx +2 -7
- package/src/components/Message/Message.tsx +1 -1
- package/src/components/Message/MessageSimple/MessageContent.tsx +2 -1
- package/src/components/Message/MessageSimple/MessageSimple.tsx +2 -1
- package/src/components/Message/hooks/useMessageActions.tsx +2 -2
- package/src/components/MessageInput/FileUploadPreview.tsx +67 -98
- package/src/components/MessageInput/InputButtons.tsx +2 -1
- package/src/components/MessageInput/MessageInput.tsx +320 -49
- package/src/components/MessageInput/SendButton.tsx +7 -3
- package/src/components/MessageInput/__tests__/MessageInput.test.js +0 -1
- package/src/components/MessageInput/__tests__/__snapshots__/SendButton.test.js.snap +132 -48
- package/src/components/MessageInput/components/AudioRecorder/AudioRecorder.tsx +313 -0
- package/src/components/MessageInput/components/AudioRecorder/AudioRecordingButton.tsx +192 -0
- package/src/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.tsx +114 -0
- package/src/components/MessageInput/components/AudioRecorder/AudioRecordingLockIndicator.tsx +85 -0
- package/src/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.tsx +102 -0
- package/src/components/MessageInput/components/AudioRecorder/AudioRecordingWaveform.tsx +62 -0
- package/src/components/MessageInput/hooks/useAudioController.tsx +288 -0
- package/src/components/MessageInput/utils/audioSampling.ts +108 -0
- package/src/components/MessageInput/utils/normalizeAudioLevel.ts +20 -0
- package/src/components/ProgressControl/ProgressControl.tsx +69 -40
- package/src/components/ProgressControl/WaveProgressBar.tsx +180 -0
- package/src/components/Reply/Reply.tsx +89 -56
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +38 -20
- package/src/components/index.ts +6 -0
- package/src/contexts/messageInputContext/MessageInputContext.tsx +95 -10
- package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +25 -0
- package/src/contexts/messageInputContext/hooks/useMessageDetailsForState.ts +80 -27
- package/src/contexts/themeContext/utils/theme.ts +111 -14
- package/src/i18n/en.json +2 -0
- package/src/i18n/es.json +2 -0
- package/src/i18n/fr.json +2 -0
- package/src/i18n/he.json +2 -0
- package/src/i18n/hi.json +2 -0
- package/src/i18n/it.json +2 -0
- package/src/i18n/ja.json +2 -0
- package/src/i18n/ko.json +2 -0
- package/src/i18n/nl.json +2 -0
- package/src/i18n/pt-BR.json +2 -0
- package/src/i18n/ru.json +2 -0
- package/src/i18n/tr.json +2 -0
- package/src/icons/ArrowLeft.tsx +18 -0
- package/src/icons/ArrowUp.tsx +19 -0
- package/src/icons/Audio.tsx +24 -24
- package/src/icons/CircleStop.tsx +18 -0
- package/src/icons/Delete.tsx +14 -8
- package/src/icons/Lock.tsx +22 -0
- package/src/icons/Mic.tsx +20 -0
- package/src/icons/Pause.tsx +12 -11
- package/src/icons/Play.tsx +9 -13
- package/src/icons/SendCheck.tsx +18 -0
- package/src/icons/SendRight.tsx +16 -7
- package/src/icons/SendUp.tsx +16 -7
- package/src/icons/Stop.tsx +12 -0
- package/src/icons/index.ts +7 -0
- package/src/native.ts +69 -0
- package/src/types/types.ts +6 -0
- package/src/utils/getTrimmedAttachmentTitle.ts +5 -0
- package/src/version.json +1 -1
|
@@ -19,23 +19,6 @@ import { isAudioPackageAvailable } from '../../native';
|
|
|
19
19
|
|
|
20
20
|
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
21
21
|
|
|
22
|
-
const FILE_PREVIEW_HEIGHT = 60;
|
|
23
|
-
|
|
24
|
-
const styles = StyleSheet.create({
|
|
25
|
-
container: {
|
|
26
|
-
padding: 4,
|
|
27
|
-
},
|
|
28
|
-
fileContainer: {
|
|
29
|
-
borderRadius: 12,
|
|
30
|
-
borderWidth: 1,
|
|
31
|
-
flexDirection: 'row',
|
|
32
|
-
height: FILE_PREVIEW_HEIGHT,
|
|
33
|
-
justifyContent: 'space-between',
|
|
34
|
-
paddingLeft: 8,
|
|
35
|
-
paddingRight: 8,
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
|
|
39
22
|
export type FileAttachmentGroupPropsWithContext<
|
|
40
23
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
41
24
|
> = Pick<MessageContextValue<StreamChatGenerics>, 'files'> &
|
|
@@ -67,7 +50,9 @@ const FileAttachmentGroupWithContext = <
|
|
|
67
50
|
const [filesToDisplay, setFilesToDisplay] = useState<FilesToDisplayType[]>([]);
|
|
68
51
|
|
|
69
52
|
useEffect(() => {
|
|
70
|
-
setFilesToDisplay(
|
|
53
|
+
setFilesToDisplay(
|
|
54
|
+
files.map((file) => ({ ...file, duration: file.duration || 0, paused: true, progress: 0 })),
|
|
55
|
+
);
|
|
71
56
|
}, [files]);
|
|
72
57
|
|
|
73
58
|
// Handler triggered when an audio is loaded in the message input. The initial state is defined for the audio here and the duration is set.
|
|
@@ -82,17 +67,17 @@ const FileAttachmentGroupWithContext = <
|
|
|
82
67
|
|
|
83
68
|
// The handler which is triggered when the audio progresses/ the thumb is dragged in the progress control. The progressed duration is set here.
|
|
84
69
|
const onProgress = (index: string, currentTime?: number, hasEnd?: boolean) => {
|
|
85
|
-
setFilesToDisplay((
|
|
86
|
-
|
|
87
|
-
...
|
|
70
|
+
setFilesToDisplay((prevFilesToDisplay) =>
|
|
71
|
+
prevFilesToDisplay.map((filesToDisplay, id) => ({
|
|
72
|
+
...filesToDisplay,
|
|
88
73
|
progress:
|
|
89
74
|
id.toString() === index
|
|
90
75
|
? hasEnd
|
|
91
76
|
? 1
|
|
92
77
|
: currentTime
|
|
93
|
-
? currentTime / (
|
|
78
|
+
? currentTime / (filesToDisplay.duration as number)
|
|
94
79
|
: 0
|
|
95
|
-
:
|
|
80
|
+
: filesToDisplay.progress,
|
|
96
81
|
})),
|
|
97
82
|
);
|
|
98
83
|
};
|
|
@@ -120,9 +105,8 @@ const FileAttachmentGroupWithContext = <
|
|
|
120
105
|
|
|
121
106
|
const {
|
|
122
107
|
theme: {
|
|
123
|
-
colors: { grey_whisper, white },
|
|
124
108
|
messageSimple: {
|
|
125
|
-
fileAttachmentGroup: { container },
|
|
109
|
+
fileAttachmentGroup: { attachmentContainer, container },
|
|
126
110
|
},
|
|
127
111
|
},
|
|
128
112
|
} = useTheme();
|
|
@@ -135,39 +119,29 @@ const FileAttachmentGroupWithContext = <
|
|
|
135
119
|
style={[
|
|
136
120
|
{ paddingBottom: index !== files.length - 1 ? 4 : 0 },
|
|
137
121
|
stylesProp.attachmentContainer,
|
|
122
|
+
attachmentContainer,
|
|
138
123
|
]}
|
|
139
124
|
>
|
|
140
|
-
{file.type === 'audio'
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
: {},
|
|
150
|
-
{
|
|
151
|
-
backgroundColor: white,
|
|
152
|
-
borderColor: grey_whisper,
|
|
153
|
-
width: -16,
|
|
125
|
+
{(file.type === 'audio' || file.type === 'voiceRecording') &&
|
|
126
|
+
isAudioPackageAvailable() ? (
|
|
127
|
+
<AudioAttachment
|
|
128
|
+
item={{
|
|
129
|
+
duration: file.duration,
|
|
130
|
+
file: {
|
|
131
|
+
name: file.title as string,
|
|
132
|
+
uri: file.asset_url,
|
|
133
|
+
waveform_data: file.waveform_data,
|
|
154
134
|
},
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
onLoad={onLoad}
|
|
166
|
-
onPlayPause={onPlayPause}
|
|
167
|
-
onProgress={onProgress}
|
|
168
|
-
testID='audio-attachment-preview'
|
|
169
|
-
/>
|
|
170
|
-
</View>
|
|
135
|
+
id: index.toString(),
|
|
136
|
+
paused: file.paused,
|
|
137
|
+
progress: file.progress,
|
|
138
|
+
}}
|
|
139
|
+
onLoad={onLoad}
|
|
140
|
+
onPlayPause={onPlayPause}
|
|
141
|
+
onProgress={onProgress}
|
|
142
|
+
showSpeedSettings={true}
|
|
143
|
+
testID='audio-attachment-preview'
|
|
144
|
+
/>
|
|
171
145
|
) : (
|
|
172
146
|
<Attachment attachment={file} />
|
|
173
147
|
)}
|
|
@@ -225,4 +199,10 @@ export const FileAttachmentGroup = <
|
|
|
225
199
|
);
|
|
226
200
|
};
|
|
227
201
|
|
|
202
|
+
const styles = StyleSheet.create({
|
|
203
|
+
container: {
|
|
204
|
+
padding: 4,
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
|
|
228
208
|
FileAttachmentGroup.displayName = 'FileAttachmentGroup{messageSimple{fileAttachmentGroup}}';
|
|
@@ -55,7 +55,7 @@ export const VideoThumbnail = (props: VideoThumbnailProps) => {
|
|
|
55
55
|
style={[styles.container, container, style]}
|
|
56
56
|
>
|
|
57
57
|
<View style={[styles.roundedView, roundedView, { backgroundColor: static_white }]}>
|
|
58
|
-
<Play
|
|
58
|
+
<Play fill={static_black} height={32} width={32} />
|
|
59
59
|
</View>
|
|
60
60
|
</ImageBackground>
|
|
61
61
|
);
|
|
@@ -128,6 +128,12 @@ import { MessageStatus as MessageStatusDefault } from '../Message/MessageSimple/
|
|
|
128
128
|
import { ReactionList as ReactionListDefault } from '../Message/MessageSimple/ReactionList';
|
|
129
129
|
import { AttachButton as AttachButtonDefault } from '../MessageInput/AttachButton';
|
|
130
130
|
import { CommandsButton as CommandsButtonDefault } from '../MessageInput/CommandsButton';
|
|
131
|
+
import { AudioRecorder as AudioRecorderDefault } from '../MessageInput/components/AudioRecorder/AudioRecorder';
|
|
132
|
+
import { AudioRecordingButton as AudioRecordingButtonDefault } from '../MessageInput/components/AudioRecorder/AudioRecordingButton';
|
|
133
|
+
import { AudioRecordingInProgress as AudioRecordingInProgressDefault } from '../MessageInput/components/AudioRecorder/AudioRecordingInProgress';
|
|
134
|
+
import { AudioRecordingLockIndicator as AudioRecordingLockIndicatorDefault } from '../MessageInput/components/AudioRecorder/AudioRecordingLockIndicator';
|
|
135
|
+
import { AudioRecordingPreview as AudioRecordingPreviewDefault } from '../MessageInput/components/AudioRecorder/AudioRecordingPreview';
|
|
136
|
+
import { AudioRecordingWaveform as AudioRecordingWaveformDefault } from '../MessageInput/components/AudioRecorder/AudioRecordingWaveform';
|
|
131
137
|
import { InputEditingStateHeader as InputEditingStateHeaderDefault } from '../MessageInput/components/InputEditingStateHeader';
|
|
132
138
|
import { InputGiphySearch as InputGiphyCommandInputDefault } from '../MessageInput/components/InputGiphySearch';
|
|
133
139
|
import { InputReplyStateHeader as InputReplyStateHeaderDefault } from '../MessageInput/components/InputReplyStateHeader';
|
|
@@ -411,10 +417,21 @@ const ChannelWithContext = <
|
|
|
411
417
|
additionalTextInputProps,
|
|
412
418
|
additionalTouchableProps,
|
|
413
419
|
allowThreadMessagesInChannel = true,
|
|
420
|
+
asyncMessagesLockDistance = 50,
|
|
421
|
+
asyncMessagesMinimumPressDuration = 500,
|
|
422
|
+
asyncMessagesMultiSendEnabled = true,
|
|
423
|
+
asyncMessagesSlideToCancelDistance = 100,
|
|
414
424
|
AttachButton = AttachButtonDefault,
|
|
415
425
|
Attachment = AttachmentDefault,
|
|
416
426
|
AttachmentActions = AttachmentActionsDefault,
|
|
417
427
|
AudioAttachment = AudioAttachmentDefault,
|
|
428
|
+
AudioAttachmentUploadPreview = AudioAttachmentDefault,
|
|
429
|
+
AudioRecorder = AudioRecorderDefault,
|
|
430
|
+
audioRecordingEnabled = false,
|
|
431
|
+
AudioRecordingInProgress = AudioRecordingInProgressDefault,
|
|
432
|
+
AudioRecordingLockIndicator = AudioRecordingLockIndicatorDefault,
|
|
433
|
+
AudioRecordingPreview = AudioRecordingPreviewDefault,
|
|
434
|
+
AudioRecordingWaveform = AudioRecordingWaveformDefault,
|
|
418
435
|
AutoCompleteSuggestionHeader = AutoCompleteSuggestionHeaderDefault,
|
|
419
436
|
AutoCompleteSuggestionItem = AutoCompleteSuggestionItemDefault,
|
|
420
437
|
AutoCompleteSuggestionList = AutoCompleteSuggestionListDefault,
|
|
@@ -552,6 +569,7 @@ const ChannelWithContext = <
|
|
|
552
569
|
setWatchers,
|
|
553
570
|
shouldSyncChannel,
|
|
554
571
|
ShowThreadMessageInChannelButton = ShowThreadMessageInChannelButtonDefault,
|
|
572
|
+
StartAudioRecordingButton = AudioRecordingButtonDefault,
|
|
555
573
|
stateUpdateThrottleInterval = defaultThrottleInterval,
|
|
556
574
|
StickyHeader,
|
|
557
575
|
supportedReactions = reactionData,
|
|
@@ -1575,6 +1593,7 @@ const ChannelWithContext = <
|
|
|
1575
1593
|
if (
|
|
1576
1594
|
(attachment.type === 'file' ||
|
|
1577
1595
|
attachment.type === 'audio' ||
|
|
1596
|
+
attachment.type === 'voiceRecording' ||
|
|
1578
1597
|
attachment.type === 'video') &&
|
|
1579
1598
|
attachment.asset_url &&
|
|
1580
1599
|
isLocalUrl(attachment.asset_url) &&
|
|
@@ -1593,6 +1612,7 @@ const ChannelWithContext = <
|
|
|
1593
1612
|
if (response.thumb_url) {
|
|
1594
1613
|
attachment.thumb_url = response.thumb_url;
|
|
1595
1614
|
}
|
|
1615
|
+
|
|
1596
1616
|
delete attachment.originalFile;
|
|
1597
1617
|
dbApi.updateMessage({
|
|
1598
1618
|
message: { ...updatedMessage, cid: channel.cid },
|
|
@@ -2183,7 +2203,18 @@ const ChannelWithContext = <
|
|
|
2183
2203
|
|
|
2184
2204
|
const inputMessageInputContext = useCreateInputMessageInputContext<StreamChatGenerics>({
|
|
2185
2205
|
additionalTextInputProps,
|
|
2206
|
+
asyncMessagesLockDistance,
|
|
2207
|
+
asyncMessagesMinimumPressDuration,
|
|
2208
|
+
asyncMessagesMultiSendEnabled,
|
|
2209
|
+
asyncMessagesSlideToCancelDistance,
|
|
2186
2210
|
AttachButton,
|
|
2211
|
+
AudioAttachmentUploadPreview,
|
|
2212
|
+
AudioRecorder,
|
|
2213
|
+
audioRecordingEnabled,
|
|
2214
|
+
AudioRecordingInProgress,
|
|
2215
|
+
AudioRecordingLockIndicator,
|
|
2216
|
+
AudioRecordingPreview,
|
|
2217
|
+
AudioRecordingWaveform,
|
|
2187
2218
|
autoCompleteSuggestionsLimit,
|
|
2188
2219
|
autoCompleteTriggerSettings,
|
|
2189
2220
|
channelId,
|
|
@@ -2224,6 +2255,7 @@ const ChannelWithContext = <
|
|
|
2224
2255
|
setInputRef,
|
|
2225
2256
|
setQuotedMessageState,
|
|
2226
2257
|
ShowThreadMessageInChannelButton,
|
|
2258
|
+
StartAudioRecordingButton,
|
|
2227
2259
|
UploadProgressIndicator,
|
|
2228
2260
|
});
|
|
2229
2261
|
|
|
@@ -7,7 +7,18 @@ export const useCreateInputMessageInputContext = <
|
|
|
7
7
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
8
8
|
>({
|
|
9
9
|
additionalTextInputProps,
|
|
10
|
+
asyncMessagesLockDistance,
|
|
11
|
+
asyncMessagesMinimumPressDuration,
|
|
12
|
+
asyncMessagesMultiSendEnabled,
|
|
13
|
+
asyncMessagesSlideToCancelDistance,
|
|
10
14
|
AttachButton,
|
|
15
|
+
AudioAttachmentUploadPreview,
|
|
16
|
+
AudioRecorder,
|
|
17
|
+
audioRecordingEnabled,
|
|
18
|
+
AudioRecordingInProgress,
|
|
19
|
+
AudioRecordingLockIndicator,
|
|
20
|
+
AudioRecordingPreview,
|
|
21
|
+
AudioRecordingWaveform,
|
|
11
22
|
autoCompleteSuggestionsLimit,
|
|
12
23
|
autoCompleteTriggerSettings,
|
|
13
24
|
channelId,
|
|
@@ -48,6 +59,7 @@ export const useCreateInputMessageInputContext = <
|
|
|
48
59
|
setInputRef,
|
|
49
60
|
setQuotedMessageState,
|
|
50
61
|
ShowThreadMessageInChannelButton,
|
|
62
|
+
StartAudioRecordingButton,
|
|
51
63
|
UploadProgressIndicator,
|
|
52
64
|
}: InputMessageInputContextValue<StreamChatGenerics> & {
|
|
53
65
|
/**
|
|
@@ -65,7 +77,18 @@ export const useCreateInputMessageInputContext = <
|
|
|
65
77
|
const inputMessageInputContext: InputMessageInputContextValue<StreamChatGenerics> = useMemo(
|
|
66
78
|
() => ({
|
|
67
79
|
additionalTextInputProps,
|
|
80
|
+
asyncMessagesLockDistance,
|
|
81
|
+
asyncMessagesMinimumPressDuration,
|
|
82
|
+
asyncMessagesMultiSendEnabled,
|
|
83
|
+
asyncMessagesSlideToCancelDistance,
|
|
68
84
|
AttachButton,
|
|
85
|
+
AudioAttachmentUploadPreview,
|
|
86
|
+
AudioRecorder,
|
|
87
|
+
audioRecordingEnabled,
|
|
88
|
+
AudioRecordingInProgress,
|
|
89
|
+
AudioRecordingLockIndicator,
|
|
90
|
+
AudioRecordingPreview,
|
|
91
|
+
AudioRecordingWaveform,
|
|
69
92
|
autoCompleteSuggestionsLimit,
|
|
70
93
|
autoCompleteTriggerSettings,
|
|
71
94
|
clearEditingState,
|
|
@@ -105,6 +128,7 @@ export const useCreateInputMessageInputContext = <
|
|
|
105
128
|
setInputRef,
|
|
106
129
|
setQuotedMessageState,
|
|
107
130
|
ShowThreadMessageInChannelButton,
|
|
131
|
+
StartAudioRecordingButton,
|
|
108
132
|
UploadProgressIndicator,
|
|
109
133
|
}),
|
|
110
134
|
[
|
|
@@ -209,7 +209,7 @@ describe('ImageGallery', () => {
|
|
|
209
209
|
|
|
210
210
|
const progressDurationComponent = screen.getByLabelText('Progress Duration');
|
|
211
211
|
await waitFor(() => {
|
|
212
|
-
expect(screen.
|
|
212
|
+
expect(screen.queryAllByLabelText('Play Icon').length).toBeGreaterThan(0);
|
|
213
213
|
expect(progressDurationComponent.children[0]).toBe('00:10');
|
|
214
214
|
});
|
|
215
215
|
});
|
|
@@ -42,10 +42,10 @@ describe('ImageGalleryOverlay', () => {
|
|
|
42
42
|
it('should render the play icon when paused prop is true', async () => {
|
|
43
43
|
render(getComponent({ paused: true }));
|
|
44
44
|
|
|
45
|
-
const
|
|
45
|
+
const components = screen.queryAllByLabelText('Play Icon').length;
|
|
46
46
|
|
|
47
47
|
await waitFor(() => {
|
|
48
|
-
expect(
|
|
48
|
+
expect(components).toBeGreaterThan(0);
|
|
49
49
|
});
|
|
50
50
|
});
|
|
51
51
|
|
|
@@ -75,14 +75,9 @@ export const ImageGalleryVideoControl = React.memo(
|
|
|
75
75
|
<TouchableOpacity accessibilityLabel='Play Pause Button' onPress={handlePlayPause}>
|
|
76
76
|
<View style={[styles.roundedView, roundedView, { backgroundColor: static_white }]}>
|
|
77
77
|
{paused ? (
|
|
78
|
-
<Play accessibilityLabel='Play Icon'
|
|
78
|
+
<Play accessibilityLabel='Play Icon' fill={static_black} height={32} width={32} />
|
|
79
79
|
) : (
|
|
80
|
-
<Pause
|
|
81
|
-
accessibilityLabel='Pause Icon'
|
|
82
|
-
height={24}
|
|
83
|
-
pathFill={static_black}
|
|
84
|
-
width={24}
|
|
85
|
-
/>
|
|
80
|
+
<Pause accessibilityLabel='Pause Icon' fill={static_black} height={32} width={32} />
|
|
86
81
|
)}
|
|
87
82
|
</View>
|
|
88
83
|
</TouchableOpacity>
|
|
@@ -386,7 +386,7 @@ const MessageWithContext = <
|
|
|
386
386
|
} else if (cur.type === 'video' && !cur.og_scrape_url) {
|
|
387
387
|
acc.files.push(cur);
|
|
388
388
|
acc.other = []; // remove other attachments if a file exists
|
|
389
|
-
} else if (cur.type === 'audio') {
|
|
389
|
+
} else if (cur.type === 'audio' || cur.type === 'voiceRecording') {
|
|
390
390
|
acc.files.push(cur);
|
|
391
391
|
} else if (cur.type === 'image' && !cur.title_link && !cur.og_scrape_url) {
|
|
392
392
|
/**
|
|
@@ -510,7 +510,8 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
510
510
|
const attachmentKeysEqual =
|
|
511
511
|
attachment.image_url === nextMessageAttachments[index].image_url &&
|
|
512
512
|
attachment.og_scrape_url === nextMessageAttachments[index].og_scrape_url &&
|
|
513
|
-
attachment.thumb_url === nextMessageAttachments[index].thumb_url
|
|
513
|
+
attachment.thumb_url === nextMessageAttachments[index].thumb_url &&
|
|
514
|
+
attachment.type === nextMessageAttachments[index].type;
|
|
514
515
|
|
|
515
516
|
if (isAttachmentEqual)
|
|
516
517
|
return (
|
|
@@ -177,7 +177,8 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
177
177
|
const attachmentKeysEqual =
|
|
178
178
|
attachment.image_url === nextMessageAttachments[index].image_url &&
|
|
179
179
|
attachment.og_scrape_url === nextMessageAttachments[index].og_scrape_url &&
|
|
180
|
-
attachment.thumb_url === nextMessageAttachments[index].thumb_url
|
|
180
|
+
attachment.thumb_url === nextMessageAttachments[index].thumb_url &&
|
|
181
|
+
attachment.type === nextMessageAttachments[index].type;
|
|
181
182
|
|
|
182
183
|
return attachmentKeysEqual;
|
|
183
184
|
})
|
|
@@ -196,7 +196,7 @@ export const useMessageActions = <
|
|
|
196
196
|
}
|
|
197
197
|
},
|
|
198
198
|
actionType: 'deleteMessage',
|
|
199
|
-
icon: <Delete
|
|
199
|
+
icon: <Delete fill={accent_red} size={32} />,
|
|
200
200
|
title: t('Delete Message'),
|
|
201
201
|
titleStyle: { color: accent_red },
|
|
202
202
|
};
|
|
@@ -345,7 +345,7 @@ export const useMessageActions = <
|
|
|
345
345
|
await handleResendMessage();
|
|
346
346
|
},
|
|
347
347
|
actionType: 'retry',
|
|
348
|
-
icon: <SendUp
|
|
348
|
+
icon: <SendUp fill={accent_blue} size={32} />,
|
|
349
349
|
title: t('Resend'),
|
|
350
350
|
};
|
|
351
351
|
|
|
@@ -20,7 +20,8 @@ import { Close } from '../../icons/Close';
|
|
|
20
20
|
import { Warning } from '../../icons/Warning';
|
|
21
21
|
import { isAudioPackageAvailable } from '../../native';
|
|
22
22
|
import type { DefaultStreamChatGenerics, FileUpload } from '../../types/types';
|
|
23
|
-
import {
|
|
23
|
+
import { getTrimmedAttachmentTitle } from '../../utils/getTrimmedAttachmentTitle';
|
|
24
|
+
import { getIndicatorTypeForFileState, ProgressIndicatorTypes } from '../../utils/utils';
|
|
24
25
|
import { getFileSizeDisplayText } from '../Attachment/FileAttachment';
|
|
25
26
|
import { WritingDirectionAwareText } from '../RTLComponents/WritingDirectionAwareText';
|
|
26
27
|
|
|
@@ -40,13 +41,8 @@ const styles = StyleSheet.create({
|
|
|
40
41
|
borderRadius: 12,
|
|
41
42
|
borderWidth: 1,
|
|
42
43
|
flexDirection: 'row',
|
|
43
|
-
|
|
44
|
-
justifyContent: 'space-between',
|
|
45
|
-
marginBottom: 8,
|
|
46
|
-
paddingLeft: 8,
|
|
47
|
-
paddingRight: 8,
|
|
44
|
+
paddingHorizontal: 8,
|
|
48
45
|
},
|
|
49
|
-
fileContentContainer: { flexDirection: 'row' },
|
|
50
46
|
fileIcon: {
|
|
51
47
|
alignItems: 'center',
|
|
52
48
|
alignSelf: 'center',
|
|
@@ -59,17 +55,17 @@ const styles = StyleSheet.create({
|
|
|
59
55
|
},
|
|
60
56
|
fileSizeText: {
|
|
61
57
|
fontSize: 12,
|
|
58
|
+
marginTop: 10,
|
|
62
59
|
paddingHorizontal: 10,
|
|
63
60
|
},
|
|
64
61
|
fileTextContainer: {
|
|
65
|
-
height: '100%',
|
|
66
62
|
justifyContent: 'space-around',
|
|
63
|
+
marginVertical: 10,
|
|
67
64
|
},
|
|
68
65
|
flatList: { marginBottom: 12, maxHeight: FILE_PREVIEW_HEIGHT * 2.5 + 16 },
|
|
69
66
|
overlay: {
|
|
70
67
|
borderRadius: 12,
|
|
71
|
-
|
|
72
|
-
marginRight: 8,
|
|
68
|
+
marginHorizontal: 8,
|
|
73
69
|
marginTop: 2,
|
|
74
70
|
},
|
|
75
71
|
unsupportedFile: {
|
|
@@ -140,9 +136,9 @@ type FileUploadPreviewPropsWithContext<
|
|
|
140
136
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
141
137
|
> = Pick<
|
|
142
138
|
MessageInputContextValue<StreamChatGenerics>,
|
|
143
|
-
'fileUploads' | 'removeFile' | 'uploadFile' | 'setFileUploads'
|
|
139
|
+
'fileUploads' | 'removeFile' | 'uploadFile' | 'setFileUploads' | 'AudioAttachmentUploadPreview'
|
|
144
140
|
> &
|
|
145
|
-
Pick<MessagesContextValue<StreamChatGenerics>, '
|
|
141
|
+
Pick<MessagesContextValue<StreamChatGenerics>, 'FileAttachmentIcon'> &
|
|
146
142
|
Pick<ChatContextValue<StreamChatGenerics>, 'enableOfflineSupport'>;
|
|
147
143
|
|
|
148
144
|
const FileUploadPreviewWithContext = <
|
|
@@ -151,7 +147,7 @@ const FileUploadPreviewWithContext = <
|
|
|
151
147
|
props: FileUploadPreviewPropsWithContext<StreamChatGenerics>,
|
|
152
148
|
) => {
|
|
153
149
|
const {
|
|
154
|
-
|
|
150
|
+
AudioAttachmentUploadPreview,
|
|
155
151
|
enableOfflineSupport,
|
|
156
152
|
FileAttachmentIcon,
|
|
157
153
|
fileUploads,
|
|
@@ -163,12 +159,27 @@ const FileUploadPreviewWithContext = <
|
|
|
163
159
|
const flatListRef = useRef<FlatList<FileUpload> | null>(null);
|
|
164
160
|
const [flatListWidth, setFlatListWidth] = useState(0);
|
|
165
161
|
|
|
162
|
+
useEffect(() => {
|
|
163
|
+
setFileUploads(
|
|
164
|
+
fileUploads.map((file) => ({
|
|
165
|
+
...file,
|
|
166
|
+
duration: file.duration || 0,
|
|
167
|
+
paused: true,
|
|
168
|
+
progress: 0,
|
|
169
|
+
})),
|
|
170
|
+
);
|
|
171
|
+
}, [fileUploads.length]);
|
|
172
|
+
|
|
166
173
|
// Handler triggered when an audio is loaded in the message input. The initial state is defined for the audio here and the duration is set.
|
|
167
174
|
const onLoad = (index: string, duration: number) => {
|
|
168
175
|
setFileUploads((prevFileUploads) =>
|
|
169
176
|
prevFileUploads.map((fileUpload) => ({
|
|
170
177
|
...fileUpload,
|
|
171
178
|
duration: fileUpload.id === index ? duration : fileUpload.duration,
|
|
179
|
+
file: {
|
|
180
|
+
...fileUpload.file,
|
|
181
|
+
duration: fileUpload.id === index ? duration : fileUpload.duration,
|
|
182
|
+
},
|
|
172
183
|
})),
|
|
173
184
|
);
|
|
174
185
|
};
|
|
@@ -213,26 +224,16 @@ const FileUploadPreviewWithContext = <
|
|
|
213
224
|
|
|
214
225
|
const {
|
|
215
226
|
theme: {
|
|
216
|
-
colors: { black, grey_dark, grey_gainsboro, grey_whisper
|
|
227
|
+
colors: { black, grey_dark, grey_gainsboro, grey_whisper },
|
|
217
228
|
messageInput: {
|
|
218
|
-
fileUploadPreview: {
|
|
219
|
-
audioAttachmentFileContainer,
|
|
220
|
-
dismiss,
|
|
221
|
-
fileContainer,
|
|
222
|
-
fileContentContainer,
|
|
223
|
-
filenameText,
|
|
224
|
-
fileTextContainer,
|
|
225
|
-
flatList,
|
|
226
|
-
},
|
|
229
|
+
fileUploadPreview: { dismiss, fileContainer, filenameText, fileTextContainer, flatList },
|
|
227
230
|
},
|
|
228
231
|
},
|
|
229
232
|
} = useTheme();
|
|
230
233
|
|
|
231
|
-
const renderItem = ({
|
|
234
|
+
const renderItem = ({ item }: { item: FileUpload }) => {
|
|
232
235
|
const indicatorType = getIndicatorTypeForFileState(item.state, enableOfflineSupport);
|
|
233
236
|
|
|
234
|
-
const lastIndexOfDot = item.file.name.lastIndexOf('.');
|
|
235
|
-
|
|
236
237
|
return (
|
|
237
238
|
<>
|
|
238
239
|
<UploadProgressIndicator
|
|
@@ -243,85 +244,53 @@ const FileUploadPreviewWithContext = <
|
|
|
243
244
|
type={indicatorType}
|
|
244
245
|
>
|
|
245
246
|
{item.file.mimeType?.startsWith('audio/') && isAudioPackageAvailable() ? (
|
|
246
|
-
<
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
styles.fileContainer,
|
|
255
|
-
index === fileUploads.length - 1
|
|
256
|
-
? {
|
|
257
|
-
marginBottom: 0,
|
|
258
|
-
}
|
|
259
|
-
: {},
|
|
260
|
-
{
|
|
261
|
-
backgroundColor: white,
|
|
262
|
-
borderColor: grey_whisper,
|
|
263
|
-
width: -16,
|
|
264
|
-
},
|
|
265
|
-
fileContainer,
|
|
266
|
-
]}
|
|
267
|
-
testID='audio-attachment-upload-preview'
|
|
268
|
-
>
|
|
269
|
-
<AudioAttachment
|
|
270
|
-
item={item}
|
|
271
|
-
onLoad={onLoad}
|
|
272
|
-
onPlayPause={onPlayPause}
|
|
273
|
-
onProgress={onProgress}
|
|
274
|
-
testID='audio-attachment-upload-preview'
|
|
275
|
-
/>
|
|
276
|
-
</View>
|
|
277
|
-
</View>
|
|
247
|
+
<AudioAttachmentUploadPreview
|
|
248
|
+
hideProgressBar={true}
|
|
249
|
+
item={item}
|
|
250
|
+
onLoad={onLoad}
|
|
251
|
+
onPlayPause={onPlayPause}
|
|
252
|
+
onProgress={onProgress}
|
|
253
|
+
testID='audio-attachment-upload-preview'
|
|
254
|
+
/>
|
|
278
255
|
) : (
|
|
279
256
|
<View
|
|
280
257
|
style={[
|
|
281
258
|
styles.fileContainer,
|
|
282
|
-
index === fileUploads.length - 1
|
|
283
|
-
? {
|
|
284
|
-
marginBottom: 0,
|
|
285
|
-
}
|
|
286
|
-
: {},
|
|
287
259
|
{
|
|
288
260
|
borderColor: grey_whisper,
|
|
289
|
-
width: flatListWidth - 16,
|
|
290
261
|
},
|
|
291
262
|
fileContainer,
|
|
292
263
|
]}
|
|
293
264
|
>
|
|
294
|
-
<View style={
|
|
295
|
-
<
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
<
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
)}
|
|
324
|
-
</View>
|
|
265
|
+
<View style={styles.fileIcon}>
|
|
266
|
+
<FileAttachmentIcon mimeType={item.file.mimeType} />
|
|
267
|
+
</View>
|
|
268
|
+
<View style={[styles.fileTextContainer, fileTextContainer]}>
|
|
269
|
+
<Text
|
|
270
|
+
numberOfLines={1}
|
|
271
|
+
style={[
|
|
272
|
+
styles.filenameText,
|
|
273
|
+
{
|
|
274
|
+
color: black,
|
|
275
|
+
width:
|
|
276
|
+
flatListWidth -
|
|
277
|
+
16 - // 16 = horizontal padding
|
|
278
|
+
40 - // 40 = file icon size
|
|
279
|
+
24 - // 24 = close icon size
|
|
280
|
+
24, // 24 = internal padding
|
|
281
|
+
},
|
|
282
|
+
I18nManager.isRTL ? { writingDirection: 'rtl' } : { writingDirection: 'ltr' },
|
|
283
|
+
filenameText,
|
|
284
|
+
]}
|
|
285
|
+
>
|
|
286
|
+
{getTrimmedAttachmentTitle(item.file.name)}
|
|
287
|
+
</Text>
|
|
288
|
+
{indicatorType !== null && (
|
|
289
|
+
<UnsupportedFileTypeOrFileSizeIndicator
|
|
290
|
+
indicatorType={indicatorType}
|
|
291
|
+
item={item}
|
|
292
|
+
/>
|
|
293
|
+
)}
|
|
325
294
|
</View>
|
|
326
295
|
</View>
|
|
327
296
|
)}
|
|
@@ -408,14 +377,14 @@ export const FileUploadPreview = <
|
|
|
408
377
|
props: FileUploadPreviewProps<StreamChatGenerics>,
|
|
409
378
|
) => {
|
|
410
379
|
const { enableOfflineSupport } = useChatContext<StreamChatGenerics>();
|
|
411
|
-
const { fileUploads, removeFile, setFileUploads, uploadFile } =
|
|
380
|
+
const { AudioAttachmentUploadPreview, fileUploads, removeFile, setFileUploads, uploadFile } =
|
|
412
381
|
useMessageInputContext<StreamChatGenerics>();
|
|
413
|
-
const {
|
|
382
|
+
const { FileAttachmentIcon } = useMessagesContext<StreamChatGenerics>();
|
|
414
383
|
|
|
415
384
|
return (
|
|
416
385
|
<MemoizedFileUploadPreview
|
|
417
386
|
{...{
|
|
418
|
-
|
|
387
|
+
AudioAttachmentUploadPreview,
|
|
419
388
|
FileAttachmentIcon,
|
|
420
389
|
fileUploads,
|
|
421
390
|
removeFile,
|
|
@@ -11,7 +11,7 @@ import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
|
11
11
|
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
12
12
|
|
|
13
13
|
const styles = StyleSheet.create({
|
|
14
|
-
attachButtonContainer: { paddingRight:
|
|
14
|
+
attachButtonContainer: { paddingRight: 5 },
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
export type InputButtonsProps<
|
|
@@ -88,6 +88,7 @@ export const InputButtonsWithContext = <
|
|
|
88
88
|
</>
|
|
89
89
|
);
|
|
90
90
|
};
|
|
91
|
+
|
|
91
92
|
const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(
|
|
92
93
|
prevProps: InputButtonsWithContextProps<StreamChatGenerics>,
|
|
93
94
|
nextProps: InputButtonsWithContextProps<StreamChatGenerics>,
|