framer-motion 6.3.3 → 6.3.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/cjs/index.js +17 -19
- package/dist/es/components/AnimatePresence/index.mjs +0 -6
- package/dist/es/components/MotionConfig/index.mjs +1 -1
- package/dist/es/events/use-dom-event.mjs +2 -1
- package/dist/es/gestures/drag/VisualElementDragControls.mjs +1 -1
- package/dist/es/gestures/use-hover-gesture.mjs +2 -2
- package/dist/es/gestures/use-tap-gesture.mjs +8 -2
- package/dist/es/projection/node/DocumentProjectionNode.mjs +2 -4
- package/dist/es/value/scroll/use-element-scroll.mjs +1 -1
- package/dist/es/value/scroll/use-viewport-scroll.mjs +1 -1
- package/dist/framer-motion.dev.js +17 -18
- package/dist/framer-motion.js +1 -1
- package/dist/projection.dev.js +9 -6
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-webpack-dom-animation.js +1 -1
- package/dist/size-webpack-dom-max.js +1 -1
- package/package.json +3 -3
- package/types/motion/types.d.ts +20 -20
package/dist/cjs/index.js
CHANGED
|
@@ -3884,8 +3884,9 @@ exports.AnimationType = void 0;
|
|
|
3884
3884
|
})(exports.AnimationType || (exports.AnimationType = {}));
|
|
3885
3885
|
|
|
3886
3886
|
function addDomEvent(target, eventName, handler, options) {
|
|
3887
|
+
if (options === void 0) { options = { passive: true }; }
|
|
3887
3888
|
target.addEventListener(eventName, handler, options);
|
|
3888
|
-
return function () { return target.removeEventListener(eventName, handler
|
|
3889
|
+
return function () { return target.removeEventListener(eventName, handler); };
|
|
3889
3890
|
}
|
|
3890
3891
|
/**
|
|
3891
3892
|
* Attaches an event listener directly to the provided DOM element.
|
|
@@ -4112,10 +4113,10 @@ function useHoverGesture(_a) {
|
|
|
4112
4113
|
var onHoverStart = _a.onHoverStart, onHoverEnd = _a.onHoverEnd, whileHover = _a.whileHover, visualElement = _a.visualElement;
|
|
4113
4114
|
usePointerEvent(visualElement, "pointerenter", onHoverStart || whileHover
|
|
4114
4115
|
? createHoverEvent(visualElement, true, onHoverStart)
|
|
4115
|
-
: undefined);
|
|
4116
|
+
: undefined, { passive: !onHoverStart });
|
|
4116
4117
|
usePointerEvent(visualElement, "pointerleave", onHoverEnd || whileHover
|
|
4117
4118
|
? createHoverEvent(visualElement, false, onHoverEnd)
|
|
4118
|
-
: undefined);
|
|
4119
|
+
: undefined, { passive: !onHoverEnd });
|
|
4119
4120
|
}
|
|
4120
4121
|
|
|
4121
4122
|
/**
|
|
@@ -4150,6 +4151,12 @@ function useTapGesture(_a) {
|
|
|
4150
4151
|
var hasPressListeners = onTap || onTapStart || onTapCancel || whileTap;
|
|
4151
4152
|
var isPressing = React.useRef(false);
|
|
4152
4153
|
var cancelPointerEndListeners = React.useRef(null);
|
|
4154
|
+
/**
|
|
4155
|
+
* Only set listener to passive if there are no external listeners.
|
|
4156
|
+
*/
|
|
4157
|
+
var eventOptions = {
|
|
4158
|
+
passive: !(onTapStart || onTap || onTapCancel || onPointerDown),
|
|
4159
|
+
};
|
|
4153
4160
|
function removePointerEndListener() {
|
|
4154
4161
|
var _a;
|
|
4155
4162
|
(_a = cancelPointerEndListeners.current) === null || _a === void 0 ? void 0 : _a.call(cancelPointerEndListeners);
|
|
@@ -4184,14 +4191,14 @@ function useTapGesture(_a) {
|
|
|
4184
4191
|
if (isPressing.current)
|
|
4185
4192
|
return;
|
|
4186
4193
|
isPressing.current = true;
|
|
4187
|
-
cancelPointerEndListeners.current = popmotion.pipe(addPointerEvent(window, "pointerup", onPointerUp), addPointerEvent(window, "pointercancel", onPointerCancel));
|
|
4194
|
+
cancelPointerEndListeners.current = popmotion.pipe(addPointerEvent(window, "pointerup", onPointerUp, eventOptions), addPointerEvent(window, "pointercancel", onPointerCancel, eventOptions));
|
|
4188
4195
|
/**
|
|
4189
4196
|
* Ensure we trigger animations before firing event callback
|
|
4190
4197
|
*/
|
|
4191
4198
|
(_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Tap, true);
|
|
4192
4199
|
onTapStart === null || onTapStart === void 0 ? void 0 : onTapStart(event, info);
|
|
4193
4200
|
}
|
|
4194
|
-
usePointerEvent(visualElement, "pointerdown", hasPressListeners ? onPointerDown : undefined);
|
|
4201
|
+
usePointerEvent(visualElement, "pointerdown", hasPressListeners ? onPointerDown : undefined, eventOptions);
|
|
4195
4202
|
useUnmountEffect(removePointerEndListener);
|
|
4196
4203
|
}
|
|
4197
4204
|
|
|
@@ -5783,7 +5790,7 @@ var VisualElementDragControls = /** @class */ (function () {
|
|
|
5783
5790
|
* constraints as the window resizes.
|
|
5784
5791
|
*/
|
|
5785
5792
|
var stopResizeListener = addDomEvent(window, "resize", function () {
|
|
5786
|
-
_this.scalePositionWithinConstraints();
|
|
5793
|
+
return _this.scalePositionWithinConstraints();
|
|
5787
5794
|
});
|
|
5788
5795
|
/**
|
|
5789
5796
|
* If the element's layout changes, calculate the delta and apply that to
|
|
@@ -7056,10 +7063,7 @@ var layoutFeatures = {
|
|
|
7056
7063
|
};
|
|
7057
7064
|
|
|
7058
7065
|
var DocumentProjectionNode = createProjectionNode({
|
|
7059
|
-
attachResizeListener: function (ref, notify) {
|
|
7060
|
-
ref.addEventListener("resize", notify, { passive: true });
|
|
7061
|
-
return function () { return ref.removeEventListener("resize", notify); };
|
|
7062
|
-
},
|
|
7066
|
+
attachResizeListener: function (ref, notify) { return addDomEvent(ref, "resize", notify); },
|
|
7063
7067
|
measureScroll: function () { return ({
|
|
7064
7068
|
x: document.documentElement.scrollLeft || document.body.scrollLeft,
|
|
7065
7069
|
y: document.documentElement.scrollTop || document.body.scrollTop,
|
|
@@ -7203,15 +7207,9 @@ function newChildrenMap() {
|
|
|
7203
7207
|
}
|
|
7204
7208
|
|
|
7205
7209
|
var getChildKey = function (child) { return child.key || ""; };
|
|
7206
|
-
var isDev = process$1.env.NODE_ENV !== "production";
|
|
7207
7210
|
function updateChildLookup(children, allChildren) {
|
|
7208
|
-
var seenChildren = isDev ? new Set() : null;
|
|
7209
7211
|
children.forEach(function (child) {
|
|
7210
7212
|
var key = getChildKey(child);
|
|
7211
|
-
if (isDev && seenChildren && seenChildren.has(key)) {
|
|
7212
|
-
console.warn("Children of AnimatePresence require unique keys. \"".concat(key, "\" is a duplicate."));
|
|
7213
|
-
seenChildren.add(key);
|
|
7214
|
-
}
|
|
7215
7213
|
allChildren.set(key, child);
|
|
7216
7214
|
});
|
|
7217
7215
|
}
|
|
@@ -7454,7 +7452,7 @@ function MotionConfig(_a) {
|
|
|
7454
7452
|
* Creating a new config context object will re-render every `motion` component
|
|
7455
7453
|
* every time it renders. So we only want to create a new one sparingly.
|
|
7456
7454
|
*/
|
|
7457
|
-
var context = React.useMemo(function () { return config; }, [JSON.stringify(config.transition), config.transformPagePoint]);
|
|
7455
|
+
var context = React.useMemo(function () { return config; }, [JSON.stringify(config.transition), config.transformPagePoint, config.reducedMotion]);
|
|
7458
7456
|
return (React__namespace.createElement(MotionConfigContext.Provider, { value: context }, children));
|
|
7459
7457
|
}
|
|
7460
7458
|
|
|
@@ -7921,7 +7919,7 @@ function useElementScroll(ref) {
|
|
|
7921
7919
|
if (!element)
|
|
7922
7920
|
return;
|
|
7923
7921
|
var updateScrollValues = createScrollUpdater(values, getElementScrollOffsets(element));
|
|
7924
|
-
var scrollListener = addDomEvent(element, "scroll", updateScrollValues
|
|
7922
|
+
var scrollListener = addDomEvent(element, "scroll", updateScrollValues);
|
|
7925
7923
|
var resizeListener = addDomEvent(element, "resize", updateScrollValues);
|
|
7926
7924
|
return function () {
|
|
7927
7925
|
scrollListener && scrollListener();
|
|
@@ -7944,7 +7942,7 @@ var hasListeners = false;
|
|
|
7944
7942
|
function addEventListeners() {
|
|
7945
7943
|
hasListeners = true;
|
|
7946
7944
|
var updateScrollValues = createScrollUpdater(viewportScrollValues, getViewportScrollOffsets);
|
|
7947
|
-
addDomEvent(window, "scroll", updateScrollValues
|
|
7945
|
+
addDomEvent(window, "scroll", updateScrollValues);
|
|
7948
7946
|
addDomEvent(window, "resize", updateScrollValues);
|
|
7949
7947
|
}
|
|
7950
7948
|
/**
|
|
@@ -10,15 +10,9 @@ import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs
|
|
|
10
10
|
import { useUnmountEffect } from '../../utils/use-unmount-effect.mjs';
|
|
11
11
|
|
|
12
12
|
var getChildKey = function (child) { return child.key || ""; };
|
|
13
|
-
var isDev = process.env.NODE_ENV !== "production";
|
|
14
13
|
function updateChildLookup(children, allChildren) {
|
|
15
|
-
var seenChildren = isDev ? new Set() : null;
|
|
16
14
|
children.forEach(function (child) {
|
|
17
15
|
var key = getChildKey(child);
|
|
18
|
-
if (isDev && seenChildren && seenChildren.has(key)) {
|
|
19
|
-
console.warn("Children of AnimatePresence require unique keys. \"".concat(key, "\" is a duplicate."));
|
|
20
|
-
seenChildren.add(key);
|
|
21
|
-
}
|
|
22
16
|
allChildren.set(key, child);
|
|
23
17
|
});
|
|
24
18
|
}
|
|
@@ -38,7 +38,7 @@ function MotionConfig(_a) {
|
|
|
38
38
|
* Creating a new config context object will re-render every `motion` component
|
|
39
39
|
* every time it renders. So we only want to create a new one sparingly.
|
|
40
40
|
*/
|
|
41
|
-
var context = useMemo(function () { return config; }, [JSON.stringify(config.transition), config.transformPagePoint]);
|
|
41
|
+
var context = useMemo(function () { return config; }, [JSON.stringify(config.transition), config.transformPagePoint, config.reducedMotion]);
|
|
42
42
|
return (React.createElement(MotionConfigContext.Provider, { value: context }, children));
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
|
|
3
3
|
function addDomEvent(target, eventName, handler, options) {
|
|
4
|
+
if (options === void 0) { options = { passive: true }; }
|
|
4
5
|
target.addEventListener(eventName, handler, options);
|
|
5
|
-
return function () { return target.removeEventListener(eventName, handler
|
|
6
|
+
return function () { return target.removeEventListener(eventName, handler); };
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* Attaches an event listener directly to the provided DOM element.
|
|
@@ -388,7 +388,7 @@ var VisualElementDragControls = /** @class */ (function () {
|
|
|
388
388
|
* constraints as the window resizes.
|
|
389
389
|
*/
|
|
390
390
|
var stopResizeListener = addDomEvent(window, "resize", function () {
|
|
391
|
-
_this.scalePositionWithinConstraints();
|
|
391
|
+
return _this.scalePositionWithinConstraints();
|
|
392
392
|
});
|
|
393
393
|
/**
|
|
394
394
|
* If the element's layout changes, calculate the delta and apply that to
|
|
@@ -19,10 +19,10 @@ function useHoverGesture(_a) {
|
|
|
19
19
|
var onHoverStart = _a.onHoverStart, onHoverEnd = _a.onHoverEnd, whileHover = _a.whileHover, visualElement = _a.visualElement;
|
|
20
20
|
usePointerEvent(visualElement, "pointerenter", onHoverStart || whileHover
|
|
21
21
|
? createHoverEvent(visualElement, true, onHoverStart)
|
|
22
|
-
: undefined);
|
|
22
|
+
: undefined, { passive: !onHoverStart });
|
|
23
23
|
usePointerEvent(visualElement, "pointerleave", onHoverEnd || whileHover
|
|
24
24
|
? createHoverEvent(visualElement, false, onHoverEnd)
|
|
25
|
-
: undefined);
|
|
25
|
+
: undefined, { passive: !onHoverEnd });
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export { useHoverGesture };
|
|
@@ -15,6 +15,12 @@ function useTapGesture(_a) {
|
|
|
15
15
|
var hasPressListeners = onTap || onTapStart || onTapCancel || whileTap;
|
|
16
16
|
var isPressing = useRef(false);
|
|
17
17
|
var cancelPointerEndListeners = useRef(null);
|
|
18
|
+
/**
|
|
19
|
+
* Only set listener to passive if there are no external listeners.
|
|
20
|
+
*/
|
|
21
|
+
var eventOptions = {
|
|
22
|
+
passive: !(onTapStart || onTap || onTapCancel || onPointerDown),
|
|
23
|
+
};
|
|
18
24
|
function removePointerEndListener() {
|
|
19
25
|
var _a;
|
|
20
26
|
(_a = cancelPointerEndListeners.current) === null || _a === void 0 ? void 0 : _a.call(cancelPointerEndListeners);
|
|
@@ -49,14 +55,14 @@ function useTapGesture(_a) {
|
|
|
49
55
|
if (isPressing.current)
|
|
50
56
|
return;
|
|
51
57
|
isPressing.current = true;
|
|
52
|
-
cancelPointerEndListeners.current = pipe(addPointerEvent(window, "pointerup", onPointerUp), addPointerEvent(window, "pointercancel", onPointerCancel));
|
|
58
|
+
cancelPointerEndListeners.current = pipe(addPointerEvent(window, "pointerup", onPointerUp, eventOptions), addPointerEvent(window, "pointercancel", onPointerCancel, eventOptions));
|
|
53
59
|
/**
|
|
54
60
|
* Ensure we trigger animations before firing event callback
|
|
55
61
|
*/
|
|
56
62
|
(_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Tap, true);
|
|
57
63
|
onTapStart === null || onTapStart === void 0 ? void 0 : onTapStart(event, info);
|
|
58
64
|
}
|
|
59
|
-
usePointerEvent(visualElement, "pointerdown", hasPressListeners ? onPointerDown : undefined);
|
|
65
|
+
usePointerEvent(visualElement, "pointerdown", hasPressListeners ? onPointerDown : undefined, eventOptions);
|
|
60
66
|
useUnmountEffect(removePointerEndListener);
|
|
61
67
|
}
|
|
62
68
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { createProjectionNode } from './create-projection-node.mjs';
|
|
2
|
+
import { addDomEvent } from '../../events/use-dom-event.mjs';
|
|
2
3
|
|
|
3
4
|
var DocumentProjectionNode = createProjectionNode({
|
|
4
|
-
attachResizeListener: function (ref, notify) {
|
|
5
|
-
ref.addEventListener("resize", notify, { passive: true });
|
|
6
|
-
return function () { return ref.removeEventListener("resize", notify); };
|
|
7
|
-
},
|
|
5
|
+
attachResizeListener: function (ref, notify) { return addDomEvent(ref, "resize", notify); },
|
|
8
6
|
measureScroll: function () { return ({
|
|
9
7
|
x: document.documentElement.scrollLeft || document.body.scrollLeft,
|
|
10
8
|
y: document.documentElement.scrollTop || document.body.scrollTop,
|
|
@@ -45,7 +45,7 @@ function useElementScroll(ref) {
|
|
|
45
45
|
if (!element)
|
|
46
46
|
return;
|
|
47
47
|
var updateScrollValues = createScrollUpdater(values, getElementScrollOffsets(element));
|
|
48
|
-
var scrollListener = addDomEvent(element, "scroll", updateScrollValues
|
|
48
|
+
var scrollListener = addDomEvent(element, "scroll", updateScrollValues);
|
|
49
49
|
var resizeListener = addDomEvent(element, "resize", updateScrollValues);
|
|
50
50
|
return function () {
|
|
51
51
|
scrollListener && scrollListener();
|
|
@@ -15,7 +15,7 @@ var hasListeners = false;
|
|
|
15
15
|
function addEventListeners() {
|
|
16
16
|
hasListeners = true;
|
|
17
17
|
var updateScrollValues = createScrollUpdater(viewportScrollValues, getViewportScrollOffsets);
|
|
18
|
-
addDomEvent(window, "scroll", updateScrollValues
|
|
18
|
+
addDomEvent(window, "scroll", updateScrollValues);
|
|
19
19
|
addDomEvent(window, "resize", updateScrollValues);
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
@@ -5109,8 +5109,9 @@
|
|
|
5109
5109
|
})(exports.AnimationType || (exports.AnimationType = {}));
|
|
5110
5110
|
|
|
5111
5111
|
function addDomEvent(target, eventName, handler, options) {
|
|
5112
|
+
if (options === void 0) { options = { passive: true }; }
|
|
5112
5113
|
target.addEventListener(eventName, handler, options);
|
|
5113
|
-
return function () { return target.removeEventListener(eventName, handler
|
|
5114
|
+
return function () { return target.removeEventListener(eventName, handler); };
|
|
5114
5115
|
}
|
|
5115
5116
|
/**
|
|
5116
5117
|
* Attaches an event listener directly to the provided DOM element.
|
|
@@ -5337,10 +5338,10 @@
|
|
|
5337
5338
|
var onHoverStart = _a.onHoverStart, onHoverEnd = _a.onHoverEnd, whileHover = _a.whileHover, visualElement = _a.visualElement;
|
|
5338
5339
|
usePointerEvent(visualElement, "pointerenter", onHoverStart || whileHover
|
|
5339
5340
|
? createHoverEvent(visualElement, true, onHoverStart)
|
|
5340
|
-
: undefined);
|
|
5341
|
+
: undefined, { passive: !onHoverStart });
|
|
5341
5342
|
usePointerEvent(visualElement, "pointerleave", onHoverEnd || whileHover
|
|
5342
5343
|
? createHoverEvent(visualElement, false, onHoverEnd)
|
|
5343
|
-
: undefined);
|
|
5344
|
+
: undefined, { passive: !onHoverEnd });
|
|
5344
5345
|
}
|
|
5345
5346
|
|
|
5346
5347
|
/**
|
|
@@ -5375,6 +5376,12 @@
|
|
|
5375
5376
|
var hasPressListeners = onTap || onTapStart || onTapCancel || whileTap;
|
|
5376
5377
|
var isPressing = React.useRef(false);
|
|
5377
5378
|
var cancelPointerEndListeners = React.useRef(null);
|
|
5379
|
+
/**
|
|
5380
|
+
* Only set listener to passive if there are no external listeners.
|
|
5381
|
+
*/
|
|
5382
|
+
var eventOptions = {
|
|
5383
|
+
passive: !(onTapStart || onTap || onTapCancel || onPointerDown),
|
|
5384
|
+
};
|
|
5378
5385
|
function removePointerEndListener() {
|
|
5379
5386
|
var _a;
|
|
5380
5387
|
(_a = cancelPointerEndListeners.current) === null || _a === void 0 ? void 0 : _a.call(cancelPointerEndListeners);
|
|
@@ -5409,14 +5416,14 @@
|
|
|
5409
5416
|
if (isPressing.current)
|
|
5410
5417
|
return;
|
|
5411
5418
|
isPressing.current = true;
|
|
5412
|
-
cancelPointerEndListeners.current = pipe(addPointerEvent(window, "pointerup", onPointerUp), addPointerEvent(window, "pointercancel", onPointerCancel));
|
|
5419
|
+
cancelPointerEndListeners.current = pipe(addPointerEvent(window, "pointerup", onPointerUp, eventOptions), addPointerEvent(window, "pointercancel", onPointerCancel, eventOptions));
|
|
5413
5420
|
/**
|
|
5414
5421
|
* Ensure we trigger animations before firing event callback
|
|
5415
5422
|
*/
|
|
5416
5423
|
(_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Tap, true);
|
|
5417
5424
|
onTapStart === null || onTapStart === void 0 ? void 0 : onTapStart(event, info);
|
|
5418
5425
|
}
|
|
5419
|
-
usePointerEvent(visualElement, "pointerdown", hasPressListeners ? onPointerDown : undefined);
|
|
5426
|
+
usePointerEvent(visualElement, "pointerdown", hasPressListeners ? onPointerDown : undefined, eventOptions);
|
|
5420
5427
|
useUnmountEffect(removePointerEndListener);
|
|
5421
5428
|
}
|
|
5422
5429
|
|
|
@@ -7008,7 +7015,7 @@
|
|
|
7008
7015
|
* constraints as the window resizes.
|
|
7009
7016
|
*/
|
|
7010
7017
|
var stopResizeListener = addDomEvent(window, "resize", function () {
|
|
7011
|
-
_this.scalePositionWithinConstraints();
|
|
7018
|
+
return _this.scalePositionWithinConstraints();
|
|
7012
7019
|
});
|
|
7013
7020
|
/**
|
|
7014
7021
|
* If the element's layout changes, calculate the delta and apply that to
|
|
@@ -8281,10 +8288,7 @@
|
|
|
8281
8288
|
};
|
|
8282
8289
|
|
|
8283
8290
|
var DocumentProjectionNode = createProjectionNode({
|
|
8284
|
-
attachResizeListener: function (ref, notify) {
|
|
8285
|
-
ref.addEventListener("resize", notify, { passive: true });
|
|
8286
|
-
return function () { return ref.removeEventListener("resize", notify); };
|
|
8287
|
-
},
|
|
8291
|
+
attachResizeListener: function (ref, notify) { return addDomEvent(ref, "resize", notify); },
|
|
8288
8292
|
measureScroll: function () { return ({
|
|
8289
8293
|
x: document.documentElement.scrollLeft || document.body.scrollLeft,
|
|
8290
8294
|
y: document.documentElement.scrollTop || document.body.scrollTop,
|
|
@@ -8429,13 +8433,8 @@
|
|
|
8429
8433
|
|
|
8430
8434
|
var getChildKey = function (child) { return child.key || ""; };
|
|
8431
8435
|
function updateChildLookup(children, allChildren) {
|
|
8432
|
-
var seenChildren = new Set() ;
|
|
8433
8436
|
children.forEach(function (child) {
|
|
8434
8437
|
var key = getChildKey(child);
|
|
8435
|
-
if (seenChildren && seenChildren.has(key)) {
|
|
8436
|
-
console.warn("Children of AnimatePresence require unique keys. \"".concat(key, "\" is a duplicate."));
|
|
8437
|
-
seenChildren.add(key);
|
|
8438
|
-
}
|
|
8439
8438
|
allChildren.set(key, child);
|
|
8440
8439
|
});
|
|
8441
8440
|
}
|
|
@@ -8677,7 +8676,7 @@
|
|
|
8677
8676
|
* Creating a new config context object will re-render every `motion` component
|
|
8678
8677
|
* every time it renders. So we only want to create a new one sparingly.
|
|
8679
8678
|
*/
|
|
8680
|
-
var context = React.useMemo(function () { return config; }, [JSON.stringify(config.transition), config.transformPagePoint]);
|
|
8679
|
+
var context = React.useMemo(function () { return config; }, [JSON.stringify(config.transition), config.transformPagePoint, config.reducedMotion]);
|
|
8681
8680
|
return (React__namespace.createElement(MotionConfigContext.Provider, { value: context }, children));
|
|
8682
8681
|
}
|
|
8683
8682
|
|
|
@@ -9144,7 +9143,7 @@
|
|
|
9144
9143
|
if (!element)
|
|
9145
9144
|
return;
|
|
9146
9145
|
var updateScrollValues = createScrollUpdater(values, getElementScrollOffsets(element));
|
|
9147
|
-
var scrollListener = addDomEvent(element, "scroll", updateScrollValues
|
|
9146
|
+
var scrollListener = addDomEvent(element, "scroll", updateScrollValues);
|
|
9148
9147
|
var resizeListener = addDomEvent(element, "resize", updateScrollValues);
|
|
9149
9148
|
return function () {
|
|
9150
9149
|
scrollListener && scrollListener();
|
|
@@ -9167,7 +9166,7 @@
|
|
|
9167
9166
|
function addEventListeners() {
|
|
9168
9167
|
hasListeners = true;
|
|
9169
9168
|
var updateScrollValues = createScrollUpdater(viewportScrollValues, getViewportScrollOffsets);
|
|
9170
|
-
addDomEvent(window, "scroll", updateScrollValues
|
|
9169
|
+
addDomEvent(window, "scroll", updateScrollValues);
|
|
9171
9170
|
addDomEvent(window, "resize", updateScrollValues);
|
|
9172
9171
|
}
|
|
9173
9172
|
/**
|