framer-motion 12.8.0 → 12.8.2

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.
@@ -1027,26 +1027,17 @@ type SwitchLayoutGroupContext = SwitchLayoutGroup & InitialPromotionConfig;
1027
1027
  */
1028
1028
  declare const SwitchLayoutGroupContext: React$1.Context<SwitchLayoutGroupContext>;
1029
1029
 
1030
- interface OnUpdateSettings<Instance, RenderState> {
1031
- props: MotionProps;
1032
- prevProps?: MotionProps;
1033
- current: Instance | null;
1034
- renderState: RenderState;
1035
- latestValues: ResolvedValues;
1036
- }
1037
1030
  interface VisualState<Instance, RenderState> {
1038
1031
  renderState: RenderState;
1039
1032
  latestValues: ResolvedValues;
1040
- onUpdate?: (settings: OnUpdateSettings<Instance, RenderState>) => void;
1041
1033
  onMount?: (instance: Instance) => void;
1042
1034
  }
1043
1035
  type UseVisualState<Instance, RenderState> = (props: MotionProps, isStatic: boolean) => VisualState<Instance, RenderState>;
1044
- interface UseVisualStateConfig<Instance, RenderState> {
1036
+ interface UseVisualStateConfig<RenderState> {
1045
1037
  scrapeMotionValuesFromProps: ScrapeMotionValuesFromProps;
1046
1038
  createRenderState: () => RenderState;
1047
- onUpdate?: (settings: OnUpdateSettings<Instance, RenderState>) => void;
1048
1039
  }
1049
- declare const makeUseVisualState: <I, RS>(config: UseVisualStateConfig<I, RS>) => UseVisualState<I, RS>;
1040
+ declare const makeUseVisualState: <I, RS>(config: UseVisualStateConfig<RS>) => UseVisualState<I, RS>;
1050
1041
 
1051
1042
  type ScrapeMotionValuesFromProps = (props: MotionProps, prevProps: MotionProps, visualElement?: VisualElement) => {
1052
1043
  [key: string]: MotionValue | string | number;
@@ -1526,7 +1517,6 @@ declare abstract class VisualElement<Instance = unknown, RenderState = unknown,
1526
1517
  * VisualElement.on(), but only one of those can be defined via the onUpdate prop.
1527
1518
  */
1528
1519
  private propEventSubscriptions;
1529
- private onUpdate?;
1530
1520
  constructor({ parent, props, presenceContext, reducedMotionConfig, blockInitialAnimation, visualState, }: VisualElementOptions<Instance, RenderState>, options?: Options);
1531
1521
  mount(instance: Instance): void;
1532
1522
  unmount(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framer-motion",
3
- "version": "12.8.0",
3
+ "version": "12.8.2",
4
4
  "description": "A simple and powerful JavaScript animation library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.mjs",
@@ -87,7 +87,7 @@
87
87
  "measure": "rollup -c ./rollup.size.config.mjs"
88
88
  },
89
89
  "dependencies": {
90
- "motion-dom": "^12.8.0",
90
+ "motion-dom": "^12.8.1",
91
91
  "motion-utils": "^12.7.5",
92
92
  "tslib": "^2.4.0"
93
93
  },
@@ -142,5 +142,5 @@
142
142
  "maxSize": "2.26 kB"
143
143
  }
144
144
  ],
145
- "gitHead": "9472348ed0cb2c9f2a153241595dac2ff5876efd"
145
+ "gitHead": "a95e71abca6a1e5954c7ab31029bb391713d85d6"
146
146
  }
@@ -1,19 +0,0 @@
1
- function updateSVGDimensions(instance, renderState) {
2
- try {
3
- renderState.dimensions =
4
- typeof instance.getBBox === "function"
5
- ? instance.getBBox()
6
- : instance.getBoundingClientRect();
7
- }
8
- catch (e) {
9
- // Most likely trying to measure an unrendered element under Firefox
10
- renderState.dimensions = {
11
- x: 0,
12
- y: 0,
13
- width: 0,
14
- height: 0,
15
- };
16
- }
17
- }
18
-
19
- export { updateSVGDimensions };
@@ -1,18 +0,0 @@
1
- import { px } from 'motion-dom';
2
-
3
- function calcOrigin(origin, offset, size) {
4
- return typeof origin === "string"
5
- ? origin
6
- : px.transform(offset + size * origin);
7
- }
8
- /**
9
- * The SVG transform origin defaults are different to CSS and is less intuitive,
10
- * so we use the measured dimensions of the SVG to reconcile these.
11
- */
12
- function calcSVGTransformOrigin(dimensions, originX, originY) {
13
- const pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);
14
- const pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);
15
- return `${pxOriginX} ${pxOriginY}`;
16
- }
17
-
18
- export { calcSVGTransformOrigin };