@graphcommerce/next-ui 3.13.2 → 3.14.0

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.
@@ -11,7 +11,7 @@ import {
11
11
  import { m } from 'framer-motion'
12
12
  import PageLink from 'next/link'
13
13
  import { Router, useRouter } from 'next/router'
14
- import React from 'react'
14
+ import React, { useEffect } from 'react'
15
15
  import { UseStyles } from '../Styles'
16
16
  import responsiveVal from '../Styles/responsiveVal'
17
17
  import SvgImageSimple from '../SvgImage/SvgImageSimple'
@@ -81,7 +81,11 @@ export default function MenuFab(props: MenuFabProps) {
81
81
 
82
82
  const { filter, opacity, scale } = useFabAnimation()
83
83
 
84
- Router.events.on('routeChangeStart', () => setOpenEl(null))
84
+ useEffect(() => {
85
+ const clear = () => setOpenEl(null)
86
+ router.events.on('routeChangeStart', clear)
87
+ return () => router.events.off('routeChangeStart', clear)
88
+ }, [router])
85
89
 
86
90
  return (
87
91
  <m.div className={classes.menuWrapper} style={{ opacity, scale, filter }}>
@@ -60,7 +60,7 @@ function SheetShellBase(props: SheetShellBaseProps) {
60
60
  const sheetClasses = useSheetStyles(props)
61
61
  const router = useRouter()
62
62
  const pageRouter = usePageRouter()
63
- const { depth, closeSteps, active } = usePageContext()
63
+ const { depth, closeSteps, active, direction } = usePageContext()
64
64
  const open = depth < 0 || router.asPath === pageRouter.asPath
65
65
  const initialLocale = useRef(router.locale)
66
66
 
@@ -95,7 +95,7 @@ function SheetShellBase(props: SheetShellBaseProps) {
95
95
  <Sheet open={open} onSnap={handleSnap} variant={variant} size={size}>
96
96
  <SheetBackdrop onTap={handleClose} classes={sheetClasses} />
97
97
  <SheetContainer classes={sheetContainerClasses}>
98
- <SheetPanel classes={sheetClasses}>
98
+ <SheetPanel initial={direction === -1 ? 'snapPoint1' : 'closed'} classes={sheetClasses}>
99
99
  {/* <FocusLock returnFocus={{ preventScroll: true }} disabled={!isActive}> */}
100
100
  {children}
101
101
  {/* </FocusLock> */}
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
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
+ # [3.14.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.13.2...@graphcommerce/next-ui@3.14.0) (2021-11-04)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **menu-fab:** fix route change start event handling ([20dde65](https://github.com/ho-nl/m2-pwa/commit/20dde65f8e8ead449b21f4f5292d653d003e6ead))
12
+
13
+
14
+ ### Features
15
+
16
+ * **sheet-shell-base:** stop animating drawer on browser back ([c6262f1](https://github.com/ho-nl/m2-pwa/commit/c6262f1c3a0d181e57bd5d4971efb469901503b1))
17
+
18
+
19
+
20
+
21
+
6
22
  ## [3.13.2](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.13.1...@graphcommerce/next-ui@3.13.2) (2021-11-03)
7
23
 
8
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphcommerce/next-ui",
3
- "version": "3.13.2",
3
+ "version": "3.14.0",
4
4
  "author": "",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -12,7 +12,7 @@
12
12
  "@apollo/client": "^3.4.16",
13
13
  "@graphcommerce/framer-next-pages": "^2.107.3",
14
14
  "@graphcommerce/framer-scroller": "^1.0.2",
15
- "@graphcommerce/framer-sheet": "^2.105.15",
15
+ "@graphcommerce/framer-sheet": "^2.106.0",
16
16
  "@graphcommerce/framer-utils": "^2.103.13",
17
17
  "@graphcommerce/graphql": "^2.105.3",
18
18
  "@graphcommerce/image": "^2.105.2",
@@ -53,5 +53,5 @@
53
53
  "project": "./tsconfig.json"
54
54
  }
55
55
  },
56
- "gitHead": "db0c7ff1a81b75e4e6eeee3717a1fc608d9c3c86"
56
+ "gitHead": "2da9f0e580a1eddf4203a375ccd1444c40401db1"
57
57
  }