motion-dom 12.34.3 → 12.35.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 (235) hide show
  1. package/dist/cjs/index.js +69 -94
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/es/animation/AsyncMotionValueAnimation.mjs.map +1 -1
  4. package/dist/es/animation/GroupAnimation.mjs.map +1 -1
  5. package/dist/es/animation/GroupAnimationWithThen.mjs.map +1 -1
  6. package/dist/es/animation/JSAnimation.mjs.map +1 -1
  7. package/dist/es/animation/NativeAnimation.mjs +13 -8
  8. package/dist/es/animation/NativeAnimation.mjs.map +1 -1
  9. package/dist/es/animation/NativeAnimationExtended.mjs.map +1 -1
  10. package/dist/es/animation/NativeAnimationWrapper.mjs.map +1 -1
  11. package/dist/es/animation/animate/single-value.mjs.map +1 -1
  12. package/dist/es/animation/drivers/frame.mjs +1 -1
  13. package/dist/es/animation/drivers/frame.mjs.map +1 -1
  14. package/dist/es/animation/generators/inertia.mjs.map +1 -1
  15. package/dist/es/animation/generators/keyframes.mjs.map +1 -1
  16. package/dist/es/animation/generators/spring/defaults.mjs.map +1 -1
  17. package/dist/es/animation/generators/spring/find.mjs.map +1 -1
  18. package/dist/es/animation/generators/spring/index.mjs +1 -1
  19. package/dist/es/animation/generators/spring/index.mjs.map +1 -1
  20. package/dist/es/animation/generators/utils/calc-duration.mjs.map +1 -1
  21. package/dist/es/animation/generators/utils/create-generator-easing.mjs.map +1 -1
  22. package/dist/es/animation/generators/utils/is-generator.mjs.map +1 -1
  23. package/dist/es/animation/generators/utils/velocity.mjs.map +1 -1
  24. package/dist/es/animation/interfaces/motion-value.mjs.map +1 -1
  25. package/dist/es/animation/interfaces/visual-element-target.mjs.map +1 -1
  26. package/dist/es/animation/interfaces/visual-element-variant.mjs.map +1 -1
  27. package/dist/es/animation/interfaces/visual-element.mjs.map +1 -1
  28. package/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.map +1 -1
  29. package/dist/es/animation/keyframes/KeyframesResolver.mjs.map +1 -1
  30. package/dist/es/animation/keyframes/get-final.mjs.map +1 -1
  31. package/dist/es/animation/keyframes/offsets/default.mjs.map +1 -1
  32. package/dist/es/animation/keyframes/offsets/fill.mjs.map +1 -1
  33. package/dist/es/animation/keyframes/offsets/time.mjs.map +1 -1
  34. package/dist/es/animation/keyframes/utils/apply-px-defaults.mjs.map +1 -1
  35. package/dist/es/animation/keyframes/utils/fill-wildcards.mjs.map +1 -1
  36. package/dist/es/animation/keyframes/utils/is-none.mjs.map +1 -1
  37. package/dist/es/animation/keyframes/utils/make-none-animatable.mjs.map +1 -1
  38. package/dist/es/animation/keyframes/utils/unit-conversion.mjs.map +1 -1
  39. package/dist/es/animation/optimized-appear/data-id.mjs.map +1 -1
  40. package/dist/es/animation/optimized-appear/get-appear-id.mjs.map +1 -1
  41. package/dist/es/animation/utils/WithPromise.mjs.map +1 -1
  42. package/dist/es/animation/utils/active-animations.mjs.map +1 -1
  43. package/dist/es/animation/utils/calc-child-stagger.mjs.map +1 -1
  44. package/dist/es/animation/utils/can-animate.mjs.map +1 -1
  45. package/dist/es/animation/utils/css-variables-conversion.mjs.map +1 -1
  46. package/dist/es/animation/utils/default-transitions.mjs.map +1 -1
  47. package/dist/es/animation/utils/get-final-keyframe.mjs.map +1 -1
  48. package/dist/es/animation/utils/get-value-transition.mjs.map +1 -1
  49. package/dist/es/animation/utils/is-animatable.mjs.map +1 -1
  50. package/dist/es/animation/utils/is-css-variable.mjs.map +1 -1
  51. package/dist/es/animation/utils/is-transition-defined.mjs.map +1 -1
  52. package/dist/es/animation/utils/make-animation-instant.mjs.map +1 -1
  53. package/dist/es/animation/utils/replace-transition-type.mjs.map +1 -1
  54. package/dist/es/animation/utils/resolve-transition.mjs.map +1 -1
  55. package/dist/es/animation/waapi/easing/cubic-bezier.mjs.map +1 -1
  56. package/dist/es/animation/waapi/easing/is-supported.mjs.map +1 -1
  57. package/dist/es/animation/waapi/easing/map-easing.mjs.map +1 -1
  58. package/dist/es/animation/waapi/easing/supported.mjs.map +1 -1
  59. package/dist/es/animation/waapi/start-waapi-animation.mjs.map +1 -1
  60. package/dist/es/animation/waapi/supports/partial-keyframes.mjs.map +1 -1
  61. package/dist/es/animation/waapi/supports/waapi.mjs.map +1 -1
  62. package/dist/es/animation/waapi/utils/accelerated-values.mjs.map +1 -1
  63. package/dist/es/animation/waapi/utils/apply-generator.mjs.map +1 -1
  64. package/dist/es/animation/waapi/utils/linear.mjs.map +1 -1
  65. package/dist/es/animation/waapi/utils/px-values.mjs.map +1 -1
  66. package/dist/es/animation/waapi/utils/unsupported-easing.mjs +1 -1
  67. package/dist/es/animation/waapi/utils/unsupported-easing.mjs.map +1 -1
  68. package/dist/es/effects/MotionValueState.mjs.map +1 -1
  69. package/dist/es/effects/attr/index.mjs.map +1 -1
  70. package/dist/es/effects/prop/index.mjs.map +1 -1
  71. package/dist/es/effects/style/index.mjs.map +1 -1
  72. package/dist/es/effects/style/transform.mjs.map +1 -1
  73. package/dist/es/effects/svg/index.mjs.map +1 -1
  74. package/dist/es/effects/utils/create-dom-effect.mjs.map +1 -1
  75. package/dist/es/effects/utils/create-effect.mjs.map +1 -1
  76. package/dist/es/events/add-dom-event.mjs.map +1 -1
  77. package/dist/es/frameloop/batcher.mjs.map +1 -1
  78. package/dist/es/frameloop/frame.mjs.map +1 -1
  79. package/dist/es/frameloop/index-legacy.mjs.map +1 -1
  80. package/dist/es/frameloop/microtask.mjs.map +1 -1
  81. package/dist/es/frameloop/order.mjs.map +1 -1
  82. package/dist/es/frameloop/render-step.mjs.map +1 -1
  83. package/dist/es/frameloop/sync-time.mjs.map +1 -1
  84. package/dist/es/gestures/drag/state/is-active.mjs.map +1 -1
  85. package/dist/es/gestures/drag/state/set-active.mjs.map +1 -1
  86. package/dist/es/gestures/hover.mjs.map +1 -1
  87. package/dist/es/gestures/press/index.mjs.map +1 -1
  88. package/dist/es/gestures/press/utils/is-keyboard-accessible.mjs.map +1 -1
  89. package/dist/es/gestures/press/utils/keyboard.mjs.map +1 -1
  90. package/dist/es/gestures/press/utils/state.mjs.map +1 -1
  91. package/dist/es/gestures/utils/is-node-or-child.mjs.map +1 -1
  92. package/dist/es/gestures/utils/is-primary-pointer.mjs.map +1 -1
  93. package/dist/es/gestures/utils/setup.mjs.map +1 -1
  94. package/dist/es/index.mjs +2 -2
  95. package/dist/es/layout/LayoutAnimationBuilder.mjs.map +1 -1
  96. package/dist/es/projection/animation/mix-values.mjs.map +1 -1
  97. package/dist/es/projection/geometry/conversion.mjs.map +1 -1
  98. package/dist/es/projection/geometry/copy.mjs.map +1 -1
  99. package/dist/es/projection/geometry/delta-apply.mjs +8 -2
  100. package/dist/es/projection/geometry/delta-apply.mjs.map +1 -1
  101. package/dist/es/projection/geometry/delta-calc.mjs.map +1 -1
  102. package/dist/es/projection/geometry/delta-remove.mjs.map +1 -1
  103. package/dist/es/projection/geometry/models.mjs.map +1 -1
  104. package/dist/es/projection/geometry/utils.mjs.map +1 -1
  105. package/dist/es/projection/node/HTMLProjectionNode.mjs.map +1 -1
  106. package/dist/es/projection/node/create-projection-node.mjs +1 -1
  107. package/dist/es/projection/node/create-projection-node.mjs.map +1 -1
  108. package/dist/es/projection/node/group.mjs.map +1 -1
  109. package/dist/es/projection/node/state.mjs.map +1 -1
  110. package/dist/es/projection/shared/stack.mjs +32 -75
  111. package/dist/es/projection/shared/stack.mjs.map +1 -1
  112. package/dist/es/projection/styles/scale-border-radius.mjs.map +1 -1
  113. package/dist/es/projection/styles/scale-box-shadow.mjs.map +1 -1
  114. package/dist/es/projection/styles/scale-correction.mjs.map +1 -1
  115. package/dist/es/projection/styles/transform.mjs.map +1 -1
  116. package/dist/es/projection/utils/compare-by-depth.mjs.map +1 -1
  117. package/dist/es/projection/utils/each-axis.mjs.map +1 -1
  118. package/dist/es/projection/utils/flat-tree.mjs.map +1 -1
  119. package/dist/es/projection/utils/has-transform.mjs.map +1 -1
  120. package/dist/es/projection/utils/measure.mjs.map +1 -1
  121. package/dist/es/render/Feature.mjs.map +1 -1
  122. package/dist/es/render/VisualElement.mjs.map +1 -1
  123. package/dist/es/render/dom/DOMVisualElement.mjs.map +1 -1
  124. package/dist/es/render/dom/parse-transform.mjs.map +1 -1
  125. package/dist/es/render/dom/style-computed.mjs.map +1 -1
  126. package/dist/es/render/dom/style-set.mjs.map +1 -1
  127. package/dist/es/render/dom/utils/camel-to-dash.mjs.map +1 -1
  128. package/dist/es/render/html/HTMLVisualElement.mjs.map +1 -1
  129. package/dist/es/render/html/utils/build-styles.mjs.map +1 -1
  130. package/dist/es/render/html/utils/build-transform.mjs.map +1 -1
  131. package/dist/es/render/html/utils/render.mjs.map +1 -1
  132. package/dist/es/render/html/utils/scrape-motion-values.mjs.map +1 -1
  133. package/dist/es/render/object/ObjectVisualElement.mjs.map +1 -1
  134. package/dist/es/render/store.mjs.map +1 -1
  135. package/dist/es/render/svg/SVGVisualElement.mjs.map +1 -1
  136. package/dist/es/render/svg/utils/build-attrs.mjs.map +1 -1
  137. package/dist/es/render/svg/utils/camel-case-attrs.mjs.map +1 -1
  138. package/dist/es/render/svg/utils/path.mjs.map +1 -1
  139. package/dist/es/render/svg/utils/render.mjs.map +1 -1
  140. package/dist/es/render/svg/utils/scrape-motion-values.mjs.map +1 -1
  141. package/dist/es/render/utils/animation-state.mjs +14 -9
  142. package/dist/es/render/utils/animation-state.mjs.map +1 -1
  143. package/dist/es/render/utils/get-variant-context.mjs.map +1 -1
  144. package/dist/es/render/utils/is-animation-controls.mjs.map +1 -1
  145. package/dist/es/render/utils/is-controlling-variants.mjs.map +1 -1
  146. package/dist/es/render/utils/is-forced-motion-value.mjs.map +1 -1
  147. package/dist/es/render/utils/is-keyframes-target.mjs.map +1 -1
  148. package/dist/es/render/utils/is-variant-label.mjs.map +1 -1
  149. package/dist/es/render/utils/keys-position.mjs.map +1 -1
  150. package/dist/es/render/utils/keys-transform.mjs.map +1 -1
  151. package/dist/es/render/utils/motion-values.mjs.map +1 -1
  152. package/dist/es/render/utils/reduced-motion/index.mjs.map +1 -1
  153. package/dist/es/render/utils/reduced-motion/state.mjs.map +1 -1
  154. package/dist/es/render/utils/resolve-dynamic-variants.mjs.map +1 -1
  155. package/dist/es/render/utils/resolve-variants.mjs.map +1 -1
  156. package/dist/es/render/utils/setters.mjs.map +1 -1
  157. package/dist/es/render/utils/shallow-compare.mjs.map +1 -1
  158. package/dist/es/render/utils/variant-props.mjs.map +1 -1
  159. package/dist/es/resize/handle-element.mjs.map +1 -1
  160. package/dist/es/resize/handle-window.mjs.map +1 -1
  161. package/dist/es/resize/index.mjs.map +1 -1
  162. package/dist/es/scroll/observe.mjs.map +1 -1
  163. package/dist/es/stats/animation-count.mjs.map +1 -1
  164. package/dist/es/stats/buffer.mjs.map +1 -1
  165. package/dist/es/stats/index.mjs.map +1 -1
  166. package/dist/es/utils/delay.mjs.map +1 -1
  167. package/dist/es/utils/interpolate.mjs.map +1 -1
  168. package/dist/es/utils/is-html-element.mjs.map +1 -1
  169. package/dist/es/utils/is-svg-element.mjs.map +1 -1
  170. package/dist/es/utils/is-svg-svg-element.mjs.map +1 -1
  171. package/dist/es/utils/mix/color.mjs.map +1 -1
  172. package/dist/es/utils/mix/complex.mjs.map +1 -1
  173. package/dist/es/utils/mix/immediate.mjs.map +1 -1
  174. package/dist/es/utils/mix/index.mjs.map +1 -1
  175. package/dist/es/utils/mix/number.mjs.map +1 -1
  176. package/dist/es/utils/mix/visibility.mjs.map +1 -1
  177. package/dist/es/utils/resolve-elements.mjs.map +1 -1
  178. package/dist/es/utils/stagger.mjs.map +1 -1
  179. package/dist/es/utils/supports/linear-easing.mjs.map +1 -1
  180. package/dist/es/utils/supports/memo.mjs.map +1 -1
  181. package/dist/es/utils/supports/scroll-timeline.mjs +2 -1
  182. package/dist/es/utils/supports/scroll-timeline.mjs.map +1 -1
  183. package/dist/es/utils/transform.mjs.map +1 -1
  184. package/dist/es/value/follow-value.mjs.map +1 -1
  185. package/dist/es/value/index.mjs.map +1 -1
  186. package/dist/es/value/map-value.mjs.map +1 -1
  187. package/dist/es/value/spring-value.mjs +1 -1
  188. package/dist/es/value/spring-value.mjs.map +1 -1
  189. package/dist/es/value/subscribe-value.mjs.map +1 -1
  190. package/dist/es/value/transform-value.mjs.map +1 -1
  191. package/dist/es/value/types/auto.mjs.map +1 -1
  192. package/dist/es/value/types/color/hex.mjs.map +1 -1
  193. package/dist/es/value/types/color/hsla-to-rgba.mjs.map +1 -1
  194. package/dist/es/value/types/color/hsla.mjs +1 -1
  195. package/dist/es/value/types/color/hsla.mjs.map +1 -1
  196. package/dist/es/value/types/color/index.mjs.map +1 -1
  197. package/dist/es/value/types/color/rgba.mjs +1 -1
  198. package/dist/es/value/types/color/rgba.mjs.map +1 -1
  199. package/dist/es/value/types/color/utils.mjs.map +1 -1
  200. package/dist/es/value/types/complex/filter.mjs.map +1 -1
  201. package/dist/es/value/types/complex/index.mjs.map +1 -1
  202. package/dist/es/value/types/complex/mask.mjs.map +1 -1
  203. package/dist/es/value/types/dimensions.mjs.map +1 -1
  204. package/dist/es/value/types/int.mjs.map +1 -1
  205. package/dist/es/value/types/maps/defaults.mjs.map +1 -1
  206. package/dist/es/value/types/maps/number.mjs.map +1 -1
  207. package/dist/es/value/types/maps/transform.mjs +2 -2
  208. package/dist/es/value/types/maps/transform.mjs.map +1 -1
  209. package/dist/es/value/types/numbers/index.mjs.map +1 -1
  210. package/dist/es/value/types/numbers/units.mjs.map +1 -1
  211. package/dist/es/value/types/utils/animatable-none.mjs.map +1 -1
  212. package/dist/es/value/types/utils/find.mjs.map +1 -1
  213. package/dist/es/value/types/utils/get-as-type.mjs.map +1 -1
  214. package/dist/es/value/types/utils/is-nullish.mjs.map +1 -1
  215. package/dist/es/value/types/utils/sanitize.mjs.map +1 -1
  216. package/dist/es/value/utils/is-motion-value.mjs.map +1 -1
  217. package/dist/es/value/utils/resolve-motion-value.mjs.map +1 -1
  218. package/dist/es/value/will-change/add-will-change.mjs.map +1 -1
  219. package/dist/es/value/will-change/is.mjs.map +1 -1
  220. package/dist/es/view/index.mjs.map +1 -1
  221. package/dist/es/view/queue.mjs.map +1 -1
  222. package/dist/es/view/start.mjs.map +1 -1
  223. package/dist/es/view/utils/choose-layer-type.mjs.map +1 -1
  224. package/dist/es/view/utils/css.mjs.map +1 -1
  225. package/dist/es/view/utils/get-layer-info.mjs.map +1 -1
  226. package/dist/es/view/utils/get-view-animations.mjs.map +1 -1
  227. package/dist/es/view/utils/has-target.mjs.map +1 -1
  228. package/dist/index.d.ts +16 -6
  229. package/dist/motion-dom.dev.js +69 -94
  230. package/dist/motion-dom.js +1 -1
  231. package/dist/size-rollup-motion-value.js +1 -1
  232. package/dist/size-rollup-motion-value.js.map +1 -1
  233. package/dist/size-rollup-style-effect.js +1 -1
  234. package/dist/size-rollup-style-effect.js.map +1 -1
  235. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"start.mjs","sources":["../../../src/view/start.ts"],"sourcesContent":["import { secondsToMilliseconds } from \"motion-utils\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport { NativeAnimationWrapper } from \"../animation/NativeAnimationWrapper\"\nimport { AnimationPlaybackControls } from \"../animation/types\"\nimport { getValueTransition } from \"../animation/utils/get-value-transition\"\nimport { mapEasingToNativeEasing } from \"../animation/waapi/easing/map-easing\"\nimport { applyGeneratorOptions } from \"../animation/waapi/utils/apply-generator\"\nimport type { ViewTransitionBuilder } from \"./index\"\nimport { ViewTransitionTarget } from \"./types\"\nimport { chooseLayerType } from \"./utils/choose-layer-type\"\nimport { css } from \"./utils/css\"\nimport { getViewAnimationLayerInfo } from \"./utils/get-layer-info\"\nimport { getViewAnimations } from \"./utils/get-view-animations\"\nimport { hasTarget } from \"./utils/has-target\"\n\nconst definitionNames = [\"layout\", \"enter\", \"exit\", \"new\", \"old\"] as const\n\nexport function startViewAnimation(\n builder: ViewTransitionBuilder\n): Promise<GroupAnimation> {\n const { update, targets, options: defaultOptions } = builder\n\n if (!document.startViewTransition) {\n return new Promise(async (resolve) => {\n await update()\n resolve(new GroupAnimation([]))\n })\n }\n\n // TODO: Go over existing targets and ensure they all have ids\n\n /**\n * If we don't have any animations defined for the root target,\n * remove it from being captured.\n */\n if (!hasTarget(\"root\", targets)) {\n css.set(\":root\", {\n \"view-transition-name\": \"none\",\n })\n }\n\n /**\n * Set the timing curve to linear for all view transition layers.\n * This gets baked into the keyframes, which can't be changed\n * without breaking the generated animation.\n *\n * This allows us to set easing via updateTiming - which can be changed.\n */\n css.set(\n \"::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)\",\n { \"animation-timing-function\": \"linear !important\" }\n )\n\n css.commit() // Write\n\n const transition = document.startViewTransition(async () => {\n await update()\n\n // TODO: Go over new targets and ensure they all have ids\n })\n\n transition.finished.finally(() => {\n css.remove() // Write\n })\n\n return new Promise((resolve) => {\n transition.ready.then(() => {\n const generatedViewAnimations = getViewAnimations()\n\n const animations: AnimationPlaybackControls[] = []\n\n /**\n * Create animations for each of our explicitly-defined subjects.\n */\n targets.forEach((definition, target) => {\n // TODO: If target is not \"root\", resolve elements\n // and iterate over each\n for (const key of definitionNames) {\n if (!definition[key]) continue\n const { keyframes, options } =\n definition[key as keyof ViewTransitionTarget]!\n\n for (let [valueName, valueKeyframes] of Object.entries(\n keyframes\n )) {\n if (!valueKeyframes) continue\n\n const valueOptions = {\n ...getValueTransition(\n defaultOptions as any,\n valueName\n ),\n ...getValueTransition(options as any, valueName),\n }\n\n const type = chooseLayerType(\n key as keyof ViewTransitionTarget\n )\n\n /**\n * If this is an opacity animation, and keyframes are not an array,\n * we need to convert them into an array and set an initial value.\n */\n if (\n valueName === \"opacity\" &&\n !Array.isArray(valueKeyframes)\n ) {\n const initialValue = type === \"new\" ? 0 : 1\n valueKeyframes = [initialValue, valueKeyframes]\n }\n\n /**\n * Resolve stagger function if provided.\n */\n if (typeof valueOptions.delay === \"function\") {\n valueOptions.delay = valueOptions.delay(0, 1)\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(\n valueOptions.delay\n )\n\n const animation = new NativeAnimation({\n ...valueOptions,\n element: document.documentElement,\n name: valueName,\n pseudoElement: `::view-transition-${type}(${target})`,\n keyframes: valueKeyframes,\n })\n\n animations.push(animation)\n }\n }\n })\n\n /**\n * Handle browser generated animations\n */\n for (const animation of generatedViewAnimations) {\n if (animation.playState === \"finished\") continue\n\n const { effect } = animation\n if (!effect || !(effect instanceof KeyframeEffect)) continue\n\n const { pseudoElement } = effect\n if (!pseudoElement) continue\n\n const name = getViewAnimationLayerInfo(pseudoElement)\n if (!name) continue\n\n const targetDefinition = targets.get(name.layer)\n\n if (!targetDefinition) {\n /**\n * If transition name is group then update the timing of the animation\n * whereas if it's old or new then we could possibly replace it using\n * the above method.\n */\n const transitionName = name.type === \"group\" ? \"layout\" : \"\"\n let animationTransition = {\n ...getValueTransition(defaultOptions, transitionName),\n }\n\n animationTransition.duration &&= secondsToMilliseconds(\n animationTransition.duration\n )\n\n animationTransition =\n applyGeneratorOptions(animationTransition)\n\n const easing = mapEasingToNativeEasing(\n animationTransition.ease,\n animationTransition.duration!\n ) as string\n\n effect.updateTiming({\n delay: secondsToMilliseconds(\n animationTransition.delay ?? 0\n ),\n duration: animationTransition.duration,\n easing,\n })\n\n animations.push(new NativeAnimationWrapper(animation))\n } else if (\n hasOpacity(targetDefinition, \"enter\") &&\n hasOpacity(targetDefinition, \"exit\") &&\n effect\n .getKeyframes()\n .some((keyframe) => keyframe.mixBlendMode)\n ) {\n animations.push(new NativeAnimationWrapper(animation))\n } else {\n animation.cancel()\n }\n }\n\n resolve(new GroupAnimation(animations))\n })\n })\n}\n\nfunction hasOpacity(\n target: ViewTransitionTarget | undefined,\n key: \"enter\" | \"exit\" | \"layout\"\n) {\n return target?.[key]?.keyframes.opacity\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgBA,MAAM,eAAe,GA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mBAAmB,CAAC,QAAQ,KAA5B,mBAAmB,CAAC,QAAQ,GAAK,qBAAqB,CAClD,mBAAmB,CAAC,QAAQ,CAC/B,CAAA,CAAA;oBAED,mBAAmB;wBACf,qBAAqB,CAAC,mBAAmB,CAAC,CAAA;AAE9C,oBAAA,MAAM,MAAM,GAAG,uBAAuB,CAClC,mBAAmB,CAAC,IAAI,EACxB,mBAAmB,CAAC,QAAS,CACtB,CAAA;oBAEX,MAAM,CAAC,YAAY,CAAC;wBAChB,KAAK,EAAE,qBAAqB,CACxB,mBAAmB,CAAC,KAAK,IAAI,CAAC,CACjC;wBACD,QAAQ,EAAE,mBAAmB,CAAC,QAAQ;wBACtC,MAAM;AACT,qBAAA,CAAC,CAAA;oBAEF,UAAU,CAAC,IAAI,CAAC,IAAI,sBAAsB,CAAC,SAAS,CAAC,CAAC,CAAA;iBACzD;AAAM,qBAAA,IACH,UAAU,CAAC,gBAAgB,EAAE,OAAO,CAAC;AACrC,oBAAA,UAAU,CAAC,gBAAgB,EAAE,MAAM,CAAC;oBACpC,MAAM;AACD,yBAAA,YAAY,EAAE;yBACd,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,YAAY,CAAC,EAChD;oBACE,UAAU,CAAC,IAAI,CAAC,IAAI,sBAAsB,CAAC,SAAS,CAAC,CAAC,CAAA;iBACzD;qBAAM;oBACH,SAAS,CAAC,MAAM,EAAE,CAAA;iBACrB;aACJ;AAED,YAAA,OAAO,CAAC,IAAI,cAAc,CAAC,UAAU,CAAC,CAAC,CAAA;AAC3C,SAAC,CAAC,CAAA;AACN,KAAC,CAAC,CAAA;AACN,CAAC;AAED,SAAS,UAAU,CACf,MAAwC,EACxC,GAAgC,EAAA;IAEhC,OAAO,MAAM,GAAG,GAAG,CAAC,EAAE,SAAS,CAAC,OAAO,CAAA;AAC3C;;;;"}
