stream-chat-react 10.10.0 → 10.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.full-bundle.js +397 -392
- package/dist/browser.full-bundle.js.map +1 -1
- package/dist/browser.full-bundle.min.js +5 -20
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/components/Attachment/Attachment.js +1 -31
- package/dist/components/Attachment/AttachmentContainer.js +1 -11
- package/dist/components/Attachment/Audio.js +1 -11
- package/dist/components/Attachment/Card.js +1 -11
- package/dist/components/Attachment/utils.js +1 -11
- package/dist/components/AutoCompleteTextarea/List.js +1 -11
- package/dist/components/AutoCompleteTextarea/Textarea.js +1 -37
- package/dist/components/Channel/Channel.d.ts.map +1 -1
- package/dist/components/Channel/Channel.js +28 -66
- package/dist/components/Channel/channelState.js +1 -20
- package/dist/components/Channel/emojiData.js +1 -11
- package/dist/components/Channel/utils.d.ts +0 -4
- package/dist/components/Channel/utils.d.ts.map +1 -1
- package/dist/components/Channel/utils.js +1 -9
- package/dist/components/ChannelList/ChannelList.js +1 -47
- package/dist/components/ChannelList/hooks/useChannelDeletedListener.js +1 -9
- package/dist/components/ChannelList/hooks/useChannelHiddenListener.js +1 -9
- package/dist/components/ChannelList/hooks/useChannelTruncatedListener.js +1 -9
- package/dist/components/ChannelList/hooks/useChannelUpdatedListener.js +1 -20
- package/dist/components/ChannelList/hooks/useChannelVisibleListener.d.ts.map +1 -1
- package/dist/components/ChannelList/hooks/useChannelVisibleListener.js +7 -47
- package/dist/components/ChannelList/hooks/useMessageNewListener.js +1 -9
- package/dist/components/ChannelList/hooks/useNotificationAddedToChannelListener.d.ts.map +1 -1
- package/dist/components/ChannelList/hooks/useNotificationAddedToChannelListener.js +20 -52
- package/dist/components/ChannelList/hooks/useNotificationMessageNewListener.d.ts.map +1 -1
- package/dist/components/ChannelList/hooks/useNotificationMessageNewListener.js +7 -47
- package/dist/components/ChannelList/hooks/usePaginatedChannels.js +1 -56
- package/dist/components/ChannelList/hooks/useUserPresenceChangedListener.js +1 -9
- package/dist/components/ChannelList/utils.d.ts +1 -8
- package/dist/components/ChannelList/utils.d.ts.map +1 -1
- package/dist/components/ChannelList/utils.js +1 -79
- package/dist/components/ChannelPreview/ChannelPreview.js +1 -11
- package/dist/components/ChannelSearch/ChannelSearch.js +1 -11
- package/dist/components/ChannelSearch/SearchBar.js +1 -22
- package/dist/components/ChannelSearch/hooks/useChannelSearch.js +1 -56
- package/dist/components/Chat/hooks/useChat.d.ts +0 -1
- package/dist/components/Chat/hooks/useChat.d.ts.map +1 -1
- package/dist/components/Chat/hooks/useChat.js +1 -47
- package/dist/components/EventComponent/EventComponent.js +1 -11
- package/dist/components/Gallery/Gallery.js +1 -11
- package/dist/components/Gallery/Image.js +1 -11
- package/dist/components/InfiniteScrollPaginator/InfiniteScroll.js +1 -22
- package/dist/components/MML/MML.js +1 -36
- package/dist/components/Message/Message.js +1 -22
- package/dist/components/Message/MessageSimple.js +1 -11
- package/dist/components/Message/hooks/useActionHandler.js +1 -47
- package/dist/components/Message/hooks/useDeleteHandler.js +1 -36
- package/dist/components/Message/hooks/useEditHandler.d.ts +1 -0
- package/dist/components/Message/hooks/useEditHandler.d.ts.map +1 -1
- package/dist/components/Message/hooks/useFlagHandler.js +1 -36
- package/dist/components/Message/hooks/useMuteHandler.js +1 -36
- package/dist/components/Message/hooks/usePinHandler.js +1 -47
- package/dist/components/Message/hooks/useReactionHandler.js +1 -56
- package/dist/components/Message/hooks/useRetryHandler.js +1 -36
- package/dist/components/Message/hooks/useUserHandler.d.ts +1 -0
- package/dist/components/Message/hooks/useUserHandler.d.ts.map +1 -1
- package/dist/components/Message/types.d.ts +1 -0
- package/dist/components/Message/types.d.ts.map +1 -1
- package/dist/components/Message/utils.js +1 -9
- package/dist/components/MessageActions/MessageActions.js +1 -11
- package/dist/components/MessageInput/DefaultTriggerProvider.js +1 -11
- package/dist/components/MessageInput/DropzoneProvider.js +1 -11
- package/dist/components/MessageInput/MessageInput.js +1 -11
- package/dist/components/MessageInput/MessageInputFlat.js +1 -11
- package/dist/components/MessageInput/hooks/useCooldownTimer.js +1 -9
- package/dist/components/MessageInput/hooks/useFileUploads.js +1 -36
- package/dist/components/MessageInput/hooks/useImageUploads.js +1 -47
- package/dist/components/MessageInput/hooks/useLinkPreviews.js +1 -22
- package/dist/components/MessageInput/hooks/useMessageInputState.js +1 -11
- package/dist/components/MessageInput/hooks/usePasteHandler.js +1 -36
- package/dist/components/MessageInput/hooks/useSubmitHandler.js +1 -67
- package/dist/components/MessageInput/hooks/useUserTrigger.js +1 -56
- package/dist/components/MessageInput/hooks/utils.js +1 -36
- package/dist/components/MessageInput/icons.js +1 -22
- package/dist/components/MessageList/MessageList.js +1 -58
- package/dist/components/MessageList/VirtualizedMessageList.js +1 -47
- package/dist/components/MessageList/hooks/useMessageListElements.js +1 -11
- package/dist/components/MessageList/utils.d.ts +1 -0
- package/dist/components/MessageList/utils.d.ts.map +1 -1
- package/dist/components/ReactFileUtilities/FileIcon/FileIcon.js +1 -22
- package/dist/components/ReactFileUtilities/FileIcon/FileIconSet/v1.js +1 -22
- package/dist/components/ReactFileUtilities/FileIcon/FileIconSet/v2.js +1 -22
- package/dist/components/ReactFileUtilities/FileIcon/iconMap.js +1 -11
- package/dist/components/ReactFileUtilities/FilePreviewer.js +1 -11
- package/dist/components/ReactFileUtilities/ImageDropzone.js +1 -11
- package/dist/components/ReactFileUtilities/UploadButton.js +1 -22
- package/dist/components/ReactFileUtilities/icons/FilePlaceholderIcon.js +1 -11
- package/dist/components/ReactFileUtilities/utils.d.ts +2 -1
- package/dist/components/ReactFileUtilities/utils.d.ts.map +1 -1
- package/dist/components/ReactFileUtilities/utils.js +4 -38
- package/dist/components/Reactions/ReactionSelector.js +1 -11
- package/dist/components/Reactions/ReactionsList.js +1 -22
- package/dist/components/Reactions/SimpleReactionsList.js +1 -22
- package/dist/components/Thread/Thread.js +1 -11
- package/dist/components/Thread/ThreadHead.js +1 -11
- package/dist/components/Tooltip/Tooltip.js +1 -22
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/context/ChannelActionContext.js +1 -11
- package/dist/context/ChannelStateContext.js +1 -11
- package/dist/context/ChatContext.js +1 -11
- package/dist/context/ComponentContext.js +1 -11
- package/dist/context/EmojiContext.js +1 -11
- package/dist/context/MessageContext.js +1 -11
- package/dist/context/TranslationContext.js +1 -11
- package/dist/context/TypingContext.js +1 -11
- package/dist/i18n/Streami18n.js +1 -47
- package/dist/index.cjs.js +137 -69
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/utils/getChannel.d.ts +20 -0
- package/dist/utils/getChannel.d.ts.map +1 -0
- package/dist/utils/getChannel.js +58 -0
- package/dist/utils.js +1 -31
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/css/index.css.map +0 -1
- package/dist/css/v2/index.css.map +0 -1
- package/dist/css/v2/index.layout.css.map +0 -1
- package/dist/stories/add-message.stories.d.ts +0 -3
- package/dist/stories/add-message.stories.d.ts.map +0 -1
- package/dist/stories/add-message.stories.js +0 -53
- package/dist/stories/attachment-sizing.stories.d.ts +0 -2
- package/dist/stories/attachment-sizing.stories.d.ts.map +0 -1
- package/dist/stories/attachment-sizing.stories.js +0 -179
- package/dist/stories/edit-message.stories.d.ts +0 -2
- package/dist/stories/edit-message.stories.d.ts.map +0 -1
- package/dist/stories/edit-message.stories.js +0 -49
- package/dist/stories/hello.stories.d.ts +0 -3
- package/dist/stories/hello.stories.d.ts.map +0 -1
- package/dist/stories/hello.stories.js +0 -31
- package/dist/stories/jump-to-message.stories.d.ts +0 -3
- package/dist/stories/jump-to-message.stories.d.ts.map +0 -1
- package/dist/stories/jump-to-message.stories.js +0 -77
- package/dist/stories/mark-read.stories.d.ts +0 -3
- package/dist/stories/mark-read.stories.d.ts.map +0 -1
- package/dist/stories/mark-read.stories.js +0 -53
- package/dist/stories/message-status-readby-tooltip.stories.d.ts +0 -3
- package/dist/stories/message-status-readby-tooltip.stories.d.ts.map +0 -1
- package/dist/stories/message-status-readby-tooltip.stories.js +0 -57
- package/dist/stories/navigate-long-message-lists.stories.d.ts +0 -2
- package/dist/stories/navigate-long-message-lists.stories.d.ts.map +0 -1
- package/dist/stories/navigate-long-message-lists.stories.js +0 -179
- package/dist/stories/pin-message.stories.d.ts +0 -2
- package/dist/stories/pin-message.stories.d.ts.map +0 -1
- package/dist/stories/pin-message.stories.js +0 -98
- package/dist/stories/toggle-message-actions.stories.d.ts +0 -2
- package/dist/stories/toggle-message-actions.stories.d.ts.map +0 -1
- package/dist/stories/toggle-message-actions.stories.js +0 -35
- package/dist/stories/utils.d.ts +0 -26
- package/dist/stories/utils.d.ts.map +0 -1
- package/dist/stories/utils.js +0 -50
package/dist/index.cjs.js
CHANGED
|
@@ -115,7 +115,7 @@ var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
|
115
115
|
var nimbleEmoji__default = /*#__PURE__*/_interopDefaultLegacy(nimbleEmoji);
|
|
116
116
|
var nimblePicker__default = /*#__PURE__*/_interopDefaultLegacy(nimblePicker);
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
/******************************************************************************
|
|
119
119
|
Copyright (c) Microsoft Corporation.
|
|
120
120
|
|
|
121
121
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -169,7 +169,7 @@ function __generator(thisArg, body) {
|
|
|
169
169
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
170
170
|
function step(op) {
|
|
171
171
|
if (f) throw new TypeError("Generator is already executing.");
|
|
172
|
-
while (_) try {
|
|
172
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
173
173
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
174
174
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
175
175
|
switch (op[0]) {
|
|
@@ -215,8 +215,13 @@ function __spreadArray(to, from, pack) {
|
|
|
215
215
|
ar[i] = from[i];
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
return to.concat(ar || from);
|
|
219
|
-
}
|
|
218
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
222
|
+
var e = new Error(message);
|
|
223
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
224
|
+
};
|
|
220
225
|
|
|
221
226
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
222
227
|
|
|
@@ -2038,7 +2043,7 @@ var RetryIcon$1 = function () { return (React__default["default"].createElement(
|
|
|
2038
2043
|
|
|
2039
2044
|
var useHandleFileChangeWrapper = function (resetOnChange, handler) {
|
|
2040
2045
|
if (resetOnChange === void 0) { resetOnChange = false; }
|
|
2041
|
-
return function (_a) {
|
|
2046
|
+
return React.useCallback(function (_a) {
|
|
2042
2047
|
var currentTarget = _a.currentTarget;
|
|
2043
2048
|
var files = currentTarget.files;
|
|
2044
2049
|
if (!files)
|
|
@@ -2051,7 +2056,7 @@ var useHandleFileChangeWrapper = function (resetOnChange, handler) {
|
|
|
2051
2056
|
}
|
|
2052
2057
|
if (resetOnChange)
|
|
2053
2058
|
currentTarget.value = '';
|
|
2054
|
-
};
|
|
2059
|
+
}, [handler, resetOnChange]);
|
|
2055
2060
|
};
|
|
2056
2061
|
function dataTransferItemsHaveFiles(items) {
|
|
2057
2062
|
if (!items || !items.length) {
|
|
@@ -32878,6 +32883,64 @@ var makeAddNotifications = function (setNotifications, notificationTimeouts) { r
|
|
|
32878
32883
|
notificationTimeouts.push(timeout);
|
|
32879
32884
|
}; };
|
|
32880
32885
|
|
|
32886
|
+
/**
|
|
32887
|
+
* prevent from duplicate invocation of channel.watch()
|
|
32888
|
+
* when events 'notification.message_new' and 'notification.added_to_channel' arrive at the same time
|
|
32889
|
+
*/
|
|
32890
|
+
var WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL = {};
|
|
32891
|
+
/**
|
|
32892
|
+
* Calls channel.watch() if it was not already recently called. Waits for watch promise to resolve even if it was invoked previously.
|
|
32893
|
+
* @param client
|
|
32894
|
+
* @param members
|
|
32895
|
+
* @param type
|
|
32896
|
+
* @param id
|
|
32897
|
+
* @param channel
|
|
32898
|
+
*/
|
|
32899
|
+
var getChannel = function (_a) {
|
|
32900
|
+
var channel = _a.channel, client = _a.client, id = _a.id, members = _a.members, type = _a.type;
|
|
32901
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
32902
|
+
var theChannel, originalCid, queryPromise;
|
|
32903
|
+
return __generator(this, function (_b) {
|
|
32904
|
+
switch (_b.label) {
|
|
32905
|
+
case 0:
|
|
32906
|
+
if (!channel && !type) {
|
|
32907
|
+
throw new Error('Channel or channel type have to be provided to query a channel.');
|
|
32908
|
+
}
|
|
32909
|
+
theChannel = channel || client.channel(type, id, { members: members });
|
|
32910
|
+
originalCid = (theChannel === null || theChannel === void 0 ? void 0 : theChannel.id)
|
|
32911
|
+
? theChannel.cid
|
|
32912
|
+
: members && members.length
|
|
32913
|
+
? generateChannelTempCid(theChannel.type, members)
|
|
32914
|
+
: undefined;
|
|
32915
|
+
if (!originalCid) {
|
|
32916
|
+
throw new Error('Channel ID or channel members array have to be provided to query a channel.');
|
|
32917
|
+
}
|
|
32918
|
+
queryPromise = WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid];
|
|
32919
|
+
if (!queryPromise) return [3 /*break*/, 2];
|
|
32920
|
+
return [4 /*yield*/, queryPromise];
|
|
32921
|
+
case 1:
|
|
32922
|
+
_b.sent();
|
|
32923
|
+
return [3 /*break*/, 4];
|
|
32924
|
+
case 2:
|
|
32925
|
+
WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid] = theChannel.watch();
|
|
32926
|
+
return [4 /*yield*/, WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid]];
|
|
32927
|
+
case 3:
|
|
32928
|
+
_b.sent();
|
|
32929
|
+
delete WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid];
|
|
32930
|
+
_b.label = 4;
|
|
32931
|
+
case 4: return [2 /*return*/, theChannel];
|
|
32932
|
+
}
|
|
32933
|
+
});
|
|
32934
|
+
});
|
|
32935
|
+
};
|
|
32936
|
+
// Channels created without ID need to be referenced by an identifier until the back-end generates the final ID.
|
|
32937
|
+
var generateChannelTempCid = function (channelType, members) {
|
|
32938
|
+
if (!members)
|
|
32939
|
+
return;
|
|
32940
|
+
var membersStr = __spreadArray([], members, true).sort().join(',');
|
|
32941
|
+
return "".concat(channelType, ":!members-").concat(membersStr);
|
|
32942
|
+
};
|
|
32943
|
+
|
|
32881
32944
|
var useChannelContainerClasses = function (_a) {
|
|
32882
32945
|
var _b, _c, _d;
|
|
32883
32946
|
var customClasses = _a.customClasses;
|
|
@@ -33120,22 +33183,40 @@ var ChannelInner = function (props) {
|
|
|
33120
33183
|
markRead();
|
|
33121
33184
|
};
|
|
33122
33185
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
33123
|
-
var config, e_1;
|
|
33124
|
-
|
|
33125
|
-
|
|
33186
|
+
var members, _i, _a, member, userId, _b, user, user_id, config, e_1;
|
|
33187
|
+
var _c;
|
|
33188
|
+
return __generator(this, function (_d) {
|
|
33189
|
+
switch (_d.label) {
|
|
33126
33190
|
case 0:
|
|
33127
33191
|
if (!!channel.initialized) return [3 /*break*/, 4];
|
|
33128
|
-
|
|
33192
|
+
_d.label = 1;
|
|
33129
33193
|
case 1:
|
|
33130
|
-
|
|
33131
|
-
|
|
33194
|
+
_d.trys.push([1, 3, , 4]);
|
|
33195
|
+
members = [];
|
|
33196
|
+
if (!channel.id && ((_c = channel.data) === null || _c === void 0 ? void 0 : _c.members)) {
|
|
33197
|
+
for (_i = 0, _a = channel.data.members; _i < _a.length; _i++) {
|
|
33198
|
+
member = _a[_i];
|
|
33199
|
+
userId = void 0;
|
|
33200
|
+
if (typeof member === 'string') {
|
|
33201
|
+
userId = member;
|
|
33202
|
+
}
|
|
33203
|
+
else if (typeof member === 'object') {
|
|
33204
|
+
_b = member, user = _b.user, user_id = _b.user_id;
|
|
33205
|
+
userId = user_id || (user === null || user === void 0 ? void 0 : user.id);
|
|
33206
|
+
}
|
|
33207
|
+
if (userId) {
|
|
33208
|
+
members.push(userId);
|
|
33209
|
+
}
|
|
33210
|
+
}
|
|
33211
|
+
}
|
|
33212
|
+
return [4 /*yield*/, getChannel({ channel: channel, client: client, members: members })];
|
|
33132
33213
|
case 2:
|
|
33133
|
-
|
|
33214
|
+
_d.sent();
|
|
33134
33215
|
config = channel.getConfig();
|
|
33135
33216
|
setChannelConfig(config);
|
|
33136
33217
|
return [3 /*break*/, 4];
|
|
33137
33218
|
case 3:
|
|
33138
|
-
e_1 =
|
|
33219
|
+
e_1 = _d.sent();
|
|
33139
33220
|
dispatch({ error: e_1, type: 'setError' });
|
|
33140
33221
|
errored = true;
|
|
33141
33222
|
return [3 /*break*/, 4];
|
|
@@ -33867,52 +33948,6 @@ var useChannelUpdatedListener = function (setChannels, customHandler, forceUpdat
|
|
|
33867
33948
|
}, [customHandler]);
|
|
33868
33949
|
};
|
|
33869
33950
|
|
|
33870
|
-
/**
|
|
33871
|
-
* prevent from duplicate invocation of channel.watch()
|
|
33872
|
-
* when events 'notification.message_new' and 'notification.added_to_channel' arrive at the same time
|
|
33873
|
-
*/
|
|
33874
|
-
var WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL = {};
|
|
33875
|
-
/**
|
|
33876
|
-
* Calls channel.watch() if it was not already recently called. Waits for watch promise to resolve even if it was invoked previously.
|
|
33877
|
-
* @param client
|
|
33878
|
-
* @param type
|
|
33879
|
-
* @param id
|
|
33880
|
-
*/
|
|
33881
|
-
var getChannel = function (client, type, id) { return __awaiter(void 0, void 0, void 0, function () {
|
|
33882
|
-
var channel, queryPromise;
|
|
33883
|
-
return __generator(this, function (_a) {
|
|
33884
|
-
switch (_a.label) {
|
|
33885
|
-
case 0:
|
|
33886
|
-
channel = client.channel(type, id);
|
|
33887
|
-
queryPromise = WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[channel.cid];
|
|
33888
|
-
if (!queryPromise) return [3 /*break*/, 2];
|
|
33889
|
-
return [4 /*yield*/, queryPromise];
|
|
33890
|
-
case 1:
|
|
33891
|
-
_a.sent();
|
|
33892
|
-
return [3 /*break*/, 4];
|
|
33893
|
-
case 2:
|
|
33894
|
-
WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[channel.cid] = channel.watch();
|
|
33895
|
-
return [4 /*yield*/, WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[channel.cid]];
|
|
33896
|
-
case 3:
|
|
33897
|
-
_a.sent();
|
|
33898
|
-
WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[channel.cid] = undefined;
|
|
33899
|
-
_a.label = 4;
|
|
33900
|
-
case 4: return [2 /*return*/, channel];
|
|
33901
|
-
}
|
|
33902
|
-
});
|
|
33903
|
-
}); };
|
|
33904
|
-
var MAX_QUERY_CHANNELS_LIMIT = 30;
|
|
33905
|
-
var moveChannelUp = function (_a) {
|
|
33906
|
-
var activeChannel = _a.activeChannel, channels = _a.channels, cid = _a.cid;
|
|
33907
|
-
// get index of channel to move up
|
|
33908
|
-
var channelIndex = channels.findIndex(function (channel) { return channel.cid === cid; });
|
|
33909
|
-
if (!activeChannel && channelIndex <= 0)
|
|
33910
|
-
return channels;
|
|
33911
|
-
// get channel to move up
|
|
33912
|
-
var channel = activeChannel || channels[channelIndex];
|
|
33913
|
-
return uniqBy__default["default"](__spreadArray([channel], channels, true), 'cid');
|
|
33914
|
-
};
|
|
33915
|
-
|
|
33916
33951
|
var useChannelVisibleListener = function (setChannels, customHandler) {
|
|
33917
33952
|
var client = useChatContext('useChannelVisibleListener').client;
|
|
33918
33953
|
React.useEffect(function () {
|
|
@@ -33926,7 +33961,11 @@ var useChannelVisibleListener = function (setChannels, customHandler) {
|
|
|
33926
33961
|
return [3 /*break*/, 3];
|
|
33927
33962
|
case 1:
|
|
33928
33963
|
if (!(event.type && event.channel_type && event.channel_id)) return [3 /*break*/, 3];
|
|
33929
|
-
return [4 /*yield*/, getChannel(
|
|
33964
|
+
return [4 /*yield*/, getChannel({
|
|
33965
|
+
client: client,
|
|
33966
|
+
id: event.channel_id,
|
|
33967
|
+
type: event.channel_type,
|
|
33968
|
+
})];
|
|
33930
33969
|
case 2:
|
|
33931
33970
|
channel_1 = _a.sent();
|
|
33932
33971
|
setChannels(function (channels) { return uniqBy__default["default"](__spreadArray([channel_1], channels, true), 'cid'); });
|
|
@@ -33957,6 +33996,18 @@ var useConnectionRecoveredListener = function (forceUpdate) {
|
|
|
33957
33996
|
}, []);
|
|
33958
33997
|
};
|
|
33959
33998
|
|
|
33999
|
+
var MAX_QUERY_CHANNELS_LIMIT = 30;
|
|
34000
|
+
var moveChannelUp = function (_a) {
|
|
34001
|
+
var activeChannel = _a.activeChannel, channels = _a.channels, cid = _a.cid;
|
|
34002
|
+
// get index of channel to move up
|
|
34003
|
+
var channelIndex = channels.findIndex(function (channel) { return channel.cid === cid; });
|
|
34004
|
+
if (!activeChannel && channelIndex <= 0)
|
|
34005
|
+
return channels;
|
|
34006
|
+
// get channel to move up
|
|
34007
|
+
var channel = activeChannel || channels[channelIndex];
|
|
34008
|
+
return uniqBy__default["default"](__spreadArray([channel], channels, true), 'cid');
|
|
34009
|
+
};
|
|
34010
|
+
|
|
33960
34011
|
var useMessageNewListener = function (setChannels, lockChannelOrder, allowNewMessagesFromUnfilteredChannels) {
|
|
33961
34012
|
if (lockChannelOrder === void 0) { lockChannelOrder = false; }
|
|
33962
34013
|
if (allowNewMessagesFromUnfilteredChannels === void 0) { allowNewMessagesFromUnfilteredChannels = true; }
|
|
@@ -34004,20 +34055,32 @@ var useNotificationAddedToChannelListener = function (setChannels, customHandler
|
|
|
34004
34055
|
React.useEffect(function () {
|
|
34005
34056
|
var handleEvent = function (event) { return __awaiter(void 0, void 0, void 0, function () {
|
|
34006
34057
|
var channel_1;
|
|
34007
|
-
var _a;
|
|
34008
|
-
return __generator(this, function (
|
|
34009
|
-
switch (
|
|
34058
|
+
var _a, _b;
|
|
34059
|
+
return __generator(this, function (_c) {
|
|
34060
|
+
switch (_c.label) {
|
|
34010
34061
|
case 0:
|
|
34011
34062
|
if (!(customHandler && typeof customHandler === 'function')) return [3 /*break*/, 1];
|
|
34012
34063
|
customHandler(setChannels, event);
|
|
34013
34064
|
return [3 /*break*/, 3];
|
|
34014
34065
|
case 1:
|
|
34015
34066
|
if (!(allowNewMessagesFromUnfilteredChannels && ((_a = event.channel) === null || _a === void 0 ? void 0 : _a.type))) return [3 /*break*/, 3];
|
|
34016
|
-
return [4 /*yield*/, getChannel(
|
|
34067
|
+
return [4 /*yield*/, getChannel({
|
|
34068
|
+
client: client,
|
|
34069
|
+
id: event.channel.id,
|
|
34070
|
+
members: (_b = event.channel.members) === null || _b === void 0 ? void 0 : _b.reduce(function (acc, _a) {
|
|
34071
|
+
var user = _a.user, user_id = _a.user_id;
|
|
34072
|
+
var userId = user_id || (user === null || user === void 0 ? void 0 : user.id);
|
|
34073
|
+
if (userId) {
|
|
34074
|
+
acc.push(userId);
|
|
34075
|
+
}
|
|
34076
|
+
return acc;
|
|
34077
|
+
}, []),
|
|
34078
|
+
type: event.channel.type,
|
|
34079
|
+
})];
|
|
34017
34080
|
case 2:
|
|
34018
|
-
channel_1 =
|
|
34081
|
+
channel_1 = _c.sent();
|
|
34019
34082
|
setChannels(function (channels) { return uniqBy__default["default"](__spreadArray([channel_1], channels, true), 'cid'); });
|
|
34020
|
-
|
|
34083
|
+
_c.label = 3;
|
|
34021
34084
|
case 3: return [2 /*return*/];
|
|
34022
34085
|
}
|
|
34023
34086
|
});
|
|
@@ -34044,7 +34107,11 @@ var useNotificationMessageNewListener = function (setChannels, customHandler, al
|
|
|
34044
34107
|
return [3 /*break*/, 3];
|
|
34045
34108
|
case 1:
|
|
34046
34109
|
if (!(allowNewMessagesFromUnfilteredChannels && ((_a = event.channel) === null || _a === void 0 ? void 0 : _a.type))) return [3 /*break*/, 3];
|
|
34047
|
-
return [4 /*yield*/, getChannel(
|
|
34110
|
+
return [4 /*yield*/, getChannel({
|
|
34111
|
+
client: client,
|
|
34112
|
+
id: event.channel.id,
|
|
34113
|
+
type: event.channel.type,
|
|
34114
|
+
})];
|
|
34048
34115
|
case 2:
|
|
34049
34116
|
channel_1 = _b.sent();
|
|
34050
34117
|
setChannels(function (channels) { return uniqBy__default["default"](__spreadArray([channel_1], channels, true), 'cid'); });
|
|
@@ -34801,7 +34868,7 @@ var UnMemoizedChannelList = function (props) {
|
|
|
34801
34868
|
*/
|
|
34802
34869
|
var ChannelList = React__default["default"].memo(UnMemoizedChannelList);
|
|
34803
34870
|
|
|
34804
|
-
var version = '10.10.
|
|
34871
|
+
var version = '10.10.2';
|
|
34805
34872
|
|
|
34806
34873
|
var useChat = function (_a) {
|
|
34807
34874
|
var _b, _c;
|
|
@@ -36999,6 +37066,7 @@ exports.TypingProvider = TypingProvider;
|
|
|
36999
37066
|
exports.UnMemoizedLoadMorePaginator = UnMemoizedLoadMorePaginator;
|
|
37000
37067
|
exports.UnsupportedAttachment = UnsupportedAttachment;
|
|
37001
37068
|
exports.UnsupportedAttachmentContainer = UnsupportedAttachmentContainer;
|
|
37069
|
+
exports.UploadButton = UploadButton;
|
|
37002
37070
|
exports.UploadIcon = UploadIcon;
|
|
37003
37071
|
exports.UploadsPreview = UploadsPreview;
|
|
37004
37072
|
exports.UserItem = UserItem;
|