im-ui-mobile 0.0.70 → 0.0.72
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/index.js +6 -27
- package/package.json +1 -1
- package/types/components/arrow-bar.d.ts +1 -1
- package/types/components/bar-group.d.ts +1 -1
- package/types/components/button.d.ts +1 -1
- package/types/components/chat-at-box.d.ts +1 -1
- package/types/components/chat-group-readed.d.ts +1 -1
- package/types/components/chat-item.d.ts +1 -1
- package/types/components/chat-message-item.d.ts +1 -1
- package/types/components/chat-record.d.ts +1 -1
- package/types/components/file-upload.d.ts +1 -1
- package/types/components/friend-item.d.ts +1 -1
- package/types/components/group-item.d.ts +1 -1
- package/types/components/group-member-selector.d.ts +1 -1
- package/types/components/group-rtc-join.d.ts +1 -1
- package/types/components/head-image.d.ts +1 -1
- package/types/components/loading.d.ts +1 -1
- package/types/components/long-press-menu.d.ts +1 -1
- package/types/components/sample.d.ts +1 -1
- package/types/components/switch-bar.d.ts +1 -1
- package/types/components/virtual-scroller.d.ts +1 -1
- package/types/index.d.ts +3 -3
- package/types/utils/emoji.d.ts +1 -0
- package/types/utils/recorderApp.d.ts +3 -2
- package/types/utils/recorderH5.d.ts +3 -2
- package/types/utils/useDynamicRefs.d.ts +1 -1
- package/types/utils/websocket.d.ts +4 -5
- package/utils/websocket.js +1 -6
- /package/types/{components/_common.d.ts → common.d.ts} +0 -0
package/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// import { PiniaPlugin } from './plugins/pinia.js'
|
|
2
1
|
import { UViewPlusPlugin } from './plugins/uview-plus.js'
|
|
3
2
|
import eventBus from "./utils/eventBus.js";
|
|
4
3
|
import datetime from "./utils/datetime.js";
|
|
@@ -12,7 +11,6 @@ import Requester from "./utils/requester.js";
|
|
|
12
11
|
import url from "./utils/url.js";
|
|
13
12
|
import { useDynamicRefs } from "./utils/useDynamicRefs.js";
|
|
14
13
|
import WebSocket from "./utils/websocket.js";
|
|
15
|
-
import { webSocket } from "./utils/websocket.js";
|
|
16
14
|
import { MESSAGE_TYPE, RTC_STATE, TERMINAL_TYPE, MESSAGE_STATUS } from "./utils/enums.js";
|
|
17
15
|
|
|
18
16
|
const importFn = import.meta.glob('./components/im-*/im-*.vue', { eager: true })
|
|
@@ -44,36 +42,23 @@ let config = {}
|
|
|
44
42
|
// 默认配置
|
|
45
43
|
const defaultConfig = {
|
|
46
44
|
emojiUrl: '',
|
|
47
|
-
|
|
45
|
+
baseUrl: ''
|
|
48
46
|
}
|
|
49
47
|
|
|
50
48
|
const install = (app, options = {}) => {
|
|
51
49
|
// 合并配置
|
|
52
50
|
config = { ...defaultConfig, ...options }
|
|
53
51
|
|
|
54
|
-
// // 配置 Emoji
|
|
55
|
-
// if (globalConfig.emojiUrl) {
|
|
56
|
-
// emoji.setEmojiUrl(globalConfig.emojiUrl);
|
|
57
|
-
// }
|
|
58
|
-
|
|
59
|
-
|
|
60
52
|
// 提供全局配置
|
|
61
|
-
app.provide('im-config', options
|
|
53
|
+
app.provide('im-config', options || {})
|
|
62
54
|
|
|
63
|
-
|
|
55
|
+
// 应用配置到各个模块
|
|
64
56
|
if (config.emojiUrl) {
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
// 设置 emoji 模块
|
|
58
|
+
emoji.setEmojiUrl(config.emojiUrl);
|
|
67
59
|
}
|
|
68
60
|
|
|
69
61
|
// 安装插件
|
|
70
|
-
|
|
71
|
-
// // 安装pinia插件
|
|
72
|
-
// if (options.usePinia !== false) {
|
|
73
|
-
// app.use(PiniaPlugin, options.piniaOptions)
|
|
74
|
-
// }
|
|
75
|
-
|
|
76
|
-
// 安装 uview-plus
|
|
77
62
|
app.use(UViewPlusPlugin)
|
|
78
63
|
|
|
79
64
|
// 注册组件
|
|
@@ -82,14 +67,8 @@ const install = (app, options = {}) => {
|
|
|
82
67
|
})
|
|
83
68
|
}
|
|
84
69
|
|
|
85
|
-
// // 导出安装函数和配置方法
|
|
86
|
-
// const setConfig = (options) => {
|
|
87
|
-
// if (options.emoji && options.emoji.baseUrl) {
|
|
88
|
-
// emoji.setEmojiUrl(options.emoji.baseUrl);
|
|
89
|
-
// }
|
|
90
|
-
// };
|
|
91
|
-
|
|
92
70
|
const getConfig = () => ({ ...config });
|
|
71
|
+
const webSocket = new WebSocket();
|
|
93
72
|
|
|
94
73
|
export {
|
|
95
74
|
getConfig,
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ import Requester from "./utils/requester.d.ts";
|
|
|
13
13
|
import * as url from "./utils/url.d.ts";
|
|
14
14
|
import { useDynamicRefs } from "./utils/useDynamicRefs.d.ts";
|
|
15
15
|
import WebSocket from "./utils/websocket.d.ts";
|
|
16
|
-
import { webSocket } from "./utils/websocket.d.ts";
|
|
17
16
|
import type {
|
|
18
17
|
// 类型常量
|
|
19
18
|
RtcMode,
|
|
@@ -43,12 +42,14 @@ declare module 'im-ui-mobile' {
|
|
|
43
42
|
export function install(): void
|
|
44
43
|
|
|
45
44
|
interface Config {
|
|
45
|
+
baseUrl: string;
|
|
46
46
|
emojiUrl: string;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
function getConfig(): Config;
|
|
50
50
|
|
|
51
51
|
export {
|
|
52
|
+
getConfig,
|
|
52
53
|
eventBus,
|
|
53
54
|
datetime,
|
|
54
55
|
Emoji,
|
|
@@ -59,7 +60,6 @@ declare module 'im-ui-mobile' {
|
|
|
59
60
|
url,
|
|
60
61
|
useDynamicRefs,
|
|
61
62
|
WebSocket,
|
|
62
|
-
webSocket,
|
|
63
63
|
|
|
64
64
|
// 枚举类型
|
|
65
65
|
RTC_STATE,
|
package/types/utils/emoji.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { UploadRecorderFileResult } from '../libs';
|
|
2
|
-
declare
|
|
2
|
+
declare class RecorderApp {
|
|
3
|
+
constructor();
|
|
3
4
|
checkIsEnable: () => boolean;
|
|
4
5
|
start: () => Promise<void>;
|
|
5
6
|
close: () => void;
|
|
6
7
|
upload: () => Promise<UploadRecorderFileResult>;
|
|
7
8
|
};
|
|
8
|
-
export default
|
|
9
|
+
export default RecorderApp;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { UploadRecorderFileResult } from '../libs';
|
|
2
|
-
declare
|
|
2
|
+
declare class RecorderH5 {
|
|
3
|
+
constructor();
|
|
3
4
|
checkIsEnable: () => boolean;
|
|
4
5
|
start: () => Promise<void>;
|
|
5
6
|
close: () => void;
|
|
6
7
|
upload: () => Promise<UploadRecorderFileResult>;
|
|
7
8
|
};
|
|
8
|
-
export default
|
|
9
|
+
export default RecorderH5;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 使用动态Refs(组合式函数)
|
|
3
3
|
*/
|
|
4
4
|
export declare function useDynamicRefs<T = any>(): {
|
|
5
|
-
refs: import("vue").Ref<Map<string, import("@vue/reactivity").UnwrapRefSimple<T>> & Omit<Map<string, T>, keyof Map<any, any>>, Map<string, T> | (Map<string, import("@vue/reactivity").UnwrapRefSimple<T>> & Omit<Map<string, T>, keyof Map<any, any>>)>;
|
|
5
|
+
refs: import("vue").Ref<Map<string, import("@vue/reactivity").UnwrapRefSimple<T>> & Omit<Map<string, T>, keyof Map<any, any>>, Map<string, T> | (Map<string, import("@vue/reactivity").UnwrapRefSimple<T>> & Omit<Map<string, T>, keyof Map<any, any>>) >;
|
|
6
6
|
setRef: (key: string) => (el: T) => void;
|
|
7
7
|
getRef: (key: string) => T | undefined;
|
|
8
8
|
getAllRefs: () => Map<string, import("@vue/reactivity").UnwrapRefSimple<T>> & Omit<Map<string, T>, keyof Map<any, any>>;
|
|
@@ -14,12 +14,13 @@ declare class WebSocket {
|
|
|
14
14
|
private startHeartCheck;
|
|
15
15
|
private resetHeartCheck;
|
|
16
16
|
private clearHeartCheck;
|
|
17
|
-
connect(wsurl: string, token: string): void;
|
|
18
17
|
private setupSocketEvents;
|
|
19
18
|
private handleMessage;
|
|
20
19
|
private handleClose;
|
|
21
|
-
reconnect(wsurl: string, token: string): void;
|
|
22
20
|
private scheduleReconnect;
|
|
21
|
+
constructor();
|
|
22
|
+
connect(wsurl: string, token: string): void;
|
|
23
|
+
reconnect(wsurl: string, token: string): void;
|
|
23
24
|
close(code?: number): void;
|
|
24
25
|
sendMessage(message: string): void;
|
|
25
26
|
onConnect(callback: ConnectCallback): void;
|
|
@@ -30,6 +31,4 @@ declare class WebSocket {
|
|
|
30
31
|
setHeartCheckTimeout(timeout: number): void;
|
|
31
32
|
destroy(): void;
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
-
export { webSocket, WebSocket };
|
|
35
|
-
export default webSocket;
|
|
34
|
+
export default WebSocket;
|
package/utils/websocket.js
CHANGED
|
File without changes
|