@smart-link/rn-im 1.0.24 → 1.1.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/assets/file-dir.jpg +0 -0
- package/dist/api/addressList.d.ts +16 -15
- package/dist/api/addressList.js +15 -1
- package/dist/api/user.js +1 -1
- package/dist/components/Camera/Camera.js +3 -2
- package/dist/components/Camera/CameraCapture.js +61 -12
- package/dist/components/ChatAvatar/ChatAvatar.d.ts +3 -3
- package/dist/components/ChatAvatar/ChatAvatar.js +51 -49
- package/dist/components/ChatAvatar/ChatAvatarId.d.ts +2 -2
- package/dist/components/ChatAvatar/ChatAvatarId.js +19 -46
- package/dist/components/ChatAvatar/ChatAvatarLocal.js +22 -10
- package/dist/components/Favicon.js +1 -1
- package/dist/components/LocalImage.js +3 -1
- package/dist/components/styles.d.ts +7 -1
- package/dist/components/styles.js +16 -11
- package/dist/default-assets.d.ts +1 -0
- package/dist/default-assets.js +1 -0
- package/dist/hooks/useAnimatedValue.d.ts +2 -0
- package/dist/hooks/useAnimatedValue.js +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/init.d.ts +2 -2
- package/dist/init.js +8 -5
- package/dist/interface.d.ts +15 -0
- package/dist/pages/address-list/AddressList.js +22 -40
- package/dist/pages/address-list/ChooseContact.js +209 -45
- package/dist/pages/address-list/MyGroups.d.ts +6 -0
- package/dist/pages/address-list/MyGroups.js +90 -0
- package/dist/pages/address-list/Organization.d.ts +0 -7
- package/dist/pages/address-list/Organization.js +24 -108
- package/dist/pages/address-list/UserDetail.js +5 -5
- package/dist/pages/address-list/UserSearch.js +6 -7
- package/dist/pages/address-list/addressList.routes.d.ts +9 -0
- package/dist/pages/address-list/addressList.routes.js +8 -0
- package/dist/pages/address-list/components/Icons.d.ts +8 -0
- package/dist/pages/address-list/components/Icons.js +15 -0
- package/dist/pages/address-list/components/OrgPath.d.ts +12 -0
- package/dist/pages/address-list/components/OrgPath.js +59 -0
- package/dist/pages/address-list/components/RenderUserItem.d.ts +9 -0
- package/dist/pages/address-list/components/RenderUserItem.js +14 -0
- package/dist/pages/address-list/{UserJobs.js → components/UserJobs.js} +2 -2
- package/dist/pages/address-list/useGroupCategory.d.ts +2 -0
- package/dist/pages/address-list/useGroupCategory.js +11 -0
- package/dist/pages/address-list/useRoleList.d.ts +2 -0
- package/dist/pages/address-list/useRoleList.js +11 -0
- package/dist/pages/collection/Collection.js +52 -8
- package/dist/pages/collection/ContentFactory.js +50 -3
- package/dist/pages/conversation/ForwardToConversation.js +4 -2
- package/dist/pages/conversation/List.js +15 -7
- package/dist/pages/conversation/components/ConversationCard.js +1 -7
- package/dist/pages/conversation/setting/OptionAvatars.d.ts +1 -1
- package/dist/pages/conversation/setting/OptionAvatars.js +0 -1
- package/dist/pages/conversation/setting/OptionGroup.d.ts +2 -2
- package/dist/pages/conversation/setting/OptionGroup.js +4 -4
- package/dist/pages/conversation/setting/OptionGroupManage.js +4 -8
- package/dist/pages/conversation/setting/OptionGroupMoreMember.js +37 -18
- package/dist/pages/conversation/setting/Setting.js +5 -5
- package/dist/pages/conversation/setting/SettingChatBg.js +32 -16
- package/dist/pages/message/ChooseMember.js +2 -2
- package/dist/pages/message/FileSelector.d.ts +6 -0
- package/dist/pages/message/FileSelector.js +272 -0
- package/dist/pages/message/MessageList.js +81 -43
- package/dist/pages/message/MessageRecord.js +34 -23
- package/dist/pages/message/components/MessageItem.d.ts +7 -7
- package/dist/pages/message/components/MessageItem.js +29 -20
- package/dist/pages/message/components/MessageOption.d.ts +7 -3
- package/dist/pages/message/components/MessageOption.js +14 -16
- package/dist/pages/message/components/MessagePayload.d.ts +2 -1
- package/dist/pages/message/components/MessagePictureAlbum.js +6 -4
- package/dist/pages/message/components/Payload/PayloadFile.d.ts +1 -1
- package/dist/pages/message/components/Payload/PayloadFile.js +34 -16
- package/dist/pages/message/components/Payload/PayloadMultiple.js +12 -8
- package/dist/pages/message/components/Payload/PayloadNotify.js +14 -5
- package/dist/pages/message/components/Payload/PayloadPicture.d.ts +1 -1
- package/dist/pages/message/components/Payload/PayloadPicture.js +9 -7
- package/dist/pages/message/components/Payload/PayloadText.js +7 -8
- package/dist/pages/message/components/Payload/PayloadVideo.js +2 -1
- package/dist/pages/message/components/Payload/PayloadVoice.js +7 -13
- package/dist/pages/message/components/Payload/PayloadWrapper.d.ts +2 -1
- package/dist/pages/message/components/Payload/PayloadWrapper.js +46 -20
- package/dist/pages/message/components/Payload/type.d.ts +3 -1
- package/dist/pages/message/components/ReceiptBack.js +2 -2
- package/dist/pages/message/components/TextMixMessage.d.ts +2 -0
- package/dist/pages/message/components/TextMixMessage.js +10 -3
- package/dist/pages/message/components/TextMixQuote.js +10 -15
- package/dist/pages/message/components/TextMixQuoteMessage.d.ts +2 -1
- package/dist/pages/message/components/TextMixQuoteMessage.js +5 -5
- package/dist/pages/message/components/UploadProgress.d.ts +1 -1
- package/dist/pages/message/components/UploadProgress.js +1 -1
- package/dist/pages/message/components/messageBar/EmojiPanel.js +8 -9
- package/dist/pages/message/components/messageBar/MessageBar.d.ts +1 -1
- package/dist/pages/message/components/messageBar/MessageBar.js +14 -12
- package/dist/pages/message/components/messageBar/MessageInput.d.ts +1 -0
- package/dist/pages/message/components/messageBar/MessageInput.js +19 -1
- package/dist/pages/message/components/messageBar/OptionPanel.js +22 -44
- package/dist/pages/message/message.routes.js +10 -0
- package/dist/pages/search/components/SearchUser.js +2 -2
- package/dist/pages/types.d.ts +6 -2
- package/dist/slice/contact/contact.slice.js +1 -0
- package/dist/slice/video/video.action.js +9 -1
- package/dist/utils/common-action-sheet.d.ts +1 -0
- package/dist/utils/common-action-sheet.js +18 -0
- package/dist/utils/file-icon.js +29 -2
- package/dist/utils/file.d.ts +21 -2
- package/dist/utils/file.js +209 -42
- package/dist/utils/phone.d.ts +1 -1
- package/dist/utils/phone.js +1 -9
- package/dist/utils/request.d.ts +2 -1
- package/dist/utils/request.js +17 -6
- package/dist/utils/upload.d.ts +2 -4
- package/dist/utils/upload.js +13 -49
- package/package.json +5 -5
- package/dist/pages/address-list/Icons.d.ts +0 -5
- package/dist/pages/address-list/Icons.js +0 -9
- package/dist/slice/contact/contact.action.d.ts +0 -1
- package/dist/slice/contact/contact.action.js +0 -1
- package/dist/utils/cookie.d.ts +0 -2
- package/dist/utils/cookie.js +0 -25
- package/dist/utils/file-operate.d.ts +0 -1
- package/dist/utils/file-operate.js +0 -3
- package/dist/utils/text-mix.d.ts +0 -9
- package/dist/utils/text-mix.js +0 -75
- /package/dist/pages/address-list/{CardInfo.d.ts → components/CardInfo.d.ts} +0 -0
- /package/dist/pages/address-list/{CardInfo.js → components/CardInfo.js} +0 -0
- /package/dist/pages/address-list/{UserJobs.d.ts → components/UserJobs.d.ts} +0 -0
package/dist/utils/upload.js
CHANGED
|
@@ -7,59 +7,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { backgroundUpload, UploadType } from 'react-native-compressor';
|
|
11
|
-
import { getCookieString } from './cookie';
|
|
12
10
|
import request, { getBaseURL } from './request';
|
|
13
|
-
import { Platform } from 'react-native';
|
|
14
11
|
import { toAbsolutePath } from './file';
|
|
15
|
-
import { throttle } from "lodash-es";
|
|
16
12
|
const uploadFile = (filePath, type, onProgress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
13
|
const url = getBaseURL();
|
|
18
14
|
const uploadUrl = `${url}/api-file/file/uploadFile`;
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// console.log('uploadFile progress: ', written, total);
|
|
33
|
-
throttledFn({ loaded: written, total });
|
|
34
|
-
});
|
|
35
|
-
console.log('uploadFile: ', resp);
|
|
36
|
-
try {
|
|
37
|
-
let body = JSON.parse(resp.body);
|
|
38
|
-
if (body.data) {
|
|
39
|
-
return body.data;
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
throw new Error(body.codeMsg);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
catch (e) {
|
|
46
|
-
console.log('uploadFile error: ', e);
|
|
47
|
-
throw e;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
const formData = new FormData();
|
|
52
|
-
formData.append('file', {
|
|
53
|
-
// @ts-ignore
|
|
54
|
-
uri: toAbsolutePath(filePath),
|
|
55
|
-
name: filePath.split('/').pop(),
|
|
56
|
-
type: type,
|
|
57
|
-
});
|
|
58
|
-
const resp = yield request.postFile(uploadUrl, formData, {
|
|
59
|
-
onUploadProgress: throttledFn,
|
|
60
|
-
});
|
|
61
|
-
console.log('uploadFile: ', resp);
|
|
62
|
-
return resp.data;
|
|
63
|
-
}
|
|
15
|
+
const formData = new FormData();
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
formData.append('file', {
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
uri: toAbsolutePath(filePath),
|
|
20
|
+
name: filePath.split('/').pop(),
|
|
21
|
+
type: type,
|
|
22
|
+
});
|
|
23
|
+
const resp = yield request.postFile(uploadUrl, formData, {
|
|
24
|
+
onUploadProgress: onProgress,
|
|
25
|
+
});
|
|
26
|
+
console.log('uploadFile: ', resp);
|
|
27
|
+
return resp.data;
|
|
64
28
|
});
|
|
65
29
|
export default uploadFile;
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smart-link/rn-im",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"color": "^5.0.0",
|
|
8
8
|
"lodash-es": "^4.17.21",
|
|
9
|
-
"emoji-regex": "^10.4.0"
|
|
9
|
+
"emoji-regex": "^10.4.0",
|
|
10
|
+
"await-to-js": "^3.0.0"
|
|
10
11
|
},
|
|
11
12
|
"devDependencies": {
|
|
12
13
|
"@react-native/eslint-config": "0.73.2",
|
|
@@ -23,7 +24,6 @@
|
|
|
23
24
|
},
|
|
24
25
|
"peerDependencies": {
|
|
25
26
|
"@baronha/react-native-photo-editor": "1.1.6",
|
|
26
|
-
"@react-native-async-storage/async-storage": "1.24.0",
|
|
27
27
|
"@react-native-camera-roll/camera-roll": "7.10.0",
|
|
28
28
|
"@react-native-clipboard/clipboard": "1.16.2",
|
|
29
29
|
"@react-native-community/netinfo": "11.4.1",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"react-redux": "^8.1.3",
|
|
63
63
|
"redux": "^4.2.1",
|
|
64
64
|
"redux-thunk": "^2.4.2",
|
|
65
|
-
"@smart-link/rn-ui": "^1.0
|
|
66
|
-
"@smart-link/im-base": "^1.
|
|
65
|
+
"@smart-link/rn-ui": "^1.1.0",
|
|
66
|
+
"@smart-link/im-base": "^1.1.1"
|
|
67
67
|
},
|
|
68
68
|
"files": [
|
|
69
69
|
"dist/**",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { dp } from '@smart-link/rn-ui';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Svg, Path } from 'react-native-svg';
|
|
4
|
-
export const Unfold = (props) => {
|
|
5
|
-
const { size = 32, color } = props || {};
|
|
6
|
-
return (<Svg viewBox="0 0 1024 1024" width={dp(size)} height={dp(size)}>
|
|
7
|
-
<Path d="M832 800H256a32 32 0 0 1-32-32V192a32 32 0 0 1 64 0v544h544a32 32 0 1 1 0 64z" fill={color}/>
|
|
8
|
-
</Svg>);
|
|
9
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/utils/cookie.d.ts
DELETED
package/dist/utils/cookie.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { getBaseURL } from '../utils/request';
|
|
11
|
-
import CookieManager from '@react-native-cookies/cookies';
|
|
12
|
-
let cookiesStr = '';
|
|
13
|
-
export const getCookieString = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
-
if (cookiesStr)
|
|
15
|
-
return cookiesStr;
|
|
16
|
-
const url = getBaseURL();
|
|
17
|
-
const cookies = yield CookieManager.get(url);
|
|
18
|
-
cookiesStr = Object.keys(cookies).map((key) => {
|
|
19
|
-
return `${key}=${cookies[key].value}`;
|
|
20
|
-
}).join(';');
|
|
21
|
-
return cookiesStr;
|
|
22
|
-
});
|
|
23
|
-
export const clearCookies = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
cookiesStr = '';
|
|
25
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/utils/text-mix.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type TextType = 'text' | 'phone' | 'url';
|
|
2
|
-
export type TextItem = {
|
|
3
|
-
type: TextType;
|
|
4
|
-
value: string;
|
|
5
|
-
};
|
|
6
|
-
export declare function mixPhone(text: string): TextItem[];
|
|
7
|
-
export declare function mixUrl(text: string): TextItem[];
|
|
8
|
-
export declare function mixWithReg(text: string, type: TextType, reg: RegExp): TextItem[];
|
|
9
|
-
export declare function mix(text: string): TextItem[];
|
package/dist/utils/text-mix.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
// export function mixEmoji(text: string, textEmojiItems: TextItem[]) {
|
|
2
|
-
// if (!text || text.length === 0) {
|
|
3
|
-
// return;
|
|
4
|
-
// }
|
|
5
|
-
//
|
|
6
|
-
// let leftIndex = text.indexOf('[');
|
|
7
|
-
// let rightIndex = text.indexOf(']');
|
|
8
|
-
//
|
|
9
|
-
// if (leftIndex < 0 || rightIndex < 0) {
|
|
10
|
-
// textEmojiItems.push({type: 'text', value: text});
|
|
11
|
-
// return;
|
|
12
|
-
// }
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
// let leftText = text.substring(0, leftIndex);
|
|
16
|
-
// if(textEmojiItems.length > 0 && (leftText.length === 0 || leftText.lastIndexOf(' ') !== leftText.length -1)){
|
|
17
|
-
// leftText = leftText +' ';
|
|
18
|
-
// }
|
|
19
|
-
// textEmojiItems.push({type: 'text', value: leftText });
|
|
20
|
-
//
|
|
21
|
-
// const emoji = text.substring(leftIndex + 1, rightIndex);
|
|
22
|
-
// textEmojiItems.push({type: 'emoji', value: emoji});
|
|
23
|
-
//
|
|
24
|
-
// text = ' ' + text.substring(rightIndex + 1);
|
|
25
|
-
// mixEmoji(text, textEmojiItems);
|
|
26
|
-
// }
|
|
27
|
-
export function mixPhone(text) {
|
|
28
|
-
const phoneReg = /(1[\d]{10}|0\d{2,3}-\d{7,8}|400-?\d{3}-?\d{4})/g;
|
|
29
|
-
return mixWithReg(text, 'phone', phoneReg);
|
|
30
|
-
}
|
|
31
|
-
export function mixUrl(text) {
|
|
32
|
-
let urlReg = /(https?|http|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/g;
|
|
33
|
-
return mixWithReg(text, 'url', urlReg);
|
|
34
|
-
}
|
|
35
|
-
export function mixWithReg(text, type, reg) {
|
|
36
|
-
const items = [];
|
|
37
|
-
const tags = text.match(reg);
|
|
38
|
-
tags && tags.forEach(tag => {
|
|
39
|
-
let leftIndex = text.indexOf(tag);
|
|
40
|
-
let rightIndex = leftIndex + tag.length;
|
|
41
|
-
const leftText = text.substring(0, leftIndex);
|
|
42
|
-
items.push({ type: 'text', value: leftText + '' });
|
|
43
|
-
const tagText = text.substring(leftIndex, rightIndex);
|
|
44
|
-
items.push({ type: type, value: tagText });
|
|
45
|
-
text = '' + text.substring(rightIndex);
|
|
46
|
-
});
|
|
47
|
-
items.push({ type: 'text', value: text });
|
|
48
|
-
return items;
|
|
49
|
-
}
|
|
50
|
-
export function mix(text) {
|
|
51
|
-
const viewItems = [];
|
|
52
|
-
if (!text || text === '') {
|
|
53
|
-
return viewItems;
|
|
54
|
-
}
|
|
55
|
-
mixUrl(text).forEach(textUrlItem => {
|
|
56
|
-
if (textUrlItem.type === 'text') {
|
|
57
|
-
mixPhone(textUrlItem.value).forEach(textPhoneItem => {
|
|
58
|
-
// if (textPhoneItem.type === 'text') {
|
|
59
|
-
// const textEmojiItems: TextItem[] = [];
|
|
60
|
-
// // mixEmoji(textPhoneItem.value, textEmojiItems);
|
|
61
|
-
// textEmojiItems.forEach(textEmojiItem => {
|
|
62
|
-
// viewItems.push(textEmojiItem);
|
|
63
|
-
// })
|
|
64
|
-
// } else {
|
|
65
|
-
// viewItems.push(textPhoneItem);
|
|
66
|
-
// }
|
|
67
|
-
viewItems.push(textPhoneItem);
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
viewItems.push(textUrlItem);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
return viewItems;
|
|
75
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|