@stream-io/video-react-native-sdk 0.0.1-alpha.205 → 0.0.1-alpha.207
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/UserInfoView.js +1 -1
- package/dist/src/providers/StreamCall.d.ts +3 -32
- package/dist/src/providers/StreamCall.js +5 -53
- package/dist/src/providers/StreamCall.js.map +1 -1
- package/package.json +3 -3
- package/src/components/UserInfoView.tsx +1 -1
- package/src/providers/StreamCall.tsx +6 -73
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.207](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.1-alpha.206...@stream-io/video-react-native-sdk-0.0.1-alpha.207) (2023-06-23)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **react-native:** null coalescing operator issue in UserInfoView ([#702](https://github.com/GetStream/stream-video-js/issues/702)) ([45f24f9](https://github.com/GetStream/stream-video-js/commit/45f24f99ed6a8843e2c8aa05527387fb862d4a91))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.0.1-alpha.206](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.1-alpha.205...@stream-io/video-react-native-sdk-0.0.1-alpha.206) (2023-06-23)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
5
18
|
## [0.0.1-alpha.205](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.1-alpha.204...@stream-io/video-react-native-sdk-0.0.1-alpha.205) (2023-06-23)
|
|
6
19
|
|
|
7
20
|
|
|
@@ -22,7 +22,7 @@ const UserInfoView = ({ includeSelf = false, totalMembersToShow = 3, }) => {
|
|
|
22
22
|
const membersToShow = (members || [])
|
|
23
23
|
.slice(0, totalMembersToShow)
|
|
24
24
|
.map(({ user }) => user)
|
|
25
|
-
.filter((user) => user.id !== connectedUser?.id
|
|
25
|
+
.filter((user) => user.id !== connectedUser?.id || includeSelf);
|
|
26
26
|
if (includeSelf &&
|
|
27
27
|
!membersToShow.find((user) => user.id === connectedUser?.id)) {
|
|
28
28
|
// if the current user is not in the initial batch of members,
|
|
@@ -1,35 +1,7 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { Call } from '@stream-io/video-client';
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
* The call type.
|
|
6
|
-
*/
|
|
7
|
-
callType: string;
|
|
8
|
-
/**
|
|
9
|
-
* The call id.
|
|
10
|
-
*/
|
|
11
|
-
callId: string;
|
|
12
|
-
/**
|
|
13
|
-
* The call instance to use.
|
|
14
|
-
*/
|
|
15
|
-
call?: Call;
|
|
16
|
-
};
|
|
17
|
-
type InitWithCallInstance = {
|
|
18
|
-
/**
|
|
19
|
-
* The call instance to use.
|
|
20
|
-
*/
|
|
21
|
-
call: Call | undefined;
|
|
22
|
-
/**
|
|
23
|
-
* The call type.
|
|
24
|
-
*/
|
|
25
|
-
callType?: string;
|
|
26
|
-
/**
|
|
27
|
-
* The call id.
|
|
28
|
-
*/
|
|
29
|
-
callId?: string;
|
|
30
|
-
};
|
|
31
|
-
type InitStreamCall = InitWithCallCID | InitWithCallInstance;
|
|
32
|
-
export type StreamCallProps = InitStreamCall & {
|
|
3
|
+
export type StreamCallProps = {
|
|
4
|
+
call: Call;
|
|
33
5
|
callCycleHandlers: CallCycleHandlersType;
|
|
34
6
|
};
|
|
35
7
|
/**
|
|
@@ -39,7 +11,7 @@ export type StreamCallProps = InitStreamCall & {
|
|
|
39
11
|
*
|
|
40
12
|
* @category Client State
|
|
41
13
|
*/
|
|
42
|
-
export declare const StreamCall: ({
|
|
14
|
+
export declare const StreamCall: ({ call, callCycleHandlers, children, }: PropsWithChildren<StreamCallProps>) => JSX.Element;
|
|
43
15
|
/**
|
|
44
16
|
* Exclude types from documentation site, but we should still add doc comments
|
|
45
17
|
* @internal
|
|
@@ -78,4 +50,3 @@ export type CallCycleLogicsWrapperProps = {
|
|
|
78
50
|
callCycleHandlers: CallCycleHandlersType;
|
|
79
51
|
};
|
|
80
52
|
export declare const CallCycleLogicsWrapper: ({ callCycleHandlers, children, }: PropsWithChildren<CallCycleLogicsWrapperProps>) => JSX.Element;
|
|
81
|
-
export {};
|
|
@@ -1,32 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
6
|
exports.CallCycleLogicsWrapper = exports.StreamCall = void 0;
|
|
27
7
|
const video_react_bindings_1 = require("@stream-io/video-react-bindings");
|
|
28
|
-
const react_1 =
|
|
29
|
-
const video_client_1 = require("@stream-io/video-client");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
30
9
|
const hooks_1 = require("../hooks");
|
|
31
10
|
const useIosCallkeepEndEffect_1 = require("../hooks/useIosCallkeepEndEffect");
|
|
32
11
|
/**
|
|
@@ -36,35 +15,8 @@ const useIosCallkeepEndEffect_1 = require("../hooks/useIosCallkeepEndEffect");
|
|
|
36
15
|
*
|
|
37
16
|
* @category Client State
|
|
38
17
|
*/
|
|
39
|
-
const StreamCall = ({
|
|
40
|
-
|
|
41
|
-
const [activeCall, setActiveCall] = (0, react_1.useState)(() => {
|
|
42
|
-
if (call) {
|
|
43
|
-
return call;
|
|
44
|
-
}
|
|
45
|
-
if (!videoClient || !callId || !callType) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
return videoClient?.call(callType, callId);
|
|
49
|
-
});
|
|
50
|
-
// Effect to create a new call with the given call id and type if the call doesn't exist
|
|
51
|
-
(0, react_1.useEffect)(() => {
|
|
52
|
-
if (!videoClient) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (callId && callType && !activeCall) {
|
|
56
|
-
const newCall = videoClient.call(callType, callId);
|
|
57
|
-
setActiveCall(newCall);
|
|
58
|
-
}
|
|
59
|
-
return () => {
|
|
60
|
-
if (activeCall?.state.callingState === video_client_1.CallingState.LEFT) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
activeCall?.leave().catch((e) => console.log(e));
|
|
64
|
-
setActiveCall(undefined);
|
|
65
|
-
};
|
|
66
|
-
}, [activeCall, callId, callType, videoClient]);
|
|
67
|
-
return (<video_react_bindings_1.StreamCallProvider call={activeCall}>
|
|
18
|
+
const StreamCall = ({ call, callCycleHandlers = {}, children, }) => {
|
|
19
|
+
return (<video_react_bindings_1.StreamCallProvider call={call}>
|
|
68
20
|
<AndroidKeepCallAlive />
|
|
69
21
|
<IosInformCallkeepCallEnd />
|
|
70
22
|
<exports.CallCycleLogicsWrapper callCycleHandlers={callCycleHandlers}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StreamCall.js","sourceRoot":"","sources":["../../../src/providers/StreamCall.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StreamCall.js","sourceRoot":"","sources":["../../../src/providers/StreamCall.tsx"],"names":[],"mappings":";;;;;;AAAA,0EAAqE;AACrE,kDAAiD;AAEjD,oCAA6E;AAC7E,8EAA2E;AAM3E;;;;;;GAMG;AACI,MAAM,UAAU,GAAG,CAAC,EACzB,IAAI,EACJ,iBAAiB,GAAG,EAAE,EACtB,QAAQ,GAC2B,EAAE,EAAE;IACvC,OAAO,CACL,CAAC,yCAAkB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAC7B;MAAA,CAAC,oBAAoB,CAAC,AAAD,EACrB;MAAA,CAAC,wBAAwB,CAAC,AAAD,EACzB;MAAA,CAAC,8BAAsB,CAAC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CAC3D;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,8BAAsB,CAC1B;IAAA,EAAE,yCAAkB,CAAC,CACtB,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,UAAU,cAcrB;AAyCK,MAAM,sBAAsB,GAAG,CAAC,EACrC,iBAAiB,EACjB,QAAQ,GACuC,EAAE,EAAE;IACnD,IAAA,0BAAkB,EAAC,iBAAiB,CAAC,CAAC;IAEtC,OAAO,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC;AACzB,CAAC,CAAC;AAPW,QAAA,sBAAsB,0BAOjC;AAEF;;;GAGG;AACH,MAAM,oBAAoB,GAAG,GAAG,EAAE;IAChC,IAAA,qCAA6B,GAAE,CAAC;IAChC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,wBAAwB,GAAG,GAAG,EAAE;IACpC,IAAA,iDAAuB,GAAE,CAAC;IAC1B,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@stream-io/i18n": "^0.0.6",
|
|
25
|
-
"@stream-io/video-client": "^0.0.
|
|
26
|
-
"@stream-io/video-react-bindings": "^0.0.
|
|
25
|
+
"@stream-io/video-client": "^0.0.26",
|
|
26
|
+
"@stream-io/video-react-bindings": "^0.0.27"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@notifee/react-native": ">=7.7.0",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"typedoc-plugin-markdown": "^3.15.3",
|
|
86
86
|
"typescript": "^4.9.5"
|
|
87
87
|
},
|
|
88
|
-
"version": "0.0.1-alpha.
|
|
88
|
+
"version": "0.0.1-alpha.207"
|
|
89
89
|
}
|
|
@@ -39,7 +39,7 @@ export const UserInfoView = ({
|
|
|
39
39
|
const membersToShow: UserResponse[] = (members || [])
|
|
40
40
|
.slice(0, totalMembersToShow)
|
|
41
41
|
.map(({ user }) => user)
|
|
42
|
-
.filter((user) => user.id !== connectedUser?.id
|
|
42
|
+
.filter((user) => user.id !== connectedUser?.id || includeSelf);
|
|
43
43
|
if (
|
|
44
44
|
includeSelf &&
|
|
45
45
|
!membersToShow.find((user) => user.id === connectedUser?.id)
|
|
@@ -1,45 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from '@stream-io/video-react-bindings';
|
|
5
|
-
import React, { PropsWithChildren, useEffect, useState } from 'react';
|
|
6
|
-
import { Call, CallingState } from '@stream-io/video-client';
|
|
1
|
+
import { StreamCallProvider } from '@stream-io/video-react-bindings';
|
|
2
|
+
import React, { PropsWithChildren } from 'react';
|
|
3
|
+
import { Call } from '@stream-io/video-client';
|
|
7
4
|
import { useAndroidKeepCallAliveEffect, useCallCycleEffect } from '../hooks';
|
|
8
5
|
import { useIosCallkeepEndEffect } from '../hooks/useIosCallkeepEndEffect';
|
|
9
6
|
|
|
10
|
-
type
|
|
11
|
-
|
|
12
|
-
* The call type.
|
|
13
|
-
*/
|
|
14
|
-
callType: string;
|
|
15
|
-
/**
|
|
16
|
-
* The call id.
|
|
17
|
-
*/
|
|
18
|
-
callId: string;
|
|
19
|
-
/**
|
|
20
|
-
* The call instance to use.
|
|
21
|
-
*/
|
|
22
|
-
call?: Call;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
type InitWithCallInstance = {
|
|
26
|
-
/**
|
|
27
|
-
* The call instance to use.
|
|
28
|
-
*/
|
|
29
|
-
call: Call | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* The call type.
|
|
32
|
-
*/
|
|
33
|
-
callType?: string;
|
|
34
|
-
/**
|
|
35
|
-
* The call id.
|
|
36
|
-
*/
|
|
37
|
-
callId?: string;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
type InitStreamCall = InitWithCallCID | InitWithCallInstance;
|
|
41
|
-
|
|
42
|
-
export type StreamCallProps = InitStreamCall & {
|
|
7
|
+
export type StreamCallProps = {
|
|
8
|
+
call: Call;
|
|
43
9
|
callCycleHandlers: CallCycleHandlersType;
|
|
44
10
|
};
|
|
45
11
|
/**
|
|
@@ -50,45 +16,12 @@ export type StreamCallProps = InitStreamCall & {
|
|
|
50
16
|
* @category Client State
|
|
51
17
|
*/
|
|
52
18
|
export const StreamCall = ({
|
|
53
|
-
callId,
|
|
54
|
-
callType = 'default',
|
|
55
19
|
call,
|
|
56
20
|
callCycleHandlers = {},
|
|
57
21
|
children,
|
|
58
22
|
}: PropsWithChildren<StreamCallProps>) => {
|
|
59
|
-
const videoClient = useStreamVideoClient();
|
|
60
|
-
const [activeCall, setActiveCall] = useState<Call | undefined>(() => {
|
|
61
|
-
if (call) {
|
|
62
|
-
return call;
|
|
63
|
-
}
|
|
64
|
-
if (!videoClient || !callId || !callType) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
return videoClient?.call(callType, callId);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
// Effect to create a new call with the given call id and type if the call doesn't exist
|
|
71
|
-
useEffect(() => {
|
|
72
|
-
if (!videoClient) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (callId && callType && !activeCall) {
|
|
77
|
-
const newCall = videoClient.call(callType, callId);
|
|
78
|
-
setActiveCall(newCall);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return () => {
|
|
82
|
-
if (activeCall?.state.callingState === CallingState.LEFT) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
activeCall?.leave().catch((e) => console.log(e));
|
|
86
|
-
setActiveCall(undefined);
|
|
87
|
-
};
|
|
88
|
-
}, [activeCall, callId, callType, videoClient]);
|
|
89
|
-
|
|
90
23
|
return (
|
|
91
|
-
<StreamCallProvider call={
|
|
24
|
+
<StreamCallProvider call={call}>
|
|
92
25
|
<AndroidKeepCallAlive />
|
|
93
26
|
<IosInformCallkeepCallEnd />
|
|
94
27
|
<CallCycleLogicsWrapper callCycleHandlers={callCycleHandlers}>
|