im-ui-mobile 0.0.53 → 0.0.55

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.
@@ -6,6 +6,8 @@
6
6
  </template>
7
7
 
8
8
  <script setup lang="ts">
9
+ import { computed } from 'vue'
10
+
9
11
  interface Props {
10
12
  title: string;
11
13
  icon?: string;
@@ -35,6 +35,7 @@
35
35
  </template>
36
36
 
37
37
  <script setup lang="ts">
38
+ import { ref, computed } from 'vue'
38
39
  import ImHeadImage from '../im-head-image/im-head-image.vue'
39
40
  import ImVirtualScroller from '../im-virtual-scroller/im-virtual-scroller.vue'
40
41
  import { GroupMember } from '../../libs';
@@ -33,6 +33,7 @@
33
33
  </template>
34
34
 
35
35
  <script setup lang="ts">
36
+ import { ref } from 'vue'
36
37
  import ImHeadImage from '../im-head-image/im-head-image.vue'
37
38
  import ImVirtualScroller from '../im-virtual-scroller/im-virtual-scroller.vue'
38
39
  import { Chat, Message } from '../../libs';
@@ -25,9 +25,10 @@
25
25
  </template>
26
26
 
27
27
  <script setup lang="ts">
28
+ import { computed } from 'vue'
28
29
  import ImHeadImage from '../im-head-image/im-head-image.vue'
29
30
  import { datetime, dom, messageType, emoji } from '../../index'
30
- import { MESSAGE_TYPE } from '../../types'
31
+ import { MESSAGE_TYPE } from '../../index'
31
32
 
32
33
  interface Props {
33
34
  chat?: any;
@@ -88,11 +88,12 @@
88
88
  </template>
89
89
 
90
90
  <script setup lang="ts">
91
+ import { ref, computed } from 'vue'
91
92
  import ImHeadImage from '../im-head-image/im-head-image.vue'
92
93
  import ImChatGroupReaded from '../im-chat-group-readed/im-chat-group-readed.vue'
93
94
  import ImLongPressMenu from '../im-long-press-menu/im-long-press-menu.vue'
94
- import { MESSAGE_TYPE, MESSAGE_STATUS, } from '../../types'
95
- import { datetime, dom, url,messageType, emoji } from '../../index'
95
+ import { MESSAGE_TYPE, MESSAGE_STATUS } from '../../index'
96
+ import { datetime, dom, url, messageType, emoji } from '../../index'
96
97
 
97
98
  interface Props {
98
99
  avatar?: string;
@@ -26,6 +26,7 @@
26
26
  </template>
27
27
 
28
28
  <script setup lang="ts">
29
+ import { ref, computed } from 'vue'
29
30
  import { recorderApp, recorderH5 } from '../../index'
30
31
 
31
32
  const recording = ref(false);
@@ -12,6 +12,8 @@
12
12
  </template>
13
13
 
14
14
  <script setup lang="ts">
15
+ import { ref } from 'vue'
16
+
15
17
  // 定义类型
16
18
  interface UploadFile {
17
19
  url: string
@@ -10,7 +10,7 @@
10
10
  <scroll-view v-show="checkedIds.length > 0" scroll-x="true" scroll-left="120">
11
11
  <view class="checked-users">
12
12
  <view v-for="m in checkedMembers" class="user-item" :key="m.userId">
13
- <im-head-image :name="m.showNickName" :url="m.headImage" :size="60"/>
13
+ <im-head-image :name="m.showNickName" :url="m.headImage" :size="60" />
14
14
  </view>
15
15
  </view>
16
16
  </scroll-view>
@@ -22,7 +22,7 @@
22
22
  <template v-slot="{ item }">
23
23
  <view class="member-item" @click="onSwitchChecked(item)">
24
24
  <im-head-image :name="item.showNickName" :online="item.online" :url="item.headImage"
25
- :size="90"/>
25
+ :size="90" />
26
26
  <view class="member-name">{{ item.showNickName }}
27
27
  </view>
28
28
  <view class="member-checked">
@@ -39,6 +39,7 @@
39
39
 
40
40
 
41
41
  <script setup lang="ts">
42
+ import { ref, computed } from 'vue'
42
43
  import ImHeadImage from '../im-head-image/im-head-image.vue'
43
44
  import ImVirtualScroller from '../im-virtual-scroller/im-virtual-scroller.vue'
44
45
 
@@ -5,6 +5,8 @@
5
5
  </template>
6
6
 
7
7
  <script setup lang="ts">
8
+ import { ref } from 'vue'
9
+
8
10
  interface Props {
9
11
  maxCount?: number;
10
12
  maxSize?: number;
@@ -6,6 +6,8 @@
6
6
  </template>
7
7
 
8
8
  <script setup lang="ts">
9
+ import { computed } from 'vue'
10
+
9
11
  interface Props {
10
12
  size?: number;
11
13
  iconColor?: string;
@@ -13,6 +13,8 @@
13
13
  </template>
14
14
 
15
15
  <script setup lang="ts">
16
+ import { ref } from 'vue'
17
+
16
18
  interface Props {
17
19
  items?: any[];
18
20
  }
@@ -6,6 +6,8 @@
6
6
  </template>
7
7
 
8
8
  <script setup lang="ts">
9
+ import { ref } from 'vue'
10
+
9
11
  interface Props {
10
12
  title: string;
11
13
  checked?: boolean;
@@ -9,6 +9,8 @@
9
9
  </template>
10
10
 
11
11
  <script setup lang="ts">
12
+ import { ref, computed } from 'vue'
13
+
12
14
  interface Props {
13
15
  height?: string;
14
16
  items?: any[];
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Pinia } from './plugins/pinia.js'
1
+ import { PiniaPlugin } from './plugins/pinia.js'
2
2
  import { UViewPlusPlugin } from './plugins/uview-plus.js'
3
3
 
4
4
  const importFn = import.meta.glob('./components/im-*/im-*.vue', { eager: true })
@@ -27,7 +27,7 @@ for (const key in importFn) {
27
27
  const install = (app, options = {}) => {
28
28
  // 安装pinia插件
29
29
  if (options.usePinia !== false) {
30
- app.use(Pinia, options.piniaOptions)
30
+ app.use(PiniaPlugin, options.piniaOptions)
31
31
  }
32
32
 
33
33
  // 安装 uview-plus
@@ -45,14 +45,15 @@ const install = (app, options = {}) => {
45
45
  import eventBus from "./utils/eventBus.js";
46
46
  import datetime from "./utils/datetime.js";
47
47
  import { emoji, Emoji } from "./utils/emoji.js";
48
- import * as dom from "./utils/dom.js";
48
+ import dom from "./utils/dom.js";
49
49
  import messageType from "./utils/messageType.js";
50
- import * as recorderApp from "./utils/recorderApp.js";
51
- import * as recorderH5 from "./utils/recorderH5.js";
50
+ import RecorderApp from "./utils/recorderApp.js";
51
+ import RecorderH5 from "./utils/recorderH5.js";
52
52
  import Requester from "./utils/requester.js";
53
- import * as url from "./utils/url.js";
53
+ import url from "./utils/url.js";
54
54
  import { useDynamicRefs } from "./utils/useDynamicRefs.js";
55
55
  import { webSocketManager, WebSocketManager } from "./utils/websocket.js";
56
+ import { MESSAGE_TYPE, RTC_STATE, TERMINAL_TYPE, MESSAGE_STATUS } from "./utils/enums.js";
56
57
 
57
58
  export {
58
59
  eventBus,
@@ -61,13 +62,19 @@ export {
61
62
  Emoji,
62
63
  dom,
63
64
  messageType,
64
- recorderApp,
65
- recorderH5,
65
+ RecorderApp as recorderApp,
66
+ RecorderH5 as recorderH5,
66
67
  Requester,
67
68
  url,
68
69
  useDynamicRefs,
69
70
  webSocketManager,
70
- WebSocketManager
71
+ WebSocketManager,
72
+
73
+ // Enums
74
+ MESSAGE_TYPE,
75
+ RTC_STATE,
76
+ TERMINAL_TYPE,
77
+ MESSAGE_STATUS
71
78
  }
72
79
 
73
80
  export default {
package/libs/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { RTC_STATE, MESSAGE_TYPE } from '../types/utils/enums'
1
+ import type { RTC_STATE, MESSAGE_TYPE } from '../types/utils/enums.d.ts'
2
2
 
3
3
 
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "im-ui-mobile",
3
- "version": "0.0.53",
3
+ "version": "0.0.55",
4
4
  "description": "A Vue3.0 + typescript instant messaging component library for Uniapp",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/plugins/pinia.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createPinia } from 'pinia'
2
2
 
3
- export const Pinia = {
3
+ export const PiniaPlugin = {
4
4
  install(app, options = {}) {
5
5
  // 创建pinia实例
6
6
  const pinia = createPinia()
@@ -1,4 +1,4 @@
1
- import type { RTC_STATE, MESSAGE_TYPE } from '../utils/enums';
1
+ import type { RTC_STATE, MESSAGE_TYPE } from '../utils/enums.d.ts';
2
2
  /**
3
3
  * 通话模式类型
4
4
  */
@@ -1,5 +1,4 @@
1
1
  /// <reference types="@dcloudio/types" />
2
- /// <reference types="@dcloudio/types" />
3
2
  import type { Response } from '../libs/index';
4
3
  export default class Requester {
5
4
  private baseURL;
package/utils/dom.js CHANGED
@@ -31,7 +31,7 @@ const HTML_UNESCAPE_MAP = {
31
31
  */
32
32
  const html2Escape = (text) => {
33
33
  if (!text) return '';
34
-
34
+
35
35
  return text.replace(/[<>&"']/g, (char) => {
36
36
  return HTML_ESCAPE_MAP[char] || char;
37
37
  });
@@ -44,7 +44,7 @@ const html2Escape = (text) => {
44
44
  */
45
45
  const htmlEscape = (text) => {
46
46
  if (!text) return '';
47
-
47
+
48
48
  const escapeRegex = /[<>&"'`]/g;
49
49
  return text.replace(escapeRegex, (char) => {
50
50
  return HTML_ESCAPE_MAP[char] || char;
@@ -58,7 +58,7 @@ const htmlEscape = (text) => {
58
58
  */
59
59
  const htmlUnescape = (text) => {
60
60
  if (!text) return '';
61
-
61
+
62
62
  const unescapeRegex = /&(lt|gt|amp|quot|#39|#96);/g;
63
63
  return text.replace(unescapeRegex, (entity) => {
64
64
  return HTML_UNESCAPE_MAP[entity] || entity;
@@ -72,7 +72,7 @@ const htmlUnescape = (text) => {
72
72
  */
73
73
  const escapeAttribute = (value) => {
74
74
  if (!value) return '';
75
-
75
+
76
76
  return value
77
77
  .replace(/"/g, '&quot;')
78
78
  .replace(/'/g, '&#39;')
@@ -87,7 +87,7 @@ const escapeAttribute = (value) => {
87
87
  */
88
88
  const escapeTextContent = (text) => {
89
89
  if (!text) return '';
90
-
90
+
91
91
  return text
92
92
  .replace(/&/g, '&amp;')
93
93
  .replace(/</g, '&lt;')
@@ -102,7 +102,7 @@ const escapeTextContent = (text) => {
102
102
  */
103
103
  const hasHtmlSpecialChars = (text) => {
104
104
  if (!text) return false;
105
-
105
+
106
106
  return /[<>&"']/.test(text);
107
107
  };
108
108
 
@@ -113,7 +113,7 @@ const hasHtmlSpecialChars = (text) => {
113
113
  */
114
114
  const setSafeHTML = (element, html) => {
115
115
  if (!element) return;
116
-
116
+
117
117
  element.innerHTML = htmlEscape(html);
118
118
  };
119
119
 
@@ -125,14 +125,14 @@ const setSafeHTML = (element, html) => {
125
125
  */
126
126
  const safeHTML = (strings, ...values) => {
127
127
  let result = '';
128
-
128
+
129
129
  for (let i = 0; i < strings.length; i++) {
130
130
  result += strings[i];
131
131
  if (i < values.length) {
132
132
  result += htmlEscape(String(values[i]));
133
133
  }
134
134
  }
135
-
135
+
136
136
  return result;
137
137
  };
138
138
 
@@ -1,4 +1,4 @@
1
- export default class Requester {
1
+ class Requester {
2
2
  constructor(baseURL, options = {}) {
3
3
  this.baseURL = baseURL;
4
4
  this.options = options;
@@ -81,4 +81,4 @@ export default class Requester {
81
81
  }
82
82
  }
83
83
 
84
- export { Requester }
84
+ export default { Requester }