From 0d0bd2932ee311254056f7749b05f0a78f05d653 Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Thu, 24 Oct 2024 17:02:26 +0300 Subject: [PATCH] fix(editor): Toolbar, layering, and label rendering improvements on new canvas (no-changelog) (#11390) --- .../canvas/elements/edges/CanvasEdge.vue | 20 ++++++++++++++++--- .../elements/nodes/CanvasNodeToolbar.vue | 3 ++- .../src/styles/plugins/_vueflow.scss | 9 +++------ 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/packages/editor-ui/src/components/canvas/elements/edges/CanvasEdge.vue b/packages/editor-ui/src/components/canvas/elements/edges/CanvasEdge.vue index 479c0542bf..f23d3c6c33 100644 --- a/packages/editor-ui/src/components/canvas/elements/edges/CanvasEdge.vue +++ b/packages/editor-ui/src/components/canvas/elements/edges/CanvasEdge.vue @@ -74,15 +74,29 @@ const edgeStyle = computed(() => ({ stroke: isHovered.value ? 'var(--color-primary)' : edgeColor.value, })); -const edgeLabelStyle = computed(() => ({ color: edgeColor.value })); +const edgeClasses = computed(() => ({ + [$style.edge]: true, + hovered: isHovered.value, +})); + +const edgeLabelStyle = computed(() => ({ + color: edgeColor.value, +})); const edgeToolbarStyle = computed(() => { const [, labelX, labelY] = path.value; return { transform: `translate(-50%, -50%) translate(${labelX}px,${labelY}px)`, + ...(isHovered.value ? { zIndex: 1 } : {}), }; }); +const edgeToolbarClasses = computed(() => ({ + [$style.edgeLabelWrapper]: true, + 'vue-flow__edge-label': true, + selected: props.selected, +})); + const path = computed(() => getCustomPath(props, { connectionType: connectionType.value, @@ -108,7 +122,7 @@ function onDelete() {