@graphcommerce/framer-scroller 1.1.19 → 1.1.20
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 +12 -0
- package/components/MotionImageAspect.tsx +26 -16
- package/hooks/useScroller.ts +4 -0
- package/index.ts +0 -1
- package/package.json +3 -3
- package/components/CenterSlide.tsx +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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.20](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@1.1.19...@graphcommerce/framer-scroller@1.1.20) (2021-12-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **framer-scroller:** gallery didn't align images in the center ([0cf6066](https://github.com/ho-nl/m2-pwa/commit/0cf60669b2547d2c421eb07c1ba23d7718df74aa))
|
|
12
|
+
* **framer-scroller:** offaxis scroll was allowed on safari ([4ece409](https://github.com/ho-nl/m2-pwa/commit/4ece409fabad7e686d491cc6bc1682c4507f2d3b))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
## [1.1.17](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@1.1.16...@graphcommerce/framer-scroller@1.1.17) (2021-12-21)
|
|
7
19
|
|
|
8
20
|
|
|
@@ -6,13 +6,22 @@ import React, { forwardRef } from 'react'
|
|
|
6
6
|
|
|
7
7
|
const useStyles = makeStyles(
|
|
8
8
|
{
|
|
9
|
+
root: {
|
|
10
|
+
position: 'relative',
|
|
11
|
+
},
|
|
9
12
|
picture: {
|
|
10
13
|
display: 'block',
|
|
11
14
|
'@supports (aspect-ratio: 1 / 1)': {
|
|
12
|
-
maxWidth: '
|
|
13
|
-
maxHeight: '
|
|
14
|
-
width: 'auto
|
|
15
|
-
height: 'auto
|
|
15
|
+
maxWidth: '99.6%',
|
|
16
|
+
maxHeight: '99.6%',
|
|
17
|
+
width: 'auto',
|
|
18
|
+
height: 'auto',
|
|
19
|
+
|
|
20
|
+
position: 'absolute',
|
|
21
|
+
top: '50%',
|
|
22
|
+
left: '50%',
|
|
23
|
+
transform: 'translate(-50%, -50%)',
|
|
24
|
+
|
|
16
25
|
'&:after': {
|
|
17
26
|
display: 'block',
|
|
18
27
|
content: '""',
|
|
@@ -40,23 +49,24 @@ export type MotionImageAspectProps = Omit<ImageProps, 'layout' | 'unoptimized'>
|
|
|
40
49
|
* - Renders an image with the given aspect ratio
|
|
41
50
|
* - Supports framer motion layout transitions
|
|
42
51
|
*
|
|
43
|
-
* Note: We have a fallback for Safari which doesn't yet support aspect-ratio, this causes a
|
|
44
|
-
* when the layout is animated. Should be fixed in Safari 15
|
|
52
|
+
* Note: We have a fallback for Safari 14 which doesn't yet support aspect-ratio, this causes a
|
|
53
|
+
* problem when the layout is animated. Should be fixed in Safari 15
|
|
45
54
|
*/
|
|
46
55
|
const MotionImageAspect = m(
|
|
47
56
|
forwardRef<HTMLImageElement, MotionImageAspectProps>((props, ref) => {
|
|
48
57
|
const classes = useStyles()
|
|
49
58
|
return (
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
<div className={classes.root} ref={ref}>
|
|
60
|
+
<Image
|
|
61
|
+
{...props}
|
|
62
|
+
layout='fill'
|
|
63
|
+
className={clsx(classes.image, props.className)}
|
|
64
|
+
pictureProps={{
|
|
65
|
+
className: clsx(classes.picture, props.pictureProps?.className),
|
|
66
|
+
style: { ...props.style, aspectRatio: `${props.width} / ${props.height}` },
|
|
67
|
+
}}
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
60
70
|
)
|
|
61
71
|
}),
|
|
62
72
|
)
|
package/hooks/useScroller.ts
CHANGED
|
@@ -40,24 +40,28 @@ const useStyles = makeStyles(
|
|
|
40
40
|
rootSmSnapDirBlock: {
|
|
41
41
|
[theme.breakpoints.down('sm')]: {
|
|
42
42
|
overflowY: 'auto',
|
|
43
|
+
overflowX: 'hidden',
|
|
43
44
|
overscrollBehaviorBlock: 'contain',
|
|
44
45
|
},
|
|
45
46
|
},
|
|
46
47
|
rootMdSnapDirBlock: {
|
|
47
48
|
[theme.breakpoints.up('md')]: {
|
|
48
49
|
overflowY: 'auto',
|
|
50
|
+
overflowX: 'hidden',
|
|
49
51
|
overscrollBehaviorBlock: 'contain',
|
|
50
52
|
},
|
|
51
53
|
},
|
|
52
54
|
rootSmSnapDirInline: {
|
|
53
55
|
[theme.breakpoints.down('sm')]: {
|
|
54
56
|
overflowX: 'auto',
|
|
57
|
+
overflowY: 'hidden',
|
|
55
58
|
overscrollBehaviorInline: 'contain',
|
|
56
59
|
},
|
|
57
60
|
},
|
|
58
61
|
rootMdSnapDirInline: {
|
|
59
62
|
[theme.breakpoints.up('md')]: {
|
|
60
63
|
overflowX: 'auto',
|
|
64
|
+
overflowY: 'hidden',
|
|
61
65
|
overscrollBehaviorInline: 'contain',
|
|
62
66
|
},
|
|
63
67
|
},
|
package/index.ts
CHANGED
|
@@ -4,7 +4,6 @@ export * from './components/MotionImageAspect'
|
|
|
4
4
|
export { default as MotionImageAspect } from './components/MotionImageAspect'
|
|
5
5
|
|
|
6
6
|
export { default as Scroller } from './components/Scroller'
|
|
7
|
-
export { default as CenterSlide } from './components/CenterSlide'
|
|
8
7
|
|
|
9
8
|
export * from './components/ScrollerButton'
|
|
10
9
|
export { default as ScrollerButton } from './components/ScrollerButton'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/framer-scroller",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.20",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "tsc -W"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@graphcommerce/framer-utils": "^2.103.20",
|
|
20
20
|
"@graphcommerce/image": "^2.105.11",
|
|
21
|
-
"@graphcommerce/next-ui": "^3.21.
|
|
21
|
+
"@graphcommerce/next-ui": "^3.21.10",
|
|
22
22
|
"@material-ui/core": "^4.12.3",
|
|
23
23
|
"popmotion": "11.0.3"
|
|
24
24
|
},
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"react-dom": "^17.0.2",
|
|
37
37
|
"type-fest": "^2.8.0"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "c8ce20cffa0bf8fe47fa75d98c97d8c5d684c485"
|
|
40
40
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { styled } from '@material-ui/core'
|
|
2
|
-
|
|
3
|
-
const CenterSlide = styled('div')(
|
|
4
|
-
{
|
|
5
|
-
display: 'flex',
|
|
6
|
-
alignItems: 'center',
|
|
7
|
-
justifyContent: 'center',
|
|
8
|
-
},
|
|
9
|
-
{ name: 'CenterSlide' },
|
|
10
|
-
)
|
|
11
|
-
CenterSlide.displayName = 'CenterSlide'
|
|
12
|
-
|
|
13
|
-
export default CenterSlide
|