framer-motion 12.24.7 → 12.24.9
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/{feature-bundle-C6mMBZjn.js → feature-bundle-Cw8jj9v7.js} +20 -7
- package/dist/cjs/{feature-bundle-C6mMBZjn.js.map → feature-bundle-Cw8jj9v7.js.map} +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/dom.js +1 -1
- package/dist/es/gestures/drag/VisualElementDragControls.mjs +16 -6
- package/dist/es/gestures/drag/VisualElementDragControls.mjs.map +1 -1
- package/dist/es/gestures/pan/PanSession.mjs +4 -1
- package/dist/es/gestures/pan/PanSession.mjs.map +1 -1
- package/dist/framer-motion.dev.js +53 -9
- package/dist/framer-motion.js +1 -1
- package/dist/projection.d.ts +912 -0
- 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-animation.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.map +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/size-rollup-motion.js.map +1 -1
- package/dist/size-rollup-scroll.js.map +1 -1
- package/package.json +4 -3
package/dist/cjs/client.js
CHANGED
|
@@ -5172,8 +5172,11 @@ class PanSession {
|
|
|
5172
5172
|
this.handlePointerUp = (event, info) => {
|
|
5173
5173
|
this.end();
|
|
5174
5174
|
const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;
|
|
5175
|
-
if (
|
|
5175
|
+
// Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)
|
|
5176
|
+
// This ensures constraint animations continue when interrupted by a click
|
|
5177
|
+
if (this.dragSnapToOrigin || !this.startEvent) {
|
|
5176
5178
|
resumeAnimation && resumeAnimation();
|
|
5179
|
+
}
|
|
5177
5180
|
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
|
|
5178
5181
|
return;
|
|
5179
5182
|
const panInfo = getPanInfo(event.type === "pointercancel"
|
|
@@ -5422,15 +5425,21 @@ class VisualElementDragControls {
|
|
|
5422
5425
|
if (presenceContext && presenceContext.isPresent === false)
|
|
5423
5426
|
return;
|
|
5424
5427
|
const onSessionStart = (event) => {
|
|
5425
|
-
|
|
5426
|
-
//
|
|
5427
|
-
//
|
|
5428
|
-
dragSnapToOrigin ? this.pauseAnimation() : this.stopAnimation();
|
|
5428
|
+
// Stop or pause animations based on context:
|
|
5429
|
+
// - snapToCursor: stop because we'll set new position values
|
|
5430
|
+
// - otherwise: pause to allow resume if no drag starts (for constraint animations)
|
|
5429
5431
|
if (snapToCursor) {
|
|
5432
|
+
this.stopAnimation();
|
|
5430
5433
|
this.snapToCursor(extractEventInfo(event).point);
|
|
5431
5434
|
}
|
|
5435
|
+
else {
|
|
5436
|
+
this.pauseAnimation();
|
|
5437
|
+
}
|
|
5432
5438
|
};
|
|
5433
5439
|
const onStart = (event, info) => {
|
|
5440
|
+
// Stop any paused animation so motion values reflect true current position
|
|
5441
|
+
// (pauseAnimation was called in onSessionStart to allow resume if no drag started)
|
|
5442
|
+
this.stopAnimation();
|
|
5434
5443
|
// Attempt to grab the global drag gesture lock - maybe make this part of PanSession
|
|
5435
5444
|
const { drag, dragPropagation, onDragStart } = this.getProps();
|
|
5436
5445
|
if (drag && !dragPropagation) {
|
|
@@ -5796,7 +5805,11 @@ class VisualElementDragControls {
|
|
|
5796
5805
|
*/
|
|
5797
5806
|
const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => {
|
|
5798
5807
|
const { drag, dragListener = true } = this.getProps();
|
|
5799
|
-
drag &&
|
|
5808
|
+
if (drag &&
|
|
5809
|
+
dragListener &&
|
|
5810
|
+
!motionDom.isElementKeyboardAccessible(event.target)) {
|
|
5811
|
+
this.start(event);
|
|
5812
|
+
}
|
|
5800
5813
|
});
|
|
5801
5814
|
const measureDragConstraints = () => {
|
|
5802
5815
|
const { dragConstraints } = this.getProps();
|
|
@@ -6359,4 +6372,4 @@ exports.useIsPresent = useIsPresent;
|
|
|
6359
6372
|
exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
|
|
6360
6373
|
exports.usePresence = usePresence;
|
|
6361
6374
|
exports.visualElementStore = visualElementStore;
|
|
6362
|
-
//# sourceMappingURL=feature-bundle-
|
|
6375
|
+
//# sourceMappingURL=feature-bundle-Cw8jj9v7.js.map
|