tuikit-atomicx-vue3 4.3.1 → 4.4.0
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/{MessageInput.vue_vue_type_script_setup_true_lang-D1G-LitO.js → MessageInput.vue_vue_type_script_setup_true_lang-D9jiYNFu.js} +31 -31
- package/dist/chat/index.d.ts +35 -35
- package/dist/chat/server.js +15 -15
- package/dist/components/ContactList/ContactInfo/BlacklistInfo/BlacklistInfo.js +6 -6
- package/dist/components/ContactList/ContactInfo/ContactInfo.js +1 -1
- package/dist/components/ContactList/ContactInfo/FriendApplicationInfo/FriendApplicationInfo.js +1 -1
- package/dist/components/ContactList/ContactInfo/FriendInfo/FriendInfo.js +9 -9
- package/dist/components/ContactList/ContactInfo/GroupApplicationInfo/GroupApplicationInfo.js +1 -1
- package/dist/components/ContactList/ContactInfo/GroupInfo/GroupInfo.js +4 -4
- package/dist/components/ContactList/ContactInfo/SearchGroupInfo/SearchGroupInfo.js +8 -8
- package/dist/components/ContactList/ContactInfo/SearchUserInfo/SearchUserInfo.js +7 -7
- package/dist/components/ContactList/ContactList.js +7 -7
- package/dist/components/ContactList/ContactListItem/BlacklistItem/BlacklistItem.js +8 -8
- package/dist/components/ContactList/ContactListItem/FriendApplicationItem/FriendApplicationItem.js +5 -5
- package/dist/components/ContactList/ContactListItem/FriendItem/FriendItem.js +5 -5
- package/dist/components/ContactList/ContactListItem/GroupApplicationItem/GroupApplicationItem.js +1 -1
- package/dist/components/ContactList/ContactListItem/GroupItem/GroupItem.js +1 -1
- package/dist/components/ContactList/ContactSearch/ContactSearch.js +6 -6
- package/dist/components/ConversationList/ConversationCreate/ConversationCreate.js +9 -9
- package/dist/components/ConversationList/ConversationList.js +4 -4
- package/dist/components/ConversationList/ConversationList.vue.d.ts +10 -10
- package/dist/components/ConversationList/ConversationPreview/ConversationPreview.vue.d.ts +10 -10
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.js +20 -20
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue.d.ts +2 -2
- package/dist/components/ConversationList/ConversationPreview/index.js +1 -1
- package/dist/components/ConversationList/index.d.ts +30 -30
- package/dist/components/MessageInput/EmojiPicker/EmojiPicker.js +88 -84
- package/dist/components/MessageInput/MessageInput.js +1 -1
- package/dist/components/MessageInput/MessageInput.vue.d.ts +2 -2
- package/dist/components/MessageInput/TextEditor/EditorCore.d.ts +2 -1
- package/dist/components/MessageInput/TextEditor/EditorCore.js +23 -21
- package/dist/components/MessageInput/TextEditor/TextEditor.vue.d.ts +2 -2
- package/dist/components/MessageInput/TextEditor/index.js +32 -31
- package/dist/components/MessageInput/index.d.ts +6 -6
- package/dist/components/MessageInput/index.js +1 -1
- package/dist/components/MessageList/Message/AudioMessage/WaveForm.js +24 -34
- package/dist/components/MessageList/Message/CustomMessage/CallMessage/CallMessage.js +29 -28
- package/dist/components/MessageList/Message/Message.vue.d.ts +1 -1
- package/dist/components/MessageList/MessageList.js +8 -6
- package/dist/components/MessageList/index.d.ts +2 -2
- package/dist/hooks/useAudioControl.d.ts +3 -3
- package/dist/hooks/useAudioControl.js +32 -30
- package/dist/rtc/server.js +45 -40
- package/dist/states/LoginState.d.ts +23 -0
- package/dist/states/LoginState.js +34 -39
- package/dist/states/MessageInputState/MessageInputState.d.ts +41 -7
- package/dist/states/MessageInputState/MessageInputState.js +60 -59
- package/dist/states/MessageInputState/utils.d.ts +8 -1
- package/dist/states/MessageInputState/utils.js +30 -10
- package/dist/styles/index.css +1 -1
- package/dist/utils/call.js +1 -1
- package/package.json +1 -1
- package/src/chat/server.ts +0 -1
- package/src/components/ContactList/ContactInfo/BlacklistInfo/BlacklistInfo.vue +1 -1
- package/src/components/ContactList/ContactInfo/ContactInfo.vue +1 -1
- package/src/components/ContactList/ContactInfo/FriendApplicationInfo/FriendApplicationInfo.vue +1 -1
- package/src/components/ContactList/ContactInfo/FriendInfo/FriendInfo.vue +1 -1
- package/src/components/ContactList/ContactInfo/GroupApplicationInfo/GroupApplicationInfo.vue +1 -1
- package/src/components/ContactList/ContactInfo/GroupInfo/GroupInfo.vue +1 -1
- package/src/components/ContactList/ContactInfo/SearchGroupInfo/SearchGroupInfo.vue +1 -1
- package/src/components/ContactList/ContactInfo/SearchUserInfo/SearchUserInfo.vue +1 -1
- package/src/components/ContactList/ContactList.vue +1 -1
- package/src/components/ContactList/ContactListItem/BlacklistItem/BlacklistItem.vue +1 -1
- package/src/components/ContactList/ContactListItem/FriendApplicationItem/FriendApplicationItem.vue +1 -1
- package/src/components/ContactList/ContactListItem/FriendItem/FriendItem.vue +1 -1
- package/src/components/ContactList/ContactListItem/GroupApplicationItem/GroupApplicationItem.vue +1 -1
- package/src/components/ContactList/ContactListItem/GroupItem/GroupItem.vue +1 -1
- package/src/components/ContactList/ContactSearch/ContactSearch.vue +1 -1
- package/src/components/ConversationList/ConversationActions/ConversationActions.vue +1 -1
- package/src/components/ConversationList/ConversationCreate/ConversationCreate.vue +2 -2
- package/src/components/ConversationList/ConversationCreate/ConversationCreateButton/ConversationCreateButton.vue +1 -1
- package/src/components/ConversationList/ConversationCreate/ConversationCreateGroupDetail/ConversationCreateGroupDetail.vue +1 -1
- package/src/components/ConversationList/ConversationCreate/ConversationCreateUserSelectList/ConversationCreateUserSelectList.vue +1 -1
- package/src/components/ConversationList/ConversationCreate/ConversationGroupTypeInfo/ConversationGroupTypeInfo.vue +1 -1
- package/src/components/ConversationList/ConversationList.vue +2 -2
- package/src/components/ConversationList/ConversationListContent/ConversationListContent.vue +1 -1
- package/src/components/ConversationList/ConversationListHeader/ConversationListHeader.vue +1 -1
- package/src/components/ConversationList/ConversationPlaceHolder/ConversationPlaceHolder.vue +1 -1
- package/src/components/ConversationList/ConversationPreview/ConversationPreview.vue +1 -1
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.vue +1 -1
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.vue +1 -1
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue +1 -1
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue +3 -3
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewUnread.vue +1 -1
- package/src/components/ConversationList/ConversationSearch/ConversationSearch.vue +1 -1
- package/src/components/MessageInput/EmojiPicker/EmojiPicker.vue +7 -3
- package/src/components/MessageInput/MessageInput.module.scss +1 -0
- package/src/components/MessageInput/MessageInput.vue +1 -1
- package/src/components/MessageInput/TextEditor/EditorCore.ts +4 -2
- package/src/components/MessageInput/TextEditor/TextEditor.vue +3 -4
- package/src/components/MessageList/Message/AudioMessage/WaveForm.vue +20 -37
- package/src/components/MessageList/Message/CustomMessage/CallMessage/CallMessage.vue +1 -1
- package/src/components/MessageList/Message/Message.vue +1 -1
- package/src/components/MessageList/MessageList.vue +2 -0
- package/src/components/Search/Search.vue +1 -1
- package/src/components/Search/SearchAdvanced/DateRangePicker/DateRangePicker.vue +1 -1
- package/src/components/Search/SearchAdvanced/MessageAdvanced/MessageAdvanced.vue +1 -1
- package/src/components/Search/SearchAdvanced/SearchAdvanced.vue +1 -1
- package/src/components/Search/SearchAdvanced/SearchTab/SearchTab.vue +1 -1
- package/src/components/Search/SearchAdvanced/Slider/Slider.vue +1 -1
- package/src/components/Search/SearchAdvanced/UserAdvanced/UserAdvanced.vue +1 -1
- package/src/components/Search/SearchBar/SearchBar.vue +1 -1
- package/src/components/Search/SearchResults/EmptyResult/EmptyResult.vue +1 -1
- package/src/components/Search/SearchResults/Loading/Loading.vue +1 -1
- package/src/components/Search/SearchResults/SearchResults.vue +1 -1
- package/src/components/Search/SearchResults/SearchResultsItem/Conversation/Conversation.vue +1 -1
- package/src/components/Search/SearchResults/SearchResultsItem/Group/Group.vue +1 -1
- package/src/components/Search/SearchResults/SearchResultsItem/Message/Message.vue +1 -1
- package/src/components/Search/SearchResults/SearchResultsItem/SearchResultsItem.vue +1 -1
- package/src/components/Search/SearchResults/SearchResultsItem/User/User.vue +1 -1
- package/src/hooks/useAudioControl.ts +17 -4
- package/src/rtc/server.ts +4 -0
- package/src/utils/call.ts +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as
|
|
1
|
+
import { S as x, P as d, E as y, I as o } from "../../../index-DTi1fL-x.js";
|
|
2
2
|
import { E as M } from "../../../index-BfIEeWMg.js";
|
|
3
3
|
import { MessageContentType as n } from "../../../states/MessageInputState/type.js";
|
|
4
|
-
function
|
|
4
|
+
function T() {
|
|
5
5
|
return o.extend({
|
|
6
6
|
name: n.EMOJI,
|
|
7
7
|
inline: !0,
|
|
@@ -18,7 +18,7 @@ function y() {
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function b() {
|
|
22
22
|
return o.extend({
|
|
23
23
|
addOptions() {
|
|
24
24
|
var t;
|
|
@@ -59,7 +59,7 @@ function p(t) {
|
|
|
59
59
|
}
|
|
60
60
|
function c(t) {
|
|
61
61
|
return t != null && t.content ? t.content.flatMap((e) => {
|
|
62
|
-
var a, s,
|
|
62
|
+
var a, s, u, r;
|
|
63
63
|
switch (e.type) {
|
|
64
64
|
case "text":
|
|
65
65
|
return e.text ? [{
|
|
@@ -76,8 +76,8 @@ function c(t) {
|
|
|
76
76
|
type: n.EMOJI,
|
|
77
77
|
content: {
|
|
78
78
|
url: (s = e.attrs) == null ? void 0 : s.src,
|
|
79
|
-
key: (
|
|
80
|
-
text: (
|
|
79
|
+
key: (u = e.attrs) == null ? void 0 : u.alt,
|
|
80
|
+
text: (r = e.attrs) == null ? void 0 : r.title
|
|
81
81
|
}
|
|
82
82
|
}];
|
|
83
83
|
case "hardBreak":
|
|
@@ -91,38 +91,40 @@ function c(t) {
|
|
|
91
91
|
}
|
|
92
92
|
}) : [];
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function D({
|
|
95
95
|
element: t,
|
|
96
96
|
placeholder: e = "",
|
|
97
97
|
autoFocus: a = !1,
|
|
98
98
|
disabled: s = !1,
|
|
99
|
+
isPlaceholderOnlyShowWhenEditable: u = !0,
|
|
99
100
|
onUpdate: r,
|
|
100
|
-
onEnter:
|
|
101
|
-
onFocus:
|
|
102
|
-
onBlur:
|
|
101
|
+
onEnter: f,
|
|
102
|
+
onFocus: E,
|
|
103
|
+
onBlur: l
|
|
103
104
|
}) {
|
|
104
105
|
const m = {
|
|
105
106
|
element: t,
|
|
106
107
|
autofocus: a,
|
|
107
108
|
editable: !s,
|
|
108
109
|
extensions: ((i) => [
|
|
109
|
-
|
|
110
|
+
x,
|
|
110
111
|
p(i ? { onEnter: i } : void 0),
|
|
111
|
-
y(),
|
|
112
112
|
T(),
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
b(),
|
|
114
|
+
d.configure({
|
|
115
|
+
placeholder: e,
|
|
116
|
+
showOnlyWhenEditable: u
|
|
115
117
|
})
|
|
116
|
-
])(
|
|
118
|
+
])(f),
|
|
117
119
|
onUpdate: ({ editor: i }) => {
|
|
118
|
-
const
|
|
119
|
-
r == null || r(
|
|
120
|
+
const g = c(i.getJSON());
|
|
121
|
+
r == null || r(g);
|
|
120
122
|
},
|
|
121
|
-
onFocus:
|
|
122
|
-
onBlur:
|
|
123
|
+
onFocus: E,
|
|
124
|
+
onBlur: l
|
|
123
125
|
};
|
|
124
|
-
return new
|
|
126
|
+
return new y(m);
|
|
125
127
|
}
|
|
126
128
|
export {
|
|
127
|
-
|
|
129
|
+
D as createEditor
|
|
128
130
|
};
|
|
@@ -10,11 +10,11 @@ declare function __VLS_template(): {
|
|
|
10
10
|
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TextEditorProps>, {
|
|
11
11
|
autoFocus: boolean;
|
|
12
12
|
disabled: boolean;
|
|
13
|
-
placeholder:
|
|
13
|
+
placeholder: undefined;
|
|
14
14
|
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TextEditorProps>, {
|
|
15
15
|
autoFocus: boolean;
|
|
16
16
|
disabled: boolean;
|
|
17
|
-
placeholder:
|
|
17
|
+
placeholder: undefined;
|
|
18
18
|
}>>> & Readonly<{}>, {
|
|
19
19
|
placeholder: string;
|
|
20
20
|
disabled: boolean;
|
|
@@ -1,67 +1,68 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useUIKit as
|
|
1
|
+
import { defineComponent as I, ref as p, onMounted as F, onUnmounted as g, watch as c, createElementBlock as f, openBlock as m, normalizeClass as d, unref as a, createElementVNode as _, renderSlot as h } from "vue";
|
|
2
|
+
import { useUIKit as B } from "@tencentcloud/uikit-base-component-vue3";
|
|
3
3
|
import { createEditor as S } from "./EditorCore.js";
|
|
4
|
-
import { useMessageInputState as
|
|
5
|
-
import { useConversationListState as
|
|
6
|
-
const
|
|
4
|
+
import { useMessageInputState as k } from "../../../states/MessageInputState/MessageInputState.js";
|
|
5
|
+
import { useConversationListState as M } from "../../../states/ConversationListState/ConversationListState.js";
|
|
6
|
+
const D = "_disabled_ihh75_11", R = "_editor_ihh75_21", o = {
|
|
7
7
|
"input-wrapper": "_input-wrapper_ihh75_1",
|
|
8
|
-
disabled:
|
|
8
|
+
disabled: D,
|
|
9
9
|
"input-prefix": "_input-prefix_ihh75_15",
|
|
10
10
|
"input-suffix": "_input-suffix_ihh75_16",
|
|
11
|
-
editor:
|
|
12
|
-
},
|
|
11
|
+
editor: R
|
|
12
|
+
}, $ = /* @__PURE__ */ I({
|
|
13
13
|
__name: "TextEditor",
|
|
14
14
|
props: {
|
|
15
15
|
autoFocus: { type: Boolean, default: !0 },
|
|
16
16
|
disabled: { type: Boolean, default: !1 },
|
|
17
|
-
placeholder: { default:
|
|
17
|
+
placeholder: { default: void 0 }
|
|
18
18
|
},
|
|
19
19
|
setup(b) {
|
|
20
|
-
const t = b, { t: x } =
|
|
20
|
+
const t = b, { t: x } = B(), { activeConversation: E } = M(), { updateRawValue: v, sendMessage: y, setEditorInstance: n, setContent: r } = k(), l = p(null), u = p(t.autoFocus);
|
|
21
21
|
let s = null;
|
|
22
|
-
return
|
|
23
|
-
const e =
|
|
22
|
+
return F(() => {
|
|
23
|
+
const e = l.value;
|
|
24
24
|
e && (e.classList.add("message-input"), e.dataset.editorCreated || (s = S({
|
|
25
25
|
element: e,
|
|
26
|
-
placeholder:
|
|
26
|
+
placeholder: t.placeholder ?? x("MessageInput.enter_a_message"),
|
|
27
|
+
isPlaceholderOnlyShowWhenEditable: t.placeholder === void 0,
|
|
27
28
|
autoFocus: t.autoFocus,
|
|
28
29
|
disabled: t.disabled,
|
|
29
|
-
onUpdate: (
|
|
30
|
-
v(
|
|
30
|
+
onUpdate: (i) => {
|
|
31
|
+
v(i);
|
|
31
32
|
},
|
|
32
33
|
onEnter: () => {
|
|
33
|
-
|
|
34
|
+
y(), r("");
|
|
34
35
|
},
|
|
35
36
|
onFocus: () => {
|
|
36
|
-
|
|
37
|
+
u.value = !0;
|
|
37
38
|
},
|
|
38
39
|
onBlur: () => {
|
|
39
|
-
|
|
40
|
+
u.value = !1;
|
|
40
41
|
}
|
|
41
|
-
}), e.dataset.editorCreated = "true",
|
|
42
|
-
}),
|
|
43
|
-
const e =
|
|
44
|
-
s && e && (s.destroy(), e.removeAttribute("data-editor-created"),
|
|
45
|
-
}), c(E, (e,
|
|
46
|
-
(e == null ? void 0 : e.conversationID) !== (
|
|
42
|
+
}), e.dataset.editorCreated = "true", n(s)));
|
|
43
|
+
}), g(() => {
|
|
44
|
+
const e = l.value;
|
|
45
|
+
s && e && (s.destroy(), e.removeAttribute("data-editor-created"), n(null));
|
|
46
|
+
}), c(E, (e, i) => {
|
|
47
|
+
(e == null ? void 0 : e.conversationID) !== (i == null ? void 0 : i.conversationID) && r("");
|
|
47
48
|
}), c(() => t.disabled, (e) => {
|
|
48
49
|
s && (s.setEditable(!e), e && r(""));
|
|
49
|
-
}), (e,
|
|
50
|
-
class: d([
|
|
50
|
+
}), (e, i) => (m(), f("div", {
|
|
51
|
+
class: d([a(o)["input-wrapper"], t.disabled && a(o).disabled])
|
|
51
52
|
}, [
|
|
52
53
|
_("div", {
|
|
53
|
-
class: d(
|
|
54
|
+
class: d(a(o)["input-prefix"])
|
|
54
55
|
}, [
|
|
55
56
|
h(e.$slots, "inputPrefix")
|
|
56
57
|
], 2),
|
|
57
58
|
(m(), f("div", {
|
|
58
59
|
ref_key: "editorDomRef",
|
|
59
|
-
ref:
|
|
60
|
+
ref: l,
|
|
60
61
|
key: t.disabled ? "disabled" : "enabled",
|
|
61
|
-
class: d(
|
|
62
|
+
class: d(a(o).editor)
|
|
62
63
|
}, null, 2)),
|
|
63
64
|
_("div", {
|
|
64
|
-
class: d(
|
|
65
|
+
class: d(a(o)["input-suffix"])
|
|
65
66
|
}, [
|
|
66
67
|
h(e.$slots, "inputSuffix")
|
|
67
68
|
], 2)
|
|
@@ -69,5 +70,5 @@ const T = "_disabled_ihh75_11", U = "_editor_ihh75_21", o = {
|
|
|
69
70
|
}
|
|
70
71
|
});
|
|
71
72
|
export {
|
|
72
|
-
|
|
73
|
+
$ as TextEditor
|
|
73
74
|
};
|
|
@@ -5,7 +5,7 @@ declare const MessageInput: {
|
|
|
5
5
|
};
|
|
6
6
|
placeholder: {
|
|
7
7
|
type: import('vue').PropType<string>;
|
|
8
|
-
default:
|
|
8
|
+
default: undefined;
|
|
9
9
|
};
|
|
10
10
|
disabled: {
|
|
11
11
|
type: import('vue').PropType<boolean>;
|
|
@@ -47,7 +47,7 @@ declare const MessageInput: {
|
|
|
47
47
|
};
|
|
48
48
|
placeholder: {
|
|
49
49
|
type: import('vue').PropType<string>;
|
|
50
|
-
default:
|
|
50
|
+
default: undefined;
|
|
51
51
|
};
|
|
52
52
|
disabled: {
|
|
53
53
|
type: import('vue').PropType<boolean>;
|
|
@@ -86,7 +86,7 @@ declare const MessageInput: {
|
|
|
86
86
|
};
|
|
87
87
|
placeholder: {
|
|
88
88
|
type: import('vue').PropType<string>;
|
|
89
|
-
default:
|
|
89
|
+
default: undefined;
|
|
90
90
|
};
|
|
91
91
|
disabled: {
|
|
92
92
|
type: import('vue').PropType<boolean>;
|
|
@@ -402,7 +402,7 @@ declare const TextEditor: {
|
|
|
402
402
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
403
403
|
placeholder: {
|
|
404
404
|
type: import('vue').PropType<string>;
|
|
405
|
-
default:
|
|
405
|
+
default: undefined;
|
|
406
406
|
};
|
|
407
407
|
disabled: {
|
|
408
408
|
type: import('vue').PropType<boolean>;
|
|
@@ -426,7 +426,7 @@ declare const TextEditor: {
|
|
|
426
426
|
}, Readonly<import('vue').ExtractPropTypes<{
|
|
427
427
|
placeholder: {
|
|
428
428
|
type: import('vue').PropType<string>;
|
|
429
|
-
default:
|
|
429
|
+
default: undefined;
|
|
430
430
|
};
|
|
431
431
|
disabled: {
|
|
432
432
|
type: import('vue').PropType<boolean>;
|
|
@@ -447,7 +447,7 @@ declare const TextEditor: {
|
|
|
447
447
|
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
448
448
|
placeholder: {
|
|
449
449
|
type: import('vue').PropType<string>;
|
|
450
|
-
default:
|
|
450
|
+
default: undefined;
|
|
451
451
|
};
|
|
452
452
|
disabled: {
|
|
453
453
|
type: import('vue').PropType<boolean>;
|
|
@@ -6,7 +6,7 @@ import n from "./EmojiPicker/EmojiPicker.js";
|
|
|
6
6
|
import { TextEditor as c } from "./TextEditor/index.js";
|
|
7
7
|
import s from "./AudioCallPicker/AudioCallPicker.js";
|
|
8
8
|
import a from "./VideoCallPicker/VideoCallPicker.js";
|
|
9
|
-
import { _ as p } from "../../MessageInput.vue_vue_type_script_setup_true_lang-
|
|
9
|
+
import { _ as p } from "../../MessageInput.vue_vue_type_script_setup_true_lang-D9jiYNFu.js";
|
|
10
10
|
import { addI18n as o } from "../../i18n/index.js";
|
|
11
11
|
import { resources as t } from "./i18n/index.js";
|
|
12
12
|
o("en-US", { translation: { MessageInput: t["en-US"] } });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as g, computed as
|
|
2
|
-
import { _ as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as g, computed as l, createElementBlock as a, openBlock as n, normalizeStyle as i, Fragment as w, renderList as C, unref as b, normalizeClass as y } from "vue";
|
|
2
|
+
import { _ as k } from "../../../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const x = /* @__PURE__ */ g({
|
|
4
4
|
__name: "WaveForm",
|
|
5
5
|
props: {
|
|
6
6
|
progress: {},
|
|
@@ -9,41 +9,31 @@ const F = /* @__PURE__ */ g({
|
|
|
9
9
|
},
|
|
10
10
|
emits: ["seek"],
|
|
11
11
|
setup(m, { emit: u }) {
|
|
12
|
-
const
|
|
13
|
-
width: typeof
|
|
14
|
-
})),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return (t.progress || 0) >= r;
|
|
24
|
-
}, v = i(() => ({
|
|
25
|
-
left: `${(t.progress || 0) * 100}%`
|
|
26
|
-
})), h = (e) => {
|
|
27
|
-
const s = e.currentTarget.getBoundingClientRect(), _ = (e.clientX - s.left) / s.width, w = Math.max(0, Math.min(1, _));
|
|
28
|
-
d("seek", w);
|
|
12
|
+
const e = m, f = u, d = l(() => ({
|
|
13
|
+
width: typeof e.width == "number" ? `${e.width}px` : e.width
|
|
14
|
+
})), p = Array.from({ length: e.barsCount }, () => Math.random() * 16 + 4), v = l(() => {
|
|
15
|
+
const t = e.progress || 0;
|
|
16
|
+
return t === 0 ? Array(e.barsCount).fill(!1) : Array.from({ length: e.barsCount }, (r, s) => {
|
|
17
|
+
const o = s / e.barsCount;
|
|
18
|
+
return t >= o;
|
|
19
|
+
});
|
|
20
|
+
}), _ = (t) => {
|
|
21
|
+
const r = t.currentTarget.getBoundingClientRect(), o = (t.clientX - r.left) / r.width, h = Math.max(0, Math.min(1, o));
|
|
22
|
+
f("seek", h);
|
|
29
23
|
};
|
|
30
|
-
return (
|
|
24
|
+
return (t, c) => (n(), a("div", {
|
|
31
25
|
class: "wave-form",
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
style: i(d.value),
|
|
27
|
+
onClick: _
|
|
34
28
|
}, [
|
|
35
|
-
(n(!0), a(
|
|
36
|
-
key:
|
|
37
|
-
class:
|
|
38
|
-
style:
|
|
39
|
-
}, null, 6))), 128))
|
|
40
|
-
C("div", {
|
|
41
|
-
class: "wave-form__cursor",
|
|
42
|
-
style: c(v.value)
|
|
43
|
-
}, null, 4)
|
|
29
|
+
(n(!0), a(w, null, C(b(p), (r, s) => (n(), a("div", {
|
|
30
|
+
key: s,
|
|
31
|
+
class: y(["wave-form__bar", { "wave-form__bar--active": v.value[s] }]),
|
|
32
|
+
style: i({ height: `${r}px` })
|
|
33
|
+
}, null, 6))), 128))
|
|
44
34
|
], 4));
|
|
45
35
|
}
|
|
46
|
-
}),
|
|
36
|
+
}), F = /* @__PURE__ */ k(x, [["__scopeId", "data-v-93c67ced"]]);
|
|
47
37
|
export {
|
|
48
|
-
|
|
38
|
+
F as default
|
|
49
39
|
};
|
|
@@ -1,60 +1,61 @@
|
|
|
1
|
-
import { defineComponent as v, useCssModule as
|
|
2
|
-
import { IconCall1Filled as
|
|
3
|
-
import { View as
|
|
4
|
-
import { ConversationType as
|
|
5
|
-
import { parseCallMessageText as
|
|
6
|
-
import { useConversationListState as
|
|
7
|
-
import { _ as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as v, useCssModule as k, computed as _, createBlock as l, unref as e, openBlock as c, normalizeClass as o, withCtx as u, createTextVNode as p, toDisplayString as g } from "vue";
|
|
2
|
+
import { IconCall1Filled as x, IconVideoDefaultFilled as z } from "@tencentcloud/uikit-base-component-vue3";
|
|
3
|
+
import { View as d } from "../../../../../baseComp/View/index.js";
|
|
4
|
+
import { ConversationType as f } from "../../../../../types/engine.js";
|
|
5
|
+
import { parseCallMessageText as M, parseCallMessage as T, startCall as D } from "../../../../../utils/call.js";
|
|
6
|
+
import { useConversationListState as I } from "../../../../../states/ConversationListState/ConversationListState.js";
|
|
7
|
+
import { _ as w } from "../../../../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
|
+
const V = /* @__PURE__ */ v({
|
|
9
9
|
__name: "CallMessage",
|
|
10
10
|
props: {
|
|
11
11
|
message: {}
|
|
12
12
|
},
|
|
13
|
-
setup(
|
|
14
|
-
const s =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
setup(C) {
|
|
14
|
+
const s = C, a = k(), { activeConversation: n } = I(), i = _(() => M(s.message)), t = _(() => T(s.message)), y = () => {
|
|
15
|
+
var r;
|
|
16
|
+
!n.value || !t.value || s.message.conversationType === f.GROUP || D({
|
|
17
|
+
type: t.value.data.data.call_type,
|
|
18
|
+
userIDList: [(r = n.value.userProfile) == null ? void 0 : r.userID]
|
|
18
19
|
});
|
|
19
20
|
};
|
|
20
|
-
return (
|
|
21
|
+
return (r, F) => s.message.conversationType === e(f).C2C ? (c(), l(e(d), {
|
|
21
22
|
key: 0,
|
|
22
23
|
gap: 8,
|
|
23
24
|
dir: "row",
|
|
24
25
|
class: o(e(a)["call-message-c2c"]),
|
|
25
|
-
onClick:
|
|
26
|
+
onClick: y
|
|
26
27
|
}, {
|
|
27
|
-
default:
|
|
28
|
-
var
|
|
28
|
+
default: u(() => {
|
|
29
|
+
var m;
|
|
29
30
|
return [
|
|
30
|
-
((
|
|
31
|
+
((m = t.value) == null ? void 0 : m.data.data.call_type) === 1 ? (c(), l(e(x), {
|
|
31
32
|
key: 0,
|
|
32
33
|
class: o(e(a)["call-message-c2c__icon"])
|
|
33
|
-
}, null, 8, ["class"])) : (
|
|
34
|
+
}, null, 8, ["class"])) : (c(), l(e(z), {
|
|
34
35
|
key: 1,
|
|
35
36
|
class: o(e(a)["call-message-c2c__icon"])
|
|
36
37
|
}, null, 8, ["class"])),
|
|
37
|
-
|
|
38
|
+
p(" " + g(i.value), 1)
|
|
38
39
|
];
|
|
39
40
|
}),
|
|
40
41
|
_: 1
|
|
41
|
-
}, 8, ["class"])) : (
|
|
42
|
+
}, 8, ["class"])) : (c(), l(e(d), {
|
|
42
43
|
key: 1,
|
|
43
44
|
class: o(e(a)["call-message-group"])
|
|
44
45
|
}, {
|
|
45
|
-
default:
|
|
46
|
-
|
|
46
|
+
default: u(() => [
|
|
47
|
+
p(g(i.value), 1)
|
|
47
48
|
]),
|
|
48
49
|
_: 1
|
|
49
50
|
}, 8, ["class"]));
|
|
50
51
|
}
|
|
51
|
-
}),
|
|
52
|
+
}), h = {
|
|
52
53
|
"call-message-c2c": "_call-message-c2c_u2zzk_1",
|
|
53
54
|
"call-message-c2c__icon": "_call-message-c2c__icon_u2zzk_7",
|
|
54
55
|
"call-message-group": "_call-message-group_u2zzk_11"
|
|
55
|
-
},
|
|
56
|
-
$style:
|
|
57
|
-
},
|
|
56
|
+
}, B = {
|
|
57
|
+
$style: h
|
|
58
|
+
}, O = /* @__PURE__ */ w(V, [["__cssModules", B]]);
|
|
58
59
|
export {
|
|
59
|
-
|
|
60
|
+
O as default
|
|
60
61
|
};
|
|
@@ -51,9 +51,9 @@ const ce = { class: "message-list" }, me = { class: "message-chunk" }, y = 150,
|
|
|
51
51
|
key: `chunk-${e.ID}`
|
|
52
52
|
}) : T.messages.push(e);
|
|
53
53
|
}), s;
|
|
54
|
-
}),
|
|
54
|
+
}), H = se(() => {
|
|
55
55
|
t.value && (f.value = t.value.scrollHeight - t.value.scrollTop - t.value.clientHeight, f.value > y && (p(!0), h.value = !0), f.value < y && (p(!1), h.value = !1));
|
|
56
|
-
}, 100),
|
|
56
|
+
}, 100), b = async () => {
|
|
57
57
|
v.value = !1, p(!1), h.value = !1;
|
|
58
58
|
}, X = async () => {
|
|
59
59
|
var l;
|
|
@@ -73,7 +73,7 @@ const ce = { class: "message-list" }, me = { class: "message-chunk" }, y = 150,
|
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
return A(U, () => {
|
|
76
|
-
|
|
76
|
+
b();
|
|
77
77
|
}), A(g, (l, s) => {
|
|
78
78
|
if (s === void 0 && l && !v.value) {
|
|
79
79
|
w(() => {
|
|
@@ -85,14 +85,16 @@ const ce = { class: "message-list" }, me = { class: "message-chunk" }, y = 150,
|
|
|
85
85
|
return;
|
|
86
86
|
const o = l[l.length - 1], e = s[s.length - 1];
|
|
87
87
|
(o == null ? void 0 : o.ID) !== (e == null ? void 0 : e.ID) && (o.flow === "out" || !P.value && f.value < y) && _({ behavior: "smooth" });
|
|
88
|
+
}, {
|
|
89
|
+
immediate: !0
|
|
88
90
|
}), A(() => a.enableReadReceipt, (l) => {
|
|
89
91
|
W(l);
|
|
90
92
|
}, {
|
|
91
93
|
immediate: !0
|
|
92
94
|
}), K(() => {
|
|
93
|
-
t.value && t.value.addEventListener("scroll",
|
|
95
|
+
t.value && t.value.addEventListener("scroll", H), b();
|
|
94
96
|
}), Q(() => {
|
|
95
|
-
t.value && t.value.removeEventListener("scroll",
|
|
97
|
+
t.value && t.value.removeEventListener("scroll", H);
|
|
96
98
|
}), (l, s) => (u(), C("div", ce, [
|
|
97
99
|
S("div", {
|
|
98
100
|
id: "messageScrollList",
|
|
@@ -145,7 +147,7 @@ const ce = { class: "message-list" }, me = { class: "message-chunk" }, y = 150,
|
|
|
145
147
|
}, null, 8, ["class"])) : Y("", !0)
|
|
146
148
|
]));
|
|
147
149
|
}
|
|
148
|
-
}), De = /* @__PURE__ */ ue(ge, [["__scopeId", "data-v-
|
|
150
|
+
}), De = /* @__PURE__ */ ue(ge, [["__scopeId", "data-v-ac83869e"]]);
|
|
149
151
|
export {
|
|
150
152
|
De as default
|
|
151
153
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const Message: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
2
|
message: {
|
|
3
|
-
type: import('vue').PropType<import('
|
|
3
|
+
type: import('vue').PropType<import('../..').MessageModel>;
|
|
4
4
|
required: true;
|
|
5
5
|
};
|
|
6
6
|
isLastInChunk: {
|
|
@@ -33,7 +33,7 @@ declare const Message: import('vue').DefineComponent<import('vue').ExtractPropTy
|
|
|
33
33
|
};
|
|
34
34
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
35
35
|
message: {
|
|
36
|
-
type: import('vue').PropType<import('
|
|
36
|
+
type: import('vue').PropType<import('../..').MessageModel>;
|
|
37
37
|
required: true;
|
|
38
38
|
};
|
|
39
39
|
isLastInChunk: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ref } from 'vue';
|
|
2
2
|
|
|
3
|
-
interface
|
|
3
|
+
interface UseAudioControlProps {
|
|
4
4
|
url: string;
|
|
5
5
|
audioId?: string;
|
|
6
6
|
}
|
|
7
|
-
interface
|
|
7
|
+
interface UseAudioControlReturn {
|
|
8
8
|
isPlaying: ReturnType<typeof ref<boolean>>;
|
|
9
9
|
progress: ReturnType<typeof ref<number>>;
|
|
10
10
|
duration: ReturnType<typeof ref<number | undefined>>;
|
|
@@ -22,5 +22,5 @@ interface IUseAudioControlReturn {
|
|
|
22
22
|
* @param props Configuration parameters
|
|
23
23
|
* @returns Audio control related states and methods
|
|
24
24
|
*/
|
|
25
|
-
export declare function useAudioControl(props:
|
|
25
|
+
export declare function useAudioControl(props: UseAudioControlProps): UseAudioControlReturn;
|
|
26
26
|
export {};
|
|
@@ -1,47 +1,49 @@
|
|
|
1
|
-
import { ref as l, onMounted as
|
|
2
|
-
const v = /* @__PURE__ */ new Map(),
|
|
1
|
+
import { ref as l, onMounted as I, onUnmounted as T } from "vue";
|
|
2
|
+
const v = /* @__PURE__ */ new Map(), f = "AUDIO_PLAY_EVENT", g = (c) => new CustomEvent(f, {
|
|
3
3
|
detail: { audioId: c }
|
|
4
4
|
});
|
|
5
5
|
function y(c) {
|
|
6
|
-
const { url: m } = c,
|
|
7
|
-
t.value && (window.dispatchEvent(
|
|
8
|
-
},
|
|
9
|
-
t.value && (t.value.pause(),
|
|
6
|
+
const { url: m } = c, a = c.audioId || `audio-${m}`, r = l(!1), u = l(0), n = l(void 0), o = l(!0), t = l(null), h = () => {
|
|
7
|
+
t.value && (window.dispatchEvent(g(a)), t.value.play(), r.value = !0);
|
|
8
|
+
}, E = () => {
|
|
9
|
+
t.value && (t.value.pause(), r.value = !1);
|
|
10
10
|
}, w = () => {
|
|
11
|
-
t.value && (t.value.pause(), t.value.currentTime = 0,
|
|
11
|
+
t.value && (t.value.pause(), t.value.currentTime = 0, r.value = !1, u.value = 0);
|
|
12
12
|
}, A = (e) => {
|
|
13
|
-
if (!t.value ||
|
|
13
|
+
if (!t.value || n.value === void 0)
|
|
14
14
|
return;
|
|
15
|
-
const
|
|
16
|
-
t.value.currentTime =
|
|
17
|
-
}, s = () => {
|
|
18
|
-
!t.value || !a.value || (r.value = t.value.currentTime / a.value);
|
|
15
|
+
const d = Math.max(0, Math.min(1, e));
|
|
16
|
+
t.value.currentTime = n.value * d, u.value = d;
|
|
19
17
|
}, i = () => {
|
|
20
|
-
|
|
18
|
+
!t.value || !n.value || (u.value = t.value.currentTime / n.value);
|
|
19
|
+
}, s = () => {
|
|
20
|
+
r.value = !1, u.value = 0;
|
|
21
21
|
}, L = (e) => {
|
|
22
|
-
e.detail.audioId !==
|
|
22
|
+
e.detail.audioId !== a && r.value && E();
|
|
23
23
|
};
|
|
24
|
-
return
|
|
25
|
-
window.addEventListener(
|
|
26
|
-
let e = v.get(
|
|
27
|
-
const
|
|
28
|
-
e && (
|
|
24
|
+
return I(() => {
|
|
25
|
+
window.addEventListener(f, L);
|
|
26
|
+
let e = v.get(a);
|
|
27
|
+
const d = () => {
|
|
28
|
+
e && (e.duration === 1 / 0 ? (e.currentTime = 1e101, e.ontimeupdate = () => {
|
|
29
|
+
e && (n.value = e.duration, e.ontimeupdate = null, e.currentTime = 0);
|
|
30
|
+
}) : n.value = e.duration, o.value = !1);
|
|
29
31
|
}, p = () => {
|
|
30
|
-
console.error("Audio load error:", m),
|
|
32
|
+
console.error("Audio load error:", m), o.value = !1;
|
|
31
33
|
};
|
|
32
|
-
!e || e.src !== m ? (
|
|
33
|
-
}),
|
|
34
|
-
if (window.removeEventListener(
|
|
35
|
-
const e = v.get(
|
|
36
|
-
e.removeEventListener("timeupdate",
|
|
34
|
+
!e || e.src !== m ? (o.value = !0, n.value = void 0, e && (e.pause(), e.src = "", e.load(), e.removeEventListener("loadedmetadata", d), e.removeEventListener("error", p), e.removeEventListener("timeupdate", i), e.removeEventListener("ended", s)), e = new Audio(m), e.addEventListener("loadedmetadata", d), e.addEventListener("error", p), e.addEventListener("timeupdate", i), e.addEventListener("ended", s), v.set(a, e), t.value = e, r.value = !1, u.value = 0) : (t.value = e, e.removeEventListener("timeupdate", i), e.removeEventListener("ended", s), e.addEventListener("timeupdate", i), e.addEventListener("ended", s), e.duration && (n.value = e.duration, o.value = !1));
|
|
35
|
+
}), T(() => {
|
|
36
|
+
if (window.removeEventListener(f, L), v.has(a)) {
|
|
37
|
+
const e = v.get(a);
|
|
38
|
+
e.removeEventListener("timeupdate", i), e.removeEventListener("ended", s), e.pause(), e.src = "", e.load(), v.delete(a);
|
|
37
39
|
}
|
|
38
40
|
}), {
|
|
39
|
-
isPlaying:
|
|
40
|
-
progress:
|
|
41
|
-
duration:
|
|
42
|
-
isLoading:
|
|
41
|
+
isPlaying: r,
|
|
42
|
+
progress: u,
|
|
43
|
+
duration: n,
|
|
44
|
+
isLoading: o,
|
|
43
45
|
play: h,
|
|
44
|
-
pause:
|
|
46
|
+
pause: E,
|
|
45
47
|
stop: w,
|
|
46
48
|
setProgress: A
|
|
47
49
|
};
|