stream-chat-react-native-core 5.28.1-beta.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 +2 -0
- package/lib/commonjs/i18n/es.json +11 -9
- package/lib/commonjs/i18n/fr.json +11 -9
- package/lib/commonjs/i18n/he.json +11 -9
- package/lib/commonjs/i18n/hi.json +11 -9
- package/lib/commonjs/i18n/it.json +11 -9
- package/lib/commonjs/i18n/ja.json +11 -9
- package/lib/commonjs/i18n/ko.json +11 -9
- package/lib/commonjs/i18n/nl.json +11 -9
- package/lib/commonjs/i18n/pt-BR.json +11 -9
- package/lib/commonjs/i18n/ru.json +11 -9
- package/lib/commonjs/i18n/tr.json +11 -9
- 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 +11 -9
- package/lib/module/i18n/fr.json +11 -9
- package/lib/module/i18n/he.json +11 -9
- package/lib/module/i18n/hi.json +11 -9
- package/lib/module/i18n/it.json +11 -9
- package/lib/module/i18n/ja.json +11 -9
- package/lib/module/i18n/ko.json +11 -9
- package/lib/module/i18n/nl.json +11 -9
- package/lib/module/i18n/pt-BR.json +11 -9
- package/lib/module/i18n/ru.json +11 -9
- package/lib/module/i18n/tr.json +11 -9
- 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 +11 -9
- package/lib/typescript/i18n/fr.json +11 -9
- package/lib/typescript/i18n/he.json +11 -9
- package/lib/typescript/i18n/hi.json +11 -9
- package/lib/typescript/i18n/it.json +11 -9
- package/lib/typescript/i18n/ja.json +11 -9
- package/lib/typescript/i18n/ko.json +11 -9
- package/lib/typescript/i18n/nl.json +11 -9
- package/lib/typescript/i18n/pt-BR.json +11 -9
- package/lib/typescript/i18n/ru.json +11 -9
- package/lib/typescript/i18n/tr.json +11 -9
- 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 +11 -9
- package/src/i18n/fr.json +11 -9
- package/src/i18n/he.json +11 -9
- package/src/i18n/hi.json +11 -9
- package/src/i18n/it.json +11 -9
- package/src/i18n/ja.json +11 -9
- package/src/i18n/ko.json +11 -9
- package/src/i18n/nl.json +11 -9
- package/src/i18n/pt-BR.json +11 -9
- package/src/i18n/ru.json +11 -9
- package/src/i18n/tr.json +11 -9
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","fail","Error","compressImage","exports","deleteFile","getLocalAssetUri","oniOS14GalleryLibrarySelectionChange","iOS14RefreshGallerySelection","getPhotos","FlatList","DefaultFlatList","NetInfo","addEventListener","fetch","pickDocument","saveFile","setClipboardString","shareImage","takePhoto","triggerHaptic","SDK","Sound","Video","registerNativeHandlers","handlers","undefined","isVideoPackageAvailable","isAudioPackageAvailable","Player","initializeSound"],"sourceRoot":"../../src","sources":["native.ts"],"mappings":";;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAMA,IAAMC,IAAI,GAAG,SAAPA,IAAIA,CAAA,EAAS;EACjB,MAAMC,KAAK,CACT,mGACF,CAAC;AACH,CAAC;AAaM,IAAIC,aAA4B,GAAGF,IAAI;AAACG,OAAA,CAAAD,aAAA,GAAAA,aAAA;AAGxC,IAAIE,UAAsB,GAAGJ,IAAI;AAACG,OAAA,CAAAC,UAAA,GAAAA,UAAA;AAGlC,IAAIC,gBAAkC,GAAGL,IAAI;AAACG,OAAA,CAAAE,gBAAA,GAAAA,gBAAA;AAG9C,IAAIC,oCAAmE,GAAGN,IAAI;AAACG,OAAA,CAAAG,oCAAA,GAAAA,oCAAA;AAG/E,IAAIC,4BAA0D,GAAGP,IAAI;AAACG,OAAA,CAAAI,4BAAA,GAAAA,4BAAA;AAUtE,IAAIC,SAAoB,GAAGR,IAAI;AAACG,OAAA,CAAAK,SAAA,GAAAA,SAAA;AAOhC,IAAIC,QAAQ,GAAGC,qBAAe;AAACP,OAAA,CAAAM,QAAA,GAAAA,QAAA;AAE/B,IAAIE,OAAgB,GAAG;EAC5BC,gBAAgB,EAAEZ,IAAI;EACtBa,KAAK,EAAEb;AACT,CAAC;AAACG,OAAA,CAAAQ,OAAA,GAAAA,OAAA;AAQK,IAAIG,YAA0B,GAAGd,IAAI;AAACG,OAAA,CAAAW,YAAA,GAAAA,YAAA;AAOtC,IAAIC,QAAkB,GAAGf,IAAI;AAACG,OAAA,CAAAY,QAAA,GAAAA,QAAA;AAG9B,IAAIC,kBAAsC,GAAGhB,IAAI;AAACG,OAAA,CAAAa,kBAAA,GAAAA,kBAAA;AAOlD,IAAIC,UAAsB,GAAGjB,IAAI;AAACG,OAAA,CAAAc,UAAA,GAAAA,UAAA;AAalC,IAAIC,SAAoB,GAAGlB,IAAI;AAACG,OAAA,CAAAe,SAAA,GAAAA,SAAA;AAWhC,IAAIC,aAA4B,GAAGnB,IAAI;AAACG,OAAA,CAAAgB,aAAA,GAAAA,aAAA;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","fail","Error","compressImage","exports","deleteFile","getLocalAssetUri","oniOS14GalleryLibrarySelectionChange","iOS14RefreshGallerySelection","getPhotos","FlatList","DefaultFlatList","NetInfo","addEventListener","fetch","pickDocument","saveFile","setClipboardString","shareImage","takePhoto","triggerHaptic","SDK","Audio","Sound","Video","registerNativeHandlers","handlers","undefined","isVideoPackageAvailable","isAudioPackageAvailable","Player","initializeSound","isRecordingPackageAvailable"],"sourceRoot":"../../src","sources":["native.ts"],"mappings":";;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAMA,IAAMC,IAAI,GAAG,SAAPA,IAAIA,CAAA,EAAS;EACjB,MAAMC,KAAK,CACT,mGACF,CAAC;AACH,CAAC;AAaM,IAAIC,aAA4B,GAAGF,IAAI;AAACG,OAAA,CAAAD,aAAA,GAAAA,aAAA;AAGxC,IAAIE,UAAsB,GAAGJ,IAAI;AAACG,OAAA,CAAAC,UAAA,GAAAA,UAAA;AAGlC,IAAIC,gBAAkC,GAAGL,IAAI;AAACG,OAAA,CAAAE,gBAAA,GAAAA,gBAAA;AAG9C,IAAIC,oCAAmE,GAAGN,IAAI;AAACG,OAAA,CAAAG,oCAAA,GAAAA,oCAAA;AAG/E,IAAIC,4BAA0D,GAAGP,IAAI;AAACG,OAAA,CAAAI,4BAAA,GAAAA,4BAAA;AAUtE,IAAIC,SAAoB,GAAGR,IAAI;AAACG,OAAA,CAAAK,SAAA,GAAAA,SAAA;AAOhC,IAAIC,QAAQ,GAAGC,qBAAe;AAACP,OAAA,CAAAM,QAAA,GAAAA,QAAA;AAE/B,IAAIE,OAAgB,GAAG;EAC5BC,gBAAgB,EAAEZ,IAAI;EACtBa,KAAK,EAAEb;AACT,CAA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AAK;EACxB;EAEA,IAAIG,QAAQ,CAACP,SAAS,EAAE;IACtBf,OAAA,CAAAe,SAAA,GAAAA,SAAS,GAAGO,QAAQ,CAACP,SAAS;EAChC;EAEA,IAAIO,QAAQ,CAACN,aAAa,EAAE;IAC1BhB,OAAA,CAAAgB,aAAA,GAAAA,aAAa,GAAGM,QAAQ,CAACN,aAAa;EACxC;EAEA,IAAIM,QAAQ,CAACF,KAAK,EAAE;IAClBpB,OAAA,CAAAoB,KAAA,GAAAA,KAAK,GAAGE,QAAQ,CAACF,KAAK;EACxB;EAEA,IAAIE,QAAQ,CAACT,kBAAkB,KAAKU,SAAS,EAAE;IAC7CvB,OAAA,CAAAa,kBAAA,GAAAA,kBAAkB,GAAGS,QAAQ,CAACT,kBAAkB;EAClD;AACF,CAAC;AAACb,OAAA,CAAAqB,sBAAA,GAAAA,sBAAA;AAEK,IAAMG,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAA;EAAA,OAAS,CAAC,CAACJ,KAAK;AAAA;AAACpB,OAAA,CAAAwB,uBAAA,GAAAA,uBAAA;AAC9C,IAAMC,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAA;EAAA,OAAS,CAAC,CAACN,KAAK,CAACO,MAAM,IAAI,CAAC,CAACP,KAAK,CAACQ,eAAe;AAAA;AAAC3B,OAAA,CAAAyB,uBAAA,GAAAA,uBAAA;AAChF,IAAMG,2BAA2B,GAAG,SAA9BA,2BAA2BA,CAAA;EAAA,OAAS,CAAC,CAACV,KAAK;AAAA;AAAClB,OAAA,CAAA4B,2BAAA,GAAAA,2BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.getTrimmedAttachmentTitle = void 0;
|
|
5
|
+
var getTrimmedAttachmentTitle = function getTrimmedAttachmentTitle(title) {
|
|
6
|
+
if (!title) return '';
|
|
7
|
+
var lastIndexOfDot = title.lastIndexOf('.');
|
|
8
|
+
return title.length < 12 ? title : title.slice(0, 12) + '...' + title.slice(lastIndexOfDot);
|
|
9
|
+
};
|
|
10
|
+
exports.getTrimmedAttachmentTitle = getTrimmedAttachmentTitle;
|
|
11
|
+
//# sourceMappingURL=getTrimmedAttachmentTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getTrimmedAttachmentTitle","title","lastIndexOfDot","lastIndexOf","length","slice","exports"],"sourceRoot":"../../../src","sources":["utils/getTrimmedAttachmentTitle.ts"],"mappings":";;;;AAAO,IAAMA,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAIC,KAAc,EAAK;EAC3D,IAAI,CAACA,KAAK,EAAE,OAAO,EAAE;EACrB,IAAMC,cAAc,GAAGD,KAAK,CAACE,WAAW,CAAC,GAAG,CAAC;EAC7C,OAAOF,KAAK,CAACG,MAAM,GAAG,EAAE,GAAGH,KAAK,GAAGA,KAAK,CAACI,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,GAAGJ,KAAK,CAACI,KAAK,CAACH,cAAc,CAAC;AAC7F,CAAC;AAACI,OAAA,CAAAN,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
@@ -50,7 +50,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
|
|
|
50
50
|
attachment: attachment
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
if (attachment.type === 'file' || attachment.type === 'audio') {
|
|
53
|
+
if (attachment.type === 'file' || attachment.type === 'audio' || attachment.type === 'voiceRecording') {
|
|
54
54
|
return (0, _jsxRuntime.jsx)(FileAttachment, {
|
|
55
55
|
attachment: attachment
|
|
56
56
|
});
|
|
@@ -70,7 +70,7 @@ var areEqual = function areEqual(prevProps, nextProps) {
|
|
|
70
70
|
prevMyMessageTheme = prevProps.myMessageTheme;
|
|
71
71
|
var nextAttachment = nextProps.attachment,
|
|
72
72
|
nextMyMessageTheme = nextProps.myMessageTheme;
|
|
73
|
-
var attachmentEqual = ((_prevAttachment$actio = prevAttachment.actions) == null ? void 0 : _prevAttachment$actio.length) === ((_nextAttachment$actio = nextAttachment.actions) == null ? void 0 : _nextAttachment$actio.length) && prevAttachment.image_url === nextAttachment.image_url && prevAttachment.thumb_url === nextAttachment.thumb_url;
|
|
73
|
+
var attachmentEqual = ((_prevAttachment$actio = prevAttachment.actions) == null ? void 0 : _prevAttachment$actio.length) === ((_nextAttachment$actio = nextAttachment.actions) == null ? void 0 : _nextAttachment$actio.length) && prevAttachment.image_url === nextAttachment.image_url && prevAttachment.thumb_url === nextAttachment.thumb_url && prevAttachment.type === nextAttachment.type;
|
|
74
74
|
if (!attachmentEqual) return false;
|
|
75
75
|
if (isAttachmentEqual) {
|
|
76
76
|
return isAttachmentEqual(prevAttachment, nextAttachment);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_AttachmentActions","_Card","_FileAttachment","_Gallery","_Giphy","_MessagesContext","_native","_jsxRuntime","_this","_jsxFileName","AttachmentWithContext","props","_attachment$actions","attachment","AttachmentActions","Card","FileAttachment","Gallery","Giphy","giphyVersion","UrlPreview","hasAttachmentActions","actions","length","type","jsx","og_scrape_url","title_link","Object","assign","jsxs","Fragment","children","images","concat","id","isVideoPackageAvailable","videos","areEqual","prevProps","nextProps","_prevAttachment$actio","_nextAttachment$actio","prevAttachment","isAttachmentEqual","prevMyMessageTheme","myMessageTheme","nextAttachment","nextMyMessageTheme","attachmentEqual","image_url","thumb_url","messageThemeEqual","JSON","stringify","MemoizedAttachment","React","memo","Attachment","PropAttachmentActions","PropCard","PropFileAttachment","PropGallery","PropGiphy","PropGiphyVersion","PropMyMessageTheme","PropUrlPreview","_useMessagesContext","useMessagesContext","ContextAttachmentActions","ContextCard","ContextFileAttachment","ContextGallery","ContextGiphy","ContextGiphyVersion","ContextMyMessageTheme","ContextUrlPreview","AttachmentActionsDefault","CardDefault","FileAttachmentDefault","GalleryDefault","GiphyD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AU,EAAAQ,MAAA,CAAAC,MAAA,KAAKhB,UAAU,CAAG,CAAC;EACvC;EAEA,IAAIA,UAAU,CAACW,IAAI,KAAK,OAAO,EAAE;IAC/B,OACE,IAAAjB,WAAA,CAAAuB,IAAA,EAAAvB,WAAA,CAAAwB,QAAA;MAAAC,QAAA,GACE,IAAAzB,WAAA,CAAAkB,GAAA,EAACR,OAAO;QAACgB,MAAM,EAAE,CAACpB,UAAU;MAAE,CAAE,CAAC,EAChCQ,oBAAoB,IACnB,IAAAd,WAAA,CAAAkB,GAAA,EAACX,iBAAiB,EAAAc,MAAA,CAAAC,MAAA,KAA0ChB,UAAU,kBAAAqB,MAAA,CAA/BrB,UAAU,CAACsB,EAAE,CAAqB,CAC1E;IAAA,CACD,CAAC;EAEP;EAEA,IAAItB,UAAU,CAACW,IAAI,KAAK,OAAO,IAAI,CAACX,UAAU,CAACa,aAAa,EAAE;IAC5D,OAAO,IAAAU,+BAAuB,EAAC,CAAC,GAC9B,IAAA7B,WAAA,CAAAuB,IAAA,EAAAvB,WAAA,CAAAwB,QAAA;MAAAC,QAAA,GACE,IAAAzB,WAAA,CAAAkB,GAAA,EAACR,OAAO;QAACoB,MAAM,EAAE,CAACxB,UAAU;MAAE,CAAE,CAAC,EAChCQ,oBAAoB,IACnB,IAAAd,WAAA,CAAAkB,GAAA,EAACX,iBAAiB,EAAAc,MAAA,CAAAC,MAAA,KAA0ChB,UAAU,kBAAAqB,MAAA,CAA/BrB,UAAU,CAACsB,EAAE,CAAqB,CAC1E;IAAA,CACD,CAAC,GAEH,IAAA5B,WAAA,CAAAkB,GAAA,EAACT,cAAc;MAACH,UAAU,EAAEA;IAAW,CAAE,CAC1C;EACH;EAEA,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_AttachmentActions","_Card","_FileAttachment","_Gallery","_Giphy","_MessagesContext","_native","_jsxRuntime","_this","_jsxFileName","AttachmentWithContext","props","_attachment$actions","attachment","AttachmentActions","Card","FileAttachment","Gallery","Giphy","giphyVersion","UrlPreview","hasAttachmentActions","actions","length","type","jsx","og_scrape_url","title_link","Object","assign","jsxs","Fragment","children","images","concat","id","isVideoPackageAvailable","videos","areEqual","prevProps","nextProps","_prevAttachment$actio","_nextAttachment$actio","prevAttachment","isAttachmentEqual","prevMyMessageTheme","myMessageTheme","nextAttachment","nextMyMessageTheme","attachmentEqual","image_url","thumb_url","messageThemeEqual","JSON","stringify","MemoizedAttachment","React","memo","Attachment","PropAttachmentActions","PropCard","PropFileAttachment","PropGallery","PropGiphy","PropGiphyVersion","PropMyMessageTheme","PropUrlPreview","_useMessagesContext","useMessagesContext","ContextAttachmentActions","ContextCard","ContextFileAttachment","ContextGallery","ContextGiphy","ContextGiphyVersion","ContextMyMessageTheme","ContextUrlPreview","AttachmentActionsDefault","CardDefault","FileAttachmentDefault","GalleryDefault","GiphyDefault","exports"],"sourceRoot":"../../../../src","sources":["components/Attachment/Attachment.tsx"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,gBAAA,GAAAN,OAAA;AAIA,IAAAO,OAAA,GAAAP,OAAA;AAAuD,IAAAQ,WAAA,GAAAR,OAAA;AAAA,IAAAS,KAAA;EAAAC,YAAA;AA0BvD,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAGzBC,KAAqD,EAClD;EAAA,IAAAC,mBAAA;EACH,IACEC,UAAU,GAQRF,KAAK,CARPE,UAAU;IACVC,iBAAiB,GAOfH,KAAK,CAPPG,iBAAiB;IACjBC,IAAI,GAMFJ,KAAK,CANPI,IAAI;IACJC,cAAc,GAKZL,KAAK,CALPK,cAAc;IACdC,OAAO,GAILN,KAAK,CAJPM,OAAO;IACPC,KAAK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C,UAAU,EAAVA,UAAU;IACVC,iBAAiB,EAAjBA,iBAAiB;IACjBC,IAAI,EAAJA,IAAI;IACJC,cAAc,EAAdA,cAAc;IACdC,OAAO,EAAPA,OAAO;IACPC,KAAK,EAALA,KAAK;IACLC,YAAY,EAAZA,YAAY;IACZyB,iBAAiB,EAAjBA,iBAAiB;IACjBE,cAAc,EAAdA,cAAc;IACd1B,UAAU,EAAVA;EAAU,CAEb,CAAC;AAEN,CAAC;AAAC8D,OAAA,CAAAxB,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.AudioAttachment = void 0;
|
|
7
7
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
8
8
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _reactNative = require("react-native");
|
|
11
12
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
@@ -13,95 +14,58 @@ var _duration = _interopRequireDefault(require("dayjs/plugin/duration"));
|
|
|
13
14
|
var _contexts = require("../../contexts");
|
|
14
15
|
var _icons = require("../../icons");
|
|
15
16
|
var _native = require("../../native");
|
|
17
|
+
var _getTrimmedAttachmentTitle = require("../../utils/getTrimmedAttachmentTitle");
|
|
16
18
|
var _ProgressControl = require("../ProgressControl/ProgressControl");
|
|
19
|
+
var _WaveProgressBar = require("../ProgressControl/WaveProgressBar");
|
|
17
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
21
|
var _this = this,
|
|
19
22
|
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/Attachment/AudioAttachment.tsx";
|
|
20
23
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
21
24
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
22
25
|
_dayjs["default"].extend(_duration["default"]);
|
|
23
|
-
var
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
fileContentContainer: {
|
|
34
|
-
flexDirection: 'row',
|
|
35
|
-
paddingRight: 40
|
|
36
|
-
},
|
|
37
|
-
filenameText: {
|
|
38
|
-
fontSize: 14,
|
|
39
|
-
fontWeight: 'bold',
|
|
40
|
-
paddingLeft: 10
|
|
41
|
-
},
|
|
42
|
-
fileTextContainer: {
|
|
43
|
-
justifyContent: 'space-around'
|
|
44
|
-
},
|
|
45
|
-
flatList: {
|
|
46
|
-
marginBottom: 12,
|
|
47
|
-
maxHeight: FILE_PREVIEW_HEIGHT * 2.5 + 16
|
|
48
|
-
},
|
|
49
|
-
overlay: {
|
|
50
|
-
borderRadius: 12,
|
|
51
|
-
marginLeft: 8,
|
|
52
|
-
marginRight: 8
|
|
53
|
-
},
|
|
54
|
-
progressControlView: {
|
|
55
|
-
flex: 8
|
|
56
|
-
},
|
|
57
|
-
progressDurationText: {
|
|
58
|
-
flex: 4,
|
|
59
|
-
fontSize: 12,
|
|
60
|
-
paddingLeft: 10,
|
|
61
|
-
paddingRight: 8
|
|
62
|
-
},
|
|
63
|
-
roundedView: {
|
|
64
|
-
alignItems: 'center',
|
|
65
|
-
alignSelf: 'center',
|
|
66
|
-
borderRadius: 50,
|
|
67
|
-
display: 'flex',
|
|
68
|
-
elevation: 4,
|
|
69
|
-
height: 36,
|
|
70
|
-
justifyContent: 'center',
|
|
71
|
-
shadowOffset: {
|
|
72
|
-
height: 2,
|
|
73
|
-
width: 0
|
|
74
|
-
},
|
|
75
|
-
shadowOpacity: 0.23,
|
|
76
|
-
shadowRadius: 2.62,
|
|
77
|
-
width: 36
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
var AudioAttachmentWithContext = function AudioAttachmentWithContext(props) {
|
|
26
|
+
var AudioAttachment = function AudioAttachment(props) {
|
|
27
|
+
var _item$duration;
|
|
28
|
+
var _useState = (0, _react.useState)(0),
|
|
29
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
30
|
+
width = _useState2[0],
|
|
31
|
+
setWidth = _useState2[1];
|
|
32
|
+
var _useState3 = (0, _react.useState)(1.0),
|
|
33
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
34
|
+
currentSpeed = _useState4[0],
|
|
35
|
+
setCurrentSpeed = _useState4[1];
|
|
81
36
|
var soundRef = _react["default"].useRef(null);
|
|
82
|
-
var
|
|
37
|
+
var _props$hideProgressBa = props.hideProgressBar,
|
|
38
|
+
hideProgressBar = _props$hideProgressBa === void 0 ? false : _props$hideProgressBa,
|
|
39
|
+
item = props.item,
|
|
83
40
|
onLoad = props.onLoad,
|
|
84
41
|
onPlayPause = props.onPlayPause,
|
|
85
|
-
onProgress = props.onProgress
|
|
42
|
+
onProgress = props.onProgress,
|
|
43
|
+
_props$showSpeedSetti = props.showSpeedSettings,
|
|
44
|
+
showSpeedSettings = _props$showSpeedSetti === void 0 ? false : _props$showSpeedSetti,
|
|
45
|
+
testID = props.testID;
|
|
86
46
|
var handleLoad = function handleLoad(payload) {
|
|
87
|
-
onLoad(item.id, payload.duration);
|
|
47
|
+
onLoad(item.id, item.duration || payload.duration);
|
|
88
48
|
};
|
|
89
49
|
var handleProgress = function handleProgress(data) {
|
|
90
|
-
if (data.currentTime
|
|
50
|
+
if (data.currentTime <= data.seekableDuration) {
|
|
91
51
|
onProgress(item.id, data.currentTime);
|
|
92
52
|
}
|
|
93
53
|
};
|
|
54
|
+
var handleEnd = function handleEnd() {
|
|
55
|
+
onPlayPause(item.id, true);
|
|
56
|
+
onProgress(item.id, item.duration, true);
|
|
57
|
+
};
|
|
94
58
|
var handlePlayPause = function () {
|
|
95
59
|
var _ref = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(isPausedStatusAvailable) {
|
|
96
60
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
97
61
|
while (1) switch (_context.prev = _context.next) {
|
|
98
62
|
case 0:
|
|
99
63
|
if (!soundRef.current) {
|
|
100
|
-
_context.next =
|
|
64
|
+
_context.next = 20;
|
|
101
65
|
break;
|
|
102
66
|
}
|
|
103
67
|
if (!(isPausedStatusAvailable === undefined)) {
|
|
104
|
-
_context.next =
|
|
68
|
+
_context.next = 19;
|
|
105
69
|
break;
|
|
106
70
|
}
|
|
107
71
|
if (item.progress === 1) {
|
|
@@ -109,7 +73,7 @@ var AudioAttachmentWithContext = function AudioAttachmentWithContext(props) {
|
|
|
109
73
|
if (soundRef.current.setPositionAsync) soundRef.current.setPositionAsync(0);
|
|
110
74
|
}
|
|
111
75
|
if (!item.paused) {
|
|
112
|
-
_context.next =
|
|
76
|
+
_context.next = 13;
|
|
113
77
|
break;
|
|
114
78
|
}
|
|
115
79
|
if (!soundRef.current.playAsync) {
|
|
@@ -119,24 +83,31 @@ var AudioAttachmentWithContext = function AudioAttachmentWithContext(props) {
|
|
|
119
83
|
_context.next = 7;
|
|
120
84
|
return soundRef.current.playAsync();
|
|
121
85
|
case 7:
|
|
86
|
+
if (!soundRef.current.setProgressUpdateIntervalAsync) {
|
|
87
|
+
_context.next = 10;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
_context.next = 10;
|
|
91
|
+
return soundRef.current.setProgressUpdateIntervalAsync(60);
|
|
92
|
+
case 10:
|
|
122
93
|
onPlayPause(item.id, false);
|
|
123
|
-
_context.next =
|
|
94
|
+
_context.next = 17;
|
|
124
95
|
break;
|
|
125
|
-
case
|
|
96
|
+
case 13:
|
|
126
97
|
if (!soundRef.current.pauseAsync) {
|
|
127
|
-
_context.next =
|
|
98
|
+
_context.next = 16;
|
|
128
99
|
break;
|
|
129
100
|
}
|
|
130
|
-
_context.next =
|
|
101
|
+
_context.next = 16;
|
|
131
102
|
return soundRef.current.pauseAsync();
|
|
132
|
-
case
|
|
103
|
+
case 16:
|
|
133
104
|
onPlayPause(item.id, true);
|
|
134
|
-
case
|
|
135
|
-
_context.next =
|
|
105
|
+
case 17:
|
|
106
|
+
_context.next = 20;
|
|
136
107
|
break;
|
|
137
|
-
case
|
|
108
|
+
case 19:
|
|
138
109
|
onPlayPause(item.id, isPausedStatusAvailable);
|
|
139
|
-
case
|
|
110
|
+
case 20:
|
|
140
111
|
case "end":
|
|
141
112
|
return _context.stop();
|
|
142
113
|
}
|
|
@@ -170,10 +141,6 @@ var AudioAttachmentWithContext = function AudioAttachmentWithContext(props) {
|
|
|
170
141
|
return _ref2.apply(this, arguments);
|
|
171
142
|
};
|
|
172
143
|
}();
|
|
173
|
-
var handleEnd = function handleEnd() {
|
|
174
|
-
onPlayPause(item.id, true);
|
|
175
|
-
onProgress(item.id, item.duration, true);
|
|
176
|
-
};
|
|
177
144
|
var onPlaybackStatusUpdate = function onPlaybackStatusUpdate(playbackStatus) {
|
|
178
145
|
if (!playbackStatus.isLoaded) {
|
|
179
146
|
if (playbackStatus.error) {
|
|
@@ -182,7 +149,9 @@ var AudioAttachmentWithContext = function AudioAttachmentWithContext(props) {
|
|
|
182
149
|
} else {
|
|
183
150
|
var durationMillis = playbackStatus.durationMillis,
|
|
184
151
|
positionMillis = playbackStatus.positionMillis;
|
|
185
|
-
|
|
152
|
+
if (item.duration === 0) {
|
|
153
|
+
onLoad(item.id, durationMillis / 1000);
|
|
154
|
+
}
|
|
186
155
|
if (playbackStatus.isPlaying) {
|
|
187
156
|
onProgress(item.id, positionMillis / 1000);
|
|
188
157
|
} else {}
|
|
@@ -236,7 +205,7 @@ var AudioAttachmentWithContext = function AudioAttachmentWithContext(props) {
|
|
|
236
205
|
while (1) switch (_context4.prev = _context4.next) {
|
|
237
206
|
case 0:
|
|
238
207
|
if (!soundRef.current) {
|
|
239
|
-
_context4.next =
|
|
208
|
+
_context4.next = 13;
|
|
240
209
|
break;
|
|
241
210
|
}
|
|
242
211
|
if (!item.paused) {
|
|
@@ -250,7 +219,7 @@ var AudioAttachmentWithContext = function AudioAttachmentWithContext(props) {
|
|
|
250
219
|
_context4.next = 5;
|
|
251
220
|
return soundRef.current.pauseAsync();
|
|
252
221
|
case 5:
|
|
253
|
-
_context4.next =
|
|
222
|
+
_context4.next = 13;
|
|
254
223
|
break;
|
|
255
224
|
case 7:
|
|
256
225
|
if (!soundRef.current.playAsync) {
|
|
@@ -260,6 +229,13 @@ var AudioAttachmentWithContext = function AudioAttachmentWithContext(props) {
|
|
|
260
229
|
_context4.next = 10;
|
|
261
230
|
return soundRef.current.playAsync();
|
|
262
231
|
case 10:
|
|
232
|
+
if (!soundRef.current.setProgressUpdateIntervalAsync) {
|
|
233
|
+
_context4.next = 13;
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
_context4.next = 13;
|
|
237
|
+
return soundRef.current.setProgressUpdateIntervalAsync(60);
|
|
238
|
+
case 13:
|
|
263
239
|
case "end":
|
|
264
240
|
return _context4.stop();
|
|
265
241
|
}
|
|
@@ -273,47 +249,115 @@ var AudioAttachmentWithContext = function AudioAttachmentWithContext(props) {
|
|
|
273
249
|
initalPlayPause();
|
|
274
250
|
}
|
|
275
251
|
}, [item.paused]);
|
|
252
|
+
var onSpeedChangeHandler = function () {
|
|
253
|
+
var _ref5 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee5() {
|
|
254
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
255
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
256
|
+
case 0:
|
|
257
|
+
if (!(currentSpeed === 2.0)) {
|
|
258
|
+
_context5.next = 7;
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
setCurrentSpeed(1.0);
|
|
262
|
+
if (!(soundRef.current && soundRef.current.setRateAsync)) {
|
|
263
|
+
_context5.next = 5;
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
_context5.next = 5;
|
|
267
|
+
return soundRef.current.setRateAsync(1.0);
|
|
268
|
+
case 5:
|
|
269
|
+
_context5.next = 19;
|
|
270
|
+
break;
|
|
271
|
+
case 7:
|
|
272
|
+
if (!(currentSpeed === 1.0)) {
|
|
273
|
+
_context5.next = 14;
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
setCurrentSpeed(1.5);
|
|
277
|
+
if (!(soundRef.current && soundRef.current.setRateAsync)) {
|
|
278
|
+
_context5.next = 12;
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
281
|
+
_context5.next = 12;
|
|
282
|
+
return soundRef.current.setRateAsync(1.5);
|
|
283
|
+
case 12:
|
|
284
|
+
_context5.next = 19;
|
|
285
|
+
break;
|
|
286
|
+
case 14:
|
|
287
|
+
if (!(currentSpeed === 1.5)) {
|
|
288
|
+
_context5.next = 19;
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
setCurrentSpeed(2.0);
|
|
292
|
+
if (!(soundRef.current && soundRef.current.setRateAsync)) {
|
|
293
|
+
_context5.next = 19;
|
|
294
|
+
break;
|
|
295
|
+
}
|
|
296
|
+
_context5.next = 19;
|
|
297
|
+
return soundRef.current.setRateAsync(2.0);
|
|
298
|
+
case 19:
|
|
299
|
+
case "end":
|
|
300
|
+
return _context5.stop();
|
|
301
|
+
}
|
|
302
|
+
}, _callee5);
|
|
303
|
+
}));
|
|
304
|
+
return function onSpeedChangeHandler() {
|
|
305
|
+
return _ref5.apply(this, arguments);
|
|
306
|
+
};
|
|
307
|
+
}();
|
|
276
308
|
var _useTheme = (0, _contexts.useTheme)(),
|
|
277
309
|
_useTheme$theme = _useTheme.theme,
|
|
310
|
+
_useTheme$theme$audio = _useTheme$theme.audioAttachment,
|
|
311
|
+
container = _useTheme$theme$audio.container,
|
|
312
|
+
leftContainer = _useTheme$theme$audio.leftContainer,
|
|
313
|
+
playPauseButton = _useTheme$theme$audio.playPauseButton,
|
|
314
|
+
progressControlContainer = _useTheme$theme$audio.progressControlContainer,
|
|
315
|
+
progressDurationText = _useTheme$theme$audio.progressDurationText,
|
|
316
|
+
rightContainer = _useTheme$theme$audio.rightContainer,
|
|
317
|
+
speedChangeButton = _useTheme$theme$audio.speedChangeButton,
|
|
318
|
+
speedChangeButtonText = _useTheme$theme$audio.speedChangeButtonText,
|
|
278
319
|
_useTheme$theme$color = _useTheme$theme.colors,
|
|
279
320
|
accent_blue = _useTheme$theme$color.accent_blue,
|
|
280
321
|
black = _useTheme$theme$color.black,
|
|
281
322
|
grey_dark = _useTheme$theme$color.grey_dark,
|
|
323
|
+
grey_whisper = _useTheme$theme$color.grey_whisper,
|
|
282
324
|
static_black = _useTheme$theme$color.static_black,
|
|
283
325
|
static_white = _useTheme$theme$color.static_white,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
progressControlView = _useTheme$theme$messa2.progressControlView,
|
|
287
|
-
progressDurationText = _useTheme$theme$messa2.progressDurationText,
|
|
288
|
-
roundedView = _useTheme$theme$messa2.roundedView,
|
|
289
|
-
fileContentContainer = _useTheme$theme$messa.fileContentContainer,
|
|
290
|
-
filenameText = _useTheme$theme$messa.filenameText,
|
|
291
|
-
fileTextContainer = _useTheme$theme$messa.fileTextContainer;
|
|
326
|
+
white = _useTheme$theme$color.white,
|
|
327
|
+
filenameText = _useTheme$theme.messageInput.fileUploadPreview.filenameText;
|
|
292
328
|
var progressValueInSeconds = item.duration * item.progress;
|
|
293
|
-
var progressDuration = progressValueInSeconds ? progressValueInSeconds / 3600 >= 1 ? _dayjs["default"].duration(progressValueInSeconds, 'second').format('HH:mm:ss') : _dayjs["default"].duration(progressValueInSeconds, 'second').format('mm:ss') : '
|
|
294
|
-
var lastIndexOfDot = item.file.name.lastIndexOf('.');
|
|
329
|
+
var progressDuration = progressValueInSeconds ? progressValueInSeconds / 3600 >= 1 ? _dayjs["default"].duration(progressValueInSeconds, 'second').format('HH:mm:ss') : _dayjs["default"].duration(progressValueInSeconds, 'second').format('mm:ss') : _dayjs["default"].duration((_item$duration = item.duration) != null ? _item$duration : 0, 'second').format('mm:ss');
|
|
295
330
|
return (0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
296
|
-
|
|
297
|
-
|
|
331
|
+
accessibilityLabel: "audio-attachment-preview",
|
|
332
|
+
onLayout: function onLayout(_ref6) {
|
|
333
|
+
var nativeEvent = _ref6.nativeEvent;
|
|
334
|
+
setWidth(nativeEvent.layout.width);
|
|
335
|
+
},
|
|
336
|
+
style: [styles.container, {
|
|
337
|
+
backgroundColor: white,
|
|
338
|
+
borderColor: grey_whisper
|
|
339
|
+
}, container],
|
|
340
|
+
testID: testID,
|
|
341
|
+
children: [(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
298
342
|
accessibilityLabel: "Play Pause Button",
|
|
299
343
|
onPress: function onPress() {
|
|
300
344
|
return handlePlayPause();
|
|
301
345
|
},
|
|
302
|
-
style: [styles.
|
|
346
|
+
style: [styles.playPauseButton, {
|
|
303
347
|
backgroundColor: static_white,
|
|
304
348
|
shadowColor: black
|
|
305
|
-
}],
|
|
349
|
+
}, playPauseButton],
|
|
306
350
|
children: item.paused ? (0, _jsxRuntime.jsx)(_icons.Play, {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
width:
|
|
351
|
+
fill: static_black,
|
|
352
|
+
height: 32,
|
|
353
|
+
width: 32
|
|
310
354
|
}) : (0, _jsxRuntime.jsx)(_icons.Pause, {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
width:
|
|
355
|
+
fill: static_black,
|
|
356
|
+
height: 32,
|
|
357
|
+
width: 32
|
|
314
358
|
})
|
|
315
359
|
}), (0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
316
|
-
style: [styles.
|
|
360
|
+
style: [styles.leftContainer, leftContainer],
|
|
317
361
|
children: [(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
318
362
|
accessibilityLabel: "File Name",
|
|
319
363
|
numberOfLines: 1,
|
|
@@ -325,18 +369,15 @@ var AudioAttachmentWithContext = function AudioAttachmentWithContext(props) {
|
|
|
325
369
|
} : {
|
|
326
370
|
writingDirection: 'ltr'
|
|
327
371
|
}, filenameText],
|
|
328
|
-
children:
|
|
372
|
+
children: (0, _getTrimmedAttachmentTitle.getTrimmedAttachmentTitle)(item.file.name)
|
|
329
373
|
}), (0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
330
|
-
style:
|
|
331
|
-
alignItems: 'center',
|
|
332
|
-
display: 'flex',
|
|
333
|
-
flexDirection: 'row'
|
|
334
|
-
},
|
|
374
|
+
style: styles.audioInfo,
|
|
335
375
|
children: [_native.Sound.Player && (0, _jsxRuntime.jsx)(_native.Sound.Player, {
|
|
336
376
|
onEnd: handleEnd,
|
|
337
377
|
onLoad: handleLoad,
|
|
338
378
|
onProgress: handleProgress,
|
|
339
379
|
paused: item.paused,
|
|
380
|
+
rate: currentSpeed,
|
|
340
381
|
soundRef: soundRef,
|
|
341
382
|
testID: "sound-player",
|
|
342
383
|
uri: item.file.uri
|
|
@@ -345,25 +386,116 @@ var AudioAttachmentWithContext = function AudioAttachmentWithContext(props) {
|
|
|
345
386
|
color: grey_dark
|
|
346
387
|
}, progressDurationText],
|
|
347
388
|
children: progressDuration
|
|
348
|
-
}), (0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
349
|
-
style: [styles.
|
|
350
|
-
children: (0, _jsxRuntime.jsx)(
|
|
389
|
+
}), !hideProgressBar && (0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
390
|
+
style: [styles.progressControlContainer, progressControlContainer],
|
|
391
|
+
children: item.file.waveform_data ? (0, _jsxRuntime.jsx)(_WaveProgressBar.WaveProgressBar, {
|
|
392
|
+
amplitudesCount: 35,
|
|
393
|
+
onPlayPause: handlePlayPause,
|
|
394
|
+
onProgressDrag: function onProgressDrag(position) {
|
|
395
|
+
if (item.file.waveform_data) {
|
|
396
|
+
var progress = position / 30 * item.duration;
|
|
397
|
+
handleProgressDrag(progress);
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
progress: item.progress,
|
|
401
|
+
waveformData: item.file.waveform_data
|
|
402
|
+
}) : (0, _jsxRuntime.jsx)(_ProgressControl.ProgressControl, {
|
|
351
403
|
duration: item.duration,
|
|
352
404
|
filledColor: accent_blue,
|
|
353
405
|
onPlayPause: handlePlayPause,
|
|
354
406
|
onProgressDrag: handleProgressDrag,
|
|
355
407
|
progress: item.progress,
|
|
356
408
|
testID: "progress-control",
|
|
357
|
-
width:
|
|
409
|
+
width: width / 2
|
|
358
410
|
})
|
|
359
411
|
})]
|
|
360
412
|
})]
|
|
413
|
+
}), showSpeedSettings && (0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
414
|
+
style: [styles.rightContainer, rightContainer],
|
|
415
|
+
children: item.progress === 0 || item.progress === 1 ? (0, _jsxRuntime.jsx)(_icons.Audio, {
|
|
416
|
+
fill: '#ffffff'
|
|
417
|
+
}) : (0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
418
|
+
onPress: onSpeedChangeHandler,
|
|
419
|
+
style: [styles.speedChangeButton, {
|
|
420
|
+
backgroundColor: static_white,
|
|
421
|
+
shadowColor: black
|
|
422
|
+
}, speedChangeButton],
|
|
423
|
+
children: (0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
424
|
+
style: [styles.speedChangeButtonText, speedChangeButtonText],
|
|
425
|
+
children: "x".concat(currentSpeed)
|
|
426
|
+
})
|
|
427
|
+
})
|
|
361
428
|
})]
|
|
362
429
|
});
|
|
363
430
|
};
|
|
364
|
-
var AudioAttachment = function AudioAttachment(props) {
|
|
365
|
-
return (0, _jsxRuntime.jsx)(AudioAttachmentWithContext, Object.assign({}, props));
|
|
366
|
-
};
|
|
367
431
|
exports.AudioAttachment = AudioAttachment;
|
|
432
|
+
var styles = _reactNative.StyleSheet.create({
|
|
433
|
+
audioInfo: {
|
|
434
|
+
alignItems: 'center',
|
|
435
|
+
display: 'flex',
|
|
436
|
+
flexDirection: 'row'
|
|
437
|
+
},
|
|
438
|
+
container: {
|
|
439
|
+
alignItems: 'center',
|
|
440
|
+
borderRadius: 12,
|
|
441
|
+
borderWidth: 1,
|
|
442
|
+
flexDirection: 'row',
|
|
443
|
+
paddingHorizontal: 8,
|
|
444
|
+
paddingVertical: 12
|
|
445
|
+
},
|
|
446
|
+
filenameText: {
|
|
447
|
+
fontSize: 14,
|
|
448
|
+
fontWeight: 'bold',
|
|
449
|
+
paddingBottom: 12,
|
|
450
|
+
paddingLeft: 8
|
|
451
|
+
},
|
|
452
|
+
leftContainer: {
|
|
453
|
+
justifyContent: 'space-around'
|
|
454
|
+
},
|
|
455
|
+
playPauseButton: {
|
|
456
|
+
alignItems: 'center',
|
|
457
|
+
alignSelf: 'center',
|
|
458
|
+
borderRadius: 50,
|
|
459
|
+
display: 'flex',
|
|
460
|
+
elevation: 4,
|
|
461
|
+
justifyContent: 'center',
|
|
462
|
+
paddingVertical: 2,
|
|
463
|
+
shadowOffset: {
|
|
464
|
+
height: 2,
|
|
465
|
+
width: 0
|
|
466
|
+
},
|
|
467
|
+
shadowOpacity: 0.23,
|
|
468
|
+
shadowRadius: 2.62,
|
|
469
|
+
width: 36
|
|
470
|
+
},
|
|
471
|
+
progressControlContainer: {},
|
|
472
|
+
progressDurationText: {
|
|
473
|
+
fontSize: 12,
|
|
474
|
+
paddingLeft: 10,
|
|
475
|
+
paddingRight: 8
|
|
476
|
+
},
|
|
477
|
+
rightContainer: {
|
|
478
|
+
marginLeft: 10
|
|
479
|
+
},
|
|
480
|
+
speedChangeButton: {
|
|
481
|
+
alignItems: 'center',
|
|
482
|
+
alignSelf: 'center',
|
|
483
|
+
borderRadius: 50,
|
|
484
|
+
elevation: 4,
|
|
485
|
+
justifyContent: 'center',
|
|
486
|
+
paddingVertical: 5,
|
|
487
|
+
shadowOffset: {
|
|
488
|
+
height: 2,
|
|
489
|
+
width: 0
|
|
490
|
+
},
|
|
491
|
+
shadowOpacity: 0.23,
|
|
492
|
+
shadowRadius: 2.62,
|
|
493
|
+
width: 36
|
|
494
|
+
},
|
|
495
|
+
speedChangeButtonText: {
|
|
496
|
+
fontSize: 12,
|
|
497
|
+
fontWeight: '500'
|
|
498
|
+
}
|
|
499
|
+
});
|
|
368
500
|
AudioAttachment.displayName = 'AudioAttachment{messageInput{audioAttachment}}';
|
|
369
501
|
//# sourceMappingURL=AudioAttachment.js.map
|