@glodon-aiot/chat-app-sdk 0.0.28 → 0.0.29

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/README.md CHANGED
@@ -8,7 +8,7 @@ Glodon AIoT Chat App SDK - 基于广联达行业AI平台的智能聊天 SDK,
8
8
 
9
9
  ## 📚 在线示例
10
10
 
11
- **🎯 [查看完整示例和演示](https://aruna1990.github.io/glodon-aiot-examples/)**
11
+ **🎯 [查看完整示例和演示](https://glodon-aiot.github.io/chat-app-sdk-demo/live/#/demo)**
12
12
 
13
13
  示例项目展示了以下功能:
14
14
  - ✅ Web Components 集成
@@ -272,7 +272,7 @@ const client = new WebChatClient({
272
272
 
273
273
  ### 示例组件
274
274
 
275
- 查看 [在线示例](https://aruna1990.github.io/glodon-aiot-examples/) 了解以下组件的实现:
275
+ 查看 [在线示例](https://glodon-aiot.github.io/chat-app-sdk-demo/live/#/demo) 了解以下组件的实现:
276
276
 
277
277
  - `knowledge-reference-list` - 知识库引用列表组件
278
278
  - `search-result-list` - 搜索结果列表组件
@@ -440,7 +440,7 @@ auth: {
440
440
 
441
441
  ### Q6: 如何自定义 Web Components?
442
442
 
443
- 参考 [在线示例](https://aruna1990.github.io/glodon-aiot-examples/) 中的实现,注册自定义组件并在配置中指定:
443
+ 参考 [在线示例](https://glodon-aiot.github.io/chat-app-sdk-demo/live/#/demo) 中的实现,注册自定义组件并在配置中指定:
444
444
 
445
445
  ```typescript
446
446
  // 注册组件
@@ -496,7 +496,7 @@ Apache-2.0
496
496
 
497
497
  ## 🔗 相关链接
498
498
 
499
- - 📚 [在线示例和演示](https://aruna1990.github.io/glodon-aiot-examples/)
499
+ - 📚 [在线示例和演示](https://glodon-aiot.github.io/chat-app-sdk-demo/live/#/demo)
500
500
  - 📦 [npm 包地址](https://www.npmjs.com/package/@glodon-aiot/chat-app-sdk)
501
501
  - 📖 [广联达行业AI平台官方文档](https://glodon-cv-help.yuque.com/cuv0se/ol9231)
502
502
 
package/es/index.esm.js CHANGED
@@ -294756,7 +294756,10 @@ const FileCard_FileCard = (props)=>{
294756
294756
  ].includes(file[statusKey]) ? FAIL_FILE_ICON_MAP : SUCCESS_FILE_ICON_MAP;
294757
294757
  const buttonsVisible = !readonly;
294758
294758
  const { extension, nameWithoutExtension } = getFileExtensionAndName(file.file_name);
294759
- const isCanceled = file[statusKey] === statusEnum.cancelEnum;
294759
+ // Coze Chat SDK uses status 3 for upload failed; show as failed (not canceled)
294760
+ const FILE_STATUS_UPLOAD_FAILED = 3;
294761
+ const isUploadFailed = file[statusKey] === statusEnum.failEnum || file[statusKey] === FILE_STATUS_UPLOAD_FAILED;
294762
+ const isCanceled = file[statusKey] === statusEnum.cancelEnum && file[statusKey] !== FILE_STATUS_UPLOAD_FAILED;
294760
294763
  const fileStatusValue = file[statusKey];
294761
294764
  const fileUrl = file.file_url;
294762
294765
  const fileKey = file.file_key;
@@ -294824,7 +294827,7 @@ const FileCard_FileCard = (props)=>{
294824
294827
  // showBackground && file[statusKey] !== statusEnum.failEnum,
294825
294828
  // })}
294826
294829
  className: classnames_default()(typeSafeFileCardVariants({
294827
- isError: file[statusKey] === statusEnum.failEnum,
294830
+ isError: isUploadFailed,
294828
294831
  layout: layout === common_Layout.PC ? "pc" : "mobile",
294829
294832
  showBackground
294830
294833
  }), className, "cursor-pointer"),
@@ -294890,10 +294893,10 @@ const FileCard_FileCard = (props)=>{
294890
294893
  }
294891
294894
  })
294892
294895
  }),
294893
- [
294896
+ ([
294894
294897
  statusEnum.cancelEnum,
294895
294898
  statusEnum.failEnum
294896
- ].includes(file[statusKey]) && /*#__PURE__*/ (0,jsx_runtime_.jsx)(UIKitTooltip, {
294899
+ ].includes(file[statusKey]) || file[statusKey] === FILE_STATUS_UPLOAD_FAILED) && /*#__PURE__*/ (0,jsx_runtime_.jsx)(UIKitTooltip, {
294897
294900
  theme: "light",
294898
294901
  position: "top",
294899
294902
  content: tooltipsCopywriting === null || tooltipsCopywriting === void 0 ? void 0 : tooltipsCopywriting.retry,
@@ -427128,9 +427131,12 @@ const useUploadToKnowledge = (config)=>{
427128
427131
  // 轮询被用户取消(已删除文件)时不再更新 store,直接返回 null
427129
427132
  if (statusResult === null && (controller === null || controller === void 0 ? void 0 : controller.signal.aborted)) return null;
427130
427133
  if (statusResult) {
427131
- // Check if file processing failed
427134
+ // 处理失败时返回 null,让 chat-input 将文件标为 Error,file card 展示上传失败
427132
427135
  const failedFile = statusResult.find((item)=>item.status === 3);
427133
- if (failedFile) console.error(`File processing failed: ${failedFile.message}`, failedFile);
427136
+ if (failedFile) {
427137
+ console.error(`File processing failed: ${failedFile.message}`, failedFile);
427138
+ return null;
427139
+ }
427134
427140
  }
427135
427141
  return result.data;
427136
427142
  } else {
@@ -427594,20 +427600,20 @@ const ProgressMask = (param)=>{
427594
427600
 
427595
427601
 
427596
427602
 
427603
+ // import { IconRefresh } from '@coze-arch/bot-icons';
427597
427604
 
427598
427605
 
427599
427606
 
427600
427607
 
427601
-
427602
-
427608
+ // import { useRetryUpload } from '../../../hooks/file/use-upload';
427603
427609
 
427604
427610
 
427605
427611
  const CommonFile = (param)=>{
427606
427612
  let { file, status, percent, id, className, uri, url } = param;
427607
427613
  const ref = (0,react_.useRef)(null);
427608
427614
  const isHover = useHover_(ref);
427609
- const retryUpload = useRetryUpload();
427610
- const onRetry = ()=>retryUpload(id, file);
427615
+ // const retryUpload = useRetryUpload();
427616
+ // const onRetry = () => retryUpload(id, file);
427611
427617
  const isError = status === types_FileStatus.Error;
427612
427618
  const isSuccess = status === types_FileStatus.Success;
427613
427619
  const fileTypeConfig = getFileTypConfig(file);
@@ -427691,15 +427697,6 @@ const CommonFile = (param)=>{
427691
427697
  }) : null
427692
427698
  ]
427693
427699
  }),
427694
- isError ? /*#__PURE__*/ (0,jsx_runtime_.jsx)(ui_button_Button, {
427695
- icon: /*#__PURE__*/ (0,jsx_runtime_.jsx)(IconRefresh, {}),
427696
- onClick: (e)=>{
427697
- e.stopPropagation();
427698
- onRetry();
427699
- },
427700
- theme: "borderless",
427701
- className: batch_upload_file_list_common_file_index_module_["retry-button"]
427702
- }) : null,
427703
427700
  isSuccess ? /*#__PURE__*/ (0,jsx_runtime_.jsx)(esm_webpack_exports_Tooltip, {
427704
427701
  content: "预览",
427705
427702
  theme: "light",