@ray-js/t-agent-ui-ray 0.0.7-beta-1 → 0.0.8-beta-1

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.
@@ -102,14 +102,15 @@ export default function ChatContainer(props) {
102
102
  };
103
103
  }, [messages, socketStatus]);
104
104
  useEffect(() => {
105
- (async function () {
106
- logger.debug('[ChatProvider] agent.start');
107
- try {
108
- await agent.start();
109
- } catch (error) {
110
- logger.error('[ChatProvider] agent.start error', error);
111
- }
112
- })();
105
+ logger.debug('ChatProvider agent.start');
106
+ agent.start().then(() => {
107
+ logger.debug('ChatProvider agent.start success');
108
+ }, error => {
109
+ logger.error('ChatProvider agent.start error', error);
110
+ });
111
+ return () => {
112
+ agent.dispose();
113
+ };
113
114
  }, []);
114
115
  return /*#__PURE__*/React.createElement(View, {
115
116
  className: "t-agent-chat-container ".concat(className || '')
@@ -67,7 +67,7 @@ export default function AsrInput(props) {
67
67
  "data-testid": "t-agent-message-input-asr-button-right",
68
68
  className: cx('t-agent-message-input-button', {
69
69
  't-agent-message-input-button-voice-send': state === 'pending',
70
- 't-agent-message-input-button-hide': state === 'recording',
70
+ 't-agent-message-input-button-hide': state === 'recording' || !hasMore,
71
71
  't-agent-message-input-button-more': state === 'init' && hasMore,
72
72
  't-agent-message-input-button-more-open': state === 'init' && moreOpen
73
73
  }),
@@ -11,6 +11,7 @@ import { getCurrentHomeInfo, submitEvaluation } from '@ray-js/t-agent-plugin-ass
11
11
  import TileRender from '../../TileRender';
12
12
  import Feedback from './Feedback';
13
13
  import noticeSvg from './notice.svg';
14
+ import noticeWarnSvg from './notice-warn.svg';
14
15
  import { useChatAgent } from '../../hooks';
15
16
  const BubbleTile = props => {
16
17
  var _message$meta$request;
@@ -63,14 +64,26 @@ const BubbleTile = props => {
63
64
  });
64
65
  }
65
66
  };
67
+ let errorNode = null;
68
+ if (bubbleStatus === BubbleTileStatus.ERROR) {
69
+ errorNode = /*#__PURE__*/React.createElement(Image, {
70
+ onClick: showInfo,
71
+ src: noticeSvg,
72
+ className: "t-agent-bubble-tile-error",
73
+ "data-testid": "t-agent-bubble-tile-error"
74
+ });
75
+ } else if (bubbleStatus === BubbleTileStatus.WARNING) {
76
+ errorNode = /*#__PURE__*/React.createElement(Image, {
77
+ onClick: showInfo,
78
+ src: noticeWarnSvg,
79
+ className: "t-agent-bubble-tile-error",
80
+ "data-testid": "t-agent-bubble-tile-error"
81
+ });
82
+ }
66
83
  return /*#__PURE__*/React.createElement(View, {
67
84
  className: "t-agent-bubble-tile t-agent-bubble-tile-".concat(side),
68
85
  onLongPress: () => {}
69
- }, bubbleStatus === BubbleTileStatus.ERROR && side === 'end' && /*#__PURE__*/React.createElement(Image, {
70
- onClick: showInfo,
71
- src: noticeSvg,
72
- className: "t-agent-bubble-tile-error"
73
- }), /*#__PURE__*/React.createElement(View, {
86
+ }, side === 'end' && errorNode, /*#__PURE__*/React.createElement(View, {
74
87
  className: "t-agent-bubble-tile-bubble ".concat(loading ? 't-agent-bubble-tile-bubble-loading' : '')
75
88
  }, children.map(t => {
76
89
  return /*#__PURE__*/React.createElement(TileRender, {
@@ -111,10 +124,6 @@ const BubbleTile = props => {
111
124
  icon: 'none'
112
125
  });
113
126
  }
114
- })), bubbleStatus === BubbleTileStatus.ERROR && side === 'start' && /*#__PURE__*/React.createElement(Image, {
115
- onClick: showInfo,
116
- src: noticeSvg,
117
- className: "t-agent-bubble-tile-error"
118
- }));
127
+ })), side === 'start' && errorNode);
119
128
  };
