@alicloud/appflow-chat 0.0.4-alpha.11 → 0.0.4-alpha.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alicloud/appflow-chat",
3
- "version": "0.0.4-alpha.11",
3
+ "version": "0.0.4-alpha.12",
4
4
  "description": "Appflow-Chat AI聊天机器人组件库,提供聊天服务和UI组件",
5
5
  "type": "module",
6
6
  "main": "./dist/appflow-chat.cjs.js",
@@ -5,7 +5,7 @@
5
5
  import React, { useState, useRef, useCallback, useMemo, useEffect } from 'react';
6
6
  import { Sender, Attachments } from '@ant-design/x';
7
7
  import type { AttachmentsProps } from '@ant-design/x';
8
- import { Select, Switch, Button, Tooltip } from 'antd';
8
+ import { Select, Switch, Button, Tooltip, Spin } from 'antd';
9
9
  import {
10
10
  PaperClipOutlined,
11
11
  PictureOutlined,
@@ -429,34 +429,36 @@ export const ChatSender: React.FC<ChatSenderProps> = ({
429
429
  content: { padding: 4 },
430
430
  }}
431
431
  >
432
- <Attachments
433
- ref={attachmentsRef as any}
434
- items={attachmentItems as AttachmentsProps['items']}
435
- accept={acceptTypes}
436
- multiple
437
- customRequest={({ file }) => {
438
- if (file instanceof File) {
439
- handleFileUpload(file);
440
- }
441
- }}
442
- onRemove={(file) => {
443
- setAttachments(prev => {
444
- const updated = prev.filter(a => a.uid !== file.uid);
445
- if (updated.length === 0) {
446
- setHeaderOpen(false);
432
+ <Spin spinning={isUploading} tip="文件上传中,请稍候...">
433
+ <Attachments
434
+ ref={attachmentsRef as any}
435
+ items={attachmentItems as AttachmentsProps['items']}
436
+ accept={acceptTypes}
437
+ multiple
438
+ customRequest={({ file }) => {
439
+ if (file instanceof File) {
440
+ handleFileUpload(file);
447
441
  }
448
- return updated;
449
- });
450
- }}
451
- placeholder={{
452
- icon: <CloudUploadOutlined />,
453
- title: '拖拽文件到此处',
454
- description: '支持图片和文件',
455
- }}
456
- />
442
+ }}
443
+ onRemove={(file) => {
444
+ setAttachments(prev => {
445
+ const updated = prev.filter(a => a.uid !== file.uid);
446
+ if (updated.length === 0) {
447
+ setHeaderOpen(false);
448
+ }
449
+ return updated;
450
+ });
451
+ }}
452
+ placeholder={{
453
+ icon: <CloudUploadOutlined />,
454
+ title: '拖拽文件到此处',
455
+ description: '支持图片和文件',
456
+ }}
457
+ />
458
+ </Spin>
457
459
  </Sender.Header>
458
460
  );
459
- }, [hasUploadCapability, headerOpen, attachmentItems]);
461
+ }, [hasUploadCapability, headerOpen, attachmentItems, isUploading]);
460
462
 
461
463
  // ==================== 触发文件选择 ====================
462
464