Skip to content

Commit e33f7e7

Browse files
committed
refactor(core): the snap drag calls the motion engine by its new name
Main renamed createMotionAnimator to createMotionEngine.
1 parent a42cd3f commit e33f7e7

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎packages/core/src/dragToSnapPoints/createDragToSnapPoints.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ vi.mock('../motion/animator', async importOriginal => {
3333
const actual = await importOriginal<typeof AnimatorModule>();
3434
return {
3535
...actual,
36-
createMotionAnimator: (
37-
...args: Parameters<typeof actual.createMotionAnimator>
36+
createMotionEngine: (
37+
...args: Parameters<typeof actual.createMotionEngine>
3838
) => {
39-
const animator = actual.createMotionAnimator(...args);
39+
const animator = actual.createMotionEngine(...args);
4040
const animate = animator.animate.bind(animator);
4141
animator.animate = (target, options, ...rest) => {
4242
animates.push({target, options: {...options}});

‎packages/core/src/dragToSnapPoints/createDragToSnapPoints.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
createPanGesture,
2222
type PanGestureEvent,
2323
} from '../gestures/createPanGesture';
24-
import {createMotionAnimator} from '../motion/animator';
24+
import {createMotionEngine} from '../motion/animator';
2525
import {resolveSnapPoint} from '../motion/resolveSnapPoint';
2626
import {devWarn} from '../utils/devWarning';
2727
import {registerSpringsTable, springs} from '../motion/uikit/springs';
@@ -132,7 +132,7 @@ export function createDragToSnapPoints(
132132
// It starts where the element is drawn, so a drag created again to
133133
// change its options moves on from there instead of jumping.
134134
const drawn = drawnAt(element);
135-
const animator = createMotionAnimator(element, {initial: drawn});
135+
const animator = createMotionEngine(element, {initial: drawn});
136136
let targetIndex = resolveSnapPoint({
137137
points,
138138
position: drawn[axis],

0 commit comments

Comments
 (0)