im-ui-mobile 0.0.79 → 0.0.81
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.
|
@@ -27,14 +27,15 @@
|
|
|
27
27
|
<script setup lang="ts">
|
|
28
28
|
import { computed } from 'vue'
|
|
29
29
|
import ImHeadImage from '../im-head-image/im-head-image.vue'
|
|
30
|
-
import { datetime, dom, messageType
|
|
30
|
+
import { datetime, dom, messageType } from '../../index'
|
|
31
31
|
import { MESSAGE_TYPE } from '../../index'
|
|
32
32
|
|
|
33
33
|
interface Props {
|
|
34
34
|
chat?: any;
|
|
35
35
|
index?: number;
|
|
36
36
|
active?: boolean;
|
|
37
|
-
online: boolean
|
|
37
|
+
online: boolean;
|
|
38
|
+
emoji: any;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
const $datetime = datetime
|
|
@@ -82,7 +83,7 @@ const isTextMessage = computed(() => {
|
|
|
82
83
|
|
|
83
84
|
const nodesText = computed(() => {
|
|
84
85
|
const text = dom.html2Escape(props.chat?.lastContent || '');
|
|
85
|
-
return emoji.transform(text, 'emoji-small');
|
|
86
|
+
return props.emoji.transform(text, 'emoji-small');
|
|
86
87
|
});
|
|
87
88
|
|
|
88
89
|
// TODO:组件化(换为props.online)
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<im-long-press-menu :items="menuItems" @select="onSelectMenu">
|
|
20
20
|
<!-- up-parse支持点击a标签,但是不支持显示emo表情,也不支持换行 -->
|
|
21
21
|
<up-parse
|
|
22
|
-
v-if="$url.containUrl(msgInfo.content) &&
|
|
22
|
+
v-if="$url.containUrl(msgInfo.content) && !emoji.containEmoji(msgInfo.content)"
|
|
23
23
|
class="message-text" :showImgMenu="false" :content="nodesText" />
|
|
24
24
|
<!-- rich-text支持显示emo表情以及消息换行,但是不支持点击a标签 -->
|
|
25
25
|
<rich-text v-else class="message-text" :nodes="nodesText" />
|
|
@@ -93,13 +93,14 @@ import ImHeadImage from '../im-head-image/im-head-image.vue'
|
|
|
93
93
|
import ImChatGroupReaded from '../im-chat-group-readed/im-chat-group-readed.vue'
|
|
94
94
|
import ImLongPressMenu from '../im-long-press-menu/im-long-press-menu.vue'
|
|
95
95
|
import { MESSAGE_TYPE, MESSAGE_STATUS } from '../../index'
|
|
96
|
-
import { datetime, dom, url, messageType
|
|
96
|
+
import { datetime, dom, url, messageType } from '../../index'
|
|
97
97
|
|
|
98
98
|
interface Props {
|
|
99
99
|
avatar?: string;
|
|
100
100
|
showName: string;
|
|
101
101
|
msgInfo: any;
|
|
102
102
|
groupMembers?: any[];
|
|
103
|
+
emoji: any;
|
|
103
104
|
}
|
|
104
105
|
|
|
105
106
|
interface Emits {
|
|
@@ -113,7 +114,6 @@ interface Emits {
|
|
|
113
114
|
(e: 'download', msgInfo: any): void;
|
|
114
115
|
}
|
|
115
116
|
|
|
116
|
-
const $emoji = emoji
|
|
117
117
|
const $url = url
|
|
118
118
|
const $datetime = datetime
|
|
119
119
|
const props = defineProps<Props>();
|
|
@@ -261,7 +261,7 @@ const nodesText = computed(() => {
|
|
|
261
261
|
const color = props.msgInfo.selfSend ? 'white' : '';
|
|
262
262
|
let text = dom.html2Escape(props.msgInfo.content);
|
|
263
263
|
text = url.replaceURLWithHTMLLinks(text, color);
|
|
264
|
-
return emoji.transform(text, 'emoji-normal');
|
|
264
|
+
return props.emoji.transform(text, 'emoji-normal');
|
|
265
265
|
});
|
|
266
266
|
|
|
267
267
|
const imageStyle = computed(() => {
|
package/index.js
CHANGED
|
@@ -43,7 +43,9 @@ const defaultConfig = {
|
|
|
43
43
|
emojiUrl: '',
|
|
44
44
|
baseUrl: ''
|
|
45
45
|
}
|
|
46
|
+
|
|
46
47
|
let emoji = null
|
|
48
|
+
|
|
47
49
|
const install = (app, options = {}) => {
|
|
48
50
|
// 合并配置
|
|
49
51
|
config = { ...defaultConfig, ...options }
|
|
@@ -59,7 +61,7 @@ const install = (app, options = {}) => {
|
|
|
59
61
|
// }
|
|
60
62
|
|
|
61
63
|
emoji = new Emoji({ emojiUrl: config.emojiUrl })
|
|
62
|
-
emoji.setEmojiUrl(config.emojiUrl)
|
|
64
|
+
// emoji.setEmojiUrl(config.emojiUrl)
|
|
63
65
|
|
|
64
66
|
// 安装插件
|
|
65
67
|
app.use(UViewPlusPlugin)
|