@builder.io/sdk 1.1.29-2 → 1.1.29-6

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.
package/dist/index.cjs.js CHANGED
@@ -129,7 +129,7 @@ function assertAllowedPropertyName(name) {
129
129
  throw new Error("Property name \"".concat(name, "\" is not allowed"));
130
130
  }
131
131
 
132
- var version = "1.1.29-1";
132
+ var version = "1.1.29-5";
133
133
 
134
134
  var Subscription = /** @class */ (function () {
135
135
  function Subscription(listeners, listener) {
@@ -685,7 +685,10 @@ var Animator = /** @class */ (function () {
685
685
  }, (animation.duration + (animation.delay || 0)) * 1000 + 100);
686
686
  });
687
687
  }
688
- else if (animation.repeat && triggered && !pendingAnimation && !isScrolledIntoView(element)) {
688
+ else if (animation.repeat &&
689
+ triggered &&
690
+ !pendingAnimation &&
691
+ !isScrolledIntoView(element)) {
689
692
  // we want to repeat the animation everytime the the element is out of vide and back again
690
693
  triggered = false;
691
694
  assign(element.style, animation.steps[0].styles);
@@ -697,8 +700,8 @@ var Animator = /** @class */ (function () {
697
700
  function isScrolledIntoView(elem) {
698
701
  var rect = elem.getBoundingClientRect();
699
702
  var windowHeight = window.innerHeight;
700
- var thresholdPrecent = animation.thresholdPrecent || 0;
701
- var threshold = thresholdPrecent * windowHeight;
703
+ var thresholdPercent = (animation.thresholdPercent || 0) / 100;
704
+ var threshold = thresholdPercent * windowHeight;
702
705
  // TODO: partial in view? or what if element is larger than screen itself
703
706
  return (rect.bottom > threshold && rect.top < windowHeight - threshold // Element is peeking top or bottom
704
707
  // (rect.top > 0 && rect.bottom < window.innerHeight) || // element fits within the screen and is fully on screen (not hanging off at all)
@@ -1148,9 +1151,14 @@ var Builder = /** @class */ (function () {
1148
1151
  if (isBrowser) {
1149
1152
  this.bindMessageListeners();
1150
1153
  if (Builder.isEditing) {
1151
- parent.postMessage({ type: 'builder.animatorOptions', data: { options: {
1152
- version: 2
1153
- } } }, '*');
1154
+ parent.postMessage({
1155
+ type: 'builder.animatorOptions',
1156
+ data: {
1157
+ options: {
1158
+ version: 2,
1159
+ },
1160
+ },
1161
+ }, '*');
1154
1162
  }
1155
1163
  // TODO: postmessage to parent the builder info for every package
1156
1164
  // type: 'builder.sdk', data: { name: '@builder.io/react', version: '0.1.23' }