Merge branch 'ui' into for_webui
This commit is contained in:
@@ -14,6 +14,8 @@ export const MessageInputBox = () => {
|
|||||||
currentMessageLogs,
|
currentMessageLogs,
|
||||||
currentMessageInputValue,
|
currentMessageInputValue,
|
||||||
updateMessageInputValue,
|
updateMessageInputValue,
|
||||||
|
startTyping,
|
||||||
|
stopTyping,
|
||||||
} = useMessage();
|
} = useMessage();
|
||||||
|
|
||||||
const { currentEnableAutoClearMessageInputBox } = useEnableAutoClearMessageInputBox();
|
const { currentEnableAutoClearMessageInputBox } = useEnableAutoClearMessageInputBox();
|
||||||
@@ -45,16 +47,12 @@ export const MessageInputBox = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onChangeFunction = (e) => {
|
const onChangeFunction = (e) => {
|
||||||
updateMessageInputValue(e.currentTarget.value);
|
const value = e.currentTarget.value;
|
||||||
|
updateMessageInputValue(value);
|
||||||
|
value.trim() ? startTyping() : stopTyping();
|
||||||
};
|
};
|
||||||
|
|
||||||
const onKeyDownFunction = (e) => {
|
const onKeyDownFunction = (e) => {
|
||||||
if (currentSendMessageButtonType.data === "show_and_disable_enter_key") return;
|
|
||||||
|
|
||||||
if (e.keyCode === 13 && !e.shiftKey) {
|
|
||||||
onSubmitFunction(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e.key === "ArrowUp" && e.shiftKey) {
|
if (e.key === "ArrowUp" && e.shiftKey) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
@@ -78,6 +76,13 @@ export const MessageInputBox = () => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currentSendMessageButtonType.data === "show_and_disable_enter_key") return;
|
||||||
|
|
||||||
|
if (e.keyCode === 13 && !e.shiftKey) {
|
||||||
|
onSubmitFunction(e);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -86,6 +91,7 @@ export const MessageInputBox = () => {
|
|||||||
<textarea
|
<textarea
|
||||||
className={styles.message_box_input_area}
|
className={styles.message_box_input_area}
|
||||||
onChange={onChangeFunction}
|
onChange={onChangeFunction}
|
||||||
|
onBlur={stopTyping}
|
||||||
placeholder="Input Textfield"
|
placeholder="Input Textfield"
|
||||||
value={currentMessageInputValue.data}
|
value={currentMessageInputValue.data}
|
||||||
onKeyDown={onKeyDownFunction}
|
onKeyDown={onKeyDownFunction}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import HelpSvg from "@images/help.svg?react";
|
|||||||
|
|
||||||
import { useStore_OpenedQuickSetting } from "@store";
|
import { useStore_OpenedQuickSetting } from "@store";
|
||||||
import { useIsSoftwareUpdateAvailable } from "@logics_common";
|
import { useIsSoftwareUpdateAvailable } from "@logics_common";
|
||||||
import { useIsEnabledOverlaySmallLog, useEnableVrcMicMuteSync } from "@logics_configs";
|
import { useIsEnabledOverlaySmallLog, useIsEnabledOverlayLargeLog, useEnableVrcMicMuteSync } from "@logics_configs";
|
||||||
import { OpenQuickSettingButton } from "./_buttons/OpenQuickSettingButton";
|
import { OpenQuickSettingButton } from "./_buttons/OpenQuickSettingButton";
|
||||||
|
|
||||||
export const RightSideComponents = () => {
|
export const RightSideComponents = () => {
|
||||||
@@ -30,15 +30,18 @@ const OpenOverlayQuickSetting = () => {
|
|||||||
// const { t } = useTranslation();
|
// const { t } = useTranslation();
|
||||||
const { updateOpenedQuickSetting } = useStore_OpenedQuickSetting();
|
const { updateOpenedQuickSetting } = useStore_OpenedQuickSetting();
|
||||||
const { currentIsEnabledOverlaySmallLog } = useIsEnabledOverlaySmallLog();
|
const { currentIsEnabledOverlaySmallLog } = useIsEnabledOverlaySmallLog();
|
||||||
|
const { currentIsEnabledOverlayLargeLog } = useIsEnabledOverlayLargeLog();
|
||||||
|
|
||||||
const onClickFunction = () => {
|
const onClickFunction = () => {
|
||||||
updateOpenedQuickSetting("overlay");
|
updateOpenedQuickSetting("overlay");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const is_enable = currentIsEnabledOverlaySmallLog.data === true || currentIsEnabledOverlayLargeLog.data === true;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<OpenQuickSettingButton
|
<OpenQuickSettingButton
|
||||||
label="Overlay(VR)"
|
label="Overlay(VR)"
|
||||||
variable={currentIsEnabledOverlaySmallLog.data}
|
variable={is_enable}
|
||||||
onClickFunction={onClickFunction}
|
onClickFunction={onClickFunction}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -42,6 +42,13 @@ export const useMessage = () => {
|
|||||||
addMessageLogs(message_object);
|
addMessageLogs(message_object);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const startTyping = () => {
|
||||||
|
asyncStdoutToPython("/run/typing_message_box");
|
||||||
|
};
|
||||||
|
const stopTyping = () => {
|
||||||
|
asyncStdoutToPython("/run/stop_typing_message_box");
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
currentMessageLogs,
|
currentMessageLogs,
|
||||||
sendMessage,
|
sendMessage,
|
||||||
@@ -51,6 +58,9 @@ export const useMessage = () => {
|
|||||||
|
|
||||||
currentMessageInputValue,
|
currentMessageInputValue,
|
||||||
updateMessageInputValue,
|
updateMessageInputValue,
|
||||||
|
|
||||||
|
startTyping,
|
||||||
|
stopTyping,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -222,6 +222,8 @@ export const useReceiveRoutes = () => {
|
|||||||
|
|
||||||
// Message
|
// Message
|
||||||
"/run/send_message_box": updateSentMessageLogById,
|
"/run/send_message_box": updateSentMessageLogById,
|
||||||
|
"/run/typing_message_box": ()=>{},
|
||||||
|
"/run/stop_typing_message_box": ()=>{},
|
||||||
"/run/transcription_send_mic_message": addSentMessageLog,
|
"/run/transcription_send_mic_message": addSentMessageLog,
|
||||||
"/run/transcription_receive_speaker_message": addReceivedMessageLog,
|
"/run/transcription_receive_speaker_message": addReceivedMessageLog,
|
||||||
|
|
||||||
@@ -424,6 +426,11 @@ export const useReceiveRoutes = () => {
|
|||||||
|
|
||||||
"/get/data/osc_port": updateOscPort,
|
"/get/data/osc_port": updateOscPort,
|
||||||
"/set/data/osc_port": updateOscPort,
|
"/set/data/osc_port": updateOscPort,
|
||||||
|
|
||||||
|
"/get/data/mic_avg_logprob": ()=>{}, // Not implemented on UI yet
|
||||||
|
"/get/data/mic_no_speech_prob": ()=>{}, // Not implemented on UI yet
|
||||||
|
"/get/data/speaker_avg_logprob": ()=>{}, // Not implemented on UI yet
|
||||||
|
"/get/data/speaker_no_speech_prob": ()=>{}, // Not implemented on UI yet
|
||||||
};
|
};
|
||||||
|
|
||||||
const error_routes = {
|
const error_routes = {
|
||||||
|
|||||||
Reference in New Issue
Block a user