1
+ {"version":3,"file":"start.mjs","sources":["../../../src/view/start.ts"],"sourcesContent":["import { secondsToMilliseconds } from \"motion-utils\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport { NativeAnimationWrapper } from \"../animation/NativeAnimationWrapper\"\nimport { AnimationPlaybackControls } from \"../animation/types\"\nimport { getValueTransition } from \"../animation/utils/get-value-transition\"\nimport { mapEasingToNativeEasing } from \"../animation/waapi/easing/map-easing\"\nimport { applyGeneratorOptions } from \"../animation/waapi/utils/apply-generator\"\nimport type { ViewTransitionBuilder } from \"./index\"\nimport { ViewTransitionTarget } from \"./types\"\nimport { chooseLayerType } from \"./utils/choose-layer-type\"\nimport { css } from \"./utils/css\"\nimport { getViewAnimationLayerInfo } from \"./utils/get-layer-info\"\nimport { getViewAnimations } from \"./utils/get-view-animations\"\nimport { hasTarget } from \"./utils/has-target\"\n\nconst definitionNames = [\"layout\", \"enter\", \"exit\", \"new\", \"old\"] as const\n\nexport function startViewAnimation(\n builder: ViewTransitionBuilder\n): Promise<GroupAnimation> {\n const { update, targets, options: defaultOptions } = builder\n\n if (!document.startViewTransition) {\n return new Promise(async (resolve) => {\n await update()\n resolve(new GroupAnimation([]))\n })\n }\n\n // TODO: Go over existing targets and ensure they all have ids\n\n /**\n * If we don't have any animations defined for the root target,\n * remove it from being captured.\n */\n if (!hasTarget(\"root\", targets)) {\n css.set(\":root\", {\n \"view-transition-name\": \"none\",\n })\n }\n\n /**\n * Set the timing curve to linear for all view transition layers.\n * This gets baked into the keyframes, which can't be changed\n * without breaking the generated animation.\n *\n * This allows us to set easing via updateTiming - which can be changed.\n */\n css.set(\n \"::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)\",\n { \"animation-timing-function\": \"linear !important\" }\n )\n\n css.commit() // Write\n\n const transition = document.startViewTransition(async () => {\n await update()\n\n // TODO: Go over new targets and ensure they all have ids\n })\n\n transition.finished.finally(() => {\n css.remove() // Write\n })\n\n return new Promise((resolve) => {\n transition.ready.then(() => {\n const generatedViewAnimations = getViewAnimations()\n\n const animations: AnimationPlaybackControls[] = []\n\n /**\n * Create animations for each of our explicitly-defined subjects.\n */\n targets.forEach((definition, target) => {\n // TODO: If target is not \"root\", resolve elements\n // and iterate over each\n for (const key of definitionNames) {\n if (!definition[key]) continue\n const { keyframes, options } =\n definition[key as keyof ViewTransitionTarget]!\n\n for (let [valueName, valueKeyframes] of Object.entries(\n keyframes\n )) {\n if (!valueKeyframes) continue\n\n const valueOptions = {\n ...getValueTransition(\n defaultOptions as any,\n valueName\n ),\n ...getValueTransition(options as any, valueName),\n }\n\n const type = chooseLayerType(\n key as keyof ViewTransitionTarget\n )\n\n /**\n * If this is an opacity animation, and keyframes are not an array,\n * we need to convert them into an array and set an initial value.\n */\n if (\n valueName === \"opacity\" &&\n !Array.isArray(valueKeyframes)\n ) {\n const initialValue = type === \"new\" ? 0 : 1\n valueKeyframes = [initialValue, valueKeyframes]\n }\n\n /**\n * Resolve stagger function if provided.\n */\n if (typeof valueOptions.delay === \"function\") {\n valueOptions.delay = valueOptions.delay(0, 1)\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(\n valueOptions.delay\n )\n\n const animation = new NativeAnimation({\n ...valueOptions,\n element: document.documentElement,\n name: valueName,\n pseudoElement: `::view-transition-${type}(${target})`,\n keyframes: valueKeyframes,\n })\n\n animations.push(animation)\n }\n }\n })\n\n /**\n * Handle browser generated animations\n */\n for (const animation of generatedViewAnimations) {\n if (animation.playState === \"finished\") continue\n\n const { effect } = animation\n if (!effect || !(effect instanceof KeyframeEffect)) continue\n\n const { pseudoElement } = effect\n if (!pseudoElement) continue\n\n const name = getViewAnimationLayerInfo(pseudoElement)\n if (!name) continue\n\n const targetDefinition = targets.get(name.layer)\n\n if (!targetDefinition) {\n /**\n * If transition name is group then update the timing of the animation\n * whereas if it's old or new then we could possibly replace it using\n * the above method.\n */\n const transitionName = name.type === \"group\" ? \"layout\" : \"\"\n let animationTransition = {\n ...getValueTransition(defaultOptions, transitionName),\n }\n\n animationTransition.duration &&= secondsToMilliseconds(\n animationTransition.duration\n )\n\n animationTransition =\n applyGeneratorOptions(animationTransition)\n\n const easing = mapEasingToNativeEasing(\n animationTransition.ease,\n animationTransition.duration!\n ) as string\n\n effect.updateTiming({\n delay: secondsToMilliseconds(\n animationTransition.delay ?? 0\n ),\n duration: animationTransition.duration,\n easing,\n })\n\n animations.push(new NativeAnimationWrapper(animation))\n } else if (\n hasOpacity(targetDefinition, \"enter\") &&\n hasOpacity(targetDefinition, \"exit\") &&\n effect\n .getKeyframes()\n .some((keyframe) => keyframe.mixBlendMode)\n ) {\n animations.push(new NativeAnimationWrapper(animation))\n } else {\n animation.cancel()\n }\n }\n\n resolve(new GroupAnimation(animations))\n })\n })\n}\n\nfunction hasOpacity(\n target: ViewTransitionTarget | undefined,\n key: \"enter\" | \"exit\" | \"layout\"\n) {\n return target?.[key]?.keyframes.opacity\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgBA,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAU;AAEpE,SAAU,kBAAkB,CAC9B,OAA8B,EAAA;IAE9B,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,OAAO;AAE5D,IAAA,IAAI,CAAC,QAAQ,CAAC,mBAAmB,EAAE;AAC/B,QAAA,OAAO,IAAI,OAAO,CAAC,OAAO,OAAO,KAAI;YACjC,MAAM,MAAM,EAAE;AACd,YAAA,OAAO,CAAC,IAAI,cAAc,CAAC,EAAE,CAAC,CAAC;AACnC,QAAA,CAAC,CAAC;IACN;;AAIA;;;AAGG;IACH,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;AAC7B,QAAA,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE;AACb,YAAA,sBAAsB,EAAE,MAAM;AACjC,SAAA,CAAC;IACN;AAEA;;;;;;AAMG;IACH,GAAG,CAAC,GAA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AAE;gBACtB;YACJ;AAEA,YAAA,OAAO,CAAC,IAAI,cAAc,CAAC,UAAU,CAAC,CAAC;AAC3C,QAAA,CAAC,CAAC;AACN,IAAA,CAAC,CAAC;AACN;AAEA,SAAS,UAAU,CACf,MAAwC,EACxC,GAAgC,EAAA;IAEhC,OAAO,MAAM,GAAG,GAAG,CAAC,EAAE,SAAS,CAAC,OAAO;AAC3C;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"choose-layer-type.mjs","sources":["../../../../src/view/utils/choose-layer-type.ts"],"sourcesContent":["export function chooseLayerType(\n valueName: \"layout\" | \"enter\" | \"exit\" | \"new\" | \"old\"\n): \"group\" | \"old\" | \"new\" {\n if (valueName === \"layout\") return \"group\"\n if (valueName === \"enter\" || valueName === \"new\") return \"new\"\n if (valueName === \"exit\" || valueName === \"old\") return \"old\"\n\n return \"group\"\n}\n"],"names":[],"mappings":"AAAM,SAAU,eAAe,CAC3B,SAAsD,EAAA;IAEtD,IAAI,SAAS,KAAK,QAAQ;AAAE,QAAA,OAAO,OAAO,CAAA;AAC1C,IAAA,IAAI,SAAS,KAAK,OAAO,IAAI,SAAS,KAAK,KAAK;AAAE,QAAA,OAAO,KAAK,CAAA;AAC9D,IAAA,IAAI,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,KAAK;AAAE,QAAA,OAAO,KAAK,CAAA;AAE7D,IAAA,OAAO,OAAO,CAAA;AAClB;;;;"}
1
+ {"version":3,"file":"choose-layer-type.mjs","sources":["../../../../src/view/utils/choose-layer-type.ts"],"sourcesContent":["export function chooseLayerType(\n valueName: \"layout\" | \"enter\" | \"exit\" | \"new\" | \"old\"\n): \"group\" | \"old\" | \"new\" {\n if (valueName === \"layout\") return \"group\"\n if (valueName === \"enter\" || valueName === \"new\") return \"new\"\n if (valueName === \"exit\" || valueName === \"old\") return \"old\"\n\n return \"group\"\n}\n"],"names":[],"mappings":"AAAM,SAAU,eAAe,CAC3B,SAAsD,EAAA;IAEtD,IAAI,SAAS,KAAK,QAAQ;AAAE,QAAA,OAAO,OAAO;AAC1C,IAAA,IAAI,SAAS,KAAK,OAAO,IAAI,SAAS,KAAK,KAAK;AAAE,QAAA,OAAO,KAAK;AAC9D,IAAA,IAAI,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,KAAK;AAAE,QAAA,OAAO,KAAK;AAE7D,IAAA,OAAO,OAAO;AAClB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"css.mjs","sources":["../../../../src/view/utils/css.ts"],"sourcesContent":["let pendingRules: Record<string, Record<string, string>> = {}\n\nlet style: HTMLStyleElement | null = null\n\nexport const css = {\n set: (selector: string, values: Record<string, string>) => {\n pendingRules[selector] = values\n },\n\n commit: () => {\n if (!style) {\n style = document.createElement(\"style\")\n style.id = \"motion-view\"\n }\n\n let cssText = \"\"\n\n for (const selector in pendingRules) {\n const rule = pendingRules[selector]\n cssText += `${selector} {\\n`\n for (const [property, value] of Object.entries(rule)) {\n cssText += ` ${property}: ${value};\\n`\n }\n cssText += \"}\\n\"\n }\n\n style.textContent = cssText\n document.head.appendChild(style)\n\n pendingRules = {}\n },\n\n remove: () => {\n if (style && style.parentElement) {\n style.parentElement.removeChild(style)\n }\n },\n}\n"],"names":[],"mappings":"AAAA,IAAI,YAAY,GAA2C,EAAE,CAAA;AAE7D,IAAI,KAAK,GAA4B,IAAI,CAAA;AAE5B,MAAA,GAAG,GAAG;AACf,IAAA,GAAG,EAAE,CAAC,QAAgB,EAAE,MAA8B,KAAI;AACtD,QAAA,YAAY,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAA;KAClC;IAED,MAAM,EAAE,MAAK;QACT,IAAI,CAAC,KAAK,EAAE;AACR,YAAA,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;AACvC,YAAA,KAAK,CAAC,EAAE,GAAG,aAAa,CAAA;SAC3B;QAED,IAAI,OAAO,GAAG,EAAE,CAAA;AAEhB,QAAA,KAAK,MAAM,QAAQ,IAAI,YAAY,EAAE;AACjC,YAAA,MAAM,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAA;AACnC,YAAA,OAAO,IAAI,CAAA,EAAG,QAAQ,CAAA,IAAA,CAAM,CAAA;AAC5B,YAAA,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;AAClD,gBAAA,OAAO,IAAI,CAAK,EAAA,EAAA,QAAQ,CAAK,EAAA,EAAA,KAAK,KAAK,CAAA;aAC1C;YACD,OAAO,IAAI,KAAK,CAAA;SACnB;AAED,QAAA,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA;AAC3B,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;QAEhC,YAAY,GAAG,EAAE,CAAA;KACpB;IAED,MAAM,EAAE,MAAK;AACT,QAAA,IAAI,KAAK,IAAI,KAAK,CAAC,aAAa,EAAE;AAC9B,YAAA,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;SACzC;KACJ;;;;;"}
1
+ {"version":3,"file":"css.mjs","sources":["../../../../src/view/utils/css.ts"],"sourcesContent":["let pendingRules: Record<string, Record<string, string>> = {}\n\nlet style: HTMLStyleElement | null = null\n\nexport const css = {\n set: (selector: string, values: Record<string, string>) => {\n pendingRules[selector] = values\n },\n\n commit: () => {\n if (!style) {\n style = document.createElement(\"style\")\n style.id = \"motion-view\"\n }\n\n let cssText = \"\"\n\n for (const selector in pendingRules) {\n const rule = pendingRules[selector]\n cssText += `${selector} {\\n`\n for (const [property, value] of Object.entries(rule)) {\n cssText += ` ${property}: ${value};\\n`\n }\n cssText += \"}\\n\"\n }\n\n style.textContent = cssText\n document.head.appendChild(style)\n\n pendingRules = {}\n },\n\n remove: () => {\n if (style && style.parentElement) {\n style.parentElement.removeChild(style)\n }\n },\n}\n"],"names":[],"mappings":"AAAA,IAAI,YAAY,GAA2C,EAAE;AAE7D,IAAI,KAAK,GAA4B,IAAI;AAElC,MAAM,GAAG,GAAG;AACf,IAAA,GAAG,EAAE,CAAC,QAAgB,EAAE,MAA8B,KAAI;AACtD,QAAA,YAAY,CAAC,QAAQ,CAAC,GAAG,MAAM;IACnC,CAAC;IAED,MAAM,EAAE,MAAK;QACT,IAAI,CAAC,KAAK,EAAE;AACR,YAAA,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AACvC,YAAA,KAAK,CAAC,EAAE,GAAG,aAAa;QAC5B;QAEA,IAAI,OAAO,GAAG,EAAE;AAEhB,QAAA,KAAK,MAAM,QAAQ,IAAI,YAAY,EAAE;AACjC,YAAA,MAAM,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC;AACnC,YAAA,OAAO,IAAI,CAAA,EAAG,QAAQ,CAAA,IAAA,CAAM;AAC5B,YAAA,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;AAClD,gBAAA,OAAO,IAAI,CAAA,EAAA,EAAK,QAAQ,CAAA,EAAA,EAAK,KAAK,KAAK;YAC3C;YACA,OAAO,IAAI,KAAK;QACpB;AAEA,QAAA,KAAK,CAAC,WAAW,GAAG,OAAO;AAC3B,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;QAEhC,YAAY,GAAG,EAAE;IACrB,CAAC;IAED,MAAM,EAAE,MAAK;AACT,QAAA,IAAI,KAAK,IAAI,KAAK,CAAC,aAAa,EAAE;AAC9B,YAAA,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,CAAC;QAC1C;IACJ,CAAC;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-layer-info.mjs","sources":["../../../../src/view/utils/get-layer-info.ts"],"sourcesContent":["export function getViewAnimationLayerInfo(pseudoElement: string) {\n const match = pseudoElement.match(\n /::view-transition-(old|new|group|image-pair)\\((.*?)\\)/\n )\n if (!match) return null\n\n return { layer: match[2], type: match[1] }\n}\n"],"names":[],"mappings":"AAAM,SAAU,yBAAyB,CAAC,aAAqB,EAAA;IAC3D,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAC7B,uDAAuD,CAC1D,CAAA;AACD,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,IAAI,CAAA;AAEvB,IAAA,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;AAC9C;;;;"}
1
+ {"version":3,"file":"get-layer-info.mjs","sources":["../../../../src/view/utils/get-layer-info.ts"],"sourcesContent":["export function getViewAnimationLayerInfo(pseudoElement: string) {\n const match = pseudoElement.match(\n /::view-transition-(old|new|group|image-pair)\\((.*?)\\)/\n )\n if (!match) return null\n\n return { layer: match[2], type: match[1] }\n}\n"],"names":[],"mappings":"AAAM,SAAU,yBAAyB,CAAC,aAAqB,EAAA;IAC3D,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAC7B,uDAAuD,CAC1D;AACD,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,IAAI;AAEvB,IAAA,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE;AAC9C;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-view-animations.mjs","sources":["../../../../src/view/utils/get-view-animations.ts"],"sourcesContent":["function filterViewAnimations(animation: Animation) {\n const { effect } = animation\n if (!effect) return false\n\n return (\n effect.target === document.documentElement &&\n effect.pseudoElement?.startsWith(\"::view-transition\")\n )\n}\n\nexport function getViewAnimations() {\n return document.getAnimations().filter(filterViewAnimations)\n}\n"],"names":[],"mappings":"AAAA,SAAS,oBAAoB,CAAC,SAAoB,EAAA;AAC9C,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;AAC5B,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,KAAK,CAAA;AAEzB,IAAA,QACI,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,eAAe;QAC1C,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,mBAAmB,CAAC,EACxD;AACL,CAAC;SAEe,iBAAiB,GAAA;IAC7B,OAAO,QAAQ,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAA;AAChE;;;;"}
1
+ {"version":3,"file":"get-view-animations.mjs","sources":["../../../../src/view/utils/get-view-animations.ts"],"sourcesContent":["function filterViewAnimations(animation: Animation) {\n const { effect } = animation\n if (!effect) return false\n\n return (\n effect.target === document.documentElement &&\n effect.pseudoElement?.startsWith(\"::view-transition\")\n )\n}\n\nexport function getViewAnimations() {\n return document.getAnimations().filter(filterViewAnimations)\n}\n"],"names":[],"mappings":"AAAA,SAAS,oBAAoB,CAAC,SAAoB,EAAA;AAC9C,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS;AAC5B,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,KAAK;AAEzB,IAAA,QACI,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,eAAe;QAC1C,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,mBAAmB,CAAC;AAE7D;SAEgB,iBAAiB,GAAA;IAC7B,OAAO,QAAQ,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC;AAChE;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"has-target.mjs","sources":["../../../../src/view/utils/has-target.ts"],"sourcesContent":["import { ViewTransitionTarget, ViewTransitionTargetDefinition } from \"../types\"\n\nexport function hasTarget(\n target: ViewTransitionTargetDefinition,\n targets: Map<ViewTransitionTargetDefinition, ViewTransitionTarget>\n) {\n return targets.has(target) && Object.keys(targets.get(target)!).length > 0\n}\n"],"names":[],"mappings":"AAEgB,SAAA,SAAS,CACrB,MAAsC,EACtC,OAAkE,EAAA;IAElE,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;AAC9E;;;;"}
1
+ {"version":3,"file":"has-target.mjs","sources":["../../../../src/view/utils/has-target.ts"],"sourcesContent":["import { ViewTransitionTarget, ViewTransitionTargetDefinition } from \"../types\"\n\nexport function hasTarget(\n target: ViewTransitionTargetDefinition,\n targets: Map<ViewTransitionTargetDefinition, ViewTransitionTarget>\n) {\n return targets.has(target) && Object.keys(targets.get(target)!).length > 0\n}\n"],"names":[],"mappings":"AAEM,SAAU,SAAS,CACrB,MAAsC,EACtC,OAAkE,EAAA;IAElE,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC,CAAC,MAAM,GAAG,CAAC;AAC9E;;;;"}
package/dist/index.d.ts CHANGED
@@ -1487,6 +1487,8 @@ interface ValueAnimationOptionsWithRenderContext<V extends AnyResolvedKeyframe =
1487
1487
  }
1488
1488
  interface TimelineWithFallback {
1489
1489
  timeline?: ProgressTimeline;
1490
+ rangeStart?: string;
1491
+ rangeEnd?: string;
1490
1492
  observe: (animation: AnimationPlaybackControls) => VoidFunction;
1491
1493
  }
1492
1494
  /**
@@ -2448,7 +2450,7 @@ declare class NativeAnimation<T extends AnyResolvedKeyframe> extends WithPromise
2448
2450
  /**
2449
2451
  * Attaches a timeline to the animation, for instance the `ScrollTimeline`.
2450
2452
  */
2451
- attachTimeline({ timeline, observe }: TimelineWithFallback): VoidFunction;
2453
+ attachTimeline({ timeline, rangeStart, rangeEnd, observe, }: TimelineWithFallback): VoidFunction;
2452
2454
  }
2453
2455
 
2454
2456
  type NativeAnimationOptionsExtended<T extends AnyResolvedKeyframe> = NativeAnimationOptions & ValueAnimationOptions<T> & NativeAnimationOptions;
@@ -3395,6 +3397,7 @@ declare const supportsLinearEasing: () => boolean;
3395
3397
  declare global {
3396
3398
  interface Window {
3397
3399
  ScrollTimeline: ScrollTimeline;
3400
+ ViewTimeline: ViewTimeline;
3398
3401
  }
3399
3402
  }
3400
3403
  declare class ScrollTimeline implements ProgressTimeline {
@@ -3404,7 +3407,18 @@ declare class ScrollTimeline implements ProgressTimeline {
3404
3407
  };
3405
3408
  cancel?: VoidFunction;
3406
3409
  }
3410
+ declare class ViewTimeline implements ProgressTimeline {
3411
+ constructor(options: {
3412
+ subject: Element;
3413
+ axis?: string;
3414
+ });
3415
+ currentTime: null | {
3416
+ value: number;
3417
+ };
3418
+ cancel?: VoidFunction;
3419
+ }
3407
3420
  declare const supportsScrollTimeline: () => boolean;
3421
+ declare const supportsViewTimeline: () => boolean;
3408
3422
 
3409
3423
  /**
3410
3424
  * @public
@@ -4358,10 +4372,6 @@ declare class NodeStack {
4358
4372
  promote(node: IProjectionNode, preserveFollowOpacity?: boolean): void;
4359
4373
  exitAnimationComplete(): void;
4360
4374
  scheduleRender(): void;
4361
- /**
4362
- * Clear any leads that have been removed this render to prevent them from being
4363
- * used in future animations and to prevent memory leaks
4364
- */
4365
4375
  removeLeadSnapshot(): void;
4366
4376
  }
