@graphcommerce/framer-next-pages 8.1.0-canary.2 → 8.1.0-canary.22
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 +107 -1
- package/components/Page.tsx +2 -8
- package/components/Pages.tsx +1 -2
- package/hooks/useHistoryLink.ts +8 -15
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,112 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 8.1.0-canary.
|
|
3
|
+
## 8.1.0-canary.22
|
|
4
|
+
|
|
5
|
+
## 8.1.0-canary.21
|
|
6
|
+
|
|
7
|
+
## 8.1.0-canary.20
|
|
8
|
+
|
|
9
|
+
## 8.1.0-canary.19
|
|
10
|
+
|
|
11
|
+
## 8.1.0-canary.18
|
|
12
|
+
|
|
13
|
+
## 8.1.0-canary.17
|
|
14
|
+
|
|
15
|
+
## 8.1.0-canary.16
|
|
16
|
+
|
|
17
|
+
## 8.1.0-canary.15
|
|
18
|
+
|
|
19
|
+
## 8.1.0-canary.14
|
|
20
|
+
|
|
21
|
+
## 8.1.0-canary.13
|
|
22
|
+
|
|
23
|
+
## 8.1.0-canary.12
|
|
24
|
+
|
|
25
|
+
## 8.1.0-canary.11
|
|
26
|
+
|
|
27
|
+
## 8.1.0-canary.10
|
|
28
|
+
|
|
29
|
+
## 8.1.0-canary.9
|
|
30
|
+
|
|
31
|
+
## 8.1.0-canary.8
|
|
32
|
+
|
|
33
|
+
## 8.1.0-canary.7
|
|
34
|
+
|
|
35
|
+
## 8.1.0-canary.6
|
|
36
|
+
|
|
37
|
+
## 8.1.0-canary.5
|
|
38
|
+
|
|
39
|
+
## 8.0.6-canary.4
|
|
40
|
+
|
|
41
|
+
## 8.0.6-canary.3
|
|
42
|
+
|
|
43
|
+
## 8.0.6-canary.2
|
|
44
|
+
|
|
45
|
+
## 8.0.6-canary.1
|
|
46
|
+
|
|
47
|
+
## 8.0.6-canary.0
|
|
48
|
+
|
|
49
|
+
## 8.0.5
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- [#2236](https://github.com/graphcommerce-org/graphcommerce/pull/2236) [`85fb916`](https://github.com/graphcommerce-org/graphcommerce/commit/85fb916e5ec2a1456a93a59bf92a5f414fee8595) - Solve issue where the inert prop wouldnt be properly forwarded
|
|
54
|
+
([@paales](https://github.com/paales))
|
|
55
|
+
|
|
56
|
+
## 8.0.5-canary.10
|
|
57
|
+
|
|
58
|
+
## 8.0.5-canary.9
|
|
59
|
+
|
|
60
|
+
## 8.0.5-canary.8
|
|
61
|
+
|
|
62
|
+
## 8.0.5-canary.7
|
|
63
|
+
|
|
64
|
+
## 8.0.5-canary.6
|
|
65
|
+
|
|
66
|
+
## 8.0.5-canary.5
|
|
67
|
+
|
|
68
|
+
## 8.0.5-canary.4
|
|
69
|
+
|
|
70
|
+
## 8.0.5-canary.3
|
|
71
|
+
|
|
72
|
+
### Patch Changes
|
|
73
|
+
|
|
74
|
+
- [#2236](https://github.com/graphcommerce-org/graphcommerce/pull/2236) [`85fb916`](https://github.com/graphcommerce-org/graphcommerce/commit/85fb916e5ec2a1456a93a59bf92a5f414fee8595) - Solve issue where the inert prop wouldnt be properly forwarded
|
|
75
|
+
([@paales](https://github.com/paales))
|
|
76
|
+
|
|
77
|
+
## 8.0.5-canary.2
|
|
78
|
+
|
|
79
|
+
## 8.0.5-canary.1
|
|
80
|
+
|
|
81
|
+
## 8.0.5-canary.0
|
|
82
|
+
|
|
83
|
+
## 8.0.4
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- [#2228](https://github.com/graphcommerce-org/graphcommerce/pull/2228) [`0c0cacb`](https://github.com/graphcommerce-org/graphcommerce/commit/0c0cacb8725f0a626ea5d3acf154d83c433c3eb7) - apply correct type for the inert property
|
|
88
|
+
([@carlocarels90](https://github.com/carlocarels90))
|
|
89
|
+
|
|
90
|
+
## 8.0.4-canary.1
|
|
91
|
+
|
|
92
|
+
## 8.0.4-canary.0
|
|
93
|
+
|
|
94
|
+
### Patch Changes
|
|
95
|
+
|
|
96
|
+
- [#2228](https://github.com/graphcommerce-org/graphcommerce/pull/2228) [`0c0cacb`](https://github.com/graphcommerce-org/graphcommerce/commit/0c0cacb8725f0a626ea5d3acf154d83c433c3eb7) - apply correct type for the inert property
|
|
97
|
+
([@carlocarels90](https://github.com/carlocarels90))
|
|
98
|
+
|
|
99
|
+
## 8.0.3
|
|
100
|
+
|
|
101
|
+
## 8.0.3-canary.6
|
|
102
|
+
|
|
103
|
+
## 8.0.3-canary.5
|
|
104
|
+
|
|
105
|
+
## 8.0.3-canary.4
|
|
106
|
+
|
|
107
|
+
## 8.0.3-canary.3
|
|
108
|
+
|
|
109
|
+
## 8.0.3-canary.2
|
|
4
110
|
|
|
5
111
|
## 8.0.3-canary.1
|
|
6
112
|
|
package/components/Page.tsx
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { dvh } from '@graphcommerce/framer-utils'
|
|
2
2
|
import { m, useIsPresent } from 'framer-motion'
|
|
3
|
-
import React from 'react'
|
|
3
|
+
import React, { HTMLAttributes } from 'react'
|
|
4
4
|
import type { PageItem } from '../types'
|
|
5
5
|
|
|
6
|
-
declare module 'react' {
|
|
7
|
-
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
|
|
8
|
-
inert?: 'true'
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
6
|
export type PageProps = Pick<PageItem, 'routerKey'> & {
|
|
13
7
|
active: boolean
|
|
14
8
|
children: React.ReactNode
|
|
@@ -42,7 +36,7 @@ export function Page(props: PageProps) {
|
|
|
42
36
|
<m.div
|
|
43
37
|
layoutScroll
|
|
44
38
|
style={{ position, top, zIndex, minHeight: dvh(100), left: 0, right: 0 }}
|
|
45
|
-
inert={!active ? 'true' : undefined}
|
|
39
|
+
inert={!active ? ('true' as unknown as boolean) : undefined}
|
|
46
40
|
data-nosnippet={!active ? true : undefined}
|
|
47
41
|
aria-hidden={!active ? true : undefined}
|
|
48
42
|
>
|
package/components/Pages.tsx
CHANGED
|
@@ -45,9 +45,8 @@ function getPageInfo(router: NextRouter) {
|
|
|
45
45
|
export function FramerNextPages(props: PagesProps) {
|
|
46
46
|
const { router, Component, pageProps: incomingProps, fallback = '/', fallbackRoute = '/' } = props
|
|
47
47
|
|
|
48
|
-
// @ts-expect-error Key of the route is still private, should be fixed in https://github.com/vercel/next.js/pull/37192
|
|
49
48
|
// eslint-disable-next-line no-underscore-dangle
|
|
50
|
-
const key = router
|
|
49
|
+
const key = (router as NextRouter & { _key: string })._key
|
|
51
50
|
|
|
52
51
|
useMeasureDynamicViewportSize()
|
|
53
52
|
const items = useRef<PageItem[]>([])
|
package/hooks/useHistoryLink.ts
CHANGED
|
@@ -10,24 +10,17 @@ export function useHistoryLink(options: UseHistoryLink) {
|
|
|
10
10
|
const prevRouter = usePrevPageRouter()
|
|
11
11
|
const router = useRouter()
|
|
12
12
|
|
|
13
|
-
const onClick =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
: undefined
|
|
13
|
+
const onClick = (e: ClickEvent) => {
|
|
14
|
+
e.preventDefault()
|
|
15
|
+
|
|
16
|
+
if (href === prevRouter?.asPath) return router.back()
|
|
17
|
+
return router.replace(href)
|
|
18
|
+
}
|
|
20
19
|
|
|
21
20
|
return { onClick, href }
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
export function useHistoryGo(options: UseHistoryLink) {
|
|
25
|
-
const { onClick
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return () => {
|
|
29
|
-
if (onClick) onClick({ preventDefault: () => {} })
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
31
|
-
else router.push(href)
|
|
32
|
-
}
|
|
24
|
+
const { onClick } = useHistoryLink(options)
|
|
25
|
+
return () => onClick({ preventDefault: () => {} })
|
|
33
26
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/framer-next-pages",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "8.1.0-canary.
|
|
5
|
+
"version": "8.1.0-canary.22",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "^8.1.0-canary.
|
|
16
|
-
"@graphcommerce/framer-utils": "^8.1.0-canary.
|
|
17
|
-
"@graphcommerce/prettier-config-pwa": "^8.1.0-canary.
|
|
18
|
-
"@graphcommerce/typescript-config-pwa": "^8.1.0-canary.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "^8.1.0-canary.22",
|
|
16
|
+
"@graphcommerce/framer-utils": "^8.1.0-canary.22",
|
|
17
|
+
"@graphcommerce/prettier-config-pwa": "^8.1.0-canary.22",
|
|
18
|
+
"@graphcommerce/typescript-config-pwa": "^8.1.0-canary.22",
|
|
19
19
|
"framer-motion": "^10.0.0",
|
|
20
20
|
"next": "*",
|
|
21
21
|
"react": "^18.2.0",
|