@graphcommerce/framer-utils 6.0.0-canary.26 → 6.0.0-canary.28

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
+ ## 6.0.0-canary.28
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1823](https://github.com/graphcommerce-org/graphcommerce/pull/1823) [`605d74434`](https://github.com/graphcommerce-org/graphcommerce/commit/605d74434b78baa83f3574b6a4249eae0431d570) - Fix/upgrade instructions ([@paales](https://github.com/paales))
8
+
9
+ ## 6.0.0-canary.27
10
+
3
11
  ## 6.0.0-canary.26
4
12
 
5
13
  ## 6.0.0-canary.25
@@ -3,7 +3,7 @@ import sync from 'framesync'
3
3
  import { RefObject, useMemo } from 'react'
4
4
  import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect'
5
5
 
6
- type ScrollMotionValue = { x: number; y: number; xMax: number; yMax: number }
6
+ type ScrollMotionValue = { animating: boolean; x: number; y: number; xMax: number; yMax: number }
7
7
 
8
8
  export interface ScrollMotionValues {
9
9
  x: MotionValue<number>
@@ -20,7 +20,7 @@ const refScrollMap = new Map<
20
20
  MotionValue<ScrollMotionValue>
21
21
  >()
22
22
 
23
- const initval = () => motionValue({ x: 0, y: 0, xMax: 0, yMax: 0 })
23
+ const initval = () => motionValue({ animating: false, x: 0, y: 0, xMax: 0, yMax: 0 })
24
24
 
25
25
  const getScrollMotion = (ref?: RefObject<HTMLElement | undefined>, sharedKey?: string) => {
26
26
  if (!ref) return initval()
@@ -50,7 +50,7 @@ export function useElementScroll(ref?: RefObject<HTMLElement | undefined>): Scro
50
50
  if (!element) return () => {}
51
51
 
52
52
  const updater = () => {
53
- if (scroll.isAnimating()) return
53
+ if (scroll.get().animating) return
54
54
 
55
55
  sync.read(() => {
56
56
  const scrollnew = {
@@ -62,6 +62,7 @@ export function useElementScroll(ref?: RefObject<HTMLElement | undefined>): Scro
62
62
 
63
63
  if (JSON.stringify(scrollnew) !== JSON.stringify(scroll.get())) {
64
64
  scroll.set({
65
+ animating: false,
65
66
  x: element.scrollLeft,
66
67
  y: element.scrollTop,
67
68
  xMax: Math.max(0, element.scrollWidth - element.offsetWidth),
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": "6.0.0-canary.26",
5
+ "version": "6.0.0-canary.28",
6
6
  "sideEffects": false,
7
7
  "scripts": {
8
8
  "dev": "tsc -W"
@@ -15,9 +15,9 @@
15
15
  }
16
16
  },
17
17
  "devDependencies": {
18
- "@graphcommerce/eslint-config-pwa": "6.0.0-canary.26",
19
- "@graphcommerce/prettier-config-pwa": "6.0.0-canary.26",
20
- "@graphcommerce/typescript-config-pwa": "6.0.0-canary.26"
18
+ "@graphcommerce/eslint-config-pwa": "6.0.0-canary.28",
19
+ "@graphcommerce/prettier-config-pwa": "6.0.0-canary.28",
20
+ "@graphcommerce/typescript-config-pwa": "6.0.0-canary.28"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "framer-motion": "^7.0.0",