framer-motion 11.18.0 → 11.18.1

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.
@@ -409,7 +409,7 @@ class MotionValue {
409
409
  * This will be replaced by the build step with the latest version number.
410
410
  * When MotionValues are provided to motion components, warn if versions are mixed.
411
411
  */
412
- this.version = "11.18.0";
412
+ this.version = "11.18.1";
413
413
  /**
414
414
  * Tracks whether this value can output a velocity. Currently this is only true
415
415
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -5201,7 +5201,7 @@ function updateMotionValuesFromProps(element, next, prev) {
5201
5201
  * and warn against mismatches.
5202
5202
  */
5203
5203
  if (process.env.NODE_ENV === "development") {
5204
- warnOnce(nextValue.version === "11.18.0", `Attempting to mix Motion versions ${nextValue.version} with 11.18.0 may not work as expected.`);
5204
+ warnOnce(nextValue.version === "11.18.1", `Attempting to mix Motion versions ${nextValue.version} with 11.18.1 may not work as expected.`);
5205
5205
  }
5206
5206
  }
5207
5207
  else if (isMotionValue(prevValue)) {
@@ -5858,21 +5858,6 @@ function buildHTMLStyles(state, latestValues, transformTemplate) {
5858
5858
  }
5859
5859
  }
5860
5860
 
5861
- function calcOrigin(origin, offset, size) {
5862
- return typeof origin === "string"
5863
- ? origin
5864
- : px.transform(offset + size * origin);
5865
- }
5866
- /**
5867
- * The SVG transform origin defaults are different to CSS and is less intuitive,
5868
- * so we use the measured dimensions of the SVG to reconcile these.
5869
- */
5870
- function calcSVGTransformOrigin(dimensions, originX, originY) {
5871
- const pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);
5872
- const pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);
5873
- return `${pxOriginX} ${pxOriginY}`;
5874
- }
5875
-
5876
5861
  const dashKeys = {
5877
5862
  offset: "stroke-dashoffset",
5878
5863
  array: "stroke-dasharray",
@@ -5902,6 +5887,21 @@ function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true
5902
5887
  attrs[keys.array] = `${pathLength} ${pathSpacing}`;
5903
5888
  }
5904
5889
 
5890
+ function calcOrigin(origin, offset, size) {
5891
+ return typeof origin === "string"
5892
+ ? origin
5893
+ : px.transform(offset + size * origin);
5894
+ }
5895
+ /**
5896
+ * The SVG transform origin defaults are different to CSS and is less intuitive,
5897
+ * so we use the measured dimensions of the SVG to reconcile these.
5898
+ */
5899
+ function calcSVGTransformOrigin(dimensions, originX, originY) {
5900
+ const pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);
5901
+ const pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);
5902
+ return `${pxOriginX} ${pxOriginY}`;
5903
+ }
5904
+
5905
5905
  /**
5906
5906
  * Build SVG visual attrbutes, like cx and style.transform
5907
5907
  */
@@ -9086,10 +9086,12 @@ const svgMotionConfig = {
9086
9086
  }
9087
9087
  if (!needsMeasure)
9088
9088
  return;
9089
- frame.read(() => updateSVGDimensions(current, renderState));
9090
- frame.render(() => {
9091
- buildSVGAttrs(renderState, latestValues, isSVGTag(current.tagName), props.transformTemplate);
9092
- renderSVG(current, renderState);
9089
+ frame.read(() => {
9090
+ updateSVGDimensions(current, renderState);
9091
+ frame.render(() => {
9092
+ buildSVGAttrs(renderState, latestValues, isSVGTag(current.tagName), props.transformTemplate);
9093
+ renderSVG(current, renderState);
9094
+ });
9093
9095
  });
9094
9096
  },
9095
9097
  }),
