@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 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 ?? includeSelf);
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 InitWithCallCID = {
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: ({ callId, callType, call, callCycleHandlers, children, }: PropsWithChildren<StreamCallProps>) => JSX.Element;
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
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 = __importStar(require("react"));
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 = ({ callId, callType = 'default', call, callCycleHandlers = {}, children, }) => {
40
- const videoClient = (0, video_react_bindings_1.useStreamVideoClient)();
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":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAGyC;AACzC,+CAAsE;AACtE,0DAA6D;AAC7D,oCAA6E;AAC7E,8EAA2E;AAqC3E;;;;;;GAMG;AACI,MAAM,UAAU,GAAG,CAAC,EACzB,MAAM,EACN,QAAQ,GAAG,SAAS,EACpB,IAAI,EACJ,iBAAiB,GAAG,EAAE,EACtB,QAAQ,GAC2B,EAAE,EAAE;IACvC,MAAM,WAAW,GAAG,IAAA,2CAAoB,GAAE,CAAC;IAC3C,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAmB,GAAG,EAAE;QAClE,IAAI,IAAI,EAAE;YACR,OAAO,IAAI,CAAC;SACb;QACD,IAAI,CAAC,WAAW,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE;YACxC,OAAO;SACR;QACD,OAAO,WAAW,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,wFAAwF;IACxF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO;SACR;QAED,IAAI,MAAM,IAAI,QAAQ,IAAI,CAAC,UAAU,EAAE;YACrC,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YACnD,aAAa,CAAC,OAAO,CAAC,CAAC;SACxB;QAED,OAAO,GAAG,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","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.25",
26
- "@stream-io/video-react-bindings": "^0.0.26"
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.205"
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 ?? includeSelf);
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
- StreamCallProvider,
3
- useStreamVideoClient,
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 InitWithCallCID = {
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={activeCall}>
24
+ <StreamCallProvider call={call}>
92
25
  <AndroidKeepCallAlive />
93
26
  <IosInformCallkeepCallEnd />
94
27
  <CallCycleLogicsWrapper callCycleHandlers={callCycleHandlers}>