@dnd-kit/collision 0.0.9-beta-20250209205423 → 0.0.9-beta-20250209220628

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/index.cjs CHANGED
@@ -99,8 +99,10 @@ var closestCorners = (input) => {
99
99
  if (!droppable.shape) {
100
100
  return null;
101
101
  }
102
- const shapeCorners = shape ? corners(shape.current) : void 0;
103
- const distance = corners(droppable.shape).reduce(
102
+ const shapeCorners = shape ? import_geometry3.Rectangle.from(shape.current.boundingRectangle).corners : void 0;
103
+ const distance = import_geometry3.Rectangle.from(
104
+ droppable.shape.boundingRectangle
105
+ ).corners.reduce(
104
106
  (acc, corner, index) => {
105
107
  var _a;
106
108
  return acc + import_geometry3.Point.distance(
@@ -118,15 +120,6 @@ var closestCorners = (input) => {
118
120
  priority: import_abstract3.CollisionPriority.Normal
119
121
  };
120
122
  };
121
- function corners(shape) {
122
- const { left, top, right, bottom } = shape.boundingRectangle;
123
- return [
124
- { x: left, y: top },
125
- { x: right, y: top },
126
- { x: left, y: bottom },
127
- { x: right, y: bottom }
128
- ];
129
- }
130
123
 
131
124
  // src/algorithms/closestCenter.ts
132
125
  var import_abstract4 = require("@dnd-kit/abstract");
package/dist/index.js CHANGED
@@ -60,15 +60,17 @@ var defaultCollisionDetection = (args) => {
60
60
 
61
61
  // src/algorithms/closestCorners.ts
62
62
  import { CollisionPriority as CollisionPriority3, CollisionType as CollisionType3 } from "@dnd-kit/abstract";
63
- import { Point as Point3 } from "@dnd-kit/geometry";
63
+ import { Point as Point3, Rectangle } from "@dnd-kit/geometry";
64
64
  var closestCorners = (input) => {
65
65
  const { dragOperation, droppable } = input;
66
66
  const { shape, position } = dragOperation;
67
67
  if (!droppable.shape) {
68
68
  return null;
69
69
  }
70
- const shapeCorners = shape ? corners(shape.current) : void 0;
71
- const distance = corners(droppable.shape).reduce(
70
+ const shapeCorners = shape ? Rectangle.from(shape.current.boundingRectangle).corners : void 0;
71
+ const distance = Rectangle.from(
72
+ droppable.shape.boundingRectangle
73
+ ).corners.reduce(
72
74
  (acc, corner, index) => {
73
75
  var _a;
74
76
  return acc + Point3.distance(
@@ -86,15 +88,6 @@ var closestCorners = (input) => {
86
88
  priority: CollisionPriority3.Normal
87
89
  };
88
90
  };
89
- function corners(shape) {
90
- const { left, top, right, bottom } = shape.boundingRectangle;
91
- return [
92
- { x: left, y: top },
93
- { x: right, y: top },
94
- { x: left, y: bottom },
95
- { x: right, y: bottom }
96
- ];
97
- }
98
91
 
99
92
  // src/algorithms/closestCenter.ts
100
93
  import { CollisionPriority as CollisionPriority4, CollisionType as CollisionType4 } from "@dnd-kit/abstract";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dnd-kit/collision",
3
3
  "type": "module",
4
- "version": "0.0.9-beta-20250209205423",
4
+ "version": "0.0.9-beta-20250209220628",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -24,8 +24,8 @@
24
24
  "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
25
25
  },
26
26
  "dependencies": {
27
- "@dnd-kit/abstract": "0.0.9-beta-20250209205423",
28
- "@dnd-kit/geometry": "0.0.9-beta-20250209205423",
27
+ "@dnd-kit/abstract": "0.0.9-beta-20250209220628",
28
+ "@dnd-kit/geometry": "0.0.9-beta-20250209220628",
29
29
  "tslib": "^2.6.2"
30
30
  },
31
31
  "devDependencies": {