framer-motion 6.3.10 → 6.3.13

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 (234) hide show
  1. package/dist/cjs/index.js +18 -25
  2. package/dist/es/animation/use-animated-state.mjs +0 -1
  3. package/dist/es/animation/utils/transitions.mjs +0 -2
  4. package/dist/es/context/DeprecatedLayoutGroupContext.mjs +0 -1
  5. package/dist/es/context/LayoutGroupContext.mjs +0 -3
  6. package/dist/es/gestures/use-pan-gesture.mjs +1 -1
  7. package/dist/es/motion/index.mjs +0 -2
  8. package/dist/es/motion/utils/valid-prop.mjs +1 -1
  9. package/dist/es/projection/styles/transform.mjs +13 -2
  10. package/dist/es/render/utils/animation.mjs +0 -3
  11. package/dist/es/render/utils/motion-values.mjs +1 -1
  12. package/dist/es/value/index.mjs +2 -5
  13. package/dist/es/value/use-inverted-scale.mjs +0 -1
  14. package/dist/es/value/utils/resolve-motion-value.mjs +0 -2
  15. package/dist/framer-motion.dev.js +18 -25
  16. package/dist/framer-motion.js +1 -1
  17. package/dist/index.d.ts +4188 -0
  18. package/dist/projection.dev.js +16 -12
  19. package/dist/size-rollup-dom-animation.js +1 -1
  20. package/dist/size-rollup-dom-max.js +1 -1
  21. package/dist/size-webpack-dom-max.js +1 -1
  22. package/dist/three-entry.d.ts +2502 -0
  23. package/package.json +5 -5
  24. package/types/animation/animate.d.ts +0 -54
  25. package/types/animation/animation-controls.d.ts +0 -5
  26. package/types/animation/types.d.ts +0 -79
  27. package/types/animation/use-animated-state.d.ts +0 -6
  28. package/types/animation/use-animation.d.ts +0 -31
  29. package/types/animation/utils/default-transitions.d.ts +0 -19
  30. package/types/animation/utils/easing.d.ts +0 -3
  31. package/types/animation/utils/is-animatable.d.ts +0 -11
  32. package/types/animation/utils/is-animation-controls.d.ts +0 -2
  33. package/types/animation/utils/is-keyframes-target.d.ts +0 -2
  34. package/types/animation/utils/transitions.d.ts +0 -29
  35. package/types/animation/utils/variant-resolvers.d.ts +0 -12
  36. package/types/components/AnimatePresence/PresenceChild.d.ts +0 -12
  37. package/types/components/AnimatePresence/index.d.ts +0 -36
  38. package/types/components/AnimatePresence/types.d.ts +0 -61
  39. package/types/components/AnimatePresence/use-presence.d.ts +0 -52
  40. package/types/components/AnimateSharedLayout.d.ts +0 -2
  41. package/types/components/LayoutGroup/index.d.ts +0 -12
  42. package/types/components/LazyMotion/index.d.ts +0 -38
  43. package/types/components/LazyMotion/types.d.ts +0 -54
  44. package/types/components/MotionConfig/index.d.ts +0 -25
  45. package/types/components/Reorder/Group.d.ts +0 -297
  46. package/types/components/Reorder/Item.d.ts +0 -278
  47. package/types/components/Reorder/index.d.ts +0 -509
  48. package/types/components/Reorder/types.d.ts +0 -10
  49. package/types/components/Reorder/utils/check-reorder.d.ts +0 -2
  50. package/types/context/DeprecatedLayoutGroupContext.d.ts +0 -6
  51. package/types/context/LayoutGroupContext.d.ts +0 -11
  52. package/types/context/LazyContext.d.ts +0 -7
  53. package/types/context/MotionConfigContext.d.ts +0 -36
  54. package/types/context/MotionContext/create.d.ts +0 -3
  55. package/types/context/MotionContext/index.d.ts +0 -9
  56. package/types/context/MotionContext/utils.d.ts +0 -3
  57. package/types/context/PresenceContext.d.ts +0 -17
  58. package/types/context/ReorderContext.d.ts +0 -3
  59. package/types/context/SwitchLayoutGroupContext.d.ts +0 -23
  60. package/types/events/event-info.d.ts +0 -5
  61. package/types/events/types.d.ts +0 -10
  62. package/types/events/use-dom-event.d.ts +0 -24
  63. package/types/events/use-pointer-event.d.ts +0 -4
  64. package/types/events/utils.d.ts +0 -3
  65. package/types/gestures/PanSession.d.ts +0 -127
  66. package/types/gestures/drag/VisualElementDragControls.d.ts +0 -56
  67. package/types/gestures/drag/types.d.ts +0 -294
  68. package/types/gestures/drag/use-drag-controls.d.ts +0 -74
  69. package/types/gestures/drag/use-drag.d.ts +0 -7
  70. package/types/gestures/drag/utils/constraints.d.ts +0 -77
  71. package/types/gestures/drag/utils/lock.d.ts +0 -4
  72. package/types/gestures/types.d.ts +0 -225
  73. package/types/gestures/use-focus-gesture.d.ts +0 -8
  74. package/types/gestures/use-hover-gesture.d.ts +0 -2
  75. package/types/gestures/use-pan-gesture.d.ts +0 -14
  76. package/types/gestures/use-tap-gesture.d.ts +0 -6
  77. package/types/gestures/utils/event-type.d.ts +0 -2
  78. package/types/gestures/utils/is-node-or-child.d.ts +0 -8
  79. package/types/index.d.ts +0 -96
  80. package/types/motion/features/animations.d.ts +0 -2
  81. package/types/motion/features/definitions.d.ts +0 -3
  82. package/types/motion/features/drag.d.ts +0 -2
  83. package/types/motion/features/gestures.d.ts +0 -2
  84. package/types/motion/features/layout/MeasureLayout.d.ts +0 -3
  85. package/types/motion/features/layout/index.d.ts +0 -2
  86. package/types/motion/features/layout/types.d.ts +0 -75
  87. package/types/motion/features/types.d.ts +0 -52
  88. package/types/motion/features/use-features.d.ts +0 -8
  89. package/types/motion/features/use-projection.d.ts +0 -3
  90. package/types/motion/features/viewport/observers.d.ts +0 -3
  91. package/types/motion/features/viewport/types.d.ts +0 -21
  92. package/types/motion/features/viewport/use-viewport.d.ts +0 -2
  93. package/types/motion/index.d.ts +0 -25
  94. package/types/motion/types.d.ts +0 -279
  95. package/types/motion/utils/VisualElementHandler.d.ts +0 -18
  96. package/types/motion/utils/is-forced-motion-value.d.ts +0 -2
  97. package/types/motion/utils/make-renderless-component.d.ts +0 -2
  98. package/types/motion/utils/should-inherit-variant.d.ts +0 -2
  99. package/types/motion/utils/use-motion-ref.d.ts +0 -8
  100. package/types/motion/utils/use-visual-element.d.ts +0 -6
  101. package/types/motion/utils/use-visual-state.d.ts +0 -14
  102. package/types/motion/utils/valid-prop.d.ts +0 -9
  103. package/types/projection/animation/mix-values.d.ts +0 -2
  104. package/types/projection/geometry/conversion.d.ts +0 -14
  105. package/types/projection/geometry/copy.d.ts +0 -13
  106. package/types/projection/geometry/delta-apply.d.ts +0 -37
  107. package/types/projection/geometry/delta-calc.d.ts +0 -10
  108. package/types/projection/geometry/delta-remove.d.ts +0 -20
  109. package/types/projection/geometry/models.d.ts +0 -5
  110. package/types/projection/geometry/types.d.ts +0 -29
  111. package/types/projection/geometry/utils.d.ts +0 -3
  112. package/types/projection/index.d.ts +0 -14
  113. package/types/projection/node/DocumentProjectionNode.d.ts +0 -108
  114. package/types/projection/node/HTMLProjectionNode.d.ts +0 -112
  115. package/types/projection/node/create-projection-node.d.ts +0 -301
  116. package/types/projection/node/group.d.ts +0 -7
  117. package/types/projection/node/id.d.ts +0 -1
  118. package/types/projection/node/types.d.ts +0 -136
  119. package/types/projection/shared/stack.d.ts +0 -17
  120. package/types/projection/styles/scale-border-radius.d.ts +0 -11
  121. package/types/projection/styles/scale-box-shadow.d.ts +0 -2
  122. package/types/projection/styles/scale-correction.d.ts +0 -3
  123. package/types/projection/styles/transform-origin.d.ts +0 -0
  124. package/types/projection/styles/transform.d.ts +0 -4
  125. package/types/projection/styles/types.d.ts +0 -9
  126. package/types/projection/use-instant-layout-transition.d.ts +0 -1
  127. package/types/projection/use-reset-projection.d.ts +0 -1
  128. package/types/projection/utils/each-axis.d.ts +0 -3
  129. package/types/projection/utils/has-transform.d.ts +0 -3
  130. package/types/projection/utils/measure.d.ts +0 -4
  131. package/types/render/dom/create-visual-element.d.ts +0 -2
  132. package/types/render/dom/features-animation.d.ts +0 -5
  133. package/types/render/dom/features-max.d.ts +0 -5
  134. package/types/render/dom/motion-minimal.d.ts +0 -5
  135. package/types/render/dom/motion-proxy.d.ts +0 -30
  136. package/types/render/dom/motion.d.ts +0 -25
  137. package/types/render/dom/types.d.ts +0 -28
  138. package/types/render/dom/use-render.d.ts +0 -4
  139. package/types/render/dom/utils/camel-to-dash.d.ts +0 -4
  140. package/types/render/dom/utils/create-config.d.ts +0 -8
  141. package/types/render/dom/utils/css-variables-conversion.d.ts +0 -22
  142. package/types/render/dom/utils/filter-props.d.ts +0 -4
  143. package/types/render/dom/utils/is-css-variable.d.ts +0 -4
  144. package/types/render/dom/utils/is-svg-component.d.ts +0 -2
  145. package/types/render/dom/utils/parse-dom-variant.d.ts +0 -6
  146. package/types/render/dom/utils/unit-conversion.d.ts +0 -27
  147. package/types/render/dom/value-types/animatable-none.d.ts +0 -1
  148. package/types/render/dom/value-types/defaults.d.ts +0 -9
  149. package/types/render/dom/value-types/dimensions.d.ts +0 -8
  150. package/types/render/dom/value-types/find.d.ts +0 -9
  151. package/types/render/dom/value-types/get-as-type.d.ts +0 -5
  152. package/types/render/dom/value-types/number.d.ts +0 -2
  153. package/types/render/dom/value-types/test.d.ts +0 -5
  154. package/types/render/dom/value-types/type-auto.d.ts +0 -5
  155. package/types/render/dom/value-types/type-int.d.ts +0 -8
  156. package/types/render/dom/value-types/types.d.ts +0 -4
  157. package/types/render/html/config-motion.d.ts +0 -3
  158. package/types/render/html/supported-elements.d.ts +0 -7
  159. package/types/render/html/types.d.ts +0 -61
  160. package/types/render/html/use-props.d.ts +0 -8
  161. package/types/render/html/utils/build-styles.d.ts +0 -5
  162. package/types/render/html/utils/build-transform.d.ts +0 -15
  163. package/types/render/html/utils/create-render-state.d.ts +0 -7
  164. package/types/render/html/utils/render.d.ts +0 -4
  165. package/types/render/html/utils/scrape-motion-values.d.ts +0 -2
  166. package/types/render/html/utils/transform.d.ts +0 -15
  167. package/types/render/html/visual-element.d.ts +0 -6
  168. package/types/render/index.d.ts +0 -2
  169. package/types/render/svg/config-motion.d.ts +0 -3
  170. package/types/render/svg/lowercase-elements.d.ts +0 -5
  171. package/types/render/svg/supported-elements.d.ts +0 -7
  172. package/types/render/svg/types.d.ts +0 -44
  173. package/types/render/svg/use-props.d.ts +0 -7
  174. package/types/render/svg/utils/build-attrs.d.ts +0 -8
  175. package/types/render/svg/utils/camel-case-attrs.d.ts +0 -4
  176. package/types/render/svg/utils/create-render-state.d.ts +0 -2
  177. package/types/render/svg/utils/path.d.ts +0 -9
  178. package/types/render/svg/utils/render.d.ts +0 -4
  179. package/types/render/svg/utils/scrape-motion-values.d.ts +0 -2
  180. package/types/render/svg/utils/transform-origin.d.ts +0 -6
  181. package/types/render/svg/visual-element.d.ts +0 -2
  182. package/types/render/types.d.ts +0 -113
  183. package/types/render/utils/animation-state.d.ts +0 -31
  184. package/types/render/utils/animation.d.ts +0 -21
  185. package/types/render/utils/compare-by-depth.d.ts +0 -5
  186. package/types/render/utils/flat-tree.d.ts +0 -8
  187. package/types/render/utils/is-draggable.d.ts +0 -2
  188. package/types/render/utils/lifecycles.d.ts +0 -114
  189. package/types/render/utils/motion-values.d.ts +0 -3
  190. package/types/render/utils/setters.d.ts +0 -792
  191. package/types/render/utils/types.d.ts +0 -9
  192. package/types/render/utils/variants.d.ts +0 -20
  193. package/types/three-entry.d.ts +0 -19
  194. package/types/types.d.ts +0 -981
  195. package/types/utils/array.d.ts +0 -3
  196. package/types/utils/each-axis.d.ts +0 -1
  197. package/types/utils/is-browser.d.ts +0 -1
  198. package/types/utils/is-numerical-string.d.ts +0 -4
  199. package/types/utils/is-ref-object.d.ts +0 -2
  200. package/types/utils/is-zero-value-string.d.ts +0 -4
  201. package/types/utils/noop.d.ts +0 -1
  202. package/types/utils/process.d.ts +0 -1
  203. package/types/utils/resolve-value.d.ts +0 -3
  204. package/types/utils/shallow-compare.d.ts +0 -1
  205. package/types/utils/subscription-manager.d.ts +0 -9
  206. package/types/utils/time-conversion.d.ts +0 -7
  207. package/types/utils/transform.d.ts +0 -91
  208. package/types/utils/use-animation-frame.d.ts +0 -2
  209. package/types/utils/use-constant.d.ts +0 -10
  210. package/types/utils/use-cycle.d.ts +0 -30
  211. package/types/utils/use-force-update.d.ts +0 -1
  212. package/types/utils/use-id.d.ts +0 -6
  213. package/types/utils/use-instant-transition-state.d.ts +0 -3
  214. package/types/utils/use-instant-transition.d.ts +0 -1
  215. package/types/utils/use-is-mounted.d.ts +0 -2
  216. package/types/utils/use-isomorphic-effect.d.ts +0 -2
  217. package/types/utils/use-reduced-motion.d.ts +0 -28
  218. package/types/utils/use-unmount-effect.d.ts +0 -1
  219. package/types/utils/warn-once.d.ts +0 -2
  220. package/types/value/index.d.ts +0 -260
  221. package/types/value/scroll/use-element-scroll.d.ts +0 -28
  222. package/types/value/scroll/use-viewport-scroll.d.ts +0 -22
  223. package/types/value/scroll/utils.d.ts +0 -19
  224. package/types/value/use-combine-values.d.ts +0 -2
  225. package/types/value/use-inverted-scale.d.ts +0 -28
  226. package/types/value/use-motion-template.d.ts +0 -24
  227. package/types/value/use-motion-value.d.ts +0 -19
  228. package/types/value/use-on-change.d.ts +0 -3
  229. package/types/value/use-spring.d.ts +0 -22
  230. package/types/value/use-time.d.ts +0 -1
  231. package/types/value/use-transform.d.ts +0 -93
  232. package/types/value/use-velocity.d.ts +0 -13
  233. package/types/value/utils/is-motion-value.d.ts +0 -2
  234. package/types/value/utils/resolve-motion-value.d.ts +0 -10