package/dist/cjs/dom.js CHANGED
@@ -994,7 +994,7 @@ class MotionValue {
994
994
  * This will be replaced by the build step with the latest version number.
995
995
  * When MotionValues are provided to motion components, warn if versions are mixed.
996
996
  */
997
- this.version = "11.18.0";
997
+ this.version = "11.18.1";
998
998
  /**
999
999
  * Tracks whether this value can output a velocity. Currently this is only true
1000
1000
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -3924,7 +3924,7 @@ function updateMotionValuesFromProps(element, next, prev) {
3924
3924
  * and warn against mismatches.
3925
3925
  */
3926
3926
  if (process.env.NODE_ENV === "development") {
3927
- warnOnce(nextValue.version === "11.18.0", `Attempting to mix Motion versions ${nextValue.version} with 11.18.0 may not work as expected.`);
3927
+ warnOnce(nextValue.version === "11.18.1", `Attempting to mix Motion versions ${nextValue.version} with 11.18.1 may not work as expected.`);
3928
3928
  }
3929
3929
  }
3930
3930
  else if (isMotionValue(prevValue)) {
@@ -4581,21 +4581,6 @@ function buildHTMLStyles(state, latestValues, transformTemplate) {
4581
4581
  }
4582
4582
  }
4583
4583
 
4584
- function calcOrigin(origin, offset, size) {
4585
- return typeof origin === "string"
4586
- ? origin
4587
- : px.transform(offset + size * origin);
4588
- }
4589
- /**
4590
- * The SVG transform origin defaults are different to CSS and is less intuitive,
4591
- * so we use the measured dimensions of the SVG to reconcile these.
4592
- */
4593
- function calcSVGTransformOrigin(dimensions, originX, originY) {
4594
- const pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);
4595
- const pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);
4596
- return `${pxOriginX} ${pxOriginY}`;
4597
- }
4598
-
4599
4584
  const dashKeys = {
4600
4585
  offset: "stroke-dashoffset",
4601
4586
  array: "stroke-dasharray",
@@ -4625,6 +4610,21 @@ function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true
4625
4610
  attrs[keys.array] = `${pathLength} ${pathSpacing}`;
4626
4611
  }
4627
4612
 
4613
+ function calcOrigin(origin, offset, size) {
4614
+ return typeof origin === "string"
4615
+ ? origin
4616
+ : px.transform(offset + size * origin);
4617
+ }
4618
+ /**
4619
+ * The SVG transform origin defaults are different to CSS and is less intuitive,
4620
+ * so we use the measured dimensions of the SVG to reconcile these.
4621
+ */
4622
+ function calcSVGTransformOrigin(dimensions, originX, originY) {
4623
+ const pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);
4624
+ const pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);
4625
+ return `${pxOriginX} ${pxOriginY}`;
4626
+ }
4627
+
4628
4628
  /**
4629
4629
  * Build SVG visual attrbutes, like cx and style.transform
4630
4630
  */
package/dist/cjs/index.js CHANGED
@@ -445,7 +445,7 @@ class MotionValue {
445
445
  * This will be replaced by the build step with the latest version number.
446
446
  * When MotionValues are provided to motion components, warn if versions are mixed.
447
447
  */
448
- this.version = "11.18.0";
448
+ this.version = "11.18.1";
449
449
  /**
450
450
  * Tracks whether this value can output a velocity. Currently this is only true
451
451
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -5215,7 +5215,7 @@ function updateMotionValuesFromProps(element, next, prev) {
5215
5215
  * and warn against mismatches.
5216
5216
  */
5217
5217
  if (process.env.NODE_ENV === "development") {
5218
- warnOnce(nextValue.version === "11.18.0", `Attempting to mix Motion versions ${nextValue.version} with 11.18.0 may not work as expected.`);
5218
+ warnOnce(nextValue.version === "11.18.1", `Attempting to mix Motion versions ${nextValue.version} with 11.18.1 may not work as expected.`);
5219
5219
  }
5220
5220
  }
5221
5221
  else if (isMotionValue(prevValue)) {
@@ -5872,21 +5872,6 @@ function buildHTMLStyles(state, latestValues, transformTemplate) {
5872
5872
  }
5873
5873
  }
