@builder.io/sdk 1.1.29-3 → 1.1.29

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-2";
132
+ var version = "1.1.28";
133
133
 
134
134
  var Subscription = /** @class */ (function () {
135
135
  function Subscription(listeners, listener) {
@@ -666,30 +666,18 @@ var Animator = /** @class */ (function () {
666
666
  Array.from(elements).forEach(function (element) {
667
667
  _this.augmentAnimation(animation, element);
668
668
  var triggered = false;
669
- var pendingAnimation = false;
670
669
  function immediateOnScroll() {
671
670
  if (!triggered && isScrolledIntoView(element)) {
672
671
  triggered = true;
673
- pendingAnimation = true;
674
672
  setTimeout(function () {
675
673
  assign(element.style, animation.steps[1].styles);
676
- if (!animation.repeat) {
677
- document.removeEventListener('scroll', onScroll);
678
- }
674
+ document.removeEventListener('scroll', onScroll);
679
675
  setTimeout(function () {
680
- pendingAnimation = false;
681
- if (!animation.repeat) {
682
- element.style.transition = '';
683
- element.style.transitionDelay = '';
684
- }
685
- }, (animation.duration + (animation.delay || 0)) * 1000 + 100);
676
+ element.style.transition = '';
677
+ element.style.transitionDelay = '';
678
+ }, (animation.duration * 1000 + (animation.delay || 0)) * 1000 + 100);
686
679
  });
687
680
  }
688
- else if (animation.repeat && triggered && !pendingAnimation && !isScrolledIntoView(element)) {
689
- // we want to repeat the animation everytime the the element is out of vide and back again
690
- triggered = false;
691
- assign(element.style, animation.steps[0].styles);
692
- }
693
681
  }
694
682
  // TODO: roll all of these in one for more efficiency of checking all the rects
695
683
  var onScroll = throttle(immediateOnScroll, 200, { leading: false });
@@ -697,8 +685,8 @@ var Animator = /** @class */ (function () {
697
685
  function isScrolledIntoView(elem) {
698
686
  var rect = elem.getBoundingClientRect();
699
687
  var windowHeight = window.innerHeight;
700
- var thresholdPercent = animation.thresholdPercent || 0;
701
- var threshold = thresholdPercent * windowHeight;
688
+ var thresholdPrecent = 0;
689
+ var threshold = thresholdPrecent * windowHeight;
702
690
  // TODO: partial in view? or what if element is larger than screen itself
703
691
  return (rect.bottom > threshold && rect.top < windowHeight - threshold // Element is peeking top or bottom
704
692
  // (rect.top > 0 && rect.bottom < window.innerHeight) || // element fits within the screen and is fully on screen (not hanging off at all)
@@ -1147,11 +1135,6 @@ var Builder = /** @class */ (function () {
1147
1135
  }
1148
1136
  if (isBrowser) {
1149
1137
  this.bindMessageListeners();
1150
- if (Builder.isEditing) {
1151
- parent.postMessage({ type: 'builder.animatorOptions', data: { options: {
1152
- version: 2
1153
- } } }, '*');
1154
- }
1155
1138
  // TODO: postmessage to parent the builder info for every package
1156
1139
  // type: 'builder.sdk', data: { name: '@builder.io/react', version: '0.1.23' }
1157
1140
  // (window as any).BUILDER_VERSION = Builder.VERSION;