@graphcommerce/next-ui 6.2.0-canary.63 → 6.2.0-canary.65
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.2.0-canary.65
|
|
4
|
+
|
|
5
|
+
## 6.2.0-canary.64
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- [#1998](https://github.com/graphcommerce-org/graphcommerce/pull/1998) [`fdbdcb76f`](https://github.com/graphcommerce-org/graphcommerce/commit/fdbdcb76f918cf74b22253bd641a04c490ceb140) - Fixed users accidentally being able to scroll overlays out of view during open animation ([@bramvanderholst](https://github.com/bramvanderholst))
|
|
10
|
+
|
|
3
11
|
## 6.2.0-canary.63
|
|
4
12
|
|
|
5
13
|
## 6.2.0-canary.62
|
|
@@ -48,6 +48,7 @@ export type SidebarGalleryProps = {
|
|
|
48
48
|
aspectRatio?: [number, number]
|
|
49
49
|
routeHash?: string
|
|
50
50
|
sx?: SxProps<Theme>
|
|
51
|
+
disableZoom?: boolean
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
export function SidebarGallery(props: SidebarGalleryProps) {
|
|
@@ -57,6 +58,7 @@ export function SidebarGallery(props: SidebarGalleryProps) {
|
|
|
57
58
|
aspectRatio: [width, height] = [1, 1],
|
|
58
59
|
sx,
|
|
59
60
|
routeHash = 'gallery',
|
|
61
|
+
disableZoom,
|
|
60
62
|
} = props
|
|
61
63
|
|
|
62
64
|
const router = useRouter()
|
|
@@ -76,6 +78,9 @@ export function SidebarGallery(props: SidebarGalleryProps) {
|
|
|
76
78
|
}, [prevRoute?.pathname, route, router, zoomed])
|
|
77
79
|
|
|
78
80
|
const toggle = () => {
|
|
81
|
+
if (disableZoom) {
|
|
82
|
+
return
|
|
83
|
+
}
|
|
79
84
|
if (!zoomed) {
|
|
80
85
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
81
86
|
router.push(route, undefined, { shallow: true })
|
|
@@ -192,7 +197,7 @@ export function SidebarGallery(props: SidebarGalleryProps) {
|
|
|
192
197
|
height: '100%',
|
|
193
198
|
gridAutoColumns: `100%`,
|
|
194
199
|
gridTemplateRows: `100%`,
|
|
195
|
-
cursor: 'zoom-in',
|
|
200
|
+
cursor: disableZoom ? 'auto' : 'zoom-in',
|
|
196
201
|
},
|
|
197
202
|
zoomed && {
|
|
198
203
|
height: `var(--client-size-y)`,
|
|
@@ -232,16 +237,22 @@ export function SidebarGallery(props: SidebarGalleryProps) {
|
|
|
232
237
|
right: theme.spacings.sm,
|
|
233
238
|
}}
|
|
234
239
|
>
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
240
|
+
{!disableZoom && (
|
|
241
|
+
<Fab
|
|
242
|
+
size='small'
|
|
243
|
+
className={classes.toggleIcon}
|
|
244
|
+
disabled={!hasImages}
|
|
245
|
+
onMouseUp={toggle}
|
|
246
|
+
aria-label='Toggle Fullscreen'
|
|
247
|
+
sx={{ boxShadow: 6 }}
|
|
248
|
+
>
|
|
249
|
+
{!zoomed ? (
|
|
250
|
+
<IconSvg src={iconFullscreen} />
|
|
251
|
+
) : (
|
|
252
|
+
<IconSvg src={iconFullscreenExit} />
|
|
253
|
+
)}
|
|
254
|
+
</Fab>
|
|
255
|
+
)}
|
|
245
256
|
</MotionBox>
|
|
246
257
|
<Box
|
|
247
258
|
className={classes.centerLeft}
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
useMotionValue,
|
|
16
16
|
useTransform,
|
|
17
17
|
} from 'framer-motion'
|
|
18
|
-
import framesync from 'framesync'
|
|
19
18
|
import React, { useCallback, useEffect, useRef } from 'react'
|
|
20
19
|
import { LayoutProvider } from '../../Layout/components/LayoutProvider'
|
|
21
20
|
import { ExtendableComponent, extendableComponent } from '../../Styles'
|
|
@@ -196,7 +195,7 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
|
|
|
196
195
|
scroller.scrollLeft = scroll.x.getPrevious()
|
|
197
196
|
scroller.scrollTop = scroll.y.getPrevious()
|
|
198
197
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
199
|
-
scrollTo(openClosePositions().open)
|
|
198
|
+
scrollTo(openClosePositions().open, { stopAnimationOnScroll: false })
|
|
200
199
|
}
|
|
201
200
|
}
|
|
202
201
|
|
|
@@ -281,7 +280,9 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
|
|
|
281
280
|
|
|
282
281
|
if (position.get() !== OverlayPosition.OPENED && !scroll.animating.get()) {
|
|
283
282
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
284
|
-
scrollTo(openClosePositions().open).then(() =>
|
|
283
|
+
scrollTo(openClosePositions().open, { stopAnimationOnScroll: false }).then(() =>
|
|
284
|
+
position.set(OverlayPosition.OPENED),
|
|
285
|
+
)
|
|
285
286
|
}
|
|
286
287
|
}, [isPresent, openClosePositions, position, scroll.animating, scrollTo, scrollerRef, variant])
|
|
287
288
|
|
|
@@ -291,7 +292,7 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
|
|
|
291
292
|
if (isPresent || !scroller) return
|
|
292
293
|
|
|
293
294
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
294
|
-
scrollTo(openClosePositions().closed).then(() => {
|
|
295
|
+
scrollTo(openClosePositions().closed, { stopAnimationOnScroll: false }).then(() => {
|
|
295
296
|
safeToRemove?.()
|
|
296
297
|
document.body.style.overflow = ''
|
|
297
298
|
})
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/next-ui",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "6.2.0-canary.
|
|
5
|
+
"version": "6.2.0-canary.65",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"sideEffects": false,
|
|
@@ -18,18 +18,18 @@
|
|
|
18
18
|
"@emotion/react": "^11.11.1",
|
|
19
19
|
"@emotion/server": "^11.11.0",
|
|
20
20
|
"@emotion/styled": "^11.11.0",
|
|
21
|
-
"@graphcommerce/framer-next-pages": "6.2.0-canary.
|
|
22
|
-
"@graphcommerce/framer-scroller": "6.2.0-canary.
|
|
23
|
-
"@graphcommerce/framer-utils": "6.2.0-canary.
|
|
24
|
-
"@graphcommerce/image": "6.2.0-canary.
|
|
21
|
+
"@graphcommerce/framer-next-pages": "6.2.0-canary.65",
|
|
22
|
+
"@graphcommerce/framer-scroller": "6.2.0-canary.65",
|
|
23
|
+
"@graphcommerce/framer-utils": "6.2.0-canary.65",
|
|
24
|
+
"@graphcommerce/image": "6.2.0-canary.65",
|
|
25
25
|
"cookie": "^0.5.0",
|
|
26
26
|
"react-is": "^18.2.0",
|
|
27
27
|
"schema-dts": "^1.1.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.
|
|
31
|
-
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.
|
|
32
|
-
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.
|
|
30
|
+
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.65",
|
|
31
|
+
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.65",
|
|
32
|
+
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.65",
|
|
33
33
|
"@types/cookie": "^0.5.1",
|
|
34
34
|
"@types/react-is": "^18.2.0",
|
|
35
35
|
"typescript": "5.1.3"
|