Skip to content

Commit d7b4d4c

Browse files
committed
chore: update dependencies and clean up unused code in motion package
1 parent d0da30e commit d7b4d4c

File tree

7 files changed

+156
-53
lines changed

7 files changed

+156
-53
lines changed

packages/motion/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
"vue": ">=3.0.0"
7575
},
7676
"dependencies": {
77-
"framer-motion": "12.22.0",
77+
"framer-motion": "12.23.12",
7878
"hey-listen": "^1.0.8",
79-
"motion-dom": "12.22.0"
79+
"motion-dom": "12.23.12"
8080
}
8181
}

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export class AnimationFeature extends Feature {
4343
},
4444
reducedMotionConfig: this.state.options.motionConfig.reducedMotion,
4545
})
46-
4746
this.state.animateUpdates = this.animateUpdates
4847
if (this.state.isMounted())
4948
this.state.startAnimation()
@@ -61,7 +60,6 @@ export class AnimationFeature extends Feature {
6160
directAnimate,
6261
directTransition,
6362
controlDelay = 0,
64-
isFallback,
6563
isExit,
6664
} = {}) => {
6765
// check if the user has reduced motion
@@ -79,7 +77,7 @@ export class AnimationFeature extends Feature {
7977
})
8078

8179
const factories = this.createAnimationFactories(prevTarget, animationOptions, controlDelay)
82-
const { getChildAnimations } = this.setupChildAnimations(animationOptions, this.state.activeStates, isFallback)
80+
const { getChildAnimations } = this.setupChildAnimations(animationOptions, this.state.activeStates)
8381
return this.executeAnimations({
8482
factories,
8583
getChildAnimations,
@@ -145,7 +143,6 @@ export class AnimationFeature extends Feature {
145143
setupChildAnimations(
146144
transition: $Transition | undefined,
147145
controlActiveState: Partial<Record<string, boolean>> | undefined,
148-
isFallback: boolean,
149146
) {
150147
const visualElement = this.state.visualElement
151148
if (!visualElement.variantChildren?.size || !controlActiveState)

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export interface AnimateUpdatesOptions {
1212
controlDelay?: number
1313
directAnimate?: Options['animate']
1414
directTransition?: Options['transition']
15-
isFallback?: boolean
1615
isExit?: boolean
1716
}
1817

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,4 @@ export const domAnimation = [
1515
HoverGesture,
1616
InViewGesture,
1717
FocusGesture,
18-
// ProjectionFeature,
19-
// DragGesture,
20-
// LayoutFeature,
21-
// PanGesture,
2218
] as unknown as Feature[]

packages/motion/src/state/motion-state.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ export class MotionState {
5353
*/
5454
public currentProcess: ReturnType<typeof frame.render> | null = null
5555

56-
// Depth in component tree for lifecycle ordering
57-
public depth: number
58-
5956
// Base animation target values
6057
public baseTarget: DOMKeyframesDefinition
6158

@@ -72,8 +69,6 @@ export class MotionState {
7269
this.parent = parent
7370
// Add to parent's children set for lifecycle management
7471
parent?.children?.add(this)
75-
// Calculate depth in component tree
76-
this.depth = parent?.depth + 1 || 0
7772

7873
// Initialize with either initial or animate variant
7974
const initial = (options.initial === undefined && options.variants) ? this.context.initial : options.initial
@@ -173,8 +168,6 @@ export class MotionState {
173168
this.featureManager.beforeUnmount()
174169
}
175170

176-
// Unmount motion state and optionally unmount children
177-
// Handles unmounting in the correct order based on component tree
178171
unmount(unMountChildren = false) {
179172
/**
180173
* Unlike React, within the same update cycle, the execution order of unmount and mount depends on the component's order in the component tree.
@@ -228,7 +221,6 @@ export class MotionState {
228221
})
229222
if (isAnimate) {
230223
this.animateUpdates({
231-
isFallback: !isActive && name !== 'exit' && this.visualElement.isControllingVariants,
232224
isExit: name === 'exit' && this.activeStates.exit,
233225
})
234226
}

packages/motion/src/utils/use-in-view.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function useInView(
1515
const isInView = ref(false)
1616

1717
watchEffect((onCleanup) => {
18-
const realOptions = unref(options) || {}
18+
const realOptions = (unref(options) || {}) as UseInViewOptions
1919
const { once } = realOptions
2020
const el = unrefElement(domRef)
2121
if (!el || (once && isInView.value)) {
@@ -31,7 +31,7 @@ export function useInView(
3131
}
3232
const cleanup = inView(el, onEnter, {
3333
...realOptions,
34-
root: unref(realOptions.root),
34+
root: unref(realOptions.root) as Element | Document,
3535
})
3636
onCleanup(() => {
3737
cleanup()

0 commit comments

Comments
 (0)