Chore: frontend infrastructure upgrade (#16420)

Co-authored-by: NFish <douxc512@gmail.com>
Co-authored-by: zxhlyh <jasonapring2015@outlook.com>
Co-authored-by: twwu <twwu@dify.ai>
Co-authored-by: jZonG <jzongcode@gmail.com>
This commit is contained in:
Joel
2025-03-21 17:41:03 +08:00
committed by GitHub
parent e61415223b
commit 7709d9df20
1435 changed files with 13372 additions and 11612 deletions

View File

@@ -72,9 +72,9 @@ const OperationSelector: FC<OperationSelectorProps> = ({
className,
)}
>
<div className='flex p-1 items-center'>
<div className='flex items-center p-1'>
<span
className={`truncate overflow-hidden text-ellipsis system-sm-regular
className={`system-sm-regular overflow-hidden truncate text-ellipsis
${selectedItem ? 'text-components-input-text-filled' : 'text-components-input-text-disabled'}`}
>
{selectedItem?.name ? t(`${i18nPrefix}.operations.${selectedItem?.name}`) : t(`${i18nPrefix}.operations.title`)}
@@ -86,9 +86,9 @@ const OperationSelector: FC<OperationSelectorProps> = ({
<PortalToFollowElemContent className={`z-20 ${popupClassName}`}>
<div className='flex w-[140px] flex-col items-start rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur shadow-lg'>
<div className='flex p-1 flex-col items-start self-stretch'>
<div className='flex px-3 pt-1 pb-0.5 items-start self-stretch'>
<div className='flex grow text-text-tertiary system-xs-medium-uppercase'>{t(`${i18nPrefix}.operations.title`)}</div>
<div className='flex flex-col items-start self-stretch p-1'>
<div className='flex items-start self-stretch px-3 pb-0.5 pt-1'>
<div className='system-xs-medium-uppercase flex grow text-text-tertiary'>{t(`${i18nPrefix}.operations.title`)}</div>
</div>
{items.map(item => (
item.value === 'divider'
@@ -107,11 +107,11 @@ const OperationSelector: FC<OperationSelectorProps> = ({
setOpen(false)
}}
>
<div className='flex min-h-5 px-1 items-center gap-1 grow'>
<span className={'flex grow text-text-secondary system-sm-medium'}>{t(`${i18nPrefix}.operations.${item.name}`)}</span>
<div className='flex min-h-5 grow items-center gap-1 px-1'>
<span className={'system-sm-medium flex grow text-text-secondary'}>{t(`${i18nPrefix}.operations.${item.name}`)}</span>
</div>
{item.value === value && (
<div className='flex justify-center items-center'>
<div className='flex items-center justify-center'>
<RiCheckLine className='h-4 w-4 text-text-accent' />
</div>
)}

View File

@@ -128,7 +128,7 @@ const VarList: FC<Props> = ({
return (
<div className='flex items-start gap-1 self-stretch' key={index}>
<div className='flex flex-col items-start gap-1 grow'>
<div className='flex grow flex-col items-start gap-1'>
<div className='flex items-center gap-1 self-stretch'>
<VarReferencePicker
readonly={readonly}
@@ -212,10 +212,10 @@ const VarList: FC<Props> = ({
</div>
<ActionButton
size='l'
className='shrink-0 group hover:!bg-state-destructive-hover'
className='group shrink-0 hover:!bg-state-destructive-hover'
onClick={handleVarRemove(index)}
>
<RiDeleteBinLine className='text-text-tertiary w-4 h-4 group-hover:text-text-destructive' />
<RiDeleteBinLine className='h-4 w-4 text-text-tertiary group-hover:text-text-destructive' />
</ActionButton>
</div>
)

View File

@@ -23,17 +23,17 @@ const NodeComponent: FC<NodeProps<AssignerNodeType>> = ({
if (validOperationItems.length === 0) {
return (
<div className='relative flex flex-col px-3 py-1 gap-0.5 items-start self-stretch'>
<div className='relative flex flex-col items-start gap-0.5 self-stretch px-3 py-1'>
<div className='flex flex-col items-start gap-1 self-stretch'>
<div className='flex px-[5px] py-1 items-center gap-1 self-stretch rounded-md bg-workflow-block-parma-bg'>
<div className='flex-1 text-text-tertiary system-xs-medium'>{t(`${i18nPrefix}.varNotSet`)}</div>
<div className='flex items-center gap-1 self-stretch rounded-md bg-workflow-block-parma-bg px-[5px] py-1'>
<div className='system-xs-medium flex-1 text-text-tertiary'>{t(`${i18nPrefix}.varNotSet`)}</div>
</div>
</div>
</div>
)
}
return (
<div className='relative flex flex-col px-3 py-1 gap-0.5 items-start self-stretch'>
<div className='relative flex flex-col items-start gap-0.5 self-stretch px-3 py-1'>
{operationItems.map((value, index) => {
const variable = value.variable_selector
if (!variable || variable.length === 0)
@@ -71,7 +71,7 @@ const NodeComponent: FC<NodeProps<AssignerNodeType>> = ({
const varName = isSystem ? `sys.${variable[variable.length - 1]}` : variable.slice(1).join('.')
return (
<div className='relative flex flex-col px-3 py-1 gap-0.5 items-start self-stretch'>
<div className='relative flex flex-col items-start gap-0.5 self-stretch px-3 py-1'>
<NodeVariableItem
node={node as Node}
isEnv={isEnv}

View File

@@ -37,12 +37,12 @@ const Panel: FC<NodePanelProps<AssignerNodeType>> = ({
}
return (
<div className='flex py-2 flex-col items-start self-stretch'>
<div className='flex flex-col justify-center items-start gap-1 px-4 py-2 w-full self-stretch'>
<div className='flex flex-col items-start self-stretch py-2'>
<div className='flex w-full flex-col items-start justify-center gap-1 self-stretch px-4 py-2'>
<div className='flex items-start gap-2 self-stretch'>
<div className='flex flex-col justify-center items-start grow text-text-secondary system-sm-semibold-uppercase'>{t(`${i18nPrefix}.variables`)}</div>
<div className='system-sm-semibold-uppercase flex grow flex-col items-start justify-center text-text-secondary'>{t(`${i18nPrefix}.variables`)}</div>
<ActionButton onClick={handleAddOperation}>
<RiAddLine className='w-4 h-4 shrink-0 text-text-tertiary' />
<RiAddLine className='h-4 w-4 shrink-0 text-text-tertiary' />
</ActionButton>
</div>
<VarList