motion-v 0.2.6 → 0.3.1-beta.1

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 (244) hide show
  1. package/dist/cjs/index.js +5858 -0
  2. package/dist/es/animation/use-animate.mjs +31 -0
  3. package/dist/es/components/AnimatePresence.vue.mjs +71 -0
  4. package/dist/es/components/AnimatePresence.vue2.mjs +4 -0
  5. package/dist/es/components/Motion.vue.mjs +116 -0
  6. package/dist/es/components/Motion.vue2.mjs +4 -0
  7. package/dist/es/components/Primitive.mjs +29 -0
  8. package/dist/es/components/Slot.mjs +36 -0
  9. package/dist/es/components/context.mjs +6 -0
  10. package/dist/es/components/presence.mjs +16 -0
  11. package/dist/es/components/renderSlotFragments.mjs +13 -0
  12. package/dist/es/constants/index.mjs +20 -0
  13. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/GroupPlaybackControls.mjs +76 -0
  14. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animate/index.mjs +27 -0
  15. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animate/resolve-subjects.mjs +16 -0
  16. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animate/sequence.mjs +14 -0
  17. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animate/single-value.mjs +11 -0
  18. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animate/subject.mjs +38 -0
  19. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs +243 -0
  20. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/BaseAnimation.mjs +95 -0
  21. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs +275 -0
  22. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.mjs +17 -0
  23. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/utils/accelerated-values.mjs +12 -0
  24. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/utils/can-animate.mjs +30 -0
  25. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/NativeAnimation.mjs +162 -0
  26. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +31 -0
  27. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs +13 -0
  28. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/easing.mjs +37 -0
  29. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/index.mjs +20 -0
  30. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/attach-timeline.mjs +7 -0
  31. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs +9 -0
  32. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/linear.mjs +13 -0
  33. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/memo-supports.mjs +12 -0
  34. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/style.mjs +10 -0
  35. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-flags.mjs +6 -0
  36. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-linear-easing.mjs +12 -0
  37. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-partial-keyframes.mjs +12 -0
  38. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-waapi.mjs +5 -0
  39. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/inertia.mjs +67 -0
  40. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/keyframes.mjs +37 -0
  41. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/spring/find.mjs +83 -0
  42. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/spring/index.mjs +83 -0
  43. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/utils/calc-duration.mjs +15 -0
  44. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/utils/is-generator.mjs +6 -0
  45. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/utils/velocity.mjs +9 -0
  46. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/interfaces/motion-value.mjs +73 -0
  47. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +59 -0
  48. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/optimized-appear/data-id.mjs +7 -0
  49. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs +7 -0
  50. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/sequence/create.mjs +153 -0
  51. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs +15 -0
  52. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/sequence/utils/edit.mjs +26 -0
  53. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/sequence/utils/sort.mjs +14 -0
  54. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/create-visual-element.mjs +43 -0
  55. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/default-transitions.mjs +33 -0
  56. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/get-value-transition.mjs +6 -0
  57. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/is-animatable.mjs +16 -0
  58. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/is-animation-controls.mjs +6 -0
  59. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs +6 -0
  60. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs +6 -0
  61. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/is-none.mjs +13 -0
  62. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/is-transition-defined.mjs +6 -0
  63. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/stagger.mjs +26 -0
  64. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/anticipate.mjs +5 -0
  65. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/back.mjs +11 -0
  66. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/circ.mjs +10 -0
  67. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/cubic-bezier.mjs +28 -0
  68. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/ease.mjs +9 -0
  69. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/modifiers/mirror.mjs +4 -0
  70. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/modifiers/reverse.mjs +4 -0
  71. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/steps.mjs +12 -0
  72. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/utils/create-generator-easing.mjs +14 -0
  73. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/utils/get-easing-for-segment.mjs +8 -0
  74. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/utils/is-bezier-definition.mjs +4 -0
  75. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/utils/is-easing-array.mjs +6 -0
  76. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/utils/map.mjs +35 -0
  77. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/frameloop/batcher.mjs +75 -0
  78. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/frameloop/frame.mjs +9 -0
  79. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/frameloop/index-legacy.mjs +11 -0
  80. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/frameloop/render-step.mjs +63 -0
  81. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/frameloop/sync-time.mjs +21 -0
  82. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/motion/features/definitions.mjs +29 -0
  83. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs +8 -0
  84. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/projection/geometry/conversion.mjs +22 -0
  85. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/projection/geometry/models.mjs +9 -0
  86. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/projection/styles/scale-correction.mjs +4 -0
  87. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/projection/utils/measure.mjs +7 -0
  88. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/VisualElement.mjs +372 -0
  89. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/DOMKeyframesResolver.mjs +101 -0
  90. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/DOMVisualElement.mjs +21 -0
  91. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/resize/handle-element.mjs +62 -0
  92. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/resize/handle-window.mjs +31 -0
  93. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/resize/index.mjs +8 -0
  94. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/index.mjs +63 -0
  95. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/info.mjs +51 -0
  96. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/observe.mjs +18 -0
  97. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs +33 -0
  98. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs +38 -0
  99. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs +36 -0
  100. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs +23 -0
  101. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs +21 -0
  102. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs +39 -0
  103. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/supports.mjs +5 -0
  104. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/track.mjs +67 -0
  105. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs +4 -0
  106. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs +31 -0
  107. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs +14 -0
  108. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/utils/is-svg-element.mjs +6 -0
  109. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/utils/resolve-element.mjs +23 -0
  110. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs +65 -0
  111. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs +12 -0
  112. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/defaults.mjs +25 -0
  113. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/dimensions.mjs +10 -0
  114. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/find.mjs +9 -0
  115. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs +6 -0
  116. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/number-browser.mjs +41 -0
  117. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/number.mjs +18 -0
  118. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/test.mjs +4 -0
  119. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/transform.mjs +31 -0
  120. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/type-auto.mjs +7 -0
  121. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/value-types/type-int.mjs +8 -0
  122. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/viewport/index.mjs +37 -0
  123. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/html/HTMLVisualElement.mjs +55 -0
  124. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/html/utils/build-styles.mjs +42 -0
  125. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/html/utils/build-transform.mjs +47 -0
  126. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/html/utils/make-none-animatable.mjs +22 -0
  127. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/html/utils/render.mjs +9 -0
  128. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs +16 -0
  129. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/html/utils/transform.mjs +24 -0
  130. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/object/ObjectVisualElement.mjs +41 -0
  131. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/store.mjs +4 -0
  132. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +45 -0
  133. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/svg/utils/build-attrs.mjs +46 -0
  134. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs +28 -0
  135. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs +4 -0
  136. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/svg/utils/path.mjs +20 -0
  137. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/svg/utils/render.mjs +12 -0
  138. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs +16 -0
  139. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/svg/utils/transform-origin.mjs +12 -0
  140. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/utils/KeyframesResolver.mjs +134 -0
  141. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/utils/is-controlling-variants.mjs +13 -0
  142. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/utils/is-variant-label.mjs +6 -0
  143. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/utils/motion-values.mjs +37 -0
  144. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs +8 -0
  145. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/utils/resolve-variants.mjs +25 -0
  146. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/utils/setters.mjs +22 -0
  147. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/utils/variant-props.mjs +14 -0
  148. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/GlobalConfig.mjs +7 -0
  149. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/array.mjs +13 -0
  150. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/clamp.mjs +10 -0
  151. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/delay.mjs +22 -0
  152. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/distance.mjs +10 -0
  153. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/errors.mjs +19 -0
  154. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/hsla-to-rgba.mjs +39 -0
  155. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/interpolate.mjs +49 -0
  156. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/is-browser.mjs +4 -0
  157. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/is-numerical-string.mjs +4 -0
  158. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/is-zero-value-string.mjs +4 -0
  159. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/memo.mjs +11 -0
  160. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/mix/color.mjs +44 -0
  161. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/mix/complex.mjs +84 -0
  162. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/mix/immediate.mjs +6 -0
  163. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/mix/index.mjs +12 -0
  164. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/mix/number.mjs +6 -0
  165. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/mix/visibility.mjs +12 -0
  166. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/noop.mjs +4 -0
  167. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/offsets/default.mjs +9 -0
  168. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/offsets/fill.mjs +12 -0
  169. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/offsets/time.mjs +6 -0
  170. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/pipe.mjs +5 -0
  171. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/progress.mjs +7 -0
  172. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/reduced-motion/index.mjs +18 -0
  173. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/reduced-motion/state.mjs +6 -0
  174. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/resolve-value.mjs +7 -0
  175. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/subscription-manager.mjs +32 -0
  176. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/time-conversion.mjs +6 -0
  177. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/transform.mjs +21 -0
  178. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/velocity-per-second.mjs +6 -0
  179. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/warn-once.mjs +10 -0
  180. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/wrap.mjs +7 -0
  181. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/index.mjs +282 -0
  182. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/color/hex.mjs +37 -0
  183. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/color/hsla.mjs +14 -0
  184. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/color/index.mjs +21 -0
  185. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/color/rgba.mjs +18 -0
  186. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/color/utils.mjs +21 -0
  187. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/complex/filter.mjs +27 -0
  188. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/complex/index.mjs +84 -0
  189. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/numbers/index.mjs +19 -0
  190. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/numbers/units.mjs +23 -0
  191. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/utils/color-regex.mjs +4 -0
  192. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/utils/float-regex.mjs +4 -0
  193. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/utils/is-nullish.mjs +6 -0
  194. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/utils/sanitize.mjs +4 -0
  195. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/types/utils/single-color-regex.mjs +4 -0
  196. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/use-will-change/add-will-change.mjs +10 -0
  197. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/use-will-change/is.mjs +7 -0
  198. package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/utils/is-motion-value.mjs +4 -0
  199. package/dist/es/external/.pnpm/hey-listen@1.0.8/external/hey-listen/dist/hey-listen.es.mjs +20 -0
  200. package/dist/es/features/events.mjs +69 -0
  201. package/dist/es/features/feature-manager.mjs +29 -0
  202. package/dist/es/features/feature.mjs +10 -0
  203. package/dist/es/features/gestures/base.mjs +19 -0
  204. package/dist/es/features/gestures/hover.mjs +42 -0
  205. package/dist/es/features/gestures/in-view.mjs +35 -0
  206. package/dist/es/features/gestures/press.mjs +37 -0
  207. package/dist/es/features/svg.mjs +31 -0
  208. package/dist/es/index.mjs +104 -0
  209. package/dist/es/state/event.mjs +6 -0
  210. package/dist/es/state/motion-state.mjs +175 -0
  211. package/dist/es/state/schedule.mjs +30 -0
  212. package/dist/es/state/style.mjs +117 -0
  213. package/dist/es/state/transform.mjs +68 -0
  214. package/dist/es/state/utils.mjs +119 -0
  215. package/dist/es/utils/createContext.mjs +25 -0
  216. package/dist/es/utils/events.mjs +8 -0
  217. package/dist/es/utils/motion-value.mjs +6 -0
  218. package/dist/es/utils/use-animation-frame.mjs +20 -0
  219. package/dist/es/utils/use-in-view.mjs +25 -0
  220. package/dist/es/value/use-combine-values.mjs +27 -0
  221. package/dist/es/value/use-computed.mjs +20 -0
  222. package/dist/es/value/use-motion-template.mjs +22 -0
  223. package/dist/es/value/use-scroll.mjs +56 -0
  224. package/dist/es/value/use-spring.mjs +59 -0
  225. package/dist/es/value/use-time.mjs +10 -0
  226. package/dist/es/value/use-transform.mjs +29 -0
  227. package/dist/src/animation/index.d.ts +1 -0
  228. package/dist/src/animation/use-animate.d.ts +8 -0
  229. package/dist/src/components/Motion.d.ts +3 -3
  230. package/dist/src/features/events.d.ts +1 -1
  231. package/dist/src/features/feature-manager.d.ts +9 -0
  232. package/dist/src/features/feature.d.ts +0 -7
  233. package/dist/src/features/index.d.ts +2 -1
  234. package/dist/src/index.d.ts +3 -0
  235. package/dist/src/state/motion-state.d.ts +1 -1
  236. package/dist/src/state/utils.d.ts +1 -1
  237. package/dist/src/types/state.d.ts +3 -2
  238. package/dist/src/utils/index.d.ts +2 -0
  239. package/dist/src/utils/use-dom-ref.d.ts +1 -0
  240. package/dist/src/utils/use-in-view.d.ts +3 -0
  241. package/package.json +8 -7
  242. package/dist/index.js +0 -4011
  243. package/dist/index.umd.cjs +0 -1
  244. package/dist/src/components/usePrimitiveElement.d.ts +0 -5
