@builder.io/sdk
Advanced tools
Comparing version 0.0.99 to 0.0.100
@@ -486,12 +486,2 @@ 'use strict'; | ||
var rect = el.getBoundingClientRect(); | ||
// Check if parent has fixed height | ||
// FIXME: too slow - element.matches is expensive to run over and over | ||
// TODO: memoize these things so not recheck same element (also only check on mousemove hmmm) | ||
var rules = _this.getCssForElement(el, 'height'); | ||
for (var _i = 0, rules_1 = rules; _i < rules_1.length; _i++) { | ||
var rule = rules_1[_i]; | ||
if (rule.style.height && rule.style.height.match(/em|px/)) { | ||
return false; | ||
} | ||
} | ||
return ( | ||
@@ -504,3 +494,18 @@ // At least 50% of page width | ||
// (i.e. get topmost parent that shares the same bottom point) | ||
!_this.findParent(el, function (parent) { return Math.abs(parent.getBoundingClientRect().bottom - rect.bottom) < 10; }, false)); | ||
!_this.findParent(el, function (parent) { | ||
return parent !== el && Math.abs(parent.getBoundingClientRect().bottom - rect.bottom) < 10; | ||
}, false) && | ||
!_this.findParent(el, function (parent) { | ||
// Check if parent has fixed height | ||
// FIXME: too slow - element.matches is expensive to run over and over | ||
// TODO: memoize these things so not recheck same element (also only check on mousemove hmmm) | ||
var rules = _this.getCssForElement(parent, 'height'); | ||
for (var _i = 0, rules_1 = rules; _i < rules_1.length; _i++) { | ||
var rule = rules_1[_i]; | ||
if (rule.style.height && rule.style.height.match(/em|px/)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}, false)); | ||
}); | ||
@@ -518,2 +523,3 @@ }; | ||
EventCapturer.prototype.virtualizeEvent = function (event) { | ||
// TODO: only get target on mouseover too? | ||
var target = event.target; | ||
@@ -520,0 +526,0 @@ var builderTarget = event.type === 'mouseover' && this.findBuilderParent(target); |
@@ -480,12 +480,2 @@ import uniqueSelector from 'unique-selector'; | ||
var rect = el.getBoundingClientRect(); | ||
// Check if parent has fixed height | ||
// FIXME: too slow - element.matches is expensive to run over and over | ||
// TODO: memoize these things so not recheck same element (also only check on mousemove hmmm) | ||
var rules = _this.getCssForElement(el, 'height'); | ||
for (var _i = 0, rules_1 = rules; _i < rules_1.length; _i++) { | ||
var rule = rules_1[_i]; | ||
if (rule.style.height && rule.style.height.match(/em|px/)) { | ||
return false; | ||
} | ||
} | ||
return ( | ||
@@ -498,3 +488,18 @@ // At least 50% of page width | ||
// (i.e. get topmost parent that shares the same bottom point) | ||
!_this.findParent(el, function (parent) { return Math.abs(parent.getBoundingClientRect().bottom - rect.bottom) < 10; }, false)); | ||
!_this.findParent(el, function (parent) { | ||
return parent !== el && Math.abs(parent.getBoundingClientRect().bottom - rect.bottom) < 10; | ||
}, false) && | ||
!_this.findParent(el, function (parent) { | ||
// Check if parent has fixed height | ||
// FIXME: too slow - element.matches is expensive to run over and over | ||
// TODO: memoize these things so not recheck same element (also only check on mousemove hmmm) | ||
var rules = _this.getCssForElement(parent, 'height'); | ||
for (var _i = 0, rules_1 = rules; _i < rules_1.length; _i++) { | ||
var rule = rules_1[_i]; | ||
if (rule.style.height && rule.style.height.match(/em|px/)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}, false)); | ||
}); | ||
@@ -512,2 +517,3 @@ }; | ||
EventCapturer.prototype.virtualizeEvent = function (event) { | ||
// TODO: only get target on mouseover too? | ||
var target = event.target; | ||
@@ -514,0 +520,0 @@ var builderTarget = event.type === 'mouseover' && this.findBuilderParent(target); |
{ | ||
"name": "@builder.io/sdk", | ||
"version": "0.0.99", | ||
"version": "0.0.100", | ||
"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
1043930
15966