@vkzstudio/muza-ui 1.0.8 → 1.0.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.
Files changed (143) hide show
  1. package/dist/components/Button/Button.js +19 -19
  2. package/dist/components/Button/ButtonLoader.d.ts +7 -0
  3. package/dist/components/Button/ButtonLoader.d.ts.map +1 -0
  4. package/dist/components/Button/ButtonLoader.js +40 -0
  5. package/dist/components/Icons/CustomIcons.js +1 -1
  6. package/dist/components/ReorderableTable/ReorderableTable.js +1 -1
  7. package/dist/components/SwipeButton/SwipeButton.js +1 -1
  8. package/dist/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.js +4 -4
  9. package/dist/node_modules/framer-motion/dist/es/animation/animate/subject.js +24 -24
  10. package/dist/node_modules/framer-motion/dist/es/animation/sequence/create.js +61 -56
  11. package/dist/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.js +8 -8
  12. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +32 -30
  13. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +22 -22
  14. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +34 -32
  15. package/dist/node_modules/framer-motion/dist/es/components/Reorder/Group.js +34 -26
  16. package/dist/node_modules/framer-motion/dist/es/components/Reorder/Item.js +30 -25
  17. package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.js +64 -0
  18. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +2 -2
  19. package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +3 -3
  20. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +100 -89
  21. package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +11 -7
  22. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +4 -4
  23. package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +2 -2
  24. package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +1 -1
  25. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +106 -59
  26. package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +6 -6
  27. package/dist/node_modules/framer-motion/dist/es/gestures/press.js +1 -1
  28. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +1 -1
  29. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +5 -5
  30. package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +18 -6
  31. package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +1 -1
  32. package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +27 -42
  33. package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +4 -4
  34. package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +10 -7
  35. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +4 -4
  36. package/dist/node_modules/framer-motion/dist/es/motion/index.js +49 -49
  37. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +18 -13
  38. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +41 -40
  39. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +13 -13
  40. package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +6 -6
  41. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +12 -12
  42. package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +3 -3
  43. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +7 -7
  44. package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +5 -5
  45. package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +1 -1
  46. package/dist/node_modules/framer-motion/dist/es/value/use-transform.js +26 -18
  47. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +33 -30
  48. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +17 -17
  49. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +20 -19
  50. package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +10 -0
  51. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/interfaces/motion-value.js +13 -13
  52. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/interfaces/visual-element-target.js +11 -11
  53. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +24 -20
  54. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/utils/default-transitions.js +1 -1
  55. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +7 -3
  56. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +1 -1
  57. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/animation/mix-values.js +2 -2
  58. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/delta-apply.js +4 -4
  59. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/delta-calc.js +1 -1
  60. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/delta-remove.js +6 -6
  61. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/node/DocumentProjectionNode.js +7 -4
  62. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/node/create-projection-node.js +149 -149
  63. package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +60 -0
  64. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/styles/scale-border-radius.js +1 -1
  65. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/styles/scale-box-shadow.js +2 -2
  66. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +21 -0
  67. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/VisualElement.js +58 -50
  68. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/dom/DOMVisualElement.js +7 -6
  69. package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +6 -0
  70. package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +38 -0
  71. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +29 -0
  72. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +37 -0
  73. package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +14 -0
  74. package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +40 -0
  75. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +32 -0
  76. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +15 -0
  77. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +15 -0
  78. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/animation-state.js +31 -31
  79. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/is-controlling-variants.js +1 -1
  80. package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +9 -0
  81. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/motion-values.js +6 -6
  82. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +15 -0
  83. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/setters.js +4 -4
  84. package/dist/node_modules/{framer-motion → motion-dom}/dist/es/utils/delay.js +2 -2
  85. package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +8 -6
  86. package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +62 -42
  87. package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +7 -0
  88. package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +7 -0
  89. package/dist/node_modules/motion-utils/dist/es/errors.js +10 -9
  90. package/package.json +1 -1
  91. package/dist/node_modules/framer-motion/dist/es/animation/animate/single-value.js +0 -10
  92. package/dist/node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.js +0 -8
  93. package/dist/node_modules/framer-motion/dist/es/projection/shared/stack.js +0 -58
  94. package/dist/node_modules/framer-motion/dist/es/projection/styles/scale-correction.js +0 -10
  95. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.js +0 -4
  96. package/dist/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.js +0 -38
  97. package/dist/node_modules/framer-motion/dist/es/render/html/utils/build-styles.js +0 -29
  98. package/dist/node_modules/framer-motion/dist/es/render/html/utils/build-transform.js +0 -31
  99. package/dist/node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.js +0 -12
  100. package/dist/node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.js +0 -40
  101. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.js +0 -23
  102. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/path.js +0 -18
  103. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.js +0 -15
  104. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/index.js +0 -13
  105. package/dist/node_modules/framer-motion/dist/es/value/use-will-change/is.js +0 -7
  106. package/dist/node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.js +0 -7
  107. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/interfaces/visual-element-variant.js +0 -0
  108. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/interfaces/visual-element.js +0 -0
  109. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/optimized-appear/data-id.js +0 -0
  110. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/optimized-appear/get-appear-id.js +0 -0
  111. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/utils/calc-child-stagger.js +0 -0
  112. /package/dist/node_modules/{framer-motion/dist/es/animation/animators/waapi → motion-dom/dist/es/animation}/utils/get-final-keyframe.js +0 -0
  113. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/utils/is-transition-defined.js +0 -0
  114. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/events/add-dom-event.js +0 -0
  115. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/conversion.js +0 -0
  116. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/copy.js +0 -0
  117. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/models.js +0 -0
  118. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/utils.js +0 -0
  119. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/node/HTMLProjectionNode.js +0 -0
  120. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/node/state.js +0 -0
  121. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/styles/transform.js +0 -0
  122. /package/dist/node_modules/{framer-motion/dist/es/render → motion-dom/dist/es/projection}/utils/compare-by-depth.js +0 -0
  123. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/utils/each-axis.js +0 -0
  124. /package/dist/node_modules/{framer-motion/dist/es/render → motion-dom/dist/es/projection}/utils/flat-tree.js +0 -0
  125. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/utils/has-transform.js +0 -0
  126. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/utils/measure.js +0 -0
  127. /package/dist/node_modules/{framer-motion/dist/es/motion/features → motion-dom/dist/es/render}/Feature.js +0 -0
  128. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/html/utils/render.js +0 -0
  129. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/object/ObjectVisualElement.js +0 -0
  130. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/store.js +0 -0
  131. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/svg/utils/camel-case-attrs.js +0 -0
  132. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/svg/utils/is-svg-tag.js +0 -0
  133. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/svg/utils/render.js +0 -0
  134. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/get-variant-context.js +0 -0
  135. /package/dist/node_modules/{framer-motion/dist/es/animation → motion-dom/dist/es/render}/utils/is-animation-controls.js +0 -0
  136. /package/dist/node_modules/{framer-motion/dist/es/animation → motion-dom/dist/es/render}/utils/is-keyframes-target.js +0 -0
  137. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/is-variant-label.js +0 -0
  138. /package/dist/node_modules/{framer-motion/dist/es → motion-dom/dist/es/render}/utils/reduced-motion/state.js +0 -0
  139. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/resolve-dynamic-variants.js +0 -0
  140. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/resolve-variants.js +0 -0
  141. /package/dist/node_modules/{framer-motion/dist/es → motion-dom/dist/es/render}/utils/shallow-compare.js +0 -0
  142. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/variant-props.js +0 -0
  143. /package/dist/node_modules/{framer-motion/dist/es/value/use-will-change → motion-dom/dist/es/value/will-change}/add-will-change.js +0 -0
