@baishuyun/ai-design 2.1.0-alpha.4 → 2.1.3
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/.storybook/preview.ts +2 -0
- package/CHANGELOG.md +197 -28
- package/package.json +11 -11
- package/scripts/post-build.cjs +32 -0
- package/src/components/agent-drawer.tsx +119 -0
- package/src/components/agent-helper/agent-entry-card/index.tsx +3 -8
- package/src/components/agent-helper/agent-helper-card/index.tsx +3 -3
- package/src/components/agent-helper/app-select/index.tsx +119 -84
- package/src/components/agent-helper/condition-input/index.tsx +18 -21
- package/src/components/agent-helper/condition-item/index.tsx +1 -0
- package/src/components/agent-helper/field-edit-preference-select/index.tsx +31 -4
- package/src/components/agent-helper/field-value-input/dept-select.tsx +447 -0
- package/src/components/agent-helper/field-value-input/index.tsx +3 -2
- package/src/components/agent-helper/field-value-input/picker-inputs.tsx +20 -18
- package/src/components/agent-helper/form-select/index.tsx +12 -25
- package/src/components/agent-helper/relational-operator-select/index.tsx +37 -23
- package/src/components/agent-helper/table/index.tsx +6 -2
- package/src/components/agent-helper/team-wide-form-select/data-adapter.ts +109 -0
- package/src/components/agent-helper/team-wide-form-select/index.tsx +289 -0
- package/src/components/agent-helper/team-wide-form-select/tree-panel.tsx +180 -0
- package/src/components/agent-helper/team-wide-form-select/types.ts +36 -0
- package/src/components/agent-helper/team-wide-form-select/use-form-tree.ts +108 -0
- package/src/components/agent-helper/trigger-select/index.tsx +1 -1
- package/src/components/agent-select.tsx +115 -35
- package/src/components/bot-avatar-name.tsx +1 -1
- package/src/components/bs-entry-select/build-tree.ts +0 -6
- package/src/components/bs-entry-select/entry-item.tsx +7 -11
- package/src/components/bs-entry-select/other-app-section.tsx +2 -4
- package/src/components/bs-entry-select/scroll-slider.tsx +6 -11
- package/src/components/bs-icons.tsx +752 -206
- package/src/components/card.tsx +55 -10
- package/src/components/circle-checker.tsx +18 -3
- package/src/components/collapsible-txt-msg.tsx +18 -13
- package/src/components/fake-bot-msg.tsx +18 -7
- package/src/components/field-checker-list-msg.tsx +4 -3
- package/src/components/fields-design-info-table.tsx +9 -26
- package/src/components/fields-portal.tsx +2 -2
- package/src/components/fields-previewer.tsx +1 -0
- package/src/components/font-icon.tsx +20 -9
- package/src/components/form-info-editor.tsx +21 -6
- package/src/components/legacy-slot.tsx +11 -16
- package/src/components/memoized-markdown.tsx +32 -19
- package/src/components/message-content.tsx +7 -3
- package/src/components/output-config-editor.tsx +39 -25
- package/src/components/primary-confirm-btn.tsx +6 -1
- package/src/components/scroll-to-bottom-btn.tsx +3 -2
- package/src/components/shadow-content.tsx +19 -0
- package/src/components/shadow-portal.tsx +23 -0
- package/src/components/ui/dialog.tsx +4 -1
- package/src/components/ui/drawer.tsx +3 -1
- package/src/components/ui/enhanced-drawer.tsx +134 -0
- package/src/components/ui/popover.tsx +3 -2
- package/src/components/ui/select.tsx +3 -2
- package/src/components/ui/tooltip.tsx +3 -2
- package/src/components/user-txt-msg-bubble.tsx +41 -19
- package/src/components/warning-msg.tsx +29 -12
- package/src/const/shadow.ts +17 -0
- package/src/const/ui.ts +2 -2
- package/src/hooks/use-column-appear.ts +1 -1
- package/src/hooks/use-portal-container.ts +6 -3
- package/src/hooks/use-shadow-boundary.ts +67 -0
- package/src/hooks/use-shadow.ts +24 -7
- package/src/index.ts +21 -0
- package/src/stories/AppSelect.stories.tsx +44 -0
- package/src/stories/FieldValueInput.stories.tsx +6 -3
- package/src/stories/FormSelect.stories.tsx +40 -0
- package/src/stories/IconfontPicker.stories.tsx +106 -0
- package/src/stories/RelationalOperatorSelect.stories.tsx +27 -0
- package/src/stories/TeamWideFormSelect.stories.tsx +362 -0
- package/src/stories/UserTextMsgBubble.stories.ts +28 -0
- package/src/style.css +30 -1
- package/style.css +172 -130
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { IAppFormListEntry } from '@baishuyun/types';
|
|
2
|
+
|
|
3
|
+
// ── Tree Node ─────────────────────────────────────────────────────
|
|
4
|
+
|
|
5
|
+
export type TeamWideFormNodeType = 'appGroup' | 'app' | 'formGroup' | 'form';
|
|
6
|
+
|
|
7
|
+
export interface TeamWideFormTreeNode {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
type: TeamWideFormNodeType;
|
|
11
|
+
/** app 节点的图标名(imgbg-bsy-app-N,AppIcon) */
|
|
12
|
+
appIcon?: number | string;
|
|
13
|
+
/** form/formGroup 节点的图标 number(FontIcon) */
|
|
14
|
+
formIcon?: number;
|
|
15
|
+
/** form 叶子节点的原始条目数据 */
|
|
16
|
+
data?: IAppFormListEntry;
|
|
17
|
+
children?: TeamWideFormTreeNode[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// ── Section(按当前应用分组展示) ──────────────────────────────────
|
|
21
|
+
|
|
22
|
+
export interface TeamWideFormTreeSection {
|
|
23
|
+
key: 'all' | 'current' | 'other';
|
|
24
|
+
/** 分组标题('当前应用表单' / '其他应用表单');'all' 无标题 */
|
|
25
|
+
title?: string;
|
|
26
|
+
nodes: TeamWideFormTreeNode[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// ── Change Result ─────────────────────────────────────────────────
|
|
30
|
+
|
|
31
|
+
export interface TeamWideFormSelectChangeResult {
|
|
32
|
+
appId: string;
|
|
33
|
+
entryId: string;
|
|
34
|
+
/** 选中的原始条目(含 type/icon/hasCoop 等) */
|
|
35
|
+
form: IAppFormListEntry;
|
|
36
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
2
|
+
import type { TeamWideFormTreeNode, TeamWideFormTreeSection } from './types';
|
|
3
|
+
|
|
4
|
+
/** 收集所有含子节点的 id(默认全部展开——树层级深,折叠会隐藏目标表单) */
|
|
5
|
+
function collectExpandableIds(nodes: TeamWideFormTreeNode[]): Set<string> {
|
|
6
|
+
const ids = new Set<string>();
|
|
7
|
+
const walk = (list: TeamWideFormTreeNode[]) => {
|
|
8
|
+
for (const n of list) {
|
|
9
|
+
if (n.children && n.children.length > 0) {
|
|
10
|
+
ids.add(n.id);
|
|
11
|
+
walk(n.children);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
walk(nodes);
|
|
16
|
+
return ids;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** 按关键字过滤树:命中自身或任一后代即保留(保留祖先链) */
|
|
20
|
+
function filterTree(
|
|
21
|
+
nodes: TeamWideFormTreeNode[],
|
|
22
|
+
query: string
|
|
23
|
+
): TeamWideFormTreeNode[] {
|
|
24
|
+
const q = query.trim().toLowerCase();
|
|
25
|
+
if (!q) return nodes;
|
|
26
|
+
|
|
27
|
+
const walk = (list: TeamWideFormTreeNode[]): TeamWideFormTreeNode[] => {
|
|
28
|
+
const result: TeamWideFormTreeNode[] = [];
|
|
29
|
+
for (const node of list) {
|
|
30
|
+
const selfMatch = node.label.toLowerCase().includes(q);
|
|
31
|
+
const filteredChildren = node.children ? walk(node.children) : [];
|
|
32
|
+
if (selfMatch || filteredChildren.length > 0) {
|
|
33
|
+
result.push({
|
|
34
|
+
...node,
|
|
35
|
+
children:
|
|
36
|
+
filteredChildren.length > 0 ? filteredChildren : node.children,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
return walk(nodes);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 树形面板状态:展开/收起 + 搜索过滤。
|
|
47
|
+
* 搜索时强制展开(让命中的深层节点可见)。
|
|
48
|
+
*/
|
|
49
|
+
export function useFormTree(sections: TeamWideFormTreeSection[]) {
|
|
50
|
+
const [searchQuery, setSearchQuery] = useState('');
|
|
51
|
+
const [collapsedIds, setCollapsedIds] = useState<Set<string>>(new Set());
|
|
52
|
+
|
|
53
|
+
const isExpanded = useCallback(
|
|
54
|
+
(id: string) => !collapsedIds.has(id),
|
|
55
|
+
[collapsedIds]
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const toggleExpanded = useCallback((id: string) => {
|
|
59
|
+
setCollapsedIds((prev) => {
|
|
60
|
+
const next = new Set(prev);
|
|
61
|
+
if (next.has(id)) next.delete(id);
|
|
62
|
+
else next.add(id);
|
|
63
|
+
return next;
|
|
64
|
+
});
|
|
65
|
+
}, []);
|
|
66
|
+
|
|
67
|
+
const filteredSections = useMemo(() => {
|
|
68
|
+
const searching = searchQuery.trim().length > 0;
|
|
69
|
+
return sections.map((section) => ({
|
|
70
|
+
...section,
|
|
71
|
+
nodes: filterTree(section.nodes, searchQuery),
|
|
72
|
+
searching,
|
|
73
|
+
}));
|
|
74
|
+
}, [sections, searchQuery]);
|
|
75
|
+
|
|
76
|
+
const totalVisible = useMemo(
|
|
77
|
+
() =>
|
|
78
|
+
filteredSections.reduce(
|
|
79
|
+
(sum, s) => sum + countLeaves(s.nodes),
|
|
80
|
+
0
|
|
81
|
+
),
|
|
82
|
+
[filteredSections]
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
searchQuery,
|
|
87
|
+
setSearchQuery,
|
|
88
|
+
filteredSections,
|
|
89
|
+
isExpanded,
|
|
90
|
+
toggleExpanded,
|
|
91
|
+
/** 搜索中(此时忽略折叠状态,全部展开) */
|
|
92
|
+
searching: searchQuery.trim().length > 0,
|
|
93
|
+
hasResult: totalVisible > 0,
|
|
94
|
+
expandableIds: useMemo(
|
|
95
|
+
() => collectExpandableIds(sections.reduce((acc, s) => acc.concat(s.nodes), [] as TeamWideFormTreeNode[])),
|
|
96
|
+
[sections]
|
|
97
|
+
),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function countLeaves(nodes: TeamWideFormTreeNode[]): number {
|
|
102
|
+
let count = 0;
|
|
103
|
+
for (const n of nodes) {
|
|
104
|
+
if (n.children && n.children.length > 0) count += countLeaves(n.children);
|
|
105
|
+
else count += 1;
|
|
106
|
+
}
|
|
107
|
+
return count;
|
|
108
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { triggerType } from '@baishuyun/types';
|
|
2
|
-
import { CommonTypeIcon, GoToFormIcon, FlowNodeTypeIcon, FormFieldIcon, FormTypeIcon } from '../../bs-icons';
|
|
2
|
+
import { CommonTypeIcon, GoToFormIcon, FlowNodeTypeIcon, ScheduleTypeIcon, FormFieldIcon, FormTypeIcon } from '../../bs-icons';
|
|
3
3
|
import { IconCard, type IconCardProps } from '../../icon-card';
|
|
4
4
|
|
|
5
5
|
export type TriggerCardConfig = Pick<
|
|
@@ -13,6 +13,11 @@ export interface AgentSelectProps {
|
|
|
13
13
|
className?: string;
|
|
14
14
|
activeAgent?: { id: string } | null;
|
|
15
15
|
onSelect: (agent: AgentSelectAgent) => void | Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* 大规格行(移动端设计稿 40434:32068):行高 40、图标 20、名称 16px、
|
|
18
|
+
* 分组标题 14px。默认 false,不影响现有 PC 样式
|
|
19
|
+
*/
|
|
20
|
+
large?: boolean;
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
interface AgentGroup {
|
|
@@ -27,6 +32,7 @@ export const AgentSelect = ({
|
|
|
27
32
|
onSelect,
|
|
28
33
|
showAllItems,
|
|
29
34
|
className,
|
|
35
|
+
large = false,
|
|
30
36
|
}: AgentSelectProps) => {
|
|
31
37
|
const [searchQuery, setSearchQuery] = useState('');
|
|
32
38
|
|
|
@@ -60,37 +66,67 @@ export const AgentSelect = ({
|
|
|
60
66
|
return (
|
|
61
67
|
<div className={classNames('flex flex-col', 'rounded-[4px]', className)}>
|
|
62
68
|
{showSearch && (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
69
|
+
// 大规格(移动端抽屉设计稿 40654:39905):搜索框高 46、圆角 100、左右 12 边距、
|
|
70
|
+
// 图标 18、文字 16px、占位「请输入智能体名称」
|
|
71
|
+
<div className={large ? 'px-[12px] pb-[10px]' : 'px-1.5 pt-1 pb-0.5'}>
|
|
72
|
+
<div
|
|
73
|
+
className={cn(
|
|
74
|
+
'flex items-center bg-white border border-[#E0E0E0]',
|
|
75
|
+
// shadow 内 --spacing=3.5px,数值类会缩小,设计稿像素一律用任意值
|
|
76
|
+
large
|
|
77
|
+
? 'h-[46px] gap-[6px] px-[10px] py-[5px] rounded-[100px]'
|
|
78
|
+
: 'h-7.5 gap-1.5 px-2.5 py-1.25 rounded-[4px]'
|
|
79
|
+
)}
|
|
80
|
+
>
|
|
81
|
+
{large ? (
|
|
82
|
+
<svg
|
|
83
|
+
width="18"
|
|
84
|
+
height="18"
|
|
85
|
+
viewBox="0 0 18 18"
|
|
86
|
+
fill="none"
|
|
87
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
88
|
+
className="shrink-0"
|
|
89
|
+
aria-hidden="true"
|
|
90
|
+
>
|
|
91
|
+
<path
|
|
92
|
+
d="M16.7608 15.6971L13.8144 12.6563C14.7965 11.3794 15.3849 9.90789 15.3849 8.14051C15.3849 4.21426 12.146 0.976513 8.21976 0.976513C4.29463 0.975388 1.05688 4.21426 1.05688 8.13939C1.05688 12.0656 4.29576 15.3056 8.22088 15.3056C9.88926 15.3056 11.4609 14.7161 12.7366 13.734L15.6808 16.6781C15.7786 16.875 15.9744 16.875 16.1713 16.875C16.3532 16.8711 16.5276 16.8012 16.6618 16.6781C16.9565 16.4824 16.9565 15.9919 16.7608 15.6971ZM2.52951 8.23839C2.5307 6.72901 3.13083 5.28179 4.19812 4.2145C5.26541 3.14721 6.71263 2.54708 8.22201 2.54589C9.73139 2.54708 11.1786 3.14721 12.2459 4.2145C13.3132 5.28179 13.9133 6.72901 13.9145 8.23839C13.9133 9.74777 13.3132 11.195 12.2459 12.2623C11.1786 13.3296 9.73139 13.9297 8.22201 13.9309C6.71263 13.9297 5.26541 13.3296 4.19812 12.2623C3.13083 11.195 2.5307 9.74777 2.52951 8.23839Z"
|
|
93
|
+
fill="#666666"
|
|
94
|
+
/>
|
|
95
|
+
</svg>
|
|
96
|
+
) : (
|
|
97
|
+
<svg
|
|
98
|
+
width="14"
|
|
99
|
+
height="14"
|
|
100
|
+
viewBox="0 0 14 14"
|
|
101
|
+
fill="none"
|
|
102
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
103
|
+
className="shrink-0 text-[#999999]"
|
|
104
|
+
>
|
|
105
|
+
<path
|
|
106
|
+
d="M6.41667 11.0833C8.994 11.0833 11.0833 8.994 11.0833 6.41667C11.0833 3.83934 8.994 1.75 6.41667 1.75C3.83934 1.75 1.75 3.83934 1.75 6.41667C1.75 8.994 3.83934 11.0833 6.41667 11.0833Z"
|
|
107
|
+
stroke="currentColor"
|
|
108
|
+
strokeWidth="1.2"
|
|
109
|
+
strokeLinecap="round"
|
|
110
|
+
strokeLinejoin="round"
|
|
111
|
+
/>
|
|
112
|
+
<path
|
|
113
|
+
d="M12.25 12.25L9.7125 9.7125"
|
|
114
|
+
stroke="currentColor"
|
|
115
|
+
strokeWidth="1.2"
|
|
116
|
+
strokeLinecap="round"
|
|
117
|
+
strokeLinejoin="round"
|
|
118
|
+
/>
|
|
119
|
+
</svg>
|
|
120
|
+
)}
|
|
88
121
|
<input
|
|
89
122
|
type="text"
|
|
90
|
-
placeholder=
|
|
123
|
+
placeholder={large ? '请输入智能体名称' : '搜索智能体助手'}
|
|
91
124
|
value={searchQuery}
|
|
92
125
|
onChange={(e) => setSearchQuery(e.target.value)}
|
|
93
|
-
className=
|
|
126
|
+
className={cn(
|
|
127
|
+
'h-full flex-1 bg-transparent text-[#121111] placeholder:text-[#999999] outline-none',
|
|
128
|
+
large ? 'text-[16px]' : 'text-[12px]'
|
|
129
|
+
)}
|
|
94
130
|
/>
|
|
95
131
|
</div>
|
|
96
132
|
</div>
|
|
@@ -101,29 +137,48 @@ export const AgentSelect = ({
|
|
|
101
137
|
<div key={group.label}>
|
|
102
138
|
<div
|
|
103
139
|
className={cn(
|
|
104
|
-
'flex
|
|
140
|
+
'flex items-start',
|
|
141
|
+
large ? 'h-[40px] px-[12px] pt-[9px]' : 'h-8 px-2.5 pt-2.25',
|
|
105
142
|
groupIndex > 0 && 'mt-0.5'
|
|
106
143
|
)}
|
|
107
144
|
>
|
|
108
|
-
<div
|
|
109
|
-
|
|
145
|
+
<div
|
|
146
|
+
className={cn(
|
|
147
|
+
'flex w-full flex-col gap-1.5',
|
|
148
|
+
// 设计稿分割线钉在分组头底部(justify-between)
|
|
149
|
+
large && 'h-full justify-between'
|
|
150
|
+
)}
|
|
151
|
+
>
|
|
152
|
+
<span
|
|
153
|
+
className={cn(
|
|
154
|
+
'font-medium text-[#666666]',
|
|
155
|
+
large ? 'text-[14px] leading-[20px]' : 'text-[12px] leading-4.25'
|
|
156
|
+
)}
|
|
157
|
+
>
|
|
110
158
|
{group.label}
|
|
111
159
|
</span>
|
|
112
160
|
<div className="h-0 w-full border-b border-[#E0E0E0]" />
|
|
113
161
|
</div>
|
|
114
162
|
</div>
|
|
115
163
|
|
|
116
|
-
|
|
164
|
+
{/* 大规格:全宽行(设计稿行高 46、左右 10) */}
|
|
165
|
+
<div className={large ? 'px-0' : 'px-1'}>
|
|
117
166
|
{group.agents.map((agent) => {
|
|
118
167
|
const isActive = activeAgent?.id === agent.id;
|
|
119
168
|
return (
|
|
120
169
|
<button
|
|
121
170
|
key={agent.id}
|
|
122
171
|
className={cn(
|
|
123
|
-
'flex
|
|
172
|
+
'flex w-full cursor-pointer items-center rounded-[4px] text-left',
|
|
173
|
+
large
|
|
174
|
+
? 'h-[46px] px-[12px] py-[10px] gap-[6px]'
|
|
175
|
+
: 'h-8 px-2.5 py-1.5 gap-1.5',
|
|
124
176
|
transCls,
|
|
177
|
+
// 选中态:移动端蓝字 + 勾选(无底色高亮,设计稿 40654:39918);PC 浅蓝底高亮
|
|
125
178
|
isActive
|
|
126
|
-
?
|
|
179
|
+
? large
|
|
180
|
+
? 'text-[#0265FF]'
|
|
181
|
+
: 'bg-[#F0F6FF] text-[#0265FF]'
|
|
127
182
|
: 'text-[#121111] hover:bg-[#EFF0F6]'
|
|
128
183
|
)}
|
|
129
184
|
onClick={() => handleSelect(agent)}
|
|
@@ -131,11 +186,36 @@ export const AgentSelect = ({
|
|
|
131
186
|
<img
|
|
132
187
|
src={agent.icon}
|
|
133
188
|
alt={agent.name}
|
|
134
|
-
className=
|
|
189
|
+
className={cn(
|
|
190
|
+
'rounded-[4px] object-cover shrink-0',
|
|
191
|
+
large ? 'size-[20px]' : 'h-4 w-4'
|
|
192
|
+
)}
|
|
135
193
|
/>
|
|
136
|
-
<span
|
|
194
|
+
<span
|
|
195
|
+
className={cn(
|
|
196
|
+
'truncate',
|
|
197
|
+
large && 'flex-1',
|
|
198
|
+
large ? 'text-[16px] leading-[22px]' : 'text-[14px] leading-5'
|
|
199
|
+
)}
|
|
200
|
+
>
|
|
137
201
|
{agent.name}
|
|
138
202
|
</span>
|
|
203
|
+
{/* 选中勾选(仅移动端 large) */}
|
|
204
|
+
{large && isActive && (
|
|
205
|
+
<svg
|
|
206
|
+
width="20"
|
|
207
|
+
height="20"
|
|
208
|
+
viewBox="0 0 20 20"
|
|
209
|
+
fill="none"
|
|
210
|
+
className="shrink-0"
|
|
211
|
+
aria-hidden="true"
|
|
212
|
+
>
|
|
213
|
+
<path
|
|
214
|
+
d="M15.7613 5.42387C15.5414 5.22244 15.2506 5.11654 14.9527 5.12943C14.6548 5.14232 14.3742 5.27295 14.1725 5.49262L8.23378 11.9676L5.91628 8.72387L5.82753 8.61387C5.63315 8.40442 5.36635 8.27678 5.08129 8.25687C4.79623 8.23696 4.51428 8.32628 4.29267 8.50668C4.07106 8.68708 3.92641 8.94506 3.88808 9.22823C3.84975 9.5114 3.92061 9.79855 4.08628 10.0314L7.21128 14.4064L7.30628 14.5226C7.41228 14.6356 7.54046 14.7254 7.6828 14.7865C7.82514 14.8477 7.97856 14.8787 8.13346 14.8778C8.28836 14.8768 8.4414 14.8439 8.58299 14.7811C8.72457 14.7183 8.85166 14.6269 8.95628 14.5126L15.8313 7.01262L15.9263 6.89387C16.0811 6.67029 16.1497 6.3982 16.1193 6.12794C16.089 5.85769 15.9618 5.60757 15.7613 5.42387Z"
|
|
215
|
+
fill="#0265FF"
|
|
216
|
+
/>
|
|
217
|
+
</svg>
|
|
218
|
+
)}
|
|
139
219
|
</button>
|
|
140
220
|
);
|
|
141
221
|
})}
|
|
@@ -16,12 +16,6 @@ export function getDepthPadding(depth: number): string {
|
|
|
16
16
|
return DEPTH_PADDING[Math.min(depth, 5)] ?? DEPTH_PADDING[5];
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export function getEntryIconClass(entry: IEntryDetail): string {
|
|
20
|
-
const isNew = entry.icon >= 25;
|
|
21
|
-
const newStr = isNew ? '-new' : '';
|
|
22
|
-
return `node-icon icon-bsy-form${newStr} icon${newStr}-bsy-form-${entry.icon}`;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
19
|
export function buildEntryTreeFromAliasMap(
|
|
26
20
|
appDetail: IAppDetail,
|
|
27
21
|
searchQuery: string
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { cn } from '../../lib/utils';
|
|
2
2
|
import { transCls } from '../../const/ui';
|
|
3
|
-
import { getDepthPadding
|
|
3
|
+
import { getDepthPadding } from './build-tree';
|
|
4
|
+
import { FontIcon } from '../font-icon';
|
|
4
5
|
import type { EntryTreeItem } from './types';
|
|
5
6
|
|
|
6
7
|
export function EntryItem({
|
|
@@ -26,16 +27,11 @@ export function EntryItem({
|
|
|
26
27
|
onClick={onClick}
|
|
27
28
|
>
|
|
28
29
|
<span className="flex items-center gap-[6px] min-w-0 flex-1">
|
|
29
|
-
|
|
30
|
-
className={
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
? getEntryIconClass(item.entry)
|
|
35
|
-
: 'node-icon icon-bsy-form icon-new-bsy-form-25'
|
|
36
|
-
}
|
|
37
|
-
style={{ fontSize: 16, lineHeight: 1 }}
|
|
38
|
-
/>
|
|
30
|
+
{item.iconClass ? (
|
|
31
|
+
<i className={item.iconClass} style={{ fontSize: 16, lineHeight: 1 }} />
|
|
32
|
+
) : (
|
|
33
|
+
<FontIcon name={item.entry?.icon ?? 25} />
|
|
34
|
+
)}
|
|
39
35
|
<span className="text-[14px] text-[#030303] truncate">
|
|
40
36
|
{item.name}
|
|
41
37
|
</span>
|
|
@@ -6,6 +6,7 @@ import { TreeItemNode } from './tree-item-node';
|
|
|
6
6
|
import type { IAppDetail } from '@baishuyun/types';
|
|
7
7
|
import type { BsEntrySelectChangeResult } from './types';
|
|
8
8
|
import { SolidArrowDownIcon } from '../bs-icons';
|
|
9
|
+
import { FontIcon } from '../font-icon';
|
|
9
10
|
|
|
10
11
|
const ChevronRightIcon = ({ size }: { size?: number }) => (
|
|
11
12
|
<SolidArrowDownIcon className="-rotate-90" size={size} />
|
|
@@ -59,10 +60,7 @@ export function OtherAppSection({
|
|
|
59
60
|
>
|
|
60
61
|
<ChevronRightIcon size={18} />
|
|
61
62
|
</span>
|
|
62
|
-
<
|
|
63
|
-
className="node-icon icon-bsy-form icon-new-bsy-form-0"
|
|
64
|
-
style={{ fontSize: 16, lineHeight: 1 }}
|
|
65
|
-
/>
|
|
63
|
+
<FontIcon name={0} />
|
|
66
64
|
<span className="text-[14px] text-[#030303] truncate">
|
|
67
65
|
{appDetail.name}
|
|
68
66
|
</span>
|
|
@@ -11,9 +11,9 @@ import { cn } from '../../lib/utils';
|
|
|
11
11
|
import { transCls } from '../../const/ui';
|
|
12
12
|
import { IconBtn } from '../icon-btn';
|
|
13
13
|
import { LeftArrowIcon, SolidArrowDownIcon, DividerIcon } from '../bs-icons';
|
|
14
|
+
import { FontIcon } from '../font-icon';
|
|
14
15
|
import {
|
|
15
16
|
buildEntryTreeFromAliasMap,
|
|
16
|
-
getEntryIconClass,
|
|
17
17
|
filterTreeBySearch,
|
|
18
18
|
buildFlowCenterTree,
|
|
19
19
|
} from './build-tree';
|
|
@@ -648,16 +648,11 @@ export function ScrollSlider({
|
|
|
648
648
|
),
|
|
649
649
|
)}
|
|
650
650
|
>
|
|
651
|
-
|
|
652
|
-
className={
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
? getEntryIconClass(node.entry)
|
|
657
|
-
: 'node-icon icon-bsy-form icon-new-bsy-form-25'
|
|
658
|
-
}
|
|
659
|
-
style={{ fontSize: 16, lineHeight: 1 }}
|
|
660
|
-
/>
|
|
651
|
+
{node.iconClass ? (
|
|
652
|
+
<i className={node.iconClass} style={{ fontSize: 16, lineHeight: 1 }} />
|
|
653
|
+
) : (
|
|
654
|
+
<FontIcon name={node.entry?.icon ?? 25} />
|
|
655
|
+
)}
|
|
661
656
|
<span className="text-[14px] leading-[normal] truncate">
|
|
662
657
|
{node.name}
|
|
663
658
|
</span>
|