Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Motion adheres to [Semantic Versioning](http://semver.org/).

Undocumented APIs should be considered internal and may change without warning.

## [12.26.2] 2026-01-13

### Fixed

- Internal refactor of projection system into `motion-dom`.

## [12.26.1] 2026-01-12

### Fixed
Expand Down
8 changes: 4 additions & 4 deletions dev/html/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "html-env",
"private": true,
"version": "12.26.1",
"version": "12.26.2",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -10,9 +10,9 @@
"preview": "vite preview"
},
"dependencies": {
"framer-motion": "^12.26.1",
"motion": "^12.26.1",
"motion-dom": "^12.24.11",
"framer-motion": "^12.26.2",
"motion": "^12.26.2",
"motion-dom": "^12.26.2",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
4 changes: 2 additions & 2 deletions dev/next/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "next-env",
"private": true,
"version": "12.26.1",
"version": "12.26.2",
"type": "module",
"scripts": {
"dev": "next dev",
Expand All @@ -10,7 +10,7 @@
"build": "next build"
},
"dependencies": {
"motion": "^12.26.1",
"motion": "^12.26.2",
"next": "15.4.10",
"react": "19.0.0",
"react-dom": "19.0.0"
Expand Down
4 changes: 2 additions & 2 deletions dev/react-19/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-19-env",
"private": true,
"version": "12.26.1",
"version": "12.26.2",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -11,7 +11,7 @@
"preview": "vite preview"
},
"dependencies": {
"motion": "^12.26.1",
"motion": "^12.26.2",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions dev/react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-env",
"private": true,
"version": "12.26.1",
"version": "12.26.2",
"type": "module",
"scripts": {
"dev": "yarn vite",
Expand All @@ -11,7 +11,7 @@
"preview": "yarn vite preview"
},
"dependencies": {
"framer-motion": "^12.26.1",
"framer-motion": "^12.26.2",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "12.26.1",
"version": "12.26.2",
"packages": [
"packages/*",
"dev/*"
Expand Down
4 changes: 2 additions & 2 deletions packages/framer-motion/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "framer-motion",
"version": "12.26.1",
"version": "12.26.2",
"description": "A simple and powerful JavaScript animation library",
"main": "dist/cjs/index.js",
"module": "dist/es/index.mjs",
Expand Down Expand Up @@ -88,7 +88,7 @@
"measure": "rollup -c ./rollup.size.config.mjs"
},
"dependencies": {
"motion-dom": "^12.24.11",
"motion-dom": "^12.26.2",
"motion-utils": "^12.24.10",
"tslib": "^2.4.0"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/framer-motion/src/animation/animate/subject.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import {
animateTarget,
AnimationPlaybackControlsWithThen,
AnimationScope,
AnyResolvedKeyframe,
DOMKeyframesDefinition,
AnimationOptions as DynamicAnimationOptions,
ElementOrSelector,
isMotionValue,
MotionValue,
TargetAndTransition,
UnresolvedValueKeyframe,
ValueAnimationTransition,
isMotionValue,
visualElementStore,
} from "motion-dom"
import { invariant } from "motion-utils"
import { visualElementStore } from "../../render/store"
import { animateTarget } from "../interfaces/visual-element-target"
import { ObjectTarget } from "../sequence/types"
import {
createDOMVisualElement,
createObjectVisualElement,
} from "../utils/create-visual-element"
import { isDOMKeyframes } from "../utils/is-dom-keyframes"
import { resolveSubjects } from "./resolve-subjects"
import { animateSingleValue } from "./single-value"
import { animateSingleValue } from "motion-dom"

export type AnimationSubject = Element | MotionValue<any> | any

Expand Down

This file was deleted.

11 changes: 7 additions & 4 deletions packages/framer-motion/src/animation/hooks/animation-controls.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import type { AnimationDefinition, LegacyAnimationControls } from "motion-dom"
import {
animateVisualElement,
setTarget,
type AnimationDefinition,
type LegacyAnimationControls,
type VisualElement,
} from "motion-dom"
import { invariant } from "motion-utils"
import { setTarget } from "../../render/utils/setters"
import type { VisualElement } from "../../render/VisualElement"
import { animateVisualElement } from "../interfaces/visual-element"

function stopAnimation(visualElement: VisualElement) {
visualElement.values.forEach((value) => value.stop())
Expand Down
12 changes: 7 additions & 5 deletions packages/framer-motion/src/animation/hooks/use-animated-state.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
"use client"

import { TargetAndTransition } from "motion-dom"
import {
animateVisualElement,
createBox,
ResolvedValues,
TargetAndTransition,
VisualElement,
} from "motion-dom"
import { useLayoutEffect, useState } from "react"
import { makeUseVisualState } from "../../motion/utils/use-visual-state"
import { createBox } from "../../projection/geometry/models"
import { ResolvedValues } from "../../render/types"
import { VisualElement } from "../../render/VisualElement"
import { useConstant } from "../../utils/use-constant"
import { animateVisualElement } from "../interfaces/visual-element"

interface AnimatedStateOptions {
initialState: ResolvedValues
Expand Down
9 changes: 0 additions & 9 deletions packages/framer-motion/src/animation/interfaces/types.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import {
AnyResolvedKeyframe,
Batcher,
getOptimisedAppearId,
MotionValue,
optimizedAppearDataId,
startWaapiAnimation,
ValueAnimationTransition,
type WithAppearProps,
} from "motion-dom"
import { noop } from "motion-utils"
import { optimizedAppearDataId } from "./data-id"
import { getOptimisedAppearId } from "./get-appear-id"
import { handoffOptimizedAppearAnimation } from "./handoff"
import { appearAnimationStore, appearComplete, AppearStoreEntry } from "./store"
import { appearStoreId } from "./store-id"
import "./types"
import type { WithAppearProps } from "./types"

/**
* A single time to use across all animations to manually set startTime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { isSVGElement, isSVGSVGElement } from "motion-dom"
import { HTMLVisualElement } from "../../render/html/HTMLVisualElement"
import { ObjectVisualElement } from "../../render/object/ObjectVisualElement"
import { visualElementStore } from "../../render/store"
import { SVGVisualElement } from "../../render/svg/SVGVisualElement"
import {
HTMLVisualElement,
isSVGElement,
isSVGSVGElement,
ObjectVisualElement,
SVGVisualElement,
visualElementStore,
} from "motion-dom"

export function createDOMVisualElement(element: HTMLElement | SVGElement) {
const options = {
Expand Down
2 changes: 1 addition & 1 deletion packages/framer-motion/src/context/LayoutGroupContext.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client"

import { createContext } from "react"
import { NodeGroup } from "../projection/node/group"
import type { NodeGroup } from "motion-dom"

export interface LayoutGroupContextProps {
id?: string
Expand Down
2 changes: 1 addition & 1 deletion packages/framer-motion/src/context/MotionContext/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client"

import type { VisualElement } from "motion-dom"
import { createContext } from "react"
import type { VisualElement } from "../../render/VisualElement"

export interface MotionContextProps<Instance = unknown> {
visualElement?: VisualElement<Instance>
Expand Down
3 changes: 1 addition & 2 deletions packages/framer-motion/src/context/MotionContext/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { isControllingVariants, isVariantLabel } from "motion-dom"
import type { MotionContextProps } from "."
import { MotionProps } from "../../motion/types"
import { isControllingVariants } from "../../render/utils/is-controlling-variants"
import { isVariantLabel } from "../../render/utils/is-variant-label"

export function getCurrentTreeVariants(
props: MotionProps,
Expand Down
14 changes: 2 additions & 12 deletions packages/framer-motion/src/context/PresenceContext.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
"use client"

import { createContext } from "react"
import { VariantLabels } from "../motion/types"
import type { PresenceContextProps } from "motion-dom"

/**
* @public
*/
export interface PresenceContextProps {
id: string
isPresent: boolean
register: (id: string | number) => () => void
onExitComplete?: (id: string | number) => void
initial?: false | VariantLabels
custom?: any
}
export type { PresenceContextProps }

/**
* @public
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"use client"

import type { Transition } from "motion-dom"
import type { Transition, IProjectionNode } from "motion-dom"
import { createContext } from "react"
import { IProjectionNode } from "../projection/node/types"

export interface SwitchLayoutGroup {
register?: (member: IProjectionNode) => void
Expand Down
2 changes: 1 addition & 1 deletion packages/framer-motion/src/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ export * from "./animation/sequence/types"
/**
* Utils
*/
export { delayInSeconds as delay, DelayedFunction } from "./utils/delay"
export { delayInSeconds as delay, type DelayedFunction } from "motion-dom"
export * from "./utils/distance"
2 changes: 1 addition & 1 deletion packages/framer-motion/src/events/add-pointer-event.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addDomEvent } from "./add-dom-event"
import { addDomEvent } from "motion-dom"
import { addPointerInfo, EventListenerWithPointInfo } from "./event-info"

export function addPointerEvent(
Expand Down
2 changes: 1 addition & 1 deletion packages/framer-motion/src/events/use-dom-event.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client"

import { RefObject, useEffect } from "react"
import { addDomEvent } from "./add-dom-event"
import { addDomEvent } from "motion-dom"

/**
* Attaches an event listener directly to the provided DOM element.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
import {
isElementKeyboardAccessible,
PanInfo,
ResolvedConstraints,
Transition,
addValueToWillChange,
animateMotionValue,
calcLength,
convertBoundingBoxToBox,
convertBoxToBoundingBox,
createBox,
eachAxis,
frame,
isElementKeyboardAccessible,
measurePageBox,
mixNumber,
PanInfo,
percent,
ResolvedConstraints,
setDragLock,
Transition,
type VisualElement,
} from "motion-dom"
import { Axis, Point, invariant } from "motion-utils"
import { animateMotionValue } from "../../animation/interfaces/motion-value"
import { addDomEvent } from "../../events/add-dom-event"
import { addDomEvent, type LayoutUpdateData } from "motion-dom"
import { addPointerEvent } from "../../events/add-pointer-event"
import { extractEventInfo } from "../../events/event-info"
import { MotionProps } from "../../motion/types"
import {
convertBoundingBoxToBox,
convertBoxToBoundingBox,
} from "../../projection/geometry/conversion"
import { calcLength } from "../../projection/geometry/delta-calc"
import { createBox } from "../../projection/geometry/models"
import type { LayoutUpdateData } from "../../projection/node/types"
import { eachAxis } from "../../projection/utils/each-axis"
import { measurePageBox } from "../../projection/utils/measure"
import type { VisualElement } from "../../render/VisualElement"
import { getContextWindow } from "../../utils/get-context-window"
import { isRefObject } from "../../utils/is-ref-object"
import { addValueToWillChange } from "../../value/use-will-change/add-will-change"
import { PanSession } from "../pan/PanSession"
import {
applyConstraints,
Expand Down
3 changes: 1 addition & 2 deletions packages/framer-motion/src/gestures/drag/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Feature } from "../../motion/features/Feature"
import type { VisualElement } from "../../render/VisualElement"
import { Feature, type VisualElement } from "motion-dom"
import { noop } from "motion-utils"
import { VisualElementDragControls } from "./VisualElementDragControls"

Expand Down
Loading
Loading