5874
5874
 
5875
- function calcOrigin$1(origin, offset, size) {
5876
- return typeof origin === "string"
5877
- ? origin
5878
- : px.transform(offset + size * origin);
5879
- }
5880
- /**
5881
- * The SVG transform origin defaults are different to CSS and is less intuitive,
5882
- * so we use the measured dimensions of the SVG to reconcile these.
5883
- */
5884
- function calcSVGTransformOrigin(dimensions, originX, originY) {
5885
- const pxOriginX = calcOrigin$1(originX, dimensions.x, dimensions.width);
5886
- const pxOriginY = calcOrigin$1(originY, dimensions.y, dimensions.height);
5887
- return `${pxOriginX} ${pxOriginY}`;
5888
- }
5889
-
5890
5875
  const dashKeys = {
5891
5876
  offset: "stroke-dashoffset",
5892
5877
  array: "stroke-dasharray",
@@ -5916,6 +5901,21 @@ function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true
5916
5901
  attrs[keys.array] = `${pathLength} ${pathSpacing}`;
5917
5902
  }
5918
5903
 
5904
+ function calcOrigin$1(origin, offset, size) {
5905
+ return typeof origin === "string"
5906
+ ? origin
5907
+ : px.transform(offset + size * origin);
5908
+ }
5909
+ /**
5910
+ * The SVG transform origin defaults are different to CSS and is less intuitive,
5911
+ * so we use the measured dimensions of the SVG to reconcile these.
5912
+ */
5913
+ function calcSVGTransformOrigin(dimensions, originX, originY) {
5914
+ const pxOriginX = calcOrigin$1(originX, dimensions.x, dimensions.width);
5915
+ const pxOriginY = calcOrigin$1(originY, dimensions.y, dimensions.height);
5916
+ return `${pxOriginX} ${pxOriginY}`;
5917
+ }
5918
+
5919
5919
  /**
5920
5920
  * Build SVG visual attrbutes, like cx and style.transform
5921
5921
  */
@@ -11095,10 +11095,12 @@ const svgMotionConfig = {
11095
11095
  }
11096
11096
  if (!needsMeasure)
11097
11097
  return;
11098
- frame.read(() => updateSVGDimensions(current, renderState));
11099
- frame.render(() => {
11100
- buildSVGAttrs(renderState, latestValues, isSVGTag(current.tagName), props.transformTemplate);
11101
- renderSVG(current, renderState);
11098
+ frame.read(() => {
11099
+ updateSVGDimensions(current, renderState);
11100
+ frame.render(() => {
11101
+ buildSVGAttrs(renderState, latestValues, isSVGTag(current.tagName), props.transformTemplate);
11102
+ renderSVG(current, renderState);
11103
+ });
11102
11104
  });
11103
11105
  },
11104
11106
  }),
package/dist/cjs/m.js CHANGED
@@ -1010,21 +1010,6 @@ function buildHTMLStyles(state, latestValues, transformTemplate) {
1010
1010
  }
1011
1011
  }
1012
1012
 
1013
- function calcOrigin(origin, offset, size) {
1014
- return typeof origin === "string"
1015
- ? origin
1016
- : px.transform(offset + size * origin);
1017
- }
1018
- /**
1019
- * The SVG transform origin defaults are different to CSS and is less intuitive,
1020
- * so we use the measured dimensions of the SVG to reconcile these.
1021
- */
1022
- function calcSVGTransformOrigin(dimensions, originX, originY) {
1023
- const pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);
1024
- const pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);
1025
- return `${pxOriginX} ${pxOriginY}`;
1026
- }
1027
-
1028
1013
  const dashKeys = {
1029
1014
  offset: "stroke-dashoffset",
1030
1015
  array: "stroke-dasharray",
@@ -1054,6 +1039,21 @@ function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true
1054
1039
  attrs[keys.array] = `${pathLength} ${pathSpacing}`;
1055
1040
  }
1056
1041
 
