chore(changelogs): update

This commit is contained in:
moklick
2024-07-09 10:58:44 +02:00
parent 69bd68f4b8
commit b1118b1dd9
3 changed files with 11 additions and 12 deletions

View File

@@ -1,5 +1,9 @@
# @xyflow/react
## 12.0.0-next.28
- add `paneDistanceClick` prop (max distance between mousedown/up that will trigger a click)
## 12.0.0-next.27
- return Promises for `setViewport`, `fitView`, `fitBounds` and `zoomTo` to be able to await viewport update

View File

@@ -1,5 +1,9 @@
# @xyflow/svelte
## 0.1.10
- add `paneDistanceClick` prop (max distance between mousedown/up that will trigger a click)
## 0.1.9
- return Promises for `setViewport`, `fitView`, `fitBounds` and `zoomTo` to be able to await viewport update

View File

@@ -54,7 +54,7 @@ export function XYPanZoom({
};
const bbox = domNode.getBoundingClientRect();
const d3ZoomInstance = zoom()
.clickDistance(paneClickDistance)
.clickDistance(!isNumeric(paneClickDistance) || paneClickDistance < 0 ? 0 : paneClickDistance)
.scaleExtent([minZoom, maxZoom])
.translateExtent(translateExtent);
const d3Selection = select(domNode).call(d3ZoomInstance);
@@ -272,17 +272,8 @@ export function XYPanZoom({
}
function setClickDistance(distance: number) {
let validNumber = distance;
if (!isNumeric(distance)) {
validNumber = 0;
}
if (validNumber < 0) {
validNumber = 0;
}
d3ZoomInstance?.clickDistance(validNumber);
const validDistance = !isNumeric(distance) || distance < 0 ? 0 : distance;
d3ZoomInstance?.clickDistance(validDistance);
}
return {