chore(editor): Bump vue-flow with necessary workaround (#18245)

Co-authored-by: Csaba Tuncsik <csaba.tuncsik@gmail.com>
This commit is contained in:
Suguru Inoue
2025-09-01 11:54:51 +02:00
committed by GitHub
parent 7f64baebd2
commit 056418307a
6 changed files with 38 additions and 42 deletions

View File

@@ -53,7 +53,7 @@
"@typescript/vfs": "^1.6.0",
"@vue-flow/background": "^1.3.2",
"@vue-flow/controls": "^1.1.2",
"@vue-flow/core": "1.42.1",
"@vue-flow/core": "1.45.0",
"@vue-flow/minimap": "^1.5.2",
"@vue-flow/node-resizer": "^1.4.0",
"@vueuse/components": "^10.11.0",

View File

@@ -92,7 +92,10 @@ export function createCanvasGraphNode({
isParent: false,
selected: false,
resizing: false,
handleBounds: {},
handleBounds: {
source: null,
target: null,
},
events: {},
data: createCanvasNodeData({ id, type, ...data }),
...rest,

View File

@@ -447,11 +447,7 @@ function onSelectNodes({ ids, panIntoView }: CanvasEventBusEvents['nodes:select'
const newViewport = updateViewportToContainNodes(viewport.value, dimensions.value, nodes, 100);
void setViewport(newViewport, {
duration: 200,
// TODO: restore when re-upgrading vue-flow to >= 1.45
// interpolate: 'linear',
});
void setViewport(newViewport, { duration: 200, interpolate: 'linear' });
}
}
@@ -469,10 +465,16 @@ function onUpdateNodeParameters(id: string, parameters: Record<string, unknown>)
function onUpdateNodeInputs(id: string) {
emit('update:node:inputs', id);
// Let VueFlow update connection paths to match the new handle position
void nextTick(() => vueFlow.updateNodeInternals([id]));
}
function onUpdateNodeOutputs(id: string) {
emit('update:node:outputs', id);
// Let VueFlow update connection paths to match the new handle position
void nextTick(() => vueFlow.updateNodeInternals([id]));
}
function onFocusNode(id: string) {

View File

@@ -88,8 +88,7 @@ export const useExperimentalNdvStore = defineStore('experimentalNdv', () => {
{
duration: 200,
zoom: maxCanvasZoom.value,
// TODO: restore when re-upgrading vue-flow to >= 1.45
// interpolate: 'linear',
interpolate: 'linear',
},
);
}
@@ -107,19 +106,11 @@ export const useExperimentalNdvStore = defineStore('experimentalNdv', () => {
function toggleZoomMode(options: ToggleZoomModeOptions) {
if (isActive(options.canvasViewport.zoom)) {
if (previousViewport.value === undefined) {
void options.fitView({
duration: 200,
// TODO: restore when re-upgrading vue-flow to >= 1.45
// interpolate: 'linear',
});
void options.fitView({ duration: 200, interpolate: 'linear' });
return;
}
void options.setViewport(previousViewport.value, {
duration: 200,
// TODO: restore when re-upgrading vue-flow to >= 1.45
// interpolate: 'linear'
});
void options.setViewport(previousViewport.value, { duration: 200, interpolate: 'linear' });
return;
}
@@ -136,11 +127,7 @@ export const useExperimentalNdvStore = defineStore('experimentalNdv', () => {
return;
}
void options.zoomTo(maxCanvasZoom.value, {
duration: 200,
// TODO: restore when re-upgrading vue-flow to >= 1.45
// interpolate: 'linear',
});
void options.zoomTo(maxCanvasZoom.value, { duration: 200, interpolate: 'linear' });
}
return {

View File

@@ -558,7 +558,10 @@ describe('calculateNodeSize', () => {
function createTestGraphNode(data: Partial<GraphNode> = {}): GraphNode {
return {
computedPosition: { z: 0, ...(data.position ?? { x: 0, y: 0 }) },
handleBounds: {},
handleBounds: {
source: null,
target: null,
},
dimensions: { width: 0, height: 0 },
isParent: true,
selected: false,