1042
+ function calcOrigin(origin, offset, size) {
1043
+ return typeof origin === "string"
1044
+ ? origin
1045
+ : px.transform(offset + size * origin);
1046
+ }
1047
+ /**
1048
+ * The SVG transform origin defaults are different to CSS and is less intuitive,
1049
+ * so we use the measured dimensions of the SVG to reconcile these.
1050
+ */
1051
+ function calcSVGTransformOrigin(dimensions, originX, originY) {
1052
+ const pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);
1053
+ const pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);
1054
+ return `${pxOriginX} ${pxOriginY}`;
1055
+ }
1056
+
1057
1057
  /**
1058
1058
  * Build SVG visual attrbutes, like cx and style.transform
1059
1059
  */
@@ -1250,10 +1250,12 @@ const svgMotionConfig = {
1250
1250
  }
1251
1251
  if (!needsMeasure)
1252
1252
  return;
1253
- frame.read(() => updateSVGDimensions(current, renderState));
1254
- frame.render(() => {
1255
- buildSVGAttrs(renderState, latestValues, isSVGTag(current.tagName), props.transformTemplate);
1256
- renderSVG(current, renderState);
1253
+ frame.read(() => {
1254
+ updateSVGDimensions(current, renderState);
1255
+ frame.render(() => {
1256
+ buildSVGAttrs(renderState, latestValues, isSVGTag(current.tagName), props.transformTemplate);
1257
+ renderSVG(current, renderState);
1258
+ });
1257
1259
  });
1258
1260
  },
1259
1261
  }),
package/dist/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import * as React$1 from 'react';
2
+ import * as react from 'react';
3
3
  import { SVGAttributes, CSSProperties, PropsWithoutRef, RefAttributes, JSX } from 'react';
4
4
  import { AnimationPlaybackControls, TransformProperties, SVGPathProperties, VariableKeyframesDefinition, Easing, Transition as Transition$1, ProgressTimeline } from 'motion-dom';
5
5
 
@@ -1232,7 +1232,7 @@ declare class DragControls {
1232
1232
  *
1233
1233
  * @public
1234
1234
  */
1235
- start(event: React$1.PointerEvent | PointerEvent, options?: DragControlOptions): void;
1235
+ start(event: react.PointerEvent | PointerEvent, options?: DragControlOptions): void;
1236
1236
  }
1237
1237
 
1238
1238
  type DragElastic = boolean | number | Partial<BoundingBox>;
@@ -2375,9 +2375,9 @@ declare global {
2375
2375
 
2376
2376
  type DOMMotionComponents = HTMLMotionComponents & SVGMotionComponents;
2377
2377
 
2378
- declare const createMotionComponent: <Props, TagName extends string = "div">(Component: string | TagName | React$1.ComponentType<Props>, { forwardMotionProps }?: {
2378
+ declare const createMotionComponent: <Props, TagName extends string = "div">(Component: string | TagName | react.ComponentType<Props>, { forwardMotionProps }?: {
2379
2379
  forwardMotionProps: boolean;
2380
- }) => TagName extends "symbol" | "clipPath" | "filter" | "mask" | "marker" | "text" | "animate" | "stop" | "path" | "image" | "circle" | "switch" | "svg" | keyof HTMLElements | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "line" | "linearGradient" | "metadata" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "textPath" | "tspan" | "use" | "view" ? DOMMotionComponents[TagName] : React$1.ComponentType<MotionComponentProps<React$1.PropsWithChildren<Props>>>;
2380
+ }) => TagName extends "symbol" | "clipPath" | "filter" | "mask" | "marker" | "text" | "animate" | "stop" | "path" | "image" | "circle" | "switch" | "svg" | keyof HTMLElements | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "line" | "linearGradient" | "metadata" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "textPath" | "tspan" | "use" | "view" ? DOMMotionComponents[TagName] : react.ComponentType<MotionComponentProps<react.PropsWithChildren<Props>>>;
2381
2381
 
2382
2382
  /**
2383
2383
  * HTML components