@baishuyun/ai-design 2.0.27 → 2.0.28

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
@@ -1,5 +1,14 @@
1
1
  # @baishuyun/ai-design
2
2
 
3
+ ## 2.0.28
4
+
5
+ ### Patch Changes
6
+
7
+ - fix tree entry
8
+ - Updated dependencies
9
+ - @baishuyun/types@3.0.24
10
+ - @baishuyun/ai-feat-utils@2.0.26
11
+
3
12
  ## 2.0.27
4
13
 
5
14
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baishuyun/ai-design",
3
- "version": "2.0.27",
3
+ "version": "2.0.28",
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.25",
64
- "@baishuyun/types": "3.0.23"
63
+ "@baishuyun/ai-feat-utils": "2.0.26",
64
+ "@baishuyun/types": "3.0.24"
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.23",
86
+ "@baishuyun/types": "3.0.24",
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
- return buildEntryTreeFromAliasMap(appDetails[currentAppId], searchQuery);
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,
@@ -111,6 +111,7 @@ export function buildEntryTreeFromAliasMap(
111
111
  for (const rootId of rootParents) {
112
112
  result.push(...buildRecursive(rootId, 0));
113
113
  }
114
+
114
115
  return result;
115
116
  }
116
117
 
@@ -32,7 +32,7 @@ const ChevronRightIcon = ({ size }: { size?: number }) => (
32
32
  <SolidArrowDownIcon className="-rotate-90" size={size} />
33
33
  );
34
34
 
35
- interface FlatNode {
35
+ export interface FlatNode {
36
36
  node: EntryTreeItem;
37
37
  appId: string;
38
38
  section: 'current' | 'other';