Легенда связи смещена выше stroke; убран extent parent, чтобы узлы можно было вынести из группы. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -59,11 +59,12 @@ function TopologyEdgeComponent(props: EdgeProps<Edge<TopologyEdgeData>>) {
|
||||
<EdgeLabelRenderer>
|
||||
<div
|
||||
className={cn(
|
||||
'nodrag nopan absolute flex max-w-[220px] flex-wrap items-center justify-center gap-1 rounded-md border border-border bg-background/95 px-1.5 py-1 shadow-sm backdrop-blur-sm',
|
||||
'nodrag nopan absolute z-[1000] flex max-w-[220px] flex-wrap items-center justify-center gap-1 rounded-md border border-border bg-background px-1.5 py-1 shadow-sm',
|
||||
selected && 'ring-1 ring-primary/40',
|
||||
)}
|
||||
style={{
|
||||
transform: `translate(-50%, -50%) translate(${labelX}px,${labelY}px)`,
|
||||
// Смещение вверх от центра линии, чтобы легенда была над stroke
|
||||
transform: `translate(-50%, -100%) translate(${labelX}px,${labelY - 6}px)`,
|
||||
pointerEvents: 'all',
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -14,10 +14,12 @@ export function normalizeGroupLayers(nodes: TopologyFlowNode[]): TopologyFlowNod
|
||||
if (n.type === 'group') {
|
||||
return { ...n, zIndex: n.selected ? 0 : GROUP_Z }
|
||||
}
|
||||
if (n.zIndex != null && n.zIndex < CONTENT_Z) {
|
||||
return { ...n, zIndex: CONTENT_Z }
|
||||
// extent: 'parent' блокирует вытаскивание — не используем; parentId достаточно для «прилипания»
|
||||
const cleared = n.extent != null ? { ...n, extent: undefined } : n
|
||||
if (cleared.zIndex != null && cleared.zIndex < CONTENT_Z) {
|
||||
return { ...cleared, zIndex: CONTENT_Z }
|
||||
}
|
||||
return n.zIndex == null ? { ...n, zIndex: CONTENT_Z } : n
|
||||
return cleared.zIndex == null ? { ...cleared, zIndex: CONTENT_Z } : cleared
|
||||
})
|
||||
}
|
||||
|
||||
@@ -122,7 +124,7 @@ export function attachNodeToGroup(
|
||||
return {
|
||||
...node,
|
||||
parentId: group.id,
|
||||
extent: 'parent',
|
||||
extent: undefined,
|
||||
zIndex: CONTENT_Z,
|
||||
}
|
||||
}
|
||||
@@ -132,7 +134,7 @@ export function attachNodeToGroup(
|
||||
return {
|
||||
...node,
|
||||
parentId: group.id,
|
||||
extent: 'parent',
|
||||
extent: undefined,
|
||||
position: {
|
||||
x: abs.x - groupAbs.x,
|
||||
y: abs.y - groupAbs.y,
|
||||
@@ -201,7 +203,7 @@ export function placeWithOptionalParent(
|
||||
return {
|
||||
...node,
|
||||
parentId: group.id,
|
||||
extent: 'parent',
|
||||
extent: undefined,
|
||||
position: {
|
||||
x: flowPosition.x - groupAbs.x,
|
||||
y: flowPosition.y - groupAbs.y,
|
||||
|
||||
Reference in New Issue
Block a user