@ethora/chat-component-rn 26.10.3 → 26.10.5
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/lib/commonjs/components/Header/HeaderRoomList.js +72 -69
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +2 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/ActiveCallBar.js +248 -0
- package/lib/commonjs/components/VideoCalls/ActiveCallBar.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/CallIcons.js +41 -16
- package/lib/commonjs/components/VideoCalls/CallIcons.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/VideoCallOverlay.js +193 -37
- package/lib/commonjs/components/VideoCalls/VideoCallOverlay.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js +71 -109
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/callSessionController.js +74 -21
- package/lib/commonjs/components/VideoCalls/callSessionController.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/callUiStore.js +120 -0
- package/lib/commonjs/components/VideoCalls/callUiStore.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/livekitRuntime.js +10 -1
- package/lib/commonjs/components/VideoCalls/livekitRuntime.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/useCallKeep.js +197 -28
- package/lib/commonjs/components/VideoCalls/useCallKeep.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/useOngoingCallNotification.js +88 -0
- package/lib/commonjs/components/VideoCalls/useOngoingCallNotification.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/usePipTile.js +232 -0
- package/lib/commonjs/components/VideoCalls/usePipTile.js.map +1 -0
- package/lib/commonjs/helpers/updateMessagesTillLast.js +3 -1
- package/lib/commonjs/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +54 -0
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/components/Header/HeaderRoomList.js +73 -70
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +2 -1
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/VideoCalls/ActiveCallBar.js +240 -0
- package/lib/module/components/VideoCalls/ActiveCallBar.js.map +1 -0
- package/lib/module/components/VideoCalls/CallIcons.js +38 -15
- package/lib/module/components/VideoCalls/CallIcons.js.map +1 -1
- package/lib/module/components/VideoCalls/VideoCallOverlay.js +195 -39
- package/lib/module/components/VideoCalls/VideoCallOverlay.js.map +1 -1
- package/lib/module/components/VideoCalls/VideoCallSession.js +72 -111
- package/lib/module/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/module/components/VideoCalls/callSessionController.js +71 -19
- package/lib/module/components/VideoCalls/callSessionController.js.map +1 -1
- package/lib/module/components/VideoCalls/callUiStore.js +111 -0
- package/lib/module/components/VideoCalls/callUiStore.js.map +1 -0
- package/lib/module/components/VideoCalls/livekitRuntime.js +10 -1
- package/lib/module/components/VideoCalls/livekitRuntime.js.map +1 -1
- package/lib/module/components/VideoCalls/useCallKeep.js +198 -29
- package/lib/module/components/VideoCalls/useCallKeep.js.map +1 -1
- package/lib/module/components/VideoCalls/useOngoingCallNotification.js +84 -0
- package/lib/module/components/VideoCalls/useOngoingCallNotification.js.map +1 -0
- package/lib/module/components/VideoCalls/usePipTile.js +228 -0
- package/lib/module/components/VideoCalls/usePipTile.js.map +1 -0
- package/lib/module/helpers/updateMessagesTillLast.js +3 -1
- package/lib/module/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/module/i18n/strings.js +54 -0
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/main.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/ActiveCallBar.d.ts +27 -0
- package/lib/typescript/components/VideoCalls/ActiveCallBar.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/CallIcons.d.ts +9 -0
- package/lib/typescript/components/VideoCalls/CallIcons.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/VideoCallOverlay.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts +7 -3
- package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/callSessionController.d.ts +9 -0
- package/lib/typescript/components/VideoCalls/callSessionController.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/callUiStore.d.ts +37 -0
- package/lib/typescript/components/VideoCalls/callUiStore.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/livekitRuntime.d.ts +7 -0
- package/lib/typescript/components/VideoCalls/livekitRuntime.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/useCallKeep.d.ts +12 -0
- package/lib/typescript/components/VideoCalls/useCallKeep.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/useOngoingCallNotification.d.ts +10 -0
- package/lib/typescript/components/VideoCalls/useOngoingCallNotification.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/usePipTile.d.ts +46 -0
- package/lib/typescript/components/VideoCalls/usePipTile.d.ts.map +1 -0
- package/lib/typescript/helpers/updateMessagesTillLast.d.ts.map +1 -1
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/main.d.ts +1 -1
- package/lib/typescript/main.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +40 -0
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Header/HeaderRoomList.tsx +66 -61
- package/src/components/MainComponents/ChatHeader.tsx +3 -0
- package/src/components/VideoCalls/ActiveCallBar.tsx +222 -0
- package/src/components/VideoCalls/CallIcons.tsx +36 -12
- package/src/components/VideoCalls/VideoCallOverlay.tsx +211 -37
- package/src/components/VideoCalls/VideoCallSession.tsx +84 -93
- package/src/components/VideoCalls/callSessionController.ts +73 -24
- package/src/components/VideoCalls/callUiStore.ts +106 -0
- package/src/components/VideoCalls/livekitRuntime.ts +16 -0
- package/src/components/VideoCalls/useCallKeep.ts +204 -33
- package/src/components/VideoCalls/useOngoingCallNotification.ts +113 -0
- package/src/components/VideoCalls/usePipTile.ts +214 -0
- package/src/helpers/updateMessagesTillLast.tsx +2 -1
- package/src/i18n/strings.ts +54 -0
- package/src/main.ts +3 -0
- package/src/types/types.ts +48 -0
- package/src/version.ts +1 -1
- package/lib/commonjs/components/VideoCalls/useDraggable.js +0 -59
- package/lib/commonjs/components/VideoCalls/useDraggable.js.map +0 -1
- package/lib/module/components/VideoCalls/useDraggable.js +0 -55
- package/lib/module/components/VideoCalls/useDraggable.js.map +0 -1
- package/lib/typescript/components/VideoCalls/useDraggable.d.ts +0 -19
- package/lib/typescript/components/VideoCalls/useDraggable.d.ts.map +0 -1
- package/src/components/VideoCalls/useDraggable.ts +0 -46
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
|
+
import { RootState } from '../../roomStore';
|
|
4
|
+
import { useT } from '../../i18n/useT';
|
|
5
|
+
import type {
|
|
6
|
+
OngoingCallNotification,
|
|
7
|
+
OngoingCallNotificationAction,
|
|
8
|
+
} from '../../types/types';
|
|
9
|
+
import { terminateActiveCall } from './callActions';
|
|
10
|
+
import { toggleCallCamera, toggleCallMic, useCallSession } from './callSessionController';
|
|
11
|
+
import { setCallMinimized } from './callUiStore';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Drives the host's ongoing-call notification (`videoCalls.
|
|
15
|
+
* ongoingCallNotification`, an Android foreground-service notification in
|
|
16
|
+
* the Ethora app): shown while a call is connecting or connected, updated
|
|
17
|
+
* when the mic, camera or timer anchor change, and its buttons act on the
|
|
18
|
+
* call like the in-app ones.
|
|
19
|
+
*/
|
|
20
|
+
export const useOngoingCallNotification = (
|
|
21
|
+
adapter: OngoingCallNotification | undefined
|
|
22
|
+
): void => {
|
|
23
|
+
const t = useT();
|
|
24
|
+
const call = useSelector((state: RootState) => state.call);
|
|
25
|
+
const session = useCallSession();
|
|
26
|
+
const shownRef = useRef(false);
|
|
27
|
+
|
|
28
|
+
const live =
|
|
29
|
+
!!call.token && (call.phase === 'connecting' || call.phase === 'in-call');
|
|
30
|
+
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (!adapter) {return;}
|
|
33
|
+
return adapter.addActionListener((action: OngoingCallNotificationAction) => {
|
|
34
|
+
switch (action) {
|
|
35
|
+
case 'hangUp':
|
|
36
|
+
terminateActiveCall('ended');
|
|
37
|
+
break;
|
|
38
|
+
case 'toggleMic':
|
|
39
|
+
void toggleCallMic();
|
|
40
|
+
break;
|
|
41
|
+
case 'toggleCamera':
|
|
42
|
+
void toggleCallCamera();
|
|
43
|
+
break;
|
|
44
|
+
case 'open':
|
|
45
|
+
// Back from the notification: show the call, not the strip.
|
|
46
|
+
setCallMinimized(false);
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}, [adapter]);
|
|
51
|
+
|
|
52
|
+
const isVideo = call.kind === 'video';
|
|
53
|
+
const connectedAt = session.anchorAt;
|
|
54
|
+
const text =
|
|
55
|
+
connectedAt !== null
|
|
56
|
+
? isVideo
|
|
57
|
+
? t('call.notification.ongoingVideo')
|
|
58
|
+
: t('call.notification.ongoing')
|
|
59
|
+
: !session.connected
|
|
60
|
+
? t('call.status.connecting')
|
|
61
|
+
: t('call.status.waitingForPeer');
|
|
62
|
+
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (!adapter) {return;}
|
|
65
|
+
if (!live) {
|
|
66
|
+
if (shownRef.current) {
|
|
67
|
+
shownRef.current = false;
|
|
68
|
+
adapter.hide();
|
|
69
|
+
}
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
shownRef.current = true;
|
|
73
|
+
adapter.show({
|
|
74
|
+
callId: call.callId || call.roomJid || 'call',
|
|
75
|
+
title: call.roomName || t('call.unknownCaller'),
|
|
76
|
+
text,
|
|
77
|
+
kind: call.kind,
|
|
78
|
+
connectedAt,
|
|
79
|
+
micOn: session.micOn,
|
|
80
|
+
cameraOn: isVideo && session.cameraOn,
|
|
81
|
+
labels: {
|
|
82
|
+
hangUp: t('call.action.hangUp'),
|
|
83
|
+
mute: t('call.notification.mute'),
|
|
84
|
+
unmute: t('call.notification.unmute'),
|
|
85
|
+
cameraOn: t('call.notification.cameraOn'),
|
|
86
|
+
cameraOff: t('call.notification.cameraOff'),
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
}, [
|
|
90
|
+
adapter,
|
|
91
|
+
live,
|
|
92
|
+
t,
|
|
93
|
+
text,
|
|
94
|
+
connectedAt,
|
|
95
|
+
isVideo,
|
|
96
|
+
call.callId,
|
|
97
|
+
call.roomJid,
|
|
98
|
+
call.roomName,
|
|
99
|
+
call.kind,
|
|
100
|
+
session.micOn,
|
|
101
|
+
session.cameraOn,
|
|
102
|
+
]);
|
|
103
|
+
|
|
104
|
+
useEffect(
|
|
105
|
+
() => () => {
|
|
106
|
+
if (adapter && shownRef.current) {
|
|
107
|
+
shownRef.current = false;
|
|
108
|
+
adapter.hide();
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
[adapter]
|
|
112
|
+
);
|
|
113
|
+
};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { Animated, LayoutChangeEvent, PanResponder } from 'react-native';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The small video tile of a call, Telegram-style: drag it anywhere and it
|
|
6
|
+
* snaps to the nearest corner when released (a flick carries it towards
|
|
7
|
+
* the flick), pinch it to switch between a small and a large size.
|
|
8
|
+
*
|
|
9
|
+
* Positions are kept per corner rather than per pixel, so the tile stays
|
|
10
|
+
* glued to its corner when the stage changes size (rotation, iPad split
|
|
11
|
+
* view) or the tile itself changes size.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export type PipTileSize = 'small' | 'large';
|
|
15
|
+
|
|
16
|
+
export const PIP_TILE_SIZES: Record<PipTileSize, { width: number; height: number }> = {
|
|
17
|
+
small: { width: 104, height: 148 },
|
|
18
|
+
large: { width: 156, height: 222 },
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const MARGIN = 12;
|
|
22
|
+
// How far a flick carries the tile before picking a corner, in ms of velocity.
|
|
23
|
+
const FLICK_PROJECTION_MS = 160;
|
|
24
|
+
// Pinch past these ratios to change size; in between keeps the current one.
|
|
25
|
+
const GROW_RATIO = 1.12;
|
|
26
|
+
const SHRINK_RATIO = 0.9;
|
|
27
|
+
|
|
28
|
+
interface Corner {
|
|
29
|
+
right: boolean;
|
|
30
|
+
bottom: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface Stage {
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const SPRING = { useNativeDriver: false, damping: 20, stiffness: 220, mass: 0.8 };
|
|
39
|
+
|
|
40
|
+
const touchDistance = (touches: ReadonlyArray<{ pageX: number; pageY: number }>) => {
|
|
41
|
+
const [a, b] = touches;
|
|
42
|
+
return Math.hypot(a.pageX - b.pageX, a.pageY - b.pageY);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const usePipTile = ({ topInset = 0 }: { topInset?: number } = {}) => {
|
|
46
|
+
const [stage, setStage] = useState<Stage | null>(null);
|
|
47
|
+
const [size, setSize] = useState<PipTileSize>('small');
|
|
48
|
+
const stageRef = useRef<Stage | null>(null);
|
|
49
|
+
const sizeRef = useRef<PipTileSize>('small');
|
|
50
|
+
const cornerRef = useRef<Corner>({ right: true, bottom: false });
|
|
51
|
+
const topInsetRef = useRef(topInset);
|
|
52
|
+
topInsetRef.current = topInset;
|
|
53
|
+
|
|
54
|
+
const position = useRef(new Animated.ValueXY({ x: 0, y: 0 })).current;
|
|
55
|
+
const width = useRef(new Animated.Value(PIP_TILE_SIZES.small.width)).current;
|
|
56
|
+
const height = useRef(new Animated.Value(PIP_TILE_SIZES.small.height)).current;
|
|
57
|
+
const pinchScale = useRef(new Animated.Value(1)).current;
|
|
58
|
+
// Where the tile rests, i.e. where a drag starts from.
|
|
59
|
+
const restRef = useRef({ x: 0, y: 0 });
|
|
60
|
+
const gestureRef = useRef({ pinching: false, startDistance: 0, scale: 1 });
|
|
61
|
+
|
|
62
|
+
const cornerPoint = useCallback((corner: Corner, tileSize: PipTileSize) => {
|
|
63
|
+
const area = stageRef.current;
|
|
64
|
+
if (!area) {return { x: 0, y: 0 };}
|
|
65
|
+
const tile = PIP_TILE_SIZES[tileSize];
|
|
66
|
+
const top = MARGIN + topInsetRef.current;
|
|
67
|
+
return {
|
|
68
|
+
x: corner.right ? Math.max(MARGIN, area.width - tile.width - MARGIN) : MARGIN,
|
|
69
|
+
y: corner.bottom ? Math.max(top, area.height - tile.height - MARGIN) : top,
|
|
70
|
+
};
|
|
71
|
+
}, []);
|
|
72
|
+
|
|
73
|
+
const settle = useCallback(
|
|
74
|
+
(animated: boolean) => {
|
|
75
|
+
const tileSize = sizeRef.current;
|
|
76
|
+
const target = cornerPoint(cornerRef.current, tileSize);
|
|
77
|
+
const tile = PIP_TILE_SIZES[tileSize];
|
|
78
|
+
restRef.current = target;
|
|
79
|
+
if (!animated) {
|
|
80
|
+
position.setValue(target);
|
|
81
|
+
width.setValue(tile.width);
|
|
82
|
+
height.setValue(tile.height);
|
|
83
|
+
pinchScale.setValue(1);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
Animated.parallel([
|
|
87
|
+
Animated.spring(position, { ...SPRING, toValue: target }),
|
|
88
|
+
Animated.spring(width, { ...SPRING, toValue: tile.width }),
|
|
89
|
+
Animated.spring(height, { ...SPRING, toValue: tile.height }),
|
|
90
|
+
Animated.spring(pinchScale, { ...SPRING, toValue: 1 }),
|
|
91
|
+
]).start();
|
|
92
|
+
},
|
|
93
|
+
[cornerPoint, position, width, height, pinchScale]
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
const onStageLayout = useCallback(
|
|
97
|
+
(event: LayoutChangeEvent) => {
|
|
98
|
+
const { width: w, height: h } = event.nativeEvent.layout;
|
|
99
|
+
const prev = stageRef.current;
|
|
100
|
+
if (prev && prev.width === w && prev.height === h) {return;}
|
|
101
|
+
stageRef.current = { width: w, height: h };
|
|
102
|
+
setStage(stageRef.current);
|
|
103
|
+
settle(false);
|
|
104
|
+
},
|
|
105
|
+
[settle]
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
// The safe-area inset arrives after the first layout on some devices.
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
if (stageRef.current) {settle(false);}
|
|
111
|
+
}, [topInset, settle]);
|
|
112
|
+
|
|
113
|
+
const panHandlers = useMemo(
|
|
114
|
+
() =>
|
|
115
|
+
PanResponder.create({
|
|
116
|
+
// Two fingers are always ours (pinch); one finger only once it
|
|
117
|
+
// moves, so a tap still reaches the tile's onPress (swap videos).
|
|
118
|
+
onStartShouldSetPanResponderCapture: (event) =>
|
|
119
|
+
event.nativeEvent.touches.length >= 2,
|
|
120
|
+
// Own the touch from the start when the tile has no tap target
|
|
121
|
+
// (nothing to swap): an ancestor outside the call Modal would take
|
|
122
|
+
// it otherwise, and the move-capture below would never be asked.
|
|
123
|
+
onStartShouldSetPanResponder: () => true,
|
|
124
|
+
onMoveShouldSetPanResponderCapture: (event, gesture) =>
|
|
125
|
+
event.nativeEvent.touches.length >= 2 ||
|
|
126
|
+
Math.abs(gesture.dx) > 4 ||
|
|
127
|
+
Math.abs(gesture.dy) > 4,
|
|
128
|
+
// Never hand the tile over to the swipe-to-minimize of the screen.
|
|
129
|
+
onPanResponderTerminationRequest: () => false,
|
|
130
|
+
onPanResponderGrant: () => {
|
|
131
|
+
position.stopAnimation();
|
|
132
|
+
width.stopAnimation();
|
|
133
|
+
height.stopAnimation();
|
|
134
|
+
pinchScale.stopAnimation();
|
|
135
|
+
gestureRef.current = { pinching: false, startDistance: 0, scale: 1 };
|
|
136
|
+
},
|
|
137
|
+
onPanResponderMove: (event, gesture) => {
|
|
138
|
+
const touches = event.nativeEvent.touches;
|
|
139
|
+
const state = gestureRef.current;
|
|
140
|
+
if (touches.length >= 2) {
|
|
141
|
+
const distance = touchDistance(touches);
|
|
142
|
+
if (!state.pinching || state.startDistance <= 0) {
|
|
143
|
+
state.pinching = true;
|
|
144
|
+
state.startDistance = distance;
|
|
145
|
+
} else {
|
|
146
|
+
state.scale = Math.min(1.8, Math.max(0.6, distance / state.startDistance));
|
|
147
|
+
pinchScale.setValue(state.scale);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
position.setValue({
|
|
151
|
+
x: restRef.current.x + gesture.dx,
|
|
152
|
+
y: restRef.current.y + gesture.dy,
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
onPanResponderRelease: (_event, gesture) => {
|
|
156
|
+
const area = stageRef.current;
|
|
157
|
+
const state = gestureRef.current;
|
|
158
|
+
if (state.pinching) {
|
|
159
|
+
const next: PipTileSize =
|
|
160
|
+
state.scale >= GROW_RATIO
|
|
161
|
+
? 'large'
|
|
162
|
+
: state.scale <= SHRINK_RATIO
|
|
163
|
+
? 'small'
|
|
164
|
+
: sizeRef.current;
|
|
165
|
+
if (next !== sizeRef.current) {
|
|
166
|
+
// Keep the size the finger left it at, then let the spring
|
|
167
|
+
// carry it to the new one, so the tile doesn't jump.
|
|
168
|
+
const from = PIP_TILE_SIZES[sizeRef.current];
|
|
169
|
+
width.setValue(from.width * state.scale);
|
|
170
|
+
height.setValue(from.height * state.scale);
|
|
171
|
+
pinchScale.setValue(1);
|
|
172
|
+
sizeRef.current = next;
|
|
173
|
+
setSize(next);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (area) {
|
|
177
|
+
const tile = PIP_TILE_SIZES[sizeRef.current];
|
|
178
|
+
const centerX =
|
|
179
|
+
restRef.current.x + gesture.dx + gesture.vx * FLICK_PROJECTION_MS + tile.width / 2;
|
|
180
|
+
const centerY =
|
|
181
|
+
restRef.current.y + gesture.dy + gesture.vy * FLICK_PROJECTION_MS + tile.height / 2;
|
|
182
|
+
cornerRef.current = {
|
|
183
|
+
right: centerX > area.width / 2,
|
|
184
|
+
bottom: centerY > area.height / 2,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
settle(true);
|
|
188
|
+
},
|
|
189
|
+
onPanResponderTerminate: () => settle(true),
|
|
190
|
+
}).panHandlers,
|
|
191
|
+
[position, width, height, pinchScale, settle]
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
return {
|
|
195
|
+
/** Put on the area the tile moves within. */
|
|
196
|
+
onStageLayout,
|
|
197
|
+
panHandlers,
|
|
198
|
+
size,
|
|
199
|
+
/** Hidden until the stage is measured, so it never flashes at 0,0. */
|
|
200
|
+
style: {
|
|
201
|
+
position: 'absolute' as const,
|
|
202
|
+
left: 0,
|
|
203
|
+
top: 0,
|
|
204
|
+
width,
|
|
205
|
+
height,
|
|
206
|
+
opacity: stage ? 1 : 0,
|
|
207
|
+
transform: [
|
|
208
|
+
{ translateX: position.x },
|
|
209
|
+
{ translateY: position.y },
|
|
210
|
+
{ scale: pinchScale },
|
|
211
|
+
],
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
};
|
|
@@ -74,7 +74,8 @@ export const updateMessagesTillLast = async (
|
|
|
74
74
|
{ coalesceRoom: true, source: 'background', selfApplied: true }
|
|
75
75
|
);
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
// undefined when the stanza was dropped (e.g. reconnecting).
|
|
78
|
+
if (!fetchedMessages?.length) {break;}
|
|
78
79
|
|
|
79
80
|
counter++;
|
|
80
81
|
|
package/src/i18n/strings.ts
CHANGED
|
@@ -115,6 +115,15 @@ const en: UiStringTable = {
|
|
|
115
115
|
'call.action.stopCamera': 'Turn camera off',
|
|
116
116
|
'call.action.startCamera': 'Turn camera on',
|
|
117
117
|
'call.action.switchCamera': 'Switch camera',
|
|
118
|
+
'call.action.swapVideo': 'Swap videos',
|
|
119
|
+
'call.action.fillVideo': 'Stretch video',
|
|
120
|
+
'call.action.fitVideo': 'Show whole video',
|
|
121
|
+
'call.notification.ongoing': 'Ongoing call',
|
|
122
|
+
'call.notification.ongoingVideo': 'Ongoing video call',
|
|
123
|
+
'call.notification.mute': 'Mute',
|
|
124
|
+
'call.notification.unmute': 'Unmute',
|
|
125
|
+
'call.notification.cameraOn': 'Camera on',
|
|
126
|
+
'call.notification.cameraOff': 'Camera off',
|
|
118
127
|
'call.action.speakerOn': 'Turn speaker on',
|
|
119
128
|
'call.action.speakerOff': 'Turn speaker off',
|
|
120
129
|
'call.action.startAudioCall': 'Start audio call',
|
|
@@ -495,6 +504,15 @@ const fr: UiStringTable = {
|
|
|
495
504
|
'call.action.stopCamera': 'Désactiver la caméra',
|
|
496
505
|
'call.action.startCamera': 'Activer la caméra',
|
|
497
506
|
'call.action.switchCamera': 'Changer de caméra',
|
|
507
|
+
'call.action.swapVideo': 'Inverser les vidéos',
|
|
508
|
+
'call.action.fillVideo': 'Étirer la vidéo',
|
|
509
|
+
'call.action.fitVideo': 'Afficher toute la vidéo',
|
|
510
|
+
'call.notification.ongoing': 'Appel en cours',
|
|
511
|
+
'call.notification.ongoingVideo': 'Appel vidéo en cours',
|
|
512
|
+
'call.notification.mute': 'Couper',
|
|
513
|
+
'call.notification.unmute': 'Réactiver',
|
|
514
|
+
'call.notification.cameraOn': 'Caméra on',
|
|
515
|
+
'call.notification.cameraOff': 'Caméra off',
|
|
498
516
|
'call.action.speakerOn': 'Activer le haut-parleur',
|
|
499
517
|
'call.action.speakerOff': 'Désactiver le haut-parleur',
|
|
500
518
|
'call.action.startAudioCall': 'Démarrer un appel audio',
|
|
@@ -875,6 +893,15 @@ const es: UiStringTable = {
|
|
|
875
893
|
'call.action.stopCamera': 'Apagar la cámara',
|
|
876
894
|
'call.action.startCamera': 'Encender la cámara',
|
|
877
895
|
'call.action.switchCamera': 'Cambiar de cámara',
|
|
896
|
+
'call.action.swapVideo': 'Intercambiar vídeos',
|
|
897
|
+
'call.action.fillVideo': 'Ampliar vídeo',
|
|
898
|
+
'call.action.fitVideo': 'Ver vídeo completo',
|
|
899
|
+
'call.notification.ongoing': 'Llamada en curso',
|
|
900
|
+
'call.notification.ongoingVideo': 'Videollamada en curso',
|
|
901
|
+
'call.notification.mute': 'Silenciar',
|
|
902
|
+
'call.notification.unmute': 'Activar',
|
|
903
|
+
'call.notification.cameraOn': 'Cámara on',
|
|
904
|
+
'call.notification.cameraOff': 'Cámara off',
|
|
878
905
|
'call.action.speakerOn': 'Activar el altavoz',
|
|
879
906
|
'call.action.speakerOff': 'Desactivar el altavoz',
|
|
880
907
|
'call.action.startAudioCall': 'Iniciar llamada de audio',
|
|
@@ -1255,6 +1282,15 @@ const pt: UiStringTable = {
|
|
|
1255
1282
|
'call.action.stopCamera': 'Desligar a câmara',
|
|
1256
1283
|
'call.action.startCamera': 'Ligar a câmara',
|
|
1257
1284
|
'call.action.switchCamera': 'Mudar de câmara',
|
|
1285
|
+
'call.action.swapVideo': 'Trocar vídeos',
|
|
1286
|
+
'call.action.fillVideo': 'Esticar vídeo',
|
|
1287
|
+
'call.action.fitVideo': 'Mostrar vídeo inteiro',
|
|
1288
|
+
'call.notification.ongoing': 'Chamada em andamento',
|
|
1289
|
+
'call.notification.ongoingVideo': 'Videochamada em andamento',
|
|
1290
|
+
'call.notification.mute': 'Silenciar',
|
|
1291
|
+
'call.notification.unmute': 'Ativar som',
|
|
1292
|
+
'call.notification.cameraOn': 'Ligar câmera',
|
|
1293
|
+
'call.notification.cameraOff': 'Desligar câmera',
|
|
1258
1294
|
'call.action.speakerOn': 'Ligar o altifalante',
|
|
1259
1295
|
'call.action.speakerOff': 'Desligar o altifalante',
|
|
1260
1296
|
'call.action.startAudioCall': 'Iniciar chamada de áudio',
|
|
@@ -1635,6 +1671,15 @@ const ht: UiStringTable = {
|
|
|
1635
1671
|
'call.action.stopCamera': 'Etenn kamera a',
|
|
1636
1672
|
'call.action.startCamera': 'Limen kamera a',
|
|
1637
1673
|
'call.action.switchCamera': 'Chanje kamera',
|
|
1674
|
+
'call.action.swapVideo': 'Chanje videyo yo',
|
|
1675
|
+
'call.action.fillVideo': 'Lonje videyo a',
|
|
1676
|
+
'call.action.fitVideo': 'Montre tout videyo a',
|
|
1677
|
+
'call.notification.ongoing': 'Apèl k ap fèt',
|
|
1678
|
+
'call.notification.ongoingVideo': 'Apèl videyo k ap fèt',
|
|
1679
|
+
'call.notification.mute': 'Fèmen mikwo',
|
|
1680
|
+
'call.notification.unmute': 'Louvri mikwo',
|
|
1681
|
+
'call.notification.cameraOn': 'Limen kamera',
|
|
1682
|
+
'call.notification.cameraOff': 'Etenn kamera',
|
|
1638
1683
|
'call.action.speakerOn': 'Limen opalè a',
|
|
1639
1684
|
'call.action.speakerOff': 'Etenn opalè a',
|
|
1640
1685
|
'call.action.startAudioCall': 'Kòmanse yon apèl odyo',
|
|
@@ -2015,6 +2060,15 @@ const zh: UiStringTable = {
|
|
|
2015
2060
|
'call.action.stopCamera': '关闭摄像头',
|
|
2016
2061
|
'call.action.startCamera': '打开摄像头',
|
|
2017
2062
|
'call.action.switchCamera': '切换摄像头',
|
|
2063
|
+
'call.action.swapVideo': '切换画面',
|
|
2064
|
+
'call.action.fillVideo': '铺满画面',
|
|
2065
|
+
'call.action.fitVideo': '显示完整画面',
|
|
2066
|
+
'call.notification.ongoing': '通话中',
|
|
2067
|
+
'call.notification.ongoingVideo': '视频通话中',
|
|
2068
|
+
'call.notification.mute': '静音',
|
|
2069
|
+
'call.notification.unmute': '取消静音',
|
|
2070
|
+
'call.notification.cameraOn': '开启摄像头',
|
|
2071
|
+
'call.notification.cameraOff': '关闭摄像头',
|
|
2018
2072
|
'call.action.speakerOn': '打开扬声器',
|
|
2019
2073
|
'call.action.speakerOff': '关闭扬声器',
|
|
2020
2074
|
'call.action.startAudioCall': '发起语音通话',
|
package/src/main.ts
CHANGED
|
@@ -91,6 +91,9 @@ export type {
|
|
|
91
91
|
ChatTextStyle,
|
|
92
92
|
VideoCallsConfig,
|
|
93
93
|
VideoCallIcons,
|
|
94
|
+
OngoingCallNotification,
|
|
95
|
+
OngoingCallNotificationAction,
|
|
96
|
+
OngoingCallNotificationState,
|
|
94
97
|
} from './types/types';
|
|
95
98
|
export type { Iso639_1Codes } from './types/models/language.model';
|
|
96
99
|
export type { TranslateMode } from './utils/translateModePolicy';
|
package/src/types/types.ts
CHANGED
|
@@ -1023,6 +1023,54 @@ export interface VideoCallsConfig {
|
|
|
1023
1023
|
showScreenShare?: boolean;
|
|
1024
1024
|
/** Custom icons for the call control bar / ring screen. */
|
|
1025
1025
|
icons?: VideoCallIcons;
|
|
1026
|
+
/**
|
|
1027
|
+
* The system "call in progress" surface outside the app, typically an
|
|
1028
|
+
* Android ongoing-call notification (a foreground service, which Android
|
|
1029
|
+
* also needs to keep the microphone and camera alive in the background).
|
|
1030
|
+
* Native code, so the host supplies it; the SDK drives it from the call
|
|
1031
|
+
* state and handles its buttons. On iOS the same role is played by
|
|
1032
|
+
* CallKit (`react-native-callkeep`), which the SDK uses on its own.
|
|
1033
|
+
*/
|
|
1034
|
+
ongoingCallNotification?: OngoingCallNotification;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
/** What the ongoing-call notification should show. Sent on every change. */
|
|
1038
|
+
export interface OngoingCallNotificationState {
|
|
1039
|
+
callId: string;
|
|
1040
|
+
/** The peer's display name. */
|
|
1041
|
+
title: string;
|
|
1042
|
+
/** Localized second line, e.g. "Ongoing video call" or "Connecting...". */
|
|
1043
|
+
text: string;
|
|
1044
|
+
kind: 'audio' | 'video';
|
|
1045
|
+
/** Epoch ms the call connected, for a running timer; null before. */
|
|
1046
|
+
connectedAt: number | null;
|
|
1047
|
+
micOn: boolean;
|
|
1048
|
+
cameraOn: boolean;
|
|
1049
|
+
/** Localized button labels. */
|
|
1050
|
+
labels: {
|
|
1051
|
+
hangUp: string;
|
|
1052
|
+
mute: string;
|
|
1053
|
+
unmute: string;
|
|
1054
|
+
cameraOn: string;
|
|
1055
|
+
cameraOff: string;
|
|
1056
|
+
};
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
export type OngoingCallNotificationAction =
|
|
1060
|
+
| 'hangUp'
|
|
1061
|
+
| 'toggleMic'
|
|
1062
|
+
| 'toggleCamera'
|
|
1063
|
+
/** The notification itself was tapped and brought the app forward. */
|
|
1064
|
+
| 'open';
|
|
1065
|
+
|
|
1066
|
+
export interface OngoingCallNotification {
|
|
1067
|
+
/** Create the notification, or update it if it is already shown. */
|
|
1068
|
+
show: (state: OngoingCallNotificationState) => void;
|
|
1069
|
+
hide: () => void;
|
|
1070
|
+
/** Returns the unsubscribe function. */
|
|
1071
|
+
addActionListener: (
|
|
1072
|
+
listener: (action: OngoingCallNotificationAction) => void
|
|
1073
|
+
) => () => void;
|
|
1026
1074
|
}
|
|
1027
1075
|
|
|
1028
1076
|
interface ConfigRoom {
|
package/src/version.ts
CHANGED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useDraggable = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
/**
|
|
10
|
-
* Drag a floating element around (web's useDraggable, for the self-view
|
|
11
|
-
* tile and the minimized call panel). The offset is kept between drags.
|
|
12
|
-
*
|
|
13
|
-
* The responder only claims the gesture once the finger actually moves a
|
|
14
|
-
* few points, so taps still reach the buttons inside the dragged element.
|
|
15
|
-
*/
|
|
16
|
-
const useDraggable = () => {
|
|
17
|
-
const position = (0, _react.useRef)(new _reactNative.Animated.ValueXY({
|
|
18
|
-
x: 0,
|
|
19
|
-
y: 0
|
|
20
|
-
})).current;
|
|
21
|
-
const offset = (0, _react.useRef)({
|
|
22
|
-
x: 0,
|
|
23
|
-
y: 0
|
|
24
|
-
});
|
|
25
|
-
const panHandlers = (0, _react.useMemo)(() => _reactNative.PanResponder.create({
|
|
26
|
-
onMoveShouldSetPanResponder: (_event, gesture) => Math.abs(gesture.dx) > 4 || Math.abs(gesture.dy) > 4,
|
|
27
|
-
onPanResponderGrant: () => {
|
|
28
|
-
position.setOffset(offset.current);
|
|
29
|
-
position.setValue({
|
|
30
|
-
x: 0,
|
|
31
|
-
y: 0
|
|
32
|
-
});
|
|
33
|
-
},
|
|
34
|
-
onPanResponderMove: _reactNative.Animated.event([null, {
|
|
35
|
-
dx: position.x,
|
|
36
|
-
dy: position.y
|
|
37
|
-
}], {
|
|
38
|
-
useNativeDriver: false
|
|
39
|
-
}),
|
|
40
|
-
onPanResponderRelease: (_event, gesture) => {
|
|
41
|
-
offset.current = {
|
|
42
|
-
x: offset.current.x + gesture.dx,
|
|
43
|
-
y: offset.current.y + gesture.dy
|
|
44
|
-
};
|
|
45
|
-
position.flattenOffset();
|
|
46
|
-
},
|
|
47
|
-
onPanResponderTerminate: () => {
|
|
48
|
-
position.flattenOffset();
|
|
49
|
-
}
|
|
50
|
-
}).panHandlers, [position]);
|
|
51
|
-
return {
|
|
52
|
-
panHandlers,
|
|
53
|
-
style: {
|
|
54
|
-
transform: position.getTranslateTransform()
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
exports.useDraggable = useDraggable;
|
|
59
|
-
//# sourceMappingURL=useDraggable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","useDraggable","position","useRef","Animated","ValueXY","x","y","current","offset","panHandlers","useMemo","PanResponder","create","onMoveShouldSetPanResponder","_event","gesture","Math","abs","dx","dy","onPanResponderGrant","setOffset","setValue","onPanResponderMove","event","useNativeDriver","onPanResponderRelease","flattenOffset","onPanResponderTerminate","style","transform","getTranslateTransform","exports"],"sourceRoot":"../../../../src","sources":["components/VideoCalls/useDraggable.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,YAAY,GAAGA,CAAA,KAAM;EAChC,MAAMC,QAAQ,GAAG,IAAAC,aAAM,EAAC,IAAIC,qBAAQ,CAACC,OAAO,CAAC;IAAEC,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE;EAAE,CAAC,CAAC,CAAC,CAACC,OAAO;EACrE,MAAMC,MAAM,GAAG,IAAAN,aAAM,EAAC;IAAEG,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE;EAAE,CAAC,CAAC;EAErC,MAAMG,WAAW,GAAG,IAAAC,cAAO,EACzB,MACEC,yBAAY,CAACC,MAAM,CAAC;IAClBC,2BAA2B,EAAEA,CAACC,MAAM,EAAEC,OAAO,KAC3CC,IAAI,CAACC,GAAG,CAACF,OAAO,CAACG,EAAE,CAAC,GAAG,CAAC,IAAIF,IAAI,CAACC,GAAG,CAACF,OAAO,CAACI,EAAE,CAAC,GAAG,CAAC;IACtDC,mBAAmB,EAAEA,CAAA,KAAM;MACzBnB,QAAQ,CAACoB,SAAS,CAACb,MAAM,CAACD,OAAO,CAAC;MAClCN,QAAQ,CAACqB,QAAQ,CAAC;QAAEjB,CAAC,EAAE,CAAC;QAAEC,CAAC,EAAE;MAAE,CAAC,CAAC;IACnC,CAAC;IACDiB,kBAAkB,EAAEpB,qBAAQ,CAACqB,KAAK,CAChC,CAAC,IAAI,EAAE;MAAEN,EAAE,EAAEjB,QAAQ,CAACI,CAAC;MAAEc,EAAE,EAAElB,QAAQ,CAACK;IAAE,CAAC,CAAC,EAC1C;MAAEmB,eAAe,EAAE;IAAM,CAC3B,CAAC;IACDC,qBAAqB,EAAEA,CAACZ,MAAM,EAAEC,OAAO,KAAK;MAC1CP,MAAM,CAACD,OAAO,GAAG;QACfF,CAAC,EAAEG,MAAM,CAACD,OAAO,CAACF,CAAC,GAAGU,OAAO,CAACG,EAAE;QAChCZ,CAAC,EAAEE,MAAM,CAACD,OAAO,CAACD,CAAC,GAAGS,OAAO,CAACI;MAChC,CAAC;MACDlB,QAAQ,CAAC0B,aAAa,CAAC,CAAC;IAC1B,CAAC;IACDC,uBAAuB,EAAEA,CAAA,KAAM;MAC7B3B,QAAQ,CAAC0B,aAAa,CAAC,CAAC;IAC1B;EACF,CAAC,CAAC,CAAClB,WAAW,EAChB,CAACR,QAAQ,CACX,CAAC;EAED,OAAO;IACLQ,WAAW;IACXoB,KAAK,EAAE;MAAEC,SAAS,EAAE7B,QAAQ,CAAC8B,qBAAqB,CAAC;IAAE;EACvD,CAAC;AACH,CAAC;AAACC,OAAA,CAAAhC,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { useMemo, useRef } from 'react';
|
|
4
|
-
import { Animated, PanResponder } from 'react-native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Drag a floating element around (web's useDraggable, for the self-view
|
|
8
|
-
* tile and the minimized call panel). The offset is kept between drags.
|
|
9
|
-
*
|
|
10
|
-
* The responder only claims the gesture once the finger actually moves a
|
|
11
|
-
* few points, so taps still reach the buttons inside the dragged element.
|
|
12
|
-
*/
|
|
13
|
-
export const useDraggable = () => {
|
|
14
|
-
const position = useRef(new Animated.ValueXY({
|
|
15
|
-
x: 0,
|
|
16
|
-
y: 0
|
|
17
|
-
})).current;
|
|
18
|
-
const offset = useRef({
|
|
19
|
-
x: 0,
|
|
20
|
-
y: 0
|
|
21
|
-
});
|
|
22
|
-
const panHandlers = useMemo(() => PanResponder.create({
|
|
23
|
-
onMoveShouldSetPanResponder: (_event, gesture) => Math.abs(gesture.dx) > 4 || Math.abs(gesture.dy) > 4,
|
|
24
|
-
onPanResponderGrant: () => {
|
|
25
|
-
position.setOffset(offset.current);
|
|
26
|
-
position.setValue({
|
|
27
|
-
x: 0,
|
|
28
|
-
y: 0
|
|
29
|
-
});
|
|
30
|
-
},
|
|
31
|
-
onPanResponderMove: Animated.event([null, {
|
|
32
|
-
dx: position.x,
|
|
33
|
-
dy: position.y
|
|
34
|
-
}], {
|
|
35
|
-
useNativeDriver: false
|
|
36
|
-
}),
|
|
37
|
-
onPanResponderRelease: (_event, gesture) => {
|
|
38
|
-
offset.current = {
|
|
39
|
-
x: offset.current.x + gesture.dx,
|
|
40
|
-
y: offset.current.y + gesture.dy
|
|
41
|
-
};
|
|
42
|
-
position.flattenOffset();
|
|
43
|
-
},
|
|
44
|
-
onPanResponderTerminate: () => {
|
|
45
|
-
position.flattenOffset();
|
|
46
|
-
}
|
|
47
|
-
}).panHandlers, [position]);
|
|
48
|
-
return {
|
|
49
|
-
panHandlers,
|
|
50
|
-
style: {
|
|
51
|
-
transform: position.getTranslateTransform()
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
//# sourceMappingURL=useDraggable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","useRef","Animated","PanResponder","useDraggable","position","ValueXY","x","y","current","offset","panHandlers","create","onMoveShouldSetPanResponder","_event","gesture","Math","abs","dx","dy","onPanResponderGrant","setOffset","setValue","onPanResponderMove","event","useNativeDriver","onPanResponderRelease","flattenOffset","onPanResponderTerminate","style","transform","getTranslateTransform"],"sourceRoot":"../../../../src","sources":["components/VideoCalls/useDraggable.ts"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,MAAM,QAAQ,OAAO;AACvC,SAASC,QAAQ,EAAEC,YAAY,QAAQ,cAAc;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,GAAGA,CAAA,KAAM;EAChC,MAAMC,QAAQ,GAAGJ,MAAM,CAAC,IAAIC,QAAQ,CAACI,OAAO,CAAC;IAAEC,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE;EAAE,CAAC,CAAC,CAAC,CAACC,OAAO;EACrE,MAAMC,MAAM,GAAGT,MAAM,CAAC;IAAEM,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE;EAAE,CAAC,CAAC;EAErC,MAAMG,WAAW,GAAGX,OAAO,CACzB,MACEG,YAAY,CAACS,MAAM,CAAC;IAClBC,2BAA2B,EAAEA,CAACC,MAAM,EAAEC,OAAO,KAC3CC,IAAI,CAACC,GAAG,CAACF,OAAO,CAACG,EAAE,CAAC,GAAG,CAAC,IAAIF,IAAI,CAACC,GAAG,CAACF,OAAO,CAACI,EAAE,CAAC,GAAG,CAAC;IACtDC,mBAAmB,EAAEA,CAAA,KAAM;MACzBf,QAAQ,CAACgB,SAAS,CAACX,MAAM,CAACD,OAAO,CAAC;MAClCJ,QAAQ,CAACiB,QAAQ,CAAC;QAAEf,CAAC,EAAE,CAAC;QAAEC,CAAC,EAAE;MAAE,CAAC,CAAC;IACnC,CAAC;IACDe,kBAAkB,EAAErB,QAAQ,CAACsB,KAAK,CAChC,CAAC,IAAI,EAAE;MAAEN,EAAE,EAAEb,QAAQ,CAACE,CAAC;MAAEY,EAAE,EAAEd,QAAQ,CAACG;IAAE,CAAC,CAAC,EAC1C;MAAEiB,eAAe,EAAE;IAAM,CAC3B,CAAC;IACDC,qBAAqB,EAAEA,CAACZ,MAAM,EAAEC,OAAO,KAAK;MAC1CL,MAAM,CAACD,OAAO,GAAG;QACfF,CAAC,EAAEG,MAAM,CAACD,OAAO,CAACF,CAAC,GAAGQ,OAAO,CAACG,EAAE;QAChCV,CAAC,EAAEE,MAAM,CAACD,OAAO,CAACD,CAAC,GAAGO,OAAO,CAACI;MAChC,CAAC;MACDd,QAAQ,CAACsB,aAAa,CAAC,CAAC;IAC1B,CAAC;IACDC,uBAAuB,EAAEA,CAAA,KAAM;MAC7BvB,QAAQ,CAACsB,aAAa,CAAC,CAAC;IAC1B;EACF,CAAC,CAAC,CAAChB,WAAW,EAChB,CAACN,QAAQ,CACX,CAAC;EAED,OAAO;IACLM,WAAW;IACXkB,KAAK,EAAE;MAAEC,SAAS,EAAEzB,QAAQ,CAAC0B,qBAAqB,CAAC;IAAE;EACvD,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Animated } from 'react-native';
|
|
2
|
-
/**
|
|
3
|
-
* Drag a floating element around (web's useDraggable, for the self-view
|
|
4
|
-
* tile and the minimized call panel). The offset is kept between drags.
|
|
5
|
-
*
|
|
6
|
-
* The responder only claims the gesture once the finger actually moves a
|
|
7
|
-
* few points, so taps still reach the buttons inside the dragged element.
|
|
8
|
-
*/
|
|
9
|
-
export declare const useDraggable: () => {
|
|
10
|
-
panHandlers: import("react-native").GestureResponderHandlers;
|
|
11
|
-
style: {
|
|
12
|
-
transform: [{
|
|
13
|
-
translateX: Animated.AnimatedValue;
|
|
14
|
-
}, {
|
|
15
|
-
translateY: Animated.AnimatedValue;
|
|
16
|
-
}];
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=useDraggable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDraggable.d.ts","sourceRoot":"","sources":["../../../../src/components/VideoCalls/useDraggable.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAgB,MAAM,cAAc,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;;;;;;;;;CAmCxB,CAAC"}
|