@graphcommerce/next-ui 6.2.0-canary.70 → 6.2.0-canary.72
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 +8 -0
- package/Overlay/components/OverlayBase.tsx +22 -3
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 6.2.0-canary.72
|
|
4
|
+
|
|
5
|
+
## 6.2.0-canary.71
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- [#1980](https://github.com/graphcommerce-org/graphcommerce/pull/1980) [`275aaaba3`](https://github.com/graphcommerce-org/graphcommerce/commit/275aaaba34c9db1705183393c4327e8f16b09386) - Fixed overlays closing while still dragging - overlays should only close after releasing pointer ([@bramvanderholst](https://github.com/bramvanderholst))
|
|
10
|
+
|
|
3
11
|
## 6.2.0-canary.70
|
|
4
12
|
|
|
5
13
|
## 6.2.0-canary.69
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
motionValue,
|
|
14
14
|
useDomEvent,
|
|
15
15
|
useMotionValue,
|
|
16
|
+
useMotionValueEvent,
|
|
16
17
|
useTransform,
|
|
17
18
|
} from 'framer-motion'
|
|
18
19
|
import React, { useCallback, useEffect, useRef } from 'react'
|
|
@@ -312,10 +313,28 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
|
|
|
312
313
|
}
|
|
313
314
|
useDomEvent(windowRef, 'keyup', handleEscape, { passive: true })
|
|
314
315
|
|
|
316
|
+
const dragging = useMotionValue(false)
|
|
317
|
+
const scrollerElementRef = scrollerRef as React.RefObject<HTMLElement>
|
|
318
|
+
|
|
319
|
+
const handleDragStart = () => {
|
|
320
|
+
dragging.set(true)
|
|
321
|
+
}
|
|
322
|
+
const handleDragEnd = () => {
|
|
323
|
+
dragging.set(false)
|
|
324
|
+
// When releasing pointer and visibility 0 (overlay is dragged offscreen), close the overlay
|
|
325
|
+
if (positions.open.visible.get() === 0) closeOverlay()
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
useDomEvent(scrollerElementRef, 'pointerdown', handleDragStart, { passive: true })
|
|
329
|
+
useDomEvent(scrollerElementRef, 'pointerup', handleDragEnd, { passive: true })
|
|
330
|
+
// We use touchend as well as pointerup, because scrolling (dragging the overlay) on mobile causes pointercancel to fire, preventing pointerup from ever firing
|
|
331
|
+
useDomEvent(scrollerElementRef, 'touchend', handleDragEnd, { passive: true })
|
|
332
|
+
|
|
315
333
|
// When the overlay isn't visible anymore, we navigate back.
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
334
|
+
useMotionValueEvent(
|
|
335
|
+
positions.open.visible,
|
|
336
|
+
'change',
|
|
337
|
+
(o) => o === 0 && !dragging.get() && closeOverlay(),
|
|
319
338
|
)
|
|
320
339
|
|
|
321
340
|
// Measure the offset of the overlay in the scroller.
|
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.72",
|
|
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.72",
|
|
22
|
+
"@graphcommerce/framer-scroller": "6.2.0-canary.72",
|
|
23
|
+
"@graphcommerce/framer-utils": "6.2.0-canary.72",
|
|
24
|
+
"@graphcommerce/image": "6.2.0-canary.72",
|
|
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.72",
|
|
31
|
+
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.72",
|
|
32
|
+
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.72",
|
|
33
33
|
"@types/cookie": "^0.5.1",
|
|
34
34
|
"@types/react-is": "^18.2.0",
|
|
35
35
|
"typescript": "5.1.3"
|