Files
klz-cables.com/.pnpm-store/v10/files/86/7a5fc23af3cfc4462bb84b49e33ba46446d0651c4f23c4e673d3f867d55590d617a688c7c47a86b392146f5f63b86a1974b22e6c529788db17642882caf178
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

42 lines
2.0 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseDocumentSize = exports.parseBounds = exports.Bounds = void 0;
var Bounds = /** @class */ (function () {
function Bounds(left, top, width, height) {
this.left = left;
this.top = top;
this.width = width;
this.height = height;
}
Bounds.prototype.add = function (x, y, w, h) {
return new Bounds(this.left + x, this.top + y, this.width + w, this.height + h);
};
Bounds.fromClientRect = function (context, clientRect) {
return new Bounds(clientRect.left + context.windowBounds.left, clientRect.top + context.windowBounds.top, clientRect.width, clientRect.height);
};
Bounds.fromDOMRectList = function (context, domRectList) {
var domRect = Array.from(domRectList).find(function (rect) { return rect.width !== 0; });
return domRect
? new Bounds(domRect.left + context.windowBounds.left, domRect.top + context.windowBounds.top, domRect.width, domRect.height)
: Bounds.EMPTY;
};
Bounds.EMPTY = new Bounds(0, 0, 0, 0);
return Bounds;
}());
exports.Bounds = Bounds;
var parseBounds = function (context, node) {
return Bounds.fromClientRect(context, node.getBoundingClientRect());
};
exports.parseBounds = parseBounds;
var parseDocumentSize = function (document) {
var body = document.body;
var documentElement = document.documentElement;
if (!body || !documentElement) {
throw new Error("Unable to get document size");
}
var width = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth));
var height = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight));
return new Bounds(0, 0, width, height);
};
exports.parseDocumentSize = parseDocumentSize;
//# sourceMappingURL=bounds.js.map