@graphcommerce/next-ui 4.18.0 → 4.19.0
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 +11 -0
- package/Form/Form.tsx +3 -2
- package/PageMeta/PageMeta.tsx +15 -8
- package/Theme/MuiChip.ts +2 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1576](https://github.com/graphcommerce-org/graphcommerce/pull/1576) [`b6d3a3c13`](https://github.com/graphcommerce-org/graphcommerce/commit/b6d3a3c13ea63ef0f691f497507f07c0e094de5b) Thanks [@ErwinOtten](https://github.com/ErwinOtten)! - Create products sitemap
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies []:
|
|
12
|
+
- @graphcommerce/framer-scroller@2.1.30
|
|
13
|
+
|
|
3
14
|
## 4.18.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
package/Form/Form.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { darken, lighten, styled,
|
|
1
|
+
import { darken, lighten, styled, Theme } from '@mui/material'
|
|
2
2
|
import { responsiveVal } from '../Styles/responsiveVal'
|
|
3
|
+
import { sx } from '../Theme/themeDefaults'
|
|
3
4
|
|
|
4
5
|
type FormStyleProps = {
|
|
5
6
|
contained?: boolean
|
|
@@ -7,7 +8,7 @@ type FormStyleProps = {
|
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
const styles = ({ theme, contained = false, background }: { theme: Theme } & FormStyleProps) =>
|
|
10
|
-
|
|
11
|
+
sx([
|
|
11
12
|
{
|
|
12
13
|
display: 'grid',
|
|
13
14
|
alignItems: 'center',
|
package/PageMeta/PageMeta.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { usePageContext } from '@graphcommerce/framer-next-pages'
|
|
|
2
2
|
import { addBasePath } from 'next/dist/client/add-base-path'
|
|
3
3
|
import { addLocale } from 'next/dist/client/add-locale'
|
|
4
4
|
import { getDomainLocale } from 'next/dist/client/get-domain-locale'
|
|
5
|
-
import { resolveHref } from 'next/dist/shared/lib/router/router'
|
|
5
|
+
import { NextRouter, resolveHref } from 'next/dist/shared/lib/router/router'
|
|
6
6
|
import Head from 'next/head'
|
|
7
7
|
import { useRouter } from 'next/router'
|
|
8
8
|
|
|
@@ -29,8 +29,11 @@ export type PageMetaProps = {
|
|
|
29
29
|
metaRobots?: MetaRobotsAll | MetaRobots[]
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
type PartialNextRouter = Pick<
|
|
33
|
+
NextRouter,
|
|
34
|
+
'pathname' | 'locale' | 'locales' | 'isLocaleDomain' | 'domainLocales' | 'defaultLocale'
|
|
35
|
+
>
|
|
36
|
+
export function canonicalize(router: PartialNextRouter, incomming?: Canonical) {
|
|
34
37
|
let canonical = incomming
|
|
35
38
|
|
|
36
39
|
if (!canonical) return canonical
|
|
@@ -51,17 +54,16 @@ export function useCanonical(incomming?: Canonical) {
|
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
56
|
|
|
54
|
-
let [href, as] = resolveHref(router, canonical, true)
|
|
57
|
+
let [href, as] = resolveHref(router as NextRouter, canonical, true)
|
|
55
58
|
|
|
56
59
|
const curLocale = router.locale
|
|
57
60
|
|
|
58
|
-
// Copied from here https://github.com/vercel/next.js/blob/
|
|
61
|
+
// Copied from here https://github.com/vercel/next.js/blob/213c42f446874d29d07fa2cca6e6b11fc9c3b711/packages/next/client/link.tsx#L512
|
|
59
62
|
const localeDomain =
|
|
60
|
-
router &&
|
|
61
63
|
router.isLocaleDomain &&
|
|
62
|
-
getDomainLocale(as, curLocale, router && router.locales, router
|
|
64
|
+
getDomainLocale(as, curLocale, router && router.locales, router.domainLocales)
|
|
63
65
|
|
|
64
|
-
href = localeDomain || addBasePath(addLocale(as, curLocale, router
|
|
66
|
+
href = localeDomain || addBasePath(addLocale(as, curLocale, router.defaultLocale))
|
|
65
67
|
|
|
66
68
|
let siteUrl = process.env.NEXT_PUBLIC_SITE_URL
|
|
67
69
|
if (siteUrl && siteUrl.endsWith('/')) {
|
|
@@ -83,6 +85,11 @@ export function useCanonical(incomming?: Canonical) {
|
|
|
83
85
|
return canonical
|
|
84
86
|
}
|
|
85
87
|
|
|
88
|
+
export function useCanonical(incomming?: Canonical) {
|
|
89
|
+
const router = useRouter()
|
|
90
|
+
return canonicalize(router, incomming)
|
|
91
|
+
}
|
|
92
|
+
|
|
86
93
|
export function PageMeta(props: PageMetaProps) {
|
|
87
94
|
const { active } = usePageContext()
|
|
88
95
|
const { title, canonical: canonicalBare, metaDescription, metaRobots = ['all'] } = props
|
package/Theme/MuiChip.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ComponentsVariants, darken
|
|
1
|
+
import { ComponentsVariants, darken } from '@mui/material'
|
|
2
2
|
import { responsiveVal } from '../Styles'
|
|
3
|
+
import { sx } from './themeDefaults'
|
|
3
4
|
|
|
4
5
|
declare module '@mui/material/Chip/Chip' {
|
|
5
6
|
interface ChipPropsSizeOverrides {
|
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": "4.
|
|
5
|
+
"version": "4.19.0",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"sideEffects": false,
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@emotion/server": "^11.4.0",
|
|
21
21
|
"@emotion/styled": "^11.9.3",
|
|
22
22
|
"@graphcommerce/framer-next-pages": "3.2.4",
|
|
23
|
-
"@graphcommerce/framer-scroller": "2.1.
|
|
23
|
+
"@graphcommerce/framer-scroller": "2.1.30",
|
|
24
24
|
"@graphcommerce/framer-utils": "3.1.4",
|
|
25
25
|
"@graphcommerce/image": "3.1.7",
|
|
26
26
|
"cookie": "^0.5.0",
|