@builder.io/sdk
Advanced tools
Comparing version 0.0.137 to 0.0.138
@@ -639,5 +639,7 @@ 'use strict'; | ||
var rect = elem.getBoundingClientRect(); | ||
var windowHeight = window.innerHeight; | ||
var thresholdPrecent = 0.2; | ||
var threshold = thresholdPrecent * windowHeight; | ||
// TODO: partial in view? or what if element is larger than screen itself | ||
return ((rect.top > 0 && rect.bottom < window.innerHeight) || // element fits within the screen and is fully on screen (not hanging off at all) | ||
(rect.top < 0 && rect.bottom > window.innerHeight) // element is larger than the screen and hangs over the top and bottom | ||
return (rect.bottom > threshold && rect.top < windowHeight - threshold // Element is peeking top or bottom | ||
); | ||
@@ -644,0 +646,0 @@ } |
@@ -633,5 +633,7 @@ import uniqueSelector from 'unique-selector'; | ||
var rect = elem.getBoundingClientRect(); | ||
var windowHeight = window.innerHeight; | ||
var thresholdPrecent = 0.2; | ||
var threshold = thresholdPrecent * windowHeight; | ||
// TODO: partial in view? or what if element is larger than screen itself | ||
return ((rect.top > 0 && rect.bottom < window.innerHeight) || // element fits within the screen and is fully on screen (not hanging off at all) | ||
(rect.top < 0 && rect.bottom > window.innerHeight) // element is larger than the screen and hangs over the top and bottom | ||
return (rect.bottom > threshold && rect.top < windowHeight - threshold // Element is peeking top or bottom | ||
); | ||
@@ -638,0 +640,0 @@ } |
{ | ||
"name": "@builder.io/sdk", | ||
"version": "0.0.137", | ||
"version": "0.0.138", | ||
"browser": "./dist/index.umd.min.js", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.cjs.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
15049
1088479