tuikit-atomicx-vue3 5.8.2 → 5.9.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/components/ASRTools/components/RealtimeMessageList.js +82 -0
- package/dist/components/ASRTools/components/RealtimeMessageList.vue.d.ts +19 -0
- package/dist/components/ASRTools/components/Subtitle.js +85 -0
- package/dist/components/ASRTools/components/Subtitle.vue.d.ts +45 -0
- package/dist/components/ASRTools/index.d.ts +2 -2
- package/dist/components/ASRTools/index.js +2 -2
- package/dist/components/ASRTools/utils/display.d.ts +7 -0
- package/dist/components/ASRTools/utils/display.js +45 -0
- package/dist/components/BarrageInput/TextEditor/index.js +64 -51
- package/dist/components/ChatSetting/C2CChatSetting/C2CChatSetting.js +114 -74
- package/dist/components/ChatSetting/Divider/Divider.js +2 -2
- package/dist/components/ChatSetting/GroupChatSetting/GroupActions/GroupActions.js +124 -84
- package/dist/components/ChatSetting/GroupChatSetting/GroupChatSetting.js +1 -1
- package/dist/components/ChatSetting/i18n/en-US.d.ts +4 -0
- package/dist/components/ChatSetting/i18n/en-US.js +4 -0
- package/dist/components/ChatSetting/i18n/index.d.ts +8 -0
- package/dist/components/ChatSetting/i18n/zh-CN.d.ts +4 -0
- package/dist/components/ChatSetting/i18n/zh-CN.js +4 -0
- package/dist/components/CoHostPanel/ConnectionPanel.js +55 -55
- package/dist/components/CoHostPanel/RecommendHostList.js +36 -43
- package/dist/components/ContactList/i18n/en-US.d.ts +1 -0
- package/dist/components/ContactList/i18n/en-US.js +4 -3
- package/dist/components/ContactList/i18n/zh-CN.d.ts +1 -0
- package/dist/components/ContactList/i18n/zh-CN.js +2 -1
- package/dist/components/LiveGift/LiveGiftH5/LiveGift.js +18 -18
- package/dist/components/LiveGift/LiveGiftPC/LiveGift.js +7 -7
- package/dist/components/LiveScenePanel/CameraSettingDialog.js +226 -100
- package/dist/components/LiveScenePanel/i18n/en-US/index.d.ts +2 -0
- package/dist/components/LiveScenePanel/i18n/en-US/index.js +2 -0
- package/dist/components/LiveScenePanel/i18n/zh-CN/index.d.ts +2 -0
- package/dist/components/LiveScenePanel/i18n/zh-CN/index.js +2 -0
- package/dist/components/LiveScenePanel/index.js +47 -47
- package/dist/components/LiveView/DefaultAutoPlayPrompt.js +41 -0
- package/dist/components/LiveView/DefaultAutoPlayPrompt.vue.d.ts +19 -0
- package/dist/components/LiveView/DefaultStreamViewUI.js +45 -45
- package/dist/components/LiveView/OverlayState.d.ts +59 -0
- package/dist/components/LiveView/OverlayState.js +66 -0
- package/dist/components/LiveView/PlayerControl/PlayerControl.js +74 -72
- package/dist/components/LiveView/PlayerControl/PlayerControlState.d.ts +3 -0
- package/dist/components/LiveView/PlayerControl/PlayerControlState.js +144 -151
- package/dist/components/LiveView/PlayerControl/utils/videoReadyObserver.d.ts +21 -0
- package/dist/components/LiveView/PlayerControl/utils/videoReadyObserver.js +30 -0
- package/dist/components/LiveView/i18n/en-US/index.d.ts +2 -0
- package/dist/components/LiveView/i18n/en-US/index.js +5 -3
- package/dist/components/LiveView/i18n/zh-CN/index.d.ts +2 -0
- package/dist/components/LiveView/i18n/zh-CN/index.js +3 -1
- package/dist/components/LiveView/index.d.ts +47 -28
- package/dist/components/LiveView/index.js +235 -205
- package/dist/components/LiveView/index.vue.d.ts +26 -15
- package/dist/components/MessageInput/MessageInput.vue.d.ts +1 -1
- package/dist/components/MessageInput/index.d.ts +15 -15
- package/dist/components/MessageList/Message/AudioMessage/AudioMessage.js +40 -34
- package/dist/components/MessageList/Message/CustomMessage/CustomMessage.js +38 -29
- package/dist/components/MessageList/Message/FaceMessage/FaceMessage.js +16 -13
- package/dist/components/MessageList/Message/FileMessage/FileMessage.js +19 -16
- package/dist/components/MessageList/Message/ImageMessage/ImageMessage.js +1 -1
- package/dist/components/MessageList/Message/MessageLayout/MessageBubble/MessageBubble.js +17 -18
- package/dist/components/MessageList/Message/MessageLayout/MessageLayout.js +11 -11
- package/dist/components/MessageList/Message/MessageLayout/useMessageLayoutClasses.js +17 -19
- package/dist/components/MessageList/Message/TextMessage/TextMessage.js +49 -44
- package/dist/components/MessageList/Message/VideoMessage/VideoMessage.js +1 -1
- package/dist/components/RoomView/usePlayStream/useStreamPostion.js +22 -14
- package/dist/components/ScheduleRoomPanel/ScheduleRoomPanel.js +108 -104
- package/dist/components/StreamMixer/LocalMixer/index.js +43 -41
- package/dist/components/UserPicker/index.d.ts +8 -8
- package/dist/index.js +196 -195
- package/dist/report/MetricsKey.d.ts +18 -14
- package/dist/report/MetricsKey.js +1 -1
- package/dist/states/AITranscriberState/AITranscriberState.d.ts +10 -2
- package/dist/states/AITranscriberState/AITranscriberState.js +117 -71
- package/dist/states/BattleState/BattleState.d.ts +5 -1
- package/dist/states/BattleState/BattleState.js +54 -51
- package/dist/states/C2CSettingState/C2CSettingState.d.ts +1 -0
- package/dist/states/C2CSettingState/C2CSettingState.js +42 -35
- package/dist/states/CoHostState/CoHostState.d.ts +44 -7
- package/dist/states/CoHostState/CoHostState.js +188 -132
- package/dist/states/ContactListState/ContactListState.js +165 -160
- package/dist/states/GroupSettingState/GroupSettingState.d.ts +1 -0
- package/dist/states/GroupSettingState/GroupSettingState.js +99 -90
- package/dist/states/LiveAudienceState.d.ts +3 -2
- package/dist/states/LiveAudienceState.js +160 -124
- package/dist/states/LiveGiftState/LiveGiftState.d.ts +99 -2
- package/dist/states/LiveGiftState/LiveGiftState.js +148 -38
- package/dist/states/LiveListState/LiveListState.d.ts +17 -1
- package/dist/states/LiveListState/LiveListState.js +193 -156
- package/dist/states/LiveMonitorState/api/http.js +759 -734
- package/dist/states/LivePlayerState/LivePlayerState.js +87 -85
- package/dist/states/LiveSeatState/index.d.ts +5 -0
- package/dist/states/LiveSeatState/index.js +15 -12
- package/dist/states/LiveSeatState/seatEventManager.d.ts +2 -0
- package/dist/states/LiveSeatState/seatEventManager.js +83 -52
- package/dist/states/LiveSeatState/seatManager.d.ts +8 -2
- package/dist/states/LiveSeatState/seatManager.js +21 -15
- package/dist/states/LiveSeatState/store.d.ts +2 -1
- package/dist/states/LiveSeatState/store.js +10 -9
- package/dist/states/LiveSeatState/usePlayStream/useStreamPostion.js +24 -16
- package/dist/states/VideoMixerState/VideoMixerState.d.ts +33 -24
- package/dist/states/VideoMixerState/VideoMixerState.js +280 -162
- package/dist/styles/index.css +1 -1
- package/dist/subEntry/live/index.js +146 -145
- package/dist/subEntry/room/index.js +133 -132
- package/dist/subEntry/room/room.js +2 -2
- package/dist/types/asr.d.ts +51 -1
- package/dist/types/audience.d.ts +131 -4
- package/dist/types/audience.js +2 -2
- package/dist/types/barrage.d.ts +12 -2
- package/dist/types/battle.d.ts +295 -9
- package/dist/types/battle.js +3 -3
- package/dist/types/coGuest.d.ts +321 -1
- package/dist/types/coHost.d.ts +136 -18
- package/dist/types/gift.d.ts +131 -2
- package/dist/types/index.js +59 -58
- package/dist/types/live.d.ts +97 -2
- package/dist/types/login.d.ts +118 -2
- package/dist/types/seat.d.ts +85 -12
- package/dist/types/seat.js +5 -4
- package/dist/types/videoMixer.d.ts +10 -1
- package/package.json +4 -4
- package/src/components/ASRTools/{RealtimeMessageList.vue → components/RealtimeMessageList.vue} +36 -6
- package/src/components/ASRTools/components/Subtitle.vue +257 -0
- package/src/components/ASRTools/index.ts +2 -3
- package/src/components/ASRTools/utils/display.ts +104 -0
- package/src/components/BarrageInput/TextEditor/TextEditor.vue +26 -0
- package/src/components/ChatSetting/C2CChatSetting/C2CChatSetting.vue +58 -1
- package/src/components/ChatSetting/Divider/Divider.vue +1 -1
- package/src/components/ChatSetting/GroupChatSetting/GroupActions/GroupActions.vue +47 -3
- package/src/components/ChatSetting/GroupChatSetting/GroupChatSetting.vue +23 -0
- package/src/components/ChatSetting/i18n/en-US.ts +4 -0
- package/src/components/ChatSetting/i18n/zh-CN.ts +4 -0
- package/src/components/CoHostPanel/ConnectionPanel.vue +33 -10
- package/src/components/CoHostPanel/RecommendHostList.vue +4 -12
- package/src/components/ContactList/i18n/en-US.ts +1 -0
- package/src/components/ContactList/i18n/zh-CN.ts +1 -0
- package/src/components/LiveGift/LiveGiftH5/LiveGift.vue +2 -2
- package/src/components/LiveGift/LiveGiftPC/LiveGift.vue +2 -2
- package/src/components/LiveScenePanel/CameraSettingDialog.vue +347 -58
- package/src/components/LiveScenePanel/i18n/en-US/index.ts +2 -0
- package/src/components/LiveScenePanel/i18n/zh-CN/index.ts +2 -0
- package/src/components/LiveScenePanel/index.vue +1 -1
- package/src/components/LiveView/DefaultAutoPlayPrompt.vue +107 -0
- package/src/components/LiveView/DefaultStreamViewUI.vue +16 -5
- package/src/components/LiveView/OverlayState.ts +211 -0
- package/src/components/LiveView/PlayerControl/PlayerControl.vue +7 -1
- package/src/components/LiveView/PlayerControl/PlayerControlState.ts +14 -14
- package/src/components/LiveView/PlayerControl/utils/videoReadyObserver.ts +106 -0
- package/src/components/LiveView/i18n/en-US/index.ts +4 -2
- package/src/components/LiveView/i18n/zh-CN/index.ts +2 -0
- package/src/components/LiveView/index.ts +1 -0
- package/src/components/LiveView/index.vue +148 -22
- package/src/components/MessageList/Message/AudioMessage/AudioMessage.vue +10 -1
- package/src/components/MessageList/Message/CustomMessage/CustomMessage.vue +15 -3
- package/src/components/MessageList/Message/FaceMessage/FaceMessage.vue +9 -1
- package/src/components/MessageList/Message/FileMessage/FileMessage.vue +6 -3
- package/src/components/MessageList/Message/ImageMessage/ImageMessage.vue +3 -2
- package/src/components/MessageList/Message/MessageLayout/MessageBubble/MessageBubble.vue +4 -31
- package/src/components/MessageList/Message/MessageLayout/MessageLayout.vue +0 -4
- package/src/components/MessageList/Message/MessageLayout/useMessageLayoutClasses.ts +0 -2
- package/src/components/MessageList/Message/TextMessage/TextMessage.vue +9 -1
- package/src/components/MessageList/Message/VideoMessage/VideoMessage.vue +3 -2
- package/src/components/MessageList/Message/_bubble-mixins.scss +23 -0
- package/src/components/RoomView/usePlayStream/useStreamPostion.ts +28 -5
- package/src/components/ScheduleRoomPanel/ScheduleRoomPanel.vue +3 -3
- package/src/components/StreamMixer/LocalMixer/index.vue +3 -1
- package/src/report/MetricsKey.ts +18 -14
- package/src/types/asr.ts +55 -1
- package/src/types/audience.ts +135 -3
- package/src/types/barrage.ts +12 -2
- package/src/types/battle.ts +296 -9
- package/src/types/coGuest.ts +325 -1
- package/src/types/coHost.ts +138 -19
- package/src/types/gift.ts +135 -9
- package/src/types/live.ts +98 -2
- package/src/types/login.ts +119 -2
- package/src/types/seat.ts +87 -12
- package/src/types/videoMixer.ts +7 -1
- package/dist/components/ASRTools/RealtimeMessageList.js +0 -72
- package/dist/components/ASRTools/RealtimeMessageList.vue.d.ts +0 -2
- package/dist/components/ASRTools/Subtitle.js +0 -51
- package/dist/components/ASRTools/Subtitle.vue.d.ts +0 -2
- package/dist/components/ASRTools/utils.d.ts +0 -1
- package/dist/components/ASRTools/utils.js +0 -8
- package/src/components/ASRTools/Subtitle.vue +0 -134
- package/src/components/ASRTools/utils.ts +0 -8
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { defineComponent as x, ref as M, computed as u, onMounted as B, watch as C, nextTick as R, openBlock as r, createElementBlock as o, Fragment as m, renderList as p, createElementVNode as d, toDisplayString as f, unref as T, normalizeClass as $ } from "vue";
|
|
2
|
+
import { formatTimestampToTime as A } from "../../../utils/utils.js";
|
|
3
|
+
import { hasDisplayableText as E, getDisplayName as F, getMessageDisplayLines as H } from "../utils/display.js";
|
|
4
|
+
import { useAITranscriberState as N } from "../../../states/AITranscriberState/AITranscriberState.js";
|
|
5
|
+
import { _ as w } from "../../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
+
const U = { class: "title" }, q = { class: "speaker" }, z = { class: "timestamp" }, G = 60 * 1e3, V = /* @__PURE__ */ x({
|
|
7
|
+
__name: "RealtimeMessageList",
|
|
8
|
+
props: {
|
|
9
|
+
targetLanguage: {},
|
|
10
|
+
displayMode: {}
|
|
11
|
+
},
|
|
12
|
+
setup(y) {
|
|
13
|
+
const s = M(), c = M(!1), v = y, { realtimeMessageList: g } = N(), k = u(() => v.targetLanguage || ""), L = u(() => v.displayMode || "translation"), D = () => {
|
|
14
|
+
if (!s.value)
|
|
15
|
+
return !1;
|
|
16
|
+
const { scrollTop: a, scrollHeight: i, clientHeight: e } = s.value;
|
|
17
|
+
return Math.ceil(a + e) >= i - 50;
|
|
18
|
+
}, _ = () => {
|
|
19
|
+
!s.value || c.value || requestAnimationFrame(() => {
|
|
20
|
+
s.value && (s.value.scrollTop = s.value.scrollHeight);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
B(() => {
|
|
24
|
+
_();
|
|
25
|
+
});
|
|
26
|
+
const b = () => {
|
|
27
|
+
s.value && (c.value = !D());
|
|
28
|
+
}, I = u(() => {
|
|
29
|
+
const a = [
|
|
30
|
+
...g.value.filter((t) => E(t.sourceText) && typeof t.timestamp == "number" && Number.isFinite(t.timestamp))
|
|
31
|
+
].sort((t, n) => (t.timestamp ?? 0) - (n.timestamp ?? 0));
|
|
32
|
+
if (a.length === 0)
|
|
33
|
+
return [];
|
|
34
|
+
const i = [];
|
|
35
|
+
let e = null;
|
|
36
|
+
return a.forEach((t) => {
|
|
37
|
+
const n = t.speakerUserId || "unknown", l = t.timestamp ?? 0;
|
|
38
|
+
!e || n !== e.sender || l - e.startMsTs > G ? (e = {
|
|
39
|
+
sender: n,
|
|
40
|
+
startMsTs: l,
|
|
41
|
+
messages: [t]
|
|
42
|
+
}, i.push(e)) : e.messages.push(t);
|
|
43
|
+
}), i;
|
|
44
|
+
}), S = (a) => H(
|
|
45
|
+
a,
|
|
46
|
+
k.value,
|
|
47
|
+
L.value
|
|
48
|
+
);
|
|
49
|
+
return C(() => g.value.length, () => {
|
|
50
|
+
R(() => {
|
|
51
|
+
c.value || _();
|
|
52
|
+
});
|
|
53
|
+
}), (a, i) => (r(), o("div", {
|
|
54
|
+
ref_key: "conversationContainerRef",
|
|
55
|
+
ref: s,
|
|
56
|
+
class: "conversation",
|
|
57
|
+
onScroll: b
|
|
58
|
+
}, [
|
|
59
|
+
(r(!0), o(m, null, p(I.value, (e) => (r(), o("div", {
|
|
60
|
+
key: `${e.sender}-${e.startMsTs}`,
|
|
61
|
+
class: "conversation-group"
|
|
62
|
+
}, [
|
|
63
|
+
d("div", U, [
|
|
64
|
+
d("span", q, f(T(F)(e.sender)), 1),
|
|
65
|
+
d("span", z, f(T(A)(e.startMsTs)), 1)
|
|
66
|
+
]),
|
|
67
|
+
(r(!0), o(m, null, p(e.messages, (t, n) => (r(), o("div", {
|
|
68
|
+
key: t.segmentId || n,
|
|
69
|
+
class: "content"
|
|
70
|
+
}, [
|
|
71
|
+
(r(!0), o(m, null, p(S(t), (l, h) => (r(), o("div", {
|
|
72
|
+
key: `${t.segmentId || n}-${h}`,
|
|
73
|
+
class: $(["content-line", { secondary: h > 0 }])
|
|
74
|
+
}, f(l), 3))), 128))
|
|
75
|
+
]))), 128))
|
|
76
|
+
]))), 128))
|
|
77
|
+
], 544));
|
|
78
|
+
}
|
|
79
|
+
}), Q = /* @__PURE__ */ w(V, [["__scopeId", "data-v-90c83e3e"]]);
|
|
80
|
+
export {
|
|
81
|
+
Q as default
|
|
82
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SubtitleDisplayMode } from '../../../types/asr';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
targetLanguage?: string;
|
|
5
|
+
displayMode?: SubtitleDisplayMode;
|
|
6
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
7
|
+
targetLanguage?: string;
|
|
8
|
+
displayMode?: SubtitleDisplayMode;
|
|
9
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
12
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
13
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
14
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
15
|
+
} : {
|
|
16
|
+
type: import('vue').PropType<T[K]>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { defineComponent as D, ref as x, computed as c, onMounted as N, onUnmounted as R, openBlock as o, createElementBlock as a, createElementVNode as l, renderSlot as U, createCommentVNode as d, Fragment as j, renderList as B, unref as _, toDisplayString as u } from "vue";
|
|
2
|
+
import { getMessageDisplayLines as O, getDisplayName as y } from "../utils/display.js";
|
|
3
|
+
import { useAITranscriberState as V } from "../../../states/AITranscriberState/AITranscriberState.js";
|
|
4
|
+
import { RealtimeTranscriberEvent as h } from "../../../types/asr.js";
|
|
5
|
+
import { _ as $ } from "../../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
+
const w = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "asr-subtitle"
|
|
9
|
+
}, A = { class: "subtitle-panel" }, F = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "subtitle-actions"
|
|
12
|
+
}, H = { class: "subtitle-scroll" }, q = ["title"], z = { class: "subtitle-content" }, G = { class: "subtitle-text primary" }, J = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "subtitle-text secondary"
|
|
15
|
+
}, K = /* @__PURE__ */ D({
|
|
16
|
+
__name: "Subtitle",
|
|
17
|
+
props: {
|
|
18
|
+
targetLanguage: { default: "" },
|
|
19
|
+
displayMode: { default: "translation" }
|
|
20
|
+
},
|
|
21
|
+
setup(M) {
|
|
22
|
+
const p = M, { subscribeEvent: T, unsubscribeEvent: I } = V(), i = x({}), n = {}, r = {}, L = c(() => p.targetLanguage), m = c(() => p.displayMode), k = (e, t) => {
|
|
23
|
+
n[e] && clearTimeout(n[e]), n[e] = setTimeout(t, 3e3);
|
|
24
|
+
}, S = (e) => {
|
|
25
|
+
const { speakerUserId: t } = e, s = i.value[t], C = r[t];
|
|
26
|
+
if (e.isCompleted && C === e.segmentId)
|
|
27
|
+
return;
|
|
28
|
+
if (!e.isCompleted) {
|
|
29
|
+
n[t] && (clearTimeout(n[t]), delete n[t]), delete r[t], i.value[t] = e;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const E = !s || s.segmentId !== e.segmentId || !s.isCompleted;
|
|
33
|
+
i.value[t] = e, E && (r[t] = e.segmentId, k(t, () => {
|
|
34
|
+
var g, f;
|
|
35
|
+
(g = i.value[t]) != null && g.isCompleted && ((f = i.value[t]) == null ? void 0 : f.segmentId) === e.segmentId && delete i.value[t], delete n[t], delete r[t];
|
|
36
|
+
}));
|
|
37
|
+
}, v = (e) => {
|
|
38
|
+
S(e.message);
|
|
39
|
+
};
|
|
40
|
+
N(() => {
|
|
41
|
+
T(h.onReceiveTranscriberMessage, v);
|
|
42
|
+
});
|
|
43
|
+
const b = c(() => Object.values(i.value).sort((e, t) => (e.timestamp ?? 0) - (t.timestamp ?? 0)).map((e) => ({
|
|
44
|
+
...e,
|
|
45
|
+
lines: O(
|
|
46
|
+
e,
|
|
47
|
+
L.value,
|
|
48
|
+
m.value
|
|
49
|
+
)
|
|
50
|
+
})).filter((e) => e.lines.length).map((e) => ({
|
|
51
|
+
...e,
|
|
52
|
+
primaryLine: e.lines[0] || "",
|
|
53
|
+
secondaryLine: m.value === "bilingual" && e.lines[1] || ""
|
|
54
|
+
})).slice(-3));
|
|
55
|
+
return R(() => {
|
|
56
|
+
I(h.onReceiveTranscriberMessage, v), Object.values(n).forEach((e) => {
|
|
57
|
+
clearTimeout(e);
|
|
58
|
+
});
|
|
59
|
+
}), (e, t) => b.value.length ? (o(), a("div", w, [
|
|
60
|
+
l("div", A, [
|
|
61
|
+
e.$slots.actions ? (o(), a("div", F, [
|
|
62
|
+
U(e.$slots, "actions", {}, void 0, !0)
|
|
63
|
+
])) : d("", !0),
|
|
64
|
+
l("div", H, [
|
|
65
|
+
(o(!0), a(j, null, B(b.value, (s) => (o(), a("div", {
|
|
66
|
+
key: s.speakerUserId,
|
|
67
|
+
class: "subtitle-item"
|
|
68
|
+
}, [
|
|
69
|
+
l("span", {
|
|
70
|
+
class: "subtitle-speaker",
|
|
71
|
+
title: _(y)(s.speakerUserId)
|
|
72
|
+
}, u(_(y)(s.speakerUserId)) + ":", 9, q),
|
|
73
|
+
l("div", z, [
|
|
74
|
+
l("span", G, u(s.primaryLine), 1),
|
|
75
|
+
s.secondaryLine ? (o(), a("span", J, u(s.secondaryLine), 1)) : d("", !0)
|
|
76
|
+
])
|
|
77
|
+
]))), 128))
|
|
78
|
+
])
|
|
79
|
+
])
|
|
80
|
+
])) : d("", !0);
|
|
81
|
+
}
|
|
82
|
+
}), Z = /* @__PURE__ */ $(K, [["__scopeId", "data-v-5305179d"]]);
|
|
83
|
+
export {
|
|
84
|
+
Z as default
|
|
85
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { SubtitleDisplayMode } from '../../../types/asr';
|
|
2
|
+
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
actions?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
7
|
+
targetLanguage?: string;
|
|
8
|
+
displayMode?: SubtitleDisplayMode;
|
|
9
|
+
}>, {
|
|
10
|
+
targetLanguage: string;
|
|
11
|
+
displayMode: string;
|
|
12
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
13
|
+
targetLanguage?: string;
|
|
14
|
+
displayMode?: SubtitleDisplayMode;
|
|
15
|
+
}>, {
|
|
16
|
+
targetLanguage: string;
|
|
17
|
+
displayMode: string;
|
|
18
|
+
}>>> & Readonly<{}>, {
|
|
19
|
+
targetLanguage: string;
|
|
20
|
+
displayMode: SubtitleDisplayMode;
|
|
21
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
22
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
25
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
26
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
27
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
28
|
+
} : {
|
|
29
|
+
type: import('vue').PropType<T[K]>;
|
|
30
|
+
required: true;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
type __VLS_WithDefaults<P, D> = {
|
|
34
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
35
|
+
default: D[K];
|
|
36
|
+
}> : P[K];
|
|
37
|
+
};
|
|
38
|
+
type __VLS_Prettify<T> = {
|
|
39
|
+
[K in keyof T]: T[K];
|
|
40
|
+
} & {};
|
|
41
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
42
|
+
new (): {
|
|
43
|
+
$slots: S;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as RealtimeMessageList } from './RealtimeMessageList.vue';
|
|
2
|
-
import { default as Subtitle } from './Subtitle.vue';
|
|
1
|
+
import { default as RealtimeMessageList } from './components/RealtimeMessageList.vue';
|
|
2
|
+
import { default as Subtitle } from './components/Subtitle.vue';
|
|
3
3
|
|
|
4
4
|
export { Subtitle, RealtimeMessageList };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { default as a } from "./RealtimeMessageList.js";
|
|
2
|
-
import { default as f } from "./Subtitle.js";
|
|
1
|
+
import { default as a } from "./components/RealtimeMessageList.js";
|
|
2
|
+
import { default as f } from "./components/Subtitle.js";
|
|
3
3
|
export {
|
|
4
4
|
a as RealtimeMessageList,
|
|
5
5
|
f as Subtitle
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SubtitleDisplayMode, TranscriberLanguage, TranscriberMessage } from '../../../types';
|
|
2
|
+
|
|
3
|
+
export declare const getDisplayName: (userId: string) => string;
|
|
4
|
+
export declare const hasDisplayableText: (value: unknown) => boolean;
|
|
5
|
+
export declare const getTranslationText: (message: TranscriberMessage, targetLanguage: TranscriberLanguage | "") => string;
|
|
6
|
+
export declare const hasTranslationText: (message: TranscriberMessage) => boolean;
|
|
7
|
+
export declare const getMessageDisplayLines: (message: TranscriberMessage, targetLanguage: TranscriberLanguage | "", displayMode: SubtitleDisplayMode) => string[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import l from "../../../states/RoomParticipantState/index.js";
|
|
2
|
+
const { participantList: u } = l(), a = (t) => {
|
|
3
|
+
if (typeof t == "string")
|
|
4
|
+
return t.trim();
|
|
5
|
+
if (typeof t == "number" || typeof t == "boolean")
|
|
6
|
+
return String(t).trim();
|
|
7
|
+
if (t && typeof t == "object") {
|
|
8
|
+
const n = t.text ?? t.translationText ?? t.value;
|
|
9
|
+
if (typeof n == "string" || typeof n == "number" || typeof n == "boolean")
|
|
10
|
+
return String(n).trim();
|
|
11
|
+
}
|
|
12
|
+
return "";
|
|
13
|
+
}, d = (t) => {
|
|
14
|
+
const n = u.value.find((r) => r.userId === t);
|
|
15
|
+
return (n == null ? void 0 : n.nameCard) || (n == null ? void 0 : n.userName) || (n == null ? void 0 : n.userId) || t;
|
|
16
|
+
}, c = (t) => !!a(t), x = (t) => t ? t instanceof Map ? t.size : Array.isArray(t) ? t.length : 0 : 0, T = (t, n) => {
|
|
17
|
+
if (!n || !t.translationTexts)
|
|
18
|
+
return "";
|
|
19
|
+
if (t.translationTexts instanceof Map) {
|
|
20
|
+
const r = String(n).toLowerCase(), o = Array.from(t.translationTexts.entries()).find(
|
|
21
|
+
([s]) => String(s).toLowerCase() === r
|
|
22
|
+
), e = Array.from(t.translationTexts.values()).find((s) => c(s));
|
|
23
|
+
return a((o == null ? void 0 : o[1]) || e);
|
|
24
|
+
}
|
|
25
|
+
if (Array.isArray(t.translationTexts)) {
|
|
26
|
+
const r = t.translationTexts, o = String(n).toLowerCase(), e = r.find((i) => {
|
|
27
|
+
var f;
|
|
28
|
+
return ((f = i == null ? void 0 : i.language) == null ? void 0 : f.toLowerCase()) === o;
|
|
29
|
+
}), s = r.find((i) => c(i == null ? void 0 : i.text));
|
|
30
|
+
return a(
|
|
31
|
+
(e == null ? void 0 : e.text) || (s == null ? void 0 : s.text)
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
return "";
|
|
35
|
+
}, g = (t) => x(t.translationTexts) > 0, p = (t, n, r) => {
|
|
36
|
+
const o = a(t.sourceText), e = a(T(t, n));
|
|
37
|
+
return r === "translation" ? [o || e].filter(Boolean) : [o, e].filter(Boolean);
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
d as getDisplayName,
|
|
41
|
+
p as getMessageDisplayLines,
|
|
42
|
+
T as getTranslationText,
|
|
43
|
+
c as hasDisplayableText,
|
|
44
|
+
g as hasTranslationText
|
|
45
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useUIKit as
|
|
3
|
-
import { useMessageInputState as
|
|
4
|
-
import { ERROR_MESSAGE as
|
|
5
|
-
import { createEditor as
|
|
6
|
-
import
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as M, ref as g, computed as V, watch as l, nextTick as L, onMounted as U, onUnmounted as A, openBlock as c, createElementBlock as p, normalizeClass as n, unref as i, createElementVNode as E, renderSlot as I, createCommentVNode as B, toDisplayString as D } from "vue";
|
|
2
|
+
import { useUIKit as N, TUIToast as $ } from "@tencentcloud/uikit-base-component-vue3";
|
|
3
|
+
import { useMessageInputState as z } from "../MessageInputState.js";
|
|
4
|
+
import { ERROR_MESSAGE as G } from "../constants.js";
|
|
5
|
+
import { createEditor as O } from "./EditorCore.js";
|
|
6
|
+
import P from "../../../states/ConversationListState/ConversationListState.js";
|
|
7
|
+
const q = "_disabled_jp6u3_13", C = "_editor_jp6u3_30", s = {
|
|
8
8
|
"input-wrapper": "_input-wrapper_jp6u3_1",
|
|
9
|
-
disabled:
|
|
9
|
+
disabled: q,
|
|
10
10
|
"input-prefix": "_input-prefix_jp6u3_17",
|
|
11
11
|
"input-suffix": "_input-suffix_jp6u3_23",
|
|
12
|
-
editor:
|
|
12
|
+
editor: C,
|
|
13
13
|
"disabled-editor": "_disabled-editor_jp6u3_39"
|
|
14
|
-
},
|
|
14
|
+
}, Z = /* @__PURE__ */ M({
|
|
15
15
|
__name: "TextEditor",
|
|
16
16
|
props: {
|
|
17
17
|
autoFocus: { type: Boolean, default: !0 },
|
|
@@ -20,80 +20,93 @@ const G = "_disabled_jp6u3_13", O = "_editor_jp6u3_30", i = {
|
|
|
20
20
|
maxLength: {}
|
|
21
21
|
},
|
|
22
22
|
emits: ["focus", "blur"],
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
let
|
|
26
|
-
const
|
|
27
|
-
const t =
|
|
28
|
-
!t || e.disabled || t.dataset.editorCreated || (
|
|
23
|
+
setup(F, { emit: R }) {
|
|
24
|
+
const o = F, f = R, { t: m } = N(), { activeConversation: S } = P(), { inputRawValue: j, updateRawValue: k, sendMessage: T, setEditorInstance: _, setContent: b } = z(), d = g(null), v = g(o.autoFocus), u = V(() => o.placeholder || m("BarrageInput.saySomething"));
|
|
25
|
+
let r = null;
|
|
26
|
+
const h = (e) => {
|
|
27
|
+
const t = d.value;
|
|
28
|
+
!t || e.disabled || t.dataset.editorCreated || (r = O({
|
|
29
29
|
element: t,
|
|
30
|
-
placeholder:
|
|
30
|
+
placeholder: u.value,
|
|
31
31
|
autoFocus: e.autoFocus,
|
|
32
32
|
disabled: e.disabled,
|
|
33
33
|
maxLength: e.maxLength,
|
|
34
34
|
onUpdate: (a) => {
|
|
35
|
-
|
|
35
|
+
k(a);
|
|
36
36
|
},
|
|
37
37
|
onEnter: async () => {
|
|
38
38
|
try {
|
|
39
|
-
const a =
|
|
40
|
-
|
|
39
|
+
const a = j.value;
|
|
40
|
+
b(""), await T(a);
|
|
41
41
|
} catch (a) {
|
|
42
|
-
|
|
43
|
-
message:
|
|
42
|
+
$.error({
|
|
43
|
+
message: m(G[a.code] || "BarrageInput.sendFailed")
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
onFocus: () => {
|
|
48
48
|
var a;
|
|
49
|
-
|
|
49
|
+
v.value = !0, navigator && "virtualKeyboard" in navigator && ((a = navigator == null ? void 0 : navigator.virtualKeyboard) == null || a.show()), f("focus");
|
|
50
50
|
},
|
|
51
51
|
onBlur: () => {
|
|
52
52
|
var a;
|
|
53
|
-
|
|
53
|
+
v.value = !1, navigator && "virtualKeyboard" in navigator && ((a = navigator == null ? void 0 : navigator.virtualKeyboard) == null || a.hide()), f("blur");
|
|
54
54
|
}
|
|
55
|
-
}), t.dataset.editorCreated = "true",
|
|
56
|
-
},
|
|
55
|
+
}), t.dataset.editorCreated = "true", _(r));
|
|
56
|
+
}, x = () => {
|
|
57
57
|
var e;
|
|
58
|
-
|
|
58
|
+
r == null || r.destroy(), (e = d.value) == null || e.removeAttribute("data-editor-created"), _(null);
|
|
59
|
+
}, w = (e) => {
|
|
60
|
+
var a, y;
|
|
61
|
+
if (!r)
|
|
62
|
+
return;
|
|
63
|
+
const t = (y = (a = r.extensionManager) == null ? void 0 : a.extensions) == null ? void 0 : y.find(
|
|
64
|
+
(K) => K.name === "placeholder"
|
|
65
|
+
);
|
|
66
|
+
t && (t.options.placeholder = e, r.view.dispatch(r.state.tr));
|
|
59
67
|
};
|
|
60
|
-
return
|
|
61
|
-
() =>
|
|
68
|
+
return l(
|
|
69
|
+
() => o.disabled,
|
|
62
70
|
async (e, t) => {
|
|
63
|
-
e !== t && (e ?
|
|
71
|
+
e !== t && (e ? x() : (await L(), h(o)));
|
|
64
72
|
}
|
|
65
|
-
),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
), l(
|
|
74
|
+
u,
|
|
75
|
+
(e) => {
|
|
76
|
+
!r || o.disabled || w(e);
|
|
77
|
+
}
|
|
78
|
+
), U(() => {
|
|
79
|
+
h(o);
|
|
80
|
+
}), A(() => {
|
|
81
|
+
x();
|
|
82
|
+
}), l(S, (e, t) => {
|
|
83
|
+
(e == null ? void 0 : e.conversationID) !== (t == null ? void 0 : t.conversationID) && b("");
|
|
84
|
+
}), (e, t) => (c(), p("div", {
|
|
85
|
+
class: n([i(s)["input-wrapper"], o.disabled && i(s).disabled])
|
|
73
86
|
}, [
|
|
74
|
-
|
|
75
|
-
class:
|
|
87
|
+
E("div", {
|
|
88
|
+
class: n(i(s)["input-prefix"])
|
|
76
89
|
}, [
|
|
77
|
-
|
|
90
|
+
I(e.$slots, "prefix")
|
|
78
91
|
], 2),
|
|
79
|
-
|
|
92
|
+
o.disabled ? B("", !0) : (c(), p("div", {
|
|
80
93
|
key: 0,
|
|
81
94
|
ref_key: "editorRef",
|
|
82
|
-
ref:
|
|
83
|
-
class:
|
|
95
|
+
ref: d,
|
|
96
|
+
class: n(i(s).editor)
|
|
84
97
|
}, null, 2)),
|
|
85
|
-
|
|
98
|
+
o.disabled ? (c(), p("div", {
|
|
86
99
|
key: 1,
|
|
87
|
-
class:
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
class:
|
|
100
|
+
class: n([i(s)["disabled-editor"]])
|
|
101
|
+
}, D(u.value), 3)) : B("", !0),
|
|
102
|
+
E("span", {
|
|
103
|
+
class: n(i(s)["input-suffix"])
|
|
91
104
|
}, [
|
|
92
|
-
|
|
105
|
+
I(e.$slots, "suffix")
|
|
93
106
|
], 2)
|
|
94
107
|
], 2));
|
|
95
108
|
}
|
|
96
109
|
});
|
|
97
110
|
export {
|
|
98
|
-
|
|
111
|
+
Z as TextEditor
|
|
99
112
|
};
|