@graphcommerce/framer-utils 3.1.4 → 3.1.5

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1598](https://github.com/graphcommerce-org/graphcommerce/pull/1598) [`707dbc73d`](https://github.com/graphcommerce-org/graphcommerce/commit/707dbc73d181204d88fdbbd2e09340e25b2b5f7b) Thanks [@paales](https://github.com/paales)! - Upgraded dependencies
8
+
9
+ * [#1600](https://github.com/graphcommerce-org/graphcommerce/pull/1600) [`5c5645e6e`](https://github.com/graphcommerce-org/graphcommerce/commit/5c5645e6eaf5314c063f05547707fcd4b34a8717) Thanks [@paales](https://github.com/paales)! - Reduce the required properties for useMotionValueValue
10
+
3
11
  ## 3.1.4
4
12
 
5
13
  ### Patch Changes
@@ -1,14 +1,17 @@
1
1
  import { MotionValue } from 'framer-motion'
2
- import { useState } from 'react'
2
+ import { startTransition, useState } from 'react'
3
3
  import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect'
4
4
 
5
5
  /** Get the MotionValue's value and return the value as a state update. */
6
- export function useMotionValueValue<T, R>(motionValue: MotionValue<T>, effect: (v: T) => R) {
6
+ export function useMotionValueValue<T, R>(
7
+ motionValue: Pick<MotionValue<T>, 'onChange' | 'get'>,
8
+ effect: (v: T) => R,
9
+ ) {
7
10
  const [result, setResult] = useState<R>(effect(motionValue.get()))
8
11
 
9
12
  useIsomorphicLayoutEffect(() => {
10
- const set = (v: T) => setResult(effect(v))
11
- set(motionValue.get())
13
+ const set = (v: T) => startTransition(() => setResult(effect(v)))
14
+ setResult(effect(motionValue.get()))
12
15
  return motionValue.onChange(set)
13
16
  // we're not recalculating
14
17
  // eslint-disable-next-line react-hooks/exhaustive-deps
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/framer-utils",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "3.1.4",
5
+ "version": "3.1.5",
6
6
  "sideEffects": false,
7
7
  "scripts": {
8
8
  "dev": "tsc -W"
@@ -15,7 +15,7 @@
15
15
  }
16
16
  },
17
17
  "devDependencies": {
18
- "@graphcommerce/eslint-config-pwa": "^4.1.8",
18
+ "@graphcommerce/eslint-config-pwa": "^4.1.10",
19
19
  "@graphcommerce/prettier-config-pwa": "^4.0.6",
20
20
  "@graphcommerce/typescript-config-pwa": "^4.0.2",
21
21
  "@playwright/test": "^1.21.1"
@@ -26,6 +26,6 @@
26
26
  "react-dom": "^18.0.0"
27
27
  },
28
28
  "dependencies": {
29
- "framesync": "^6.1.0"
29
+ "framesync": "^6.1.1"
30
30
  }
31
31
  }