motion 11.11.17 → 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 -47
- package/README.md +16 -3
- package/dist/cjs/index.js +192 -116
- package/dist/cjs/mini.js +24 -28
- package/dist/cjs/react-client.js +146 -93
- package/dist/cjs/react-mini.js +24 -28
- 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 +3 -2
- package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +2 -2
- package/dist/es/framer-motion/dist/es/animation/animators/waapi/utils/linear.mjs +2 -3
- package/dist/es/framer-motion/dist/es/animation/generators/spring/defaults.mjs +27 -0
- package/dist/es/framer-motion/dist/es/animation/generators/spring/find.mjs +9 -12
- package/dist/es/framer-motion/dist/es/animation/generators/spring/index.mjs +53 -17
- 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 +192 -116
- 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
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
|
|
@@ -649,6 +708,34 @@
|
|
|
649
708
|
}
|
|
650
709
|
}
|
|
651
710
|
|
|
711
|
+
/*
|
|
712
|
+
Progress within given range
|
|
713
|
+
|
|
714
|
+
Given a lower limit and an upper limit, we return the progress
|
|
715
|
+
(expressed as a number 0-1) represented by the given value, and
|
|
716
|
+
limit that progress to within 0-1.
|
|
717
|
+
|
|
718
|
+
@param [number]: Lower limit
|
|
719
|
+
@param [number]: Upper limit
|
|
720
|
+
@param [number]: Value to find progress within given range
|
|
721
|
+
@return [number]: Progress of value within range as expressed 0-1
|
|
722
|
+
*/
|
|
723
|
+
const progress = (from, to, value) => {
|
|
724
|
+
const toFromDifference = to - from;
|
|
725
|
+
return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
const generateLinearEasing = (easing, duration, // as milliseconds
|
|
729
|
+
resolution = 10 // as milliseconds
|
|
730
|
+
) => {
|
|
731
|
+
let points = "";
|
|
732
|
+
const numPoints = Math.max(Math.round(duration / resolution), 2);
|
|
733
|
+
for (let i = 0; i < numPoints; i++) {
|
|
734
|
+
points += easing(progress(0, numPoints - 1, i)) + ", ";
|
|
735
|
+
}
|
|
736
|
+
return `linear(${points.substring(0, points.length - 2)})`;
|
|
737
|
+
};
|
|
738
|
+
|
|
652
739
|
/**
|
|
653
740
|
* Converts seconds to milliseconds
|
|
654
741
|
*
|
|
@@ -664,21 +751,6 @@
|
|
|
664
751
|
return velocityPerSecond(current - resolveValue(prevT), t - prevT);
|
|
665
752
|
}
|
|
666
753
|
|
|
667
|
-
exports.warning = noop;
|
|
668
|
-
exports.invariant = noop;
|
|
669
|
-
{
|
|
670
|
-
exports.warning = (check, message) => {
|
|
671
|
-
if (!check && typeof console !== "undefined") {
|
|
672
|
-
console.warn(message);
|
|
673
|
-
}
|
|
674
|
-
};
|
|
675
|
-
exports.invariant = (check, message) => {
|
|
676
|
-
if (!check) {
|
|
677
|
-
throw new Error(message);
|
|
678
|
-
}
|
|
679
|
-
};
|
|
680
|
-
}
|
|
681
|
-
|
|
682
754
|
const clamp = (min, max, v) => {
|
|
683
755
|
if (v > max)
|
|
684
756
|
return max;
|
|
@@ -687,21 +759,43 @@
|
|
|
687
759
|
return v;
|
|
688
760
|
};
|
|
689
761
|
|
|
762
|
+
const springDefaults = {
|
|
763
|
+
// Default spring physics
|
|
764
|
+
stiffness: 100,
|
|
765
|
+
damping: 10,
|
|
766
|
+
mass: 1.0,
|
|
767
|
+
velocity: 0.0,
|
|
768
|
+
// Default duration/bounce-based options
|
|
769
|
+
duration: 800, // in ms
|
|
770
|
+
bounce: 0.3,
|
|
771
|
+
visualDuration: 0.3, // in seconds
|
|
772
|
+
// Rest thresholds
|
|
773
|
+
restSpeed: {
|
|
774
|
+
granular: 0.01,
|
|
775
|
+
default: 2,
|
|
776
|
+
},
|
|
777
|
+
restDelta: {
|
|
778
|
+
granular: 0.005,
|
|
779
|
+
default: 0.5,
|
|
780
|
+
},
|
|
781
|
+
// Limits
|
|
782
|
+
minDuration: 0.01, // in seconds
|
|
783
|
+
maxDuration: 10.0, // in seconds
|
|
784
|
+
minDamping: 0.05,
|
|
785
|
+
maxDamping: 1,
|
|
786
|
+
};
|
|
787
|
+
|
|
690
788
|
const safeMin = 0.001;
|
|
691
|
-
|
|
692
|
-
const maxDuration$1 = 10.0;
|
|
693
|
-
const minDamping = 0.05;
|
|
694
|
-
const maxDamping = 1;
|
|
695
|
-
function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, }) {
|
|
789
|
+
function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {
|
|
696
790
|
let envelope;
|
|
697
791
|
let derivative;
|
|
698
|
-
exports.warning(duration <= secondsToMilliseconds(maxDuration
|
|
792
|
+
exports.warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less");
|
|
699
793
|
let dampingRatio = 1 - bounce;
|
|
700
794
|
/**
|
|
701
795
|
* Restrict dampingRatio and duration to within acceptable ranges.
|
|
702
796
|
*/
|
|
703
|
-
dampingRatio = clamp(minDamping, maxDamping, dampingRatio);
|
|
704
|
-
duration = clamp(minDuration, maxDuration
|
|
797
|
+
dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);
|
|
798
|
+
duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));
|
|
705
799
|
if (dampingRatio < 1) {
|
|
706
800
|
/**
|
|
707
801
|
* Underdamped spring
|
|
@@ -745,8 +839,8 @@
|
|
|
745
839
|
duration = secondsToMilliseconds(duration);
|
|
746
840
|
if (isNaN(undampedFreq)) {
|
|
747
841
|
return {
|
|
748
|
-
stiffness:
|
|
749
|
-
damping:
|
|
842
|
+
stiffness: springDefaults.stiffness,
|
|
843
|
+
damping: springDefaults.damping,
|
|
750
844
|
duration,
|
|
751
845
|
};
|
|
752
846
|
}
|
|
@@ -771,6 +865,22 @@
|
|
|
771
865
|
return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);
|
|
772
866
|
}
|
|
773
867
|
|
|
868
|
+
/**
|
|
869
|
+
* Implement a practical max duration for keyframe generation
|
|
870
|
+
* to prevent infinite loops
|
|
871
|
+
*/
|
|
872
|
+
const maxGeneratorDuration = 20000;
|
|
873
|
+
function calcGeneratorDuration(generator) {
|
|
874
|
+
let duration = 0;
|
|
875
|
+
const timeStep = 50;
|
|
876
|
+
let state = generator.next(duration);
|
|
877
|
+
while (!state.done && duration < maxGeneratorDuration) {
|
|
878
|
+
duration += timeStep;
|
|
879
|
+
state = generator.next(duration);
|
|
880
|
+
}
|
|
881
|
+
return duration >= maxGeneratorDuration ? Infinity : duration;
|
|
882
|
+
}
|
|
883
|
+
|
|
774
884
|
const durationKeys = ["duration", "bounce"];
|
|
775
885
|
const physicsKeys = ["stiffness", "damping", "mass"];
|
|
776
886
|
function isSpringType(options, keys) {
|
|
@@ -778,29 +888,51 @@
|
|
|
778
888
|
}
|
|
779
889
|
function getSpringOptions(options) {
|
|
780
890
|
let springOptions = {
|
|
781
|
-
velocity:
|
|
782
|
-
stiffness:
|
|
783
|
-
damping:
|
|
784
|
-
mass:
|
|
891
|
+
velocity: springDefaults.velocity,
|
|
892
|
+
stiffness: springDefaults.stiffness,
|
|
893
|
+
damping: springDefaults.damping,
|
|
894
|
+
mass: springDefaults.mass,
|
|
785
895
|
isResolvedFromDuration: false,
|
|
786
896
|
...options,
|
|
787
897
|
};
|
|
788
898
|
// stiffness/damping/mass overrides duration/bounce
|
|
789
899
|
if (!isSpringType(options, physicsKeys) &&
|
|
790
900
|
isSpringType(options, durationKeys)) {
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
901
|
+
if (options.visualDuration) {
|
|
902
|
+
const visualDuration = options.visualDuration;
|
|
903
|
+
const root = (2 * Math.PI) / (visualDuration * 1.2);
|
|
904
|
+
const stiffness = root * root;
|
|
905
|
+
const damping = 2 * clamp(0.05, 1, 1 - options.bounce) * Math.sqrt(stiffness);
|
|
906
|
+
springOptions = {
|
|
907
|
+
...springOptions,
|
|
908
|
+
mass: springDefaults.mass,
|
|
909
|
+
stiffness,
|
|
910
|
+
damping,
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
else {
|
|
914
|
+
const derived = findSpring(options);
|
|
915
|
+
springOptions = {
|
|
916
|
+
...springOptions,
|
|
917
|
+
...derived,
|
|
918
|
+
mass: springDefaults.mass,
|
|
919
|
+
};
|
|
920
|
+
springOptions.isResolvedFromDuration = true;
|
|
921
|
+
}
|
|
798
922
|
}
|
|
799
923
|
return springOptions;
|
|
800
924
|
}
|
|
801
|
-
function spring(
|
|
802
|
-
const
|
|
803
|
-
|
|
925
|
+
function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {
|
|
926
|
+
const options = typeof optionsOrVisualDuration !== "object"
|
|
927
|
+
? {
|
|
928
|
+
visualDuration: optionsOrVisualDuration,
|
|
929
|
+
keyframes: [0, 1],
|
|
930
|
+
bounce,
|
|
931
|
+
}
|
|
932
|
+
: optionsOrVisualDuration;
|
|
933
|
+
let { restSpeed, restDelta } = options;
|
|
934
|
+
const origin = options.keyframes[0];
|
|
935
|
+
const target = options.keyframes[options.keyframes.length - 1];
|
|
804
936
|
/**
|
|
805
937
|
* This is the Iterator-spec return value. We ensure it's mutable rather than using a generator
|
|
806
938
|
* to reduce GC during animation.
|
|
@@ -822,8 +954,12 @@
|
|
|
822
954
|
* ratio between feeling good and finishing as soon as changes are imperceptible.
|
|
823
955
|
*/
|
|
824
956
|
const isGranularScale = Math.abs(initialDelta) < 5;
|
|
825
|
-
restSpeed || (restSpeed = isGranularScale
|
|
826
|
-
|
|
957
|
+
restSpeed || (restSpeed = isGranularScale
|
|
958
|
+
? springDefaults.restSpeed.granular
|
|
959
|
+
: springDefaults.restSpeed.default);
|
|
960
|
+
restDelta || (restDelta = isGranularScale
|
|
961
|
+
? springDefaults.restDelta.granular
|
|
962
|
+
: springDefaults.restDelta.default);
|
|
827
963
|
let resolveSpring;
|
|
828
964
|
if (dampingRatio < 1) {
|
|
829
965
|
const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);
|
|
@@ -864,7 +1000,7 @@
|
|
|
864
1000
|
dampedAngularFreq);
|
|
865
1001
|
};
|
|
866
1002
|
}
|
|
867
|
-
|
|
1003
|
+
const generator = {
|
|
868
1004
|
calculatedDuration: isResolvedFromDuration ? duration || null : null,
|
|
869
1005
|
next: (t) => {
|
|
870
1006
|
const current = resolveSpring(t);
|
|
@@ -892,23 +1028,13 @@
|
|
|
892
1028
|
state.value = state.done ? target : current;
|
|
893
1029
|
return state;
|
|
894
1030
|
},
|
|
1031
|
+
toString: () => {
|
|
1032
|
+
const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);
|
|
1033
|
+
const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);
|
|
1034
|
+
return calculatedDuration + "ms " + easing;
|
|
1035
|
+
},
|
|
895
1036
|
};
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
/**
|
|
899
|
-
* Implement a practical max duration for keyframe generation
|
|
900
|
-
* to prevent infinite loops
|
|
901
|
-
*/
|
|
902
|
-
const maxGeneratorDuration = 20000;
|
|
903
|
-
function calcGeneratorDuration(generator) {
|
|
904
|
-
let duration = 0;
|
|
905
|
-
const timeStep = 50;
|
|
906
|
-
let state = generator.next(duration);
|
|
907
|
-
while (!state.done && duration < maxGeneratorDuration) {
|
|
908
|
-
duration += timeStep;
|
|
909
|
-
state = generator.next(duration);
|
|
910
|
-
}
|
|
911
|
-
return duration >= maxGeneratorDuration ? Infinity : duration;
|
|
1037
|
+
return generator;
|
|
912
1038
|
}
|
|
913
1039
|
|
|
914
1040
|
/**
|
|
@@ -949,23 +1075,6 @@
|
|
|
949
1075
|
return from + (to - from) * progress;
|
|
950
1076
|
};
|
|
951
1077
|
|
|
952
|
-
/*
|
|
953
|
-
Progress within given range
|
|
954
|
-
|
|
955
|
-
Given a lower limit and an upper limit, we return the progress
|
|
956
|
-
(expressed as a number 0-1) represented by the given value, and
|
|
957
|
-
limit that progress to within 0-1.
|
|
958
|
-
|
|
959
|
-
@param [number]: Lower limit
|
|
960
|
-
@param [number]: Upper limit
|
|
961
|
-
@param [number]: Value to find progress within given range
|
|
962
|
-
@return [number]: Progress of value within range as expressed 0-1
|
|
963
|
-
*/
|
|
964
|
-
const progress = (from, to, value) => {
|
|
965
|
-
const toFromDifference = to - from;
|
|
966
|
-
return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
|
|
967
|
-
};
|
|
968
|
-
|
|
969
1078
|
function fillOffset(offset, remaining) {
|
|
970
1079
|
const min = offset[offset.length - 1];
|
|
971
1080
|
for (let i = 1; i <= remaining; i++) {
|
|
@@ -982,31 +1091,6 @@
|
|
|
982
1091
|
|
|
983
1092
|
const isMotionValue = (value) => Boolean(value && value.getVelocity);
|
|
984
1093
|
|
|
985
|
-
function resolveElements(elements, scope, selectorCache) {
|
|
986
|
-
var _a;
|
|
987
|
-
if (typeof elements === "string") {
|
|
988
|
-
let root = document;
|
|
989
|
-
if (scope) {
|
|
990
|
-
exports.invariant(Boolean(scope.current), "Scope provided, but no element detected.");
|
|
991
|
-
root = scope.current;
|
|
992
|
-
}
|
|
993
|
-
if (selectorCache) {
|
|
994
|
-
(_a = selectorCache[elements]) !== null && _a !== void 0 ? _a : (selectorCache[elements] = root.querySelectorAll(elements));
|
|
995
|
-
elements = selectorCache[elements];
|
|
996
|
-
}
|
|
997
|
-
else {
|
|
998
|
-
elements = root.querySelectorAll(elements);
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
else if (elements instanceof Element) {
|
|
1002
|
-
elements = [elements];
|
|
1003
|
-
}
|
|
1004
|
-
/**
|
|
1005
|
-
* Return an empty array
|
|
1006
|
-
*/
|
|
1007
|
-
return Array.from(elements || []);
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
1094
|
function isDOMKeyframes(keyframes) {
|
|
1011
1095
|
return typeof keyframes === "object" && !Array.isArray(keyframes);
|
|
1012
1096
|
}
|
|
@@ -3324,18 +3408,6 @@
|
|
|
3324
3408
|
// "background-color"
|
|
3325
3409
|
]);
|
|
3326
3410
|
|
|
3327
|
-
// Create a linear easing point for every 10 ms
|
|
3328
|
-
const resolution = 10;
|
|
3329
|
-
const generateLinearEasing = (easing, duration // as milliseconds
|
|
3330
|
-
) => {
|
|
3331
|
-
let points = "";
|
|
3332
|
-
const numPoints = Math.max(Math.round(duration / resolution), 2);
|
|
3333
|
-
for (let i = 0; i < numPoints; i++) {
|
|
3334
|
-
points += easing(progress(0, numPoints - 1, i)) + ", ";
|
|
3335
|
-
}
|
|
3336
|
-
return `linear(${points.substring(0, points.length - 2)})`;
|
|
3337
|
-
};
|
|
3338
|
-
|
|
3339
3411
|
/**
|
|
3340
3412
|
* Add the ability for test suites to manually set support flags
|
|
3341
3413
|
* to better test more environments.
|
|
@@ -4105,7 +4177,7 @@
|
|
|
4105
4177
|
* and warn against mismatches.
|
|
4106
4178
|
*/
|
|
4107
4179
|
{
|
|
4108
|
-
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.`);
|
|
4109
4181
|
}
|
|
4110
4182
|
}
|
|
4111
4183
|
else if (isMotionValue(prevValue)) {
|
|
@@ -5253,6 +5325,7 @@
|
|
|
5253
5325
|
valueKeyframes = [valueKeyframes];
|
|
5254
5326
|
}
|
|
5255
5327
|
hydrateKeyframes(valueName, valueKeyframes, readInitialKeyframe);
|
|
5328
|
+
// TODO: Replace this with toString()?
|
|
5256
5329
|
if (isGenerator(options.type)) {
|
|
5257
5330
|
const generatorOptions = createGeneratorEasing(options, 100, options.type);
|
|
5258
5331
|
options.ease = supportsLinearEasing()
|
|
@@ -6125,6 +6198,7 @@
|
|
|
6125
6198
|
exports.frame = frame;
|
|
6126
6199
|
exports.frameData = frameData;
|
|
6127
6200
|
exports.frameSteps = frameSteps;
|
|
6201
|
+
exports.hover = hover;
|
|
6128
6202
|
exports.inView = inView;
|
|
6129
6203
|
exports.inertia = inertia;
|
|
6130
6204
|
exports.interpolate = interpolate;
|
|
@@ -6132,8 +6206,10 @@
|
|
|
6132
6206
|
exports.mirrorEasing = mirrorEasing;
|
|
6133
6207
|
exports.mix = mix;
|
|
6134
6208
|
exports.motionValue = motionValue;
|
|
6209
|
+
exports.noop = noop;
|
|
6135
6210
|
exports.pipe = pipe;
|
|
6136
6211
|
exports.progress = progress;
|
|
6212
|
+
exports.resolveElements = resolveElements;
|
|
6137
6213
|
exports.reverseEasing = reverseEasing;
|
|
6138
6214
|
exports.scroll = scroll;
|
|
6139
6215
|
exports.scrollInfo = scrollInfo;
|