@xyflow/system 0.0.66 → 0.0.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +59 -35
- package/dist/esm/index.mjs +59 -35
- package/dist/esm/types/edges.d.ts +2 -2
- package/dist/esm/types/edges.d.ts.map +1 -1
- package/dist/esm/types/nodes.d.ts +2 -7
- package/dist/esm/types/nodes.d.ts.map +1 -1
- package/dist/esm/utils/general.d.ts +1 -1
- package/dist/esm/utils/general.d.ts.map +1 -1
- package/dist/esm/utils/marker.d.ts +1 -1
- package/dist/esm/utils/marker.d.ts.map +1 -1
- package/dist/esm/xydrag/XYDrag.d.ts.map +1 -1
- package/dist/esm/xydrag/utils.d.ts +14 -1
- package/dist/esm/xydrag/utils.d.ts.map +1 -1
- package/dist/esm/xyhandle/types.d.ts +1 -0
- package/dist/esm/xyhandle/types.d.ts.map +1 -1
- package/dist/esm/xyminimap/index.d.ts.map +1 -1
- package/dist/esm/xyresizer/XYResizer.d.ts +2 -2
- package/dist/esm/xyresizer/XYResizer.d.ts.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/types/edges.d.ts +2 -2
- package/dist/umd/types/edges.d.ts.map +1 -1
- package/dist/umd/types/nodes.d.ts +2 -7
- package/dist/umd/types/nodes.d.ts.map +1 -1
- package/dist/umd/utils/general.d.ts +1 -1
- package/dist/umd/utils/general.d.ts.map +1 -1
- package/dist/umd/utils/marker.d.ts +1 -1
- package/dist/umd/utils/marker.d.ts.map +1 -1
- package/dist/umd/xydrag/XYDrag.d.ts.map +1 -1
- package/dist/umd/xydrag/utils.d.ts +14 -1
- package/dist/umd/xydrag/utils.d.ts.map +1 -1
- package/dist/umd/xyhandle/types.d.ts +1 -0
- package/dist/umd/xyhandle/types.d.ts.map +1 -1
- package/dist/umd/xyminimap/index.d.ts.map +1 -1
- package/dist/umd/xyresizer/XYResizer.d.ts +2 -2
- package/dist/umd/xyresizer/XYResizer.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/esm/index.js
CHANGED
|
@@ -767,7 +767,7 @@ const getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding)
|
|
|
767
767
|
};
|
|
768
768
|
const isMacOs = () => typeof navigator !== 'undefined' && navigator?.userAgent?.indexOf('Mac') >= 0;
|
|
769
769
|
function isCoordinateExtent(extent) {
|
|
770
|
-
return extent !== undefined && extent !== 'parent';
|
|
770
|
+
return extent !== undefined && extent !== null && extent !== 'parent';
|
|
771
771
|
}
|
|
772
772
|
function getNodeDimensions(node) {
|
|
773
773
|
return {
|
|
@@ -1964,6 +1964,25 @@ function getEventHandlerParams({ nodeId, dragItems, nodeLookup, dragging = true,
|
|
|
1964
1964
|
nodesFromDragItems,
|
|
1965
1965
|
];
|
|
1966
1966
|
}
|
|
1967
|
+
/**
|
|
1968
|
+
* If a selection is being dragged we want to apply the same snap offset to all nodes in the selection.
|
|
1969
|
+
* This function calculates the snap offset based on the first node in the selection.
|
|
1970
|
+
*/
|
|
1971
|
+
function calculateSnapOffset({ dragItems, snapGrid, x, y, }) {
|
|
1972
|
+
const refDragItem = dragItems.values().next().value;
|
|
1973
|
+
if (!refDragItem) {
|
|
1974
|
+
return null;
|
|
1975
|
+
}
|
|
1976
|
+
const refPos = {
|
|
1977
|
+
x: x - refDragItem.distance.x,
|
|
1978
|
+
y: y - refDragItem.distance.y,
|
|
1979
|
+
};
|
|
1980
|
+
const refPosSnapped = snapPosition(refPos, snapGrid);
|
|
1981
|
+
return {
|
|
1982
|
+
x: refPosSnapped.x - refPos.x,
|
|
1983
|
+
y: refPosSnapped.y - refPos.y,
|
|
1984
|
+
};
|
|
1985
|
+
}
|
|
1967
1986
|
|
|
1968
1987
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1969
1988
|
function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragStop, }) {
|
|
@@ -1977,39 +1996,43 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
1977
1996
|
let d3Selection = null;
|
|
1978
1997
|
let abortDrag = false; // prevents unintentional dragging on multitouch
|
|
1979
1998
|
let nodePositionsChanged = false;
|
|
1999
|
+
// we store the last drag event to be able to use it in the update function
|
|
2000
|
+
let dragEvent = null;
|
|
1980
2001
|
// public functions
|
|
1981
2002
|
function update({ noDragClassName, handleSelector, domNode, isSelectable, nodeId, nodeClickDistance = 0, }) {
|
|
1982
2003
|
d3Selection = select(domNode);
|
|
1983
|
-
function updateNodes({ x, y }
|
|
2004
|
+
function updateNodes({ x, y }) {
|
|
1984
2005
|
const { nodeLookup, nodeExtent, snapGrid, snapToGrid, nodeOrigin, onNodeDrag, onSelectionDrag, onError, updateNodePositions, } = getStoreItems();
|
|
1985
2006
|
lastPos = { x, y };
|
|
1986
2007
|
let hasChange = false;
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
2008
|
+
const isMultiDrag = dragItems.size > 1;
|
|
2009
|
+
const nodesBox = isMultiDrag && nodeExtent ? rectToBox(getInternalNodesBounds(dragItems)) : null;
|
|
2010
|
+
const multiDragSnapOffset = isMultiDrag && snapToGrid
|
|
2011
|
+
? calculateSnapOffset({
|
|
2012
|
+
dragItems,
|
|
2013
|
+
snapGrid,
|
|
2014
|
+
x,
|
|
2015
|
+
y,
|
|
2016
|
+
})
|
|
2017
|
+
: null;
|
|
1992
2018
|
for (const [id, dragItem] of dragItems) {
|
|
2019
|
+
/*
|
|
2020
|
+
* if the node is not in the nodeLookup anymore, it was probably deleted while dragging
|
|
2021
|
+
*/
|
|
1993
2022
|
if (!nodeLookup.has(id)) {
|
|
1994
|
-
/*
|
|
1995
|
-
* if the node is not in the nodeLookup anymore, it was probably deleted while dragging
|
|
1996
|
-
* and we don't need to update it anymore
|
|
1997
|
-
*/
|
|
1998
2023
|
continue;
|
|
1999
2024
|
}
|
|
2000
2025
|
let nextPosition = { x: x - dragItem.distance.x, y: y - dragItem.distance.y };
|
|
2001
2026
|
if (snapToGrid) {
|
|
2002
|
-
nextPosition =
|
|
2027
|
+
nextPosition = multiDragSnapOffset
|
|
2028
|
+
? {
|
|
2029
|
+
x: Math.round(nextPosition.x + multiDragSnapOffset.x),
|
|
2030
|
+
y: Math.round(nextPosition.y + multiDragSnapOffset.y),
|
|
2031
|
+
}
|
|
2032
|
+
: snapPosition(nextPosition, snapGrid);
|
|
2003
2033
|
}
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
* based on its position so that the node stays at it's position relative to the selection.
|
|
2007
|
-
*/
|
|
2008
|
-
let adjustedNodeExtent = [
|
|
2009
|
-
[nodeExtent[0][0], nodeExtent[0][1]],
|
|
2010
|
-
[nodeExtent[1][0], nodeExtent[1][1]],
|
|
2011
|
-
];
|
|
2012
|
-
if (dragItems.size > 1 && nodeExtent && !dragItem.extent) {
|
|
2034
|
+
let adjustedNodeExtent = null;
|
|
2035
|
+
if (isMultiDrag && nodeExtent && !dragItem.extent && nodesBox) {
|
|
2013
2036
|
const { positionAbsolute } = dragItem.internals;
|
|
2014
2037
|
const x1 = positionAbsolute.x - nodesBox.x + nodeExtent[0][0];
|
|
2015
2038
|
const x2 = positionAbsolute.x + dragItem.measured.width - nodesBox.x2 + nodeExtent[1][0];
|
|
@@ -2024,7 +2047,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
2024
2047
|
nodeId: id,
|
|
2025
2048
|
nextPosition,
|
|
2026
2049
|
nodeLookup,
|
|
2027
|
-
nodeExtent: adjustedNodeExtent,
|
|
2050
|
+
nodeExtent: adjustedNodeExtent ? adjustedNodeExtent : nodeExtent,
|
|
2028
2051
|
nodeOrigin,
|
|
2029
2052
|
onError,
|
|
2030
2053
|
});
|
|
@@ -2066,7 +2089,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
2066
2089
|
lastPos.x = (lastPos.x ?? 0) - xMovement / transform[2];
|
|
2067
2090
|
lastPos.y = (lastPos.y ?? 0) - yMovement / transform[2];
|
|
2068
2091
|
if (await panBy({ x: xMovement, y: yMovement })) {
|
|
2069
|
-
updateNodes(lastPos
|
|
2092
|
+
updateNodes(lastPos);
|
|
2070
2093
|
}
|
|
2071
2094
|
}
|
|
2072
2095
|
autoPanId = requestAnimationFrame(autoPan);
|
|
@@ -2106,6 +2129,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
2106
2129
|
containerBounds = domNode?.getBoundingClientRect() || null;
|
|
2107
2130
|
abortDrag = false;
|
|
2108
2131
|
nodePositionsChanged = false;
|
|
2132
|
+
dragEvent = event.sourceEvent;
|
|
2109
2133
|
if (nodeDragThreshold === 0) {
|
|
2110
2134
|
startDrag(event);
|
|
2111
2135
|
}
|
|
@@ -2116,6 +2140,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
2116
2140
|
.on('drag', (event) => {
|
|
2117
2141
|
const { autoPanOnNodeDrag, transform, snapGrid, snapToGrid, nodeDragThreshold, nodeLookup } = getStoreItems();
|
|
2118
2142
|
const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds });
|
|
2143
|
+
dragEvent = event.sourceEvent;
|
|
2119
2144
|
if ((event.sourceEvent.type === 'touchmove' && event.sourceEvent.touches.length > 1) ||
|
|
2120
2145
|
// if user deletes a node while dragging, we need to abort the drag to prevent errors
|
|
2121
2146
|
(nodeId && !nodeLookup.has(nodeId))) {
|
|
@@ -2138,9 +2163,8 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
2138
2163
|
}
|
|
2139
2164
|
// skip events without movement
|
|
2140
2165
|
if ((lastPos.x !== pointerPos.xSnapped || lastPos.y !== pointerPos.ySnapped) && dragItems && dragStarted) {
|
|
2141
|
-
// dragEvent = event.sourceEvent as MouseEvent;
|
|
2142
2166
|
mousePosition = getEventPosition(event.sourceEvent, containerBounds);
|
|
2143
|
-
updateNodes(pointerPos
|
|
2167
|
+
updateNodes(pointerPos);
|
|
2144
2168
|
}
|
|
2145
2169
|
})
|
|
2146
2170
|
.on('end', (event) => {
|
|
@@ -2283,14 +2307,13 @@ function isConnectionValid(isInsideConnectionRadius, isHandleValid) {
|
|
|
2283
2307
|
}
|
|
2284
2308
|
|
|
2285
2309
|
const alwaysValid = () => true;
|
|
2286
|
-
function onPointerDown(event, { connectionMode, connectionRadius, handleId, nodeId, edgeUpdaterType, isTarget, domNode, nodeLookup, lib, autoPanOnConnect, flowId, panBy, cancelConnection, onConnectStart, onConnect, onConnectEnd, isValidConnection = alwaysValid, onReconnectEnd, updateConnection, getTransform, getFromHandle, autoPanSpeed, dragThreshold = 1, }) {
|
|
2310
|
+
function onPointerDown(event, { connectionMode, connectionRadius, handleId, nodeId, edgeUpdaterType, isTarget, domNode, nodeLookup, lib, autoPanOnConnect, flowId, panBy, cancelConnection, onConnectStart, onConnect, onConnectEnd, isValidConnection = alwaysValid, onReconnectEnd, updateConnection, getTransform, getFromHandle, autoPanSpeed, dragThreshold = 1, handleDomNode, }) {
|
|
2287
2311
|
// when xyflow is used inside a shadow root we can't use document
|
|
2288
2312
|
const doc = getHostForElement(event.target);
|
|
2289
2313
|
let autoPanId = 0;
|
|
2290
2314
|
let closestHandle;
|
|
2291
2315
|
const { x, y } = getEventPosition(event);
|
|
2292
|
-
const
|
|
2293
|
-
const handleType = getHandleType(edgeUpdaterType, clickedHandle);
|
|
2316
|
+
const handleType = getHandleType(edgeUpdaterType, handleDomNode);
|
|
2294
2317
|
const containerBounds = domNode?.getBoundingClientRect();
|
|
2295
2318
|
let connectionStarted = false;
|
|
2296
2319
|
if (!containerBounds || !handleType) {
|
|
@@ -2304,7 +2327,7 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
2304
2327
|
let autoPanStarted = false;
|
|
2305
2328
|
let connection = null;
|
|
2306
2329
|
let isValid = false;
|
|
2307
|
-
let
|
|
2330
|
+
let resultHandleDomNode = null;
|
|
2308
2331
|
// when the user is moving the mouse close to the edge of the canvas while connecting we move the canvas
|
|
2309
2332
|
function autoPan() {
|
|
2310
2333
|
if (!autoPanOnConnect || !containerBounds) {
|
|
@@ -2377,7 +2400,7 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
2377
2400
|
flowId,
|
|
2378
2401
|
nodeLookup,
|
|
2379
2402
|
});
|
|
2380
|
-
|
|
2403
|
+
resultHandleDomNode = result.handleDomNode;
|
|
2381
2404
|
connection = result.connection;
|
|
2382
2405
|
isValid = isConnectionValid(!!closestHandle, result.isValid);
|
|
2383
2406
|
const newConnection = {
|
|
@@ -2411,7 +2434,7 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
2411
2434
|
}
|
|
2412
2435
|
function onPointerUp(event) {
|
|
2413
2436
|
if (connectionStarted) {
|
|
2414
|
-
if ((closestHandle ||
|
|
2437
|
+
if ((closestHandle || resultHandleDomNode) && connection && isValid) {
|
|
2415
2438
|
onConnect?.(connection);
|
|
2416
2439
|
}
|
|
2417
2440
|
/*
|
|
@@ -2434,7 +2457,7 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
2434
2457
|
autoPanStarted = false;
|
|
2435
2458
|
isValid = false;
|
|
2436
2459
|
connection = null;
|
|
2437
|
-
|
|
2460
|
+
resultHandleDomNode = null;
|
|
2438
2461
|
doc.removeEventListener('mousemove', onPointerMove);
|
|
2439
2462
|
doc.removeEventListener('mouseup', onPointerUp);
|
|
2440
2463
|
doc.removeEventListener('touchmove', onPointerMove);
|
|
@@ -2498,17 +2521,18 @@ const XYHandle = {
|
|
|
2498
2521
|
|
|
2499
2522
|
function XYMinimap({ domNode, panZoom, getTransform, getViewScale }) {
|
|
2500
2523
|
const selection = select(domNode);
|
|
2501
|
-
function update({ translateExtent, width, height, zoomStep =
|
|
2524
|
+
function update({ translateExtent, width, height, zoomStep = 1, pannable = true, zoomable = true, inversePan = false, }) {
|
|
2502
2525
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2503
2526
|
const zoomHandler = (event) => {
|
|
2504
|
-
const transform = getTransform();
|
|
2505
2527
|
if (event.sourceEvent.type !== 'wheel' || !panZoom) {
|
|
2506
2528
|
return;
|
|
2507
2529
|
}
|
|
2530
|
+
const transform = getTransform();
|
|
2531
|
+
const factor = event.sourceEvent.ctrlKey && isMacOs() ? 10 : 1;
|
|
2508
2532
|
const pinchDelta = -event.sourceEvent.deltaY *
|
|
2509
2533
|
(event.sourceEvent.deltaMode === 1 ? 0.05 : event.sourceEvent.deltaMode ? 1 : 0.002) *
|
|
2510
2534
|
zoomStep;
|
|
2511
|
-
const nextZoom = transform[2] * Math.pow(2, pinchDelta);
|
|
2535
|
+
const nextZoom = transform[2] * Math.pow(2, pinchDelta * factor);
|
|
2512
2536
|
panZoom.scaleTo(nextZoom);
|
|
2513
2537
|
};
|
|
2514
2538
|
let panStart = [0, 0];
|
package/dist/esm/index.mjs
CHANGED
|
@@ -767,7 +767,7 @@ const getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding)
|
|
|
767
767
|
};
|
|
768
768
|
const isMacOs = () => typeof navigator !== 'undefined' && navigator?.userAgent?.indexOf('Mac') >= 0;
|
|
769
769
|
function isCoordinateExtent(extent) {
|
|
770
|
-
return extent !== undefined && extent !== 'parent';
|
|
770
|
+
return extent !== undefined && extent !== null && extent !== 'parent';
|
|
771
771
|
}
|
|
772
772
|
function getNodeDimensions(node) {
|
|
773
773
|
return {
|
|
@@ -1964,6 +1964,25 @@ function getEventHandlerParams({ nodeId, dragItems, nodeLookup, dragging = true,
|
|
|
1964
1964
|
nodesFromDragItems,
|
|
1965
1965
|
];
|
|
1966
1966
|
}
|
|
1967
|
+
/**
|
|
1968
|
+
* If a selection is being dragged we want to apply the same snap offset to all nodes in the selection.
|
|
1969
|
+
* This function calculates the snap offset based on the first node in the selection.
|
|
1970
|
+
*/
|
|
1971
|
+
function calculateSnapOffset({ dragItems, snapGrid, x, y, }) {
|
|
1972
|
+
const refDragItem = dragItems.values().next().value;
|
|
1973
|
+
if (!refDragItem) {
|
|
1974
|
+
return null;
|
|
1975
|
+
}
|
|
1976
|
+
const refPos = {
|
|
1977
|
+
x: x - refDragItem.distance.x,
|
|
1978
|
+
y: y - refDragItem.distance.y,
|
|
1979
|
+
};
|
|
1980
|
+
const refPosSnapped = snapPosition(refPos, snapGrid);
|
|
1981
|
+
return {
|
|
1982
|
+
x: refPosSnapped.x - refPos.x,
|
|
1983
|
+
y: refPosSnapped.y - refPos.y,
|
|
1984
|
+
};
|
|
1985
|
+
}
|
|
1967
1986
|
|
|
1968
1987
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1969
1988
|
function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragStop, }) {
|
|
@@ -1977,39 +1996,43 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
1977
1996
|
let d3Selection = null;
|
|
1978
1997
|
let abortDrag = false; // prevents unintentional dragging on multitouch
|
|
1979
1998
|
let nodePositionsChanged = false;
|
|
1999
|
+
// we store the last drag event to be able to use it in the update function
|
|
2000
|
+
let dragEvent = null;
|
|
1980
2001
|
// public functions
|
|
1981
2002
|
function update({ noDragClassName, handleSelector, domNode, isSelectable, nodeId, nodeClickDistance = 0, }) {
|
|
1982
2003
|
d3Selection = select(domNode);
|
|
1983
|
-
function updateNodes({ x, y }
|
|
2004
|
+
function updateNodes({ x, y }) {
|
|
1984
2005
|
const { nodeLookup, nodeExtent, snapGrid, snapToGrid, nodeOrigin, onNodeDrag, onSelectionDrag, onError, updateNodePositions, } = getStoreItems();
|
|
1985
2006
|
lastPos = { x, y };
|
|
1986
2007
|
let hasChange = false;
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
2008
|
+
const isMultiDrag = dragItems.size > 1;
|
|
2009
|
+
const nodesBox = isMultiDrag && nodeExtent ? rectToBox(getInternalNodesBounds(dragItems)) : null;
|
|
2010
|
+
const multiDragSnapOffset = isMultiDrag && snapToGrid
|
|
2011
|
+
? calculateSnapOffset({
|
|
2012
|
+
dragItems,
|
|
2013
|
+
snapGrid,
|
|
2014
|
+
x,
|
|
2015
|
+
y,
|
|
2016
|
+
})
|
|
2017
|
+
: null;
|
|
1992
2018
|
for (const [id, dragItem] of dragItems) {
|
|
2019
|
+
/*
|
|
2020
|
+
* if the node is not in the nodeLookup anymore, it was probably deleted while dragging
|
|
2021
|
+
*/
|
|
1993
2022
|
if (!nodeLookup.has(id)) {
|
|
1994
|
-
/*
|
|
1995
|
-
* if the node is not in the nodeLookup anymore, it was probably deleted while dragging
|
|
1996
|
-
* and we don't need to update it anymore
|
|
1997
|
-
*/
|
|
1998
2023
|
continue;
|
|
1999
2024
|
}
|
|
2000
2025
|
let nextPosition = { x: x - dragItem.distance.x, y: y - dragItem.distance.y };
|
|
2001
2026
|
if (snapToGrid) {
|
|
2002
|
-
nextPosition =
|
|
2027
|
+
nextPosition = multiDragSnapOffset
|
|
2028
|
+
? {
|
|
2029
|
+
x: Math.round(nextPosition.x + multiDragSnapOffset.x),
|
|
2030
|
+
y: Math.round(nextPosition.y + multiDragSnapOffset.y),
|
|
2031
|
+
}
|
|
2032
|
+
: snapPosition(nextPosition, snapGrid);
|
|
2003
2033
|
}
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
* based on its position so that the node stays at it's position relative to the selection.
|
|
2007
|
-
*/
|
|
2008
|
-
let adjustedNodeExtent = [
|
|
2009
|
-
[nodeExtent[0][0], nodeExtent[0][1]],
|
|
2010
|
-
[nodeExtent[1][0], nodeExtent[1][1]],
|
|
2011
|
-
];
|
|
2012
|
-
if (dragItems.size > 1 && nodeExtent && !dragItem.extent) {
|
|
2034
|
+
let adjustedNodeExtent = null;
|
|
2035
|
+
if (isMultiDrag && nodeExtent && !dragItem.extent && nodesBox) {
|
|
2013
2036
|
const { positionAbsolute } = dragItem.internals;
|
|
2014
2037
|
const x1 = positionAbsolute.x - nodesBox.x + nodeExtent[0][0];
|
|
2015
2038
|
const x2 = positionAbsolute.x + dragItem.measured.width - nodesBox.x2 + nodeExtent[1][0];
|
|
@@ -2024,7 +2047,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
2024
2047
|
nodeId: id,
|
|
2025
2048
|
nextPosition,
|
|
2026
2049
|
nodeLookup,
|
|
2027
|
-
nodeExtent: adjustedNodeExtent,
|
|
2050
|
+
nodeExtent: adjustedNodeExtent ? adjustedNodeExtent : nodeExtent,
|
|
2028
2051
|
nodeOrigin,
|
|
2029
2052
|
onError,
|
|
2030
2053
|
});
|
|
@@ -2066,7 +2089,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
2066
2089
|
lastPos.x = (lastPos.x ?? 0) - xMovement / transform[2];
|
|
2067
2090
|
lastPos.y = (lastPos.y ?? 0) - yMovement / transform[2];
|
|
2068
2091
|
if (await panBy({ x: xMovement, y: yMovement })) {
|
|
2069
|
-
updateNodes(lastPos
|
|
2092
|
+
updateNodes(lastPos);
|
|
2070
2093
|
}
|
|
2071
2094
|
}
|
|
2072
2095
|
autoPanId = requestAnimationFrame(autoPan);
|
|
@@ -2106,6 +2129,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
2106
2129
|
containerBounds = domNode?.getBoundingClientRect() || null;
|
|
2107
2130
|
abortDrag = false;
|
|
2108
2131
|
nodePositionsChanged = false;
|
|
2132
|
+
dragEvent = event.sourceEvent;
|
|
2109
2133
|
if (nodeDragThreshold === 0) {
|
|
2110
2134
|
startDrag(event);
|
|
2111
2135
|
}
|
|
@@ -2116,6 +2140,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
2116
2140
|
.on('drag', (event) => {
|
|
2117
2141
|
const { autoPanOnNodeDrag, transform, snapGrid, snapToGrid, nodeDragThreshold, nodeLookup } = getStoreItems();
|
|
2118
2142
|
const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds });
|
|
2143
|
+
dragEvent = event.sourceEvent;
|
|
2119
2144
|
if ((event.sourceEvent.type === 'touchmove' && event.sourceEvent.touches.length > 1) ||
|
|
2120
2145
|
// if user deletes a node while dragging, we need to abort the drag to prevent errors
|
|
2121
2146
|
(nodeId && !nodeLookup.has(nodeId))) {
|
|
@@ -2138,9 +2163,8 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
2138
2163
|
}
|
|
2139
2164
|
// skip events without movement
|
|
2140
2165
|
if ((lastPos.x !== pointerPos.xSnapped || lastPos.y !== pointerPos.ySnapped) && dragItems && dragStarted) {
|
|
2141
|
-
// dragEvent = event.sourceEvent as MouseEvent;
|
|
2142
2166
|
mousePosition = getEventPosition(event.sourceEvent, containerBounds);
|
|
2143
|
-
updateNodes(pointerPos
|
|
2167
|
+
updateNodes(pointerPos);
|
|
2144
2168
|
}
|
|
2145
2169
|
})
|
|
2146
2170
|
.on('end', (event) => {
|
|
@@ -2283,14 +2307,13 @@ function isConnectionValid(isInsideConnectionRadius, isHandleValid) {
|
|
|
2283
2307
|
}
|
|
2284
2308
|
|
|
2285
2309
|
const alwaysValid = () => true;
|
|
2286
|
-
function onPointerDown(event, { connectionMode, connectionRadius, handleId, nodeId, edgeUpdaterType, isTarget, domNode, nodeLookup, lib, autoPanOnConnect, flowId, panBy, cancelConnection, onConnectStart, onConnect, onConnectEnd, isValidConnection = alwaysValid, onReconnectEnd, updateConnection, getTransform, getFromHandle, autoPanSpeed, dragThreshold = 1, }) {
|
|
2310
|
+
function onPointerDown(event, { connectionMode, connectionRadius, handleId, nodeId, edgeUpdaterType, isTarget, domNode, nodeLookup, lib, autoPanOnConnect, flowId, panBy, cancelConnection, onConnectStart, onConnect, onConnectEnd, isValidConnection = alwaysValid, onReconnectEnd, updateConnection, getTransform, getFromHandle, autoPanSpeed, dragThreshold = 1, handleDomNode, }) {
|
|
2287
2311
|
// when xyflow is used inside a shadow root we can't use document
|
|
2288
2312
|
const doc = getHostForElement(event.target);
|
|
2289
2313
|
let autoPanId = 0;
|
|
2290
2314
|
let closestHandle;
|
|
2291
2315
|
const { x, y } = getEventPosition(event);
|
|
2292
|
-
const
|
|
2293
|
-
const handleType = getHandleType(edgeUpdaterType, clickedHandle);
|
|
2316
|
+
const handleType = getHandleType(edgeUpdaterType, handleDomNode);
|
|
2294
2317
|
const containerBounds = domNode?.getBoundingClientRect();
|
|
2295
2318
|
let connectionStarted = false;
|
|
2296
2319
|
if (!containerBounds || !handleType) {
|
|
@@ -2304,7 +2327,7 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
2304
2327
|
let autoPanStarted = false;
|
|
2305
2328
|
let connection = null;
|
|
2306
2329
|
let isValid = false;
|
|
2307
|
-
let
|
|
2330
|
+
let resultHandleDomNode = null;
|
|
2308
2331
|
// when the user is moving the mouse close to the edge of the canvas while connecting we move the canvas
|
|
2309
2332
|
function autoPan() {
|
|
2310
2333
|
if (!autoPanOnConnect || !containerBounds) {
|
|
@@ -2377,7 +2400,7 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
2377
2400
|
flowId,
|
|
2378
2401
|
nodeLookup,
|
|
2379
2402
|
});
|
|
2380
|
-
|
|
2403
|
+
resultHandleDomNode = result.handleDomNode;
|
|
2381
2404
|
connection = result.connection;
|
|
2382
2405
|
isValid = isConnectionValid(!!closestHandle, result.isValid);
|
|
2383
2406
|
const newConnection = {
|
|
@@ -2411,7 +2434,7 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
2411
2434
|
}
|
|
2412
2435
|
function onPointerUp(event) {
|
|
2413
2436
|
if (connectionStarted) {
|
|
2414
|
-
if ((closestHandle ||
|
|
2437
|
+
if ((closestHandle || resultHandleDomNode) && connection && isValid) {
|
|
2415
2438
|
onConnect?.(connection);
|
|
2416
2439
|
}
|
|
2417
2440
|
/*
|
|
@@ -2434,7 +2457,7 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
2434
2457
|
autoPanStarted = false;
|
|
2435
2458
|
isValid = false;
|
|
2436
2459
|
connection = null;
|
|
2437
|
-
|
|
2460
|
+
resultHandleDomNode = null;
|
|
2438
2461
|
doc.removeEventListener('mousemove', onPointerMove);
|
|
2439
2462
|
doc.removeEventListener('mouseup', onPointerUp);
|
|
2440
2463
|
doc.removeEventListener('touchmove', onPointerMove);
|
|
@@ -2498,17 +2521,18 @@ const XYHandle = {
|
|
|
2498
2521
|
|
|
2499
2522
|
function XYMinimap({ domNode, panZoom, getTransform, getViewScale }) {
|
|
2500
2523
|
const selection = select(domNode);
|
|
2501
|
-
function update({ translateExtent, width, height, zoomStep =
|
|
2524
|
+
function update({ translateExtent, width, height, zoomStep = 1, pannable = true, zoomable = true, inversePan = false, }) {
|
|
2502
2525
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2503
2526
|
const zoomHandler = (event) => {
|
|
2504
|
-
const transform = getTransform();
|
|
2505
2527
|
if (event.sourceEvent.type !== 'wheel' || !panZoom) {
|
|
2506
2528
|
return;
|
|
2507
2529
|
}
|
|
2530
|
+
const transform = getTransform();
|
|
2531
|
+
const factor = event.sourceEvent.ctrlKey && isMacOs() ? 10 : 1;
|
|
2508
2532
|
const pinchDelta = -event.sourceEvent.deltaY *
|
|
2509
2533
|
(event.sourceEvent.deltaMode === 1 ? 0.05 : event.sourceEvent.deltaMode ? 1 : 0.002) *
|
|
2510
2534
|
zoomStep;
|
|
2511
|
-
const nextZoom = transform[2] * Math.pow(2, pinchDelta);
|
|
2535
|
+
const nextZoom = transform[2] * Math.pow(2, pinchDelta * factor);
|
|
2512
2536
|
panZoom.scaleTo(nextZoom);
|
|
2513
2537
|
};
|
|
2514
2538
|
let panStart = [0, 0];
|
|
@@ -77,8 +77,8 @@ export declare enum ConnectionLineType {
|
|
|
77
77
|
* @public
|
|
78
78
|
*/
|
|
79
79
|
export type EdgeMarker = {
|
|
80
|
-
type: MarkerType
|
|
81
|
-
color?: string;
|
|
80
|
+
type: MarkerType | `${MarkerType}`;
|
|
81
|
+
color?: string | null;
|
|
82
82
|
width?: number;
|
|
83
83
|
height?: number;
|
|
84
84
|
markerUnits?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edges.d.ts","sourceRoot":"","sources":["../../src/types/edges.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,MAAM,MAAM,QAAQ,CAClB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,QAAQ,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IACtD;IACF,4BAA4B;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,wCAAwC;IACxC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;;OAGG;IAC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AC1E,CAAC;AAEF;;;;;;;;;GASG;AACH,oBAAY,kBAAkB;IAC5B,MAAM,YAAY;IAClB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,YAAY,iBAAiB;CAC9B;AAED;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,UAAU,GAAG,GAAG,UAAU,EAAE,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,CAAC;AAEjD;;;;;GAKG;AACH,oBAAY,UAAU;IACpB,KAAK,UAAU;IACf,WAAW,gBAAgB;CAC5B;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG;IACrC,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,QAAQ,CAAC;IACzB,cAAc,EAAE,QAAQ,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -53,7 +53,7 @@ export type NodeBase<NodeData extends Record<string, unknown> = Record<string, u
|
|
|
53
53
|
* Boundary a node can be moved in.
|
|
54
54
|
* @example 'parent' or [[0, 0], [100, 100]]
|
|
55
55
|
*/
|
|
56
|
-
extent?: 'parent' | CoordinateExtent;
|
|
56
|
+
extent?: 'parent' | CoordinateExtent | null;
|
|
57
57
|
/**
|
|
58
58
|
* When `true`, the parent node will automatically expand if this node is dragged to the edge of
|
|
59
59
|
* the parent node's bounds.
|
|
@@ -134,12 +134,7 @@ export type NodeDragItem = {
|
|
|
134
134
|
internals: {
|
|
135
135
|
positionAbsolute: XYPosition;
|
|
136
136
|
};
|
|
137
|
-
|
|
138
|
-
parentId?: string;
|
|
139
|
-
dragging?: boolean;
|
|
140
|
-
origin?: NodeOrigin;
|
|
141
|
-
expandParent?: boolean;
|
|
142
|
-
};
|
|
137
|
+
} & Pick<InternalNodeBase, 'extent' | 'parentId' | 'origin' | 'expandParent' | 'dragging'>;
|
|
143
138
|
/**
|
|
144
139
|
* The origin of a Node determines how it is placed relative to its own coordinates.
|
|
145
140
|
* `[0, 0]` places it at the top left corner, `[0.5, 0.5]` right in the center and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../src/types/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,CAClB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,QAAQ,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IACtD;IACF,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,QAAQ,EAAE,UAAU,CAAC;IACrB,uCAAuC;IACvC,IAAI,EAAE,QAAQ,CAAC;IACf;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B;;;OAGG;IACH,cAAc,CAAC,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
42
42
|
*/
|
|
43
43
|
export declare const getViewportForBounds: (bounds: Rect, width: number, height: number, minZoom: number, maxZoom: number, padding: Padding) => Viewport;
|
|
44
44
|
export declare const isMacOs: () => boolean;
|
|
45
|
-
export declare function isCoordinateExtent(extent?: CoordinateExtent | 'parent'): extent is CoordinateExtent;
|
|
45
|
+
export declare function isCoordinateExtent(extent?: CoordinateExtent | 'parent' | null): extent is CoordinateExtent;
|
|
46
46
|
export declare function getNodeDimensions(node: {
|
|
47
47
|
measured?: {
|
|
48
48
|
width?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/utils/general.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,GAAG,EACH,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,OAAO,EAER,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,EAA0B,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAE5E,eAAO,MAAM,KAAK,QAAS,MAAM,iCAAqB,MAA2C,CAAC;AAElG,eAAO,MAAM,aAAa,aACd,UAAU,sBACZ,gBAAgB,cACZ,OAAO,CAAC,UAAU,CAAC;;;CAI/B,CAAC;AAEH,wBAAgB,qBAAqB,CAAC,QAAQ,SAAS,QAAQ,EAC7D,aAAa,EAAE,UAAU,EACzB,eAAe,EAAE,UAAU,EAC3B,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC;;;EAanC;AAoBD,eAAO,MAAM,WAAW,QACjB,UAAU,UACP,UAAU,UACX,MAAM,aACH,MAAM,KACf,MAAM,EAKR,CAAC;AAEF,eAAO,MAAM,gBAAgB,SAAU,GAAG,QAAQ,GAAG,KAAG,GAKtD,CAAC;AAEH,eAAO,MAAM,SAAS,4BAA6B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M,CAAA;CAAE,YAA0B,EACzE,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,GACrB,UAAU,CAWZ;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,WAY1D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,KAAK;IAClC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC7C,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC,CASA;AAED,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAExF"}
|
|
@@ -2,7 +2,7 @@ import type { EdgeBase, EdgeMarkerType, MarkerProps } from '../types';
|
|
|
2
2
|
export declare function getMarkerId(marker: EdgeMarkerType | undefined, id?: string | null): string;
|
|
3
3
|
export declare function createMarkerIds(edges: EdgeBase[], { id, defaultColor, defaultMarkerStart, defaultMarkerEnd, }: {
|
|
4
4
|
id?: string | null;
|
|
5
|
-
defaultColor?: string;
|
|
5
|
+
defaultColor?: string | null;
|
|
6
6
|
defaultMarkerStart?: EdgeMarkerType;
|
|
7
7
|
defaultMarkerEnd?: EdgeMarkerType;
|
|
8
8
|
}): MarkerProps[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marker.d.ts","sourceRoot":"","sources":["../../src/utils/marker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAc,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAElF,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,SAAS,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAe1F;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,QAAQ,EAAE,EACjB,EACE,EAAE,EACF,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,GACjB,EAAE;IACD,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"marker.d.ts","sourceRoot":"","sources":["../../src/utils/marker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAc,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAElF,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,SAAS,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAe1F;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,QAAQ,EAAE,EACjB,EACE,EAAE,EACF,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,GACjB,EAAE;IACD,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,kBAAkB,CAAC,EAAE,cAAc,CAAC;IACpC,gBAAgB,CAAC,EAAE,cAAc,CAAC;CACnC,iBAmBF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XYDrag.d.ts","sourceRoot":"","sources":["../../src/xydrag/XYDrag.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EAGZ,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,eAAe,EACf,mBAAmB,
|
|
1
|
+
{"version":3,"file":"XYDrag.d.ts","sourceRoot":"","sources":["../../src/xydrag/XYDrag.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EAGZ,QAAQ,EACR,g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{ type NodeDragItem, type XYPosition, InternalNodeBase, NodeBase, NodeLookup, SnapGrid } from '../types';
|
|
2
2
|
export declare function isParentSelected<NodeType extends NodeBase>(node: NodeType, nodeLookup: NodeLookup): boolean;
|
|
3
3
|
export declare function hasSelector(target: Element | EventTarget | null, selector: string, domNode: Element): boolean;
|
|
4
4
|
export declare function getDragItems<NodeType extends NodeBase>(nodeLookup: Map<string, InternalNodeBase<NodeType>>, nodesDraggable: boolean, mousePos: XYPosition, nodeId?: string): Map<string, NodeDragItem>;
|
|
@@ -8,4 +8,17 @@ export declare function getEventHandlerParams<NodeType extends InternalNodeBase>
|
|
|
8
8
|
nodeLookup: Map<string, NodeType>;
|
|
9
9
|
dragging?: boolean;
|
|
10
10
|
}): [NodeBase, NodeBase[]];
|
|
11
|
+
/**
|
|
12
|
+
* If a selection is being dragged we want to apply the same snap offset to all nodes in the selection.
|
|
13
|
+
* This function calculates the snap offset based on the first node in the selection.
|
|
14
|
+
*/
|
|
15
|
+
export declare function calculateSnapOffset({ dragItems, snapGrid, x, y, }: {
|
|
16
|
+
dragItems: Map<string, NodeDragItem>;
|
|
17
|
+
snapGrid: SnapGrid;
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
}): {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
} | null;
|
|
11
24
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/xydrag/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/xydrag/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,gBAAgB,EAAE,QAA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I,CAAC;IAC5B,QAAQ,EAAE,UAAU,CAAC;IACrB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,GAAG,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,aAAa,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACrF,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,MAAM,EAAE,aAAa,KAAK,MAAM,CAAC;CAC5E,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/xyminimap/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,OAAO,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/xyminimap/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,OAAO,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG7E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,OAAO,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,SAAS,CAAC;IAC9B,YAAY,EAAE,MAAM,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,eAAe,EAAE,gBAAgB,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE,eAAe;4FAWtF,eAAe;;;EAqFnB"}
|