motion-v 0.7.0 → 0.8.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 (144) hide show
  1. package/dist/cjs/index.js +290 -134
  2. package/dist/es/animation/hooks/animation-controls.d.ts +8 -0
  3. package/dist/es/animation/hooks/animation-controls.mjs +89 -0
  4. package/dist/es/animation/{use-animate.mjs → hooks/use-animate.mjs} +1 -1
  5. package/dist/es/animation/hooks/use-animation-controls.d.ts +33 -0
  6. package/dist/es/animation/hooks/use-animation-controls.mjs +16 -0
  7. package/dist/es/animation/index.d.ts +2 -0
  8. package/dist/es/animation/types.d.ts +68 -0
  9. package/dist/es/animation/utils.d.ts +2 -0
  10. package/dist/es/animation/utils.mjs +6 -0
  11. package/dist/es/components/animate-presence/AnimatePresence.vue.mjs +2 -2
  12. package/dist/{src → es}/components/index.d.ts +1 -1
  13. package/dist/es/components/motion/Motion.vue.mjs +4 -1
  14. package/dist/{src → es}/components/motion/NameSpace.d.ts +2 -2
  15. package/dist/es/constants/index.mjs +0 -1
  16. package/dist/es/features/animation/animation.d.ts +13 -0
  17. package/dist/es/features/animation/animation.mjs +33 -0
  18. package/dist/es/features/feature-manager.mjs +5 -1
  19. package/dist/{src → es}/features/gestures/drag/types.d.ts +1 -1
  20. package/dist/es/features/gestures/focus/index.d.ts +7 -0
  21. package/dist/es/features/gestures/focus/index.mjs +36 -0
  22. package/dist/es/features/gestures/focus/types.d.ts +6 -0
  23. package/dist/{src → es}/features/index.d.ts +1 -0
  24. package/dist/es/index.mjs +3 -1
  25. package/dist/es/state/animate-updates.d.ts +19 -0
  26. package/dist/es/state/animate-updates.mjs +129 -0
  27. package/dist/es/state/animation/types.d.ts +0 -0
  28. package/dist/{src → es}/state/motion-state.d.ts +2 -4
  29. package/dist/es/state/motion-state.mjs +6 -123
  30. package/dist/es/state/style.mjs +2 -2
  31. package/dist/{src → es}/state/utils.d.ts +1 -1
  32. package/dist/{src → es}/types/state.d.ts +4 -2
  33. package/package.json +6 -5
  34. package/dist/es/components/animate-presence/utils.mjs +0 -10
  35. package/dist/src/animation/index.d.ts +0 -1
  36. package/dist/src/components/animate-presence/utils.d.ts +0 -1
  37. /package/dist/{src/animation → es/animation/hooks}/use-animate.d.ts +0 -0
  38. /package/dist/{src → es}/components/LayoutGroup.d.ts +0 -0
  39. /package/dist/{src → es}/components/animate-presence/AnimatePresence.d.ts +0 -0
  40. /package/dist/{src → es}/components/animate-presence/index.d.ts +0 -0
  41. /package/dist/{src → es}/components/animate-presence/types.d.ts +0 -0
  42. /package/dist/{src → es}/components/animate-presence/use-pop-layout.d.ts +0 -0
  43. /package/dist/{src → es}/components/animate-presence/use-presence.d.ts +0 -0
  44. /package/dist/{src/animation/types.d.ts → es/components/animate-presence/utils.d.ts} +0 -0
  45. /package/dist/{src → es}/components/context.d.ts +0 -0
  46. /package/dist/{src → es}/components/group.d.ts +0 -0
  47. /package/dist/{src → es}/components/hooks/use-motion-elm.d.ts +0 -0
  48. /package/dist/{src → es}/components/motion/Motion.d.ts +0 -0
  49. /package/dist/{src → es}/components/motion/Primitive.d.ts +0 -0
  50. /package/dist/{src → es}/components/motion/Slot.d.ts +0 -0
  51. /package/dist/{src → es}/components/motion/index.d.ts +0 -0
  52. /package/dist/{src → es}/components/motion/renderSlotFragments.d.ts +0 -0
  53. /package/dist/{src → es}/components/motion/utils.d.ts +0 -0
  54. /package/dist/{src → es}/components/motion-config/MotionConfig.d.ts +0 -0
  55. /package/dist/{src → es}/components/motion-config/context.d.ts +0 -0
  56. /package/dist/{src → es}/components/motion-config/index.d.ts +0 -0
  57. /package/dist/{src → es}/components/motion-config/types.d.ts +0 -0
  58. /package/dist/{src → es}/components/presence.d.ts +0 -0
  59. /package/dist/{src → es}/components/use-force-update.d.ts +0 -0
  60. /package/dist/{src → es}/components/use-layout-group.d.ts +0 -0
  61. /package/dist/{src → es}/components/use-slot-change-index.d.ts +0 -0
  62. /package/dist/{src → es}/constants/index.d.ts +0 -0
  63. /package/dist/{src → es}/events/add-dom-event.d.ts +0 -0
  64. /package/dist/{src → es}/events/add-pointer-event.d.ts +0 -0
  65. /package/dist/{src → es}/events/event-info.d.ts +0 -0
  66. /package/dist/{src → es}/events/index.d.ts +0 -0
  67. /package/dist/{src → es}/events/types.d.ts +0 -0
  68. /package/dist/{src → es}/events/utils/index.d.ts +0 -0
  69. /package/dist/{src → es}/events/utils/is-primary-pointer.d.ts +0 -0
  70. /package/dist/{src → es}/features/feature-manager.d.ts +0 -0
  71. /package/dist/{src → es}/features/feature.d.ts +0 -0
  72. /package/dist/{src → es}/features/gestures/base.d.ts +0 -0
  73. /package/dist/{src → es}/features/gestures/drag/VisualElementDragControls.d.ts +0 -0
  74. /package/dist/{src → es}/features/gestures/drag/index.d.ts +0 -0
  75. /package/dist/{src → es}/features/gestures/drag/lock.d.ts +0 -0
  76. /package/dist/{src → es}/features/gestures/drag/use-drag-controls.d.ts +0 -0
  77. /package/dist/{src → es}/features/gestures/drag/utils/constraints.d.ts +0 -0
  78. /package/dist/{src → es}/features/gestures/drag/utils/is.d.ts +0 -0
  79. /package/dist/{src → es}/features/gestures/hover/index.d.ts +0 -0
  80. /package/dist/{src → es}/features/gestures/hover/types.d.ts +0 -0
  81. /package/dist/{src → es}/features/gestures/in-view/index.d.ts +0 -0
  82. /package/dist/{src → es}/features/gestures/in-view/types.d.ts +0 -0
  83. /package/dist/{src → es}/features/gestures/index.d.ts +0 -0
  84. /package/dist/{src → es}/features/gestures/pan/PanSession.d.ts +0 -0
  85. /package/dist/{src → es}/features/gestures/pan/index.d.ts +0 -0
  86. /package/dist/{src → es}/features/gestures/pan/types.d.ts +0 -0
  87. /package/dist/{src → es}/features/gestures/press/index.d.ts +0 -0
  88. /package/dist/{src → es}/features/gestures/press/types.d.ts +0 -0
  89. /package/dist/{src → es}/features/gestures/types.d.ts +0 -0
  90. /package/dist/{src → es}/features/layout/config.d.ts +0 -0
  91. /package/dist/{src → es}/features/layout/layout.d.ts +0 -0
  92. /package/dist/{src → es}/features/layout/projection.d.ts +0 -0
  93. /package/dist/{src → es}/features/layout/types.d.ts +0 -0
  94. /package/dist/{src → es}/features/layout/utils.d.ts +0 -0
  95. /package/dist/{src → es}/features/svg.d.ts +0 -0
  96. /package/dist/{src → es}/index.d.ts +0 -0
  97. /package/dist/{src → es}/projection/conversion.d.ts +0 -0
  98. /package/dist/{src → es}/projection/geometry/delta-apply.d.ts +0 -0
  99. /package/dist/{src → es}/projection/geometry/delta-calc.d.ts +0 -0
  100. /package/dist/{src → es}/projection/geometry/models.d.ts +0 -0
  101. /package/dist/{src → es}/projection/node/types.d.ts +0 -0
  102. /package/dist/{src → es}/projection/utils/each-axis.d.ts +0 -0
  103. /package/dist/{src → es}/projection/utils/measure.d.ts +0 -0
  104. /package/dist/{src → es}/render/utils/setters.d.ts +0 -0
  105. /package/dist/{src → es}/shared/index.d.ts +0 -0
  106. /package/dist/{src → es}/shared/test.d.ts +0 -0
  107. /package/dist/{src → es}/state/animate-variants-children.d.ts +0 -0
  108. /package/dist/{src/animation/use-animation.d.ts → es/state/animation/index.d.ts} +0 -0
  109. /package/dist/{src → es}/state/create-visual-element.d.ts +0 -0
  110. /package/dist/{src → es}/state/event.d.ts +0 -0
  111. /package/dist/{src → es}/state/index.d.ts +0 -0
  112. /package/dist/{src → es}/state/style.d.ts +0 -0
  113. /package/dist/{src → es}/state/transform.d.ts +0 -0
  114. /package/dist/{src → es}/state/utils/is-present.d.ts +0 -0
  115. /package/dist/{src → es}/types/framer-motion.d.ts +0 -0
  116. /package/dist/{src → es}/types/index.d.ts +0 -0
  117. /package/dist/{src → es}/types/motion-values.d.ts +0 -0
  118. /package/dist/{src → es}/types/transform.d.ts +0 -0
  119. /package/dist/{src → es}/utils/clamp.d.ts +0 -0
  120. /package/dist/{src → es}/utils/createContext.d.ts +0 -0
  121. /package/dist/{src → es}/utils/get-context-window.d.ts +0 -0
  122. /package/dist/{src → es}/utils/index.d.ts +0 -0
  123. /package/dist/{src → es}/utils/mix/number.d.ts +0 -0
  124. /package/dist/{src → es}/utils/motion-value.d.ts +0 -0
  125. /package/dist/{src → es}/utils/noop.d.ts +0 -0
  126. /package/dist/{src → es}/utils/progress.d.ts +0 -0
  127. /package/dist/{src → es}/utils/time-conversion.d.ts +0 -0
  128. /package/dist/{src → es}/utils/use-animation-frame.d.ts +0 -0
  129. /package/dist/{src → es}/utils/use-dom-ref.d.ts +0 -0
  130. /package/dist/{src → es}/utils/use-in-view.d.ts +0 -0
  131. /package/dist/{src → es}/value/index.d.ts +0 -0
  132. /package/dist/{src → es}/value/types/numbers/units.d.ts +0 -0
  133. /package/dist/{src → es}/value/use-combine-values.d.ts +0 -0
  134. /package/dist/{src → es}/value/use-computed.d.ts +0 -0
  135. /package/dist/{src → es}/value/use-motion-template.d.ts +0 -0
  136. /package/dist/{src → es}/value/use-motion-value-event.d.ts +0 -0
  137. /package/dist/{src → es}/value/use-scroll.d.ts +0 -0
  138. /package/dist/{src → es}/value/use-spring.d.ts +0 -0
  139. /package/dist/{src → es}/value/use-time.d.ts +0 -0
  140. /package/dist/{src → es}/value/use-transform.d.ts +0 -0
  141. /package/dist/{src → es}/value/use-velocity.d.ts +0 -0
  142. /package/dist/{src → es}/value/use-will-change/add-will-change.d.ts +0 -0
  143. /package/dist/{src → es}/value/use-will-change/is.d.ts +0 -0
  144. /package/dist/{src → es}/value/use-will-change/types.d.ts +0 -0
