im-ui-mobile 0.0.67 → 0.0.69

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 CHANGED
@@ -39,24 +39,31 @@ for (const key in importFn) {
39
39
  }
40
40
 
41
41
  // 全局配置对象
42
- let globalConfig = {
43
- emojiUrl: '',
44
- };
42
+ let globalConfig = {};
43
+
44
+ const install = (app, upuiParams = '') => {
45
+ // // 合并配置
46
+ // globalConfig = { ...globalConfig, ...options };
45
47
 
46
- const install = (app, options = {}) => {
47
- // 合并配置
48
- globalConfig = { ...globalConfig, ...options };
48
+ // // 配置 Emoji
49
+ // if (globalConfig.emojiUrl) {
50
+ // emoji.setEmojiUrl(globalConfig.emojiUrl);
51
+ // }
49
52
 
50
- // 配置 Emoji
51
- if (globalConfig.emojiUrl) {
52
- emoji.setEmojiUrl(globalConfig.emojiUrl);
53
+ // 配置
54
+ if (upuiParams) {
55
+ uni.upuiParams = upuiParams
56
+ const temp = upuiParams()
57
+ if (temp.options) {
58
+ setConfig(temp.options)
59
+ }
53
60
  }
54
61
 
55
62
  // 提供全局配置
56
63
  app.provide('im-config', options.config || {})
57
64
 
58
65
  // 安装插件
59
-
66
+
60
67
  // // 安装pinia插件
61
68
  // if (options.usePinia !== false) {
62
69
  // app.use(PiniaPlugin, options.piniaOptions)
@@ -74,8 +81,8 @@ const install = (app, options = {}) => {
74
81
  // 导出安装函数和配置方法
75
82
  const setConfig = (options) => {
76
83
  Object.assign(globalConfig, options);
77
- if (options.emojiUrl) {
78
- emoji.setEmojiUrl(options.emojiUrl);
84
+ if (options.emoji && options.emoji.baseUrl) {
85
+ emoji.setEmojiUrl(options.emoji.baseUrl);
79
86
  }
80
87
  };
81
88
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "im-ui-mobile",
3
- "version": "0.0.67",
3
+ "version": "0.0.69",
4
4
  "description": "A Vue3.0 + typescript instant messaging component library for Uniapp",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/types/index.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  import eventBus from "./utils/eventBus.d.ts";
4
4
  import datetime from "./utils/datetime.d.ts";
5
5
  import Emoji from "./utils/emoji.d.ts";
6
- import {emoji} from "./utils/emoji.d.ts";
6
+ import { emoji } from "./utils/emoji.d.ts";
7
7
  import { MESSAGE_TYPE, RTC_STATE, TERMINAL_TYPE, MESSAGE_STATUS } from "./utils/enums.d.ts";
8
8
  import * as dom from "./utils/dom.d.ts";
9
9
  import messageType from "./utils/messageType.d.ts";
@@ -13,7 +13,7 @@ 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";
16
+ import { webSocket } from "./utils/websocket.d.ts";
17
17
  import type {
18
18
  // 类型常量
19
19
  RtcMode,
@@ -42,7 +42,18 @@ import type {
42
42
  declare module 'im-ui-mobile' {
43
43
  export function install(): void
44
44
 
45
+ interface EmojiConfig {
46
+ baseUrl: string;
47
+ }
48
+
49
+ interface GlobalConfig {
50
+ emoji: Partial<EmojiConfig>;
51
+ }
52
+
53
+ export function setConfig(config: Partial<GlobalConfig>): void;
54
+
45
55
  export {
56
+ ImUiConfig,
46
57
  eventBus,
47
58
  datetime,
48
59
  Emoji,