mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 04:26:30 +08:00
fix: human input field dragging
This commit is contained in:
parent
9341227cf1
commit
2ccef3ac84
@ -61,7 +61,7 @@ export default function DraggableBlockPlugin({
|
|||||||
menuComponent={
|
menuComponent={
|
||||||
isSupportDrag
|
isSupportDrag
|
||||||
? (
|
? (
|
||||||
<div ref={menuRef} className={cn(DRAGGABLE_BLOCK_MENU_CLASSNAME, 'absolute right-6 top-4 cursor-grab opacity-0 will-change-transform active:cursor-move')}>
|
<div ref={menuRef} className={cn(DRAGGABLE_BLOCK_MENU_CLASSNAME, 'absolute right-2.5 top-4 cursor-grab opacity-0 will-change-transform active:cursor-move')}>
|
||||||
<RiDraggable className="size-3.5 text-text-tertiary" />
|
<RiDraggable className="size-3.5 text-text-tertiary" />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -111,7 +111,7 @@ const HITLInputComponentUI: FC<HITLInputComponentUIProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex w-full items-center gap-x-0.5 pr-8">
|
<div className="flex w-full items-center gap-x-0.5 pr-5">
|
||||||
<div className="min-w-0 grow">
|
<div className="min-w-0 grow">
|
||||||
{/* Default Value Info */}
|
{/* Default Value Info */}
|
||||||
{isDefaultValueVariable && (
|
{isDefaultValueVariable && (
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import {
|
|||||||
memo,
|
memo,
|
||||||
useEffect,
|
useEffect,
|
||||||
} from 'react'
|
} from 'react'
|
||||||
|
import { CustomTextNode } from '../custom-text/node'
|
||||||
import {
|
import {
|
||||||
$createHITLInputNode,
|
$createHITLInputNode,
|
||||||
HITLInputNode,
|
HITLInputNode,
|
||||||
@ -70,9 +71,11 @@ const HITLInputBlock = memo(({
|
|||||||
undefined,
|
undefined,
|
||||||
readonly,
|
readonly,
|
||||||
)
|
)
|
||||||
|
const prev = new CustomTextNode('\n')
|
||||||
|
$insertNodes([prev])
|
||||||
$insertNodes([currentHITLNode])
|
$insertNodes([currentHITLNode])
|
||||||
|
const next = new CustomTextNode('\n')
|
||||||
|
$insertNodes([next])
|
||||||
if (onInsert)
|
if (onInsert)
|
||||||
onInsert()
|
onInsert()
|
||||||
|
|
||||||
|
|||||||
@ -164,7 +164,7 @@ export class HITLInputNode extends DecoratorNode<React.JSX.Element> {
|
|||||||
|
|
||||||
createDOM(): HTMLElement {
|
createDOM(): HTMLElement {
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div')
|
||||||
div.classList.add('flex', 'items-center', 'align-middle', 'support-drag')
|
div.classList.add('inline-flex', 'w-[calc(100%-1px)]', 'items-center', 'align-middle', 'support-drag')
|
||||||
return div
|
return div
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user