@@ -1,79 +1,81 @@
1
- import { animateMotionValue as M } from "../../animation/interfaces/motion-value.js";
2
- import { addDomEvent as S } from "../../events/add-dom-event.js";
3
- import { addPointerEvent as B } from "../../events/add-pointer-event.js";
4
- import { extractEventInfo as k } from "../../events/event-info.js";
5
- import { convertBoxToBoundingBox as j, convertBoundingBoxToBox as T } from "../../projection/geometry/conversion.js";
6
- import { calcLength as w } from "../../projection/geometry/delta-calc.js";
7
- import { createBox as b } from "../../projection/geometry/models.js";
8
- import { eachAxis as h } from "../../projection/utils/each-axis.js";
9
- import { measurePageBox as I } from "../../projection/utils/measure.js";
10
- import { getContextWindow as R } from "../../utils/get-context-window.js";
1
+ import { addPointerEvent as M } from "../../events/add-pointer-event.js";
2
+ import { extractEventInfo as S } from "../../events/event-info.js";
3
+ import { getContextWindow as k } from "../../utils/get-context-window.js";
11
4
  import { isRefObject as D } from "../../utils/is-ref-object.js";
12
- import { addValueToWillChange as x } from "../../value/use-will-change/add-will-change.js";
13
- import { PanSession as W } from "../pan/PanSession.js";
14
- import { applyConstraints as O, calcRelativeConstraints as U, resolveDragElastic as z, calcViewportConstraints as _, defaultElastic as F, rebaseAxisConstraints as K, calcOrigin as N } from "./utils/constraints.js";
5
+ import { PanSession as B } from "../pan/PanSession.js";
6
+ import { applyConstraints as j, calcRelativeConstraints as b, resolveDragElastic as T, calcViewportConstraints as w, defaultElastic as I, rebaseAxisConstraints as R, calcOrigin as W } from "./utils/constraints.js";
7
+ import { createBox as O } from "../../../../../motion-dom/dist/es/projection/geometry/models.js";
8
+ import { eachAxis as h } from "../../../../../motion-dom/dist/es/projection/utils/each-axis.js";
15
9
  import { frame as y } from "../../../../../motion-dom/dist/es/frameloop/frame.js";
16
- import { invariant as $ } from "../../../../../motion-utils/dist/es/errors.js";
17
- import { setDragLock as q } from "../../../../../motion-dom/dist/es/gestures/drag/state/set-active.js";
18
- import { percent as G } from "../../../../../motion-dom/dist/es/value/types/numbers/units.js";
10
+ import { invariant as K } from "../../../../../motion-utils/dist/es/errors.js";
11
+ import { measurePageBox as U } from "../../../../../motion-dom/dist/es/projection/utils/measure.js";
12
+ import { convertBoxToBoundingBox as z, convertBoundingBoxToBox as _ } from "../../../../../motion-dom/dist/es/projection/geometry/conversion.js";
13
+ import { addValueToWillChange as x } from "../../../../../motion-dom/dist/es/value/will-change/add-will-change.js";
14
+ import { animateMotionValue as F } from "../../../../../motion-dom/dist/es/animation/interfaces/motion-value.js";
15
+ import { addDomEvent as N } from "../../../../../motion-dom/dist/es/events/add-dom-event.js";
16
+ import { setDragLock as $ } from "../../../../../motion-dom/dist/es/gestures/drag/state/set-active.js";
17
+ import { percent as q } from "../../../../../motion-dom/dist/es/value/types/numbers/units.js";
18
+ import { calcLength as G } from "../../../../../motion-dom/dist/es/projection/geometry/delta-calc.js";
19
19
  import { mixNumber as L } from "../../../../../motion-dom/dist/es/utils/mix/number.js";
