motion-v 0.5.0-beta.2 → 0.5.0

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 (333) hide show
  1. package/dist/cjs/index.js +1564 -608
  2. package/dist/es/animation/use-animate.mjs +1 -1
  3. package/dist/es/components/AnimatePresence.vue.mjs +1 -4
  4. package/dist/es/components/Motion.vue.mjs +50 -16
  5. package/dist/es/components/presence.mjs +2 -3
  6. package/dist/es/events/add-pointer-event.mjs +8 -0
  7. package/dist/es/events/event-info.mjs +16 -0
  8. package/dist/es/events/utils/is-primary-pointer.mjs +10 -0
  9. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/GroupPlaybackControls.mjs +3 -0
  10. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animate/resolve-subjects.mjs +1 -1
  11. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animate/subject.mjs +1 -1
  12. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs +2 -1
  13. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/BaseAnimation.mjs +4 -0
  14. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs +7 -1
  15. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/utils/can-animate.mjs +1 -1
  16. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/NativeAnimation.mjs +8 -2
  17. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +3 -3
  18. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/index.mjs +1 -1
  19. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/linear.mjs +1 -2
  20. package/dist/es/external/.pnpm/framer-motion@11.15.0/external/framer-motion/dist/es/animation/generators/spring/defaults.mjs +32 -0
  21. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/generators/spring/find.mjs +9 -16
  22. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/generators/spring/index.mjs +46 -17
  23. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/sequence/create.mjs +23 -2
  24. package/dist/es/external/.pnpm/framer-motion@11.15.0/external/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs +6 -0
  25. package/dist/es/external/.pnpm/framer-motion@11.15.0/external/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs +8 -0
  26. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/cubic-bezier.mjs +2 -1
  27. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/utils/map.mjs +2 -2
  28. package/dist/es/external/.pnpm/framer-motion@11.15.0/external/framer-motion/dist/es/events/add-dom-event.mjs +7 -0
  29. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/frameloop/frame.mjs +2 -1
  30. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/frameloop/render-step.mjs +1 -1
  31. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/animation/mix-values.mjs +2 -1
  32. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/node/create-projection-node.mjs +2 -1
  33. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/DOMVisualElement.mjs +15 -0
  34. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/resize/handle-element.mjs +1 -1
  35. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/index.mjs +13 -6
  36. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs +1 -1
  37. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/viewport/index.mjs +1 -1
  38. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/html/HTMLVisualElement.mjs +0 -14
  39. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/motion-values.mjs +1 -1
  40. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/interpolate.mjs +2 -2
  41. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/mix/color.mjs +1 -1
  42. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/mix/complex.mjs +1 -1
  43. package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/index.mjs +1 -1
  44. package/dist/es/features/feature-manager.mjs +26 -7
  45. package/dist/es/features/feature.mjs +10 -0
  46. package/dist/es/features/gestures/drag/VisualElementDragControls.mjs +450 -0
  47. package/dist/es/features/gestures/drag/index.mjs +26 -0
  48. package/dist/es/features/gestures/drag/lock.mjs +42 -0
  49. package/dist/es/features/gestures/drag/utils/constraints.mjs +93 -0
  50. package/dist/es/features/gestures/drag/utils/is.mjs +6 -0
  51. package/dist/es/features/gestures/hover/index.mjs +40 -0
  52. package/dist/es/features/gestures/in-view/index.mjs +39 -0
  53. package/dist/es/features/gestures/pan/PanSession.mjs +150 -0
  54. package/dist/es/features/gestures/pan/index.mjs +69 -0
  55. package/dist/es/features/gestures/press/index.mjs +51 -0
  56. package/dist/es/features/layout/config.mjs +2 -2
  57. package/dist/es/features/layout/layout.mjs +24 -51
  58. package/dist/es/features/layout/projection.mjs +39 -0
  59. package/dist/es/features/svg.mjs +1 -1
  60. package/dist/es/index.mjs +41 -31
  61. package/dist/es/projection/conversion.mjs +31 -0
  62. package/dist/es/projection/geometry/delta-apply.mjs +7 -0
  63. package/dist/es/projection/geometry/delta-calc.mjs +6 -0
  64. package/dist/es/projection/geometry/models.mjs +11 -0
  65. package/dist/es/projection/utils/each-axis.mjs +6 -0
  66. package/dist/es/projection/utils/measure.mjs +20 -0
  67. package/dist/es/state/animate-variants-children.mjs +1 -1
  68. package/dist/es/state/create-visual-element.mjs +2 -2
  69. package/dist/es/state/motion-state.mjs +24 -7
  70. package/dist/es/state/utils/is-present.mjs +7 -0
  71. package/dist/es/state/utils.mjs +0 -3
  72. package/dist/es/utils/clamp.mjs +10 -0
  73. package/dist/es/utils/get-context-window.mjs +6 -0
  74. package/dist/es/utils/mix/number.mjs +6 -0
  75. package/dist/es/utils/progress.mjs +7 -0
  76. package/dist/es/utils/time-conversion.mjs +8 -0
  77. package/dist/es/utils/use-animation-frame.mjs +1 -1
  78. package/dist/es/utils/use-in-view.mjs +1 -1
  79. package/dist/es/value/types/numbers/units.mjs +11 -0
  80. package/dist/es/value/use-combine-values.mjs +2 -2
  81. package/dist/es/value/use-computed.mjs +1 -1
  82. package/dist/es/value/use-scroll.mjs +3 -3
  83. package/dist/es/value/use-spring.mjs +3 -3
  84. package/dist/es/value/use-time.mjs +1 -1
  85. package/dist/es/value/use-transform.mjs +1 -1
  86. package/dist/es/value/use-velocity.mjs +2 -2
  87. package/dist/es/value/use-will-change/add-will-change.mjs +10 -0
  88. package/dist/es/value/use-will-change/is.mjs +7 -0
  89. package/dist/src/animation/animation-controls.d.ts +7 -0
  90. package/dist/src/animation/types.d.ts +12 -0
  91. package/dist/src/animation/use-animation.d.ts +0 -0
  92. package/dist/src/components/AnimatePresence.d.ts +1 -1
  93. package/dist/src/events/add-dom-event.d.ts +1 -0
  94. package/dist/src/events/add-pointer-event.d.ts +2 -0
  95. package/dist/src/events/event-info.d.ts +4 -0
  96. package/dist/src/events/index.d.ts +5 -0
  97. package/dist/src/events/types.d.ts +5 -0
  98. package/dist/src/events/utils/index.d.ts +1 -0
  99. package/dist/src/events/utils/is-primary-pointer.d.ts +1 -0
  100. package/dist/src/features/feature-manager.d.ts +3 -0
  101. package/dist/src/features/feature.d.ts +6 -3
  102. package/dist/src/features/gestures/drag/VisualElementDragControls.d.ts +57 -0
  103. package/dist/src/features/gestures/drag/index.d.ts +8 -10
  104. package/dist/src/features/gestures/drag/lock.d.ts +4 -0
  105. package/dist/src/features/gestures/drag/types.d.ts +149 -70
  106. package/dist/src/features/gestures/drag/use-drag-controls.d.ts +73 -0
  107. package/dist/src/features/gestures/drag/utils/constraints.d.ts +55 -0
  108. package/dist/src/features/gestures/drag/utils/is.d.ts +1 -0
  109. package/dist/src/features/gestures/hover/index.d.ts +7 -0
  110. package/dist/src/features/gestures/hover/types.d.ts +8 -0
  111. package/dist/src/features/gestures/in-view/index.d.ts +7 -0
  112. package/dist/src/features/gestures/in-view/types.d.ts +18 -0
  113. package/dist/src/features/gestures/pan/PanSession.d.ts +139 -0
  114. package/dist/src/features/gestures/pan/index.d.ts +16 -0
  115. package/dist/src/features/gestures/pan/types.d.ts +7 -0
  116. package/dist/src/features/gestures/press/index.d.ts +9 -0
  117. package/dist/src/features/gestures/press/types.d.ts +13 -0
  118. package/dist/src/features/index.d.ts +1 -1
  119. package/dist/src/features/layout/layout.d.ts +3 -2
  120. package/dist/src/features/layout/projection.d.ts +7 -0
  121. package/dist/src/index.d.ts +1 -0
  122. package/dist/src/projection/conversion.d.ts +14 -0
  123. package/dist/src/projection/geometry/delta-apply.d.ts +2 -0
  124. package/dist/src/projection/geometry/delta-calc.d.ts +2 -0
  125. package/dist/src/projection/geometry/models.d.ts +3 -0
  126. package/dist/src/projection/node/types.d.ts +16 -0
  127. package/dist/src/projection/utils/each-axis.d.ts +3 -0
  128. package/dist/src/projection/utils/measure.d.ts +3 -0
  129. package/dist/src/render/utils/setters.d.ts +3 -0
  130. package/dist/src/state/motion-state.d.ts +6 -3
  131. package/dist/src/state/utils/is-present.d.ts +2 -0
  132. package/dist/src/state/utils.d.ts +0 -1
  133. package/dist/src/types/framer-motion.d.ts +0 -78
  134. package/dist/src/types/state.d.ts +10 -23
  135. package/dist/src/utils/clamp.d.ts +1 -0
  136. package/dist/src/utils/get-context-window.d.ts +2 -0
  137. package/dist/src/utils/index.d.ts +2 -0
  138. package/dist/src/utils/mix/number.d.ts +1 -0
  139. package/dist/src/utils/noop.d.ts +1 -0
  140. package/dist/src/utils/progress.d.ts +1 -0
  141. package/dist/src/utils/time-conversion.d.ts +8 -0
  142. package/dist/src/value/types/numbers/units.d.ts +30 -0
  143. package/dist/src/value/use-will-change/add-will-change.d.ts +2 -0
  144. package/dist/src/value/use-will-change/is.d.ts +2 -0
  145. package/dist/src/value/use-will-change/types.d.ts +4 -0
  146. package/package.json +5 -3
  147. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/utils/resolve-element.mjs +0 -23
  148. package/dist/es/external/.pnpm/hey-listen@1.0.8/external/hey-listen/dist/hey-listen.es.mjs +0 -20
  149. package/dist/es/features/events.mjs +0 -69
  150. package/dist/es/features/gestures/base.mjs +0 -19
  151. package/dist/es/features/gestures/hover.mjs +0 -46
  152. package/dist/es/features/gestures/in-view.mjs +0 -39
  153. package/dist/es/features/gestures/press.mjs +0 -37
  154. package/dist/es/utils/events.mjs +0 -8
  155. package/dist/src/features/events.d.ts +0 -6
  156. package/dist/src/features/gestures/hover.d.ts +0 -10
  157. package/dist/src/features/gestures/in-view.d.ts +0 -8
  158. package/dist/src/features/gestures/press.d.ts +0 -8
  159. /package/dist/es/{external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/events → events}/add-dom-event.mjs +0 -0
  160. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animate/index.mjs +0 -0
  161. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animate/sequence.mjs +0 -0
  162. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animate/single-value.mjs +0 -0
  163. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.mjs +0 -0
  164. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/utils/accelerated-values.mjs +0 -0
  165. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs +0 -0
  166. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/easing.mjs +0 -0
  167. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/attach-timeline.mjs +0 -0
  168. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs +0 -0
  169. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/memo-supports.mjs +0 -0
  170. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/style.mjs +0 -0
  171. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-flags.mjs +0 -0
  172. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-linear-easing.mjs +0 -0
  173. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-partial-keyframes.mjs +0 -0
  174. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-waapi.mjs +0 -0
  175. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/generators/inertia.mjs +0 -0
  176. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/generators/keyframes.mjs +0 -0
  177. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/generators/utils/calc-duration.mjs +0 -0
  178. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/generators/utils/is-generator.mjs +0 -0
  179. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/generators/utils/velocity.mjs +0 -0
  180. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/interfaces/motion-value.mjs +0 -0
  181. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +0 -0
  182. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/optimized-appear/data-id.mjs +0 -0
  183. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs +0 -0
  184. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs +0 -0
  185. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/sequence/utils/edit.mjs +0 -0
  186. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/sequence/utils/sort.mjs +0 -0
  187. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/create-visual-element.mjs +0 -0
  188. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/default-transitions.mjs +0 -0
  189. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/get-value-transition.mjs +0 -0
  190. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/is-animatable.mjs +0 -0
  191. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/is-animation-controls.mjs +0 -0
  192. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs +0 -0
  193. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs +0 -0
  194. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/is-none.mjs +0 -0
  195. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/is-transition-defined.mjs +0 -0
  196. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/stagger.mjs +0 -0
  197. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/anticipate.mjs +0 -0
  198. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/back.mjs +0 -0
  199. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/circ.mjs +0 -0
  200. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/ease.mjs +0 -0
  201. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/modifiers/mirror.mjs +0 -0
  202. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/modifiers/reverse.mjs +0 -0
  203. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/steps.mjs +0 -0
  204. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/utils/create-generator-easing.mjs +0 -0
  205. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/utils/get-easing-for-segment.mjs +0 -0
  206. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/utils/is-bezier-definition.mjs +0 -0
  207. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/utils/is-easing-array.mjs +0 -0
  208. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/frameloop/batcher.mjs +0 -0
  209. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/frameloop/index-legacy.mjs +0 -0
  210. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/frameloop/microtask.mjs +0 -0
  211. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/frameloop/sync-time.mjs +0 -0
  212. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/motion/features/definitions.mjs +0 -0
  213. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs +0 -0
  214. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/geometry/conversion.mjs +0 -0
  215. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/geometry/copy.mjs +0 -0
  216. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/geometry/delta-apply.mjs +0 -0
  217. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/geometry/delta-calc.mjs +0 -0
  218. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/geometry/delta-remove.mjs +0 -0
  219. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/geometry/models.mjs +0 -0
  220. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/geometry/utils.mjs +0 -0
  221. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs +0 -0
  222. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs +0 -0
  223. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/node/state.mjs +0 -0
  224. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/shared/stack.mjs +0 -0
  225. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/styles/scale-border-radius.mjs +0 -0
  226. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs +0 -0
  227. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/styles/scale-correction.mjs +0 -0
  228. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/styles/transform.mjs +0 -0
  229. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/utils/each-axis.mjs +0 -0
  230. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/utils/has-transform.mjs +0 -0
  231. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/utils/measure.mjs +0 -0
  232. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/VisualElement.mjs +0 -0
  233. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/DOMKeyframesResolver.mjs +0 -0
  234. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/resize/handle-window.mjs +0 -0
  235. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/resize/index.mjs +0 -0
  236. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/info.mjs +0 -0
  237. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/observe.mjs +0 -0
  238. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs +0 -0
  239. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs +0 -0
  240. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs +0 -0
  241. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs +0 -0
  242. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs +0 -0
  243. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs +0 -0
  244. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/supports.mjs +0 -0
  245. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/track.mjs +0 -0
  246. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs +0 -0
  247. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs +0 -0
  248. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/utils/is-svg-element.mjs +0 -0
  249. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs +0 -0
  250. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs +0 -0
  251. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/defaults.mjs +0 -0
  252. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/dimensions.mjs +0 -0
  253. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/find.mjs +0 -0
  254. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs +0 -0
  255. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/number-browser.mjs +0 -0
  256. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/number.mjs +0 -0
  257. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/test.mjs +0 -0
  258. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/transform.mjs +0 -0
  259. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/type-auto.mjs +0 -0
  260. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/type-int.mjs +0 -0
  261. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/html/utils/build-styles.mjs +0 -0
  262. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/html/utils/build-transform.mjs +0 -0
  263. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/html/utils/make-none-animatable.mjs +0 -0
  264. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/html/utils/render.mjs +0 -0
  265. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs +0 -0
  266. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/html/utils/transform.mjs +0 -0
  267. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/object/ObjectVisualElement.mjs +0 -0
  268. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/store.mjs +0 -0
  269. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +0 -0
  270. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/svg/utils/build-attrs.mjs +0 -0
  271. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs +0 -0
  272. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs +0 -0
  273. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/svg/utils/path.mjs +0 -0
  274. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/svg/utils/render.mjs +0 -0
  275. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs +0 -0
  276. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/svg/utils/transform-origin.mjs +0 -0
  277. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/KeyframesResolver.mjs +0 -0
  278. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/compare-by-depth.mjs +0 -0
  279. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/flat-tree.mjs +0 -0
  280. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/is-controlling-variants.mjs +0 -0
  281. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/is-variant-label.mjs +0 -0
  282. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs +0 -0
  283. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/resolve-variants.mjs +0 -0
  284. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/setters.mjs +0 -0
  285. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/variant-props.mjs +0 -0
  286. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/GlobalConfig.mjs +0 -0
  287. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/array.mjs +0 -0
  288. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/clamp.mjs +0 -0
  289. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/delay.mjs +0 -0
  290. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/distance.mjs +0 -0
  291. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/hsla-to-rgba.mjs +0 -0
  292. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/is-browser.mjs +0 -0
  293. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/is-numerical-string.mjs +0 -0
  294. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/is-zero-value-string.mjs +0 -0
  295. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/memo.mjs +0 -0
  296. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/mix/immediate.mjs +0 -0
  297. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/mix/index.mjs +0 -0
  298. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/mix/number.mjs +0 -0
  299. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/mix/visibility.mjs +0 -0
  300. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/offsets/default.mjs +0 -0
  301. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/offsets/fill.mjs +0 -0
  302. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/offsets/time.mjs +0 -0
  303. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/pipe.mjs +0 -0
  304. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/progress.mjs +0 -0
  305. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/reduced-motion/index.mjs +0 -0
  306. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/reduced-motion/state.mjs +0 -0
  307. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/resolve-value.mjs +0 -0
  308. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/subscription-manager.mjs +0 -0
  309. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/time-conversion.mjs +0 -0
  310. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/transform.mjs +0 -0
  311. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/velocity-per-second.mjs +0 -0
  312. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/warn-once.mjs +0 -0
  313. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/wrap.mjs +0 -0
  314. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/color/hex.mjs +0 -0
  315. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/color/hsla.mjs +0 -0
  316. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/color/index.mjs +0 -0
  317. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/color/rgba.mjs +0 -0
  318. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/color/utils.mjs +0 -0
  319. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/complex/filter.mjs +0 -0
  320. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/complex/index.mjs +0 -0
  321. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/numbers/index.mjs +0 -0
  322. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/numbers/units.mjs +0 -0
  323. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/utils/color-regex.mjs +0 -0
  324. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/utils/float-regex.mjs +0 -0
  325. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/utils/is-nullish.mjs +0 -0
  326. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/utils/sanitize.mjs +0 -0
  327. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/utils/single-color-regex.mjs +0 -0
  328. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/use-will-change/add-will-change.mjs +0 -0
  329. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/use-will-change/is.mjs +0 -0
  330. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/utils/is-motion-value.mjs +0 -0
  331. /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/utils/resolve-motion-value.mjs +0 -0
  332. /package/dist/es/external/.pnpm/{framer-motion@11.11.11/external/framer-motion/dist/es/utils → motion-utils@11.14.3/external/motion-utils/dist/es}/errors.mjs +0 -0
  333. /package/dist/es/external/.pnpm/{framer-motion@11.11.11/external/framer-motion/dist/es/utils → motion-utils@11.14.3/external/motion-utils/dist/es}/noop.mjs +0 -0
