tuikit-atomicx-vue3 4.5.0 → 4.5.1
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/dist/{PopoverTrigger-L8abAry7.js → PopoverPortal-DghpKKm8.js} +91 -136
- package/dist/PopoverTrigger-BajjNkGO.js +54 -0
- package/dist/{PopperContent-XdhqL8Y2.js → PopperContent-SLoFuK7k.js} +6 -6
- package/dist/{Teleport-CSEuZbpM.js → Teleport-DFrneqLM.js} +4 -4
- package/dist/baseComp/Modal/Modal.js +3 -3
- package/dist/components/BarrageInput/EmojiPicker/EmojiPicker.js +10 -9
- package/dist/components/BarrageInput/TextEditor/CharacterCountExtension.js +1 -1
- package/dist/components/BarrageInput/TextEditor/EditorCore.js +16 -15
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.js +62 -40
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.js +29 -27
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.js +27 -23
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue.d.ts +1 -1
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.js +67 -65
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUnread.js +32 -30
- package/dist/components/ConversationList/ConversationPreview/utils.d.ts +2 -2
- package/dist/components/ConversationList/ConversationPreview/utils.js +81 -35
- package/dist/components/ConversationList/i18n/en-US.d.ts +10 -1
- package/dist/components/ConversationList/i18n/en-US.js +11 -2
- package/dist/components/ConversationList/i18n/zh-CN.d.ts +10 -1
- package/dist/components/ConversationList/i18n/zh-CN.js +11 -2
- package/dist/components/LiveScenePanel/index.js +10 -9
- package/dist/components/MessageInput/AttachmentPicker/index.js +10 -9
- package/dist/components/MessageInput/EmojiPicker/EmojiPicker.js +17 -16
- package/dist/components/MessageInput/QuotedMessagePreview/index.js +35 -35
- package/dist/components/MessageInput/TextEditor/EditorCore.d.ts +13 -12
- package/dist/components/MessageInput/TextEditor/EditorCore.js +54 -89
- package/dist/components/MessageInput/TextEditor/extensions/MentionSuggestion.js +229 -0
- package/dist/components/MessageInput/TextEditor/extensions/MentionSuggestion.vue.d.ts +15 -0
- package/dist/components/MessageInput/TextEditor/extensions/characterCountExtension.js +1 -1
- package/dist/components/MessageInput/TextEditor/extensions/emojiExtension.d.ts +1 -0
- package/dist/components/MessageInput/TextEditor/extensions/emojiExtension.js +22 -0
- package/dist/components/MessageInput/TextEditor/extensions/enterKeyExtension.d.ts +3 -0
- package/dist/components/MessageInput/TextEditor/extensions/enterKeyExtension.js +15 -0
- package/dist/components/MessageInput/TextEditor/extensions/imageExtension.js +2 -2
- package/dist/components/MessageInput/TextEditor/extensions/index.d.ts +8 -0
- package/dist/components/MessageInput/TextEditor/extensions/index.js +12 -0
- package/dist/components/MessageInput/TextEditor/extensions/mentionExtension.d.ts +5 -0
- package/dist/components/MessageInput/TextEditor/extensions/mentionExtension.js +330 -0
- package/dist/components/MessageInput/TextEditor/index.js +62 -62
- package/dist/components/MessageInput/i18n/en-US.d.ts +3 -0
- package/dist/components/MessageInput/i18n/en-US.js +4 -1
- package/dist/components/MessageInput/i18n/index.d.ts +6 -0
- package/dist/components/MessageInput/i18n/zh-CN.d.ts +3 -0
- package/dist/components/MessageInput/i18n/zh-CN.js +4 -1
- package/dist/components/MessageList/Message/ImageMessage/ImageMessage.js +119 -89
- package/dist/components/MessageList/Message/ImageMessage/ImagePreview.js +142 -0
- package/dist/components/MessageList/Message/ImageMessage/ImagePreview.vue.d.ts +20 -0
- package/dist/components/MessageList/Message/Message.vue.d.ts +8 -0
- package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.js +3 -3
- package/dist/components/MessageList/Message/MessageLayout/MessageLayout.js +69 -58
- package/dist/components/MessageList/Message/MessageLayout/MessageLayout.vue.d.ts +8 -0
- package/dist/components/MessageList/Message/index.js +8 -4
- package/dist/components/MessageList/MessageList.js +98 -90
- package/dist/components/MessageList/MessageList.vue.d.ts +1 -1
- package/dist/components/MessageList/index.d.ts +21 -3
- package/dist/components/Search/SearchResults/SearchResultsItem/Message/Message.js +6 -6
- package/dist/components/Search/SearchResults/SearchResultsItem/Message/Message.vue.d.ts +1 -1
- package/dist/index-BvFYOUyz.js +2936 -0
- package/dist/{index-Do-2CngU.js → index-C8Jw_xE4.js} +1621 -1731
- package/dist/{index-7vNB_Vx8.js → index-CiYL_XsE.js} +1 -1
- package/dist/index-CzCDLp99.js +2174 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +103 -103
- package/dist/states/MessageActionState/MessageActionState.js +83 -223
- package/dist/states/MessageInputState/MessageInputState.js +115 -83
- package/dist/states/MessageInputState/type.d.ts +36 -10
- package/dist/states/MessageInputState/utils.d.ts +1 -5
- package/dist/states/MessageListState/MessageListState.d.ts +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/{chat/index.d.ts → subEntry/chat/chat.d.ts} +2112 -2087
- package/dist/subEntry/chat/chat.js +89 -0
- package/dist/subEntry/chat/index.d.ts +11 -0
- package/dist/subEntry/chat/index.js +81 -0
- package/dist/{chat → subEntry/chat}/server.js +4 -4
- package/dist/{useId-CtirfF0W.js → useId-D5WE76CM.js} +1 -1
- package/dist/{utils-DaB7eSu5.js → utils-CttDpxqz.js} +1 -1
- package/package.json +8 -6
- package/src/components/ConversationList/ConversationPreview/ConversationPreview.scss +8 -0
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.vue +32 -1
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue +3 -2
- package/src/components/ConversationList/ConversationPreview/utils.ts +98 -28
- package/src/components/ConversationList/i18n/en-US.ts +10 -1
- package/src/components/ConversationList/i18n/zh-CN.ts +10 -1
- package/src/components/LiveScenePanel/index.vue +1 -0
- package/src/components/MessageInput/QuotedMessagePreview/QuotedMessagePreview.vue +19 -22
- package/src/components/MessageInput/TextEditor/Editor.scss +25 -0
- package/src/components/MessageInput/TextEditor/EditorCore.ts +79 -99
- package/src/components/MessageInput/TextEditor/TextEditor.vue +64 -68
- package/src/components/MessageInput/TextEditor/extensions/MentionSuggestion.vue +449 -0
- package/src/components/MessageInput/TextEditor/extensions/emojiExtension.ts +22 -0
- package/src/components/MessageInput/TextEditor/extensions/enterKeyExtension.ts +22 -0
- package/src/components/MessageInput/TextEditor/extensions/index.ts +8 -0
- package/src/components/MessageInput/TextEditor/extensions/mentionExtension.ts +87 -0
- package/src/components/MessageInput/i18n/en-US.ts +3 -0
- package/src/components/MessageInput/i18n/zh-CN.ts +3 -0
- package/src/components/MessageList/Message/ImageMessage/ImageMessage.vue +49 -0
- package/src/components/MessageList/Message/ImageMessage/ImagePreview.vue +344 -0
- package/src/components/MessageList/Message/Message.vue +6 -0
- package/src/components/MessageList/Message/MessageLayout/MessageLayout.vue +8 -1
- package/src/components/MessageList/MessageList.vue +36 -14
- package/src/components/Search/SearchResults/SearchResultsItem/Message/Message.vue +30 -31
- package/src/index.ts +1 -1
- package/src/{chat/index.ts → subEntry/chat/chat.ts} +25 -18
- package/src/subEntry/chat/index.ts +13 -0
- package/src/{chat → subEntry/chat}/server.ts +3 -3
- package/dist/chat/index.js +0 -59
- package/dist/index-ZILx4LYk.js +0 -4826
- package/dist/states/SearchState.d.ts +0 -314
- /package/dist/{chat → subEntry/chat}/server.d.ts +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import "../../states/LoginState.js";
|
|
2
|
+
import "../../components/UserPicker/index.js";
|
|
3
|
+
import { View as e } from "../../baseComp/View/index.js";
|
|
4
|
+
import { ChatSetting as t } from "../../components/ChatSetting/index.js";
|
|
5
|
+
import { ContactList as s, ContactListItem as o, ContactInfo as a } from "../../components/ContactList/index.js";
|
|
6
|
+
import { ConversationList as n, ConversationActions as r, ConversationListHeader as i, ConversationListContent as c, ConversationPreview as m, ConversationPreviewUI as p, ConversationSearch as C } from "../../components/ConversationList/index.js";
|
|
7
|
+
import { MessageInput as S, EmojiPicker as u, AttachmentPicker as v, FilePicker as g, ImagePicker as $, VideoPicker as d, AudioCallPicker as l, VideoCallPicker as L } from "../../components/MessageInput/index.js";
|
|
8
|
+
import { MessageList as P, Message as f } from "../../components/MessageList/index.js";
|
|
9
|
+
import { Search as h, SearchAdvanced as M, UserAdvanced as A, MessageAdvanced as I, SearchResults as k, SearchResultItem as T, SearchBar as y } from "../../components/Search/index.js";
|
|
10
|
+
import { useMessageActions as V } from "../../hooks/useMessageActions.js";
|
|
11
|
+
import { useSearchState as x } from "../../states/SearchState.js";
|
|
12
|
+
import G from "./server.js";
|
|
13
|
+
import { QuoteTypeEnum as Je, TranslationStatusEnum as Ke, VoiceToTextStatusEnum as Ne } from "../../types/message.js";
|
|
14
|
+
import { VariantType as We, defaultTypeLabels as Xe } from "../../types/search.js";
|
|
15
|
+
import { ConversationType as Ze, MessageType as et, SearchType as tt } from "../../types/engine.js";
|
|
16
|
+
import { CreateConvTypes as ot, GroupLabelTypes as at, GroupType as nt, PageStateTypes as rt, PlaceHolderTypes as it } from "../../types/conversation.js";
|
|
17
|
+
import { ContactItemType as mt, GroupApplicationType as pt } from "../../types/contact.js";
|
|
18
|
+
import { CallMediaType as St } from "../../types/call.js";
|
|
19
|
+
import { useContactListState as w } from "../../states/ContactListState/ContactListState.js";
|
|
20
|
+
import { useC2CSettingState as R } from "../../states/C2CSettingState/C2CSettingState.js";
|
|
21
|
+
import { useGroupSettingState as E } from "../../states/GroupSettingState/GroupSettingState.js";
|
|
22
|
+
import { useMessageListState as U } from "../../states/MessageListState/MessageListState.js";
|
|
23
|
+
import { useMessageInputState as H } from "../../states/MessageInputState/MessageInputState.js";
|
|
24
|
+
import { useMessageActionState as b } from "../../states/MessageActionState/MessageActionState.js";
|
|
25
|
+
import { useConversationListState as j } from "../../states/ConversationListState/ConversationListState.js";
|
|
26
|
+
import { GroupInviteType as vt, GroupMemberRole as gt, GroupPermission as $t } from "../../states/GroupSettingState/types.js";
|
|
27
|
+
import "../../components/Avatar/Avatar.js";
|
|
28
|
+
import "../../components/Avatar/constants/avatar.js";
|
|
29
|
+
G.getInstance().init();
|
|
30
|
+
const re = h, ie = M, ce = I, me = A, pe = y, Ce = k, Se = T, ue = n, ve = r, ge = i, $e = c, de = m, le = p, Le = C, Pe = s, fe = o, he = a, Me = P, Ae = f, Ie = S, ke = u, Te = v, ye = g, Ve = $, xe = d, Ge = l, we = L, Re = t, Ee = e, Ue = V, He = j, be = b, je = H, Be = U, Fe = x, _e = w, Qe = R, qe = E;
|
|
31
|
+
export {
|
|
32
|
+
Te as AttachmentPicker,
|
|
33
|
+
Ge as AudioCallPicker,
|
|
34
|
+
St as CallMediaType,
|
|
35
|
+
Re as ChatSetting,
|
|
36
|
+
he as ContactInfo,
|
|
37
|
+
mt as ContactItemType,
|
|
38
|
+
Pe as ContactList,
|
|
39
|
+
fe as ContactListItem,
|
|
40
|
+
ve as ConversationActions,
|
|
41
|
+
ue as ConversationList,
|
|
42
|
+
$e as ConversationListContent,
|
|
43
|
+
ge as ConversationListHeader,
|
|
44
|
+
de as ConversationPreview,
|
|
45
|
+
le as ConversationPreviewUI,
|
|
46
|
+
Le as ConversationSearch,
|
|
47
|
+
Ze as ConversationType,
|
|
48
|
+
ot as CreateConvTypes,
|
|
49
|
+
ke as EmojiPicker,
|
|
50
|
+
ye as FilePicker,
|
|
51
|
+
pt as GroupApplicationType,
|
|
52
|
+
vt as GroupInviteType,
|
|
53
|
+
at as GroupLabelTypes,
|
|
54
|
+
gt as GroupMemberRole,
|
|
55
|
+
$t as GroupPermission,
|
|
56
|
+
nt as GroupType,
|
|
57
|
+
Ve as ImagePicker,
|
|
58
|
+
Ae as Message,
|
|
59
|
+
ce as MessageAdvanced,
|
|
60
|
+
Ie as MessageInput,
|
|
61
|
+
Me as MessageList,
|
|
62
|
+
et as MessageType,
|
|
63
|
+
rt as PageStateTypes,
|
|
64
|
+
it as PlaceHolderTypes,
|
|
65
|
+
Je as QuoteTypeEnum,
|
|
66
|
+
re as Search,
|
|
67
|
+
ie as SearchAdvanced,
|
|
68
|
+
pe as SearchBar,
|
|
69
|
+
Se as SearchResultItem,
|
|
70
|
+
Ce as SearchResults,
|
|
71
|
+
tt as SearchType,
|
|
72
|
+
Ke as TranslationStatusEnum,
|
|
73
|
+
me as UserAdvanced,
|
|
74
|
+
We as VariantType,
|
|
75
|
+
we as VideoCallPicker,
|
|
76
|
+
xe as VideoPicker,
|
|
77
|
+
Ee as View,
|
|
78
|
+
Ne as VoiceToTextStatusEnum,
|
|
79
|
+
Xe as defaultTypeLabels,
|
|
80
|
+
Qe as useC2CSettingState,
|
|
81
|
+
_e as useContactListState,
|
|
82
|
+
He as useConversationListState,
|
|
83
|
+
qe as useGroupSettingState,
|
|
84
|
+
be as useMessageActionState,
|
|
85
|
+
Ue as useMessageActions,
|
|
86
|
+
je as useMessageInputState,
|
|
87
|
+
Be as useMessageListState,
|
|
88
|
+
Fe as useSearchState
|
|
89
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { useLoginState } from '../../states/LoginState';
|
|
2
|
+
export * from '../../components/Avatar';
|
|
3
|
+
export * from '../../components/UserPicker';
|
|
4
|
+
export * from './chat';
|
|
5
|
+
export * from '../../types/message';
|
|
6
|
+
export * from '../../types/search';
|
|
7
|
+
export * from '../../types/engine';
|
|
8
|
+
export * from '../../types/conversation';
|
|
9
|
+
export * from '../../types/contact';
|
|
10
|
+
export * from '../../types/call';
|
|
11
|
+
export * from '../../types/chatSetting';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import '../../styles/index.css';
|
|
2
|
+
import { useLoginState as o } from "../../states/LoginState.js";
|
|
3
|
+
import { UserPicker as r } from "../../components/UserPicker/index.js";
|
|
4
|
+
import { AttachmentPicker as i, AudioCallPicker as n, ChatSetting as p, ContactInfo as A, ContactList as T, ContactListItem as c, ConversationActions as u, ConversationList as C, ConversationListContent as S, ConversationListHeader as m, ConversationPreview as L, ConversationPreviewUI as P, ConversationSearch as l, EmojiPicker as v, FilePicker as R, ImagePicker as _, Message as U, MessageAdvanced as f, MessageInput as g, MessageList as y, Search as M, SearchAdvanced as d, SearchBar as x, SearchResultItem as E, SearchResults as G, UserAdvanced as V, VideoCallPicker as I, VideoPicker as h, View as O, useC2CSettingState as k, useContactListState as F, useConversationListState as D, useGroupSettingState as b, useMessageActionState as w, useMessageActions as H, useMessageInputState as B, useMessageListState as N, useSearchState as j } from "./chat.js";
|
|
5
|
+
import { QuoteTypeEnum as Q, TranslationStatusEnum as W, VoiceToTextStatusEnum as q } from "../../types/message.js";
|
|
6
|
+
import { VariantType as J, defaultTypeLabels as X } from "../../types/search.js";
|
|
7
|
+
import { ConversationType as Z, MessageType as $, SearchType as ee } from "../../types/engine.js";
|
|
8
|
+
import { CreateConvTypes as oe, GroupLabelTypes as ae, GroupType as re, PageStateTypes as se, PlaceHolderTypes as ie } from "../../types/conversation.js";
|
|
9
|
+
import { ContactItemType as pe, GroupApplicationType as Ae } from "../../types/contact.js";
|
|
10
|
+
import { CallMediaType as ce } from "../../types/call.js";
|
|
11
|
+
import { default as Ce } from "../../components/Avatar/Avatar.js";
|
|
12
|
+
import { DEFAULT_GROUP_AVATAR_AVCHATROOM as me, DEFAULT_GROUP_AVATAR_COMMON as Le, DEFAULT_GROUP_AVATAR_MEETING as Pe, DEFAULT_GROUP_AVATAR_PUBLIC as le, DEFAULT_GROUP_AVATAR_WORK as ve, DEFAULT_USER_AVATAR as Re } from "../../components/Avatar/constants/avatar.js";
|
|
13
|
+
import { GroupInviteType as Ue, GroupMemberRole as fe, GroupPermission as ge } from "../../states/GroupSettingState/types.js";
|
|
14
|
+
export {
|
|
15
|
+
i as AttachmentPicker,
|
|
16
|
+
n as AudioCallPicker,
|
|
17
|
+
Ce as Avatar,
|
|
18
|
+
ce as CallMediaType,
|
|
19
|
+
p as ChatSetting,
|
|
20
|
+
A as ContactInfo,
|
|
21
|
+
pe as ContactItemType,
|
|
22
|
+
T as ContactList,
|
|
23
|
+
c as ContactListItem,
|
|
24
|
+
u as ConversationActions,
|
|
25
|
+
C as ConversationList,
|
|
26
|
+
S as ConversationListContent,
|
|
27
|
+
m as ConversationListHeader,
|
|
28
|
+
L as ConversationPreview,
|
|
29
|
+
P as ConversationPreviewUI,
|
|
30
|
+
l as ConversationSearch,
|
|
31
|
+
Z as ConversationType,
|
|
32
|
+
oe as CreateConvTypes,
|
|
33
|
+
me as DEFAULT_GROUP_AVATAR_AVCHATROOM,
|
|
34
|
+
Le as DEFAULT_GROUP_AVATAR_COMMON,
|
|
35
|
+
Pe as DEFAULT_GROUP_AVATAR_MEETING,
|
|
36
|
+
le as DEFAULT_GROUP_AVATAR_PUBLIC,
|
|
37
|
+
ve as DEFAULT_GROUP_AVATAR_WORK,
|
|
38
|
+
Re as DEFAULT_USER_AVATAR,
|
|
39
|
+
v as EmojiPicker,
|
|
40
|
+
R as FilePicker,
|
|
41
|
+
Ae as GroupApplicationType,
|
|
42
|
+
Ue as GroupInviteType,
|
|
43
|
+
ae as GroupLabelTypes,
|
|
44
|
+
fe as GroupMemberRole,
|
|
45
|
+
ge as GroupPermission,
|
|
46
|
+
re as GroupType,
|
|
47
|
+
_ as ImagePicker,
|
|
48
|
+
U as Message,
|
|
49
|
+
f as MessageAdvanced,
|
|
50
|
+
g as MessageInput,
|
|
51
|
+
y as MessageList,
|
|
52
|
+
$ as MessageType,
|
|
53
|
+
se as PageStateTypes,
|
|
54
|
+
ie as PlaceHolderTypes,
|
|
55
|
+
Q as QuoteTypeEnum,
|
|
56
|
+
M as Search,
|
|
57
|
+
d as SearchAdvanced,
|
|
58
|
+
x as SearchBar,
|
|
59
|
+
E as SearchResultItem,
|
|
60
|
+
G as SearchResults,
|
|
61
|
+
ee as SearchType,
|
|
62
|
+
W as TranslationStatusEnum,
|
|
63
|
+
V as UserAdvanced,
|
|
64
|
+
r as UserPicker,
|
|
65
|
+
J as VariantType,
|
|
66
|
+
I as VideoCallPicker,
|
|
67
|
+
h as VideoPicker,
|
|
68
|
+
O as View,
|
|
69
|
+
q as VoiceToTextStatusEnum,
|
|
70
|
+
X as defaultTypeLabels,
|
|
71
|
+
k as useC2CSettingState,
|
|
72
|
+
F as useContactListState,
|
|
73
|
+
D as useConversationListState,
|
|
74
|
+
b as useGroupSettingState,
|
|
75
|
+
o as useLoginState,
|
|
76
|
+
w as useMessageActionState,
|
|
77
|
+
H as useMessageActions,
|
|
78
|
+
B as useMessageInputState,
|
|
79
|
+
N as useMessageListState,
|
|
80
|
+
j as useSearchState
|
|
81
|
+
};
|
|
@@ -4,10 +4,10 @@ var s = (o, t, i) => u(o, typeof t != "symbol" ? t + "" : t, i);
|
|
|
4
4
|
import { ref as I } from "vue";
|
|
5
5
|
import U from "@tencentcloud/chat-uikit-engine";
|
|
6
6
|
import T, { TUIConstants as g, TUILogin as S } from "@tencentcloud/tui-core";
|
|
7
|
-
import { useLoginState as m } from "
|
|
8
|
-
import { ChatSceneType as l } from "
|
|
9
|
-
import { useStatistical as C } from "
|
|
10
|
-
import { isPC as p } from "
|
|
7
|
+
import { useLoginState as m } from "../../states/LoginState.js";
|
|
8
|
+
import { ChatSceneType as l } from "../../statistical/const.js";
|
|
9
|
+
import { useStatistical as C } from "../../statistical/statistical.js";
|
|
10
|
+
import { isPC as p } from "../../utils/env.js";
|
|
11
11
|
const { setChatScene: N } = C(), e = class e {
|
|
12
12
|
constructor() {
|
|
13
13
|
s(this, "isReady", !1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tuikit-atomicx-vue3",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"import": "./dist/index.js"
|
|
17
17
|
},
|
|
18
18
|
"./chat": {
|
|
19
|
-
"types": "./dist/chat/index.d.ts",
|
|
20
|
-
"import": "./dist/chat/index.js"
|
|
19
|
+
"types": "./dist/subEntry/chat/index.d.ts",
|
|
20
|
+
"import": "./dist/subEntry/chat/index.js"
|
|
21
21
|
},
|
|
22
22
|
"./live": {
|
|
23
23
|
"types": "./dist/subEntry/live/index.d.ts",
|
|
@@ -56,12 +56,14 @@
|
|
|
56
56
|
"@tencentcloud/chat": "^3.5.8",
|
|
57
57
|
"@tencentcloud/chat-uikit-engine": "~2.5.7",
|
|
58
58
|
"@tencentcloud/tui-core": "latest",
|
|
59
|
-
"@tencentcloud/tuiroom-engine-js": "~3.5.
|
|
60
|
-
"@tencentcloud/uikit-base-component-vue3": "1.3.
|
|
61
|
-
"vue": "^3.4.
|
|
59
|
+
"@tencentcloud/tuiroom-engine-js": "~3.5.1-beta.1",
|
|
60
|
+
"@tencentcloud/uikit-base-component-vue3": "1.3.1",
|
|
61
|
+
"vue": "^3.4.0"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@tencentcloud/universal-api": "^2.4.0",
|
|
65
|
+
"@tiptap/extension-mention": "^2.11.5",
|
|
66
|
+
"@tiptap/suggestion": "2.11.5",
|
|
65
67
|
"@tiptap/extension-image": "^2.11.5",
|
|
66
68
|
"@tiptap/extension-placeholder": "^2.11.5",
|
|
67
69
|
"@tiptap/pm": "^3.1.0",
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.conversationPreview__abstract">
|
|
3
3
|
<template v-if="draftTextAbstract">
|
|
4
|
-
<label :class="$style.
|
|
4
|
+
<label :class="$style.conversationPreview__abstract__drafts">[{{ t('TUIConversation.Drafts') }}]</label>
|
|
5
5
|
{{ ' ' }}
|
|
6
6
|
{{ draftTextAbstract }}
|
|
7
7
|
</template>
|
|
8
8
|
<template v-else>
|
|
9
|
+
<label v-if="atInfoPreview" :class="$style['conversationPreview__abstract__at-info']">{{ atInfoPreview }}</label>
|
|
9
10
|
{{ latestMessagePreview }}
|
|
10
11
|
</template>
|
|
11
12
|
</div>
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
<script lang="ts" setup>
|
|
15
16
|
import { computed } from 'vue';
|
|
16
17
|
import { useUIKit } from '@tencentcloud/uikit-base-component-vue3';
|
|
18
|
+
import { ConversationType } from '../../../types';
|
|
17
19
|
import { JSONStringToParse } from '../../../utils';
|
|
18
20
|
import { getLatestMessagePreview } from './utils';
|
|
19
21
|
import type { ConversationModel } from '../../../types';
|
|
@@ -30,6 +32,35 @@ const draftTextAbstract = computed(() => {
|
|
|
30
32
|
});
|
|
31
33
|
|
|
32
34
|
const latestMessagePreview = computed(() => getLatestMessagePreview(props.conversation, t));
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Get group @ info preview text.
|
|
38
|
+
* atTypeArray[0] values: 1 = someone @me, 2 = @all, 3 = @all + someone @me
|
|
39
|
+
*/
|
|
40
|
+
const atInfoPreview = computed(() => {
|
|
41
|
+
const { type, groupAtInfoList } = props?.conversation || {};
|
|
42
|
+
|
|
43
|
+
// Only show @ info for group conversations with valid groupAtInfoList
|
|
44
|
+
if (type !== ConversationType.GROUP || !groupAtInfoList?.length) {
|
|
45
|
+
return '';
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const atInfoTextList: string[] = [
|
|
49
|
+
`[${t('TUIConversation.someone_at_me')}]`,
|
|
50
|
+
`[${t('TUIConversation.at_all')}]`,
|
|
51
|
+
`[${t('TUIConversation.at_all')}][${t('TUIConversation.someone_at_me')}]`,
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
let atInfo = '';
|
|
55
|
+
groupAtInfoList.forEach((item) => {
|
|
56
|
+
const atType = item?.atTypeArray?.[0];
|
|
57
|
+
if (atType && atType >= 1 && atType <= 3) {
|
|
58
|
+
atInfo = atInfoTextList[atType - 1];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
return atInfo;
|
|
63
|
+
});
|
|
33
64
|
</script>
|
|
34
65
|
|
|
35
66
|
<style lang="scss" module>
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script lang="ts" setup>
|
|
8
|
-
import
|
|
8
|
+
import { computed } from 'vue';
|
|
9
|
+
import type { ConversationModel } from '../../../types/engine';
|
|
9
10
|
|
|
10
11
|
const props = defineProps<{
|
|
11
12
|
conversation: ConversationModel;
|
|
12
13
|
}>();
|
|
13
14
|
|
|
14
|
-
const title =props?.conversation?.getShowName?.() || '';
|
|
15
|
+
const title = computed(() => props?.conversation?.getShowName?.() || '');
|
|
15
16
|
</script>
|
|
16
17
|
|
|
17
18
|
<style lang="scss" module>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import TUIChatEngine from '@tencentcloud/chat-uikit-engine';
|
|
2
|
-
import
|
|
2
|
+
import { MessageType, ConversationType } from '../../../types/engine';
|
|
3
|
+
import { transformTextWithEmojiKeyToName, safeJSONParse } from '../../../utils';
|
|
4
|
+
import { parseCallMessageText } from '../../../utils/call';
|
|
5
|
+
import { resolveGroupTipMessage } from '../../MessageList/Message/GroupTipMessage/resolveGroupTipMessage';
|
|
6
|
+
import type { ConversationModel, MessageModel } from '../../../types/engine';
|
|
3
7
|
|
|
4
8
|
export const generateHighlightTitle = (
|
|
5
9
|
conversation: ConversationModel,
|
|
@@ -20,36 +24,102 @@ export const generateHighlightTitle = (
|
|
|
20
24
|
};
|
|
21
25
|
|
|
22
26
|
export const getLatestMessagePreview = (conversation: ConversationModel, t: (key: string) => string) => {
|
|
23
|
-
const {
|
|
27
|
+
const { draftText } = conversation || {};
|
|
28
|
+
|
|
29
|
+
// Handle draft message
|
|
30
|
+
if (draftText) {
|
|
31
|
+
if (typeof draftText === 'string') {
|
|
32
|
+
return draftText;
|
|
33
|
+
}
|
|
34
|
+
const draftInfo = safeJSONParse(draftText, { abstract: '' });
|
|
35
|
+
return draftInfo.abstract;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Handle special operation type messages
|
|
39
|
+
const OPERATION_MESSAGES: Record<number, string> = {
|
|
40
|
+
4: t('TUIConversation.you_have_been_removed_from_the_group'),
|
|
41
|
+
5: t('TUIConversation.the_group_chat_has_been_disbanded'),
|
|
42
|
+
8: t('TUIConversation.you_have_left_the_group_chat'),
|
|
43
|
+
};
|
|
44
|
+
if (conversation.operationType && OPERATION_MESSAGES[conversation.operationType]) {
|
|
45
|
+
return OPERATION_MESSAGES[conversation.operationType];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const { lastMessage } = conversation;
|
|
49
|
+
|
|
24
50
|
if (!lastMessage) {
|
|
25
51
|
return '';
|
|
26
52
|
}
|
|
27
53
|
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
const isGroupConversation = conversation.type === ConversationType.GROUP;
|
|
55
|
+
const typedLastMessage = lastMessage as unknown as MessageModel;
|
|
56
|
+
const { type, payload } = typedLastMessage;
|
|
57
|
+
|
|
58
|
+
let messageContent = '';
|
|
59
|
+
|
|
60
|
+
if (lastMessage?.isRevoked) {
|
|
61
|
+
messageContent = t('TUIConversation.recalled_a_message');
|
|
62
|
+
} else {
|
|
63
|
+
switch (type) {
|
|
64
|
+
case MessageType.TEXT:
|
|
65
|
+
messageContent = transformTextWithEmojiKeyToName(payload.text || '');
|
|
66
|
+
break;
|
|
67
|
+
case MessageType.IMAGE:
|
|
68
|
+
messageContent = `[${t('TUIConversation.Image')}]`;
|
|
69
|
+
break;
|
|
70
|
+
case MessageType.AUDIO:
|
|
71
|
+
messageContent = `[${t('TUIConversation.Audio')}]`;
|
|
72
|
+
break;
|
|
73
|
+
case MessageType.VIDEO:
|
|
74
|
+
messageContent = `[${t('TUIConversation.Video')}]`;
|
|
75
|
+
break;
|
|
76
|
+
case MessageType.FILE:
|
|
77
|
+
messageContent = `[${t('TUIConversation.File')}]`;
|
|
78
|
+
break;
|
|
79
|
+
case MessageType.CUSTOM: {
|
|
80
|
+
const data = safeJSONParse(payload?.data, { businessID: undefined });
|
|
81
|
+
// Handle CallKit signaling message
|
|
82
|
+
if (data?.businessID === 1) {
|
|
83
|
+
try {
|
|
84
|
+
messageContent = parseCallMessageText(typedLastMessage, t);
|
|
85
|
+
} catch {
|
|
86
|
+
messageContent = `[${t('TUIConversation.call_message')}]`;
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
messageContent = `[${t('TUIConversation.Custom')}]`;
|
|
90
|
+
}
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
case MessageType.LOCATION:
|
|
94
|
+
messageContent = `[${t('TUIConversation.Location')}]`;
|
|
95
|
+
break;
|
|
96
|
+
case MessageType.FACE:
|
|
97
|
+
messageContent = `[${t('TUIConversation.Face')}]`;
|
|
98
|
+
break;
|
|
99
|
+
case MessageType.MERGER:
|
|
100
|
+
messageContent = `[${t('TUIConversation.Chat History')}]`;
|
|
101
|
+
break;
|
|
102
|
+
case MessageType.GRP_TIP:
|
|
103
|
+
return resolveGroupTipMessage(typedLastMessage)?.text;
|
|
104
|
+
default:
|
|
105
|
+
messageContent = `[${t('TUIConversation.unknown_message')}]`;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
54
108
|
}
|
|
109
|
+
|
|
110
|
+
if (isGroupConversation) {
|
|
111
|
+
let senderName = '';
|
|
112
|
+
if (lastMessage?.fromAccount === TUIChatEngine.getMyUserID()) {
|
|
113
|
+
senderName = t('TUIConversation.me');
|
|
114
|
+
} else {
|
|
115
|
+
// Priority: friendRemark > nameCard > nick > userID
|
|
116
|
+
senderName = conversation.remark
|
|
117
|
+
|| typedLastMessage?.nameCard
|
|
118
|
+
|| lastMessage?.nick
|
|
119
|
+
|| lastMessage.fromAccount;
|
|
120
|
+
}
|
|
121
|
+
return senderName ? `${senderName}: ${messageContent}` : messageContent;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return messageContent;
|
|
55
125
|
};
|
|
@@ -64,7 +64,16 @@ export default {
|
|
|
64
64
|
'File': 'File',
|
|
65
65
|
'Custom': 'Custom',
|
|
66
66
|
'Location': 'Location',
|
|
67
|
-
'
|
|
67
|
+
'Face': 'Face',
|
|
68
68
|
'Chat History': 'Chat History',
|
|
69
|
+
'call_message': 'Call Message',
|
|
70
|
+
'unknown_message': 'Unknown Message',
|
|
71
|
+
'me': 'Me',
|
|
72
|
+
'recalled_a_message': 'recalled a message',
|
|
73
|
+
'you_have_been_removed_from_the_group': 'You have been removed from the group by the group administrator',
|
|
74
|
+
'the_group_chat_has_been_disbanded': 'The group chat has been disbanded',
|
|
75
|
+
'you_have_left_the_group_chat': 'You have left the group chat',
|
|
76
|
+
'someone_at_me': 'You were mentioned',
|
|
77
|
+
'at_all': '@All',
|
|
69
78
|
},
|
|
70
79
|
};
|
|
@@ -64,7 +64,16 @@ export default {
|
|
|
64
64
|
'File': '文件',
|
|
65
65
|
'Custom': '自定义消息',
|
|
66
66
|
'Location': '位置',
|
|
67
|
-
'
|
|
67
|
+
'Face': '动画表情',
|
|
68
68
|
'Chat History': '聊天记录',
|
|
69
|
+
'call_message': '通话消息',
|
|
70
|
+
'unknown_message': '消息',
|
|
71
|
+
'me': '我',
|
|
72
|
+
'recalled_a_message': '撤回了一条消息',
|
|
73
|
+
'you_have_been_removed_from_the_group': '你已被群管理员移出该群',
|
|
74
|
+
'the_group_chat_has_been_disbanded': '该群聊已解散',
|
|
75
|
+
'you_have_left_the_group_chat': '你已退出该群聊',
|
|
76
|
+
'someone_at_me': '有人@我',
|
|
77
|
+
'at_all': '@所有人',
|
|
69
78
|
},
|
|
70
79
|
};
|
|
@@ -16,60 +16,57 @@
|
|
|
16
16
|
<IconClose
|
|
17
17
|
:class="styles['quoted__message__preview__close']"
|
|
18
18
|
size="16"
|
|
19
|
-
@click="
|
|
19
|
+
@click="handleCloseQuotedMessage"
|
|
20
20
|
/>
|
|
21
21
|
</div>
|
|
22
22
|
</template>
|
|
23
23
|
|
|
24
24
|
<script setup lang="ts">
|
|
25
|
-
import { watch } from 'vue';
|
|
26
|
-
import TencentCloudChat from '@tencentcloud/chat';
|
|
25
|
+
import { watch, onUnmounted } from 'vue';
|
|
27
26
|
import { useUIKit, IconClose } from '@tencentcloud/uikit-base-component-vue3';
|
|
28
|
-
import { useConversationListState } from '../../../states/ConversationListState';
|
|
29
27
|
import { useMessageActionState } from '../../../states/MessageActionState';
|
|
30
28
|
import { useMessageInputState } from '../../../states/MessageInputState';
|
|
29
|
+
import { MessageType } from '../../../types/engine';
|
|
30
|
+
import { transformTextWithEmojiKeyToName } from '../../../utils';
|
|
31
31
|
import styles from './QuotedMessagePreview.module.scss';
|
|
32
|
-
import type {
|
|
32
|
+
import type { MessageModel } from '../../../types/engine';
|
|
33
33
|
|
|
34
34
|
const { t } = useUIKit();
|
|
35
|
-
const { activeConversation } = useConversationListState();
|
|
36
35
|
const { focusEditor } = useMessageInputState();
|
|
37
36
|
const { quotedMessage, clearQuotedMessage } = useMessageActionState();
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
onUnmounted(() => {
|
|
39
|
+
clearQuotedMessage();
|
|
40
|
+
});
|
|
41
|
+
|
|
40
42
|
watch(quotedMessage, (newVal) => {
|
|
41
43
|
if (newVal) {
|
|
42
44
|
focusEditor();
|
|
43
45
|
}
|
|
44
46
|
});
|
|
45
47
|
|
|
46
|
-
|
|
47
|
-
watch(activeConversation, () => {
|
|
48
|
-
clearQuotedMessage();
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
const handleClose = () => {
|
|
48
|
+
const handleCloseQuotedMessage = () => {
|
|
52
49
|
clearQuotedMessage();
|
|
53
50
|
};
|
|
54
51
|
|
|
55
|
-
const calculateReferenceContent = (message:
|
|
52
|
+
const calculateReferenceContent = (message: MessageModel | undefined): string => {
|
|
56
53
|
if (!message) {
|
|
57
54
|
return 'no reference';
|
|
58
55
|
}
|
|
59
56
|
switch (message.type) {
|
|
60
|
-
case
|
|
61
|
-
return message.payload?.text;
|
|
62
|
-
case
|
|
57
|
+
case MessageType.TEXT:
|
|
58
|
+
return transformTextWithEmojiKeyToName(message.payload?.text || '');
|
|
59
|
+
case MessageType.IMAGE:
|
|
63
60
|
return t('MessageInput.image');
|
|
64
|
-
case
|
|
61
|
+
case MessageType.AUDIO:
|
|
65
62
|
return t('MessageInput.audio');
|
|
66
|
-
case
|
|
63
|
+
case MessageType.VIDEO:
|
|
67
64
|
return t('MessageInput.video');
|
|
68
|
-
case
|
|
65
|
+
case MessageType.FILE:
|
|
69
66
|
return t('MessageInput.file');
|
|
70
|
-
case
|
|
67
|
+
case MessageType.LOCATION:
|
|
71
68
|
return t('MessageInput.location');
|
|
72
|
-
case
|
|
69
|
+
case MessageType.CUSTOM:
|
|
73
70
|
return t('MessageInput.custom_message');
|
|
74
71
|
default:
|
|
75
72
|
return t('MessageInput.unknown');
|
|
@@ -39,7 +39,9 @@
|
|
|
39
39
|
height: 20px;
|
|
40
40
|
user-select: text;
|
|
41
41
|
pointer-events: none;
|
|
42
|
+
vertical-align: bottom;
|
|
42
43
|
}
|
|
44
|
+
|
|
43
45
|
.message-image {
|
|
44
46
|
display: inline-block;
|
|
45
47
|
width: 100px;
|
|
@@ -57,3 +59,26 @@
|
|
|
57
59
|
pointer-events: none;
|
|
58
60
|
}
|
|
59
61
|
|
|
62
|
+
// Mention tag styles (Telegram-style)
|
|
63
|
+
.uikit-message-input-mention-tag {
|
|
64
|
+
display: inline;
|
|
65
|
+
padding: 2px 4px;
|
|
66
|
+
margin: 0 2px;
|
|
67
|
+
border-radius: 4px;
|
|
68
|
+
background-color: rgba(0, 122, 255, 0.1);
|
|
69
|
+
color: #007AFF;
|
|
70
|
+
font-weight: 500;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
user-select: none;
|
|
73
|
+
white-space: nowrap;
|
|
74
|
+
|
|
75
|
+
&:hover {
|
|
76
|
+
background-color: rgba(0, 122, 255, 0.15);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Selected state (when backspacing)
|
|
80
|
+
&.ProseMirror-selectednode {
|
|
81
|
+
background-color: rgba(0, 122, 255, 0.2);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|