@graphcommerce/framer-next-pages 8.1.0-canary.3 → 8.1.0-canary.30

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,8 +1,128 @@
1
1
  # Change Log
2
2
 
3
- ## 8.1.0-canary.3
3
+ ## 8.1.0-canary.30
4
4
 
5
- ## 8.1.0-canary.2
5
+ ## 8.1.0-canary.29
6
+
7
+ ## 8.1.0-canary.28
8
+
9
+ ## 8.1.0-canary.27
10
+
11
+ ## 8.1.0-canary.26
12
+
13
+ ## 8.1.0-canary.25
14
+
15
+ ## 8.1.0-canary.24
16
+
17
+ ## 8.1.0-canary.23
18
+
19
+ ## 8.1.0-canary.22
20
+
21
+ ## 8.1.0-canary.21
22
+
23
+ ## 8.1.0-canary.20
24
+
25
+ ## 8.1.0-canary.19
26
+
27
+ ## 8.1.0-canary.18
28
+
29
+ ## 8.1.0-canary.17
30
+
31
+ ## 8.1.0-canary.16
32
+
33
+ ## 8.1.0-canary.15
34
+
35
+ ## 8.1.0-canary.14
36
+
37
+ ## 8.1.0-canary.13
38
+
39
+ ## 8.1.0-canary.12
40
+
41
+ ## 8.1.0-canary.11
42
+
43
+ ## 8.1.0-canary.10
44
+
45
+ ## 8.1.0-canary.9
46
+
47
+ ## 8.1.0-canary.8
48
+
49
+ ## 8.1.0-canary.7
50
+
51
+ ## 8.1.0-canary.6
52
+
53
+ ## 8.1.0-canary.5
54
+
55
+ ## 8.0.6-canary.4
56
+
57
+ ## 8.0.6-canary.3
58
+
59
+ ## 8.0.6-canary.2
60
+
61
+ ## 8.0.6-canary.1
62
+
63
+ ## 8.0.6-canary.0
64
+
65
+ ## 8.0.5
66
+
67
+ ### Patch Changes
68
+
69
+ - [#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
70
+ ([@paales](https://github.com/paales))
71
+
72
+ ## 8.0.5-canary.10
73
+
74
+ ## 8.0.5-canary.9
75
+
76
+ ## 8.0.5-canary.8
77
+
78
+ ## 8.0.5-canary.7
79
+
80
+ ## 8.0.5-canary.6
81
+
82
+ ## 8.0.5-canary.5
83
+
84
+ ## 8.0.5-canary.4
85
+
86
+ ## 8.0.5-canary.3
87
+
88
+ ### Patch Changes
89
+
90
+ - [#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
91
+ ([@paales](https://github.com/paales))
92
+
93
+ ## 8.0.5-canary.2
94
+
95
+ ## 8.0.5-canary.1
96
+
97
+ ## 8.0.5-canary.0
98
+
99
+ ## 8.0.4
100
+
101
+ ### Patch Changes
102
+
103
+ - [#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
104
+ ([@carlocarels90](https://github.com/carlocarels90))
105
+
106
+ ## 8.0.4-canary.1
107
+
108
+ ## 8.0.4-canary.0
109
+
110
+ ### Patch Changes
111
+
112
+ - [#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
113
+ ([@carlocarels90](https://github.com/carlocarels90))
114
+
115
+ ## 8.0.3
116
+
117
+ ## 8.0.3-canary.6
118
+
119
+ ## 8.0.3-canary.5
120
+
121
+ ## 8.0.3-canary.4
122
+
123
+ ## 8.0.3-canary.3
124
+
125
+ ## 8.0.3-canary.2
6
126
 
7
127
  ## 8.0.3-canary.1
8
128
 
@@ -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
  >
@@ -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._key as string
49
+ const key = (router as NextRouter & { _key: string })._key
51
50
 
52
51
  useMeasureDynamicViewportSize()
53
52
  const items = useRef<PageItem[]>([])
@@ -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
- href === prevRouter?.asPath
15
- ? (e: ClickEvent) => {
16
- e.preventDefault()
17
- router.back()
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, href } = useHistoryLink(options)
26
- const router = useRouter()
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.3",
5
+ "version": "8.1.0-canary.30",
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.3",
16
- "@graphcommerce/framer-utils": "^8.1.0-canary.3",
17
- "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.3",
18
- "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.3",
15
+ "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.30",
16
+ "@graphcommerce/framer-utils": "^8.1.0-canary.30",
17
+ "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.30",
18
+ "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.30",
19
19
  "framer-motion": "^10.0.0",
20
20
  "next": "*",
21
21
  "react": "^18.2.0",