motion 11.12.0 → 11.13.0-beta.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/.turbo/turbo-build.log +45 -45
- package/dist/cjs/index.js +66 -44
- package/dist/cjs/mini.js +21 -25
- package/dist/cjs/react-client.js +21 -21
- package/dist/cjs/react-mini.js +21 -25
- package/dist/es/dom/dist/es/gestures/hover.mjs +26 -0
- package/dist/es/dom/dist/es/utils/resolve-elements.mjs +22 -0
- package/dist/es/framer-motion/dist/es/animation/animate/resolve-subjects.mjs +1 -1
- package/dist/es/framer-motion/dist/es/animation/animate/subject.mjs +1 -1
- package/dist/es/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs +2 -1
- package/dist/es/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs +1 -1
- package/dist/es/framer-motion/dist/es/animation/animators/utils/can-animate.mjs +1 -1
- package/dist/es/framer-motion/dist/es/animation/animators/waapi/NativeAnimation.mjs +2 -2
- package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +2 -2
- package/dist/es/framer-motion/dist/es/animation/generators/spring/find.mjs +1 -1
- package/dist/es/framer-motion/dist/es/animation/hooks/animation-controls.mjs +1 -1
- package/dist/es/framer-motion/dist/es/animation/optimized-appear/start.mjs +2 -1
- package/dist/es/framer-motion/dist/es/components/AnimatePresence/index.mjs +1 -1
- package/dist/es/framer-motion/dist/es/components/AnimateSharedLayout.mjs +1 -1
- package/dist/es/framer-motion/dist/es/components/Reorder/Group.mjs +1 -1
- package/dist/es/framer-motion/dist/es/components/Reorder/Item.mjs +1 -1
- package/dist/es/framer-motion/dist/es/easing/cubic-bezier.mjs +2 -1
- package/dist/es/framer-motion/dist/es/easing/utils/map.mjs +2 -2
- package/dist/es/framer-motion/dist/es/events/event-info.mjs +3 -3
- package/dist/es/framer-motion/dist/es/frameloop/frame.mjs +2 -1
- package/dist/es/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs +2 -2
- package/dist/es/framer-motion/dist/es/gestures/drag/index.mjs +2 -1
- package/dist/es/framer-motion/dist/es/gestures/pan/index.mjs +2 -1
- package/dist/es/framer-motion/dist/es/gestures/press.mjs +2 -1
- package/dist/es/framer-motion/dist/es/motion/index.mjs +1 -1
- package/dist/es/framer-motion/dist/es/projection/animation/mix-values.mjs +2 -1
- package/dist/es/framer-motion/dist/es/projection/node/create-projection-node.mjs +2 -1
- package/dist/es/framer-motion/dist/es/render/dom/resize/handle-element.mjs +1 -1
- package/dist/es/framer-motion/dist/es/render/dom/scroll/index.mjs +2 -1
- package/dist/es/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs +1 -1
- package/dist/es/framer-motion/dist/es/render/dom/viewport/index.mjs +1 -1
- package/dist/es/framer-motion/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/framer-motion/dist/es/utils/interpolate.mjs +2 -2
- package/dist/es/framer-motion/dist/es/utils/mix/color.mjs +1 -1
- package/dist/es/framer-motion/dist/es/utils/mix/complex.mjs +1 -1
- package/dist/es/framer-motion/dist/es/value/index.mjs +1 -1
- package/dist/es/framer-motion/dist/es/value/use-inverted-scale.mjs +1 -1
- package/dist/es/framer-motion/dist/es/value/use-scroll.mjs +1 -1
- package/dist/es/motion/lib/index.mjs +4 -1
- package/dist/es/motion/lib/react.mjs +4 -1
- package/dist/motion.dev.js +66 -44
- package/dist/motion.js +1 -1
- package/package.json +3 -3
- package/dist/es/framer-motion/dist/es/render/dom/utils/resolve-element.mjs +0 -28
- /package/dist/es/{framer-motion/dist/es/utils → utils/dist/es}/errors.mjs +0 -0
- /package/dist/es/{framer-motion/dist/es/utils → utils/dist/es}/noop.mjs +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { invariant } from '
|
|
1
|
+
import { invariant } from '../../../../../utils/dist/es/errors.mjs';
|
|
2
|
+
import { noop } from '../../../../../utils/dist/es/noop.mjs';
|
|
2
3
|
import { cubicBezier } from '../cubic-bezier.mjs';
|
|
3
|
-
import { noop } from '../../utils/noop.mjs';
|
|
4
4
|
import { easeIn, easeInOut, easeOut } from '../ease.mjs';
|
|
5
5
|
import { circIn, circInOut, circOut } from '../circ.mjs';
|
|
6
6
|
import { backIn, backInOut, backOut } from '../back.mjs';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { isPrimaryPointer } from './utils/is-primary-pointer.mjs';
|
|
2
2
|
|
|
3
|
-
function extractEventInfo(event
|
|
3
|
+
function extractEventInfo(event) {
|
|
4
4
|
return {
|
|
5
5
|
point: {
|
|
6
|
-
x: event
|
|
7
|
-
y: event
|
|
6
|
+
x: event.pageX,
|
|
7
|
+
y: event.pageY,
|
|
8
8
|
},
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../../utils/dist/es/errors.mjs';
|
|
2
|
+
import { noop } from '../../../../utils/dist/es/noop.mjs';
|
|
2
3
|
import { createRenderBatcher } from './batcher.mjs';
|
|
3
4
|
|
|
4
5
|
const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { invariant } from '
|
|
1
|
+
import { invariant } from '../../../../../utils/dist/es/errors.mjs';
|
|
2
2
|
import { PanSession } from '../pan/PanSession.mjs';
|
|
3
3
|
import { getGlobalLock } from './utils/lock.mjs';
|
|
4
4
|
import { isRefObject } from '../../utils/is-ref-object.mjs';
|
|
@@ -56,7 +56,7 @@ class VisualElementDragControls {
|
|
|
56
56
|
// the component.
|
|
57
57
|
dragSnapToOrigin ? this.pauseAnimation() : this.stopAnimation();
|
|
58
58
|
if (snapToCursor) {
|
|
59
|
-
this.snapToCursor(extractEventInfo(event
|
|
59
|
+
this.snapToCursor(extractEventInfo(event).point);
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
const onStart = (event, info) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Feature } from '../../motion/features/Feature.mjs';
|
|
2
|
-
import
|
|
2
|
+
import '../../../../../utils/dist/es/errors.mjs';
|
|
3
|
+
import { noop } from '../../../../../utils/dist/es/noop.mjs';
|
|
3
4
|
import { VisualElementDragControls } from './VisualElementDragControls.mjs';
|
|
4
5
|
|
|
5
6
|
class DragGesture extends Feature {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { PanSession } from './PanSession.mjs';
|
|
2
2
|
import { addPointerEvent } from '../../events/add-pointer-event.mjs';
|
|
3
3
|
import { Feature } from '../../motion/features/Feature.mjs';
|
|
4
|
-
import
|
|
4
|
+
import '../../../../../utils/dist/es/errors.mjs';
|
|
5
|
+
import { noop } from '../../../../../utils/dist/es/noop.mjs';
|
|
5
6
|
import { getContextWindow } from '../../utils/get-context-window.mjs';
|
|
6
7
|
import { frame } from '../../frameloop/frame.mjs';
|
|
7
8
|
|
|
@@ -5,7 +5,8 @@ import { Feature } from '../motion/features/Feature.mjs';
|
|
|
5
5
|
import { pipe } from '../utils/pipe.mjs';
|
|
6
6
|
import { isDragActive } from './drag/utils/lock.mjs';
|
|
7
7
|
import { isNodeOrChild } from './utils/is-node-or-child.mjs';
|
|
8
|
-
import
|
|
8
|
+
import '../../../../utils/dist/es/errors.mjs';
|
|
9
|
+
import { noop } from '../../../../utils/dist/es/noop.mjs';
|
|
9
10
|
import { frame } from '../frameloop/frame.mjs';
|
|
10
11
|
|
|
11
12
|
function fireSyntheticPointerEvent(name, handler) {
|
|
@@ -11,7 +11,7 @@ import { isBrowser } from '../utils/is-browser.mjs';
|
|
|
11
11
|
import { LayoutGroupContext } from '../context/LayoutGroupContext.mjs';
|
|
12
12
|
import { LazyContext } from '../context/LazyContext.mjs';
|
|
13
13
|
import { motionComponentSymbol } from './utils/symbol.mjs';
|
|
14
|
-
import { warning, invariant } from '
|
|
14
|
+
import { warning, invariant } from '../../../../utils/dist/es/errors.mjs';
|
|
15
15
|
import { featureDefinitions } from './features/definitions.mjs';
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { circOut } from '../../easing/circ.mjs';
|
|
2
2
|
import { progress } from '../../utils/progress.mjs';
|
|
3
3
|
import { mixNumber } from '../../utils/mix/number.mjs';
|
|
4
|
-
import
|
|
4
|
+
import '../../../../../utils/dist/es/errors.mjs';
|
|
5
|
+
import { noop } from '../../../../../utils/dist/es/noop.mjs';
|
|
5
6
|
import { percent, px } from '../../value/types/numbers/units.mjs';
|
|
6
7
|
|
|
7
8
|
const borders = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"];
|
|
@@ -20,7 +20,8 @@ import { isSVGElement } from '../../render/dom/utils/is-svg-element.mjs';
|
|
|
20
20
|
import { animateSingleValue } from '../../animation/animate/single-value.mjs';
|
|
21
21
|
import { clamp } from '../../utils/clamp.mjs';
|
|
22
22
|
import { cancelFrame, frameData, frameSteps, frame } from '../../frameloop/frame.mjs';
|
|
23
|
-
import
|
|
23
|
+
import '../../../../../utils/dist/es/errors.mjs';
|
|
24
|
+
import { noop } from '../../../../../utils/dist/es/noop.mjs';
|
|
24
25
|
import { time } from '../../frameloop/sync-time.mjs';
|
|
25
26
|
import { microtask } from '../../frameloop/microtask.mjs';
|
|
26
27
|
import { getOptimisedAppearId } from '../../animation/optimized-appear/get-appear-id.mjs';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { scrollInfo } from './track.mjs';
|
|
2
2
|
import { observeTimeline } from './observe.mjs';
|
|
3
3
|
import { supportsScrollTimeline } from './supports.mjs';
|
|
4
|
-
import
|
|
4
|
+
import '../../../../../../utils/dist/es/errors.mjs';
|
|
5
|
+
import { noop } from '../../../../../../utils/dist/es/noop.mjs';
|
|
5
6
|
|
|
6
7
|
function scrollTimelineFallback({ source, container, axis = "y", }) {
|
|
7
8
|
// Support legacy source argument. Deprecate later.
|
|
@@ -17,7 +17,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
17
17
|
* and warn against mismatches.
|
|
18
18
|
*/
|
|
19
19
|
if (process.env.NODE_ENV === "development") {
|
|
20
|
-
warnOnce(nextValue.version === "11.
|
|
20
|
+
warnOnce(nextValue.version === "11.13.0-beta.0", `Attempting to mix Motion versions ${nextValue.version} with 11.13.0-beta.0 may not work as expected.`);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
else if (isMotionValue(prevValue)) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { invariant } from './errors.mjs';
|
|
2
1
|
import { clamp } from './clamp.mjs';
|
|
3
2
|
import { pipe } from './pipe.mjs';
|
|
4
3
|
import { progress } from './progress.mjs';
|
|
5
|
-
import {
|
|
4
|
+
import { invariant } from '../../../../utils/dist/es/errors.mjs';
|
|
5
|
+
import { noop } from '../../../../utils/dist/es/noop.mjs';
|
|
6
6
|
import { mix } from './mix/index.mjs';
|
|
7
7
|
|
|
8
8
|
function createMixers(output, ease, customMixer) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mixNumber } from './number.mjs';
|
|
2
|
-
import { warning } from '
|
|
2
|
+
import { warning } from '../../../../../utils/dist/es/errors.mjs';
|
|
3
3
|
import { hslaToRgba } from '../hsla-to-rgba.mjs';
|
|
4
4
|
import { hex } from '../../value/types/color/hex.mjs';
|
|
5
5
|
import { rgba } from '../../value/types/color/rgba.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mixNumber as mixNumber$1 } from './number.mjs';
|
|
2
2
|
import { mixColor } from './color.mjs';
|
|
3
3
|
import { pipe } from '../pipe.mjs';
|
|
4
|
-
import { warning } from '
|
|
4
|
+
import { warning } from '../../../../../utils/dist/es/errors.mjs';
|
|
5
5
|
import { color } from '../../value/types/color/index.mjs';
|
|
6
6
|
import { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';
|
|
7
7
|
import { isCSSVariableToken } from '../../render/dom/utils/is-css-variable.mjs';
|
|
@@ -34,7 +34,7 @@ class MotionValue {
|
|
|
34
34
|
* This will be replaced by the build step with the latest version number.
|
|
35
35
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
36
36
|
*/
|
|
37
|
-
this.version = "11.
|
|
37
|
+
this.version = "11.13.0-beta.0";
|
|
38
38
|
/**
|
|
39
39
|
* Tracks whether this value can output a velocity. Currently this is only true
|
|
40
40
|
* if the value is numerical, but we might be able to widen the scope here and support
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useTransform } from './use-transform.mjs';
|
|
2
|
-
import { invariant, warning } from '
|
|
2
|
+
import { invariant, warning } from '../../../../utils/dist/es/errors.mjs';
|
|
3
3
|
import { useMotionValue } from './use-motion-value.mjs';
|
|
4
4
|
import { MotionContext } from '../context/MotionContext/index.mjs';
|
|
5
5
|
import { useContext } from 'react';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { motionValue } from './index.mjs';
|
|
2
2
|
import { useConstant } from '../utils/use-constant.mjs';
|
|
3
3
|
import { useEffect } from 'react';
|
|
4
|
-
import { warning } from '
|
|
4
|
+
import { warning } from '../../../../utils/dist/es/errors.mjs';
|
|
5
5
|
import { scroll } from '../render/dom/scroll/index.mjs';
|
|
6
6
|
import { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs';
|
|
7
7
|
|
|
@@ -20,7 +20,6 @@ export { transform } from '../../framer-motion/dist/es/utils/transform.mjs';
|
|
|
20
20
|
export { clamp } from '../../framer-motion/dist/es/utils/clamp.mjs';
|
|
21
21
|
export { delayInSeconds as delay } from '../../framer-motion/dist/es/utils/delay.mjs';
|
|
22
22
|
export { distance, distance2D } from '../../framer-motion/dist/es/utils/distance.mjs';
|
|
23
|
-
export { invariant, warning } from '../../framer-motion/dist/es/utils/errors.mjs';
|
|
24
23
|
export { interpolate } from '../../framer-motion/dist/es/utils/interpolate.mjs';
|
|
25
24
|
export { mix } from '../../framer-motion/dist/es/utils/mix/index.mjs';
|
|
26
25
|
export { pipe } from '../../framer-motion/dist/es/utils/pipe.mjs';
|
|
@@ -28,3 +27,7 @@ export { progress } from '../../framer-motion/dist/es/utils/progress.mjs';
|
|
|
28
27
|
export { wrap } from '../../framer-motion/dist/es/utils/wrap.mjs';
|
|
29
28
|
export { cancelSync, sync } from '../../framer-motion/dist/es/frameloop/index-legacy.mjs';
|
|
30
29
|
export { cancelFrame, frame, frameData, frameSteps } from '../../framer-motion/dist/es/frameloop/frame.mjs';
|
|
30
|
+
export { invariant, warning } from '../../utils/dist/es/errors.mjs';
|
|
31
|
+
export { noop } from '../../utils/dist/es/noop.mjs';
|
|
32
|
+
export { hover } from '../../dom/dist/es/gestures/hover.mjs';
|
|
33
|
+
export { resolveElements } from '../../dom/dist/es/utils/resolve-elements.mjs';
|
|
@@ -90,7 +90,6 @@ export { steps } from '../../framer-motion/dist/es/easing/steps.mjs';
|
|
|
90
90
|
export { mirrorEasing } from '../../framer-motion/dist/es/easing/modifiers/mirror.mjs';
|
|
91
91
|
export { reverseEasing } from '../../framer-motion/dist/es/easing/modifiers/reverse.mjs';
|
|
92
92
|
export { distance, distance2D } from '../../framer-motion/dist/es/utils/distance.mjs';
|
|
93
|
-
export { invariant, warning } from '../../framer-motion/dist/es/utils/errors.mjs';
|
|
94
93
|
export { interpolate } from '../../framer-motion/dist/es/utils/interpolate.mjs';
|
|
95
94
|
export { cancelFrame, frame, frameData, frameSteps } from '../../framer-motion/dist/es/frameloop/frame.mjs';
|
|
96
95
|
export { animations } from '../../framer-motion/dist/es/motion/features/animations.mjs';
|
|
@@ -106,5 +105,9 @@ export { isBrowser } from '../../framer-motion/dist/es/utils/is-browser.mjs';
|
|
|
106
105
|
export { useUnmountEffect } from '../../framer-motion/dist/es/utils/use-unmount-effect.mjs';
|
|
107
106
|
export { useIsomorphicLayoutEffect } from '../../framer-motion/dist/es/utils/use-isomorphic-effect.mjs';
|
|
108
107
|
export { useForceUpdate } from '../../framer-motion/dist/es/utils/use-force-update.mjs';
|
|
108
|
+
export { invariant, warning } from '../../utils/dist/es/errors.mjs';
|
|
109
|
+
export { noop } from '../../utils/dist/es/noop.mjs';
|
|
110
|
+
export { hover } from '../../dom/dist/es/gestures/hover.mjs';
|
|
111
|
+
export { resolveElements } from '../../dom/dist/es/utils/resolve-elements.mjs';
|
|
109
112
|
import * as namespace from '../../framer-motion/dist/es/components/Reorder/namespace.mjs';
|
|
110
113
|
export { namespace as Reorder };
|
package/dist/motion.dev.js
CHANGED
|
@@ -4,6 +4,67 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Motion = {}));
|
|
5
5
|
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
|
+
const noop = (any) => any;
|
|
8
|
+
|
|
9
|
+
exports.warning = noop;
|
|
10
|
+
exports.invariant = noop;
|
|
11
|
+
{
|
|
12
|
+
exports.warning = (check, message) => {
|
|
13
|
+
if (!check && typeof console !== "undefined") {
|
|
14
|
+
console.warn(message);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
exports.invariant = (check, message) => {
|
|
18
|
+
if (!check) {
|
|
19
|
+
throw new Error(message);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function resolveElements(elementOrSelector, scope, selectorCache) {
|
|
25
|
+
var _a;
|
|
26
|
+
if (elementOrSelector instanceof Element) {
|
|
27
|
+
return [elementOrSelector];
|
|
28
|
+
}
|
|
29
|
+
else if (typeof elementOrSelector === "string") {
|
|
30
|
+
let root = document;
|
|
31
|
+
if (scope) {
|
|
32
|
+
// TODO: Refactor to utils package
|
|
33
|
+
// invariant(
|
|
34
|
+
// Boolean(scope.current),
|
|
35
|
+
// "Scope provided, but no element detected."
|
|
36
|
+
// )
|
|
37
|
+
root = scope.current;
|
|
38
|
+
}
|
|
39
|
+
const elements = (_a = selectorCache === null || selectorCache === void 0 ? void 0 : selectorCache[elementOrSelector]) !== null && _a !== void 0 ? _a : root.querySelectorAll(elementOrSelector);
|
|
40
|
+
return elements ? Array.from(elements) : [];
|
|
41
|
+
}
|
|
42
|
+
return Array.from(elementOrSelector);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function hover(elementOrSelector, onHoverStart) {
|
|
46
|
+
const elements = resolveElements(elementOrSelector);
|
|
47
|
+
const cancelGesture = new AbortController();
|
|
48
|
+
const options = { signal: cancelGesture.signal };
|
|
49
|
+
const onPointerEnter = (enterEvent) => {
|
|
50
|
+
if (enterEvent.pointerType === "touch")
|
|
51
|
+
return;
|
|
52
|
+
const { target } = enterEvent;
|
|
53
|
+
const onHoverEnd = onHoverStart(enterEvent);
|
|
54
|
+
if (onHoverEnd && target) {
|
|
55
|
+
const onPointerLeave = (leaveEvent) => {
|
|
56
|
+
onHoverEnd(leaveEvent);
|
|
57
|
+
target.removeEventListener("pointerleave", onPointerLeave);
|
|
58
|
+
};
|
|
59
|
+
target.addEventListener("pointerleave", onPointerLeave, options);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
elements.forEach((element) => {
|
|
63
|
+
element.addEventListener("pointerenter", onPointerEnter, options);
|
|
64
|
+
});
|
|
65
|
+
return () => cancelGesture.abort();
|
|
66
|
+
}
|
|
67
|
+
|
|
7
68
|
function addUniqueItem(arr, item) {
|
|
8
69
|
if (arr.indexOf(item) === -1)
|
|
9
70
|
arr.push(item);
|
|
@@ -76,8 +137,6 @@
|
|
|
76
137
|
useManualTiming: false,
|
|
77
138
|
};
|
|
78
139
|
|
|
79
|
-
const noop = (any) => any;
|
|
80
|
-
|
|
81
140
|
function createRenderStep(runNextFrame) {
|
|
82
141
|
/**
|
|
83
142
|
* We create and reuse two queues, one to queue jobs for the current frame
|
|
@@ -281,7 +340,7 @@
|
|
|
281
340
|
* This will be replaced by the build step with the latest version number.
|
|
282
341
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
283
342
|
*/
|
|
284
|
-
this.version = "11.
|
|
343
|
+
this.version = "11.13.0-beta.0";
|
|
285
344
|
/**
|
|
286
345
|
* Tracks whether this value can output a velocity. Currently this is only true
|
|
287
346
|
* if the value is numerical, but we might be able to widen the scope here and support
|
|
@@ -692,21 +751,6 @@
|
|
|
692
751
|
return velocityPerSecond(current - resolveValue(prevT), t - prevT);
|
|
693
752
|
}
|
|
694
753
|
|
|
695
|
-
exports.warning = noop;
|
|
696
|
-
exports.invariant = noop;
|
|
697
|
-
{
|
|
698
|
-
exports.warning = (check, message) => {
|
|
699
|
-
if (!check && typeof console !== "undefined") {
|
|
700
|
-
console.warn(message);
|
|
701
|
-
}
|
|
702
|
-
};
|
|
703
|
-
exports.invariant = (check, message) => {
|
|
704
|
-
if (!check) {
|
|
705
|
-
throw new Error(message);
|
|
706
|
-
}
|
|
707
|
-
};
|
|
708
|
-
}
|
|
709
|
-
|
|
710
754
|
const clamp = (min, max, v) => {
|
|
711
755
|
if (v > max)
|
|
712
756
|
return max;
|
|
@@ -1047,31 +1091,6 @@
|
|
|
1047
1091
|
|
|
1048
1092
|
const isMotionValue = (value) => Boolean(value && value.getVelocity);
|
|
1049
1093
|
|
|
1050
|
-
function resolveElements(elements, scope, selectorCache) {
|
|
1051
|
-
var _a;
|
|
1052
|
-
if (typeof elements === "string") {
|
|
1053
|
-
let root = document;
|
|
1054
|
-
if (scope) {
|
|
1055
|
-
exports.invariant(Boolean(scope.current), "Scope provided, but no element detected.");
|
|
1056
|
-
root = scope.current;
|
|
1057
|
-
}
|
|
1058
|
-
if (selectorCache) {
|
|
1059
|
-
(_a = selectorCache[elements]) !== null && _a !== void 0 ? _a : (selectorCache[elements] = root.querySelectorAll(elements));
|
|
1060
|
-
elements = selectorCache[elements];
|
|
1061
|
-
}
|
|
1062
|
-
else {
|
|
1063
|
-
elements = root.querySelectorAll(elements);
|
|
1064
|
-
}
|
|
1065
|
-
}
|
|
1066
|
-
else if (elements instanceof Element) {
|
|
1067
|
-
elements = [elements];
|
|
1068
|
-
}
|
|
1069
|
-
/**
|
|
1070
|
-
* Return an empty array
|
|
1071
|
-
*/
|
|
1072
|
-
return Array.from(elements || []);
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
1094
|
function isDOMKeyframes(keyframes) {
|
|
1076
1095
|
return typeof keyframes === "object" && !Array.isArray(keyframes);
|
|
1077
1096
|
}
|
|
@@ -4158,7 +4177,7 @@
|
|
|
4158
4177
|
* and warn against mismatches.
|
|
4159
4178
|
*/
|
|
4160
4179
|
{
|
|
4161
|
-
warnOnce(nextValue.version === "11.
|
|
4180
|
+
warnOnce(nextValue.version === "11.13.0-beta.0", `Attempting to mix Motion versions ${nextValue.version} with 11.13.0-beta.0 may not work as expected.`);
|
|
4162
4181
|
}
|
|
4163
4182
|
}
|
|
4164
4183
|
else if (isMotionValue(prevValue)) {
|
|
@@ -6179,6 +6198,7 @@
|
|
|
6179
6198
|
exports.frame = frame;
|
|
6180
6199
|
exports.frameData = frameData;
|
|
6181
6200
|
exports.frameSteps = frameSteps;
|
|
6201
|
+
exports.hover = hover;
|
|
6182
6202
|
exports.inView = inView;
|
|
6183
6203
|
exports.inertia = inertia;
|
|
6184
6204
|
exports.interpolate = interpolate;
|
|
@@ -6186,8 +6206,10 @@
|
|
|
6186
6206
|
exports.mirrorEasing = mirrorEasing;
|
|
6187
6207
|
exports.mix = mix;
|
|
6188
6208
|
exports.motionValue = motionValue;
|
|
6209
|
+
exports.noop = noop;
|
|
6189
6210
|
exports.pipe = pipe;
|
|
6190
6211
|
exports.progress = progress;
|
|
6212
|
+
exports.resolveElements = resolveElements;
|
|
6191
6213
|
exports.reverseEasing = reverseEasing;
|
|
6192
6214
|
exports.scroll = scroll;
|
|
6193
6215
|
exports.scrollInfo = scrollInfo;
|