sceyt-chat-react-uikit 1.6.9-beta.19 → 1.6.9-beta.20
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IDetailsProps } from '../ChannelDetailsContainer';
|
|
3
|
-
declare const Details: ({ detailsTitleText, editDetailsTitleText, detailsTitleFontSize, size, channelNameFontSize, channelNameLineHeight, channelAvatarSize, channelAvatarTextSize, channelMembersFontSize, channelMembersLineHeight, showAboutChannel, showAboutChannelTitle, avatarAndNameDirection, channelEditIcon, channelEditIconTopPosition, channelEditIconRightPosition, editChannelSaveButtonBackgroundColor, editChannelSaveButtonTextColor, editChannelCancelButtonBackgroundColor, editChannelCancelButtonTextColor, showMuteUnmuteNotifications, muteUnmuteNotificationsOrder, muteNotificationIcon, unmuteNotificationIcon, muteNotificationIconColor, unmuteNotificationIconColor, muteUnmuteNotificationSwitcherColor, muteUnmuteNotificationTextColor, timeOptionsToMuteNotifications, showStarredMessages, starredMessagesOrder, staredMessagesIcon, staredMessagesIconColor, staredMessagesTextColor, showPinChannel, pinChannelOrder, pinChannelIcon, unpinChannelIcon, pinChannelIconColor, pinChannelTextColor, showMarkAsReadUnread, markAsReadUnreadOrder, markAsReadIcon, markAsUnreadIcon, markAsReadIconColor, markAsUnreadIconColor, markAsReadUnreadTextColor, showLeaveChannel, leaveChannelOrder, leaveChannelIcon, leaveChannelIconColor, leaveChannelTextColor, showReportChannel, reportChannelIcon, reportChannelOrder, reportChannelIconColor, reportChannelTextColor, deleteChannelIcon, showDeleteChannel, deleteChannelIconColor, deleteChannelTextColor, deleteChannelOrder, showBlockAndLeaveChannel, showBlockUser, blockAndLeaveChannelIcon, blockAndLeaveChannelIconColor, blockAndLeaveChannelTextColor, unblockUserIcon, linkPreviewIcon, linkPreviewHoverIcon, linkPreviewTitleColor, linkPreviewColor, linkPreviewHoverBackgroundColor, voicePreviewPlayIcon, voicePreviewPlayHoverIcon, voicePreviewPauseIcon, voicePreviewPauseHoverIcon, voicePreviewTitleColor, voicePreviewDateAndTimeColor, voicePreviewHoverBackgroundColor, filePreviewIcon, filePreviewHoverIcon, filePreviewTitleColor, filePreviewSizeColor, filePreviewHoverBackgroundColor, filePreviewDownloadIcon, fileNameFontSize, fileNameLineHeight, fileSizeFontSize, fileSizeLineHeight, showClearHistory, clearHistoryOrder, clearHistoryIcon, clearHistoryTextColor, showDeleteAllMessages, deleteAllMessagesOrder, deleteAllMessagesIcon, deleteAllMessagesTextColor, showChangeMemberRole, showKickMember, showKickAndBlockMember, showMakeMemberAdmin, memberHoverBackgroundColor, addMemberFontSize, memberNameFontSize, memberAvatarSize, memberPresenceFontSize, actionItemsFontSize, addMemberIcon, tabItemsFontSize, tabItemsLineHeight, tabItemsMinWidth, backgroundColor, bordersColor }: IDetailsProps) => React.JSX.Element;
|
|
3
|
+
declare const Details: ({ detailsTitleText, editDetailsTitleText, detailsTitleFontSize, size, channelNameFontSize, channelNameLineHeight, channelAvatarSize, channelAvatarTextSize, channelMembersFontSize, channelMembersLineHeight, showAboutChannel, showAboutChannelTitle, avatarAndNameDirection, channelEditIcon, channelEditIconTopPosition, channelEditIconRightPosition, editChannelSaveButtonBackgroundColor, editChannelSaveButtonTextColor, editChannelCancelButtonBackgroundColor, editChannelCancelButtonTextColor, showMuteUnmuteNotifications, muteUnmuteNotificationsOrder, muteNotificationIcon, unmuteNotificationIcon, muteNotificationIconColor, unmuteNotificationIconColor, muteUnmuteNotificationSwitcherColor, muteUnmuteNotificationTextColor, timeOptionsToMuteNotifications, showStarredMessages, starredMessagesOrder, staredMessagesIcon, staredMessagesIconColor, staredMessagesTextColor, showPinChannel, pinChannelOrder, pinChannelIcon, unpinChannelIcon, pinChannelIconColor, pinChannelTextColor, showMarkAsReadUnread, markAsReadUnreadOrder, markAsReadIcon, markAsUnreadIcon, markAsReadIconColor, markAsUnreadIconColor, markAsReadUnreadTextColor, showLeaveChannel, leaveChannelOrder, leaveChannelIcon, leaveChannelIconColor, leaveChannelTextColor, showReportChannel, reportChannelIcon, reportChannelOrder, reportChannelIconColor, reportChannelTextColor, deleteChannelIcon, showDeleteChannel, deleteChannelIconColor, deleteChannelTextColor, deleteChannelOrder, showBlockAndLeaveChannel, showBlockUser, blockAndLeaveChannelIcon, blockAndLeaveChannelIconColor, blockAndLeaveChannelTextColor, unblockUserIcon, linkPreviewIcon, linkPreviewHoverIcon, linkPreviewTitleColor, linkPreviewColor, linkPreviewHoverBackgroundColor, voicePreviewPlayIcon, voicePreviewPlayHoverIcon, voicePreviewPauseIcon, voicePreviewPauseHoverIcon, voicePreviewTitleColor, voicePreviewDateAndTimeColor, voicePreviewHoverBackgroundColor, filePreviewIcon, filePreviewHoverIcon, filePreviewTitleColor, filePreviewSizeColor, filePreviewHoverBackgroundColor, filePreviewDownloadIcon, fileNameFontSize, fileNameLineHeight, fileSizeFontSize, fileSizeLineHeight, showClearHistory, clearHistoryOrder, clearHistoryIcon, clearHistoryTextColor, showDeleteAllMessages, deleteAllMessagesOrder, deleteAllMessagesIcon, deleteAllMessagesTextColor, showChangeMemberRole, showKickMember, showKickAndBlockMember, showMakeMemberAdmin, memberHoverBackgroundColor, addMemberFontSize, memberNameFontSize, memberAvatarSize, memberPresenceFontSize, actionItemsFontSize, addMemberIcon, tabItemsFontSize, tabItemsLineHeight, tabItemsMinWidth, backgroundColor, bordersColor, showPhoneNumber }: IDetailsProps) => React.JSX.Element;
|
|
4
4
|
export default Details;
|
|
@@ -116,6 +116,7 @@ export interface IDetailsProps {
|
|
|
116
116
|
tabItemsMinWidth?: string;
|
|
117
117
|
backgroundColor?: string;
|
|
118
118
|
bordersColor?: string;
|
|
119
|
+
showPhoneNumber?: boolean;
|
|
119
120
|
}
|
|
120
|
-
declare const ChannelDetailsContainer: ({ size, detailsTitleText, editDetailsTitleText, detailsTitleFontSize, channelNameFontSize, channelNameLineHeight, channelAvatarSize, channelAvatarTextSize, channelMembersFontSize, channelMembersLineHeight, channelEditIcon, channelEditIconTopPosition, channelEditIconRightPosition, showAboutChannel, showAboutChannelTitle, avatarAndNameDirection, editChannelSaveButtonBackgroundColor, editChannelSaveButtonTextColor, editChannelCancelButtonBackgroundColor, editChannelCancelButtonTextColor, showMuteUnmuteNotifications, muteUnmuteNotificationsOrder, muteNotificationIcon, unmuteNotificationIcon, muteNotificationIconColor, unmuteNotificationIconColor, muteUnmuteNotificationSwitcherColor, muteUnmuteNotificationTextColor, timeOptionsToMuteNotifications, showStarredMessages, starredMessagesOrder, staredMessagesIcon, staredMessagesIconColor, staredMessagesTextColor, showPinChannel, pinChannelOrder, pinChannelIcon, unpinChannelIcon, pinChannelIconColor, pinChannelTextColor, showMarkAsReadUnread, markAsReadUnreadOrder, markAsReadIcon, markAsUnreadIcon, markAsReadIconColor, markAsUnreadIconColor, markAsReadUnreadTextColor, showLeaveChannel, leaveChannelOrder, leaveChannelIcon, leaveChannelIconColor, leaveChannelTextColor, showReportChannel, reportChannelIcon, reportChannelOrder, reportChannelIconColor, reportChannelTextColor, showDeleteChannel, deleteChannelIcon, deleteChannelIconColor, deleteChannelTextColor, deleteChannelOrder, showBlockAndLeaveChannel, showBlockUser, blockAndLeaveChannelIcon, blockAndLeaveChannelIconColor, blockAndLeaveChannelTextColor, unblockUserIcon, linkPreviewIcon, linkPreviewHoverIcon, linkPreviewTitleColor, linkPreviewColor, linkPreviewHoverBackgroundColor, filePreviewIcon, filePreviewHoverIcon, filePreviewTitleColor, filePreviewSizeColor, filePreviewHoverBackgroundColor, filePreviewDownloadIcon, fileNameFontSize, fileNameLineHeight, fileSizeFontSize, fileSizeLineHeight, showClearHistory, clearHistoryOrder, clearHistoryIcon, clearHistoryTextColor, showDeleteAllMessages, deleteAllMessagesOrder, deleteAllMessagesIcon, deleteAllMessagesTextColor, showChangeMemberRole, memberHoverBackgroundColor, addMemberFontSize, addMemberIcon, memberNameFontSize, memberAvatarSize, memberPresenceFontSize, showKickMember, showKickAndBlockMember, backgroundColor, actionItemsFontSize, tabItemsFontSize, tabItemsLineHeight, tabItemsMinWidth, bordersColor }: IDetailsProps) => React.JSX.Element;
|
|
121
|
+
declare const ChannelDetailsContainer: ({ size, detailsTitleText, editDetailsTitleText, detailsTitleFontSize, channelNameFontSize, channelNameLineHeight, channelAvatarSize, channelAvatarTextSize, channelMembersFontSize, channelMembersLineHeight, channelEditIcon, channelEditIconTopPosition, channelEditIconRightPosition, showAboutChannel, showAboutChannelTitle, avatarAndNameDirection, editChannelSaveButtonBackgroundColor, editChannelSaveButtonTextColor, editChannelCancelButtonBackgroundColor, editChannelCancelButtonTextColor, showMuteUnmuteNotifications, muteUnmuteNotificationsOrder, muteNotificationIcon, unmuteNotificationIcon, muteNotificationIconColor, unmuteNotificationIconColor, muteUnmuteNotificationSwitcherColor, muteUnmuteNotificationTextColor, timeOptionsToMuteNotifications, showStarredMessages, starredMessagesOrder, staredMessagesIcon, staredMessagesIconColor, staredMessagesTextColor, showPinChannel, pinChannelOrder, pinChannelIcon, unpinChannelIcon, pinChannelIconColor, pinChannelTextColor, showMarkAsReadUnread, markAsReadUnreadOrder, markAsReadIcon, markAsUnreadIcon, markAsReadIconColor, markAsUnreadIconColor, markAsReadUnreadTextColor, showLeaveChannel, leaveChannelOrder, leaveChannelIcon, leaveChannelIconColor, leaveChannelTextColor, showReportChannel, reportChannelIcon, reportChannelOrder, reportChannelIconColor, reportChannelTextColor, showDeleteChannel, deleteChannelIcon, deleteChannelIconColor, deleteChannelTextColor, deleteChannelOrder, showBlockAndLeaveChannel, showBlockUser, blockAndLeaveChannelIcon, blockAndLeaveChannelIconColor, blockAndLeaveChannelTextColor, unblockUserIcon, linkPreviewIcon, linkPreviewHoverIcon, linkPreviewTitleColor, linkPreviewColor, linkPreviewHoverBackgroundColor, filePreviewIcon, filePreviewHoverIcon, filePreviewTitleColor, filePreviewSizeColor, filePreviewHoverBackgroundColor, filePreviewDownloadIcon, fileNameFontSize, fileNameLineHeight, fileSizeFontSize, fileSizeLineHeight, showClearHistory, clearHistoryOrder, clearHistoryIcon, clearHistoryTextColor, showDeleteAllMessages, deleteAllMessagesOrder, deleteAllMessagesIcon, deleteAllMessagesTextColor, showChangeMemberRole, memberHoverBackgroundColor, addMemberFontSize, addMemberIcon, memberNameFontSize, memberAvatarSize, memberPresenceFontSize, showKickMember, showKickAndBlockMember, backgroundColor, actionItemsFontSize, tabItemsFontSize, tabItemsLineHeight, tabItemsMinWidth, bordersColor, showPhoneNumber }: IDetailsProps) => React.JSX.Element;
|
|
121
122
|
export default ChannelDetailsContainer;
|
package/index.js
CHANGED
|
@@ -10210,6 +10210,16 @@ function removePendingMessageFromMap(channelId, messageId) {
|
|
|
10210
10210
|
});
|
|
10211
10211
|
}
|
|
10212
10212
|
}
|
|
10213
|
+
function updatePendingMessageOnMap(channelId, messageId, updatedMessage) {
|
|
10214
|
+
if (pendingMessagesMap[channelId]) {
|
|
10215
|
+
pendingMessagesMap[channelId] = pendingMessagesMap[channelId].map(function (msg) {
|
|
10216
|
+
if (msg.id === messageId || msg.tid === messageId) {
|
|
10217
|
+
return _extends({}, msg, updatedMessage);
|
|
10218
|
+
}
|
|
10219
|
+
return msg;
|
|
10220
|
+
});
|
|
10221
|
+
}
|
|
10222
|
+
}
|
|
10213
10223
|
function clearMessagesMap() {
|
|
10214
10224
|
messagesMap = {};
|
|
10215
10225
|
}
|
|
@@ -13654,7 +13664,7 @@ function watchForEvents() {
|
|
|
13654
13664
|
};
|
|
13655
13665
|
});
|
|
13656
13666
|
_loop = /*#__PURE__*/_regenerator().m(function _callee() {
|
|
13657
|
-
var _yield$take, type, args, createdChannel, channelFilterTypes, getFromContacts, channelExists, _chan, channel, _chan2, _channel, member, _channelExists, _activeChannelId, groupName, updateChannelData, _channel2, _channelExists2, _channel3, removedMembers, _activeChannelId2, _channelExists3, activeChannel, _updateChannelData, _groupName, _channel4, addedMembers, _activeChannelId3, _channelExists4, _updateChannelData2, _groupName2, updatedChannel, _channelExists5, subject, avatarUrl, muted, mutedTill, metadata, _activeChannelId4, _groupName3, _channel5, message, messageToHandle, _channelFilterTypes, _activeChannelId5, _channelExists6, channelForAdd, hasNextMessage, _groupName4, showNotifications, tabIsActive, _state$ThemeReducer$n, _state$ThemeReducer$n2, _state$ThemeReducer$n3, _state$ThemeReducer$n4, _state$ThemeReducer$n5, _state$ThemeReducer$n6, contactsMap, _getFromContacts, state, theme, accentColor, textSecondary, messageBody, channelId, markerList, _channel6, _activeChannelId6, updateLastMessage, markersMap, lastMessage, _channelId, _channel7, _channel8, deletedMessage, _activeChannelId7, _channelExists7, _channel9, _message, _activeChannelId8, _channelExists8, _channel0, user, _message2, reaction, isSelf, _activeChannelId9, _state$ThemeReducer$n7, _state$ThemeReducer$n8, _state$ThemeReducer$n9, _state$ThemeReducer$n0, _state$ThemeReducer$n1, _state$ThemeReducer$n10, _contactsMap, _getFromContacts2, _state, _theme, _accentColor, _textSecondary, _messageBody, channelUpdateParams, _channel1, _user, _message3, _reaction, channelFromMap, _isSelf, _activeChannelId0, _channelUpdateParams, _channel10, _updatedChannel, _channel11, _activeChannelId1, channelExist, _channel12, _channel13, _channel14, _channel15, _channel16, _channel17, _channel18, _groupName5, _channel19, _groupName6, _channel20, members, _activeChannelId10, i, _channel21, _channel22, _channelId2, from, name, status, _t;
|
|
13667
|
+
var _yield$take, type, args, createdChannel, channelFilterTypes, getFromContacts, channelExists, _chan, channel, _chan2, _channel, member, _channelExists, _activeChannelId, groupName, updateChannelData, _channel2, _channelExists2, _channel3, removedMembers, _activeChannelId2, _channelExists3, activeChannel, _updateChannelData, _groupName, _channel4, addedMembers, _activeChannelId3, _channelExists4, _updateChannelData2, _groupName2, updatedChannel, _channelExists5, subject, avatarUrl, muted, mutedTill, metadata, _activeChannelId4, _groupName3, _channel5, message, messageToHandle, _channelFilterTypes, _activeChannelId5, _channelExists6, channelForAdd, hasNextMessage, _groupName4, showNotifications, tabIsActive, _state$ThemeReducer$n, _state$ThemeReducer$n2, _state$ThemeReducer$n3, _state$ThemeReducer$n4, _state$ThemeReducer$n5, _state$ThemeReducer$n6, contactsMap, _getFromContacts, state, theme, accentColor, textSecondary, messageBody, channelId, markerList, _channel6, _activeChannelId6, updateLastMessage, markersMap, activeChannelMessages, lastMessage, _channelId, _channel7, _channel8, deletedMessage, _activeChannelId7, _channelExists7, _channel9, _message, _activeChannelId8, _channelExists8, _channel0, user, _message2, reaction, isSelf, _activeChannelId9, _state$ThemeReducer$n7, _state$ThemeReducer$n8, _state$ThemeReducer$n9, _state$ThemeReducer$n0, _state$ThemeReducer$n1, _state$ThemeReducer$n10, _contactsMap, _getFromContacts2, _state, _theme, _accentColor, _textSecondary, _messageBody, channelUpdateParams, _channel1, _user, _message3, _reaction, channelFromMap, _isSelf, _activeChannelId0, _channelUpdateParams, _channel10, _updatedChannel, _channel11, _activeChannelId1, channelExist, _channel12, _channel13, _channel14, _channel15, _channel16, _channel17, _channel18, _groupName5, _channel19, _groupName6, _channel20, members, _activeChannelId10, i, _channel21, _channel22, _channelId2, from, name, status, _t;
|
|
13658
13668
|
return _regenerator().w(function (_context) {
|
|
13659
13669
|
while (1) switch (_context.n) {
|
|
13660
13670
|
case 0:
|
|
@@ -14140,8 +14150,17 @@ function watchForEvents() {
|
|
|
14140
14150
|
_activeChannelId6 = _context.v;
|
|
14141
14151
|
updateLastMessage = false;
|
|
14142
14152
|
markersMap = {};
|
|
14153
|
+
activeChannelMessages = getMessagesFromMap(_activeChannelId6);
|
|
14143
14154
|
markerList.messageIds.forEach(function (messageId) {
|
|
14144
|
-
|
|
14155
|
+
if (activeChannelMessages.find(function (message) {
|
|
14156
|
+
return message.id === messageId;
|
|
14157
|
+
})) {
|
|
14158
|
+
removePendingMessageFromMap(_activeChannelId6, messageId);
|
|
14159
|
+
} else {
|
|
14160
|
+
updatePendingMessageOnMap(_activeChannelId6, messageId, {
|
|
14161
|
+
deliveryStatus: markerList.name
|
|
14162
|
+
});
|
|
14163
|
+
}
|
|
14145
14164
|
markersMap[messageId] = true;
|
|
14146
14165
|
if (_channel6) {
|
|
14147
14166
|
if (_channel6.lastMessage && messageId === _channel6.lastMessage.id && _channel6.lastMessage.deliveryStatus !== MESSAGE_DELIVERY_STATUS.READ) {
|
|
@@ -18324,7 +18343,7 @@ function deleteMessage(action) {
|
|
|
18324
18343
|
}, _marked5$1, null, [[0, 5]]);
|
|
18325
18344
|
}
|
|
18326
18345
|
function editMessage(action) {
|
|
18327
|
-
var payload, _message, channelId, channel, editedMessage, messageToUpdate, _t8;
|
|
18346
|
+
var payload, _message, channelId, channel, linkAttachments, anotherAttachments, linkAttachmentsToSend, editedMessage, messageToUpdate, _t8;
|
|
18328
18347
|
return _regenerator().w(function (_context8) {
|
|
18329
18348
|
while (1) switch (_context8.p = _context8.n) {
|
|
18330
18349
|
case 0:
|
|
@@ -18341,6 +18360,21 @@ function editMessage(action) {
|
|
|
18341
18360
|
setChannelInMap(channel);
|
|
18342
18361
|
}
|
|
18343
18362
|
}
|
|
18363
|
+
if (_message.attachments.length > 0) {
|
|
18364
|
+
linkAttachments = _message.attachments.filter(function (att) {
|
|
18365
|
+
return att.type === attachmentTypes.link;
|
|
18366
|
+
});
|
|
18367
|
+
anotherAttachments = _message.attachments.filter(function (att) {
|
|
18368
|
+
return att.type !== attachmentTypes.link;
|
|
18369
|
+
});
|
|
18370
|
+
linkAttachmentsToSend = [];
|
|
18371
|
+
linkAttachments.forEach(function (linkAttachment) {
|
|
18372
|
+
var linkAttachmentBuilder = channel.createAttachmentBuilder(linkAttachment.data, linkAttachment.type);
|
|
18373
|
+
var linkAttachmentToSend = linkAttachmentBuilder.setName(linkAttachment.name).setUpload(linkAttachment.upload).create();
|
|
18374
|
+
linkAttachmentsToSend.push(linkAttachmentToSend);
|
|
18375
|
+
});
|
|
18376
|
+
_message.attachments = [].concat(anotherAttachments, linkAttachmentsToSend);
|
|
18377
|
+
}
|
|
18344
18378
|
_context8.n = 2;
|
|
18345
18379
|
return effects.call(channel.editMessage, _extends({}, _message, {
|
|
18346
18380
|
metadata: isJSON(_message.metadata) ? _message.metadata : JSON.stringify(_message.metadata),
|
|
@@ -31031,9 +31065,9 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
31031
31065
|
setMetadata = _useState[1];
|
|
31032
31066
|
var attachment = React.useMemo(function () {
|
|
31033
31067
|
return attachments.find(function (attachment) {
|
|
31034
|
-
return attachment.type ===
|
|
31068
|
+
return attachment.type === attachmentTypes.link;
|
|
31035
31069
|
});
|
|
31036
|
-
}, [attachments
|
|
31070
|
+
}, [attachments]);
|
|
31037
31071
|
var ogMetadataQueryBuilder = React.useCallback(function (url) {
|
|
31038
31072
|
try {
|
|
31039
31073
|
var client = getClient();
|
|
@@ -31062,7 +31096,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
31062
31096
|
}
|
|
31063
31097
|
}, []);
|
|
31064
31098
|
React.useEffect(function () {
|
|
31065
|
-
if (attachment !== null && attachment !== void 0 && attachment.id &&
|
|
31099
|
+
if (attachment !== null && attachment !== void 0 && attachment.id && attachment !== null && attachment !== void 0 && attachment.url) {
|
|
31066
31100
|
var url = attachment === null || attachment === void 0 ? void 0 : attachment.url;
|
|
31067
31101
|
if (url) {
|
|
31068
31102
|
getMetadata(url.replace('https://', '').replace('http://', '')).then(function (cachedMetadata) {
|
|
@@ -31081,7 +31115,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
31081
31115
|
});
|
|
31082
31116
|
}
|
|
31083
31117
|
}
|
|
31084
|
-
}, [attachment === null || attachment === void 0 ? void 0 : attachment.url
|
|
31118
|
+
}, [attachment === null || attachment === void 0 ? void 0 : attachment.url]);
|
|
31085
31119
|
var ogUrl = React.useMemo(function () {
|
|
31086
31120
|
var url = attachment === null || attachment === void 0 ? void 0 : attachment.url;
|
|
31087
31121
|
var urlObj = validateUrl(url);
|
|
@@ -36528,6 +36562,18 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
36528
36562
|
var handleEditMessage = function handleEditMessage() {
|
|
36529
36563
|
var messageTexToSend = editMessageText.trim();
|
|
36530
36564
|
if (messageTexToSend) {
|
|
36565
|
+
var linkAttachment;
|
|
36566
|
+
if (messageTexToSend) {
|
|
36567
|
+
var linkify = new LinkifyIt();
|
|
36568
|
+
var match = linkify.match(messageTexToSend);
|
|
36569
|
+
if (match) {
|
|
36570
|
+
linkAttachment = {
|
|
36571
|
+
type: attachmentTypes.link,
|
|
36572
|
+
data: match[0].url,
|
|
36573
|
+
upload: false
|
|
36574
|
+
};
|
|
36575
|
+
}
|
|
36576
|
+
}
|
|
36531
36577
|
var mentionedMembersPositions = [];
|
|
36532
36578
|
var mentionMembersToSend = [];
|
|
36533
36579
|
if (mentionedMembers && mentionedMembers.length) {
|
|
@@ -36547,7 +36593,9 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
36547
36593
|
});
|
|
36548
36594
|
}
|
|
36549
36595
|
}
|
|
36550
|
-
var messageToSend = _extends({}, messageToEdit, {
|
|
36596
|
+
var messageToSend = _extends({}, messageToEdit, linkAttachment ? {
|
|
36597
|
+
attachments: [linkAttachment]
|
|
36598
|
+
} : {}, {
|
|
36551
36599
|
metadata: mentionedMembersPositions,
|
|
36552
36600
|
bodyAttributes: messageBodyAttributes,
|
|
36553
36601
|
mentionedUsers: mentionMembersToSend,
|
|
@@ -40163,7 +40211,8 @@ var Details = function Details(_ref) {
|
|
|
40163
40211
|
tabItemsLineHeight = _ref.tabItemsLineHeight,
|
|
40164
40212
|
tabItemsMinWidth = _ref.tabItemsMinWidth,
|
|
40165
40213
|
backgroundColor = _ref.backgroundColor,
|
|
40166
|
-
bordersColor = _ref.bordersColor
|
|
40214
|
+
bordersColor = _ref.bordersColor,
|
|
40215
|
+
showPhoneNumber = _ref.showPhoneNumber;
|
|
40167
40216
|
var _useColor = useColors(),
|
|
40168
40217
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
40169
40218
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
@@ -40317,7 +40366,7 @@ var Details = function Details(_ref) {
|
|
|
40317
40366
|
color: textSecondary,
|
|
40318
40367
|
fontSize: channelMembersFontSize,
|
|
40319
40368
|
lineHeight: channelMembersLineHeight
|
|
40320
|
-
}, hideUserPresence && directChannelUser && hideUserPresence(directChannelUser) ? '' : directChannelUser && directChannelUser.presence && (directChannelUser.presence.state === USER_PRESENCE_STATUS.ONLINE ? 'Online' : directChannelUser.presence.lastActiveAt && userLastActiveDateFormat(directChannelUser.presence.lastActiveAt)))) : (/*#__PURE__*/React__default.createElement(SubTitle, {
|
|
40369
|
+
}, showPhoneNumber ? "+" + directChannelUser.id : hideUserPresence && directChannelUser && hideUserPresence(directChannelUser) ? '' : directChannelUser && directChannelUser.presence && (directChannelUser.presence.state === USER_PRESENCE_STATUS.ONLINE ? 'Online' : directChannelUser.presence.lastActiveAt && userLastActiveDateFormat(directChannelUser.presence.lastActiveAt)))) : (/*#__PURE__*/React__default.createElement(SubTitle, {
|
|
40321
40370
|
color: textSecondary,
|
|
40322
40371
|
fontSize: channelMembersFontSize,
|
|
40323
40372
|
lineHeight: channelMembersLineHeight
|
|
@@ -40593,7 +40642,8 @@ var ChannelDetailsContainer = function ChannelDetailsContainer(_ref) {
|
|
|
40593
40642
|
tabItemsFontSize = _ref.tabItemsFontSize,
|
|
40594
40643
|
tabItemsLineHeight = _ref.tabItemsLineHeight,
|
|
40595
40644
|
tabItemsMinWidth = _ref.tabItemsMinWidth,
|
|
40596
|
-
bordersColor = _ref.bordersColor
|
|
40645
|
+
bordersColor = _ref.bordersColor,
|
|
40646
|
+
showPhoneNumber = _ref.showPhoneNumber;
|
|
40597
40647
|
var channelDetailsIsOpen = reactRedux.useSelector(channelInfoIsOpenSelector, reactRedux.shallowEqual);
|
|
40598
40648
|
React.useEffect(function () {
|
|
40599
40649
|
setShowChannelDetails(true);
|
|
@@ -40706,7 +40756,8 @@ var ChannelDetailsContainer = function ChannelDetailsContainer(_ref) {
|
|
|
40706
40756
|
addMemberIcon: addMemberIcon,
|
|
40707
40757
|
tabItemsFontSize: tabItemsFontSize,
|
|
40708
40758
|
tabItemsLineHeight: tabItemsLineHeight,
|
|
40709
|
-
tabItemsMinWidth: tabItemsMinWidth
|
|
40759
|
+
tabItemsMinWidth: tabItemsMinWidth,
|
|
40760
|
+
showPhoneNumber: showPhoneNumber
|
|
40710
40761
|
})));
|
|
40711
40762
|
};
|
|
40712
40763
|
var DetailsWrapper = styled__default.div(_templateObject$W || (_templateObject$W = _taggedTemplateLiteralLoose([""])));
|
package/index.modern.js
CHANGED
|
@@ -10189,6 +10189,16 @@ function removePendingMessageFromMap(channelId, messageId) {
|
|
|
10189
10189
|
});
|
|
10190
10190
|
}
|
|
10191
10191
|
}
|
|
10192
|
+
function updatePendingMessageOnMap(channelId, messageId, updatedMessage) {
|
|
10193
|
+
if (pendingMessagesMap[channelId]) {
|
|
10194
|
+
pendingMessagesMap[channelId] = pendingMessagesMap[channelId].map(function (msg) {
|
|
10195
|
+
if (msg.id === messageId || msg.tid === messageId) {
|
|
10196
|
+
return _extends({}, msg, updatedMessage);
|
|
10197
|
+
}
|
|
10198
|
+
return msg;
|
|
10199
|
+
});
|
|
10200
|
+
}
|
|
10201
|
+
}
|
|
10192
10202
|
function clearMessagesMap() {
|
|
10193
10203
|
messagesMap = {};
|
|
10194
10204
|
}
|
|
@@ -13633,7 +13643,7 @@ function watchForEvents() {
|
|
|
13633
13643
|
};
|
|
13634
13644
|
});
|
|
13635
13645
|
_loop = /*#__PURE__*/_regenerator().m(function _callee() {
|
|
13636
|
-
var _yield$take, type, args, createdChannel, channelFilterTypes, getFromContacts, channelExists, _chan, channel, _chan2, _channel, member, _channelExists, _activeChannelId, groupName, updateChannelData, _channel2, _channelExists2, _channel3, removedMembers, _activeChannelId2, _channelExists3, activeChannel, _updateChannelData, _groupName, _channel4, addedMembers, _activeChannelId3, _channelExists4, _updateChannelData2, _groupName2, updatedChannel, _channelExists5, subject, avatarUrl, muted, mutedTill, metadata, _activeChannelId4, _groupName3, _channel5, message, messageToHandle, _channelFilterTypes, _activeChannelId5, _channelExists6, channelForAdd, hasNextMessage, _groupName4, showNotifications, tabIsActive, _state$ThemeReducer$n, _state$ThemeReducer$n2, _state$ThemeReducer$n3, _state$ThemeReducer$n4, _state$ThemeReducer$n5, _state$ThemeReducer$n6, contactsMap, _getFromContacts, state, theme, accentColor, textSecondary, messageBody, channelId, markerList, _channel6, _activeChannelId6, updateLastMessage, markersMap, lastMessage, _channelId, _channel7, _channel8, deletedMessage, _activeChannelId7, _channelExists7, _channel9, _message, _activeChannelId8, _channelExists8, _channel0, user, _message2, reaction, isSelf, _activeChannelId9, _state$ThemeReducer$n7, _state$ThemeReducer$n8, _state$ThemeReducer$n9, _state$ThemeReducer$n0, _state$ThemeReducer$n1, _state$ThemeReducer$n10, _contactsMap, _getFromContacts2, _state, _theme, _accentColor, _textSecondary, _messageBody, channelUpdateParams, _channel1, _user, _message3, _reaction, channelFromMap, _isSelf, _activeChannelId0, _channelUpdateParams, _channel10, _updatedChannel, _channel11, _activeChannelId1, channelExist, _channel12, _channel13, _channel14, _channel15, _channel16, _channel17, _channel18, _groupName5, _channel19, _groupName6, _channel20, members, _activeChannelId10, i, _channel21, _channel22, _channelId2, from, name, status, _t;
|
|
13646
|
+
var _yield$take, type, args, createdChannel, channelFilterTypes, getFromContacts, channelExists, _chan, channel, _chan2, _channel, member, _channelExists, _activeChannelId, groupName, updateChannelData, _channel2, _channelExists2, _channel3, removedMembers, _activeChannelId2, _channelExists3, activeChannel, _updateChannelData, _groupName, _channel4, addedMembers, _activeChannelId3, _channelExists4, _updateChannelData2, _groupName2, updatedChannel, _channelExists5, subject, avatarUrl, muted, mutedTill, metadata, _activeChannelId4, _groupName3, _channel5, message, messageToHandle, _channelFilterTypes, _activeChannelId5, _channelExists6, channelForAdd, hasNextMessage, _groupName4, showNotifications, tabIsActive, _state$ThemeReducer$n, _state$ThemeReducer$n2, _state$ThemeReducer$n3, _state$ThemeReducer$n4, _state$ThemeReducer$n5, _state$ThemeReducer$n6, contactsMap, _getFromContacts, state, theme, accentColor, textSecondary, messageBody, channelId, markerList, _channel6, _activeChannelId6, updateLastMessage, markersMap, activeChannelMessages, lastMessage, _channelId, _channel7, _channel8, deletedMessage, _activeChannelId7, _channelExists7, _channel9, _message, _activeChannelId8, _channelExists8, _channel0, user, _message2, reaction, isSelf, _activeChannelId9, _state$ThemeReducer$n7, _state$ThemeReducer$n8, _state$ThemeReducer$n9, _state$ThemeReducer$n0, _state$ThemeReducer$n1, _state$ThemeReducer$n10, _contactsMap, _getFromContacts2, _state, _theme, _accentColor, _textSecondary, _messageBody, channelUpdateParams, _channel1, _user, _message3, _reaction, channelFromMap, _isSelf, _activeChannelId0, _channelUpdateParams, _channel10, _updatedChannel, _channel11, _activeChannelId1, channelExist, _channel12, _channel13, _channel14, _channel15, _channel16, _channel17, _channel18, _groupName5, _channel19, _groupName6, _channel20, members, _activeChannelId10, i, _channel21, _channel22, _channelId2, from, name, status, _t;
|
|
13637
13647
|
return _regenerator().w(function (_context) {
|
|
13638
13648
|
while (1) switch (_context.n) {
|
|
13639
13649
|
case 0:
|
|
@@ -14119,8 +14129,17 @@ function watchForEvents() {
|
|
|
14119
14129
|
_activeChannelId6 = _context.v;
|
|
14120
14130
|
updateLastMessage = false;
|
|
14121
14131
|
markersMap = {};
|
|
14132
|
+
activeChannelMessages = getMessagesFromMap(_activeChannelId6);
|
|
14122
14133
|
markerList.messageIds.forEach(function (messageId) {
|
|
14123
|
-
|
|
14134
|
+
if (activeChannelMessages.find(function (message) {
|
|
14135
|
+
return message.id === messageId;
|
|
14136
|
+
})) {
|
|
14137
|
+
removePendingMessageFromMap(_activeChannelId6, messageId);
|
|
14138
|
+
} else {
|
|
14139
|
+
updatePendingMessageOnMap(_activeChannelId6, messageId, {
|
|
14140
|
+
deliveryStatus: markerList.name
|
|
14141
|
+
});
|
|
14142
|
+
}
|
|
14124
14143
|
markersMap[messageId] = true;
|
|
14125
14144
|
if (_channel6) {
|
|
14126
14145
|
if (_channel6.lastMessage && messageId === _channel6.lastMessage.id && _channel6.lastMessage.deliveryStatus !== MESSAGE_DELIVERY_STATUS.READ) {
|
|
@@ -18303,7 +18322,7 @@ function deleteMessage(action) {
|
|
|
18303
18322
|
}, _marked5$1, null, [[0, 5]]);
|
|
18304
18323
|
}
|
|
18305
18324
|
function editMessage(action) {
|
|
18306
|
-
var payload, _message, channelId, channel, editedMessage, messageToUpdate, _t8;
|
|
18325
|
+
var payload, _message, channelId, channel, linkAttachments, anotherAttachments, linkAttachmentsToSend, editedMessage, messageToUpdate, _t8;
|
|
18307
18326
|
return _regenerator().w(function (_context8) {
|
|
18308
18327
|
while (1) switch (_context8.p = _context8.n) {
|
|
18309
18328
|
case 0:
|
|
@@ -18320,6 +18339,21 @@ function editMessage(action) {
|
|
|
18320
18339
|
setChannelInMap(channel);
|
|
18321
18340
|
}
|
|
18322
18341
|
}
|
|
18342
|
+
if (_message.attachments.length > 0) {
|
|
18343
|
+
linkAttachments = _message.attachments.filter(function (att) {
|
|
18344
|
+
return att.type === attachmentTypes.link;
|
|
18345
|
+
});
|
|
18346
|
+
anotherAttachments = _message.attachments.filter(function (att) {
|
|
18347
|
+
return att.type !== attachmentTypes.link;
|
|
18348
|
+
});
|
|
18349
|
+
linkAttachmentsToSend = [];
|
|
18350
|
+
linkAttachments.forEach(function (linkAttachment) {
|
|
18351
|
+
var linkAttachmentBuilder = channel.createAttachmentBuilder(linkAttachment.data, linkAttachment.type);
|
|
18352
|
+
var linkAttachmentToSend = linkAttachmentBuilder.setName(linkAttachment.name).setUpload(linkAttachment.upload).create();
|
|
18353
|
+
linkAttachmentsToSend.push(linkAttachmentToSend);
|
|
18354
|
+
});
|
|
18355
|
+
_message.attachments = [].concat(anotherAttachments, linkAttachmentsToSend);
|
|
18356
|
+
}
|
|
18323
18357
|
_context8.n = 2;
|
|
18324
18358
|
return call(channel.editMessage, _extends({}, _message, {
|
|
18325
18359
|
metadata: isJSON(_message.metadata) ? _message.metadata : JSON.stringify(_message.metadata),
|
|
@@ -31010,9 +31044,9 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
31010
31044
|
setMetadata = _useState[1];
|
|
31011
31045
|
var attachment = useMemo(function () {
|
|
31012
31046
|
return attachments.find(function (attachment) {
|
|
31013
|
-
return attachment.type ===
|
|
31047
|
+
return attachment.type === attachmentTypes.link;
|
|
31014
31048
|
});
|
|
31015
|
-
}, [attachments
|
|
31049
|
+
}, [attachments]);
|
|
31016
31050
|
var ogMetadataQueryBuilder = useCallback(function (url) {
|
|
31017
31051
|
try {
|
|
31018
31052
|
var client = getClient();
|
|
@@ -31041,7 +31075,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
31041
31075
|
}
|
|
31042
31076
|
}, []);
|
|
31043
31077
|
useEffect(function () {
|
|
31044
|
-
if (attachment !== null && attachment !== void 0 && attachment.id &&
|
|
31078
|
+
if (attachment !== null && attachment !== void 0 && attachment.id && attachment !== null && attachment !== void 0 && attachment.url) {
|
|
31045
31079
|
var url = attachment === null || attachment === void 0 ? void 0 : attachment.url;
|
|
31046
31080
|
if (url) {
|
|
31047
31081
|
getMetadata(url.replace('https://', '').replace('http://', '')).then(function (cachedMetadata) {
|
|
@@ -31060,7 +31094,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
31060
31094
|
});
|
|
31061
31095
|
}
|
|
31062
31096
|
}
|
|
31063
|
-
}, [attachment === null || attachment === void 0 ? void 0 : attachment.url
|
|
31097
|
+
}, [attachment === null || attachment === void 0 ? void 0 : attachment.url]);
|
|
31064
31098
|
var ogUrl = useMemo(function () {
|
|
31065
31099
|
var url = attachment === null || attachment === void 0 ? void 0 : attachment.url;
|
|
31066
31100
|
var urlObj = validateUrl(url);
|
|
@@ -36507,6 +36541,18 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
36507
36541
|
var handleEditMessage = function handleEditMessage() {
|
|
36508
36542
|
var messageTexToSend = editMessageText.trim();
|
|
36509
36543
|
if (messageTexToSend) {
|
|
36544
|
+
var linkAttachment;
|
|
36545
|
+
if (messageTexToSend) {
|
|
36546
|
+
var linkify = new LinkifyIt();
|
|
36547
|
+
var match = linkify.match(messageTexToSend);
|
|
36548
|
+
if (match) {
|
|
36549
|
+
linkAttachment = {
|
|
36550
|
+
type: attachmentTypes.link,
|
|
36551
|
+
data: match[0].url,
|
|
36552
|
+
upload: false
|
|
36553
|
+
};
|
|
36554
|
+
}
|
|
36555
|
+
}
|
|
36510
36556
|
var mentionedMembersPositions = [];
|
|
36511
36557
|
var mentionMembersToSend = [];
|
|
36512
36558
|
if (mentionedMembers && mentionedMembers.length) {
|
|
@@ -36526,7 +36572,9 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
36526
36572
|
});
|
|
36527
36573
|
}
|
|
36528
36574
|
}
|
|
36529
|
-
var messageToSend = _extends({}, messageToEdit, {
|
|
36575
|
+
var messageToSend = _extends({}, messageToEdit, linkAttachment ? {
|
|
36576
|
+
attachments: [linkAttachment]
|
|
36577
|
+
} : {}, {
|
|
36530
36578
|
metadata: mentionedMembersPositions,
|
|
36531
36579
|
bodyAttributes: messageBodyAttributes,
|
|
36532
36580
|
mentionedUsers: mentionMembersToSend,
|
|
@@ -40142,7 +40190,8 @@ var Details = function Details(_ref) {
|
|
|
40142
40190
|
tabItemsLineHeight = _ref.tabItemsLineHeight,
|
|
40143
40191
|
tabItemsMinWidth = _ref.tabItemsMinWidth,
|
|
40144
40192
|
backgroundColor = _ref.backgroundColor,
|
|
40145
|
-
bordersColor = _ref.bordersColor
|
|
40193
|
+
bordersColor = _ref.bordersColor,
|
|
40194
|
+
showPhoneNumber = _ref.showPhoneNumber;
|
|
40146
40195
|
var _useColor = useColors(),
|
|
40147
40196
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
40148
40197
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
@@ -40296,7 +40345,7 @@ var Details = function Details(_ref) {
|
|
|
40296
40345
|
color: textSecondary,
|
|
40297
40346
|
fontSize: channelMembersFontSize,
|
|
40298
40347
|
lineHeight: channelMembersLineHeight
|
|
40299
|
-
}, hideUserPresence && directChannelUser && hideUserPresence(directChannelUser) ? '' : directChannelUser && directChannelUser.presence && (directChannelUser.presence.state === USER_PRESENCE_STATUS.ONLINE ? 'Online' : directChannelUser.presence.lastActiveAt && userLastActiveDateFormat(directChannelUser.presence.lastActiveAt)))) : (/*#__PURE__*/React__default.createElement(SubTitle, {
|
|
40348
|
+
}, showPhoneNumber ? "+" + directChannelUser.id : hideUserPresence && directChannelUser && hideUserPresence(directChannelUser) ? '' : directChannelUser && directChannelUser.presence && (directChannelUser.presence.state === USER_PRESENCE_STATUS.ONLINE ? 'Online' : directChannelUser.presence.lastActiveAt && userLastActiveDateFormat(directChannelUser.presence.lastActiveAt)))) : (/*#__PURE__*/React__default.createElement(SubTitle, {
|
|
40300
40349
|
color: textSecondary,
|
|
40301
40350
|
fontSize: channelMembersFontSize,
|
|
40302
40351
|
lineHeight: channelMembersLineHeight
|
|
@@ -40572,7 +40621,8 @@ var ChannelDetailsContainer = function ChannelDetailsContainer(_ref) {
|
|
|
40572
40621
|
tabItemsFontSize = _ref.tabItemsFontSize,
|
|
40573
40622
|
tabItemsLineHeight = _ref.tabItemsLineHeight,
|
|
40574
40623
|
tabItemsMinWidth = _ref.tabItemsMinWidth,
|
|
40575
|
-
bordersColor = _ref.bordersColor
|
|
40624
|
+
bordersColor = _ref.bordersColor,
|
|
40625
|
+
showPhoneNumber = _ref.showPhoneNumber;
|
|
40576
40626
|
var channelDetailsIsOpen = useSelector(channelInfoIsOpenSelector, shallowEqual);
|
|
40577
40627
|
useEffect(function () {
|
|
40578
40628
|
setShowChannelDetails(true);
|
|
@@ -40685,7 +40735,8 @@ var ChannelDetailsContainer = function ChannelDetailsContainer(_ref) {
|
|
|
40685
40735
|
addMemberIcon: addMemberIcon,
|
|
40686
40736
|
tabItemsFontSize: tabItemsFontSize,
|
|
40687
40737
|
tabItemsLineHeight: tabItemsLineHeight,
|
|
40688
|
-
tabItemsMinWidth: tabItemsMinWidth
|
|
40738
|
+
tabItemsMinWidth: tabItemsMinWidth,
|
|
40739
|
+
showPhoneNumber: showPhoneNumber
|
|
40689
40740
|
})));
|
|
40690
40741
|
};
|
|
40691
40742
|
var DetailsWrapper = styled.div(_templateObject$W || (_templateObject$W = _taggedTemplateLiteralLoose([""])));
|