sceyt-chat-react-uikit 1.6.8-beta.15 → 1.6.8-beta.16
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/components/Message/Message.types.d.ts +2 -0
- package/components/Message/MessageBody/index.d.ts +3 -1
- package/components/Message/index.d.ts +1 -1
- package/components/Messages/MessageList/index.d.ts +2 -0
- package/components/Messages/index.d.ts +1 -0
- package/index.js +61 -17
- package/index.modern.js +61 -17
- package/messageUtils/index.d.ts +4 -2
- package/package.json +1 -1
|
@@ -57,6 +57,7 @@ interface ICustomMessageItem {
|
|
|
57
57
|
handleScrollToRepliedMessage: (messageId: string) => void;
|
|
58
58
|
handleMediaItemClick?: (attachment: IAttachment) => void;
|
|
59
59
|
isThreadMessage?: boolean;
|
|
60
|
+
handleOpenUserProfile: (user: IUser) => void;
|
|
60
61
|
}
|
|
61
62
|
export interface IMessageProps {
|
|
62
63
|
message: IMessage;
|
|
@@ -187,5 +188,6 @@ export interface IMessageProps {
|
|
|
187
188
|
messageTextFontSize?: string;
|
|
188
189
|
messageTextLineHeight?: string;
|
|
189
190
|
messageTimeColorOnAttachment?: string;
|
|
191
|
+
shouldOpenUserProfileForMention?: boolean;
|
|
190
192
|
}
|
|
191
193
|
export {};
|
|
@@ -125,6 +125,8 @@ interface IMessageBodyProps {
|
|
|
125
125
|
handleReactionAddDelete: (emoji: any) => void;
|
|
126
126
|
handleCreateChat: (user?: IUser) => void;
|
|
127
127
|
messageTextRef: React.RefObject<HTMLSpanElement>;
|
|
128
|
+
handleOpenUserProfile: (user: IUser) => void;
|
|
129
|
+
shouldOpenUserProfileForMention?: boolean;
|
|
128
130
|
}
|
|
129
|
-
declare const _default: React.MemoExoticComponent<({ message, channel, MessageActionsMenu, handleScrollToRepliedMessage, handleMediaItemClick, isPendingMessage, prevMessage, nextMessage, isUnreadMessage, unreadMessageId, isThreadMessage, fontFamily, ownMessageOnRightSide, showSenderNameOnDirectChannel, showSenderNameOnGroupChannel, showSenderNameOnOwnMessages, messageStatusAndTimePosition, messageStatusDisplayingType, outgoingMessageStyles, incomingMessageStyles, ownRepliedMessageBackground, incomingRepliedMessageBackground, showMessageStatus, showMessageTimeAndStatusOnlyOnHover, showMessageTime, showMessageStatusForEachMessage, showMessageTimeForEachMessage, messageReaction, editMessage, copyMessage, replyMessage, replyMessageInThread, deleteMessage, selectMessage, allowEditDeleteIncomingMessage, forwardMessage, reportMessage, reactionIcon, editIcon, copyIcon, replyIcon, replyInThreadIcon, forwardIcon, deleteIcon, selectIcon, starIcon, staredIcon, reportIcon, reactionIconOrder, editIconOrder, copyIconOrder, replyIconOrder, replyInThreadIconOrder, forwardIconOrder, deleteIconOrder, selectIconOrder, starIconOrder, reportIconOrder, reactionIconTooltipText, editIconTooltipText, copyIconTooltipText, replyIconTooltipText, replyInThreadIconTooltipText, forwardIconTooltipText, deleteIconTooltipText, selectIconTooltipText, starIconTooltipText, reportIconTooltipText, messageActionIconsColor, messageStatusSize, messageStatusColor, messageReadStatusColor, messageStateFontSize, messageStateColor, messageTimeFontSize, messageTimeColor, messageStatusAndTimeLineHeight, messageTimeColorOnAttachment, fileAttachmentsIcon, fileAttachmentsBoxWidth, fileAttachmentsBoxBorder, fileAttachmentsTitleColor, fileAttachmentsSizeColor, imageAttachmentMaxWidth, imageAttachmentMaxHeight, videoAttachmentMaxWidth, videoAttachmentMaxHeight, emojisCategoryIconsPosition, emojisContainerBorderRadius, fixEmojiCategoriesTitleOnTop, selectedMessagesMap, contactsMap, theme, messageTextFontSize, messageTextLineHeight, handleToggleForwardMessagePopup, messageActionsShow, closeMessageActions, handleDeletePendingMessage, handleReplyMessage, handleToggleDeleteMessagePopup, handleToggleReportPopupOpen, handleResendMessage, handleOpenEmojis, emojisPopupOpen, setEmojisPopupOpen, emojisPopupPosition, frequentlyEmojisOpen, handleCopyMessage, toggleEditMode, handleSelectMessage, handleMouseEnter, handleMouseLeave, handleReactionAddDelete, handleCreateChat, messageTextRef }: IMessageBodyProps) => React.JSX.Element>;
|
|
131
|
+
declare const _default: React.MemoExoticComponent<({ message, channel, MessageActionsMenu, handleScrollToRepliedMessage, handleMediaItemClick, isPendingMessage, prevMessage, nextMessage, isUnreadMessage, unreadMessageId, isThreadMessage, fontFamily, ownMessageOnRightSide, showSenderNameOnDirectChannel, showSenderNameOnGroupChannel, showSenderNameOnOwnMessages, messageStatusAndTimePosition, messageStatusDisplayingType, outgoingMessageStyles, incomingMessageStyles, ownRepliedMessageBackground, incomingRepliedMessageBackground, showMessageStatus, showMessageTimeAndStatusOnlyOnHover, showMessageTime, showMessageStatusForEachMessage, showMessageTimeForEachMessage, messageReaction, editMessage, copyMessage, replyMessage, replyMessageInThread, deleteMessage, selectMessage, allowEditDeleteIncomingMessage, forwardMessage, reportMessage, reactionIcon, editIcon, copyIcon, replyIcon, replyInThreadIcon, forwardIcon, deleteIcon, selectIcon, starIcon, staredIcon, reportIcon, reactionIconOrder, editIconOrder, copyIconOrder, replyIconOrder, replyInThreadIconOrder, forwardIconOrder, deleteIconOrder, selectIconOrder, starIconOrder, reportIconOrder, reactionIconTooltipText, editIconTooltipText, copyIconTooltipText, replyIconTooltipText, replyInThreadIconTooltipText, forwardIconTooltipText, deleteIconTooltipText, selectIconTooltipText, starIconTooltipText, reportIconTooltipText, messageActionIconsColor, messageStatusSize, messageStatusColor, messageReadStatusColor, messageStateFontSize, messageStateColor, messageTimeFontSize, messageTimeColor, messageStatusAndTimeLineHeight, messageTimeColorOnAttachment, fileAttachmentsIcon, fileAttachmentsBoxWidth, fileAttachmentsBoxBorder, fileAttachmentsTitleColor, fileAttachmentsSizeColor, imageAttachmentMaxWidth, imageAttachmentMaxHeight, videoAttachmentMaxWidth, videoAttachmentMaxHeight, emojisCategoryIconsPosition, emojisContainerBorderRadius, fixEmojiCategoriesTitleOnTop, selectedMessagesMap, contactsMap, theme, messageTextFontSize, messageTextLineHeight, handleToggleForwardMessagePopup, messageActionsShow, closeMessageActions, handleDeletePendingMessage, handleReplyMessage, handleToggleDeleteMessagePopup, handleToggleReportPopupOpen, handleResendMessage, handleOpenEmojis, emojisPopupOpen, setEmojisPopupOpen, emojisPopupPosition, frequentlyEmojisOpen, handleCopyMessage, toggleEditMode, handleSelectMessage, handleMouseEnter, handleMouseLeave, handleReactionAddDelete, handleCreateChat, messageTextRef, handleOpenUserProfile, shouldOpenUserProfileForMention }: IMessageBodyProps) => React.JSX.Element>;
|
|
130
132
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IMessageProps } from './Message.types';
|
|
3
|
-
declare const _default: React.MemoExoticComponent<({ message, channel, MessageActionsMenu, CustomMessageItem, handleScrollToRepliedMessage, handleMediaItemClick, stopScrolling, isPendingMessage, prevMessage, nextMessage, setLastVisibleMessageId, isUnreadMessage, unreadMessageId, isThreadMessage, fontFamily, ownMessageOnRightSide, messageWidthPercent, showSenderNameOnDirectChannel, showSenderNameOnGroupChannel, showSenderNameOnOwnMessages, messageStatusAndTimePosition, messageStatusDisplayingType, outgoingMessageStyles, incomingMessageStyles, ownRepliedMessageBackground, incomingRepliedMessageBackground, showOwnAvatar, showMessageStatus, showMessageTimeAndStatusOnlyOnHover, showMessageTime, showMessageStatusForEachMessage, showMessageTimeForEachMessage, hoverBackground, messageReaction, editMessage, copyMessage, replyMessage, replyMessageInThread, deleteMessage, selectMessage, allowEditDeleteIncomingMessage, forwardMessage, reportMessage, reactionIcon, editIcon, copyIcon, replyIcon, replyInThreadIcon, forwardIcon, deleteIcon, selectIcon, starIcon, staredIcon, reportIcon, reactionIconOrder, openFrequentlyUsedReactions, editIconOrder, copyIconOrder, replyIconOrder, replyInThreadIconOrder, forwardIconOrder, deleteIconOrder, selectIconOrder, starIconOrder, reportIconOrder, reactionIconTooltipText, editIconTooltipText, copyIconTooltipText, replyIconTooltipText, replyInThreadIconTooltipText, forwardIconTooltipText, deleteIconTooltipText, selectIconTooltipText, starIconTooltipText, reportIconTooltipText, messageActionIconsColor, messageStatusSize, messageStatusColor, messageReadStatusColor, messageStateFontSize, messageStateColor, messageTimeFontSize, messageTimeColor, messageStatusAndTimeLineHeight, fileAttachmentsIcon, reactionsDisplayCount, showEachReactionCount, showTotalReactionCount, reactionItemBorder, reactionItemBorderRadius, reactionItemBackground, reactionItemPadding, reactionItemMargin, reactionsFontSize, reactionsContainerBoxShadow, reactionsContainerBorder, reactionsContainerBorderRadius, reactionsContainerBackground, reactionsContainerPadding, reactionsContainerTopPosition, reactionsDetailsPopupBorderRadius, reactionsDetailsPopupHeaderItemsStyle, fileAttachmentsBoxWidth, fileAttachmentsBoxBorder, fileAttachmentsTitleColor, fileAttachmentsSizeColor, imageAttachmentMaxWidth, imageAttachmentMaxHeight, videoAttachmentMaxWidth, videoAttachmentMaxHeight, emojisCategoryIconsPosition, emojisContainerBorderRadius, fixEmojiCategoriesTitleOnTop, sameUserMessageSpacing, differentUserMessageSpacing, selectedMessagesMap, contactsMap, openedMessageMenuId, tabIsActive, connectionStatus, theme, messageTextFontSize, messageTextLineHeight, messageTimeColorOnAttachment }: IMessageProps) => React.JSX.Element>;
|
|
3
|
+
declare const _default: React.MemoExoticComponent<({ message, channel, MessageActionsMenu, CustomMessageItem, handleScrollToRepliedMessage, handleMediaItemClick, stopScrolling, isPendingMessage, prevMessage, nextMessage, setLastVisibleMessageId, isUnreadMessage, unreadMessageId, isThreadMessage, fontFamily, ownMessageOnRightSide, messageWidthPercent, showSenderNameOnDirectChannel, showSenderNameOnGroupChannel, showSenderNameOnOwnMessages, messageStatusAndTimePosition, messageStatusDisplayingType, outgoingMessageStyles, incomingMessageStyles, ownRepliedMessageBackground, incomingRepliedMessageBackground, showOwnAvatar, showMessageStatus, showMessageTimeAndStatusOnlyOnHover, showMessageTime, showMessageStatusForEachMessage, showMessageTimeForEachMessage, hoverBackground, messageReaction, editMessage, copyMessage, replyMessage, replyMessageInThread, deleteMessage, selectMessage, allowEditDeleteIncomingMessage, forwardMessage, reportMessage, reactionIcon, editIcon, copyIcon, replyIcon, replyInThreadIcon, forwardIcon, deleteIcon, selectIcon, starIcon, staredIcon, reportIcon, reactionIconOrder, openFrequentlyUsedReactions, editIconOrder, copyIconOrder, replyIconOrder, replyInThreadIconOrder, forwardIconOrder, deleteIconOrder, selectIconOrder, starIconOrder, reportIconOrder, reactionIconTooltipText, editIconTooltipText, copyIconTooltipText, replyIconTooltipText, replyInThreadIconTooltipText, forwardIconTooltipText, deleteIconTooltipText, selectIconTooltipText, starIconTooltipText, reportIconTooltipText, messageActionIconsColor, messageStatusSize, messageStatusColor, messageReadStatusColor, messageStateFontSize, messageStateColor, messageTimeFontSize, messageTimeColor, messageStatusAndTimeLineHeight, fileAttachmentsIcon, reactionsDisplayCount, showEachReactionCount, showTotalReactionCount, reactionItemBorder, reactionItemBorderRadius, reactionItemBackground, reactionItemPadding, reactionItemMargin, reactionsFontSize, reactionsContainerBoxShadow, reactionsContainerBorder, reactionsContainerBorderRadius, reactionsContainerBackground, reactionsContainerPadding, reactionsContainerTopPosition, reactionsDetailsPopupBorderRadius, reactionsDetailsPopupHeaderItemsStyle, fileAttachmentsBoxWidth, fileAttachmentsBoxBorder, fileAttachmentsTitleColor, fileAttachmentsSizeColor, imageAttachmentMaxWidth, imageAttachmentMaxHeight, videoAttachmentMaxWidth, videoAttachmentMaxHeight, emojisCategoryIconsPosition, emojisContainerBorderRadius, fixEmojiCategoriesTitleOnTop, sameUserMessageSpacing, differentUserMessageSpacing, selectedMessagesMap, contactsMap, openedMessageMenuId, tabIsActive, connectionStatus, theme, messageTextFontSize, messageTextLineHeight, messageTimeColorOnAttachment, shouldOpenUserProfileForMention }: IMessageProps) => React.JSX.Element>;
|
|
4
4
|
export default _default;
|
|
@@ -67,6 +67,7 @@ interface MessagesProps {
|
|
|
67
67
|
handleReactionAddDelete: (selectedEmoji: any) => void;
|
|
68
68
|
handleScrollToRepliedMessage: (messageId: string) => void;
|
|
69
69
|
handleMediaItemClick?: (attachment: IAttachment) => void;
|
|
70
|
+
handleOpenUserProfile: (user: IUser) => void;
|
|
70
71
|
isThreadMessage?: boolean;
|
|
71
72
|
}>;
|
|
72
73
|
messageReaction?: boolean;
|
|
@@ -173,6 +174,7 @@ interface MessagesProps {
|
|
|
173
174
|
messageTextFontSize?: string;
|
|
174
175
|
messageTextLineHeight?: string;
|
|
175
176
|
hiddenMessagesProperties?: HiddenMessageProperty[];
|
|
177
|
+
shouldOpenUserProfileForMention?: boolean;
|
|
176
178
|
}
|
|
177
179
|
declare const MessageList: React.FC<MessagesProps>;
|
|
178
180
|
export default MessageList;
|
|
@@ -173,6 +173,7 @@ interface MessagesProps {
|
|
|
173
173
|
messageTimeColor?: string;
|
|
174
174
|
messageStatusAndTimeLineHeight?: string;
|
|
175
175
|
hiddenMessagesProperties?: HiddenMessageProperty[];
|
|
176
|
+
shouldOpenUserProfileForMention?: boolean;
|
|
176
177
|
}
|
|
177
178
|
declare const MessagesContainer: React.FC<MessagesProps>;
|
|
178
179
|
export default MessagesContainer;
|
package/index.js
CHANGED
|
@@ -11193,7 +11193,7 @@ var UploadAvatarButton = styled__default.button(_templateObject24 || (_templateO
|
|
|
11193
11193
|
var UploadAvatarHandler = styled__default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteralLoose(["\n margin-left: 18px;\n font-size: 13px;\n color: ", ";\n"])), function (props) {
|
|
11194
11194
|
return props.color;
|
|
11195
11195
|
});
|
|
11196
|
-
var StyledText = styled__default.span(_templateObject26 || (_templateObject26 = _taggedTemplateLiteralLoose(["\n font-weight: ", ";\n font-family: ", ";\n font-style: ", ";\n text-decoration: ", ";\n letter-spacing: ", ";\n\n &.mention {\n color: ", ";\n font-weight: ", ";\n }\n &.bold {\n font-weight: 600;\n }\n &.italic {\n font-style: italic;\n }\n &.underline {\n text-decoration: underline;\n }\n &.strikethrough {\n text-decoration: line-through;\n }\n &.underline.strikethrough {\n text-decoration: underline line-through;\n }\n &.monospace {\n letter-spacing: 4px;\n }\n"])), function (props) {
|
|
11196
|
+
var StyledText = styled__default.span(_templateObject26 || (_templateObject26 = _taggedTemplateLiteralLoose(["\n font-weight: ", ";\n font-family: ", ";\n font-style: ", ";\n text-decoration: ", ";\n letter-spacing: ", ";\n\n &.mention {\n color: ", ";\n font-weight: ", ";\n cursor: ", ";\n }\n &.bold {\n font-weight: 600;\n }\n &.italic {\n font-style: italic;\n }\n &.underline {\n text-decoration: underline;\n }\n &.strikethrough {\n text-decoration: line-through;\n }\n &.underline.strikethrough {\n text-decoration: underline line-through;\n }\n &.monospace {\n letter-spacing: 4px;\n }\n"])), function (props) {
|
|
11197
11197
|
return props.fontWeight || props.isLastMessage && '500';
|
|
11198
11198
|
}, function (props) {
|
|
11199
11199
|
return props.fontFamily;
|
|
@@ -11207,6 +11207,8 @@ var StyledText = styled__default.span(_templateObject26 || (_templateObject26 =
|
|
|
11207
11207
|
return props.color;
|
|
11208
11208
|
}, function (props) {
|
|
11209
11209
|
return props.isLastMessage && '500';
|
|
11210
|
+
}, function (props) {
|
|
11211
|
+
return props.shouldOpenUserProfileForMention && 'pointer';
|
|
11210
11212
|
});
|
|
11211
11213
|
var MessageOwner = styled__default.h3(_templateObject27 || (_templateObject27 = _taggedTemplateLiteralLoose(["\n margin: 0 12px 4px 0;\n white-space: nowrap;\n color: ", ";\n margin-left: ", ";\n font-weight: 500;\n font-size: ", ";\n line-height: ", ";\n cursor: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n"])), function (props) {
|
|
11212
11214
|
return props.color;
|
|
@@ -11452,7 +11454,9 @@ var MessageTextFormat = function MessageTextFormat(_ref2) {
|
|
|
11452
11454
|
isLastMessage = _ref2.isLastMessage,
|
|
11453
11455
|
asSampleText = _ref2.asSampleText,
|
|
11454
11456
|
accentColor = _ref2.accentColor,
|
|
11455
|
-
textSecondary = _ref2.textSecondary
|
|
11457
|
+
textSecondary = _ref2.textSecondary,
|
|
11458
|
+
onMentionNameClick = _ref2.onMentionNameClick,
|
|
11459
|
+
shouldOpenUserProfileForMention = _ref2.shouldOpenUserProfileForMention;
|
|
11456
11460
|
try {
|
|
11457
11461
|
var messageText = [];
|
|
11458
11462
|
var linkify = new LinkifyIt();
|
|
@@ -11497,12 +11501,18 @@ var MessageTextFormat = function MessageTextFormat(_ref2) {
|
|
|
11497
11501
|
className: "" + combinedAttributesList[index - 1].type,
|
|
11498
11502
|
isLastMessage: isLastMessage,
|
|
11499
11503
|
key: attributeOffset + index,
|
|
11500
|
-
color: isLastMessage ? textSecondary : accentColor
|
|
11504
|
+
color: isLastMessage ? textSecondary : accentColor,
|
|
11505
|
+
shouldOpenUserProfileForMention: onMentionNameClick && shouldOpenUserProfileForMention
|
|
11501
11506
|
}, firsTextPart, /*#__PURE__*/React__default.createElement(StyledText, {
|
|
11502
11507
|
className: 'mention',
|
|
11503
11508
|
isLastMessage: isLastMessage,
|
|
11504
11509
|
color: isLastMessage ? textSecondary : accentColor,
|
|
11505
|
-
key: attributeOffset + index
|
|
11510
|
+
key: attributeOffset + index,
|
|
11511
|
+
onClick: function onClick() {
|
|
11512
|
+
if (onMentionNameClick && shouldOpenUserProfileForMention) {
|
|
11513
|
+
onMentionNameClick(mentionDisplay);
|
|
11514
|
+
}
|
|
11515
|
+
}
|
|
11506
11516
|
}, mentionDisplayName), secondTextPart)), index === combinedAttributesList.length - 1 ? secondPart : '');
|
|
11507
11517
|
} else {
|
|
11508
11518
|
nextPartIndex = attribute.offset + attribute.length;
|
|
@@ -11510,7 +11520,13 @@ var MessageTextFormat = function MessageTextFormat(_ref2) {
|
|
|
11510
11520
|
className: attribute.type,
|
|
11511
11521
|
isLastMessage: isLastMessage,
|
|
11512
11522
|
color: isLastMessage ? textSecondary : accentColor,
|
|
11513
|
-
key: attributeOffset
|
|
11523
|
+
key: attributeOffset,
|
|
11524
|
+
onClick: function onClick() {
|
|
11525
|
+
if (onMentionNameClick && shouldOpenUserProfileForMention) {
|
|
11526
|
+
onMentionNameClick(mentionDisplay);
|
|
11527
|
+
}
|
|
11528
|
+
},
|
|
11529
|
+
shouldOpenUserProfileForMention: onMentionNameClick && shouldOpenUserProfileForMention
|
|
11514
11530
|
}, mentionDisplayName)), index === combinedAttributesList.length - 1 ? secondPart : '');
|
|
11515
11531
|
}
|
|
11516
11532
|
} else {
|
|
@@ -29584,7 +29600,9 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
29584
29600
|
handleMouseLeave = _ref.handleMouseLeave,
|
|
29585
29601
|
handleReactionAddDelete = _ref.handleReactionAddDelete,
|
|
29586
29602
|
handleCreateChat = _ref.handleCreateChat,
|
|
29587
|
-
messageTextRef = _ref.messageTextRef
|
|
29603
|
+
messageTextRef = _ref.messageTextRef,
|
|
29604
|
+
handleOpenUserProfile = _ref.handleOpenUserProfile,
|
|
29605
|
+
shouldOpenUserProfileForMention = _ref.shouldOpenUserProfileForMention;
|
|
29588
29606
|
var _useColor = useColors(),
|
|
29589
29607
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
29590
29608
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
@@ -29785,7 +29803,9 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
29785
29803
|
contactsMap: contactsMap,
|
|
29786
29804
|
getFromContacts: getFromContacts,
|
|
29787
29805
|
accentColor: accentColor,
|
|
29788
|
-
textSecondary: textSecondary
|
|
29806
|
+
textSecondary: textSecondary,
|
|
29807
|
+
onMentionNameClick: handleOpenUserProfile,
|
|
29808
|
+
shouldOpenUserProfileForMention: !!shouldOpenUserProfileForMention
|
|
29789
29809
|
})), !withAttachments && message.state === MESSAGE_STATUS.DELETE ? (/*#__PURE__*/React__default.createElement(MessageStatusDeleted$1, {
|
|
29790
29810
|
color: textSecondary
|
|
29791
29811
|
}, " Message was deleted. ")) : '', messageStatusAndTimePosition === 'onMessage' && !notLinkAttachment && (messageStatusVisible || messageTimeVisible) ? (/*#__PURE__*/React__default.createElement(MessageStatusAndTime$1, {
|
|
@@ -30071,7 +30091,8 @@ var Message$1 = function Message(_ref) {
|
|
|
30071
30091
|
theme = _ref.theme,
|
|
30072
30092
|
messageTextFontSize = _ref.messageTextFontSize,
|
|
30073
30093
|
messageTextLineHeight = _ref.messageTextLineHeight,
|
|
30074
|
-
messageTimeColorOnAttachment = _ref.messageTimeColorOnAttachment
|
|
30094
|
+
messageTimeColorOnAttachment = _ref.messageTimeColorOnAttachment,
|
|
30095
|
+
shouldOpenUserProfileForMention = _ref.shouldOpenUserProfileForMention;
|
|
30075
30096
|
var _useColor = useColors(),
|
|
30076
30097
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
30077
30098
|
backgroundSections = _useColor[THEME_COLORS.BACKGROUND_SECTIONS],
|
|
@@ -30335,6 +30356,21 @@ var Message$1 = function Message(_ref) {
|
|
|
30335
30356
|
document.removeEventListener('mousedown', handleClick);
|
|
30336
30357
|
};
|
|
30337
30358
|
}, []);
|
|
30359
|
+
var handleOpenChannelDetails = function handleOpenChannelDetails() {
|
|
30360
|
+
dispatch(switchChannelInfoAC(true));
|
|
30361
|
+
};
|
|
30362
|
+
var handleOpenUserProfile = function handleOpenUserProfile(user) {
|
|
30363
|
+
if (getOpenChatOnUserInteraction() && user && !selectionIsActive) {
|
|
30364
|
+
dispatch(createChannelAC({
|
|
30365
|
+
metadata: '',
|
|
30366
|
+
type: DEFAULT_CHANNEL_TYPE.DIRECT,
|
|
30367
|
+
members: [_extends({}, user, {
|
|
30368
|
+
role: 'owner'
|
|
30369
|
+
})]
|
|
30370
|
+
}, true));
|
|
30371
|
+
handleOpenChannelDetails();
|
|
30372
|
+
}
|
|
30373
|
+
};
|
|
30338
30374
|
return /*#__PURE__*/React__default.createElement(MessageItem, {
|
|
30339
30375
|
className: 'message_item',
|
|
30340
30376
|
rtl: ownMessageOnRightSide && !message.incoming,
|
|
@@ -30403,7 +30439,8 @@ var Message$1 = function Message(_ref) {
|
|
|
30403
30439
|
handleReactionAddDelete: handleReactionAddDelete,
|
|
30404
30440
|
handleScrollToRepliedMessage: handleScrollToRepliedMessage,
|
|
30405
30441
|
handleMediaItemClick: handleMediaItemClick,
|
|
30406
|
-
isThreadMessage: isThreadMessage
|
|
30442
|
+
isThreadMessage: isThreadMessage,
|
|
30443
|
+
handleOpenUserProfile: handleOpenUserProfile
|
|
30407
30444
|
})) : (/*#__PURE__*/React__default.createElement(MessageBody$1, {
|
|
30408
30445
|
message: message,
|
|
30409
30446
|
channel: channel,
|
|
@@ -30523,7 +30560,9 @@ var Message$1 = function Message(_ref) {
|
|
|
30523
30560
|
handleDeletePendingMessage: handleDeletePendingMessage,
|
|
30524
30561
|
handleCreateChat: handleCreateChat,
|
|
30525
30562
|
messageTextRef: messageTextRef,
|
|
30526
|
-
messageTimeColorOnAttachment: messageTimeColorOnAttachment || textOnPrimary
|
|
30563
|
+
messageTimeColorOnAttachment: messageTimeColorOnAttachment || textOnPrimary,
|
|
30564
|
+
handleOpenUserProfile: handleOpenUserProfile,
|
|
30565
|
+
shouldOpenUserProfileForMention: shouldOpenUserProfileForMention
|
|
30527
30566
|
})), messageStatusAndTimePosition === 'bottomOfMessage' && (messageStatusVisible || messageTimeVisible) && (/*#__PURE__*/React__default.createElement(MessageStatusAndTime$1, {
|
|
30528
30567
|
message: message,
|
|
30529
30568
|
showMessageTimeAndStatusOnlyOnHover: showMessageTimeAndStatusOnlyOnHover,
|
|
@@ -30771,7 +30810,7 @@ var CreateMessageDateDivider = function CreateMessageDateDivider(_ref) {
|
|
|
30771
30810
|
}));
|
|
30772
30811
|
};
|
|
30773
30812
|
var MessageList = function MessageList(_ref2) {
|
|
30774
|
-
var _channel$lastMessage, _channel$
|
|
30813
|
+
var _channel$lastMessage, _channel$lastMessage3, _scrollRef$current;
|
|
30775
30814
|
var messages = _ref2.messages,
|
|
30776
30815
|
fontFamily = _ref2.fontFamily,
|
|
30777
30816
|
_ref2$ownMessageOnRig = _ref2.ownMessageOnRightSide,
|
|
@@ -30912,7 +30951,8 @@ var MessageList = function MessageList(_ref2) {
|
|
|
30912
30951
|
messageTimeFontSize = _ref2.messageTimeFontSize,
|
|
30913
30952
|
messageTimeColor = _ref2.messageTimeColor,
|
|
30914
30953
|
messageStatusAndTimeLineHeight = _ref2.messageStatusAndTimeLineHeight,
|
|
30915
|
-
hiddenMessagesProperties = _ref2.hiddenMessagesProperties
|
|
30954
|
+
hiddenMessagesProperties = _ref2.hiddenMessagesProperties,
|
|
30955
|
+
shouldOpenUserProfileForMention = _ref2.shouldOpenUserProfileForMention;
|
|
30916
30956
|
var _useColor = useColors(),
|
|
30917
30957
|
outgoingMessageBackground = _useColor[THEME_COLORS.OUTGOING_MESSAGE_BACKGROUND],
|
|
30918
30958
|
themeBackgroundColor = _useColor[THEME_COLORS.BACKGROUND],
|
|
@@ -31209,10 +31249,11 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31209
31249
|
}
|
|
31210
31250
|
};
|
|
31211
31251
|
React.useEffect(function () {
|
|
31212
|
-
|
|
31252
|
+
var _messages, _channel$lastMessage2;
|
|
31253
|
+
if (messages.length > 0 && ((_messages = messages[messages.length - 1]) === null || _messages === void 0 ? void 0 : _messages.id) === ((_channel$lastMessage2 = channel.lastMessage) === null || _channel$lastMessage2 === void 0 ? void 0 : _channel$lastMessage2.id) && scrollRef.current && scrollRef.current.scrollTop > -50 && !showScrollToNewMessageButton) {
|
|
31213
31254
|
dispatch(showScrollToNewMessageButtonAC(false));
|
|
31214
31255
|
}
|
|
31215
|
-
}, [messages, channel === null || channel === void 0 ? void 0 : (_channel$
|
|
31256
|
+
}, [messages, channel === null || channel === void 0 ? void 0 : (_channel$lastMessage3 = channel.lastMessage) === null || _channel$lastMessage3 === void 0 ? void 0 : _channel$lastMessage3.id, scrollRef === null || scrollRef === void 0 ? void 0 : (_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.scrollTop, showScrollToNewMessageButton]);
|
|
31216
31257
|
React.useEffect(function () {
|
|
31217
31258
|
if (scrollToRepliedMessage) {
|
|
31218
31259
|
loading = false;
|
|
@@ -31656,7 +31697,8 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31656
31697
|
messageStateColor: messageStateColor,
|
|
31657
31698
|
messageTimeFontSize: messageTimeFontSize,
|
|
31658
31699
|
messageTimeColor: messageTimeColor,
|
|
31659
|
-
messageStatusAndTimeLineHeight: messageStatusAndTimeLineHeight
|
|
31700
|
+
messageStatusAndTimeLineHeight: messageStatusAndTimeLineHeight,
|
|
31701
|
+
shouldOpenUserProfileForMention: shouldOpenUserProfileForMention
|
|
31660
31702
|
}))), isUnreadMessage ? (/*#__PURE__*/React__default.createElement(MessageDivider, {
|
|
31661
31703
|
theme: theme,
|
|
31662
31704
|
newMessagesSeparatorTextColor: newMessagesSeparatorTextColor,
|
|
@@ -31891,7 +31933,8 @@ var MessagesContainer = function MessagesContainer(_ref) {
|
|
|
31891
31933
|
messageTimeColor = _ref.messageTimeColor,
|
|
31892
31934
|
messageStatusAndTimeLineHeight = _ref.messageStatusAndTimeLineHeight,
|
|
31893
31935
|
_ref$hiddenMessagesPr = _ref.hiddenMessagesProperties,
|
|
31894
|
-
hiddenMessagesProperties = _ref$hiddenMessagesPr === void 0 ? [] : _ref$hiddenMessagesPr
|
|
31936
|
+
hiddenMessagesProperties = _ref$hiddenMessagesPr === void 0 ? [] : _ref$hiddenMessagesPr,
|
|
31937
|
+
shouldOpenUserProfileForMention = _ref.shouldOpenUserProfileForMention;
|
|
31895
31938
|
var messages = reactRedux.useSelector(activeChannelMessagesSelector) || [];
|
|
31896
31939
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(MessageList, {
|
|
31897
31940
|
messages: messages,
|
|
@@ -32019,7 +32062,8 @@ var MessagesContainer = function MessagesContainer(_ref) {
|
|
|
32019
32062
|
messageTimeFontSize: messageTimeFontSize,
|
|
32020
32063
|
messageTimeColor: messageTimeColor,
|
|
32021
32064
|
messageStatusAndTimeLineHeight: messageStatusAndTimeLineHeight,
|
|
32022
|
-
hiddenMessagesProperties: hiddenMessagesProperties
|
|
32065
|
+
hiddenMessagesProperties: hiddenMessagesProperties,
|
|
32066
|
+
shouldOpenUserProfileForMention: shouldOpenUserProfileForMention
|
|
32023
32067
|
}));
|
|
32024
32068
|
};
|
|
32025
32069
|
|
package/index.modern.js
CHANGED
|
@@ -11170,7 +11170,7 @@ var UploadAvatarButton = styled.button(_templateObject24 || (_templateObject24 =
|
|
|
11170
11170
|
var UploadAvatarHandler = styled.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteralLoose(["\n margin-left: 18px;\n font-size: 13px;\n color: ", ";\n"])), function (props) {
|
|
11171
11171
|
return props.color;
|
|
11172
11172
|
});
|
|
11173
|
-
var StyledText = styled.span(_templateObject26 || (_templateObject26 = _taggedTemplateLiteralLoose(["\n font-weight: ", ";\n font-family: ", ";\n font-style: ", ";\n text-decoration: ", ";\n letter-spacing: ", ";\n\n &.mention {\n color: ", ";\n font-weight: ", ";\n }\n &.bold {\n font-weight: 600;\n }\n &.italic {\n font-style: italic;\n }\n &.underline {\n text-decoration: underline;\n }\n &.strikethrough {\n text-decoration: line-through;\n }\n &.underline.strikethrough {\n text-decoration: underline line-through;\n }\n &.monospace {\n letter-spacing: 4px;\n }\n"])), function (props) {
|
|
11173
|
+
var StyledText = styled.span(_templateObject26 || (_templateObject26 = _taggedTemplateLiteralLoose(["\n font-weight: ", ";\n font-family: ", ";\n font-style: ", ";\n text-decoration: ", ";\n letter-spacing: ", ";\n\n &.mention {\n color: ", ";\n font-weight: ", ";\n cursor: ", ";\n }\n &.bold {\n font-weight: 600;\n }\n &.italic {\n font-style: italic;\n }\n &.underline {\n text-decoration: underline;\n }\n &.strikethrough {\n text-decoration: line-through;\n }\n &.underline.strikethrough {\n text-decoration: underline line-through;\n }\n &.monospace {\n letter-spacing: 4px;\n }\n"])), function (props) {
|
|
11174
11174
|
return props.fontWeight || props.isLastMessage && '500';
|
|
11175
11175
|
}, function (props) {
|
|
11176
11176
|
return props.fontFamily;
|
|
@@ -11184,6 +11184,8 @@ var StyledText = styled.span(_templateObject26 || (_templateObject26 = _taggedTe
|
|
|
11184
11184
|
return props.color;
|
|
11185
11185
|
}, function (props) {
|
|
11186
11186
|
return props.isLastMessage && '500';
|
|
11187
|
+
}, function (props) {
|
|
11188
|
+
return props.shouldOpenUserProfileForMention && 'pointer';
|
|
11187
11189
|
});
|
|
11188
11190
|
var MessageOwner = styled.h3(_templateObject27 || (_templateObject27 = _taggedTemplateLiteralLoose(["\n margin: 0 12px 4px 0;\n white-space: nowrap;\n color: ", ";\n margin-left: ", ";\n font-weight: 500;\n font-size: ", ";\n line-height: ", ";\n cursor: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n"])), function (props) {
|
|
11189
11191
|
return props.color;
|
|
@@ -11429,7 +11431,9 @@ var MessageTextFormat = function MessageTextFormat(_ref2) {
|
|
|
11429
11431
|
isLastMessage = _ref2.isLastMessage,
|
|
11430
11432
|
asSampleText = _ref2.asSampleText,
|
|
11431
11433
|
accentColor = _ref2.accentColor,
|
|
11432
|
-
textSecondary = _ref2.textSecondary
|
|
11434
|
+
textSecondary = _ref2.textSecondary,
|
|
11435
|
+
onMentionNameClick = _ref2.onMentionNameClick,
|
|
11436
|
+
shouldOpenUserProfileForMention = _ref2.shouldOpenUserProfileForMention;
|
|
11433
11437
|
try {
|
|
11434
11438
|
var messageText = [];
|
|
11435
11439
|
var linkify = new LinkifyIt();
|
|
@@ -11474,12 +11478,18 @@ var MessageTextFormat = function MessageTextFormat(_ref2) {
|
|
|
11474
11478
|
className: "" + combinedAttributesList[index - 1].type,
|
|
11475
11479
|
isLastMessage: isLastMessage,
|
|
11476
11480
|
key: attributeOffset + index,
|
|
11477
|
-
color: isLastMessage ? textSecondary : accentColor
|
|
11481
|
+
color: isLastMessage ? textSecondary : accentColor,
|
|
11482
|
+
shouldOpenUserProfileForMention: onMentionNameClick && shouldOpenUserProfileForMention
|
|
11478
11483
|
}, firsTextPart, /*#__PURE__*/React__default.createElement(StyledText, {
|
|
11479
11484
|
className: 'mention',
|
|
11480
11485
|
isLastMessage: isLastMessage,
|
|
11481
11486
|
color: isLastMessage ? textSecondary : accentColor,
|
|
11482
|
-
key: attributeOffset + index
|
|
11487
|
+
key: attributeOffset + index,
|
|
11488
|
+
onClick: function onClick() {
|
|
11489
|
+
if (onMentionNameClick && shouldOpenUserProfileForMention) {
|
|
11490
|
+
onMentionNameClick(mentionDisplay);
|
|
11491
|
+
}
|
|
11492
|
+
}
|
|
11483
11493
|
}, mentionDisplayName), secondTextPart)), index === combinedAttributesList.length - 1 ? secondPart : '');
|
|
11484
11494
|
} else {
|
|
11485
11495
|
nextPartIndex = attribute.offset + attribute.length;
|
|
@@ -11487,7 +11497,13 @@ var MessageTextFormat = function MessageTextFormat(_ref2) {
|
|
|
11487
11497
|
className: attribute.type,
|
|
11488
11498
|
isLastMessage: isLastMessage,
|
|
11489
11499
|
color: isLastMessage ? textSecondary : accentColor,
|
|
11490
|
-
key: attributeOffset
|
|
11500
|
+
key: attributeOffset,
|
|
11501
|
+
onClick: function onClick() {
|
|
11502
|
+
if (onMentionNameClick && shouldOpenUserProfileForMention) {
|
|
11503
|
+
onMentionNameClick(mentionDisplay);
|
|
11504
|
+
}
|
|
11505
|
+
},
|
|
11506
|
+
shouldOpenUserProfileForMention: onMentionNameClick && shouldOpenUserProfileForMention
|
|
11491
11507
|
}, mentionDisplayName)), index === combinedAttributesList.length - 1 ? secondPart : '');
|
|
11492
11508
|
}
|
|
11493
11509
|
} else {
|
|
@@ -29561,7 +29577,9 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
29561
29577
|
handleMouseLeave = _ref.handleMouseLeave,
|
|
29562
29578
|
handleReactionAddDelete = _ref.handleReactionAddDelete,
|
|
29563
29579
|
handleCreateChat = _ref.handleCreateChat,
|
|
29564
|
-
messageTextRef = _ref.messageTextRef
|
|
29580
|
+
messageTextRef = _ref.messageTextRef,
|
|
29581
|
+
handleOpenUserProfile = _ref.handleOpenUserProfile,
|
|
29582
|
+
shouldOpenUserProfileForMention = _ref.shouldOpenUserProfileForMention;
|
|
29565
29583
|
var _useColor = useColors(),
|
|
29566
29584
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
29567
29585
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
@@ -29762,7 +29780,9 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
29762
29780
|
contactsMap: contactsMap,
|
|
29763
29781
|
getFromContacts: getFromContacts,
|
|
29764
29782
|
accentColor: accentColor,
|
|
29765
|
-
textSecondary: textSecondary
|
|
29783
|
+
textSecondary: textSecondary,
|
|
29784
|
+
onMentionNameClick: handleOpenUserProfile,
|
|
29785
|
+
shouldOpenUserProfileForMention: !!shouldOpenUserProfileForMention
|
|
29766
29786
|
})), !withAttachments && message.state === MESSAGE_STATUS.DELETE ? (/*#__PURE__*/React__default.createElement(MessageStatusDeleted$1, {
|
|
29767
29787
|
color: textSecondary
|
|
29768
29788
|
}, " Message was deleted. ")) : '', messageStatusAndTimePosition === 'onMessage' && !notLinkAttachment && (messageStatusVisible || messageTimeVisible) ? (/*#__PURE__*/React__default.createElement(MessageStatusAndTime$1, {
|
|
@@ -30048,7 +30068,8 @@ var Message$1 = function Message(_ref) {
|
|
|
30048
30068
|
theme = _ref.theme,
|
|
30049
30069
|
messageTextFontSize = _ref.messageTextFontSize,
|
|
30050
30070
|
messageTextLineHeight = _ref.messageTextLineHeight,
|
|
30051
|
-
messageTimeColorOnAttachment = _ref.messageTimeColorOnAttachment
|
|
30071
|
+
messageTimeColorOnAttachment = _ref.messageTimeColorOnAttachment,
|
|
30072
|
+
shouldOpenUserProfileForMention = _ref.shouldOpenUserProfileForMention;
|
|
30052
30073
|
var _useColor = useColors(),
|
|
30053
30074
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
30054
30075
|
backgroundSections = _useColor[THEME_COLORS.BACKGROUND_SECTIONS],
|
|
@@ -30312,6 +30333,21 @@ var Message$1 = function Message(_ref) {
|
|
|
30312
30333
|
document.removeEventListener('mousedown', handleClick);
|
|
30313
30334
|
};
|
|
30314
30335
|
}, []);
|
|
30336
|
+
var handleOpenChannelDetails = function handleOpenChannelDetails() {
|
|
30337
|
+
dispatch(switchChannelInfoAC(true));
|
|
30338
|
+
};
|
|
30339
|
+
var handleOpenUserProfile = function handleOpenUserProfile(user) {
|
|
30340
|
+
if (getOpenChatOnUserInteraction() && user && !selectionIsActive) {
|
|
30341
|
+
dispatch(createChannelAC({
|
|
30342
|
+
metadata: '',
|
|
30343
|
+
type: DEFAULT_CHANNEL_TYPE.DIRECT,
|
|
30344
|
+
members: [_extends({}, user, {
|
|
30345
|
+
role: 'owner'
|
|
30346
|
+
})]
|
|
30347
|
+
}, true));
|
|
30348
|
+
handleOpenChannelDetails();
|
|
30349
|
+
}
|
|
30350
|
+
};
|
|
30315
30351
|
return /*#__PURE__*/React__default.createElement(MessageItem, {
|
|
30316
30352
|
className: 'message_item',
|
|
30317
30353
|
rtl: ownMessageOnRightSide && !message.incoming,
|
|
@@ -30380,7 +30416,8 @@ var Message$1 = function Message(_ref) {
|
|
|
30380
30416
|
handleReactionAddDelete: handleReactionAddDelete,
|
|
30381
30417
|
handleScrollToRepliedMessage: handleScrollToRepliedMessage,
|
|
30382
30418
|
handleMediaItemClick: handleMediaItemClick,
|
|
30383
|
-
isThreadMessage: isThreadMessage
|
|
30419
|
+
isThreadMessage: isThreadMessage,
|
|
30420
|
+
handleOpenUserProfile: handleOpenUserProfile
|
|
30384
30421
|
})) : (/*#__PURE__*/React__default.createElement(MessageBody$1, {
|
|
30385
30422
|
message: message,
|
|
30386
30423
|
channel: channel,
|
|
@@ -30500,7 +30537,9 @@ var Message$1 = function Message(_ref) {
|
|
|
30500
30537
|
handleDeletePendingMessage: handleDeletePendingMessage,
|
|
30501
30538
|
handleCreateChat: handleCreateChat,
|
|
30502
30539
|
messageTextRef: messageTextRef,
|
|
30503
|
-
messageTimeColorOnAttachment: messageTimeColorOnAttachment || textOnPrimary
|
|
30540
|
+
messageTimeColorOnAttachment: messageTimeColorOnAttachment || textOnPrimary,
|
|
30541
|
+
handleOpenUserProfile: handleOpenUserProfile,
|
|
30542
|
+
shouldOpenUserProfileForMention: shouldOpenUserProfileForMention
|
|
30504
30543
|
})), messageStatusAndTimePosition === 'bottomOfMessage' && (messageStatusVisible || messageTimeVisible) && (/*#__PURE__*/React__default.createElement(MessageStatusAndTime$1, {
|
|
30505
30544
|
message: message,
|
|
30506
30545
|
showMessageTimeAndStatusOnlyOnHover: showMessageTimeAndStatusOnlyOnHover,
|
|
@@ -30748,7 +30787,7 @@ var CreateMessageDateDivider = function CreateMessageDateDivider(_ref) {
|
|
|
30748
30787
|
}));
|
|
30749
30788
|
};
|
|
30750
30789
|
var MessageList = function MessageList(_ref2) {
|
|
30751
|
-
var _channel$lastMessage, _channel$
|
|
30790
|
+
var _channel$lastMessage, _channel$lastMessage3, _scrollRef$current;
|
|
30752
30791
|
var messages = _ref2.messages,
|
|
30753
30792
|
fontFamily = _ref2.fontFamily,
|
|
30754
30793
|
_ref2$ownMessageOnRig = _ref2.ownMessageOnRightSide,
|
|
@@ -30889,7 +30928,8 @@ var MessageList = function MessageList(_ref2) {
|
|
|
30889
30928
|
messageTimeFontSize = _ref2.messageTimeFontSize,
|
|
30890
30929
|
messageTimeColor = _ref2.messageTimeColor,
|
|
30891
30930
|
messageStatusAndTimeLineHeight = _ref2.messageStatusAndTimeLineHeight,
|
|
30892
|
-
hiddenMessagesProperties = _ref2.hiddenMessagesProperties
|
|
30931
|
+
hiddenMessagesProperties = _ref2.hiddenMessagesProperties,
|
|
30932
|
+
shouldOpenUserProfileForMention = _ref2.shouldOpenUserProfileForMention;
|
|
30893
30933
|
var _useColor = useColors(),
|
|
30894
30934
|
outgoingMessageBackground = _useColor[THEME_COLORS.OUTGOING_MESSAGE_BACKGROUND],
|
|
30895
30935
|
themeBackgroundColor = _useColor[THEME_COLORS.BACKGROUND],
|
|
@@ -31186,10 +31226,11 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31186
31226
|
}
|
|
31187
31227
|
};
|
|
31188
31228
|
useEffect(function () {
|
|
31189
|
-
|
|
31229
|
+
var _messages, _channel$lastMessage2;
|
|
31230
|
+
if (messages.length > 0 && ((_messages = messages[messages.length - 1]) === null || _messages === void 0 ? void 0 : _messages.id) === ((_channel$lastMessage2 = channel.lastMessage) === null || _channel$lastMessage2 === void 0 ? void 0 : _channel$lastMessage2.id) && scrollRef.current && scrollRef.current.scrollTop > -50 && !showScrollToNewMessageButton) {
|
|
31190
31231
|
dispatch(showScrollToNewMessageButtonAC(false));
|
|
31191
31232
|
}
|
|
31192
|
-
}, [messages, channel === null || channel === void 0 ? void 0 : (_channel$
|
|
31233
|
+
}, [messages, channel === null || channel === void 0 ? void 0 : (_channel$lastMessage3 = channel.lastMessage) === null || _channel$lastMessage3 === void 0 ? void 0 : _channel$lastMessage3.id, scrollRef === null || scrollRef === void 0 ? void 0 : (_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.scrollTop, showScrollToNewMessageButton]);
|
|
31193
31234
|
useEffect(function () {
|
|
31194
31235
|
if (scrollToRepliedMessage) {
|
|
31195
31236
|
loading = false;
|
|
@@ -31633,7 +31674,8 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31633
31674
|
messageStateColor: messageStateColor,
|
|
31634
31675
|
messageTimeFontSize: messageTimeFontSize,
|
|
31635
31676
|
messageTimeColor: messageTimeColor,
|
|
31636
|
-
messageStatusAndTimeLineHeight: messageStatusAndTimeLineHeight
|
|
31677
|
+
messageStatusAndTimeLineHeight: messageStatusAndTimeLineHeight,
|
|
31678
|
+
shouldOpenUserProfileForMention: shouldOpenUserProfileForMention
|
|
31637
31679
|
}))), isUnreadMessage ? (/*#__PURE__*/React__default.createElement(MessageDivider, {
|
|
31638
31680
|
theme: theme,
|
|
31639
31681
|
newMessagesSeparatorTextColor: newMessagesSeparatorTextColor,
|
|
@@ -31868,7 +31910,8 @@ var MessagesContainer = function MessagesContainer(_ref) {
|
|
|
31868
31910
|
messageTimeColor = _ref.messageTimeColor,
|
|
31869
31911
|
messageStatusAndTimeLineHeight = _ref.messageStatusAndTimeLineHeight,
|
|
31870
31912
|
_ref$hiddenMessagesPr = _ref.hiddenMessagesProperties,
|
|
31871
|
-
hiddenMessagesProperties = _ref$hiddenMessagesPr === void 0 ? [] : _ref$hiddenMessagesPr
|
|
31913
|
+
hiddenMessagesProperties = _ref$hiddenMessagesPr === void 0 ? [] : _ref$hiddenMessagesPr,
|
|
31914
|
+
shouldOpenUserProfileForMention = _ref.shouldOpenUserProfileForMention;
|
|
31872
31915
|
var messages = useSelector(activeChannelMessagesSelector) || [];
|
|
31873
31916
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(MessageList, {
|
|
31874
31917
|
messages: messages,
|
|
@@ -31996,7 +32039,8 @@ var MessagesContainer = function MessagesContainer(_ref) {
|
|
|
31996
32039
|
messageTimeFontSize: messageTimeFontSize,
|
|
31997
32040
|
messageTimeColor: messageTimeColor,
|
|
31998
32041
|
messageStatusAndTimeLineHeight: messageStatusAndTimeLineHeight,
|
|
31999
|
-
hiddenMessagesProperties: hiddenMessagesProperties
|
|
32042
|
+
hiddenMessagesProperties: hiddenMessagesProperties,
|
|
32043
|
+
shouldOpenUserProfileForMention: shouldOpenUserProfileForMention
|
|
32000
32044
|
}));
|
|
32001
32045
|
};
|
|
32002
32046
|
|
package/messageUtils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IContactsMap } from '../types';
|
|
2
|
+
import { IContactsMap, IUser } from '../types';
|
|
3
3
|
declare const MessageStatusIcon: ({ messageStatus, messageStatusDisplayingType, color, readIconColor, size, accentColor }: {
|
|
4
4
|
messageStatus: string;
|
|
5
5
|
messageStatusDisplayingType?: string | undefined;
|
|
@@ -8,7 +8,7 @@ declare const MessageStatusIcon: ({ messageStatus, messageStatusDisplayingType,
|
|
|
8
8
|
readIconColor?: string | undefined;
|
|
9
9
|
accentColor?: string | undefined;
|
|
10
10
|
}) => React.JSX.Element;
|
|
11
|
-
declare const MessageTextFormat: ({ text, message, contactsMap, getFromContacts, isLastMessage, asSampleText, accentColor, textSecondary }: {
|
|
11
|
+
declare const MessageTextFormat: ({ text, message, contactsMap, getFromContacts, isLastMessage, asSampleText, accentColor, textSecondary, onMentionNameClick, shouldOpenUserProfileForMention }: {
|
|
12
12
|
text: string;
|
|
13
13
|
message: any;
|
|
14
14
|
contactsMap?: IContactsMap | undefined;
|
|
@@ -17,5 +17,7 @@ declare const MessageTextFormat: ({ text, message, contactsMap, getFromContacts,
|
|
|
17
17
|
asSampleText?: boolean | undefined;
|
|
18
18
|
accentColor: string;
|
|
19
19
|
textSecondary: string;
|
|
20
|
+
onMentionNameClick?: ((user: IUser) => void) | undefined;
|
|
21
|
+
shouldOpenUserProfileForMention?: boolean | undefined;
|
|
20
22
|
}) => any;
|
|
21
23
|
export { MessageStatusIcon, MessageTextFormat };
|