@graphcommerce/ecommerce-ui 10.0.4-canary.0 → 10.1.0-canary.4
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 +12 -0
- package/package.json +7 -7
- package/route/preview.ts +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @graphcommerce/ecommerce-ui
|
|
2
2
|
|
|
3
|
+
## 10.1.0-canary.4
|
|
4
|
+
|
|
5
|
+
## 10.1.0-canary.3
|
|
6
|
+
|
|
7
|
+
## 10.0.4-canary.2
|
|
8
|
+
|
|
9
|
+
## 10.0.4-canary.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#2585](https://github.com/graphcommerce-org/graphcommerce/pull/2585) [`c9e862a`](https://github.com/graphcommerce-org/graphcommerce/commit/c9e862ad0b2fe4a30855df6ddfd27b7c052ac4e8) - Get redirectTo from the url params instead of the headers ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
|
|
14
|
+
|
|
3
15
|
## 10.0.4-canary.0
|
|
4
16
|
|
|
5
17
|
## 10.0.3
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/ecommerce-ui",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "10.0
|
|
5
|
+
"version": "10.1.0-canary.4",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "^10.0
|
|
16
|
-
"@graphcommerce/graphql": "^10.0
|
|
17
|
-
"@graphcommerce/next-ui": "^10.0
|
|
18
|
-
"@graphcommerce/prettier-config-pwa": "^10.0
|
|
19
|
-
"@graphcommerce/react-hook-form": "^10.0
|
|
20
|
-
"@graphcommerce/typescript-config-pwa": "^10.0
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "^10.1.0-canary.4",
|
|
16
|
+
"@graphcommerce/graphql": "^10.1.0-canary.4",
|
|
17
|
+
"@graphcommerce/next-ui": "^10.1.0-canary.4",
|
|
18
|
+
"@graphcommerce/prettier-config-pwa": "^10.1.0-canary.4",
|
|
19
|
+
"@graphcommerce/react-hook-form": "^10.1.0-canary.4",
|
|
20
|
+
"@graphcommerce/typescript-config-pwa": "^10.1.0-canary.4",
|
|
21
21
|
"@lingui/core": "^5",
|
|
22
22
|
"@lingui/macro": "^5",
|
|
23
23
|
"@lingui/react": "^5",
|
package/route/preview.ts
CHANGED
|
@@ -8,9 +8,12 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|
|
8
8
|
|
|
9
9
|
// const domain = req.url ? new URL(req.url) : undefined
|
|
10
10
|
const referer = req.headers.referer ? new URL(req.headers.referer) : undefined
|
|
11
|
-
|
|
12
|
-
req.
|
|
13
|
-
|
|
11
|
+
let redirectTo =
|
|
12
|
+
req.query.redirectTo ?? (referer && req.headers.host === referer.host ? referer.pathname : '/')
|
|
13
|
+
|
|
14
|
+
if (redirectTo === '/page/home') {
|
|
15
|
+
redirectTo = '/'
|
|
16
|
+
}
|
|
14
17
|
|
|
15
18
|
if (!action) {
|
|
16
19
|
res.status(400).json({ message: 'No action provided' })
|
|
@@ -27,7 +30,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
res.setDraftMode({ enable: true })
|
|
30
|
-
const previewData = req.query.
|
|
33
|
+
const previewData = req.query.previewData
|
|
31
34
|
? (JSON.parse(`${req.query.previewData}`) as PreviewData)
|
|
32
35
|
: previewModeDefaults()
|
|
33
36
|
|