Files
klz-cables.com/.pnpm-store/v10/files/1d/62b6b360fabe50017db446388f400d3181ca6ab30aa5851d4e5072f3e1e47a2d9dafbbd234236cde9d0930a8ce9c4434bbfe349a3c284c78fe194dbd0a5d2d
Marc Mintel 5397309103
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
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

132 lines
3.2 KiB
Plaintext

'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var utilities = require('@dnd-kit/utilities');
function createSnapModifier(gridSize) {
return _ref => {
let {
transform
} = _ref;
return { ...transform,
x: Math.ceil(transform.x / gridSize) * gridSize,
y: Math.ceil(transform.y / gridSize) * gridSize
};
};
}
const restrictToHorizontalAxis = _ref => {
let {
transform
} = _ref;
return { ...transform,
y: 0
};
};
function restrictToBoundingRect(transform, rect, boundingRect) {
const value = { ...transform
};
if (rect.top + transform.y <= boundingRect.top) {
value.y = boundingRect.top - rect.top;
} else if (rect.bottom + transform.y >= boundingRect.top + boundingRect.height) {
value.y = boundingRect.top + boundingRect.height - rect.bottom;
}
if (rect.left + transform.x <= boundingRect.left) {
value.x = boundingRect.left - rect.left;
} else if (rect.right + transform.x >= boundingRect.left + boundingRect.width) {
value.x = boundingRect.left + boundingRect.width - rect.right;
}
return value;
}
const restrictToParentElement = _ref => {
let {
containerNodeRect,
draggingNodeRect,
transform
} = _ref;
if (!draggingNodeRect || !containerNodeRect) {
return transform;
}
return restrictToBoundingRect(transform, draggingNodeRect, containerNodeRect);
};
const restrictToFirstScrollableAncestor = _ref => {
let {
draggingNodeRect,
transform,
scrollableAncestorRects
} = _ref;
const firstScrollableAncestorRect = scrollableAncestorRects[0];
if (!draggingNodeRect || !firstScrollableAncestorRect) {
return transform;
}
return restrictToBoundingRect(transform, draggingNodeRect, firstScrollableAncestorRect);
};
const restrictToVerticalAxis = _ref => {
let {
transform
} = _ref;
return { ...transform,
x: 0
};
};
const restrictToWindowEdges = _ref => {
let {
transform,
draggingNodeRect,
windowRect
} = _ref;
if (!draggingNodeRect || !windowRect) {
return transform;
}
return restrictToBoundingRect(transform, draggingNodeRect, windowRect);
};
const snapCenterToCursor = _ref => {
let {
activatorEvent,
draggingNodeRect,
transform
} = _ref;
if (draggingNodeRect && activatorEvent) {
const activatorCoordinates = utilities.getEventCoordinates(activatorEvent);
if (!activatorCoordinates) {
return transform;
}
const offsetX = activatorCoordinates.x - draggingNodeRect.left;
const offsetY = activatorCoordinates.y - draggingNodeRect.top;
return { ...transform,
x: transform.x + offsetX - draggingNodeRect.width / 2,
y: transform.y + offsetY - draggingNodeRect.height / 2
};
}
return transform;
};
exports.createSnapModifier = createSnapModifier;
exports.restrictToFirstScrollableAncestor = restrictToFirstScrollableAncestor;
exports.restrictToHorizontalAxis = restrictToHorizontalAxis;
exports.restrictToParentElement = restrictToParentElement;
exports.restrictToVerticalAxis = restrictToVerticalAxis;
exports.restrictToWindowEdges = restrictToWindowEdges;
exports.snapCenterToCursor = snapCenterToCursor;
//# sourceMappingURL=modifiers.cjs.development.js.map