@ant-design/agentic-ui 2.10.2 → 2.11.0

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.
@@ -49,7 +49,7 @@ import { Button, Modal, Tooltip } from "antd";
49
49
  import React, { useCallback, useContext, useMemo, useState } from "react";
50
50
  import { useRefFunction } from "../../Hooks/useRefFunction";
51
51
  import { I18nContext } from "../../I18n";
52
- import { isMobileDevice, isVivoOrOppoDevice, kbToSize } from "./utils";
52
+ import { isMobileDevice, isVivoOrOppoDevice, isWeChat, kbToSize } from "./utils";
53
53
  /**
54
54
  * 移动设备默认的文件类型 accept 值
55
55
  */ 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,text/plain,application/x-zip-compressed';
@@ -142,6 +142,9 @@ export var AttachmentButtonPopover = function(param) {
142
142
  var isMobile = useMemo(function() {
143
143
  return isMobileDevice();
144
144
  }, []);
145
+ var isWeChatEnv = useMemo(function() {
146
+ return isWeChat();
147
+ }, []);
145
148
  var trigger = useMemo(function() {
146
149
  return isVivoOrOppo ? [
147
150
  'click'
@@ -158,8 +161,8 @@ export var AttachmentButtonPopover = function(param) {
158
161
  * 根据支持的格式获取 accept 属性值
159
162
  */ var getAcceptValue = useRefFunction(function(forGallery) {
160
163
  // 如果是移动设备,返回默认的 accept 值
161
- if (isMobile || forGallery) {
162
- return MOBILE_DEFAULT_ACCEPT;
164
+ if (isMobile || forGallery || isWeChatEnv) {
165
+ return '';
163
166
  }
164
167
  // 打开文件,使用具体扩展名列表
165
168
  return extensions.length > 0 ? extensions.map(function(ext) {
@@ -85,3 +85,15 @@ export declare const isVivoOrOppoDevice: (ua?: string) => boolean;
85
85
  * ```
86
86
  */
87
87
  export declare const isMobileDevice: () => boolean;
88
+ /**
89
+ * 检测是否为微信环境
90
+ *
91
+ * @param {string} [ua] - User Agent 字符串,如果不提供则使用 navigator.userAgent
92
+ * @returns {boolean} 是否为微信环境
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * isWeChat() // true | false
97
+ * ```
98
+ */
99
+ export declare const isWeChat: (ua?: string) => boolean;
@@ -366,3 +366,20 @@
366
366
  var isSmallScreen = typeof window !== 'undefined' && window.innerWidth <= 768;
367
367
  return mobileRegex.test(userAgent) || hasTouchScreen && isSmallScreen;
368
368
  };
369
+ /**
370
+ * 检测是否为微信环境
371
+ *
372
+ * @param {string} [ua] - User Agent 字符串,如果不提供则使用 navigator.userAgent
373
+ * @returns {boolean} 是否为微信环境
374
+ *
375
+ * @example
376
+ * ```ts
377
+ * isWeChat() // true | false
378
+ * ```
379
+ */ export var isWeChat = function(ua) {
380
+ if (typeof navigator === 'undefined' && !ua) {
381
+ return false;
382
+ }
383
+ var userAgent = (ua || navigator.userAgent).toLowerCase();
384
+ return /micromessenger/i.test(userAgent);
385
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ant-design/agentic-ui",
3
- "version": "2.10.2",
3
+ "version": "2.11.0",
4
4
  "description": "面向智能体的 UI 组件库,提供多步推理可视化、工具调用展示、任务执行协同等 Agentic UI 能力",
5
5
  "repository": "git@github.com:ant-design/agentic-ui.git",
6
6
  "license": "MIT",