motion-v 1.0.0-alpha.3 → 1.0.0-beta.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.
Files changed (88) hide show
  1. package/dist/cjs/index.js +1064 -268
  2. package/dist/es/components/animate-presence/use-pop-layout.mjs +2 -1
  3. package/dist/es/components/motion/props.d.ts +0 -6
  4. package/dist/es/components/motion/props.mjs +1 -3
  5. package/dist/es/components/motion/use-motion-state.mjs +5 -3
  6. package/dist/es/components/motion/utils.mjs +4 -2
  7. package/dist/es/components/reorder/utils.mjs +2 -1
  8. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/animation/animate/index.mjs +2 -1
  9. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/animation/animate/resolve-subjects.mjs +2 -1
  10. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/animation/animate/single-value.mjs +2 -1
  11. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs +4 -1
  12. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/animation/animators/BaseAnimation.mjs +2 -1
  13. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs +2 -3
  14. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.mjs +3 -1
  15. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/animation/animators/utils/can-animate.mjs +1 -1
  16. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/animation/animators/waapi/NativeAnimation.mjs +4 -1
  17. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +2 -1
  18. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs +2 -1
  19. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/animation/animators/waapi/index.mjs +2 -9
  20. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/animation/generators/spring/index.mjs +2 -1
  21. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/animation/interfaces/motion-value.mjs +3 -1
  22. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +3 -1
  23. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/animation/sequence/create.mjs +2 -1
  24. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/easing/utils/map.mjs +1 -1
  25. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/projection/node/create-projection-node.mjs +4 -24
  26. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/render/VisualElement.mjs +3 -1
  27. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/render/dom/resize/handle-element.mjs +2 -1
  28. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/render/dom/scroll/index.mjs +1 -1
  29. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/render/dom/scroll/observe.mjs +2 -1
  30. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/render/dom/scroll/track.mjs +2 -1
  31. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/render/dom/viewport/index.mjs +2 -1
  32. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +2 -1
  33. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/render/utils/KeyframesResolver.mjs +2 -1
  34. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/render/utils/motion-values.mjs +1 -1
  35. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/render/utils/setters.mjs +2 -1
  36. package/dist/es/external/.pnpm/framer-motion@12.5.0/external/framer-motion/dist/es/utils/delay.mjs +2 -1
  37. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/animation/controls/BaseGroup.mjs +79 -0
  38. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/animation/controls/Group.mjs +9 -0
  39. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs +15 -0
  40. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs +17 -0
  41. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/animation/generators/utils/is-generator.mjs +6 -0
  42. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/animation/utils/get-value-transition.mjs +6 -0
  43. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/animation/waapi/NativeAnimationControls.mjs +81 -0
  44. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/animation/waapi/utils/attach-timeline.mjs +7 -0
  45. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/animation/waapi/utils/easing.mjs +37 -0
  46. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/animation/waapi/utils/linear.mjs +13 -0
  47. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/batcher.mjs +64 -0
  48. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/frame.mjs +10 -0
  49. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/microtask.mjs +6 -0
  50. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/order.mjs +17 -0
  51. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/render-step.mjs +70 -0
  52. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/sync-time.mjs +22 -0
  53. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/gestures/drag/state/is-active.mjs +11 -0
  54. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/gestures/hover.mjs +30 -0
  55. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/gestures/press/index.mjs +74 -0
  56. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs +13 -0
  57. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/gestures/press/utils/keyboard.mjs +32 -0
  58. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/gestures/press/utils/state.mjs +4 -0
  59. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/gestures/utils/capture-pointer.mjs +12 -0
  60. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs +12 -0
  61. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs +10 -0
  62. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/gestures/utils/setup.mjs +15 -0
  63. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/stats/buffer.mjs +7 -0
  64. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/utils/is-bezier-definition.mjs +4 -0
  65. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/utils/resolve-elements.mjs +17 -0
  66. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/utils/supports/flags.mjs +6 -0
  67. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/utils/supports/linear-easing.mjs +12 -0
  68. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/utils/supports/memo.mjs +13 -0
  69. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/utils/supports/scroll-timeline.mjs +6 -0
  70. package/dist/es/external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/value/index.mjs +277 -0
  71. package/dist/es/external/.pnpm/motion-utils@12.5.0/external/motion-utils/dist/es/global-config.mjs +7 -0
  72. package/dist/es/features/gestures/drag/VisualElementDragControls.mjs +2 -1
  73. package/dist/es/features/gestures/hover/index.mjs +3 -1
  74. package/dist/es/features/gestures/in-view/index.mjs +2 -1
  75. package/dist/es/features/gestures/pan/PanSession.mjs +2 -1
  76. package/dist/es/features/gestures/pan/index.mjs +1 -1
  77. package/dist/es/features/gestures/press/index.mjs +3 -1
  78. package/dist/es/index.mjs +6 -1
  79. package/dist/es/state/motion-state.mjs +1 -1
  80. package/dist/es/state/style.mjs +5 -3
  81. package/dist/es/utils/use-animation-frame.mjs +2 -1
  82. package/dist/es/value/use-combine-values.mjs +3 -1
  83. package/dist/es/value/use-computed.mjs +2 -1
  84. package/dist/es/value/use-scroll.mjs +2 -1
  85. package/dist/es/value/use-spring.mjs +3 -1
  86. package/dist/es/value/use-time.mjs +2 -1
  87. package/dist/es/value/use-velocity.mjs +3 -1
  88. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  import { useMotionConfig } from "../motion-config/context.mjs";