package/dist/cjs/index.js CHANGED
@@ -472,7 +472,7 @@ var MotionValue = /** @class */ (function () {
472
472
  * This will be replaced by the build step with the latest version number.
473
473
  * When MotionValues are provided to motion components, warn if versions are mixed.
474
474
  */
475
- this.version = "6.3.10";
475
+ this.version = "6.3.13";
476
476
  /**
477
477
  * Duration, in milliseconds, since last updating frame.
478
478
  *
@@ -599,7 +599,7 @@ var MotionValue = /** @class */ (function () {
599
599
  * }
600
600
  * ```
601
601
  *
602
- * @internalremarks
602
+ * @privateRemarks
603
603
  *
604
604
  * We could look into a `useOnChange` hook if the above lifecycle management proves confusing.
605
605
  *
@@ -751,9 +751,6 @@ var MotionValue = /** @class */ (function () {
751
751
  };
752
752
  return MotionValue;
753
753
  }());
754
- /**
755
- * @internal
756
- */
757
754
  function motionValue(init) {
758
755
  return new MotionValue(init);
759
756
  }
@@ -1159,8 +1156,6 @@ function getValueTransition(transition, key) {
1159
1156
  /**
1160
1157
  * Start animation on a MotionValue. This function is an interface between
1161
1158
  * Framer Motion and Popmotion
1162
- *
1163
- * @internal
1164
1159
  */
1165
1160
  function startAnimation(key, value, target, transition) {
1166
1161
  if (transition === void 0) { transition = {}; }
@@ -1696,7 +1691,7 @@ function addScaleCorrector(correctors) {
1696
1691
  Object.assign(scaleCorrectors, correctors);
1697
1692
  }
1698
1693
 
1699
- var identityProjection = "translate3d(0px, 0px, 0) scale(1, 1)";
1694
+ var identityProjection = "translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)";
1700
1695
  function buildProjectionTransform(delta, treeScale, latestTransform) {
1701
1696
  /**
1702
1697
  * The translations we use to calculate are always relative to the viewport coordinate space.
@@ -1707,6 +1702,11 @@ function buildProjectionTransform(delta, treeScale, latestTransform) {
1707
1702
  var xTranslate = delta.x.translate / treeScale.x;
1708
1703
  var yTranslate = delta.y.translate / treeScale.y;
1709
1704
  var transform = "translate3d(".concat(xTranslate, "px, ").concat(yTranslate, "px, 0) ");
1705
+ /**
1706
+ * Apply scale correction for the tree transform.
1707
+ * This will apply scale to the screen-orientated axes.
1708
+ */
1709
+ transform += "scale(".concat(1 / treeScale.x, ", ").concat(1 / treeScale.y, ") ");
1710
1710
  if (latestTransform) {
1711
1711
  var rotate = latestTransform.rotate, rotateX = latestTransform.rotateX, rotateY = latestTransform.rotateY;
1712
1712
  if (rotate)
@@ -1716,7 +1716,13 @@ function buildProjectionTransform(delta, treeScale, latestTransform) {
1716
1716
  if (rotateY)
1717
1717
  transform += "rotateY(".concat(rotateY, "deg) ");
1718
1718
  }
1719
- transform += "scale(".concat(delta.x.scale, ", ").concat(delta.y.scale, ")");
1719
+ /**
1720
+ * Apply scale to match the size of the element to the size we want it.
1721
+ * This will apply scale to the element-orientated axes.
1722
+ */
1723
+ var elementScaleX = delta.x.scale * treeScale.x;
1724
+ var elementScaleY = delta.y.scale * treeScale.y;
1725
+ transform += "scale(".concat(elementScaleX, ", ").concat(elementScaleY, ")");
1720
1726
  return transform === identityProjection ? "none" : transform;
1721
1727
  }
1722
1728
 
@@ -1793,8 +1799,6 @@ var FlatTree = /** @class */ (function () {
1793
1799
  * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself
1794
1800
  *
1795
1801
  * TODO: Remove and move to library
1796
- *
1797
- * @internal
1798
1802
  */
1799
1803
  function resolveMotionValue(value) {
1800
1804
  var unwrappedValue = isMotionValue(value) ? value.get() : value;
@@ -2995,9 +2999,6 @@ function useProjectionId() {
2995
2999
  });
2996
3000
  }
2997
3001
 
2998
- /**
2999
- * @internal
3000
- */
3001
3002
  var LayoutGroupContext = React.createContext({});
3002
3003
 
3003
3004
  /**
@@ -3066,8 +3067,6 @@ var VisualElementHandler = /** @class */ (function (_super) {
3066
3067
  *
3067
3068
  * Alongside this is a config option which provides a way of rendering the provided
3068
3069
  * component "offline", or outside the React render cycle.
3069
- *
3070
- * @internal
3071
3070
  */
3072
3071
  function createMotionComponent(_a) {
3073
3072
  var preloadedFeatures = _a.preloadedFeatures, createVisualElement = _a.createVisualElement, projectionNodeConstructor = _a.projectionNodeConstructor, useRender = _a.useRender, useVisualState = _a.useVisualState, Component = _a.Component;
@@ -3445,7 +3444,7 @@ function useHTMLProps(props, visualState, isStatic) {
3445
3444
  /**
3446
3445
  * A list of all valid MotionProps.
3447
3446
  *
3448
- * @internalremarks
3447
+ * @privateRemarks
3449
3448
  * This doesn't throw if a `MotionProp` name is missing - it should.
3450
3449
  */
3451
3450
  var validMotionProps = new Set([
@@ -4603,9 +4602,6 @@ function getOrigin(target, transition, visualElement) {
4603
4602
  return origin;
4604
4603
  }
4605
4604
 
4606
- /**
4607
- * @internal
4608
- */
4609
4605
  function animateVisualElement(visualElement, definition, options) {
4610
4606
  if (options === void 0) { options = {}; }
4611
4607
  visualElement.notifyAnimationStart(definition);
@@ -5868,7 +5864,7 @@ function useDrag(props) {
5868
5864
  * @param handlers -
5869
5865
  * @param ref -
5870
5866
  *
5871
- * @internalremarks
5867
+ * @privateRemarks
5872
5868
  * Currently this sets new pan gesture functions every render. The memo route has been explored
5873
5869
  * in the past but ultimately we're still creating new functions every render. An optimisation
5874
5870
  * to explore is creating the pan gestures and loading them into a `ref`.
@@ -5970,7 +5966,7 @@ function updateMotionValuesFromProps(element, next, prev) {
5970
5966
  * and warn against mismatches.
5971
5967
  */
5972
5968
  if (process.env.NODE_ENV === "development") {
5973
- warnOnce(nextValue.version === "6.3.10", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 6.3.10 may not work as expected."));
5969
+ warnOnce(nextValue.version === "6.3.13", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 6.3.13 may not work as expected."));
5974
5970
  }
5975
5971
  }
5976
5972
  else if (isMotionValue(prevValue)) {
@@ -7368,7 +7364,6 @@ var AnimatePresence = function (_a) {
7368
7364
  };
7369
7365
 
7370
7366
  /**
7371
- * @internal
7372
7367
  * @deprecated
7373
7368
  */
7374
7369
  var DeprecatedLayoutGroupContext = React.createContext(null);
@@ -8323,7 +8318,6 @@ var useVisualState = makeUseVisualState({
8323
8318
  /**
8324
8319
  * This is not an officially supported API and may be removed
8325
8320
  * on any version.
8326
- * @internal
8327
8321
  */
8328
8322
  function useAnimatedState(initialState) {
8329
8323
  var _a = tslib.__read(React.useState(initialState), 2), animationState = _a[0], setAnimationState = _a[1];
@@ -8374,7 +8368,6 @@ var hasWarned = false;
8374
8368
  * ```
8375
8369
  *
8376
8370
  * @deprecated
8377
- * @internal
8378
8371
  */
8379
8372
  function useInvertedScale(scale) {
8380
8373
  var parentScaleX = useMotionValue(1);
@@ -33,7 +33,6 @@ var useVisualState = makeUseVisualState({
33
33
  /**
34
34
  * This is not an officially supported API and may be removed
35
35
  * on any version.
36
- * @internal
37
36
  */
38
37
  function useAnimatedState(initialState) {
39
38
  var _a = __read(useState(initialState), 2), animationState = _a[0], setAnimationState = _a[1];
@@ -180,8 +180,6 @@ function getValueTransition(transition, key) {
180
180
  /**
181
181
  * Start animation on a MotionValue. This function is an interface between
182
182
  * Framer Motion and Popmotion
183
- *
184
- * @internal
185
183
  */
186
184
  function startAnimation(key, value, target, transition) {
187
185
  if (transition === void 0) { transition = {}; }
@@ -1,7 +1,6 @@
1
1
  import { createContext } from 'react';
2
2
 
3
3
  /**
4
- * @internal
5
4
  * @deprecated
6
5
  */
7
6
  var DeprecatedLayoutGroupContext = createContext(null);
@@ -1,8 +1,5 @@
1
1
  import { createContext } from 'react';
2
2
 
3
- /**
4
- * @internal
5
- */
6
3
  var LayoutGroupContext = createContext({});
7
4
 
8
5
  export { LayoutGroupContext };
@@ -9,7 +9,7 @@ import { PanSession } from './PanSession.mjs';
9
9
  * @param handlers -
10
10
  * @param ref -
11
11
  *
12
- * @internalremarks
12
+ * @privateRemarks
13
13
  * Currently this sets new pan gesture functions every render. The memo route has been explored
14
14
  * in the past but ultimately we're still creating new functions every render. An optimisation
15
15
  * to explore is creating the pan gestures and loading them into a `ref`.
@@ -22,8 +22,6 @@ import { VisualElementHandler } from './utils/VisualElementHandler.mjs';
22
22
  *
23
23
  * Alongside this is a config option which provides a way of rendering the provided
24
24
  * component "offline", or outside the React render cycle.
25
- *
26
- * @internal
27
25
  */
28
26
  function createMotionComponent(_a) {
29
27
  var preloadedFeatures = _a.preloadedFeatures, createVisualElement = _a.createVisualElement, projectionNodeConstructor = _a.projectionNodeConstructor, useRender = _a.useRender, useVisualState = _a.useVisualState, Component = _a.Component;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * A list of all valid MotionProps.
3
3
  *
4
- * @internalremarks
4
+ * @privateRemarks
5
5
  * This doesn't throw if a `MotionProp` name is missing - it should.
6
6
  */
7
7
  var validMotionProps = new Set([
@@ -1,4 +1,4 @@
1
- var identityProjection = "translate3d(0px, 0px, 0) scale(1, 1)";
1
+ var identityProjection = "translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)";
2
2
  function buildProjectionTransform(delta, treeScale, latestTransform) {
3
3
  /**
4
4
  * The translations we use to calculate are always relative to the viewport coordinate space.
@@ -9,6 +9,11 @@ function buildProjectionTransform(delta, treeScale, latestTransform) {
9
9
  var xTranslate = delta.x.translate / treeScale.x;
10
10
  var yTranslate = delta.y.translate / treeScale.y;
11
11
  var transform = "translate3d(".concat(xTranslate, "px, ").concat(yTranslate, "px, 0) ");
12
+ /**
13
+ * Apply scale correction for the tree transform.
14
+ * This will apply scale to the screen-orientated axes.
15
+ */
16
+ transform += "scale(".concat(1 / treeScale.x, ", ").concat(1 / treeScale.y, ") ");
12
17
  if (latestTransform) {
13
18
  var rotate = latestTransform.rotate, rotateX = latestTransform.rotateX, rotateY = latestTransform.rotateY;
14
19
  if (rotate)
@@ -18,7 +23,13 @@ function buildProjectionTransform(delta, treeScale, latestTransform) {
18
23
  if (rotateY)
19
24
  transform += "rotateY(".concat(rotateY, "deg) ");
20
25
  }
21
- transform += "scale(".concat(delta.x.scale, ", ").concat(delta.y.scale, ")");
26
+ /**
27
+ * Apply scale to match the size of the element to the size we want it.
28
+ * This will apply scale to the element-orientated axes.
29
+ */
30
+ var elementScaleX = delta.x.scale * treeScale.x;
31
+ var elementScaleY = delta.y.scale * treeScale.y;
32
+ transform += "scale(".concat(elementScaleX, ", ").concat(elementScaleY, ")");
22
33
  return transform === identityProjection ? "none" : transform;
23
34
  }
24
35
 
@@ -4,9 +4,6 @@ import { setTarget } from './setters.mjs';
4
4
  import { resolveVariant } from './variants.mjs';
5
5
  import { isTransformProp } from '../html/utils/transform.mjs';
6
6
 
7
- /**
8
- * @internal
9
- */
10
7
  function animateVisualElement(visualElement, definition, options) {
11
8
  if (options === void 0) { options = {}; }
12
9
  visualElement.notifyAnimationStart(definition);
@@ -18,7 +18,7 @@ function updateMotionValuesFromProps(element, next, prev) {
18
18
  * and warn against mismatches.
19
19
  */
20
20
  if (process.env.NODE_ENV === "development") {
21
- warnOnce(nextValue.version === "6.3.10", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 6.3.10 may not work as expected."));
21
+ warnOnce(nextValue.version === "6.3.13", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 6.3.13 may not work as expected."));
22
22
  }
23
23
  }
24
24
  else if (isMotionValue(prevValue)) {
@@ -25,7 +25,7 @@ var MotionValue = /** @class */ (function () {
25
25
  * This will be replaced by the build step with the latest version number.
26
26
  * When MotionValues are provided to motion components, warn if versions are mixed.
27
27
  */
28
- this.version = "6.3.10";
28
+ this.version = "6.3.13";
29
29
  /**
30
30
  * Duration, in milliseconds, since last updating frame.
31
31
  *
@@ -152,7 +152,7 @@ var MotionValue = /** @class */ (function () {
152
152
  * }
153
153
  * ```
154
154
  *
155
- * @internalremarks
155
+ * @privateRemarks
156
156
  *
157
157
  * We could look into a `useOnChange` hook if the above lifecycle management proves confusing.
158
158
  *
@@ -304,9 +304,6 @@ var MotionValue = /** @class */ (function () {
304
304
  };
305
305
  return MotionValue;
306
306
  }());
307
- /**
308
- * @internal
309
- */
310
307
  function motionValue(init) {
311
308
  return new MotionValue(init);
312
309
  }
@@ -29,7 +29,6 @@ var hasWarned = false;
29
29
  * ```
30
30
  *
31
31
  * @deprecated
32
- * @internal
33
32
  */
34
33
  function useInvertedScale(scale) {
35
34
  var parentScaleX = useMotionValue(1);
@@ -5,8 +5,6 @@ import { isMotionValue } from './is-motion-value.mjs';
5
5
  * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself
6
6
  *
7
7
  * TODO: Remove and move to library
8
- *
9
- * @internal
10
8
  */
11
9
  function resolveMotionValue(value) {
12
10
  var unwrappedValue = isMotionValue(value) ? value.get() : value;
@@ -1706,7 +1706,7 @@
1706
1706
  * This will be replaced by the build step with the latest version number.
1707
1707
  * When MotionValues are provided to motion components, warn if versions are mixed.
1708
1708
  */
1709
- this.version = "6.3.10";
1709
+ this.version = "6.3.13";
1710
1710
  /**
1711
1711
  * Duration, in milliseconds, since last updating frame.
1712
1712
  *
@@ -1833,7 +1833,7 @@
1833
1833
  * }
1834
1834
  * ```
1835
1835
  *
1836
- * @internalremarks
1836
+ * @privateRemarks
1837
1837
  *
1838
1838
  * We could look into a `useOnChange` hook if the above lifecycle management proves confusing.
1839
1839
  *
@@ -1985,9 +1985,6 @@
1985
1985
  };
1986
1986
  return MotionValue;
1987
1987
  }());
1988
- /**
1989
- * @internal
1990
- */
1991
1988
  function motionValue(init) {
1992
1989
  return new MotionValue(init);
1993
1990
  }
@@ -2393,8 +2390,6 @@
2393
2390
  /**
2394
2391
  * Start animation on a MotionValue. This function is an interface between
2395
2392
  * Framer Motion and Popmotion
2396
- *
2397
- * @internal
2398
2393
  */
2399
2394
  function startAnimation(key, value, target, transition) {
2400
2395
  if (transition === void 0) { transition = {}; }
@@ -2930,7 +2925,7 @@
2930
2925
  Object.assign(scaleCorrectors, correctors);
2931
2926
  }
2932
2927
 
2933
- var identityProjection = "translate3d(0px, 0px, 0) scale(1, 1)";
2928
+ var identityProjection = "translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)";
2934
2929
  function buildProjectionTransform(delta, treeScale, latestTransform) {
2935
2930
  /**
2936
2931
  * The translations we use to calculate are always relative to the viewport coordinate space.
@@ -2941,6 +2936,11 @@
2941
2936
  var xTranslate = delta.x.translate / treeScale.x;
2942
2937
  var yTranslate = delta.y.translate / treeScale.y;
2943
2938
  var transform = "translate3d(".concat(xTranslate, "px, ").concat(yTranslate, "px, 0) ");
2939
+ /**
2940
+ * Apply scale correction for the tree transform.
2941
+ * This will apply scale to the screen-orientated axes.
2942
+ */
2943
+ transform += "scale(".concat(1 / treeScale.x, ", ").concat(1 / treeScale.y, ") ");
2944
2944
  if (latestTransform) {
2945
2945
  var rotate = latestTransform.rotate, rotateX = latestTransform.rotateX, rotateY = latestTransform.rotateY;
2946
2946
  if (rotate)
@@ -2950,7 +2950,13 @@
2950
2950
  if (rotateY)
2951
2951
  transform += "rotateY(".concat(rotateY, "deg) ");
2952
2952
  }
2953
- transform += "scale(".concat(delta.x.scale, ", ").concat(delta.y.scale, ")");
2953
+ /**
2954
+ * Apply scale to match the size of the element to the size we want it.
2955
+ * This will apply scale to the element-orientated axes.
2956
+ */
2957
+ var elementScaleX = delta.x.scale * treeScale.x;
2958
+ var elementScaleY = delta.y.scale * treeScale.y;
2959
+ transform += "scale(".concat(elementScaleX, ", ").concat(elementScaleY, ")");
2954
2960
  return transform === identityProjection ? "none" : transform;
2955
2961
  }
2956
2962
 
@@ -3027,8 +3033,6 @@
3027
3033
  * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself
3028
3034
  *
3029
3035
  * TODO: Remove and move to library
3030
- *
3031
- * @internal
3032
3036
  */
3033
3037
  function resolveMotionValue(value) {
3034
3038
  var unwrappedValue = isMotionValue(value) ? value.get() : value;
@@ -4229,9 +4233,6 @@
4229
4233
  });
4230
4234
  }
4231
4235
 
4232
- /**
4233
- * @internal
4234
- */
4235
4236
  var LayoutGroupContext = React.createContext({});
4236
4237
 
4237
4238
  /**
@@ -4300,8 +4301,6 @@
4300
4301
  *
4301
4302
  * Alongside this is a config option which provides a way of rendering the provided
4302
4303
  * component "offline", or outside the React render cycle.
4303
- *
4304
- * @internal
4305
4304
  */
4306
4305
  function createMotionComponent(_a) {
4307
4306
  var preloadedFeatures = _a.preloadedFeatures, createVisualElement = _a.createVisualElement, projectionNodeConstructor = _a.projectionNodeConstructor, useRender = _a.useRender, useVisualState = _a.useVisualState, Component = _a.Component;
@@ -4679,7 +4678,7 @@
4679
4678
  /**
4680
4679
  * A list of all valid MotionProps.
4681
4680
  *
4682
- * @internalremarks
4681
+ * @privateRemarks
4683
4682
  * This doesn't throw if a `MotionProp` name is missing - it should.
4684
4683
  */
4685
4684
  var validMotionProps = new Set([
@@ -5837,9 +5836,6 @@
5837
5836
  return origin;
5838
5837
  }
5839
5838
 
5840
- /**
5841
- * @internal
5842
- */
5843
5839
  function animateVisualElement(visualElement, definition, options) {
5844
5840
  if (options === void 0) { options = {}; }
5845
5841
  visualElement.notifyAnimationStart(definition);
@@ -7102,7 +7098,7 @@
7102
7098
  * @param handlers -
7103
7099
  * @param ref -
7104
7100
  *
7105
- * @internalremarks
7101
+ * @privateRemarks
7106
7102
  * Currently this sets new pan gesture functions every render. The memo route has been explored
7107
7103
  * in the past but ultimately we're still creating new functions every render. An optimisation
7108
7104
  * to explore is creating the pan gestures and loading them into a `ref`.
@@ -7204,7 +7200,7 @@
7204
7200
  * and warn against mismatches.
7205
7201
  */
7206
7202
  {
7207
- warnOnce(nextValue.version === "6.3.10", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 6.3.10 may not work as expected."));
7203
+ warnOnce(nextValue.version === "6.3.13", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 6.3.13 may not work as expected."));
7208
7204
  }
7209
7205
  }
7210
7206
  else if (isMotionValue(prevValue)) {
@@ -8602,7 +8598,6 @@
8602
8598
  };
8603
8599
 
8604
8600
  /**
8605
- * @internal
8606
8601
  * @deprecated
8607
8602
  */
8608
8603
  var DeprecatedLayoutGroupContext = React.createContext(null);
@@ -9557,7 +9552,6 @@
9557
9552
  /**
9558
9553
  * This is not an officially supported API and may be removed
9559
9554
  * on any version.
9560
- * @internal
9561
9555
  */
9562
9556
  function useAnimatedState(initialState) {
9563
9557
  var _a = __read(React.useState(initialState), 2), animationState = _a[0], setAnimationState = _a[1];
@@ -9608,7 +9602,6 @@
9608
9602
  * ```
9609
9603
  *
9610
9604
  * @deprecated
9611
- * @internal
9612
9605
  */
9613
9606
  function useInvertedScale(scale) {
9614
9607
  var parentScaleX = useMotionValue(1);