mirror of https://github.com/langgenius/dify.git
fix: The HTTP Request node panel supports line break and overflow handling for variable values (#33359)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
b66097b5f3
commit
0dcfac5b84
|
|
@ -1,5 +1,6 @@
|
|||
'use client'
|
||||
|
||||
import type { InitialConfigType } from '@lexical/react/LexicalComposer'
|
||||
import type {
|
||||
EditorState,
|
||||
LexicalCommand,
|
||||
|
|
@ -153,7 +154,10 @@ const PromptEditor: FC<PromptEditorProps> = ({
|
|||
shortcutPopups = [],
|
||||
}) => {
|
||||
const { eventEmitter } = useEventEmitterContextContext()
|
||||
const initialConfig = {
|
||||
const initialConfig: InitialConfigType = {
|
||||
theme: {
|
||||
paragraph: 'group-[.clamp]:line-clamp-5 group-focus/editable:!line-clamp-none',
|
||||
},
|
||||
namespace: 'prompt-editor',
|
||||
nodes: [
|
||||
CodeNode,
|
||||
|
|
@ -214,7 +218,7 @@ const PromptEditor: FC<PromptEditorProps> = ({
|
|||
contentEditable={(
|
||||
<ContentEditable
|
||||
className={cn(
|
||||
'text-text-secondary outline-none',
|
||||
'group/editable text-text-secondary outline-none group-[.clamp]:max-h-24 group-[.clamp]:overflow-y-auto',
|
||||
compact ? 'text-[13px] leading-5' : 'text-sm leading-6',
|
||||
className,
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -61,11 +61,11 @@ const Editor: FC<Props> = ({
|
|||
const setShowInputFieldPanel = useStore(s => s.setShowInputFieldPanel)
|
||||
|
||||
return (
|
||||
<div className={cn(className, 'relative')}>
|
||||
<div className={cn(className, 'relative min-h-8')}>
|
||||
<>
|
||||
<PromptEditor
|
||||
instanceId={instanceId}
|
||||
className={cn(promptMinHeightClassName, '!leading-[18px]')}
|
||||
className={cn(promptMinHeightClassName, 'leading-[18px]')}
|
||||
placeholder={placeholder}
|
||||
placeholderClassName={placeholderClassName}
|
||||
value={value}
|
||||
|
|
|
|||
|
|
@ -59,12 +59,12 @@ const InputItem: FC<Props> = ({
|
|||
}, [onRemove])
|
||||
|
||||
return (
|
||||
<div className={cn(className, 'hover:cursor-text hover:bg-state-base-hover', 'relative flex !h-[30px] items-center')}>
|
||||
<div className={cn(className, 'hover:cursor-text hover:bg-state-base-hover', 'relative flex')}>
|
||||
{(!readOnly)
|
||||
? (
|
||||
<Input
|
||||
instanceId={instanceId}
|
||||
className={cn(isFocus ? 'bg-components-input-bg-active' : 'bg-width', 'h-full w-0 grow px-3 py-1')}
|
||||
className={cn(isFocus ? 'bg-components-input-bg-active' : '', 'clamp group w-0 grow px-3 py-1')}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
readOnly={readOnly}
|
||||
|
|
@ -73,7 +73,6 @@ const InputItem: FC<Props> = ({
|
|||
onFocusChange={setIsFocus}
|
||||
placeholder={t('nodes.http.insertVarPlaceholder', { ns: 'workflow' })!}
|
||||
placeholderClassName="!leading-[21px]"
|
||||
promptMinHeightClassName="h-full"
|
||||
insertVarTipToLeft={insertVarTipToLeft}
|
||||
/>
|
||||
)
|
||||
|
|
@ -85,7 +84,7 @@ const InputItem: FC<Props> = ({
|
|||
{hasValue && (
|
||||
<Input
|
||||
instanceId={instanceId}
|
||||
className={cn(isFocus ? 'border-components-input-border-active bg-components-input-bg-active shadow-xs' : 'border-components-input-border-hover bg-components-input-bg-normal', 'h-full w-0 grow rounded-lg border px-3 py-[6px]')}
|
||||
className={cn(isFocus ? 'border-components-input-border-active bg-components-input-bg-active shadow-xs' : 'border-components-input-border-hover bg-components-input-bg-normal', 'clamp group h-full w-0 grow rounded-lg border px-3 py-[6px]')}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
readOnly={readOnly}
|
||||
|
|
|
|||
|
|
@ -6853,9 +6853,6 @@
|
|||
"no-restricted-imports": {
|
||||
"count": 1
|
||||
},
|
||||
"tailwindcss/no-unnecessary-whitespace": {
|
||||
"count": 1
|
||||
},
|
||||
"ts/no-explicit-any": {
|
||||
"count": 1
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue