@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.esm.js CHANGED
@@ -123,7 +123,7 @@ function assertAllowedPropertyName(name) {
123
123
  throw new Error("Property name \"".concat(name, "\" is not allowed"));
124
124
  }
125
125
 
126
- var version = "1.1.29-1";
126
+ var version = "1.1.29-5";
127
127
 
128
128
  var Subscription = /** @class */ (function () {
129
129
  function Subscription(listeners, listener) {
@@ -679,7 +679,10 @@ var Animator = /** @class */ (function () {
679
679
  }, (animation.duration + (animation.delay || 0)) * 1000 + 100);
680
680
  });
681
681
  }
682
- else if (animation.repeat && triggered && !pendingAnimation && !isScrolledIntoView(element)) {
682
+ else if (animation.repeat &&
683
+ triggered &&
684
+ !pendingAnimation &&
685
+ !isScrolledIntoView(element)) {
683
686
  // we want to repeat the animation everytime the the element is out of vide and back again
684
687
  triggered = false;
685
688
  assign(element.style, animation.steps[0].styles);
@@ -691,8 +694,8 @@ var Animator = /** @class */ (function () {
691
694
  function isScrolledIntoView(elem) {
692
695
  var rect = elem.getBoundingClientRect();
693
696
  var windowHeight = window.innerHeight;
694
- var thresholdPrecent = animation.thresholdPrecent || 0;
695
- var threshold = thresholdPrecent * windowHeight;
697
+ var thresholdPercent = (animation.thresholdPercent || 0) / 100;
698
+ var threshold = thresholdPercent * windowHeight;
696
699
  // TODO: partial in view? or what if element is larger than screen itself
697
700
  return (rect.bottom > threshold && rect.top < windowHeight - threshold // Element is peeking top or bottom
698
701
  // (rect.top > 0 && rect.bottom < window.innerHeight) || // element fits within the screen and is fully on screen (not hanging off at all)
@@ -1142,9 +1145,14 @@ var Builder = /** @class */ (function () {
1142
1145
  if (isBrowser) {
1143
1146
  this.bindMessageListeners();
1144
1147
  if (Builder.isEditing) {
1145
- parent.postMessage({ type: 'builder.animatorOptions', data: { options: {
1146
- version: 2
1147
- } } }, '*');
1148
+ parent.postMessage({
1149
+ type: 'builder.animatorOptions',
1150
+ data: {
1151
+ options: {
1152
+ version: 2,
1153
+ },
1154
+ },
1155
+ }, '*');
1148
1156
  }
1149
1157
  // TODO: postmessage to parent the builder info for every package
1150
1158
  // type: 'builder.sdk', data: { name: '@builder.io/react', version: '0.1.23' }