@graphcommerce/framer-scroller 2.1.12 → 2.1.15
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 +28 -0
- package/components/ScrollerButton.tsx +17 -6
- package/components/ScrollerDots.tsx +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 2.1.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1509](https://github.com/graphcommerce-org/graphcommerce/pull/1509) [`0ab7c5465`](https://github.com/graphcommerce-org/graphcommerce/commit/0ab7c5465441cba9bf8cd185a6790ce2f443f4ed) Thanks [@paales](https://github.com/paales)! - SidebarGallery improvements (product page):
|
|
8
|
+
|
|
9
|
+
- Prevent vertical scrolling
|
|
10
|
+
- Disable zoom fab when there are no images
|
|
11
|
+
- Hide scroller dots when there in only one image
|
|
12
|
+
- Make sure the prev/next buttons are shown as expected
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [[`0ab7c5465`](https://github.com/graphcommerce-org/graphcommerce/commit/0ab7c5465441cba9bf8cd185a6790ce2f443f4ed)]:
|
|
15
|
+
- @graphcommerce/next-ui@4.8.4
|
|
16
|
+
|
|
17
|
+
## 2.1.14
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [[`afc67103d`](https://github.com/graphcommerce-org/graphcommerce/commit/afc67103d0e00583e274465036fd287537f95e79)]:
|
|
22
|
+
- @graphcommerce/next-ui@4.8.3
|
|
23
|
+
|
|
24
|
+
## 2.1.13
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies [[`c8c246b8a`](https://github.com/graphcommerce-org/graphcommerce/commit/c8c246b8aaab0621b68a2fca2a1c529a56fad962)]:
|
|
29
|
+
- @graphcommerce/next-ui@4.8.2
|
|
30
|
+
|
|
3
31
|
## 2.1.12
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useElementScroll } from '@graphcommerce/framer-utils'
|
|
1
|
+
import { useElementScroll, useMotionValueValue } from '@graphcommerce/framer-utils'
|
|
2
2
|
import { Fab, FabProps } from '@mui/material'
|
|
3
|
-
import { m, useSpring, useTransform } from 'framer-motion'
|
|
3
|
+
import { m, useMotionTemplate, useSpring, useTransform } from 'framer-motion'
|
|
4
4
|
import React from 'react'
|
|
5
5
|
import { useScrollTo } from '../hooks/useScrollTo'
|
|
6
6
|
import { useScrollerContext } from '../hooks/useScrollerContext'
|
|
@@ -8,11 +8,12 @@ import { SnapPositionDirection } from '../types'
|
|
|
8
8
|
|
|
9
9
|
export type ScrollerButtonProps = {
|
|
10
10
|
direction: SnapPositionDirection
|
|
11
|
+
layout?: boolean
|
|
11
12
|
} & FabProps
|
|
12
13
|
|
|
13
14
|
export const ScrollerButton = m(
|
|
14
15
|
React.forwardRef<HTMLDivElement, ScrollerButtonProps>((props, ref) => {
|
|
15
|
-
const { direction, sx = [], ...buttonProps } = props
|
|
16
|
+
const { direction, sx = [], layout, ...buttonProps } = props
|
|
16
17
|
|
|
17
18
|
const { getSnapPosition, scrollerRef } = useScrollerContext()
|
|
18
19
|
const scrollTo = useScrollTo()
|
|
@@ -39,20 +40,30 @@ export const ScrollerButton = m(
|
|
|
39
40
|
}
|
|
40
41
|
},
|
|
41
42
|
)
|
|
42
|
-
|
|
43
|
+
|
|
44
|
+
const scale = useMotionValueValue(progress, (v) => v)
|
|
43
45
|
|
|
44
46
|
return (
|
|
45
|
-
<m.div ref={ref}
|
|
47
|
+
<m.div ref={ref} layout={layout}>
|
|
46
48
|
<Fab
|
|
47
49
|
type='button'
|
|
48
50
|
size='small'
|
|
49
51
|
{...buttonProps}
|
|
50
52
|
onClick={handleClick}
|
|
51
53
|
aria-label={direction}
|
|
52
|
-
sx={[
|
|
54
|
+
sx={[
|
|
55
|
+
{
|
|
56
|
+
display: { xs: 'none', md: 'flex' },
|
|
57
|
+
transition: 'all 250ms',
|
|
58
|
+
opacity: scale,
|
|
59
|
+
transform: `scale(${scale})`,
|
|
60
|
+
},
|
|
61
|
+
...(Array.isArray(sx) ? sx : [sx]),
|
|
62
|
+
]}
|
|
53
63
|
/>
|
|
54
64
|
</m.div>
|
|
55
65
|
)
|
|
56
66
|
}),
|
|
57
67
|
)
|
|
68
|
+
|
|
58
69
|
ScrollerButton.displayName = 'ScrollerButton'
|
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": "2.1.
|
|
5
|
+
"version": "2.1.15",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "tsc -W"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@graphcommerce/framer-utils": "3.1.3",
|
|
19
19
|
"@graphcommerce/image": "3.1.6",
|
|
20
|
-
"@graphcommerce/next-ui": "4.8.
|
|
20
|
+
"@graphcommerce/next-ui": "4.8.4"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@graphcommerce/eslint-config-pwa": "^4.1.7",
|