4367
4377
 
@@ -5062,4 +5072,4 @@ declare const sync: Batcher;
5062
5072
  */
5063
5073
  declare const cancelSync: Record<string, (process: Process) => void>;
5064
5074
 
5065
- export { type AccelerateConfig, type AcceptedAnimations, type ActiveStatsBuffer, type AnimationDefinition, type AnimationGeneratorName, type AnimationGeneratorType, type AnimationList, type AnimationOptions, type AnimationOrchestrationOptions, type AnimationPlaybackControls, type AnimationPlaybackControlsWithThen, type AnimationPlaybackLifecycles, type AnimationPlaybackOptions, type AnimationScope, type AnimationState, type AnimationType, type AnimationTypeState, type AnyResolvedKeyframe, AsyncMotionValueAnimation, type Batcher, type CSSStyleDeclarationWithTransform, type CSSVariableName, type CSSVariableToken, type CancelProcess, type Color, type ComplexValueInfo, type ComplexValues, type DOMKeyframesDefinition, DOMKeyframesResolver, type DOMValueAnimationOptions, DOMVisualElement, type DOMVisualElementOptions, type DecayOptions, type DelayedFunction, DocumentProjectionNode, type DragElastic, type DragHandler, type DraggableProps, type DurationSpringOptions, type DynamicOption, type ElementOrSelector, type EventInfo, type EventOptions, Feature, type FeatureClass, FlatTree, type FollowValueOptions, type FrameData, type FrameStats, type GeneratorFactory, type GeneratorFactoryFunction, GroupAnimation, GroupAnimationWithThen, type GroupedAnimations, type HSLA, HTMLProjectionNode, type HTMLRenderState, HTMLVisualElement, type HandoffFunction, type IProjectionNode, type InactiveStatsBuffer, type InertiaOptions, type InitialPromotionConfig, type InterpolateOptions, JSAnimation, type KeyframeGenerator, type KeyframeOptions, KeyframeResolver, LayoutAnimationBuilder, type LayoutEvents, type LayoutLifecycles, type LayoutUpdateData, type LayoutUpdateHandler, type LegacyAnimationControls, type MapInputRange, type Measurements, type Mixer, type MixerFactory, type MotionConfigContextProps, type MotionNodeAdvancedOptions, type MotionNodeAnimationOptions, type MotionNodeDragHandlers, type MotionNodeDraggableOptions, type MotionNodeEventOptions, type MotionNodeFocusHandlers, type MotionNodeHoverHandlers, type MotionNodeLayoutOptions, type MotionNodeOptions, type MotionNodePanHandlers, type MotionNodeTapHandlers, type MotionNodeViewportOptions, type MotionStyle, MotionValue, type MotionValueEventCallbacks, type MotionValueOptions, type MultiTransformer, NativeAnimation, NativeAnimationExtended, type NativeAnimationOptions, type NativeAnimationOptionsExtended, NativeAnimationWrapper, type NodeGroup, NodeStack, type NumberMap, ObjectVisualElement, type OnHoverEndEvent, type OnHoverStartEvent, type OnKeyframesResolved, type OnPressEndEvent, type OnPressStartEvent, type Owner, type PanHandler, type PanInfo, type PassiveEffect, type Phase, type PointerEventOptions, type PresenceContextProps, type PressGestureInfo, type Process, type ProgressTimeline, type ProjectionEventName, type ProjectionNodeConfig, type ProjectionNodeOptions, type PropagateOptions, type RGBA, type ReducedMotionConfig, type RepeatType, type ResolvedConstraints, type ResolvedElastic, type ResolvedKeyframes, type ResolvedValueKeyframe, type ResolvedValues$1 as ResolvedValues, type SVGAttributes, type SVGForcedAttrKeyframesDefinition, type SVGForcedAttrProperties, type SVGForcedAttrTransitions, type SVGKeyframesDefinition, type SVGPathKeyframesDefinition, type SVGPathProperties, type SVGPathTransitions, type SVGRenderState, type SVGTransitions, SVGVisualElement, type ScaleCorrectionNode, type ScaleCorrector, type ScaleCorrectorDefinition, type ScaleCorrectorMap, type Schedule, type ScrapeMotionValuesFromProps, type ScrollMeasurements, type SelectorCache, type SingleTransformer, type Spring, type SpringOptions, type StaggerOptions, type StaggerOrigin, type StartAnimation, type Stats, type StatsBuffer, type StatsRecording, type StatsSummary, type Step, type StepId, type Steps, type StyleKeyframesDefinition, type StyleTransitions, type Subscriber, type Summary, type TapHandlers, type TapInfo, type Target, type TargetAndTransition, type TargetResolver, type TimelineWithFallback, type TransformInputRange, type TransformOptions, type TransformOrigin, type TransformProperties, type TransformTemplate, type Transformer, type Transition, type TransitionWithValueOverrides, type Tween, type UnresolvedKeyframes, type UnresolvedValueKeyframe, type UseRenderState, type ValueAnimationOptions, type ValueAnimationOptionsWithRenderContext, type ValueAnimationTransition, type ValueAnimationWithDynamicDelay, type ValueIndexes, type ValueKeyframe, type ValueKeyframesDefinition, type ValueTransformer, type ValueTransition, type ValueType, type ValueTypeMap, type VariableKeyframesDefinition, type VariableTransitions, type Variant, type VariantLabels, type Variants, type VelocityOptions, type ViewTransitionAnimationDefinition, ViewTransitionBuilder, type ViewTransitionOptions, type ViewTransitionTarget, type ViewTransitionTargetDefinition, type ViewportEventHandler, type ViewportOptions, VisualElement, type VisualElementAnimationOptions, type VisualElementEventCallbacks, type VisualElementOptions, type VisualState, type WillChange, type WithAppearProps, type WithDepth, type WithQuerySelectorAll, acceleratedValues, activeAnimations, addAttrValue, addDomEvent, addScaleCorrector, addStyleValue, addValueToWillChange, alpha, analyseComplexValue, animateMotionValue, animateSingleValue, animateTarget, animateValue, animateVariant, animateView, animateVisualElement, animationMapKey, applyAxisDelta, applyBoxDelta, applyGeneratorOptions, applyPointDelta, applyPxDefaults, applyTreeDeltas, aspectRatio, attachFollow, attachSpring, attrEffect, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, buildHTMLStyles, buildProjectionTransform, buildSVGAttrs, buildSVGPath, buildTransform, calcAxisDelta, calcBoxDelta, calcChildStagger, calcGeneratorDuration, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, camelCaseAttributes, camelToDash, cancelFrame, cancelMicrotask, cancelSync, checkVariantsDidChange, cleanDirtyNodes, collectMotionValues, color, compareByDepth, complex, containsCSSVariable, convertBoundingBoxToBox, convertBoxToBoundingBox, convertOffsetToTimes, copyAxisDeltaInto, copyAxisInto, copyBoxInto, correctBorderRadius, correctBoxShadow, createAnimationState, createAxis, createAxisDelta, createBox, createDelta, createGeneratorEasing, createProjectionNode, createRenderBatcher, cubicBezierAsString, defaultEasing, defaultOffset, defaultTransformValue, defaultValueTypes, degrees, delay, delayInSeconds, dimensionValueTypes, eachAxis, fillOffset, fillWildcards, findDimensionValueType, findValueType, flushKeyframeResolvers, followValue, frame, frameData, frameSteps, generateLinearEasing, getAnimatableNone, getAnimationMap, getComputedStyle, getDefaultTransition, getDefaultValueType, getFeatureDefinitions, getFinalKeyframe, getMixer, getOptimisedAppearId, getOriginIndex, getValueAsType, getValueTransition, getVariableValue, getVariantContext, getViewAnimationLayerInfo, getViewAnimations, globalProjectionState, has2DTranslate, hasReducedMotionListener, hasScale, hasTransform, hex, hover, hsla, hslaToRgba, inertia, initPrefersReducedMotion, interpolate, invisibleValues, isAnimationControls, isCSSVariableName, isCSSVariableToken, isControllingVariants, isDeltaZero, isDragActive, isDragging, isElementKeyboardAccessible, isElementTextInput, isForcedMotionValue, isGenerator, isHTMLElement, isKeyframesTarget, isMotionValue, isNear, isNodeOrChild, isPrimaryPointer, isSVGElement, isSVGSVGElement, isSVGTag, isTransitionDefined, isVariantLabel, isVariantNode, isWaapiSupportedEasing, isWillChangeMotionValue, keyframes, makeAnimationInstant, mapEasingToNativeEasing, mapValue, maxGeneratorDuration, measurePageBox, measureViewportBox, microtask, mix, mixArray, mixColor, mixComplex, mixImmediate, mixLinearColor, mixNumber, mixObject, mixValues, mixVisibility, motionValue, nodeGroup, number, numberValueTypes, observeTimeline, optimizedAppearDataAttribute, optimizedAppearDataId, parseAnimateLayoutArgs, parseCSSVariable, parseValueFromTransform, percent, pixelsToPercent, positionalKeys, prefersReducedMotion, press, progressPercentage, propEffect, propagateDirtyNodes, px, readTransformValue, recordStats, removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta, renderHTML, renderSVG, resize, resolveElements, resolveMotionValue, resolveTransition, resolveVariant, resolveVariantFromProps, rgbUnit, rgba, rootProjectionNode, scale, scaleCorrectors, scalePoint, scrapeMotionValuesFromProps$1 as scrapeHTMLMotionValuesFromProps, scrapeMotionValuesFromProps as scrapeSVGMotionValuesFromProps, setDragLock, setFeatureDefinitions, setStyle, setTarget, spring, springValue, stagger, startWaapiAnimation, statsBuffer, styleEffect, supportedWaapiEasing, supportsBrowserAnimation, supportsFlags, supportsLinearEasing, supportsPartialKeyframes, supportsScrollTimeline, svgEffect, sync, testValueType, time, transform, transformAxis, transformBox, transformBoxPoints, transformPropOrder, transformProps, transformValue, transformValueTypes, translateAxis, updateMotionValuesFromProps, variantPriorityOrder, variantProps, vh, visualElementStore, vw };
5075
+ export { type AccelerateConfig, type AcceptedAnimations, type ActiveStatsBuffer, type AnimationDefinition, type AnimationGeneratorName, type AnimationGeneratorType, type AnimationList, type AnimationOptions, type AnimationOrchestrationOptions, type AnimationPlaybackControls, type AnimationPlaybackControlsWithThen, type AnimationPlaybackLifecycles, type AnimationPlaybackOptions, type AnimationScope, type AnimationState, type AnimationType, type AnimationTypeState, type AnyResolvedKeyframe, AsyncMotionValueAnimation, type Batcher, type CSSStyleDeclarationWithTransform, type CSSVariableName, type CSSVariableToken, type CancelProcess, type Color, type ComplexValueInfo, type ComplexValues, type DOMKeyframesDefinition, DOMKeyframesResolver, type DOMValueAnimationOptions, DOMVisualElement, type DOMVisualElementOptions, type DecayOptions, type DelayedFunction, DocumentProjectionNode, type DragElastic, type DragHandler, type DraggableProps, type DurationSpringOptions, type DynamicOption, type ElementOrSelector, type EventInfo, type EventOptions, Feature, type FeatureClass, FlatTree, type FollowValueOptions, type FrameData, type FrameStats, type GeneratorFactory, type GeneratorFactoryFunction, GroupAnimation, GroupAnimationWithThen, type GroupedAnimations, type HSLA, HTMLProjectionNode, type HTMLRenderState, HTMLVisualElement, type HandoffFunction, type IProjectionNode, type InactiveStatsBuffer, type InertiaOptions, type InitialPromotionConfig, type InterpolateOptions, JSAnimation, type KeyframeGenerator, type KeyframeOptions, KeyframeResolver, LayoutAnimationBuilder, type LayoutEvents, type LayoutLifecycles, type LayoutUpdateData, type LayoutUpdateHandler, type LegacyAnimationControls, type MapInputRange, type Measurements, type Mixer, type MixerFactory, type MotionConfigContextProps, type MotionNodeAdvancedOptions, type MotionNodeAnimationOptions, type MotionNodeDragHandlers, type MotionNodeDraggableOptions, type MotionNodeEventOptions, type MotionNodeFocusHandlers, type MotionNodeHoverHandlers, type MotionNodeLayoutOptions, type MotionNodeOptions, type MotionNodePanHandlers, type MotionNodeTapHandlers, type MotionNodeViewportOptions, type MotionStyle, MotionValue, type MotionValueEventCallbacks, type MotionValueOptions, type MultiTransformer, NativeAnimation, NativeAnimationExtended, type NativeAnimationOptions, type NativeAnimationOptionsExtended, NativeAnimationWrapper, type NodeGroup, NodeStack, type NumberMap, ObjectVisualElement, type OnHoverEndEvent, type OnHoverStartEvent, type OnKeyframesResolved, type OnPressEndEvent, type OnPressStartEvent, type Owner, type PanHandler, type PanInfo, type PassiveEffect, type Phase, type PointerEventOptions, type PresenceContextProps, type PressGestureInfo, type Process, type ProgressTimeline, type ProjectionEventName, type ProjectionNodeConfig, type ProjectionNodeOptions, type PropagateOptions, type RGBA, type ReducedMotionConfig, type RepeatType, type ResolvedConstraints, type ResolvedElastic, type ResolvedKeyframes, type ResolvedValueKeyframe, type ResolvedValues$1 as ResolvedValues, type SVGAttributes, type SVGForcedAttrKeyframesDefinition, type SVGForcedAttrProperties, type SVGForcedAttrTransitions, type SVGKeyframesDefinition, type SVGPathKeyframesDefinition, type SVGPathProperties, type SVGPathTransitions, type SVGRenderState, type SVGTransitions, SVGVisualElement, type ScaleCorrectionNode, type ScaleCorrector, type ScaleCorrectorDefinition, type ScaleCorrectorMap, type Schedule, type ScrapeMotionValuesFromProps, type ScrollMeasurements, type SelectorCache, type SingleTransformer, type Spring, type SpringOptions, type StaggerOptions, type StaggerOrigin, type StartAnimation, type Stats, type StatsBuffer, type StatsRecording, type StatsSummary, type Step, type StepId, type Steps, type StyleKeyframesDefinition, type StyleTransitions, type Subscriber, type Summary, type TapHandlers, type TapInfo, type Target, type TargetAndTransition, type TargetResolver, type TimelineWithFallback, type TransformInputRange, type TransformOptions, type TransformOrigin, type TransformProperties, type TransformTemplate, type Transformer, type Transition, type TransitionWithValueOverrides, type Tween, type UnresolvedKeyframes, type UnresolvedValueKeyframe, type UseRenderState, type ValueAnimationOptions, type ValueAnimationOptionsWithRenderContext, type ValueAnimationTransition, type ValueAnimationWithDynamicDelay, type ValueIndexes, type ValueKeyframe, type ValueKeyframesDefinition, type ValueTransformer, type ValueTransition, type ValueType, type ValueTypeMap, type VariableKeyframesDefinition, type VariableTransitions, type Variant, type VariantLabels, type Variants, type VelocityOptions, type ViewTransitionAnimationDefinition, ViewTransitionBuilder, type ViewTransitionOptions, type ViewTransitionTarget, type ViewTransitionTargetDefinition, type ViewportEventHandler, type ViewportOptions, VisualElement, type VisualElementAnimationOptions, type VisualElementEventCallbacks, type VisualElementOptions, type VisualState, type WillChange, type WithAppearProps, type WithDepth, type WithQuerySelectorAll, acceleratedValues, activeAnimations, addAttrValue, addDomEvent, addScaleCorrector, addStyleValue, addValueToWillChange, alpha, analyseComplexValue, animateMotionValue, animateSingleValue, animateTarget, animateValue, animateVariant, animateView, animateVisualElement, animationMapKey, applyAxisDelta, applyBoxDelta, applyGeneratorOptions, applyPointDelta, applyPxDefaults, applyTreeDeltas, aspectRatio, attachFollow, attachSpring, attrEffect, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, buildHTMLStyles, buildProjectionTransform, buildSVGAttrs, buildSVGPath, buildTransform, calcAxisDelta, calcBoxDelta, calcChildStagger, calcGeneratorDuration, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, camelCaseAttributes, camelToDash, cancelFrame, cancelMicrotask, cancelSync, checkVariantsDidChange, cleanDirtyNodes, collectMotionValues, color, compareByDepth, complex, containsCSSVariable, convertBoundingBoxToBox, convertBoxToBoundingBox, convertOffsetToTimes, copyAxisDeltaInto, copyAxisInto, copyBoxInto, correctBorderRadius, correctBoxShadow, createAnimationState, createAxis, createAxisDelta, createBox, createDelta, createGeneratorEasing, createProjectionNode, createRenderBatcher, cubicBezierAsString, defaultEasing, defaultOffset, defaultTransformValue, defaultValueTypes, degrees, delay, delayInSeconds, dimensionValueTypes, eachAxis, fillOffset, fillWildcards, findDimensionValueType, findValueType, flushKeyframeResolvers, followValue, frame, frameData, frameSteps, generateLinearEasing, getAnimatableNone, getAnimationMap, getComputedStyle, getDefaultTransition, getDefaultValueType, getFeatureDefinitions, getFinalKeyframe, getMixer, getOptimisedAppearId, getOriginIndex, getValueAsType, getValueTransition, getVariableValue, getVariantContext, getViewAnimationLayerInfo, getViewAnimations, globalProjectionState, has2DTranslate, hasReducedMotionListener, hasScale, hasTransform, hex, hover, hsla, hslaToRgba, inertia, initPrefersReducedMotion, interpolate, invisibleValues, isAnimationControls, isCSSVariableName, isCSSVariableToken, isControllingVariants, isDeltaZero, isDragActive, isDragging, isElementKeyboardAccessible, isElementTextInput, isForcedMotionValue, isGenerator, isHTMLElement, isKeyframesTarget, isMotionValue, isNear, isNodeOrChild, isPrimaryPointer, isSVGElement, isSVGSVGElement, isSVGTag, isTransitionDefined, isVariantLabel, isVariantNode, isWaapiSupportedEasing, isWillChangeMotionValue, keyframes, makeAnimationInstant, mapEasingToNativeEasing, mapValue, maxGeneratorDuration, measurePageBox, measureViewportBox, microtask, mix, mixArray, mixColor, mixComplex, mixImmediate, mixLinearColor, mixNumber, mixObject, mixValues, mixVisibility, motionValue, nodeGroup, number, numberValueTypes, observeTimeline, optimizedAppearDataAttribute, optimizedAppearDataId, parseAnimateLayoutArgs, parseCSSVariable, parseValueFromTransform, percent, pixelsToPercent, positionalKeys, prefersReducedMotion, press, progressPercentage, propEffect, propagateDirtyNodes, px, readTransformValue, recordStats, removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta, renderHTML, renderSVG, resize, resolveElements, resolveMotionValue, resolveTransition, resolveVariant, resolveVariantFromProps, rgbUnit, rgba, rootProjectionNode, scale, scaleCorrectors, scalePoint, scrapeMotionValuesFromProps$1 as scrapeHTMLMotionValuesFromProps, scrapeMotionValuesFromProps as scrapeSVGMotionValuesFromProps, setDragLock, setFeatureDefinitions, setStyle, setTarget, spring, springValue, stagger, startWaapiAnimation, statsBuffer, styleEffect, supportedWaapiEasing, supportsBrowserAnimation, supportsFlags, supportsLinearEasing, supportsPartialKeyframes, supportsScrollTimeline, supportsViewTimeline, svgEffect, sync, testValueType, time, transform, transformAxis, transformBox, transformBoxPoints, transformPropOrder, transformProps, transformValue, transformValueTypes, translateAxis, updateMotionValuesFromProps, variantPriorityOrder, variantProps, vh, visualElementStore, vw };
@@ -1944,6 +1944,7 @@
1944
1944
  }
