@graphcommerce/framer-next-pages 9.0.0-canary.77 → 9.0.0-canary.79

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,13 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.0-canary.79
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2356](https://github.com/graphcommerce-org/graphcommerce/pull/2356) [`d283901`](https://github.com/graphcommerce-org/graphcommerce/commit/d283901cb537c3e7bf6f5500e9f52f47f452cf10) - Loading an overlay page directly would animate in the overlay instead of directly showing it. ([@paales](https://github.com/paales))
8
+
9
+ ## 9.0.0-canary.78
10
+
3
11
  ## 9.0.0-canary.77
4
12
 
5
13
  ## 9.0.0-canary.76
@@ -5,7 +5,7 @@ import { PrivateRouteInfo } from 'next/dist/shared/lib/router/router'
5
5
  import { AppPropsType } from 'next/dist/shared/lib/utils'
6
6
  import { NextRouter, Router } from 'next/router'
7
7
  import { useEffect, useRef, useState } from 'react'
8
- import { pageContext } from '../context/pageContext'
8
+ import { Direction, pageContext } from '../context/pageContext'
9
9
  import type { PageComponent, PageItem, UpPage } from '../types'
10
10
  import { Page } from './Page'
11
11
  import { PageRenderer } from './PageRenderer'
@@ -56,7 +56,8 @@ export function FramerNextPages(props: PagesProps) {
56
56
  const idx = routerKeys.indexOf(key)
57
57
 
58
58
  const prevHistory = useRef<number>(-1)
59
- const direction = idx >= prevHistory.current ? 1 : -1
59
+ let direction: Direction = idx >= prevHistory.current ? 1 : -1
60
+ if (prevHistory.current === -1) direction = 0
60
61
 
61
62
  prevHistory.current = idx
62
63
 
@@ -1,9 +1,17 @@
1
1
  import { createContext } from 'react'
2
2
 
3
- export type Direction = 1 | -1
3
+ /**
4
+ * - `-1` -> Navigated back
5
+ * - `0` -> Loaded the page
6
+ * - `1` -> Navigated forward
7
+ */
8
+ export type Direction = -1 | 0 | 1
4
9
 
5
10
  export type PageContext = {
6
- /** Number of steps we need to navigate back to go to the last non-overlay page and thus close the overlay */
11
+ /**
12
+ * Number of steps we need to navigate back to go to the last non-overlay page and thus close the
13
+ * overlay
14
+ */
7
15
  closeSteps: number
8
16
 
9
17
  /** Number of steps we can go back inside the the current overlay */
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": "9.0.0-canary.77",
5
+ "version": "9.0.0-canary.79",
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": "^9.0.0-canary.77",
16
- "@graphcommerce/framer-utils": "^9.0.0-canary.77",
17
- "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.77",
18
- "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.77",
15
+ "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.79",
16
+ "@graphcommerce/framer-utils": "^9.0.0-canary.79",
17
+ "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.79",
18
+ "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.79",
19
19
  "framer-motion": "^10.0.0",
20
20
  "next": "*",
21
21
  "react": "^18.2.0",