framer-motion 12.11.0 → 12.11.1
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/README.md +0 -1
- package/dist/cjs/dom.js +7 -13
- package/dist/cjs/index.js +7 -17
- package/dist/dom.d.ts +3 -3
- package/dist/dom.js +1 -1
- package/dist/es/render/dom/scroll/index.mjs +4 -11
- package/dist/es/render/dom/scroll/track.mjs +5 -2
- package/dist/es/value/use-spring.mjs +0 -4
- package/dist/framer-motion.dev.js +7 -17
- package/dist/framer-motion.js +1 -1
- package/dist/size-rollup-scroll.js +1 -1
- package/dist/types/index.d.ts +3 -3
- package/package.json +2 -2
|
@@ -12489,8 +12489,10 @@
|
|
|
12489
12489
|
const scrollListeners = new WeakMap();
|
|
12490
12490
|
const resizeListeners = new WeakMap();
|
|
12491
12491
|
const onScrollHandlers = new WeakMap();
|
|
12492
|
-
const getEventTarget = (element) => element === document.
|
|
12493
|
-
function scrollInfo(onScroll, { container = document.
|
|
12492
|
+
const getEventTarget = (element) => element === document.scrollingElement ? window : element;
|
|
12493
|
+
function scrollInfo(onScroll, { container = document.scrollingElement, ...options } = {}) {
|
|
12494
|
+
if (!container)
|
|
12495
|
+
return noop;
|
|
12494
12496
|
let containerHandlers = onScrollHandlers.get(container);
|
|
12495
12497
|
/**
|
|
12496
12498
|
* Get the onScroll handlers for this container.
|
|
@@ -12621,17 +12623,9 @@
|
|
|
12621
12623
|
}
|
|
12622
12624
|
}
|
|
12623
12625
|
|
|
12624
|
-
function scroll(onScroll, { axis = "y", container = document.
|
|
12625
|
-
|
|
12626
|
-
|
|
12627
|
-
* and clientHeight are the same, we need to use the document.body instead
|
|
12628
|
-
* as this is the scrollable document element.
|
|
12629
|
-
*/
|
|
12630
|
-
if (container === document.documentElement &&
|
|
12631
|
-
((axis === "y" && container.scrollHeight === container.clientHeight) ||
|
|
12632
|
-
(axis === "x" && container.scrollWidth === container.clientWidth))) {
|
|
12633
|
-
container = document.body;
|
|
12634
|
-
}
|
|
12626
|
+
function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) {
|
|
12627
|
+
if (!container)
|
|
12628
|
+
return noop;
|
|
12635
12629
|
const optionsWithDefaults = { axis, container, ...options };
|
|
12636
12630
|
return typeof onScroll === "function"
|
|
12637
12631
|
? attachToFunction(onScroll, optionsWithDefaults)
|
|
@@ -12858,11 +12852,7 @@
|
|
|
12858
12852
|
restSpeed: 0.01,
|
|
12859
12853
|
...config,
|
|
12860
12854
|
onUpdate: latestSetter.current,
|
|
12861
|
-
onComplete: () => {
|
|
12862
|
-
value.isEffectActive = true;
|
|
12863
|
-
},
|
|
12864
12855
|
});
|
|
12865
|
-
value.isEffectActive = false;
|
|
12866
12856
|
};
|
|
12867
12857
|
const stopAnimation = () => {
|
|
12868
12858
|
if (activeSpringAnimation.current) {
|