@smart-link/rn-im 1.0.23 → 1.0.26
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/assets/file-dir.jpg +0 -0
- package/dist/api/addressList.js +6 -17
- package/dist/api/backup.js +8 -20
- package/dist/api/file.js +6 -35
- package/dist/api/user.js +6 -16
- package/dist/components/CachedImage.js +14 -42
- package/dist/components/Camera/Camera.js +26 -54
- package/dist/components/Camera/CameraCapture.js +99 -128
- package/dist/components/Camera/CameraResult.js +33 -61
- package/dist/components/ChatAvatar/ChatAvatar.d.ts +1 -1
- package/dist/components/ChatAvatar/ChatAvatar.js +34 -62
- package/dist/components/ChatAvatar/ChatAvatarId.d.ts +2 -2
- package/dist/components/ChatAvatar/ChatAvatarId.js +26 -51
- package/dist/components/ChatAvatar/ChatAvatarLocal.d.ts +2 -2
- package/dist/components/ChatAvatar/ChatAvatarLocal.js +22 -25
- package/dist/components/ChatAvatar/index.js +2 -23
- package/dist/components/Favicon.js +6 -34
- package/dist/components/FormatTimeText.js +5 -10
- package/dist/components/Highlighter.js +9 -34
- package/dist/components/IndicatorText.js +14 -39
- package/dist/components/LocalImage.js +7 -32
- package/dist/components/NetworkUnconnected.js +14 -42
- package/dist/components/PopoverWrapper.js +22 -47
- package/dist/components/VideoPlayer.js +111 -138
- package/dist/components/styles.js +10 -13
- package/dist/default-assets.d.ts +2 -0
- package/dist/default-assets.js +9 -10
- package/dist/hooks/useDownloadSource.js +7 -12
- package/dist/hooks/useFormatMsgTime.js +5 -13
- package/dist/hooks/useImReady.js +7 -10
- package/dist/hooks/useImSelector.js +34 -48
- package/dist/hooks/useTranslation.js +5 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -28
- package/dist/init.js +30 -40
- package/dist/interface.d.ts +9 -0
- package/dist/interface.js +1 -2
- package/dist/locales/en/addressList.js +1 -3
- package/dist/locales/index.js +4 -27
- package/dist/locales/lao/addressList.js +1 -3
- package/dist/locales/zh/addressList.js +1 -3
- package/dist/pages/address-list/AddressList.js +33 -61
- package/dist/pages/address-list/CardInfo.js +10 -18
- package/dist/pages/address-list/ChooseContact.js +50 -78
- package/dist/pages/address-list/Icons.js +7 -14
- package/dist/pages/address-list/Organization.js +59 -89
- package/dist/pages/address-list/UserDetail.js +55 -83
- package/dist/pages/address-list/UserJobs.js +31 -33
- package/dist/pages/address-list/UserSearch.js +29 -54
- package/dist/pages/address-list/addressList.routes.js +11 -16
- package/dist/pages/collection/Collection.js +53 -81
- package/dist/pages/collection/ContentFactory.js +53 -82
- package/dist/pages/collection/collection.routes.js +3 -9
- package/dist/pages/conversation/ForwardToConversation.js +63 -91
- package/dist/pages/conversation/List.js +74 -102
- package/dist/pages/conversation/components/ConversationCard.js +46 -74
- package/dist/pages/conversation/components/ConversationOption.js +27 -55
- package/dist/pages/conversation/conversation.routes.js +17 -23
- package/dist/pages/conversation/setting/GroupTransfer.js +32 -60
- package/dist/pages/conversation/setting/OptionAvatars.d.ts +1 -1
- package/dist/pages/conversation/setting/OptionAvatars.js +62 -90
- package/dist/pages/conversation/setting/OptionCancelGroup.js +14 -42
- package/dist/pages/conversation/setting/OptionConversation.js +20 -48
- package/dist/pages/conversation/setting/OptionGroup.d.ts +1 -1
- package/dist/pages/conversation/setting/OptionGroup.js +20 -48
- package/dist/pages/conversation/setting/OptionGroupManage.js +21 -49
- package/dist/pages/conversation/setting/OptionGroupMoreMember.js +48 -53
- package/dist/pages/conversation/setting/OptionGroupNameOrNoticeEdit.js +49 -77
- package/dist/pages/conversation/setting/Setting.js +50 -56
- package/dist/pages/conversation/setting/SettingChatBg.js +26 -54
- package/dist/pages/index.js +7 -27
- package/dist/pages/message/ChooseMember.js +56 -84
- package/dist/pages/message/FileSelector.d.ts +6 -0
- package/dist/pages/message/FileSelector.js +235 -0
- package/dist/pages/message/MessageBackup/Bar.js +18 -43
- package/dist/pages/message/MessageBackup/MessageBackup.js +42 -72
- package/dist/pages/message/MessageBackup/RestoreBackupPage.js +48 -76
- package/dist/pages/message/MessageBackup/StartBackupPage.js +48 -76
- package/dist/pages/message/MessageBackup/index.js +3 -12
- package/dist/pages/message/MessageBackup/utils.js +14 -22
- package/dist/pages/message/MessageList.js +151 -141
- package/dist/pages/message/MessageRecord.js +74 -87
- package/dist/pages/message/components/BusiNotifyCard.js +60 -85
- package/dist/pages/message/components/ChatBg.js +11 -36
- package/dist/pages/message/components/MessageItem.d.ts +2 -1
- package/dist/pages/message/components/MessageItem.js +85 -112
- package/dist/pages/message/components/MessageItemQuote.js +30 -58
- package/dist/pages/message/components/MessageItemTips.js +27 -55
- package/dist/pages/message/components/MessageOption.d.ts +7 -3
- package/dist/pages/message/components/MessageOption.js +107 -134
- package/dist/pages/message/components/MessagePayload.d.ts +2 -1
- package/dist/pages/message/components/MessagePayload.js +36 -64
- package/dist/pages/message/components/MessagePictureAlbum.js +32 -60
- package/dist/pages/message/components/MessageReceiptStatus.js +18 -43
- package/dist/pages/message/components/MessageUndo.js +18 -48
- package/dist/pages/message/components/MultipleBar/index.js +48 -76
- package/dist/pages/message/components/Payload/PayloadContact.js +30 -58
- package/dist/pages/message/components/Payload/PayloadFile.d.ts +1 -1
- package/dist/pages/message/components/Payload/PayloadFile.js +44 -68
- package/dist/pages/message/components/Payload/PayloadMultiple.js +46 -70
- package/dist/pages/message/components/Payload/PayloadNotify.js +28 -56
- package/dist/pages/message/components/Payload/PayloadPicture.d.ts +1 -1
- package/dist/pages/message/components/Payload/PayloadPicture.js +21 -50
- package/dist/pages/message/components/Payload/PayloadShare.js +39 -67
- package/dist/pages/message/components/Payload/PayloadText.js +39 -67
- package/dist/pages/message/components/Payload/PayloadVideo.js +30 -57
- package/dist/pages/message/components/Payload/PayloadVoice.js +80 -93
- package/dist/pages/message/components/Payload/PayloadWrapper.d.ts +2 -1
- package/dist/pages/message/components/Payload/PayloadWrapper.js +24 -44
- package/dist/pages/message/components/Payload/type.d.ts +2 -1
- package/dist/pages/message/components/Payload/type.js +1 -2
- package/dist/pages/message/components/ReceiptBack.js +30 -60
- package/dist/pages/message/components/TextMixMessage.js +13 -38
- package/dist/pages/message/components/TextMixQuote.js +128 -162
- package/dist/pages/message/components/TextMixQuoteMessage.js +19 -47
- package/dist/pages/message/components/UploadProgress.js +12 -37
- package/dist/pages/message/components/messageBar/EmojiPanel.js +25 -50
- package/dist/pages/message/components/messageBar/Icons.js +56 -74
- package/dist/pages/message/components/messageBar/MessageBar.js +84 -115
- package/dist/pages/message/components/messageBar/MessageInput.js +30 -55
- package/dist/pages/message/components/messageBar/OptionPanel.js +54 -107
- package/dist/pages/message/components/messageBar/VoiceBar.js +122 -100
- package/dist/pages/message/components/messageBar/index.js +2 -23
- package/dist/pages/message/message.routes.js +21 -40
- package/dist/pages/search/Search.js +38 -66
- package/dist/pages/search/SearchChatRecords.js +64 -92
- package/dist/pages/search/SearchFile.js +68 -96
- package/dist/pages/search/SearchManager.js +60 -65
- package/dist/pages/search/SearchPicturePage.js +16 -44
- package/dist/pages/search/components/ChatRecords.js +46 -74
- package/dist/pages/search/components/MyGroupChat.js +41 -69
- package/dist/pages/search/components/PictureMulipleBar.js +35 -63
- package/dist/pages/search/components/SearchFileList.js +59 -64
- package/dist/pages/search/components/SearchPictures.js +68 -98
- package/dist/pages/search/components/SearchShareLinkList.js +50 -55
- package/dist/pages/search/components/SearchUser.js +25 -53
- package/dist/pages/search/components/useSearchMessage.js +12 -16
- package/dist/pages/search/search.routes.js +11 -17
- package/dist/pages/search/utils.js +4 -12
- package/dist/pages/types.d.ts +4 -2
- package/dist/pages/types.js +1 -2
- package/dist/slice/contact/contact.slice.js +4 -8
- package/dist/slice/index.js +7 -13
- package/dist/slice/panel/panel.slice.d.ts +2 -1
- package/dist/slice/panel/panel.slice.js +8 -7
- package/dist/slice/video/video.action.d.ts +1 -0
- package/dist/slice/video/video.action.js +64 -38
- package/dist/slice/video/video.slice.d.ts +1 -1
- package/dist/slice/video/video.slice.js +7 -8
- package/dist/utils/audio.d.ts +3 -0
- package/dist/utils/audio.js +10 -0
- package/dist/utils/color.js +2 -9
- package/dist/utils/common-action-sheet.js +9 -14
- package/dist/utils/cookie.js +6 -14
- package/dist/utils/emoji.js +9 -12
- package/dist/utils/file-icon.js +33 -60
- package/dist/utils/file-operate.js +1 -2
- package/dist/utils/file.d.ts +10 -2
- package/dist/utils/file.js +188 -88
- package/dist/utils/golden-rectangle.js +3 -7
- package/dist/utils/phone.js +13 -22
- package/dist/utils/request.js +7 -15
- package/dist/utils/scroll.js +5 -9
- package/dist/utils/summary.js +4 -11
- package/dist/utils/take-camera.js +12 -19
- package/dist/utils/text-mix.js +4 -11
- package/dist/utils/upload.js +20 -41
- package/package.json +6 -7
- package/dist/slice/contact/contact.action.d.ts +0 -1
- package/dist/slice/contact/contact.action.js +0 -2
package/dist/utils/request.js
CHANGED
@@ -1,11 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.createRequest = exports.getBaseURL = exports.Headers = void 0;
|
7
|
-
const axios_1 = __importDefault(require("axios"));
|
8
|
-
exports.Headers = {
|
1
|
+
import axios from 'axios';
|
2
|
+
export const Headers = {
|
9
3
|
json: {
|
10
4
|
'Content-Type': 'application/json;utf-8',
|
11
5
|
},
|
@@ -18,11 +12,10 @@ exports.Headers = {
|
|
18
12
|
};
|
19
13
|
let instance = null;
|
20
14
|
let baseURL = '';
|
21
|
-
const getBaseURL = () => baseURL;
|
22
|
-
|
23
|
-
const createRequest = (base) => {
|
15
|
+
export const getBaseURL = () => baseURL;
|
16
|
+
export const createRequest = (base) => {
|
24
17
|
baseURL = base;
|
25
|
-
instance =
|
18
|
+
instance = axios.create({
|
26
19
|
baseURL: base,
|
27
20
|
timeout: 10000,
|
28
21
|
headers: {
|
@@ -50,9 +43,8 @@ const createRequest = (base) => {
|
|
50
43
|
});
|
51
44
|
return instance;
|
52
45
|
};
|
53
|
-
exports.createRequest = createRequest;
|
54
46
|
const request = (url, data, method = 'post', contentType = 'json', config) => {
|
55
|
-
return instance.request(Object.assign(Object.assign({ url, data: contentType !== 'form' ? data : null, method, params: contentType === 'form' ? data : null }, config), { headers: Object.assign(Object.assign({},
|
47
|
+
return instance.request(Object.assign(Object.assign({ url, data: contentType !== 'form' ? data : null, method, params: contentType === 'form' ? data : null }, config), { headers: Object.assign(Object.assign({}, Headers[contentType]), config === null || config === void 0 ? void 0 : config.headers) }));
|
56
48
|
};
|
57
49
|
request.get = (url, data, config) => request(url, data, 'get', 'form', config);
|
58
50
|
request.post = (url, data, config) => {
|
@@ -64,4 +56,4 @@ request.postForm = (url, data, config) => {
|
|
64
56
|
request.postFile = (url, data, config) => {
|
65
57
|
return request(url, data, 'post', 'multipart', config);
|
66
58
|
};
|
67
|
-
|
59
|
+
export default request;
|
package/dist/utils/scroll.js
CHANGED
@@ -1,12 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
const react_native_1 = require("react-native");
|
6
|
-
const scrollToBottom = (animated = true) => {
|
7
|
-
react_native_1.InteractionManager.runAfterInteractions(() => {
|
1
|
+
import { getImManager } from '../init';
|
2
|
+
import { InteractionManager } from 'react-native';
|
3
|
+
export const scrollToBottom = (animated = true) => {
|
4
|
+
InteractionManager.runAfterInteractions(() => {
|
8
5
|
var _a, _b, _c;
|
9
|
-
(_c = (_b = (_a =
|
6
|
+
(_c = (_b = (_a = getImManager()) === null || _a === void 0 ? void 0 : _a.flatListRef) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.scrollToOffset({ animated, offset: 0 });
|
10
7
|
});
|
11
8
|
};
|
12
|
-
exports.scrollToBottom = scrollToBottom;
|
package/dist/utils/summary.js
CHANGED
@@ -1,12 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.getSummary = void 0;
|
7
|
-
const react_native_1 = require("react-native");
|
8
|
-
const react_1 = __importDefault(require("react"));
|
9
|
-
function getSummary(text, searchKey, summaryLength = 15, color = 'red') {
|
1
|
+
import { Text } from "react-native";
|
2
|
+
import React from 'react';
|
3
|
+
export function getSummary(text, searchKey, summaryLength = 15, color = 'red') {
|
10
4
|
if (!text) {
|
11
5
|
return;
|
12
6
|
}
|
@@ -35,8 +29,7 @@ function getSummary(text, searchKey, summaryLength = 15, color = 'red') {
|
|
35
29
|
else {
|
36
30
|
result.push(text.substring(0, index));
|
37
31
|
}
|
38
|
-
result.push(<
|
32
|
+
result.push(<Text key={result.length} style={{ color }}>{text.substr(index, searchLength)}</Text>);
|
39
33
|
result.push(text.substring(index + searchLength, textLength));
|
40
34
|
return result;
|
41
35
|
}
|
42
|
-
exports.getSummary = getSummary;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
"use strict";
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
@@ -8,29 +7,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
8
|
});
|
10
9
|
};
|
11
|
-
|
12
|
-
|
13
|
-
};
|
14
|
-
|
15
|
-
exports.takeCamera = void 0;
|
16
|
-
const react_1 = __importDefault(require("react"));
|
17
|
-
const Camera_1 = __importDefault(require("../components/Camera/Camera"));
|
18
|
-
const rn_ui_1 = require("@smart-link/rn-ui");
|
19
|
-
const init_1 = require("../init");
|
10
|
+
import React from 'react';
|
11
|
+
import Camera from '../components/Camera/Camera';
|
12
|
+
import { TopViewGetInstance } from '@smart-link/rn-ui';
|
13
|
+
import { getImManager } from "../init";
|
20
14
|
let topKey = 0;
|
21
|
-
const takeCamera = (conversation) => __awaiter(void 0, void 0, void 0, function* () {
|
15
|
+
export const takeCamera = (conversation) => __awaiter(void 0, void 0, void 0, function* () {
|
22
16
|
return new Promise((resolve, reject) => {
|
23
|
-
|
24
|
-
.add(<
|
25
|
-
|
26
|
-
|
17
|
+
TopViewGetInstance()
|
18
|
+
.add(<Camera horizontal={false} finishTakePicture={(picData) => {
|
19
|
+
getImManager().sendPictureMessage(Object.assign({}, conversation), picData);
|
20
|
+
TopViewGetInstance().remove(topKey);
|
27
21
|
resolve();
|
28
22
|
}} finishTakeRecord={(videoData) => {
|
29
|
-
|
30
|
-
|
23
|
+
getImManager().sendVideoMessage(Object.assign({}, conversation), videoData);
|
24
|
+
TopViewGetInstance().remove(topKey);
|
31
25
|
resolve();
|
32
26
|
}} cancelCamera={() => {
|
33
|
-
|
27
|
+
TopViewGetInstance().remove(topKey);
|
34
28
|
reject('cancel');
|
35
29
|
}}/>)
|
36
30
|
.then(id => {
|
@@ -38,4 +32,3 @@ const takeCamera = (conversation) => __awaiter(void 0, void 0, void 0, function*
|
|
38
32
|
});
|
39
33
|
});
|
40
34
|
});
|
41
|
-
exports.takeCamera = takeCamera;
|
package/dist/utils/text-mix.js
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.mix = exports.mixWithReg = exports.mixUrl = exports.mixPhone = void 0;
|
4
1
|
// export function mixEmoji(text: string, textEmojiItems: TextItem[]) {
|
5
2
|
// if (!text || text.length === 0) {
|
6
3
|
// return;
|
@@ -27,17 +24,15 @@ exports.mix = exports.mixWithReg = exports.mixUrl = exports.mixPhone = void 0;
|
|
27
24
|
// text = ' ' + text.substring(rightIndex + 1);
|
28
25
|
// mixEmoji(text, textEmojiItems);
|
29
26
|
// }
|
30
|
-
function mixPhone(text) {
|
27
|
+
export function mixPhone(text) {
|
31
28
|
const phoneReg = /(1[\d]{10}|0\d{2,3}-\d{7,8}|400-?\d{3}-?\d{4})/g;
|
32
29
|
return mixWithReg(text, 'phone', phoneReg);
|
33
30
|
}
|
34
|
-
|
35
|
-
function mixUrl(text) {
|
31
|
+
export function mixUrl(text) {
|
36
32
|
let urlReg = /(https?|http|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/g;
|
37
33
|
return mixWithReg(text, 'url', urlReg);
|
38
34
|
}
|
39
|
-
|
40
|
-
function mixWithReg(text, type, reg) {
|
35
|
+
export function mixWithReg(text, type, reg) {
|
41
36
|
const items = [];
|
42
37
|
const tags = text.match(reg);
|
43
38
|
tags && tags.forEach(tag => {
|
@@ -52,8 +47,7 @@ function mixWithReg(text, type, reg) {
|
|
52
47
|
items.push({ type: 'text', value: text });
|
53
48
|
return items;
|
54
49
|
}
|
55
|
-
|
56
|
-
function mix(text) {
|
50
|
+
export function mix(text) {
|
57
51
|
const viewItems = [];
|
58
52
|
if (!text || text === '') {
|
59
53
|
return viewItems;
|
@@ -79,4 +73,3 @@ function mix(text) {
|
|
79
73
|
});
|
80
74
|
return viewItems;
|
81
75
|
}
|
82
|
-
exports.mix = mix;
|
package/dist/utils/upload.js
CHANGED
@@ -1,27 +1,3 @@
|
|
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
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
26
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
27
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
@@ -31,27 +7,30 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
31
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
32
8
|
});
|
33
9
|
};
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
10
|
+
import { backgroundUpload, UploadType } from 'react-native-compressor';
|
11
|
+
import { getCookieString } from './cookie';
|
12
|
+
import request, { getBaseURL } from './request';
|
13
|
+
import { Platform } from 'react-native';
|
14
|
+
import { toAbsolutePath } from './file';
|
15
|
+
import { throttle } from "lodash-es";
|
40
16
|
const uploadFile = (filePath, type, onProgress) => __awaiter(void 0, void 0, void 0, function* () {
|
41
|
-
const url =
|
17
|
+
const url = getBaseURL();
|
42
18
|
const uploadUrl = `${url}/api-file/file/uploadFile`;
|
43
|
-
const cookies = yield
|
44
|
-
|
45
|
-
|
19
|
+
const cookies = yield getCookieString();
|
20
|
+
const throttledFn = throttle((o) => {
|
21
|
+
onProgress === null || onProgress === void 0 ? void 0 : onProgress(o);
|
22
|
+
}, 500);
|
23
|
+
if (Platform.OS === 'android') {
|
24
|
+
const resp = yield backgroundUpload(uploadUrl, toAbsolutePath(filePath), {
|
46
25
|
httpMethod: 'POST',
|
47
|
-
uploadType:
|
26
|
+
uploadType: UploadType.MULTIPART,
|
48
27
|
headers: {
|
49
28
|
Cookie: cookies,
|
50
29
|
accept: 'application/json',
|
51
30
|
},
|
52
31
|
}, (written, total) => {
|
53
|
-
console.log('uploadFile progress: ', written, total);
|
54
|
-
|
32
|
+
// console.log('uploadFile progress: ', written, total);
|
33
|
+
throttledFn({ loaded: written, total });
|
55
34
|
});
|
56
35
|
console.log('uploadFile: ', resp);
|
57
36
|
try {
|
@@ -72,15 +51,15 @@ const uploadFile = (filePath, type, onProgress) => __awaiter(void 0, void 0, voi
|
|
72
51
|
const formData = new FormData();
|
73
52
|
formData.append('file', {
|
74
53
|
// @ts-ignore
|
75
|
-
uri:
|
54
|
+
uri: toAbsolutePath(filePath),
|
76
55
|
name: filePath.split('/').pop(),
|
77
56
|
type: type,
|
78
57
|
});
|
79
|
-
const resp = yield
|
80
|
-
onUploadProgress:
|
58
|
+
const resp = yield request.postFile(uploadUrl, formData, {
|
59
|
+
onUploadProgress: throttledFn,
|
81
60
|
});
|
82
61
|
console.log('uploadFile: ', resp);
|
83
62
|
return resp.data;
|
84
63
|
}
|
85
64
|
});
|
86
|
-
|
65
|
+
export default uploadFile;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@smart-link/rn-im",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.26",
|
4
4
|
"description": "",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"dependencies": {
|
@@ -15,10 +15,8 @@
|
|
15
15
|
"@types/react": "^18.2.0",
|
16
16
|
"@types/react-native-sqlite-storage": "^6.0.1",
|
17
17
|
"@types/react-native-video": "5.0.19",
|
18
|
-
"concurrently": "^9.1.0",
|
19
18
|
"eslint-plugin-jest": "^26.5.3",
|
20
19
|
"rimraf": "^6.0.1",
|
21
|
-
"tsc-alias": "^1.8.10",
|
22
20
|
"typescript": "5.0.4",
|
23
21
|
"react-native": "^0.73.0",
|
24
22
|
"redux": "^4.2.1"
|
@@ -44,7 +42,7 @@
|
|
44
42
|
"react": "18.2.0",
|
45
43
|
"react-i18next": "^13.2.0",
|
46
44
|
"react-native": "^0.73.0",
|
47
|
-
"react-native-audio-recorder-player": "3.6.
|
45
|
+
"react-native-audio-recorder-player": "3.6.14",
|
48
46
|
"react-native-image-crop-picker": "0.42.0",
|
49
47
|
"react-native-compressor": "1.10.5",
|
50
48
|
"react-native-contacts": "^8.0.5",
|
@@ -54,6 +52,7 @@
|
|
54
52
|
"react-native-permissions": "5.3.0",
|
55
53
|
"react-native-progress": "5.0.1",
|
56
54
|
"react-native-sqlite-storage": "6.0.1",
|
55
|
+
"react-native-sound": "0.11.2",
|
57
56
|
"react-native-svg": "14.1.0",
|
58
57
|
"react-native-vector-icons": "10.0.0",
|
59
58
|
"react-native-video": "5.2.1",
|
@@ -64,7 +63,7 @@
|
|
64
63
|
"redux": "^4.2.1",
|
65
64
|
"redux-thunk": "^2.4.2",
|
66
65
|
"@smart-link/rn-ui": "^1.0.6",
|
67
|
-
"@smart-link/im-base": "^1.0.
|
66
|
+
"@smart-link/im-base": "^1.0.26"
|
68
67
|
},
|
69
68
|
"files": [
|
70
69
|
"dist/**",
|
@@ -73,8 +72,8 @@
|
|
73
72
|
],
|
74
73
|
"scripts": {
|
75
74
|
"clean": "rimraf ./dist",
|
76
|
-
"build": "pnpm run clean && tsc
|
77
|
-
"build:watch": "tsc
|
75
|
+
"build": "pnpm run clean && tsc",
|
76
|
+
"build:watch": "tsc -w",
|
78
77
|
"release": "pnpm build && pnpm publish --tag latest --access public --no-git-checks"
|
79
78
|
}
|
80
79
|
}
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|