@vchasno/ui-kit 0.3.12 → 0.3.13

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.
@@ -3210,12 +3210,21 @@ const createCoords = v => ({
3210
3210
  y: v
3211
3211
  });
3212
3212
  function rectToClientRect(rect) {
3213
+ const {
3214
+ x,
3215
+ y,
3216
+ width,
3217
+ height
3218
+ } = rect;
3213
3219
  return {
3214
- ...rect,
3215
- top: rect.y,
3216
- left: rect.x,
3217
- right: rect.x + rect.width,
3218
- bottom: rect.y + rect.height
3220
+ width,
3221
+ height,
3222
+ top: y,
3223
+ left: x,
3224
+ right: x + width,
3225
+ bottom: y + height,
3226
+ x,
3227
+ y
3219
3228
  };
3220
3229
  }
3221
3230
 
@@ -3308,10 +3317,14 @@ function getOverflowAncestors(node, list, traverseIframes) {
3308
3317
  const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
3309
3318
  const win = getWindow(scrollableAncestor);
3310
3319
  if (isBody) {
3311
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
3320
+ const frameElement = getFrameElement(win);
3321
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
3312
3322
  }
3313
3323
  return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
3314
3324
  }
3325
+ function getFrameElement(win) {
3326
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
3327
+ }
3315
3328
 
3316
3329
  function getCssDimensions(element) {
3317
3330
  const css = getComputedStyle$1(element);