@builder.io/sdk 1.1.28 → 1.1.29-0
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.browser.js +1 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.js +14 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +14 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +14 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/builder.class.d.ts +4 -0
- package/dist/src/builder.class.js +5 -0
- package/dist/src/builder.class.js.map +1 -1
- package/dist/src/classes/animator.class.d.ts +2 -0
- package/dist/src/classes/animator.class.js +8 -1
- package/dist/src/classes/animator.class.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
throw new Error("Property name \"".concat(name, "\" is not allowed"));
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
var version = "1.1.28
|
|
155
|
+
var version = "1.1.28";
|
|
156
156
|
|
|
157
157
|
var Subscription = /** @class */ (function () {
|
|
158
158
|
function Subscription(listeners, listener) {
|
|
@@ -689,18 +689,25 @@
|
|
|
689
689
|
Array.from(elements).forEach(function (element) {
|
|
690
690
|
_this.augmentAnimation(animation, element);
|
|
691
691
|
var triggered = false;
|
|
692
|
+
var pendingAnimation = false;
|
|
692
693
|
function immediateOnScroll() {
|
|
693
694
|
if (!triggered && isScrolledIntoView(element)) {
|
|
694
695
|
triggered = true;
|
|
696
|
+
pendingAnimation = true;
|
|
695
697
|
setTimeout(function () {
|
|
696
698
|
assign(element.style, animation.steps[1].styles);
|
|
697
699
|
document.removeEventListener('scroll', onScroll);
|
|
698
700
|
setTimeout(function () {
|
|
701
|
+
pendingAnimation = false;
|
|
699
702
|
element.style.transition = '';
|
|
700
703
|
element.style.transitionDelay = '';
|
|
701
704
|
}, (animation.duration * 1000 + (animation.delay || 0)) * 1000 + 100);
|
|
702
705
|
});
|
|
703
706
|
}
|
|
707
|
+
else if (animation.repeat && triggered && !pendingAnimation && !isScrolledIntoView(element)) {
|
|
708
|
+
// we want to repeat the animation everytime the the element is out of vide and back again
|
|
709
|
+
triggered = false;
|
|
710
|
+
}
|
|
704
711
|
}
|
|
705
712
|
// TODO: roll all of these in one for more efficiency of checking all the rects
|
|
706
713
|
var onScroll = throttle(immediateOnScroll, 200, { leading: false });
|
|
@@ -708,7 +715,7 @@
|
|
|
708
715
|
function isScrolledIntoView(elem) {
|
|
709
716
|
var rect = elem.getBoundingClientRect();
|
|
710
717
|
var windowHeight = window.innerHeight;
|
|
711
|
-
var thresholdPrecent = 0;
|
|
718
|
+
var thresholdPrecent = animation.thresholdPrecent || 0;
|
|
712
719
|
var threshold = thresholdPrecent * windowHeight;
|
|
713
720
|
// TODO: partial in view? or what if element is larger than screen itself
|
|
714
721
|
return (rect.bottom > threshold && rect.top < windowHeight - threshold // Element is peeking top or bottom
|
|
@@ -1226,6 +1233,11 @@
|
|
|
1226
1233
|
}
|
|
1227
1234
|
if (isBrowser) {
|
|
1228
1235
|
this.bindMessageListeners();
|
|
1236
|
+
if (Builder.isEditing) {
|
|
1237
|
+
parent.postMessage({ type: 'builder.animatorOptions', data: { options: {
|
|
1238
|
+
version: 2
|
|
1239
|
+
} } }, '*');
|
|
1240
|
+
}
|
|
1229
1241
|
// TODO: postmessage to parent the builder info for every package
|
|
1230
1242
|
// type: 'builder.sdk', data: { name: '@builder.io/react', version: '0.1.23' }
|
|
1231
1243
|
// (window as any).BUILDER_VERSION = Builder.VERSION;
|