1945
1945
 
1946
1946
  const supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, "scrollTimeline");
1947
+ const supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, "viewTimeline");
1947
1948
 
1948
1949
  const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {
1949
1950
  try {
@@ -2074,13 +2075,14 @@
2074
2075
  if (this.updateMotionValue) {
2075
2076
  this.updateMotionValue(keyframe);
2076
2077
  }
2077
- else {
2078
- /**
2079
- * If we can, we want to commit the final style as set by the user,
2080
- * rather than the computed keyframe value supplied by the animation.
2081
- */
2082
- setStyle(element, name, keyframe);
2083
- }
2078
+ /**
2079
+ * If we can, we want to commit the final style as set by the user,
2080
+ * rather than the computed keyframe value supplied by the animation.
2081
+ * We always do this, even when a motion value is present, to prevent
2082
+ * a visual flash in Firefox where the WAAPI animation's fill is removed
2083
+ * during cancel() before the scheduled render can apply the correct value.
2084
+ */
2085
+ setStyle(element, name, keyframe);
2084
2086
  this.animation.cancel();
2085
2087
  }
2086
2088
  onComplete?.();
@@ -2186,13 +2188,17 @@
2186
2188
  /**
2187
2189
  * Attaches a timeline to the animation, for instance the `ScrollTimeline`.
2188
2190
  */
2189
- attachTimeline({ timeline, observe }) {
2191
+ attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) {
2190
2192
  if (this.allowFlatten) {
2191
2193
  this.animation.effect?.updateTiming({ easing: "linear" });
2192
2194
  }
2193
2195
  this.animation.onfinish = null;
2194
2196
  if (timeline && supportsScrollTimeline()) {
2195
2197
  this.animation.timeline = timeline;
2198
+ if (rangeStart)
2199
+ this.animation.rangeStart = rangeStart;
2200
+ if (rangeEnd)
2201
+ this.animation.rangeEnd = rangeEnd;
2196
2202
  return motionUtils.noop;
2197
2203
  }
2198
2204
  else {
@@ -6182,12 +6188,18 @@
6182
6188
  // Apply the axis delta to the final axis
6183
6189
  applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale);
6184
6190
  }
6191
+ function resolveAxisTranslate(value, axis) {
6192
+ if (typeof value === "string") {
6193
+ return (parseFloat(value) / 100) * (axis.max - axis.min);
6194
+ }
6195
+ return value;
6196
+ }
6185
6197
  /**
6186
6198
  * Apply a transform to a box from the latest resolved motion values.
6187
6199
  */
6188
6200
  function transformBox(box, transform) {
6189
- transformAxis(box.x, transform.x, transform.scaleX, transform.scale, transform.originX);
6190
- transformAxis(box.y, transform.y, transform.scaleY, transform.scale, transform.originY);
6201
+ transformAxis(box.x, resolveAxisTranslate(transform.x, box.x), transform.scaleX, transform.scale, transform.originX);
6202
+ transformAxis(box.y, resolveAxisTranslate(transform.y, box.y), transform.scaleY, transform.scale, transform.originY);
6191
6203
  }
6192
6204
 
6193
6205
  function measureViewportBox(instance, transformPoint) {
@@ -6759,6 +6771,14 @@
6759
6771
  let animate = createAnimateFunction(visualElement);
6760
6772
  let state = createState();
6761
6773
  let isInitialRender = true;
6774
+ /**
6775
+ * Track whether the animation state has been reset (e.g. via StrictMode
6776
+ * double-invocation or Suspense unmount/remount). On the first
6777
+ * animateChanges() call after a reset we need to behave like the initial
6778
+ * render for variant-inheritance checks, even though isInitialRender is
6779
+ * already false.
6780
+ */
6781
+ let wasReset = false;
6762
6782
  /**
6763
6783
  * This function will be used to reduce the animation definitions for
6764
6784
  * each active animation type into an object of resolved values for it.
@@ -6844,7 +6864,7 @@
6844
6864
  prop !== props[type] &&
6845
6865
  propIsVariant;
6846
6866
  if (isInherited &&
6847
- isInitialRender &&
6867
+ (isInitialRender || wasReset) &&
6848
6868
  visualElement.manuallyAnimateOnMount) {
6849
6869
  isInherited = false;
6850
6870
  }
@@ -6982,7 +7002,8 @@
6982
7002
  if (typeState.isActive) {
6983
7003
  encounteredKeys = { ...encounteredKeys, ...resolvedValues };
6984
7004
  }
6985
- if (isInitialRender && visualElement.blockInitialAnimation) {
7005
+ if ((isInitialRender || wasReset) &&
7006
+ visualElement.blockInitialAnimation) {
6986
7007
  shouldAnimateType = false;
6987
7008
  }
6988
7009
  /**
@@ -7000,7 +7021,7 @@
7000
7021
  * we want to use the parent's transition to calculate the stagger.
7001
7022
  */
7002
7023
  if (typeof animation === "string" &&
7003
- isInitialRender &&
7024
+ (isInitialRender || wasReset) &&
7004
7025
  !willAnimateViaParent &&
7005
7026
  visualElement.manuallyAnimateOnMount &&
7006
7027
  visualElement.parent) {
@@ -7054,6 +7075,7 @@
7054
7075
  shouldAnimate = false;
7055
7076
  }
7056
7077
  isInitialRender = false;
7078
+ wasReset = false;
7057
7079
  return shouldAnimate ? animate(animations) : Promise.resolve();
7058
7080
  }
7059
7081
  /**
@@ -7079,12 +7101,7 @@
7079
7101
  getState: () => state,
7080
7102
  reset: () => {
7081
7103
  state = createState();
7082
- /**
7083
- * Temporarily disabling resetting this flag as it prevents components
7084
- * with initial={false} from animating after being remounted, for instance
7085
- * as the child of an Activity component.
7086
- */
7087
- // isInitialRender = true
7104
+ wasReset = true;
7088
7105
  },
