stream-chat-react 8.0.0 → 8.1.2
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/dist/browser.full-bundle.js +1841 -640
- package/dist/browser.full-bundle.js.map +1 -1
- package/dist/browser.full-bundle.min.js +4 -4
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/components/Attachment/AttachmentActions.d.ts +0 -1
- package/dist/components/Attachment/AttachmentActions.d.ts.map +1 -1
- package/dist/components/Attachment/Audio.d.ts +0 -1
- package/dist/components/Attachment/Audio.d.ts.map +1 -1
- package/dist/components/Attachment/FileAttachment.d.ts +0 -1
- package/dist/components/Attachment/FileAttachment.d.ts.map +1 -1
- package/dist/components/AutoCompleteTextarea/Item.d.ts.map +1 -1
- package/dist/components/AutoCompleteTextarea/Item.js +2 -1
- package/dist/components/AutoCompleteTextarea/List.d.ts.map +1 -1
- package/dist/components/AutoCompleteTextarea/Textarea.d.ts.map +1 -1
- package/dist/components/AutoCompleteTextarea/Textarea.js +1 -1
- package/dist/components/Channel/Channel.d.ts.map +1 -1
- package/dist/components/Channel/Channel.js +107 -32
- package/dist/components/Channel/channelState.d.ts +17 -0
- package/dist/components/Channel/channelState.d.ts.map +1 -1
- package/dist/components/Channel/channelState.js +24 -2
- package/dist/components/Channel/hooks/useCreateChannelStateContext.d.ts.map +1 -1
- package/dist/components/Channel/hooks/useCreateChannelStateContext.js +7 -1
- package/dist/components/Channel/hooks/useIsMounted.d.ts +0 -1
- package/dist/components/Channel/hooks/useIsMounted.d.ts.map +1 -1
- package/dist/components/Channel/utils.d.ts +5 -0
- package/dist/components/Channel/utils.d.ts.map +1 -0
- package/dist/components/Channel/utils.js +19 -0
- package/dist/components/ChannelHeader/icons.d.ts +0 -1
- package/dist/components/ChannelHeader/icons.d.ts.map +1 -1
- package/dist/components/ChannelHeader/icons.js +1 -1
- package/dist/components/ChannelList/ChannelList.d.ts +2 -3
- package/dist/components/ChannelList/ChannelList.d.ts.map +1 -1
- package/dist/components/ChannelList/ChannelList.js +1 -0
- package/dist/components/ChannelList/hooks/useChannelDeletedListener.d.ts +0 -1
- package/dist/components/ChannelList/hooks/useChannelDeletedListener.d.ts.map +1 -1
- package/dist/components/ChannelList/hooks/useChannelHiddenListener.d.ts +0 -1
- package/dist/components/ChannelList/hooks/useChannelHiddenListener.d.ts.map +1 -1
- package/dist/components/ChannelList/hooks/useChannelTruncatedListener.d.ts +0 -1
- package/dist/components/ChannelList/hooks/useChannelTruncatedListener.d.ts.map +1 -1
- package/dist/components/ChannelList/hooks/useChannelUpdatedListener.d.ts +0 -1
- package/dist/components/ChannelList/hooks/useChannelUpdatedListener.d.ts.map +1 -1
- package/dist/components/ChannelList/hooks/useChannelVisibleListener.d.ts +0 -1
- package/dist/components/ChannelList/hooks/useChannelVisibleListener.d.ts.map +1 -1
- package/dist/components/ChannelList/hooks/useMessageNewListener.d.ts +0 -1
- package/dist/components/ChannelList/hooks/useMessageNewListener.d.ts.map +1 -1
- package/dist/components/ChannelList/hooks/useNotificationAddedToChannelListener.d.ts +0 -1
- package/dist/components/ChannelList/hooks/useNotificationAddedToChannelListener.d.ts.map +1 -1
- package/dist/components/ChannelList/hooks/useNotificationMessageNewListener.d.ts +0 -1
- package/dist/components/ChannelList/hooks/useNotificationMessageNewListener.d.ts.map +1 -1
- package/dist/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.d.ts +0 -1
- package/dist/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.d.ts.map +1 -1
- package/dist/components/ChannelList/hooks/usePaginatedChannels.d.ts +0 -1
- package/dist/components/ChannelList/hooks/usePaginatedChannels.d.ts.map +1 -1
- package/dist/components/ChannelList/hooks/useUserPresenceChangedListener.d.ts +0 -1
- package/dist/components/ChannelList/hooks/useUserPresenceChangedListener.d.ts.map +1 -1
- package/dist/components/ChannelPreview/ChannelPreview.d.ts.map +1 -1
- package/dist/components/ChannelPreview/ChannelPreview.js +6 -10
- package/dist/components/ChannelPreview/ChannelPreviewMessenger.d.ts +0 -1
- package/dist/components/ChannelPreview/ChannelPreviewMessenger.d.ts.map +1 -1
- package/dist/components/ChannelPreview/utils.d.ts +0 -1
- package/dist/components/ChannelPreview/utils.d.ts.map +1 -1
- package/dist/components/Chat/Chat.d.ts.map +1 -1
- package/dist/components/Chat/Chat.js +2 -1
- package/dist/components/Chat/hooks/useChat.d.ts +1 -1
- package/dist/components/Chat/hooks/useChat.d.ts.map +1 -1
- package/dist/components/Chat/hooks/useChat.js +12 -7
- package/dist/components/Chat/hooks/useCreateChatContext.d.ts.map +1 -1
- package/dist/components/Chat/hooks/useCreateChatContext.js +2 -1
- package/dist/components/ChatDown/ChatDown.d.ts +5 -5
- package/dist/components/ChatDown/ChatDown.d.ts.map +1 -1
- package/dist/components/ChatDown/ChatDown.js +4 -4
- package/dist/components/ChatDown/icons.d.ts +2 -0
- package/dist/components/ChatDown/icons.d.ts.map +1 -0
- package/dist/components/ChatDown/icons.js +7 -0
- package/dist/components/DateSeparator/DateSeparator.d.ts +0 -1
- package/dist/components/DateSeparator/DateSeparator.d.ts.map +1 -1
- package/dist/components/Gallery/Gallery.d.ts +0 -1
- package/dist/components/Gallery/Gallery.d.ts.map +1 -1
- package/dist/components/Gallery/Gallery.js +11 -8
- package/dist/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +2 -2
- package/dist/components/InfiniteScrollPaginator/InfiniteScroll.d.ts.map +1 -1
- package/dist/components/InfiniteScrollPaginator/InfiniteScroll.js +16 -45
- package/dist/components/InfiniteScrollPaginator/index.d.ts +0 -2
- package/dist/components/InfiniteScrollPaginator/index.d.ts.map +1 -1
- package/dist/components/InfiniteScrollPaginator/index.js +0 -2
- package/dist/components/Message/FixedHeightMessage.d.ts +0 -1
- package/dist/components/Message/FixedHeightMessage.d.ts.map +1 -1
- package/dist/components/Message/Message.d.ts +0 -1
- package/dist/components/Message/Message.d.ts.map +1 -1
- package/dist/components/Message/Message.js +8 -7
- package/dist/components/Message/MessageCommerce.d.ts +0 -1
- package/dist/components/Message/MessageCommerce.d.ts.map +1 -1
- package/dist/components/Message/MessageCommerce.js +2 -1
- package/dist/components/Message/MessageDeleted.d.ts +0 -1
- package/dist/components/Message/MessageDeleted.d.ts.map +1 -1
- package/dist/components/Message/MessageLivestream.d.ts.map +1 -1
- package/dist/components/Message/MessageLivestream.js +2 -1
- package/dist/components/Message/MessageRepliesCountButton.d.ts.map +1 -1
- package/dist/components/Message/MessageRepliesCountButton.js +10 -24
- package/dist/components/Message/MessageSimple.d.ts +0 -1
- package/dist/components/Message/MessageSimple.d.ts.map +1 -1
- package/dist/components/Message/MessageSimple.js +4 -3
- package/dist/components/Message/MessageTeam.d.ts +0 -1
- package/dist/components/Message/MessageTeam.d.ts.map +1 -1
- package/dist/components/Message/MessageText.d.ts +0 -1
- package/dist/components/Message/MessageText.d.ts.map +1 -1
- package/dist/components/Message/MessageTimestamp.d.ts +0 -1
- package/dist/components/Message/MessageTimestamp.d.ts.map +1 -1
- package/dist/components/Message/QuotedMessage.d.ts +0 -1
- package/dist/components/Message/QuotedMessage.d.ts.map +1 -1
- package/dist/components/Message/QuotedMessage.js +3 -1
- package/dist/components/Message/hooks/useEditHandler.d.ts +0 -1
- package/dist/components/Message/hooks/useEditHandler.d.ts.map +1 -1
- package/dist/components/Message/hooks/useUserHandler.d.ts +0 -1
- package/dist/components/Message/hooks/useUserHandler.d.ts.map +1 -1
- package/dist/components/Message/icons.d.ts +0 -1
- package/dist/components/Message/icons.d.ts.map +1 -1
- package/dist/components/Message/types.d.ts +2 -1
- package/dist/components/Message/types.d.ts.map +1 -1
- package/dist/components/Message/utils.d.ts.map +1 -1
- package/dist/components/Message/utils.js +3 -0
- package/dist/components/MessageActions/MessageActionsBox.d.ts +0 -1
- package/dist/components/MessageActions/MessageActionsBox.d.ts.map +1 -1
- package/dist/components/MessageInput/EditMessageForm.d.ts +0 -1
- package/dist/components/MessageInput/EditMessageForm.d.ts.map +1 -1
- package/dist/components/MessageInput/EmojiPicker.d.ts +0 -1
- package/dist/components/MessageInput/EmojiPicker.d.ts.map +1 -1
- package/dist/components/MessageInput/MessageInputFlat.d.ts +0 -1
- package/dist/components/MessageInput/MessageInputFlat.d.ts.map +1 -1
- package/dist/components/MessageInput/MessageInputFlat.js +25 -3
- package/dist/components/MessageInput/MessageInputSmall.d.ts +0 -1
- package/dist/components/MessageInput/MessageInputSmall.d.ts.map +1 -1
- package/dist/components/MessageInput/MessageInputSmall.js +26 -4
- package/dist/components/MessageInput/QuotedMessagePreview.d.ts +0 -1
- package/dist/components/MessageInput/QuotedMessagePreview.d.ts.map +1 -1
- package/dist/components/MessageInput/UploadsPreview.d.ts +0 -1
- package/dist/components/MessageInput/UploadsPreview.d.ts.map +1 -1
- package/dist/components/MessageInput/hooks/useAttachments.d.ts +0 -1
- package/dist/components/MessageInput/hooks/useAttachments.d.ts.map +1 -1
- package/dist/components/MessageInput/hooks/useCooldownTimer.d.ts.map +1 -1
- package/dist/components/MessageInput/hooks/useCooldownTimer.js +19 -29
- package/dist/components/MessageInput/hooks/useEmojiPicker.d.ts +0 -1
- package/dist/components/MessageInput/hooks/useEmojiPicker.d.ts.map +1 -1
- package/dist/components/MessageInput/hooks/useFileUploads.d.ts +0 -1
- package/dist/components/MessageInput/hooks/useFileUploads.d.ts.map +1 -1
- package/dist/components/MessageInput/hooks/useMessageInputText.d.ts +0 -1
- package/dist/components/MessageInput/hooks/useMessageInputText.d.ts.map +1 -1
- package/dist/components/MessageInput/hooks/useSubmitHandler.d.ts +0 -1
- package/dist/components/MessageInput/hooks/useSubmitHandler.d.ts.map +1 -1
- package/dist/components/MessageList/GiphyPreviewMessage.d.ts +0 -1
- package/dist/components/MessageList/GiphyPreviewMessage.d.ts.map +1 -1
- package/dist/components/MessageList/MessageList.d.ts +8 -3
- package/dist/components/MessageList/MessageList.d.ts.map +1 -1
- package/dist/components/MessageList/MessageList.js +90 -24
- package/dist/components/MessageList/MessageListNotifications.d.ts +1 -0
- package/dist/components/MessageList/MessageListNotifications.d.ts.map +1 -1
- package/dist/components/MessageList/MessageListNotifications.js +2 -2
- package/dist/components/MessageList/VirtualizedMessageList.d.ts +11 -1
- package/dist/components/MessageList/VirtualizedMessageList.d.ts.map +1 -1
- package/dist/components/MessageList/VirtualizedMessageList.js +118 -20
- package/dist/components/MessageList/hooks/index.d.ts +0 -1
- package/dist/components/MessageList/hooks/index.d.ts.map +1 -1
- package/dist/components/MessageList/hooks/index.js +0 -1
- package/dist/components/MessageList/hooks/useEnrichedMessages.d.ts +0 -1
- package/dist/components/MessageList/hooks/useEnrichedMessages.d.ts.map +1 -1
- package/dist/components/MessageList/hooks/useEnrichedMessages.js +4 -4
- package/dist/components/MessageList/hooks/useGiphyPreview.d.ts +0 -1
- package/dist/components/MessageList/hooks/useGiphyPreview.d.ts.map +1 -1
- package/dist/components/MessageList/hooks/useMessageListElements.d.ts.map +1 -1
- package/dist/components/MessageList/hooks/useMessageListElements.js +6 -3
- package/dist/components/MessageList/hooks/useNewMessageNotification.d.ts +1 -2
- package/dist/components/MessageList/hooks/useNewMessageNotification.d.ts.map +1 -1
- package/dist/components/MessageList/hooks/useNewMessageNotification.js +6 -2
- package/dist/components/MessageList/hooks/usePrependMessagesCount.d.ts.map +1 -1
- package/dist/components/MessageList/hooks/usePrependMessagesCount.js +2 -0
- package/dist/components/MessageList/hooks/useScrollLocationLogic.d.ts +2 -0
- package/dist/components/MessageList/hooks/useScrollLocationLogic.d.ts.map +1 -1
- package/dist/components/MessageList/hooks/useScrollLocationLogic.js +9 -5
- package/dist/components/MessageList/utils.d.ts +25 -6
- package/dist/components/MessageList/utils.d.ts.map +1 -1
- package/dist/components/MessageList/utils.js +57 -35
- package/dist/components/Reactions/ReactionsList.d.ts +0 -1
- package/dist/components/Reactions/ReactionsList.d.ts.map +1 -1
- package/dist/components/Reactions/utils/utils.d.ts +0 -1
- package/dist/components/Reactions/utils/utils.d.ts.map +1 -1
- package/dist/components/Thread/Thread.d.ts +2 -0
- package/dist/components/Thread/Thread.d.ts.map +1 -1
- package/dist/components/Thread/Thread.js +6 -10
- package/dist/constants/messageTypes.d.ts +5 -0
- package/dist/constants/messageTypes.d.ts.map +1 -0
- package/dist/constants/messageTypes.js +4 -0
- package/dist/context/ChannelActionContext.d.ts +3 -0
- package/dist/context/ChannelActionContext.d.ts.map +1 -1
- package/dist/context/ChannelStateContext.d.ts +5 -1
- package/dist/context/ChannelStateContext.d.ts.map +1 -1
- package/dist/context/ChatContext.d.ts +3 -0
- package/dist/context/ChatContext.d.ts.map +1 -1
- package/dist/context/MessageContext.d.ts +2 -0
- package/dist/context/MessageContext.d.ts.map +1 -1
- package/dist/context/utils/getDisplayName.d.ts +0 -1
- package/dist/context/utils/getDisplayName.d.ts.map +1 -1
- package/dist/css/index.css +1 -1
- package/dist/i18n/Streami18n.d.ts +5 -4
- package/dist/i18n/Streami18n.d.ts.map +1 -1
- package/dist/i18n/Streami18n.js +5 -5
- package/dist/i18n/de.json +29 -28
- package/dist/i18n/en.json +3 -2
- package/dist/i18n/es.json +4 -2
- package/dist/i18n/fr.json +4 -2
- package/dist/i18n/hi.json +3 -2
- package/dist/i18n/it.json +4 -2
- package/dist/i18n/ja.json +3 -2
- package/dist/i18n/ko.json +3 -2
- package/dist/i18n/nl.json +3 -2
- package/dist/i18n/pt.json +22 -20
- package/dist/i18n/ru.json +5 -2
- package/dist/i18n/tr.json +3 -2
- package/dist/index.cjs.js +552 -316
- package/dist/index.cjs.js.map +1 -1
- package/dist/scss/ActionsBox.scss +2 -2
- package/dist/scss/Attachment.scss +5 -0
- package/dist/scss/Avatar.scss +1 -1
- package/dist/scss/ChannelHeader.scss +8 -13
- package/dist/scss/ChannelList.scss +6 -0
- package/dist/scss/ChannelSearch.scss +12 -1
- package/dist/scss/Gallery.scss +19 -0
- package/dist/scss/Message.scss +110 -93
- package/dist/scss/MessageInput.scss +8 -2
- package/dist/scss/MessageInputFlat.scss +24 -0
- package/dist/scss/MessageList.scss +7 -0
- package/dist/scss/MessageNotification.scss +6 -18
- package/dist/scss/ReactionList.scss +2 -1
- package/dist/scss/ReactionSelector.scss +2 -1
- package/dist/scss/SimpleReactionsList.scss +2 -1
- package/dist/scss/SmallMessageInput.scss +34 -0
- package/dist/scss/Thread.scss +25 -5
- package/dist/scss/VirtualMessage.scss +6 -0
- package/dist/scss/_base.scss +4 -0
- package/dist/scss/_variables.scss +4 -5
- package/dist/stories/connected-user.stories.d.ts +4 -0
- package/dist/stories/connected-user.stories.d.ts.map +1 -0
- package/dist/stories/connected-user.stories.js +53 -0
- package/dist/stories/hello.stories.d.ts +3 -0
- package/dist/stories/hello.stories.d.ts.map +1 -0
- package/dist/stories/hello.stories.js +23 -0
- package/dist/stories/jump-to-message.stories.d.ts +4 -0
- package/dist/stories/jump-to-message.stories.d.ts.map +1 -0
- package/dist/stories/jump-to-message.stories.js +81 -0
- package/dist/stories/mark-read.stories.d.ts +4 -0
- package/dist/stories/mark-read.stories.d.ts.map +1 -0
- package/dist/stories/mark-read.stories.js +75 -0
- package/dist/stories/utils.d.ts +26 -0
- package/dist/stories/utils.d.ts.map +1 -0
- package/dist/stories/utils.js +38 -0
- package/dist/types/types.d.ts +17 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +28 -15
- package/dist/assets/str-chat__alert.svg +0 -1
- package/dist/assets/str-chat__connection-error.svg +0 -13
- package/dist/assets/str-chat__file-file.svg +0 -20
- package/dist/assets/str-chat__icon-chevron-down.svg +0 -1
- package/dist/assets/str-chat__icon-search.svg +0 -1
- package/dist/assets/str-chat__icon-send.svg +0 -1
- package/dist/assets/str-chat__icon-sprite.png +0 -0
- package/dist/assets/str-chat__icon-sprite@1x.png +0 -0
- package/dist/assets/str-chat__icon-sprite@2x.png +0 -0
- package/dist/assets/str-chat__icon-sprite@3x.png +0 -0
- package/dist/assets/str-chat__loading-indicator.svg +0 -23
- package/dist/assets/str-chat__reactions-sprite@1x.png +0 -0
- package/dist/assets/str-chat__reactions-sprite@2x.png +0 -0
- package/dist/assets/str-chat__reactions-sprite@3x.png +0 -0
- package/dist/components/InfiniteScrollPaginator/InfiniteScrollPaginator.d.ts +0 -18
- package/dist/components/InfiniteScrollPaginator/InfiniteScrollPaginator.d.ts.map +0 -1
- package/dist/components/InfiniteScrollPaginator/InfiniteScrollPaginator.js +0 -8
- package/dist/components/InfiniteScrollPaginator/ReverseInfiniteScroll.d.ts +0 -4
- package/dist/components/InfiniteScrollPaginator/ReverseInfiniteScroll.d.ts.map +0 -1
- package/dist/components/InfiniteScrollPaginator/ReverseInfiniteScroll.js +0 -14
- package/dist/components/MessageList/hooks/useCallLoadMore.d.ts +0 -3
- package/dist/components/MessageList/hooks/useCallLoadMore.d.ts.map +0 -1
- package/dist/components/MessageList/hooks/useCallLoadMore.js +0 -8
|
@@ -43,6 +43,8 @@
|
|
|
43
43
|
display: flex;
|
|
44
44
|
text-align: start;
|
|
45
45
|
align-items: flex-end;
|
|
46
|
+
word-break: break-all;
|
|
47
|
+
word-wrap: break-word;
|
|
46
48
|
|
|
47
49
|
.str-chat__message-attachment {
|
|
48
50
|
margin: 0;
|
|
@@ -108,6 +110,10 @@
|
|
|
108
110
|
|
|
109
111
|
.str-chat__textarea {
|
|
110
112
|
flex: 1;
|
|
113
|
+
|
|
114
|
+
&.str-chat-angular__textarea {
|
|
115
|
+
position: relative;
|
|
116
|
+
}
|
|
111
117
|
}
|
|
112
118
|
|
|
113
119
|
.str-chat__textarea > textarea {
|
|
@@ -133,6 +139,13 @@
|
|
|
133
139
|
background: var(--white);
|
|
134
140
|
}
|
|
135
141
|
|
|
142
|
+
.str-chat-angular__cooldown {
|
|
143
|
+
position: absolute;
|
|
144
|
+
top: 50%;
|
|
145
|
+
transform: translateY(-50%);
|
|
146
|
+
left: 25px;
|
|
147
|
+
}
|
|
148
|
+
|
|
136
149
|
&-emojiselect {
|
|
137
150
|
position: absolute;
|
|
138
151
|
top: calc(100% - 45px);
|
|
@@ -142,6 +155,13 @@
|
|
|
142
155
|
padding: 0;
|
|
143
156
|
background-color: transparent;
|
|
144
157
|
|
|
158
|
+
&.str-chat-angular__emojiselect {
|
|
159
|
+
max-width: 28px;
|
|
160
|
+
top: 50%;
|
|
161
|
+
transform: translateY(-50%);
|
|
162
|
+
cursor: initial;
|
|
163
|
+
}
|
|
164
|
+
|
|
145
165
|
svg {
|
|
146
166
|
fill: var(--black);
|
|
147
167
|
opacity: 0.5;
|
|
@@ -269,6 +289,10 @@
|
|
|
269
289
|
fill: var(--white);
|
|
270
290
|
}
|
|
271
291
|
}
|
|
292
|
+
|
|
293
|
+
&-quoted .quoted-message-preview-content {
|
|
294
|
+
background: var(--black20);
|
|
295
|
+
}
|
|
272
296
|
}
|
|
273
297
|
|
|
274
298
|
&.commerce {
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
padding: var(--xs-p);
|
|
50
50
|
font-family: var(--second-font);
|
|
51
51
|
text-align: center;
|
|
52
|
+
margin-top: var(--xs-m);
|
|
52
53
|
|
|
53
54
|
&.notification-success {
|
|
54
55
|
background: var(--faded-green);
|
|
@@ -61,6 +62,12 @@
|
|
|
61
62
|
border: 1px solid var(--red);
|
|
62
63
|
color: var(--red);
|
|
63
64
|
}
|
|
65
|
+
|
|
66
|
+
&.notification-info {
|
|
67
|
+
background: var(--faded-blue);
|
|
68
|
+
border: 1px solid var(--blue);
|
|
69
|
+
color: var(--blue);
|
|
70
|
+
}
|
|
64
71
|
}
|
|
65
72
|
|
|
66
73
|
.str-chat__connection-issue {
|
|
@@ -15,35 +15,23 @@
|
|
|
15
15
|
align-self: flex-end;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
&-scroll-
|
|
18
|
+
&-scroll-to-latest {
|
|
19
19
|
cursor: pointer;
|
|
20
|
-
display:
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
align-items: center;
|
|
21
23
|
width: 42px;
|
|
22
24
|
height: 42px;
|
|
23
|
-
background-size: 14px auto;
|
|
24
25
|
border-radius: 50%;
|
|
25
26
|
background: var(--white);
|
|
27
|
+
color: var(--primary-color);
|
|
26
28
|
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
|
|
27
29
|
|
|
28
|
-
&::before {
|
|
29
|
-
position: absolute;
|
|
30
|
-
top: calc(50% - 8px);
|
|
31
|
-
left: calc(50% - 6px);
|
|
32
|
-
transform: rotate(-45deg);
|
|
33
|
-
display: block;
|
|
34
|
-
width: 12px;
|
|
35
|
-
height: 12px;
|
|
36
|
-
content: '';
|
|
37
|
-
border: 2px solid var(--primary-color);
|
|
38
|
-
border-width: 0 0 2px 2px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
30
|
&-unread-count {
|
|
42
31
|
font-size: 10px;
|
|
43
|
-
position: relative;
|
|
44
32
|
left: 50%;
|
|
45
33
|
transform: translateX(-50%);
|
|
46
|
-
bottom:
|
|
34
|
+
bottom: 30px;
|
|
47
35
|
}
|
|
48
36
|
}
|
|
49
37
|
}
|
|
@@ -36,6 +36,20 @@
|
|
|
36
36
|
background-color: transparent;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
.str-chat-angular__emojiselect {
|
|
40
|
+
width: auto;
|
|
41
|
+
height: auto;
|
|
42
|
+
left: 15px;
|
|
43
|
+
max-width: 20px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.str-chat-angular__cooldown {
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 50%;
|
|
49
|
+
transform: translateY(-50%);
|
|
50
|
+
right: 15px;
|
|
51
|
+
}
|
|
52
|
+
|
|
39
53
|
.rfu-file-upload-button {
|
|
40
54
|
bottom: 9px;
|
|
41
55
|
right: 26px;
|
|
@@ -72,6 +86,12 @@
|
|
|
72
86
|
transform-origin: 100% 100%;
|
|
73
87
|
}
|
|
74
88
|
|
|
89
|
+
&-has-attachments {
|
|
90
|
+
.str-chat__send-button {
|
|
91
|
+
display: block;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
75
95
|
&--send-button {
|
|
76
96
|
background: none;
|
|
77
97
|
border: none;
|
|
@@ -95,11 +115,25 @@
|
|
|
95
115
|
font-size: var(--sm-font);
|
|
96
116
|
padding: 10px 44px 8px 8px;
|
|
97
117
|
|
|
118
|
+
&.str-chat__angular-textarea {
|
|
119
|
+
padding: 10px 35px 8px;
|
|
120
|
+
}
|
|
121
|
+
|
|
98
122
|
&:focus {
|
|
99
123
|
height: 36px;
|
|
100
124
|
}
|
|
101
125
|
}
|
|
102
126
|
|
|
127
|
+
.str-chat-angular__textarea {
|
|
128
|
+
position: relative;
|
|
129
|
+
|
|
130
|
+
+ .str-chat__fileupload-wrapper {
|
|
131
|
+
.rfu-file-upload-button {
|
|
132
|
+
right: 15px;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
103
137
|
.str-chat__emojisearch {
|
|
104
138
|
bottom: 100%;
|
|
105
139
|
}
|
package/dist/scss/Thread.scss
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
flex: 1 0 300px;
|
|
4
4
|
min-width: 300px;
|
|
5
5
|
max-width: 300px;
|
|
6
|
-
overflow-y: hidden;
|
|
7
6
|
font-family: var(--second-font);
|
|
8
7
|
overflow: hidden;
|
|
9
8
|
max-height: 100%;
|
|
@@ -62,11 +61,18 @@
|
|
|
62
61
|
.str-chat__message:first-of-type .str-chat__message-inner {
|
|
63
62
|
margin-left: unset;
|
|
64
63
|
margin-right: unset;
|
|
64
|
+
width: 100%;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
.str-chat__message-attachment.str-chat__message-attachment
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
.str-chat__message-attachment.str-chat__message-attachment {
|
|
68
|
+
&--file {
|
|
69
|
+
border-radius: var(--border-radius-md);
|
|
70
|
+
border-bottom: 1px solid var(--grey-whisper);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&--media {
|
|
74
|
+
width: 100%;
|
|
75
|
+
}
|
|
70
76
|
}
|
|
71
77
|
|
|
72
78
|
.quoted-message {
|
|
@@ -207,7 +213,8 @@
|
|
|
207
213
|
background: var(--white5);
|
|
208
214
|
|
|
209
215
|
&-header {
|
|
210
|
-
background: var(--
|
|
216
|
+
background: var(--dark-grey);
|
|
217
|
+
|
|
211
218
|
box-shadow: 0 7px 9px 0 var(--black5), 0 1px 0 0 var(--black5);
|
|
212
219
|
color: var(--white);
|
|
213
220
|
}
|
|
@@ -224,6 +231,11 @@
|
|
|
224
231
|
}
|
|
225
232
|
}
|
|
226
233
|
}
|
|
234
|
+
|
|
235
|
+
/** Quoted message preview in thread should not be squeezed to less than 100% for better readability */
|
|
236
|
+
.str-chat__input-flat-quoted .quoted-message-preview-content {
|
|
237
|
+
max-width: 100%;
|
|
238
|
+
}
|
|
227
239
|
}
|
|
228
240
|
|
|
229
241
|
.team {
|
|
@@ -304,3 +316,11 @@
|
|
|
304
316
|
}
|
|
305
317
|
}
|
|
306
318
|
}
|
|
319
|
+
|
|
320
|
+
.dark.str-chat.messaging {
|
|
321
|
+
.str-chat__thread-list {
|
|
322
|
+
.quoted-message-inner {
|
|
323
|
+
background: var(--dark-grey);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
display: flex;
|
|
74
74
|
align-items: flex-end;
|
|
75
75
|
margin-bottom: var(--xxs-m);
|
|
76
|
+
cursor: pointer;
|
|
76
77
|
|
|
77
78
|
&-inner {
|
|
78
79
|
display: flex;
|
|
@@ -197,6 +198,11 @@
|
|
|
197
198
|
position: relative;
|
|
198
199
|
cursor: pointer;
|
|
199
200
|
|
|
201
|
+
button {
|
|
202
|
+
border: none;
|
|
203
|
+
background: transparent;
|
|
204
|
+
}
|
|
205
|
+
|
|
200
206
|
svg {
|
|
201
207
|
fill: var(--black);
|
|
202
208
|
opacity: 0.5;
|
package/dist/scss/_base.scss
CHANGED
|
@@ -18,7 +18,7 @@ $border-color: #00000014;
|
|
|
18
18
|
|
|
19
19
|
$black: #000000;
|
|
20
20
|
$white: #ffffff;
|
|
21
|
-
$grey: #
|
|
21
|
+
$grey: #7a7a7a;
|
|
22
22
|
$darken-grey: #343434;
|
|
23
23
|
$lighten-black: #808080;
|
|
24
24
|
$lighten-grey: #858585;
|
|
@@ -54,6 +54,8 @@ $border-radius: 16px;
|
|
|
54
54
|
--magenta: #{$primary-color};
|
|
55
55
|
--red: #ff0000;
|
|
56
56
|
--faded-red: #d0021b1a;
|
|
57
|
+
--blue: #026afa;
|
|
58
|
+
--faded-blue: #cfe3ff;
|
|
57
59
|
|
|
58
60
|
--dt-bg-team: #{$dt-bg-team};
|
|
59
61
|
|
|
@@ -64,7 +66,7 @@ $border-radius: 16px;
|
|
|
64
66
|
--lighten-grey: #{$lighten-grey};
|
|
65
67
|
|
|
66
68
|
--light-grey: #ebebeb;
|
|
67
|
-
--grey: #{$
|
|
69
|
+
--grey: #{$grey};
|
|
68
70
|
--dark-grey: #{$darken-grey};
|
|
69
71
|
|
|
70
72
|
--green: #28ca42;
|
|
@@ -136,12 +138,10 @@ $border-radius: 16px;
|
|
|
136
138
|
|
|
137
139
|
--bg-gradient-end: #f7f7f7;
|
|
138
140
|
--bg-gradient-start: #fcfcfc;
|
|
139
|
-
--black: #000000;
|
|
140
141
|
--blue-alice: #e9f2ff;
|
|
141
142
|
--border: #00000014; // 14 = 8% opacity; top: x=0, y=-1; bottom: x=0, y=1
|
|
142
143
|
--button-background: #ffffff;
|
|
143
144
|
--button-text: #005fff;
|
|
144
|
-
--grey: #7a7a7a;
|
|
145
145
|
--grey-gainsboro: #dbdbdb;
|
|
146
146
|
--grey-whisper: #ecebeb;
|
|
147
147
|
--highlight: #fbf4dd;
|
|
@@ -151,7 +151,6 @@ $border-radius: 16px;
|
|
|
151
151
|
--shadow-icon: #00000040; // 40 = 25% opacity; x=0, y=0, radius=4
|
|
152
152
|
--targetedMessageBackground: #fbf4dd; // dark mode = #302D22
|
|
153
153
|
--transparent: transparent;
|
|
154
|
-
--white: #ffffff;
|
|
155
154
|
--white-smoke: #f2f2f2;
|
|
156
155
|
--white-snow: #fcfcfc;
|
|
157
156
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connected-user.stories.d.ts","sourceRoot":"","sources":["../../src/stories/connected-user.stories.tsx"],"names":[],"mappings":"AACA,OAAO,+CAA+C,CAAC;AAwDvD,eAAO,MAAM,KAAK,mBAUjB,CAAC;AAEF,eAAO,MAAM,KAAK,mBAUjB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import '@stream-io/stream-chat-css/dist/css/index.css';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Channel, ChannelHeader, ChannelList, MessageList, useChannelStateContext, Window, } from '../index';
|
|
5
|
+
import { ConnectedUser } from './utils';
|
|
6
|
+
var channelId = import.meta.env.E2E_ADD_MESSAGE_CHANNEL;
|
|
7
|
+
if (!channelId || typeof channelId !== 'string') {
|
|
8
|
+
throw new Error('expected ADD_MESSAGE_CHANNEL');
|
|
9
|
+
}
|
|
10
|
+
var Controls = function () {
|
|
11
|
+
var channel = useChannelStateContext().channel;
|
|
12
|
+
return (React.createElement("div", null,
|
|
13
|
+
React.createElement("button", { "data-testid": 'truncate', onClick: function () { return channel.truncate(); } }, "Truncate"),
|
|
14
|
+
React.createElement("button", { "data-testid": 'add-message', onClick: function () {
|
|
15
|
+
return channel.sendMessage({
|
|
16
|
+
text: 'Hello world!',
|
|
17
|
+
});
|
|
18
|
+
} }, "Add message")));
|
|
19
|
+
};
|
|
20
|
+
// Sort in reverse order to avoid auto-selecting unread channel
|
|
21
|
+
var sort = { last_updated: 1 };
|
|
22
|
+
var WrappedConnectedUser = function (_a) {
|
|
23
|
+
var token = _a.token, userId = _a.userId;
|
|
24
|
+
return (React.createElement(ConnectedUser, { token: token, userId: userId },
|
|
25
|
+
React.createElement(ChannelList, { filters: { members: { $in: [userId] } }, sort: sort }),
|
|
26
|
+
React.createElement(Channel, null,
|
|
27
|
+
React.createElement(Window, null,
|
|
28
|
+
React.createElement(ChannelHeader, null),
|
|
29
|
+
React.createElement(MessageList, null),
|
|
30
|
+
React.createElement(Controls, null)))));
|
|
31
|
+
};
|
|
32
|
+
export var User1 = function () {
|
|
33
|
+
var userId = import.meta.env.E2E_TEST_USER_1;
|
|
34
|
+
var token = import.meta.env.E2E_TEST_USER_1_TOKEN;
|
|
35
|
+
if (!userId || typeof userId !== 'string') {
|
|
36
|
+
throw new Error('expected TEST_USER_1');
|
|
37
|
+
}
|
|
38
|
+
if (!token || typeof token !== 'string') {
|
|
39
|
+
throw new Error('expected TEST_USER_1_TOKEN');
|
|
40
|
+
}
|
|
41
|
+
return React.createElement(WrappedConnectedUser, { token: token, userId: userId });
|
|
42
|
+
};
|
|
43
|
+
export var User2 = function () {
|
|
44
|
+
var userId = import.meta.env.E2E_TEST_USER_2;
|
|
45
|
+
var token = import.meta.env.E2E_TEST_USER_2_TOKEN;
|
|
46
|
+
if (!userId || typeof userId !== 'string') {
|
|
47
|
+
throw new Error('expected TEST_USER_2');
|
|
48
|
+
}
|
|
49
|
+
if (!token || typeof token !== 'string') {
|
|
50
|
+
throw new Error('expected TEST_USER_2_TOKEN');
|
|
51
|
+
}
|
|
52
|
+
return React.createElement(WrappedConnectedUser, { token: token, userId: userId });
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hello.stories.d.ts","sourceRoot":"","sources":["../../src/stories/hello.stories.tsx"],"names":[],"mappings":"AACA,OAAO,+CAA+C,CAAC;AA2BvD,eAAO,MAAM,UAAU,mBAYtB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import '@stream-io/stream-chat-css/dist/css/index.css';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Channel, ChannelHeader, ChannelList, MessageInput, MessageList, Thread, Window, } from '../index';
|
|
5
|
+
import { ConnectedUser } from './utils';
|
|
6
|
+
var channelId = import.meta.env.E2E_ADD_MESSAGE_CHANNEL;
|
|
7
|
+
var userId = import.meta.env.E2E_TEST_USER_1;
|
|
8
|
+
var token = import.meta.env.E2E_TEST_USER_1_TOKEN;
|
|
9
|
+
if (!channelId || typeof channelId !== 'string') {
|
|
10
|
+
throw new Error('expected ADD_MESSAGE_CHANNEL');
|
|
11
|
+
}
|
|
12
|
+
// Sort in reverse order to avoid auto-selecting unread channel
|
|
13
|
+
var sort = { last_updated: 1 };
|
|
14
|
+
var filters = { members: { $in: [userId] }, type: 'messaging' };
|
|
15
|
+
var options = { limit: 10, presence: true, state: true };
|
|
16
|
+
export var BasicSetup = function () { return (React.createElement(ConnectedUser, { token: token, userId: userId },
|
|
17
|
+
React.createElement(ChannelList, { filters: filters, options: options, showChannelSearch: true, sort: sort }),
|
|
18
|
+
React.createElement(Channel, null,
|
|
19
|
+
React.createElement(Window, null,
|
|
20
|
+
React.createElement(ChannelHeader, null),
|
|
21
|
+
React.createElement(MessageList, null),
|
|
22
|
+
React.createElement(MessageInput, { focus: true })),
|
|
23
|
+
React.createElement(Thread, null)))); };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jump-to-message.stories.d.ts","sourceRoot":"","sources":["../../src/stories/jump-to-message.stories.tsx"],"names":[],"mappings":"AAWA,OAAO,+CAA+C,CAAC;AA0CvD,eAAO,MAAM,wBAAwB,mBAapC,CAAC;AAEF,eAAO,MAAM,4BAA4B,mBAaxC,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (_) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
38
|
+
import React from 'react';
|
|
39
|
+
import { Channel, ChannelList, MessageList, useChannelActionContext, useChatContext, VirtualizedMessageList, Window, } from '../index';
|
|
40
|
+
import '@stream-io/stream-chat-css/dist/css/index.css';
|
|
41
|
+
import { ConnectedUser } from './utils';
|
|
42
|
+
void MessageList;
|
|
43
|
+
void VirtualizedMessageList;
|
|
44
|
+
var userId = import.meta.env.E2E_TEST_USER_1;
|
|
45
|
+
var userToken = import.meta.env.E2E_TEST_USER_1_TOKEN;
|
|
46
|
+
var channelId = import.meta.env.E2E_JUMP_TO_MESSAGE_CHANNEL;
|
|
47
|
+
var JumpToMessage = function () {
|
|
48
|
+
var jumpToMessage = useChannelActionContext().jumpToMessage;
|
|
49
|
+
var chatClient = useChatContext().client;
|
|
50
|
+
return (React.createElement("button", { "data-testid": 'jump-to-message', onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
51
|
+
var results;
|
|
52
|
+
return __generator(this, function (_a) {
|
|
53
|
+
switch (_a.label) {
|
|
54
|
+
case 0: return [4 /*yield*/, chatClient.search({
|
|
55
|
+
id: { $eq: channelId },
|
|
56
|
+
}, 'Message 29', { limit: 1, offset: 0 })];
|
|
57
|
+
case 1:
|
|
58
|
+
results = _a.sent();
|
|
59
|
+
jumpToMessage(results.results[0].message.id);
|
|
60
|
+
return [2 /*return*/];
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}); } }, "Jump to message '29'"));
|
|
64
|
+
};
|
|
65
|
+
var StyleFix = function () { return (React.createElement("style", null, "\n .str-chat {\n height: 700px\n }\n ")); };
|
|
66
|
+
export var JumpInRegularMessageList = function () { return (React.createElement("div", null,
|
|
67
|
+
React.createElement(StyleFix, null),
|
|
68
|
+
React.createElement(ConnectedUser, { token: userToken, userId: userId },
|
|
69
|
+
React.createElement(ChannelList, { filters: { id: { $eq: channelId } } }),
|
|
70
|
+
React.createElement(Channel, null,
|
|
71
|
+
React.createElement(JumpToMessage, null),
|
|
72
|
+
React.createElement(Window, null,
|
|
73
|
+
React.createElement(MessageList, null)))))); };
|
|
74
|
+
export var JumpInVirtualizedMessageList = function () { return (React.createElement("div", null,
|
|
75
|
+
React.createElement(StyleFix, null),
|
|
76
|
+
React.createElement(ConnectedUser, { token: userToken, userId: userId },
|
|
77
|
+
React.createElement(ChannelList, { filters: { id: { $eq: channelId } } }),
|
|
78
|
+
React.createElement(Channel, null,
|
|
79
|
+
React.createElement(JumpToMessage, null),
|
|
80
|
+
React.createElement(Window, null,
|
|
81
|
+
React.createElement(VirtualizedMessageList, null)))))); };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mark-read.stories.d.ts","sourceRoot":"","sources":["../../src/stories/mark-read.stories.tsx"],"names":[],"mappings":"AACA,OAAO,+CAA+C,CAAC;AA2FvD,eAAO,MAAM,KAAK,mBAUjB,CAAC;AAEF,eAAO,MAAM,KAAK,mBAUjB,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
13
|
+
import '@stream-io/stream-chat-css/dist/css/index.css';
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import { v4 as uuid } from 'uuid';
|
|
16
|
+
import { Channel, ChannelHeader, ChannelList, ChannelPreview, MessageList, useChannelStateContext, Window, } from '../index';
|
|
17
|
+
import { ConnectedUser } from './utils';
|
|
18
|
+
var channelId = import.meta.env.E2E_ADD_MESSAGE_CHANNEL;
|
|
19
|
+
if (!channelId || typeof channelId !== 'string') {
|
|
20
|
+
throw new Error('expected ADD_MESSAGE_CHANNEL');
|
|
21
|
+
}
|
|
22
|
+
var Controls = function () {
|
|
23
|
+
var channel = useChannelStateContext().channel;
|
|
24
|
+
return (React.createElement("div", null,
|
|
25
|
+
React.createElement("button", { "data-testid": 'truncate', onClick: function () { return channel.truncate(); } }, "Truncate"),
|
|
26
|
+
React.createElement("button", { "data-testid": 'add-message', onClick: function () {
|
|
27
|
+
return channel.sendMessage({
|
|
28
|
+
text: uuid(),
|
|
29
|
+
});
|
|
30
|
+
} }, "Add message")));
|
|
31
|
+
};
|
|
32
|
+
// Sort in reverse order to avoid auto-selecting unread channel
|
|
33
|
+
var sort = { last_updated: 1 };
|
|
34
|
+
var CustomPreviewUI = function (_a) {
|
|
35
|
+
var _b, _c;
|
|
36
|
+
var activeChannel = _a.activeChannel, channel = _a.channel, displayTitle = _a.displayTitle, setActiveChannel = _a.setActiveChannel, unread = _a.unread, watchers = _a.watchers;
|
|
37
|
+
var avatarName = displayTitle || ((_c = (_b = channel.state.messages[channel.state.messages.length - 1]) === null || _b === void 0 ? void 0 : _b.user) === null || _c === void 0 ? void 0 : _c.id);
|
|
38
|
+
return (React.createElement("div", { "data-testid": "channel-" + channel.id, onClick: function () { return setActiveChannel === null || setActiveChannel === void 0 ? void 0 : setActiveChannel(channel, watchers); }, style: { background: channel.cid === (activeChannel === null || activeChannel === void 0 ? void 0 : activeChannel.cid) ? '#fff' : 'initial' } },
|
|
39
|
+
React.createElement("span", null, avatarName),
|
|
40
|
+
" || ",
|
|
41
|
+
React.createElement("span", { "data-testid": 'unread-count' }, unread)));
|
|
42
|
+
};
|
|
43
|
+
var CustomPreview = function (props) { return (React.createElement(ChannelPreview, __assign({}, props, { Preview: CustomPreviewUI }))); };
|
|
44
|
+
var WrappedConnectedUser = function (_a) {
|
|
45
|
+
var token = _a.token, userId = _a.userId;
|
|
46
|
+
return (React.createElement(ConnectedUser, { token: token, userId: userId },
|
|
47
|
+
React.createElement(ChannelList, { filters: { members: { $in: [userId] }, name: { $autocomplete: 'mr-channel' } }, Preview: CustomPreview, setActiveChannelOnMount: false, sort: sort }),
|
|
48
|
+
React.createElement(Channel, null,
|
|
49
|
+
React.createElement(Window, null,
|
|
50
|
+
React.createElement(ChannelHeader, null),
|
|
51
|
+
React.createElement(MessageList, null),
|
|
52
|
+
React.createElement(Controls, null)))));
|
|
53
|
+
};
|
|
54
|
+
export var User1 = function () {
|
|
55
|
+
var userId = import.meta.env.E2E_TEST_USER_1;
|
|
56
|
+
var token = import.meta.env.E2E_TEST_USER_1_TOKEN;
|
|
57
|
+
if (!userId || typeof userId !== 'string') {
|
|
58
|
+
throw new Error('expected TEST_USER_1');
|
|
59
|
+
}
|
|
60
|
+
if (!token || typeof token !== 'string') {
|
|
61
|
+
throw new Error('expected TEST_USER_1_TOKEN');
|
|
62
|
+
}
|
|
63
|
+
return React.createElement(WrappedConnectedUser, { token: token, userId: userId });
|
|
64
|
+
};
|
|
65
|
+
export var User2 = function () {
|
|
66
|
+
var userId = import.meta.env.E2E_TEST_USER_2;
|
|
67
|
+
var token = import.meta.env.E2E_TEST_USER_2_TOKEN;
|
|
68
|
+
if (!userId || typeof userId !== 'string') {
|
|
69
|
+
throw new Error('expected TEST_USER_2');
|
|
70
|
+
}
|
|
71
|
+
if (!token || typeof token !== 'string') {
|
|
72
|
+
throw new Error('expected TEST_USER_2_TOKEN');
|
|
73
|
+
}
|
|
74
|
+
return React.createElement(WrappedConnectedUser, { token: token, userId: userId });
|
|
75
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { DefaultGenerics } from 'stream-chat';
|
|
3
|
+
export declare const apiKey: string;
|
|
4
|
+
declare type LocalAttachmentType = Record<string, unknown>;
|
|
5
|
+
declare type LocalChannelType = Record<string, unknown>;
|
|
6
|
+
declare type LocalCommandType = string;
|
|
7
|
+
declare type LocalEventType = Record<string, unknown>;
|
|
8
|
+
declare type LocalMessageType = Record<string, unknown>;
|
|
9
|
+
declare type LocalReactionType = Record<string, unknown>;
|
|
10
|
+
declare type LocalUserType = Record<string, unknown>;
|
|
11
|
+
export declare type StreamChatGenerics = {
|
|
12
|
+
attachmentType: LocalAttachmentType;
|
|
13
|
+
channelType: LocalChannelType;
|
|
14
|
+
commandType: LocalCommandType;
|
|
15
|
+
eventType: LocalEventType;
|
|
16
|
+
messageType: LocalMessageType;
|
|
17
|
+
reactionType: LocalReactionType;
|
|
18
|
+
userType: LocalUserType;
|
|
19
|
+
};
|
|
20
|
+
export declare type ConnectedUserProps = PropsWithChildren<{
|
|
21
|
+
token: string;
|
|
22
|
+
userId: string;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const ConnectedUser: <SCG extends DefaultGenerics = StreamChatGenerics>({ children, token, userId, }: ConnectedUserProps) => JSX.Element;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/stories/utils.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAqB,MAAM,aAAa,CAAC;AAMjE,eAAO,MAAM,MAAM,QAAS,CAAC;AAE7B,aAAK,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACnD,aAAK,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAChD,aAAK,gBAAgB,GAAG,MAAM,CAAC;AAC/B,aAAK,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC9C,aAAK,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAChD,aAAK,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACjD,aAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE7C,oBAAY,kBAAkB,GAAG;IAC/B,cAAc,EAAE,mBAAmB,CAAC;IACpC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,WAAW,EAAE,gBAAgB,CAAC;IAC9B,SAAS,EAAE,cAAc,CAAC;IAC1B,WAAW,EAAE,gBAAgB,CAAC;IAC9B,YAAY,EAAE,iBAAiB,CAAC;IAChC,QAAQ,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF,oBAAY,kBAAkB,GAAG,iBAAiB,CAAC;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH,eAAO,MAAM,aAAa,mFAIvB,kBAAkB,gBA+BpB,CAAC"}
|