mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-15 02:16:00 +08:00
chore: node new toolbar
This commit is contained in:
parent
626f2524e2
commit
8540233193
@ -109,7 +109,7 @@ const AllTools = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn(className)}>
|
<div className={cn(className)}>
|
||||||
<div className='flex items-center justify-between border-b-[0.5px] border-divider-subtle bg-background-default-hover px-3 shadow-xs'>
|
<div className='flex items-center justify-between border-b border-divider-subtle px-3'>
|
||||||
<div className='flex h-8 items-center space-x-1'>
|
<div className='flex h-8 items-center space-x-1'>
|
||||||
{
|
{
|
||||||
tabs.map(tab => (
|
tabs.map(tab => (
|
||||||
|
@ -129,7 +129,11 @@ const NodeSelector: FC<NodeSelectorProps> = ({
|
|||||||
</PortalToFollowElemTrigger>
|
</PortalToFollowElemTrigger>
|
||||||
<PortalToFollowElemContent className='z-[1000]'>
|
<PortalToFollowElemContent className='z-[1000]'>
|
||||||
<div className={`rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg shadow-lg ${popupClassName}`}>
|
<div className={`rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg shadow-lg ${popupClassName}`}>
|
||||||
<div className='px-2 pt-2' onClick={e => e.stopPropagation()}>
|
<Tabs
|
||||||
|
activeTab={activeTab}
|
||||||
|
onActiveTabChange={handleActiveTabChange}
|
||||||
|
filterElem={
|
||||||
|
<div className='relative m-2' onClick={e => e.stopPropagation()}>
|
||||||
{activeTab === TabsEnum.Blocks && (
|
{activeTab === TabsEnum.Blocks && (
|
||||||
<Input
|
<Input
|
||||||
showLeftIcon
|
showLeftIcon
|
||||||
@ -151,11 +155,8 @@ const NodeSelector: FC<NodeSelectorProps> = ({
|
|||||||
placeholder={t('plugin.searchTools')!}
|
placeholder={t('plugin.searchTools')!}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<Tabs
|
}
|
||||||
activeTab={activeTab}
|
|
||||||
onActiveTabChange={handleActiveTabChange}
|
|
||||||
onSelect={handleSelect}
|
onSelect={handleSelect}
|
||||||
searchText={searchText}
|
searchText={searchText}
|
||||||
tags={tags}
|
tags={tags}
|
||||||
|
@ -16,6 +16,7 @@ export type TabsProps = {
|
|||||||
tags: string[]
|
tags: string[]
|
||||||
onSelect: (type: BlockEnum, tool?: ToolDefaultValue) => void
|
onSelect: (type: BlockEnum, tool?: ToolDefaultValue) => void
|
||||||
availableBlocksTypes?: BlockEnum[]
|
availableBlocksTypes?: BlockEnum[]
|
||||||
|
filterElem: React.ReactNode
|
||||||
noBlocks?: boolean
|
noBlocks?: boolean
|
||||||
}
|
}
|
||||||
const Tabs: FC<TabsProps> = ({
|
const Tabs: FC<TabsProps> = ({
|
||||||
@ -25,6 +26,7 @@ const Tabs: FC<TabsProps> = ({
|
|||||||
searchText,
|
searchText,
|
||||||
onSelect,
|
onSelect,
|
||||||
availableBlocksTypes,
|
availableBlocksTypes,
|
||||||
|
filterElem,
|
||||||
noBlocks,
|
noBlocks,
|
||||||
}) => {
|
}) => {
|
||||||
const tabs = useTabs()
|
const tabs = useTabs()
|
||||||
@ -37,15 +39,15 @@ const Tabs: FC<TabsProps> = ({
|
|||||||
<div onClick={e => e.stopPropagation()}>
|
<div onClick={e => e.stopPropagation()}>
|
||||||
{
|
{
|
||||||
!noBlocks && (
|
!noBlocks && (
|
||||||
<div className='flex items-center border-b-[0.5px] border-divider-subtle px-3'>
|
<div className='relative flex bg-background-section-burn pl-1 pt-1'>
|
||||||
{
|
{
|
||||||
tabs.map(tab => (
|
tabs.map(tab => (
|
||||||
<div
|
<div
|
||||||
key={tab.key}
|
key={tab.key}
|
||||||
className={cn(
|
className={cn(
|
||||||
'system-sm-medium relative mr-4 cursor-pointer pb-2 pt-1',
|
'system-sm-medium relative mr-0.5 flex h-8 cursor-pointer items-center rounded-t-lg px-3 ',
|
||||||
activeTab === tab.key
|
activeTab === tab.key
|
||||||
? 'text-text-primary after:absolute after:bottom-0 after:left-0 after:h-0.5 after:w-full after:bg-util-colors-blue-brand-blue-brand-600'
|
? 'sm-no-bottom cursor-default bg-components-panel-bg text-text-accent'
|
||||||
: 'text-text-tertiary',
|
: 'text-text-tertiary',
|
||||||
)}
|
)}
|
||||||
onClick={() => onActiveTabChange(tab.key)}
|
onClick={() => onActiveTabChange(tab.key)}
|
||||||
@ -57,13 +59,16 @@ const Tabs: FC<TabsProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
{filterElem}
|
||||||
{
|
{
|
||||||
activeTab === TabsEnum.Blocks && !noBlocks && (
|
activeTab === TabsEnum.Blocks && !noBlocks && (
|
||||||
|
<div className='border-t border-divider-subtle'>
|
||||||
<Blocks
|
<Blocks
|
||||||
searchText={searchText}
|
searchText={searchText}
|
||||||
onSelect={onSelect}
|
onSelect={onSelect}
|
||||||
availableBlocksTypes={availableBlocksTypes}
|
availableBlocksTypes={availableBlocksTypes}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -71,6 +71,7 @@ const config = {
|
|||||||
boxShadow: {
|
boxShadow: {
|
||||||
'xs': '0px 1px 2px 0px rgba(16, 24, 40, 0.05)',
|
'xs': '0px 1px 2px 0px rgba(16, 24, 40, 0.05)',
|
||||||
'sm': '0px 1px 2px 0px rgba(16, 24, 40, 0.06), 0px 1px 3px 0px rgba(16, 24, 40, 0.10)',
|
'sm': '0px 1px 2px 0px rgba(16, 24, 40, 0.06), 0px 1px 3px 0px rgba(16, 24, 40, 0.10)',
|
||||||
|
'sm-no-bottom': '0px -1px 2px 0px rgba(16, 24, 40, 0.06), 0px -1px 3px 0px rgba(16, 24, 40, 0.10)',
|
||||||
'md': '0px 2px 4px -2px rgba(16, 24, 40, 0.06), 0px 4px 8px -2px rgba(16, 24, 40, 0.10)',
|
'md': '0px 2px 4px -2px rgba(16, 24, 40, 0.06), 0px 4px 8px -2px rgba(16, 24, 40, 0.10)',
|
||||||
'lg': '0px 4px 6px -2px rgba(16, 24, 40, 0.03), 0px 12px 16px -4px rgba(16, 24, 40, 0.08)',
|
'lg': '0px 4px 6px -2px rgba(16, 24, 40, 0.03), 0px 12px 16px -4px rgba(16, 24, 40, 0.08)',
|
||||||
'xl': '0px 8px 8px -4px rgba(16, 24, 40, 0.03), 0px 20px 24px -4px rgba(16, 24, 40, 0.08)',
|
'xl': '0px 8px 8px -4px rgba(16, 24, 40, 0.03), 0px 20px 24px -4px rgba(16, 24, 40, 0.08)',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user