Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
1 line
2.9 KiB
Plaintext
1 line
2.9 KiB
Plaintext
{"version":3,"file":"collisionDetection.js","names":["closestInXAxis","args","collisions","x","y","pointerCoordinates","collisionRect","left","width","top","height","container","droppableContainers","rect","droppableRects","get","id","bottom","centerX","distance","Math","abs","push","String","data","value","sort","a","b"],"sources":["../../../../../../src/views/Dashboard/Default/ModularDashboard/utils/collisionDetection.ts"],"sourcesContent":["import type { CollisionDetection } from '@dnd-kit/core'\n\n/**\n * Collision detection that considers the X\n * axis only with respect to the position of the pointer (or collisionRect for keyboard)\n */\nexport const closestInXAxis: CollisionDetection = (args) => {\n const collisions: Array<{ data: { value: number }; id: string }> = []\n\n // Use pointer coordinates if available (mouse/touch), otherwise use collisionRect center (keyboard)\n let x: number\n let y: number\n\n if (args.pointerCoordinates) {\n x = args.pointerCoordinates.x\n y = args.pointerCoordinates.y\n } else if (args.collisionRect) {\n // For keyboard navigation, use the center of the collisionRect\n x = args.collisionRect.left + args.collisionRect.width / 2\n y = args.collisionRect.top + args.collisionRect.height / 2\n } else {\n return []\n }\n\n for (const container of args.droppableContainers) {\n const rect = args.droppableRects.get(container.id)\n if (!rect) {\n continue\n }\n\n // Only consider widgets in the same row (same Y axis)\n if (y >= rect.top && y <= rect.bottom) {\n const centerX = rect.left + rect.width / 2\n const distance = Math.abs(x - centerX)\n collisions.push({ id: String(container.id), data: { value: distance } })\n }\n }\n\n return collisions.sort((a, b) => a.data.value - b.data.value)\n}\n"],"mappings":"AAEA;;;GAIA,OAAO,MAAMA,cAAA,GAAsCC,IAAA;EACjD,MAAMC,UAAA,GAA6D,EAAE;EAErE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