@baishuyun/ai-design 2.0.27 → 2.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/CHANGELOG.md +18 -0
- package/package.json +4 -4
- package/src/components/bs-entry-select/bs-entry-select.tsx +24 -4
- package/src/components/bs-entry-select/build-tree.ts +1 -0
- package/src/components/bs-entry-select/scroll-slider.tsx +1 -1
- package/src/components/field-checker.tsx +5 -0
- package/src/components/line-checker.tsx +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @baishuyun/ai-design
|
|
2
2
|
|
|
3
|
+
## 2.0.29
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- new std action
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @baishuyun/ai-feat-utils@2.0.27
|
|
10
|
+
- @baishuyun/types@3.0.25
|
|
11
|
+
|
|
12
|
+
## 2.0.28
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- fix tree entry
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @baishuyun/types@3.0.24
|
|
19
|
+
- @baishuyun/ai-feat-utils@2.0.26
|
|
20
|
+
|
|
3
21
|
## 2.0.27
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baishuyun/ai-design",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.29",
|
|
4
4
|
"description": "AI 功能 UI 组件库 - 所有 AI 功能的 UI 表现唯一真相来源",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -60,8 +60,8 @@
|
|
|
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.
|
|
64
|
-
"@baishuyun/types": "3.0.
|
|
63
|
+
"@baishuyun/ai-feat-utils": "2.0.27",
|
|
64
|
+
"@baishuyun/types": "3.0.25"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"react": "^19.0.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"typescript": "^5.5.0",
|
|
84
84
|
"vite": "^5.1.4",
|
|
85
85
|
"vite-plugin-dts": "^4.5.4",
|
|
86
|
-
"@baishuyun/types": "3.0.
|
|
86
|
+
"@baishuyun/types": "3.0.25",
|
|
87
87
|
"@baishuyun/tailwind-config": "3.0.9",
|
|
88
88
|
"@baishuyun/typescript-config": "2.0.9"
|
|
89
89
|
},
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
import { createPortal } from 'react-dom';
|
|
10
10
|
import { cn } from '../../lib/utils';
|
|
11
11
|
import { transCls } from '../../const/ui';
|
|
12
|
-
import { ScrollSlider } from './scroll-slider';
|
|
12
|
+
import { FlatNode, ScrollSlider } from './scroll-slider';
|
|
13
13
|
import { EntryPopover } from './entry-popover';
|
|
14
|
-
import { buildEntryTreeFromAliasMap } from './build-tree';
|
|
15
|
-
import type { BsEntrySelectProps, BsEntrySelectChangeResult } from './types';
|
|
14
|
+
import { buildEntryTreeFromAliasMap, buildFlowCenterTree } from './build-tree';
|
|
15
|
+
import type { BsEntrySelectProps, BsEntrySelectChangeResult, EntryTreeItem } from './types';
|
|
16
16
|
import { MenuLinesIcon } from '../bs-icons';
|
|
17
17
|
import { useSelectPopoverPosition } from '../../hooks/use-select-popover-position';
|
|
18
18
|
|
|
@@ -163,7 +163,27 @@ export const BsEntrySelect = forwardRef<HTMLDivElement, BsEntrySelectProps>(
|
|
|
163
163
|
|
|
164
164
|
const currentAppTree = useMemo(() => {
|
|
165
165
|
if (!currentAppId || !appDetails[currentAppId]) return [];
|
|
166
|
-
|
|
166
|
+
|
|
167
|
+
const showFlowCenter = (appDetails[currentAppId ?? '']?.isFlow ?? false);
|
|
168
|
+
|
|
169
|
+
const flowCenterNodes: FlatNode[] = [];
|
|
170
|
+
|
|
171
|
+
// Flow center — first tab in tabs mode for flow-type apps
|
|
172
|
+
if (showFlowCenter) {
|
|
173
|
+
const flowTree = buildFlowCenterTree();
|
|
174
|
+
flowCenterNodes.push(
|
|
175
|
+
...flowTree.map((node) => ({
|
|
176
|
+
node,
|
|
177
|
+
appId: currentAppId ?? '',
|
|
178
|
+
section: 'current' as const,
|
|
179
|
+
})),
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const flowCenterItems: EntryTreeItem[] = flowCenterNodes.map(n => n.node);
|
|
184
|
+
const result = buildEntryTreeFromAliasMap(appDetails[currentAppId], searchQuery);
|
|
185
|
+
|
|
186
|
+
return flowCenterItems.concat(result);
|
|
167
187
|
}, [
|
|
168
188
|
appDetails,
|
|
169
189
|
currentAppId,
|
|
@@ -18,6 +18,8 @@ export interface FieldCheckerProps {
|
|
|
18
18
|
streaming?: boolean;
|
|
19
19
|
confirmed?: boolean;
|
|
20
20
|
onLoaded?: (field: Field) => void;
|
|
21
|
+
/** 字段更新类型:new 新增(淡绿背景),removed 删除(置灰+中横线) */
|
|
22
|
+
updateType?: 'new' | 'removed';
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
export const FieldChecker = memo(
|
|
@@ -32,6 +34,7 @@ export const FieldChecker = memo(
|
|
|
32
34
|
checked,
|
|
33
35
|
streaming,
|
|
34
36
|
confirmed,
|
|
37
|
+
updateType,
|
|
35
38
|
}: FieldCheckerProps) => {
|
|
36
39
|
const { widget, label } = field;
|
|
37
40
|
if (!widget) {
|
|
@@ -119,6 +122,7 @@ export const FieldChecker = memo(
|
|
|
119
122
|
icon={icon}
|
|
120
123
|
className={extraPadding}
|
|
121
124
|
shortDesc={value as string}
|
|
125
|
+
updateType={updateType}
|
|
122
126
|
/>
|
|
123
127
|
);
|
|
124
128
|
}
|
|
@@ -136,6 +140,7 @@ export const FieldChecker = memo(
|
|
|
136
140
|
icon={icon}
|
|
137
141
|
shortDesc={typeDesc}
|
|
138
142
|
className={extraPadding}
|
|
143
|
+
updateType={updateType}
|
|
139
144
|
extra={
|
|
140
145
|
items.length ? (
|
|
141
146
|
<>
|
|
@@ -20,6 +20,8 @@ export interface LineCheckerProps {
|
|
|
20
20
|
streaming?: boolean;
|
|
21
21
|
confirmed?: boolean;
|
|
22
22
|
readonly?: boolean;
|
|
23
|
+
/** 字段更新类型:new 淡绿色背景(新增),removed 置灰+中横线(删除) */
|
|
24
|
+
updateType?: 'new' | 'removed';
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
export const LineChecker: React.FC<LineCheckerProps> = ({
|
|
@@ -36,6 +38,7 @@ export const LineChecker: React.FC<LineCheckerProps> = ({
|
|
|
36
38
|
confirmed,
|
|
37
39
|
readonly,
|
|
38
40
|
shortDesc,
|
|
41
|
+
updateType,
|
|
39
42
|
}) => {
|
|
40
43
|
const [checked, setChecked] = useState(defaultChecked);
|
|
41
44
|
|
|
@@ -80,10 +83,13 @@ export const LineChecker: React.FC<LineCheckerProps> = ({
|
|
|
80
83
|
'w-full transition-colors cursor-pointer',
|
|
81
84
|
{
|
|
82
85
|
'cursor-not-allowed': disabled,
|
|
83
|
-
'hover:bg-[#EFF0F6]': !disabled,
|
|
86
|
+
'hover:bg-[#EFF0F6]': !disabled && !updateType,
|
|
84
87
|
'items-start': hasExtra,
|
|
85
88
|
'items-center': !hasExtra,
|
|
86
89
|
'pointer-events-none': streaming || disabled || readonly || confirmed,
|
|
90
|
+
// 字段更新视觉:新增淡绿背景,删除置灰
|
|
91
|
+
'bg-[#F0FDF4]': updateType === 'new',
|
|
92
|
+
'bg-[#F5F5F5]': updateType === 'removed',
|
|
87
93
|
},
|
|
88
94
|
className
|
|
89
95
|
)}
|
|
@@ -116,12 +122,13 @@ export const LineChecker: React.FC<LineCheckerProps> = ({
|
|
|
116
122
|
<div className="w-4 h-4 flex-shrink-0 text-[#6F829E] leading-[16px]">{icon}</div>
|
|
117
123
|
)}
|
|
118
124
|
|
|
119
|
-
{/* Title - truncates */}
|
|
125
|
+
{/* Title - truncates;removed 时置灰并加中横线 */}
|
|
120
126
|
<p
|
|
121
127
|
className={classNames(' min-w-0 text-sm text-[#121111] truncate text-[12px]', {
|
|
122
128
|
'flex-1': !!icon,
|
|
123
129
|
'flex-grow-1 flex-shrink-0': !icon,
|
|
124
130
|
'!text-[#666]': readonly,
|
|
131
|
+
'line-through !text-[#999]': updateType === 'removed',
|
|
125
132
|
})}
|
|
126
133
|
>
|
|
127
134
|
{title}
|
|
@@ -134,6 +141,7 @@ export const LineChecker: React.FC<LineCheckerProps> = ({
|
|
|
134
141
|
'whitespace-nowrap flex-shrink-0': !!icon,
|
|
135
142
|
anywhere: !icon,
|
|
136
143
|
'!text-[#121111]': readonly,
|
|
144
|
+
'line-through !text-[#999]': updateType === 'removed',
|
|
137
145
|
})}
|
|
138
146
|
>
|
|
139
147
|
{shortDesc}
|