stream-chat-react 10.10.1 → 10.11.0
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 +192 -101
- package/dist/browser.full-bundle.js.map +1 -1
- package/dist/browser.full-bundle.min.js +5 -5
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/components/Channel/Channel.d.ts.map +1 -1
- package/dist/components/Channel/Channel.js +27 -8
- package/dist/components/ChannelList/hooks/useChannelVisibleListener.d.ts.map +1 -1
- package/dist/components/ChannelList/hooks/useChannelVisibleListener.js +6 -2
- package/dist/components/ChannelList/hooks/useNotificationAddedToChannelListener.d.ts.map +1 -1
- package/dist/components/ChannelList/hooks/useNotificationAddedToChannelListener.js +19 -7
- package/dist/components/ChannelList/hooks/useNotificationMessageNewListener.d.ts.map +1 -1
- package/dist/components/ChannelList/hooks/useNotificationMessageNewListener.js +6 -2
- 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 -35
- package/dist/components/Message/MessageSimple.d.ts.map +1 -1
- package/dist/components/Message/MessageSimple.js +10 -3
- package/dist/components/Message/hooks/useReactionHandler.d.ts.map +1 -1
- package/dist/components/Message/hooks/useReactionHandler.js +17 -21
- package/dist/components/MessageInput/CooldownTimer.js +1 -1
- package/dist/components/MessageInput/hooks/useCooldownTimer.d.ts.map +1 -1
- package/dist/components/MessageInput/hooks/useCooldownTimer.js +5 -2
- package/dist/context/MessageContext.d.ts +3 -1
- package/dist/context/MessageContext.d.ts.map +1 -1
- package/dist/context/TranslationContext.d.ts +1 -1
- package/dist/context/TranslationContext.d.ts.map +1 -1
- package/dist/i18n/Streami18n.d.ts +9 -3
- package/dist/i18n/Streami18n.d.ts.map +1 -1
- package/dist/i18n/Streami18n.js +18 -11
- package/dist/index.cjs.js +178 -101
- 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/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AAEvB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AAEvB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Channel, StreamChat } from 'stream-chat';
|
|
2
|
+
import type { DefaultStreamChatGenerics } from '../types/types';
|
|
3
|
+
declare type GetChannelParams<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
|
|
4
|
+
client: StreamChat<StreamChatGenerics>;
|
|
5
|
+
channel?: Channel<StreamChatGenerics>;
|
|
6
|
+
id?: string;
|
|
7
|
+
members?: string[];
|
|
8
|
+
type?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Calls channel.watch() if it was not already recently called. Waits for watch promise to resolve even if it was invoked previously.
|
|
12
|
+
* @param client
|
|
13
|
+
* @param members
|
|
14
|
+
* @param type
|
|
15
|
+
* @param id
|
|
16
|
+
* @param channel
|
|
17
|
+
*/
|
|
18
|
+
export declare const getChannel: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ channel, client, id, members, type, }: GetChannelParams<StreamChatGenerics>) => Promise<Channel<StreamChatGenerics>>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=getChannel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getChannel.d.ts","sourceRoot":"","sources":["../../src/utils/getChannel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAA2B,UAAU,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAWhE,aAAK,gBAAgB,CACnB,kBAAkB,SAAS,yBAAyB,GAAG,yBAAyB,IAC9E;IACF,MAAM,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACtC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AACF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,2MAuCtB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { __awaiter, __generator, __spreadArray } from "tslib";
|
|
2
|
+
/**
|
|
3
|
+
* prevent from duplicate invocation of channel.watch()
|
|
4
|
+
* when events 'notification.message_new' and 'notification.added_to_channel' arrive at the same time
|
|
5
|
+
*/
|
|
6
|
+
var WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL = {};
|
|
7
|
+
/**
|
|
8
|
+
* Calls channel.watch() if it was not already recently called. Waits for watch promise to resolve even if it was invoked previously.
|
|
9
|
+
* @param client
|
|
10
|
+
* @param members
|
|
11
|
+
* @param type
|
|
12
|
+
* @param id
|
|
13
|
+
* @param channel
|
|
14
|
+
*/
|
|
15
|
+
export var getChannel = function (_a) {
|
|
16
|
+
var channel = _a.channel, client = _a.client, id = _a.id, members = _a.members, type = _a.type;
|
|
17
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
18
|
+
var theChannel, originalCid, queryPromise;
|
|
19
|
+
return __generator(this, function (_b) {
|
|
20
|
+
switch (_b.label) {
|
|
21
|
+
case 0:
|
|
22
|
+
if (!channel && !type) {
|
|
23
|
+
throw new Error('Channel or channel type have to be provided to query a channel.');
|
|
24
|
+
}
|
|
25
|
+
theChannel = channel || client.channel(type, id, { members: members });
|
|
26
|
+
originalCid = (theChannel === null || theChannel === void 0 ? void 0 : theChannel.id)
|
|
27
|
+
? theChannel.cid
|
|
28
|
+
: members && members.length
|
|
29
|
+
? generateChannelTempCid(theChannel.type, members)
|
|
30
|
+
: undefined;
|
|
31
|
+
if (!originalCid) {
|
|
32
|
+
throw new Error('Channel ID or channel members array have to be provided to query a channel.');
|
|
33
|
+
}
|
|
34
|
+
queryPromise = WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid];
|
|
35
|
+
if (!queryPromise) return [3 /*break*/, 2];
|
|
36
|
+
return [4 /*yield*/, queryPromise];
|
|
37
|
+
case 1:
|
|
38
|
+
_b.sent();
|
|
39
|
+
return [3 /*break*/, 4];
|
|
40
|
+
case 2:
|
|
41
|
+
WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid] = theChannel.watch();
|
|
42
|
+
return [4 /*yield*/, WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid]];
|
|
43
|
+
case 3:
|
|
44
|
+
_b.sent();
|
|
45
|
+
delete WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid];
|
|
46
|
+
_b.label = 4;
|
|
47
|
+
case 4: return [2 /*return*/, theChannel];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
// Channels created without ID need to be referenced by an identifier until the back-end generates the final ID.
|
|
53
|
+
var generateChannelTempCid = function (channelType, members) {
|
|
54
|
+
if (!members)
|
|
55
|
+
return;
|
|
56
|
+
var membersStr = __spreadArray([], members, true).sort().join(',');
|
|
57
|
+
return "".concat(channelType, ":!members-").concat(membersStr);
|
|
58
|
+
};
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "10.
|
|
1
|
+
export declare const version = "10.11.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export var version = '10.
|
|
1
|
+
export var version = '10.11.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stream-chat-react",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.11.0",
|
|
4
4
|
"description": "React components to create chat conversations or livestream style chat",
|
|
5
5
|
"author": "GetStream",
|
|
6
6
|
"homepage": "https://getstream.io/chat/",
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"i18next-parser": "^6.0.0",
|
|
154
154
|
"jest": "^26.6.3",
|
|
155
155
|
"jest-axe": "^6.0.0",
|
|
156
|
-
"moment": "^
|
|
156
|
+
"moment-timezone": "^0.5.43",
|
|
157
157
|
"postcss": "^8.1.10",
|
|
158
158
|
"postcss-loader": "^4.1.0",
|
|
159
159
|
"prettier": "^2.2.0",
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
"rollup-plugin-url": "^3.0.1",
|
|
170
170
|
"rollup-plugin-visualizer": "^4.2.0",
|
|
171
171
|
"semantic-release": "^19.0.5",
|
|
172
|
-
"stream-chat": "^8.
|
|
172
|
+
"stream-chat": "^8.12.0",
|
|
173
173
|
"style-loader": "^2.0.0",
|
|
174
174
|
"ts-jest": "^26.5.1",
|
|
175
175
|
"typescript": "^4.7.4",
|