@@ -0,0 +1,69 @@
1
+ import { Feature } from "./feature.mjs";
2
+ class EventFeature extends Feature {
3
+ constructor() {
4
+ super(...arguments);
5
+ this.handlers = {};
6
+ }
7
+ mount() {
8
+ const element = this.state.getElement();
9
+ if (!element)
10
+ return;
11
+ this.handlers.motionstart = (event) => {
12
+ var _a, _b;
13
+ const target = event.detail.target;
14
+ (_b = (_a = this.state.getOptions()).onMotionStart) == null ? void 0 : _b.call(_a, target);
15
+ };
16
+ this.handlers.motioncomplete = (event) => {
17
+ var _a, _b;
18
+ const target = event.detail.target;
19
+ (_b = (_a = this.state.getOptions()).onMotionComplete) == null ? void 0 : _b.call(_a, target);
20
+ };
21
+ this.handlers.hoverstart = (event) => {
22
+ var _a, _b;
23
+ const e = event.detail;
24
+ (_b = (_a = this.state.getOptions()).onHoverStart) == null ? void 0 : _b.call(_a, e);
25
+ };
26
+ this.handlers.hoverend = (event) => {
27
+ var _a, _b;
28
+ const e = event.detail;
29
+ (_b = (_a = this.state.getOptions()).onHoverEnd) == null ? void 0 : _b.call(_a, e);
30
+ };
31
+ this.handlers.pressstart = (event) => {
32
+ var _a, _b;
33
+ const e = event.detail;
34
+ (_b = (_a = this.state.getOptions()).onPressStart) == null ? void 0 : _b.call(_a, e);
35
+ };
36
+ this.handlers.pressend = (event) => {
37
+ var _a, _b;
38
+ const e = event.detail;
39
+ (_b = (_a = this.state.getOptions()).onPressEnd) == null ? void 0 : _b.call(_a, e);
40
+ };
41
+ this.handlers.viewenter = (event) => {
42
+ var _a, _b;
43
+ const target = event.detail.target;
44
+ (_b = (_a = this.state.getOptions()).onViewEnter) == null ? void 0 : _b.call(_a, target);
45
+ };
46
+ this.handlers.viewleave = (event) => {
47
+ var _a, _b;
48
+ const target = event.detail.target;
49
+ (_b = (_a = this.state.getOptions()).onViewLeave) == null ? void 0 : _b.call(_a, target);
50
+ };
51
+ Object.entries(this.handlers).forEach(([event, handler]) => {
52
+ element.addEventListener(event, handler);
53
+ });
54
+ }
55
+ unmount() {
56
+ const element = this.state.getElement();
57
+ if (!element)
58
+ return;
59
+ Object.entries(this.handlers).forEach(([event, handler]) => {
60
+ if (handler) {
61
+ element.removeEventListener(event, handler);
62
+ delete this.handlers[event];
63
+ }
64
+ });
65
+ }
66
+ }
67
+ export {
68
+ EventFeature
69
+ };
@@ -0,0 +1,29 @@
1
+ import { EventFeature } from "./events.mjs";
2
+ import { SVGFeature } from "./svg.mjs";
3
+ import { HoverGesture } from "./gestures/hover.mjs";
4
+ import { PressGesture } from "./gestures/press.mjs";
5
+ import { InViewGesture } from "./gestures/in-view.mjs";
6
+ class FeatureManager {
7
+ constructor(state) {
8
+ this.features = [];
9
+ this.features = [
10
+ new HoverGesture(state),
11
+ new PressGesture(state),
12
+ new InViewGesture(state),
13
+ new SVGFeature(state),
14
+ new EventFeature(state)
15
+ ];
16
+ }
17
+ mount() {
18
+ this.features.forEach((feature) => feature.mount());
19
+ }
20
+ unmount() {
21
+ this.features.forEach((feature) => feature.unmount());
22
+ }
23
+ update() {
24
+ this.features.forEach((feature) => feature.update());
25
+ }
26
+ }
27
+ export {
28
+ FeatureManager
29
+ };
@@ -0,0 +1,10 @@
1
+ class Feature {
2
+ constructor(state) {
3
+ this.state = state;
4
+ }
5
+ update() {
6
+ }
7
+ }
8
+ export {
9
+ Feature
10
+ };
@@ -0,0 +1,19 @@
1
+ import { Feature } from "../feature.mjs";
2
+ class BaseGesture extends Feature {
3
+ updateGestureSubscriptions() {
4
+ const isActive = this.isActive();
5
+ if (isActive && !this.removeGestureSubscriptions) {
6
+ this.removeGestureSubscriptions = this.subscribeEvents();
7
+ } else if (!isActive && this.removeGestureSubscriptions) {
8
+ this.removeGestureSubscriptions();
9
+ this.removeGestureSubscriptions = void 0;
10
+ }
11
+ }
12
+ unmount() {
13
+ var _a;
14
+ (_a = this.removeGestureSubscriptions) == null ? void 0 : _a.call(this);
15
+ }
16
+ }
17
+ export {
18
+ BaseGesture
19
+ };
@@ -0,0 +1,42 @@
1
+ import { dispatchPointerEvent } from "../../utils/events.mjs";
2
+ import { BaseGesture } from "./base.mjs";
3
+ function mouseEvent(element, name, action) {
4
+ return (event) => {
5
+ if (event.pointerType && event.pointerType !== "mouse")
6
+ return;
7
+ action();
8
+ dispatchPointerEvent(element, name, event);
9
+ };
10
+ }
11
+ class HoverGesture extends BaseGesture {
12
+ isActive() {
13
+ return Boolean(this.state.getOptions().hover);
14
+ }
15
+ constructor(state) {
16
+ super(state);
17
+ this.subscribeEvents = () => {
18
+ const element = this.state.getElement();
19
+ const onEnter = mouseEvent(element, "hoverstart", () => {
20
+ this.state.setActive("hover", true);
21
+ });
22
+ const onLeave = mouseEvent(element, "hoverend", () => {
23
+ this.state.setActive("hover", false);
24
+ });
25
+ element.addEventListener("pointerenter", onEnter);
26
+ element.addEventListener("pointerleave", onLeave);
27
+ return () => {
28
+ element.removeEventListener("pointerenter", onEnter);
29
+ element.removeEventListener("pointerleave", onLeave);
30
+ };
31
+ };
32
+ }
33
+ mount() {
34
+ this.updateGestureSubscriptions();
35
+ }
36
+ update() {
37
+ this.updateGestureSubscriptions();
38
+ }
39
+ }
40
+ export {
41
+ HoverGesture
42
+ };
@@ -0,0 +1,35 @@
1
+ import { dispatchPointerEvent } from "../../utils/events.mjs";
2
+ import { inView } from "../../external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/viewport/index.mjs";
3
+ import { BaseGesture } from "./base.mjs";
4
+ class InViewGesture extends BaseGesture {
5
+ isActive() {
6
+ return Boolean(this.state.getOptions().inView);
7
+ }
8
+ constructor(state) {
9
+ super(state);
10
+ this.subscribeEvents = () => {
11
+ var _a;
12
+ const element = this.state.getElement();
13
+ const { once, ...viewOptions } = ((_a = this.state.getOptions()) == null ? void 0 : _a.inViewOptions) || {};
14
+ return inView(element, (enterEntry) => {
15
+ this.state.setActive("inView", true);
16
+ dispatchPointerEvent(element, "viewenter", enterEntry);
17
+ if (!once) {
18
+ return (leaveEntry) => {
19
+ this.state.setActive("inView", false);
20
+ dispatchPointerEvent(element, "viewleave", leaveEntry);
21
+ };
22
+ }
23
+ }, viewOptions);
24
+ };
25
+ }
26
+ mount() {
27
+ this.updateGestureSubscriptions();
28
+ }
29
+ update() {
30
+ this.updateGestureSubscriptions();
31
+ }
32
+ }
33
+ export {
34
+ InViewGesture
35
+ };
@@ -0,0 +1,37 @@
1
+ import { dispatchPointerEvent } from "../../utils/events.mjs";
2
+ import { BaseGesture } from "./base.mjs";
3
+ class PressGesture extends BaseGesture {
4
+ isActive() {
5
+ return Boolean(this.state.getOptions().press);
6
+ }
7
+ constructor(state) {
8
+ super(state);
9
+ this.subscribeEvents = () => {
10
+ const element = this.state.getElement();
11
+ const onPointerUp = (event) => {
12
+ this.state.setActive("press", false);
13
+ dispatchPointerEvent(element, "pressend", event);
14
+ window.removeEventListener("pointerup", onPointerUp);
15
+ };
16
+ const onPointerDown = (event) => {
17
+ this.state.setActive("press", true);
18
+ dispatchPointerEvent(element, "pressstart", event);
19
+ window.addEventListener("pointerup", onPointerUp);
20
+ };
21
+ element.addEventListener("pointerdown", onPointerDown);
22
+ return () => {
23
+ element.removeEventListener("pointerdown", onPointerDown);
24
+ window.removeEventListener("pointerup", onPointerUp);
25
+ };
26
+ };
27
+ }
28
+ mount() {
29
+ this.updateGestureSubscriptions();
30
+ }
31
+ update() {
32
+ this.updateGestureSubscriptions();
33
+ }
34
+ }
35
+ export {
36
+ PressGesture
37
+ };
@@ -0,0 +1,31 @@
1
+ import { Feature } from "./feature.mjs";
2
+ import { frame } from "../external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/frameloop/frame.mjs";
3
+ function isSVGElement(element) {
4
+ return element instanceof SVGElement && element.tagName !== "svg";
5
+ }
6
+ class SVGFeature extends Feature {
7
+ mount() {
8
+ const instance = this.state.getElement();
9
+ if (!isSVGElement(instance)) {
10
+ return;
11
+ }
12
+ const visualElement = this.state.visualElement;
13
+ frame.read(() => {
14
+ try {
15
+ visualElement.renderState.dimensions = typeof instance.getBBox === "function" ? instance.getBBox() : instance.getBoundingClientRect();
16
+ } catch (e) {
17
+ visualElement.renderState.dimensions = {
18
+ x: 0,
19
+ y: 0,
20
+ width: 0,
21
+ height: 0
22
+ };
23
+ }
24
+ });
25
+ }
26
+ unmount() {
27
+ }
28
+ }
29
+ export {
30
+ SVGFeature
31
+ };
@@ -0,0 +1,104 @@
1
+ import { default as default2 } from "./components/Motion.vue.mjs";
2
+ import { default as default3 } from "./components/AnimatePresence.vue.mjs";
3
+ import { components, utilities } from "./constants/index.mjs";
4
+ import { MotionValue, motionValue, motionValue as motionValue2 } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/value/index.mjs";
5
+ import { animate, createScopedAnimate } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animate/index.mjs";
6
+ import { animateMini } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs";
7
+ import { scroll } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/index.mjs";
8
+ import { scrollInfo } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/scroll/track.mjs";
9
+ import { inView } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/viewport/index.mjs";
10
+ import { anticipate } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/anticipate.mjs";
11
+ import { backIn, backInOut, backOut } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/back.mjs";
12
+ import { circIn, circInOut, circOut } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/circ.mjs";
13
+ import { easeIn, easeInOut, easeOut } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/ease.mjs";
14
+ import { cubicBezier } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/cubic-bezier.mjs";
15
+ import { steps } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/steps.mjs";
16
+ import { mirrorEasing } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/modifiers/mirror.mjs";
17
+ import { reverseEasing } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/easing/modifiers/reverse.mjs";
18
+ import { spring } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/spring/index.mjs";
19
+ import { inertia } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/inertia.mjs";
20
+ import { keyframes } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/generators/keyframes.mjs";
21
+ import { stagger } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/stagger.mjs";
22
+ import { transform } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/transform.mjs";
23
+ import { clamp } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/clamp.mjs";
24
+ import { delayInSeconds } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/delay.mjs";
25
+ import { distance, distance2D } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/distance.mjs";
26
+ import { invariant, warning } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/errors.mjs";
27
+ import { interpolate } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/interpolate.mjs";
28
+ import { mix } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/mix/index.mjs";
29
+ import { pipe } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/pipe.mjs";
30
+ import { progress } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/progress.mjs";
31
+ import { wrap } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/utils/wrap.mjs";
32
+ import { cancelSync, sync } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/frameloop/index-legacy.mjs";
33
+ import { cancelFrame, frame, frameData, frameSteps } from "./external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/frameloop/frame.mjs";
34
+ import { useTransform } from "./value/use-transform.mjs";
35
+ import { useTime } from "./value/use-time.mjs";
36
+ import { useMotionTemplate } from "./value/use-motion-template.mjs";
37
+ import { useSpring } from "./value/use-spring.mjs";
38
+ import { useScroll } from "./value/use-scroll.mjs";
39
+ import { useAnimate } from "./animation/use-animate.mjs";
40
+ import { createContext } from "./utils/createContext.mjs";
41
+ import { isMotionValue } from "./utils/motion-value.mjs";
42
+ import { useInView } from "./utils/use-in-view.mjs";
43
+ import { useAnimationFrame } from "./utils/use-animation-frame.mjs";
44
+ export {
45
+ default3 as AnimatePresence,
46
+ default2 as Motion,
47
+ MotionValue,
48
+ animate,
49
+ animateMini,
50
+ anticipate,
51
+ backIn,
52
+ backInOut,
53
+ backOut,
54
+ cancelFrame,
55
+ cancelSync,
56
+ circIn,
57
+ circInOut,
58
+ circOut,
59
+ clamp,
60
+ components,
61
+ createContext,
62
+ createScopedAnimate,
63
+ cubicBezier,
64
+ delayInSeconds as delay,
65
+ distance,
66
+ distance2D,
67
+ easeIn,
68
+ easeInOut,
69
+ easeOut,
70
+ frame,
71
+ frameData,
72
+ frameSteps,
73
+ inView,
74
+ inertia,
75
+ interpolate,
76
+ invariant,
77
+ isMotionValue,
78
+ keyframes,
79
+ mirrorEasing,
80
+ mix,
81
+ motionValue,
82
+ pipe,
83
+ progress,
84
+ reverseEasing,
85
+ scroll,
86
+ scrollInfo,
87
+ spring,
88
+ stagger,
89
+ steps,
90
+ sync,
91
+ transform,
92
+ useAnimate,
93
+ useAnimationFrame,
94
+ useInView,
95
+ useMotionTemplate,
96
+ motionValue2 as useMotionValue,
97
+ useScroll,
98
+ useSpring,
99
+ useTime,
100
+ useTransform,
101
+ utilities,
102
+ warning,
103
+ wrap
104
+ };
@@ -0,0 +1,6 @@
1
+ function motionEvent(name, target, isExit) {
2
+ return new CustomEvent(name, { detail: { target, isExit } });
3
+ }
4
+ export {
5
+ motionEvent
6
+ };
@@ -0,0 +1,175 @@
1
+ import { invariant } from "../external/.pnpm/hey-listen@1.0.8/external/hey-listen/dist/hey-listen.es.mjs";
2
+ import { visualElementStore } from "../external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/store.mjs";
3
+ import { createDOMVisualElement } from "../external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/utils/create-visual-element.mjs";
4
+ import { isDef } from "@vueuse/core";
5
+ import { resolveVariant, getOptions, hasChanged, noop } from "./utils.mjs";
6
+ import { FeatureManager } from "../features/feature-manager.mjs";
7
+ import { style } from "./style.mjs";
8
+ import { transformResetValue } from "./transform.mjs";
9
+ import { scheduleAnimation, unscheduleAnimation } from "./schedule.mjs";
10
+ import { motionEvent } from "./event.mjs";
11
+ import { animate } from "../external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/animation/animate/index.mjs";
12
+ const STATE_TYPES = ["initial", "animate", "inView", "hover", "press", "exit", "drag"];
13
+ const mountedStates = /* @__PURE__ */ new WeakMap();
14
+ class MotionState {
15
+ constructor(options, parent) {
16
+ this.element = null;
17
+ this.activeStates = {
18
+ initial: true,
19
+ animate: true
20
+ };
21
+ this._context = null;
22
+ this.options = options;
23
+ this.parent = parent;
24
+ this.depth = (parent == null ? void 0 : parent.depth) + 1 || 0;
25
+ const initialVariantSource = options.initial === false ? "animate" : "initial";
26
+ this.featureManager = new FeatureManager(this);
27
+ this.initTarget(initialVariantSource);
28
+ }
29
+ get context() {
30
+ if (!this._context) {
31
+ const handler = {
32
+ get: (target, prop) => {
33
+ var _a;
34
+ return typeof this.options[prop] === "string" ? this.options[prop] : (_a = this.parent) == null ? void 0 : _a.context[prop];
35
+ }
36
+ };
37
+ this._context = new Proxy({}, handler);
38
+ }
39
+ return this._context;
40
+ }
41
+ initTarget(initialVariantSource) {
42
+ this.baseTarget = resolveVariant(this.options[initialVariantSource] || this.context[initialVariantSource], this.options.variants) || {};
43
+ this.target = { ...this.baseTarget };
44
+ }
45
+ get initial() {
46
+ return isDef(this.options.initial) ? this.options.initial : this.context.initial;
47
+ }
48
+ mount(element) {
49
+ var _a;
50
+ invariant(
51
+ Boolean(element),
52
+ "Animation state must be mounted with valid Element"
53
+ );
54
+ this.element = element;
55
+ mountedStates.set(element, this);
56
+ if (!visualElementStore.get(element)) {
57
+ createDOMVisualElement(element);
58
+ }
59
+ const visualElement = visualElementStore.get(element);
60
+ this.visualElement = visualElement;
61
+ visualElement.update(this.options, (_a = this.parent) == null ? void 0 : _a.context);
62
+ if (typeof this.initial === "object") {
63
+ for (const key in this.initial) {
64
+ visualElement.setStaticValue(key, this.initial[key]);
65
+ }
66
+ } else if (typeof this.initial === "string" && this.options.variants) {
67
+ for (const key in this.options.variants[this.initial]) {
68
+ visualElement.setStaticValue(key, this.options.variants[this.initial][key]);
69
+ }
70
+ }
71
+ this.featureManager.mount();
72
+ }
73
+ unmount() {
74
+ var _a;
75
+ mountedStates.delete(this.element);
76
+ unscheduleAnimation(this);
77
+ (_a = visualElementStore.get(this.element)) == null ? void 0 : _a.unmount();
78
+ this.featureManager.unmount();
79
+ }
80
+ update(options) {
81
+ var _a;
82
+ this.options = options;
83
+ this.visualElement.update(this.options, (_a = this.parent) == null ? void 0 : _a.context);
84
+ this.featureManager.update();
85
+ scheduleAnimation(this);
86
+ }
87
+ setActive(name, isActive) {
88
+ if (!this.element)
89
+ return;
90
+ this.activeStates[name] = isActive;
91
+ scheduleAnimation(this);
92
+ }
93
+ *animateUpdates() {
94
+ const prevTarget = this.target;
95
+ this.target = {};
96
+ const animationOptions = {};
97
+ for (const name of STATE_TYPES) {
98
+ if (!this.activeStates[name])
99
+ continue;
100
+ const variant = resolveVariant(
101
+ isDef(this.options[name]) ? this.options[name] : this.context[name],
102
+ this.options.variants,
103
+ this.options.custom
104
+ );
105
+ if (!variant)
106
+ continue;
107
+ const allTarget = { ...prevTarget, ...variant };
108
+ for (const key in allTarget) {
109
+ if (key === "transition")
110
+ continue;
111
+ this.target[key] = variant[key];
112
+ animationOptions[key] = getOptions(
113
+ variant.transition ?? this.options.transition ?? {},
114
+ key
115
+ );
116
+ }
117
+ }
118
+ const allTargetKeys = /* @__PURE__ */ new Set([
119
+ ...Object.keys(this.target),
120
+ ...Object.keys(prevTarget)
121
+ ]);
122
+ const animationFactories = [];
123
+ allTargetKeys.forEach((key) => {
124
+ var _a;
125
+ if (this.target[key] === void 0) {
126
+ this.target[key] = this.baseTarget[key];
127
+ }
128
+ if (hasChanged(prevTarget[key], this.target[key])) {
129
+ (_a = this.baseTarget)[key] ?? (_a[key] = style.get(this.element, key));
130
+ animationFactories.push(
131
+ () => {
132
+ return animate(
133
+ this.element,
134
+ {
135
+ [key]: this.target[key] === "none" ? transformResetValue[key] : this.target[key]
136
+ },
137
+ animationOptions[key] || {}
138
+ );
139
+ }
140
+ );
141
+ }
142
+ });
143
+ yield;
144
+ const animations = animationFactories.map((factory) => factory()).filter(Boolean);
145
+ if (!animations.length)
146
+ return;
147
+ const animationTarget = this.target;
148
+ this.element.dispatchEvent(motionEvent("motionstart", animationTarget));
149
+ const isExit = this.activeStates.exit;
150
+ Promise.all(animations).then(() => {
151
+ this.element.dispatchEvent(motionEvent("motioncomplete", {
152
+ ...animationTarget
153
+ }, isExit));
154
+ }).catch(noop);
155
+ }
156
+ isMounted() {
157
+ return Boolean(this.element);
158
+ }
159
+ getDepth() {
160
+ return this.depth;
161
+ }
162
+ getOptions() {
163
+ return this.options;
164
+ }
165
+ getElement() {
166
+ return this.element;
167
+ }
168
+ getTarget() {
169
+ return this.target;
170
+ }
171
+ }
172
+ export {
173
+ MotionState,
174
+ mountedStates
175
+ };
@@ -0,0 +1,30 @@
1
+ import { addUniqueItem, removeItem } from "./utils.mjs";
2
+ let scheduled;
3
+ const fireNext = (iterator) => iterator.next();
4
+ const fireAnimateUpdates = (state) => state.animateUpdates();
5
+ function processScheduledAnimations() {
6
+ if (!scheduled)
7
+ return;
8
+ const generators = scheduled.sort(compareByDepth).map(fireAnimateUpdates);
9
+ generators.forEach(fireNext);
10
+ generators.forEach(fireNext);
11
+ scheduled = void 0;
12
+ }
13
+ function scheduleAnimation(state) {
14
+ if (!scheduled) {
15
+ scheduled = [state];
16
+ requestAnimationFrame(processScheduledAnimations);
17
+ } else {
18
+ addUniqueItem(scheduled, state);
19
+ }
20
+ }
21
+ function unscheduleAnimation(state) {
22
+ scheduled && removeItem(scheduled, state);
23
+ }
24
+ function compareByDepth(a, b) {
25
+ return a.getDepth() - b.getDepth();
26
+ }
27
+ export {
28
+ scheduleAnimation,
29
+ unscheduleAnimation
30
+ };