framer-motion 12.24.8 → 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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var featureBundle = require('./feature-bundle-C6mMBZjn.js');
5
+ var featureBundle = require('./feature-bundle-Cw8jj9v7.js');
6
6
  require('react');
7
7
  require('motion-dom');
8
8
  require('motion-utils');
@@ -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 (this.dragSnapToOrigin)
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
- const { dragSnapToOrigin } = this.getProps();
5426
- // Stop or pause any animations on both axis values immediately. This allows the user to throw and catch
5427
- // the component.
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 && dragListener && this.start(event);
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-C6mMBZjn.js.map
6375
+ //# sourceMappingURL=feature-bundle-Cw8jj9v7.js.map