motion 12.4.13 → 12.5.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.
- package/dist/cjs/debug.js +12 -12
- package/dist/cjs/index.js +1277 -1302
- package/dist/cjs/mini.js +7 -7
- package/dist/cjs/react-client.js +535 -540
- package/dist/cjs/react-m.js +20 -19
- package/dist/cjs/react-mini.js +1 -1
- package/dist/es/framer-motion/dist/es/animation/animate/single-value.mjs +2 -1
- package/dist/es/framer-motion/dist/es/animation/animators/BaseAnimation.mjs +2 -1
- package/dist/es/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs +1 -1
- package/dist/es/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.mjs +3 -2
- package/dist/es/framer-motion/dist/es/animation/animators/waapi/index.mjs +2 -2
- package/dist/es/framer-motion/dist/es/animation/generators/utils/velocity.mjs +2 -1
- package/dist/es/framer-motion/dist/es/animation/interfaces/motion-value.mjs +2 -2
- package/dist/es/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +1 -1
- package/dist/es/framer-motion/dist/es/animation/optimized-appear/start.mjs +4 -4
- package/dist/es/framer-motion/dist/es/animation/sequence/utils/edit.mjs +2 -1
- package/dist/es/framer-motion/dist/es/components/AnimatePresence/index.mjs +1 -1
- package/dist/es/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs +2 -1
- package/dist/es/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs +1 -1
- package/dist/es/framer-motion/dist/es/gestures/hover.mjs +1 -1
- package/dist/es/framer-motion/dist/es/gestures/pan/PanSession.mjs +1 -1
- package/dist/es/framer-motion/dist/es/gestures/pan/index.mjs +1 -1
- package/dist/es/framer-motion/dist/es/gestures/press.mjs +1 -1
- package/dist/es/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs +3 -2
- package/dist/es/framer-motion/dist/es/motion/utils/use-visual-element.mjs +7 -6
- package/dist/es/framer-motion/dist/es/projection/node/create-projection-node.mjs +6 -6
- package/dist/es/framer-motion/dist/es/projection/shared/stack.mjs +2 -1
- package/dist/es/framer-motion/dist/es/render/VisualElement.mjs +6 -5
- package/dist/es/framer-motion/dist/es/render/components/create-proxy.mjs +2 -1
- package/dist/es/framer-motion/dist/es/render/dom/DOMVisualElement.mjs +1 -1
- package/dist/es/framer-motion/dist/es/render/dom/scroll/info.mjs +1 -1
- package/dist/es/framer-motion/dist/es/render/dom/scroll/observe.mjs +2 -1
- package/dist/es/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs +2 -1
- package/dist/es/framer-motion/dist/es/render/dom/scroll/track.mjs +2 -1
- package/dist/es/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +2 -1
- package/dist/es/framer-motion/dist/es/render/svg/config-motion.mjs +2 -1
- package/dist/es/framer-motion/dist/es/render/utils/KeyframesResolver.mjs +2 -1
- package/dist/es/framer-motion/dist/es/render/utils/flat-tree.mjs +2 -1
- package/dist/es/framer-motion/dist/es/render/utils/motion-values.mjs +4 -3
- package/dist/es/framer-motion/dist/es/render/utils/setters.mjs +2 -1
- package/dist/es/framer-motion/dist/es/utils/delay.mjs +2 -2
- package/dist/es/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs +2 -1
- package/dist/es/framer-motion/dist/es/utils/use-animation-frame.mjs +2 -1
- package/dist/es/framer-motion/dist/es/utils/use-force-update.mjs +2 -1
- package/dist/es/framer-motion/dist/es/utils/use-instant-transition.mjs +2 -1
- package/dist/es/framer-motion/dist/es/value/scroll/use-element-scroll.mjs +2 -1
- package/dist/es/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs +2 -1
- package/dist/es/framer-motion/dist/es/value/use-combine-values.mjs +3 -2
- package/dist/es/framer-motion/dist/es/value/use-computed.mjs +2 -1
- package/dist/es/framer-motion/dist/es/value/use-inverted-scale.mjs +3 -3
- package/dist/es/framer-motion/dist/es/value/use-motion-value.mjs +2 -1
- package/dist/es/framer-motion/dist/es/value/use-scroll.mjs +4 -4
- package/dist/es/framer-motion/dist/es/value/use-spring.mjs +1 -1
- package/dist/es/framer-motion/dist/es/value/use-transform.mjs +1 -1
- package/dist/es/framer-motion/dist/es/value/use-velocity.mjs +2 -1
- package/dist/es/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs +3 -2
- package/dist/es/motion/lib/debug.mjs +1 -1
- package/dist/es/motion/lib/index.mjs +3 -4
- package/dist/es/motion/lib/react.mjs +19 -20
- package/dist/es/{framer-motion → motion-dom}/dist/es/frameloop/batcher.mjs +2 -1
- package/dist/es/{framer-motion → motion-dom}/dist/es/frameloop/frame.mjs +1 -1
- package/dist/es/motion-dom/dist/es/frameloop/microtask.mjs +6 -0
- package/dist/es/{framer-motion → motion-dom}/dist/es/frameloop/sync-time.mjs +2 -1
- package/dist/es/motion-dom/dist/es/utils/supports/scroll-timeline.mjs +1 -1
- package/dist/es/{framer-motion → motion-dom}/dist/es/value/index.mjs +6 -11
- package/dist/motion.dev.js +1277 -1302
- package/dist/motion.js +1 -1
- package/package.json +3 -3
- package/dist/es/framer-motion/dist/es/frameloop/index-legacy.mjs +0 -20
- package/dist/es/framer-motion/dist/es/frameloop/microtask.mjs +0 -5
- package/dist/es/{framer-motion → motion-dom}/dist/es/frameloop/order.mjs +0 -0
- package/dist/es/{framer-motion → motion-dom}/dist/es/frameloop/render-step.mjs +0 -0
- package/dist/es/{framer-motion → motion-dom}/dist/es/stats/animation-count.mjs +0 -0
- package/dist/es/{framer-motion → motion-dom}/dist/es/stats/buffer.mjs +0 -0
- package/dist/es/{framer-motion → motion-dom}/dist/es/stats/index.mjs +1 -1
- /package/dist/es/{framer-motion/dist/es/utils → motion-utils/dist/es}/array.mjs +0 -0
- /package/dist/es/{framer-motion/dist/es/utils/GlobalConfig.mjs → motion-utils/dist/es/global-config.mjs} +0 -0
- /package/dist/es/{framer-motion/dist/es/utils → motion-utils/dist/es}/subscription-manager.mjs +0 -0
- /package/dist/es/{framer-motion/dist/es/utils → motion-utils/dist/es}/velocity-per-second.mjs +0 -0
- /package/dist/es/{framer-motion/dist/es/utils → motion-utils/dist/es}/warn-once.mjs +0 -0
package/dist/cjs/react-m.js
CHANGED
|
@@ -171,22 +171,6 @@ function useMotionRef(visualState, visualElement, externalRef) {
|
|
|
171
171
|
[visualElement]);
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
/**
|
|
175
|
-
* @public
|
|
176
|
-
*/
|
|
177
|
-
const PresenceContext =
|
|
178
|
-
/* @__PURE__ */ react.createContext(null);
|
|
179
|
-
|
|
180
|
-
const useIsomorphicLayoutEffect = isBrowser ? react.useLayoutEffect : react.useEffect;
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Convert camelCase to dash-case properties.
|
|
184
|
-
*/
|
|
185
|
-
const camelToDash = (str) => str.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase();
|
|
186
|
-
|
|
187
|
-
const optimizedAppearDataId = "framerAppearId";
|
|
188
|
-
const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId);
|
|
189
|
-
|
|
190
174
|
const stepsOrder = [
|
|
191
175
|
"read", // Read
|
|
192
176
|
"resolveKeyframes", // Write/Read/Write/Read
|
|
@@ -352,13 +336,32 @@ function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
|
|
|
352
336
|
return { schedule, cancel, state, steps };
|
|
353
337
|
}
|
|
354
338
|
|
|
355
|
-
const { schedule:
|
|
339
|
+
const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true);
|
|
340
|
+
|
|
341
|
+
const { schedule: microtask, cancel: cancelMicrotask } =
|
|
342
|
+
/* @__PURE__ */ createRenderBatcher(queueMicrotask, false);
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Convert camelCase to dash-case properties.
|
|
346
|
+
*/
|
|
347
|
+
const camelToDash = (str) => str.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase();
|
|
348
|
+
|
|
349
|
+
const optimizedAppearDataId = "framerAppearId";
|
|
350
|
+
const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId);
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* @public
|
|
354
|
+
*/
|
|
355
|
+
const PresenceContext =
|
|
356
|
+
/* @__PURE__ */ react.createContext(null);
|
|
356
357
|
|
|
357
358
|
/**
|
|
358
359
|
* Internal, exported only for usage in Framer
|
|
359
360
|
*/
|
|
360
361
|
const SwitchLayoutGroupContext = react.createContext({});
|
|
361
362
|
|
|
363
|
+
const useIsomorphicLayoutEffect = isBrowser ? react.useLayoutEffect : react.useEffect;
|
|
364
|
+
|
|
362
365
|
function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor) {
|
|
363
366
|
var _a, _b;
|
|
364
367
|
const { visualElement: parent } = react.useContext(MotionContext);
|
|
@@ -1384,8 +1387,6 @@ const htmlMotionConfig = {
|
|
|
1384
1387
|
}),
|
|
1385
1388
|
};
|
|
1386
1389
|
|
|
1387
|
-
const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true);
|
|
1388
|
-
|
|
1389
1390
|
function updateSVGDimensions(instance, renderState) {
|
|
1390
1391
|
try {
|
|
1391
1392
|
renderState.dimensions =
|
package/dist/cjs/react-mini.js
CHANGED
|
@@ -74,7 +74,7 @@ const secondsToMilliseconds = (seconds) => seconds * 1000;
|
|
|
74
74
|
/*#__NO_SIDE_EFFECTS__*/
|
|
75
75
|
const millisecondsToSeconds = (milliseconds) => milliseconds / 1000;
|
|
76
76
|
|
|
77
|
-
const supportsScrollTimeline = memo(() => window.ScrollTimeline !== undefined);
|
|
77
|
+
const supportsScrollTimeline = /* @__PURE__ */ memo(() => window.ScrollTimeline !== undefined);
|
|
78
78
|
|
|
79
79
|
class BaseGroupPlaybackControls {
|
|
80
80
|
constructor(animations) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { motionValue } from '../../../../../motion-dom/dist/es/value/index.mjs';
|
|
2
3
|
import { isMotionValue } from '../../value/utils/is-motion-value.mjs';
|
|
3
4
|
import { animateMotionValue } from '../interfaces/motion-value.mjs';
|
|
4
5
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { time } from '../../../../../motion-dom/dist/es/frameloop/sync-time.mjs';
|
|
2
3
|
import { flushKeyframeResolvers } from '../../render/utils/KeyframesResolver.mjs';
|
|
3
4
|
import { instantAnimationState } from '../../utils/use-instant-transition-state.mjs';
|
|
4
5
|
import { canAnimate } from './utils/can-animate.mjs';
|
|
@@ -2,8 +2,8 @@ import { invariant } from '../../../../../motion-utils/dist/es/errors.mjs';
|
|
|
2
2
|
import { millisecondsToSeconds, secondsToMilliseconds } from '../../../../../motion-utils/dist/es/time-conversion.mjs';
|
|
3
3
|
import { calcGeneratorDuration } from '../../../../../motion-dom/dist/es/animation/generators/utils/calc-duration.mjs';
|
|
4
4
|
import { isGenerator } from '../../../../../motion-dom/dist/es/animation/generators/utils/is-generator.mjs';
|
|
5
|
+
import { activeAnimations } from '../../../../../motion-dom/dist/es/stats/animation-count.mjs';
|
|
5
6
|
import { KeyframeResolver } from '../../render/utils/KeyframesResolver.mjs';
|
|
6
|
-
import { activeAnimations } from '../../stats/animation-count.mjs';
|
|
7
7
|
import { clamp } from '../../utils/clamp.mjs';
|
|
8
8
|
import { mix } from '../../utils/mix/index.mjs';
|
|
9
9
|
import { pipe } from '../../utils/pipe.mjs';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { frame, cancelFrame, frameData } from '
|
|
1
|
+
import '../../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { frame, cancelFrame, frameData } from '../../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
3
|
+
import { time } from '../../../../../../motion-dom/dist/es/frameloop/sync-time.mjs';
|
|
3
4
|
|
|
4
5
|
const frameloopDriver = (update) => {
|
|
5
6
|
const passTimestamp = ({ timestamp }) => update(timestamp);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
2
|
import { mapEasingToNativeEasing } from '../../../../../../motion-dom/dist/es/animation/waapi/utils/easing.mjs';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { statsBuffer } from '../../../../../../motion-dom/dist/es/stats/buffer.mjs';
|
|
4
|
+
import { activeAnimations } from '../../../../../../motion-dom/dist/es/stats/animation-count.mjs';
|
|
5
5
|
|
|
6
6
|
function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeInOut", times, } = {}) {
|
|
7
7
|
const keyframeOptions = { [valueName]: keyframes };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { velocityPerSecond } from '../../../../../../motion-utils/dist/es/velocity-per-second.mjs';
|
|
2
3
|
|
|
3
4
|
const velocitySampleDuration = 5; // ms
|
|
4
5
|
function calcGeneratorVelocity(resolveValue, t, current) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { GroupPlaybackControls } from '../../../../../motion-dom/dist/es/animation/controls/Group.mjs';
|
|
2
2
|
import { getValueTransition } from '../../../../../motion-dom/dist/es/animation/utils/get-value-transition.mjs';
|
|
3
3
|
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
4
|
+
import { MotionGlobalConfig } from '../../../../../motion-utils/dist/es/global-config.mjs';
|
|
4
5
|
import { secondsToMilliseconds } from '../../../../../motion-utils/dist/es/time-conversion.mjs';
|
|
5
|
-
import { frame } from '
|
|
6
|
-
import { MotionGlobalConfig } from '../../utils/GlobalConfig.mjs';
|
|
6
|
+
import { frame } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
7
7
|
import { instantAnimationState } from '../../utils/use-instant-transition-state.mjs';
|
|
8
8
|
import { AcceleratedAnimation } from '../animators/AcceleratedAnimation.mjs';
|
|
9
9
|
import { MainThreadAnimation } from '../animators/MainThreadAnimation.mjs';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
2
|
import { getValueTransition } from '../../../../../motion-dom/dist/es/animation/utils/get-value-transition.mjs';
|
|
3
|
+
import { frame } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
3
4
|
import { positionalKeys } from '../../render/html/utils/keys-position.mjs';
|
|
4
5
|
import { setTarget } from '../../render/utils/setters.mjs';
|
|
5
6
|
import { addValueToWillChange } from '../../value/use-will-change/add-will-change.mjs';
|
|
6
7
|
import { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';
|
|
7
8
|
import { animateMotionValue } from './motion-value.mjs';
|
|
8
|
-
import { frame } from '../../frameloop/frame.mjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Decide whether we should block this animation. Previously, we achieved this
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { noop } from '../../../../../motion-utils/dist/es/noop.mjs';
|
|
2
3
|
import { startWaapiAnimation } from '../animators/waapi/index.mjs';
|
|
3
4
|
import { optimizedAppearDataId } from './data-id.mjs';
|
|
5
|
+
import { getOptimisedAppearId } from './get-appear-id.mjs';
|
|
4
6
|
import { handoffOptimizedAppearAnimation } from './handoff.mjs';
|
|
5
7
|
import { appearAnimationStore, appearComplete } from './store.mjs';
|
|
6
|
-
import '
|
|
7
|
-
import { noop } from '../../../../../motion-utils/dist/es/noop.mjs';
|
|
8
|
-
import { getOptimisedAppearId } from './get-appear-id.mjs';
|
|
8
|
+
import { appearStoreId } from './store-id.mjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* A single time to use across all animations to manually set startTime
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { removeItem } from '../../../../../../motion-utils/dist/es/array.mjs';
|
|
2
|
+
import '../../../../../../motion-utils/dist/es/errors.mjs';
|
|
1
3
|
import { getEasingForSegment } from '../../../easing/utils/get-easing-for-segment.mjs';
|
|
2
|
-
import { removeItem } from '../../../utils/array.mjs';
|
|
3
4
|
import { mixNumber } from '../../../utils/mix/number.mjs';
|
|
4
5
|
|
|
5
6
|
function eraseKeyframes(sequence, startTime, endTime) {
|
|
@@ -3,10 +3,10 @@ import { jsx, Fragment } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useMemo, useRef, useState, useContext } from 'react';
|
|
4
4
|
import { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';
|
|
5
5
|
import { useConstant } from '../../utils/use-constant.mjs';
|
|
6
|
+
import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';
|
|
6
7
|
import { PresenceChild } from './PresenceChild.mjs';
|
|
7
8
|
import { usePresence } from './use-presence.mjs';
|
|
8
9
|
import { onlyElements, getChildKey } from './utils.mjs';
|
|
9
|
-
import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* `AnimatePresence` enables the animation of components that have been removed from the tree.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { moveItem } from '
|
|
1
|
+
import { moveItem } from '../../../../../../motion-utils/dist/es/array.mjs';
|
|
2
|
+
import '../../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
3
|
import { mixNumber } from '../../../utils/mix/number.mjs';
|
|
3
4
|
|
|
4
5
|
function checkReorder(order, value, offset, velocity) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { invariant } from '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { frame } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
2
3
|
import { setDragLock } from '../../../../../motion-dom/dist/es/gestures/drag/state/set-active.mjs';
|
|
3
4
|
import { animateMotionValue } from '../../animation/interfaces/motion-value.mjs';
|
|
4
5
|
import { addDomEvent } from '../../events/add-dom-event.mjs';
|
|
@@ -16,7 +17,6 @@ import { percent } from '../../value/types/numbers/units.mjs';
|
|
|
16
17
|
import { addValueToWillChange } from '../../value/use-will-change/add-will-change.mjs';
|
|
17
18
|
import { PanSession } from '../pan/PanSession.mjs';
|
|
18
19
|
import { applyConstraints, calcRelativeConstraints, resolveDragElastic, calcViewportConstraints, rebaseAxisConstraints, calcOrigin, defaultElastic } from './utils/constraints.mjs';
|
|
19
|
-
import { frame } from '../../frameloop/frame.mjs';
|
|
20
20
|
|
|
21
21
|
const elementDragControls = new WeakMap();
|
|
22
22
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { frame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
2
3
|
import { hover } from '../../../../motion-dom/dist/es/gestures/hover.mjs';
|
|
3
4
|
import { extractEventInfo } from '../events/event-info.mjs';
|
|
4
5
|
import { Feature } from '../motion/features/Feature.mjs';
|
|
5
|
-
import { frame } from '../frameloop/frame.mjs';
|
|
6
6
|
|
|
7
7
|
function handleHoverEvent(node, event, lifecycle) {
|
|
8
8
|
const { props } = node;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
2
|
import { secondsToMilliseconds, millisecondsToSeconds } from '../../../../../motion-utils/dist/es/time-conversion.mjs';
|
|
3
|
+
import { frame, cancelFrame, frameData } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
3
4
|
import { isPrimaryPointer } from '../../../../../motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs';
|
|
4
5
|
import { addPointerEvent } from '../../events/add-pointer-event.mjs';
|
|
5
6
|
import { extractEventInfo } from '../../events/event-info.mjs';
|
|
6
7
|
import { distance2D } from '../../utils/distance.mjs';
|
|
7
8
|
import { pipe } from '../../utils/pipe.mjs';
|
|
8
|
-
import { frame, cancelFrame, frameData } from '../../frameloop/frame.mjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @internal
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
2
|
import { noop } from '../../../../../motion-utils/dist/es/noop.mjs';
|
|
3
|
+
import { frame } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
3
4
|
import { addPointerEvent } from '../../events/add-pointer-event.mjs';
|
|
4
5
|
import { Feature } from '../../motion/features/Feature.mjs';
|
|
5
6
|
import { getContextWindow } from '../../utils/get-context-window.mjs';
|
|
6
7
|
import { PanSession } from './PanSession.mjs';
|
|
7
|
-
import { frame } from '../../frameloop/frame.mjs';
|
|
8
8
|
|
|
9
9
|
const asyncHandler = (handler) => (event, info) => {
|
|
10
10
|
if (handler) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { frame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
2
3
|
import { press } from '../../../../motion-dom/dist/es/gestures/press/index.mjs';
|
|
3
4
|
import { extractEventInfo } from '../events/event-info.mjs';
|
|
4
5
|
import { Feature } from '../motion/features/Feature.mjs';
|
|
5
|
-
import { frame } from '../frameloop/frame.mjs';
|
|
6
6
|
|
|
7
7
|
function handlePressEvent(node, event, lifecycle) {
|
|
8
8
|
const { props } = node;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import '../../../../../../motion-utils/dist/es/errors.mjs';
|
|
4
|
+
import { frame } from '../../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
5
|
+
import { microtask } from '../../../../../../motion-dom/dist/es/frameloop/microtask.mjs';
|
|
3
6
|
import { useContext, Component } from 'react';
|
|
4
7
|
import { usePresence } from '../../../components/AnimatePresence/use-presence.mjs';
|
|
5
8
|
import { LayoutGroupContext } from '../../../context/LayoutGroupContext.mjs';
|
|
6
9
|
import { SwitchLayoutGroupContext } from '../../../context/SwitchLayoutGroupContext.mjs';
|
|
7
|
-
import { microtask } from '../../../frameloop/microtask.mjs';
|
|
8
10
|
import { globalProjectionState } from '../../../projection/node/state.mjs';
|
|
9
11
|
import { correctBorderRadius } from '../../../projection/styles/scale-border-radius.mjs';
|
|
10
12
|
import { correctBoxShadow } from '../../../projection/styles/scale-box-shadow.mjs';
|
|
11
13
|
import { addScaleCorrector } from '../../../projection/styles/scale-correction.mjs';
|
|
12
|
-
import { frame } from '../../../frameloop/frame.mjs';
|
|
13
14
|
|
|
14
15
|
class MeasureLayoutWithContext extends Component {
|
|
15
16
|
/**
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { microtask } from '../../../../../motion-dom/dist/es/frameloop/microtask.mjs';
|
|
1
3
|
import { useContext, useRef, useInsertionEffect, useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { MotionContext } from '../../context/MotionContext/index.mjs';
|
|
4
|
-
import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';
|
|
4
|
+
import { optimizedAppearDataAttribute } from '../../animation/optimized-appear/data-id.mjs';
|
|
5
5
|
import { LazyContext } from '../../context/LazyContext.mjs';
|
|
6
6
|
import { MotionConfigContext } from '../../context/MotionConfigContext.mjs';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { isRefObject } from '../../utils/is-ref-object.mjs';
|
|
7
|
+
import { MotionContext } from '../../context/MotionContext/index.mjs';
|
|
8
|
+
import { PresenceContext } from '../../context/PresenceContext.mjs';
|
|
10
9
|
import { SwitchLayoutGroupContext } from '../../context/SwitchLayoutGroupContext.mjs';
|
|
10
|
+
import { isRefObject } from '../../utils/is-ref-object.mjs';
|
|
11
|
+
import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';
|
|
11
12
|
|
|
12
13
|
function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor) {
|
|
13
14
|
var _a, _b;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
2
|
import { noop } from '../../../../../motion-utils/dist/es/noop.mjs';
|
|
3
|
+
import { SubscriptionManager } from '../../../../../motion-utils/dist/es/subscription-manager.mjs';
|
|
3
4
|
import { getValueTransition } from '../../../../../motion-dom/dist/es/animation/utils/get-value-transition.mjs';
|
|
5
|
+
import { cancelFrame, frameData, frameSteps, frame } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
6
|
+
import { statsBuffer } from '../../../../../motion-dom/dist/es/stats/buffer.mjs';
|
|
7
|
+
import { microtask } from '../../../../../motion-dom/dist/es/frameloop/microtask.mjs';
|
|
8
|
+
import { time } from '../../../../../motion-dom/dist/es/frameloop/sync-time.mjs';
|
|
9
|
+
import { activeAnimations } from '../../../../../motion-dom/dist/es/stats/animation-count.mjs';
|
|
4
10
|
import { animateSingleValue } from '../../animation/animate/single-value.mjs';
|
|
5
11
|
import { getOptimisedAppearId } from '../../animation/optimized-appear/get-appear-id.mjs';
|
|
6
|
-
import { cancelFrame, frameData, frameSteps, frame } from '../../frameloop/frame.mjs';
|
|
7
|
-
import { microtask } from '../../frameloop/microtask.mjs';
|
|
8
|
-
import { time } from '../../frameloop/sync-time.mjs';
|
|
9
12
|
import { isSVGElement } from '../../render/dom/utils/is-svg-element.mjs';
|
|
10
13
|
import { FlatTree } from '../../render/utils/flat-tree.mjs';
|
|
11
|
-
import { activeAnimations } from '../../stats/animation-count.mjs';
|
|
12
|
-
import { statsBuffer } from '../../stats/buffer.mjs';
|
|
13
14
|
import { clamp } from '../../utils/clamp.mjs';
|
|
14
15
|
import { delay } from '../../utils/delay.mjs';
|
|
15
16
|
import { mixNumber } from '../../utils/mix/number.mjs';
|
|
16
|
-
import { SubscriptionManager } from '../../utils/subscription-manager.mjs';
|
|
17
17
|
import { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';
|
|
18
18
|
import { mixValues } from '../animation/mix-values.mjs';
|
|
19
19
|
import { copyBoxInto, copyAxisDeltaInto } from '../geometry/copy.mjs';
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { SubscriptionManager } from '../../../../motion-utils/dist/es/subscription-manager.mjs';
|
|
3
|
+
import { warnOnce } from '../../../../motion-utils/dist/es/warn-once.mjs';
|
|
4
|
+
import { frame, cancelFrame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
5
|
+
import { time } from '../../../../motion-dom/dist/es/frameloop/sync-time.mjs';
|
|
6
|
+
import { motionValue } from '../../../../motion-dom/dist/es/value/index.mjs';
|
|
2
7
|
import { featureDefinitions } from '../motion/features/definitions.mjs';
|
|
3
8
|
import { createBox } from '../projection/geometry/models.mjs';
|
|
4
9
|
import { isNumericalString } from '../utils/is-numerical-string.mjs';
|
|
5
10
|
import { isZeroValueString } from '../utils/is-zero-value-string.mjs';
|
|
6
11
|
import { initPrefersReducedMotion } from '../utils/reduced-motion/index.mjs';
|
|
7
12
|
import { hasReducedMotionListener, prefersReducedMotion } from '../utils/reduced-motion/state.mjs';
|
|
8
|
-
import { SubscriptionManager } from '../utils/subscription-manager.mjs';
|
|
9
|
-
import { warnOnce } from '../utils/warn-once.mjs';
|
|
10
|
-
import { motionValue } from '../value/index.mjs';
|
|
11
13
|
import { complex } from '../value/types/complex/index.mjs';
|
|
12
14
|
import { isMotionValue } from '../value/utils/is-motion-value.mjs';
|
|
13
15
|
import { getAnimatableNone } from './dom/value-types/animatable-none.mjs';
|
|
@@ -18,7 +20,6 @@ import { isControllingVariants, isVariantNode } from './utils/is-controlling-var
|
|
|
18
20
|
import { KeyframeResolver } from './utils/KeyframesResolver.mjs';
|
|
19
21
|
import { updateMotionValuesFromProps } from './utils/motion-values.mjs';
|
|
20
22
|
import { resolveVariantFromProps } from './utils/resolve-variants.mjs';
|
|
21
|
-
import { frame, cancelFrame } from '../frameloop/frame.mjs';
|
|
22
23
|
|
|
23
24
|
const propEventHandlers = [
|
|
24
25
|
"AnimationStart",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { warnOnce } from '../../../../../motion-utils/dist/es/warn-once.mjs';
|
|
2
3
|
|
|
3
4
|
function createDOMMotionComponentProxy(componentFactory) {
|
|
4
5
|
if (typeof Proxy === "undefined") {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { isMotionValue } from '../../value/utils/is-motion-value.mjs';
|
|
1
2
|
import { VisualElement } from '../VisualElement.mjs';
|
|
2
3
|
import { DOMKeyframesResolver } from './DOMKeyframesResolver.mjs';
|
|
3
|
-
import { isMotionValue } from '../../value/utils/is-motion-value.mjs';
|
|
4
4
|
|
|
5
5
|
class DOMVisualElement extends VisualElement {
|
|
6
6
|
constructor() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
2
|
import { progress } from '../../../../../../motion-utils/dist/es/progress.mjs';
|
|
3
|
-
import { velocityPerSecond } from '
|
|
3
|
+
import { velocityPerSecond } from '../../../../../../motion-utils/dist/es/velocity-per-second.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* A time in milliseconds, beyond which we consider the scroll velocity to be 0.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { frame, cancelFrame } from '../../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
2
3
|
|
|
3
4
|
function observeTimeline(update, timeline) {
|
|
4
5
|
let prevProgress;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { warnOnce } from '../../../../../../motion-utils/dist/es/warn-once.mjs';
|
|
2
3
|
import { updateScrollInfo } from './info.mjs';
|
|
3
4
|
import { resolveOffsets } from './offsets/index.mjs';
|
|
4
5
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import '../../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { frame, cancelFrame, frameData } from '../../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
1
3
|
import { resize } from '../resize/index.mjs';
|
|
2
4
|
import { createScrollInfo } from './info.mjs';
|
|
3
5
|
import { createOnScrollHandler } from './on-scroll-handler.mjs';
|
|
4
|
-
import { frame, cancelFrame, frameData } from '../../../frameloop/frame.mjs';
|
|
5
6
|
|
|
6
7
|
const scrollListeners = new WeakMap();
|
|
7
8
|
const resizeListeners = new WeakMap();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { frame } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
2
3
|
import { createBox } from '../../projection/geometry/models.mjs';
|
|
3
4
|
import { DOMVisualElement } from '../dom/DOMVisualElement.mjs';
|
|
4
5
|
import { camelToDash } from '../dom/utils/camel-to-dash.mjs';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { frame } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
2
3
|
import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';
|
|
3
4
|
import { transformProps } from '../html/utils/keys-transform.mjs';
|
|
4
5
|
import { buildSVGAttrs } from './utils/build-attrs.mjs';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { frame } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
1
3
|
import { removeNonTranslationalTransform } from '../dom/utils/unit-conversion.mjs';
|
|
2
|
-
import { frame } from '../../frameloop/frame.mjs';
|
|
3
4
|
|
|
4
5
|
const toResolve = new Set();
|
|
5
6
|
let isScheduled = false;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { addUniqueItem, removeItem } from '
|
|
1
|
+
import { addUniqueItem, removeItem } from '../../../../../motion-utils/dist/es/array.mjs';
|
|
2
|
+
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
3
|
import { compareByDepth } from './compare-by-depth.mjs';
|
|
3
4
|
|
|
4
5
|
class FlatTree {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { warnOnce } from '../../../../../motion-utils/dist/es/warn-once.mjs';
|
|
3
|
+
import { motionValue } from '../../../../../motion-dom/dist/es/value/index.mjs';
|
|
3
4
|
import { isMotionValue } from '../../value/utils/is-motion-value.mjs';
|
|
4
5
|
|
|
5
6
|
function updateMotionValuesFromProps(element, next, prev) {
|
|
@@ -17,7 +18,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
17
18
|
* and warn against mismatches.
|
|
18
19
|
*/
|
|
19
20
|
if (process.env.NODE_ENV === "development") {
|
|
20
|
-
warnOnce(nextValue.version === "12.
|
|
21
|
+
warnOnce(nextValue.version === "12.5.0", `Attempting to mix Motion versions ${nextValue.version} with 12.5.0 may not work as expected.`);
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
else if (isMotionValue(prevValue)) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { motionValue } from '../../../../../motion-dom/dist/es/value/index.mjs';
|
|
1
3
|
import { resolveFinalValueInKeyframes } from '../../utils/resolve-value.mjs';
|
|
2
|
-
import { motionValue } from '../../value/index.mjs';
|
|
3
4
|
import { resolveVariant } from './resolve-dynamic-variants.mjs';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
2
|
import { secondsToMilliseconds } from '../../../../motion-utils/dist/es/time-conversion.mjs';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { frame, cancelFrame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
4
|
+
import { time } from '../../../../motion-dom/dist/es/frameloop/sync-time.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Timeout defined in ms
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import '../../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { warnOnce } from '../../../../../motion-utils/dist/es/warn-once.mjs';
|
|
1
3
|
import { useState } from 'react';
|
|
2
4
|
import { initPrefersReducedMotion } from './index.mjs';
|
|
3
|
-
import { warnOnce } from '../warn-once.mjs';
|
|
4
5
|
import { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { frame, cancelFrame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
1
3
|
import { useRef, useContext, useEffect } from 'react';
|
|
2
4
|
import { MotionConfigContext } from '../context/MotionConfigContext.mjs';
|
|
3
|
-
import { frame, cancelFrame } from '../frameloop/frame.mjs';
|
|
4
5
|
|
|
5
6
|
function useAnimationFrame(callback) {
|
|
6
7
|
const initialTimestamp = useRef(0);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { frame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
1
3
|
import { useState, useCallback } from 'react';
|
|
2
4
|
import { useIsMounted } from './use-is-mounted.mjs';
|
|
3
|
-
import { frame } from '../frameloop/frame.mjs';
|
|
4
5
|
|
|
5
6
|
function useForceUpdate() {
|
|
6
7
|
const isMounted = useIsMounted();
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { frame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
1
3
|
import { useRef, useEffect } from 'react';
|
|
2
4
|
import { useInstantLayoutTransition } from '../projection/use-instant-layout-transition.mjs';
|
|
3
5
|
import { useForceUpdate } from './use-force-update.mjs';
|
|
4
6
|
import { instantAnimationState } from './use-instant-transition-state.mjs';
|
|
5
|
-
import { frame } from '../frameloop/frame.mjs';
|
|
6
7
|
|
|
7
8
|
function useInstantTransition() {
|
|
8
9
|
const [forceUpdate, forcedRenderCount] = useForceUpdate();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { cancelFrame, frame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
2
3
|
import { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs';
|
|
3
|
-
import {
|
|
4
|
+
import { useMotionValue } from './use-motion-value.mjs';
|
|
4
5
|
|
|
5
6
|
function useCombineMotionValues(values, combineValues) {
|
|
6
7
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../../motion-utils/dist/es/errors.mjs';
|
|
2
|
+
import { collectMotionValues } from '../../../../motion-dom/dist/es/value/index.mjs';
|
|
2
3
|
import { useCombineMotionValues } from './use-combine-values.mjs';
|
|
3
4
|
|
|
4
5
|
function useComputed(compute) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useTransform } from './use-transform.mjs';
|
|
2
1
|
import { invariant, warning } from '../../../../motion-utils/dist/es/errors.mjs';
|
|
3
|
-
import { useMotionValue } from './use-motion-value.mjs';
|
|
4
|
-
import { MotionContext } from '../context/MotionContext/index.mjs';
|
|
5
2
|
import { useContext } from 'react';
|
|
3
|
+
import { MotionContext } from '../context/MotionContext/index.mjs';
|
|
4
|
+
import { useMotionValue } from './use-motion-value.mjs';
|
|
5
|
+
import { useTransform } from './use-transform.mjs';
|
|
6
6
|
|
|
7
7
|
// Keep things reasonable and avoid scale: Infinity. In practise we might need
|
|
8
8
|
// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1]
|