@graphcommerce/next-ui 4.13.0 → 4.13.1

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,21 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.13.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1552](https://github.com/graphcommerce-org/graphcommerce/pull/1552) [`18054c441`](https://github.com/graphcommerce-org/graphcommerce/commit/18054c441962ba750bed3acc39ab46c8d3a341ce) Thanks [@paales](https://github.com/paales)! - Updated to Next.js v12.2.2 and other packages and made compatible
8
+
9
+ * [#1552](https://github.com/graphcommerce-org/graphcommerce/pull/1552) [`c5c539c44`](https://github.com/graphcommerce-org/graphcommerce/commit/c5c539c44eeac524cd62ce649e132d2e00333794) Thanks [@paales](https://github.com/paales)! - Make sure the gallery doesn't scroll when overlays are opened
10
+
11
+ - [#1552](https://github.com/graphcommerce-org/graphcommerce/pull/1552) [`6f69bc54c`](https://github.com/graphcommerce-org/graphcommerce/commit/6f69bc54c6e0224452817c532ae58d9c332b61ea) Thanks [@paales](https://github.com/paales)! - Prevent back button scrolling when navigating between overlays
12
+
13
+ * [#1552](https://github.com/graphcommerce-org/graphcommerce/pull/1552) [`21886d6fa`](https://github.com/graphcommerce-org/graphcommerce/commit/21886d6fa64a48d9e932bfaf8d138c9b13c36e43) Thanks [@paales](https://github.com/paales)! - Fix page stacking and scroll restoration when navigating
14
+
15
+ * Updated dependencies [[`18054c441`](https://github.com/graphcommerce-org/graphcommerce/commit/18054c441962ba750bed3acc39ab46c8d3a341ce), [`21886d6fa`](https://github.com/graphcommerce-org/graphcommerce/commit/21886d6fa64a48d9e932bfaf8d138c9b13c36e43), [`b4936e961`](https://github.com/graphcommerce-org/graphcommerce/commit/b4936e96175fe80717895822e245274db05638bd)]:
16
+ - @graphcommerce/framer-next-pages@3.2.4
17
+ - @graphcommerce/framer-scroller@2.1.23
18
+
3
19
  ## 4.13.0
4
20
 
5
21
  ### Minor Changes
@@ -119,6 +119,7 @@ export function SidebarGallery(props: SidebarGalleryProps) {
119
119
  <Row maxWidth={false} disableGutters className={classes.row} sx={sx}>
120
120
  <MotionBox
121
121
  layout
122
+ layoutDependency={zoomed}
122
123
  className={classes.root}
123
124
  sx={[
124
125
  {
@@ -146,6 +147,7 @@ export function SidebarGallery(props: SidebarGalleryProps) {
146
147
  >
147
148
  <MotionBox
148
149
  layout
150
+ layoutDependency={zoomed}
149
151
  className={classes.scrollerContainer}
150
152
  sx={[
151
153
  {
@@ -193,6 +195,7 @@ export function SidebarGallery(props: SidebarGalleryProps) {
193
195
  <MotionImageAspect
194
196
  key={typeof image.src === 'string' ? image.src : idx}
195
197
  layout
198
+ layoutDependency={zoomed}
196
199
  src={image.src}
197
200
  width={image.width}
198
201
  height={image.height}
@@ -209,6 +212,7 @@ export function SidebarGallery(props: SidebarGalleryProps) {
209
212
  </Scroller>
210
213
  <MotionBox
211
214
  layout
215
+ layoutDependency={zoomed}
212
216
  className={classes.topRight}
213
217
  sx={{
214
218
  display: 'grid',
@@ -243,6 +247,7 @@ export function SidebarGallery(props: SidebarGalleryProps) {
243
247
  >
244
248
  <ScrollerButton
245
249
  layout
250
+ layoutDependency={zoomed}
246
251
  direction='left'
247
252
  size='small'
248
253
  className={classes.sliderButtons}
@@ -262,6 +267,7 @@ export function SidebarGallery(props: SidebarGalleryProps) {
262
267
  >
263
268
  <ScrollerButton
264
269
  layout
270
+ layoutDependency={zoomed}
265
271
  direction='right'
266
272
  size='small'
267
273
  className={classes.sliderButtons}
@@ -286,7 +292,11 @@ export function SidebarGallery(props: SidebarGalleryProps) {
286
292
  },
287
293
  }}
288
294
  >
289
- <ScrollerDots layout sx={{ backgroundColor: 'background.paper', boxShadow: 6 }} />
295
+ <ScrollerDots
296
+ layout
297
+ layoutDependency={zoomed}
298
+ sx={{ backgroundColor: 'background.paper', boxShadow: 6 }}
299
+ />
290
300
  </Box>
291
301
  </MotionBox>
292
302
 
@@ -319,6 +329,7 @@ export function SidebarGallery(props: SidebarGalleryProps) {
319
329
  >
320
330
  <MotionBox
321
331
  layout
332
+ layoutDependency={zoomed}
322
333
  className={classes.sidebar}
323
334
  sx={{
324
335
  boxSizing: 'border-box',
@@ -1,6 +1,6 @@
1
1
  import { useMotionValueValue } from '@graphcommerce/framer-utils'
2
2
  import { Box, styled, SxProps, Theme } from '@mui/material'
3
- import { m } from 'framer-motion'
3
+ import { LayoutProps, m } from 'framer-motion'
4
4
  import React, { useRef } from 'react'
5
5
  import { extendableComponent } from '../../Styles'
6
6
  import { useScrollY } from '../hooks/useScrollY'
@@ -16,6 +16,7 @@ export type LayoutHeaderContentProps = FloatingProps & {
16
16
  switchPoint?: number
17
17
  sx?: SxProps<Theme>
18
18
  sxBg?: SxProps<Theme>
19
+ layout?: LayoutProps['layout']
19
20
  }
20
21
 
21
22
  type OwnerState = { floatingSm: boolean; floatingMd: boolean; scrolled: boolean; divider: boolean }
@@ -36,6 +37,7 @@ export function LayoutHeaderContent(props: LayoutHeaderContentProps) {
36
37
  switchPoint = 50,
37
38
  sx = [],
38
39
  sxBg = [],
40
+ layout,
39
41
  } = props
40
42
 
41
43
  const scroll = useScrollY()
@@ -142,7 +144,7 @@ export function LayoutHeaderContent(props: LayoutHeaderContentProps) {
142
144
  justifyContent: 'start',
143
145
  })}
144
146
  >
145
- <MotionDiv layout='position'>{left}</MotionDiv>
147
+ <MotionDiv layout={layout}>{left}</MotionDiv>
146
148
  </Box>
147
149
  )}
148
150
  <Box
@@ -175,7 +177,7 @@ export function LayoutHeaderContent(props: LayoutHeaderContentProps) {
175
177
  },
176
178
  })}
177
179
  >
178
- <MotionDiv layout='position'>{children}</MotionDiv>
180
+ <MotionDiv layout={layout}>{children}</MotionDiv>
179
181
  </Box>
180
182
  <Box
181
183
  className={classes.right}
@@ -191,7 +193,7 @@ export function LayoutHeaderContent(props: LayoutHeaderContentProps) {
191
193
  justifyContent: 'end',
192
194
  })}
193
195
  >
194
- <MotionDiv layout='position'>{right}</MotionDiv>
196
+ <MotionDiv layout={layout}>{right}</MotionDiv>
195
197
  </Box>
196
198
  {divider && (
197
199
  <Box
@@ -39,8 +39,10 @@ export function LayoutDefault(props: LayoutDefaultProps) {
39
39
  sx = [],
40
40
  } = props
41
41
 
42
- const offset = useScrollOffset().y
43
- const scrollWithOffset = useTransform(useViewportScroll().scrollY, (y) => y + offset)
42
+ const scrollWithOffset = useTransform(
43
+ [useViewportScroll().scrollY, useScrollOffset()],
44
+ ([y, offset]: number[]) => y + offset,
45
+ )
44
46
 
45
47
  const classes = withState({ noSticky })
46
48
 
@@ -1,5 +1,6 @@
1
1
  import { usePageContext, useGo, useScrollOffset } from '@graphcommerce/framer-next-pages'
2
2
  import { ScrollerProvider, ScrollSnapType } from '@graphcommerce/framer-scroller'
3
+ import { useMotionValueValue } from '@graphcommerce/framer-utils'
3
4
  import { usePresence } from 'framer-motion'
4
5
  import type { SetOptional } from 'type-fest'
5
6
  import { OverlayBase, LayoutOverlayBaseProps } from '../../Overlay/components/OverlayBase'
@@ -19,7 +20,7 @@ export function LayoutOverlay(props: LayoutOverlayProps) {
19
20
 
20
21
  const { closeSteps, active, direction } = usePageContext()
21
22
  const onCloseHandler = useGo(closeSteps * -1)
22
- const offsetPageY = useScrollOffset().y
23
+ const offsetPageY = useMotionValueValue(useScrollOffset(), (v) => v)
23
24
  const [isPresent, safeToRemove] = usePresence()
24
25
 
25
26
  return (
@@ -105,6 +105,7 @@ export function NavigationOverlay(props: NavigationOverlayProps) {
105
105
  floatingMd={false}
106
106
  floatingSm={false}
107
107
  switchPoint={0}
108
+ layout='position'
108
109
  left={
109
110
  showBack && (
110
111
  <Fab
@@ -1,10 +1,8 @@
1
1
  import { usePageContext } from '@graphcommerce/framer-next-pages'
2
- import {
3
- resolveHref,
4
- addBasePath,
5
- addLocale,
6
- getDomainLocale,
7
- } from 'next/dist/shared/lib/router/router'
2
+ import { addBasePath } from 'next/dist/client/add-base-path'
3
+ import { addLocale } from 'next/dist/client/add-locale'
4
+ import { getDomainLocale } from 'next/dist/client/get-domain-locale'
5
+ import { resolveHref } from 'next/dist/shared/lib/router/router'
8
6
  import Head from 'next/head'
9
7
  import { useRouter } from 'next/router'
10
8
 
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": "4.13.0",
5
+ "version": "4.13.1",
6
6
  "author": "",
7
7
  "license": "MIT",
8
8
  "sideEffects": false,
@@ -15,15 +15,15 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@emotion/babel-preset-css-prop": "^11.2.0",
18
- "@emotion/cache": "^11.7.1",
19
- "@emotion/react": "^11.9.0",
18
+ "@emotion/cache": "^11.9.3",
19
+ "@emotion/react": "^11.9.3",
20
20
  "@emotion/server": "^11.4.0",
21
- "@emotion/styled": "^11.6.0",
22
- "@graphcommerce/framer-next-pages": "3.2.3",
23
- "@graphcommerce/framer-scroller": "2.1.22",
21
+ "@emotion/styled": "^11.9.3",
22
+ "@graphcommerce/framer-next-pages": "3.2.4",
23
+ "@graphcommerce/framer-scroller": "2.1.23",
24
24
  "@graphcommerce/framer-utils": "3.1.4",
25
25
  "@graphcommerce/image": "3.1.7",
26
- "react-is": "^18.1.0",
26
+ "react-is": "^18.2.0",
27
27
  "react-schemaorg": "^2.0.0",
28
28
  "schema-dts": "^1.1.0"
29
29
  },
@@ -38,12 +38,12 @@
38
38
  "react-dom": "^18.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@graphcommerce/eslint-config-pwa": "^4.1.8",
41
+ "@graphcommerce/eslint-config-pwa": "^4.1.9",
42
42
  "@graphcommerce/prettier-config-pwa": "^4.0.6",
43
- "@graphcommerce/typescript-config-pwa": "^4.0.3",
43
+ "@graphcommerce/typescript-config-pwa": "^4.0.4",
44
44
  "@playwright/test": "^1.21.1",
45
45
  "@types/react-is": "^17.0.3",
46
46
  "type-fest": "^2.12.2",
47
- "typescript": "4.7.3"
47
+ "typescript": "4.7.4"
48
48
  }
49
49
  }