2
- import { frame } from "motion-dom";
2
+ import { frame } from "../../external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/frame.mjs";
3
+ import "../../external/.pnpm/motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
3
4
  function usePopLayout(props) {
4
5
  const styles = /* @__PURE__ */ new WeakMap();
5
6
  const config = useMotionConfig();
@@ -218,10 +218,4 @@ export declare const MotionComponentProps: {
218
218
  onPanEnd: {
219
219
  type: FunctionConstructor;
220
220
  };
221
- onFocus: {
222
- type: FunctionConstructor;
223
- };
224
- onBlur: {
225
- type: FunctionConstructor;
226
- };
227
221
  };
@@ -84,9 +84,7 @@ const MotionComponentProps = {
84
84
  "onPanSessionStart": { type: Function },
85
85
  "onPanStart": { type: Function },
86
86
  "onPan": { type: Function },
87
- "onPanEnd": { type: Function },
88
- "onFocus": { type: Function },
89
- "onBlur": { type: Function }
87
+ "onPanEnd": { type: Function }
90
88
  };
91
89
  export {
92
90
  MotionComponentProps
@@ -66,12 +66,12 @@ function useMotionState(props) {
66
66
  ...isSVG ? {} : ((_a2 = state.visualElement) == null ? void 0 : _a2.latestValues) || state.baseTarget
67
67
  };
68
68
  if (isSVG) {
69
- const { attributes, style } = convertSvgStyleToAttributes({
69
+ const { attributes, style: style2 } = convertSvgStyleToAttributes({
70
70
  ...state.isMounted() ? state.target : state.baseTarget,
71
71
  ...styleProps
72
72
  });
73
73
  Object.assign(attrsProps, attributes);
74
- styleProps = style;
74
+ styleProps = style2;
75
75
  }
76
76
  if (props.drag && props.dragListener !== false) {
77
77
  Object.assign(styleProps, {
@@ -81,7 +81,9 @@ function useMotionState(props) {
81
81
  touchAction: props.drag === true ? "none" : `pan-${props.drag === "x" ? "y" : "x"}`
82
82
  });
83
83
  }
84
- attrsProps.style = createStyles(styleProps);
84
+ const style = createStyles(styleProps);
85
+ if (style)
86
+ attrsProps.style = style;
85
87
  return attrsProps;
86
88
  }
87
89
  const instance = getCurrentInstance().proxy;
@@ -80,8 +80,10 @@ function createMotionComponent(component, options = {}) {
80
80
  const isComponent = typeof props.as === "object";
81
81
  if ((!isComponent || props.asChild) && el) {
82
82
  const { style } = getAttrs();
83
- for (const [key, val] of Object.entries(style)) {
84
- el.style[key] = val;
83
+ if (style) {
84
+ for (const [key, val] of Object.entries(style)) {
85
+ el.style[key] = val;
86
+ }
85
87
  }
86
88
  }
87
89
  }
@@ -1,6 +1,7 @@
1
1
  import { mixNumber } from "../../utils/mix/number.mjs";
2
+ import { motionValue } from "../../external/.pnpm/motion-dom@12.5.0/external/motion-dom/dist/es/value/index.mjs";
3
+ import "../../external/.pnpm/motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
4
  import { isMotionValue } from "../../utils/motion-value.mjs";
3
- import { motionValue } from "motion-dom";
4
5
  function compareMin(a, b) {
5
6
  return a.layout.min - b.layout.min;
6
7
  }
@@ -1,4 +1,5 @@
1
- import { GroupPlaybackControls } from "motion-dom";
1
+ import { GroupPlaybackControls } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/controls/Group.mjs";
2
+ import "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
3
  import { animateSequence } from "./sequence.mjs";
3
4
  import { animateSubject } from "./subject.mjs";
4
5
  function isSequence(value) {
@@ -1,4 +1,5 @@
1
- import { resolveElements } from "motion-dom";
1
+ import "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
+ import { resolveElements } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/utils/resolve-elements.mjs";
2
3
  import { isDOMKeyframes } from "../utils/is-dom-keyframes.mjs";
3
4
  function resolveSubjects(subject, keyframes, scope, selectorCache) {
4
5
  if (typeof subject === "string" && isDOMKeyframes(keyframes)) {
@@ -1,4 +1,5 @@
1
- import { motionValue } from "motion-dom";
1
+ import "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
+ import { motionValue } from "../../../../../../../motion-dom@12.5.0/external/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
  function animateSingleValue(value, keyframes, options) {
@@ -1,7 +1,10 @@
1
- import { supportsLinearEasing, attachTimeline, isGenerator, isWaapiSupportedEasing } from "motion-dom";
2
1
  import "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
3
2
  import { noop } from "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/noop.mjs";
4
3
  import { millisecondsToSeconds, secondsToMilliseconds } from "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/time-conversion.mjs";
4
+ import { isGenerator } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/generators/utils/is-generator.mjs";
5
+ import { attachTimeline } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/waapi/utils/attach-timeline.mjs";
6
+ import { isWaapiSupportedEasing } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/waapi/utils/easing.mjs";
7
+ import { supportsLinearEasing } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/utils/supports/linear-easing.mjs";
5
8
  import { anticipate } from "../../easing/anticipate.mjs";
6
9
  import { backInOut } from "../../easing/back.mjs";
7
10
  import { circInOut } from "../../easing/circ.mjs";
@@ -1,4 +1,5 @@
1
- import { time } from "motion-dom";
1
+ import "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
+ import { time } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/sync-time.mjs";
2
3
  import { flushKeyframeResolvers } from "../../render/utils/KeyframesResolver.mjs";
3
4
  import { canAnimate } from "./utils/can-animate.mjs";
4
5
  import { getFinalKeyframe } from "./waapi/utils/get-final-keyframe.mjs";
@@ -1,6 +1,7 @@
1
- import { isGenerator, calcGeneratorDuration, activeAnimations } from "motion-dom";
2
1
  import { invariant } from "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
3
2
  import { millisecondsToSeconds, secondsToMilliseconds } from "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/time-conversion.mjs";
3
+ import { calcGeneratorDuration } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs";
4
+ import { isGenerator } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/generators/utils/is-generator.mjs";
4
5
  import { KeyframeResolver } from "../../render/utils/KeyframesResolver.mjs";
5
6
  import { clamp } from "../../utils/clamp.mjs";
6
7
  import { mix } from "../../utils/mix/index.mjs";
@@ -87,7 +88,6 @@ class MainThreadAnimation extends BaseAnimation {
87
88
  }
88
89
  onPostResolved() {
89
90
  const { autoplay = true } = this.options;
90
- activeAnimations.mainThread++;
91
91
  this.play();
92
92
  if (this.pendingPlayState === "paused" || !autoplay) {
93
93
  this.pause();
@@ -260,7 +260,6 @@ class MainThreadAnimation extends BaseAnimation {
260
260
  this.updateFinishedPromise();
261
261
  this.startTime = this.cancelTime = null;
262
262
  this.resolver.cancel();
263
- activeAnimations.mainThread--;
264
263
  }
265
264
  stopDriver() {
266
265
  if (!this.driver)
@@ -1,4 +1,6 @@
1
- import { frame, cancelFrame, frameData, time } from "motion-dom";
1
+ import "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
+ import { frame, cancelFrame, frameData } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/frame.mjs";
3
+ import { time } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/sync-time.mjs";
2
4
  const frameloopDriver = (update) => {
3
5
  const passTimestamp = ({ timestamp }) => update(timestamp);
4
6
  return {
@@ -1,5 +1,5 @@
1
- import { isGenerator } from "motion-dom";
2
1
  import { warning } from "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
+ import { isGenerator } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/generators/utils/is-generator.mjs";
3
3
  import { isAnimatable } from "../../utils/is-animatable.mjs";
4
4
  function hasKeyframesChanged(keyframes) {
5
5
  const current = keyframes[0];
@@ -1,6 +1,9 @@
1
- import { NativeAnimationControls, isGenerator, createGeneratorEasing, supportsLinearEasing } from "motion-dom";
2
1
  import { invariant } from "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
3
2
  import { secondsToMilliseconds } from "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/time-conversion.mjs";
3
+ import { createGeneratorEasing } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs";
4
+ import { isGenerator } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/generators/utils/is-generator.mjs";
5
+ import { NativeAnimationControls } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/waapi/NativeAnimationControls.mjs";
6
+ import { supportsLinearEasing } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/utils/supports/linear-easing.mjs";
4
7
  import { startWaapiAnimation } from "./index.mjs";
5
8
  import { browserNumberValueTypes } from "../../../render/dom/value-types/number-browser.mjs";
6
9
  import { getFinalKeyframe } from "./utils/get-final-keyframe.mjs";
@@ -1,6 +1,7 @@
1
- import { resolveElements, getValueTransition } from "motion-dom";
2
1
  import { invariant } from "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
3
2
  import { secondsToMilliseconds } from "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/time-conversion.mjs";
3
+ import { getValueTransition } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/utils/get-value-transition.mjs";
4
+ import { resolveElements } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/utils/resolve-elements.mjs";
4
5
  import { NativeAnimation } from "./NativeAnimation.mjs";
5
6
  function animateElements(elementOrSelector, keyframes, options, scope) {
6
7
  const elements = resolveElements(elementOrSelector, scope);
@@ -1,4 +1,5 @@
1
- import { GroupPlaybackControls } from "motion-dom";
1
+ import { GroupPlaybackControls } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/controls/Group.mjs";
2
+ import "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
3
  import { animateElements } from "./animate-elements.mjs";
3
4
  const createScopedWaapiAnimate = (scope) => {
4
5
  function scopedAnimate(elementOrSelector, keyframes, options) {
@@ -1,4 +1,5 @@
1
- import { mapEasingToNativeEasing, statsBuffer, activeAnimations } from "motion-dom";
1
+ import "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
+ import { mapEasingToNativeEasing } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/waapi/utils/easing.mjs";
2
3
  function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeInOut", times } = {}) {
3
4
  const keyframeOptions = { [valueName]: keyframes };
4
5
  if (times)
@@ -6,9 +7,6 @@ function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duratio
6
7
  const easing = mapEasingToNativeEasing(ease, duration);
7
8
  if (Array.isArray(easing))
8
9
  keyframeOptions.easing = easing;
9
- if (statsBuffer.value) {
10
- activeAnimations.waapi++;
11
- }
12
10
  const animation = element.animate(keyframeOptions, {
13
11
  delay,
14
12
  duration,
@@ -17,11 +15,6 @@ function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duratio
17
15
  iterations: repeat + 1,
18
16
  direction: repeatType === "reverse" ? "alternate" : "normal"
19
17
  });
20
- if (statsBuffer.value) {
21
- animation.finished.finally(() => {
22
- activeAnimations.waapi--;
23
- });
24
- }
25
18
  return animation;
26
19
  }
27
20
  export {
@@ -1,6 +1,7 @@
1
- import { calcGeneratorDuration, maxGeneratorDuration, generateLinearEasing } from "motion-dom";
2
1
  import "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
3
2
  import { millisecondsToSeconds, secondsToMilliseconds } from "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/time-conversion.mjs";
3
+ import { calcGeneratorDuration, maxGeneratorDuration } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs";
4
+ import { generateLinearEasing } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/waapi/utils/linear.mjs";
4
5
  import { clamp } from "../../../utils/clamp.mjs";
5
6
  import { calcGeneratorVelocity } from "../utils/velocity.mjs";
6
7
  import { springDefaults } from "./defaults.mjs";
@@ -1,6 +1,8 @@
1
- import { getValueTransition, frame, GroupPlaybackControls } from "motion-dom";
1
+ import { GroupPlaybackControls } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/controls/Group.mjs";
2
+ import { getValueTransition } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/utils/get-value-transition.mjs";
2
3
  import "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
3
4
  import { secondsToMilliseconds } from "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/time-conversion.mjs";
5
+ import { frame } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/frame.mjs";
4
6
  import { AcceleratedAnimation } from "../animators/AcceleratedAnimation.mjs";
5
7
  import { MainThreadAnimation } from "../animators/MainThreadAnimation.mjs";
6
8
  import { getFinalKeyframe } from "../animators/waapi/utils/get-final-keyframe.mjs";
@@ -1,4 +1,6 @@
1
- import { getValueTransition, frame } from "motion-dom";
1
+ import "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
+ import { getValueTransition } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/utils/get-value-transition.mjs";
3
+ import { frame } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/frame.mjs";
2
4
  import { positionalKeys } from "../../render/html/utils/keys-position.mjs";
3
5
  import { setTarget } from "../../render/utils/setters.mjs";
4
6
  import { addValueToWillChange } from "../../value/use-will-change/add-will-change.mjs";
@@ -1,7 +1,8 @@
1
- import { isGenerator, createGeneratorEasing } from "motion-dom";
2
1
  import { invariant } from "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
3
2
  import { progress } from "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/progress.mjs";
4
3
  import { secondsToMilliseconds } from "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/time-conversion.mjs";
4
+ import { createGeneratorEasing } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs";
5
+ import { isGenerator } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/generators/utils/is-generator.mjs";
5
6
  import { getEasingForSegment } from "../../easing/utils/get-easing-for-segment.mjs";
6
7
  import { defaultOffset } from "../../utils/offsets/default.mjs";
7
8
  import { fillOffset } from "../../utils/offsets/fill.mjs";
@@ -1,6 +1,6 @@
1
- import { isBezierDefinition } from "motion-dom";
2
1
  import { invariant } from "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
3
2
  import { noop } from "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/noop.mjs";
3
+ import { isBezierDefinition } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/utils/is-bezier-definition.mjs";
4
4
  import { anticipate } from "../anticipate.mjs";
5
5
  import { backIn, backInOut, backOut } from "../back.mjs";
6
6
  import { circIn, circInOut, circOut } from "../circ.mjs";
@@ -1,7 +1,10 @@
1
- import { statsBuffer, getValueTransition, cancelFrame, time, frameData, frameSteps, microtask, frame, activeAnimations } from "motion-dom";
2
1
  import "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
3
2
  import { noop } from "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/noop.mjs";
4
3
  import { SubscriptionManager } from "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/subscription-manager.mjs";
4
+ import { getValueTransition } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/animation/utils/get-value-transition.mjs";
5
+ import { cancelFrame, frameData, frameSteps, frame } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/frame.mjs";
6
+ import { microtask } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/microtask.mjs";
7
+ import { time } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/sync-time.mjs";
5
8
  import { animateSingleValue } from "../../animation/animate/single-value.mjs";
6
9
  import { getOptimisedAppearId } from "../../animation/optimized-appear/get-appear-id.mjs";
7
10
  import { isSVGElement } from "../../render/dom/utils/is-svg-element.mjs";
@@ -23,11 +26,6 @@ import { buildProjectionTransform } from "../styles/transform.mjs";
23
26
  import { eachAxis } from "../utils/each-axis.mjs";
24
27
  import { hasTransform, hasScale, has2DTranslate } from "../utils/has-transform.mjs";
25
28
  import { globalProjectionState } from "./state.mjs";
26
- const metrics = {
27
- nodes: 0,
28
- calculatedTargetDeltas: 0,
29
- calculatedProjections: 0
30
- };
31
29
  const transformAxes = ["", "X", "Y", "Z"];
32
30
  const hiddenVisibility = { visibility: "hidden" };
33
31
  const animationTarget = 1e3;
@@ -93,16 +91,10 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
93
91
  };
94
92
  this.updateProjection = () => {
95
93
  this.projectionUpdateScheduled = false;
96
- if (statsBuffer.value) {
97
- metrics.nodes = metrics.calculatedTargetDeltas = metrics.calculatedProjections = 0;
98
- }
99
94
  this.nodes.forEach(propagateDirtyNodes);
100
95
  this.nodes.forEach(resolveTargetDelta);
101
96
  this.nodes.forEach(calcProjection);
102
97
  this.nodes.forEach(cleanDirtyNodes);
103
- if (statsBuffer.addProjectionMetrics) {
104
- statsBuffer.addProjectionMetrics(metrics);
105
- }
106
98
  };
107
99
  this.resolvedRelativeTargetAt = 0;
108
100
  this.hasProjected = false;
@@ -561,9 +553,6 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
561
553
  this.relativeParent = this.relativeTarget = void 0;
562
554
  }
563
555
  }
564
- if (statsBuffer.value) {
565
- metrics.calculatedTargetDeltas++;
566
- }
567
556
  }
568
557
  getClosestProjectingParent() {
569
558
  if (!this.parent || hasScale(this.parent.latestValues) || has2DTranslate(this.parent.latestValues)) {
@@ -629,9 +618,6 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
629
618
  this.scheduleRender();
630
619
  this.notifyListeners("projectionUpdate", target);
631
620
  }
632
- if (statsBuffer.value) {
633
- metrics.calculatedProjections++;
634
- }
635
621
  }
636
622
  hide() {
637
623
  this.isVisible = false;
@@ -710,7 +696,6 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
710
696
  }
711
697
  this.pendingAnimation = frame.update(() => {
712
698
  globalProjectionState.hasAnimatedSinceResize = true;
713
- activeAnimations.layout++;
714
699
  this.currentAnimation = animateSingleValue(0, animationTarget, {
715
700
  ...options,
716
701
  onUpdate: (latest) => {
@@ -718,10 +703,8 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
718
703
  options.onUpdate && options.onUpdate(latest);
719
704
  },
720
705
  onStop: () => {
721
- activeAnimations.layout--;
722
706
  },
723
707
  onComplete: () => {
724
- activeAnimations.layout--;
725
708
  options.onComplete && options.onComplete();
726
709
  this.completeAnimation();
727
710
  }
@@ -999,9 +982,6 @@ function notifyLayoutUpdate(node) {
999
982
  node.options.transition = void 0;
1000
983
  }
1001
984
  function propagateDirtyNodes(node) {
1002
- if (statsBuffer.value) {
1003
- metrics.nodes++;
1004
- }
1005
985
  if (!node.parent)
1006
986
  return;
1007
987
  if (!node.isProjecting()) {
@@ -1,7 +1,9 @@
1
- import { time, frame, cancelFrame, motionValue } from "motion-dom";
2
1
  import "../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
3
2
  import { SubscriptionManager } from "../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/subscription-manager.mjs";
4
3
  import { warnOnce } from "../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/warn-once.mjs";
4
+ import { frame, cancelFrame } from "../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/frame.mjs";
5
+ import { time } from "../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/sync-time.mjs";
6
+ import { motionValue } from "../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/value/index.mjs";
5
7
  import { featureDefinitions } from "../motion/features/definitions.mjs";
6
8
  import { createBox } from "../projection/geometry/models.mjs";
7
9
  import { isNumericalString } from "../utils/is-numerical-string.mjs";
@@ -1,4 +1,5 @@
1
- import { resolveElements } from "motion-dom";
1
+ import "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
+ import { resolveElements } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/utils/resolve-elements.mjs";
2
3
  const resizeHandlers = /* @__PURE__ */ new WeakMap();
3
4
  let observer;
4
5
  function getElementSize(target, borderBoxSize) {
@@ -1,4 +1,4 @@
1
- import { supportsScrollTimeline } from "motion-dom";
1
+ import { supportsScrollTimeline } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/utils/supports/scroll-timeline.mjs";
2
2
  import "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
3
3
  import { noop } from "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/noop.mjs";
4
4
  import { observeTimeline } from "./observe.mjs";
@@ -1,4 +1,5 @@
1
- import { frame, cancelFrame } from "motion-dom";
1
+ import "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
+ import { frame, cancelFrame } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/frame.mjs";
2
3
  function observeTimeline(update, timeline) {
3
4
  let prevProgress;
4
5
  const onFrame = () => {
@@ -1,4 +1,5 @@
1
- import { frame, cancelFrame, frameData } from "motion-dom";
1
+ import "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
+ import { frame, cancelFrame, frameData } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/frame.mjs";
2
3
  import { resize } from "../resize/index.mjs";
3
4
  import { createScrollInfo } from "./info.mjs";
4
5
  import { createOnScrollHandler } from "./on-scroll-handler.mjs";
@@ -1,4 +1,5 @@
1
- import { resolveElements } from "motion-dom";
1
+ import "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
+ import { resolveElements } from "../../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/utils/resolve-elements.mjs";
2
3
  const thresholds = {
3
4
  some: 0,
4
5
  all: 1
@@ -1,4 +1,5 @@
1
- import { frame } from "motion-dom";
1
+ import "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
+ import { frame } from "../../../../../../../motion-dom@12.5.0/external/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 { frame } from "motion-dom";
1
+ import "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
+ import { frame } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/frame.mjs";
2
3
  import { removeNonTranslationalTransform } from "../dom/utils/unit-conversion.mjs";
3
4
  const toResolve = /* @__PURE__ */ new Set();
4
5
  let isScheduled = false;
@@ -1,6 +1,6 @@
1
- import { motionValue } from "motion-dom";
2
1
  import "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
3
2
  import { warnOnce } from "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/warn-once.mjs";
3
+ import { motionValue } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/value/index.mjs";
4
4
  import { isMotionValue } from "../../value/utils/is-motion-value.mjs";
5
5
  function updateMotionValuesFromProps(element, next, prev) {
6
6
  for (const key in next) {
@@ -1,4 +1,5 @@
1
- import { motionValue } from "motion-dom";
1
+ import "../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
+ import { motionValue } from "../../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/value/index.mjs";
2
3
  import { resolveFinalValueInKeyframes } from "../../utils/resolve-value.mjs";
3
4
  import { resolveVariant } from "./resolve-dynamic-variants.mjs";
4
5
  function setMotionValue(visualElement, key, value) {
@@ -1,6 +1,7 @@
1
- import { time, frame, cancelFrame } from "motion-dom";
2
1
  import "../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
3
2
  import { secondsToMilliseconds } from "../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/time-conversion.mjs";
3
+ import { frame, cancelFrame } from "../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/frame.mjs";
4
+ import { time } from "../../../../../../motion-dom@12.5.0/external/motion-dom/dist/es/frameloop/sync-time.mjs";
4
5
  function delay(callback, timeout) {
5
6
  const start = time.now();
6
7
  const checkElapsed = ({ timestamp }) => {
@@ -0,0 +1,79 @@
1
+ import { supportsScrollTimeline } from "../../utils/supports/scroll-timeline.mjs";
2
+ class BaseGroupPlaybackControls {
3
+ constructor(animations) {
4
+ this.stop = () => this.runAll("stop");
5
+ this.animations = animations.filter(Boolean);
6
+ }
7
+ get finished() {
8
+ return Promise.all(this.animations.map((animation) => "finished" in animation ? animation.finished : animation));
9
+ }
10
+ /**
11
+ * TODO: Filter out cancelled or stopped animations before returning
12
+ */
13
+ getAll(propName) {
14
+ return this.animations[0][propName];
15
+ }
16
+ setAll(propName, newValue) {
17
+ for (let i = 0; i < this.animations.length; i++) {
18
+ this.animations[i][propName] = newValue;
19
+ }
20
+ }
21
+ attachTimeline(timeline, fallback) {
22
+ const subscriptions = this.animations.map((animation) => {
23
+ if (supportsScrollTimeline() && animation.attachTimeline) {
24
+ return animation.attachTimeline(timeline);
25
+ } else if (typeof fallback === "function") {
26
+ return fallback(animation);
27
+ }
28
+ });
29
+ return () => {
30
+ subscriptions.forEach((cancel, i) => {
31
+ cancel && cancel();
32
+ this.animations[i].stop();
33
+ });
34
+ };
35
+ }
36
+ get time() {
37
+ return this.getAll("time");
38
+ }
39
+ set time(time) {
40
+ this.setAll("time", time);
41
+ }
42
+ get speed() {
43
+ return this.getAll("speed");
44
+ }
45
+ set speed(speed) {
46
+ this.setAll("speed", speed);
47
+ }
48
+ get startTime() {
49
+ return this.getAll("startTime");
50
+ }
51
+ get duration() {
52
+ let max = 0;
53
+ for (let i = 0; i < this.animations.length; i++) {
54
+ max = Math.max(max, this.animations[i].duration);
55
+ }
56
+ return max;
57
+ }
58
+ runAll(methodName) {
59
+ this.animations.forEach((controls) => controls[methodName]());
60
+ }
61
+ flatten() {
62
+ this.runAll("flatten");
63
+ }
64
+ play() {
65
+ this.runAll("play");
66
+ }
67
+ pause() {
68
+ this.runAll("pause");
69
+ }
70
+ cancel() {
71
+ this.runAll("cancel");
72
+ }
73
+ complete() {
74
+ this.runAll("complete");
75
+ }
76
+ }
77
+ export {
78
+ BaseGroupPlaybackControls
79
+ };
@@ -0,0 +1,9 @@
1
+ import { BaseGroupPlaybackControls } from "./BaseGroup.mjs";
2
+ class GroupPlaybackControls extends BaseGroupPlaybackControls {
3
+ then(onResolve, onReject) {
4
+ return Promise.all(this.animations).then(onResolve).catch(onReject);
5
+ }
6
+ }
7
+ export {
8
+ GroupPlaybackControls
9
+ };
@@ -0,0 +1,15 @@
1
+ const maxGeneratorDuration = 2e4;
2
+ function calcGeneratorDuration(generator) {
3
+ let duration = 0;
4
+ const timeStep = 50;
5
+ let state = generator.next(duration);
6
+ while (!state.done && duration < maxGeneratorDuration) {
7
+ duration += timeStep;
8
+ state = generator.next(duration);
9
+ }
10
+ return duration >= maxGeneratorDuration ? Infinity : duration;
11
+ }
12
+ export {
13
+ calcGeneratorDuration,
14
+ maxGeneratorDuration
15
+ };
@@ -0,0 +1,17 @@
1
+ import "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/errors.mjs";
2
+ import { millisecondsToSeconds } from "../../../../../../../../motion-utils@12.5.0/external/motion-utils/dist/es/time-conversion.mjs";
3
+ import { calcGeneratorDuration, maxGeneratorDuration } from "./calc-duration.mjs";
4
+ function createGeneratorEasing(options, scale = 100, createGenerator) {
5
+ const generator = createGenerator({ ...options, keyframes: [0, scale] });
6
+ const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);
7
+ return {
8
+ type: "keyframes",
9
+ ease: (progress) => {
10
+ return generator.next(duration * progress).value / scale;
11
+ },
12
+ duration: millisecondsToSeconds(duration)
13
+ };
14
+ }
15
+ export {
16
+ createGeneratorEasing
17
+ };
@@ -0,0 +1,6 @@
1
+ function isGenerator(type) {
2
+ return typeof type === "function";
3
+ }
4
+ export {
5
+ isGenerator
6
+ };