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.
- package/components/im-btn-bar/im-btn-bar.vue +2 -0
- package/components/im-chat-at-box/im-chat-at-box.vue +1 -0
- package/components/im-chat-group-readed/im-chat-group-readed.vue +1 -0
- package/components/im-chat-item/im-chat-item.vue +2 -1
- package/components/im-chat-message-item/im-chat-message-item.vue +3 -2
- package/components/im-chat-record/im-chat-record.vue +1 -0
- package/components/im-file-upload/im-file-upload.vue +2 -0
- package/components/im-group-member-selector/im-group-member-selector.vue +3 -2
- package/components/im-image-upload/im-image-upload.vue +2 -0
- package/components/im-loading/im-loading.vue +2 -0
- package/components/im-long-press-menu/im-long-press-menu.vue +2 -0
- package/components/im-switch-bar/im-switch-bar.vue +2 -0
- package/components/im-virtual-scroller/im-virtual-scroller.vue +2 -0
- package/index.js +16 -9
- package/libs/index.ts +1 -1
- package/package.json +1 -1
- package/plugins/pinia.js +1 -1
- package/types/libs/index.d.ts +1 -1
- package/types/utils/requester.d.ts +0 -1
- package/utils/dom.js +9 -9
- package/utils/requester.js +2 -2
|
@@ -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 '../../
|
|
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
|
|
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;
|
|
@@ -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
|
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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(
|
|
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
|
|
48
|
+
import dom from "./utils/dom.js";
|
|
49
49
|
import messageType from "./utils/messageType.js";
|
|
50
|
-
import
|
|
51
|
-
import
|
|
50
|
+
import RecorderApp from "./utils/recorderApp.js";
|
|
51
|
+
import RecorderH5 from "./utils/recorderH5.js";
|
|
52
52
|
import Requester from "./utils/requester.js";
|
|
53
|
-
import
|
|
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
package/package.json
CHANGED
package/plugins/pinia.js
CHANGED
package/types/libs/index.d.ts
CHANGED
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, '"')
|
|
78
78
|
.replace(/'/g, ''')
|
|
@@ -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, '&')
|
|
93
93
|
.replace(/</g, '<')
|
|
@@ -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
|
|
package/utils/requester.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
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 }
|