@baishuyun/ai-design 2.0.36 → 2.0.37
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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baishuyun/ai-design",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.37",
|
|
4
4
|
"description": "AI 功能 UI 组件库 - 所有 AI 功能的 UI 表现唯一真相来源",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"tw-animate-css": "^1.4.0",
|
|
61
61
|
"vaul": "^1.1.2",
|
|
62
62
|
"zod": "^4.1.13",
|
|
63
|
-
"@baishuyun/ai-feat-utils": "2.0.
|
|
63
|
+
"@baishuyun/ai-feat-utils": "2.0.33",
|
|
64
64
|
"@baishuyun/types": "3.0.30"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"typescript": "^5.5.0",
|
|
84
84
|
"vite": "^5.1.4",
|
|
85
85
|
"vite-plugin-dts": "^4.5.4",
|
|
86
|
-
"@baishuyun/tailwind-config": "3.0.9",
|
|
87
86
|
"@baishuyun/types": "3.0.30",
|
|
87
|
+
"@baishuyun/tailwind-config": "3.0.9",
|
|
88
88
|
"@baishuyun/typescript-config": "2.0.9"
|
|
89
89
|
},
|
|
90
90
|
"keywords": [],
|
|
@@ -20,7 +20,7 @@ const PopoverContent = React.forwardRef<
|
|
|
20
20
|
PopoverContentProps
|
|
21
21
|
>(
|
|
22
22
|
(
|
|
23
|
-
{ className, align = 'start', sideOffset = 4, portalContainer, style, onWheel, ...props },
|
|
23
|
+
{ className, align = 'start', sideOffset = 4, portalContainer, style, onWheel, onOpenAutoFocus, ...props },
|
|
24
24
|
ref
|
|
25
25
|
) => {
|
|
26
26
|
const handleWheel = portalContainer
|
|
@@ -45,6 +45,12 @@ const PopoverContent = React.forwardRef<
|
|
|
45
45
|
}
|
|
46
46
|
: onWheel;
|
|
47
47
|
|
|
48
|
+
// 默认阻止 Radix 打开浮层时自动聚焦内部第一个可聚焦元素(通常是搜索框),
|
|
49
|
+
// 移动端会因此唤起软键盘,不是期望的交互;调用方仍可显式传 onOpenAutoFocus 覆盖
|
|
50
|
+
const handleOpenAutoFocus = onOpenAutoFocus ?? ((event: Event) => {
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
});
|
|
53
|
+
|
|
48
54
|
return (
|
|
49
55
|
<PopoverPrimitive.Portal container={portalContainer ?? undefined}>
|
|
50
56
|
<PopoverPrimitive.Content
|
|
@@ -52,6 +58,7 @@ const PopoverContent = React.forwardRef<
|
|
|
52
58
|
align={align}
|
|
53
59
|
sideOffset={sideOffset}
|
|
54
60
|
onWheel={handleWheel}
|
|
61
|
+
onOpenAutoFocus={handleOpenAutoFocus}
|
|
55
62
|
className={cn(
|
|
56
63
|
'z-50 w-60 rounded-[8px] bg-white p-1 text-[#121111] shadow-[0px_6px_16px_rgba(0,0,0,0.06)] outline-none',
|
|
57
64
|
'data-[state=open]:animate-in data-[state=closed]:animate-out',
|