@ray-js/t-agent-ui-ray 0.2.0-beta-6 → 0.2.0-beta-8

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.
@@ -31,6 +31,10 @@ const AsrInput = props => {
31
31
  y: 0
32
32
  };
33
33
  props.onCancel();
34
+ ty.showToast({
35
+ icon: 'none',
36
+ title: t('t-agent.input.asr.error.too-short')
37
+ });
34
38
  return;
35
39
  }
36
40
  props.onConfirm();
@@ -254,12 +254,11 @@ export default function MessageInputAIStream(props) {
254
254
  });
255
255
  }
256
256
  });
257
- emitter.addEventListener('error', event => {
257
+ emitter.addEventListener('error', () => {
258
258
  ty.showToast({
259
259
  icon: 'error',
260
- title: t('t-agent.input.voice.recording-failed')
260
+ title: t('t-agent.input.asr.error.empty')
261
261
  });
262
- console.error(event);
263
262
  setRecord({
264
263
  startAt: 0,
265
264
  recording: false,
@@ -1,9 +1,2 @@
1
- import React from 'react';
2
- interface Props {
3
- className?: string;
4
- renderTop?: React.ReactNode;
5
- placeholder?: string;
6
- style?: React.CSSProperties;
7
- }
8
- export default function MessageInput(props: Props): React.JSX.Element;
9
- export {};
1
+ import MessageInputAIStream from './MessageInputAIStream';
2
+ export default MessageInputAIStream;
@@ -1,5 +1,2 @@
1
- import React from 'react';
2
1
  import MessageInputAIStream from './MessageInputAIStream';
3
- export default function MessageInput(props) {
4
- return /*#__PURE__*/React.createElement(MessageInputAIStream, props);
5
- }
2
+ export default MessageInputAIStream;
@@ -6,7 +6,7 @@ import strings from '../i18n/strings';
6
6
  import { systemInfo } from '../utils';
7
7
  const keyRE = /^t-agent\./;
8
8
  const langRE = {
9
- 'zh-Hans': /^zh([-_](hans|cn|zh))/i,
9
+ 'zh-Hans': /^zh([-_](hans|cn|zh))?/i,
10
10
  'zh-Hant': /^zh([-_](hant|tw|hk|mo))/i,
11
11
  en: /^en([-_](us|gb))/i,
12
12
  ja: /^ja([-_](jp))/i,
@@ -40,6 +40,7 @@ export const translateWith = (key, i18nTranslate) => {
40
40
  return translateCache.get(key);
41
41
  }
42
42
  const result = i18nTranslate(key);
43
+
43
44
  // result 全等于 key 说明没有翻译,使用内置翻译
44
45
  if (result === key && keyRE.test(key)) {
45
46
  var _strings$language;
@@ -20,6 +20,8 @@ declare const _default: {
20
20
  't-agent.input.asr.oninput.text.top': string;
21
21
  't-agent.input.asr.oninput.text.center': string;
22
22
  't-agent.input.asr.ptt': string;
23
+ 't-agent.input.asr.error.too-short': string;
24
+ 't-agent.input.asr.error.empty': string;
23
25
  't-agent.message.feedback.success': string;
24
26
  't-agent.message.bubble.aborted': string;
25
27
  't-agent.message.action.copy': string;
@@ -160,6 +162,8 @@ declare const _default: {
160
162
  't-agent.input.asr.oninput.text.top': string;
161
163
  't-agent.input.asr.oninput.text.center': string;
162
164
  't-agent.input.asr.ptt': string;
165
+ 't-agent.input.asr.error.too-short': string;
166
+ 't-agent.input.asr.error.empty': string;
163
167
  't-agent.message.feedback.success': string;
164
168
  't-agent.message.bubble.aborted': string;
165
169
  't-agent.message.action.copy': string;
@@ -20,6 +20,8 @@ export default {
20
20
  't-agent.input.asr.oninput.text.top': '我在听,请说话',
21
21
  't-agent.input.asr.oninput.text.center': '松开发送,上划取消',
22
22
  't-agent.input.asr.ptt': '按住说话',
23
+ 't-agent.input.asr.error.too-short': '说话时间太短',
24
+ 't-agent.input.asr.error.empty': '未能从语音中识别到文字',
23
25
  't-agent.message.feedback.success': '反馈成功',
24
26
  't-agent.message.bubble.aborted': '用户中断',
25
27
  't-agent.message.action.copy': '复制消息',
@@ -163,6 +165,10 @@ export default {
163
165
  // 交互操作指引
164
166
  't-agent.input.asr.ptt': 'Press & hold to talk',
165
167
  // Push-to-Talk 按钮提示
168
+ 't-agent.input.asr.error.too-short': 'Speaking time too short',
169
+ // 语音输入时间过短
170
+ 't-agent.input.asr.error.empty': 'No text recognized from voice',
171
+ // 语音识别未能识别到文字
166
172
  't-agent.message.feedback.success': 'Feedback Successful',
167
173
  't-agent.message.bubble.aborted': 'User Aborted',
168
174
  't-agent.message.action.copy': 'Copy Message',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/t-agent-ui-ray",
3
- "version": "0.2.0-beta-6",
3
+ "version": "0.2.0-beta-8",
4
4
  "author": "Tuya.inc",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -40,5 +40,5 @@
40
40
  "@types/echarts": "^4.9.22",
41
41
  "@types/markdown-it": "^14.1.1"
42
42
  },
43
- "gitHead": "a09b74682949c5860f34105b4a5f8f60fc34a582"
43
+ "gitHead": "586a5010616634911334e31f9c1e1993231dfb95"
44
44
  }