@@ -10,6 +10,8 @@ import { LayoutGroupState } from '../components/context';
10
10
  import { PanProps } from '../features/gestures/pan/types';
11
11
  import { MotionConfigState } from '../components/motion-config/types';
12
12
  import { $Transition } from './framer-motion';
13
+ import { FocusProps } from '../features/gestures/focus/types';
14
+ import { AnimationControls } from '../animation/types';
13
15
  type AnimationPlaybackControls = ReturnType<typeof animate>;
14
16
  export type TargetResolver = (custom: any, current: Target, velocity: Target) => TargetAndTransition | string;
15
17
  export interface Variant extends DOMKeyframesDefinition {
@@ -30,11 +32,11 @@ export type MotionStyle = Partial<{
30
32
  [K in keyof Variant]: Variant[K] | MotionValue;
31
33
  }>;
32
34
  export type ElementType = keyof IntrinsicElementAttributes;
33
- export interface Options<T = any> extends LayoutOptions, PressProps, HoverProps, InViewProps, DragProps, PanProps {
35
+ export interface Options<T = any> extends LayoutOptions, PressProps, HoverProps, InViewProps, DragProps, PanProps, FocusProps {
34
36
  custom?: T;
35
37
  as?: ElementType;
36
38
  initial?: string | Variant | boolean;
37
- animate?: string | Variant;
39
+ animate?: string | Variant | AnimationControls;
38
40
  exit?: string | Variant;
39
41
  variants?: {
40
42
  [k: string]: Variant | ((custom: T) => Variant);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion-v",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "MIT",
@@ -17,7 +17,7 @@
17
17
  "sideEffects": false,
18
18
  "exports": {
19
19
  ".": {
20
- "types": "./dist/src/index.d.ts",
20
+ "types": "./dist/es/index.d.ts",
21
21
  "import": "./dist/es/index.mjs",
22
22
  "require": "./dist/cjs/index.js"
23
23
  },
@@ -34,12 +34,12 @@
34
34
  },
35
35
  "main": "./dist/cjs/index.js",
36
36
  "module": "./dist/es/index.mjs",
37
- "types": "./dist/src/index.d.ts",
37
+ "types": "./dist/es/index.d.ts",
38
38
  "typesVersions": {
39
39
  "*": {
40
40
  "*": [
41
41
  "./dist/*/index.d.ts",
42
- "./dist/src/index.d.ts"
42
+ "./dist/es/index.d.ts"
43
43
  ],
44
44
  "nuxt": [
45
45
  "./dist/nuxt/index.d.mts",
@@ -55,12 +55,13 @@
55
55
  "vue": ">=3.0.0"
56
56
  },
57
57
  "dependencies": {
58
- "@vueuse/core": "^12.0.0",
58
+ "@vueuse/core": "^10.0.0",
59
59
  "framer-motion": "11.16.6",
60
60
  "hey-listen": "^1.0.8",
61
61
  "motion-dom": "^11.16.4"
62
62
  },
63
63
  "devDependencies": {
64
+ "@testing-library/vue": "^8.1.0",
64
65
  "@vitejs/plugin-vue": "^5.1.4",
65
66
  "@vitejs/plugin-vue-jsx": "^4.0.1",
66
67
  "@vitest/coverage-v8": "^1.4.0",
@@ -1,10 +0,0 @@
1
- function requestIdleCallback(callback) {
2
- if (typeof requestIdleCallback !== "undefined") {
3
- requestIdleCallback(callback);
4
- } else {
5
- setTimeout(callback, 50);
6
- }
7
- }
8
- export {
9
- requestIdleCallback
10
- };
@@ -1 +0,0 @@
1
- export * from './use-animate';
@@ -1 +0,0 @@
1
- export declare function requestIdleCallback(callback: () => void): void;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes