@graphcommerce/next-ui 6.0.0-canary.39 → 6.0.0-canary.40

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,7 @@
1
1
  # Change Log
2
2
 
3
+ ## 6.0.0-canary.40
4
+
3
5
  ## 6.0.0-canary.39
4
6
 
5
7
  ### Patch Changes
@@ -190,6 +190,9 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
190
190
  }
191
191
 
192
192
  const handleScroll = () => {
193
+ calcPositions()
194
+
195
+ // if (!prevVariant.current) prevVariant.current = variant()
193
196
  if (prevVariant.current !== variant()) {
194
197
  forceScrollPosition()
195
198
  prevVariant.current = variant()
@@ -199,20 +202,27 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
199
202
  }
200
203
  }
201
204
 
202
- calcPositions()
205
+ const handleResize = () => {
206
+ calcPositions()
207
+ forceScrollPosition()
208
+ }
209
+
210
+ const measureScroll = () => framesync.read(handleScroll)
211
+ const measureResize = () => framesync.read(handleResize)
203
212
  handleScroll()
204
213
 
205
- const cancelX = scroll.x.on('change', () => framesync.read(handleScroll))
206
- const cancelY = scroll.y.on('change', () => framesync.read(handleScroll))
214
+ const cancelX = scroll.x.on('change', measureScroll)
215
+ const cancelY = scroll.y.on('change', measureScroll)
207
216
 
208
- const ro = new ResizeObserver(() => {
209
- calcPositions()
210
- forceScrollPosition()
211
- })
217
+ const ro = new ResizeObserver(measureResize)
212
218
  ro.observe(scrollerRef.current)
219
+ ro.observe(beforeRef.current)
213
220
  ro.observe(overlayPaneRef.current)
221
+ ro.observe(overlayRef.current)
214
222
 
223
+ window.addEventListener('resize', measureResize)
215
224
  return () => {
225
+ window.removeEventListener('resize', measureResize)
216
226
  ro.disconnect()
217
227
  cancelX()
218
228
  cancelY()
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.0.0-canary.39",
5
+ "version": "6.0.0-canary.40",
6
6
  "author": "",
7
7
  "license": "MIT",
8
8
  "sideEffects": false,
@@ -18,18 +18,18 @@
18
18
  "@emotion/react": "^11.10.6",
19
19
  "@emotion/server": "^11.4.0",
20
20
  "@emotion/styled": "^11.10.6",
21
- "@graphcommerce/framer-next-pages": "6.0.0-canary.39",
22
- "@graphcommerce/framer-scroller": "6.0.0-canary.39",
23
- "@graphcommerce/framer-utils": "6.0.0-canary.39",
24
- "@graphcommerce/image": "6.0.0-canary.39",
21
+ "@graphcommerce/framer-next-pages": "6.0.0-canary.40",
22
+ "@graphcommerce/framer-scroller": "6.0.0-canary.40",
23
+ "@graphcommerce/framer-utils": "6.0.0-canary.40",
24
+ "@graphcommerce/image": "6.0.0-canary.40",
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.0.0-canary.39",
31
- "@graphcommerce/prettier-config-pwa": "6.0.0-canary.39",
32
- "@graphcommerce/typescript-config-pwa": "6.0.0-canary.39",
30
+ "@graphcommerce/eslint-config-pwa": "6.0.0-canary.40",
31
+ "@graphcommerce/prettier-config-pwa": "6.0.0-canary.40",
32
+ "@graphcommerce/typescript-config-pwa": "6.0.0-canary.40",
33
33
  "@types/cookie": "^0.5.1",
34
34
  "@types/react-is": "^17.0.3",
35
35
  "typescript": "4.9.5"