120
129
  export default /*#__PURE__*/React.memo(BubbleTile);
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><g><g><path d="M8,15Q8.17184,15,8.34347,14.9916Q8.51511,14.9831,8.686119999999999,14.9663Q8.85713,14.9494,9.02711,14.9242Q9.19709,14.899,9.36563,14.8655Q9.53417,14.832,9.70086,14.7902Q9.86755,14.7485,10.03199,14.6986Q10.19643,14.6487,10.35823,14.5908Q10.52002,14.5329,10.67878,14.4672Q10.83754,14.4014,10.99288,14.3279Q11.1482,14.2545,11.2998,14.1734Q11.4513,14.0924,11.5987,14.0041Q11.7461,13.9158,11.889,13.8203Q12.0319,13.7248,12.1699,13.6225Q12.3079,13.5201,12.4408,13.4111Q12.5736,13.3021,12.7009,13.1867Q12.8282,13.0713,12.9497,12.9497Q13.0713,12.8282,13.1867,12.7009Q13.3021,12.5736,13.4111,12.4408Q13.5201,12.3079,13.6225,12.1699Q13.7248,12.0319,13.8203,11.889Q13.9158,11.7461,14.0041,11.5987Q14.0924,11.4513,14.1734,11.2998Q14.2545,11.1482,14.3279,10.99288Q14.4014,10.83754,14.4672,10.67878Q14.5329,10.52002,14.5908,10.35823Q14.6487,10.19643,14.6986,10.03199Q14.7485,9.86755,14.7902,9.70086Q14.832,9.53417,14.8655,9.36563Q14.899,9.19709,14.9242,9.02711Q14.9494,8.85713,14.9663,8.686119999999999Q14.9831,8.51511,14.9916,8.34347Q15,8.17184,15,8Q15,7.82816,14.9916,7.65653Q14.9831,7.48489,14.9663,7.31388Q14.9494,7.14287,14.9242,6.97289Q14.899,6.80291,14.8655,6.63437Q14.832,6.46583,14.7902,6.29914Q14.7485,6.13245,14.6986,5.96801Q14.6487,5.80357,14.5908,5.64177Q14.5329,5.47998,14.4672,5.32122Q14.4014,5.16246,14.3279,5.00711Q14.2545,4.85177,14.1734,4.70022Q14.0924,4.5486699999999995,14.0041,4.40128Q13.9158,4.25389,13.8203,4.11101Q13.7248,3.96813,13.6225,3.8301Q13.5201,3.69208,13.4111,3.55925Q13.3021,3.42641,13.1867,3.29909Q13.0713,3.17176,12.9497,3.05025Q12.8282,2.92874,12.7009,2.81334Q12.5736,2.69794,12.4408,2.58893Q12.3079,2.4799100000000003,12.1699,2.3775500000000003Q12.0319,2.2751799999999998,11.889,2.17971Q11.7461,2.0842400000000003,11.5987,1.9959Q11.4513,1.907556,11.2998,1.826551Q11.1482,1.745546,10.99288,1.672075Q10.83754,1.598604,10.67878,1.532843Q10.52002,1.4670830000000001,10.35823,1.409191Q10.19643,1.3513,10.03199,1.301418Q9.86755,1.251535,9.70086,1.209781Q9.53417,1.168027,9.36563,1.134503Q9.19709,1.100979,9.02711,1.0757644Q8.85713,1.0505502,8.686119999999999,1.0337069Q8.51511,1.0168636,8.34347,1.0084318Q8.17184,1,8,1Q7.82816,1,7.65653,1.0084318Q7.48489,1.0168636,7.31388,1.0337069Q7.14287,1.0505502,6.97289,1.0757644Q6.80291,1.100979,6.63437,1.134503Q6.46583,1.168027,6.29914,1.209781Q6.13245,1.251535,5.96801,1.301418Q5.80357,1.3513,5.64177,1.409191Q5.47998,1.4670830000000001,5.32122,1.532843Q5.16246,1.598604,5.00711,1.672075Q4.85177,1.745546,4.70022,1.826551Q4.5486699999999995,1.907556,4.40128,1.995899Q4.25389,2.0842400000000003,4.11101,2.17971Q3.96813,2.2751799999999998,3.8301,2.3775500000000003Q3.69208,2.4799100000000003,3.55925,2.58893Q3.42641,2.69794,3.29909,2.81334Q3.17176,2.92874,3.05025,3.05025Q2.92874,3.17176,2.81334,3.29909Q2.69794,3.42641,2.58893,3.55925Q2.4799100000000003,3.69208,2.3775500000000003,3.8301Q2.2751799999999998,3.96813,2.17971,4.11101Q2.0842400000000003,4.25389,1.9959,4.40128Q1.907556,4.5486699999999995,1.826551,4.70022Q1.745546,4.85177,1.672075,5.00711Q1.598604,5.16246,1.532843,5.32122Q1.4670830000000001,5.47998,1.409191,5.64177Q1.3513,5.80357,1.301418,5.96801Q1.251535,6.13245,1.209781,6.29914Q1.168027,6.46583,1.134503,6.63437Q1.100979,6.80291,1.0757644,6.97289Q1.0505502,7.14287,1.0337069,7.31388Q1.0168636,7.48489,1.0084318,7.65653Q1,7.82816,1,8Q1,8.17184,1.0084318,8.34347Q1.0168636,8.51511,1.0337069,8.686119999999999Q1.0505502,8.85713,1.0757644,9.02711Q1.100979,9.19709,1.134503,9.36563Q1.168027,9.53417,1.209781,9.70086Q1.251535,9.86755,1.301418,10.03199Q1.3513,10.19643,1.409191,10.35823Q1.4670830000000001,10.52002,1.532843,10.67878Q1.598604,10.83754,1.672075,10.99288Q1.745546,11.1482,1.826551,11.2998Q1.907556,11.4513,1.995899,11.5987Q2.0842400000000003,11.7461,2.17971,11.889Q2.2751799999999998,12.0319,2.3775500000000003,12.1699Q2.4799100000000003,12.3079,2.58893,12.4408Q2.69794,12.5736,2.81334,12.7009Q2.92874,12.8282,3.05025,12.9497Q3.17176,13.0713,3.29909,13.1867Q3.42641,13.3021,3.55925,13.4111Q3.69208,13.5201,3.8301,13.6225Q3.96813,13.7248,4.11101,13.8203Q4.25389,13.9158,4.40128,14.0041Q4.5486699999999995,14.0924,4.70022,14.1734Q4.85177,14.2545,5.00711,14.3279Q5.16246,14.4014,5.32122,14.4672Q5.47998,14.5329,5.64177,14.5908Q5.80357,14.6487,5.96801,14.6986Q6.13245,14.7485,6.29914,14.7902Q6.46583,14.832,6.63437,14.8655Q6.80291,14.899,6.97289,14.9242Q7.14287,14.9494,7.31388,14.9663Q7.48489,14.9831,7.65653,14.9916Q7.82816,15,8,15ZM8.74315,4.39823C8.69349,4.03215,8.3797,3.75,8,3.75C7.58579,3.75,7.25,4.085789999999999,7.25,4.5L7.25,8.5L7.25685,8.60177C7.30651,8.96785,7.6203,9.25,8,9.25C8.41421,9.25,8.75,8.91421,8.75,8.5L8.75,4.5L8.74315,4.39823ZM8,12Q8.09849,12,8.19509,11.9808Q8.29169,11.9616,8.38268,11.9239Q8.47368,11.8862,8.55557,11.8315Q8.63746,11.7767,8.70711,11.7071Q8.77675,11.6375,8.83147,11.5556Q8.88619,11.4737,8.92388,11.3827Q8.96157,11.2917,8.98078,11.1951Q9,11.0985,9,11Q9,10.90151,8.98078,10.80491Q8.96157,10.70831,8.92388,10.61732Q8.88619,10.52632,8.83147,10.44443Q8.77675,10.36254,8.70711,10.29289Q8.63746,10.22325,8.55557,10.16853Q8.47368,10.11381,8.38268,10.07612Q8.29169,10.03843,8.19509,10.01921Q8.09849,10,8,10Q7.90151,10,7.80491,10.01921Q7.70831,10.03843,7.61732,10.07612Q7.52632,10.11381,7.44443,10.16853Q7.36254,10.22325,7.29289,10.29289Q7.22325,10.36254,7.16853,10.44443Q7.11381,10.52632,7.07612,10.61732Q7.03843,10.70831,7.01921,10.80491Q7,10.90151,7,11Q7,11.0985,7.01921,11.1951Q7.03843,11.2917,7.07612,11.3827Q7.11381,11.4737,7.16853,11.5556Q7.22325,11.6375,7.29289,11.7071Q7.36254,11.7767,7.44443,11.8315Q7.52632,11.8862,7.61732,11.9239Q7.70831,11.9616,7.80491,11.9808Q7.90151,12,8,12Z" fill-rule="evenodd" fill="#f2a93b" fill-opacity="1"/></g></g></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/t-agent-ui-ray",
3
- "version": "0.0.7-beta-1",
3
+ "version": "0.0.8-beta-1",
4
4
  "author": "Tuya.inc",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -41,5 +41,5 @@
41
41
  "@types/echarts": "^4.9.22",
42
42
  "@types/markdown-it": "^14.1.1"
43
43
  },
44
- "gitHead": "95aecc47d002cbf5e608c129478905c7fb458ea9"
44
+ "gitHead": "16c52814d110e10b2e108915675d90e2b023df5e"
45
45
  }