sceyt-chat-react-uikit 1.8.9-beta.8 → 1.8.9-beta.9
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/index.js +12 -10
- package/index.modern.js +12 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -31920,6 +31920,8 @@ var Channel = function Channel(_ref3) {
|
|
|
31920
31920
|
var unsupportedMessage = React.useMemo(function () {
|
|
31921
31921
|
return isMessageUnsupported(lastMessage);
|
|
31922
31922
|
}, [lastMessage === null || lastMessage === void 0 ? void 0 : lastMessage.type]);
|
|
31923
|
+
var shouldShowDraft = !!draftMessageText && !(channel.newMessageCount > 0);
|
|
31924
|
+
var displayedLastMessage = shouldShowDraft ? draftMessage || lastMessage : lastMessage;
|
|
31923
31925
|
var MessageText = React.useMemo(function () {
|
|
31924
31926
|
return /*#__PURE__*/React__default.createElement(ChannelMessageText, {
|
|
31925
31927
|
isTypingOrRecording: (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping) || (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording),
|
|
@@ -31932,12 +31934,12 @@ var Channel = function Channel(_ref3) {
|
|
|
31932
31934
|
channel: channel,
|
|
31933
31935
|
textPrimary: textPrimary,
|
|
31934
31936
|
textSecondary: textSecondary,
|
|
31935
|
-
draftMessageText: draftMessageText,
|
|
31936
|
-
lastMessage:
|
|
31937
|
+
draftMessageText: shouldShowDraft ? draftMessageText : '',
|
|
31938
|
+
lastMessage: displayedLastMessage,
|
|
31937
31939
|
isDirectChannel: isDirectChannel,
|
|
31938
31940
|
unsupportedMessage: unsupportedMessage && !getCustomLatestMessage
|
|
31939
31941
|
});
|
|
31940
|
-
}, [typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping, typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording, draftMessageText, lastMessage, user, contactsMap, getFromContacts, lastMessageMetas, accentColor, typingOrRecording, channel, isDirectChannel, unsupportedMessage]);
|
|
31942
|
+
}, [typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping, typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording, draftMessageText, shouldShowDraft, displayedLastMessage, lastMessage, user, contactsMap, getFromContacts, lastMessageMetas, accentColor, typingOrRecording, channel, isDirectChannel, unsupportedMessage]);
|
|
31941
31943
|
var getCustomLatestMessageComponent = React.useCallback(function (_ref4) {
|
|
31942
31944
|
var lastMessage = _ref4.lastMessage,
|
|
31943
31945
|
typingOrRecording = _ref4.typingOrRecording,
|
|
@@ -32028,7 +32030,7 @@ var Channel = function Channel(_ref3) {
|
|
|
32028
32030
|
}, notificationsIsMutedIcon || /*#__PURE__*/React__default.createElement(SvgUnmuteNotifications, null))), getCustomLatestMessage && !typingOrRecording.items.length ? getCustomLatestMessageComponent({
|
|
32029
32031
|
lastMessage: lastMessage,
|
|
32030
32032
|
typingOrRecording: typingOrRecording,
|
|
32031
|
-
draftMessageText: draftMessageText,
|
|
32033
|
+
draftMessageText: shouldShowDraft ? draftMessageText : undefined,
|
|
32032
32034
|
textSecondary: textSecondary,
|
|
32033
32035
|
channel: channel,
|
|
32034
32036
|
channelLastMessageFontSize: channelLastMessageFontSize || '14px',
|
|
@@ -32042,7 +32044,7 @@ var Channel = function Channel(_ref3) {
|
|
|
32042
32044
|
user: user,
|
|
32043
32045
|
MessageText: MessageText,
|
|
32044
32046
|
unsupportedMessage: unsupportedMessage
|
|
32045
|
-
}) : (lastMessage || typingOrRecording.items.length > 0 ||
|
|
32047
|
+
}) : (lastMessage || typingOrRecording.items.length > 0 || shouldShowDraft) && (/*#__PURE__*/React__default.createElement(LastMessage, {
|
|
32046
32048
|
color: textSecondary,
|
|
32047
32049
|
markedAsUnread: !!(channel.unread || channel.newMessageCount && channel.newMessageCount > 0),
|
|
32048
32050
|
unreadMentions: !!(channel.newMentionCount && channel.newMentionCount > 0),
|
|
@@ -32058,7 +32060,7 @@ var Channel = function Channel(_ref3) {
|
|
|
32058
32060
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
32059
32061
|
key: item.from.id
|
|
32060
32062
|
}, makeUsername(contactsMap && contactsMap[item.from.id], item.from, getFromContacts, true), index < typingOrRecording.items.length - 1 && ', ');
|
|
32061
|
-
})))) : null :
|
|
32063
|
+
})))) : null : shouldShowDraft ? (/*#__PURE__*/React__default.createElement(DraftMessageTitle, {
|
|
32062
32064
|
color: warningColor
|
|
32063
32065
|
}, "Draft")) : channel.lastReactedMessage && channel.newReactions && channel.newReactions[0] ? lastMessage.state !== MESSAGE_STATUS.DELETE && (channel.newReactions[0].user && channel.newReactions[0].user.id === user.id || !isDirectChannel) && lastMessage.type !== exports.MESSAGE_TYPE.SYSTEM && (/*#__PURE__*/React__default.createElement(LastMessageAuthor, {
|
|
32064
32066
|
color: textPrimary
|
|
@@ -32068,8 +32070,8 @@ var Channel = function Channel(_ref3) {
|
|
|
32068
32070
|
color: textPrimary
|
|
32069
32071
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
32070
32072
|
ref: messageAuthorRef
|
|
32071
|
-
}, lastMessage.user.id === user.id ? 'You' : makeUsername(contactsMap && contactsMap[lastMessage.user.id], lastMessage.user, getFromContacts, true)))), !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) && !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording) && (isDirectChannel ? !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) && !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording) && (
|
|
32072
|
-
color:
|
|
32073
|
+
}, lastMessage.user.id === user.id ? 'You' : makeUsername(contactsMap && contactsMap[lastMessage.user.id], lastMessage.user, getFromContacts, true)))), !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) && !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording) && (isDirectChannel ? !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) && !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording) && (shouldShowDraft || lastMessage.user && lastMessage.state !== MESSAGE_STATUS.DELETE && (channel.lastReactedMessage && channel.newReactions && channel.newReactions[0] ? channel.newReactions[0].user && channel.newReactions[0].user.id === user.id : lastMessage.user.id === user.id && lastMessage.type !== exports.MESSAGE_TYPE.SYSTEM)) : shouldShowDraft || lastMessage && lastMessage.state !== MESSAGE_STATUS.DELETE && lastMessage.type !== exports.MESSAGE_TYPE.SYSTEM) && (/*#__PURE__*/React__default.createElement(Points, {
|
|
32074
|
+
color: shouldShowDraft && warningColor || textPrimary
|
|
32073
32075
|
}, ": ")), /*#__PURE__*/React__default.createElement(LastMessageText, {
|
|
32074
32076
|
color: textSecondary,
|
|
32075
32077
|
withAttachments: !!(lastMessage && lastMessage.attachments && lastMessage.attachments.length && lastMessage.attachments[0].type !== attachmentTypes.link) && (!(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) || !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording)),
|
|
@@ -32078,7 +32080,7 @@ var Channel = function Channel(_ref3) {
|
|
|
32078
32080
|
}, MessageText)))), /*#__PURE__*/React__default.createElement(ChannelStatus, {
|
|
32079
32081
|
color: iconInactive,
|
|
32080
32082
|
ref: messageTimeAndStatusRef
|
|
32081
|
-
}, lastMessage && lastMessage.state !== MESSAGE_STATUS.DELETE && !
|
|
32083
|
+
}, lastMessage && lastMessage.state !== MESSAGE_STATUS.DELETE && !shouldShowDraft && (/*#__PURE__*/React__default.createElement(DeliveryIconCont, null, lastMessage && lastMessage.user && lastMessage.user.id === user.id && isTypeValid(lastMessage.type) && MessageStatusIcon({
|
|
32082
32084
|
messageStatus: lastMessage.deliveryStatus,
|
|
32083
32085
|
messageStatusDisplayingType: 'ticks',
|
|
32084
32086
|
readIconColor: accentColor,
|
|
@@ -32089,7 +32091,7 @@ var Channel = function Channel(_ref3) {
|
|
|
32089
32091
|
color: textSecondary,
|
|
32090
32092
|
fontSize: channelLastMessageTimeFontSize
|
|
32091
32093
|
}, lastMessage && lastMessage.createdAt && lastMessageDateFormat(lastMessage.createdAt))), /*#__PURE__*/React__default.createElement(UnreadInfo, {
|
|
32092
|
-
bottom: !(lastMessage || typingOrRecording.items.length > 0 ||
|
|
32094
|
+
bottom: !(lastMessage || typingOrRecording.items.length > 0 || shouldShowDraft) ? '5px' : ''
|
|
32093
32095
|
}, channel.pinnedAt && (/*#__PURE__*/React__default.createElement(PinnedIconWrapper, {
|
|
32094
32096
|
color: iconInactive,
|
|
32095
32097
|
margin: channel.newMessageCount || channel.unread || channel.newMentionCount && channel.newMentionCount > 0 ? '0 4px 0 4px' : ''
|
package/index.modern.js
CHANGED
|
@@ -31900,6 +31900,8 @@ var Channel = function Channel(_ref3) {
|
|
|
31900
31900
|
var unsupportedMessage = useMemo(function () {
|
|
31901
31901
|
return isMessageUnsupported(lastMessage);
|
|
31902
31902
|
}, [lastMessage === null || lastMessage === void 0 ? void 0 : lastMessage.type]);
|
|
31903
|
+
var shouldShowDraft = !!draftMessageText && !(channel.newMessageCount > 0);
|
|
31904
|
+
var displayedLastMessage = shouldShowDraft ? draftMessage || lastMessage : lastMessage;
|
|
31903
31905
|
var MessageText = useMemo(function () {
|
|
31904
31906
|
return /*#__PURE__*/React__default.createElement(ChannelMessageText, {
|
|
31905
31907
|
isTypingOrRecording: (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping) || (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording),
|
|
@@ -31912,12 +31914,12 @@ var Channel = function Channel(_ref3) {
|
|
|
31912
31914
|
channel: channel,
|
|
31913
31915
|
textPrimary: textPrimary,
|
|
31914
31916
|
textSecondary: textSecondary,
|
|
31915
|
-
draftMessageText: draftMessageText,
|
|
31916
|
-
lastMessage:
|
|
31917
|
+
draftMessageText: shouldShowDraft ? draftMessageText : '',
|
|
31918
|
+
lastMessage: displayedLastMessage,
|
|
31917
31919
|
isDirectChannel: isDirectChannel,
|
|
31918
31920
|
unsupportedMessage: unsupportedMessage && !getCustomLatestMessage
|
|
31919
31921
|
});
|
|
31920
|
-
}, [typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping, typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording, draftMessageText, lastMessage, user, contactsMap, getFromContacts, lastMessageMetas, accentColor, typingOrRecording, channel, isDirectChannel, unsupportedMessage]);
|
|
31922
|
+
}, [typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping, typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording, draftMessageText, shouldShowDraft, displayedLastMessage, lastMessage, user, contactsMap, getFromContacts, lastMessageMetas, accentColor, typingOrRecording, channel, isDirectChannel, unsupportedMessage]);
|
|
31921
31923
|
var getCustomLatestMessageComponent = useCallback(function (_ref4) {
|
|
31922
31924
|
var lastMessage = _ref4.lastMessage,
|
|
31923
31925
|
typingOrRecording = _ref4.typingOrRecording,
|
|
@@ -32008,7 +32010,7 @@ var Channel = function Channel(_ref3) {
|
|
|
32008
32010
|
}, notificationsIsMutedIcon || /*#__PURE__*/React__default.createElement(SvgUnmuteNotifications, null))), getCustomLatestMessage && !typingOrRecording.items.length ? getCustomLatestMessageComponent({
|
|
32009
32011
|
lastMessage: lastMessage,
|
|
32010
32012
|
typingOrRecording: typingOrRecording,
|
|
32011
|
-
draftMessageText: draftMessageText,
|
|
32013
|
+
draftMessageText: shouldShowDraft ? draftMessageText : undefined,
|
|
32012
32014
|
textSecondary: textSecondary,
|
|
32013
32015
|
channel: channel,
|
|
32014
32016
|
channelLastMessageFontSize: channelLastMessageFontSize || '14px',
|
|
@@ -32022,7 +32024,7 @@ var Channel = function Channel(_ref3) {
|
|
|
32022
32024
|
user: user,
|
|
32023
32025
|
MessageText: MessageText,
|
|
32024
32026
|
unsupportedMessage: unsupportedMessage
|
|
32025
|
-
}) : (lastMessage || typingOrRecording.items.length > 0 ||
|
|
32027
|
+
}) : (lastMessage || typingOrRecording.items.length > 0 || shouldShowDraft) && (/*#__PURE__*/React__default.createElement(LastMessage, {
|
|
32026
32028
|
color: textSecondary,
|
|
32027
32029
|
markedAsUnread: !!(channel.unread || channel.newMessageCount && channel.newMessageCount > 0),
|
|
32028
32030
|
unreadMentions: !!(channel.newMentionCount && channel.newMentionCount > 0),
|
|
@@ -32038,7 +32040,7 @@ var Channel = function Channel(_ref3) {
|
|
|
32038
32040
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
32039
32041
|
key: item.from.id
|
|
32040
32042
|
}, makeUsername(contactsMap && contactsMap[item.from.id], item.from, getFromContacts, true), index < typingOrRecording.items.length - 1 && ', ');
|
|
32041
|
-
})))) : null :
|
|
32043
|
+
})))) : null : shouldShowDraft ? (/*#__PURE__*/React__default.createElement(DraftMessageTitle, {
|
|
32042
32044
|
color: warningColor
|
|
32043
32045
|
}, "Draft")) : channel.lastReactedMessage && channel.newReactions && channel.newReactions[0] ? lastMessage.state !== MESSAGE_STATUS.DELETE && (channel.newReactions[0].user && channel.newReactions[0].user.id === user.id || !isDirectChannel) && lastMessage.type !== MESSAGE_TYPE.SYSTEM && (/*#__PURE__*/React__default.createElement(LastMessageAuthor, {
|
|
32044
32046
|
color: textPrimary
|
|
@@ -32048,8 +32050,8 @@ var Channel = function Channel(_ref3) {
|
|
|
32048
32050
|
color: textPrimary
|
|
32049
32051
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
32050
32052
|
ref: messageAuthorRef
|
|
32051
|
-
}, lastMessage.user.id === user.id ? 'You' : makeUsername(contactsMap && contactsMap[lastMessage.user.id], lastMessage.user, getFromContacts, true)))), !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) && !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording) && (isDirectChannel ? !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) && !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording) && (
|
|
32052
|
-
color:
|
|
32053
|
+
}, lastMessage.user.id === user.id ? 'You' : makeUsername(contactsMap && contactsMap[lastMessage.user.id], lastMessage.user, getFromContacts, true)))), !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) && !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording) && (isDirectChannel ? !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) && !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording) && (shouldShowDraft || lastMessage.user && lastMessage.state !== MESSAGE_STATUS.DELETE && (channel.lastReactedMessage && channel.newReactions && channel.newReactions[0] ? channel.newReactions[0].user && channel.newReactions[0].user.id === user.id : lastMessage.user.id === user.id && lastMessage.type !== MESSAGE_TYPE.SYSTEM)) : shouldShowDraft || lastMessage && lastMessage.state !== MESSAGE_STATUS.DELETE && lastMessage.type !== MESSAGE_TYPE.SYSTEM) && (/*#__PURE__*/React__default.createElement(Points, {
|
|
32054
|
+
color: shouldShowDraft && warningColor || textPrimary
|
|
32053
32055
|
}, ": ")), /*#__PURE__*/React__default.createElement(LastMessageText, {
|
|
32054
32056
|
color: textSecondary,
|
|
32055
32057
|
withAttachments: !!(lastMessage && lastMessage.attachments && lastMessage.attachments.length && lastMessage.attachments[0].type !== attachmentTypes.link) && (!(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) || !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording)),
|
|
@@ -32058,7 +32060,7 @@ var Channel = function Channel(_ref3) {
|
|
|
32058
32060
|
}, MessageText)))), /*#__PURE__*/React__default.createElement(ChannelStatus, {
|
|
32059
32061
|
color: iconInactive,
|
|
32060
32062
|
ref: messageTimeAndStatusRef
|
|
32061
|
-
}, lastMessage && lastMessage.state !== MESSAGE_STATUS.DELETE && !
|
|
32063
|
+
}, lastMessage && lastMessage.state !== MESSAGE_STATUS.DELETE && !shouldShowDraft && (/*#__PURE__*/React__default.createElement(DeliveryIconCont, null, lastMessage && lastMessage.user && lastMessage.user.id === user.id && isTypeValid(lastMessage.type) && MessageStatusIcon({
|
|
32062
32064
|
messageStatus: lastMessage.deliveryStatus,
|
|
32063
32065
|
messageStatusDisplayingType: 'ticks',
|
|
32064
32066
|
readIconColor: accentColor,
|
|
@@ -32069,7 +32071,7 @@ var Channel = function Channel(_ref3) {
|
|
|
32069
32071
|
color: textSecondary,
|
|
32070
32072
|
fontSize: channelLastMessageTimeFontSize
|
|
32071
32073
|
}, lastMessage && lastMessage.createdAt && lastMessageDateFormat(lastMessage.createdAt))), /*#__PURE__*/React__default.createElement(UnreadInfo, {
|
|
32072
|
-
bottom: !(lastMessage || typingOrRecording.items.length > 0 ||
|
|
32074
|
+
bottom: !(lastMessage || typingOrRecording.items.length > 0 || shouldShowDraft) ? '5px' : ''
|
|
32073
32075
|
}, channel.pinnedAt && (/*#__PURE__*/React__default.createElement(PinnedIconWrapper, {
|
|
32074
32076
|
color: iconInactive,
|
|
32075
32077
|
margin: channel.newMessageCount || channel.unread || channel.newMentionCount && channel.newMentionCount > 0 ? '0 4px 0 4px' : ''
|