@ray-js/t-agent-ui-ray 0.2.7-beta.5 → 0.2.7-beta.7
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/MarkdownRender/BlockParser.js +2 -1
- package/dist/MessageInput/MessageInputAIStream/index.js +2 -1
- package/dist/hooks/useAttachmentInput.js +4 -2
- package/dist/hooks/useTranslate.js +2 -1
- package/dist/tiles/BubbleTile/index.js +2 -2
- package/dist/utils/createSharedStore.js +3 -1
- package/package.json +2 -2
|
@@ -196,7 +196,8 @@ export class BlockParser {
|
|
|
196
196
|
}
|
|
197
197
|
const map = new Map();
|
|
198
198
|
const ids = [];
|
|
199
|
-
for (
|
|
199
|
+
for (let i = 0; i < this.pendingBlocks.length; i++) {
|
|
200
|
+
const item = this.pendingBlocks[i];
|
|
200
201
|
map.set("<".concat(item.id, " />"), item);
|
|
201
202
|
ids.push(item.id);
|
|
202
203
|
}
|
|
@@ -177,7 +177,8 @@ export default function MessageInputAIStream(props) {
|
|
|
177
177
|
}
|
|
178
178
|
attachmentInput.loadBlocks(blocks);
|
|
179
179
|
let t = '';
|
|
180
|
-
for (
|
|
180
|
+
for (let i = 0; i < blocks.length; i++) {
|
|
181
|
+
const block = blocks[i];
|
|
181
182
|
if (block.type === 'text') {
|
|
182
183
|
t = block.text;
|
|
183
184
|
}
|
|
@@ -20,7 +20,8 @@ export function useAttachmentInput() {
|
|
|
20
20
|
const blocks = useMemo(() => {
|
|
21
21
|
const b = [];
|
|
22
22
|
if (uploaded.length) {
|
|
23
|
-
for (
|
|
23
|
+
for (let i = 0; i < uploaded.length; i++) {
|
|
24
|
+
const uploadFile = uploaded[i];
|
|
24
25
|
if (uploadFile.type === 'image') {
|
|
25
26
|
if (local) {
|
|
26
27
|
b.push({
|
|
@@ -65,7 +66,8 @@ export function useAttachmentInput() {
|
|
|
65
66
|
}, [uploaded, local]);
|
|
66
67
|
const loadBlocks = useCallback((blocks, append) => {
|
|
67
68
|
const uploaded = [];
|
|
68
|
-
for (
|
|
69
|
+
for (let i = 0; i < blocks.length; i++) {
|
|
70
|
+
const block = blocks[i];
|
|
69
71
|
if (block.type === 'image_url') {
|
|
70
72
|
uploaded.push({
|
|
71
73
|
id: generateId(),
|
|
@@ -24,7 +24,8 @@ const normalizeLanguage = lang => {
|
|
|
24
24
|
if (cache.has(lang)) {
|
|
25
25
|
return cache.get(lang);
|
|
26
26
|
}
|
|
27
|
-
for (
|
|
27
|
+
for (let i = 0; i < keys.length; i++) {
|
|
28
|
+
const key = keys[i];
|
|
28
29
|
if (langRE[key].test(lang)) {
|
|
29
30
|
cache.set(lang, key);
|
|
30
31
|
return key;
|
|
@@ -3,7 +3,6 @@ import "core-js/modules/esnext.iterator.constructor.js";
|
|
|
3
3
|
import "core-js/modules/esnext.iterator.find.js";
|
|
4
4
|
import "core-js/modules/esnext.iterator.map.js";
|
|
5
5
|
import "core-js/modules/esnext.iterator.some.js";
|
|
6
|
-
import "core-js/modules/web.dom-collections.iterator.js";
|
|
7
6
|
import './index.less';
|
|
8
7
|
import { View } from '@ray-js/components';
|
|
9
8
|
import React, { memo, useCallback, useMemo } from 'react';
|
|
@@ -61,7 +60,8 @@ const BubbleTile = props => {
|
|
|
61
60
|
const longPressBlock = renderLongPressAs(longPressRes);
|
|
62
61
|
const isErrorBubble = useMemo(() => {
|
|
63
62
|
let empty = true;
|
|
64
|
-
for (
|
|
63
|
+
for (let i = 0; i < children.length; i++) {
|
|
64
|
+
const child = children[i];
|
|
65
65
|
// 如果子元素是文本类型,并且文本不为空,则不是空消息
|
|
66
66
|
if (child.type === 'text') {
|
|
67
67
|
if (child.data.text !== '') {
|
|
@@ -16,7 +16,9 @@ export function createSharedStore() {
|
|
|
16
16
|
setValue(newValue) {
|
|
17
17
|
const oldValue = storeRef.current.value;
|
|
18
18
|
storeRef.current.value = newValue;
|
|
19
|
-
|
|
19
|
+
const keys = Object.keys(newValue);
|
|
20
|
+
for (let i = 0; i < keys.length; i++) {
|
|
21
|
+
const key = keys[i];
|
|
20
22
|
if (oldValue[key] !== newValue[key]) {
|
|
21
23
|
var _storeRef$current$lis;
|
|
22
24
|
(_storeRef$current$lis = storeRef.current.listeners.get(key)) === null || _storeRef$current$lis === void 0 || _storeRef$current$lis.forEach(fn => fn());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/t-agent-ui-ray",
|
|
3
|
-
"version": "0.2.7-beta.
|
|
3
|
+
"version": "0.2.7-beta.7",
|
|
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": "
|
|
43
|
+
"gitHead": "4234e4b80d8cc59b9e7857ea28e14d62fcb8df03"
|
|
44
44
|
}
|