@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,210 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _icons = require("../../../assets/icons");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
-
/** @format */
|
|
13
|
-
|
|
14
|
-
/** Fallbacks used for the very first frame, before the card is measured. */
|
|
15
|
-
const ESTIMATED_WIDTH = 220;
|
|
16
|
-
const ESTIMATED_HEIGHT = 160;
|
|
17
|
-
const GAP = 8;
|
|
18
|
-
/** Roughly a notch inset + the header band, used until measured. */
|
|
19
|
-
const DEFAULT_TOP = 104;
|
|
20
|
-
const EDGE = 12;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* The "…" overflow menu shared by the chat and user profile screens.
|
|
24
|
-
*
|
|
25
|
-
* The shared `DropdownMenu` pins its card at a hard-coded `top: 95`, which
|
|
26
|
-
* on this screen landed it over the host's own tab bar, unanchored to the
|
|
27
|
-
* button. This one measures the button and grows the card out of it: the
|
|
28
|
-
* card scales up from its top-right corner (translate → scale → translate
|
|
29
|
-
* back, which is how you fake a transform-origin in React Native) so the
|
|
30
|
-
* menu visibly unfolds from the three dots.
|
|
31
|
-
*/
|
|
32
|
-
const ProfileMenu = ({
|
|
33
|
-
items,
|
|
34
|
-
testIDPrefix = 'chat-profile'
|
|
35
|
-
}) => {
|
|
36
|
-
const buttonRef = (0, _react.useRef)(null);
|
|
37
|
-
const [open, setOpen] = (0, _react.useState)(false);
|
|
38
|
-
const [anchor, setAnchor] = (0, _react.useState)({
|
|
39
|
-
top: DEFAULT_TOP,
|
|
40
|
-
right: EDGE
|
|
41
|
-
});
|
|
42
|
-
const [size, setSize] = (0, _react.useState)({
|
|
43
|
-
width: ESTIMATED_WIDTH,
|
|
44
|
-
height: ESTIMATED_HEIGHT
|
|
45
|
-
});
|
|
46
|
-
const progress = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
47
|
-
const animate = (to, done) => _reactNative.Animated.timing(progress, {
|
|
48
|
-
toValue: to,
|
|
49
|
-
duration: to ? 180 : 140,
|
|
50
|
-
easing: to ? _reactNative.Easing.out(_reactNative.Easing.back(1.3)) : _reactNative.Easing.in(_reactNative.Easing.quad),
|
|
51
|
-
useNativeDriver: true
|
|
52
|
-
}).start(({
|
|
53
|
-
finished
|
|
54
|
-
}) => finished && done?.());
|
|
55
|
-
|
|
56
|
-
// Anchor to the button's window frame — that is the same coordinate
|
|
57
|
-
// space the <Modal> lays out in, so no insets to subtract. Measured on
|
|
58
|
-
// layout (and again on open) rather than *before* opening: on some hosts
|
|
59
|
-
// the measure callback never fires, and gating the open on it would mean
|
|
60
|
-
// a menu that simply doesn't appear.
|
|
61
|
-
const measure = () => buttonRef.current?.measureInWindow?.((x, y, width, height) => {
|
|
62
|
-
if (typeof y !== 'number' || typeof x !== 'number') {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
const screenWidth = _reactNative.Dimensions.get('window').width;
|
|
66
|
-
setAnchor({
|
|
67
|
-
top: y + height + GAP,
|
|
68
|
-
right: Math.max(screenWidth - (x + width), EDGE)
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
const openMenu = () => {
|
|
72
|
-
measure();
|
|
73
|
-
progress.setValue(0);
|
|
74
|
-
setOpen(true);
|
|
75
|
-
animate(1);
|
|
76
|
-
};
|
|
77
|
-
const closeMenu = then => animate(0, () => {
|
|
78
|
-
setOpen(false);
|
|
79
|
-
then?.();
|
|
80
|
-
});
|
|
81
|
-
const scale = progress.interpolate({
|
|
82
|
-
inputRange: [0, 1],
|
|
83
|
-
outputRange: [0.2, 1]
|
|
84
|
-
});
|
|
85
|
-
if (items.length === 0) {
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
89
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
90
|
-
ref: buttonRef,
|
|
91
|
-
collapsable: false,
|
|
92
|
-
onLayout: measure,
|
|
93
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
94
|
-
testID: `${testIDPrefix}-menu`,
|
|
95
|
-
activeOpacity: 0.7,
|
|
96
|
-
onPress: openMenu,
|
|
97
|
-
style: styles.button,
|
|
98
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.MoreIcon, {
|
|
99
|
-
color: "#FFFFFF"
|
|
100
|
-
})
|
|
101
|
-
})
|
|
102
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Modal, {
|
|
103
|
-
transparent: true,
|
|
104
|
-
visible: open,
|
|
105
|
-
animationType: "none",
|
|
106
|
-
onRequestClose: () => closeMenu(),
|
|
107
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
108
|
-
testID: `${testIDPrefix}-menu-backdrop`,
|
|
109
|
-
style: _reactNative.StyleSheet.absoluteFill,
|
|
110
|
-
onPress: () => closeMenu()
|
|
111
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
112
|
-
testID: `${testIDPrefix}-menu-card`,
|
|
113
|
-
onLayout: e => {
|
|
114
|
-
const {
|
|
115
|
-
width,
|
|
116
|
-
height
|
|
117
|
-
} = e.nativeEvent.layout;
|
|
118
|
-
if (width && height) {
|
|
119
|
-
setSize({
|
|
120
|
-
width,
|
|
121
|
-
height
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
style: [styles.card, {
|
|
126
|
-
top: anchor.top,
|
|
127
|
-
right: anchor.right,
|
|
128
|
-
opacity: progress,
|
|
129
|
-
transform: [
|
|
130
|
-
// Move the origin to the card's top-right corner, scale
|
|
131
|
-
// there, then move back — RN has no transform-origin.
|
|
132
|
-
{
|
|
133
|
-
translateX: size.width / 2
|
|
134
|
-
}, {
|
|
135
|
-
translateY: -size.height / 2
|
|
136
|
-
}, {
|
|
137
|
-
scale
|
|
138
|
-
}, {
|
|
139
|
-
translateX: -size.width / 2
|
|
140
|
-
}, {
|
|
141
|
-
translateY: size.height / 2
|
|
142
|
-
}]
|
|
143
|
-
}],
|
|
144
|
-
children: items.map((item, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
145
|
-
testID: `${testIDPrefix}-menu-${item.key}`,
|
|
146
|
-
activeOpacity: 0.6,
|
|
147
|
-
style: [styles.row, index > 0 && styles.rowDivider],
|
|
148
|
-
onPress: () => closeMenu(item.onPress),
|
|
149
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
150
|
-
style: [styles.label, item.destructive && styles.destructive],
|
|
151
|
-
children: item.label
|
|
152
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
153
|
-
style: styles.icon,
|
|
154
|
-
children: item.icon
|
|
155
|
-
})]
|
|
156
|
-
}, item.key))
|
|
157
|
-
})]
|
|
158
|
-
})]
|
|
159
|
-
});
|
|
160
|
-
};
|
|
161
|
-
const styles = _reactNative.StyleSheet.create({
|
|
162
|
-
button: {
|
|
163
|
-
width: 40,
|
|
164
|
-
height: 40,
|
|
165
|
-
borderRadius: 20,
|
|
166
|
-
backgroundColor: 'rgba(0,0,0,0.28)',
|
|
167
|
-
alignItems: 'center',
|
|
168
|
-
justifyContent: 'center'
|
|
169
|
-
},
|
|
170
|
-
card: {
|
|
171
|
-
position: 'absolute',
|
|
172
|
-
minWidth: 200,
|
|
173
|
-
backgroundColor: '#FFFFFF',
|
|
174
|
-
borderRadius: 14,
|
|
175
|
-
paddingVertical: 4,
|
|
176
|
-
shadowColor: '#121219',
|
|
177
|
-
shadowOffset: {
|
|
178
|
-
width: 0,
|
|
179
|
-
height: 6
|
|
180
|
-
},
|
|
181
|
-
shadowOpacity: 0.18,
|
|
182
|
-
shadowRadius: 16,
|
|
183
|
-
elevation: 12
|
|
184
|
-
},
|
|
185
|
-
row: {
|
|
186
|
-
flexDirection: 'row',
|
|
187
|
-
alignItems: 'center',
|
|
188
|
-
justifyContent: 'space-between',
|
|
189
|
-
gap: 24,
|
|
190
|
-
paddingHorizontal: 16,
|
|
191
|
-
paddingVertical: 13
|
|
192
|
-
},
|
|
193
|
-
rowDivider: {
|
|
194
|
-
borderTopWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
195
|
-
borderTopColor: '#EFEFF2'
|
|
196
|
-
},
|
|
197
|
-
label: {
|
|
198
|
-
fontSize: 16,
|
|
199
|
-
color: '#141414'
|
|
200
|
-
},
|
|
201
|
-
destructive: {
|
|
202
|
-
color: '#E53935'
|
|
203
|
-
},
|
|
204
|
-
icon: {
|
|
205
|
-
width: 22,
|
|
206
|
-
alignItems: 'center'
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
var _default = exports.default = ProfileMenu;
|
|
210
|
-
//# sourceMappingURL=ProfileMenu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_icons","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ESTIMATED_WIDTH","ESTIMATED_HEIGHT","GAP","DEFAULT_TOP","EDGE","ProfileMenu","items","testIDPrefix","buttonRef","useRef","open","setOpen","useState","anchor","setAnchor","top","right","size","setSize","width","height","progress","Animated","Value","current","animate","to","done","timing","toValue","duration","easing","Easing","out","back","in","quad","useNativeDriver","start","finished","measure","measureInWindow","x","y","screenWidth","Dimensions","Math","max","openMenu","setValue","closeMenu","then","scale","interpolate","inputRange","outputRange","length","jsxs","Fragment","children","jsx","View","ref","collapsable","onLayout","TouchableOpacity","testID","activeOpacity","onPress","style","styles","button","MoreIcon","color","Modal","transparent","visible","animationType","onRequestClose","Pressable","StyleSheet","absoluteFill","nativeEvent","layout","card","opacity","transform","translateX","translateY","map","item","index","key","row","rowDivider","Text","label","destructive","icon","create","borderRadius","backgroundColor","alignItems","justifyContent","position","minWidth","paddingVertical","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","flexDirection","gap","paddingHorizontal","borderTopWidth","hairlineWidth","borderTopColor","fontSize","_default","exports"],"sourceRoot":"../../../../../src","sources":["components/Modals/ProfileHeader/ProfileMenu.tsx"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,uBAA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strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getChatBackgroundColor = exports.DEFAULT_CHAT_BACKGROUND = void 0;
|
|
7
|
-
/** @format */
|
|
8
|
-
|
|
9
|
-
/** Ground behind the conversation, and behind the rounded corners of the
|
|
10
|
-
* header and the composer that sit over it. */
|
|
11
|
-
const DEFAULT_CHAT_BACKGROUND = exports.DEFAULT_CHAT_BACKGROUND = '#F3F6FC';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* One place for the conversation's background colour.
|
|
15
|
-
*
|
|
16
|
-
* The message list has always painted it; the chat container behind it was
|
|
17
|
-
* plain white, which is what made the header's rounded bottom corners and
|
|
18
|
-
* the composer's rounded top corners invisible — the corners revealed the
|
|
19
|
-
* white parent, not the conversation.
|
|
20
|
-
*/
|
|
21
|
-
const getChatBackgroundColor = config => config?.backgroundChat?.color || DEFAULT_CHAT_BACKGROUND;
|
|
22
|
-
exports.getChatBackgroundColor = getChatBackgroundColor;
|
|
23
|
-
//# sourceMappingURL=getChatBackground.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["DEFAULT_CHAT_BACKGROUND","exports","getChatBackgroundColor","config","backgroundChat","color"],"sourceRoot":"../../../src","sources":["helpers/getChatBackground.ts"],"mappings":";;;;;;AAAA;;AAIA;AACA;AACO,MAAMA,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,SAAS;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,sBAAsB,GAAIC,MAAgB,IACrDA,MAAM,EAAEC,cAAc,EAAEC,KAAK,IAAIL,uBAAuB;AAACC,OAAA,CAAAC,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getMediaLibrary = exports.__resetMediaLibraryCache = void 0;
|
|
7
|
-
let cached;
|
|
8
|
-
const getMediaLibrary = () => {
|
|
9
|
-
if (cached !== undefined) {
|
|
10
|
-
return cached;
|
|
11
|
-
}
|
|
12
|
-
try {
|
|
13
|
-
const legacy = require('expo-media-library/legacy');
|
|
14
|
-
if (legacy?.getAssetsAsync) {
|
|
15
|
-
cached = legacy;
|
|
16
|
-
return cached;
|
|
17
|
-
}
|
|
18
|
-
} catch {}
|
|
19
|
-
try {
|
|
20
|
-
cached = require('expo-media-library') ?? null;
|
|
21
|
-
} catch {
|
|
22
|
-
cached = null;
|
|
23
|
-
}
|
|
24
|
-
return cached;
|
|
25
|
-
};
|
|
26
|
-
exports.getMediaLibrary = getMediaLibrary;
|
|
27
|
-
const __resetMediaLibraryCache = () => {
|
|
28
|
-
cached = undefined;
|
|
29
|
-
};
|
|
30
|
-
exports.__resetMediaLibraryCache = __resetMediaLibraryCache;
|
|
31
|
-
//# sourceMappingURL=mediaLibraryRuntime.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["cached","getMediaLibrary","undefined","legacy","require","getAssetsAsync","exports","__resetMediaLibraryCache"],"sourceRoot":"../../../src","sources":["helpers/mediaLibraryRuntime.ts"],"mappings":";;;;;;AAAA,IAAIA,MAAuB;AAEpB,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;AAACM,OAAA,CAAAL,eAAA,GAAAA,eAAA;AAEK,MAAMM,wBAAwB,GAAGA,CAAA,KAAM;EAC5CP,MAAM,GAAGE,SAAS;AACpB,CAAC;AAACI,OAAA,CAAAC,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.pickImageAsset = void 0;
|
|
7
|
-
var _reactNative = require("react-native");
|
|
8
|
-
var ImagePicker = _interopRequireWildcard(require("expo-image-picker"));
|
|
9
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
10
|
-
/**
|
|
11
|
-
* A picked image in the shape React Native's FormData understands.
|
|
12
|
-
*
|
|
13
|
-
* NOT a web `File`: RN streams a multipart part straight from a `file://`
|
|
14
|
-
* uri and has no usable Blob/File/atob path. Screens ported from the web
|
|
15
|
-
* client used to carry base64 -> Blob -> File helpers that could never
|
|
16
|
-
* have run here.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Ask for library permission, open the picker, and normalise the result.
|
|
21
|
-
*
|
|
22
|
-
* Returns `null` for every non-error outcome — permission refused, user
|
|
23
|
-
* cancelled — so call sites can simply keep their current value.
|
|
24
|
-
*
|
|
25
|
-
* Exists because the avatar pickers are wired to `onPress`, which hands
|
|
26
|
-
* the callback a SyntheticEvent. Storing that event as "the image" (what
|
|
27
|
-
* two screens used to do) rendered a pooled event as an <Image source>
|
|
28
|
-
* and then crashed with "Property is not configurable" when React tried
|
|
29
|
-
* to release it — on top of never letting the user pick anything.
|
|
30
|
-
*/
|
|
31
|
-
const pickImageAsset = async () => {
|
|
32
|
-
try {
|
|
33
|
-
// expo-image-picker owns the permission prompt internally and
|
|
34
|
-
// returns a `granted` flag.
|
|
35
|
-
const perm = await ImagePicker.requestMediaLibraryPermissionsAsync();
|
|
36
|
-
if (!perm.granted) {
|
|
37
|
-
_reactNative.Alert.alert('Permission required', 'Photo library permission is needed to select images.', [{
|
|
38
|
-
text: 'Cancel',
|
|
39
|
-
style: 'cancel'
|
|
40
|
-
}, {
|
|
41
|
-
text: 'Open Settings',
|
|
42
|
-
onPress: () => _reactNative.Linking.openSettings()
|
|
43
|
-
}]);
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
const result = await ImagePicker.launchImageLibraryAsync({
|
|
47
|
-
mediaTypes: ['images'],
|
|
48
|
-
allowsEditing: true,
|
|
49
|
-
aspect: [1, 1],
|
|
50
|
-
quality: 0.8
|
|
51
|
-
});
|
|
52
|
-
if (result.canceled || !result.assets?.[0]) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
const asset = result.assets[0];
|
|
56
|
-
const originalName = asset.fileName || asset.uri.split('/').pop();
|
|
57
|
-
return {
|
|
58
|
-
uri: asset.uri,
|
|
59
|
-
type: asset.mimeType || 'image/jpeg',
|
|
60
|
-
name: originalName || `image_${Date.now()}.jpg`
|
|
61
|
-
};
|
|
62
|
-
} catch (error) {
|
|
63
|
-
console.error('Failed to pick an image:', error);
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
exports.pickImageAsset = pickImageAsset;
|
|
68
|
-
//# sourceMappingURL=pickImageAsset.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","ImagePicker","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","pickImageAsset","perm","requestMediaLibraryPermissionsAsync","granted","Alert","alert","text","style","onPress","Linking","openSettings","result","launchImageLibraryAsync","mediaTypes","allowsEditing","aspect","quality","canceled","assets","asset","originalName","fileName","uri","split","pop","type","mimeType","name","Date","now","error","console","exports"],"sourceRoot":"../../../src","sources":["helpers/pickImageAsset.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAiD,SAAAE,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,CAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,I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AAG,EAAEH,KAAK,CAACG,GAAG;MACdG,IAAI,EAAEN,KAAK,CAACO,QAAQ,IAAI,YAAY;MACpCC,IAAI,EAAEP,YAAY,IAAI,SAASQ,IAAI,CAACC,GAAG,CAAC,CAAC;IAC3C,CAAC;EACH,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdC,OAAO,CAACD,KAAK,CAAC,0BAA0B,EAAEA,KAAK,CAAC;IAChD,OAAO,IAAI;EACb;AACF,CAAC;AAACE,OAAA,CAAAhC,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.shouldDismissOnDrag = exports.shouldClaimVerticalDrag = exports.DISMISS_VELOCITY = exports.DISMISS_DISTANCE = void 0;
|
|
7
|
-
/** @format */
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Shared thresholds for the drag-to-dismiss gesture on bottom sheets (the
|
|
11
|
-
* attach sheet, the profile headers, the room-list menu). Kept in one
|
|
12
|
-
* place so a pull feels identical wherever the user does it — and so the
|
|
13
|
-
* numbers are unit-testable without a touch event.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/** Drag past this many points and letting go dismisses the sheet. */
|
|
17
|
-
const DISMISS_DISTANCE = exports.DISMISS_DISTANCE = 90;
|
|
18
|
-
/** …or flick faster than this, however short the drag. */
|
|
19
|
-
const DISMISS_VELOCITY = exports.DISMISS_VELOCITY = 0.8;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Claim a drag only once it is clearly a downward pull, so a tap on a row
|
|
23
|
-
* still registers and a horizontal swipe stays with whatever scrolls
|
|
24
|
-
* sideways inside the sheet.
|
|
25
|
-
*/
|
|
26
|
-
const shouldClaimVerticalDrag = (dy, dx) => dy > 6 && Math.abs(dy) > Math.abs(dx) * 1.5;
|
|
27
|
-
|
|
28
|
-
/** Far enough / fast enough to let go of the sheet. */
|
|
29
|
-
exports.shouldClaimVerticalDrag = shouldClaimVerticalDrag;
|
|
30
|
-
const shouldDismissOnDrag = (dy, vy) => dy > DISMISS_DISTANCE || vy > DISMISS_VELOCITY;
|
|
31
|
-
exports.shouldDismissOnDrag = shouldDismissOnDrag;
|
|
32
|
-
//# sourceMappingURL=sheetGestures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["DISMISS_DISTANCE","exports","DISMISS_VELOCITY","shouldClaimVerticalDrag","dy","dx","Math","abs","shouldDismissOnDrag","vy"],"sourceRoot":"../../../src","sources":["helpers/sheetGestures.ts"],"mappings":";;;;;;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,EAAE;AAClC;AACO,MAAME,gBAAgB,GAAAD,OAAA,CAAAC,gBAAA,GAAG,GAAG;;AAEnC;AACA;AACA;AACA;AACA;AACO,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;AAAAJ,OAAA,CAAAE,uBAAA,GAAAA,uBAAA;AACO,MAAMK,mBAAmB,GAAGA,CAACJ,EAAU,EAAEK,EAAU,KACxDL,EAAE,GAAGJ,gBAAgB,IAAIS,EAAE,GAAGP,gBAAgB;AAACD,OAAA,CAAAO,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/** @format */
|
|
4
|
-
|
|
5
|
-
import React, { useState } from 'react';
|
|
6
|
-
import { ActivityIndicator, Modal, StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native';
|
|
7
|
-
import { useSelector } from 'react-redux';
|
|
8
|
-
import { getActiveRoom } from '../../../roomStore';
|
|
9
|
-
import { postReportRoom } from '../../../networking/api-requests/rooms.api';
|
|
10
|
-
import { useToast } from '../../../context/ToastContext';
|
|
11
|
-
import { useT } from '../../../i18n/useT';
|
|
12
|
-
import { getIconColor } from '../../../helpers/getIconColor';
|
|
13
|
-
import { useChatSettingState } from '../../../hooks/useChatSettingState';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Category ids go to `POST /v1/chats/reports/{chatName}` as-is; the labels
|
|
17
|
-
* come from the i18n table, which already carried `report.category.*`
|
|
18
|
-
* strings in all six locales with nothing rendering them until now.
|
|
19
|
-
*/
|
|
20
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
-
const CATEGORIES = ['spam', 'violence', 'childAbuse', 'pornography', 'personalDetails', 'illegalDrugs', 'other'];
|
|
22
|
-
const ReportChatModal = ({
|
|
23
|
-
visible,
|
|
24
|
-
onClose
|
|
25
|
-
}) => {
|
|
26
|
-
const t = useT();
|
|
27
|
-
const {
|
|
28
|
-
showToast
|
|
29
|
-
} = useToast();
|
|
30
|
-
const {
|
|
31
|
-
config
|
|
32
|
-
} = useChatSettingState();
|
|
33
|
-
const activeRoom = useSelector(state => getActiveRoom(state));
|
|
34
|
-
const [category, setCategory] = useState(null);
|
|
35
|
-
const [details, setDetails] = useState('');
|
|
36
|
-
const [sending, setSending] = useState(false);
|
|
37
|
-
const primary = getIconColor(config);
|
|
38
|
-
const close = () => {
|
|
39
|
-
setCategory(null);
|
|
40
|
-
setDetails('');
|
|
41
|
-
onClose();
|
|
42
|
-
};
|
|
43
|
-
const submit = async () => {
|
|
44
|
-
if (!category || sending) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
setSending(true);
|
|
48
|
-
try {
|
|
49
|
-
await postReportRoom({
|
|
50
|
-
chatName: activeRoom?.jid?.split('@')[0] || '',
|
|
51
|
-
category,
|
|
52
|
-
text: details.trim() || undefined
|
|
53
|
-
});
|
|
54
|
-
showToast({
|
|
55
|
-
id: Date.now().toString(),
|
|
56
|
-
title: 'Success',
|
|
57
|
-
message: t('modal.report.chatTitle'),
|
|
58
|
-
type: 'success'
|
|
59
|
-
});
|
|
60
|
-
close();
|
|
61
|
-
} catch (error) {
|
|
62
|
-
console.error('Failed to report chat:', error);
|
|
63
|
-
showToast({
|
|
64
|
-
id: Date.now().toString(),
|
|
65
|
-
title: 'Error',
|
|
66
|
-
message: t('modal.report.chatTitle'),
|
|
67
|
-
type: 'error'
|
|
68
|
-
});
|
|
69
|
-
} finally {
|
|
70
|
-
setSending(false);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
return /*#__PURE__*/_jsx(Modal, {
|
|
74
|
-
transparent: true,
|
|
75
|
-
visible: visible,
|
|
76
|
-
animationType: "fade",
|
|
77
|
-
onRequestClose: close,
|
|
78
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
79
|
-
style: styles.backdrop,
|
|
80
|
-
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
81
|
-
testID: "report-backdrop",
|
|
82
|
-
style: StyleSheet.absoluteFill,
|
|
83
|
-
activeOpacity: 1,
|
|
84
|
-
onPress: close
|
|
85
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
86
|
-
style: styles.card,
|
|
87
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
88
|
-
style: styles.title,
|
|
89
|
-
children: t('modal.report.chatTitle')
|
|
90
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
91
|
-
style: styles.categories,
|
|
92
|
-
children: CATEGORIES.map(id => {
|
|
93
|
-
const selected = category === id;
|
|
94
|
-
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
95
|
-
testID: `report-category-${id}`,
|
|
96
|
-
activeOpacity: 0.7,
|
|
97
|
-
onPress: () => setCategory(id),
|
|
98
|
-
style: [styles.category, selected && {
|
|
99
|
-
borderColor: primary,
|
|
100
|
-
backgroundColor: primary + '14'
|
|
101
|
-
}],
|
|
102
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
103
|
-
style: [styles.categoryLabel, selected && {
|
|
104
|
-
color: primary
|
|
105
|
-
}],
|
|
106
|
-
children: t(`report.category.${id}`)
|
|
107
|
-
})
|
|
108
|
-
}, id);
|
|
109
|
-
})
|
|
110
|
-
}), category === 'other' && /*#__PURE__*/_jsx(TextInput, {
|
|
111
|
-
testID: "report-details",
|
|
112
|
-
style: styles.input,
|
|
113
|
-
placeholder: t('modal.report.otherDetails'),
|
|
114
|
-
placeholderTextColor: "#8C8C8C",
|
|
115
|
-
value: details,
|
|
116
|
-
onChangeText: setDetails,
|
|
117
|
-
multiline: true
|
|
118
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
119
|
-
style: styles.buttons,
|
|
120
|
-
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
121
|
-
activeOpacity: 0.7,
|
|
122
|
-
style: [styles.button, styles.cancel],
|
|
123
|
-
onPress: close,
|
|
124
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
125
|
-
style: styles.cancelLabel,
|
|
126
|
-
children: t('action.cancel')
|
|
127
|
-
})
|
|
128
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
129
|
-
testID: "report-submit",
|
|
130
|
-
activeOpacity: 0.7,
|
|
131
|
-
disabled: !category || sending,
|
|
132
|
-
style: [styles.button, {
|
|
133
|
-
backgroundColor: primary,
|
|
134
|
-
opacity: !category || sending ? 0.5 : 1
|
|
135
|
-
}],
|
|
136
|
-
onPress: submit,
|
|
137
|
-
children: sending ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
138
|
-
color: "#FFFFFF"
|
|
139
|
-
}) : /*#__PURE__*/_jsx(Text, {
|
|
140
|
-
style: styles.submitLabel,
|
|
141
|
-
children: t('action.send')
|
|
142
|
-
})
|
|
143
|
-
})]
|
|
144
|
-
})]
|
|
145
|
-
})]
|
|
146
|
-
})
|
|
147
|
-
});
|
|
148
|
-
};
|
|
149
|
-
const styles = StyleSheet.create({
|
|
150
|
-
backdrop: {
|
|
151
|
-
flex: 1,
|
|
152
|
-
backgroundColor: 'rgba(15,15,20,0.45)',
|
|
153
|
-
alignItems: 'center',
|
|
154
|
-
justifyContent: 'center',
|
|
155
|
-
padding: 24
|
|
156
|
-
},
|
|
157
|
-
card: {
|
|
158
|
-
width: '100%',
|
|
159
|
-
borderRadius: 16,
|
|
160
|
-
backgroundColor: '#FFFFFF',
|
|
161
|
-
padding: 20
|
|
162
|
-
},
|
|
163
|
-
title: {
|
|
164
|
-
fontSize: 18,
|
|
165
|
-
fontWeight: '600',
|
|
166
|
-
color: '#141414',
|
|
167
|
-
marginBottom: 16
|
|
168
|
-
},
|
|
169
|
-
categories: {
|
|
170
|
-
flexDirection: 'row',
|
|
171
|
-
flexWrap: 'wrap',
|
|
172
|
-
gap: 8
|
|
173
|
-
},
|
|
174
|
-
category: {
|
|
175
|
-
paddingHorizontal: 12,
|
|
176
|
-
paddingVertical: 8,
|
|
177
|
-
borderRadius: 20,
|
|
178
|
-
borderWidth: 1,
|
|
179
|
-
borderColor: '#E4E4E9'
|
|
180
|
-
},
|
|
181
|
-
categoryLabel: {
|
|
182
|
-
fontSize: 14,
|
|
183
|
-
color: '#141414'
|
|
184
|
-
},
|
|
185
|
-
input: {
|
|
186
|
-
marginTop: 16,
|
|
187
|
-
minHeight: 80,
|
|
188
|
-
borderRadius: 12,
|
|
189
|
-
borderWidth: 1,
|
|
190
|
-
borderColor: '#E4E4E9',
|
|
191
|
-
padding: 12,
|
|
192
|
-
fontSize: 14,
|
|
193
|
-
color: '#141414',
|
|
194
|
-
textAlignVertical: 'top'
|
|
195
|
-
},
|
|
196
|
-
buttons: {
|
|
197
|
-
flexDirection: 'row',
|
|
198
|
-
gap: 12,
|
|
199
|
-
marginTop: 20
|
|
200
|
-
},
|
|
201
|
-
button: {
|
|
202
|
-
flex: 1,
|
|
203
|
-
height: 44,
|
|
204
|
-
borderRadius: 12,
|
|
205
|
-
alignItems: 'center',
|
|
206
|
-
justifyContent: 'center'
|
|
207
|
-
},
|
|
208
|
-
cancel: {
|
|
209
|
-
backgroundColor: '#F2F2F7'
|
|
210
|
-
},
|
|
211
|
-
cancelLabel: {
|
|
212
|
-
fontSize: 16,
|
|
213
|
-
fontWeight: '500',
|
|
214
|
-
color: '#141414'
|
|
215
|
-
},
|
|
216
|
-
submitLabel: {
|
|
217
|
-
fontSize: 16,
|
|
218
|
-
fontWeight: '600',
|
|
219
|
-
color: '#FFFFFF'
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
export default ReportChatModal;
|
|
223
|
-
//# sourceMappingURL=ReportChatModal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","ActivityIndicator","Modal","StyleSheet","Text","TextInput","TouchableOpacity","View","useSelector","getActiveRoom","postReportRoom","useToast","useT","getIconColor","useChatSettingState","jsx","_jsx","jsxs","_jsxs","CATEGORIES","ReportChatModal","visible","onClose","t","showToast","config","activeRoom","state","category","setCategory","details","setDetails","sending","setSending","primary","close","submit","chatName","jid","split","text","trim","undefined","id","Date","now","toString","title","message","type","error","console","transparent","animationType","onRequestClose","children","style","styles","backdrop","testID","absoluteFill","activeOpacity","onPress","card","categories","map","selected","borderColor","backgroundColor","categoryLabel","color","input","placeholder","placeholderTextColor","value","onChangeText","multiline","buttons","button","cancel","cancelLabel","disabled","opacity","submitLabel","create","flex","alignItems","justifyContent","padding","width","borderRadius","fontSize","fontWeight","marginBottom","flexDirection","flexWrap","gap","paddingHorizontal","paddingVertical","borderWidth","marginTop","minHeight","textAlignVertical","height"],"sourceRoot":"../../../../../src","sources":["components/Modals/ChatProfileModal/ReportChatModal.tsx"],"mappings":";;AAAA;;AAEA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SACEC,iBAAiB,EACjBC,KAAK,EACLC,UAAU,EACVC,IAAI,EACJC,SAAS,EACTC,gB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