tuikit-atomicx-vue3 3.4.2 → 4.3.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/.eslintrc.cjs +1 -0
- package/dist/baseComp/Modal/Modal.js +431 -23
- package/dist/chat/index.d.ts +18 -18
- package/dist/components/AudioSetting/AudioMediaControl.js +39 -41
- package/dist/components/AudioSetting/AudioSettingTab.js +10 -10
- package/dist/components/AudioSetting/MicrophoneSelect.js +8 -8
- package/dist/components/AudioSetting/SpeakerSelect.js +9 -9
- package/dist/components/AudioSettingPanel/i18n/en-US/index.d.ts +1 -0
- package/dist/components/AudioSettingPanel/i18n/en-US/index.js +2 -1
- package/dist/components/AudioSettingPanel/i18n/zh-CN/index.d.ts +1 -0
- package/dist/components/AudioSettingPanel/i18n/zh-CN/index.js +2 -1
- package/dist/components/AudioSettingPanel/index.js +81 -73
- package/dist/components/BarrageInput/BarrageInputH5.js +9 -9
- package/dist/components/BarrageInput/EmojiPicker/EmojiPicker.js +3 -3
- package/dist/components/BarrageInput/MessageInputState.d.ts +28 -0
- package/dist/components/BarrageInput/MessageInputState.js +82 -0
- package/dist/components/BarrageInput/TextEditor/CharacterCountExtension.js +1 -1
- package/dist/components/BarrageInput/TextEditor/EditorCore.js +2 -2
- package/dist/components/BarrageInput/TextEditor/index.js +7 -7
- package/dist/components/BarrageInput/type.d.ts +17 -0
- package/dist/components/BarrageInput/type.js +4 -0
- package/dist/components/BarrageInput/utils.d.ts +30 -0
- package/dist/components/BarrageInput/utils.js +41 -0
- package/dist/components/BarrageList/BarrageList.js +80 -110
- package/dist/components/BarrageList/BarrageList.vue.d.ts +0 -29
- package/dist/components/BarrageList/BarrageListH5.js +95 -122
- package/dist/components/BarrageList/BarrageListH5.vue.d.ts +0 -29
- package/dist/components/BarrageList/BarrageListState.d.ts +58 -0
- package/dist/components/BarrageList/BarrageListState.js +106 -0
- package/dist/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.js +16 -24
- package/dist/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.vue.d.ts +5 -5
- package/dist/components/BarrageList/Message/MessageLayout/MessageLayout.js +48 -73
- package/dist/components/BarrageList/Message/MessageLayout/MessageLayout.vue.d.ts +5 -7
- package/dist/components/BarrageList/Message/TextMessage/TextMessage.js +70 -76
- package/dist/components/BarrageList/Message/TextMessage/TextMessage.vue.d.ts +6 -6
- package/dist/components/BarrageList/Message/TextMessage/emoji.d.ts +5 -0
- package/dist/components/BarrageList/Message/TextMessage/emoji.js +134 -0
- package/dist/components/BarrageList/index.d.ts +0 -36
- package/dist/components/CameraButton/index.js +18 -19
- package/dist/components/CoGuestPanel/CoGuestPanel.js +60 -60
- package/dist/components/CoHostPanel/BattlePanel.js +11 -11
- package/dist/components/CoHostPanel/CoHostPanel.js +10 -10
- package/dist/components/CoHostPanel/ConfigSettingPanel.js +49 -55
- package/dist/components/CoHostPanel/ConnectionPanel.js +132 -123
- package/dist/components/CoHostPanel/RecommendHostList.js +39 -36
- package/dist/components/CoHostPanel/constants.d.ts +3 -0
- package/dist/components/CoHostPanel/constants.js +6 -0
- package/dist/components/CoHostPanel/i18n/en-US/index.d.ts +1 -0
- package/dist/components/CoHostPanel/i18n/en-US/index.js +2 -1
- package/dist/components/CoHostPanel/i18n/zh-CN/index.d.ts +1 -0
- package/dist/components/CoHostPanel/i18n/zh-CN/index.js +3 -2
- package/dist/components/LiveAudienceList/LiveAudienceList.js +44 -45
- package/dist/components/LiveAudienceList/LiveAudienceListH5.js +7 -7
- package/dist/components/LiveAudienceList/UserActionMenu.js +57 -64
- package/dist/components/LiveList/LiveList.js +23 -23
- package/dist/components/LiveList/LiveListH5.js +38 -38
- package/dist/components/LiveScenePanel/CameraSettingDialog.js +10 -10
- package/dist/components/LiveScenePanel/MaterialItem.js +15 -15
- package/dist/components/LiveScenePanel/index.js +4 -4
- package/dist/components/LiveView/CoreViewDecorate/BattleDecorate.js +58 -58
- package/dist/components/LiveView/CoreViewDecorate/BattleUserDecorate.js +6 -6
- package/dist/components/LiveView/CoreViewDecorate/CoHostDecorate.js +5 -5
- package/dist/components/LiveView/DefaultStreamViewUI.js +44 -41
- package/dist/components/LiveView/PlayerControl/AudioControl.js +20 -20
- package/dist/components/LiveView/PlayerControl/MultiResolution.js +49 -48
- package/dist/components/LiveView/PlayerControl/MultiResolution.vue.d.ts +7 -1
- package/dist/components/LiveView/PlayerControl/PlayerControl.js +90 -86
- package/dist/components/LiveView/PlayerControl/PlayerControlState.js +127 -131
- package/dist/components/LiveView/PlayerControl/utils/domHelpers.d.ts +6 -0
- package/dist/components/LiveView/PlayerControl/utils/domHelpers.js +54 -22
- package/dist/components/LiveView/i18n/en-US/index.d.ts +2 -2
- package/dist/components/LiveView/i18n/en-US/index.js +2 -2
- package/dist/components/LiveView/i18n/zh-CN/index.d.ts +2 -2
- package/dist/components/LiveView/i18n/zh-CN/index.js +2 -2
- package/dist/components/LiveView/index.js +17 -17
- package/dist/components/MessageInput/TextEditor/EditorCore.js +2 -2
- package/dist/components/MessageList/MessageList.vue.d.ts +2 -2
- package/dist/components/MessageList/index.d.ts +18 -18
- package/dist/components/MicButton/index.js +11 -11
- package/dist/components/StreamMixer/LocalMixer/MixerControl.js +12 -12
- package/dist/components/StreamMixer/LocalMixer/index.js +66 -63
- package/dist/components/StreamView/Layout/CustomLayout.js +8 -8
- package/dist/components/StreamView/Layout/FloatLayout.js +124 -127
- package/dist/components/StreamView/Layout/GridLayout.js +5 -5
- package/dist/components/StreamView/index.js +25 -33
- package/dist/components/StreamView/manager/mediaManager.js +54 -60
- package/dist/components/VideoSetting/CameraSelect.js +8 -8
- package/dist/components/VideoSetting/VideoMediaControl.js +10 -10
- package/dist/components/VideoSetting/VideoPreview.js +9 -9
- package/dist/components/VideoSetting/VideoProfile.js +6 -6
- package/dist/components/VideoSetting/VideoSettingTab.js +40 -39
- package/dist/components/VideoSettingPanel/CameraSelect.js +8 -8
- package/dist/components/VideoSettingPanel/VideoPreview.js +1 -1
- package/dist/components/VideoSettingPanel/VideoProfile.js +18 -18
- package/dist/hooks/useRoomEngine.js +6 -6
- package/dist/{index-D2OVtqc8.js → index-BfIEeWMg.js} +191 -181
- package/dist/{index-Bm-QfV5o.js → index-DTi1fL-x.js} +460 -457
- package/dist/index.js +162 -144
- package/dist/report/MetricsKey.d.ts +16 -0
- package/dist/report/MetricsKey.js +4 -0
- package/dist/report/dataReport.d.ts +12 -0
- package/dist/report/dataReport.js +45 -0
- package/dist/report/index.d.ts +4 -0
- package/dist/report/index.js +6 -0
- package/dist/rtc/index.d.ts +5 -43
- package/dist/rtc/index.js +48 -48
- package/dist/states/BarrageState/BarrageState.d.ts +74 -0
- package/dist/states/BarrageState/BarrageState.js +80 -0
- package/dist/states/BarrageState/index.d.ts +1 -0
- package/dist/states/BarrageState/index.js +5 -0
- package/dist/states/{BattleState.d.ts → BattleState/BattleState.d.ts} +10 -11
- package/dist/states/BattleState/BattleState.js +203 -0
- package/dist/states/BattleState/index.d.ts +1 -0
- package/dist/states/BattleState/index.js +4 -0
- package/dist/states/CoGuestState.d.ts +24 -94
- package/dist/states/CoGuestState.js +297 -189
- package/dist/states/CoHostState/CoHostState.d.ts +2 -2
- package/dist/states/CoHostState/CoHostState.js +135 -131
- package/dist/states/{DeviceState.d.ts → DeviceState/DeviceState.d.ts} +25 -13
- package/dist/states/DeviceState/DeviceState.js +314 -0
- package/dist/states/DeviceState/index.d.ts +1 -0
- package/dist/states/DeviceState/index.js +4 -0
- package/dist/states/LiveAudienceState.d.ts +3 -1
- package/dist/states/LiveAudienceState.js +106 -63
- package/dist/states/{LiveState/index.d.ts → LiveListState/LiveListState.d.ts} +13 -8
- package/dist/states/LiveListState/LiveListState.js +285 -0
- package/dist/states/LiveListState/index.d.ts +1 -0
- package/dist/states/LiveListState/index.js +4 -0
- package/dist/states/LiveMonitorState/api/http.js +147 -129
- package/dist/states/LiveMonitorState/index.js +67 -62
- package/dist/states/LiveSeatState/index.d.ts +46 -11
- package/dist/states/LiveSeatState/index.js +34 -15
- package/dist/states/LiveSeatState/seatEventManager.d.ts +2 -0
- package/dist/states/LiveSeatState/seatEventManager.js +63 -42
- package/dist/states/LiveSeatState/seatManager.d.ts +34 -5
- package/dist/states/LiveSeatState/seatManager.js +131 -29
- package/dist/states/LiveSeatState/store.d.ts +5 -5
- package/dist/states/LiveSeatState/store.js +12 -10
- package/dist/states/LiveSeatState/usePlayStream/RTCStreamManager.js +1 -1
- package/dist/states/LiveSeatState/usePlayStream/RTCStreamPlayer.js +1 -1
- package/dist/states/LiveSeatState/usePlayStream/index.js +30 -28
- package/dist/states/LoginState.js +39 -34
- package/dist/states/SeatStore.js +82 -83
- package/dist/states/{VideoMixerState.d.ts → VideoMixerState/VideoMixerState.d.ts} +1 -1
- package/dist/states/VideoMixerState/VideoMixerState.js +269 -0
- package/dist/states/VideoMixerState/index.d.ts +1 -0
- package/dist/states/VideoMixerState/index.js +4 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/audience.d.ts +21 -0
- package/dist/types/audience.js +4 -1
- package/dist/types/battle.d.ts +75 -3
- package/dist/types/battle.js +5 -1
- package/dist/types/coGuest.d.ts +72 -5
- package/dist/types/coGuest.js +4 -2
- package/dist/types/device.d.ts +38 -17
- package/dist/types/device.js +10 -8
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +96 -80
- package/dist/types/live.d.ts +36 -21
- package/dist/types/live.js +6 -4
- package/dist/types/seat.d.ts +23 -4
- package/dist/types/seat.js +7 -1
- package/dist/utils/eventCenter.d.ts +88 -0
- package/dist/utils/eventCenter.js +161 -0
- package/package.json +2 -2
- package/src/components/AudioSetting/AudioMediaControl.vue +1 -3
- package/src/components/AudioSetting/AudioSettingTab.vue +1 -2
- package/src/components/AudioSetting/MicrophoneSelect.vue +1 -2
- package/src/components/AudioSetting/SpeakerSelect.vue +1 -2
- package/src/components/AudioSettingPanel/i18n/en-US/index.ts +1 -0
- package/src/components/AudioSettingPanel/i18n/zh-CN/index.ts +1 -0
- package/src/components/AudioSettingPanel/index.vue +4 -2
- package/src/components/BarrageInput/BarrageInputH5.vue +1 -1
- package/src/components/BarrageInput/EmojiPicker/EmojiPicker.vue +1 -1
- package/src/components/BarrageInput/MessageInputState.ts +160 -0
- package/src/components/BarrageInput/TextEditor/TextEditor.vue +1 -1
- package/src/components/BarrageInput/type.ts +26 -0
- package/src/components/BarrageInput/utils.ts +45 -0
- package/src/components/BarrageList/BarrageList.vue +61 -117
- package/src/components/BarrageList/BarrageListH5.vue +75 -159
- package/src/components/BarrageList/BarrageListState.ts +223 -0
- package/src/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.vue +8 -55
- package/src/components/BarrageList/Message/MessageLayout/MessageLayout.vue +19 -44
- package/src/components/BarrageList/Message/TextMessage/TextMessage.vue +69 -96
- package/src/components/BarrageList/Message/TextMessage/emoji.ts +132 -0
- package/src/components/CameraButton/index.vue +0 -1
- package/src/components/CoGuestPanel/CoGuestPanel.vue +16 -91
- package/src/components/CoHostPanel/BattlePanel.vue +1 -4
- package/src/components/CoHostPanel/ConfigSettingPanel.vue +2 -8
- package/src/components/CoHostPanel/ConnectionPanel.vue +37 -33
- package/src/components/CoHostPanel/RecommendHostList.vue +12 -13
- package/src/components/CoHostPanel/constants.ts +3 -0
- package/src/components/CoHostPanel/i18n/en-US/index.ts +1 -0
- package/src/components/CoHostPanel/i18n/zh-CN/index.ts +2 -1
- package/src/components/LiveAudienceList/LiveAudienceList.vue +4 -5
- package/src/components/LiveAudienceList/LiveAudienceListH5.vue +2 -2
- package/src/components/LiveAudienceList/UserActionMenu.vue +7 -48
- package/src/components/LiveList/LiveList.vue +5 -5
- package/src/components/LiveList/LiveListH5.vue +6 -6
- package/src/components/LiveScenePanel/index.vue +2 -2
- package/src/components/LiveView/CoreViewDecorate/BattleDecorate.vue +10 -15
- package/src/components/LiveView/CoreViewDecorate/BattleUserDecorate.vue +2 -2
- package/src/components/LiveView/DefaultStreamViewUI.vue +5 -3
- package/src/components/LiveView/PlayerControl/AudioControl.vue +1 -1
- package/src/components/LiveView/PlayerControl/MultiResolution.vue +9 -3
- package/src/components/LiveView/PlayerControl/PlayerControl.vue +10 -2
- package/src/components/LiveView/PlayerControl/PlayerControlState.ts +233 -259
- package/src/components/LiveView/PlayerControl/utils/domHelpers.ts +64 -0
- package/src/components/LiveView/i18n/en-US/index.ts +2 -2
- package/src/components/LiveView/i18n/zh-CN/index.ts +2 -2
- package/src/components/LiveView/index.vue +2 -2
- package/src/components/MicButton/index.vue +3 -3
- package/src/components/StreamMixer/LocalMixer/index.vue +6 -8
- package/src/components/StreamView/Layout/CustomLayout.vue +2 -2
- package/src/components/StreamView/Layout/FloatLayout.vue +88 -83
- package/src/components/StreamView/index.vue +28 -14
- package/src/components/StreamView/manager/mediaManager.ts +38 -42
- package/src/components/VideoSetting/CameraSelect.vue +1 -2
- package/src/components/VideoSetting/VideoMediaControl.vue +1 -1
- package/src/components/VideoSetting/VideoPreview.vue +1 -2
- package/src/components/VideoSetting/VideoProfile.vue +1 -1
- package/src/components/VideoSetting/VideoSettingTab.vue +9 -5
- package/src/components/VideoSettingPanel/CameraSelect.vue +1 -2
- package/src/components/VideoSettingPanel/VideoProfile.vue +7 -7
- package/src/hooks/useRoomEngine.ts +1 -1
- package/src/report/MetricsKey.ts +16 -0
- package/src/report/dataReport.ts +55 -0
- package/src/report/index.ts +7 -0
- package/src/rtc/index.ts +7 -9
- package/src/types/audience.ts +27 -1
- package/src/types/battle.ts +87 -4
- package/src/types/coGuest.ts +87 -5
- package/src/types/device.ts +41 -16
- package/src/types/index.ts +2 -2
- package/src/types/live.ts +41 -22
- package/src/types/seat.ts +28 -4
- package/src/utils/eventCenter.ts +249 -0
- package/dist/DialogPortal-CvJcEAsn.js +0 -417
- package/dist/components/BarrageList/Message/FaceMessage/FaceMessage.js +0 -23
- package/dist/components/BarrageList/Message/FaceMessage/FaceMessage.vue.d.ts +0 -30
- package/dist/components/BarrageList/Message/FaceMessage/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/FaceMessage/index.js +0 -4
- package/dist/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.js +0 -4
- package/dist/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.vue.d.ts +0 -16
- package/dist/components/BarrageList/Message/GroupTipMessage/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/GroupTipMessage/index.js +0 -25
- package/dist/components/BarrageList/Message/ImageMessage/ImageMessage.js +0 -71
- package/dist/components/BarrageList/Message/ImageMessage/ImageMessage.vue.d.ts +0 -34
- package/dist/components/BarrageList/Message/ImageMessage/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/ImageMessage/index.js +0 -4
- package/dist/components/BarrageList/Message/MergerMessage/MergerMessage.js +0 -9
- package/dist/components/BarrageList/Message/MergerMessage/MergerMessage.vue.d.ts +0 -2
- package/dist/components/BarrageList/Message/MergerMessage/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/MergerMessage/index.js +0 -4
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageMeta.js +0 -40
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageMeta.vue.d.ts +0 -54
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageStatusIcon.js +0 -26
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageStatusIcon.vue.d.ts +0 -15
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/index.js +0 -4
- package/dist/components/BarrageList/Message/RecalledMessage/RecalledMessage.js +0 -41
- package/dist/components/BarrageList/Message/RecalledMessage/RecalledMessage.vue.d.ts +0 -35
- package/dist/components/BarrageList/Message/RecalledMessage/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/RecalledMessage/index.js +0 -4
- package/dist/components/BarrageList/MessageForward/ForwardListItem.js +0 -45
- package/dist/components/BarrageList/MessageForward/ForwardListItem.vue.d.ts +0 -17
- package/dist/components/BarrageList/MessageForward/MessageForward.js +0 -203
- package/dist/components/BarrageList/MessageForward/MessageForward.vue.d.ts +0 -2
- package/dist/components/BarrageList/MessageForward/index.d.ts +0 -3
- package/dist/components/BarrageList/MessageForward/index.js +0 -4
- package/dist/components/StreamView/Layout/MixLayout.js +0 -89
- package/dist/components/StreamView/Layout/MixLayout.vue.d.ts +0 -31
- package/dist/states/BarrageListState/BarrageListState.d.ts +0 -26
- package/dist/states/BarrageListState/BarrageListState.js +0 -122
- package/dist/states/BarrageListState/index.d.ts +0 -1
- package/dist/states/BarrageListState/index.js +0 -4
- package/dist/states/BattleState.js +0 -117
- package/dist/states/DeviceState.js +0 -296
- package/dist/states/LiveState/index.js +0 -254
- package/dist/states/VideoMixerState.js +0 -260
- package/src/components/BarrageList/Message/FaceMessage/FaceMessage.vue +0 -43
- package/src/components/BarrageList/Message/FaceMessage/index.ts +0 -3
- package/src/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.vue +0 -55
- package/src/components/BarrageList/Message/GroupTipMessage/index.ts +0 -3
- package/src/components/BarrageList/Message/ImageMessage/ImageMessage.vue +0 -181
- package/src/components/BarrageList/Message/ImageMessage/index.ts +0 -3
- package/src/components/BarrageList/Message/MergerMessage/MergerMessage.vue +0 -6
- package/src/components/BarrageList/Message/MergerMessage/index.ts +0 -3
- package/src/components/BarrageList/Message/MessageLayout/MessageMeta/MessageMeta.vue +0 -70
- package/src/components/BarrageList/Message/MessageLayout/MessageMeta/MessageStatusIcon.vue +0 -40
- package/src/components/BarrageList/Message/MessageLayout/MessageMeta/index.ts +0 -3
- package/src/components/BarrageList/Message/RecalledMessage/RecalledMessage.vue +0 -82
- package/src/components/BarrageList/Message/RecalledMessage/index.ts +0 -3
- package/src/components/BarrageList/MessageForward/ForwardListItem.vue +0 -67
- package/src/components/BarrageList/MessageForward/MessageForward.vue +0 -388
- package/src/components/BarrageList/MessageForward/index.ts +0 -3
- package/src/components/StreamView/Layout/MixLayout.vue +0 -144
|
@@ -3,8 +3,8 @@ import q from "./MicrophoneSelect.js";
|
|
|
3
3
|
import z from "./SpeakerSelect.js";
|
|
4
4
|
import { useI18n as F } from "../../locales/index.js";
|
|
5
5
|
import { TUIButton as b } from "@tencentcloud/uikit-base-component-vue3";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { MediaSettingDisplayMode as u } from "../../types/device.js";
|
|
7
|
+
import { useDeviceState as O } from "../../states/DeviceState/DeviceState.js";
|
|
8
8
|
import { _ as W } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const $ = { class: "audio-setting-tab" }, G = {
|
|
10
10
|
key: 0,
|
|
@@ -20,23 +20,23 @@ const $ = { class: "audio-setting-tab" }, G = {
|
|
|
20
20
|
setup(oe) {
|
|
21
21
|
const { t: o } = F(), {
|
|
22
22
|
captureVolume: E,
|
|
23
|
-
isMicrophoneTesting:
|
|
23
|
+
isMicrophoneTesting: d,
|
|
24
24
|
isSpeakerTesting: p,
|
|
25
25
|
startMicrophoneTest: w,
|
|
26
26
|
stopMicrophoneTest: x,
|
|
27
27
|
startSpeakerTest: A,
|
|
28
28
|
stopSpeakerTest: m
|
|
29
29
|
} = O(), t = P("audioSettingProps"), C = l(
|
|
30
|
-
() => (t == null ? void 0 : t.displayMode) ===
|
|
30
|
+
() => (t == null ? void 0 : t.displayMode) === u.IconWithPanel
|
|
31
31
|
), r = l(
|
|
32
|
-
() => (t == null ? void 0 : t.displayMode) ===
|
|
32
|
+
() => (t == null ? void 0 : t.displayMode) === u.Panel
|
|
33
33
|
), _ = l(() => r.value ? 36 : 28), N = l(
|
|
34
34
|
() => E.value * _.value / 100
|
|
35
35
|
), V = l(
|
|
36
|
-
() => C.value || r.value &&
|
|
36
|
+
() => C.value || r.value && d.value
|
|
37
37
|
);
|
|
38
38
|
function B() {
|
|
39
|
-
|
|
39
|
+
d.value ? x() : w({ interval: 200 });
|
|
40
40
|
}
|
|
41
41
|
async function D() {
|
|
42
42
|
p.value ? m() : A({ filePath: "https://web.sdk.qcloud.com/trtc/electron/download/resources/media/TestSpeaker.mp3" });
|
|
@@ -55,7 +55,7 @@ const $ = { class: "audio-setting-tab" }, G = {
|
|
|
55
55
|
onClick: B
|
|
56
56
|
}, {
|
|
57
57
|
default: y(() => [
|
|
58
|
-
g(n(e(
|
|
58
|
+
g(n(e(d) ? e(o)("Stop") : e(o)("Test")), 1)
|
|
59
59
|
]),
|
|
60
60
|
_: 1
|
|
61
61
|
})) : c("", !0)
|
|
@@ -78,7 +78,7 @@ const $ = { class: "audio-setting-tab" }, G = {
|
|
|
78
78
|
i("div", te, [
|
|
79
79
|
T(z, {
|
|
80
80
|
class: "select",
|
|
81
|
-
disabled: ((S = e(t)) == null ? void 0 : S.displayMode) === e(
|
|
81
|
+
disabled: ((S = e(t)) == null ? void 0 : S.displayMode) === e(u).Panel
|
|
82
82
|
}, null, 8, ["disabled"]),
|
|
83
83
|
r.value ? (s(), M(e(b), {
|
|
84
84
|
key: 0,
|
|
@@ -94,7 +94,7 @@ const $ = { class: "audio-setting-tab" }, G = {
|
|
|
94
94
|
]);
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
}), _e = /* @__PURE__ */ W(se, [["__scopeId", "data-v-
|
|
97
|
+
}), _e = /* @__PURE__ */ W(se, [["__scopeId", "data-v-d822f4ad"]]);
|
|
98
98
|
export {
|
|
99
99
|
_e as default
|
|
100
100
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as I, ref as _, watch as b, onBeforeMount as g, createBlock as v, openBlock as r, unref as
|
|
1
|
+
import { defineComponent as I, ref as _, watch as b, onBeforeMount as g, createBlock as v, openBlock as r, unref as c, withCtx as y, createElementBlock as M, Fragment as B, renderList as k } from "vue";
|
|
2
2
|
import w from "../../baseComp/Select/SelectPC.js";
|
|
3
3
|
import x from "../../baseComp/Option/OptionPC.js";
|
|
4
|
-
import { useDeviceState as S } from "../../states/DeviceState.js";
|
|
4
|
+
import { useDeviceState as S } from "../../states/DeviceState/DeviceState.js";
|
|
5
5
|
import { _ as L } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const V = /* @__PURE__ */ I({
|
|
7
7
|
__name: "MicrophoneSelect",
|
|
@@ -9,9 +9,9 @@ const V = /* @__PURE__ */ I({
|
|
|
9
9
|
onChange: {},
|
|
10
10
|
disabled: { type: Boolean, default: !1 }
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
12
|
+
setup(d) {
|
|
13
13
|
var u;
|
|
14
|
-
const { microphoneList: i, currentMicrophone: o, setCurrentMicrophone: m, getMicrophoneList: f } = S(), n =
|
|
14
|
+
const { microphoneList: i, currentMicrophone: o, setCurrentMicrophone: m, getMicrophoneList: f } = S(), n = d, t = _((u = o.value) == null ? void 0 : u.deviceId);
|
|
15
15
|
b(
|
|
16
16
|
() => {
|
|
17
17
|
var e;
|
|
@@ -33,18 +33,18 @@ const V = /* @__PURE__ */ I({
|
|
|
33
33
|
}
|
|
34
34
|
return g(async () => {
|
|
35
35
|
await f();
|
|
36
|
-
}), (e, l) => (r(), v(
|
|
36
|
+
}), (e, l) => (r(), v(c(w), {
|
|
37
37
|
modelValue: t.value,
|
|
38
38
|
"onUpdate:modelValue": l[0] || (l[0] = (a) => t.value = a),
|
|
39
39
|
placeholder: "placeholder",
|
|
40
40
|
class: "select",
|
|
41
|
-
disabled:
|
|
41
|
+
disabled: d.disabled,
|
|
42
42
|
teleported: !1,
|
|
43
43
|
"popper-append-to-body": !1,
|
|
44
44
|
onChange: h
|
|
45
45
|
}, {
|
|
46
46
|
default: y(() => [
|
|
47
|
-
(r(!0), M(B, null, k(
|
|
47
|
+
(r(!0), M(B, null, k(c(i), (a) => (r(), v(c(x), {
|
|
48
48
|
key: a.deviceId,
|
|
49
49
|
label: a.deviceName,
|
|
50
50
|
value: a.deviceId
|
|
@@ -53,7 +53,7 @@ const V = /* @__PURE__ */ I({
|
|
|
53
53
|
_: 1
|
|
54
54
|
}, 8, ["modelValue", "disabled"]));
|
|
55
55
|
}
|
|
56
|
-
}), U = /* @__PURE__ */ L(V, [["__scopeId", "data-v-
|
|
56
|
+
}), U = /* @__PURE__ */ L(V, [["__scopeId", "data-v-54429c40"]]);
|
|
57
57
|
export {
|
|
58
58
|
U as default
|
|
59
59
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as C, ref as I, watch as S, onBeforeMount as
|
|
1
|
+
import { defineComponent as C, ref as I, watch as S, onBeforeMount as _, createBlock as v, openBlock as d, unref as n, withCtx as b, createElementBlock as g, Fragment as y, renderList as B } from "vue";
|
|
2
2
|
import w from "../../baseComp/Select/SelectPC.js";
|
|
3
3
|
import x from "../../baseComp/Option/OptionPC.js";
|
|
4
|
-
import { useDeviceState as L } from "../../states/DeviceState.js";
|
|
4
|
+
import { useDeviceState as L } from "../../states/DeviceState/DeviceState.js";
|
|
5
5
|
import { _ as V } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const D = /* @__PURE__ */ C({
|
|
7
7
|
__name: "SpeakerSelect",
|
|
@@ -11,7 +11,7 @@ const D = /* @__PURE__ */ C({
|
|
|
11
11
|
},
|
|
12
12
|
setup(c) {
|
|
13
13
|
var i;
|
|
14
|
-
const
|
|
14
|
+
const o = c, { speakerList: u, currentSpeaker: t, setCurrentSpeaker: f, getSpeakerList: m } = L(), l = I((i = t.value) == null ? void 0 : i.deviceId);
|
|
15
15
|
S(
|
|
16
16
|
() => {
|
|
17
17
|
var e;
|
|
@@ -24,16 +24,16 @@ const D = /* @__PURE__ */ C({
|
|
|
24
24
|
);
|
|
25
25
|
async function k(e) {
|
|
26
26
|
var r, a, s, p;
|
|
27
|
-
(r =
|
|
27
|
+
(r = o.onChange) == null || r.call(o, e);
|
|
28
28
|
try {
|
|
29
29
|
await f({ deviceId: e });
|
|
30
30
|
} catch {
|
|
31
31
|
(a = t.value) != null && a.deviceId && u.value.map((h) => h.deviceId).includes((s = t.value) == null ? void 0 : s.deviceId) && (l.value = (p = t.value) == null ? void 0 : p.deviceId);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return _(async () => {
|
|
35
35
|
await m();
|
|
36
|
-
}), (e, r) => (
|
|
36
|
+
}), (e, r) => (d(), v(n(w), {
|
|
37
37
|
modelValue: l.value,
|
|
38
38
|
"onUpdate:modelValue": r[0] || (r[0] = (a) => l.value = a),
|
|
39
39
|
placeholder: "placeholder",
|
|
@@ -43,8 +43,8 @@ const D = /* @__PURE__ */ C({
|
|
|
43
43
|
"popper-append-to-body": !1,
|
|
44
44
|
onChange: k
|
|
45
45
|
}, {
|
|
46
|
-
default:
|
|
47
|
-
(
|
|
46
|
+
default: b(() => [
|
|
47
|
+
(d(!0), g(y, null, B(n(u), (a) => (d(), v(n(x), {
|
|
48
48
|
key: a.deviceId,
|
|
49
49
|
label: a.deviceName,
|
|
50
50
|
value: a.deviceId
|
|
@@ -53,7 +53,7 @@ const D = /* @__PURE__ */ C({
|
|
|
53
53
|
_: 1
|
|
54
54
|
}, 8, ["modelValue", "disabled"]));
|
|
55
55
|
}
|
|
56
|
-
}), U = /* @__PURE__ */ V(D, [["__scopeId", "data-v-
|
|
56
|
+
}), U = /* @__PURE__ */ V(D, [["__scopeId", "data-v-00c43451"]]);
|
|
57
57
|
export {
|
|
58
58
|
U as default
|
|
59
59
|
};
|
|
@@ -1,108 +1,116 @@
|
|
|
1
|
-
import { defineComponent as D, ref as
|
|
2
|
-
import { useUIKit as P, TUISelect as
|
|
3
|
-
import { useDeviceState as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { addI18n as
|
|
6
|
-
import { resource as
|
|
7
|
-
import { resource as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as D, ref as v, onMounted as E, watch as c, createElementBlock as r, openBlock as d, createElementVNode as o, createCommentVNode as g, toDisplayString as n, unref as e, createVNode as p, withCtx as U, Fragment as w, renderList as b, createBlock as y } from "vue";
|
|
2
|
+
import { useUIKit as P, TUISelect as C, TUIOption as x, TUISlider as M } from "@tencentcloud/uikit-base-component-vue3";
|
|
3
|
+
import { useDeviceState as F } from "../../states/DeviceState/DeviceState.js";
|
|
4
|
+
import { _ as K } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
import { addI18n as N } from "../../i18n/index.js";
|
|
6
|
+
import { resource as $ } from "./i18n/en-US/index.js";
|
|
7
|
+
import { resource as j } from "./i18n/zh-CN/index.js";
|
|
8
|
+
const q = { class: "audio-setting-panel" }, G = { class: "section" }, H = { class: "section-title" }, J = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "row"
|
|
11
|
+
}, Q = { class: "label" }, R = { class: "row" }, W = { class: "label" }, X = { class: "volume-value" }, Y = { class: "section" }, Z = { class: "section-title" }, ee = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "row"
|
|
14
|
+
}, te = { class: "label" }, le = { class: "row" }, oe = { class: "label" }, ae = { class: "volume-value" }, se = /* @__PURE__ */ D({
|
|
9
15
|
__name: "index",
|
|
10
|
-
setup(
|
|
11
|
-
const { t:
|
|
12
|
-
microphoneList:
|
|
13
|
-
currentMicrophone:
|
|
14
|
-
setCurrentMicrophone:
|
|
15
|
-
speakerList:
|
|
16
|
-
currentSpeaker:
|
|
17
|
-
setCurrentSpeaker:
|
|
16
|
+
setup(ne) {
|
|
17
|
+
const { t: s } = P(), {
|
|
18
|
+
microphoneList: I,
|
|
19
|
+
currentMicrophone: m,
|
|
20
|
+
setCurrentMicrophone: L,
|
|
21
|
+
speakerList: f,
|
|
22
|
+
currentSpeaker: _,
|
|
23
|
+
setCurrentSpeaker: z,
|
|
18
24
|
getMicrophoneList: B,
|
|
19
25
|
getSpeakerList: O,
|
|
20
|
-
captureVolume:
|
|
21
|
-
outputVolume:
|
|
26
|
+
captureVolume: S,
|
|
27
|
+
outputVolume: k,
|
|
22
28
|
setCaptureVolume: T,
|
|
23
29
|
setOutputVolume: A
|
|
24
|
-
} =
|
|
30
|
+
} = F(), i = v(""), u = v(""), V = v(S.value), h = v(k.value);
|
|
25
31
|
return E(async () => {
|
|
26
|
-
await B(), await O(),
|
|
27
|
-
}),
|
|
28
|
-
|
|
29
|
-
}),
|
|
30
|
-
|
|
31
|
-
}),
|
|
32
|
-
await T(
|
|
33
|
-
}),
|
|
34
|
-
await A(
|
|
35
|
-
}),
|
|
36
|
-
|
|
37
|
-
}), u
|
|
38
|
-
|
|
39
|
-
}), (
|
|
40
|
-
o("div",
|
|
41
|
-
o("div",
|
|
42
|
-
|
|
43
|
-
o("span",
|
|
44
|
-
|
|
32
|
+
await B(), await O(), m.value && (i.value = m.value.deviceId), _.value && (u.value = _.value.deviceId);
|
|
33
|
+
}), c(m, (t) => {
|
|
34
|
+
t && t.deviceId !== i.value && (i.value = t.deviceId);
|
|
35
|
+
}), c(_, (t) => {
|
|
36
|
+
t && t.deviceId !== u.value && (u.value = t.deviceId);
|
|
37
|
+
}), c(V, async (t) => {
|
|
38
|
+
await T(t);
|
|
39
|
+
}), c(h, async (t) => {
|
|
40
|
+
await A(t);
|
|
41
|
+
}), c(i, (t) => {
|
|
42
|
+
L({ deviceId: t });
|
|
43
|
+
}), c(u, (t) => {
|
|
44
|
+
z({ deviceId: t });
|
|
45
|
+
}), (t, a) => (d(), r("div", q, [
|
|
46
|
+
o("div", G, [
|
|
47
|
+
o("div", H, n(e(s)("Microphone")), 1),
|
|
48
|
+
e(I).length > 0 ? (d(), r("div", J, [
|
|
49
|
+
o("span", Q, n(e(s)("Select device")), 1),
|
|
50
|
+
p(e(C), {
|
|
45
51
|
modelValue: i.value,
|
|
46
|
-
"onUpdate:modelValue":
|
|
47
|
-
class: "select"
|
|
52
|
+
"onUpdate:modelValue": a[0] || (a[0] = (l) => i.value = l),
|
|
53
|
+
class: "select",
|
|
54
|
+
placeholder: e(s)("Unrecognized device")
|
|
48
55
|
}, {
|
|
49
|
-
default:
|
|
50
|
-
(
|
|
56
|
+
default: U(() => [
|
|
57
|
+
(d(!0), r(w, null, b(e(I), (l) => (d(), y(e(x), {
|
|
51
58
|
key: l.deviceId,
|
|
52
59
|
label: l.deviceName,
|
|
53
60
|
value: l.deviceId
|
|
54
61
|
}, null, 8, ["label", "value"]))), 128))
|
|
55
62
|
]),
|
|
56
63
|
_: 1
|
|
57
|
-
}, 8, ["modelValue"])
|
|
58
|
-
]),
|
|
59
|
-
o("div",
|
|
60
|
-
o("span",
|
|
61
|
-
|
|
62
|
-
modelValue:
|
|
63
|
-
"onUpdate:modelValue":
|
|
64
|
+
}, 8, ["modelValue", "placeholder"])
|
|
65
|
+
])) : g("", !0),
|
|
66
|
+
o("div", R, [
|
|
67
|
+
o("span", W, n(e(s)("Input volume")), 1),
|
|
68
|
+
p(e(M), {
|
|
69
|
+
modelValue: V.value,
|
|
70
|
+
"onUpdate:modelValue": a[1] || (a[1] = (l) => V.value = l),
|
|
64
71
|
min: 0,
|
|
65
72
|
max: 100
|
|
66
73
|
}, null, 8, ["modelValue"]),
|
|
67
|
-
o("span",
|
|
74
|
+
o("span", X, n(e(S)), 1)
|
|
68
75
|
])
|
|
69
76
|
]),
|
|
70
|
-
|
|
71
|
-
o("div",
|
|
72
|
-
o("div",
|
|
73
|
-
|
|
74
|
-
o("span",
|
|
75
|
-
|
|
76
|
-
modelValue:
|
|
77
|
-
"onUpdate:modelValue":
|
|
78
|
-
class: "select"
|
|
77
|
+
a[4] || (a[4] = o("div", { class: "divider" }, null, -1)),
|
|
78
|
+
o("div", Y, [
|
|
79
|
+
o("div", Z, n(e(s)("Speaker")), 1),
|
|
80
|
+
e(f).length > 0 ? (d(), r("div", ee, [
|
|
81
|
+
o("span", te, n(e(s)("Select device")), 1),
|
|
82
|
+
p(e(C), {
|
|
83
|
+
modelValue: u.value,
|
|
84
|
+
"onUpdate:modelValue": a[2] || (a[2] = (l) => u.value = l),
|
|
85
|
+
class: "select",
|
|
86
|
+
placeholder: e(s)("Unrecognized device")
|
|
79
87
|
}, {
|
|
80
|
-
default:
|
|
81
|
-
(
|
|
88
|
+
default: U(() => [
|
|
89
|
+
(d(!0), r(w, null, b(e(f), (l) => (d(), y(e(x), {
|
|
82
90
|
key: l.deviceId,
|
|
83
91
|
label: l.deviceName,
|
|
84
92
|
value: l.deviceId
|
|
85
93
|
}, null, 8, ["label", "value"]))), 128))
|
|
86
94
|
]),
|
|
87
95
|
_: 1
|
|
88
|
-
}, 8, ["modelValue"])
|
|
89
|
-
]),
|
|
90
|
-
o("div",
|
|
91
|
-
o("span",
|
|
92
|
-
|
|
93
|
-
modelValue:
|
|
94
|
-
"onUpdate:modelValue":
|
|
96
|
+
}, 8, ["modelValue", "placeholder"])
|
|
97
|
+
])) : g("", !0),
|
|
98
|
+
o("div", le, [
|
|
99
|
+
o("span", oe, n(e(s)("Output volume")), 1),
|
|
100
|
+
p(e(M), {
|
|
101
|
+
modelValue: h.value,
|
|
102
|
+
"onUpdate:modelValue": a[3] || (a[3] = (l) => h.value = l),
|
|
95
103
|
min: 0,
|
|
96
104
|
max: 100
|
|
97
105
|
}, null, 8, ["modelValue"]),
|
|
98
|
-
o("span",
|
|
106
|
+
o("span", ae, n(e(k)), 1)
|
|
99
107
|
])
|
|
100
108
|
])
|
|
101
109
|
]));
|
|
102
110
|
}
|
|
103
|
-
}),
|
|
104
|
-
|
|
105
|
-
|
|
111
|
+
}), me = /* @__PURE__ */ K(se, [["__scopeId", "data-v-824562f9"]]);
|
|
112
|
+
N("en-US", { translation: $ });
|
|
113
|
+
N("zh-CN", { translation: j });
|
|
106
114
|
export {
|
|
107
|
-
|
|
115
|
+
me as AudioSettingPanel
|
|
108
116
|
};
|
|
@@ -2,10 +2,10 @@ import { defineComponent as R, computed as i, ref as r, createElementBlock as g,
|
|
|
2
2
|
import { useUIKit as z, TUIButton as G, TUIToast as K } from "@tencentcloud/uikit-base-component-vue3";
|
|
3
3
|
import { useLiveAudienceState as O } from "../../states/LiveAudienceState.js";
|
|
4
4
|
import { useLoginState as q } from "../../states/LoginState.js";
|
|
5
|
-
import J from "./
|
|
6
|
-
import Q from "./
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
5
|
+
import { useMessageInputState as J } from "./MessageInputState.js";
|
|
6
|
+
import Q from "./BarrageInput.js";
|
|
7
|
+
import W from "./EmojiPicker/EmojiPicker.js";
|
|
8
|
+
import { ERROR_MESSAGE as X } from "./constants.js";
|
|
9
9
|
import { _ as Y } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
const Z = { class: "live-message-input-h5" }, $ = { class: "input-actions" }, ee = /* @__PURE__ */ R({
|
|
11
11
|
__name: "BarrageInputH5",
|
|
@@ -29,7 +29,7 @@ const Z = { class: "live-message-input-h5" }, $ = { class: "input-actions" }, ee
|
|
|
29
29
|
return p.userId === ((f = b.value) == null ? void 0 : f.userId);
|
|
30
30
|
});
|
|
31
31
|
return e.disabled || (t == null ? void 0 : t.isMessageDisabled);
|
|
32
|
-
}), { inputRawValue: m, setContent: I, sendMessage: T, blurEditor: E, focusEditor: H } =
|
|
32
|
+
}), { inputRawValue: m, setContent: I, sendMessage: T, blurEditor: E, focusEditor: H } = J(), n = r(!1), s = r(!1), l = r(!1), k = () => {
|
|
33
33
|
l.value = !0;
|
|
34
34
|
}, F = async () => {
|
|
35
35
|
if (m.value) {
|
|
@@ -39,7 +39,7 @@ const Z = { class: "live-message-input-h5" }, $ = { class: "input-actions" }, ee
|
|
|
39
39
|
I(""), await T(t);
|
|
40
40
|
} catch (t) {
|
|
41
41
|
K.error({
|
|
42
|
-
message: o(
|
|
42
|
+
message: o(X[t.code] || "send message failed")
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -60,14 +60,14 @@ const Z = { class: "live-message-input-h5" }, $ = { class: "input-actions" }, ee
|
|
|
60
60
|
onClick: N
|
|
61
61
|
}, [
|
|
62
62
|
y("div", $, [
|
|
63
|
-
j(
|
|
63
|
+
j(W, {
|
|
64
64
|
disabled: h.value,
|
|
65
65
|
"trigger-style": { display: "flex" }
|
|
66
66
|
}, null, 8, ["disabled"])
|
|
67
67
|
]),
|
|
68
68
|
y("span", null, S(d.value), 1)
|
|
69
69
|
], 4)),
|
|
70
|
-
s.value ? (a(), v(
|
|
70
|
+
s.value ? (a(), v(Q, {
|
|
71
71
|
key: 1,
|
|
72
72
|
autoFocus: e.autoFocus,
|
|
73
73
|
containerClass: C.value,
|
|
@@ -95,7 +95,7 @@ const Z = { class: "live-message-input-h5" }, $ = { class: "input-actions" }, ee
|
|
|
95
95
|
})) : u("", !0)
|
|
96
96
|
]));
|
|
97
97
|
}
|
|
98
|
-
}), ce = /* @__PURE__ */ Y(ee, [["__scopeId", "data-v-
|
|
98
|
+
}), ce = /* @__PURE__ */ Y(ee, [["__scopeId", "data-v-fcdaa865"]]);
|
|
99
99
|
export {
|
|
100
100
|
ce as default
|
|
101
101
|
};
|
|
@@ -3,8 +3,8 @@ import { useUIKit as y, IconEmoji as C } from "@tencentcloud/uikit-base-componen
|
|
|
3
3
|
import { P, a as h, b as I, c as z } from "../../../PopoverTrigger-L8abAry7.js";
|
|
4
4
|
import { emojiUrlMap as l, emojiBaseUrl as m } from "../../../constants/emoji.js";
|
|
5
5
|
import { transformTextWithEmojiKeyToName as M } from "../../../utils/emoji.js";
|
|
6
|
-
import { useMessageInputState as T } from "
|
|
7
|
-
import { MessageContentType as B } from "
|
|
6
|
+
import { useMessageInputState as T } from "../MessageInputState.js";
|
|
7
|
+
import { MessageContentType as B } from "../type.js";
|
|
8
8
|
import { _ as S } from "../../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const n = {
|
|
10
10
|
"emoji-picker__icon": "_emoji-picker__icon_77iku_1",
|
|
@@ -96,7 +96,7 @@ const n = {
|
|
|
96
96
|
})
|
|
97
97
|
]));
|
|
98
98
|
}
|
|
99
|
-
}), D = /* @__PURE__ */ S(w, [["__scopeId", "data-v-
|
|
99
|
+
}), D = /* @__PURE__ */ S(w, [["__scopeId", "data-v-e11cd753"]]);
|
|
100
100
|
export {
|
|
101
101
|
D as default
|
|
102
102
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { MessageContentType, InputContent } from './type';
|
|
3
|
+
import { Editor } from '@tiptap/vue-3';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Message Input Store
|
|
7
|
+
*
|
|
8
|
+
* This store manages the state and operations related to the chat message input, including:
|
|
9
|
+
* - Raw input value (text or structured content)
|
|
10
|
+
* - Editor instance management
|
|
11
|
+
* - Content manipulation (insertion, updating, etc.)
|
|
12
|
+
* - Message sending functionality
|
|
13
|
+
*/
|
|
14
|
+
interface MessageInputState {
|
|
15
|
+
inputRawValue: Ref<string | InputContent[]>;
|
|
16
|
+
}
|
|
17
|
+
interface MessageInputAction {
|
|
18
|
+
updateRawValue: (value: string | InputContent[]) => void;
|
|
19
|
+
setEditorInstance: (editor: Editor | null) => void;
|
|
20
|
+
setContent: (value: string | InputContent[]) => void;
|
|
21
|
+
insertContent: (value: string | InputContent[], focus?: boolean) => void;
|
|
22
|
+
focusEditor: () => void;
|
|
23
|
+
blurEditor: () => void;
|
|
24
|
+
sendMessage: (msg?: string | InputContent[]) => void;
|
|
25
|
+
}
|
|
26
|
+
declare function useMessageInputState(): MessageInputState & MessageInputAction;
|
|
27
|
+
export { useMessageInputState, MessageContentType };
|
|
28
|
+
export type { InputContent };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ref as m } from "vue";
|
|
2
|
+
import { MessageContentType as r } from "./type.js";
|
|
3
|
+
import { convertInputContentToEditorNode as f } from "./utils.js";
|
|
4
|
+
import { useBarrageState as y } from "../../states/BarrageState/BarrageState.js";
|
|
5
|
+
import { transformTextWithEmojiNameToKey as u } from "../../utils/emoji.js";
|
|
6
|
+
const { sendTextMessage: c } = y(), e = m(null), a = m(""), g = (t) => {
|
|
7
|
+
if (typeof t != "string" && !Array.isArray(t)) {
|
|
8
|
+
console.warn("Invalid input type for updateRawValue");
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
typeof t == "string" ? a.value = t.trim() : a.value = (t == null ? void 0 : t.length) > 0 ? t : "";
|
|
12
|
+
}, T = (t) => {
|
|
13
|
+
e.value && e.value.destroy(), e.value = t;
|
|
14
|
+
}, v = (t) => {
|
|
15
|
+
if (e.value) {
|
|
16
|
+
if (typeof t == "string")
|
|
17
|
+
e.value.commands.setContent(t, !0);
|
|
18
|
+
else {
|
|
19
|
+
const n = t.map(f);
|
|
20
|
+
e.value.commands.setContent(n, !0);
|
|
21
|
+
}
|
|
22
|
+
e.value.commands.focus();
|
|
23
|
+
}
|
|
24
|
+
}, C = (t, n = !0) => {
|
|
25
|
+
if (e.value) {
|
|
26
|
+
if (typeof t == "string")
|
|
27
|
+
e.value.commands.insertContent(t);
|
|
28
|
+
else {
|
|
29
|
+
const s = t.map(f);
|
|
30
|
+
e.value.commands.insertContent(s);
|
|
31
|
+
}
|
|
32
|
+
n && e.value.commands.focus();
|
|
33
|
+
}
|
|
34
|
+
}, E = () => {
|
|
35
|
+
var t;
|
|
36
|
+
(t = e.value) == null || t.commands.focus();
|
|
37
|
+
}, w = () => {
|
|
38
|
+
var t;
|
|
39
|
+
(t = e.value) == null || t.commands.blur();
|
|
40
|
+
}, x = async (t) => {
|
|
41
|
+
const n = t ?? a.value;
|
|
42
|
+
if (!n)
|
|
43
|
+
return;
|
|
44
|
+
if (typeof n == "string") {
|
|
45
|
+
c({
|
|
46
|
+
text: u(n)
|
|
47
|
+
});
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
let s = "";
|
|
51
|
+
const d = async () => {
|
|
52
|
+
s && (await c({
|
|
53
|
+
text: u(s)
|
|
54
|
+
}), s = "");
|
|
55
|
+
}, i = {
|
|
56
|
+
[r.TEXT]: (o) => o,
|
|
57
|
+
[r.EMOJI]: (o) => o.key
|
|
58
|
+
};
|
|
59
|
+
for (const o of n) {
|
|
60
|
+
if (!o.type || !i[o.type])
|
|
61
|
+
throw new Error(`Invalid message type: ${o.type}`);
|
|
62
|
+
const p = i[o.type], l = await p(o.content);
|
|
63
|
+
[r.TEXT, r.EMOJI].includes(o.type) && (s += l);
|
|
64
|
+
}
|
|
65
|
+
await d();
|
|
66
|
+
};
|
|
67
|
+
function S() {
|
|
68
|
+
return {
|
|
69
|
+
inputRawValue: a,
|
|
70
|
+
updateRawValue: g,
|
|
71
|
+
setEditorInstance: T,
|
|
72
|
+
setContent: v,
|
|
73
|
+
insertContent: C,
|
|
74
|
+
focusEditor: E,
|
|
75
|
+
blurEditor: w,
|
|
76
|
+
sendMessage: x
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export {
|
|
80
|
+
r as MessageContentType,
|
|
81
|
+
S as useMessageInputState
|
|
82
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as g, P as x, E as p, I as o } from "../../../index-
|
|
1
|
+
import { S as g, P as x, E as p, I as o } from "../../../index-DTi1fL-x.js";
|
|
2
2
|
import { isMobile as y } from "../../../utils/environment.js";
|
|
3
3
|
import { CharacterCount as M } from "./CharacterCountExtension.js";
|
|
4
|
-
import { E as T } from "../../../index-
|
|
4
|
+
import { E as T } from "../../../index-BfIEeWMg.js";
|
|
5
5
|
import { MessageContentType as a } from "../../../states/MessageInputState/type.js";
|
|
6
6
|
function b() {
|
|
7
7
|
return o.extend({
|