@ray-js/t-agent-ui-ray 0.0.7 → 0.0.8-beta-2
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/ChatContainer/index.js +46 -22
- package/dist/MessageInput/AsrInput.js +4 -3
- package/dist/MessageInput/index.js +10 -7
- package/dist/MessageInput/index.less +12 -1
- package/dist/MessageList/index.js +13 -3
- package/dist/contexts.d.ts +2 -2
- package/dist/contexts.js +1 -2
- package/dist/hooks/context.d.ts +1 -1
- package/dist/hooks/useAsrInput.js +36 -15
- package/dist/tiles/BubbleTile/index.js +19 -10
- package/dist/tiles/BubbleTile/notice-warn.svg +1 -0
- package/package.json +2 -2
|
@@ -5,25 +5,20 @@ import "core-js/modules/web.dom-collections.iterator.js";
|
|
|
5
5
|
import './index.less';
|
|
6
6
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
7
7
|
import { View } from '@ray-js/components';
|
|
8
|
-
import {
|
|
8
|
+
import { SocketStatus } from '@ray-js/t-agent-plugin-assistant';
|
|
9
|
+
import cx from 'clsx';
|
|
9
10
|
import { ChatAgentContext, MessageContext, RenderContext } from '../contexts';
|
|
10
11
|
import { defaultRenderOptions } from '../renderOption';
|
|
11
12
|
import logger from '../logger';
|
|
12
13
|
export default function ChatContainer(props) {
|
|
14
|
+
const [keyboardHeight, setKeyboardHeight] = useState(0);
|
|
13
15
|
const {
|
|
14
16
|
createAgent,
|
|
15
17
|
renderOptions = defaultRenderOptions,
|
|
16
18
|
children,
|
|
17
|
-
className
|
|
19
|
+
className
|
|
18
20
|
} = props;
|
|
19
21
|
const [messages, setMessages] = useState([]);
|
|
20
|
-
const [socketStatus, setSocketStatus] = useState(() => {
|
|
21
|
-
try {
|
|
22
|
-
return getWebSocketStatusSync().status;
|
|
23
|
-
} catch (e) {
|
|
24
|
-
return SocketStatus.WAITING;
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
22
|
const [agent] = useState(() => {
|
|
28
23
|
const agent = createAgent();
|
|
29
24
|
if (!agent.plugins.ui) {
|
|
@@ -40,7 +35,9 @@ export default function ChatContainer(props) {
|
|
|
40
35
|
emitEvent
|
|
41
36
|
} = agent.plugins.ui;
|
|
42
37
|
const offSocketStatusChange = agent.plugins.assistant.onSocketStatusChange(status => {
|
|
43
|
-
|
|
38
|
+
emitEvent('networkChange', {
|
|
39
|
+
online: status === SocketStatus.SUCCESS
|
|
40
|
+
});
|
|
44
41
|
});
|
|
45
42
|
const offMessageListInit = onEvent('messageListInit', _ref => {
|
|
46
43
|
let {
|
|
@@ -71,7 +68,8 @@ export default function ChatContainer(props) {
|
|
|
71
68
|
if (((_prev = prev[prev.length - 1]) === null || _prev === void 0 ? void 0 : _prev.id) === message.id) {
|
|
72
69
|
// 是最后一条消息,滚动到最底部
|
|
73
70
|
emitEvent('scrollToBottom', {
|
|
74
|
-
animation: false
|
|
71
|
+
animation: false,
|
|
72
|
+
follow: true
|
|
75
73
|
});
|
|
76
74
|
}
|
|
77
75
|
}
|
|
@@ -98,21 +96,47 @@ export default function ChatContainer(props) {
|
|
|
98
96
|
const messageValue = useMemo(() => {
|
|
99
97
|
return {
|
|
100
98
|
messages,
|
|
101
|
-
|
|
99
|
+
keyboardHeight
|
|
102
100
|
};
|
|
103
|
-
}, [messages,
|
|
101
|
+
}, [messages, keyboardHeight]);
|
|
104
102
|
useEffect(() => {
|
|
105
|
-
(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
logger.debug('ChatProvider agent.start');
|
|
104
|
+
agent.start().then(() => {
|
|
105
|
+
logger.debug('ChatProvider agent.start success');
|
|
106
|
+
}, error => {
|
|
107
|
+
logger.error('ChatProvider agent.start error', error);
|
|
108
|
+
});
|
|
109
|
+
return () => {
|
|
110
|
+
agent.dispose();
|
|
111
|
+
};
|
|
112
|
+
}, []);
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
const show = _ref3 => {
|
|
115
|
+
let {
|
|
116
|
+
height
|
|
117
|
+
} = _ref3;
|
|
118
|
+
setKeyboardHeight(height);
|
|
119
|
+
};
|
|
120
|
+
const hide = () => {
|
|
121
|
+
setKeyboardHeight(0);
|
|
122
|
+
};
|
|
123
|
+
ty.onKeyboardWillShow(show);
|
|
124
|
+
ty.onKeyboardWillHide(hide);
|
|
125
|
+
ty.onKeyboardHeightChange(show);
|
|
126
|
+
return () => {
|
|
127
|
+
ty.offKeyboardWillShow(show);
|
|
128
|
+
ty.offKeyboardWillHide(hide);
|
|
129
|
+
ty.offKeyboardHeightChange(show);
|
|
130
|
+
};
|
|
113
131
|
}, []);
|
|
114
132
|
return /*#__PURE__*/React.createElement(View, {
|
|
115
|
-
|
|
133
|
+
style: {
|
|
134
|
+
// @ts-ignore
|
|
135
|
+
'--t-agent-chat-container-keyboard-height': "".concat(keyboardHeight, "px")
|
|
136
|
+
},
|
|
137
|
+
className: cx('t-agent-chat-container', className, {
|
|
138
|
+
't-agent-chat-container-keyboard-show': keyboardHeight > 0
|
|
139
|
+
})
|
|
116
140
|
}, /*#__PURE__*/React.createElement(ChatAgentContext.Provider, {
|
|
117
141
|
value: agent
|
|
118
142
|
}, /*#__PURE__*/React.createElement(RenderContext.Provider, {
|
|
@@ -28,11 +28,12 @@ export default function AsrInput(props) {
|
|
|
28
28
|
}), /*#__PURE__*/React.createElement(View, {
|
|
29
29
|
className: "t-agent-message-input-voice-bubble",
|
|
30
30
|
"data-testid": "t-agent-message-input-asr-bubble"
|
|
31
|
-
}, state === 'recording' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, null, currentText), /*#__PURE__*/React.createElement(Text, {
|
|
31
|
+
}, state === 'recording' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, null, currentText.endsWith(' ') ? /*#__PURE__*/React.createElement(React.Fragment, null, currentText, "\xA0") : currentText), /*#__PURE__*/React.createElement(Text, {
|
|
32
32
|
className: "t-agent-message-input-voice-bubble-predicted"
|
|
33
33
|
}, incomingText)) : /*#__PURE__*/React.createElement(Textarea, {
|
|
34
34
|
"data-testid": "t-agent-message-input-asr-bubble-input",
|
|
35
35
|
autoHeight: true,
|
|
36
|
+
maxLength: 2048,
|
|
36
37
|
className: "t-agent-message-input-voice-bubble-input",
|
|
37
38
|
value: text,
|
|
38
39
|
onInput: event => setText(event.value)
|
|
@@ -56,8 +57,8 @@ export default function AsrInput(props) {
|
|
|
56
57
|
className: "t-agent-message-input-button t-agent-message-input-button-voice-active",
|
|
57
58
|
disabled: sendDisabled,
|
|
58
59
|
onTouchStart: () => {
|
|
59
|
-
press();
|
|
60
60
|
closeMore();
|
|
61
|
+
press();
|
|
61
62
|
},
|
|
62
63
|
onClick: release,
|
|
63
64
|
onTouchCancel: release,
|
|
@@ -67,7 +68,7 @@ export default function AsrInput(props) {
|
|
|
67
68
|
"data-testid": "t-agent-message-input-asr-button-right",
|
|
68
69
|
className: cx('t-agent-message-input-button', {
|
|
69
70
|
't-agent-message-input-button-voice-send': state === 'pending',
|
|
70
|
-
't-agent-message-input-button-hide': state === 'recording',
|
|
71
|
+
't-agent-message-input-button-hide': state === 'recording' || !hasMore,
|
|
71
72
|
't-agent-message-input-button-more': state === 'init' && hasMore,
|
|
72
73
|
't-agent-message-input-button-more-open': state === 'init' && moreOpen
|
|
73
74
|
}),
|
|
@@ -6,7 +6,7 @@ import './index.less';
|
|
|
6
6
|
import { Button, View } from '@ray-js/components';
|
|
7
7
|
import React, { useState } from 'react';
|
|
8
8
|
import { Image, Input, ScrollView } from '@ray-js/ray';
|
|
9
|
-
import { Asr
|
|
9
|
+
import { Asr } from '@ray-js/t-agent-plugin-assistant';
|
|
10
10
|
import cx from 'clsx';
|
|
11
11
|
import PrivateImage from '../PrivateImage';
|
|
12
12
|
import imageSvg from './icons/image.svg';
|
|
@@ -31,8 +31,11 @@ export default function MessageInput(props) {
|
|
|
31
31
|
const agent = useChatAgent();
|
|
32
32
|
const emitEvent = useEmitEvent();
|
|
33
33
|
const isUnmounted = useIsUnmounted();
|
|
34
|
-
useOnEvent('
|
|
35
|
-
|
|
34
|
+
useOnEvent('networkChange', _ref => {
|
|
35
|
+
let {
|
|
36
|
+
online
|
|
37
|
+
} = _ref;
|
|
38
|
+
if (!online && responding) {
|
|
36
39
|
setResponding(false);
|
|
37
40
|
}
|
|
38
41
|
});
|
|
@@ -53,10 +56,10 @@ export default function MessageInput(props) {
|
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
58
|
};
|
|
56
|
-
useOnEvent('sendMessage', async
|
|
59
|
+
useOnEvent('sendMessage', async _ref2 => {
|
|
57
60
|
let {
|
|
58
61
|
blocks
|
|
59
|
-
} =
|
|
62
|
+
} = _ref2;
|
|
60
63
|
if (uploading || responding) {
|
|
61
64
|
return;
|
|
62
65
|
}
|
|
@@ -72,10 +75,10 @@ export default function MessageInput(props) {
|
|
|
72
75
|
}
|
|
73
76
|
}
|
|
74
77
|
});
|
|
75
|
-
useOnEvent('setInputBlocks', async
|
|
78
|
+
useOnEvent('setInputBlocks', async _ref3 => {
|
|
76
79
|
let {
|
|
77
80
|
blocks
|
|
78
|
-
} =
|
|
81
|
+
} = _ref3;
|
|
79
82
|
if (uploading || responding) {
|
|
80
83
|
return;
|
|
81
84
|
}
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
padding-bottom: var(--t-agent-safe-bottom);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
.t-agent-chat-container-keyboard-show .t-agent-message-input {
|
|
16
|
+
padding-bottom: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
.t-agent-message-input-container {
|
|
16
20
|
border-top: 2rpx solid var(--t-agent-input-border-color);
|
|
17
21
|
background: var(--app-B1);
|
|
@@ -261,7 +265,10 @@
|
|
|
261
265
|
color: var(--app-M1-N1);
|
|
262
266
|
font-size: 32rpx;
|
|
263
267
|
transition: height 0.2s ease-in-out;
|
|
264
|
-
|
|
268
|
+
|
|
269
|
+
text {
|
|
270
|
+
white-space: pre-wrap;
|
|
271
|
+
}
|
|
265
272
|
|
|
266
273
|
&::after {
|
|
267
274
|
content: '';
|
|
@@ -277,6 +284,10 @@
|
|
|
277
284
|
}
|
|
278
285
|
}
|
|
279
286
|
|
|
287
|
+
.t-agent-chat-container-keyboard-show .t-agent-message-input-voice-bubble {
|
|
288
|
+
bottom: 260rpx;
|
|
289
|
+
}
|
|
290
|
+
|
|
280
291
|
.t-agent-message-input-voice-bubble-predicted {
|
|
281
292
|
color: var(--app-M1-N3);
|
|
282
293
|
}
|
|
@@ -4,7 +4,7 @@ import "core-js/modules/esnext.iterator.map.js";
|
|
|
4
4
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
5
5
|
import './index.less';
|
|
6
6
|
import { View } from '@ray-js/components';
|
|
7
|
-
import React, { useMemo, useState } from 'react';
|
|
7
|
+
import React, { useMemo, useRef, useState } from 'react';
|
|
8
8
|
import { ScrollView } from '@ray-js/ray';
|
|
9
9
|
import MessageRender from '../MessageRender';
|
|
10
10
|
import { useAgentMessage, useOnEvent, useSleep } from '../hooks';
|
|
@@ -19,13 +19,19 @@ export default function MessageList(props) {
|
|
|
19
19
|
const [scrollAnimation, setScrollAnimation] = useState(false);
|
|
20
20
|
// 最大整数位数,用于强制滚动到底部,收到连续 scrollToBottom 时,每 10 毫秒更新一次
|
|
21
21
|
const [scrollTop, setScrollTop] = useState(() => 1000000000000000 + Math.floor(Date.now() / 10));
|
|
22
|
+
const followNewMessageRef = useRef(true);
|
|
22
23
|
const sleep = useSleep();
|
|
23
24
|
|
|
24
25
|
// 强制滚动到底部
|
|
25
26
|
useOnEvent('scrollToBottom', _ref => {
|
|
26
27
|
let {
|
|
27
|
-
animation
|
|
28
|
+
animation,
|
|
29
|
+
follow
|
|
28
30
|
} = _ref;
|
|
31
|
+
// 如果发送的跟随新消息的滚动,判断当前是不是滚动到了底部,如果没有滚动到底部,不执行滚动
|
|
32
|
+
if (follow && !followNewMessageRef.current) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
29
35
|
sleep(100).then(() => {
|
|
30
36
|
setScrollAnimation(!!animation);
|
|
31
37
|
const top = 1000000000000000 + Math.floor(Date.now() / 10);
|
|
@@ -46,7 +52,11 @@ export default function MessageList(props) {
|
|
|
46
52
|
scrollTop: scrollTop,
|
|
47
53
|
refresherTriggered: false,
|
|
48
54
|
enableFlex: true,
|
|
49
|
-
scrollY: true
|
|
55
|
+
scrollY: true,
|
|
56
|
+
onScroll: event => {
|
|
57
|
+
// 使用了 flex-direction: column-reverse,所以滚动到顶部时,scrollTop = 0
|
|
58
|
+
followNewMessageRef.current = event.detail.scrollTop > -10;
|
|
59
|
+
}
|
|
50
60
|
}, /*#__PURE__*/React.createElement(View, {
|
|
51
61
|
className: "t-agent-message-list-padding"
|
|
52
62
|
}), reversed.map((msg, index) => {
|
package/dist/contexts.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ChatAgent, ChatMessageObject, UIPlugin } from '@ray-js/t-agent';
|
|
3
|
-
import { AssistantPlugin
|
|
3
|
+
import { AssistantPlugin } from '@ray-js/t-agent-plugin-assistant';
|
|
4
4
|
import { RenderOptions, TileProps } from './types';
|
|
5
5
|
export declare const MessageContext: import("react").Context<{
|
|
6
6
|
messages: ChatMessageObject[];
|
|
7
|
-
|
|
7
|
+
keyboardHeight: number;
|
|
8
8
|
}>;
|
|
9
9
|
export declare const RenderContext: import("react").Context<RenderOptions>;
|
|
10
10
|
export declare const ChatAgentContext: import("react").Context<ChatAgent<UIPlugin & AssistantPlugin>>;
|
package/dist/contexts.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { createContext } from 'react';
|
|
2
|
-
import { SocketStatus } from '@ray-js/t-agent-plugin-assistant';
|
|
3
2
|
export const MessageContext = /*#__PURE__*/createContext({
|
|
4
3
|
messages: [],
|
|
5
|
-
|
|
4
|
+
keyboardHeight: 0
|
|
6
5
|
});
|
|
7
6
|
export const RenderContext = /*#__PURE__*/createContext({
|
|
8
7
|
renderTileAs: () => null,
|
package/dist/hooks/context.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { TTTAction } from '@ray-js/t-agent-plugin-assistant';
|
|
|
2
2
|
export declare const useChatAgent: () => import("@ray-js/t-agent").ChatAgent<import("@ray-js/t-agent").UIPlugin & import("@ray-js/t-agent-plugin-assistant").AssistantPlugin>;
|
|
3
3
|
export declare const useAgentMessage: () => {
|
|
4
4
|
messages: import("@ray-js/t-agent").ChatMessageObject[];
|
|
5
|
-
|
|
5
|
+
keyboardHeight: number;
|
|
6
6
|
};
|
|
7
7
|
export declare const useRenderOptions: () => import("..").RenderOptions;
|
|
8
8
|
export declare const useOnEvent: (eventName: string, callback: (details: any) => void) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
2
|
-
import { useRef, useState } from 'react';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { Asr, AsrDetectResultState } from '@ray-js/t-agent-plugin-assistant';
|
|
4
|
+
import { useIsUnmounted } from './useIsUnmounted';
|
|
4
5
|
export let AsrErrorCode = /*#__PURE__*/function (AsrErrorCode) {
|
|
5
6
|
AsrErrorCode[AsrErrorCode["SHORT_TIME"] = 0] = "SHORT_TIME";
|
|
6
7
|
return AsrErrorCode;
|
|
@@ -47,8 +48,18 @@ export function useAsrInput(options) {
|
|
|
47
48
|
const asrRef = useRef(null);
|
|
48
49
|
const [currentText, setCurrentText] = useState('');
|
|
49
50
|
const [incomingText, setIncomingText] = useState('');
|
|
51
|
+
const isUnmounted = useIsUnmounted();
|
|
50
52
|
const [state, setState] = useState('init');
|
|
51
53
|
const startAt = useRef(0);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
return () => {
|
|
56
|
+
if (asrRef.current) {
|
|
57
|
+
asrRef.current.stop();
|
|
58
|
+
asrRef.current = null;
|
|
59
|
+
Asr.dispose();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}, []);
|
|
52
63
|
return {
|
|
53
64
|
currentText,
|
|
54
65
|
incomingText,
|
|
@@ -61,21 +72,31 @@ export function useAsrInput(options) {
|
|
|
61
72
|
},
|
|
62
73
|
press: async () => {
|
|
63
74
|
setState('recording');
|
|
64
|
-
|
|
75
|
+
|
|
76
|
+
// 保存当前文本,用于恢复
|
|
65
77
|
const initial = text;
|
|
66
|
-
|
|
78
|
+
|
|
79
|
+
// 上次识别的结果
|
|
80
|
+
let last = '';
|
|
67
81
|
setCurrentText(initial);
|
|
68
82
|
setIncomingText('');
|
|
69
83
|
|
|
70
84
|
// 开始录音时
|
|
71
|
-
const asr = Asr.detect(
|
|
72
|
-
if (
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
85
|
+
const asr = Asr.detect(res => {
|
|
86
|
+
if (isUnmounted()) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (res.state === AsrDetectResultState.MID || res.state === AsrDetectResultState.END) {
|
|
90
|
+
if (res.text.startsWith(last)) {
|
|
91
|
+
const incoming = res.text.slice(last.length);
|
|
92
|
+
setIncomingText(incoming);
|
|
93
|
+
setCurrentText(initial + last);
|
|
94
|
+
last = res.text;
|
|
95
|
+
} else {
|
|
96
|
+
setIncomingText(res.text);
|
|
97
|
+
setCurrentText(initial);
|
|
98
|
+
}
|
|
99
|
+
setText(initial + res.text);
|
|
79
100
|
}
|
|
80
101
|
if (res.state === AsrDetectResultState.ERROR) {
|
|
81
102
|
onError(new AsrError(res.errorCode));
|
|
@@ -83,6 +104,7 @@ export function useAsrInput(options) {
|
|
|
83
104
|
});
|
|
84
105
|
try {
|
|
85
106
|
await asr.start();
|
|
107
|
+
startAt.current = Date.now();
|
|
86
108
|
asrRef.current = asr;
|
|
87
109
|
} catch (error) {
|
|
88
110
|
onError(error);
|
|
@@ -92,15 +114,14 @@ export function useAsrInput(options) {
|
|
|
92
114
|
if (state !== 'recording') {
|
|
93
115
|
return;
|
|
94
116
|
}
|
|
117
|
+
if (!text && startAt.current - Date.now() < 400) {
|
|
118
|
+
onError(new AsrError(AsrErrorCode.SHORT_TIME));
|
|
119
|
+
}
|
|
95
120
|
if (text) {
|
|
96
121
|
setState('pending');
|
|
97
122
|
} else {
|
|
98
|
-
onError(new AsrError(AsrErrorCode.SHORT_TIME));
|
|
99
123
|
setState('init');
|
|
100
124
|
}
|
|
101
|
-
if (Date.now() - startAt.current < 500 && text.length === 0) {
|
|
102
|
-
onError(new AsrError(AsrErrorCode.SHORT_TIME));
|
|
103
|
-
}
|
|
104
125
|
if (asrRef.current) {
|
|
105
126
|
await asrRef.current.stop();
|
|
106
127
|
asrRef.current = null;
|
|
@@ -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
|
-
},
|
|
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
|
-
})),
|
|
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.
|
|
3
|
+
"version": "0.0.8-beta-2",
|
|
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": "
|
|
44
|
+
"gitHead": "0fe6e7c1daafbeffd1394a7ee85ab4ae86d8f93e"
|
|
45
45
|
}
|