@graphcommerce/framer-scroller 1.1.10 → 1.1.14
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 +11 -0
- package/hooks/useScrollTo.ts +7 -3
- package/hooks/useScroller.ts +2 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.1.14](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@1.1.13...@graphcommerce/framer-scroller@1.1.14) (2021-12-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **framer-scroller:** remove jank from scroller when opening ([c618bf2](https://github.com/ho-nl/m2-pwa/commit/c618bf290bd580fe5eb45663c44843dd751e00ed))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [1.1.10](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@1.1.9...@graphcommerce/framer-scroller@1.1.10) (2021-12-17)
|
|
7
18
|
|
|
8
19
|
|
package/hooks/useScrollTo.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useElementScroll } from '@graphcommerce/framer-utils'
|
|
2
2
|
import { Point } from 'framer-motion'
|
|
3
|
-
import { animate } from 'popmotion'
|
|
3
|
+
import { animate, easeOut } from 'popmotion'
|
|
4
4
|
import { useScrollerContext } from './useScrollerContext'
|
|
5
5
|
|
|
6
6
|
export function useScrollTo() {
|
|
@@ -11,6 +11,11 @@ export function useScrollTo() {
|
|
|
11
11
|
const ref = scrollerRef.current
|
|
12
12
|
if (!ref) return
|
|
13
13
|
|
|
14
|
+
// In the future we want to move to browser native scrolling behavior, but since it is too slow we're not moving to that yet.
|
|
15
|
+
// if ('scrollBehavior' in document.documentElement.style) {
|
|
16
|
+
// scrollerRef.current.scrollTo({ left: to.x, top: to.y, behavior: 'smooth' })
|
|
17
|
+
// }
|
|
18
|
+
|
|
14
19
|
const xDone = new Promise<void>((onComplete) => {
|
|
15
20
|
if (ref.scrollLeft !== to.x) {
|
|
16
21
|
disableSnap()
|
|
@@ -24,7 +29,6 @@ export function useScrollTo() {
|
|
|
24
29
|
},
|
|
25
30
|
onComplete,
|
|
26
31
|
onStop: onComplete,
|
|
27
|
-
bounce: 50,
|
|
28
32
|
}),
|
|
29
33
|
)
|
|
30
34
|
} else onComplete()
|
|
@@ -43,7 +47,7 @@ export function useScrollTo() {
|
|
|
43
47
|
},
|
|
44
48
|
onComplete,
|
|
45
49
|
onStop: onComplete,
|
|
46
|
-
|
|
50
|
+
duration: 500,
|
|
47
51
|
}),
|
|
48
52
|
)
|
|
49
53
|
} else onComplete()
|
package/hooks/useScroller.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
useTransform,
|
|
12
12
|
} from 'framer-motion'
|
|
13
13
|
import React, { ReactHTML, useState } from 'react'
|
|
14
|
-
import { ScrollSnapProps
|
|
14
|
+
import { ScrollSnapProps } from '../types'
|
|
15
15
|
import { isHTMLMousePointerEvent } from '../utils/isHTMLMousePointerEvent'
|
|
16
16
|
import { scrollSnapTypeDirection } from '../utils/scrollSnapTypeDirection'
|
|
17
17
|
import { useScrollerContext } from './useScrollerContext'
|
|
@@ -20,6 +20,7 @@ import { useVelocitySnapTo } from './useVelocitySnapTo'
|
|
|
20
20
|
const useStyles = makeStyles(
|
|
21
21
|
(theme: Theme) => ({
|
|
22
22
|
root: {
|
|
23
|
+
willChange: 'scroll-position',
|
|
23
24
|
'& *': {
|
|
24
25
|
userSelect: 'none',
|
|
25
26
|
userDrag: 'none',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/framer-scroller",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "tsc -W"
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@graphcommerce/framer-utils": "^2.103.
|
|
20
|
-
"@graphcommerce/image": "^2.105.
|
|
21
|
-
"@graphcommerce/next-ui": "^3.21.
|
|
19
|
+
"@graphcommerce/framer-utils": "^2.103.20",
|
|
20
|
+
"@graphcommerce/image": "^2.105.10",
|
|
21
|
+
"@graphcommerce/next-ui": "^3.21.4",
|
|
22
22
|
"@material-ui/core": "^4.12.3",
|
|
23
23
|
"popmotion": "11.0.3"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@graphcommerce/browserslist-config-pwa": "^3.0.
|
|
27
|
-
"@graphcommerce/eslint-config-pwa": "^3.1.
|
|
28
|
-
"@graphcommerce/prettier-config-pwa": "^3.0.
|
|
29
|
-
"@graphcommerce/typescript-config-pwa": "^3.1.
|
|
26
|
+
"@graphcommerce/browserslist-config-pwa": "^3.0.3",
|
|
27
|
+
"@graphcommerce/eslint-config-pwa": "^3.1.9",
|
|
28
|
+
"@graphcommerce/prettier-config-pwa": "^3.0.5",
|
|
29
|
+
"@graphcommerce/typescript-config-pwa": "^3.1.2",
|
|
30
30
|
"@playwright/test": "^1.17.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"react-dom": "^17.0.2",
|
|
37
37
|
"type-fest": "^2.8.0"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "cac49a2bf6cdcbb6131dc7b64172e90aad257c6d"
|
|
40
40
|
}
|