im-ui-mobile 0.0.69 → 0.0.71
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 +19 -38
- 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 +4 -7
- 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 +3 -2
- /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";
|
|
@@ -39,37 +38,28 @@ for (const key in importFn) {
|
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
// 全局配置对象
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
const install = (app, upuiParams = '') => {
|
|
45
|
-
// // 合并配置
|
|
46
|
-
// globalConfig = { ...globalConfig, ...options };
|
|
47
|
-
|
|
48
|
-
// // 配置 Emoji
|
|
49
|
-
// if (globalConfig.emojiUrl) {
|
|
50
|
-
// emoji.setEmojiUrl(globalConfig.emojiUrl);
|
|
51
|
-
// }
|
|
52
|
-
|
|
53
|
-
// 配置
|
|
54
|
-
if (upuiParams) {
|
|
55
|
-
uni.upuiParams = upuiParams
|
|
56
|
-
const temp = upuiParams()
|
|
57
|
-
if (temp.options) {
|
|
58
|
-
setConfig(temp.options)
|
|
59
|
-
}
|
|
60
|
-
}
|
|
41
|
+
let config = {}
|
|
61
42
|
|
|
62
|
-
|
|
63
|
-
|
|
43
|
+
// 默认配置
|
|
44
|
+
const defaultConfig = {
|
|
45
|
+
emojiUrl: '',
|
|
46
|
+
baseUrl: ''
|
|
47
|
+
}
|
|
64
48
|
|
|
65
|
-
|
|
49
|
+
const install = (app, options = {}) => {
|
|
50
|
+
// 合并配置
|
|
51
|
+
config = { ...defaultConfig, ...options }
|
|
66
52
|
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
// app.use(PiniaPlugin, options.piniaOptions)
|
|
70
|
-
// }
|
|
53
|
+
// 提供全局配置
|
|
54
|
+
app.provide('im-config', options || {})
|
|
71
55
|
|
|
72
|
-
//
|
|
56
|
+
// 应用配置到各个模块
|
|
57
|
+
if (config.emojiUrl) {
|
|
58
|
+
// 设置 emoji 模块
|
|
59
|
+
emoji.setEmojiUrl(config.emojiUrl);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 安装插件
|
|
73
63
|
app.use(UViewPlusPlugin)
|
|
74
64
|
|
|
75
65
|
// 注册组件
|
|
@@ -78,18 +68,9 @@ const install = (app, upuiParams = '') => {
|
|
|
78
68
|
})
|
|
79
69
|
}
|
|
80
70
|
|
|
81
|
-
|
|
82
|
-
const setConfig = (options) => {
|
|
83
|
-
Object.assign(globalConfig, options);
|
|
84
|
-
if (options.emoji && options.emoji.baseUrl) {
|
|
85
|
-
emoji.setEmojiUrl(options.emoji.baseUrl);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const getConfig = () => ({ ...globalConfig });
|
|
71
|
+
const getConfig = () => ({ ...config });
|
|
90
72
|
|
|
91
73
|
export {
|
|
92
|
-
setConfig,
|
|
93
74
|
getConfig,
|
|
94
75
|
eventBus,
|
|
95
76
|
datetime,
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -42,18 +42,15 @@ import type {
|
|
|
42
42
|
declare module 'im-ui-mobile' {
|
|
43
43
|
export function install(): void
|
|
44
44
|
|
|
45
|
-
interface
|
|
45
|
+
interface Config {
|
|
46
46
|
baseUrl: string;
|
|
47
|
+
emojiUrl: string;
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
emoji: Partial<EmojiConfig>;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export function setConfig(config: Partial<GlobalConfig>): void;
|
|
50
|
+
function getConfig(): Config;
|
|
54
51
|
|
|
55
52
|
export {
|
|
56
|
-
|
|
53
|
+
getConfig,
|
|
57
54
|
eventBus,
|
|
58
55
|
datetime,
|
|
59
56
|
Emoji,
|
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;
|
|
File without changes
|