@stream-io/video-react-native-sdk 0.0.1-alpha.388 → 0.0.1-alpha.389
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 +17 -0
- package/dist/src/components/Call/CallContent/CallContent.js +4 -2
- package/dist/src/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/src/components/Call/RingingCallContent/UserInfo.js +5 -4
- package/dist/src/components/Call/RingingCallContent/UserInfo.js.map +1 -1
- package/dist/src/components/Participant/FloatingParticipantView/index.js +3 -3
- package/dist/src/components/Participant/FloatingParticipantView/index.js.map +1 -1
- package/dist/src/components/Participant/ParticipantView/ParticipantView.d.ts +1 -1
- package/dist/src/components/Participant/ParticipantView/ParticipantView.js +1 -1
- package/dist/src/components/Participant/ParticipantView/ParticipantView.js.map +1 -1
- package/dist/src/components/Participant/ParticipantView/VideoRenderer.js +1 -1
- package/dist/src/components/Participant/ParticipantView/VideoRenderer.js.map +1 -1
- package/dist/src/theme/index.d.ts +1 -0
- package/dist/src/theme/index.js +15 -0
- package/dist/src/theme/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -9
- package/src/components/Call/CallContent/CallContent.tsx +6 -4
- package/src/components/Call/RingingCallContent/UserInfo.tsx +7 -5
- package/src/components/Participant/FloatingParticipantView/index.tsx +3 -3
- package/src/components/Participant/ParticipantView/ParticipantView.tsx +2 -2
- package/src/components/Participant/ParticipantView/VideoRenderer.tsx +1 -1
- package/src/theme/index.ts +2 -0
- package/dist/src/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.d.ts +0 -3
- package/dist/src/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.js +0 -145
- package/dist/src/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.js.map +0 -1
- package/dist/src/components/Participant/FloatingParticipantView/FloatingView/index.d.ts +0 -4
- package/dist/src/components/Participant/FloatingParticipantView/FloatingView/index.js +0 -8
- package/dist/src/components/Participant/FloatingParticipantView/FloatingView/index.js.map +0 -1
- package/dist/src/utils/internal/optionalLibs.d.ts +0 -5
- package/dist/src/utils/internal/optionalLibs.js +0 -28
- package/dist/src/utils/internal/optionalLibs.js.map +0 -1
- package/src/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.tsx +0 -168
- package/src/components/Participant/FloatingParticipantView/FloatingView/index.ts +0 -12
- package/src/utils/internal/optionalLibs.ts +0 -27
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.0.1-alpha.389](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.1-alpha.388...@stream-io/video-react-native-sdk-0.0.1-alpha.389) (2023-08-25)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* drop reanimated floating view component ([#993](https://github.com/GetStream/stream-video-js/issues/993)) ([31dd227](https://github.com/GetStream/stream-video-js/commit/31dd227f2381c66a597119512864fac24ef2170a))
|
|
11
|
+
* **react-native:** call content participants layout ([#999](https://github.com/GetStream/stream-video-js/issues/999)) ([c08be02](https://github.com/GetStream/stream-video-js/commit/c08be02ab1c8b62c9736c86f0076f3e2f9ed4811))
|
|
12
|
+
* **react-native:** don't show FloatingParticipantView in spotlight mode ([#998](https://github.com/GetStream/stream-video-js/issues/998)) ([de676b9](https://github.com/GetStream/stream-video-js/commit/de676b9017881cd64b81b368b79f552c7cddb6aa))
|
|
13
|
+
* **react-native:** fix user-info design ([#991](https://github.com/GetStream/stream-video-js/issues/991)) ([486e82c](https://github.com/GetStream/stream-video-js/commit/486e82ca0f972a5c7ba69e173313afa3ca9d587c))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **react-native:** export Theme from SDK ([#997](https://github.com/GetStream/stream-video-js/issues/997)) ([78ec49f](https://github.com/GetStream/stream-video-js/commit/78ec49f14b20cebacd361f43df7eab1e3184f06d))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
5
22
|
## [0.0.1-alpha.388](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.1-alpha.387...@stream-io/video-react-native-sdk-0.0.1-alpha.388) (2023-08-24)
|
|
6
23
|
|
|
7
24
|
|
|
@@ -43,8 +43,10 @@ const CallContent = ({ onBackPressed, onParticipantInfoPress, onHangupCallHandle
|
|
|
43
43
|
const { useRemoteParticipants } = (0, video_react_bindings_1.useCallStateHooks)();
|
|
44
44
|
const _remoteParticipants = useRemoteParticipants();
|
|
45
45
|
const remoteParticipants = (0, hooks_2.useDebouncedValue)(_remoteParticipants, 300); // we debounce the remote participants to avoid unnecessary rerenders that happen when participant tracks are all subscribed simultaneously
|
|
46
|
-
const showFloatingView = remoteParticipants.length > 0 && remoteParticipants.length < 3;
|
|
47
46
|
const showSpotlightLayout = hasScreenShare || layout === 'spotlight';
|
|
47
|
+
const showFloatingView = !showSpotlightLayout &&
|
|
48
|
+
remoteParticipants.length > 0 &&
|
|
49
|
+
remoteParticipants.length < 3;
|
|
48
50
|
/**
|
|
49
51
|
* This hook is used to handle IncallManager specs of the application.
|
|
50
52
|
*/
|
|
@@ -82,9 +84,9 @@ const CallContent = ({ onBackPressed, onParticipantInfoPress, onHangupCallHandle
|
|
|
82
84
|
{CallTopView && (<CallTopView onBackPressed={onBackPressed} onParticipantInfoPress={onParticipantInfoPress} ParticipantsInfoBadge={ParticipantsInfoBadge}/>)}
|
|
83
85
|
{showFloatingView && FloatingParticipantView && (<FloatingParticipantView {...participantViewProps}/>)}
|
|
84
86
|
</react_native_1.View>
|
|
85
|
-
|
|
86
87
|
{showSpotlightLayout ? (<CallLayout_1.CallParticipantsSpotlight {...callParticipantsSpotlightProps}/>) : (<CallLayout_1.CallParticipantsGrid {...callParticipantsGridProps}/>)}
|
|
87
88
|
</react_native_1.View>
|
|
89
|
+
|
|
88
90
|
{CallControls && (<CallControls onHangupCallHandler={onHangupCallHandler}/>)}
|
|
89
91
|
</react_native_1.View>);
|
|
90
92
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallContent.js","sourceRoot":"","sources":["../../../../../src/components/Call/CallContent/CallContent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiD;AACjD,+CAAgD;AAChD,gDAGwB;AACxB,8CAKuB;AACvB,kDAGyB;AACzB,0EAA6E;AAC7E,0DAAuD;AACvD,0CAAkD;AAClD,kDAA6C;AAC7C,gDAAyD;AACzD,mDAI2B;AAC3B,gDAA6C;AAsCtC,MAAM,WAAW,GAAG,CAAC,EAC1B,aAAa,EACb,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,GAAG,yBAAkB,EAChC,YAAY,GAAG,2BAAmB,EAClC,uBAAuB,GAAG,qCAA8B,EACxD,gBAAgB,EAChB,kCAAkC,EAClC,mBAAmB,EACnB,wBAAwB,EACxB,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,MAAM,GACW,EAAE,EAAE;IACrB,MAAM,EACJ,KAAK,EAAE,EAAE,WAAW,EAAE,GACvB,GAAG,IAAA,mBAAQ,GAAE,CAAC;IACf,MAAM,EAAE,wBAAwB,EAAE,GAAG,IAAA,wCAAiB,GAAE,CAAC;IACzD,MAAM,cAAc,GAAG,wBAAwB,EAAE,CAAC;IAClD,MAAM,EAAE,qBAAqB,EAAE,GAAG,IAAA,wCAAiB,GAAE,CAAC;IAEtD,MAAM,mBAAmB,GAAG,qBAAqB,EAAE,CAAC;IACpD,MAAM,kBAAkB,GAAG,IAAA,yBAAiB,EAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC,CAAC,2IAA2I;IACnN,MAAM,
|
|
1
|
+
{"version":3,"file":"CallContent.js","sourceRoot":"","sources":["../../../../../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AI,uBAAuB,IAAI,CAC9C,CAAC,uBAAuB,CAAC,IAAI,oBAAoB,CAAC,EAAG,CACtD,CACH;QAAA,EAAE,mBAAI,CACN;QAAA,CAAC,mBAAmB,CAAC,CAAC,CAAC,CACrB,CAAC,sCAAyB,CAAC,IAAI,8BAA8B,CAAC,EAAG,CAClE,CAAC,CAAC,CAAC,CACF,CAAC,iCAAoB,CAAC,IAAI,yBAAyB,CAAC,EAAG,CACxD,CACH;MAAA,EAAE,mBAAI,CAEN;;MAAA,CAAC,YAAY,IAAI,CACf,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC,mBAAmB,CAAC,EAAG,CAC3D,CACH;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAjGW,QAAA,WAAW,eAiGtB;AAEF,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;IACtB,IAAI,EAAE;QACJ,GAAG,yBAAU,CAAC,kBAAkB;QAChC,MAAM,EAAE,mBAAO,CAAC,QAAQ;KACzB;CACF,CAAC,CAAC"}
|
|
@@ -22,13 +22,13 @@ const UserInfo = ({ includeSelf = false, totalMembersToShow = 3, }) => {
|
|
|
22
22
|
const members = useCallMembers();
|
|
23
23
|
// take the first N members to show their avatars
|
|
24
24
|
const membersToShow = (members || [])
|
|
25
|
+
.filter((user) => user.user_id !== connectedUser?.id || includeSelf)
|
|
25
26
|
.slice(0, totalMembersToShow)
|
|
26
|
-
.map(({ user }) => user)
|
|
27
|
-
.filter((user) => user.id !== connectedUser?.id || includeSelf);
|
|
27
|
+
.map(({ user }) => user);
|
|
28
28
|
if (includeSelf &&
|
|
29
29
|
!membersToShow.find((user) => user.id === connectedUser?.id)) {
|
|
30
30
|
// if the current user is not in the initial batch of members,
|
|
31
|
-
//
|
|
31
|
+
// replace the first item in membersToShow array with the current user
|
|
32
32
|
const self = members.find(({ user }) => user.id === connectedUser?.id);
|
|
33
33
|
if (self) {
|
|
34
34
|
membersToShow.splice(0, 1, self.user);
|
|
@@ -46,6 +46,7 @@ const UserInfo = ({ includeSelf = false, totalMembersToShow = 3, }) => {
|
|
|
46
46
|
height: avatarSizes[mode],
|
|
47
47
|
width: avatarSizes[mode],
|
|
48
48
|
borderRadius: avatarSizes[mode] / 2,
|
|
49
|
+
marginVertical: 4,
|
|
49
50
|
};
|
|
50
51
|
const fontStyleByMembersCount = memberUserIds.length > 1 ? typefaces.heading5 : typefaces.heading4;
|
|
51
52
|
return (<react_native_1.View style={[styles.container, userInfo.container]}>
|
|
@@ -74,7 +75,7 @@ const UserInfo = ({ includeSelf = false, totalMembersToShow = 3, }) => {
|
|
|
74
75
|
exports.UserInfo = UserInfo;
|
|
75
76
|
const styles = react_native_1.StyleSheet.create({
|
|
76
77
|
container: {
|
|
77
|
-
paddingHorizontal:
|
|
78
|
+
paddingHorizontal: 64,
|
|
78
79
|
display: 'flex',
|
|
79
80
|
flexDirection: 'column',
|
|
80
81
|
justifyContent: 'space-between',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserInfo.js","sourceRoot":"","sources":["../../../../../src/components/Call/RingingCallContent/UserInfo.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+
|
|
1
|
+
{"version":3,"file":"UserInfo.js","sourceRoot":"","sources":["../../../../../src/components/Call/RingingCallContent/UserInfo.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+CAA6D;AAC7D,0CAAmD;AACnD,0EAGyC;AAEzC,iEAA0D;AAE1D,IAAK,WAIJ;AAJD,WAAK,WAAW;IACd,2BAAY,CAAA;IACZ,4BAAa,CAAA;IACb,2BAAY,CAAA;AACd,CAAC,EAJI,WAAW,KAAX,WAAW,QAIf;AAgBM,MAAM,QAAQ,GAAG,CAAC,EACvB,WAAW,GAAG,KAAK,EACnB,kBAAkB,GAAG,CAAC,GACT,EAAE,EAAE;IACjB,MAAM,EACJ,K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K,CAAC,CAAC;YACL,MAAM,CAAC,IAAI;YACX,uBAAuB;YACvB,EAAE,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE;YAC9B,QAAQ,CAAC,IAAI;SACd,CAAC,CAEF;QAAA,CAAC,SAAS,CACZ;MAAA,EAAE,mBAAI,CACR;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAzFW,QAAA,QAAQ,YAyFnB;AAEF,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,iBAAiB,EAAE,EAAE;QACrB,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,QAAQ;QACvB,cAAc,EAAE,eAAe;KAChC;IACD,WAAW,EAAE;QACX,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,cAAc;QAC9B,QAAQ,EAAE,MAAM;KACjB;IACD,IAAI,EAAE;QACJ,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,EAAE;KACd;CACF,CAAC,CAAC"}
|
|
@@ -10,10 +10,10 @@ const video_react_bindings_1 = require("@stream-io/video-react-bindings");
|
|
|
10
10
|
const constants_1 = require("../../../constants");
|
|
11
11
|
const TestIds_1 = require("../../../constants/TestIds");
|
|
12
12
|
const icons_1 = require("../../../icons");
|
|
13
|
-
const FloatingView_1 = __importDefault(require("./FloatingView"));
|
|
14
13
|
const common_1 = require("./FloatingView/common");
|
|
15
14
|
const ParticipantView_1 = require("../ParticipantView");
|
|
16
15
|
const ThemeContext_1 = require("../../../contexts/ThemeContext");
|
|
16
|
+
const AnimatedFloatingView_1 = __importDefault(require("./FloatingView/AnimatedFloatingView"));
|
|
17
17
|
const CustomLocalParticipantViewVideoFallback = () => {
|
|
18
18
|
const { theme: { colors, localParticipantsView, variants: { iconSizes }, }, } = (0, ThemeContext_1.useTheme)();
|
|
19
19
|
return (<react_native_1.View style={[
|
|
@@ -65,7 +65,7 @@ const FloatingParticipantView = ({ alignment = 'top-right', style, ParticipantVi
|
|
|
65
65
|
};
|
|
66
66
|
});
|
|
67
67
|
}}>
|
|
68
|
-
{containerDimensions && (<
|
|
68
|
+
{containerDimensions && (<AnimatedFloatingView_1.default containerHeight={containerDimensions.height} containerWidth={containerDimensions.width} initialAlignment={floatingAlignmentMap[alignment]}>
|
|
69
69
|
{ParticipantView && (<ParticipantView participant={localParticipant} videoMode={'video'} style={[
|
|
70
70
|
styles.participantViewContainer,
|
|
71
71
|
style,
|
|
@@ -78,7 +78,7 @@ const FloatingParticipantView = ({ alignment = 'top-right', style, ParticipantVi
|
|
|
78
78
|
// video z order must be one above the one used in grid view
|
|
79
79
|
// (which uses the default: 0)
|
|
80
80
|
videoZOrder={1} {...participantViewProps}/>)}
|
|
81
|
-
</
|
|
81
|
+
</AnimatedFloatingView_1.default>)}
|
|
82
82
|
</react_native_1.View>);
|
|
83
83
|
};
|
|
84
84
|
exports.FloatingParticipantView = FloatingParticipantView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/Participant/FloatingParticipantView/index.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+CAAsE;AACtE,0EAAoE;AACpE,kDAAwE;AACxE,wDAA8D;AAC9D,0CAA4C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/Participant/FloatingParticipantView/index.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+CAAsE;AACtE,0EAAoE;AACpE,kDAAwE;AACxE,wDAA8D;AAC9D,0CAA4C;AAE5C,kDAA8D;AAC9D,wDAG4B;AAC5B,iEAA0D;AAC1D,+FAAuE;AAuBvE,MAAM,uCAAuC,GAAG,GAAG,EAAE;IACnD,MAAM,EACJ,KAAK,EAAE,EACL,MAAM,EACN,qBAAqB,EACrB,QAAQ,EAAE,EAAE,SAAS,EAAE,GACxB,GACF,GAAG,IAAA,uBAAQ,GAAE,CAA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,CAAC,wBAAwB;iBAC/C,CAAC;YACF,4DAA4D;YAC5D,8BAA8B;YAC9B,WAAW,CAAC,CAAC,CAAC,CAAC,CACf,IAAI,oBAAoB,CAAC,EACzB,CACH,CACH;QAAA,EAAE,8BAAoB,CAAC,CACxB,CACH;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA1FW,QAAA,uBAAuB,2BA0FlC;AAEF,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,MAAM,EAAE,CAAC;QACT,+CAA+C;QAC/C,MAAM,EAAE,mBAAO,CAAC,SAAS;QACzB,IAAI,EAAE,CAAC;KACR;IACD,wBAAwB,EAAE;QACxB,MAAM,EAAE,qCAAyB,CAAC,MAAM;QACxC,KAAK,EAAE,qCAAyB,CAAC,KAAK;QACtC,YAAY,EAAE,qCAAyB,CAAC,YAAY;QACpD,YAAY,EAAE;YACZ,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;SACV;QACD,aAAa,EAAE,IAAI;QACnB,YAAY,EAAE,IAAI;QAClB,SAAS,EAAE,CAAC;KACb;IACD,aAAa,EAAE;QACb,GAAG,yBAAU,CAAC,kBAAkB;QAChC,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;CACF,CAAC,CAAC"}
|
|
@@ -49,7 +49,7 @@ export type ParticipantViewProps = ParticipantViewComponentProps & {
|
|
|
49
49
|
/**
|
|
50
50
|
* The video kind that will be displayed.
|
|
51
51
|
*/
|
|
52
|
-
videoMode
|
|
52
|
+
videoMode?: ParticipantVideoType;
|
|
53
53
|
/**
|
|
54
54
|
* Custom style to be merged with the participant view.
|
|
55
55
|
*/
|
|
@@ -17,7 +17,7 @@ const ThemeContext_1 = require("../../../contexts/ThemeContext");
|
|
|
17
17
|
* and additional info. By an absence of a video track or when isVisible is truthy,
|
|
18
18
|
* only an avatar and audio track will be rendered.
|
|
19
19
|
*/
|
|
20
|
-
const ParticipantView = ({ participant, videoMode, isVisible = true, style, ParticipantLabel = ParticipantLabel_1.ParticipantLabel, ParticipantReaction = ParticipantReaction_1.ParticipantReaction, VideoRenderer = VideoRenderer_1.VideoRenderer, ParticipantNetworkQualityIndicator = ParticipantNetworkQualityIndicator_1.ParticipantNetworkQualityIndicator, ParticipantVideoFallback = ParticipantVideoFallback_1.ParticipantVideoFallback, videoZOrder = 0, }) => {
|
|
20
|
+
const ParticipantView = ({ participant, videoMode = 'video', isVisible = true, style, ParticipantLabel = ParticipantLabel_1.ParticipantLabel, ParticipantReaction = ParticipantReaction_1.ParticipantReaction, VideoRenderer = VideoRenderer_1.VideoRenderer, ParticipantNetworkQualityIndicator = ParticipantNetworkQualityIndicator_1.ParticipantNetworkQualityIndicator, ParticipantVideoFallback = ParticipantVideoFallback_1.ParticipantVideoFallback, videoZOrder = 0, }) => {
|
|
21
21
|
const { theme: { colors, participantView }, } = (0, ThemeContext_1.useTheme)();
|
|
22
22
|
const { isSpeaking, userId } = participant;
|
|
23
23
|
const isScreenSharing = videoMode === 'screen';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParticipantView.js","sourceRoot":"","sources":["../../../../../src/components/Participant/ParticipantView/ParticipantView.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA6C;AAC7C,+CAAsE;AAEtE,6FAG8C;AAC9C,+DAG+B;AAC/B,yDAG4B;AAC5B,yEAGoC;AACpC,mDAGyB;AACzB,iEAA0D;AA4D1D;;;;GAIG;AACI,MAAM,eAAe,GAAG,CAAC,EAC9B,WAAW,EACX,SAAS,
|
|
1
|
+
{"version":3,"file":"ParticipantView.js","sourceRoot":"","sources":["../../../../../src/components/Participant/ParticipantView/ParticipantView.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA6C;AAC7C,+CAAsE;AAEtE,6FAG8C;AAC9C,+DAG+B;AAC/B,yDAG4B;AAC5B,yEAGoC;AACpC,mDAGyB;AACzB,iEAA0D;AA4D1D;;;;GA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C,CAAC,WAAW,CAAC,EACzB,CACH,CACD;MAAA,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC,CACrE;QAAA,CAAC,gBAAgB,IAAI,CACnB,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,EAAG,CACrE,CACD;QAAA,CAAC,kCAAkC,IAAI,CACrC,CAAC,kCAAkC,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,EAAG,CACjE,CACH;MAAA,EAAE,mBAAI,CACR;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAvDW,QAAA,eAAe,mBAuD1B;AAEF,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,cAAc,EAAE,eAAe;QAC/B,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,CAAC;KACV;IACD,eAAe,EAAE;QACf,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,QAAQ;KACrB;IACD,mBAAmB,EAAE;QACnB,WAAW,EAAE,CAAC;KACf;CACF,CAAC,CAAC"}
|
|
@@ -36,7 +36,7 @@ const ThemeContext_1 = require("../../../contexts/ThemeContext");
|
|
|
36
36
|
*
|
|
37
37
|
* It internally used `RTCView` to render video stream.
|
|
38
38
|
*/
|
|
39
|
-
const VideoRenderer = ({ videoMode, participant, isVisible = true, ParticipantVideoFallback = ParticipantVideoFallback_1.ParticipantVideoFallback, videoZOrder = 0, }) => {
|
|
39
|
+
const VideoRenderer = ({ videoMode = 'video', participant, isVisible = true, ParticipantVideoFallback = ParticipantVideoFallback_1.ParticipantVideoFallback, videoZOrder = 0, }) => {
|
|
40
40
|
const { theme: { videoRenderer }, } = (0, ThemeContext_1.useTheme)();
|
|
41
41
|
const call = (0, video_react_bindings_1.useCall)();
|
|
42
42
|
const { useCallCallingState, useCameraState } = (0, video_react_bindings_1.useCallStateHooks)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoRenderer.js","sourceRoot":"","sources":["../../../../../src/components/Participant/ParticipantView/VideoRenderer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiD;AACjD,+CAAgD;AAChD,wEAAyD;AAEzD,0DAIiC;AACjC,0EAA6E;AAC7E,yEAAyG;AACzG,iEAA0D;AAc1D;;;;GAIG;AACI,MAAM,aAAa,GAAG,CAAC,EAC5B,SAAS,
|
|
1
|
+
{"version":3,"file":"VideoRenderer.js","sourceRoot":"","sources":["../../../../../src/components/Participant/ParticipantView/VideoRenderer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiD;AACjD,+CAAgD;AAChD,wEAAyD;AAEzD,0DAIiC;AACjC,0EAA6E;AAC7E,yEAAyG;AACzG,iEAA0D;AAc1D;;;;GAIG;AACI,MAAM,aAAa,GAAG,CAAC,EAC5B,SAAS,GAAG,OAAO,EACnB,WAAW,EACX,SAAS,GAAG,IAAI,EAChB,wBAAwB,GAAG,mDAA+B,EAC1D,WAAW,GAAG,CAAC,GACI,EAAE,EAAE;IACvB,MAAM,EACJ,KAAK,EAAE,EAAE,aAAa,EAAE,GACzB,GAAG,IAAA,uBAAQ,GAAE,CAAC;IACf,MAAM,IAAI,GAAG,IAAA,8BAAO,GAAE,CAAC;IACvB,MAAM,EAAE,mBAAmB,EAAE,cAAc,EAAE,GAAG,IAAA,wCAAiB,GAAE,CAAC;IACpE,MAAM,YAAY,GAAG,mBAAmB,EAAE,CAAC;IAC3C,MAAM,qBAAqB,GAAG,IAAA,cAAM,GAA4B,CAAC;IACjE,MAAM,wBAAwB,GAAG,IAAA,cAAM,GAA4B,CAAC;IACpE,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAA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AAC,YAAY,CAAC,CAAC,CAAC,CACd,CAAC,6BAAO,CACN,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,CACvD,SAAS,CAAC,CAAC,mBAAmB,EAAE,KAAK,EAAE,CAAC,CACxC,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CACjD,MAAM,CAAC,CAAC,WAAW,CAAC,EACpB,CACH,CAAC,CAAC,CAAC,CACF,wBAAwB,IAAI,CAC1B,CAAC,wBAAwB,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,EAAG,CACvD,CACF,CACH;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAxKW,QAAA,aAAa,iBAwKxB;AAEF,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,GAAG,yBAAU,CAAC,kBAAkB;KACjC;IACD,WAAW,EAAE;QACX,GAAG,yBAAU,CAAC,kBAAkB;KACjC;CACF,CAAC,CAAC"}
|
package/dist/src/theme/index.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
exports.colorPallet = void 0;
|
|
4
18
|
const colors_1 = require("./colors");
|
|
@@ -6,4 +20,5 @@ exports.colorPallet = {
|
|
|
6
20
|
light: colors_1.colors,
|
|
7
21
|
dark: colors_1.darkThemeColors,
|
|
8
22
|
};
|
|
23
|
+
__exportStar(require("./theme"), exports);
|
|
9
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/theme/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/theme/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAAmD;AAGtC,QAAA,WAAW,GAAU;IAChC,KAAK,EAAE,eAAM;IACb,IAAI,EAAE,wBAAe;CACtB,CAAC;AAEF,0CAAwB"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.1-alpha.
|
|
1
|
+
export declare const version = "0.0.1-alpha.389";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stream-io/video-react-native-sdk",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.389",
|
|
4
4
|
"packageManager": "yarn@3.2.4",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -63,12 +63,6 @@
|
|
|
63
63
|
"react-native-callkeep": {
|
|
64
64
|
"optional": true
|
|
65
65
|
},
|
|
66
|
-
"react-native-gesture-handler": {
|
|
67
|
-
"optional": true
|
|
68
|
-
},
|
|
69
|
-
"react-native-reanimated": {
|
|
70
|
-
"optional": true
|
|
71
|
-
},
|
|
72
66
|
"react-native-voip-push-notification": {
|
|
73
67
|
"optional": true
|
|
74
68
|
}
|
|
@@ -94,9 +88,7 @@
|
|
|
94
88
|
"react-native": "0.71.8",
|
|
95
89
|
"react-native-callkeep": "4.3.11",
|
|
96
90
|
"react-native-device-info": "^10.6.0",
|
|
97
|
-
"react-native-gesture-handler": "2.8.0",
|
|
98
91
|
"react-native-incall-manager": "^4.0.0",
|
|
99
|
-
"react-native-reanimated": "2.7.0",
|
|
100
92
|
"react-native-svg": "^13.6.0",
|
|
101
93
|
"react-native-voip-push-notification": "3.3.1",
|
|
102
94
|
"react-test-renderer": "^18.2.0",
|
|
@@ -88,11 +88,13 @@ export const CallContent = ({
|
|
|
88
88
|
|
|
89
89
|
const _remoteParticipants = useRemoteParticipants();
|
|
90
90
|
const remoteParticipants = useDebouncedValue(_remoteParticipants, 300); // we debounce the remote participants to avoid unnecessary rerenders that happen when participant tracks are all subscribed simultaneously
|
|
91
|
-
const showFloatingView =
|
|
92
|
-
remoteParticipants.length > 0 && remoteParticipants.length < 3;
|
|
93
|
-
|
|
94
91
|
const showSpotlightLayout = hasScreenShare || layout === 'spotlight';
|
|
95
92
|
|
|
93
|
+
const showFloatingView =
|
|
94
|
+
!showSpotlightLayout &&
|
|
95
|
+
remoteParticipants.length > 0 &&
|
|
96
|
+
remoteParticipants.length < 3;
|
|
97
|
+
|
|
96
98
|
/**
|
|
97
99
|
* This hook is used to handle IncallManager specs of the application.
|
|
98
100
|
*/
|
|
@@ -145,13 +147,13 @@ export const CallContent = ({
|
|
|
145
147
|
<FloatingParticipantView {...participantViewProps} />
|
|
146
148
|
)}
|
|
147
149
|
</View>
|
|
148
|
-
|
|
149
150
|
{showSpotlightLayout ? (
|
|
150
151
|
<CallParticipantsSpotlight {...callParticipantsSpotlightProps} />
|
|
151
152
|
) : (
|
|
152
153
|
<CallParticipantsGrid {...callParticipantsGridProps} />
|
|
153
154
|
)}
|
|
154
155
|
</View>
|
|
156
|
+
|
|
155
157
|
{CallControls && (
|
|
156
158
|
<CallControls onHangupCallHandler={onHangupCallHandler} />
|
|
157
159
|
)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Image,
|
|
2
|
+
import { Image, StyleSheet, Text, View } from 'react-native';
|
|
3
3
|
import { generateCallTitle } from '../../../utils';
|
|
4
4
|
import {
|
|
5
5
|
useCallStateHooks,
|
|
@@ -46,15 +46,16 @@ export const UserInfo = ({
|
|
|
46
46
|
|
|
47
47
|
// take the first N members to show their avatars
|
|
48
48
|
const membersToShow: UserResponse[] = (members || [])
|
|
49
|
+
.filter((user) => user.user_id !== connectedUser?.id || includeSelf)
|
|
49
50
|
.slice(0, totalMembersToShow)
|
|
50
|
-
.map(({ user }) => user)
|
|
51
|
-
|
|
51
|
+
.map(({ user }) => user);
|
|
52
|
+
|
|
52
53
|
if (
|
|
53
54
|
includeSelf &&
|
|
54
55
|
!membersToShow.find((user) => user.id === connectedUser?.id)
|
|
55
56
|
) {
|
|
56
57
|
// if the current user is not in the initial batch of members,
|
|
57
|
-
//
|
|
58
|
+
// replace the first item in membersToShow array with the current user
|
|
58
59
|
const self = members.find(({ user }) => user.id === connectedUser?.id);
|
|
59
60
|
if (self) {
|
|
60
61
|
membersToShow.splice(0, 1, self.user);
|
|
@@ -79,6 +80,7 @@ export const UserInfo = ({
|
|
|
79
80
|
height: avatarSizes[mode],
|
|
80
81
|
width: avatarSizes[mode],
|
|
81
82
|
borderRadius: avatarSizes[mode] / 2,
|
|
83
|
+
marginVertical: 4,
|
|
82
84
|
};
|
|
83
85
|
|
|
84
86
|
const fontStyleByMembersCount =
|
|
@@ -119,7 +121,7 @@ export const UserInfo = ({
|
|
|
119
121
|
|
|
120
122
|
const styles = StyleSheet.create({
|
|
121
123
|
container: {
|
|
122
|
-
paddingHorizontal:
|
|
124
|
+
paddingHorizontal: 64,
|
|
123
125
|
display: 'flex',
|
|
124
126
|
flexDirection: 'column',
|
|
125
127
|
justifyContent: 'space-between',
|
|
@@ -4,7 +4,6 @@ import { useCallStateHooks } from '@stream-io/video-react-bindings';
|
|
|
4
4
|
import { FLOATING_VIDEO_VIEW_STYLE, Z_INDEX } from '../../../constants';
|
|
5
5
|
import { ComponentTestIds } from '../../../constants/TestIds';
|
|
6
6
|
import { VideoSlash } from '../../../icons';
|
|
7
|
-
import FloatingView from './FloatingView';
|
|
8
7
|
import { CallParticipantsListProps } from '../../Call';
|
|
9
8
|
import { FloatingViewAlignment } from './FloatingView/common';
|
|
10
9
|
import {
|
|
@@ -12,6 +11,7 @@ import {
|
|
|
12
11
|
ParticipantViewComponentProps,
|
|
13
12
|
} from '../ParticipantView';
|
|
14
13
|
import { useTheme } from '../../../contexts/ThemeContext';
|
|
14
|
+
import AnimatedFloatingView from './FloatingView/AnimatedFloatingView';
|
|
15
15
|
|
|
16
16
|
export type FloatingParticipantViewAlignment =
|
|
17
17
|
| 'top-left'
|
|
@@ -123,7 +123,7 @@ export const FloatingParticipantView = ({
|
|
|
123
123
|
}}
|
|
124
124
|
>
|
|
125
125
|
{containerDimensions && (
|
|
126
|
-
<
|
|
126
|
+
<AnimatedFloatingView
|
|
127
127
|
containerHeight={containerDimensions.height}
|
|
128
128
|
containerWidth={containerDimensions.width}
|
|
129
129
|
initialAlignment={floatingAlignmentMap[alignment]}
|
|
@@ -147,7 +147,7 @@ export const FloatingParticipantView = ({
|
|
|
147
147
|
{...participantViewProps}
|
|
148
148
|
/>
|
|
149
149
|
)}
|
|
150
|
-
</
|
|
150
|
+
</AnimatedFloatingView>
|
|
151
151
|
)}
|
|
152
152
|
</View>
|
|
153
153
|
);
|
|
@@ -68,7 +68,7 @@ export type ParticipantViewProps = ParticipantViewComponentProps & {
|
|
|
68
68
|
/**
|
|
69
69
|
* The video kind that will be displayed.
|
|
70
70
|
*/
|
|
71
|
-
videoMode
|
|
71
|
+
videoMode?: ParticipantVideoType;
|
|
72
72
|
/**
|
|
73
73
|
* Custom style to be merged with the participant view.
|
|
74
74
|
*/
|
|
@@ -88,7 +88,7 @@ export type ParticipantViewProps = ParticipantViewComponentProps & {
|
|
|
88
88
|
*/
|
|
89
89
|
export const ParticipantView = ({
|
|
90
90
|
participant,
|
|
91
|
-
videoMode,
|
|
91
|
+
videoMode = 'video',
|
|
92
92
|
isVisible = true,
|
|
93
93
|
style,
|
|
94
94
|
ParticipantLabel = DefaultParticipantLabel,
|
|
@@ -29,7 +29,7 @@ export type VideoRendererProps = Pick<
|
|
|
29
29
|
* It internally used `RTCView` to render video stream.
|
|
30
30
|
*/
|
|
31
31
|
export const VideoRenderer = ({
|
|
32
|
-
videoMode,
|
|
32
|
+
videoMode = 'video',
|
|
33
33
|
participant,
|
|
34
34
|
isVisible = true,
|
|
35
35
|
ParticipantVideoFallback = DefaultParticipantVideoFallback,
|
package/src/theme/index.ts
CHANGED
|
@@ -1,145 +0,0 @@
|
|
|
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;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const react_1 = __importStar(require("react"));
|
|
27
|
-
const react_native_1 = require("react-native");
|
|
28
|
-
const common_1 = require("./common");
|
|
29
|
-
const react_native_gesture_handler_1 = require("react-native-gesture-handler");
|
|
30
|
-
const react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
|
|
31
|
-
const ReanimatedFloatingView = ({ initialAlignment, containerHeight, containerWidth, children, }) => {
|
|
32
|
-
// to store the starting position of the gesture
|
|
33
|
-
const startRef = (0, react_1.useRef)({ x: 0, y: 0 });
|
|
34
|
-
// to store the necessary translate x, y position
|
|
35
|
-
const translationX = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
36
|
-
const translationY = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
37
|
-
// we don't want to show the floating view until we have the layout rectangle
|
|
38
|
-
const opacity = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
39
|
-
const [rectangle, setRectangle] = react_1.default.useState();
|
|
40
|
-
const snapAlignments = (0, react_1.useMemo)(() => {
|
|
41
|
-
if (!rectangle) {
|
|
42
|
-
return {
|
|
43
|
-
[common_1.FloatingViewAlignment.topLeft]: { x: 0, y: 0 },
|
|
44
|
-
[common_1.FloatingViewAlignment.topRight]: { x: 0, y: 0 },
|
|
45
|
-
[common_1.FloatingViewAlignment.bottomLeft]: { x: 0, y: 0 },
|
|
46
|
-
[common_1.FloatingViewAlignment.bottomRight]: { x: 0, y: 0 },
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
return (0, common_1.getSnapAlignments)({
|
|
50
|
-
rootContainerDimensions: {
|
|
51
|
-
width: containerWidth,
|
|
52
|
-
height: containerHeight,
|
|
53
|
-
},
|
|
54
|
-
floatingViewDimensions: {
|
|
55
|
-
width: rectangle.width,
|
|
56
|
-
height: rectangle.height,
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
}, [rectangle, containerWidth, containerHeight]);
|
|
60
|
-
const dragGesture = (0, react_1.useMemo)(() => react_native_gesture_handler_1.Gesture.Pan()
|
|
61
|
-
.onStart((_e) => {
|
|
62
|
-
// store the starting position of the gesture
|
|
63
|
-
startRef.current = {
|
|
64
|
-
x: translationX.value,
|
|
65
|
-
y: translationY.value,
|
|
66
|
-
};
|
|
67
|
-
})
|
|
68
|
-
.onUpdate((e) => {
|
|
69
|
-
// update the translation with the distance of the gesture + starting position
|
|
70
|
-
translationX.value = Math.max(0, Math.min(e.translationX + startRef.current.x, snapAlignments[common_1.FloatingViewAlignment.bottomRight].x));
|
|
71
|
-
translationY.value = Math.max(0, Math.min(e.translationY + startRef.current.y, snapAlignments[common_1.FloatingViewAlignment.bottomRight].y));
|
|
72
|
-
})
|
|
73
|
-
.onEnd(() => {
|
|
74
|
-
// snap to the closest alignment with a spring animation
|
|
75
|
-
const position = {
|
|
76
|
-
x: translationX.value,
|
|
77
|
-
y: translationY.value,
|
|
78
|
-
};
|
|
79
|
-
const closestAlignment = (0, common_1.getClosestSnapAlignment)({
|
|
80
|
-
position,
|
|
81
|
-
snapAlignments,
|
|
82
|
-
});
|
|
83
|
-
translationX.value = (0, react_native_reanimated_1.withTiming)(closestAlignment.x);
|
|
84
|
-
translationY.value = (0, react_native_reanimated_1.withTiming)(closestAlignment.y);
|
|
85
|
-
}), [snapAlignments, translationX, translationY]);
|
|
86
|
-
(0, react_1.useEffect)(() => {
|
|
87
|
-
if (!rectangle) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
const alignment = snapAlignments[initialAlignment];
|
|
91
|
-
startRef.current = alignment;
|
|
92
|
-
translationX.value = alignment.x;
|
|
93
|
-
translationY.value = alignment.y;
|
|
94
|
-
// add a small delay to the opacity animation to avoid
|
|
95
|
-
// the floating view to be visible when it is being moved
|
|
96
|
-
opacity.value = (0, react_native_reanimated_1.withDelay)(500, (0, react_native_reanimated_1.withTiming)(1, { duration: 50 }));
|
|
97
|
-
}, [
|
|
98
|
-
rectangle,
|
|
99
|
-
snapAlignments,
|
|
100
|
-
initialAlignment,
|
|
101
|
-
opacity,
|
|
102
|
-
translationX,
|
|
103
|
-
translationY,
|
|
104
|
-
]);
|
|
105
|
-
const animatedStyle = (0, react_native_reanimated_1.useAnimatedStyle)(() => {
|
|
106
|
-
return {
|
|
107
|
-
height: rectangle?.height,
|
|
108
|
-
width: rectangle?.width,
|
|
109
|
-
opacity: opacity.value,
|
|
110
|
-
// to keep the value in the bounds we use min and max
|
|
111
|
-
transform: [
|
|
112
|
-
{
|
|
113
|
-
translateX: translationX.value,
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
translateY: translationY.value,
|
|
117
|
-
},
|
|
118
|
-
],
|
|
119
|
-
};
|
|
120
|
-
});
|
|
121
|
-
return (
|
|
122
|
-
// gesture handler root view must absolutely fill the bounds
|
|
123
|
-
// to intercept gestures within those bounds
|
|
124
|
-
<react_native_gesture_handler_1.GestureDetector gesture={dragGesture}>
|
|
125
|
-
<react_native_reanimated_1.default.View style={animatedStyle}>
|
|
126
|
-
<react_native_1.View onLayout={(event) => {
|
|
127
|
-
const layout = event.nativeEvent.layout;
|
|
128
|
-
setRectangle((prev) => {
|
|
129
|
-
if (prev &&
|
|
130
|
-
prev.width === layout.width &&
|
|
131
|
-
prev.height === layout.height &&
|
|
132
|
-
prev.x === layout.x &&
|
|
133
|
-
prev.y === layout.y) {
|
|
134
|
-
return prev;
|
|
135
|
-
}
|
|
136
|
-
return layout;
|
|
137
|
-
});
|
|
138
|
-
}} style={common_1.floatingChildViewContainerStyle}>
|
|
139
|
-
{children}
|
|
140
|
-
</react_native_1.View>
|
|
141
|
-
</react_native_reanimated_1.default.View>
|
|
142
|
-
</react_native_gesture_handler_1.GestureDetector>);
|
|
143
|
-
};
|
|
144
|
-
exports.default = ReanimatedFloatingView;
|
|
145
|
-
//# sourceMappingURL=ReanimatedFloatingView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReanimatedFloatingView.js","sourceRoot":"","sources":["../../../../../../src/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0D;AAC1D,+CAAqD;AACrD,qCAMkB;AAClB,+EAAwE;AAExE,mFAKiC;AAEjC,MAAM,sBAAsB,GAAG,CAAC,EAC9B,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,QAAQ,GACU,EAAE,EAAE;IACtB,gDAAgD;IAChD,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACxC,iDAAiD;IACjD,MAAM,YAAY,GAAG,IAAA,wCAAc,EAAC,CAAC,CAAC,CAAC;IACvC,MAAM,YAAY,GAAG,IAAA,wCAAc,EAAC,CAAC,CAAC,CAAC;IACvC,6EAA6E;IAC7E,MAAM,OAAO,GAAG,IAAA,wCAAc,EAAC,CAAC,CAAC,CAAC;IAClC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,eAAK,CAAC,QAAQ,EAAmB,CAAC;IAEpE,MAAM,cAAc,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAClC,IAAI,CAAC,SAAS,EAAE;YACd,OAAO;gBACL,CAAC,8BAAqB,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;gBAC/C,CAAC,8BAAqB,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;gBAChD,CAAC,8BAAqB,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAA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,EAAE;gBACT;oBACE,UAAU,EAAE,YAAY,CAAC,KAAK;iBAC/B;gBACD;oBACE,UAAU,EAAE,YAAY,CAAC,KAAK;iBAC/B;aACF;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO;IACL,4DAA4D;IAC5D,4CAA4C;IAC5C,CAAC,8CAAe,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CACpC;MAAA,CAAC,iCAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,CACpC;QAAA,CAAC,mBAAI,CACH,QAAQ,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;YAClB,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC;YACxC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE;gBACpB,IACE,IAAI;oBACJ,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK;oBAC3B,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM;oBAC7B,IAAI,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC;oBACnB,IAAI,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,EACnB;oBACA,OAAO,IAAI,CAAC;iBACb;gBACD,OAAO,MAAM,CAAC;YAChB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CACF,KAAK,CAAC,CAAC,wCAA+B,CAAC,CAEvC;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,mBAAI,CACR;MAAA,EAAE,iCAAU,CAAC,IAAI,CACnB;IAAA,EAAE,8CAAe,CAAC,CACnB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,sBAAsB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const optionalLibs_1 = require("../../../../utils/internal/optionalLibs");
|
|
4
|
-
const FloatingView = (0, optionalLibs_1.getReanimatedLib)() && (0, optionalLibs_1.getGestureHandlerLib)()
|
|
5
|
-
? require('./ReanimatedFloatingView').default
|
|
6
|
-
: require('./AnimatedFloatingView').default;
|
|
7
|
-
exports.default = FloatingView;
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/Participant/FloatingParticipantView/FloatingView/index.ts"],"names":[],"mappings":";;AAAA,0EAGiD;AAGjD,MAAM,YAAY,GAChB,IAAA,+BAAgB,GAAE,IAAI,IAAA,mCAAoB,GAAE;IAC1C,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC,OAAO;IAC7C,CAAC,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,OAAO,CAAC;AAEhD,kBAAe,YAAY,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react-native-reanimated" />
|
|
2
|
-
export type GestureHandlerType = typeof import('react-native-gesture-handler');
|
|
3
|
-
export type ReanimatedType = typeof import('react-native-reanimated');
|
|
4
|
-
export declare const getReanimatedLib: (onPackageNotFound?: () => void) => typeof import("react-native-reanimated") | undefined;
|
|
5
|
-
export declare const getGestureHandlerLib: (onPackageNotFound?: () => void) => typeof import("react-native-gesture-handler") | undefined;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getGestureHandlerLib = exports.getReanimatedLib = void 0;
|
|
4
|
-
let gestureHandler;
|
|
5
|
-
let reanimated;
|
|
6
|
-
try {
|
|
7
|
-
gestureHandler = require('react-native-gesture-handler');
|
|
8
|
-
}
|
|
9
|
-
catch (e) { }
|
|
10
|
-
try {
|
|
11
|
-
reanimated = require('react-native-reanimated');
|
|
12
|
-
}
|
|
13
|
-
catch (e) { }
|
|
14
|
-
const getReanimatedLib = (onPackageNotFound = () => { }) => {
|
|
15
|
-
if (!reanimated) {
|
|
16
|
-
onPackageNotFound();
|
|
17
|
-
}
|
|
18
|
-
return reanimated;
|
|
19
|
-
};
|
|
20
|
-
exports.getReanimatedLib = getReanimatedLib;
|
|
21
|
-
const getGestureHandlerLib = (onPackageNotFound = () => { }) => {
|
|
22
|
-
if (!gestureHandler) {
|
|
23
|
-
onPackageNotFound();
|
|
24
|
-
}
|
|
25
|
-
return gestureHandler;
|
|
26
|
-
};
|
|
27
|
-
exports.getGestureHandlerLib = getGestureHandlerLib;
|
|
28
|
-
//# sourceMappingURL=optionalLibs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"optionalLibs.js","sourceRoot":"","sources":["../../../../src/utils/internal/optionalLibs.ts"],"names":[],"mappings":";;;AAGA,IAAI,cAA8C,CAAC;AACnD,IAAI,UAAsC,CAAC;AAE3C,IAAI;IACF,cAAc,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;CAC1D;AAAC,OAAO,CAAC,EAAE,GAAE;AAEd,IAAI;IACF,UAAU,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;CACjD;AAAC,OAAO,CAAC,EAAE,GAAE;AAEP,MAAM,gBAAgB,GAAG,CAAC,iBAAiB,GAAG,GAAG,EAAE,GAAE,CAAC,EAAE,EAAE;IAC/D,IAAI,CAAC,UAAU,EAAE;QACf,iBAAiB,EAAE,CAAC;KACrB;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AALW,QAAA,gBAAgB,oBAK3B;AAEK,MAAM,oBAAoB,GAAG,CAAC,iBAAiB,GAAG,GAAG,EAAE,GAAE,CAAC,EAAE,EAAE;IACnE,IAAI,CAAC,cAAc,EAAE;QACnB,iBAAiB,EAAE,CAAC;KACrB;IACD,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC;AALW,QAAA,oBAAoB,wBAK/B"}
|
package/src/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.tsx
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import React, { useMemo, useEffect, useRef } from 'react';
|
|
2
|
-
import { LayoutRectangle, View } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
FloatingViewAlignment,
|
|
5
|
-
getSnapAlignments,
|
|
6
|
-
getClosestSnapAlignment,
|
|
7
|
-
floatingChildViewContainerStyle,
|
|
8
|
-
FloatingViewProps,
|
|
9
|
-
} from './common';
|
|
10
|
-
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
11
|
-
|
|
12
|
-
import Reanimated, {
|
|
13
|
-
useSharedValue,
|
|
14
|
-
withTiming,
|
|
15
|
-
useAnimatedStyle,
|
|
16
|
-
withDelay,
|
|
17
|
-
} from 'react-native-reanimated';
|
|
18
|
-
|
|
19
|
-
const ReanimatedFloatingView = ({
|
|
20
|
-
initialAlignment,
|
|
21
|
-
containerHeight,
|
|
22
|
-
containerWidth,
|
|
23
|
-
children,
|
|
24
|
-
}: FloatingViewProps) => {
|
|
25
|
-
// to store the starting position of the gesture
|
|
26
|
-
const startRef = useRef({ x: 0, y: 0 });
|
|
27
|
-
// to store the necessary translate x, y position
|
|
28
|
-
const translationX = useSharedValue(0);
|
|
29
|
-
const translationY = useSharedValue(0);
|
|
30
|
-
// we don't want to show the floating view until we have the layout rectangle
|
|
31
|
-
const opacity = useSharedValue(0);
|
|
32
|
-
const [rectangle, setRectangle] = React.useState<LayoutRectangle>();
|
|
33
|
-
|
|
34
|
-
const snapAlignments = useMemo(() => {
|
|
35
|
-
if (!rectangle) {
|
|
36
|
-
return {
|
|
37
|
-
[FloatingViewAlignment.topLeft]: { x: 0, y: 0 },
|
|
38
|
-
[FloatingViewAlignment.topRight]: { x: 0, y: 0 },
|
|
39
|
-
[FloatingViewAlignment.bottomLeft]: { x: 0, y: 0 },
|
|
40
|
-
[FloatingViewAlignment.bottomRight]: { x: 0, y: 0 },
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return getSnapAlignments({
|
|
45
|
-
rootContainerDimensions: {
|
|
46
|
-
width: containerWidth,
|
|
47
|
-
height: containerHeight,
|
|
48
|
-
},
|
|
49
|
-
floatingViewDimensions: {
|
|
50
|
-
width: rectangle.width,
|
|
51
|
-
height: rectangle.height,
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
}, [rectangle, containerWidth, containerHeight]);
|
|
55
|
-
|
|
56
|
-
const dragGesture = useMemo(
|
|
57
|
-
() =>
|
|
58
|
-
Gesture.Pan()
|
|
59
|
-
.onStart((_e) => {
|
|
60
|
-
// store the starting position of the gesture
|
|
61
|
-
startRef.current = {
|
|
62
|
-
x: translationX.value,
|
|
63
|
-
y: translationY.value,
|
|
64
|
-
};
|
|
65
|
-
})
|
|
66
|
-
.onUpdate((e) => {
|
|
67
|
-
// update the translation with the distance of the gesture + starting position
|
|
68
|
-
translationX.value = Math.max(
|
|
69
|
-
0,
|
|
70
|
-
Math.min(
|
|
71
|
-
e.translationX + startRef.current.x,
|
|
72
|
-
snapAlignments[FloatingViewAlignment.bottomRight].x,
|
|
73
|
-
),
|
|
74
|
-
);
|
|
75
|
-
translationY.value = Math.max(
|
|
76
|
-
0,
|
|
77
|
-
Math.min(
|
|
78
|
-
e.translationY + startRef.current.y,
|
|
79
|
-
snapAlignments[FloatingViewAlignment.bottomRight].y,
|
|
80
|
-
),
|
|
81
|
-
);
|
|
82
|
-
})
|
|
83
|
-
.onEnd(() => {
|
|
84
|
-
// snap to the closest alignment with a spring animation
|
|
85
|
-
const position = {
|
|
86
|
-
x: translationX.value,
|
|
87
|
-
y: translationY.value,
|
|
88
|
-
};
|
|
89
|
-
const closestAlignment = getClosestSnapAlignment({
|
|
90
|
-
position,
|
|
91
|
-
snapAlignments,
|
|
92
|
-
});
|
|
93
|
-
translationX.value = withTiming(closestAlignment.x);
|
|
94
|
-
translationY.value = withTiming(closestAlignment.y);
|
|
95
|
-
}),
|
|
96
|
-
[snapAlignments, translationX, translationY],
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
if (!rectangle) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const alignment = snapAlignments[initialAlignment];
|
|
104
|
-
startRef.current = alignment;
|
|
105
|
-
|
|
106
|
-
translationX.value = alignment.x;
|
|
107
|
-
translationY.value = alignment.y;
|
|
108
|
-
|
|
109
|
-
// add a small delay to the opacity animation to avoid
|
|
110
|
-
// the floating view to be visible when it is being moved
|
|
111
|
-
opacity.value = withDelay(500, withTiming(1, { duration: 50 }));
|
|
112
|
-
}, [
|
|
113
|
-
rectangle,
|
|
114
|
-
snapAlignments,
|
|
115
|
-
initialAlignment,
|
|
116
|
-
opacity,
|
|
117
|
-
translationX,
|
|
118
|
-
translationY,
|
|
119
|
-
]);
|
|
120
|
-
|
|
121
|
-
const animatedStyle = useAnimatedStyle(() => {
|
|
122
|
-
return {
|
|
123
|
-
height: rectangle?.height,
|
|
124
|
-
width: rectangle?.width,
|
|
125
|
-
opacity: opacity.value,
|
|
126
|
-
// to keep the value in the bounds we use min and max
|
|
127
|
-
transform: [
|
|
128
|
-
{
|
|
129
|
-
translateX: translationX.value,
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
translateY: translationY.value,
|
|
133
|
-
},
|
|
134
|
-
],
|
|
135
|
-
};
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
return (
|
|
139
|
-
// gesture handler root view must absolutely fill the bounds
|
|
140
|
-
// to intercept gestures within those bounds
|
|
141
|
-
<GestureDetector gesture={dragGesture}>
|
|
142
|
-
<Reanimated.View style={animatedStyle}>
|
|
143
|
-
<View
|
|
144
|
-
onLayout={(event) => {
|
|
145
|
-
const layout = event.nativeEvent.layout;
|
|
146
|
-
setRectangle((prev) => {
|
|
147
|
-
if (
|
|
148
|
-
prev &&
|
|
149
|
-
prev.width === layout.width &&
|
|
150
|
-
prev.height === layout.height &&
|
|
151
|
-
prev.x === layout.x &&
|
|
152
|
-
prev.y === layout.y
|
|
153
|
-
) {
|
|
154
|
-
return prev;
|
|
155
|
-
}
|
|
156
|
-
return layout;
|
|
157
|
-
});
|
|
158
|
-
}}
|
|
159
|
-
style={floatingChildViewContainerStyle}
|
|
160
|
-
>
|
|
161
|
-
{children}
|
|
162
|
-
</View>
|
|
163
|
-
</Reanimated.View>
|
|
164
|
-
</GestureDetector>
|
|
165
|
-
);
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
export default ReanimatedFloatingView;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getGestureHandlerLib,
|
|
3
|
-
getReanimatedLib,
|
|
4
|
-
} from '../../../../utils/internal/optionalLibs';
|
|
5
|
-
import { FloatingViewProps } from './common';
|
|
6
|
-
|
|
7
|
-
const FloatingView: React.FC<FloatingViewProps> =
|
|
8
|
-
getReanimatedLib() && getGestureHandlerLib()
|
|
9
|
-
? require('./ReanimatedFloatingView').default
|
|
10
|
-
: require('./AnimatedFloatingView').default;
|
|
11
|
-
|
|
12
|
-
export default FloatingView;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export type GestureHandlerType = typeof import('react-native-gesture-handler');
|
|
2
|
-
export type ReanimatedType = typeof import('react-native-reanimated');
|
|
3
|
-
|
|
4
|
-
let gestureHandler: GestureHandlerType | undefined;
|
|
5
|
-
let reanimated: ReanimatedType | undefined;
|
|
6
|
-
|
|
7
|
-
try {
|
|
8
|
-
gestureHandler = require('react-native-gesture-handler');
|
|
9
|
-
} catch (e) {}
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
reanimated = require('react-native-reanimated');
|
|
13
|
-
} catch (e) {}
|
|
14
|
-
|
|
15
|
-
export const getReanimatedLib = (onPackageNotFound = () => {}) => {
|
|
16
|
-
if (!reanimated) {
|
|
17
|
-
onPackageNotFound();
|
|
18
|
-
}
|
|
19
|
-
return reanimated;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const getGestureHandlerLib = (onPackageNotFound = () => {}) => {
|
|
23
|
-
if (!gestureHandler) {
|
|
24
|
-
onPackageNotFound();
|
|
25
|
-
}
|
|
26
|
-
return gestureHandler;
|
|
27
|
-
};
|