Skip to content

Commit 781dd63

Browse files
authored
Merge pull request #174 from motiondivision/chore/update-motion
feat: update motion to 12.18.1
2 parents f7bf5cb + d21840b commit 781dd63

File tree

16 files changed

+68
-78
lines changed

16 files changed

+68
-78
lines changed

packages/motion/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@
7474
},
7575
"dependencies": {
7676
"@vueuse/core": "^10.0.0",
77-
"framer-motion": "12.16.0",
78-
"hey-listen": "^1.0.8"
77+
"framer-motion": "12.18.1",
78+
"hey-listen": "^1.0.8",
79+
"motion-dom": "12.18.1"
7980
},
8081
"devDependencies": {
8182
"vue": "3.4.38"

packages/motion/src/animation/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { MotionState } from '@/state'
2-
import type { $Transition, Options } from '@/types'
2+
import type { Options } from '@/types'
33
/**
44
* @public
55
*/
@@ -35,7 +35,7 @@ export interface AnimationControls {
3535
*/
3636
start: (
3737
definition: Options['animate'],
38-
transitionOverride?: $Transition
38+
transitionOverride?: Options['transition']
3939
) => Promise<any>
4040

4141
/**

packages/motion/src/features/animation/animation.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { motionEvent } from '@/state/event'
77
import { style } from '@/state/style'
88
import { transformResetValue } from '@/state/transform'
99
import { hasChanged, resolveVariant } from '@/state/utils'
10-
import type { $Transition, AnimationFactory, Options, Variant } from '@/types'
10+
import type { $Transition, AnimationFactory, Options, VariantType } from '@/types'
1111
import { isDef } from '@vueuse/core'
1212
import type { VisualElement } from 'framer-motion'
1313
import { animate, noop } from 'framer-motion/dom'
@@ -202,11 +202,11 @@ export class AnimationFeature extends Feature {
202202
}: {
203203
controlActiveState: Partial<Record<string, boolean>> | undefined
204204
directAnimate: Options['animate']
205-
directTransition: $Transition | undefined
205+
directTransition: Options['transition'] | undefined
206206
},
207207
) {
208208
let variantTransition = this.state.options.transition
209-
let variant: Variant = {}
209+
let variant: VariantType = {}
210210
const { variants, custom, transition, animatePresenceContext } = this.state.options
211211
const customValue = custom ?? animatePresenceContext?.custom
212212

packages/motion/src/features/animation/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { $Transition, Options } from '@/types'
1+
import type { Options } from '@/types'
22

33
/**
44
* Core animation update function that handles all animation state changes and execution
@@ -11,7 +11,7 @@ export interface AnimateUpdatesOptions {
1111
controlActiveState?: Partial<Record<string, boolean>>
1212
controlDelay?: number
1313
directAnimate?: Options['animate']
14-
directTransition?: $Transition
14+
directTransition?: Options['transition']
1515
isFallback?: boolean
1616
isExit?: boolean
1717
}

packages/motion/src/features/gestures/drag/VisualElementDragControls.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { eachAxis } from '@/projection/utils/each-axis'
1212
import type { Options } from '@/types'
1313
import { getContextWindow } from '@/utils'
1414
import { addValueToWillChange } from '@/value/use-will-change/add-will-change'
15-
import type { Axis, BoundingBox, Point, Transition, VisualElement } from 'framer-motion'
15+
import type { AnimationGeneratorType, Axis, BoundingBox, Point, Transition, VisualElement } from 'framer-motion'
1616
import { frame, mixNumber, percent } from 'framer-motion/dom'
1717
import { measurePageBox } from '@/projection/utils/measure'
1818
import { convertBoundingBoxToBox, convertBoxToBoundingBox } from '@/projection/conversion'
@@ -419,7 +419,7 @@ export class VisualElementDragControls {
419419
const bounceDamping = dragElastic ? 40 : 10000000
420420

421421
const inertia = {
422-
type: 'inertia',
422+
type: 'inertia' as AnimationGeneratorType,
423423
velocity: dragMomentum ? velocity[axis] : 0,
424424
bounceStiffness,
425425
bounceDamping,

packages/motion/src/features/gestures/drag/types.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { DragControls } from '@/features/gestures/drag/use-drag-controls'
2-
import type { Variant, VariantLabels } from '@/types'
2+
import type { VariantType } from '@/types'
33
import type { Axis, BoundingBox, DragElastic, InertiaOptions, PanInfo } from 'framer-motion'
4+
import type { VariantLabels } from 'motion-dom'
45

56
export interface ResolvedConstraints {
67
x: Partial<Axis>
@@ -236,5 +237,5 @@ export interface DragProps extends DragHandlers {
236237
* ```
237238
*/
238239
dragControls?: DragControls
239-
whileDrag?: VariantLabels | Variant
240+
whileDrag?: VariantLabels | VariantType
240241
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import type { Variant, VariantLabels } from '@/types'
1+
import type { VariantType } from '@/types'
2+
import type { VariantLabels } from 'motion-dom'
23

34
export type FocusProps = {
45
/**
56
* @deprecated Use `whileFocus` instead.
67
*/
7-
focus?: VariantLabels | Variant
8+
focus?: VariantLabels | VariantType
89
/**
910
* Variant to apply when the element is focused.
1011
*/
11-
whileFocus?: VariantLabels | Variant
12+
whileFocus?: VariantLabels | VariantType
1213
onFocus?: (e: FocusEvent) => void
1314
onBlur?: (e: FocusEvent) => void
1415
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
import type { Variant, VariantLabels } from '@/types'
1+
import type { VariantType } from '@/types'
22
import type { EventInfo } from 'framer-motion'
3+
import type { VariantLabels } from 'motion-dom'
34

45
export type HoverEvent = (event: MouseEvent, info: EventInfo) => void
56

67
export interface HoverProps {
78
/**
89
* @deprecated Use `whileHover` instead.
910
*/
10-
hover?: VariantLabels | Variant
11+
hover?: VariantLabels | VariantType
1112
/**
1213
* Variant to apply when the element is hovered.
1314
*/
14-
whileHover?: VariantLabels | Variant
15+
whileHover?: VariantLabels | VariantType
1516
onHoverStart?: HoverEvent
1617
onHoverEnd?: HoverEvent
1718
}

packages/motion/src/features/gestures/in-view/types.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import type { Variant, VariantLabels } from '@/types'
1+
import type { VariantType } from '@/types'
2+
import type { VariantLabels } from 'motion-dom'
23

34
type MarginValue = `${number}${'px' | '%'}`
45

@@ -17,11 +18,11 @@ export interface InViewProps {
1718
/**
1819
* @deprecated Use `whileInView` instead.
1920
*/
20-
inView?: VariantLabels | Variant
21+
inView?: VariantLabels | VariantType
2122
/**
2223
* Variant to apply when the element is in view.
2324
*/
24-
whileInView?: VariantLabels | Variant
25+
whileInView?: VariantLabels | VariantType
2526
onViewportEnter?: ViewportEventHandler
2627
onViewportLeave?: ViewportEventHandler
2728
}

packages/motion/src/features/gestures/press/types.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import type { Variant, VariantLabels } from '@/types'
1+
import type { VariantType } from '@/types'
22
import type { EventInfo } from 'framer-motion'
3+
import type { VariantLabels } from 'motion-dom'
34

45
export type PressEvent = (
56
event: PointerEvent,
@@ -14,11 +15,11 @@ export interface PressProps {
1415
/**
1516
* @deprecated Use `whilePress` instead.
1617
*/
17-
press?: VariantLabels | Variant
18+
press?: VariantLabels | VariantType
1819
/**
1920
* Variant to apply when the element is pressed.
2021
*/
21-
whilePress?: VariantLabels | Variant
22+
whilePress?: VariantLabels | VariantType
2223
onPressStart?: PressEvent
2324
onPress?: PressEvent
2425
onPressCancel?: PressEvent

0 commit comments

Comments
 (0)