@ant-design/agentic-ui 2.11.0 → 2.11.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.
@@ -159,12 +159,25 @@ export var AttachmentButtonPopover = function(param) {
159
159
  var extensions = format.extensions || [];
160
160
  /**
161
161
  * 根据支持的格式获取 accept 属性值
162
+ * 优先级:微信 > 手机品牌(oppo/vivo)> 移动设备 > 相册模式 > 默认
162
163
  */ var getAcceptValue = useRefFunction(function(forGallery) {
163
- // 如果是移动设备,返回默认的 accept 值
164
- if (isMobile || forGallery || isWeChatEnv) {
165
- return '';
164
+ // 相册模式
165
+ if (forGallery) {
166
+ return 'image/*';
166
167
  }
167
- // 打开文件,使用具体扩展名列表
168
+ // 1. 微信环境最优先:设置为空字符串以打开文件浏览器
169
+ if (isWeChatEnv) {
170
+ return '*';
171
+ }
172
+ // 2. 手机品牌其次(oppo/vivo):设置为空字符串以打开文件浏览器
173
+ if (isVivoOrOppo) {
174
+ return '*';
175
+ }
176
+ // 3. 移动设备其次:设置为空字符串以打开文件浏览器
177
+ if (isMobile) {
178
+ return '*';
179
+ }
180
+ // 5. 默认情况:使用具体扩展名列表
168
181
  return extensions.length > 0 ? extensions.map(function(ext) {
169
182
  return ".".concat(ext);
170
183
  }).join(',') : MOBILE_DEFAULT_ACCEPT;
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import React from 'react';
2
2
  import { AttachmentButtonPopoverProps } from './AttachmentButtonPopover';
3
3
  import { AttachmentFile, UploadResponse } from './types';
4
4
  export * from './AttachmentButtonPopover';
@@ -138,7 +138,7 @@ function _ts_generator(thisArg, body) {
138
138
  import { Paperclip } from "@sofa-design/icons";
139
139
  import { ConfigProvider, message } from "antd";
140
140
  import classNames from "classnames";
141
- import { default as React, useContext } from "react";
141
+ import React, { useContext } from "react";
142
142
  import { compileTemplate } from "../../I18n";
143
143
  import AttachmentButtonPopover, { SupportedFileFormats } from "./AttachmentButtonPopover";
144
144
  import { useStyle } from "./style";
@@ -181,9 +181,6 @@ import { I18nContext } from "../../I18n";
181
181
  import { upLoadFileToServer } from "../AttachmentButton";
182
182
  import { SupportedFileFormats } from "../AttachmentButton/AttachmentButtonPopover";
183
183
  import { isMobileDevice, isVivoOrOppoDevice } from "../AttachmentButton/utils";
184
- /**
185
- * 移动设备默认的文件类型 accept 值
186
- */ var MOBILE_DEFAULT_ACCEPT = 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf,.csv,image/*,text/plain,application/x-zip-compressed';
187
184
  /**
188
185
  * 文件上传管理器
189
186
  *
@@ -210,16 +207,6 @@ import { isMobileDevice, isVivoOrOppoDevice } from "../AttachmentButton/utils";
210
207
  var isMobile = isMobileDevice();
211
208
  var isVivoOrOppo = isVivoOrOppoDevice();
212
209
  var extensions = (supportedFormat === null || supportedFormat === void 0 ? void 0 : supportedFormat.extensions) || [];
213
- // 如果是移动设备,返回默认的 accept 值
214
- if (isMobile) {
215
- return MOBILE_DEFAULT_ACCEPT;
216
- }
217
- if (!isVivoOrOppo) {
218
- // 非 vivo/oppo 设备,直接使用扩展名列表
219
- return extensions.length > 0 ? extensions.map(function(ext) {
220
- return ".".concat(ext);
221
- }).join(',') : 'image/*';
222
- }
223
210
  // vivo/oppo 设备:判断是否只包含图片格式
224
211
  var imageExtensions = [
225
212
  'jpg',
@@ -237,6 +224,16 @@ import { isMobileDevice, isVivoOrOppoDevice } from "../AttachmentButton/utils";
237
224
  // 只支持图片格式,使用 image/* 打开相册
238
225
  return 'image/*';
239
226
  }
227
+ // 如果是移动设备,返回默认的 accept 值
228
+ if (isMobile) {
229
+ return '';
230
+ }
231
+ if (!isVivoOrOppo) {
232
+ // 非 vivo/oppo 设备,直接使用扩展名列表
233
+ return extensions.length > 0 ? extensions.map(function(ext) {
234
+ return ".".concat(ext);
235
+ }).join(',') : 'image/*';
236
+ }
240
237
  // 支持其他格式,使用具体扩展名列表打开文件选择器
241
238
  return extensions.length > 0 ? extensions.map(function(ext) {
242
239
  return ".".concat(ext);
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import React from 'react';
2
2
  export interface ChartStatisticProps {
3
3
  title?: string;
4
4
  tooltip?: string;
@@ -1,7 +1,7 @@
1
1
  import { QuestionCircleOutlined } from "@ant-design/icons";
2
2
  import { ConfigProvider, Tooltip } from "antd";
3
3
  import classNames from "classnames";
4
- import { default as React, useContext } from "react";
4
+ import React, { useContext } from "react";
5
5
  import { useStyle } from "./style";
6
6
  import { formatNumber } from "./utils";
7
7
  var ChartStatistic = function(param) {
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import React from 'react';
2
2
  export interface FilterOption {
3
3
  label: string;
4
4
  value: string;
@@ -1,7 +1,7 @@
1
1
  import { ChevronDown } from "@sofa-design/icons";
2
2
  import { Button, ConfigProvider, Dropdown, Segmented } from "antd";
3
3
  import classNames from "classnames";
4
- import { default as React, useContext } from "react";
4
+ import React, { useContext } from "react";
5
5
  import { I18nContext } from "../../../../I18n";
6
6
  import { useStyle } from "./style";
7
7
  var ChartFilter = function(param) {
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import React from 'react';
2
2
  /**
3
3
  * @fileoverview 图表工具栏组件文件
4
4
  *
@@ -1,7 +1,7 @@
1
1
  import { DownloadOutlined } from "@ant-design/icons";
2
2
  import { ConfigProvider, Tooltip } from "antd";
3
3
  import classNames from "classnames";
4
- import { default as React, useContext } from "react";
4
+ import React, { useContext } from "react";
5
5
  import { I18nContext } from "../../../../I18n";
6
6
  import TimeIcon from "../icons/TimeIcon";
7
7
  import { useStyle } from "./style";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ant-design/agentic-ui",
3
- "version": "2.11.0",
3
+ "version": "2.11.1",
4
4
  "description": "面向智能体的 UI 组件库,提供多步推理可视化、工具调用展示、任务执行协同等 Agentic UI 能力",
5
5
  "repository": "git@github.com:ant-design/agentic-ui.git",
6
6
  "license": "MIT",