@stream-io/video-react-sdk 0.0.1-alpha.95 → 0.0.1-alpha.97
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/CHANGELOG.md +13 -0
- package/dist/src/components/PendingCallPanel/PendingCallPanel.d.ts +13 -1
- package/dist/src/components/PendingCallPanel/PendingCallPanel.js +18 -9
- package/dist/src/components/PendingCallPanel/PendingCallPanel.js.map +1 -1
- package/package.json +5 -5
- package/src/components/PendingCallPanel/PendingCallPanel.tsx +35 -13
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.0.1-alpha.97](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-0.0.1-alpha.96...@stream-io/video-react-sdk-0.0.1-alpha.97) (2023-05-30)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* integrate the new call ring flow ([#562](https://github.com/GetStream/stream-video-js/issues/562)) ([c407961](https://github.com/GetStream/stream-video-js/commit/c4079614cb962e098215c0061690d59c35882cd8))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.0.1-alpha.96](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-0.0.1-alpha.95...@stream-io/video-react-sdk-0.0.1-alpha.96) (2023-05-30)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
5
18
|
## [0.0.1-alpha.95](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-0.0.1-alpha.94...@stream-io/video-react-sdk-0.0.1-alpha.95) (2023-05-30)
|
|
6
19
|
|
|
7
20
|
|
|
@@ -1,2 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export
|
|
2
|
+
export type PendingCallPanelProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Whether to include the current user in the list of members to show.
|
|
5
|
+
* @default false.
|
|
6
|
+
*/
|
|
7
|
+
includeSelf?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* The maximum number of members to show.
|
|
10
|
+
* @default 3.
|
|
11
|
+
*/
|
|
12
|
+
totalMembersToShow?: number;
|
|
13
|
+
};
|
|
14
|
+
export declare const PendingCallPanel: (props: PendingCallPanelProps) => JSX.Element | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CallingState } from '@stream-io/video-client';
|
|
3
|
-
import { useCall, useCallCallingState, useCallMembers,
|
|
3
|
+
import { useCall, useCallCallingState, useCallMembers, useConnectedUser, useI18n, } from '@stream-io/video-react-bindings';
|
|
4
4
|
import { Avatar } from '../Avatar';
|
|
5
5
|
import { PendingCallControls } from './PendingCallControls';
|
|
6
6
|
const CALLING_STATE_TO_LABEL = {
|
|
@@ -14,20 +14,29 @@ const CALLING_STATE_TO_LABEL = {
|
|
|
14
14
|
[CallingState.JOINED]: 'Joined',
|
|
15
15
|
[CallingState.LEFT]: 'Left call',
|
|
16
16
|
};
|
|
17
|
-
export const PendingCallPanel = () => {
|
|
17
|
+
export const PendingCallPanel = (props) => {
|
|
18
|
+
const { includeSelf = false, totalMembersToShow = 3 } = props;
|
|
18
19
|
const call = useCall();
|
|
19
20
|
const callingState = useCallCallingState();
|
|
20
21
|
const { t } = useI18n();
|
|
21
|
-
const metadata = useCallMetadata();
|
|
22
22
|
const members = useCallMembers();
|
|
23
|
+
const connectedUser = useConnectedUser();
|
|
23
24
|
if (!call)
|
|
24
25
|
return null;
|
|
25
|
-
|
|
26
|
-
const membersToShow =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
// take the first N members to show their avatars
|
|
27
|
+
const membersToShow = (members || [])
|
|
28
|
+
.slice(0, totalMembersToShow)
|
|
29
|
+
.map(({ user }) => user)
|
|
30
|
+
.filter((user) => user.id !== (connectedUser === null || connectedUser === void 0 ? void 0 : connectedUser.id) || includeSelf);
|
|
31
|
+
if (includeSelf &&
|
|
32
|
+
!membersToShow.find((user) => user.id === (connectedUser === null || connectedUser === void 0 ? void 0 : connectedUser.id))) {
|
|
33
|
+
// if the current user is not in the initial batch of members,
|
|
34
|
+
// add it to the beginning of the list
|
|
35
|
+
const self = members.find(({ user }) => user.id === (connectedUser === null || connectedUser === void 0 ? void 0 : connectedUser.id));
|
|
36
|
+
if (self) {
|
|
37
|
+
membersToShow.splice(0, 1, self.user);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
31
40
|
const callingStateLabel = CALLING_STATE_TO_LABEL[callingState];
|
|
32
41
|
return (_jsxs("div", Object.assign({ className: "str-video__call-panel str-video__call-panel--pending" }, { children: [_jsx("div", Object.assign({ className: "str-video__call-panel__members-list" }, { children: membersToShow.map((user) => (_jsxs("div", Object.assign({ className: "str-video__call-panel__member-box" }, { children: [_jsx(Avatar, { name: user.name, imageSrc: user.image }), user.name && (_jsx("div", Object.assign({ className: "str-video__member_details" }, { children: _jsx("span", Object.assign({ className: "str-video__member_name" }, { children: user.name })) })))] }), user.id))) })), callingStateLabel && (_jsx("div", Object.assign({ className: "str-video__call-panel__calling-state-label" }, { children: t(callingStateLabel) }))), [CallingState.RINGING, CallingState.JOINING].includes(callingState) && (_jsx(PendingCallControls, {}))] })));
|
|
33
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PendingCallPanel.js","sourceRoot":"","sources":["../../../../src/components/PendingCallPanel/PendingCallPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"PendingCallPanel.js","sourceRoot":"","sources":["../../../../src/components/PendingCallPanel/PendingCallPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAgB,MAAM,yBAAyB,CAAC;AACrE,OAAO,EACL,OAAO,EACP,mBA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AAK,SAAS,EAAC,4CAA4C,gBACxD,CAAC,CAAC,iBAAiB,CAAC,IACjB,CACP,EAEA,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CACtE,KAAC,mBAAmB,KAAG,CACxB,KACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"@floating-ui/react": "^0.22.0",
|
|
26
26
|
"@nivo/core": "^0.80.0",
|
|
27
27
|
"@nivo/line": "^0.80.0",
|
|
28
|
-
"@stream-io/i18n": "^0.0.1-alpha.
|
|
29
|
-
"@stream-io/video-client": "^0.0.2-alpha.
|
|
30
|
-
"@stream-io/video-react-bindings": "^0.0.1-alpha.
|
|
28
|
+
"@stream-io/i18n": "^0.0.1-alpha.79",
|
|
29
|
+
"@stream-io/video-client": "^0.0.2-alpha.8",
|
|
30
|
+
"@stream-io/video-react-bindings": "^0.0.1-alpha.90",
|
|
31
31
|
"clsx": "^1.2.1",
|
|
32
32
|
"rxjs": "~7.8.1"
|
|
33
33
|
},
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"react-dom": "^18.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@stream-io/video-styling": "^0.0.1-alpha.
|
|
39
|
+
"@stream-io/video-styling": "^0.0.1-alpha.74",
|
|
40
40
|
"@types/prop-types": "^15.7.5",
|
|
41
41
|
"@types/rimraf": "^3.0.2",
|
|
42
42
|
"prop-types": "^15.8.1",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"typedoc": "^0.24.7",
|
|
48
48
|
"typescript": "^4.9.5"
|
|
49
49
|
},
|
|
50
|
-
"version": "0.0.1-alpha.
|
|
50
|
+
"version": "0.0.1-alpha.97"
|
|
51
51
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CallingState } from '@stream-io/video-client';
|
|
1
|
+
import { CallingState, UserResponse } from '@stream-io/video-client';
|
|
2
2
|
import {
|
|
3
3
|
useCall,
|
|
4
4
|
useCallCallingState,
|
|
5
5
|
useCallMembers,
|
|
6
|
-
|
|
6
|
+
useConnectedUser,
|
|
7
7
|
useI18n,
|
|
8
8
|
} from '@stream-io/video-react-bindings';
|
|
9
9
|
import { Avatar } from '../Avatar';
|
|
@@ -21,24 +21,46 @@ const CALLING_STATE_TO_LABEL: Record<CallingState, string> = {
|
|
|
21
21
|
[CallingState.LEFT]: 'Left call',
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
export
|
|
24
|
+
export type PendingCallPanelProps = {
|
|
25
|
+
/**
|
|
26
|
+
* Whether to include the current user in the list of members to show.
|
|
27
|
+
* @default false.
|
|
28
|
+
*/
|
|
29
|
+
includeSelf?: boolean;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The maximum number of members to show.
|
|
33
|
+
* @default 3.
|
|
34
|
+
*/
|
|
35
|
+
totalMembersToShow?: number;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const PendingCallPanel = (props: PendingCallPanelProps) => {
|
|
39
|
+
const { includeSelf = false, totalMembersToShow = 3 } = props;
|
|
25
40
|
const call = useCall();
|
|
26
41
|
const callingState = useCallCallingState();
|
|
27
42
|
const { t } = useI18n();
|
|
28
|
-
const metadata = useCallMetadata();
|
|
29
43
|
const members = useCallMembers();
|
|
44
|
+
const connectedUser = useConnectedUser();
|
|
30
45
|
|
|
31
46
|
if (!call) return null;
|
|
32
47
|
|
|
33
|
-
|
|
34
|
-
const membersToShow =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
48
|
+
// take the first N members to show their avatars
|
|
49
|
+
const membersToShow: UserResponse[] = (members || [])
|
|
50
|
+
.slice(0, totalMembersToShow)
|
|
51
|
+
.map(({ user }) => user)
|
|
52
|
+
.filter((user) => user.id !== connectedUser?.id || includeSelf);
|
|
53
|
+
if (
|
|
54
|
+
includeSelf &&
|
|
55
|
+
!membersToShow.find((user) => user.id === connectedUser?.id)
|
|
56
|
+
) {
|
|
57
|
+
// if the current user is not in the initial batch of members,
|
|
58
|
+
// add it to the beginning of the list
|
|
59
|
+
const self = members.find(({ user }) => user.id === connectedUser?.id);
|
|
60
|
+
if (self) {
|
|
61
|
+
membersToShow.splice(0, 1, self.user);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
42
64
|
|
|
43
65
|
const callingStateLabel = CALLING_STATE_TO_LABEL[callingState];
|
|
44
66
|
|