@graphcommerce/framer-scroller 6.0.2-canary.19 → 6.0.2-canary.21
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 +8 -0
- package/hooks/useScrollTo.ts +8 -5
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 6.0.2-canary.21
|
|
4
|
+
|
|
5
|
+
## 6.0.2-canary.20
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- [#1901](https://github.com/graphcommerce-org/graphcommerce/pull/1901) [`54aadf39f`](https://github.com/graphcommerce-org/graphcommerce/commit/54aadf39fa9cf2d84c7feab8bc07703e3d02741d) - Make sure the stop function is stopping both x and y animations to prevent rare occasions where a direction isn’t cancelled ([@paales](https://github.com/paales))
|
|
10
|
+
|
|
3
11
|
## 6.0.2-canary.19
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/hooks/useScrollTo.ts
CHANGED
|
@@ -43,10 +43,13 @@ export function useScrollTo() {
|
|
|
43
43
|
)
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
const stop: { stop: () => void }[] = []
|
|
47
|
+
|
|
46
48
|
const xDone = new Promise<void>((onComplete) => {
|
|
47
49
|
if (ref.scrollLeft !== to.x) {
|
|
48
50
|
disableSnap()
|
|
49
|
-
|
|
51
|
+
|
|
52
|
+
stop.push(
|
|
50
53
|
animate({
|
|
51
54
|
from: ref.scrollLeft,
|
|
52
55
|
to: to.x,
|
|
@@ -66,7 +69,7 @@ export function useScrollTo() {
|
|
|
66
69
|
const yDone = new Promise<void>((onComplete) => {
|
|
67
70
|
if (ref.scrollTop !== to.y) {
|
|
68
71
|
disableSnap()
|
|
69
|
-
|
|
72
|
+
stop.push(
|
|
70
73
|
animate({
|
|
71
74
|
from: ref.scrollTop,
|
|
72
75
|
to: to.y,
|
|
@@ -86,13 +89,13 @@ export function useScrollTo() {
|
|
|
86
89
|
}
|
|
87
90
|
})
|
|
88
91
|
|
|
89
|
-
|
|
90
|
-
await yDone
|
|
92
|
+
register({ stop: () => stop.forEach((s) => s.stop()) })
|
|
93
|
+
await Promise.all([xDone, yDone])
|
|
91
94
|
|
|
92
95
|
if (Array.isArray(incoming)) {
|
|
93
96
|
const checkPositions = getScrollSnapPositions()
|
|
94
97
|
if (checkPositions.x[incoming[0]] !== to.x || checkPositions.y[incoming[1]] !== to.y)
|
|
95
|
-
await scrollTo(incoming, retrigger
|
|
98
|
+
await scrollTo(incoming, retrigger + 1)
|
|
96
99
|
}
|
|
97
100
|
enableSnap()
|
|
98
101
|
},
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/framer-scroller",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "6.0.2-canary.
|
|
5
|
+
"version": "6.0.2-canary.21",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "tsc -W"
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"popmotion": "11.0.5",
|
|
19
|
-
"@graphcommerce/framer-utils": "6.0.2-canary.
|
|
20
|
-
"@graphcommerce/image": "6.0.2-canary.
|
|
19
|
+
"@graphcommerce/framer-utils": "6.0.2-canary.21",
|
|
20
|
+
"@graphcommerce/image": "6.0.2-canary.21"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@graphcommerce/eslint-config-pwa": "6.0.2-canary.
|
|
24
|
-
"@graphcommerce/prettier-config-pwa": "6.0.2-canary.
|
|
25
|
-
"@graphcommerce/typescript-config-pwa": "6.0.2-canary.
|
|
23
|
+
"@graphcommerce/eslint-config-pwa": "6.0.2-canary.21",
|
|
24
|
+
"@graphcommerce/prettier-config-pwa": "6.0.2-canary.21",
|
|
25
|
+
"@graphcommerce/typescript-config-pwa": "6.0.2-canary.21"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@mui/material": "^5.10.16",
|