20
- const H = /* @__PURE__ */ new WeakMap();
21
- class dt {
20
+ import { isElementKeyboardAccessible as H } from "../../../../../motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js";
21
+ const J = /* @__PURE__ */ new WeakMap();
22
+ class Et {
22
23
  constructor(t) {
23
- this.openDragLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = { x: 0, y: 0 }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic = b(), this.latestPointerEvent = null, this.latestPanInfo = null, this.visualElement = t;
24
+ this.openDragLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = { x: 0, y: 0 }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic = O(), this.latestPointerEvent = null, this.latestPanInfo = null, this.visualElement = t;
24
25
  }
25
26
  start(t, { snapToCursor: s = !1, distanceThreshold: n } = {}) {
26
27
  const { presenceContext: i } = this.visualElement;
27
28
  if (i && i.isPresent === !1)
28
29
  return;
29
- const r = (a) => {
30
- const { dragSnapToOrigin: l } = this.getProps();
31
- l ? this.pauseAnimation() : this.stopAnimation(), s && this.snapToCursor(k(a).point);
32
- }, e = (a, l) => {
30
+ const r = (o) => {
31
+ s ? (this.stopAnimation(), this.snapToCursor(S(o).point)) : this.pauseAnimation();
32
+ }, e = (o, c) => {
33
+ this.stopAnimation();
33
34
  const { drag: f, dragPropagation: d, onDragStart: v } = this.getProps();
34
- if (f && !d && (this.openDragLock && this.openDragLock(), this.openDragLock = q(f), !this.openDragLock))
35
+ if (f && !d && (this.openDragLock && this.openDragLock(), this.openDragLock = $(f), !this.openDragLock))
35
36
  return;
36
- this.latestPointerEvent = a, this.latestPanInfo = l, this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0), h((m) => {
37
- let P = this.getAxisMotionValue(m).get() || 0;
38
- if (G.test(P)) {
37
+ this.latestPointerEvent = o, this.latestPanInfo = c, this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0), h((g) => {
38
+ let P = this.getAxisMotionValue(g).get() || 0;
39
+ if (q.test(P)) {
39
40
  const { projection: C } = this.visualElement;
40
41
  if (C && C.layout) {
41
- const V = C.layout.layoutBox[m];
42
- V && (P = w(V) * (parseFloat(P) / 100));
42
+ const V = C.layout.layoutBox[g];
43
+ V && (P = G(V) * (parseFloat(P) / 100));
43
44
  }
44
45
  }
45
- this.originPoint[m] = P;
46
- }), v && y.postRender(() => v(a, l)), x(this.visualElement, "transform");
46
+ this.originPoint[g] = P;
47
+ }), v && y.postRender(() => v(o, c)), x(this.visualElement, "transform");
47
48
  const { animationState: E } = this.visualElement;
48
49
  E && E.setActive("whileDrag", !0);
49
- }, o = (a, l) => {
50
- this.latestPointerEvent = a, this.latestPanInfo = l;
50
+ }, a = (o, c) => {
51
+ this.latestPointerEvent = o, this.latestPanInfo = c;
51
52
  const { dragPropagation: f, dragDirectionLock: d, onDirectionLock: v, onDrag: E } = this.getProps();
52
53
  if (!f && !this.openDragLock)
53
54
  return;
54
- const { offset: m } = l;
55
+ const { offset: g } = c;
55
56
  if (d && this.currentDirection === null) {
56
- this.currentDirection = J(m), this.currentDirection !== null && v && v(this.currentDirection);
57
+ this.currentDirection = Q(g), this.currentDirection !== null && v && v(this.currentDirection);
57
58
  return;
58
59
  }
59
- this.updateAxis("x", l.point, m), this.updateAxis("y", l.point, m), this.visualElement.render(), E && E(a, l);
60
- }, c = (a, l) => {
61
- this.latestPointerEvent = a, this.latestPanInfo = l, this.stop(a, l), this.latestPointerEvent = null, this.latestPanInfo = null;
62
- }, g = () => h((a) => {
63
- var l;
64
- return this.getAnimationState(a) === "paused" && ((l = this.getAxisMotionValue(a).animation) == null ? void 0 : l.play());
60
+ this.updateAxis("x", c.point, g), this.updateAxis("y", c.point, g), this.visualElement.render(), E && E(o, c);
61
+ }, l = (o, c) => {
62
+ this.latestPointerEvent = o, this.latestPanInfo = c, this.stop(o, c), this.latestPointerEvent = null, this.latestPanInfo = null;
63
+ }, m = () => h((o) => {
64
+ var c;
65
+ return this.getAnimationState(o) === "paused" && ((c = this.getAxisMotionValue(o).animation) == null ? void 0 : c.play());
65
66
  }), { dragSnapToOrigin: u } = this.getProps();
66
- this.panSession = new W(t, {
67
+ this.panSession = new B(t, {
67
68
  onSessionStart: r,
68
69
  onStart: e,
69
- onMove: o,
70
- onSessionEnd: c,
71
- resumeAnimation: g
70
+ onMove: a,
71
+ onSessionEnd: l,
72
+ resumeAnimation: m
72
73
  }, {
73
74
  transformPagePoint: this.visualElement.getTransformPagePoint(),
74
75
  dragSnapToOrigin: u,
75
76
  distanceThreshold: n,
76
- contextWindow: R(this.visualElement)
77
+ contextWindow: k(this.visualElement),
78
+ element: this.visualElement.current
77
79
  });
78
80
  }
79
81
  /**
@@ -85,8 +87,8 @@ class dt {
85
87
  return;
86
88
  const { velocity: e } = i;
87
89
  this.startAnimation(e);
88
- const { onDragEnd: o } = this.getProps();
89
- o && y.postRender(() => o(n, i));
90
+ const { onDragEnd: a } = this.getProps();
91
+ a && y.postRender(() => a(n, i));
90
92
  }
91
93
  /**
92
94
  * @internal
@@ -94,23 +96,32 @@ class dt {
94
96
  cancel() {
95
97
  this.isDragging = !1;
96
98
  const { projection: t, animationState: s } = this.visualElement;
97
- t && (t.isAnimationBlocked = !1), this.panSession && this.panSession.end(), this.panSession = void 0;
99
+ t && (t.isAnimationBlocked = !1), this.endPanSession();
98
100
  const { dragPropagation: n } = this.getProps();
99
101
  !n && this.openDragLock && (this.openDragLock(), this.openDragLock = null), s && s.setActive("whileDrag", !1);
100
102
  }
103
+ /**
104
+ * Clean up the pan session without modifying other drag state.
105
+ * This is used during unmount to ensure event listeners are removed
106
+ * without affecting projection animations or drag locks.
107
+ * @internal
108
+ */
109
+ endPanSession() {
110
+ this.panSession && this.panSession.end(), this.panSession = void 0;
111
+ }
101
112
  updateAxis(t, s, n) {
102
113
  const { drag: i } = this.getProps();
103
114
  if (!n || !A(t, i, this.currentDirection))
104
115
  return;
105
116
  const r = this.getAxisMotionValue(t);
106
117
  let e = this.originPoint[t] + n[t];
107
- this.constraints && this.constraints[t] && (e = O(e, this.constraints[t], this.elastic[t])), r.set(e);
118
+ this.constraints && this.constraints[t] && (e = j(e, this.constraints[t], this.elastic[t])), r.set(e);
108
119
  }
109
120
  resolveConstraints() {
110
121
  var r;
111
122
  const { dragConstraints: t, dragElastic: s } = this.getProps(), n = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(!1) : (r = this.visualElement.projection) == null ? void 0 : r.layout, i = this.constraints;
112
- t && D(t) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : t && n ? this.constraints = U(n.layoutBox, t) : this.constraints = !1, this.elastic = z(s), i !== this.constraints && n && this.constraints && !this.hasMutatedConstraints && h((e) => {
113
- this.constraints !== !1 && this.getAxisMotionValue(e) && (this.constraints[e] = K(n.layoutBox[e], this.constraints[e]));
123
+ t && D(t) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : t && n ? this.constraints = b(n.layoutBox, t) : this.constraints = !1, this.elastic = T(s), i !== this.constraints && n && this.constraints && !this.hasMutatedConstraints && h((e) => {
124
+ this.constraints !== !1 && this.getAxisMotionValue(e) && (this.constraints[e] = R(n.layoutBox[e], this.constraints[e]));
114
125
  });
115
126
  }
116
127
  resolveRefConstraints() {
@@ -118,42 +129,42 @@ class dt {
118
129
  if (!t || !D(t))
119
130
  return !1;
120
131
  const n = t.current;
121
- $(n !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref");
132
+ K(n !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref");
122
133
  const { projection: i } = this.visualElement;
123
134
  if (!i || !i.layout)
124
135
  return !1;
125
- const r = I(n, i.root, this.visualElement.getTransformPagePoint());
126
- let e = _(i.layout.layoutBox, r);
136
+ const r = U(n, i.root, this.visualElement.getTransformPagePoint());
137
+ let e = w(i.layout.layoutBox, r);
127
138
  if (s) {
128
- const o = s(j(e));
129
- this.hasMutatedConstraints = !!o, o && (e = T(o));
139
+ const a = s(z(e));
140
+ this.hasMutatedConstraints = !!a, a && (e = _(a));
130
141
  }
131
142
  return e;
132
143
  }
133
144
  startAnimation(t) {
134
- const { drag: s, dragMomentum: n, dragElastic: i, dragTransition: r, dragSnapToOrigin: e, onDragTransitionEnd: o } = this.getProps(), c = this.constraints || {}, g = h((u) => {
145
+ const { drag: s, dragMomentum: n, dragElastic: i, dragTransition: r, dragSnapToOrigin: e, onDragTransitionEnd: a } = this.getProps(), l = this.constraints || {}, m = h((u) => {
135
146
  if (!A(u, s, this.currentDirection))
136
147
  return;
137
- let a = c && c[u] || {};
138
- e && (a = { min: 0, max: 0 });
139
- const l = i ? 200 : 1e6, f = i ? 40 : 1e7, d = {
148
+ let o = l && l[u] || {};
149
+ e && (o = { min: 0, max: 0 });
150
+ const c = i ? 200 : 1e6, f = i ? 40 : 1e7, d = {
140
151
  type: "inertia",
141
152
  velocity: n ? t[u] : 0,
142
- bounceStiffness: l,
153
+ bounceStiffness: c,
143
154
  bounceDamping: f,
144
155
  timeConstant: 750,
145
156
  restDelta: 1,
146
157
  restSpeed: 10,
147
158
  ...r,
148
- ...a
159
+ ...o
149
160
  };
150
161
  return this.startAxisValueAnimation(u, d);
151
162
  });
152
- return Promise.all(g).then(o);
163
+ return Promise.all(m).then(a);
153
164
  }
154
165
  startAxisValueAnimation(t, s) {
155
166
  const n = this.getAxisMotionValue(t);
156
- return x(this.visualElement, t), n.start(M(t, n, 0, s, this.visualElement, !1));
167
+ return x(this.visualElement, t), n.start(F(t, n, 0, s, this.visualElement, !1));
157
168
  }
158
169
  stopAnimation() {
159
170
  h((t) => this.getAxisMotionValue(t).stop());
@@ -185,8 +196,8 @@ class dt {
185
196
  return;
186
197
  const { projection: i } = this.visualElement, r = this.getAxisMotionValue(s);
187
198
  if (i && i.layout) {
188
- const { min: e, max: o } = i.layout.layoutBox[s];
189
- r.set(t[s] - L(e, o, 0.5));
199
+ const { min: e, max: a } = i.layout.layoutBox[s], l = r.get() || 0;
200
+ r.set(t[s] - L(e, a, 0.5) + l);
190
201
  }
191
202
  });
192
203
  }
@@ -204,44 +215,44 @@ class dt {
204
215
  this.stopAnimation();
205
216
  const i = { x: 0, y: 0 };
206
217
  h((e) => {
207
- const o = this.getAxisMotionValue(e);
208
- if (o && this.constraints !== !1) {
209
- const c = o.get();
210
- i[e] = N({ min: c, max: c }, this.constraints[e]);
218
+ const a = this.getAxisMotionValue(e);
219
+ if (a && this.constraints !== !1) {
220
+ const l = a.get();
221
+ i[e] = W({ min: l, max: l }, this.constraints[e]);
211
222
  }
212
223
  });
213
224
  const { transformTemplate: r } = this.visualElement.getProps();
214
225
  this.visualElement.current.style.transform = r ? r({}, "") : "none", n.root && n.root.updateScroll(), n.updateLayout(), this.resolveConstraints(), h((e) => {
215
226
  if (!A(e, t, null))
216
227
  return;
217
- const o = this.getAxisMotionValue(e), { min: c, max: g } = this.constraints[e];
218
- o.set(L(c, g, i[e]));
228
+ const a = this.getAxisMotionValue(e), { min: l, max: m } = this.constraints[e];
229
+ a.set(L(l, m, i[e]));
219
230
  });
220
231
  }
221
232
  addListeners() {
222
233
  if (!this.visualElement.current)
223
234
  return;
224
- H.set(this.visualElement, this);
225
- const t = this.visualElement.current, s = B(t, "pointerdown", (c) => {
226
- const { drag: g, dragListener: u = !0 } = this.getProps();
227
- g && u && this.start(c);
235
+ J.set(this.visualElement, this);
236
+ const t = this.visualElement.current, s = M(t, "pointerdown", (l) => {
237
+ const { drag: m, dragListener: u = !0 } = this.getProps(), o = l.target, c = o !== t && H(o);
238
+ m && u && !c && this.start(l);
228
239
  }), n = () => {
229
- const { dragConstraints: c } = this.getProps();
230
- D(c) && c.current && (this.constraints = this.resolveRefConstraints());
240
+ const { dragConstraints: l } = this.getProps();
241
+ D(l) && l.current && (this.constraints = this.resolveRefConstraints());
231
242
  }, { projection: i } = this.visualElement, r = i.addEventListener("measure", n);
232
243
  i && !i.layout && (i.root && i.root.updateScroll(), i.updateLayout()), y.read(n);
233
- const e = S(window, "resize", () => this.scalePositionWithinConstraints()), o = i.addEventListener("didUpdate", (({ delta: c, hasLayoutChanged: g }) => {
234
- this.isDragging && g && (h((u) => {
235
- const a = this.getAxisMotionValue(u);
236
- a && (this.originPoint[u] += c[u].translate, a.set(a.get() + c[u].translate));
244
+ const e = N(window, "resize", () => this.scalePositionWithinConstraints()), a = i.addEventListener("didUpdate", (({ delta: l, hasLayoutChanged: m }) => {
245
+ this.isDragging && m && (h((u) => {
246
+ const o = this.getAxisMotionValue(u);
247
+ o && (this.originPoint[u] += l[u].translate, o.set(o.get() + l[u].translate));
237
248
  }), this.visualElement.render());
238
249
  }));
239
250
  return () => {
240
- e(), s(), r(), o && o();
251
+ e(), s(), r(), a && a();
241
252
  };
242
253
  }
243
254
  getProps() {
244
- const t = this.visualElement.getProps(), { drag: s = !1, dragDirectionLock: n = !1, dragPropagation: i = !1, dragConstraints: r = !1, dragElastic: e = F, dragMomentum: o = !0 } = t;
255
+ const t = this.visualElement.getProps(), { drag: s = !1, dragDirectionLock: n = !1, dragPropagation: i = !1, dragConstraints: r = !1, dragElastic: e = I, dragMomentum: a = !0 } = t;
245
256
  return {
246
257
  ...t,
247
258
  drag: s,
@@ -249,18 +260,18 @@ class dt {
249
260
  dragPropagation: i,
250
261
  dragConstraints: r,
251
262
  dragElastic: e,
252
- dragMomentum: o
263
+ dragMomentum: a
253
264
  };
254
265
  }
255
266
  }
256
267
  function A(p, t, s) {
257
268
  return (t === !0 || t === p) && (s === null || s === p);
258
269
  }
259
- function J(p, t = 10) {
270
+ function Q(p, t = 10) {
260
271
  let s = null;
261
272
  return Math.abs(p.y) > t ? s = "y" : Math.abs(p.x) > t && (s = "x"), s;
262
273
  }
263
274
  export {
264
- dt as VisualElementDragControls,
265
- H as elementDragControls
275
+ Et as VisualElementDragControls,
276
+ J as elementDragControls
266
277
  };
@@ -1,18 +1,22 @@
1
- import { Feature as s } from "../../motion/features/Feature.js";
2
1
  import { VisualElementDragControls as t } from "./VisualElementDragControls.js";
3
- import { noop as r } from "../../../../../motion-utils/dist/es/noop.js";
4
- class u extends s {
2
+ import { Feature as e } from "../../../../../motion-dom/dist/es/render/Feature.js";
3
+ import { noop as s } from "../../../../../motion-utils/dist/es/noop.js";
4
+ class m extends e {
5
5
  constructor(o) {
6
- super(o), this.removeGroupControls = r, this.removeListeners = r, this.controls = new t(o);
6
+ super(o), this.removeGroupControls = s, this.removeListeners = s, this.controls = new t(o);
7
7
  }
8
8
  mount() {
9
9
  const { dragControls: o } = this.node.getProps();
10
- o && (this.removeGroupControls = o.subscribe(this.controls)), this.removeListeners = this.controls.addListeners() || r;
10
+ o && (this.removeGroupControls = o.subscribe(this.controls)), this.removeListeners = this.controls.addListeners() || s;
11
+ }
12
+ update() {
13
+ const { dragControls: o } = this.node.getProps(), { dragControls: r } = this.node.prevProps || {};
14
+ o !== r && (this.removeGroupControls(), o && (this.removeGroupControls = o.subscribe(this.controls)));
11
15
  }
12
16
  unmount() {
13
- this.removeGroupControls(), this.removeListeners();
17
+ this.removeGroupControls(), this.removeListeners(), this.controls.isDragging || this.controls.endPanSession();
14
18
  }
15
19
  }
16
20
  export {
17
- u as DragGesture
21
+ m as DragGesture
18
22
  };
@@ -1,9 +1,9 @@
1
- import { calcLength as r } from "../../../projection/geometry/delta-calc.js";
2
- import { mixNumber as t } from "../../../../../../motion-dom/dist/es/utils/mix/number.js";
1
+ import { mixNumber as r } from "../../../../../../motion-dom/dist/es/utils/mix/number.js";
2
+ import { calcLength as t } from "../../../../../../motion-dom/dist/es/projection/geometry/delta-calc.js";
3
3
  import { progress as u } from "../../../../../../motion-utils/dist/es/progress.js";
4
4
  import { clamp as C } from "../../../../../../motion-utils/dist/es/clamp.js";
5
5
  function a(n, { min: e, max: m }, i) {
6
- return e !== void 0 && n < e ? n = i ? t(e, n, i.min) : Math.max(n, e) : m !== void 0 && n > m && (n = i ? t(m, n, i.max) : Math.min(n, m)), n;
6
+ return e !== void 0 && n < e ? n = i ? r(e, n, i.min) : Math.max(n, e) : m !== void 0 && n > m && (n = i ? r(m, n, i.max) : Math.min(n, m)), n;
7
7
  }
8
8
  function o(n, e, m) {
9
9
  return {
@@ -29,7 +29,7 @@ function w(n, e) {
29
29
  }
30
30
  function y(n, e) {
31
31
  let m = 0.5;
32
- const i = r(n), f = r(e);
32
+ const i = t(n), f = t(e);
33
33
  return f > i ? m = u(e.min, e.max - i, n.min) : i > f && (m = u(n.min, n.max - f, e.min)), C(0, 1, m);
34
34
  }
35
35
  function M(n, e) {
@@ -1,6 +1,6 @@
1
- import { addDomEvent as e } from "../events/add-dom-event.js";
2
- import { Feature as i } from "../motion/features/Feature.js";
1
+ import { Feature as i } from "../../../../motion-dom/dist/es/render/Feature.js";
3
2
  import { pipe as s } from "../../../../motion-utils/dist/es/pipe.js";
3
+ import { addDomEvent as e } from "../../../../motion-dom/dist/es/events/add-dom-event.js";
4
4
  class a extends i {
5
5
  constructor() {
6
6
  super(...arguments), this.isActive = !1;
@@ -1,5 +1,5 @@
1
1
  import { extractEventInfo as m } from "../events/event-info.js";
2
- import { Feature as s } from "../motion/features/Feature.js";
2
+ import { Feature as s } from "../../../../motion-dom/dist/es/render/Feature.js";
3
3
  import { hover as u } from "../../../../motion-dom/dist/es/gestures/hover.js";
4
4
  import { frame as c } from "../../../../motion-dom/dist/es/frameloop/frame.js";
5
5
  function a(e, t, r) {
@@ -1,84 +1,131 @@
1
- import { addPointerEvent as m } from "../../events/add-pointer-event.js";
2
- import { extractEventInfo as S } from "../../events/event-info.js";
3
- import { distance2D as T } from "../../utils/distance.js";
4
- import { frameData as x, frame as D, cancelFrame as W } from "../../../../../motion-dom/dist/es/frameloop/frame.js";
5
- import { isPrimaryPointer as L } from "../../../../../motion-dom/dist/es/gestures/utils/is-primary-pointer.js";
6
- import { pipe as U } from "../../../../../motion-utils/dist/es/pipe.js";
7
- import { secondsToMilliseconds as O, millisecondsToSeconds as V } from "../../../../../motion-utils/dist/es/time-conversion.js";
8
- class C {
9
- constructor(n, o, { transformPagePoint: e, contextWindow: r = window, dragSnapToOrigin: h = !1, distanceThreshold: s = 3 } = {}) {
10
- if (this.startEvent = null, this.lastMoveEvent = null, this.lastMoveEventInfo = null, this.handlers = {}, this.contextWindow = window, this.updatePoint = () => {
1
+ import { addPointerEvent as v } from "../../events/add-pointer-event.js";
2
+ import { extractEventInfo as W } from "../../events/event-info.js";
3
+ import { distance2D as D } from "../../utils/distance.js";
4
+ import { frameData as P, frame as x, cancelFrame as k } from "../../../../../motion-dom/dist/es/frameloop/frame.js";
5
+ import { isPrimaryPointer as U } from "../../../../../motion-dom/dist/es/gestures/utils/is-primary-pointer.js";
6
+ import { pipe as X } from "../../../../../motion-utils/dist/es/pipe.js";
7
+ import { secondsToMilliseconds as Y, millisecondsToSeconds as O } from "../../../../../motion-utils/dist/es/time-conversion.js";
8
+ const S = /* @__PURE__ */ new Set(["auto", "scroll"]);
9
+ class B {
10
+ constructor(t, i, { transformPagePoint: s, contextWindow: r = window, dragSnapToOrigin: o = !1, distanceThreshold: l = 3, element: p } = {}) {
11
+ if (this.startEvent = null, this.lastMoveEvent = null, this.lastMoveEventInfo = null, this.handlers = {}, this.contextWindow = window, this.scrollPositions = /* @__PURE__ */ new Map(), this.removeScrollListeners = null, this.onElementScroll = (e) => {
12
+ this.handleScroll(e.target);
13
+ }, this.onWindowScroll = () => {
14
+ this.handleScroll(window);
15
+ }, this.updatePoint = () => {
11
16
  if (!(this.lastMoveEvent && this.lastMoveEventInfo))
12
17
  return;
13
- const i = p(this.lastMoveEventInfo, this.history), a = this.startEvent !== null, c = T(i.offset, { x: 0, y: 0 }) >= this.distanceThreshold;
14
- if (!a && !c)
18
+ const e = u(this.lastMoveEventInfo, this.history), h = this.startEvent !== null, c = D(e.offset, { x: 0, y: 0 }) >= this.distanceThreshold;
19
+ if (!h && !c)
15
20
  return;
16
- const { point: f } = i, { timestamp: d } = x;
17
- this.history.push({ ...f, timestamp: d });
18
- const { onStart: l, onMove: E } = this.handlers;
19
- a || (l && l(this.lastMoveEvent, i), this.startEvent = this.lastMoveEvent), E && E(this.lastMoveEvent, i);
20
- }, this.handlePointerMove = (i, a) => {
21
- this.lastMoveEvent = i, this.lastMoveEventInfo = v(a, this.transformPagePoint), D.update(this.updatePoint, !0);
22
- }, this.handlePointerUp = (i, a) => {
21
+ const { point: d } = e, { timestamp: f } = P;
22
+ this.history.push({ ...d, timestamp: f });
23
+ const { onStart: a, onMove: E } = this.handlers;
24
+ h || (a && a(this.lastMoveEvent, e), this.startEvent = this.lastMoveEvent), E && E(this.lastMoveEvent, e);
25
+ }, this.handlePointerMove = (e, h) => {
26
+ this.lastMoveEvent = e, this.lastMoveEventInfo = m(h, this.transformPagePoint), x.update(this.updatePoint, !0);
27
+ }, this.handlePointerUp = (e, h) => {
23
28
  this.end();
24
- const { onEnd: c, onSessionEnd: f, resumeAnimation: d } = this.handlers;
25
- if (this.dragSnapToOrigin && d && d(), !(this.lastMoveEvent && this.lastMoveEventInfo))
29
+ const { onEnd: c, onSessionEnd: d, resumeAnimation: f } = this.handlers;
30
+ if ((this.dragSnapToOrigin || !this.startEvent) && f && f(), !(this.lastMoveEvent && this.lastMoveEventInfo))
26
31
  return;
27
- const l = p(i.type === "pointercancel" ? this.lastMoveEventInfo : v(a, this.transformPagePoint), this.history);
28
- this.startEvent && c && c(i, l), f && f(i, l);
29
- }, !L(n))
32
+ const a = u(e.type === "pointercancel" ? this.lastMoveEventInfo : m(h, this.transformPagePoint), this.history);
33
+ this.startEvent && c && c(e, a), d && d(e, a);
34
+ }, !U(t))
30
35
  return;
31
- this.dragSnapToOrigin = h, this.handlers = o, this.transformPagePoint = e, this.distanceThreshold = s, this.contextWindow = r || window;
32
- const g = S(n), u = v(g, this.transformPagePoint), { point: w } = u, { timestamp: I } = x;
33
- this.history = [{ ...w, timestamp: I }];
34
- const { onSessionStart: P } = o;
35
- P && P(n, p(u, this.history)), this.removeListeners = U(m(this.contextWindow, "pointermove", this.handlePointerMove), m(this.contextWindow, "pointerup", this.handlePointerUp), m(this.contextWindow, "pointercancel", this.handlePointerUp));
36
+ this.dragSnapToOrigin = o, this.handlers = i, this.transformPagePoint = s, this.distanceThreshold = l, this.contextWindow = r || window;
37
+ const g = W(t), w = m(g, this.transformPagePoint), { point: L } = w, { timestamp: T } = P;
38
+ this.history = [{ ...L, timestamp: T }];
39
+ const { onSessionStart: y } = i;
40
+ y && y(t, u(w, this.history)), this.removeListeners = X(v(this.contextWindow, "pointermove", this.handlePointerMove), v(this.contextWindow, "pointerup", this.handlePointerUp), v(this.contextWindow, "pointercancel", this.handlePointerUp)), p && this.startScrollTracking(p);
36
41
  }
37
- updateHandlers(n) {
38
- this.handlers = n;
42
+ /**
43
+ * Start tracking scroll on ancestors and window.
44
+ */
45
+ startScrollTracking(t) {
46
+ let i = t.parentElement;
47
+ for (; i; ) {
48
+ const s = getComputedStyle(i);
49
+ (S.has(s.overflowX) || S.has(s.overflowY)) && this.scrollPositions.set(i, {
50
+ x: i.scrollLeft,
51
+ y: i.scrollTop
52
+ }), i = i.parentElement;
53
+ }
54
+ this.scrollPositions.set(window, {
55
+ x: window.scrollX,
56
+ y: window.scrollY
57
+ }), window.addEventListener("scroll", this.onElementScroll, {
58
+ capture: !0,
59
+ passive: !0
60
+ }), window.addEventListener("scroll", this.onWindowScroll, {
61
+ passive: !0
62
+ }), this.removeScrollListeners = () => {
63
+ window.removeEventListener("scroll", this.onElementScroll, {
64
+ capture: !0
65
+ }), window.removeEventListener("scroll", this.onWindowScroll);
66
+ };
67
+ }
68
+ /**
69
+ * Handle scroll compensation during drag.
70
+ *
71
+ * For element scroll: adjusts history origin since pageX/pageY doesn't change.
72
+ * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.
73
+ */
74
+ handleScroll(t) {
75
+ const i = this.scrollPositions.get(t);
76
+ if (!i)
77
+ return;
78
+ const s = t === window, r = s ? { x: window.scrollX, y: window.scrollY } : {
79
+ x: t.scrollLeft,
80
+ y: t.scrollTop
81
+ }, o = { x: r.x - i.x, y: r.y - i.y };
82
+ o.x === 0 && o.y === 0 || (s ? this.lastMoveEventInfo && (this.lastMoveEventInfo.point.x += o.x, this.lastMoveEventInfo.point.y += o.y) : this.history.length > 0 && (this.history[0].x -= o.x, this.history[0].y -= o.y), this.scrollPositions.set(t, r), x.update(this.updatePoint, !0));
83
+ }
84
+ updateHandlers(t) {
85
+ this.handlers = t;
39
86
  }
40
87
  end() {
41
- this.removeListeners && this.removeListeners(), W(this.updatePoint);
88
+ this.removeListeners && this.removeListeners(), this.removeScrollListeners && this.removeScrollListeners(), this.scrollPositions.clear(), k(this.updatePoint);
42
89
  }
43
90
  }
44
- function v(t, n) {
45
- return n ? { point: n(t.point) } : t;
91
+ function m(n, t) {
92
+ return t ? { point: t(n.point) } : n;
46
93
  }
47
- function y(t, n) {
48
- return { x: t.x - n.x, y: t.y - n.y };
94
+ function M(n, t) {
95
+ return { x: n.x - t.x, y: n.y - t.y };
49
96
  }
50
- function p({ point: t }, n) {
97
+ function u({ point: n }, t) {
51
98
  return {
52
- point: t,
53
- delta: y(t, M(n)),
54
- offset: y(t, b(n)),
55
- velocity: k(n, 0.1)
99
+ point: n,
100
+ delta: M(n, I(t)),
101
+ offset: M(n, V(t)),
102
+ velocity: b(t, 0.1)
56
103
  };
57
104
  }
58
- function b(t) {
59
- return t[0];
105
+ function V(n) {
106
+ return n[0];
60
107
  }
61
- function M(t) {
62
- return t[t.length - 1];
108
+ function I(n) {
109
+ return n[n.length - 1];
63
110
  }
64
- function k(t, n) {
65
- if (t.length < 2)
111
+ function b(n, t) {
112
+ if (n.length < 2)
66
113
  return { x: 0, y: 0 };
67
- let o = t.length - 1, e = null;
68
- const r = M(t);
69
- for (; o >= 0 && (e = t[o], !(r.timestamp - e.timestamp > O(n))); )
70
- o--;
71
- if (!e)
114
+ let i = n.length - 1, s = null;
115
+ const r = I(n);
116
+ for (; i >= 0 && (s = n[i], !(r.timestamp - s.timestamp > Y(t))); )
117
+ i--;
118
+ if (!s)
72
119
  return { x: 0, y: 0 };
73
- const h = V(r.timestamp - e.timestamp);
74
- if (h === 0)
120
+ const o = O(r.timestamp - s.timestamp);
121
+ if (o === 0)
75
122
  return { x: 0, y: 0 };
76
- const s = {
77
- x: (r.x - e.x) / h,
78
- y: (r.y - e.y) / h
123
+ const l = {
124
+ x: (r.x - s.x) / o,
125
+ y: (r.y - s.y) / o
79
126
  };
80
- return s.x === 1 / 0 && (s.x = 0), s.y === 1 / 0 && (s.y = 0), s;
127
+ return l.x === 1 / 0 && (l.x = 0), l.y === 1 / 0 && (l.y = 0), l;
81
128
  }
82
129
  export {
83
- C as PanSession
130
+ B as PanSession
84
131
  };
@@ -1,20 +1,20 @@
1
1
  import { addPointerEvent as m } from "../../events/add-pointer-event.js";
2
- import { Feature as P } from "../../motion/features/Feature.js";
3
- import { getContextWindow as h } from "../../utils/get-context-window.js";
4
- import { PanSession as p } from "./PanSession.js";
2
+ import { getContextWindow as P } from "../../utils/get-context-window.js";
3
+ import { PanSession as h } from "./PanSession.js";
4
+ import { Feature as p } from "../../../../../motion-dom/dist/es/render/Feature.js";
5
5
  import { noop as u } from "../../../../../motion-utils/dist/es/noop.js";
6
6
  import { frame as r } from "../../../../../motion-dom/dist/es/frameloop/frame.js";
7
7
  const s = (e) => (n, o) => {
8
8
  e && r.postRender(() => e(n, o));
9
9
  };
10
- class v extends P {
10
+ class v extends p {
11
11
  constructor() {
12
12
  super(...arguments), this.removePointerDownListener = u;
13
13
  }
14
14
  onPointerDown(n) {
15
- this.session = new p(n, this.createPanHandlers(), {
15
+ this.session = new h(n, this.createPanHandlers(), {
16
16
  transformPagePoint: this.node.getTransformPagePoint(),
17
- contextWindow: h(this.node)
17
+ contextWindow: P(this.node)
18
18
  });
19
19
  }
20
20
  createPanHandlers() {