stream-chat-react 12.13.1 → 13.0.0-rc.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/README.md +27 -30
- package/dist/components/AIStateIndicator/AIStateIndicator.d.ts +4 -5
- package/dist/components/AIStateIndicator/hooks/useAIState.d.ts +2 -3
- package/dist/components/Attachment/Attachment.d.ts +8 -9
- package/dist/components/Attachment/Attachment.js +6 -5
- package/dist/components/Attachment/AttachmentActions.d.ts +2 -3
- package/dist/components/Attachment/AttachmentContainer.d.ts +15 -15
- package/dist/components/Attachment/AttachmentContainer.js +2 -2
- package/dist/components/Attachment/Audio.d.ts +3 -4
- package/dist/components/Attachment/Card.d.ts +1 -1
- package/dist/components/Attachment/FileAttachment.d.ts +3 -4
- package/dist/components/Attachment/FileAttachment.js +1 -1
- package/dist/components/Attachment/UnsupportedAttachment.d.ts +3 -4
- package/dist/components/Attachment/UnsupportedAttachment.js +1 -1
- package/dist/components/Attachment/VoiceRecording.d.ts +4 -5
- package/dist/components/Attachment/components/FileSizeIndicator.d.ts +1 -1
- package/dist/components/Attachment/components/FileSizeIndicator.js +4 -2
- package/dist/components/Attachment/utils.d.ts +8 -22
- package/dist/components/Attachment/utils.js +3 -18
- package/dist/components/Avatar/Avatar.d.ts +3 -4
- package/dist/components/Avatar/ChannelAvatar.d.ts +3 -4
- package/dist/components/Avatar/ChannelAvatar.js +1 -1
- package/dist/components/Avatar/GroupAvatar.d.ts +2 -2
- package/dist/components/Channel/Channel.d.ts +18 -37
- package/dist/components/Channel/Channel.js +31 -92
- package/dist/components/Channel/channelState.d.ts +17 -18
- package/dist/components/Channel/hooks/useChannelContainerClasses.d.ts +2 -3
- package/dist/components/Channel/hooks/useCreateChannelStateContext.d.ts +2 -3
- package/dist/components/Channel/hooks/useCreateChannelStateContext.js +1 -15
- package/dist/components/Channel/hooks/useCreateTypingContext.d.ts +1 -2
- package/dist/components/Channel/hooks/useEditMessageHandler.d.ts +3 -4
- package/dist/components/Channel/hooks/useMentionsHandlers.d.ts +3 -4
- package/dist/components/Channel/utils.d.ts +8 -6
- package/dist/components/Channel/utils.js +1 -0
- package/dist/components/ChannelHeader/ChannelHeader.d.ts +2 -3
- package/dist/components/ChannelList/ChannelList.d.ts +31 -30
- package/dist/components/ChannelList/ChannelList.js +8 -10
- package/dist/components/ChannelList/ChannelListMessenger.d.ts +6 -6
- package/dist/components/ChannelList/hooks/useChannelDeletedListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useChannelHiddenListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useChannelListShape.d.ts +44 -44
- package/dist/components/ChannelList/hooks/useChannelListShape.js +0 -2
- package/dist/components/ChannelList/hooks/useChannelMembershipState.d.ts +3 -3
- package/dist/components/ChannelList/hooks/useChannelTruncatedListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useChannelUpdatedListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useChannelVisibleListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useConnectionRecoveredListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useMessageNewListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useNotificationAddedToChannelListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useNotificationMessageNewListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/usePaginatedChannels.d.ts +7 -8
- package/dist/components/ChannelList/hooks/usePaginatedChannels.js +3 -3
- package/dist/components/ChannelList/hooks/useSelectedChannelState.d.ts +7 -7
- package/dist/components/ChannelList/hooks/useUserPresenceChangedListener.d.ts +1 -2
- package/dist/components/ChannelList/utils.d.ts +20 -21
- package/dist/components/ChannelList/utils.js +2 -2
- package/dist/components/ChannelPreview/ChannelPreview.d.ts +15 -16
- package/dist/components/ChannelPreview/ChannelPreview.js +1 -1
- package/dist/components/ChannelPreview/ChannelPreviewActionButtons.d.ts +4 -4
- package/dist/components/ChannelPreview/ChannelPreviewMessenger.d.ts +1 -2
- package/dist/components/ChannelPreview/hooks/useChannelPreviewInfo.d.ts +3 -4
- package/dist/components/ChannelPreview/hooks/useIsChannelMuted.d.ts +1 -2
- package/dist/components/ChannelPreview/hooks/useMessageDeliveryStatus.d.ts +5 -7
- package/dist/components/ChannelPreview/icons.d.ts +1 -1
- package/dist/components/ChannelPreview/utils.d.ts +7 -7
- package/dist/components/ChannelSearch/ChannelSearch.d.ts +5 -6
- package/dist/components/ChannelSearch/ChannelSearch.js +2 -2
- package/dist/components/ChannelSearch/SearchBar.d.ts +1 -1
- package/dist/components/ChannelSearch/SearchBar.js +1 -1
- package/dist/components/ChannelSearch/SearchResults.d.ts +13 -14
- package/dist/components/ChannelSearch/SearchResults.js +1 -1
- package/dist/components/ChannelSearch/hooks/useChannelSearch.d.ts +17 -18
- package/dist/components/ChannelSearch/hooks/useChannelSearch.js +2 -6
- package/dist/components/ChannelSearch/utils.d.ts +2 -3
- package/dist/components/Chat/Chat.d.ts +9 -9
- package/dist/components/Chat/hooks/useChannelsQueryState.d.ts +1 -1
- package/dist/components/Chat/hooks/useChat.d.ts +10 -10
- package/dist/components/Chat/hooks/useChat.js +4 -3
- package/dist/components/Chat/hooks/useCreateChatClient.d.ts +4 -4
- package/dist/components/Chat/hooks/useCreateChatContext.d.ts +1 -2
- package/dist/components/Dialog/DialogAnchor.d.ts +4 -3
- package/dist/components/Dialog/DialogAnchor.js +2 -2
- package/dist/components/Dialog/DialogMenu.d.ts +2 -1
- package/dist/components/Dialog/DialogPortal.d.ts +2 -1
- package/dist/components/Dialog/FormDialog.d.ts +2 -1
- package/dist/components/Dialog/FormDialog.js +1 -1
- package/dist/components/Dialog/PromptDialog.d.ts +2 -1
- package/dist/components/DragAndDrop/DragAndDropContainer.d.ts +2 -1
- package/dist/components/EventComponent/EventComponent.d.ts +7 -6
- package/dist/components/Form/FieldError.d.ts +2 -1
- package/dist/components/Form/SwitchField.d.ts +2 -1
- package/dist/components/Form/SwitchField.js +1 -1
- package/dist/components/Gallery/Gallery.d.ts +5 -5
- package/dist/components/Gallery/Image.d.ts +6 -5
- package/dist/components/Gallery/ModalGallery.d.ts +3 -4
- package/dist/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +2 -1
- package/dist/components/InfiniteScrollPaginator/InfiniteScrollPaginator.d.ts +2 -1
- package/dist/components/LoadMore/LoadMoreButton.d.ts +2 -1
- package/dist/components/LoadMore/LoadMorePaginator.d.ts +3 -2
- package/dist/components/LoadMore/LoadMorePaginator.js +1 -1
- package/dist/components/MediaRecorder/AudioRecorder/AudioRecorder.js +3 -2
- package/dist/components/MediaRecorder/AudioRecorder/AudioRecordingInProgress.js +1 -1
- package/dist/components/MediaRecorder/RecordingPermissionDeniedNotification.d.ts +1 -1
- package/dist/components/MediaRecorder/classes/MediaRecorderController.d.ts +11 -23
- package/dist/components/MediaRecorder/hooks/useMediaRecorder.d.ts +8 -8
- package/dist/components/MediaRecorder/hooks/useMediaRecorder.js +6 -4
- package/dist/components/MediaRecorder/observable/BehaviorSubject.d.ts +2 -2
- package/dist/components/MediaRecorder/observable/Observable.d.ts +1 -1
- package/dist/components/MediaRecorder/observable/Subject.d.ts +3 -2
- package/dist/components/Message/FixedHeightMessage.d.ts +4 -5
- package/dist/components/Message/Message.d.ts +1 -2
- package/dist/components/Message/MessageBlocked.d.ts +2 -0
- package/dist/components/Message/MessageBlocked.js +16 -0
- package/dist/components/Message/MessageDeleted.d.ts +4 -5
- package/dist/components/Message/MessageEditedTimestamp.d.ts +2 -3
- package/dist/components/Message/MessageErrorText.d.ts +4 -5
- package/dist/components/Message/MessageErrorText.js +2 -2
- package/dist/components/Message/MessageOptions.d.ts +3 -3
- package/dist/components/Message/MessageRepliesCountButton.d.ts +2 -1
- package/dist/components/Message/MessageSimple.d.ts +1 -2
- package/dist/components/Message/MessageSimple.js +14 -12
- package/dist/components/Message/MessageStatus.d.ts +3 -4
- package/dist/components/Message/MessageText.d.ts +6 -6
- package/dist/components/Message/MessageTimestamp.d.ts +4 -5
- package/dist/components/Message/QuotedMessage.d.ts +2 -3
- package/dist/components/Message/QuotedMessage.js +1 -1
- package/dist/components/Message/StreamedMessageText.d.ts +3 -4
- package/dist/components/Message/hooks/useActionHandler.d.ts +2 -3
- package/dist/components/Message/hooks/useActionHandler.js +1 -1
- package/dist/components/Message/hooks/useDeleteHandler.d.ts +4 -5
- package/dist/components/Message/hooks/useFlagHandler.d.ts +5 -6
- package/dist/components/Message/hooks/useMarkUnreadHandler.d.ts +5 -6
- package/dist/components/Message/hooks/useMentionsHandler.d.ts +6 -8
- package/dist/components/Message/hooks/useMessageTextStreaming.d.ts +2 -3
- package/dist/components/Message/hooks/useMuteHandler.d.ts +5 -7
- package/dist/components/Message/hooks/useMuteHandler.js +1 -1
- package/dist/components/Message/hooks/useOpenThreadHandler.d.ts +2 -3
- package/dist/components/Message/hooks/usePinHandler.d.ts +4 -5
- package/dist/components/Message/hooks/usePinHandler.js +1 -1
- package/dist/components/Message/hooks/useReactionHandler.d.ts +3 -4
- package/dist/components/Message/hooks/useReactionHandler.js +2 -4
- package/dist/components/Message/hooks/useReactionsFetcher.d.ts +5 -7
- package/dist/components/Message/hooks/useRetryHandler.d.ts +2 -3
- package/dist/components/Message/hooks/useRetryHandler.js +1 -1
- package/dist/components/Message/hooks/useUserHandler.d.ts +5 -6
- package/dist/components/Message/hooks/useUserRole.d.ts +2 -3
- package/dist/components/Message/hooks/useUserRole.js +1 -1
- package/dist/components/Message/icons.d.ts +2 -2
- package/dist/components/Message/icons.js +1 -1
- package/dist/components/Message/renderText/componentRenderers/Anchor.d.ts +2 -1
- package/dist/components/Message/renderText/componentRenderers/Emoji.d.ts +1 -1
- package/dist/components/Message/renderText/componentRenderers/Mention.d.ts +5 -5
- package/dist/components/Message/renderText/componentRenderers/Mention.js +1 -1
- package/dist/components/Message/renderText/rehypePlugins/mentionsMarkdownPlugin.d.ts +1 -2
- package/dist/components/Message/renderText/renderText.d.ts +6 -6
- package/dist/components/Message/renderText/types.d.ts +1 -1
- package/dist/components/Message/types.d.ts +27 -28
- package/dist/components/Message/utils.d.ts +21 -21
- package/dist/components/Message/utils.js +8 -4
- package/dist/components/MessageActions/CustomMessageActionsList.d.ts +6 -7
- package/dist/components/MessageActions/MessageActions.d.ts +6 -5
- package/dist/components/MessageActions/MessageActions.js +1 -1
- package/dist/components/MessageActions/MessageActionsBox.d.ts +5 -5
- package/dist/components/MessageActions/MessageActionsBox.js +4 -3
- package/dist/components/MessageActions/hooks/useMessageActionsBoxPopper.d.ts +1 -1
- package/dist/components/MessageBounce/MessageBounceModal.d.ts +4 -3
- package/dist/components/MessageBounce/MessageBouncePrompt.d.ts +1 -2
- package/dist/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.d.ts +11 -11
- package/dist/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.js +17 -14
- package/dist/components/MessageInput/AttachmentPreviewList/FileAttachmentPreview.d.ts +4 -12
- package/dist/components/MessageInput/AttachmentPreviewList/FileAttachmentPreview.js +8 -5
- package/dist/components/MessageInput/AttachmentPreviewList/ImageAttachmentPreview.d.ts +4 -5
- package/dist/components/MessageInput/AttachmentPreviewList/ImageAttachmentPreview.js +2 -2
- package/dist/components/MessageInput/AttachmentPreviewList/UnsupportedAttachmentPreview.d.ts +7 -5
- package/dist/components/MessageInput/AttachmentPreviewList/UnsupportedAttachmentPreview.js +5 -2
- package/dist/components/MessageInput/AttachmentPreviewList/VoiceRecordingPreview.d.ts +4 -5
- package/dist/components/MessageInput/AttachmentPreviewList/VoiceRecordingPreview.js +5 -2
- package/dist/components/MessageInput/AttachmentPreviewList/index.d.ts +1 -1
- package/dist/components/MessageInput/AttachmentPreviewList/types.d.ts +3 -4
- package/dist/components/MessageInput/AttachmentSelector.d.ts +1 -2
- package/dist/components/MessageInput/AttachmentSelector.js +5 -3
- package/dist/components/MessageInput/EditMessageForm.d.ts +3 -2
- package/dist/components/MessageInput/EditMessageForm.js +30 -6
- package/dist/components/MessageInput/LinkPreviewList.d.ts +6 -4
- package/dist/components/MessageInput/LinkPreviewList.js +24 -10
- package/dist/components/MessageInput/MessageInput.d.ts +23 -45
- package/dist/components/MessageInput/MessageInput.js +25 -15
- package/dist/components/MessageInput/MessageInputFlat.d.ts +1 -2
- package/dist/components/MessageInput/MessageInputFlat.js +31 -76
- package/dist/components/MessageInput/QuotedMessagePreview.d.ts +4 -7
- package/dist/components/MessageInput/QuotedMessagePreview.js +22 -16
- package/dist/components/MessageInput/SendButton.d.ts +4 -5
- package/dist/components/MessageInput/SendButton.js +6 -2
- package/dist/components/MessageInput/WithDragAndDropUpload.d.ts +38 -0
- package/dist/components/MessageInput/WithDragAndDropUpload.js +96 -0
- package/dist/components/MessageInput/hooks/index.d.ts +5 -1
- package/dist/components/MessageInput/hooks/index.js +5 -1
- package/dist/components/MessageInput/hooks/useAttachmentManagerState.d.ts +10 -0
- package/dist/components/MessageInput/hooks/useAttachmentManagerState.js +19 -0
- package/dist/components/MessageInput/hooks/useCanCreatePoll.d.ts +1 -0
- package/dist/components/MessageInput/hooks/useCanCreatePoll.js +10 -0
- package/dist/components/MessageInput/hooks/useCooldownTimer.d.ts +2 -3
- package/dist/components/MessageInput/hooks/useCreateMessageInputContext.d.ts +1 -2
- package/dist/components/MessageInput/hooks/useCreateMessageInputContext.js +1 -55
- package/dist/components/MessageInput/hooks/useMessageComposer.d.ts +2 -0
- package/dist/components/MessageInput/hooks/useMessageComposer.js +80 -0
- package/dist/components/MessageInput/hooks/useMessageComposerHasSendableData.d.ts +1 -0
- package/dist/components/MessageInput/hooks/useMessageComposerHasSendableData.js +8 -0
- package/dist/components/MessageInput/hooks/useMessageInputControls.d.ts +12 -0
- package/dist/components/MessageInput/hooks/useMessageInputControls.js +23 -0
- package/dist/components/MessageInput/hooks/useMessageInputText.d.ts +1 -5
- package/dist/components/MessageInput/hooks/useMessageInputText.js +19 -53
- package/dist/components/MessageInput/hooks/usePasteHandler.d.ts +1 -3
- package/dist/components/MessageInput/hooks/usePasteHandler.js +6 -8
- package/dist/components/MessageInput/hooks/useSubmitHandler.d.ts +2 -6
- package/dist/components/MessageInput/hooks/useSubmitHandler.js +30 -98
- package/dist/components/MessageInput/hooks/utils.d.ts +0 -27
- package/dist/components/MessageInput/hooks/utils.js +0 -124
- package/dist/components/MessageInput/index.d.ts +1 -2
- package/dist/components/MessageInput/index.js +1 -2
- package/dist/components/MessageList/ConnectionStatus.d.ts +1 -2
- package/dist/components/MessageList/ConnectionStatus.js +1 -1
- package/dist/components/MessageList/CustomNotification.d.ts +2 -1
- package/dist/components/MessageList/GiphyPreviewMessage.d.ts +4 -5
- package/dist/components/MessageList/MessageList.d.ts +11 -12
- package/dist/components/MessageList/MessageList.js +4 -4
- package/dist/components/MessageList/MessageNotification.d.ts +2 -1
- package/dist/components/MessageList/VirtualizedMessageList.d.ts +22 -21
- package/dist/components/MessageList/VirtualizedMessageList.js +6 -6
- package/dist/components/MessageList/VirtualizedMessageListComponents.d.ts +10 -10
- package/dist/components/MessageList/VirtualizedMessageListComponents.js +7 -7
- package/dist/components/MessageList/hooks/MessageList/useEnrichedMessages.d.ts +8 -10
- package/dist/components/MessageList/hooks/MessageList/useEnrichedMessages.js +1 -1
- package/dist/components/MessageList/hooks/MessageList/useMessageListElements.d.ts +11 -12
- package/dist/components/MessageList/hooks/MessageList/useMessageListScrollManager.d.ts +4 -5
- package/dist/components/MessageList/hooks/MessageList/useScrollLocationLogic.d.ts +5 -6
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.d.ts +4 -5
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.js +3 -2
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useMessageSetKey.d.ts +4 -5
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useMessageSetKey.js +1 -1
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useNewMessageNotification.d.ts +2 -3
- package/dist/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.d.ts +2 -3
- package/dist/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.js +6 -2
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useScrollToBottomOnNewMessage.d.ts +4 -5
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useShouldForceScrollToBottom.d.ts +2 -3
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useUnreadMessagesNotificationVirtualized.d.ts +3 -4
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useUnreadMessagesNotificationVirtualized.js +5 -6
- package/dist/components/MessageList/hooks/useLastReadData.d.ts +5 -6
- package/dist/components/MessageList/hooks/useLastReadData.js +5 -1
- package/dist/components/MessageList/hooks/useMarkRead.d.ts +1 -2
- package/dist/components/MessageList/renderMessages.d.ts +14 -14
- package/dist/components/MessageList/renderMessages.js +8 -7
- package/dist/components/MessageList/utils.d.ts +34 -28
- package/dist/components/MessageList/utils.js +26 -21
- package/dist/components/Modal/Modal.d.ts +2 -1
- package/dist/components/Poll/Poll.d.ts +2 -3
- package/dist/components/Poll/Poll.js +1 -1
- package/dist/components/Poll/PollActions/AddCommentForm.d.ts +1 -2
- package/dist/components/Poll/PollActions/AddCommentForm.js +4 -2
- package/dist/components/Poll/PollActions/EndPollDialog.d.ts +1 -2
- package/dist/components/Poll/PollActions/EndPollDialog.js +1 -1
- package/dist/components/Poll/PollActions/PollAction.d.ts +2 -1
- package/dist/components/Poll/PollActions/PollActions.d.ts +7 -8
- package/dist/components/Poll/PollActions/PollActions.js +5 -5
- package/dist/components/Poll/PollActions/PollAnswerList.d.ts +1 -2
- package/dist/components/Poll/PollActions/PollOptionsFullList.d.ts +1 -2
- package/dist/components/Poll/PollActions/PollOptionsFullList.js +4 -2
- package/dist/components/Poll/PollActions/PollResults/PollOptionVotesList.d.ts +3 -4
- package/dist/components/Poll/PollActions/PollResults/PollOptionVotesList.js +1 -1
- package/dist/components/Poll/PollActions/PollResults/PollOptionWithLatestVotes.d.ts +3 -4
- package/dist/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.d.ts +4 -5
- package/dist/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.js +1 -1
- package/dist/components/Poll/PollActions/PollResults/PollResults.d.ts +1 -2
- package/dist/components/Poll/PollActions/PollResults/PollResults.js +1 -1
- package/dist/components/Poll/PollActions/SuggestPollOptionForm.d.ts +1 -2
- package/dist/components/Poll/PollActions/SuggestPollOptionForm.js +3 -1
- package/dist/components/Poll/PollContent.d.ts +1 -2
- package/dist/components/Poll/PollCreationDialog/MultipleAnswersField.d.ts +2 -0
- package/dist/components/Poll/PollCreationDialog/MultipleAnswersField.js +35 -0
- package/dist/components/Poll/PollCreationDialog/NameField.d.ts +2 -0
- package/dist/components/Poll/PollCreationDialog/NameField.js +26 -0
- package/dist/components/Poll/PollCreationDialog/OptionFieldSet.d.ts +1 -8
- package/dist/components/Poll/PollCreationDialog/OptionFieldSet.js +33 -65
- package/dist/components/Poll/PollCreationDialog/PollCreationDialog.js +31 -85
- package/dist/components/Poll/PollCreationDialog/PollCreationDialogControls.d.ts +1 -4
- package/dist/components/Poll/PollCreationDialog/PollCreationDialogControls.js +15 -41
- package/dist/components/Poll/PollCreationDialog/types.d.ts +0 -14
- package/dist/components/Poll/PollHeader.d.ts +1 -2
- package/dist/components/Poll/PollOptionList.d.ts +1 -2
- package/dist/components/Poll/PollOptionList.js +4 -2
- package/dist/components/Poll/PollOptionSelector.d.ts +3 -4
- package/dist/components/Poll/PollVote.d.ts +6 -7
- package/dist/components/Poll/PollVote.js +3 -3
- package/dist/components/Poll/QuotedPoll.d.ts +1 -2
- package/dist/components/Poll/constants.d.ts +0 -1
- package/dist/components/Poll/constants.js +0 -1
- package/dist/components/Poll/hooks/useManagePollVotesRealtime.d.ts +2 -3
- package/dist/components/Poll/hooks/usePollAnswerPagination.d.ts +2 -3
- package/dist/components/Poll/hooks/usePollAnswerPagination.js +2 -2
- package/dist/components/Poll/hooks/usePollOptionVotesPagination.d.ts +2 -3
- package/dist/components/Poll/hooks/usePollOptionVotesPagination.js +1 -1
- package/dist/components/Portal/Portal.d.ts +1 -1
- package/dist/components/ReactFileUtilities/FileIcon/FileIcon.d.ts +1 -1
- package/dist/components/ReactFileUtilities/FileIcon/FileIconSet.d.ts +2 -1
- package/dist/components/ReactFileUtilities/FileIcon/iconMap.d.ts +1 -1
- package/dist/components/ReactFileUtilities/UploadButton.d.ts +3 -2
- package/dist/components/ReactFileUtilities/UploadButton.js +16 -6
- package/dist/components/ReactFileUtilities/index.d.ts +0 -1
- package/dist/components/ReactFileUtilities/index.js +0 -1
- package/dist/components/ReactFileUtilities/utils.d.ts +2 -2
- package/dist/components/Reactions/ReactionSelector.d.ts +4 -5
- package/dist/components/Reactions/ReactionSelectorWithButton.d.ts +1 -2
- package/dist/components/Reactions/ReactionsList.d.ts +6 -7
- package/dist/components/Reactions/ReactionsList.js +2 -2
- package/dist/components/Reactions/ReactionsListModal.d.ts +9 -10
- package/dist/components/Reactions/SimpleReactionsList.d.ts +5 -6
- package/dist/components/Reactions/StreamEmoji.d.ts +1 -1
- package/dist/components/Reactions/hooks/useFetchReactions.d.ts +9 -10
- package/dist/components/Reactions/hooks/useProcessReactions.d.ts +1 -2
- package/dist/components/Reactions/types.d.ts +3 -4
- package/dist/components/Reactions/utils/utils.d.ts +1 -1
- package/dist/components/SafeAnchor/SafeAnchor.d.ts +2 -1
- package/dist/components/{CommandItem → TextareaComposer/SuggestionList}/CommandItem.d.ts +2 -1
- package/dist/components/{CommandItem → TextareaComposer/SuggestionList}/CommandItem.js +1 -2
- package/dist/components/{EmoticonItem → TextareaComposer/SuggestionList}/EmoticonItem.d.ts +7 -7
- package/dist/components/TextareaComposer/SuggestionList/EmoticonItem.js +12 -0
- package/dist/components/TextareaComposer/SuggestionList/SuggestionList.d.ts +16 -0
- package/dist/components/TextareaComposer/SuggestionList/SuggestionList.js +49 -0
- package/dist/components/TextareaComposer/SuggestionList/SuggestionListItem.d.ts +18 -0
- package/dist/components/TextareaComposer/SuggestionList/SuggestionListItem.js +25 -0
- package/dist/components/{UserItem → TextareaComposer/SuggestionList}/UserItem.d.ts +7 -4
- package/dist/components/TextareaComposer/SuggestionList/UserItem.js +24 -0
- package/dist/components/TextareaComposer/SuggestionList/index.d.ts +5 -0
- package/dist/components/TextareaComposer/SuggestionList/index.js +5 -0
- package/dist/components/TextareaComposer/TextareaComposer.d.ts +13 -0
- package/dist/components/TextareaComposer/TextareaComposer.js +155 -0
- package/dist/components/TextareaComposer/index.d.ts +2 -0
- package/dist/components/TextareaComposer/index.js +2 -0
- package/dist/components/Thread/Thread.d.ts +13 -10
- package/dist/components/Thread/Thread.js +23 -12
- package/dist/components/Thread/ThreadHead.d.ts +2 -3
- package/dist/components/Thread/ThreadHeader.d.ts +5 -6
- package/dist/components/Thread/ThreadHeader.js +1 -1
- package/dist/components/Threads/ThreadContext.d.ts +2 -2
- package/dist/components/Threads/ThreadContext.js +1 -4
- package/dist/components/Threads/ThreadList/ThreadList.d.ts +1 -1
- package/dist/components/Threads/ThreadList/ThreadListItem.d.ts +1 -1
- package/dist/components/Threads/hooks/useThreadManagerState.d.ts +1 -1
- package/dist/components/Threads/hooks/useThreadState.d.ts +1 -1
- package/dist/components/Threads/icons.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +3 -2
- package/dist/components/Tooltip/hooks/useEnterLeaveHandlers.d.ts +1 -1
- package/dist/components/TypingIndicator/TypingIndicator.d.ts +1 -2
- package/dist/components/Window/Window.d.ts +6 -6
- package/dist/components/index.d.ts +1 -5
- package/dist/components/index.js +1 -5
- package/dist/context/AttachmentSelectorContext.d.ts +2 -1
- package/dist/context/ChannelActionContext.d.ts +26 -35
- package/dist/context/ChannelListContext.d.ts +9 -9
- package/dist/context/ChannelListContext.js +1 -1
- package/dist/context/ChannelStateContext.d.ts +24 -34
- package/dist/context/ChatContext.d.ts +18 -17
- package/dist/context/ComponentContext.d.ts +41 -37
- package/dist/context/DialogManagerContext.d.ts +2 -1
- package/dist/context/MessageBounceContext.d.ts +8 -7
- package/dist/context/MessageBounceContext.js +1 -1
- package/dist/context/MessageContext.d.ts +23 -23
- package/dist/context/MessageInputContext.d.ts +8 -26
- package/dist/context/MessageInputContext.js +3 -2
- package/dist/context/MessageListContext.d.ts +2 -1
- package/dist/context/PollContext.d.ts +8 -8
- package/dist/context/TranslationContext.d.ts +2 -1
- package/dist/context/TypingContext.d.ts +11 -10
- package/dist/context/VirtualizedMessageListContext.d.ts +2 -1
- package/dist/context/WithComponents.d.ts +3 -2
- package/dist/css/v2/index.css +1 -1
- package/dist/css/v2/index.layout.css +1 -1
- package/dist/experimental/MessageActions/MessageActions.d.ts +1 -1
- package/dist/experimental/MessageActions/MessageActions.js +1 -1
- package/dist/experimental/MessageActions/defaults.js +4 -3
- package/dist/experimental/Search/Search.d.ts +1 -2
- package/dist/experimental/Search/SearchContext.d.ts +8 -8
- package/dist/experimental/Search/SearchResults/SearchResultItem.d.ts +11 -11
- package/dist/experimental/Search/SearchResults/SearchResultItem.js +3 -3
- package/dist/experimental/Search/SearchResults/SearchResults.d.ts +1 -2
- package/dist/experimental/Search/SearchResults/SearchResultsHeader.d.ts +1 -2
- package/dist/experimental/Search/SearchResults/SearchResultsHeader.js +1 -1
- package/dist/experimental/Search/SearchResults/SearchSourceResultList.d.ts +2 -3
- package/dist/experimental/Search/SearchResults/SearchSourceResultListFooter.d.ts +1 -2
- package/dist/experimental/Search/SearchResults/SearchSourceResults.d.ts +1 -2
- package/dist/experimental/Search/SearchResults/SearchSourceResults.js +1 -1
- package/dist/experimental/Search/SearchSourceResultsContext.d.ts +2 -1
- package/dist/experimental/Search/hooks/useSearchFocusedMessage.d.ts +1 -2
- package/dist/experimental/Search/hooks/useSearchFocusedMessage.js +3 -1
- package/dist/experimental/Search/hooks/useSearchQueriesInProgress.d.ts +3 -4
- package/dist/experimental/index.browser.cjs +1139 -1075
- package/dist/experimental/index.browser.cjs.map +4 -4
- package/dist/experimental/index.node.cjs +1139 -1075
- package/dist/experimental/index.node.cjs.map +4 -4
- package/dist/i18n/Streami18n.d.ts +2 -1
- package/dist/i18n/de.json +1 -0
- package/dist/i18n/en.json +1 -0
- package/dist/i18n/es.json +1 -0
- package/dist/i18n/fr.json +1 -0
- package/dist/i18n/hi.json +1 -0
- package/dist/i18n/it.json +1 -0
- package/dist/i18n/ja.json +1 -0
- package/dist/i18n/ko.json +1 -0
- package/dist/i18n/nl.json +1 -0
- package/dist/i18n/pt.json +1 -0
- package/dist/i18n/ru.json +1 -0
- package/dist/i18n/tr.json +1 -0
- package/dist/i18n/types.d.ts +2 -2
- package/dist/i18n/utils.d.ts +1 -1
- package/dist/i18n/utils.js +3 -1
- package/dist/index.browser.cjs +28774 -30813
- package/dist/index.browser.cjs.map +4 -4
- package/dist/index.node.cjs +30798 -32844
- package/dist/index.node.cjs.map +4 -4
- package/dist/plugins/Emojis/index.browser.cjs +133 -5
- package/dist/plugins/Emojis/index.browser.cjs.map +4 -4
- package/dist/plugins/Emojis/index.d.ts +1 -0
- package/dist/plugins/Emojis/index.js +1 -0
- package/dist/plugins/Emojis/index.node.cjs +135 -6
- package/dist/plugins/Emojis/index.node.cjs.map +4 -4
- package/dist/plugins/Emojis/middleware/index.d.ts +1 -0
- package/dist/plugins/Emojis/middleware/index.js +1 -0
- package/dist/plugins/Emojis/middleware/textComposerEmojiMiddleware.d.ts +66 -0
- package/dist/plugins/Emojis/middleware/textComposerEmojiMiddleware.js +143 -0
- package/dist/plugins/encoders/mp3.browser.cjs.map +2 -2
- package/dist/plugins/encoders/mp3.node.cjs.map +2 -2
- package/dist/scss/v2/Autocomplete/Autocomplete-layout.scss +14 -0
- package/dist/scss/v2/Autocomplete/Autocomplete-theme.scss +11 -0
- package/dist/scss/v2/DropzoneContainer/DropzoneContainer-layout.scss +14 -0
- package/dist/scss/v2/DropzoneContainer/DropzoneContainer-theme.scss +17 -0
- package/dist/scss/v2/LinkPreview/LinkPreview-layout.scss +18 -0
- package/dist/scss/v2/LinkPreview/LinkPreview-theme.scss +15 -0
- package/dist/scss/v2/Message/Message-layout.scss +8 -0
- package/dist/scss/v2/Message/Message-theme.scss +29 -0
- package/dist/scss/v2/MessageInput/MessageInput-layout.scss +0 -13
- package/dist/scss/v2/MessageInput/MessageInput-theme.scss +8 -19
- package/dist/scss/v2/index.layout.scss +2 -1
- package/dist/scss/v2/index.scss +1 -0
- package/dist/types/defaultDataInterfaces.d.ts +25 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/types.d.ts +2 -62
- package/dist/utils/getChannel.d.ts +5 -6
- package/dist/utils/mergeDeep.d.ts +2 -3
- package/package.json +8 -11
- package/dist/components/AutoCompleteTextarea/Item.d.ts +0 -2
- package/dist/components/AutoCompleteTextarea/Item.js +0 -10
- package/dist/components/AutoCompleteTextarea/List.d.ts +0 -17
- package/dist/components/AutoCompleteTextarea/List.js +0 -89
- package/dist/components/AutoCompleteTextarea/Textarea.d.ts +0 -114
- package/dist/components/AutoCompleteTextarea/Textarea.js +0 -593
- package/dist/components/AutoCompleteTextarea/index.d.ts +0 -4
- package/dist/components/AutoCompleteTextarea/index.js +0 -4
- package/dist/components/AutoCompleteTextarea/types.d.ts +0 -15
- package/dist/components/AutoCompleteTextarea/utils.d.ts +0 -6
- package/dist/components/AutoCompleteTextarea/utils.js +0 -40
- package/dist/components/ChatAutoComplete/ChatAutoComplete.d.ts +0 -78
- package/dist/components/ChatAutoComplete/ChatAutoComplete.js +0 -33
- package/dist/components/ChatAutoComplete/index.d.ts +0 -1
- package/dist/components/ChatAutoComplete/index.js +0 -1
- package/dist/components/CommandItem/index.d.ts +0 -1
- package/dist/components/CommandItem/index.js +0 -1
- package/dist/components/EmoticonItem/EmoticonItem.js +0 -16
- package/dist/components/EmoticonItem/index.d.ts +0 -1
- package/dist/components/EmoticonItem/index.js +0 -1
- package/dist/components/MessageInput/DefaultTriggerProvider.d.ts +0 -35
- package/dist/components/MessageInput/DefaultTriggerProvider.js +0 -24
- package/dist/components/MessageInput/DropzoneProvider.d.ts +0 -4
- package/dist/components/MessageInput/DropzoneProvider.js +0 -23
- package/dist/components/MessageInput/hooks/useAttachments.d.ts +0 -14
- package/dist/components/MessageInput/hooks/useAttachments.js +0 -209
- package/dist/components/MessageInput/hooks/useCommandTrigger.d.ts +0 -3
- package/dist/components/MessageInput/hooks/useCommandTrigger.js +0 -62
- package/dist/components/MessageInput/hooks/useEmojiTrigger.d.ts +0 -3
- package/dist/components/MessageInput/hooks/useEmojiTrigger.js +0 -29
- package/dist/components/MessageInput/hooks/useLinkPreviews.d.ts +0 -30
- package/dist/components/MessageInput/hooks/useLinkPreviews.js +0 -109
- package/dist/components/MessageInput/hooks/useMessageInputState.d.ts +0 -71
- package/dist/components/MessageInput/hooks/useMessageInputState.js +0 -200
- package/dist/components/MessageInput/hooks/useUserTrigger.d.ts +0 -12
- package/dist/components/MessageInput/hooks/useUserTrigger.js +0 -130
- package/dist/components/MessageInput/types.d.ts +0 -87
- package/dist/components/MessageInput/types.js +0 -19
- package/dist/components/ReactFileUtilities/ImageDropzone.d.ts +0 -16
- package/dist/components/ReactFileUtilities/ImageDropzone.js +0 -42
- package/dist/components/UserItem/UserItem.js +0 -26
- package/dist/components/UserItem/index.d.ts +0 -1
- package/dist/components/UserItem/index.js +0 -1
- /package/dist/components/{MessageInput → MediaRecorder/AudioRecorder}/hooks/useTimeElapsed.d.ts +0 -0
- /package/dist/components/{MessageInput → MediaRecorder/AudioRecorder}/hooks/useTimeElapsed.js +0 -0
- /package/dist/scss/v2/DragAndDropContainer/{DragAmdDropContainer-layout.scss → DragAndDropContainer-layout.scss} +0 -0
- /package/dist/{components/AutoCompleteTextarea/types.js → types/defaultDataInterfaces.js} +0 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import mergeWith from 'lodash.mergewith';
|
|
2
|
+
import { BaseSearchSource, getTokenizedSuggestionDisplayName, getTriggerCharWithToken, insertItemWithTrigger, replaceWordWithEntity, } from 'stream-chat';
|
|
3
|
+
class EmojiSearchSource extends BaseSearchSource {
|
|
4
|
+
constructor(emojiSearchIndex, options) {
|
|
5
|
+
super(options);
|
|
6
|
+
this.type = 'emoji';
|
|
7
|
+
this.emojiSearchIndex = emojiSearchIndex;
|
|
8
|
+
}
|
|
9
|
+
async query(searchQuery) {
|
|
10
|
+
if (searchQuery.length === 0) {
|
|
11
|
+
return { items: [], next: null };
|
|
12
|
+
}
|
|
13
|
+
const emojis = (await this.emojiSearchIndex.search(searchQuery)) ?? [];
|
|
14
|
+
// emojiIndex.search sometimes returns undefined values, so filter those out first
|
|
15
|
+
return {
|
|
16
|
+
items: emojis
|
|
17
|
+
.filter(Boolean)
|
|
18
|
+
.slice(0, 7)
|
|
19
|
+
.map(({ emoticons = [], id, name, native, skins = [] }) => {
|
|
20
|
+
const [firstSkin] = skins;
|
|
21
|
+
return {
|
|
22
|
+
emoticons,
|
|
23
|
+
id,
|
|
24
|
+
name,
|
|
25
|
+
native: native ?? firstSkin.native,
|
|
26
|
+
};
|
|
27
|
+
}),
|
|
28
|
+
next: null, // todo: generate cursor
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
filterQueryResults(items) {
|
|
32
|
+
return items.map((item) => ({
|
|
33
|
+
...item,
|
|
34
|
+
...getTokenizedSuggestionDisplayName({
|
|
35
|
+
displayName: item.id,
|
|
36
|
+
searchToken: this.searchQuery,
|
|
37
|
+
}),
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const DEFAULT_OPTIONS = { minChars: 1, trigger: ':' };
|
|
42
|
+
/**
|
|
43
|
+
* TextComposer middleware for mentions
|
|
44
|
+
* Usage:
|
|
45
|
+
*
|
|
46
|
+
* const textComposer = new TextComposer(options);
|
|
47
|
+
*
|
|
48
|
+
* textComposer.use(new createTextComposerEmojiMiddleware(emojiSearchIndex, {
|
|
49
|
+
* minChars: 2
|
|
50
|
+
* }));
|
|
51
|
+
*
|
|
52
|
+
* @param emojiSearchIndex
|
|
53
|
+
* @param {{
|
|
54
|
+
* minChars: number;
|
|
55
|
+
* trigger: string;
|
|
56
|
+
* }} options
|
|
57
|
+
* @returns
|
|
58
|
+
*/
|
|
59
|
+
export const createTextComposerEmojiMiddleware = (emojiSearchIndex, options) => {
|
|
60
|
+
const finalOptions = mergeWith(DEFAULT_OPTIONS, options ?? {});
|
|
61
|
+
const emojiSearchSource = new EmojiSearchSource(emojiSearchIndex);
|
|
62
|
+
emojiSearchSource.activate();
|
|
63
|
+
return {
|
|
64
|
+
id: 'stream-io/emoji-middleware',
|
|
65
|
+
onChange: async ({ input, nextHandler }) => {
|
|
66
|
+
const { state } = input;
|
|
67
|
+
if (!state.selection)
|
|
68
|
+
return nextHandler(input);
|
|
69
|
+
const triggerWithToken = getTriggerCharWithToken({
|
|
70
|
+
acceptTrailingSpaces: false,
|
|
71
|
+
text: state.text.slice(0, state.selection.end),
|
|
72
|
+
trigger: finalOptions.trigger,
|
|
73
|
+
});
|
|
74
|
+
const triggerWasRemoved = !triggerWithToken || triggerWithToken.length < finalOptions.minChars;
|
|
75
|
+
if (triggerWasRemoved) {
|
|
76
|
+
const hasSuggestionsForTrigger = input.state.suggestions?.trigger === finalOptions.trigger;
|
|
77
|
+
const newInput = { ...input };
|
|
78
|
+
if (hasSuggestionsForTrigger && newInput.state.suggestions) {
|
|
79
|
+
delete newInput.state.suggestions;
|
|
80
|
+
}
|
|
81
|
+
return nextHandler(newInput);
|
|
82
|
+
}
|
|
83
|
+
const newSearchTriggerred = triggerWithToken && triggerWithToken === finalOptions.trigger;
|
|
84
|
+
if (newSearchTriggerred) {
|
|
85
|
+
emojiSearchSource.resetStateAndActivate();
|
|
86
|
+
}
|
|
87
|
+
const textWithReplacedWord = await replaceWordWithEntity({
|
|
88
|
+
caretPosition: state.selection.end,
|
|
89
|
+
getEntityString: async (word) => {
|
|
90
|
+
const { items } = await emojiSearchSource.query(word);
|
|
91
|
+
const emoji = items
|
|
92
|
+
.filter(Boolean)
|
|
93
|
+
.slice(0, 10)
|
|
94
|
+
.find(({ emoticons }) => !!emoticons?.includes(word));
|
|
95
|
+
if (!emoji)
|
|
96
|
+
return null;
|
|
97
|
+
const [firstSkin] = emoji.skins ?? [];
|
|
98
|
+
return emoji.native ?? firstSkin.native;
|
|
99
|
+
},
|
|
100
|
+
text: state.text,
|
|
101
|
+
});
|
|
102
|
+
if (textWithReplacedWord !== state.text) {
|
|
103
|
+
return {
|
|
104
|
+
state: {
|
|
105
|
+
...state,
|
|
106
|
+
suggestions: undefined, // to prevent the TextComposerMiddlewareExecutor to run the first page query
|
|
107
|
+
text: textWithReplacedWord,
|
|
108
|
+
},
|
|
109
|
+
stop: true, // Stop other middleware from processing '@' character
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
state: {
|
|
114
|
+
...state,
|
|
115
|
+
suggestions: {
|
|
116
|
+
query: triggerWithToken.slice(1),
|
|
117
|
+
searchSource: emojiSearchSource,
|
|
118
|
+
trigger: finalOptions.trigger,
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
stop: true, // Stop other middleware from processing '@' character
|
|
122
|
+
};
|
|
123
|
+
},
|
|
124
|
+
onSuggestionItemSelect: ({ input, nextHandler, selectedSuggestion, }) => {
|
|
125
|
+
const { state } = input;
|
|
126
|
+
if (!selectedSuggestion || state.suggestions?.trigger !== finalOptions.trigger)
|
|
127
|
+
return nextHandler(input);
|
|
128
|
+
emojiSearchSource.resetStateAndActivate();
|
|
129
|
+
return Promise.resolve({
|
|
130
|
+
state: {
|
|
131
|
+
...state,
|
|
132
|
+
...insertItemWithTrigger({
|
|
133
|
+
insertText: `${'native' in selectedSuggestion ? selectedSuggestion.native : ''} `,
|
|
134
|
+
selection: state.selection,
|
|
135
|
+
text: state.text,
|
|
136
|
+
trigger: finalOptions.trigger,
|
|
137
|
+
}),
|
|
138
|
+
suggestions: undefined, // Clear suggestions after selection
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/plugins/encoders/mp3.ts", "../../../src/components/ReactFileUtilities/utils.ts", "../../../src/components/MediaRecorder/transcode/audioProcessing.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n renderAudio,\n toAudioBuffer,\n} from '../../components/MediaRecorder/transcode/audioProcessing';\n\nconst ENCODING_BIT_RATE = 128; // kbps;\nconst COUNT_SAMPLES_PER_ENCODED_BLOCK = 1152;\n\nconst float32ArrayToInt16Array = (float32Arr: Float32Array) => {\n const int16Arr = new Int16Array(float32Arr.length);\n for (let i = 0; i < float32Arr.length; i++) {\n const float32Value = float32Arr[i];\n // Clamp the float value between -1 and 1\n const clampedValue = Math.max(-1, Math.min(1, float32Value));\n // Convert the float value to a signed 16-bit integer\n int16Arr[i] = Math.round(clampedValue * 32767);\n }\n return int16Arr;\n};\n\nconst splitDataByChannel = (audioBuffer: AudioBuffer) =>\n Array.from({ length: audioBuffer.numberOfChannels }, (_, i) =>\n audioBuffer.getChannelData(i),\n ).map(float32ArrayToInt16Array);\n\nexport async function encodeToMp3(file: File, sampleRate: number) {\n const lameJs = await import('@breezystack/lamejs');\n const audioBuffer = await renderAudio(await toAudioBuffer(file), sampleRate);\n const channelCount = audioBuffer.numberOfChannels;\n const dataByChannel = splitDataByChannel(audioBuffer);\n const mp3Encoder = new lameJs.Mp3Encoder(channelCount, sampleRate, ENCODING_BIT_RATE);\n\n const dataBuffer: Int8Array[] = [];\n let remaining = dataByChannel[0].length;\n for (\n let i = 0;\n remaining >= COUNT_SAMPLES_PER_ENCODED_BLOCK;\n i += COUNT_SAMPLES_PER_ENCODED_BLOCK\n ) {\n const [leftChannelBlock, rightChannelBlock] = dataByChannel.map((channel) =>\n channel.subarray(i, i + COUNT_SAMPLES_PER_ENCODED_BLOCK),\n );\n dataBuffer.push(\n new Int8Array(mp3Encoder.encodeBuffer(leftChannelBlock, rightChannelBlock)),\n );\n remaining -= COUNT_SAMPLES_PER_ENCODED_BLOCK;\n }\n\n const lastBlock = mp3Encoder.flush();\n if (lastBlock.length) dataBuffer.push(new Int8Array(lastBlock));\n return new Blob(dataBuffer, { type: 'audio/mp3;sbu_type=voice' });\n}\n", "import { FileLike, RecordedMediaType } from './types';\nimport { ChangeEvent
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;
|
|
4
|
+
"sourcesContent": ["import {\n renderAudio,\n toAudioBuffer,\n} from '../../components/MediaRecorder/transcode/audioProcessing';\n\nconst ENCODING_BIT_RATE = 128; // kbps;\nconst COUNT_SAMPLES_PER_ENCODED_BLOCK = 1152;\n\nconst float32ArrayToInt16Array = (float32Arr: Float32Array) => {\n const int16Arr = new Int16Array(float32Arr.length);\n for (let i = 0; i < float32Arr.length; i++) {\n const float32Value = float32Arr[i];\n // Clamp the float value between -1 and 1\n const clampedValue = Math.max(-1, Math.min(1, float32Value));\n // Convert the float value to a signed 16-bit integer\n int16Arr[i] = Math.round(clampedValue * 32767);\n }\n return int16Arr;\n};\n\nconst splitDataByChannel = (audioBuffer: AudioBuffer) =>\n Array.from({ length: audioBuffer.numberOfChannels }, (_, i) =>\n audioBuffer.getChannelData(i),\n ).map(float32ArrayToInt16Array);\n\nexport async function encodeToMp3(file: File, sampleRate: number) {\n const lameJs = await import('@breezystack/lamejs');\n const audioBuffer = await renderAudio(await toAudioBuffer(file), sampleRate);\n const channelCount = audioBuffer.numberOfChannels;\n const dataByChannel = splitDataByChannel(audioBuffer);\n const mp3Encoder = new lameJs.Mp3Encoder(channelCount, sampleRate, ENCODING_BIT_RATE);\n\n const dataBuffer: Int8Array[] = [];\n let remaining = dataByChannel[0].length;\n for (\n let i = 0;\n remaining >= COUNT_SAMPLES_PER_ENCODED_BLOCK;\n i += COUNT_SAMPLES_PER_ENCODED_BLOCK\n ) {\n const [leftChannelBlock, rightChannelBlock] = dataByChannel.map((channel) =>\n channel.subarray(i, i + COUNT_SAMPLES_PER_ENCODED_BLOCK),\n );\n dataBuffer.push(\n new Int8Array(mp3Encoder.encodeBuffer(leftChannelBlock, rightChannelBlock)),\n );\n remaining -= COUNT_SAMPLES_PER_ENCODED_BLOCK;\n }\n\n const lastBlock = mp3Encoder.flush();\n if (lastBlock.length) dataBuffer.push(new Int8Array(lastBlock));\n return new Blob(dataBuffer, { type: 'audio/mp3;sbu_type=voice' });\n}\n", "import type { FileLike, RecordedMediaType } from './types';\nimport type { ChangeEvent } from 'react';\nimport { useCallback } from 'react';\n\nexport const useHandleFileChangeWrapper = (\n resetOnChange = false,\n handler?: (files: Array<File>) => void,\n) =>\n useCallback(\n ({ currentTarget }: ChangeEvent<HTMLInputElement>) => {\n const { files } = currentTarget;\n\n if (!files) return;\n\n try {\n handler?.(Array.from(files));\n } catch (error) {\n console.error(error);\n }\n\n if (resetOnChange) currentTarget.value = '';\n },\n [handler, resetOnChange],\n );\n\nexport function dataTransferItemsHaveFiles(items?: DataTransferItem[]): boolean {\n if (!items || !items.length) {\n return false;\n }\n for (const item of items) {\n if (item.kind === 'file' || item.type === 'text/html') {\n return true;\n }\n }\n return false;\n}\n\nexport async function dataTransferItemsToFiles(\n items?: DataTransferItem[],\n): Promise<FileLike[]> {\n if (!items || !items.length) {\n return [];\n }\n\n // If there are files inside the DataTransferItem prefer those\n const fileLikes = getFileLikes(items);\n if (fileLikes.length) {\n return fileLikes;\n }\n\n // Otherwise extract images from html\n const blobPromises = [];\n for (const item of items) {\n if (item.type === 'text/html') {\n blobPromises.push(\n new Promise<void>((accept) => {\n item.getAsString(async (s) => {\n const imagePromises = extractImageSources(s).map((src) =>\n getImageSource(fileLikes, src),\n );\n\n await Promise.all(imagePromises);\n accept();\n });\n }),\n );\n }\n }\n await Promise.all(blobPromises);\n return fileLikes;\n}\n\nfunction getFileLikes(items: DataTransferItem[]) {\n const fileLikes = [];\n for (const item of items) {\n if (item.kind === 'file') {\n const file = item.getAsFile();\n if (file) {\n fileLikes.push(file);\n }\n }\n }\n return fileLikes;\n}\n\nasync function getImageSource(fileLikes: FileLike[], src: string) {\n let res;\n try {\n res = await fetch(src);\n } catch (e) {\n return;\n }\n const contentType = res.headers.get('Content-type') || 'application/octet-stream';\n const buf = await res.arrayBuffer();\n const blob = new Blob([buf], { type: contentType });\n fileLikes.push(blob);\n}\n\nconst extractImageSources = (s: string) => {\n const imageTags = new DOMParser()\n .parseFromString(s, 'text/html')\n .getElementsByTagName('img');\n return Array.from(imageTags, (tag) => tag.src).filter((tag) => tag);\n};\n\nexport const isBlobButNotFile = (obj: unknown): obj is Blob =>\n obj instanceof Blob && !(obj instanceof File);\n\nexport const createFileFromBlobs = ({\n blobsArray,\n fileName,\n mimeType,\n}: {\n blobsArray: Blob[];\n fileName: string;\n mimeType: string;\n}) => {\n const concatenatedBlob = new Blob(blobsArray, { type: mimeType });\n return new File([concatenatedBlob], fileName, { type: concatenatedBlob.type });\n};\n\nexport const getExtensionFromMimeType = (mimeType: string) => {\n const match = mimeType.match(/\\/([^/;]+)/);\n return match && match[1];\n};\n\nexport const getRecordedMediaTypeFromMimeType = (\n mimeType: string,\n): RecordedMediaType | null => {\n const match = mimeType.match(/^(audio|video)\\/.*$/);\n return match && (match[1] as RecordedMediaType);\n};\n\nexport const readFileAsArrayBuffer = (file: File): Promise<ArrayBuffer> =>\n new Promise((resolve, reject) => {\n const fileReader = new FileReader();\n fileReader.onload = () => {\n resolve(fileReader.result as ArrayBuffer);\n };\n\n fileReader.onerror = () => {\n reject(fileReader.error);\n };\n\n fileReader.readAsArrayBuffer(file);\n });\n\nexport const generateFileName = (mimeType: string) =>\n `file_${new Date().toISOString()}.${getExtensionFromMimeType(mimeType)}`;\n", "import { readFileAsArrayBuffer } from '../../ReactFileUtilities';\n\n/**\n * In the context of resampling audio data, AudioContext is used to decode the input audio file into an AudioBuffer,\n * which is a fundamental data structure representing audio data.\n * @param file\n */\nexport const toAudioBuffer = async (file: File) => {\n const audioCtx = new AudioContext();\n\n const arrayBuffer = await readFileAsArrayBuffer(file);\n const decodedData = await audioCtx.decodeAudioData(arrayBuffer);\n if (audioCtx.state !== 'closed') await audioCtx.close();\n return decodedData;\n};\n\n/**\n * OfflineAudioContext is a specialized type of AudioContext that does not render audio in real-time and is used for offline audio processing tasks.\n * It allows performing audio processing and rendering without actually playing the audio through speakers or outputting it to a destination.\n * In the context of resampling audio data, OfflineAudioContext is used to resample the decoded AudioBuffer from a file to the desired sample rate.\n * It provides more flexibility and control over audio processing, as it can operate at different sample rates and durations compared to real-time audio contexts.\n * @param audioBuffer\n * @param sampleRate\n */\nexport const renderAudio = async (audioBuffer: AudioBuffer, sampleRate: number) => {\n const offlineAudioCtx = new OfflineAudioContext(\n audioBuffer.numberOfChannels,\n audioBuffer.duration * sampleRate,\n sampleRate,\n );\n const source = offlineAudioCtx.createBufferSource();\n source.buffer = audioBuffer;\n source.connect(offlineAudioCtx.destination);\n source.start();\n\n return await offlineAudioCtx.startRendering();\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,mBAA4B;AAmIrB,IAAM,wBAAwB,CAAC,SACpC,IAAI,QAAQ,CAAC,SAAS,WAAW;AAC/B,QAAM,aAAa,IAAI,WAAW;AAClC,aAAW,SAAS,MAAM;AACxB,YAAQ,WAAW,MAAqB;AAAA,EAC1C;AAEA,aAAW,UAAU,MAAM;AACzB,WAAO,WAAW,KAAK;AAAA,EACzB;AAEA,aAAW,kBAAkB,IAAI;AACnC,CAAC;;;AC1II,IAAM,gBAAgB,OAAO,SAAe;AACjD,QAAM,WAAW,IAAI,aAAa;AAElC,QAAM,cAAc,MAAM,sBAAsB,IAAI;AACpD,QAAM,cAAc,MAAM,SAAS,gBAAgB,WAAW;AAC9D,MAAI,SAAS,UAAU,SAAU,OAAM,SAAS,MAAM;AACtD,SAAO;AACT;AAUO,IAAM,cAAc,OAAO,aAA0B,eAAuB;AACjF,QAAM,kBAAkB,IAAI;AAAA,IAC1B,YAAY;AAAA,IACZ,YAAY,WAAW;AAAA,IACvB;AAAA,EACF;AACA,QAAM,SAAS,gBAAgB,mBAAmB;AAClD,SAAO,SAAS;AAChB,SAAO,QAAQ,gBAAgB,WAAW;AAC1C,SAAO,MAAM;AAEb,SAAO,MAAM,gBAAgB,eAAe;AAC9C;;;AF/BA,IAAM,oBAAoB;AAC1B,IAAM,kCAAkC;AAExC,IAAM,2BAA2B,CAAC,eAA6B;AAC7D,QAAM,WAAW,IAAI,WAAW,WAAW,MAAM;AACjD,WAAS,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK;AAC1C,UAAM,eAAe,WAAW,CAAC;AAEjC,UAAM,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,GAAG,YAAY,CAAC;AAE3D,aAAS,CAAC,IAAI,KAAK,MAAM,eAAe,KAAK;AAAA,EAC/C;AACA,SAAO;AACT;AAEA,IAAM,qBAAqB,CAAC,gBAC1B,MAAM;AAAA,EAAK,EAAE,QAAQ,YAAY,iBAAiB;AAAA,EAAG,CAAC,GAAG,MACvD,YAAY,eAAe,CAAC;AAC9B,EAAE,IAAI,wBAAwB;AAEhC,eAAsB,YAAY,MAAY,YAAoB;AAChE,QAAM,SAAS,MAAM,OAAO,qBAAqB;AACjD,QAAM,cAAc,MAAM,YAAY,MAAM,cAAc,IAAI,GAAG,UAAU;AAC3E,QAAM,eAAe,YAAY;AACjC,QAAM,gBAAgB,mBAAmB,WAAW;AACpD,QAAM,aAAa,IAAI,OAAO,WAAW,cAAc,YAAY,iBAAiB;AAEpF,QAAM,aAA0B,CAAC;AACjC,MAAI,YAAY,cAAc,CAAC,EAAE;AACjC,WACM,IAAI,GACR,aAAa,iCACb,KAAK,iCACL;AACA,UAAM,CAAC,kBAAkB,iBAAiB,IAAI,cAAc;AAAA,MAAI,CAAC,YAC/D,QAAQ,SAAS,GAAG,IAAI,+BAA+B;AAAA,IACzD;AACA,eAAW;AAAA,MACT,IAAI,UAAU,WAAW,aAAa,kBAAkB,iBAAiB,CAAC;AAAA,IAC5E;AACA,iBAAa;AAAA,EACf;AAEA,QAAM,YAAY,WAAW,MAAM;AACnC,MAAI,UAAU,OAAQ,YAAW,KAAK,IAAI,UAAU,SAAS,CAAC;AAC9D,SAAO,IAAI,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAClE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/plugins/encoders/mp3.ts", "../../../src/components/ReactFileUtilities/utils.ts", "../../../src/components/MediaRecorder/transcode/audioProcessing.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n renderAudio,\n toAudioBuffer,\n} from '../../components/MediaRecorder/transcode/audioProcessing';\n\nconst ENCODING_BIT_RATE = 128; // kbps;\nconst COUNT_SAMPLES_PER_ENCODED_BLOCK = 1152;\n\nconst float32ArrayToInt16Array = (float32Arr: Float32Array) => {\n const int16Arr = new Int16Array(float32Arr.length);\n for (let i = 0; i < float32Arr.length; i++) {\n const float32Value = float32Arr[i];\n // Clamp the float value between -1 and 1\n const clampedValue = Math.max(-1, Math.min(1, float32Value));\n // Convert the float value to a signed 16-bit integer\n int16Arr[i] = Math.round(clampedValue * 32767);\n }\n return int16Arr;\n};\n\nconst splitDataByChannel = (audioBuffer: AudioBuffer) =>\n Array.from({ length: audioBuffer.numberOfChannels }, (_, i) =>\n audioBuffer.getChannelData(i),\n ).map(float32ArrayToInt16Array);\n\nexport async function encodeToMp3(file: File, sampleRate: number) {\n const lameJs = await import('@breezystack/lamejs');\n const audioBuffer = await renderAudio(await toAudioBuffer(file), sampleRate);\n const channelCount = audioBuffer.numberOfChannels;\n const dataByChannel = splitDataByChannel(audioBuffer);\n const mp3Encoder = new lameJs.Mp3Encoder(channelCount, sampleRate, ENCODING_BIT_RATE);\n\n const dataBuffer: Int8Array[] = [];\n let remaining = dataByChannel[0].length;\n for (\n let i = 0;\n remaining >= COUNT_SAMPLES_PER_ENCODED_BLOCK;\n i += COUNT_SAMPLES_PER_ENCODED_BLOCK\n ) {\n const [leftChannelBlock, rightChannelBlock] = dataByChannel.map((channel) =>\n channel.subarray(i, i + COUNT_SAMPLES_PER_ENCODED_BLOCK),\n );\n dataBuffer.push(\n new Int8Array(mp3Encoder.encodeBuffer(leftChannelBlock, rightChannelBlock)),\n );\n remaining -= COUNT_SAMPLES_PER_ENCODED_BLOCK;\n }\n\n const lastBlock = mp3Encoder.flush();\n if (lastBlock.length) dataBuffer.push(new Int8Array(lastBlock));\n return new Blob(dataBuffer, { type: 'audio/mp3;sbu_type=voice' });\n}\n", "import { FileLike, RecordedMediaType } from './types';\nimport { ChangeEvent
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;
|
|
4
|
+
"sourcesContent": ["import {\n renderAudio,\n toAudioBuffer,\n} from '../../components/MediaRecorder/transcode/audioProcessing';\n\nconst ENCODING_BIT_RATE = 128; // kbps;\nconst COUNT_SAMPLES_PER_ENCODED_BLOCK = 1152;\n\nconst float32ArrayToInt16Array = (float32Arr: Float32Array) => {\n const int16Arr = new Int16Array(float32Arr.length);\n for (let i = 0; i < float32Arr.length; i++) {\n const float32Value = float32Arr[i];\n // Clamp the float value between -1 and 1\n const clampedValue = Math.max(-1, Math.min(1, float32Value));\n // Convert the float value to a signed 16-bit integer\n int16Arr[i] = Math.round(clampedValue * 32767);\n }\n return int16Arr;\n};\n\nconst splitDataByChannel = (audioBuffer: AudioBuffer) =>\n Array.from({ length: audioBuffer.numberOfChannels }, (_, i) =>\n audioBuffer.getChannelData(i),\n ).map(float32ArrayToInt16Array);\n\nexport async function encodeToMp3(file: File, sampleRate: number) {\n const lameJs = await import('@breezystack/lamejs');\n const audioBuffer = await renderAudio(await toAudioBuffer(file), sampleRate);\n const channelCount = audioBuffer.numberOfChannels;\n const dataByChannel = splitDataByChannel(audioBuffer);\n const mp3Encoder = new lameJs.Mp3Encoder(channelCount, sampleRate, ENCODING_BIT_RATE);\n\n const dataBuffer: Int8Array[] = [];\n let remaining = dataByChannel[0].length;\n for (\n let i = 0;\n remaining >= COUNT_SAMPLES_PER_ENCODED_BLOCK;\n i += COUNT_SAMPLES_PER_ENCODED_BLOCK\n ) {\n const [leftChannelBlock, rightChannelBlock] = dataByChannel.map((channel) =>\n channel.subarray(i, i + COUNT_SAMPLES_PER_ENCODED_BLOCK),\n );\n dataBuffer.push(\n new Int8Array(mp3Encoder.encodeBuffer(leftChannelBlock, rightChannelBlock)),\n );\n remaining -= COUNT_SAMPLES_PER_ENCODED_BLOCK;\n }\n\n const lastBlock = mp3Encoder.flush();\n if (lastBlock.length) dataBuffer.push(new Int8Array(lastBlock));\n return new Blob(dataBuffer, { type: 'audio/mp3;sbu_type=voice' });\n}\n", "import type { FileLike, RecordedMediaType } from './types';\nimport type { ChangeEvent } from 'react';\nimport { useCallback } from 'react';\n\nexport const useHandleFileChangeWrapper = (\n resetOnChange = false,\n handler?: (files: Array<File>) => void,\n) =>\n useCallback(\n ({ currentTarget }: ChangeEvent<HTMLInputElement>) => {\n const { files } = currentTarget;\n\n if (!files) return;\n\n try {\n handler?.(Array.from(files));\n } catch (error) {\n console.error(error);\n }\n\n if (resetOnChange) currentTarget.value = '';\n },\n [handler, resetOnChange],\n );\n\nexport function dataTransferItemsHaveFiles(items?: DataTransferItem[]): boolean {\n if (!items || !items.length) {\n return false;\n }\n for (const item of items) {\n if (item.kind === 'file' || item.type === 'text/html') {\n return true;\n }\n }\n return false;\n}\n\nexport async function dataTransferItemsToFiles(\n items?: DataTransferItem[],\n): Promise<FileLike[]> {\n if (!items || !items.length) {\n return [];\n }\n\n // If there are files inside the DataTransferItem prefer those\n const fileLikes = getFileLikes(items);\n if (fileLikes.length) {\n return fileLikes;\n }\n\n // Otherwise extract images from html\n const blobPromises = [];\n for (const item of items) {\n if (item.type === 'text/html') {\n blobPromises.push(\n new Promise<void>((accept) => {\n item.getAsString(async (s) => {\n const imagePromises = extractImageSources(s).map((src) =>\n getImageSource(fileLikes, src),\n );\n\n await Promise.all(imagePromises);\n accept();\n });\n }),\n );\n }\n }\n await Promise.all(blobPromises);\n return fileLikes;\n}\n\nfunction getFileLikes(items: DataTransferItem[]) {\n const fileLikes = [];\n for (const item of items) {\n if (item.kind === 'file') {\n const file = item.getAsFile();\n if (file) {\n fileLikes.push(file);\n }\n }\n }\n return fileLikes;\n}\n\nasync function getImageSource(fileLikes: FileLike[], src: string) {\n let res;\n try {\n res = await fetch(src);\n } catch (e) {\n return;\n }\n const contentType = res.headers.get('Content-type') || 'application/octet-stream';\n const buf = await res.arrayBuffer();\n const blob = new Blob([buf], { type: contentType });\n fileLikes.push(blob);\n}\n\nconst extractImageSources = (s: string) => {\n const imageTags = new DOMParser()\n .parseFromString(s, 'text/html')\n .getElementsByTagName('img');\n return Array.from(imageTags, (tag) => tag.src).filter((tag) => tag);\n};\n\nexport const isBlobButNotFile = (obj: unknown): obj is Blob =>\n obj instanceof Blob && !(obj instanceof File);\n\nexport const createFileFromBlobs = ({\n blobsArray,\n fileName,\n mimeType,\n}: {\n blobsArray: Blob[];\n fileName: string;\n mimeType: string;\n}) => {\n const concatenatedBlob = new Blob(blobsArray, { type: mimeType });\n return new File([concatenatedBlob], fileName, { type: concatenatedBlob.type });\n};\n\nexport const getExtensionFromMimeType = (mimeType: string) => {\n const match = mimeType.match(/\\/([^/;]+)/);\n return match && match[1];\n};\n\nexport const getRecordedMediaTypeFromMimeType = (\n mimeType: string,\n): RecordedMediaType | null => {\n const match = mimeType.match(/^(audio|video)\\/.*$/);\n return match && (match[1] as RecordedMediaType);\n};\n\nexport const readFileAsArrayBuffer = (file: File): Promise<ArrayBuffer> =>\n new Promise((resolve, reject) => {\n const fileReader = new FileReader();\n fileReader.onload = () => {\n resolve(fileReader.result as ArrayBuffer);\n };\n\n fileReader.onerror = () => {\n reject(fileReader.error);\n };\n\n fileReader.readAsArrayBuffer(file);\n });\n\nexport const generateFileName = (mimeType: string) =>\n `file_${new Date().toISOString()}.${getExtensionFromMimeType(mimeType)}`;\n", "import { readFileAsArrayBuffer } from '../../ReactFileUtilities';\n\n/**\n * In the context of resampling audio data, AudioContext is used to decode the input audio file into an AudioBuffer,\n * which is a fundamental data structure representing audio data.\n * @param file\n */\nexport const toAudioBuffer = async (file: File) => {\n const audioCtx = new AudioContext();\n\n const arrayBuffer = await readFileAsArrayBuffer(file);\n const decodedData = await audioCtx.decodeAudioData(arrayBuffer);\n if (audioCtx.state !== 'closed') await audioCtx.close();\n return decodedData;\n};\n\n/**\n * OfflineAudioContext is a specialized type of AudioContext that does not render audio in real-time and is used for offline audio processing tasks.\n * It allows performing audio processing and rendering without actually playing the audio through speakers or outputting it to a destination.\n * In the context of resampling audio data, OfflineAudioContext is used to resample the decoded AudioBuffer from a file to the desired sample rate.\n * It provides more flexibility and control over audio processing, as it can operate at different sample rates and durations compared to real-time audio contexts.\n * @param audioBuffer\n * @param sampleRate\n */\nexport const renderAudio = async (audioBuffer: AudioBuffer, sampleRate: number) => {\n const offlineAudioCtx = new OfflineAudioContext(\n audioBuffer.numberOfChannels,\n audioBuffer.duration * sampleRate,\n sampleRate,\n );\n const source = offlineAudioCtx.createBufferSource();\n source.buffer = audioBuffer;\n source.connect(offlineAudioCtx.destination);\n source.start();\n\n return await offlineAudioCtx.startRendering();\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,mBAA4B;AAmIrB,IAAM,wBAAwB,CAAC,SACpC,IAAI,QAAQ,CAAC,SAAS,WAAW;AAC/B,QAAM,aAAa,IAAI,WAAW;AAClC,aAAW,SAAS,MAAM;AACxB,YAAQ,WAAW,MAAqB;AAAA,EAC1C;AAEA,aAAW,UAAU,MAAM;AACzB,WAAO,WAAW,KAAK;AAAA,EACzB;AAEA,aAAW,kBAAkB,IAAI;AACnC,CAAC;;;AC1II,IAAM,gBAAgB,OAAO,SAAe;AACjD,QAAM,WAAW,IAAI,aAAa;AAElC,QAAM,cAAc,MAAM,sBAAsB,IAAI;AACpD,QAAM,cAAc,MAAM,SAAS,gBAAgB,WAAW;AAC9D,MAAI,SAAS,UAAU,SAAU,OAAM,SAAS,MAAM;AACtD,SAAO;AACT;AAUO,IAAM,cAAc,OAAO,aAA0B,eAAuB;AACjF,QAAM,kBAAkB,IAAI;AAAA,IAC1B,YAAY;AAAA,IACZ,YAAY,WAAW;AAAA,IACvB;AAAA,EACF;AACA,QAAM,SAAS,gBAAgB,mBAAmB;AAClD,SAAO,SAAS;AAChB,SAAO,QAAQ,gBAAgB,WAAW;AAC1C,SAAO,MAAM;AAEb,SAAO,MAAM,gBAAgB,eAAe;AAC9C;;;AF/BA,IAAM,oBAAoB;AAC1B,IAAM,kCAAkC;AAExC,IAAM,2BAA2B,CAAC,eAA6B;AAC7D,QAAM,WAAW,IAAI,WAAW,WAAW,MAAM;AACjD,WAAS,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK;AAC1C,UAAM,eAAe,WAAW,CAAC;AAEjC,UAAM,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,GAAG,YAAY,CAAC;AAE3D,aAAS,CAAC,IAAI,KAAK,MAAM,eAAe,KAAK;AAAA,EAC/C;AACA,SAAO;AACT;AAEA,IAAM,qBAAqB,CAAC,gBAC1B,MAAM;AAAA,EAAK,EAAE,QAAQ,YAAY,iBAAiB;AAAA,EAAG,CAAC,GAAG,MACvD,YAAY,eAAe,CAAC;AAC9B,EAAE,IAAI,wBAAwB;AAEhC,eAAsB,YAAY,MAAY,YAAoB;AAChE,QAAM,SAAS,MAAM,OAAO,qBAAqB;AACjD,QAAM,cAAc,MAAM,YAAY,MAAM,cAAc,IAAI,GAAG,UAAU;AAC3E,QAAM,eAAe,YAAY;AACjC,QAAM,gBAAgB,mBAAmB,WAAW;AACpD,QAAM,aAAa,IAAI,OAAO,WAAW,cAAc,YAAY,iBAAiB;AAEpF,QAAM,aAA0B,CAAC;AACjC,MAAI,YAAY,cAAc,CAAC,EAAE;AACjC,WACM,IAAI,GACR,aAAa,iCACb,KAAK,iCACL;AACA,UAAM,CAAC,kBAAkB,iBAAiB,IAAI,cAAc;AAAA,MAAI,CAAC,YAC/D,QAAQ,SAAS,GAAG,IAAI,+BAA+B;AAAA,IACzD;AACA,eAAW;AAAA,MACT,IAAI,UAAU,WAAW,aAAa,kBAAkB,iBAAiB,CAAC;AAAA,IAC5E;AACA,iBAAa;AAAA,EACf;AAEA,QAAM,YAAY,WAAW,MAAM;AACnC,MAAI,UAAU,OAAQ,YAAW,KAAK,IAAI,UAAU,SAAS,CAAC;AAC9D,SAAO,IAAI,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAClE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -38,6 +38,16 @@
|
|
|
38
38
|
padding: unset;
|
|
39
39
|
margin: unset;
|
|
40
40
|
}
|
|
41
|
+
|
|
42
|
+
.str-chat__suggestion-list--react {
|
|
43
|
+
overflow-y: unset;
|
|
44
|
+
|
|
45
|
+
.str-chat__suggestion-list-item {
|
|
46
|
+
> button {
|
|
47
|
+
width: 100%;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
41
51
|
}
|
|
42
52
|
|
|
43
53
|
.str-chat__slash-command {
|
|
@@ -58,6 +68,8 @@
|
|
|
58
68
|
.str-chat__user-item--name {
|
|
59
69
|
@include utils.ellipsis-text;
|
|
60
70
|
@include utils.prevent-glitch-text-overflow;
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
61
73
|
width: 100%;
|
|
62
74
|
}
|
|
63
75
|
}
|
|
@@ -69,6 +81,8 @@
|
|
|
69
81
|
|
|
70
82
|
.str-chat__emoji-item--name {
|
|
71
83
|
@include utils.ellipsis-text;
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
72
86
|
width: 100%;
|
|
73
87
|
}
|
|
74
88
|
}
|
|
@@ -156,6 +156,8 @@
|
|
|
156
156
|
|
|
157
157
|
.str-chat__slash-command {
|
|
158
158
|
@include utils.component-layer-overrides('slash-command');
|
|
159
|
+
text-align: left;
|
|
160
|
+
font: var(--str-chat__subtitle-text);
|
|
159
161
|
|
|
160
162
|
.str-chat__slash-command-header {
|
|
161
163
|
.str-chat__slash-command-name {
|
|
@@ -206,4 +208,13 @@
|
|
|
206
208
|
background-color: var(--str-chat__suggestion-list-item--selected-background-color);
|
|
207
209
|
}
|
|
208
210
|
}
|
|
211
|
+
|
|
212
|
+
.str-chat__suggestion-list--react {
|
|
213
|
+
.str-chat__suggestion-list-item {
|
|
214
|
+
> button {
|
|
215
|
+
@include utils.button-reset;
|
|
216
|
+
text-decoration: none;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
209
220
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.str-chat {
|
|
2
|
+
/* The text/icon color of the dropzone container */
|
|
3
|
+
--str-chat__dropzone-container-color: var(--str-chat__on-primary-color);
|
|
4
|
+
|
|
5
|
+
/* The background color of the dropzone container */
|
|
6
|
+
--str-chat__dropzone-container-background-color: var(--str-chat__primary-overlay-color);
|
|
7
|
+
|
|
8
|
+
/* The backdrop filter applied to the dropzone container */
|
|
9
|
+
--str-chat__dropzone-container-backdrop-filter: blur(3px);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.str-chat__dropzone-container {
|
|
13
|
+
background-color: var(--str-chat__dropzone-container-background-color);
|
|
14
|
+
color: var(--str-chat__dropzone-container-color);
|
|
15
|
+
backdrop-filter: var(--str-chat__dropzone-container-backdrop-filter);
|
|
16
|
+
font: var(--str-chat__subtitle-text);
|
|
17
|
+
}
|
|
@@ -46,4 +46,22 @@
|
|
|
46
46
|
@include utils.button-reset;
|
|
47
47
|
cursor: pointer;
|
|
48
48
|
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.str-chat__link-preview-card--loading {
|
|
52
|
+
.str-chat__link-preview-card__content {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
gap: 0.25rem;
|
|
56
|
+
|
|
57
|
+
.str-chat__link-preview-card__content-title {
|
|
58
|
+
height: calc(var(--str-chat__spacing-px) * 16);
|
|
59
|
+
width: 100%
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.str-chat__link-preview-card__content-description {
|
|
63
|
+
height: calc(var(--str-chat__spacing-px) * 12);
|
|
64
|
+
width: 100%;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
49
67
|
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
@use '../utils';
|
|
2
|
+
|
|
3
|
+
.str-chat {
|
|
4
|
+
--str-chat__link-preview-loading-state-color: var(--str-chat__disabled-color);
|
|
5
|
+
}
|
|
6
|
+
|
|
1
7
|
.str-chat__link-preview-card {
|
|
2
8
|
.str-chat__link-preview-card__content {
|
|
3
9
|
border-left: 2px solid var(--str-chat__primary-color);
|
|
@@ -14,4 +20,13 @@
|
|
|
14
20
|
.str-chat__link-preview-card__dismiss-button svg path {
|
|
15
21
|
fill: var(--str-chat__text-low-emphasis-color);
|
|
16
22
|
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.str-chat__link-preview-card--loading {
|
|
26
|
+
.str-chat__link-preview-card__content-title,
|
|
27
|
+
.str-chat__link-preview-card__content-description {
|
|
28
|
+
@include utils.loading-item-background('link-preview');
|
|
29
|
+
@include utils.loading-animation;
|
|
30
|
+
border-radius: calc(var(--str-chat__spacing-px) * 3);
|
|
31
|
+
}
|
|
17
32
|
}
|
|
@@ -120,6 +120,10 @@
|
|
|
120
120
|
grid-template-areas: 'message';
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
&.str-chat__message--blocked {
|
|
124
|
+
grid-template-areas: 'message';
|
|
125
|
+
}
|
|
126
|
+
|
|
123
127
|
&.str-chat__message--system {
|
|
124
128
|
grid-template-areas: 'message';
|
|
125
129
|
grid-template-columns: auto;
|
|
@@ -260,6 +264,10 @@
|
|
|
260
264
|
@include chat-bubble-spacing;
|
|
261
265
|
}
|
|
262
266
|
|
|
267
|
+
.str-chat__message--blocked-inner {
|
|
268
|
+
@include chat-bubble-spacing;
|
|
269
|
+
}
|
|
270
|
+
|
|
263
271
|
.str-chat__quoted-message-bubble {
|
|
264
272
|
@include chat-bubble-spacing;
|
|
265
273
|
display: flex;
|
|
@@ -118,6 +118,30 @@
|
|
|
118
118
|
/* Box shadow applied to a deleted message */
|
|
119
119
|
--str-chat__deleted-message-box-shadow: none;
|
|
120
120
|
|
|
121
|
+
/* The border radius used for the borders of a deleted message */
|
|
122
|
+
--str-chat__blocked-message-border-radius: var(--str-chat__border-radius-md);
|
|
123
|
+
|
|
124
|
+
/* The text/icon of a deleted message */
|
|
125
|
+
--str-chat__blocked-message-color: var(--str-chat__text-low-emphasis-color);
|
|
126
|
+
|
|
127
|
+
/* The background of a deleted message */
|
|
128
|
+
--str-chat__blocked-message-background-color: var(--str-chat__secondary-surface-color);
|
|
129
|
+
|
|
130
|
+
/* Top border of a deleted message */
|
|
131
|
+
--str-chat__blocked-message-border-block-start: none;
|
|
132
|
+
|
|
133
|
+
/* Bottom border of a deleted message */
|
|
134
|
+
--str-chat__blocked-message-border-block-end: none;
|
|
135
|
+
|
|
136
|
+
/* Left (right in RTL layout) border of a deleted message */
|
|
137
|
+
--str-chat__blocked-message-border-inline-start: none;
|
|
138
|
+
|
|
139
|
+
/* Right (left in RTL layout) border of a deleted message */
|
|
140
|
+
--str-chat__blocked-message-border-inline-end: none;
|
|
141
|
+
|
|
142
|
+
/* Box shadow applied to a deleted message */
|
|
143
|
+
--str-chat__blocked-message-box-shadow: none;
|
|
144
|
+
|
|
121
145
|
/* The border radius used for the borders of a system message */
|
|
122
146
|
--str-chat__system-message-border-radius: 0;
|
|
123
147
|
|
|
@@ -214,6 +238,11 @@
|
|
|
214
238
|
font: var(--str-chat__body2-text);
|
|
215
239
|
}
|
|
216
240
|
|
|
241
|
+
.str-chat__message--blocked-inner {
|
|
242
|
+
@include utils.component-layer-overrides('blocked-message');
|
|
243
|
+
font: var(--str-chat__body2-text);
|
|
244
|
+
}
|
|
245
|
+
|
|
217
246
|
&.str-chat__message--me .str-chat__message-bubble {
|
|
218
247
|
color: var(--str-chat__own-message-bubble-color);
|
|
219
248
|
background-color: var(--str-chat__own-message-bubble-background-color);
|
|
@@ -26,19 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.str-chat__dropzone-container {
|
|
30
|
-
@include utils.flex-row-center;
|
|
31
|
-
|
|
32
|
-
position: absolute;
|
|
33
|
-
height: 100%;
|
|
34
|
-
width: 100%;
|
|
35
|
-
z-index: 5;
|
|
36
|
-
|
|
37
|
-
p {
|
|
38
|
-
margin: unset;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
29
|
.str-chat__message-input-inner {
|
|
43
30
|
flex-grow: 1;
|
|
44
31
|
width: 100%;
|
|
@@ -25,15 +25,6 @@
|
|
|
25
25
|
/* Box shadow applied to the component */
|
|
26
26
|
--str-chat__message-input-box-shadow: none;
|
|
27
27
|
|
|
28
|
-
/* The text/icon color of the dropzone container */
|
|
29
|
-
--str-chat__dropzone-container-color: var(--str-chat__on-primary-color);
|
|
30
|
-
|
|
31
|
-
/* The background color of the dropzone container */
|
|
32
|
-
--str-chat__dropzone-container-background-color: var(--str-chat__primary-overlay-color);
|
|
33
|
-
|
|
34
|
-
/* The backdrop filter applied to the dropzone container */
|
|
35
|
-
--str-chat__dropzone-container-backdrop-filter: blur(3px);
|
|
36
|
-
|
|
37
28
|
/* The border radius used for the borders of the textarea */
|
|
38
29
|
--str-chat__message-textarea-border-radius: var(--str-chat__border-radius-md);
|
|
39
30
|
|
|
@@ -179,19 +170,14 @@
|
|
|
179
170
|
--str-chat__attachment-selector-actions-menu-button-icon-color: var(--str-chat__primary-color);
|
|
180
171
|
|
|
181
172
|
/* Color applied to an attachment selector menu item icon when hovered over or focused */
|
|
182
|
-
--str-chat__attachment-selector-actions-menu-button-icon-color-active: var(
|
|
173
|
+
--str-chat__attachment-selector-actions-menu-button-icon-color-active: var(
|
|
174
|
+
--str-chat__primary-color
|
|
175
|
+
);
|
|
183
176
|
}
|
|
184
177
|
|
|
185
178
|
.str-chat__message-input {
|
|
186
179
|
@include utils.component-layer-overrides('message-input');
|
|
187
180
|
|
|
188
|
-
.str-chat__dropzone-container {
|
|
189
|
-
background-color: var(--str-chat__dropzone-container-background-color);
|
|
190
|
-
color: var(--str-chat__dropzone-container-color);
|
|
191
|
-
backdrop-filter: var(--str-chat__dropzone-container-backdrop-filter);
|
|
192
|
-
font: var(--str-chat__subtitle-text);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
181
|
.str-chat__file-input-container {
|
|
196
182
|
--str-chat-icon-color: var(--str-chat__message-input-tools-color);
|
|
197
183
|
@include utils.component-layer-overrides('message-input-tools');
|
|
@@ -326,11 +312,14 @@
|
|
|
326
312
|
background-color: var(--str-chat__attachment-selector-actions-menu-button-icon-color);
|
|
327
313
|
}
|
|
328
314
|
|
|
329
|
-
&:hover,
|
|
315
|
+
&:hover,
|
|
316
|
+
&:focus {
|
|
330
317
|
color: var(--str-chat__text-color);
|
|
331
318
|
|
|
332
319
|
.str-chat__dialog-menu__button-icon {
|
|
333
|
-
background-color: var(
|
|
320
|
+
background-color: var(
|
|
321
|
+
--str-chat__attachment-selector-actions-menu-button-icon-color-active
|
|
322
|
+
);
|
|
334
323
|
}
|
|
335
324
|
}
|
|
336
325
|
}
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
@use 'common/CTAButton/CTAButton-layout';
|
|
17
17
|
@use 'common/CircleFAButton/CircleFAButton-layout';
|
|
18
18
|
@use 'Dialog/Dialog-layout';
|
|
19
|
-
@use 'DragAndDropContainer/
|
|
19
|
+
@use 'DragAndDropContainer/DragAndDropContainer-layout';
|
|
20
|
+
@use 'DropzoneContainer/DropzoneContainer-layout';
|
|
20
21
|
@use 'EditMessageForm/EditMessageForm-layout';
|
|
21
22
|
@use 'Form/Form-layout';
|
|
22
23
|
@use 'ImageCarousel/ImageCarousel-layout';
|
package/dist/scss/v2/index.scss
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
@use 'ChannelSearch/ChannelSearch-theme';
|
|
20
20
|
@use 'Dialog/Dialog-theme';
|
|
21
21
|
@use 'DragAndDropContainer/DragAndDropContainer-theme';
|
|
22
|
+
@use 'DropzoneContainer/DropzoneContainer-theme';
|
|
22
23
|
@use 'EditMessageForm/EditMessageForm-theme';
|
|
23
24
|
@use 'Form/Form-theme';
|
|
24
25
|
@use 'Icon/Icon-theme';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface DefaultChannelData {
|
|
2
|
+
image?: string;
|
|
3
|
+
name?: string;
|
|
4
|
+
subtitle?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface DefaultAttachmentData {
|
|
7
|
+
}
|
|
8
|
+
export interface DefaultCommandData {
|
|
9
|
+
}
|
|
10
|
+
export interface DefaultEventData {
|
|
11
|
+
}
|
|
12
|
+
export interface DefaultMemberData {
|
|
13
|
+
}
|
|
14
|
+
export interface DefaultMessageData {
|
|
15
|
+
}
|
|
16
|
+
export interface DefaultPollOptionData {
|
|
17
|
+
}
|
|
18
|
+
export interface DefaultPollData {
|
|
19
|
+
}
|
|
20
|
+
export interface DefaultReactionData {
|
|
21
|
+
}
|
|
22
|
+
export interface DefaultUserData {
|
|
23
|
+
}
|
|
24
|
+
export interface DefaultThreadData {
|
|
25
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { ChannelUnreadUiState } from './types';
|
|
2
|
+
export type * from './defaultDataInterfaces';
|