@smart-link/rn-im 1.0.1
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/README.md +34 -0
- package/assets/avatars-busi-notify.png +0 -0
- package/assets/avatars-empty.png +0 -0
- package/assets/avatars-group.jpg +0 -0
- package/assets/avatars-man.jpg +0 -0
- package/assets/avatars-woman.jpg +0 -0
- package/assets/cloud-backup-begin.png +0 -0
- package/assets/cloud-backup.png +0 -0
- package/assets/group-mgr.png +0 -0
- package/assets/group-owner.png +0 -0
- package/assets/hook-black-double.png +0 -0
- package/assets/hook-black.png +0 -0
- package/assets/hook-blue-double.png +0 -0
- package/assets/hook-blue.png +0 -0
- package/assets/hook-green.png +0 -0
- package/assets/no_message.png +0 -0
- package/assets/share.jpeg +0 -0
- package/assets/voice-left-playing.gif +0 -0
- package/assets/voice-left.png +0 -0
- package/dist/api/addressList.d.ts +27 -0
- package/dist/api/addressList.js +18 -0
- package/dist/api/backup.d.ts +18 -0
- package/dist/api/backup.js +29 -0
- package/dist/api/file.d.ts +4 -0
- package/dist/api/file.js +49 -0
- package/dist/api/user.d.ts +8 -0
- package/dist/api/user.js +16 -0
- package/dist/components/CachedImage.d.ts +11 -0
- package/dist/components/CachedImage.js +48 -0
- package/dist/components/Camera/Camera.d.ts +10 -0
- package/dist/components/Camera/Camera.js +100 -0
- package/dist/components/Camera/CameraCapture.d.ts +32 -0
- package/dist/components/Camera/CameraCapture.js +360 -0
- package/dist/components/Camera/CameraResult.d.ts +11 -0
- package/dist/components/Camera/CameraResult.js +102 -0
- package/dist/components/ChatAvatar/ChatAvatar.d.ts +15 -0
- package/dist/components/ChatAvatar/ChatAvatar.js +134 -0
- package/dist/components/ChatAvatar/ChatAvatarId.d.ts +8 -0
- package/dist/components/ChatAvatar/ChatAvatarId.js +92 -0
- package/dist/components/ChatAvatar/ChatAvatarLocal.d.ts +9 -0
- package/dist/components/ChatAvatar/ChatAvatarLocal.js +76 -0
- package/dist/components/ChatAvatar/index.d.ts +2 -0
- package/dist/components/ChatAvatar/index.js +23 -0
- package/dist/components/Favicon.d.ts +7 -0
- package/dist/components/Favicon.js +74 -0
- package/dist/components/FormatTimeText.d.ts +8 -0
- package/dist/components/FormatTimeText.js +24 -0
- package/dist/components/Highlighter.d.ts +9 -0
- package/dist/components/Highlighter.js +42 -0
- package/dist/components/IndicatorText.d.ts +10 -0
- package/dist/components/IndicatorText.js +47 -0
- package/dist/components/LocalImage.d.ts +10 -0
- package/dist/components/LocalImage.js +37 -0
- package/dist/components/NetworkUnconnected.d.ts +3 -0
- package/dist/components/NetworkUnconnected.js +55 -0
- package/dist/components/PopoverWrapper.d.ts +13 -0
- package/dist/components/PopoverWrapper.js +78 -0
- package/dist/components/VideoPlayer.d.ts +13 -0
- package/dist/components/VideoPlayer.js +288 -0
- package/dist/components/styles.d.ts +19 -0
- package/dist/components/styles.js +23 -0
- package/dist/default-assets.d.ts +18 -0
- package/dist/default-assets.js +22 -0
- package/dist/hooks/useFormatMsgTime.d.ts +4 -0
- package/dist/hooks/useFormatMsgTime.js +53 -0
- package/dist/hooks/useImSelector.d.ts +15 -0
- package/dist/hooks/useImSelector.js +48 -0
- package/dist/hooks/useTranslation.d.ts +13 -0
- package/dist/hooks/useTranslation.js +12 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +28 -0
- package/dist/init.d.ts +17 -0
- package/dist/init.js +116 -0
- package/dist/interface.d.ts +47 -0
- package/dist/interface.js +2 -0
- package/dist/locales/en/addressList.d.ts +3 -0
- package/dist/locales/en/addressList.js +31 -0
- package/dist/locales/index.d.ts +4 -0
- package/dist/locales/index.js +27 -0
- package/dist/locales/lao/addressList.d.ts +3 -0
- package/dist/locales/lao/addressList.js +31 -0
- package/dist/locales/zh/addressList.d.ts +30 -0
- package/dist/locales/zh/addressList.js +32 -0
- package/dist/pages/address-list/AddressList.d.ts +6 -0
- package/dist/pages/address-list/AddressList.js +158 -0
- package/dist/pages/address-list/CardInfo.d.ts +15 -0
- package/dist/pages/address-list/CardInfo.js +42 -0
- package/dist/pages/address-list/ChooseContact.d.ts +6 -0
- package/dist/pages/address-list/ChooseContact.js +197 -0
- package/dist/pages/address-list/Icons.d.ts +5 -0
- package/dist/pages/address-list/Icons.js +16 -0
- package/dist/pages/address-list/Organization.d.ts +13 -0
- package/dist/pages/address-list/Organization.js +221 -0
- package/dist/pages/address-list/UserDetail.d.ts +6 -0
- package/dist/pages/address-list/UserDetail.js +131 -0
- package/dist/pages/address-list/UserJobs.d.ts +6 -0
- package/dist/pages/address-list/UserJobs.js +50 -0
- package/dist/pages/address-list/UserSearch.d.ts +6 -0
- package/dist/pages/address-list/UserSearch.js +82 -0
- package/dist/pages/address-list/addressList.routes.d.ts +50 -0
- package/dist/pages/address-list/addressList.routes.js +50 -0
- package/dist/pages/collection/Collection.d.ts +3 -0
- package/dist/pages/collection/Collection.js +136 -0
- package/dist/pages/collection/ContentFactory.d.ts +6 -0
- package/dist/pages/collection/ContentFactory.js +167 -0
- package/dist/pages/collection/collection.routes.d.ts +9 -0
- package/dist/pages/collection/collection.routes.js +17 -0
- package/dist/pages/conversation/ForwardToConversation.d.ts +6 -0
- package/dist/pages/conversation/ForwardToConversation.js +172 -0
- package/dist/pages/conversation/List.d.ts +6 -0
- package/dist/pages/conversation/List.js +204 -0
- package/dist/pages/conversation/components/ConversationCard.d.ts +12 -0
- package/dist/pages/conversation/components/ConversationCard.js +142 -0
- package/dist/pages/conversation/components/ConversationOption.d.ts +11 -0
- package/dist/pages/conversation/components/ConversationOption.js +99 -0
- package/dist/pages/conversation/conversation.routes.d.ts +2 -0
- package/dist/pages/conversation/conversation.routes.js +74 -0
- package/dist/pages/conversation/setting/GroupTransfer.d.ts +6 -0
- package/dist/pages/conversation/setting/GroupTransfer.js +88 -0
- package/dist/pages/conversation/setting/OptionAvatars.d.ts +22 -0
- package/dist/pages/conversation/setting/OptionAvatars.js +152 -0
- package/dist/pages/conversation/setting/OptionCancelGroup.d.ts +6 -0
- package/dist/pages/conversation/setting/OptionCancelGroup.js +49 -0
- package/dist/pages/conversation/setting/OptionConversation.d.ts +19 -0
- package/dist/pages/conversation/setting/OptionConversation.js +71 -0
- package/dist/pages/conversation/setting/OptionGroup.d.ts +17 -0
- package/dist/pages/conversation/setting/OptionGroup.js +76 -0
- package/dist/pages/conversation/setting/OptionGroupManage.d.ts +6 -0
- package/dist/pages/conversation/setting/OptionGroupManage.js +68 -0
- package/dist/pages/conversation/setting/OptionGroupMoreMember.d.ts +4 -0
- package/dist/pages/conversation/setting/OptionGroupMoreMember.js +124 -0
- package/dist/pages/conversation/setting/OptionGroupNameOrNoticeEdit.d.ts +6 -0
- package/dist/pages/conversation/setting/OptionGroupNameOrNoticeEdit.js +149 -0
- package/dist/pages/conversation/setting/Setting.d.ts +6 -0
- package/dist/pages/conversation/setting/Setting.js +184 -0
- package/dist/pages/conversation/setting/SettingChatBg.d.ts +6 -0
- package/dist/pages/conversation/setting/SettingChatBg.js +95 -0
- package/dist/pages/index.d.ts +8 -0
- package/dist/pages/index.js +27 -0
- package/dist/pages/message/ChooseMember.d.ts +6 -0
- package/dist/pages/message/ChooseMember.js +185 -0
- package/dist/pages/message/MessageBackup/Bar.d.ts +8 -0
- package/dist/pages/message/MessageBackup/Bar.js +77 -0
- package/dist/pages/message/MessageBackup/MessageBackup.d.ts +10 -0
- package/dist/pages/message/MessageBackup/MessageBackup.js +133 -0
- package/dist/pages/message/MessageBackup/RestoreBackupPage.d.ts +6 -0
- package/dist/pages/message/MessageBackup/RestoreBackupPage.js +135 -0
- package/dist/pages/message/MessageBackup/StartBackupPage.d.ts +6 -0
- package/dist/pages/message/MessageBackup/StartBackupPage.js +135 -0
- package/dist/pages/message/MessageBackup/index.d.ts +3 -0
- package/dist/pages/message/MessageBackup/index.js +12 -0
- package/dist/pages/message/MessageBackup/utils.d.ts +46 -0
- package/dist/pages/message/MessageBackup/utils.js +239 -0
- package/dist/pages/message/MessageList.d.ts +6 -0
- package/dist/pages/message/MessageList.js +175 -0
- package/dist/pages/message/MessageRecord.d.ts +6 -0
- package/dist/pages/message/MessageRecord.js +97 -0
- package/dist/pages/message/components/BusiNotifyCard.d.ts +6 -0
- package/dist/pages/message/components/BusiNotifyCard.js +132 -0
- package/dist/pages/message/components/ChatBg.d.ts +7 -0
- package/dist/pages/message/components/ChatBg.js +65 -0
- package/dist/pages/message/components/MessageItem.d.ts +16 -0
- package/dist/pages/message/components/MessageItem.js +205 -0
- package/dist/pages/message/components/MessageItemQuote.d.ts +7 -0
- package/dist/pages/message/components/MessageItemQuote.js +83 -0
- package/dist/pages/message/components/MessageItemTips.d.ts +9 -0
- package/dist/pages/message/components/MessageItemTips.js +67 -0
- package/dist/pages/message/components/MessageOption.d.ts +11 -0
- package/dist/pages/message/components/MessageOption.js +360 -0
- package/dist/pages/message/components/MessagePayload.d.ts +14 -0
- package/dist/pages/message/components/MessagePayload.js +96 -0
- package/dist/pages/message/components/MessagePictureAlbum.d.ts +10 -0
- package/dist/pages/message/components/MessagePictureAlbum.js +105 -0
- package/dist/pages/message/components/MessageReceiptStatus.d.ts +6 -0
- package/dist/pages/message/components/MessageReceiptStatus.js +61 -0
- package/dist/pages/message/components/MessageUndo.d.ts +10 -0
- package/dist/pages/message/components/MessageUndo.js +75 -0
- package/dist/pages/message/components/MultipleBar/index.d.ts +5 -0
- package/dist/pages/message/components/MultipleBar/index.js +116 -0
- package/dist/pages/message/components/Payload/PayloadContact.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadContact.js +86 -0
- package/dist/pages/message/components/Payload/PayloadFile.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadFile.js +115 -0
- package/dist/pages/message/components/Payload/PayloadMultiple.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadMultiple.js +102 -0
- package/dist/pages/message/components/Payload/PayloadNotify.d.ts +9 -0
- package/dist/pages/message/components/Payload/PayloadNotify.js +92 -0
- package/dist/pages/message/components/Payload/PayloadPicture.d.ts +7 -0
- package/dist/pages/message/components/Payload/PayloadPicture.js +69 -0
- package/dist/pages/message/components/Payload/PayloadShare.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadShare.js +100 -0
- package/dist/pages/message/components/Payload/PayloadText.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadText.js +128 -0
- package/dist/pages/message/components/Payload/PayloadVideo.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadVideo.js +78 -0
- package/dist/pages/message/components/Payload/PayloadVoice.d.ts +6 -0
- package/dist/pages/message/components/Payload/PayloadVoice.js +155 -0
- package/dist/pages/message/components/Payload/PayloadWrapper.d.ts +12 -0
- package/dist/pages/message/components/Payload/PayloadWrapper.js +73 -0
- package/dist/pages/message/components/Payload/type.d.ts +9 -0
- package/dist/pages/message/components/Payload/type.js +2 -0
- package/dist/pages/message/components/ReceiptBack.d.ts +7 -0
- package/dist/pages/message/components/ReceiptBack.js +82 -0
- package/dist/pages/message/components/TextMixMessage.d.ts +9 -0
- package/dist/pages/message/components/TextMixMessage.js +62 -0
- package/dist/pages/message/components/TextMixQuote.d.ts +61 -0
- package/dist/pages/message/components/TextMixQuote.js +276 -0
- package/dist/pages/message/components/TextMixQuoteMessage.d.ts +14 -0
- package/dist/pages/message/components/TextMixQuoteMessage.js +74 -0
- package/dist/pages/message/components/UploadProgress.d.ts +9 -0
- package/dist/pages/message/components/UploadProgress.js +51 -0
- package/dist/pages/message/components/messageBar/EmojiPanel.d.ts +11 -0
- package/dist/pages/message/components/messageBar/EmojiPanel.js +101 -0
- package/dist/pages/message/components/messageBar/Icons.d.ts +18 -0
- package/dist/pages/message/components/messageBar/Icons.js +88 -0
- package/dist/pages/message/components/messageBar/MessageBar.d.ts +12 -0
- package/dist/pages/message/components/messageBar/MessageBar.js +273 -0
- package/dist/pages/message/components/messageBar/MessageInput.d.ts +21 -0
- package/dist/pages/message/components/messageBar/MessageInput.js +203 -0
- package/dist/pages/message/components/messageBar/OptionPanel.d.ts +8 -0
- package/dist/pages/message/components/messageBar/OptionPanel.js +240 -0
- package/dist/pages/message/components/messageBar/VoiceBar.d.ts +3 -0
- package/dist/pages/message/components/messageBar/VoiceBar.js +272 -0
- package/dist/pages/message/components/messageBar/index.d.ts +2 -0
- package/dist/pages/message/components/messageBar/index.js +23 -0
- package/dist/pages/message/message.routes.d.ts +2 -0
- package/dist/pages/message/message.routes.js +79 -0
- package/dist/pages/search/Search.d.ts +6 -0
- package/dist/pages/search/Search.js +84 -0
- package/dist/pages/search/SearchChatRecords.d.ts +3 -0
- package/dist/pages/search/SearchChatRecords.js +173 -0
- package/dist/pages/search/SearchFile.d.ts +3 -0
- package/dist/pages/search/SearchFile.js +202 -0
- package/dist/pages/search/SearchManager.d.ts +6 -0
- package/dist/pages/search/SearchManager.js +111 -0
- package/dist/pages/search/SearchPicturePage.d.ts +6 -0
- package/dist/pages/search/SearchPicturePage.js +56 -0
- package/dist/pages/search/components/ChatRecords.d.ts +6 -0
- package/dist/pages/search/components/ChatRecords.js +151 -0
- package/dist/pages/search/components/MyGroupChat.d.ts +6 -0
- package/dist/pages/search/components/MyGroupChat.js +128 -0
- package/dist/pages/search/components/PictureMulipleBar.d.ts +10 -0
- package/dist/pages/search/components/PictureMulipleBar.js +105 -0
- package/dist/pages/search/components/SearchFileList.d.ts +7 -0
- package/dist/pages/search/components/SearchFileList.js +173 -0
- package/dist/pages/search/components/SearchPictures.d.ts +8 -0
- package/dist/pages/search/components/SearchPictures.js +220 -0
- package/dist/pages/search/components/SearchShareLinkList.d.ts +7 -0
- package/dist/pages/search/components/SearchShareLinkList.js +112 -0
- package/dist/pages/search/components/SearchUser.d.ts +6 -0
- package/dist/pages/search/components/SearchUser.js +83 -0
- package/dist/pages/search/components/useSearchMessage.d.ts +11 -0
- package/dist/pages/search/components/useSearchMessage.js +68 -0
- package/dist/pages/search/search.routes.d.ts +2 -0
- package/dist/pages/search/search.routes.js +48 -0
- package/dist/pages/search/utils.d.ts +12 -0
- package/dist/pages/search/utils.js +42 -0
- package/dist/pages/types.d.ts +70 -0
- package/dist/pages/types.js +2 -0
- package/dist/slice/contact/contact.action.d.ts +1 -0
- package/dist/slice/contact/contact.action.js +2 -0
- package/dist/slice/contact/contact.slice.d.ts +12 -0
- package/dist/slice/contact/contact.slice.js +60 -0
- package/dist/slice/index.d.ts +9 -0
- package/dist/slice/index.js +15 -0
- package/dist/slice/panel/panel.slice.d.ts +8 -0
- package/dist/slice/panel/panel.slice.js +19 -0
- package/dist/slice/video/video.action.d.ts +5 -0
- package/dist/slice/video/video.action.js +65 -0
- package/dist/slice/video/video.slice.d.ts +17 -0
- package/dist/slice/video/video.slice.js +40 -0
- package/dist/utils/color.d.ts +1 -0
- package/dist/utils/color.js +9 -0
- package/dist/utils/common-action-sheet.d.ts +8 -0
- package/dist/utils/common-action-sheet.js +45 -0
- package/dist/utils/cookie.d.ts +1 -0
- package/dist/utils/cookie.js +29 -0
- package/dist/utils/emoji.d.ts +9 -0
- package/dist/utils/emoji.js +627 -0
- package/dist/utils/file-icon.d.ts +7 -0
- package/dist/utils/file-icon.js +80 -0
- package/dist/utils/file-operate.d.ts +1 -0
- package/dist/utils/file-operate.js +4 -0
- package/dist/utils/file.d.ts +23 -0
- package/dist/utils/file.js +255 -0
- package/dist/utils/golden-rectangle.d.ts +4 -0
- package/dist/utils/golden-rectangle.js +34 -0
- package/dist/utils/phone.d.ts +2 -0
- package/dist/utils/phone.js +24 -0
- package/dist/utils/request.d.ts +34 -0
- package/dist/utils/request.js +67 -0
- package/dist/utils/scroll.d.ts +1 -0
- package/dist/utils/scroll.js +12 -0
- package/dist/utils/summary.d.ts +2 -0
- package/dist/utils/summary.js +42 -0
- package/dist/utils/take-camera.d.ts +2 -0
- package/dist/utils/take-camera.js +41 -0
- package/dist/utils/text-mix.d.ts +9 -0
- package/dist/utils/text-mix.js +82 -0
- package/dist/utils/upload.d.ts +5 -0
- package/dist/utils/upload.js +80 -0
- package/package.json +79 -0
@@ -0,0 +1,288 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
|
+
};
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
+
const react_1 = __importStar(require("react"));
|
30
|
+
const react_native_1 = require("react-native");
|
31
|
+
const react_native_video_1 = __importDefault(require("react-native-video"));
|
32
|
+
const MaterialIcons_1 = __importDefault(require("react-native-vector-icons/MaterialIcons"));
|
33
|
+
const AntDesign_1 = __importDefault(require("react-native-vector-icons/AntDesign"));
|
34
|
+
const FontAwesome_1 = __importDefault(require("react-native-vector-icons/FontAwesome"));
|
35
|
+
const Progress = __importStar(require("react-native-progress"));
|
36
|
+
const slider_1 = __importDefault(require("@react-native-community/slider"));
|
37
|
+
const rn_ui_1 = require("@smart-link/rn-ui");
|
38
|
+
const file_1 = require("../utils/file");
|
39
|
+
const im_base_1 = require("@smart-link/im-base");
|
40
|
+
const useTranslation_1 = __importDefault(require("../hooks/useTranslation"));
|
41
|
+
const useImSelector_1 = require("../hooks/useImSelector");
|
42
|
+
const video_slice_1 = require("../slice/video/video.slice");
|
43
|
+
const react_redux_1 = require("react-redux");
|
44
|
+
const { width: screenWidth } = react_native_1.Dimensions.get('screen');
|
45
|
+
const VideoPlayer = (0, react_1.memo)(() => {
|
46
|
+
const { showVideoPlay = false, videoLocalPath, videoImagePath, videoImageHeight, videoImageWidth, videoDownloadError, videoDownloadProgress = 0, } = (0, useImSelector_1.useVideo)();
|
47
|
+
// @ts-ignore
|
48
|
+
const player = react_1.default.useRef(null);
|
49
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
50
|
+
const { t } = (0, useTranslation_1.default)();
|
51
|
+
const videoImageSize = {
|
52
|
+
width: screenWidth,
|
53
|
+
height: (videoImageHeight > 500 ? (0, rn_ui_1.dp)(500) : videoImageHeight * videoImageWidth / screenWidth)
|
54
|
+
};
|
55
|
+
const [isError, setIsError] = (0, react_1.useState)(false);
|
56
|
+
const [duration, setDuration] = (0, react_1.useState)(0);
|
57
|
+
const [currentTime, setCurrentTime] = (0, react_1.useState)(0);
|
58
|
+
const [paused, setPaused] = (0, react_1.useState)(false);
|
59
|
+
const [pageX, setPageX] = (0, react_1.useState)(0);
|
60
|
+
const [pageXTime, setPageXTime] = (0, react_1.useState)(0);
|
61
|
+
const onBuffer = () => {
|
62
|
+
};
|
63
|
+
const onLoad = (data) => {
|
64
|
+
console.log('onLoad: ', data);
|
65
|
+
setDuration(data.duration);
|
66
|
+
};
|
67
|
+
const videoError = () => {
|
68
|
+
setIsError(true);
|
69
|
+
};
|
70
|
+
const onProgress = (data) => {
|
71
|
+
setCurrentTime(data.currentTime);
|
72
|
+
};
|
73
|
+
const onEnd = () => {
|
74
|
+
setPaused(true);
|
75
|
+
setCurrentTime(duration);
|
76
|
+
};
|
77
|
+
const onPause = () => {
|
78
|
+
setPaused(true);
|
79
|
+
};
|
80
|
+
const onResume = () => {
|
81
|
+
if (player && currentTime === duration) {
|
82
|
+
player.current.seek(0);
|
83
|
+
}
|
84
|
+
setPaused(false);
|
85
|
+
};
|
86
|
+
const onPressSeek = (evt) => {
|
87
|
+
if (react_native_1.Platform.OS === 'ios') {
|
88
|
+
let { nativeEvent } = evt;
|
89
|
+
setPageX(nativeEvent.pageX);
|
90
|
+
setPageXTime(currentTime);
|
91
|
+
}
|
92
|
+
else {
|
93
|
+
setCurrentTime(evt);
|
94
|
+
player.current.seek(evt);
|
95
|
+
}
|
96
|
+
setPaused(true);
|
97
|
+
};
|
98
|
+
const onMoveSeek = (evt) => {
|
99
|
+
if (react_native_1.Platform.OS === 'ios') {
|
100
|
+
let { nativeEvent } = evt;
|
101
|
+
let time = (nativeEvent.pageX - pageX) / (0, rn_ui_1.dp)(200) * duration + pageXTime;
|
102
|
+
if (time < 0) {
|
103
|
+
time = 0;
|
104
|
+
}
|
105
|
+
else if (time > duration) {
|
106
|
+
time = duration;
|
107
|
+
}
|
108
|
+
player.current.seek(time);
|
109
|
+
}
|
110
|
+
else {
|
111
|
+
player.current.seek(evt);
|
112
|
+
}
|
113
|
+
};
|
114
|
+
const onReleaseSeek = () => {
|
115
|
+
setPageX(0);
|
116
|
+
setPageXTime(0);
|
117
|
+
setPaused(false);
|
118
|
+
};
|
119
|
+
(0, react_1.useEffect)(() => {
|
120
|
+
var _a;
|
121
|
+
if (showVideoPlay) {
|
122
|
+
(_a = player.current) === null || _a === void 0 ? void 0 : _a.seek(0);
|
123
|
+
setCurrentTime(0);
|
124
|
+
setPaused(false);
|
125
|
+
setPageX(0);
|
126
|
+
setPageXTime(0);
|
127
|
+
}
|
128
|
+
}, [showVideoPlay]);
|
129
|
+
if (!videoLocalPath && !videoImagePath) {
|
130
|
+
return null;
|
131
|
+
}
|
132
|
+
return (<react_native_1.Modal animationType="fade" transparent={false} visible={showVideoPlay} onRequestClose={() => {
|
133
|
+
}}>
|
134
|
+
{react_native_1.Platform.OS === 'android' &&
|
135
|
+
<react_native_1.StatusBar backgroundColor={'#000'}/>}
|
136
|
+
<react_native_1.View style={styles.video}>
|
137
|
+
|
138
|
+
{!videoLocalPath && videoImagePath &&
|
139
|
+
<react_native_1.ImageBackground style={[styles.videoImage, videoImageSize]} source={{ uri: (0, file_1.toAbsolutePath)(videoImagePath) }}>
|
140
|
+
<Progress.Pie progress={videoDownloadProgress} size={(0, rn_ui_1.dp)(60)} borderWidth={(0, rn_ui_1.dp)(3)} color={'#fff'}/>
|
141
|
+
</react_native_1.ImageBackground>}
|
142
|
+
|
143
|
+
{(isError || videoDownloadError) &&
|
144
|
+
<react_native_1.View style={styles.error}>
|
145
|
+
<MaterialIcons_1.default name={'error'} size={(0, rn_ui_1.dp)(50)} color={'#fff'}/>
|
146
|
+
<react_native_1.Text style={styles.errorText}>{t('videoLoadingError')}</react_native_1.Text>
|
147
|
+
</react_native_1.View>}
|
148
|
+
{!isError && videoLocalPath &&
|
149
|
+
<react_native_video_1.default ref={player} source={{ uri: (0, file_1.toAbsolutePath)(videoLocalPath) }} paused={paused} resizeMode={'contain'} progressUpdateInterval={100} onLoad={onLoad} onProgress={onProgress} onEnd={onEnd} onBuffer={onBuffer} onError={videoError} style={styles.player}/>}
|
150
|
+
<react_native_1.TouchableOpacity style={styles.cancel} onPress={() => dispatch((0, video_slice_1.cancelVideoPlayer)())}>
|
151
|
+
<AntDesign_1.default name='close' size={(0, rn_ui_1.dp)(25)} color={'#fff'}/>
|
152
|
+
</react_native_1.TouchableOpacity>
|
153
|
+
<PlayBar paused={paused} currentTime={currentTime} duration={duration} onPause={onPause} onResume={onResume} onPressSeek={onPressSeek} onMoveSeek={onMoveSeek} onReleaseSeek={onReleaseSeek}/>
|
154
|
+
</react_native_1.View>
|
155
|
+
</react_native_1.Modal>);
|
156
|
+
});
|
157
|
+
const PlayBar = (0, react_1.memo)(props => {
|
158
|
+
const { paused = false, currentTime, duration, onPause, onResume, onPressSeek, onMoveSeek, onReleaseSeek, } = props;
|
159
|
+
let percentWidth = 0;
|
160
|
+
if (duration !== 0) {
|
161
|
+
percentWidth = (0, rn_ui_1.dp)(200) * currentTime / duration;
|
162
|
+
}
|
163
|
+
return (<react_native_1.View style={styles.playBar}>
|
164
|
+
{paused &&
|
165
|
+
<react_native_1.TouchableOpacity style={styles.pauseResume} onPress={onResume}>
|
166
|
+
<FontAwesome_1.default name='play' size={(0, rn_ui_1.dp)(13)} color={'#fff'}/>
|
167
|
+
</react_native_1.TouchableOpacity>}
|
168
|
+
{!paused &&
|
169
|
+
<react_native_1.TouchableOpacity style={styles.pauseResume} onPress={onPause}>
|
170
|
+
<FontAwesome_1.default name='pause' size={(0, rn_ui_1.dp)(13)} color={'#fff'}/>
|
171
|
+
</react_native_1.TouchableOpacity>}
|
172
|
+
<react_native_1.View style={{ width: (0, rn_ui_1.dp)(5) }}/>
|
173
|
+
<react_native_1.Text style={styles.time}>{(0, im_base_1.numberToTime)(currentTime)}</react_native_1.Text>
|
174
|
+
<react_native_1.View style={{ width: (0, rn_ui_1.dp)(10) }}/>
|
175
|
+
{react_native_1.Platform.OS === 'ios' ? <react_native_1.View style={styles.progress}>
|
176
|
+
<react_native_1.View style={[styles.percent, { width: percentWidth }]}>
|
177
|
+
<SeekBottom onPressSeek={onPressSeek} onMoveSeek={onMoveSeek} onReleaseSeek={onReleaseSeek}/>
|
178
|
+
</react_native_1.View>
|
179
|
+
</react_native_1.View> :
|
180
|
+
<slider_1.default style={{ width: (0, rn_ui_1.dp)(200), height: (0, rn_ui_1.dp)(30) }} disabled={duration === 0} value={currentTime} minimumValue={0} maximumValue={duration} minimumTrackTintColor="#fff" thumbTintColor="#fff" onSlidingStart={onPressSeek} onValueChange={onMoveSeek} onSlidingComplete={onReleaseSeek}/>}
|
181
|
+
<react_native_1.View style={{ width: (0, rn_ui_1.dp)(10) }}/>
|
182
|
+
<react_native_1.Text style={styles.time}>{(0, im_base_1.numberToTime)(duration)}</react_native_1.Text>
|
183
|
+
</react_native_1.View>);
|
184
|
+
});
|
185
|
+
const SeekBottom = (0, react_1.memo)(props => {
|
186
|
+
const { onPressSeek, onMoveSeek, onReleaseSeek, } = props;
|
187
|
+
return (<>
|
188
|
+
<react_native_1.View style={styles.seekRange} onStartShouldSetResponder={() => true} onMoveShouldSetResponder={() => true} onResponderGrant={onPressSeek} onResponderMove={onMoveSeek} onResponderRelease={onReleaseSeek} onResponderTerminationRequest={() => false}>
|
189
|
+
</react_native_1.View>
|
190
|
+
<react_native_1.View style={styles.seek}/>
|
191
|
+
</>);
|
192
|
+
});
|
193
|
+
const styles = react_native_1.StyleSheet.create({
|
194
|
+
video: {
|
195
|
+
flex: 1,
|
196
|
+
backgroundColor: '#000',
|
197
|
+
justifyContent: 'center',
|
198
|
+
alignItems: 'center',
|
199
|
+
},
|
200
|
+
videoImage: {
|
201
|
+
justifyContent: 'center',
|
202
|
+
alignItems: 'center',
|
203
|
+
},
|
204
|
+
error: {
|
205
|
+
justifyContent: 'center',
|
206
|
+
alignItems: 'center',
|
207
|
+
},
|
208
|
+
errorText: {
|
209
|
+
fontSize: (0, rn_ui_1.dp)(18),
|
210
|
+
color: '#fff',
|
211
|
+
lineHeight: (0, rn_ui_1.dp)(40),
|
212
|
+
},
|
213
|
+
player: {
|
214
|
+
position: 'absolute',
|
215
|
+
top: 0,
|
216
|
+
left: 0,
|
217
|
+
bottom: 0,
|
218
|
+
right: 0,
|
219
|
+
},
|
220
|
+
cancel: {
|
221
|
+
height: (0, rn_ui_1.dp)(40),
|
222
|
+
width: (0, rn_ui_1.dp)(40),
|
223
|
+
borderRadius: (0, rn_ui_1.dp)(5),
|
224
|
+
backgroundColor: '#333',
|
225
|
+
position: 'absolute',
|
226
|
+
top: (0, rn_ui_1.dp)(70),
|
227
|
+
right: (0, rn_ui_1.dp)(30),
|
228
|
+
justifyContent: 'center',
|
229
|
+
alignItems: 'center',
|
230
|
+
opacity: 0.7,
|
231
|
+
},
|
232
|
+
playBar: {
|
233
|
+
position: 'absolute',
|
234
|
+
bottom: (0, rn_ui_1.dp)(80),
|
235
|
+
backgroundColor: 'rgba(51,51,51,0.7)',
|
236
|
+
flexDirection: 'row',
|
237
|
+
paddingVertical: react_native_1.Platform.select({
|
238
|
+
ios: (0, rn_ui_1.dp)(10),
|
239
|
+
default: (0, rn_ui_1.dp)(5)
|
240
|
+
}),
|
241
|
+
paddingHorizontal: (0, rn_ui_1.dp)(10),
|
242
|
+
borderRadius: (0, rn_ui_1.dp)(5),
|
243
|
+
justifyContent: 'center',
|
244
|
+
alignItems: 'center',
|
245
|
+
},
|
246
|
+
pauseResume: {
|
247
|
+
justifyContent: 'center',
|
248
|
+
alignItems: 'center',
|
249
|
+
width: (0, rn_ui_1.dp)(20),
|
250
|
+
},
|
251
|
+
progress: {
|
252
|
+
flexDirection: 'row',
|
253
|
+
height: (0, rn_ui_1.dp)(2),
|
254
|
+
width: (0, rn_ui_1.dp)(200),
|
255
|
+
borderRadius: (0, rn_ui_1.dp)(1),
|
256
|
+
backgroundColor: '#666',
|
257
|
+
},
|
258
|
+
percent: {
|
259
|
+
height: (2),
|
260
|
+
width: (0, rn_ui_1.dp)(100),
|
261
|
+
backgroundColor: '#fff'
|
262
|
+
},
|
263
|
+
time: {
|
264
|
+
fontSize: (0, rn_ui_1.dp)(12),
|
265
|
+
color: '#fff'
|
266
|
+
},
|
267
|
+
seekRange: {
|
268
|
+
height: (0, rn_ui_1.dp)(50),
|
269
|
+
width: (0, rn_ui_1.dp)(50),
|
270
|
+
borderRadius: (0, rn_ui_1.dp)(25),
|
271
|
+
position: 'absolute',
|
272
|
+
top: (0, rn_ui_1.dp)(-23),
|
273
|
+
right: (0, rn_ui_1.dp)(-25),
|
274
|
+
opacity: 0,
|
275
|
+
zIndex: 999,
|
276
|
+
},
|
277
|
+
seek: {
|
278
|
+
backgroundColor: '#fff',
|
279
|
+
height: (0, rn_ui_1.dp)(12),
|
280
|
+
width: (0, rn_ui_1.dp)(12),
|
281
|
+
borderRadius: (0, rn_ui_1.dp)(6),
|
282
|
+
top: (0, rn_ui_1.dp)(-5),
|
283
|
+
right: (0, rn_ui_1.dp)(-6),
|
284
|
+
position: 'absolute',
|
285
|
+
zIndex: 1,
|
286
|
+
}
|
287
|
+
});
|
288
|
+
exports.default = VideoPlayer;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
export declare const shadowStyle: {
|
2
|
+
shadowColor: string;
|
3
|
+
shadowOffset: {
|
4
|
+
width: number;
|
5
|
+
height: number;
|
6
|
+
};
|
7
|
+
shadowRadius: number;
|
8
|
+
shadowOpacity: number;
|
9
|
+
elevation: number;
|
10
|
+
};
|
11
|
+
export declare const borderStyle: {
|
12
|
+
borderRadius: number;
|
13
|
+
};
|
14
|
+
export declare const plain: {
|
15
|
+
color: string;
|
16
|
+
fontSize: number;
|
17
|
+
paddingHorizontal: number;
|
18
|
+
paddingVertical: number;
|
19
|
+
};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.plain = exports.borderStyle = exports.shadowStyle = void 0;
|
4
|
+
const rn_ui_1 = require("@smart-link/rn-ui");
|
5
|
+
exports.shadowStyle = {
|
6
|
+
shadowColor: 'rgba(0, 0, 0, 0.08)',
|
7
|
+
shadowOffset: {
|
8
|
+
width: 0,
|
9
|
+
height: (0, rn_ui_1.dp)(3),
|
10
|
+
},
|
11
|
+
shadowRadius: (0, rn_ui_1.dp)(3),
|
12
|
+
shadowOpacity: 1,
|
13
|
+
elevation: 1.5,
|
14
|
+
};
|
15
|
+
exports.borderStyle = {
|
16
|
+
borderRadius: (0, rn_ui_1.dp)(5),
|
17
|
+
};
|
18
|
+
exports.plain = {
|
19
|
+
color: '#000',
|
20
|
+
fontSize: (0, rn_ui_1.dp)(14),
|
21
|
+
paddingHorizontal: (0, rn_ui_1.dp)(12),
|
22
|
+
paddingVertical: (0, rn_ui_1.dp)(10),
|
23
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
export declare const defaultAvatars: {
|
2
|
+
MAN: any;
|
3
|
+
WOMAN: any;
|
4
|
+
EMPTY: any;
|
5
|
+
GROUP: any;
|
6
|
+
BUSI_NOTIFY: any;
|
7
|
+
GROUP_OWNER: any;
|
8
|
+
GROUP_MGR: any;
|
9
|
+
};
|
10
|
+
export declare const receiptStatus: {
|
11
|
+
read: any;
|
12
|
+
arrived: any;
|
13
|
+
sent: any;
|
14
|
+
};
|
15
|
+
export declare const messageBackupImg: {
|
16
|
+
cloud: any;
|
17
|
+
cloud_begin: any;
|
18
|
+
};
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.messageBackupImg = exports.receiptStatus = exports.defaultAvatars = void 0;
|
4
|
+
const im_base_1 = require("@smart-link/im-base");
|
5
|
+
exports.defaultAvatars = {
|
6
|
+
MAN: require('../assets/avatars-man.jpg'),
|
7
|
+
WOMAN: require('../assets/avatars-woman.jpg'),
|
8
|
+
EMPTY: require('../assets/avatars-empty.png'),
|
9
|
+
GROUP: require('../assets/avatars-group.jpg'),
|
10
|
+
BUSI_NOTIFY: require('../assets/avatars-busi-notify.png'),
|
11
|
+
GROUP_OWNER: require('../assets/group-owner.png'),
|
12
|
+
GROUP_MGR: require('../assets/group-mgr.png'),
|
13
|
+
};
|
14
|
+
exports.receiptStatus = {
|
15
|
+
[im_base_1.MessageStatus.READ]: require('../assets/hook-blue-double.png'),
|
16
|
+
[im_base_1.MessageStatus.ARRIVED]: require('../assets/hook-black-double.png'),
|
17
|
+
[im_base_1.MessageStatus.EMITTED]: require('../assets/hook-black-double.png'),
|
18
|
+
};
|
19
|
+
exports.messageBackupImg = {
|
20
|
+
cloud: require('../assets/cloud-backup.png'),
|
21
|
+
cloud_begin: require('../assets/cloud-backup-begin.png'),
|
22
|
+
};
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { ITranslationFunc } from '@smart-link/im-base';
|
2
|
+
import { i18n as I18n } from 'i18next';
|
3
|
+
export declare const formatTime: (time: number, t: ITranslationFunc, i18n: I18n, showDetail?: boolean) => string;
|
4
|
+
export default function useFormatMsgTime(time: number | null, showDetail?: boolean): string;
|
@@ -0,0 +1,53 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.formatTime = void 0;
|
7
|
+
const useTranslation_1 = __importDefault(require("./useTranslation"));
|
8
|
+
const isDate = (date) => {
|
9
|
+
if (date === null || date === undefined) {
|
10
|
+
return false;
|
11
|
+
}
|
12
|
+
return !isNaN(new Date(date).getTime());
|
13
|
+
};
|
14
|
+
const formatTime = (time, t, i18n, showDetail = true) => {
|
15
|
+
let date = new Date(time), nowDate = new Date();
|
16
|
+
let nowDay = nowDate.getDate(), nowMonth = nowDate.getMonth() + 1, nowYear = nowDate.getFullYear();
|
17
|
+
let year = date.getFullYear(), hours = date.getHours(), minutes = date.getMinutes(), month = date.getMonth() + 1, days = date.getDate();
|
18
|
+
hours = hours >= 10 ? hours : '0' + hours;
|
19
|
+
minutes = minutes >= 10 ? minutes : '0' + minutes;
|
20
|
+
// const enDay: Record<number, string> = {
|
21
|
+
// 1: '1st',
|
22
|
+
// 2: '2nd',
|
23
|
+
// 3: '3rd',
|
24
|
+
// };
|
25
|
+
if (year === nowYear) {
|
26
|
+
// 今年
|
27
|
+
if (month === nowMonth) {
|
28
|
+
if (days === nowDay) {
|
29
|
+
return `${t('today')} ${showDetail ? ` ${hours}:${minutes}` : ''}`;
|
30
|
+
}
|
31
|
+
if (days + 1 === nowDay) {
|
32
|
+
return `${t('yesterday')} ${showDetail ? ` ${hours}:${minutes}` : ''}`;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
if (i18n.language === 'zh') {
|
36
|
+
return `${month}月${days}日 ${showDetail ? ` ${hours}:${minutes}` : ''}`;
|
37
|
+
}
|
38
|
+
return `${month}/${days} ${showDetail ? ` ${hours}:${minutes}` : ''}`;
|
39
|
+
}
|
40
|
+
if (i18n.language === 'zh') {
|
41
|
+
return `${year}年${month}月${days}日 ${showDetail ? `${hours}:${minutes}` : ''}`;
|
42
|
+
}
|
43
|
+
return `${year}/${month}/${days} ${showDetail ? `${hours}:${minutes}` : ''}`;
|
44
|
+
};
|
45
|
+
exports.formatTime = formatTime;
|
46
|
+
function useFormatMsgTime(time, showDetail = true) {
|
47
|
+
const { t, i18n } = (0, useTranslation_1.default)();
|
48
|
+
if (!isDate(time)) {
|
49
|
+
return '';
|
50
|
+
}
|
51
|
+
return (0, exports.formatTime)(time, t, i18n, showDetail);
|
52
|
+
}
|
53
|
+
exports.default = useFormatMsgTime;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { ChatGroupState, CollectionState, ConversationState, ForwardState, IUser, MessageState, SettingState } from '@smart-link/im-base';
|
2
|
+
import { ContactState, PanelState, VideoState } from '../slice';
|
3
|
+
export declare function useConversation(): ConversationState;
|
4
|
+
export declare function useAvatars(): Record<string, string>;
|
5
|
+
export declare function useMessage(): MessageState;
|
6
|
+
export declare function useAuth(): {
|
7
|
+
user: IUser;
|
8
|
+
};
|
9
|
+
export declare function useVideo(): VideoState;
|
10
|
+
export declare function useCollection(): CollectionState;
|
11
|
+
export declare function useForward(): ForwardState;
|
12
|
+
export declare function useSetting(): SettingState;
|
13
|
+
export declare function useChatGroup(): ChatGroupState;
|
14
|
+
export declare function useContact(): ContactState;
|
15
|
+
export declare function usePanel(): PanelState;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.usePanel = exports.useContact = exports.useChatGroup = exports.useSetting = exports.useForward = exports.useCollection = exports.useVideo = exports.useAuth = exports.useMessage = exports.useAvatars = exports.useConversation = void 0;
|
4
|
+
const react_redux_1 = require("react-redux");
|
5
|
+
function useConversation() {
|
6
|
+
return (0, react_redux_1.useSelector)(state => state['chat/conversation']);
|
7
|
+
}
|
8
|
+
exports.useConversation = useConversation;
|
9
|
+
function useAvatars() {
|
10
|
+
return (0, react_redux_1.useSelector)(state => state['chat/conversation']['avatarsMap']);
|
11
|
+
}
|
12
|
+
exports.useAvatars = useAvatars;
|
13
|
+
function useMessage() {
|
14
|
+
return (0, react_redux_1.useSelector)(state => state['chat/message']);
|
15
|
+
}
|
16
|
+
exports.useMessage = useMessage;
|
17
|
+
function useAuth() {
|
18
|
+
return (0, react_redux_1.useSelector)(state => state.auth);
|
19
|
+
}
|
20
|
+
exports.useAuth = useAuth;
|
21
|
+
function useVideo() {
|
22
|
+
return (0, react_redux_1.useSelector)(state => state['chat/video']);
|
23
|
+
}
|
24
|
+
exports.useVideo = useVideo;
|
25
|
+
function useCollection() {
|
26
|
+
return (0, react_redux_1.useSelector)(state => state['chat/collection']);
|
27
|
+
}
|
28
|
+
exports.useCollection = useCollection;
|
29
|
+
function useForward() {
|
30
|
+
return (0, react_redux_1.useSelector)(state => state['chat/forward']);
|
31
|
+
}
|
32
|
+
exports.useForward = useForward;
|
33
|
+
function useSetting() {
|
34
|
+
return (0, react_redux_1.useSelector)(state => state['chat/setting']);
|
35
|
+
}
|
36
|
+
exports.useSetting = useSetting;
|
37
|
+
function useChatGroup() {
|
38
|
+
return (0, react_redux_1.useSelector)(state => state['chat/group']);
|
39
|
+
}
|
40
|
+
exports.useChatGroup = useChatGroup;
|
41
|
+
function useContact() {
|
42
|
+
return (0, react_redux_1.useSelector)(state => state['chat/contact']);
|
43
|
+
}
|
44
|
+
exports.useContact = useContact;
|
45
|
+
function usePanel() {
|
46
|
+
return (0, react_redux_1.useSelector)(state => state['chat/panel']);
|
47
|
+
}
|
48
|
+
exports.usePanel = usePanel;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { ImLocaleKey } from '@smart-link/im-base';
|
2
|
+
import { i18n } from 'i18next';
|
3
|
+
import { AddressListLocaleKey } from '../locales';
|
4
|
+
export default function useTranslation(): {
|
5
|
+
t: (key: ImLocaleKey, data?: any) => string;
|
6
|
+
i18n: i18n;
|
7
|
+
ready: boolean;
|
8
|
+
};
|
9
|
+
export declare function useTranslationAddrList(): {
|
10
|
+
t: (key: AddressListLocaleKey, data?: any) => string;
|
11
|
+
i18n: i18n;
|
12
|
+
ready: boolean;
|
13
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.useTranslationAddrList = void 0;
|
4
|
+
const react_i18next_1 = require("react-i18next");
|
5
|
+
function useTranslation() {
|
6
|
+
return (0, react_i18next_1.useTranslation)('im');
|
7
|
+
}
|
8
|
+
exports.default = useTranslation;
|
9
|
+
function useTranslationAddrList() {
|
10
|
+
return (0, react_i18next_1.useTranslation)('addressList');
|
11
|
+
}
|
12
|
+
exports.useTranslationAddrList = useTranslationAddrList;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
18
|
+
};
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
20
|
+
exports.ChatAvatar = void 0;
|
21
|
+
__exportStar(require("@smart-link/im-base"), exports);
|
22
|
+
__exportStar(require("./init"), exports);
|
23
|
+
__exportStar(require("./pages"), exports);
|
24
|
+
__exportStar(require("./slice"), exports);
|
25
|
+
__exportStar(require("./locales"), exports);
|
26
|
+
__exportStar(require("./hooks/useImSelector"), exports);
|
27
|
+
var ChatAvatar_1 = require("./components/ChatAvatar/ChatAvatar");
|
28
|
+
Object.defineProperty(exports, "ChatAvatar", { enumerable: true, get: function () { return __importDefault(ChatAvatar_1).default; } });
|
package/dist/init.d.ts
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
import { ImManager, IUser, SocketStore } from '@smart-link/im-base';
|
2
|
+
import { ImageRequireSource } from 'react-native';
|
3
|
+
interface IMSdkOptions {
|
4
|
+
user: IUser;
|
5
|
+
store: SocketStore;
|
6
|
+
storage: Storage;
|
7
|
+
server: string;
|
8
|
+
t: (key: unknown, data?: unknown) => string;
|
9
|
+
undoLimitTime: number;
|
10
|
+
logout: () => Promise<void>;
|
11
|
+
logo: ImageRequireSource;
|
12
|
+
}
|
13
|
+
export declare const initImSdk: ({ user, storage, store, server, logo: outLogo, t, logout, undoLimitTime }: IMSdkOptions) => Promise<ImManager>;
|
14
|
+
export declare const initRequest: (server: string) => void;
|
15
|
+
export declare const getImManager: () => ImManager;
|
16
|
+
export declare const getLogo: () => number;
|
17
|
+
export {};
|