7089
7106
  };
7090
7107
  }
@@ -7452,51 +7469,36 @@
7452
7469
  add(node) {
7453
7470
  motionUtils.addUniqueItem(this.members, node);
7454
7471
  for (let i = this.members.length - 1; i >= 0; i--) {
7455
- const m = this.members[i];
7456
- if (m === node || m === this.lead || m === this.prevLead)
7472
+ const member = this.members[i];
7473
+ if (member === node || member === this.lead || member === this.prevLead)
7457
7474
  continue;
7458
- const inst = m.instance;
7459
- if (inst && inst.isConnected === false && m.isPresent !== false && !m.snapshot) {
7460
- motionUtils.removeItem(this.members, m);
7475
+ const inst = member.instance;
7476
+ if ((!inst || inst.isConnected === false) && !member.snapshot) {
7477
+ motionUtils.removeItem(this.members, member);
7478
+ member.unmount();
7461
7479
  }
7462
7480
  }
7463
7481
  node.scheduleRender();
7464
7482
  }
7465
7483
  remove(node) {
7466
7484
  motionUtils.removeItem(this.members, node);
7467
- if (node === this.prevLead) {
7485
+ if (node === this.prevLead)
7468
7486
  this.prevLead = undefined;
7469
- }
7470
7487
  if (node === this.lead) {
7471
7488
  const prevLead = this.members[this.members.length - 1];
7472
- if (prevLead) {
7489
+ if (prevLead)
7473
7490
  this.promote(prevLead);
7474
- }
7475
7491
  }
7476
7492
  }
7477
7493
  relegate(node) {
7478
- const indexOfNode = this.members.findIndex((member) => node === member);
7479
- if (indexOfNode === 0)
7480
- return false;
7481
- /**
7482
- * Find the next projection node that is present
7483
- */
7484
- let prevLead;
7485
- for (let i = indexOfNode; i >= 0; i--) {
7494
+ for (let i = this.members.indexOf(node) - 1; i >= 0; i--) {
7486
7495
  const member = this.members[i];
7487
- const inst = member.instance;
7488
- if (member.isPresent !== false && (!inst || inst.isConnected !== false)) {
7489
- prevLead = member;
7490
- break;
7496
+ if (member.isPresent !== false && member.instance?.isConnected !== false) {
7497
+ this.promote(member);
7498
+ return true;
7491
7499
  }
7492
7500
  }
7493
- if (prevLead) {
7494
- this.promote(prevLead);
7495
- return true;
7496
- }
7497
- else {
7498
- return false;
7499
- }
7501
+ return false;
7500
7502
  }
7501
7503
  promote(node, preserveFollowOpacity) {
7502
7504
  const prevLead = this.lead;
@@ -7506,66 +7508,38 @@
7506
7508
  this.lead = node;
7507
7509
  node.show();
7508
7510
  if (prevLead) {
7509
- prevLead.instance && prevLead.scheduleRender();
7511
+ prevLead.updateSnapshot();
7510
7512
  node.scheduleRender();
7511
- /**
7512
- * If both the new and previous lead have the same defined layoutDependency,
7513
- * skip the shared layout animation. This allows components with layoutId
7514
- * to opt-out of animations when their layoutDependency hasn't changed,
7515
- * even when the component unmounts and remounts in a different location.
7516
- */
7517
- const prevDep = prevLead.options.layoutDependency;
7518
- const nextDep = node.options.layoutDependency;
7519
- const dependencyMatches = prevDep !== undefined &&
7520
- nextDep !== undefined &&
7521
- prevDep === nextDep;
7522
- if (!dependencyMatches) {
7523
- const prevInstance = prevLead.instance;
7524
- const isStale = prevInstance && prevInstance.isConnected === false && !prevLead.snapshot;
7525
- if (!isStale) {
7526
- node.resumeFrom = prevLead;
7527
- if (preserveFollowOpacity) {
7528
- node.resumeFrom.preserveOpacity = true;
7529
- }
7530
- if (prevLead.snapshot) {
7531
- node.snapshot = prevLead.snapshot;
7532
- node.snapshot.latestValues =
7533
- prevLead.animationValues || prevLead.latestValues;
7534
- }
7535
- if (node.root && node.root.isUpdating) {
7536
- node.isLayoutDirty = true;
7537
- }
7513
+ const { layoutDependency: prevDep } = prevLead.options;
7514
+ const { layoutDependency: nextDep } = node.options;
7515
+ if (prevDep === undefined || prevDep !== nextDep) {
7516
+ node.resumeFrom = prevLead;
7517
+ if (preserveFollowOpacity)
7518
+ prevLead.preserveOpacity = true;
7519
+ if (prevLead.snapshot) {
7520
+ node.snapshot = prevLead.snapshot;
7521
+ node.snapshot.latestValues =
7522
+ prevLead.animationValues || prevLead.latestValues;
7538
7523
  }
7524
+ if (node.root?.isUpdating)
7525
+ node.isLayoutDirty = true;
7539
7526
  }
7540
- const { crossfade } = node.options;
7541
- if (crossfade === false) {
7527
+ if (node.options.crossfade === false)
7542
7528
  prevLead.hide();
7543
- }
7544
7529
  }
7545
7530
  }
7546
7531
  exitAnimationComplete() {
7547
- this.members.forEach((node) => {
7548
- const { options, resumingFrom } = node;
7549
- options.onExitComplete && options.onExitComplete();
7550
- if (resumingFrom) {
7551
- resumingFrom.options.onExitComplete &&
7552
- resumingFrom.options.onExitComplete();
7553
- }
7532
+ this.members.forEach((member) => {
7533
+ member.options.onExitComplete?.();
7534
+ member.resumingFrom?.options.onExitComplete?.();
7554
7535
  });
7555
7536
  }
7556
7537
  scheduleRender() {
7557
- this.members.forEach((node) => {
7558
- node.instance && node.scheduleRender(false);
7559
- });
7538
+ this.members.forEach((member) => member.instance && member.scheduleRender(false));
7560
7539
  }
7561
- /**
7562
- * Clear any leads that have been removed this render to prevent them from being
7563
- * used in future animations and to prevent memory leaks
7564
- */
7565
7540
  removeLeadSnapshot() {
7566
- if (this.lead && this.lead.snapshot) {
7541
+ if (this.lead?.snapshot)
7567
7542
  this.lead.snapshot = undefined;
7568
- }
7569
7543
  }
7570
7544
  }
7571
7545
 
@@ -9759,6 +9733,7 @@
9759
9733
  exports.supportsLinearEasing = supportsLinearEasing;
9760
9734
  exports.supportsPartialKeyframes = supportsPartialKeyframes;
9761
9735
  exports.supportsScrollTimeline = supportsScrollTimeline;
9736
+ exports.supportsViewTimeline = supportsViewTimeline;
9762
9737
  exports.svgEffect = svgEffect;
9763
9738
  exports.sync = sync;
9764
9739
  exports.testValueType = testValueType;