@ethora/chat-component-rn 26.7.4 → 26.7.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/CHANGELOG.md +0 -54
- package/README.md +8 -31
- package/lib/commonjs/assets/icons.js +2 -7
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/Header/HeaderRoomList.js +6 -20
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +14 -36
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageList.js +23 -7
- package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js +13 -14
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomList.js +32 -62
- package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +98 -309
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +110 -320
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +213 -552
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +2 -6
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/commonjs/components/Modals/Modal/Modal.js +0 -8
- package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js +1 -2
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +104 -202
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js +0 -8
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +2 -4
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js +21 -7
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +244 -507
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +46 -74
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/commonjs/components/Modals/styledModalComponents.js +2 -9
- package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +7 -17
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/commonjs/components/styled/SendInput.js +11 -80
- package/lib/commonjs/components/styled/SendInput.js.map +1 -1
- package/lib/commonjs/components/styled/StyledComponents.js +3 -9
- package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +4 -11
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/commonjs/context/xmppProvider.js +35 -6
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/helpers/updateMessagesTillLast.js +40 -12
- package/lib/commonjs/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/commonjs/hooks/useChatRoomFocus.js +9 -3
- package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/commonjs/hooks/useLogout.js +5 -0
- package/lib/commonjs/hooks/useLogout.js.map +1 -1
- package/lib/commonjs/hooks/useSendMessage.js +50 -23
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +1 -121
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js +0 -6
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/networking/api-requests/user.api.js +0 -59
- package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
- package/lib/commonjs/networking/outboundQueue.js +18 -0
- package/lib/commonjs/networking/outboundQueue.js.map +1 -1
- package/lib/commonjs/networking/stanzaHandlers.js +10 -1
- package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
- package/lib/commonjs/networking/xmppClient.js +107 -7
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js +1 -3
- package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +22 -3
- package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
- package/lib/module/assets/icons.js +1 -6
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/Header/HeaderRoomList.js +6 -20
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +14 -36
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/MessageList.js +24 -8
- package/lib/module/components/MainComponents/MessageList.js.map +1 -1
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js +13 -14
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/module/components/MainComponents/RoomList.js +32 -62
- package/lib/module/components/MainComponents/RoomList.js.map +1 -1
- package/lib/module/components/Menu/HeaderRoomListMenu.js +101 -311
- package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js +113 -311
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +217 -555
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +2 -6
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/module/components/Modals/Modal/Modal.js +1 -9
- package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/ModalContent.js +1 -2
- package/lib/module/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js +106 -205
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js +0 -8
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +2 -4
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js +23 -9
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +248 -509
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +48 -76
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/module/components/Modals/styledModalComponents.js +2 -9
- package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/module/components/RoomComponents/ChatRoomItem.js +7 -17
- package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/module/components/styled/SendInput.js +12 -81
- package/lib/module/components/styled/SendInput.js.map +1 -1
- package/lib/module/components/styled/StyledComponents.js +3 -9
- package/lib/module/components/styled/StyledComponents.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +4 -11
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/module/context/xmppProvider.js +35 -6
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/helpers/updateMessagesTillLast.js +41 -13
- package/lib/module/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/module/hooks/useChatRoomFocus.js +9 -3
- package/lib/module/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/module/hooks/useLogout.js +5 -0
- package/lib/module/hooks/useLogout.js.map +1 -1
- package/lib/module/hooks/useSendMessage.js +51 -24
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/i18n/strings.js +1 -121
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/main.js +1 -1
- package/lib/module/main.js.map +1 -1
- package/lib/module/networking/api-requests/user.api.js +0 -56
- package/lib/module/networking/api-requests/user.api.js.map +1 -1
- package/lib/module/networking/outboundQueue.js +17 -0
- package/lib/module/networking/outboundQueue.js.map +1 -1
- package/lib/module/networking/stanzaHandlers.js +10 -1
- package/lib/module/networking/stanzaHandlers.js.map +1 -1
- package/lib/module/networking/xmppClient.js +107 -7
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/chatSettingsSlice.js +1 -3
- package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +20 -2
- package/lib/module/roomStore/roomsSlice.js.map +1 -1
- package/lib/typescript/assets/icons.d.ts +0 -16
- package/lib/typescript/assets/icons.d.ts.map +1 -1
- package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ProfileImagePlaceholder.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts +0 -3
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts +0 -9
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +0 -10
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/Modal/Modal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts +2 -4
- package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts +1 -1
- package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/UpdNewChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts +1 -6
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/EditUserModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts +0 -16
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts +0 -1
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
- package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledComponents.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
- package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
- package/lib/typescript/helpers/updateMessagesTillLast.d.ts.map +1 -1
- package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -1
- package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
- package/lib/typescript/hooks/useSendMessage.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/networking/api-requests/user.api.d.ts +0 -27
- package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
- package/lib/typescript/networking/outboundQueue.d.ts +16 -0
- package/lib/typescript/networking/outboundQueue.d.ts.map +1 -1
- package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
- package/lib/typescript/networking/xmppClient.d.ts +33 -1
- package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts +18 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
- package/lib/typescript/types/models/room.model.d.ts +15 -0
- package/lib/typescript/types/models/room.model.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +20 -20
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/package.json +1 -6
- package/src/assets/icons.tsx +9 -48
- package/src/components/Header/HeaderRoomList.tsx +5 -20
- package/src/components/MainComponents/ChatRoom.tsx +20 -38
- package/src/components/MainComponents/MessageList.tsx +24 -8
- package/src/components/MainComponents/ProfileImagePlaceholder.tsx +14 -21
- package/src/components/MainComponents/RoomList.tsx +34 -65
- package/src/components/Menu/HeaderRoomListMenu.tsx +71 -310
- package/src/components/Modals/AttachSheet/AttachSheet.tsx +97 -331
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +279 -598
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +2 -4
- package/src/components/Modals/Modal/Modal.tsx +0 -7
- package/src/components/Modals/NewChatModal/ModalContent.tsx +3 -6
- package/src/components/Modals/NewChatModal/NewChatModal.tsx +117 -219
- package/src/components/Modals/NewChatModal/UpdNewChatModal.tsx +1 -12
- package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +4 -14
- package/src/components/Modals/UserProfileModal/EditUserModal.tsx +25 -9
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +307 -617
- package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +58 -75
- package/src/components/Modals/styledModalComponents.tsx +2 -9
- package/src/components/RoomComponents/ChatRoomItem.tsx +7 -14
- package/src/components/styled/SendInput.tsx +12 -83
- package/src/components/styled/StyledComponents.ts +3 -9
- package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +4 -11
- package/src/context/xmppProvider.tsx +41 -8
- package/src/helpers/updateMessagesTillLast.tsx +42 -17
- package/src/hooks/useChatRoomFocus.ts +11 -3
- package/src/hooks/useLogout.tsx +7 -0
- package/src/hooks/useSendMessage.tsx +60 -24
- package/src/i18n/strings.ts +1 -121
- package/src/main.ts +1 -1
- package/src/networking/api-requests/user.api.ts +0 -71
- package/src/networking/outboundQueue.ts +29 -0
- package/src/networking/stanzaHandlers.ts +9 -1
- package/src/networking/xmppClient.ts +118 -7
- package/src/roomStore/chatSettingsSlice.ts +1 -3
- package/src/roomStore/roomsSlice.ts +20 -2
- package/src/types/models/room.model.ts +15 -0
- package/src/types/types.ts +20 -22
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +0 -226
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +0 -1
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js +0 -556
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js.map +0 -1
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js +0 -210
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +0 -1
- package/lib/commonjs/helpers/getChatBackground.js +0 -23
- package/lib/commonjs/helpers/getChatBackground.js.map +0 -1
- package/lib/commonjs/helpers/mediaLibraryRuntime.js +0 -31
- package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +0 -1
- package/lib/commonjs/helpers/pickImageAsset.js +0 -68
- package/lib/commonjs/helpers/pickImageAsset.js.map +0 -1
- package/lib/commonjs/helpers/sheetGestures.js +0 -32
- package/lib/commonjs/helpers/sheetGestures.js.map +0 -1
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +0 -223
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +0 -1
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js +0 -548
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js.map +0 -1
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js +0 -205
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +0 -1
- package/lib/module/helpers/getChatBackground.js +0 -18
- package/lib/module/helpers/getChatBackground.js.map +0 -1
- package/lib/module/helpers/mediaLibraryRuntime.js +0 -25
- package/lib/module/helpers/mediaLibraryRuntime.js.map +0 -1
- package/lib/module/helpers/pickImageAsset.js +0 -63
- package/lib/module/helpers/pickImageAsset.js.map +0 -1
- package/lib/module/helpers/sheetGestures.js +0 -26
- package/lib/module/helpers/sheetGestures.js.map +0 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts +0 -9
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +0 -1
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts +0 -75
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts.map +0 -1
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts +0 -25
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts.map +0 -1
- package/lib/typescript/helpers/getChatBackground.d.ts +0 -15
- package/lib/typescript/helpers/getChatBackground.d.ts.map +0 -1
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +0 -3
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +0 -1
- package/lib/typescript/helpers/pickImageAsset.d.ts +0 -27
- package/lib/typescript/helpers/pickImageAsset.d.ts.map +0 -1
- package/lib/typescript/helpers/sheetGestures.d.ts +0 -20
- package/lib/typescript/helpers/sheetGestures.d.ts.map +0 -1
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +0 -244
- package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +0 -615
- package/src/components/Modals/ProfileHeader/ProfileMenu.tsx +0 -217
- package/src/helpers/getChatBackground.ts +0 -18
- package/src/helpers/mediaLibraryRuntime.ts +0 -25
- package/src/helpers/pickImageAsset.ts +0 -68
- package/src/helpers/sheetGestures.ts +0 -25
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/** @format */
|
|
4
|
-
|
|
5
|
-
import React, { useRef, useState } from 'react';
|
|
6
|
-
import { Animated, Dimensions, Easing, Modal, Pressable, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
7
|
-
import { MoreIcon } from '../../../assets/icons';
|
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
|
-
/** Fallbacks used for the very first frame, before the card is measured. */
|
|
10
|
-
const ESTIMATED_WIDTH = 220;
|
|
11
|
-
const ESTIMATED_HEIGHT = 160;
|
|
12
|
-
const GAP = 8;
|
|
13
|
-
/** Roughly a notch inset + the header band, used until measured. */
|
|
14
|
-
const DEFAULT_TOP = 104;
|
|
15
|
-
const EDGE = 12;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* The "…" overflow menu shared by the chat and user profile screens.
|
|
19
|
-
*
|
|
20
|
-
* The shared `DropdownMenu` pins its card at a hard-coded `top: 95`, which
|
|
21
|
-
* on this screen landed it over the host's own tab bar, unanchored to the
|
|
22
|
-
* button. This one measures the button and grows the card out of it: the
|
|
23
|
-
* card scales up from its top-right corner (translate → scale → translate
|
|
24
|
-
* back, which is how you fake a transform-origin in React Native) so the
|
|
25
|
-
* menu visibly unfolds from the three dots.
|
|
26
|
-
*/
|
|
27
|
-
const ProfileMenu = ({
|
|
28
|
-
items,
|
|
29
|
-
testIDPrefix = 'chat-profile'
|
|
30
|
-
}) => {
|
|
31
|
-
const buttonRef = useRef(null);
|
|
32
|
-
const [open, setOpen] = useState(false);
|
|
33
|
-
const [anchor, setAnchor] = useState({
|
|
34
|
-
top: DEFAULT_TOP,
|
|
35
|
-
right: EDGE
|
|
36
|
-
});
|
|
37
|
-
const [size, setSize] = useState({
|
|
38
|
-
width: ESTIMATED_WIDTH,
|
|
39
|
-
height: ESTIMATED_HEIGHT
|
|
40
|
-
});
|
|
41
|
-
const progress = useRef(new Animated.Value(0)).current;
|
|
42
|
-
const animate = (to, done) => Animated.timing(progress, {
|
|
43
|
-
toValue: to,
|
|
44
|
-
duration: to ? 180 : 140,
|
|
45
|
-
easing: to ? Easing.out(Easing.back(1.3)) : Easing.in(Easing.quad),
|
|
46
|
-
useNativeDriver: true
|
|
47
|
-
}).start(({
|
|
48
|
-
finished
|
|
49
|
-
}) => finished && done?.());
|
|
50
|
-
|
|
51
|
-
// Anchor to the button's window frame — that is the same coordinate
|
|
52
|
-
// space the <Modal> lays out in, so no insets to subtract. Measured on
|
|
53
|
-
// layout (and again on open) rather than *before* opening: on some hosts
|
|
54
|
-
// the measure callback never fires, and gating the open on it would mean
|
|
55
|
-
// a menu that simply doesn't appear.
|
|
56
|
-
const measure = () => buttonRef.current?.measureInWindow?.((x, y, width, height) => {
|
|
57
|
-
if (typeof y !== 'number' || typeof x !== 'number') {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const screenWidth = Dimensions.get('window').width;
|
|
61
|
-
setAnchor({
|
|
62
|
-
top: y + height + GAP,
|
|
63
|
-
right: Math.max(screenWidth - (x + width), EDGE)
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
const openMenu = () => {
|
|
67
|
-
measure();
|
|
68
|
-
progress.setValue(0);
|
|
69
|
-
setOpen(true);
|
|
70
|
-
animate(1);
|
|
71
|
-
};
|
|
72
|
-
const closeMenu = then => animate(0, () => {
|
|
73
|
-
setOpen(false);
|
|
74
|
-
then?.();
|
|
75
|
-
});
|
|
76
|
-
const scale = progress.interpolate({
|
|
77
|
-
inputRange: [0, 1],
|
|
78
|
-
outputRange: [0.2, 1]
|
|
79
|
-
});
|
|
80
|
-
if (items.length === 0) {
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
84
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
85
|
-
ref: buttonRef,
|
|
86
|
-
collapsable: false,
|
|
87
|
-
onLayout: measure,
|
|
88
|
-
children: /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
89
|
-
testID: `${testIDPrefix}-menu`,
|
|
90
|
-
activeOpacity: 0.7,
|
|
91
|
-
onPress: openMenu,
|
|
92
|
-
style: styles.button,
|
|
93
|
-
children: /*#__PURE__*/_jsx(MoreIcon, {
|
|
94
|
-
color: "#FFFFFF"
|
|
95
|
-
})
|
|
96
|
-
})
|
|
97
|
-
}), /*#__PURE__*/_jsxs(Modal, {
|
|
98
|
-
transparent: true,
|
|
99
|
-
visible: open,
|
|
100
|
-
animationType: "none",
|
|
101
|
-
onRequestClose: () => closeMenu(),
|
|
102
|
-
children: [/*#__PURE__*/_jsx(Pressable, {
|
|
103
|
-
testID: `${testIDPrefix}-menu-backdrop`,
|
|
104
|
-
style: StyleSheet.absoluteFill,
|
|
105
|
-
onPress: () => closeMenu()
|
|
106
|
-
}), /*#__PURE__*/_jsx(Animated.View, {
|
|
107
|
-
testID: `${testIDPrefix}-menu-card`,
|
|
108
|
-
onLayout: e => {
|
|
109
|
-
const {
|
|
110
|
-
width,
|
|
111
|
-
height
|
|
112
|
-
} = e.nativeEvent.layout;
|
|
113
|
-
if (width && height) {
|
|
114
|
-
setSize({
|
|
115
|
-
width,
|
|
116
|
-
height
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
style: [styles.card, {
|
|
121
|
-
top: anchor.top,
|
|
122
|
-
right: anchor.right,
|
|
123
|
-
opacity: progress,
|
|
124
|
-
transform: [
|
|
125
|
-
// Move the origin to the card's top-right corner, scale
|
|
126
|
-
// there, then move back — RN has no transform-origin.
|
|
127
|
-
{
|
|
128
|
-
translateX: size.width / 2
|
|
129
|
-
}, {
|
|
130
|
-
translateY: -size.height / 2
|
|
131
|
-
}, {
|
|
132
|
-
scale
|
|
133
|
-
}, {
|
|
134
|
-
translateX: -size.width / 2
|
|
135
|
-
}, {
|
|
136
|
-
translateY: size.height / 2
|
|
137
|
-
}]
|
|
138
|
-
}],
|
|
139
|
-
children: items.map((item, index) => /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
140
|
-
testID: `${testIDPrefix}-menu-${item.key}`,
|
|
141
|
-
activeOpacity: 0.6,
|
|
142
|
-
style: [styles.row, index > 0 && styles.rowDivider],
|
|
143
|
-
onPress: () => closeMenu(item.onPress),
|
|
144
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
145
|
-
style: [styles.label, item.destructive && styles.destructive],
|
|
146
|
-
children: item.label
|
|
147
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
148
|
-
style: styles.icon,
|
|
149
|
-
children: item.icon
|
|
150
|
-
})]
|
|
151
|
-
}, item.key))
|
|
152
|
-
})]
|
|
153
|
-
})]
|
|
154
|
-
});
|
|
155
|
-
};
|
|
156
|
-
const styles = StyleSheet.create({
|
|
157
|
-
button: {
|
|
158
|
-
width: 40,
|
|
159
|
-
height: 40,
|
|
160
|
-
borderRadius: 20,
|
|
161
|
-
backgroundColor: 'rgba(0,0,0,0.28)',
|
|
162
|
-
alignItems: 'center',
|
|
163
|
-
justifyContent: 'center'
|
|
164
|
-
},
|
|
165
|
-
card: {
|
|
166
|
-
position: 'absolute',
|
|
167
|
-
minWidth: 200,
|
|
168
|
-
backgroundColor: '#FFFFFF',
|
|
169
|
-
borderRadius: 14,
|
|
170
|
-
paddingVertical: 4,
|
|
171
|
-
shadowColor: '#121219',
|
|
172
|
-
shadowOffset: {
|
|
173
|
-
width: 0,
|
|
174
|
-
height: 6
|
|
175
|
-
},
|
|
176
|
-
shadowOpacity: 0.18,
|
|
177
|
-
shadowRadius: 16,
|
|
178
|
-
elevation: 12
|
|
179
|
-
},
|
|
180
|
-
row: {
|
|
181
|
-
flexDirection: 'row',
|
|
182
|
-
alignItems: 'center',
|
|
183
|
-
justifyContent: 'space-between',
|
|
184
|
-
gap: 24,
|
|
185
|
-
paddingHorizontal: 16,
|
|
186
|
-
paddingVertical: 13
|
|
187
|
-
},
|
|
188
|
-
rowDivider: {
|
|
189
|
-
borderTopWidth: StyleSheet.hairlineWidth,
|
|
190
|
-
borderTopColor: '#EFEFF2'
|
|
191
|
-
},
|
|
192
|
-
label: {
|
|
193
|
-
fontSize: 16,
|
|
194
|
-
color: '#141414'
|
|
195
|
-
},
|
|
196
|
-
destructive: {
|
|
197
|
-
color: '#E53935'
|
|
198
|
-
},
|
|
199
|
-
icon: {
|
|
200
|
-
width: 22,
|
|
201
|
-
alignItems: 'center'
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
export default ProfileMenu;
|
|
205
|
-
//# sourceMappingURL=ProfileMenu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useRef","useState","Animated","Dimensions","Easing","Modal","Pressable","StyleSheet","Text","TouchableOpacity","View","MoreIcon","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ESTIMATED_WIDTH","ESTIMATED_HEIGHT","GAP","DEFAULT_TOP","EDGE","ProfileMenu","items","testIDPrefix","buttonRef","open","setOpen","anchor","setAnchor","top","right","size","setSize","width","height","progress","Value","current","animate","to","done","timing","toValue","duration","easing","out","back","in","quad","useNativeDriver","start","finished","measure","measureInWindow","x","y","screenWidth","get","Math","max","openMenu","setValue","closeMenu","then","scale","interpolate","inputRange","outputRange","length","children","ref","collapsable","onLayout","testID","activeOpacity","onPress","style","styles","button","color","transparent","visible","animationType","onRequestClose","absoluteFill","e","nativeEvent","layout","card","opacity","transform","translateX","translateY","map","item","index","key","row","rowDivider","label","destructive","icon","create","borderRadius","backgroundColor","alignItems","justifyContent","position","minWidth","paddingVertical","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","flexDirection","gap","paddingHorizontal","borderTopWidth","hairlineWidth","borderTopColor","fontSize"],"sourceRoot":"../../../../../src","sources":["components/Modals/ProfileHeader/ProfileMenu.tsx"],"mappings":";;AAAA;;AAEA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC/C,SACEC,QAAQ,EACRC,UAAU,EACVC,MAAM,EACNC,KAAK,EACLC,SAAS,EACTC,UAAU,EACVC,IAAI,EACJC,gBAAgB,EAChBC,IAAI,QACC,cAAc;AACrB,SAASC,QAAQ,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAUjD;AACA,MAAMC,eAAe,GAAG,GAAG;AAC3B,MAAMC,gBAAgB,GAAG,GAAG;AAC5B,MAAMC,GAAG,GAAG,CAAC;AACb;AACA,MAAMC,WAAW,GAAG,GAAG;AACvB,MAAMC,IAAI,GAAG,EAAE;;AAEf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,WAGJ,GAAGA,CAAC;EAAEC,KAAK;EAAEC,YAAY,GAAG;AAAe,CAAC,KAAK;EACjD,MAAMC,SAAS,GAAG1B,MAAM,CAAO,IAAI,CAAC;EACpC,MAAM,CAAC2B,IAAI,EAAEC,OAAO,CAAC,GAAG3B,QAAQ,CAAC,KAAK,CAAC;EACvC,MAAM,CAAC4B,MAAM,EAAEC,SAAS,CAAC,GAAG7B,QAAQ,CAAC;IAAE8B,GAAG,EAAEV,WAAW;IAAEW,K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EAAE,EAAE;IACPC,iBAAiB,EAAE,EAAE;IACrBR,eAAe,EAAE;EACnB,CAAC;EACDX,UAAU,EAAE;IACVoB,cAAc,EAAEjH,UAAU,CAACkH,aAAa;IACxCC,cAAc,EAAE;EAClB,CAAC;EACDrB,KAAK,EAAE;IACLsB,QAAQ,EAAE,EAAE;IACZ1C,KAAK,EAAE;EACT,CAAC;EACDqB,WAAW,EAAE;IACXrB,KAAK,EAAE;EACT,CAAC;EACDsB,IAAI,EAAE;IACJpE,KAAK,EAAE,EAAE;IACTwE,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAepF,WAAW","ignoreList":[]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/** @format */
|
|
4
|
-
|
|
5
|
-
/** Ground behind the conversation, and behind the rounded corners of the
|
|
6
|
-
* header and the composer that sit over it. */
|
|
7
|
-
export const DEFAULT_CHAT_BACKGROUND = '#F3F6FC';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* One place for the conversation's background colour.
|
|
11
|
-
*
|
|
12
|
-
* The message list has always painted it; the chat container behind it was
|
|
13
|
-
* plain white, which is what made the header's rounded bottom corners and
|
|
14
|
-
* the composer's rounded top corners invisible — the corners revealed the
|
|
15
|
-
* white parent, not the conversation.
|
|
16
|
-
*/
|
|
17
|
-
export const getChatBackgroundColor = config => config?.backgroundChat?.color || DEFAULT_CHAT_BACKGROUND;
|
|
18
|
-
//# sourceMappingURL=getChatBackground.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["DEFAULT_CHAT_BACKGROUND","getChatBackgroundColor","config","backgroundChat","color"],"sourceRoot":"../../../src","sources":["helpers/getChatBackground.ts"],"mappings":";;AAAA;;AAIA;AACA;AACA,OAAO,MAAMA,uBAAuB,GAAG,SAAS;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAIC,MAAgB,IACrDA,MAAM,EAAEC,cAAc,EAAEC,KAAK,IAAIJ,uBAAuB","ignoreList":[]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
let cached;
|
|
4
|
-
export const getMediaLibrary = () => {
|
|
5
|
-
if (cached !== undefined) {
|
|
6
|
-
return cached;
|
|
7
|
-
}
|
|
8
|
-
try {
|
|
9
|
-
const legacy = require('expo-media-library/legacy');
|
|
10
|
-
if (legacy?.getAssetsAsync) {
|
|
11
|
-
cached = legacy;
|
|
12
|
-
return cached;
|
|
13
|
-
}
|
|
14
|
-
} catch {}
|
|
15
|
-
try {
|
|
16
|
-
cached = require('expo-media-library') ?? null;
|
|
17
|
-
} catch {
|
|
18
|
-
cached = null;
|
|
19
|
-
}
|
|
20
|
-
return cached;
|
|
21
|
-
};
|
|
22
|
-
export const __resetMediaLibraryCache = () => {
|
|
23
|
-
cached = undefined;
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=mediaLibraryRuntime.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["cached","getMediaLibrary","undefined","legacy","require","getAssetsAsync","__resetMediaLibraryCache"],"sourceRoot":"../../../src","sources":["helpers/mediaLibraryRuntime.ts"],"mappings":";;AAAA,IAAIA,MAAuB;AAE3B,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAkB;EAC/C,IAAID,MAAM,KAAKE,SAAS,EAAE;IAAC,OAAOF,MAAM;EAAC;EACzC,IAAI;IACF,MAAMG,MAAM,GAAGC,OAAO,CAAC,2BAA2B,CAAC;IAEnD,IAAID,MAAM,EAAEE,cAAc,EAAE;MAC1BL,MAAM,GAAGG,MAAM;MACf,OAAOH,MAAM;IACf;EACF,CAAC,CAAC,MAAM,CACR;EAEA,IAAI;IACFA,MAAM,GAAGI,OAAO,CAAC,oBAAoB,CAAC,IAAI,IAAI;EAChD,CAAC,CAAC,MAAM;IACNJ,MAAM,GAAG,IAAI;EACf;EACA,OAAOA,MAAM;AACf,CAAC;AAED,OAAO,MAAMM,wBAAwB,GAAGA,CAAA,KAAM;EAC5CN,MAAM,GAAGE,SAAS;AACpB,CAAC","ignoreList":[]}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { Alert, Linking } from 'react-native';
|
|
4
|
-
import * as ImagePicker from 'expo-image-picker';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A picked image in the shape React Native's FormData understands.
|
|
8
|
-
*
|
|
9
|
-
* NOT a web `File`: RN streams a multipart part straight from a `file://`
|
|
10
|
-
* uri and has no usable Blob/File/atob path. Screens ported from the web
|
|
11
|
-
* client used to carry base64 -> Blob -> File helpers that could never
|
|
12
|
-
* have run here.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Ask for library permission, open the picker, and normalise the result.
|
|
17
|
-
*
|
|
18
|
-
* Returns `null` for every non-error outcome — permission refused, user
|
|
19
|
-
* cancelled — so call sites can simply keep their current value.
|
|
20
|
-
*
|
|
21
|
-
* Exists because the avatar pickers are wired to `onPress`, which hands
|
|
22
|
-
* the callback a SyntheticEvent. Storing that event as "the image" (what
|
|
23
|
-
* two screens used to do) rendered a pooled event as an <Image source>
|
|
24
|
-
* and then crashed with "Property is not configurable" when React tried
|
|
25
|
-
* to release it — on top of never letting the user pick anything.
|
|
26
|
-
*/
|
|
27
|
-
export const pickImageAsset = async () => {
|
|
28
|
-
try {
|
|
29
|
-
// expo-image-picker owns the permission prompt internally and
|
|
30
|
-
// returns a `granted` flag.
|
|
31
|
-
const perm = await ImagePicker.requestMediaLibraryPermissionsAsync();
|
|
32
|
-
if (!perm.granted) {
|
|
33
|
-
Alert.alert('Permission required', 'Photo library permission is needed to select images.', [{
|
|
34
|
-
text: 'Cancel',
|
|
35
|
-
style: 'cancel'
|
|
36
|
-
}, {
|
|
37
|
-
text: 'Open Settings',
|
|
38
|
-
onPress: () => Linking.openSettings()
|
|
39
|
-
}]);
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
const result = await ImagePicker.launchImageLibraryAsync({
|
|
43
|
-
mediaTypes: ['images'],
|
|
44
|
-
allowsEditing: true,
|
|
45
|
-
aspect: [1, 1],
|
|
46
|
-
quality: 0.8
|
|
47
|
-
});
|
|
48
|
-
if (result.canceled || !result.assets?.[0]) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
const asset = result.assets[0];
|
|
52
|
-
const originalName = asset.fileName || asset.uri.split('/').pop();
|
|
53
|
-
return {
|
|
54
|
-
uri: asset.uri,
|
|
55
|
-
type: asset.mimeType || 'image/jpeg',
|
|
56
|
-
name: originalName || `image_${Date.now()}.jpg`
|
|
57
|
-
};
|
|
58
|
-
} catch (error) {
|
|
59
|
-
console.error('Failed to pick an image:', error);
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
//# sourceMappingURL=pickImageAsset.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Alert","Linking","ImagePicker","pickImageAsset","perm","requestMediaLibraryPermissionsAsync","granted","alert","text","style","onPress","openSettings","result","launchImageLibraryAsync","mediaTypes","allowsEditing","aspect","quality","canceled","assets","asset","originalName","fileName","uri","split","pop","type","mimeType","name","Date","now","error","console"],"sourceRoot":"../../../src","sources":["helpers/pickImageAsset.ts"],"mappings":";;AAAA,SAASA,KAAK,EAAEC,OAAO,QAAQ,cAAc;AAC7C,OAAO,KAAKC,WAAW,MAAM,mBAAmB;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAG,MAAAA,CAAA,KAAyC;EACrE,IAAI;IACF;IACA;IACA,MAAMC,IAAI,GAAG,MAAMF,WAAW,CAACG,mCAAmC,CAAC,CAAC;IACpE,IAAI,CAACD,I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for the drag-to-dismiss gesture on bottom sheets (the
|
|
7
|
-
* attach sheet, the profile headers, the room-list menu). Kept in one
|
|
8
|
-
* place so a pull feels identical wherever the user does it — and so the
|
|
9
|
-
* numbers are unit-testable without a touch event.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/** Drag past this many points and letting go dismisses the sheet. */
|
|
13
|
-
export const DISMISS_DISTANCE = 90;
|
|
14
|
-
/** …or flick faster than this, however short the drag. */
|
|
15
|
-
export const DISMISS_VELOCITY = 0.8;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Claim a drag only once it is clearly a downward pull, so a tap on a row
|
|
19
|
-
* still registers and a horizontal swipe stays with whatever scrolls
|
|
20
|
-
* sideways inside the sheet.
|
|
21
|
-
*/
|
|
22
|
-
export const shouldClaimVerticalDrag = (dy, dx) => dy > 6 && Math.abs(dy) > Math.abs(dx) * 1.5;
|
|
23
|
-
|
|
24
|
-
/** Far enough / fast enough to let go of the sheet. */
|
|
25
|
-
export const shouldDismissOnDrag = (dy, vy) => dy > DISMISS_DISTANCE || vy > DISMISS_VELOCITY;
|
|
26
|
-
//# sourceMappingURL=sheetGestures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["DISMISS_DISTANCE","DISMISS_VELOCITY","shouldClaimVerticalDrag","dy","dx","Math","abs","shouldDismissOnDrag","vy"],"sourceRoot":"../../../src","sources":["helpers/sheetGestures.ts"],"mappings":";;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,MAAMA,gBAAgB,GAAG,EAAE;AAClC;AACA,OAAO,MAAMC,gBAAgB,GAAG,GAAG;;AAEnC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAGA,CAACC,EAAU,EAAEC,EAAU,KAC5DD,EAAE,GAAG,CAAC,IAAIE,IAAI,CAACC,GAAG,CAACH,EAAE,CAAC,GAAGE,IAAI,CAACC,GAAG,CAACF,EAAE,CAAC,GAAG,GAAG;;AAE7C;AACA,OAAO,MAAMG,mBAAmB,GAAGA,CAACJ,EAAU,EAAEK,EAAU,KACxDL,EAAE,GAAGH,gBAAgB,IAAIQ,EAAE,GAAGP,gBAAgB","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** @format */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
interface ReportChatModalProps {
|
|
4
|
-
visible: boolean;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
}
|
|
7
|
-
declare const ReportChatModal: React.FC<ReportChatModalProps>;
|
|
8
|
-
export default ReportChatModal;
|
|
9
|
-
//# sourceMappingURL=ReportChatModal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReportChatModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/Modals/ChatProfileModal/ReportChatModal.tsx"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,KAAmB,MAAM,OAAO,CAAC;AAiCxC,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA+HnD,CAAC;AA4EF,eAAe,eAAe,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/** @format */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Animated, StyleProp, TextStyle } from 'react-native';
|
|
4
|
-
/** Height of the expanded photo hero. */
|
|
5
|
-
export declare const HERO_HEIGHT = 320;
|
|
6
|
-
/** Back / "…" row, directly below the status-bar inset. */
|
|
7
|
-
export declare const TOP_BAR_BUTTONS = 60;
|
|
8
|
-
/**
|
|
9
|
-
* Avatar + name row underneath it, revealed as the header collapses.
|
|
10
|
-
* Taller than the 48pt avatar it holds, so the row breathes: the extra
|
|
11
|
-
* height splits evenly above and below (the row centres its content),
|
|
12
|
-
* putting real space between the avatar and both the buttons above and
|
|
13
|
-
* the content below.
|
|
14
|
-
*/
|
|
15
|
-
export declare const TOP_BAR_NAME = 92;
|
|
16
|
-
/** Content band of the collapsed bar, below the status-bar inset. */
|
|
17
|
-
export declare const TOP_BAR_BAND: number;
|
|
18
|
-
/** True when the frosted-glass layer is the real thing, not the dim. */
|
|
19
|
-
export declare const hasNativeBlur: () => boolean;
|
|
20
|
-
export interface HeroAction {
|
|
21
|
-
key: string;
|
|
22
|
-
label: string;
|
|
23
|
-
/** Rendered inside a circle tinted for the current background. */
|
|
24
|
-
icon: (color: string) => React.ReactNode;
|
|
25
|
-
onPress: () => void;
|
|
26
|
-
}
|
|
27
|
-
interface CommonProps {
|
|
28
|
-
title: string;
|
|
29
|
-
subtitle?: string;
|
|
30
|
-
imageUri?: string | null;
|
|
31
|
-
/** Background when the chat has no picture — one flat colour, no scrims. */
|
|
32
|
-
fallbackColor: string;
|
|
33
|
-
/** Two uppercase letters shown on that background. */
|
|
34
|
-
initials: string;
|
|
35
|
-
scrollY: Animated.Value;
|
|
36
|
-
/** Prefixes every testID, so each screen's tests address their own. */
|
|
37
|
-
testIDPrefix?: string;
|
|
38
|
-
}
|
|
39
|
-
/** Everything the screen needs to line its scroll content up with the bar. */
|
|
40
|
-
export declare const useHeaderMetrics: () => {
|
|
41
|
-
insets: import("react-native-safe-area-context").EdgeInsets;
|
|
42
|
-
barHeight: number;
|
|
43
|
-
/** Scroll distance between the expanded hero and the collapsed bar. */
|
|
44
|
-
collapseDistance: number;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* The chat picture, blown up to a full-bleed hero with the name, member
|
|
48
|
-
* count and the round action buttons on top of it.
|
|
49
|
-
*
|
|
50
|
-
* It lives INSIDE the ScrollView (rather than behind it) so the action
|
|
51
|
-
* buttons stay tappable — an absolutely-positioned hero would sit under a
|
|
52
|
-
* full-screen scroll surface that swallows every touch. Parallax is done
|
|
53
|
-
* on the inner image instead: the wrapper keeps its layout height while
|
|
54
|
-
* the picture drifts at ~⅓ of the scroll speed, and over-scrolling
|
|
55
|
-
* upwards scales it up the way iOS profile headers do.
|
|
56
|
-
*/
|
|
57
|
-
export declare const ProfileHero: React.FC<CommonProps & {
|
|
58
|
-
actions: HeroAction[];
|
|
59
|
-
/** Rendered to the right of the name (the profile's Leave button). */
|
|
60
|
-
titleAccessory?: React.ReactNode;
|
|
61
|
-
titleStyle?: StyleProp<TextStyle>;
|
|
62
|
-
subtitleStyle?: StyleProp<TextStyle>;
|
|
63
|
-
}>;
|
|
64
|
-
/**
|
|
65
|
-
* The bar pinned over the hero: back button and the "…" menu are always
|
|
66
|
-
* there, while the frosted picture, small avatar and name fade in as the
|
|
67
|
-
* hero scrolls away — the collapsed state from the design's third screen.
|
|
68
|
-
*/
|
|
69
|
-
export declare const ProfileTopBar: React.FC<CommonProps & {
|
|
70
|
-
onBack: () => void;
|
|
71
|
-
menu?: React.ReactNode;
|
|
72
|
-
titleStyle?: StyleProp<TextStyle>;
|
|
73
|
-
}>;
|
|
74
|
-
export {};
|
|
75
|
-
//# sourceMappingURL=ProfileHeader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileHeader.d.ts","sourceRoot":"","sources":["../../../../../src/components/Modals/ProfileHeader/ProfileHeader.tsx"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,QAAQ,EAER,SAAS,EAGT,SAAS,EAGV,MAAM,cAAc,CAAC;AAKtB,yCAAyC;AACzC,eAAO,MAAM,WAAW,MAAM,CAAC;AAC/B,2DAA2D;AAC3D,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,qEAAqE;AACrE,eAAO,MAAM,YAAY,QAAiC,CAAC;AAyC3D,wEAAwE;AACxE,eAAO,MAAM,aAAa,eAAmB,CAAC;AAyC9C,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,M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;
|
|
5
|
-
label: string;
|
|
6
|
-
icon: React.ReactNode;
|
|
7
|
-
destructive?: boolean;
|
|
8
|
-
onPress: () => void;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* The "…" overflow menu shared by the chat and user profile screens.
|
|
12
|
-
*
|
|
13
|
-
* The shared `DropdownMenu` pins its card at a hard-coded `top: 95`, which
|
|
14
|
-
* on this screen landed it over the host's own tab bar, unanchored to the
|
|
15
|
-
* button. This one measures the button and grows the card out of it: the
|
|
16
|
-
* card scales up from its top-right corner (translate → scale → translate
|
|
17
|
-
* back, which is how you fake a transform-origin in React Native) so the
|
|
18
|
-
* menu visibly unfolds from the three dots.
|
|
19
|
-
*/
|
|
20
|
-
declare const ProfileMenu: React.FC<{
|
|
21
|
-
items: ProfileMenuItem[];
|
|
22
|
-
testIDPrefix?: string;
|
|
23
|
-
}>;
|
|
24
|
-
export default ProfileMenu;
|
|
25
|
-
//# sourceMappingURL=ProfileMenu.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/Modals/ProfileHeader/ProfileMenu.tsx"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,KAA2B,MAAM,OAAO,CAAC;AAchD,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAUD;;;;;;;;;GASG;AACH,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;IAC1B,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CA2HA,CAAC;AAgDF,eAAe,WAAW,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/** @format */
|
|
2
|
-
import type { IConfig } from '../types/types';
|
|
3
|
-
/** Ground behind the conversation, and behind the rounded corners of the
|
|
4
|
-
* header and the composer that sit over it. */
|
|
5
|
-
export declare const DEFAULT_CHAT_BACKGROUND = "#F3F6FC";
|
|
6
|
-
/**
|
|
7
|
-
* One place for the conversation's background colour.
|
|
8
|
-
*
|
|
9
|
-
* The message list has always painted it; the chat container behind it was
|
|
10
|
-
* plain white, which is what made the header's rounded bottom corners and
|
|
11
|
-
* the composer's rounded top corners invisible — the corners revealed the
|
|
12
|
-
* white parent, not the conversation.
|
|
13
|
-
*/
|
|
14
|
-
export declare const getChatBackgroundColor: (config?: IConfig) => string;
|
|
15
|
-
//# sourceMappingURL=getChatBackground.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getChatBackground.d.ts","sourceRoot":"","sources":["../../../src/helpers/getChatBackground.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C;+CAC+C;AAC/C,eAAO,MAAM,uBAAuB,YAAY,CAAC;AAEjD;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GAAI,SAAS,OAAO,KAAG,MACA,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mediaLibraryRuntime.d.ts","sourceRoot":"","sources":["../../../src/helpers/mediaLibraryRuntime.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,QAAO,GAAG,GAAG,IAkBxC,CAAC;AAEF,eAAO,MAAM,wBAAwB,YAEpC,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A picked image in the shape React Native's FormData understands.
|
|
3
|
-
*
|
|
4
|
-
* NOT a web `File`: RN streams a multipart part straight from a `file://`
|
|
5
|
-
* uri and has no usable Blob/File/atob path. Screens ported from the web
|
|
6
|
-
* client used to carry base64 -> Blob -> File helpers that could never
|
|
7
|
-
* have run here.
|
|
8
|
-
*/
|
|
9
|
-
export interface PickedImage {
|
|
10
|
-
uri: string;
|
|
11
|
-
type: string;
|
|
12
|
-
name: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Ask for library permission, open the picker, and normalise the result.
|
|
16
|
-
*
|
|
17
|
-
* Returns `null` for every non-error outcome — permission refused, user
|
|
18
|
-
* cancelled — so call sites can simply keep their current value.
|
|
19
|
-
*
|
|
20
|
-
* Exists because the avatar pickers are wired to `onPress`, which hands
|
|
21
|
-
* the callback a SyntheticEvent. Storing that event as "the image" (what
|
|
22
|
-
* two screens used to do) rendered a pooled event as an <Image source>
|
|
23
|
-
* and then crashed with "Property is not configurable" when React tried
|
|
24
|
-
* to release it — on top of never letting the user pick anything.
|
|
25
|
-
*/
|
|
26
|
-
export declare const pickImageAsset: () => Promise<PickedImage | null>;
|
|
27
|
-
//# sourceMappingURL=pickImageAsset.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pickImageAsset.d.ts","sourceRoot":"","sources":["../../../src/helpers/pickImageAsset.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,QAAa,OAAO,CAAC,WAAW,GAAG,IAAI,CAsCjE,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/** @format */
|
|
2
|
-
/**
|
|
3
|
-
* Shared thresholds for the drag-to-dismiss gesture on bottom sheets (the
|
|
4
|
-
* attach sheet, the profile headers, the room-list menu). Kept in one
|
|
5
|
-
* place so a pull feels identical wherever the user does it — and so the
|
|
6
|
-
* numbers are unit-testable without a touch event.
|
|
7
|
-
*/
|
|
8
|
-
/** Drag past this many points and letting go dismisses the sheet. */
|
|
9
|
-
export declare const DISMISS_DISTANCE = 90;
|
|
10
|
-
/** …or flick faster than this, however short the drag. */
|
|
11
|
-
export declare const DISMISS_VELOCITY = 0.8;
|
|
12
|
-
/**
|
|
13
|
-
* Claim a drag only once it is clearly a downward pull, so a tap on a row
|
|
14
|
-
* still registers and a horizontal swipe stays with whatever scrolls
|
|
15
|
-
* sideways inside the sheet.
|
|
16
|
-
*/
|
|
17
|
-
export declare const shouldClaimVerticalDrag: (dy: number, dx: number) => boolean;
|
|
18
|
-
/** Far enough / fast enough to let go of the sheet. */
|
|
19
|
-
export declare const shouldDismissOnDrag: (dy: number, vy: number) => boolean;
|
|
20
|
-
//# sourceMappingURL=sheetGestures.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sheetGestures.d.ts","sourceRoot":"","sources":["../../../src/helpers/sheetGestures.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd;;;;;GAKG;AAEH,qEAAqE;AACrE,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,0DAA0D;AAC1D,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAAI,IAAI,MAAM,EAAE,IAAI,MAAM,YACjB,CAAC;AAE9C,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,GAAI,IAAI,MAAM,EAAE,IAAI,MAAM,YACV,CAAC"}
|