stream-chat-react-native-core 5.28.1 → 5.29.0-beta.1
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 +3 -1
- package/lib/commonjs/i18n/es.json +64 -62
- package/lib/commonjs/i18n/fr.json +64 -62
- package/lib/commonjs/i18n/he.json +64 -62
- package/lib/commonjs/i18n/hi.json +64 -62
- package/lib/commonjs/i18n/it.json +64 -62
- package/lib/commonjs/i18n/ja.json +64 -62
- package/lib/commonjs/i18n/ko.json +64 -62
- package/lib/commonjs/i18n/nl.json +64 -62
- package/lib/commonjs/i18n/pt-BR.json +64 -62
- package/lib/commonjs/i18n/ru.json +64 -62
- package/lib/commonjs/i18n/tr.json +64 -62
- 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 +3 -1
- package/lib/module/i18n/es.json +64 -62
- package/lib/module/i18n/fr.json +64 -62
- package/lib/module/i18n/he.json +64 -62
- package/lib/module/i18n/hi.json +64 -62
- package/lib/module/i18n/it.json +64 -62
- package/lib/module/i18n/ja.json +64 -62
- package/lib/module/i18n/ko.json +64 -62
- package/lib/module/i18n/nl.json +64 -62
- package/lib/module/i18n/pt-BR.json +64 -62
- package/lib/module/i18n/ru.json +64 -62
- package/lib/module/i18n/tr.json +64 -62
- 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 +3 -1
- package/lib/typescript/i18n/es.json +64 -62
- package/lib/typescript/i18n/fr.json +64 -62
- package/lib/typescript/i18n/he.json +64 -62
- package/lib/typescript/i18n/hi.json +64 -62
- package/lib/typescript/i18n/it.json +64 -62
- package/lib/typescript/i18n/ja.json +64 -62
- package/lib/typescript/i18n/ko.json +64 -62
- package/lib/typescript/i18n/nl.json +64 -62
- package/lib/typescript/i18n/pt-BR.json +64 -62
- package/lib/typescript/i18n/ru.json +64 -62
- package/lib/typescript/i18n/tr.json +64 -62
- 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 +3 -1
- package/src/i18n/es.json +64 -62
- package/src/i18n/fr.json +64 -62
- package/src/i18n/he.json +64 -62
- package/src/i18n/hi.json +64 -62
- package/src/i18n/it.json +64 -62
- package/src/i18n/ja.json +64 -62
- package/src/i18n/ko.json +64 -62
- package/src/i18n/nl.json +64 -62
- package/src/i18n/pt-BR.json +64 -62
- package/src/i18n/ru.json +64 -62
- package/src/i18n/tr.json +64 -62
- 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
|
@@ -21,9 +21,16 @@ import {
|
|
|
21
21
|
import { useCreateMessageInputContext } from './hooks/useCreateMessageInputContext';
|
|
22
22
|
import { useMessageDetailsForState } from './hooks/useMessageDetailsForState';
|
|
23
23
|
|
|
24
|
+
import { AudioAttachmentProps } from '../../components/Attachment/AudioAttachment';
|
|
24
25
|
import { parseLinksFromText } from '../../components/Message/MessageSimple/utils/parseLinks';
|
|
25
26
|
import type { AttachButtonProps } from '../../components/MessageInput/AttachButton';
|
|
26
27
|
import type { CommandsButtonProps } from '../../components/MessageInput/CommandsButton';
|
|
28
|
+
import type { AudioRecorderProps } from '../../components/MessageInput/components/AudioRecorder/AudioRecorder';
|
|
29
|
+
import type { AudioRecordingButtonProps } from '../../components/MessageInput/components/AudioRecorder/AudioRecordingButton';
|
|
30
|
+
import type { AudioRecordingInProgressProps } from '../../components/MessageInput/components/AudioRecorder/AudioRecordingInProgress';
|
|
31
|
+
import type { AudioRecordingLockIndicatorProps } from '../../components/MessageInput/components/AudioRecorder/AudioRecordingLockIndicator';
|
|
32
|
+
import type { AudioRecordingPreviewProps } from '../../components/MessageInput/components/AudioRecorder/AudioRecordingPreview';
|
|
33
|
+
import type { AudioRecordingWaveformProps } from '../../components/MessageInput/components/AudioRecorder/AudioRecordingWaveform';
|
|
27
34
|
import type { InputEditingStateHeaderProps } from '../../components/MessageInput/components/InputEditingStateHeader';
|
|
28
35
|
import type { InputGiphySearchProps } from '../../components/MessageInput/components/InputGiphySearch';
|
|
29
36
|
import type { InputReplyStateHeaderProps } from '../../components/MessageInput/components/InputReplyStateHeader';
|
|
@@ -192,9 +199,6 @@ export type LocalMessageInputContext<
|
|
|
192
199
|
setShowMoreOptions: React.Dispatch<React.SetStateAction<boolean>>;
|
|
193
200
|
setText: React.Dispatch<React.SetStateAction<string>>;
|
|
194
201
|
showMoreOptions: boolean;
|
|
195
|
-
/**
|
|
196
|
-
* Text value of the TextInput
|
|
197
|
-
*/
|
|
198
202
|
text: string;
|
|
199
203
|
toggleAttachmentPicker: () => void;
|
|
200
204
|
/**
|
|
@@ -213,12 +217,68 @@ export type LocalMessageInputContext<
|
|
|
213
217
|
export type InputMessageInputContextValue<
|
|
214
218
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
215
219
|
> = Pick<ChannelContextValue<StreamChatGenerics>, 'disabled'> & {
|
|
220
|
+
/**
|
|
221
|
+
* Controls how many pixels to the top side the user has to scroll in order to lock the recording view and allow the user to lift their finger from the screen without stopping the recording.
|
|
222
|
+
*/
|
|
223
|
+
asyncMessagesLockDistance: number;
|
|
224
|
+
/**
|
|
225
|
+
* Controls the minimum duration that the user has to press on the record button in the composer, in order to start recording a new voice message.
|
|
226
|
+
*/
|
|
227
|
+
asyncMessagesMinimumPressDuration: number;
|
|
228
|
+
/**
|
|
229
|
+
* When it’s enabled, recorded messages won’t be sent immediately. Instead they will “stack up” in the composer allowing the user to send multiple voice recording as part of the same message.
|
|
230
|
+
*/
|
|
231
|
+
asyncMessagesMultiSendEnabled: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* Controls how many pixels to the leading side the user has to scroll in order to cancel the recording of a voice message.
|
|
234
|
+
*/
|
|
235
|
+
asyncMessagesSlideToCancelDistance: number;
|
|
216
236
|
/**
|
|
217
237
|
* Custom UI component for attach button.
|
|
218
238
|
*
|
|
219
239
|
* Defaults to and accepts same props as: [AttachButton](https://getstream.io/chat/docs/sdk/reactnative/ui-components/attach-button/)
|
|
220
240
|
*/
|
|
221
241
|
AttachButton: React.ComponentType<AttachButtonProps<StreamChatGenerics>>;
|
|
242
|
+
/**
|
|
243
|
+
* Custom UI component for audio attachment upload preview.
|
|
244
|
+
*
|
|
245
|
+
* Defaults to and accepts same props as: [AudioAttachmentUploadPreview](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/AudioAttachment.tsx)
|
|
246
|
+
*/
|
|
247
|
+
AudioAttachmentUploadPreview: React.ComponentType<AudioAttachmentProps>;
|
|
248
|
+
/**
|
|
249
|
+
* Custom UI component for audio recorder UI.
|
|
250
|
+
*
|
|
251
|
+
* Defaults to and accepts same props as: [AudioRecorder](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageInput/AudioRecorder.tsx)
|
|
252
|
+
*/
|
|
253
|
+
AudioRecorder: React.ComponentType<AudioRecorderProps<StreamChatGenerics>>;
|
|
254
|
+
/**
|
|
255
|
+
* Controls whether the async audio feature is enabled.
|
|
256
|
+
*/
|
|
257
|
+
audioRecordingEnabled: boolean;
|
|
258
|
+
/**
|
|
259
|
+
* Custom UI component to render audio recording in progress.
|
|
260
|
+
*
|
|
261
|
+
* **Default** [AudioRecordingInProgress](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.tsx)
|
|
262
|
+
*/
|
|
263
|
+
AudioRecordingInProgress: React.ComponentType<AudioRecordingInProgressProps>;
|
|
264
|
+
/**
|
|
265
|
+
* Custom UI component for audio recording lock indicator.
|
|
266
|
+
*
|
|
267
|
+
* Defaults to and accepts same props as: [AudioRecordingLockIndicator](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageInput/components/AudioRecorder/AudioRecordingLockIndicator.tsx)
|
|
268
|
+
*/
|
|
269
|
+
AudioRecordingLockIndicator: React.ComponentType<AudioRecordingLockIndicatorProps>;
|
|
270
|
+
/**
|
|
271
|
+
* Custom UI component to render audio recording preview.
|
|
272
|
+
*
|
|
273
|
+
* **Default** [AudioRecordingPreview](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.tsx)
|
|
274
|
+
*/
|
|
275
|
+
AudioRecordingPreview: React.ComponentType<AudioRecordingPreviewProps>;
|
|
276
|
+
/**
|
|
277
|
+
* Custom UI component to render audio recording waveform.
|
|
278
|
+
*
|
|
279
|
+
* **Default** [AudioRecordingWaveform](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageInput/components/AudioRecorder/AudioRecordingWaveform.tsx)
|
|
280
|
+
*/
|
|
281
|
+
AudioRecordingWaveform: React.ComponentType<AudioRecordingWaveformProps>;
|
|
222
282
|
|
|
223
283
|
clearEditingState: () => void;
|
|
224
284
|
clearQuotedMessageState: () => void;
|
|
@@ -260,6 +320,7 @@ export type InputMessageInputContextValue<
|
|
|
260
320
|
InputReplyStateHeader: React.ComponentType<InputReplyStateHeaderProps<StreamChatGenerics>>;
|
|
261
321
|
/** Limit on allowed number of files to attach at a time. */
|
|
262
322
|
maxNumberOfFiles: number;
|
|
323
|
+
|
|
263
324
|
/**
|
|
264
325
|
* Custom UI component for more options button.
|
|
265
326
|
*
|
|
@@ -285,12 +346,19 @@ export type InputMessageInputContextValue<
|
|
|
285
346
|
ShowThreadMessageInChannelButton: React.ComponentType<{
|
|
286
347
|
threadList?: boolean;
|
|
287
348
|
}>;
|
|
349
|
+
/**
|
|
350
|
+
* Custom UI component for audio recording mic button.
|
|
351
|
+
*
|
|
352
|
+
* Defaults to and accepts same props as: [AudioRecordingButton](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageInput/components/AudioRecorder/AudioRecordingButton.tsx)
|
|
353
|
+
*/
|
|
354
|
+
StartAudioRecordingButton: React.ComponentType<AudioRecordingButtonProps<StreamChatGenerics>>;
|
|
288
355
|
/**
|
|
289
356
|
* Custom UI component to render upload progress indicator on attachment preview.
|
|
290
357
|
*
|
|
291
358
|
* **Default** [UploadProgressIndicator](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageInput/UploadProgressIndicator.tsx)
|
|
292
359
|
*/
|
|
293
360
|
UploadProgressIndicator: React.ComponentType<UploadProgressIndicatorProps>;
|
|
361
|
+
|
|
294
362
|
/**
|
|
295
363
|
* Additional props for underlying TextInput component. These props will be forwarded as it is to TextInput component.
|
|
296
364
|
*
|
|
@@ -666,7 +734,7 @@ export const MessageInputProvider = <
|
|
|
666
734
|
};
|
|
667
735
|
|
|
668
736
|
const mapFileUploadToAttachment = (file: FileUpload): Attachment<StreamChatGenerics> => {
|
|
669
|
-
if (file.
|
|
737
|
+
if (file.type === 'image') {
|
|
670
738
|
return {
|
|
671
739
|
fallback: file.file.name,
|
|
672
740
|
image_url: file.url,
|
|
@@ -674,7 +742,7 @@ export const MessageInputProvider = <
|
|
|
674
742
|
originalFile: file.file,
|
|
675
743
|
type: 'image',
|
|
676
744
|
};
|
|
677
|
-
} else if (file.
|
|
745
|
+
} else if (file.type === 'audio') {
|
|
678
746
|
return {
|
|
679
747
|
asset_url: file.url || file.file.uri,
|
|
680
748
|
duration: file.file.duration,
|
|
@@ -684,7 +752,7 @@ export const MessageInputProvider = <
|
|
|
684
752
|
title: file.file.name,
|
|
685
753
|
type: 'audio',
|
|
686
754
|
};
|
|
687
|
-
} else if (file.
|
|
755
|
+
} else if (file.type === 'video') {
|
|
688
756
|
return {
|
|
689
757
|
asset_url: file.url || file.file.uri,
|
|
690
758
|
duration: file.file.duration,
|
|
@@ -695,6 +763,17 @@ export const MessageInputProvider = <
|
|
|
695
763
|
title: file.file.name,
|
|
696
764
|
type: 'video',
|
|
697
765
|
};
|
|
766
|
+
} else if (file.type === 'voiceRecording') {
|
|
767
|
+
return {
|
|
768
|
+
asset_url: file.url || file.file.uri,
|
|
769
|
+
duration: file.file.duration,
|
|
770
|
+
file_size: file.file.size,
|
|
771
|
+
mime_type: file.file.mimeType,
|
|
772
|
+
originalFile: file.file,
|
|
773
|
+
title: file.file.name,
|
|
774
|
+
type: 'voiceRecording',
|
|
775
|
+
waveform_data: file.file.waveform_data,
|
|
776
|
+
};
|
|
698
777
|
} else {
|
|
699
778
|
return {
|
|
700
779
|
asset_url: file.url || file.file.uri,
|
|
@@ -1009,7 +1088,11 @@ export const MessageInputProvider = <
|
|
|
1009
1088
|
}
|
|
1010
1089
|
uploadAbortControllerRef.current.delete(file.name);
|
|
1011
1090
|
}
|
|
1012
|
-
|
|
1091
|
+
|
|
1092
|
+
const extraData: Partial<FileUpload> = {
|
|
1093
|
+
thumb_url: response.thumb_url,
|
|
1094
|
+
url: response.file,
|
|
1095
|
+
};
|
|
1013
1096
|
setFileUploads(getUploadSetStateAction(id, FileState.UPLOADED, extraData));
|
|
1014
1097
|
} catch (error: unknown) {
|
|
1015
1098
|
if (
|
|
@@ -1121,13 +1204,15 @@ export const MessageInputProvider = <
|
|
|
1121
1204
|
? FileState.NOT_SUPPORTED
|
|
1122
1205
|
: FileState.UPLOADING;
|
|
1123
1206
|
|
|
1207
|
+
// If file type is explicitly provided while upload we use it, else we derive the file type.
|
|
1208
|
+
const fileType = file.type || file.mimeType?.split('/')[0];
|
|
1209
|
+
|
|
1124
1210
|
const newFile: FileUpload = {
|
|
1125
|
-
duration: 0,
|
|
1211
|
+
duration: file.duration || 0,
|
|
1126
1212
|
file,
|
|
1127
1213
|
id: file.id || id,
|
|
1128
|
-
paused: true,
|
|
1129
|
-
progress: 0,
|
|
1130
1214
|
state: fileState,
|
|
1215
|
+
type: fileType,
|
|
1131
1216
|
};
|
|
1132
1217
|
|
|
1133
1218
|
await Promise.all([
|
|
@@ -10,8 +10,19 @@ export const useCreateMessageInputContext = <
|
|
|
10
10
|
additionalTextInputProps,
|
|
11
11
|
appendText,
|
|
12
12
|
asyncIds,
|
|
13
|
+
asyncMessagesLockDistance,
|
|
14
|
+
asyncMessagesMinimumPressDuration,
|
|
15
|
+
asyncMessagesMultiSendEnabled,
|
|
16
|
+
asyncMessagesSlideToCancelDistance,
|
|
13
17
|
asyncUploads,
|
|
14
18
|
AttachButton,
|
|
19
|
+
AudioAttachmentUploadPreview,
|
|
20
|
+
AudioRecorder,
|
|
21
|
+
audioRecordingEnabled,
|
|
22
|
+
AudioRecordingInProgress,
|
|
23
|
+
AudioRecordingLockIndicator,
|
|
24
|
+
AudioRecordingPreview,
|
|
25
|
+
AudioRecordingWaveform,
|
|
15
26
|
autoCompleteSuggestionsLimit,
|
|
16
27
|
clearEditingState,
|
|
17
28
|
clearQuotedMessageState,
|
|
@@ -57,6 +68,7 @@ export const useCreateMessageInputContext = <
|
|
|
57
68
|
openCommandsPicker,
|
|
58
69
|
openFilePicker,
|
|
59
70
|
openMentionsPicker,
|
|
71
|
+
|
|
60
72
|
pickFile,
|
|
61
73
|
quotedMessage,
|
|
62
74
|
removeFile,
|
|
@@ -85,6 +97,7 @@ export const useCreateMessageInputContext = <
|
|
|
85
97
|
setText,
|
|
86
98
|
showMoreOptions,
|
|
87
99
|
ShowThreadMessageInChannelButton,
|
|
100
|
+
StartAudioRecordingButton,
|
|
88
101
|
text,
|
|
89
102
|
thread,
|
|
90
103
|
toggleAttachmentPicker,
|
|
@@ -117,8 +130,19 @@ export const useCreateMessageInputContext = <
|
|
|
117
130
|
additionalTextInputProps,
|
|
118
131
|
appendText,
|
|
119
132
|
asyncIds,
|
|
133
|
+
asyncMessagesLockDistance,
|
|
134
|
+
asyncMessagesMinimumPressDuration,
|
|
135
|
+
asyncMessagesMultiSendEnabled,
|
|
136
|
+
asyncMessagesSlideToCancelDistance,
|
|
120
137
|
asyncUploads,
|
|
121
138
|
AttachButton,
|
|
139
|
+
AudioAttachmentUploadPreview,
|
|
140
|
+
AudioRecorder,
|
|
141
|
+
audioRecordingEnabled,
|
|
142
|
+
AudioRecordingInProgress,
|
|
143
|
+
AudioRecordingLockIndicator,
|
|
144
|
+
AudioRecordingPreview,
|
|
145
|
+
AudioRecordingWaveform,
|
|
122
146
|
autoCompleteSuggestionsLimit,
|
|
123
147
|
clearEditingState,
|
|
124
148
|
clearQuotedMessageState,
|
|
@@ -192,6 +216,7 @@ export const useCreateMessageInputContext = <
|
|
|
192
216
|
setText,
|
|
193
217
|
showMoreOptions,
|
|
194
218
|
ShowThreadMessageInChannelButton,
|
|
219
|
+
StartAudioRecordingButton,
|
|
195
220
|
text,
|
|
196
221
|
toggleAttachmentPicker,
|
|
197
222
|
triggerSettings,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
|
+
import { Attachment } from 'stream-chat';
|
|
4
|
+
|
|
3
5
|
import type { DefaultStreamChatGenerics, FileUpload, ImageUpload } from '../../../types/types';
|
|
4
6
|
import { generateRandomId } from '../../../utils/utils';
|
|
5
7
|
|
|
@@ -16,6 +18,7 @@ export const useMessageDetailsForState = <
|
|
|
16
18
|
const [mentionedUsers, setMentionedUsers] = useState<string[]>([]);
|
|
17
19
|
const [numberOfUploads, setNumberOfUploads] = useState(0);
|
|
18
20
|
const [showMoreOptions, setShowMoreOptions] = useState(true);
|
|
21
|
+
|
|
19
22
|
const initialTextValue = initialValue || '';
|
|
20
23
|
const [text, setText] = useState(initialTextValue);
|
|
21
24
|
|
|
@@ -23,7 +26,10 @@ export const useMessageDetailsForState = <
|
|
|
23
26
|
if (text !== initialTextValue) {
|
|
24
27
|
setShowMoreOptions(false);
|
|
25
28
|
}
|
|
26
|
-
|
|
29
|
+
if (fileUploads.length || imageUploads.length) {
|
|
30
|
+
setShowMoreOptions(false);
|
|
31
|
+
}
|
|
32
|
+
}, [text, imageUploads.length, fileUploads.length]);
|
|
27
33
|
|
|
28
34
|
const messageValue =
|
|
29
35
|
message === undefined ? '' : `${message.id}${message.text}${message.updated_at}`;
|
|
@@ -35,6 +41,73 @@ export const useMessageDetailsForState = <
|
|
|
35
41
|
}
|
|
36
42
|
}, [messageValue]);
|
|
37
43
|
|
|
44
|
+
const mapAttachmentToFileUpload = (attachment: Attachment<StreamChatGenerics>): FileUpload => {
|
|
45
|
+
const id = generateRandomId();
|
|
46
|
+
|
|
47
|
+
if (attachment.type === 'audio') {
|
|
48
|
+
return {
|
|
49
|
+
file: {
|
|
50
|
+
duration: attachment.duration,
|
|
51
|
+
mimeType: attachment.mime_type,
|
|
52
|
+
name: attachment.title || '',
|
|
53
|
+
size: attachment.file_size,
|
|
54
|
+
uri: attachment.asset_url,
|
|
55
|
+
},
|
|
56
|
+
id,
|
|
57
|
+
state: 'finished',
|
|
58
|
+
url: attachment.asset_url,
|
|
59
|
+
};
|
|
60
|
+
} else if (attachment.type === 'video') {
|
|
61
|
+
return {
|
|
62
|
+
file: {
|
|
63
|
+
mimeType: attachment.mime_type,
|
|
64
|
+
name: attachment.title || '',
|
|
65
|
+
size: attachment.file_size,
|
|
66
|
+
},
|
|
67
|
+
id,
|
|
68
|
+
state: 'finished',
|
|
69
|
+
thumb_url: attachment.thumb_url,
|
|
70
|
+
url: attachment.asset_url,
|
|
71
|
+
};
|
|
72
|
+
} else if (attachment.type === 'voiceRecording') {
|
|
73
|
+
return {
|
|
74
|
+
file: {
|
|
75
|
+
duration: attachment.duration,
|
|
76
|
+
mimeType: attachment.mime_type,
|
|
77
|
+
name: attachment.title || '',
|
|
78
|
+
size: attachment.file_size,
|
|
79
|
+
uri: attachment.asset_url,
|
|
80
|
+
waveform_data: attachment.waveform_data,
|
|
81
|
+
},
|
|
82
|
+
id,
|
|
83
|
+
state: 'finished',
|
|
84
|
+
url: attachment.asset_url,
|
|
85
|
+
};
|
|
86
|
+
} else if (attachment.type === 'file') {
|
|
87
|
+
return {
|
|
88
|
+
file: {
|
|
89
|
+
mimeType: attachment.mime_type,
|
|
90
|
+
name: attachment.title || '',
|
|
91
|
+
size: attachment.file_size,
|
|
92
|
+
},
|
|
93
|
+
id,
|
|
94
|
+
state: 'finished',
|
|
95
|
+
url: attachment.asset_url,
|
|
96
|
+
};
|
|
97
|
+
} else {
|
|
98
|
+
return {
|
|
99
|
+
file: {
|
|
100
|
+
mimeType: attachment.mime_type,
|
|
101
|
+
name: attachment.title || '',
|
|
102
|
+
size: attachment.file_size,
|
|
103
|
+
},
|
|
104
|
+
id,
|
|
105
|
+
state: 'finished',
|
|
106
|
+
url: attachment.asset_url,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
38
111
|
useEffect(() => {
|
|
39
112
|
if (message) {
|
|
40
113
|
setText(message?.text || '');
|
|
@@ -44,19 +117,7 @@ export const useMessageDetailsForState = <
|
|
|
44
117
|
const attachments = Array.isArray(message.attachments) ? message.attachments : [];
|
|
45
118
|
|
|
46
119
|
for (const attachment of attachments) {
|
|
47
|
-
if (attachment.type === '
|
|
48
|
-
const id = generateRandomId();
|
|
49
|
-
newFileUploads.push({
|
|
50
|
-
file: {
|
|
51
|
-
mimeType: attachment.mime_type,
|
|
52
|
-
name: attachment.title || '',
|
|
53
|
-
size: attachment.file_size,
|
|
54
|
-
},
|
|
55
|
-
id,
|
|
56
|
-
state: 'finished',
|
|
57
|
-
url: attachment.asset_url,
|
|
58
|
-
});
|
|
59
|
-
} else if (attachment.type === 'image') {
|
|
120
|
+
if (attachment.type === 'image') {
|
|
60
121
|
const id = generateRandomId();
|
|
61
122
|
newImageUploads.push({
|
|
62
123
|
file: {
|
|
@@ -68,19 +129,11 @@ export const useMessageDetailsForState = <
|
|
|
68
129
|
state: 'finished',
|
|
69
130
|
url: attachment.image_url || attachment.asset_url || attachment.thumb_url,
|
|
70
131
|
});
|
|
71
|
-
} else
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
name: attachment.title || '',
|
|
77
|
-
size: attachment.file_size,
|
|
78
|
-
},
|
|
79
|
-
id,
|
|
80
|
-
state: 'finished',
|
|
81
|
-
thumb_url: attachment.thumb_url,
|
|
82
|
-
url: attachment.asset_url,
|
|
83
|
-
});
|
|
132
|
+
} else {
|
|
133
|
+
const fileUpload = mapAttachmentToFileUpload(attachment);
|
|
134
|
+
if (fileUpload) {
|
|
135
|
+
newFileUploads.push(fileUpload);
|
|
136
|
+
}
|
|
84
137
|
}
|
|
85
138
|
}
|
|
86
139
|
if (newFileUploads.length) {
|
|
@@ -96,6 +96,16 @@ export type Theme = {
|
|
|
96
96
|
container: ViewStyle;
|
|
97
97
|
icon: ViewStyle;
|
|
98
98
|
};
|
|
99
|
+
audioAttachment: {
|
|
100
|
+
container: ViewStyle;
|
|
101
|
+
leftContainer: ViewStyle;
|
|
102
|
+
playPauseButton: ViewStyle;
|
|
103
|
+
progressControlContainer: ViewStyle;
|
|
104
|
+
progressDurationText: TextStyle;
|
|
105
|
+
rightContainer: ViewStyle;
|
|
106
|
+
speedChangeButton: ViewStyle;
|
|
107
|
+
speedChangeButtonText: TextStyle;
|
|
108
|
+
};
|
|
99
109
|
avatar: {
|
|
100
110
|
BASE_AVATAR_SIZE: number;
|
|
101
111
|
container: ViewStyle;
|
|
@@ -230,6 +240,44 @@ export type Theme = {
|
|
|
230
240
|
attachButton: ViewStyle;
|
|
231
241
|
attachButtonContainer: ViewStyle;
|
|
232
242
|
attachmentSelectionBar: ViewStyle;
|
|
243
|
+
attachmentSeparator: ViewStyle;
|
|
244
|
+
audioRecorder: {
|
|
245
|
+
arrowLeftIcon: IconProps;
|
|
246
|
+
checkContainer: ViewStyle;
|
|
247
|
+
circleStopIcon: IconProps;
|
|
248
|
+
deleteContainer: ViewStyle;
|
|
249
|
+
deleteIcon: IconProps;
|
|
250
|
+
micContainer: ViewStyle;
|
|
251
|
+
micIcon: IconProps;
|
|
252
|
+
pausedContainer: ViewStyle;
|
|
253
|
+
sendCheckIcon: IconProps;
|
|
254
|
+
slideToCancelContainer: ViewStyle;
|
|
255
|
+
};
|
|
256
|
+
audioRecordingButton: {
|
|
257
|
+
container: ViewStyle;
|
|
258
|
+
micIcon: IconProps;
|
|
259
|
+
};
|
|
260
|
+
audioRecordingInProgress: {
|
|
261
|
+
container: ViewStyle;
|
|
262
|
+
durationText: TextStyle;
|
|
263
|
+
};
|
|
264
|
+
audioRecordingLockIndicator: {
|
|
265
|
+
arrowUpIcon: IconProps;
|
|
266
|
+
container: ViewStyle;
|
|
267
|
+
lockIcon: IconProps;
|
|
268
|
+
};
|
|
269
|
+
audioRecordingPreview: {
|
|
270
|
+
container: ViewStyle;
|
|
271
|
+
currentTime: TextStyle;
|
|
272
|
+
infoContainer: ViewStyle;
|
|
273
|
+
pauseIcon: IconProps;
|
|
274
|
+
playIcon: IconProps;
|
|
275
|
+
progressBar: ViewStyle;
|
|
276
|
+
};
|
|
277
|
+
audioRecordingWaveform: {
|
|
278
|
+
container: ViewStyle;
|
|
279
|
+
waveform: ViewStyle;
|
|
280
|
+
};
|
|
233
281
|
autoCompleteInputContainer: ViewStyle;
|
|
234
282
|
commandsButton: ViewStyle;
|
|
235
283
|
commandsButtonContainer: ViewStyle;
|
|
@@ -247,15 +295,8 @@ export type Theme = {
|
|
|
247
295
|
editingBoxHeaderTitle: TextStyle;
|
|
248
296
|
};
|
|
249
297
|
fileUploadPreview: {
|
|
250
|
-
audioAttachment: {
|
|
251
|
-
progressControlView: ViewStyle;
|
|
252
|
-
progressDurationText: TextStyle;
|
|
253
|
-
roundedView: ViewStyle;
|
|
254
|
-
};
|
|
255
|
-
audioAttachmentFileContainer: ViewStyle;
|
|
256
298
|
dismiss: ViewStyle;
|
|
257
299
|
fileContainer: ViewStyle;
|
|
258
|
-
fileContentContainer: ViewStyle;
|
|
259
300
|
filenameText: TextStyle;
|
|
260
301
|
fileSizeText: TextStyle;
|
|
261
302
|
fileTextContainer: ViewStyle;
|
|
@@ -275,6 +316,7 @@ export type Theme = {
|
|
|
275
316
|
};
|
|
276
317
|
inputBox: TextStyle;
|
|
277
318
|
inputBoxContainer: ViewStyle;
|
|
319
|
+
micButtonContainer: ViewStyle;
|
|
278
320
|
moreOptionsButton: ViewStyle;
|
|
279
321
|
optionsContainer: ViewStyle;
|
|
280
322
|
replyContainer: ViewStyle;
|
|
@@ -437,6 +479,7 @@ export type Theme = {
|
|
|
437
479
|
title: TextStyle;
|
|
438
480
|
};
|
|
439
481
|
fileAttachmentGroup: {
|
|
482
|
+
attachmentContainer: ViewStyle;
|
|
440
483
|
container: ViewStyle;
|
|
441
484
|
};
|
|
442
485
|
gallery: {
|
|
@@ -545,12 +588,19 @@ export type Theme = {
|
|
|
545
588
|
reactionSize: number;
|
|
546
589
|
};
|
|
547
590
|
};
|
|
591
|
+
progressControl: {
|
|
592
|
+
container: ViewStyle;
|
|
593
|
+
filledColor: ColorValue;
|
|
594
|
+
filledStyles: ViewStyle;
|
|
595
|
+
thumb: ViewStyle;
|
|
596
|
+
};
|
|
548
597
|
reply: {
|
|
549
598
|
container: ViewStyle;
|
|
550
599
|
fileAttachmentContainer: ViewStyle;
|
|
551
600
|
imageAttachment: ImageStyle;
|
|
552
601
|
markdownStyles: MarkdownStyle;
|
|
553
602
|
messageContainer: ViewStyle;
|
|
603
|
+
secondaryText: ViewStyle;
|
|
554
604
|
textContainer: ViewStyle;
|
|
555
605
|
videoThumbnail: {
|
|
556
606
|
container: ViewStyle;
|
|
@@ -573,6 +623,11 @@ export type Theme = {
|
|
|
573
623
|
fontSize: TextStyle['fontSize'];
|
|
574
624
|
};
|
|
575
625
|
};
|
|
626
|
+
waveProgressBar: {
|
|
627
|
+
container: ViewStyle;
|
|
628
|
+
thumb: ViewStyle;
|
|
629
|
+
waveform: ViewStyle;
|
|
630
|
+
};
|
|
576
631
|
};
|
|
577
632
|
|
|
578
633
|
export const defaultTheme: Theme = {
|
|
@@ -592,6 +647,16 @@ export const defaultTheme: Theme = {
|
|
|
592
647
|
container: {},
|
|
593
648
|
icon: {},
|
|
594
649
|
},
|
|
650
|
+
audioAttachment: {
|
|
651
|
+
container: {},
|
|
652
|
+
leftContainer: {},
|
|
653
|
+
playPauseButton: {},
|
|
654
|
+
progressControlContainer: {},
|
|
655
|
+
progressDurationText: {},
|
|
656
|
+
rightContainer: {},
|
|
657
|
+
speedChangeButton: {},
|
|
658
|
+
speedChangeButtonText: {},
|
|
659
|
+
},
|
|
595
660
|
avatar: {
|
|
596
661
|
BASE_AVATAR_SIZE: 32,
|
|
597
662
|
container: {},
|
|
@@ -745,6 +810,31 @@ export const defaultTheme: Theme = {
|
|
|
745
810
|
attachButton: {},
|
|
746
811
|
attachButtonContainer: {},
|
|
747
812
|
attachmentSelectionBar: {},
|
|
813
|
+
attachmentSeparator: {},
|
|
814
|
+
audioRecorder: {
|
|
815
|
+
arrowLeftIcon: {},
|
|
816
|
+
checkContainer: {},
|
|
817
|
+
circleStopIcon: {},
|
|
818
|
+
deleteContainer: {},
|
|
819
|
+
deleteIcon: {},
|
|
820
|
+
micContainer: {},
|
|
821
|
+
micIcon: {},
|
|
822
|
+
pausedContainer: {},
|
|
823
|
+
sendCheckIcon: {},
|
|
824
|
+
slideToCancelContainer: {},
|
|
825
|
+
},
|
|
826
|
+
audioRecordingButton: { container: {}, micIcon: {} },
|
|
827
|
+
audioRecordingInProgress: { container: {}, durationText: {} },
|
|
828
|
+
audioRecordingLockIndicator: { arrowUpIcon: {}, container: {}, lockIcon: {} },
|
|
829
|
+
audioRecordingPreview: {
|
|
830
|
+
container: {},
|
|
831
|
+
currentTime: {},
|
|
832
|
+
infoContainer: {},
|
|
833
|
+
pauseIcon: {},
|
|
834
|
+
playIcon: {},
|
|
835
|
+
progressBar: {},
|
|
836
|
+
},
|
|
837
|
+
audioRecordingWaveform: { container: {}, waveform: {} },
|
|
748
838
|
autoCompleteInputContainer: {},
|
|
749
839
|
commandsButton: {},
|
|
750
840
|
commandsButtonContainer: {},
|
|
@@ -762,15 +852,8 @@ export const defaultTheme: Theme = {
|
|
|
762
852
|
editingBoxHeaderTitle: {},
|
|
763
853
|
},
|
|
764
854
|
fileUploadPreview: {
|
|
765
|
-
audioAttachment: {
|
|
766
|
-
progressControlView: {},
|
|
767
|
-
progressDurationText: {},
|
|
768
|
-
roundedView: {},
|
|
769
|
-
},
|
|
770
|
-
audioAttachmentFileContainer: {},
|
|
771
855
|
dismiss: {},
|
|
772
856
|
fileContainer: {},
|
|
773
|
-
fileContentContainer: {},
|
|
774
857
|
filenameText: {},
|
|
775
858
|
fileSizeText: {},
|
|
776
859
|
fileTextContainer: {},
|
|
@@ -790,6 +873,7 @@ export const defaultTheme: Theme = {
|
|
|
790
873
|
},
|
|
791
874
|
inputBox: {},
|
|
792
875
|
inputBoxContainer: {},
|
|
876
|
+
micButtonContainer: {},
|
|
793
877
|
moreOptionsButton: {},
|
|
794
878
|
optionsContainer: {},
|
|
795
879
|
replyContainer: {},
|
|
@@ -979,6 +1063,7 @@ export const defaultTheme: Theme = {
|
|
|
979
1063
|
title: {},
|
|
980
1064
|
},
|
|
981
1065
|
fileAttachmentGroup: {
|
|
1066
|
+
attachmentContainer: {},
|
|
982
1067
|
container: {},
|
|
983
1068
|
},
|
|
984
1069
|
gallery: {
|
|
@@ -1095,12 +1180,19 @@ export const defaultTheme: Theme = {
|
|
|
1095
1180
|
reactionSize: 24,
|
|
1096
1181
|
},
|
|
1097
1182
|
},
|
|
1183
|
+
progressControl: {
|
|
1184
|
+
container: {},
|
|
1185
|
+
filledColor: '',
|
|
1186
|
+
filledStyles: {},
|
|
1187
|
+
thumb: {},
|
|
1188
|
+
},
|
|
1098
1189
|
reply: {
|
|
1099
1190
|
container: {},
|
|
1100
1191
|
fileAttachmentContainer: {},
|
|
1101
1192
|
imageAttachment: {},
|
|
1102
1193
|
markdownStyles: {},
|
|
1103
1194
|
messageContainer: {},
|
|
1195
|
+
secondaryText: {},
|
|
1104
1196
|
textContainer: {},
|
|
1105
1197
|
videoThumbnail: {
|
|
1106
1198
|
container: {},
|
|
@@ -1120,4 +1212,9 @@ export const defaultTheme: Theme = {
|
|
|
1120
1212
|
fontSize: 14,
|
|
1121
1213
|
},
|
|
1122
1214
|
},
|
|
1215
|
+
waveProgressBar: {
|
|
1216
|
+
container: {},
|
|
1217
|
+
thumb: {},
|
|
1218
|
+
waveform: {},
|
|
1219
|
+
},
|
|
1123
1220
|
};
|
package/src/i18n/en.json
CHANGED
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"File type not supported": "File type not supported",
|
|
27
27
|
"Flag": "Flag",
|
|
28
28
|
"Flag Message": "Flag Message",
|
|
29
|
-
"Flag action failed either due to a network issue or the message is already flagged": "Flag action failed either due to a network issue or the message is already flagged
|
|
29
|
+
"Flag action failed either due to a network issue or the message is already flagged": "Flag action failed either due to a network issue or the message is already flagged",
|
|
30
|
+
"Hold to start recording.": "Hold to start recording.",
|
|
30
31
|
"How about sending your first message to a friend?": "How about sending your first message to a friend?",
|
|
31
32
|
"Instant Commands": "Instant Commands",
|
|
32
33
|
"Let's start chatting!": "Let's start chatting!",
|
|
@@ -48,6 +49,7 @@
|
|
|
48
49
|
"Photos and Videos": "Photos and Videos",
|
|
49
50
|
"Pin to Conversation": "Pin to Conversation",
|
|
50
51
|
"Pinned by": "Pinned by",
|
|
52
|
+
"Please allow Audio permissions in settings.": "Please allow Audio permissions in settings.",
|
|
51
53
|
"Please enable access to your photos and videos so you can share them.": "Please enable access to your photos and videos so you can share them.",
|
|
52
54
|
"Please select a channel first": "Please select a channel first",
|
|
53
55
|
"Reconnecting...": "Reconnecting...",
|