@@ -0,0 +1,450 @@
1
+ import { addPointerEvent } from "../../../events/add-pointer-event.mjs";
2
+ import { extractEventInfo } from "../../../events/event-info.mjs";
3
+ import { addDomEvent } from "../../../events/add-dom-event.mjs";
4
+ import { getGlobalLock } from "./lock.mjs";
5
+ import { applyConstraints, calcRelativeConstraints, resolveDragElastic, calcViewportConstraints, rebaseAxisConstraints, calcOrigin, defaultElastic } from "./utils/constraints.mjs";
6
+ import { isHTMLElement } from "./utils/is.mjs";
7
+ import { PanSession } from "../pan/PanSession.mjs";
8
+ import { calcLength } from "../../../projection/geometry/delta-calc.mjs";
9
+ import { createBox } from "../../../projection/geometry/models.mjs";
10
+ import { eachAxis } from "../../../projection/utils/each-axis.mjs";
11
+ import { percent } from "../../../value/types/numbers/units.mjs";
12
+ import { addValueToWillChange } from "../../../value/use-will-change/add-will-change.mjs";
13
+ import { measurePageBox } from "../../../projection/utils/measure.mjs";
14
+ import { convertBoxToBoundingBox, convertBoundingBoxToBox } from "../../../projection/conversion.mjs";
15
+ import { animateMotionValue } from "../../../external/.pnpm/framer-motion@11.15.0/external/framer-motion/dist/es/animation/interfaces/motion-value.mjs";
16
+ import { mixNumber } from "../../../utils/mix/number.mjs";
17
+ import { invariant } from "hey-listen";
18
+ import { isPresent } from "../../../state/utils/is-present.mjs";
19
+ import { getContextWindow } from "../../../utils/get-context-window.mjs";
20
+ import { frame } from "../../../external/.pnpm/framer-motion@11.15.0/external/framer-motion/dist/es/frameloop/frame.mjs";
21
+ const elementDragControls = /* @__PURE__ */ new WeakMap();
22
+ class VisualElementDragControls {
23
+ constructor(visualElement) {
24
+ this.openGlobalLock = null;
25
+ this.isDragging = false;
26
+ this.currentDirection = null;
27
+ this.originPoint = { x: 0, y: 0 };
28
+ this.constraints = false;
29
+ this.hasMutatedConstraints = false;
30
+ this.elastic = createBox();
31
+ this.visualElement = visualElement;
32
+ }
33
+ start(originEvent, { snapToCursor = false } = {}) {
34
+ if (!isPresent(this.visualElement))
35
+ return;
36
+ const onSessionStart = (event) => {
37
+ const { dragSnapToOrigin: dragSnapToOrigin2 } = this.getProps();
38
+ dragSnapToOrigin2 ? this.pauseAnimation() : this.stopAnimation();
39
+ if (snapToCursor) {
40
+ this.snapToCursor(extractEventInfo(event, "page").point);
41
+ }
42
+ };
43
+ const onStart = (event, info) => {
44
+ const { drag, dragPropagation, onDragStart } = this.getProps();
45
+ if (drag && !dragPropagation) {
46
+ if (this.openGlobalLock)
47
+ this.openGlobalLock();
48
+ this.openGlobalLock = getGlobalLock(drag);
49
+ if (!this.openGlobalLock)
50
+ return;
51
+ }
52
+ this.isDragging = true;
53
+ this.currentDirection = null;
54
+ this.resolveConstraints();
55
+ if (this.visualElement.projection) {
56
+ this.visualElement.projection.isAnimationBlocked = true;
57
+ this.visualElement.projection.target = void 0;
58
+ }
59
+ eachAxis((axis) => {
60
+ let current = this.getAxisMotionValue(axis).get() || 0;
61
+ if (percent.test(current)) {
62
+ const { projection } = this.visualElement;
63
+ if (projection && projection.layout) {
64
+ const measuredAxis = projection.layout.layoutBox[axis];
65
+ if (measuredAxis) {
66
+ const length = calcLength(measuredAxis);
67
+ current = length * (parseFloat(current) / 100);
68
+ }
69
+ }
70
+ }
71
+ this.originPoint[axis] = current;
72
+ });
73
+ if (onDragStart) {
74
+ frame.postRender(() => onDragStart(event, info));
75
+ }
76
+ addValueToWillChange(this.visualElement, "transform");
77
+ const state = this.visualElement.state;
78
+ state.setActive("whileDrag", true);
79
+ };
80
+ const onMove = (event, info) => {
81
+ const {
82
+ dragPropagation,
83
+ dragDirectionLock,
84
+ onDirectionLock,
85
+ onDrag
86
+ } = this.getProps();
87
+ if (!dragPropagation && !this.openGlobalLock)
88
+ return;
89
+ const { offset } = info;
90
+ if (dragDirectionLock && this.currentDirection === null) {
91
+ this.currentDirection = getCurrentDirection(offset);
92
+ if (this.currentDirection !== null) {
93
+ onDirectionLock && onDirectionLock(this.currentDirection);
94
+ }
95
+ return;
96
+ }
97
+ this.updateAxis("x", info.point, offset);
98
+ this.updateAxis("y", info.point, offset);
99
+ this.visualElement.render();
100
+ onDrag && onDrag(event, info);
101
+ };
102
+ const onSessionEnd = (event, info) => this.stop(event, info);
103
+ const resumeAnimation = () => eachAxis(
104
+ (axis) => {
105
+ var _a;
106
+ return this.getAnimationState(axis) === "paused" && ((_a = this.getAxisMotionValue(axis).animation) == null ? void 0 : _a.play());
107
+ }
108
+ );
109
+ const { dragSnapToOrigin } = this.getProps();
110
+ this.panSession = new PanSession(
111
+ originEvent,
112
+ {
113
+ onSessionStart,
114
+ onStart,
115
+ onMove,
116
+ onSessionEnd,
117
+ resumeAnimation
118
+ },
119
+ {
120
+ transformPagePoint: this.visualElement.getTransformPagePoint(),
121
+ dragSnapToOrigin,
122
+ contextWindow: getContextWindow(this.visualElement)
123
+ }
124
+ );
125
+ }
126
+ stop(event, info) {
127
+ const isDragging = this.isDragging;
128
+ this.cancel();
129
+ if (!isDragging)
130
+ return;
131
+ const { velocity } = info;
132
+ this.startAnimation(velocity);
133
+ const { onDragEnd } = this.getProps();
134
+ if (onDragEnd) {
135
+ frame.postRender(() => onDragEnd(event, info));
136
+ }
137
+ }
138
+ cancel() {
139
+ this.isDragging = false;
140
+ const { projection, animationState } = this.visualElement;
141
+ if (projection) {
142
+ projection.isAnimationBlocked = false;
143
+ }
144
+ this.panSession && this.panSession.end();
145
+ this.panSession = void 0;
146
+ const { dragPropagation } = this.getProps();
147
+ if (!dragPropagation && this.openGlobalLock) {
148
+ this.openGlobalLock();
149
+ this.openGlobalLock = null;
150
+ }
151
+ const state = this.visualElement.state;
152
+ state.setActive("whileDrag", false);
153
+ }
154
+ updateAxis(axis, _point, offset) {
155
+ const { drag } = this.getProps();
156
+ if (!offset || !shouldDrag(axis, drag, this.currentDirection))
157
+ return;
158
+ const axisValue = this.getAxisMotionValue(axis);
159
+ let next = this.originPoint[axis] + offset[axis];
160
+ if (this.constraints && this.constraints[axis]) {
161
+ next = applyConstraints(
162
+ next,
163
+ this.constraints[axis],
164
+ this.elastic[axis]
165
+ );
166
+ }
167
+ axisValue.set(next);
168
+ }
169
+ resolveConstraints() {
170
+ var _a;
171
+ const { dragConstraints, dragElastic } = this.getProps();
172
+ const layout = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(false) : (_a = this.visualElement.projection) == null ? void 0 : _a.layout;
173
+ const prevConstraints = this.constraints;
174
+ if (dragConstraints && isHTMLElement(dragConstraints)) {
175
+ if (!this.constraints) {
176
+ this.constraints = this.resolveRefConstraints();
177
+ }
178
+ } else {
179
+ if (dragConstraints && layout) {
180
+ this.constraints = calcRelativeConstraints(
181
+ layout.layoutBox,
182
+ dragConstraints
183
+ );
184
+ } else {
185
+ this.constraints = false;
186
+ }
187
+ }
188
+ this.elastic = resolveDragElastic(dragElastic);
189
+ if (prevConstraints !== this.constraints && layout && this.constraints && !this.hasMutatedConstraints) {
190
+ eachAxis((axis) => {
191
+ if (this.constraints !== false && this.getAxisMotionValue(axis)) {
192
+ this.constraints[axis] = rebaseAxisConstraints(
193
+ layout.layoutBox[axis],
194
+ this.constraints[axis]
195
+ );
196
+ }
197
+ });
198
+ }
199
+ }
200
+ resolveRefConstraints() {
201
+ const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();
202
+ if (!constraints || !isHTMLElement(constraints))
203
+ return false;
204
+ const constraintsElement = constraints;
205
+ invariant(
206
+ constraintsElement !== null,
207
+ "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop."
208
+ );
209
+ const { projection } = this.visualElement;
210
+ if (!projection || !projection.layout)
211
+ return false;
212
+ const constraintsBox = measurePageBox(
213
+ constraintsElement,
214
+ projection.root,
215
+ this.visualElement.getTransformPagePoint()
216
+ );
217
+ let measuredConstraints = calcViewportConstraints(
218
+ projection.layout.layoutBox,
219
+ constraintsBox
220
+ );
221
+ if (onMeasureDragConstraints) {
222
+ const userConstraints = onMeasureDragConstraints(
223
+ convertBoxToBoundingBox(measuredConstraints)
224
+ );
225
+ this.hasMutatedConstraints = !!userConstraints;
226
+ if (userConstraints) {
227
+ measuredConstraints = convertBoundingBoxToBox(userConstraints);
228
+ }
229
+ }
230
+ return measuredConstraints;
231
+ }
232
+ startAnimation(velocity) {
233
+ const {
234
+ drag,
235
+ dragMomentum,
236
+ dragElastic,
237
+ dragTransition,
238
+ dragSnapToOrigin,
239
+ onDragTransitionEnd
240
+ } = this.getProps();
241
+ const constraints = this.constraints || {};
242
+ const momentumAnimations = eachAxis((axis) => {
243
+ if (!shouldDrag(axis, drag, this.currentDirection)) {
244
+ return;
245
+ }
246
+ let transition = constraints && constraints[axis] || {};
247
+ if (dragSnapToOrigin)
248
+ transition = { min: 0, max: 0 };
249
+ const bounceStiffness = dragElastic ? 200 : 1e6;
250
+ const bounceDamping = dragElastic ? 40 : 1e7;
251
+ const inertia = {
252
+ type: "inertia",
253
+ velocity: dragMomentum ? velocity[axis] : 0,
254
+ bounceStiffness,
255
+ bounceDamping,
256
+ timeConstant: 750,
257
+ restDelta: 1,
258
+ restSpeed: 10,
259
+ ...dragTransition,
260
+ ...transition
261
+ };
262
+ return this.startAxisValueAnimation(axis, inertia);
263
+ });
264
+ return Promise.all(momentumAnimations).then(onDragTransitionEnd);
265
+ }
266
+ startAxisValueAnimation(axis, transition) {
267
+ const axisValue = this.getAxisMotionValue(axis);
268
+ addValueToWillChange(this.visualElement, axis);
269
+ return axisValue.start(
270
+ animateMotionValue(
271
+ axis,
272
+ axisValue,
273
+ 0,
274
+ transition,
275
+ this.visualElement,
276
+ false
277
+ )
278
+ );
279
+ }
280
+ stopAnimation() {
281
+ if (!isPresent(this.visualElement))
282
+ return;
283
+ eachAxis((axis) => this.getAxisMotionValue(axis).stop());
284
+ }
285
+ pauseAnimation() {
286
+ eachAxis((axis) => {
287
+ var _a;
288
+ return (_a = this.getAxisMotionValue(axis).animation) == null ? void 0 : _a.pause();
289
+ });
290
+ }
291
+ getAnimationState(axis) {
292
+ var _a;
293
+ return (_a = this.getAxisMotionValue(axis).animation) == null ? void 0 : _a.state;
294
+ }
295
+ /**
296
+ * Drag works differently depending on which props are provided.
297
+ *
298
+ * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.
299
+ * - Otherwise, we apply the delta to the x/y motion values.
300
+ */
301
+ getAxisMotionValue(axis) {
302
+ const dragKey = `_drag${axis.toUpperCase()}`;
303
+ const props = this.visualElement.getProps();
304
+ const externalMotionValue = props[dragKey];
305
+ return externalMotionValue || this.visualElement.getValue(
306
+ axis,
307
+ (props.initial ? props.initial[axis] : void 0) || 0
308
+ );
309
+ }
310
+ snapToCursor(point) {
311
+ eachAxis((axis) => {
312
+ const { drag } = this.getProps();
313
+ if (!shouldDrag(axis, drag, this.currentDirection))
314
+ return;
315
+ const { projection } = this.visualElement;
316
+ const axisValue = this.getAxisMotionValue(axis);
317
+ if (projection && projection.layout) {
318
+ const { min, max } = projection.layout.layoutBox[axis];
319
+ axisValue.set(point[axis] - mixNumber(min, max, 0.5));
320
+ }
321
+ });
322
+ }
323
+ /**
324
+ * When the viewport resizes we want to check if the measured constraints
325
+ * have changed and, if so, reposition the element within those new constraints
326
+ * relative to where it was before the resize.
327
+ */
328
+ scalePositionWithinConstraints() {
329
+ if (!this.visualElement.current)
330
+ return;
331
+ const { drag, dragConstraints } = this.getProps();
332
+ const { projection } = this.visualElement;
333
+ if (!isHTMLElement(dragConstraints) || !projection || !this.constraints)
334
+ return;
335
+ this.stopAnimation();
336
+ const boxProgress = { x: 0, y: 0 };
337
+ eachAxis((axis) => {
338
+ const axisValue = this.getAxisMotionValue(axis);
339
+ if (axisValue && this.constraints !== false) {
340
+ const latest = axisValue.get();
341
+ boxProgress[axis] = calcOrigin(
342
+ { min: latest, max: latest },
343
+ this.constraints[axis]
344
+ );
345
+ }
346
+ });
347
+ const { transformTemplate } = this.visualElement.getProps();
348
+ this.visualElement.current.style.transform = transformTemplate ? transformTemplate({}, "") : "none";
349
+ projection.root && projection.root.updateScroll();
350
+ projection.updateLayout();
351
+ this.resolveConstraints();
352
+ eachAxis((axis) => {
353
+ if (!shouldDrag(axis, drag, null))
354
+ return;
355
+ const axisValue = this.getAxisMotionValue(axis);
356
+ const { min, max } = this.constraints[axis];
357
+ axisValue.set(mixNumber(min, max, boxProgress[axis]));
358
+ });
359
+ }
360
+ addListeners() {
361
+ if (!this.visualElement.current)
362
+ return;
363
+ elementDragControls.set(this.visualElement, this);
364
+ const element = this.visualElement.current;
365
+ const stopPointerListener = addPointerEvent(
366
+ element,
367
+ "pointerdown",
368
+ (event) => {
369
+ const { drag, dragListener = true } = this.getProps();
370
+ drag && dragListener && this.start(event);
371
+ }
372
+ );
373
+ const measureDragConstraints = () => {
374
+ const { dragConstraints } = this.getProps();
375
+ if (isHTMLElement(dragConstraints)) {
376
+ this.constraints = this.resolveRefConstraints();
377
+ }
378
+ };
379
+ const { projection } = this.visualElement;
380
+ const stopMeasureLayoutListener = projection.addEventListener(
381
+ "measure",
382
+ measureDragConstraints
383
+ );
384
+ if (projection && !projection.layout) {
385
+ projection.root && projection.root.updateScroll();
386
+ projection.updateLayout();
387
+ }
388
+ frame.read(measureDragConstraints);
389
+ const stopResizeListener = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints());
390
+ const stopLayoutUpdateListener = projection.addEventListener(
391
+ "didUpdate",
392
+ ({ delta, hasLayoutChanged }) => {
393
+ if (this.isDragging && hasLayoutChanged) {
394
+ eachAxis((axis) => {
395
+ const motionValue = this.getAxisMotionValue(axis);
396
+ if (!motionValue)
397
+ return;
398
+ this.originPoint[axis] += delta[axis].translate;
399
+ motionValue.set(
400
+ motionValue.get() + delta[axis].translate
401
+ );
402
+ });
403
+ this.visualElement.render();
404
+ }
405
+ }
406
+ );
407
+ return () => {
408
+ stopResizeListener();
409
+ stopPointerListener();
410
+ stopMeasureLayoutListener();
411
+ stopLayoutUpdateListener && stopLayoutUpdateListener();
412
+ };
413
+ }
414
+ getProps() {
415
+ const props = this.visualElement.getProps();
416
+ const {
417
+ drag = false,
418
+ dragDirectionLock = false,
419
+ dragPropagation = false,
420
+ dragConstraints = false,
421
+ dragElastic = defaultElastic,
422
+ dragMomentum = true
423
+ } = props;
424
+ return {
425
+ ...props,
426
+ drag,
427
+ dragDirectionLock,
428
+ dragPropagation,
429
+ dragConstraints,
430
+ dragElastic,
431
+ dragMomentum
432
+ };
433
+ }
434
+ }
435
+ function shouldDrag(direction, drag, currentDirection) {
436
+ return (drag === true || drag === direction) && (currentDirection === null || currentDirection === direction);
437
+ }
438
+ function getCurrentDirection(offset, lockThreshold = 10) {
439
+ let direction = null;
440
+ if (Math.abs(offset.y) > lockThreshold) {
441
+ direction = "y";
442
+ } else if (Math.abs(offset.x) > lockThreshold) {
443
+ direction = "x";
444
+ }
445
+ return direction;
446
+ }
447
+ export {
448
+ VisualElementDragControls,
449
+ elementDragControls
450
+ };
@@ -0,0 +1,26 @@
1
+ import { Feature } from "../../feature.mjs";
2
+ import { VisualElementDragControls } from "./VisualElementDragControls.mjs";
3
+ import { noop } from "../../../external/.pnpm/motion-utils@11.14.3/external/motion-utils/dist/es/noop.mjs";
4
+ import "../../../external/.pnpm/motion-utils@11.14.3/external/motion-utils/dist/es/errors.mjs";
5
+ class DragGesture extends Feature {
6
+ constructor(state) {
7
+ super(state);
8
+ this.removeGroupControls = noop;
9
+ this.removeListeners = noop;
10
+ this.controls = new VisualElementDragControls(state.visualElement);
11
+ }
12
+ mount() {
13
+ const { dragControls } = this.state.options;
14
+ if (dragControls) {
15
+ this.removeGroupControls = dragControls.subscribe(this.controls);
16
+ }
17
+ this.removeListeners = this.controls.addListeners() || noop;
18
+ }
19
+ unmount() {
20
+ this.removeGroupControls();
21
+ this.removeListeners();
22
+ }
23
+ }
24
+ export {
25
+ DragGesture
26
+ };
@@ -0,0 +1,42 @@
1
+ function createLock(name) {
2
+ let lock = null;
3
+ return () => {
4
+ const openLock = () => {
5
+ lock = null;
6
+ };
7
+ if (lock === null) {
8
+ lock = name;
9
+ return openLock;
10
+ }
11
+ return false;
12
+ };
13
+ }
14
+ const globalHorizontalLock = createLock("dragHorizontal");
15
+ const globalVerticalLock = createLock("dragVertical");
16
+ function getGlobalLock(drag) {
17
+ let lock = false;
18
+ if (drag === "y") {
19
+ lock = globalVerticalLock();
20
+ } else if (drag === "x") {
21
+ lock = globalHorizontalLock();
22
+ } else {
23
+ const openHorizontal = globalHorizontalLock();
24
+ const openVertical = globalVerticalLock();
25
+ if (openHorizontal && openVertical) {
26
+ lock = () => {
27
+ openHorizontal();
28
+ openVertical();
29
+ };
30
+ } else {
31
+ if (openHorizontal)
32
+ openHorizontal();
33
+ if (openVertical)
34
+ openVertical();
35
+ }
36
+ }
37
+ return lock;
38
+ }
39
+ export {
40
+ createLock,
41
+ getGlobalLock
42
+ };
@@ -0,0 +1,93 @@
1
+ import { calcLength } from "../../../../projection/geometry/delta-calc.mjs";
2
+ import { clamp } from "../../../../utils/clamp.mjs";
3
+ import { mixNumber } from "../../../../utils/mix/number.mjs";
4
+ import { progress } from "../../../../utils/progress.mjs";
5
+ function applyConstraints(point, { min, max }, elastic) {
6
+ if (min !== void 0 && point < min) {
7
+ point = elastic ? mixNumber(min, point, elastic.min) : Math.max(point, min);
8
+ } else if (max !== void 0 && point > max) {
9
+ point = elastic ? mixNumber(max, point, elastic.max) : Math.min(point, max);
10
+ }
11
+ return point;
12
+ }
13
+ const defaultElastic = 0.35;
14
+ function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {
15
+ return {
16
+ x: calcRelativeAxisConstraints(layoutBox.x, left, right),
17
+ y: calcRelativeAxisConstraints(layoutBox.y, top, bottom)
18
+ };
19
+ }
20
+ function calcRelativeAxisConstraints(axis, min, max) {
21
+ return {
22
+ min: min !== void 0 ? axis.min + min : void 0,
23
+ max: max !== void 0 ? axis.max + max - (axis.max - axis.min) : void 0
24
+ };
25
+ }
26
+ function resolveDragElastic(dragElastic = defaultElastic) {
27
+ if (dragElastic === false) {
28
+ dragElastic = 0;
29
+ } else if (dragElastic === true) {
30
+ dragElastic = defaultElastic;
31
+ }
32
+ return {
33
+ x: resolveAxisElastic(dragElastic, "left", "right"),
34
+ y: resolveAxisElastic(dragElastic, "top", "bottom")
35
+ };
36
+ }
37
+ function resolveAxisElastic(dragElastic, minLabel, maxLabel) {
38
+ return {
39
+ min: resolvePointElastic(dragElastic, minLabel),
40
+ max: resolvePointElastic(dragElastic, maxLabel)
41
+ };
42
+ }
43
+ function resolvePointElastic(dragElastic, label) {
44
+ return typeof dragElastic === "number" ? dragElastic : dragElastic[label] || 0;
45
+ }
46
+ function rebaseAxisConstraints(layout, constraints) {
47
+ const relativeConstraints = {};
48
+ if (constraints.min !== void 0) {
49
+ relativeConstraints.min = constraints.min - layout.min;
50
+ }
51
+ if (constraints.max !== void 0) {
52
+ relativeConstraints.max = constraints.max - layout.min;
53
+ }
54
+ return relativeConstraints;
55
+ }
56
+ function calcViewportConstraints(layoutBox, constraintsBox) {
57
+ return {
58
+ x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),
59
+ y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y)
60
+ };
61
+ }
62
+ function calcViewportAxisConstraints(layoutAxis, constraintsAxis) {
63
+ let min = constraintsAxis.min - layoutAxis.min;
64
+ let max = constraintsAxis.max - layoutAxis.max;
65
+ if (constraintsAxis.max - constraintsAxis.min < layoutAxis.max - layoutAxis.min) {
66
+ [min, max] = [max, min];
67
+ }
68
+ return { min, max };
69
+ }
70
+ function calcOrigin(source, target) {
71
+ let origin = 0.5;
72
+ const sourceLength = calcLength(source);
73
+ const targetLength = calcLength(target);
74
+ if (targetLength > sourceLength) {
75
+ origin = progress(target.min, target.max - sourceLength, source.min);
76
+ } else if (sourceLength > targetLength) {
77
+ origin = progress(source.min, source.max - targetLength, target.min);
78
+ }
79
+ return clamp(0, 1, origin);
80
+ }
81
+ export {
82
+ applyConstraints,
83
+ calcOrigin,
84
+ calcRelativeAxisConstraints,
85
+ calcRelativeConstraints,
86
+ calcViewportAxisConstraints,
87
+ calcViewportConstraints,
88
+ defaultElastic,
89
+ rebaseAxisConstraints,
90
+ resolveAxisElastic,
91
+ resolveDragElastic,
92
+ resolvePointElastic
93
+ };
@@ -0,0 +1,6 @@
1
+ function isHTMLElement(value) {
2
+ return typeof value === "object" && value !== null && "nodeType" in value;
3
+ }
4
+ export {
5
+ isHTMLElement
6
+ };
@@ -0,0 +1,40 @@
1
+ import { Feature } from "../../feature.mjs";
2
+ import { hover } from "motion-dom";
3
+ import { frame } from "../../../external/.pnpm/framer-motion@11.15.0/external/framer-motion/dist/es/frameloop/frame.mjs";
4
+ import { extractEventInfo } from "../press/index.mjs";
5
+ function handleHoverEvent(state, event, lifecycle) {
6
+ const props = state.options;
7
+ if (props.hover) {
8
+ state.setActive("hover", lifecycle === "Start");
9
+ }
10
+ const eventName = `onHover${lifecycle}`;
11
+ const callback = props[eventName];
12
+ if (callback) {
13
+ frame.postRender(() => callback(event, extractEventInfo(event)));
14
+ }
15
+ }
16
+ class HoverGesture extends Feature {
17
+ isActive() {
18
+ return Boolean(this.state.getOptions().hover);
19
+ }
20
+ constructor(state) {
21
+ super(state);
22
+ }
23
+ mount() {
24
+ const element = this.state.element;
25
+ if (!element)
26
+ return;
27
+ this.unmount = hover(
28
+ element,
29
+ (startEvent) => {
30
+ handleHoverEvent(this.state, startEvent, "Start");
31
+ return (endEvent) => {
32
+ handleHoverEvent(this.state, endEvent, "End");
33
+ };
34
+ }
35
+ );
36
+ }
37
+ }
38
+ export {
39
+ HoverGesture
40
+ };
@@ -0,0 +1,39 @@
1
+ import { Feature } from "../../feature.mjs";
2
+ import { inView } from "../../../external/.pnpm/framer-motion@11.15.0/external/framer-motion/dist/es/render/dom/viewport/index.mjs";
3
+ import { frame } from "../../../external/.pnpm/framer-motion@11.15.0/external/framer-motion/dist/es/frameloop/frame.mjs";
4
+ function handleHoverEvent(state, entry, lifecycle) {
5
+ const props = state.options;
6
+ if (props.inView) {
7
+ state.setActive("inView", lifecycle === "Enter");
8
+ }
9
+ const eventName = `onViewport${lifecycle}`;
10
+ const callback = props[eventName];
11
+ if (callback) {
12
+ frame.postRender(() => callback(entry));
13
+ }
14
+ }
15
+ class InViewGesture extends Feature {
16
+ isActive() {
17
+ return Boolean(this.state.getOptions().inView);
18
+ }
19
+ constructor(state) {
20
+ super(state);
21
+ }
22
+ mount() {
23
+ const element = this.state.element;
24
+ if (!element)
25
+ return;
26
+ this.unmount = inView(
27
+ element,
28
+ (entry) => {
29
+ handleHoverEvent(this.state, entry, "Enter");
30
+ return (endEvent) => {
31
+ handleHoverEvent(this.state, entry, "Leave");
32
+ };
33
+ }
34
+ );
35
+ }
36
+ }
37
+ export {
38
+ InViewGesture
39
+ };