motion 11.16.3 → 11.16.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 +664 -663
- package/dist/cjs/mini.js +1 -1
- package/dist/cjs/react-client.js +531 -529
- package/dist/cjs/react-m.js +6 -6
- package/dist/cjs/react-mini.js +1 -1
- package/dist/es/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +2 -2
- package/dist/es/framer-motion/dist/es/animation/optimized-appear/store-id.mjs +1 -1
- package/dist/es/framer-motion/dist/es/animation/utils/default-transitions.mjs +1 -1
- package/dist/es/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs +1 -1
- package/dist/es/framer-motion/dist/es/render/VisualElement.mjs +12 -12
- package/dist/es/framer-motion/dist/es/render/dom/DOMKeyframesResolver.mjs +4 -3
- package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs +6 -5
- package/dist/es/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs +2 -14
- package/dist/es/framer-motion/dist/es/render/html/HTMLVisualElement.mjs +6 -6
- package/dist/es/framer-motion/dist/es/render/html/utils/build-styles.mjs +2 -2
- package/dist/es/framer-motion/dist/es/render/html/utils/build-transform.mjs +1 -1
- package/dist/es/framer-motion/dist/es/render/html/utils/keys-position.mjs +13 -0
- package/dist/es/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +6 -6
- package/dist/es/framer-motion/dist/es/render/svg/utils/scrape-motion-values.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 +4 -1
- package/dist/es/framer-motion/dist/es/value/index.mjs +1 -1
- package/dist/es/framer-motion/dist/es/value/use-will-change/get-will-change-name.mjs +1 -1
- package/dist/es/motion-dom/dist/es/animation/controls/BaseGroup.mjs +1 -1
- package/dist/es/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs +2 -1
- package/dist/motion.dev.js +664 -663
- package/dist/motion.js +1 -1
- package/package.json +3 -3
- /package/dist/es/framer-motion/dist/es/render/html/utils/{transform.mjs → keys-transform.mjs} +0 -0
package/dist/cjs/react-m.js
CHANGED
|
@@ -650,8 +650,6 @@ function renderSVG(element, renderState, _styleProp, projection) {
|
|
|
650
650
|
|
|
651
651
|
const isMotionValue = (value) => Boolean(value && value.getVelocity);
|
|
652
652
|
|
|
653
|
-
const scaleCorrectors = {};
|
|
654
|
-
|
|
655
653
|
/**
|
|
656
654
|
* Generate a list of every possible transform key.
|
|
657
655
|
*/
|
|
@@ -679,6 +677,8 @@ const transformPropOrder = [
|
|
|
679
677
|
*/
|
|
680
678
|
const transformProps = new Set(transformPropOrder);
|
|
681
679
|
|
|
680
|
+
const scaleCorrectors = {};
|
|
681
|
+
|
|
682
682
|
function isForcedMotionValue(key, { layout, layoutId }) {
|
|
683
683
|
return (transformProps.has(key) ||
|
|
684
684
|
key.startsWith("origin") ||
|
|
@@ -866,6 +866,10 @@ const createSvgRenderState = () => ({
|
|
|
866
866
|
attrs: {},
|
|
867
867
|
});
|
|
868
868
|
|
|
869
|
+
const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token);
|
|
870
|
+
const isCSSVariableName =
|
|
871
|
+
/*@__PURE__*/ checkStringStartsWith("--");
|
|
872
|
+
|
|
869
873
|
/**
|
|
870
874
|
* Provided a value and a ValueType, returns the value as that value type.
|
|
871
875
|
*/
|
|
@@ -1049,10 +1053,6 @@ function buildTransform(latestValues, transform, transformTemplate) {
|
|
|
1049
1053
|
return transformString;
|
|
1050
1054
|
}
|
|
1051
1055
|
|
|
1052
|
-
const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token);
|
|
1053
|
-
const isCSSVariableName =
|
|
1054
|
-
/*@__PURE__*/ checkStringStartsWith("--");
|
|
1055
|
-
|
|
1056
1056
|
function buildHTMLStyles(state, latestValues, transformTemplate) {
|
|
1057
1057
|
const { style, vars, transformOrigin } = state;
|
|
1058
1058
|
// Track whether we encounter any transform or transformOrigin values.
|
package/dist/cjs/react-mini.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
2
|
import { getValueTransition } from '../../../../../motion-dom/dist/es/animation/utils/get-value-transition.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { positionalKeys } from '../../render/html/utils/keys-position.mjs';
|
|
4
4
|
import { setTarget } from '../../render/utils/setters.mjs';
|
|
5
5
|
import { addValueToWillChange } from '../../value/use-will-change/add-will-change.mjs';
|
|
6
6
|
import { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';
|
|
@@ -55,7 +55,7 @@ function animateTarget(visualElement, targetAndTransition, { delay = 0, transiti
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
addValueToWillChange(visualElement, key);
|
|
58
|
-
value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion &&
|
|
58
|
+
value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && positionalKeys.has(key)
|
|
59
59
|
? { type: false }
|
|
60
60
|
: valueTransition, visualElement, isHandoff));
|
|
61
61
|
const animation = value.animation;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { transformProps } from '../../render/html/utils/transform.mjs';
|
|
1
|
+
import { transformProps } from '../../render/html/utils/keys-transform.mjs';
|
|
2
2
|
|
|
3
3
|
const appearStoreId = (elementId, valueName) => {
|
|
4
4
|
const key = transformProps.has(valueName) ? "transform" : valueName;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';
|
|
2
|
-
import { transformProps } from '../../render/html/utils/transform.mjs';
|
|
2
|
+
import { transformProps } from '../../render/html/utils/keys-transform.mjs';
|
|
3
3
|
|
|
4
4
|
function isForcedMotionValue(key, { layout, layoutId }) {
|
|
5
5
|
return (transformProps.has(key) ||
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
+
import { time } from '../frameloop/sync-time.mjs';
|
|
2
|
+
import { featureDefinitions } from '../motion/features/definitions.mjs';
|
|
3
|
+
import { createBox } from '../projection/geometry/models.mjs';
|
|
4
|
+
import { isNumericalString } from '../utils/is-numerical-string.mjs';
|
|
5
|
+
import { isZeroValueString } from '../utils/is-zero-value-string.mjs';
|
|
1
6
|
import { initPrefersReducedMotion } from '../utils/reduced-motion/index.mjs';
|
|
2
7
|
import { hasReducedMotionListener, prefersReducedMotion } from '../utils/reduced-motion/state.mjs';
|
|
3
8
|
import { SubscriptionManager } from '../utils/subscription-manager.mjs';
|
|
9
|
+
import { warnOnce } from '../utils/warn-once.mjs';
|
|
4
10
|
import { motionValue } from '../value/index.mjs';
|
|
11
|
+
import { complex } from '../value/types/complex/index.mjs';
|
|
5
12
|
import { isMotionValue } from '../value/utils/is-motion-value.mjs';
|
|
6
|
-
import {
|
|
13
|
+
import { getAnimatableNone } from './dom/value-types/animatable-none.mjs';
|
|
14
|
+
import { findValueType } from './dom/value-types/find.mjs';
|
|
15
|
+
import { transformProps } from './html/utils/keys-transform.mjs';
|
|
16
|
+
import { visualElementStore } from './store.mjs';
|
|
7
17
|
import { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';
|
|
18
|
+
import { KeyframeResolver } from './utils/KeyframesResolver.mjs';
|
|
8
19
|
import { updateMotionValuesFromProps } from './utils/motion-values.mjs';
|
|
9
20
|
import { resolveVariantFromProps } from './utils/resolve-variants.mjs';
|
|
10
|
-
import { warnOnce } from '../utils/warn-once.mjs';
|
|
11
|
-
import { featureDefinitions } from '../motion/features/definitions.mjs';
|
|
12
|
-
import { visualElementStore } from './store.mjs';
|
|
13
|
-
import { KeyframeResolver } from './utils/KeyframesResolver.mjs';
|
|
14
|
-
import { isNumericalString } from '../utils/is-numerical-string.mjs';
|
|
15
|
-
import { isZeroValueString } from '../utils/is-zero-value-string.mjs';
|
|
16
|
-
import { findValueType } from './dom/value-types/find.mjs';
|
|
17
|
-
import { complex } from '../value/types/complex/index.mjs';
|
|
18
|
-
import { getAnimatableNone } from './dom/value-types/animatable-none.mjs';
|
|
19
|
-
import { createBox } from '../projection/geometry/models.mjs';
|
|
20
|
-
import { time } from '../frameloop/sync-time.mjs';
|
|
21
21
|
import { frame, cancelFrame } from '../frameloop/frame.mjs';
|
|
22
22
|
|
|
23
23
|
const propEventHandlers = [
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { isNone } from '../../animation/utils/is-none.mjs';
|
|
2
|
+
import { positionalKeys } from '../html/utils/keys-position.mjs';
|
|
3
|
+
import { makeNoneKeyframesAnimatable } from '../html/utils/make-none-animatable.mjs';
|
|
4
|
+
import { KeyframeResolver } from '../utils/KeyframesResolver.mjs';
|
|
2
5
|
import { getVariableValue } from './utils/css-variables-conversion.mjs';
|
|
3
6
|
import { isCSSVariableToken } from './utils/is-css-variable.mjs';
|
|
4
|
-
import {
|
|
7
|
+
import { isNumOrPxType, positionalValues } from './utils/unit-conversion.mjs';
|
|
5
8
|
import { findDimensionValueType } from './value-types/dimensions.mjs';
|
|
6
|
-
import { KeyframeResolver } from '../utils/KeyframesResolver.mjs';
|
|
7
|
-
import { makeNoneKeyframesAnimatable } from '../html/utils/make-none-animatable.mjs';
|
|
8
9
|
|
|
9
10
|
class DOMKeyframesResolver extends KeyframeResolver {
|
|
10
11
|
constructor(unresolvedKeyframes, onComplete, name, motionValue, element) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ScrollOffset } from './presets.mjs';
|
|
3
|
-
import { resolveOffset } from './offset.mjs';
|
|
1
|
+
import { clamp } from '../../../../utils/clamp.mjs';
|
|
4
2
|
import { interpolate } from '../../../../utils/interpolate.mjs';
|
|
5
3
|
import { defaultOffset } from '../../../../utils/offsets/default.mjs';
|
|
4
|
+
import { calcInset } from './inset.mjs';
|
|
5
|
+
import { resolveOffset } from './offset.mjs';
|
|
6
|
+
import { ScrollOffset } from './presets.mjs';
|
|
6
7
|
|
|
7
8
|
const point = { x: 0, y: 0 };
|
|
8
9
|
function getTargetSize(target) {
|
|
@@ -50,10 +51,10 @@ function resolveOffsets(container, info, options) {
|
|
|
50
51
|
* to map scroll value into a progress.
|
|
51
52
|
*/
|
|
52
53
|
if (hasChanged) {
|
|
53
|
-
info[axis].interpolate = interpolate(info[axis].offset, defaultOffset(offsetDefinition));
|
|
54
|
+
info[axis].interpolate = interpolate(info[axis].offset, defaultOffset(offsetDefinition), { clamp: false });
|
|
54
55
|
info[axis].interpolatorOffsets = [...info[axis].offset];
|
|
55
56
|
}
|
|
56
|
-
info[axis].progress = info[axis].interpolate(info[axis].current);
|
|
57
|
+
info[axis].progress = clamp(0, 1, info[axis].interpolate(info[axis].current));
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
export { resolveOffsets };
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
import { transformPropOrder } from '../../html/utils/transform.mjs';
|
|
2
1
|
import { number } from '../../../value/types/numbers/index.mjs';
|
|
3
2
|
import { px } from '../../../value/types/numbers/units.mjs';
|
|
3
|
+
import { transformPropOrder } from '../../html/utils/keys-transform.mjs';
|
|
4
4
|
|
|
5
|
-
const positionalKeys = new Set([
|
|
6
|
-
"width",
|
|
7
|
-
"height",
|
|
8
|
-
"top",
|
|
9
|
-
"left",
|
|
10
|
-
"right",
|
|
11
|
-
"bottom",
|
|
12
|
-
"x",
|
|
13
|
-
"y",
|
|
14
|
-
"translateX",
|
|
15
|
-
"translateY",
|
|
16
|
-
]);
|
|
17
5
|
const isNumOrPxType = (v) => v === number || v === px;
|
|
18
6
|
const getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(", ")[pos]);
|
|
19
7
|
const getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform }) => {
|
|
@@ -62,4 +50,4 @@ const positionalValues = {
|
|
|
62
50
|
positionalValues.translateX = positionalValues.x;
|
|
63
51
|
positionalValues.translateY = positionalValues.y;
|
|
64
52
|
|
|
65
|
-
export { isNumOrPxType,
|
|
53
|
+
export { isNumOrPxType, positionalValues, removeNonTranslationalTransform };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { buildHTMLStyles } from './utils/build-styles.mjs';
|
|
2
|
-
import { isCSSVariableName } from '../dom/utils/is-css-variable.mjs';
|
|
3
|
-
import { transformProps } from './utils/transform.mjs';
|
|
4
|
-
import { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';
|
|
5
|
-
import { renderHTML } from './utils/render.mjs';
|
|
6
|
-
import { getDefaultValueType } from '../dom/value-types/defaults.mjs';
|
|
7
1
|
import { measureViewportBox } from '../../projection/utils/measure.mjs';
|
|
8
2
|
import { DOMVisualElement } from '../dom/DOMVisualElement.mjs';
|
|
3
|
+
import { isCSSVariableName } from '../dom/utils/is-css-variable.mjs';
|
|
4
|
+
import { getDefaultValueType } from '../dom/value-types/defaults.mjs';
|
|
5
|
+
import { buildHTMLStyles } from './utils/build-styles.mjs';
|
|
6
|
+
import { transformProps } from './utils/keys-transform.mjs';
|
|
7
|
+
import { renderHTML } from './utils/render.mjs';
|
|
8
|
+
import { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';
|
|
9
9
|
|
|
10
10
|
function getComputedStyle(element) {
|
|
11
11
|
return window.getComputedStyle(element);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { buildTransform } from './build-transform.mjs';
|
|
2
1
|
import { isCSSVariableName } from '../../dom/utils/is-css-variable.mjs';
|
|
3
|
-
import { transformProps } from './transform.mjs';
|
|
4
2
|
import { getValueAsType } from '../../dom/value-types/get-as-type.mjs';
|
|
5
3
|
import { numberValueTypes } from '../../dom/value-types/number.mjs';
|
|
4
|
+
import { buildTransform } from './build-transform.mjs';
|
|
5
|
+
import { transformProps } from './keys-transform.mjs';
|
|
6
6
|
|
|
7
7
|
function buildHTMLStyles(state, latestValues, transformTemplate) {
|
|
8
8
|
const { style, vars, transformOrigin } = state;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { transformPropOrder } from './transform.mjs';
|
|
2
1
|
import { getValueAsType } from '../../dom/value-types/get-as-type.mjs';
|
|
3
2
|
import { numberValueTypes } from '../../dom/value-types/number.mjs';
|
|
3
|
+
import { transformPropOrder } from './keys-transform.mjs';
|
|
4
4
|
|
|
5
5
|
const translateAlias = {
|
|
6
6
|
x: "translateX",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createBox } from '../../projection/geometry/models.mjs';
|
|
2
2
|
import { DOMVisualElement } from '../dom/DOMVisualElement.mjs';
|
|
3
|
-
import { buildSVGAttrs } from './utils/build-attrs.mjs';
|
|
4
3
|
import { camelToDash } from '../dom/utils/camel-to-dash.mjs';
|
|
5
|
-
import { camelCaseAttributes } from './utils/camel-case-attrs.mjs';
|
|
6
|
-
import { transformProps } from '../html/utils/transform.mjs';
|
|
7
|
-
import { renderSVG } from './utils/render.mjs';
|
|
8
4
|
import { getDefaultValueType } from '../dom/value-types/defaults.mjs';
|
|
9
|
-
import {
|
|
5
|
+
import { transformProps } from '../html/utils/keys-transform.mjs';
|
|
6
|
+
import { buildSVGAttrs } from './utils/build-attrs.mjs';
|
|
7
|
+
import { camelCaseAttributes } from './utils/camel-case-attrs.mjs';
|
|
10
8
|
import { isSVGTag } from './utils/is-svg-tag.mjs';
|
|
9
|
+
import { renderSVG } from './utils/render.mjs';
|
|
10
|
+
import { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';
|
|
11
11
|
|
|
12
12
|
class SVGVisualElement extends DOMVisualElement {
|
|
13
13
|
constructor() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';
|
|
2
|
+
import { transformPropOrder } from '../../html/utils/keys-transform.mjs';
|
|
2
3
|
import { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';
|
|
3
|
-
import { transformPropOrder } from '../../html/utils/transform.mjs';
|
|
4
4
|
|
|
5
5
|
function scrapeMotionValuesFromProps(props, prevProps, visualElement) {
|
|
6
6
|
const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);
|
|
@@ -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.16.
|
|
20
|
+
warnOnce(nextValue.version === "11.16.6", `Attempting to mix Motion versions ${nextValue.version} with 11.16.6 may not work as expected.`);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
else if (isMotionValue(prevValue)) {
|
|
@@ -47,8 +47,9 @@ function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {})
|
|
|
47
47
|
*/
|
|
48
48
|
if (inputLength === 1)
|
|
49
49
|
return () => output[0];
|
|
50
|
-
if (inputLength === 2 &&
|
|
50
|
+
if (inputLength === 2 && output[0] === output[1])
|
|
51
51
|
return () => output[1];
|
|
52
|
+
const isZeroDeltaRange = input[0] === input[1];
|
|
52
53
|
// If input runs highest -> lowest, reverse both arrays
|
|
53
54
|
if (input[0] > input[inputLength - 1]) {
|
|
54
55
|
input = [...input].reverse();
|
|
@@ -57,6 +58,8 @@ function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {})
|
|
|
57
58
|
const mixers = createMixers(output, ease, mixer);
|
|
58
59
|
const numMixers = mixers.length;
|
|
59
60
|
const interpolator = (v) => {
|
|
61
|
+
if (isZeroDeltaRange && v < input[0])
|
|
62
|
+
return output[0];
|
|
60
63
|
let i = 0;
|
|
61
64
|
if (numMixers > 1) {
|
|
62
65
|
for (; i < input.length - 2; i++) {
|
|
@@ -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.16.
|
|
37
|
+
this.version = "11.16.6";
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import { acceleratedValues } from '../../animation/animators/utils/accelerated-values.mjs';
|
|
2
2
|
import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';
|
|
3
|
-
import { transformProps } from '../../render/html/utils/transform.mjs';
|
|
3
|
+
import { transformProps } from '../../render/html/utils/keys-transform.mjs';
|
|
4
4
|
|
|
5
5
|
function getWillChangeName(name) {
|
|
6
6
|
if (transformProps.has(name)) {
|
|
@@ -6,7 +6,8 @@ const focusableElements = new Set([
|
|
|
6
6
|
"A",
|
|
7
7
|
]);
|
|
8
8
|
function isElementKeyboardAccessible(element) {
|
|
9
|
-
return focusableElements.has(element.tagName) ||
|
|
9
|
+
return (focusableElements.has(element.tagName) ||
|
|
10
|
+
element.tabIndex !== -1);
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export { isElementKeyboardAccessible };
|