framer-motion 12.24.0 → 12.24.2
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/client.js +1 -1
- package/dist/cjs/dom.js +15 -0
- package/dist/cjs/dom.js.map +1 -1
- package/dist/cjs/{feature-bundle-DhbxBqkJ.js → feature-bundle-DBjkFz2c.js} +24 -2
- package/dist/cjs/feature-bundle-DBjkFz2c.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/m.js +15 -0
- package/dist/cjs/m.js.map +1 -1
- package/dist/dom.js +1 -1
- package/dist/es/components/Reorder/Item.mjs.map +1 -1
- package/dist/es/gestures/drag/VisualElementDragControls.mjs +8 -1
- package/dist/es/gestures/drag/VisualElementDragControls.mjs.map +1 -1
- package/dist/es/render/svg/utils/build-attrs.mjs +15 -0
- package/dist/es/render/svg/utils/build-attrs.mjs.map +1 -1
- package/dist/framer-motion.dev.js +23 -1
- package/dist/framer-motion.js +1 -1
- package/dist/size-rollup-animate.js +1 -1
- package/dist/size-rollup-animate.js.map +1 -1
- package/dist/size-rollup-dom-animation-assets.js +1 -1
- package/dist/size-rollup-dom-max-assets.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-m.js +1 -1
- package/dist/size-rollup-m.js.map +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/size-rollup-motion.js.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/package.json +2 -2
- package/dist/cjs/feature-bundle-DhbxBqkJ.js.map +0 -1
|
@@ -3672,6 +3672,15 @@ function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true
|
|
|
3672
3672
|
attrs[keys.array] = `${pathLength} ${pathSpacing}`;
|
|
3673
3673
|
}
|
|
3674
3674
|
|
|
3675
|
+
/**
|
|
3676
|
+
* CSS Motion Path properties that should remain as CSS styles on SVG elements.
|
|
3677
|
+
*/
|
|
3678
|
+
const cssMotionPathProperties = [
|
|
3679
|
+
"offsetDistance",
|
|
3680
|
+
"offsetPath",
|
|
3681
|
+
"offsetRotate",
|
|
3682
|
+
"offsetAnchor",
|
|
3683
|
+
];
|
|
3675
3684
|
/**
|
|
3676
3685
|
* Build SVG visual attributes, like cx and style.transform
|
|
3677
3686
|
*/
|
|
@@ -3712,6 +3721,12 @@ function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing
|
|
|
3712
3721
|
style.transformBox = styleProp?.transformBox ?? "fill-box";
|
|
3713
3722
|
delete attrs.transformBox;
|
|
3714
3723
|
}
|
|
3724
|
+
for (const key of cssMotionPathProperties) {
|
|
3725
|
+
if (attrs[key] !== undefined) {
|
|
3726
|
+
style[key] = attrs[key];
|
|
3727
|
+
delete attrs[key];
|
|
3728
|
+
}
|
|
3729
|
+
}
|
|
3715
3730
|
// Render attrX/attrY/attrScale as attributes
|
|
3716
3731
|
if (attrX !== undefined)
|
|
3717
3732
|
attrs.x = attrX;
|
|
@@ -5672,7 +5687,14 @@ class VisualElementDragControls {
|
|
|
5672
5687
|
const axisValue = this.getAxisMotionValue(axis);
|
|
5673
5688
|
if (projection && projection.layout) {
|
|
5674
5689
|
const { min, max } = projection.layout.layoutBox[axis];
|
|
5675
|
-
|
|
5690
|
+
/**
|
|
5691
|
+
* The layout measurement includes the current transform value,
|
|
5692
|
+
* so we need to add it back to get the correct snap position.
|
|
5693
|
+
* This fixes an issue where elements with initial coordinates
|
|
5694
|
+
* would snap to the wrong position on the first drag.
|
|
5695
|
+
*/
|
|
5696
|
+
const current = axisValue.get() || 0;
|
|
5697
|
+
axisValue.set(point[axis] - motionDom.mixNumber(min, max, 0.5) + current);
|
|
5676
5698
|
}
|
|
5677
5699
|
});
|
|
5678
5700
|
}
|
|
@@ -6303,4 +6325,4 @@ exports.useIsPresent = useIsPresent;
|
|
|
6303
6325
|
exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
|
|
6304
6326
|
exports.usePresence = usePresence;
|
|
6305
6327
|
exports.visualElementStore = visualElementStore;
|
|
6306
|
-
//# sourceMappingURL=feature-bundle-
|
|
6328
|
+
//# sourceMappingURL=feature-bundle-DBjkFz2c.js.map
|