@graphcommerce/magento-product-configurable 9.0.0-canary.58 → 9.0.0-canary.60
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 +4 -0
- package/package.json +18 -18
- package/plugins/ConfigurableProductPage/ConfigurableProductPageDescription.tsx +7 -7
- package/plugins/ConfigurableProductPage/ConfigurableProductPageGallery.tsx +7 -7
- package/plugins/ConfigurableProductPage/ConfigurableProductPageJsonLd.tsx +8 -11
- package/plugins/ConfigurableProductPage/ConfigurableProductPageMeta.tsx +7 -9
- package/plugins/ConfigurableProductPage/ConfigurableProductPageName.tsx +7 -9
- package/plugins/ConfigurableProductPage/ConfigurableProductPagePrice.tsx +7 -7
- package/plugins/ConfigurableProductPage/ConfigurableProductPagePriceTiers.tsx +7 -7
- package/plugins/ConfigurableProductPage/ConfigurableProductShortDescription.tsx +8 -8
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-product-configurable",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "9.0.0-canary.
|
|
5
|
+
"version": "9.0.0-canary.60",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,23 +12,23 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@graphcommerce/ecommerce-ui": "^9.0.0-canary.
|
|
16
|
-
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.
|
|
17
|
-
"@graphcommerce/graphql": "^9.0.0-canary.
|
|
18
|
-
"@graphcommerce/graphql-mesh": "^9.0.0-canary.
|
|
19
|
-
"@graphcommerce/image": "^9.0.0-canary.
|
|
20
|
-
"@graphcommerce/lingui-next": "9.0.0-canary.
|
|
21
|
-
"@graphcommerce/magento-cart": "^9.0.0-canary.
|
|
22
|
-
"@graphcommerce/magento-cart-items": "^9.0.0-canary.
|
|
23
|
-
"@graphcommerce/magento-category": "^9.0.0-canary.
|
|
24
|
-
"@graphcommerce/magento-customer": "^9.0.0-canary.
|
|
25
|
-
"@graphcommerce/magento-product": "^9.0.0-canary.
|
|
26
|
-
"@graphcommerce/magento-product-simple": "^9.0.0-canary.
|
|
27
|
-
"@graphcommerce/magento-store": "^9.0.0-canary.
|
|
28
|
-
"@graphcommerce/next-ui": "^9.0.0-canary.
|
|
29
|
-
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.
|
|
30
|
-
"@graphcommerce/react-hook-form": "^9.0.0-canary.
|
|
31
|
-
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.
|
|
15
|
+
"@graphcommerce/ecommerce-ui": "^9.0.0-canary.60",
|
|
16
|
+
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.60",
|
|
17
|
+
"@graphcommerce/graphql": "^9.0.0-canary.60",
|
|
18
|
+
"@graphcommerce/graphql-mesh": "^9.0.0-canary.60",
|
|
19
|
+
"@graphcommerce/image": "^9.0.0-canary.60",
|
|
20
|
+
"@graphcommerce/lingui-next": "9.0.0-canary.60",
|
|
21
|
+
"@graphcommerce/magento-cart": "^9.0.0-canary.60",
|
|
22
|
+
"@graphcommerce/magento-cart-items": "^9.0.0-canary.60",
|
|
23
|
+
"@graphcommerce/magento-category": "^9.0.0-canary.60",
|
|
24
|
+
"@graphcommerce/magento-customer": "^9.0.0-canary.60",
|
|
25
|
+
"@graphcommerce/magento-product": "^9.0.0-canary.60",
|
|
26
|
+
"@graphcommerce/magento-product-simple": "^9.0.0-canary.60",
|
|
27
|
+
"@graphcommerce/magento-store": "^9.0.0-canary.60",
|
|
28
|
+
"@graphcommerce/next-ui": "^9.0.0-canary.60",
|
|
29
|
+
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.60",
|
|
30
|
+
"@graphcommerce/react-hook-form": "^9.0.0-canary.60",
|
|
31
|
+
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.60",
|
|
32
32
|
"@lingui/core": "^4.2.1",
|
|
33
33
|
"@lingui/macro": "^4.2.1",
|
|
34
34
|
"@lingui/react": "^4.2.1",
|
|
@@ -2,14 +2,16 @@ import type {
|
|
|
2
2
|
AddToCartItemSelector,
|
|
3
3
|
ProductPageDescriptionProps,
|
|
4
4
|
} from '@graphcommerce/magento-product'
|
|
5
|
-
import type {
|
|
5
|
+
import type { PluginConfig, PluginProps } from '@graphcommerce/next-config'
|
|
6
6
|
import { useConfigurableSelectedVariant } from '../../hooks'
|
|
7
7
|
|
|
8
|
-
export const
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
export const config: PluginConfig = {
|
|
9
|
+
type: 'component',
|
|
10
|
+
module: '@graphcommerce/magento-product',
|
|
11
|
+
ifConfig: 'configurableVariantValues.content',
|
|
12
|
+
}
|
|
11
13
|
|
|
12
|
-
export const
|
|
14
|
+
export const ProductPageDescription = (
|
|
13
15
|
props: PluginProps<ProductPageDescriptionProps & AddToCartItemSelector>,
|
|
14
16
|
) => {
|
|
15
17
|
const { Prev, product, index, ...rest } = props
|
|
@@ -28,5 +30,3 @@ export const ConfigurableProductPageDescription = (
|
|
|
28
30
|
/>
|
|
29
31
|
)
|
|
30
32
|
}
|
|
31
|
-
|
|
32
|
-
export const Plugin = ConfigurableProductPageDescription
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { AddToCartItemSelector, ProductPageGalleryProps } from '@graphcommerce/magento-product'
|
|
2
|
-
import type { PluginProps } from '@graphcommerce/next-config'
|
|
2
|
+
import type { PluginConfig, PluginProps } from '@graphcommerce/next-config'
|
|
3
3
|
import { useConfigurableOptionsSelection } from '../../hooks'
|
|
4
4
|
|
|
5
|
-
export const
|
|
6
|
-
|
|
5
|
+
export const config: PluginConfig = {
|
|
6
|
+
type: 'component',
|
|
7
|
+
module: '@graphcommerce/magento-product',
|
|
8
|
+
}
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
export function ProductPageGallery(
|
|
9
11
|
props: PluginProps<ProductPageGalleryProps> & AddToCartItemSelector,
|
|
10
|
-
)
|
|
12
|
+
) {
|
|
11
13
|
const { Prev, product, index, ...rest } = props
|
|
12
14
|
|
|
13
15
|
const { configured } = useConfigurableOptionsSelection({ url_key: product.url_key, index })
|
|
@@ -19,5 +21,3 @@ const ConfigurableProductPageGallery = (
|
|
|
19
21
|
|
|
20
22
|
return <Prev product={{ ...product, media_gallery }} {...rest} />
|
|
21
23
|
}
|
|
22
|
-
|
|
23
|
-
export const Plugin = ConfigurableProductPageGallery
|
|
@@ -3,22 +3,19 @@ import type {
|
|
|
3
3
|
JsonLdProductFragment,
|
|
4
4
|
ProductPageJsonLdProps,
|
|
5
5
|
} from '@graphcommerce/magento-product'
|
|
6
|
-
import type {
|
|
6
|
+
import type { PluginConfig, PluginProps } from '@graphcommerce/next-config'
|
|
7
7
|
import { useConfigurableSelectedVariant } from '../../hooks'
|
|
8
8
|
|
|
9
|
-
export const
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export const config: PluginConfig = {
|
|
10
|
+
type: 'component',
|
|
11
|
+
module: '@graphcommerce/magento-product',
|
|
12
|
+
ifConfig: 'configurableVariantValues.content',
|
|
13
|
+
}
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
T extends { '@type': string },
|
|
15
|
-
P extends JsonLdProductFragment,
|
|
16
|
-
>(
|
|
15
|
+
export function ProductPageJsonLd<T extends { '@type': string }, P extends JsonLdProductFragment>(
|
|
17
16
|
props: PluginProps<ProductPageJsonLdProps<T, P>> & AddToCartItemSelector,
|
|
18
|
-
)
|
|
17
|
+
) {
|
|
19
18
|
const { Prev, product, index, ...rest } = props
|
|
20
19
|
const variant = useConfigurableSelectedVariant({ url_key: product.url_key, index })
|
|
21
20
|
return <Prev product={(variant ?? product) as P} {...rest} />
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
export const Plugin = ConfigurableProductPageJsonLd
|
|
@@ -4,18 +4,18 @@ import {
|
|
|
4
4
|
type AddToCartItemSelector,
|
|
5
5
|
ProductPageMetaProps,
|
|
6
6
|
} from '@graphcommerce/magento-product'
|
|
7
|
-
import type {
|
|
7
|
+
import type { PluginConfig, PluginProps } from '@graphcommerce/next-config'
|
|
8
8
|
import { useRouter } from 'next/router'
|
|
9
9
|
import { useEffect } from 'react'
|
|
10
10
|
import { useConfigurableSelectedVariant } from '../../hooks'
|
|
11
11
|
|
|
12
|
-
export const
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
export const config: PluginConfig = {
|
|
13
|
+
type: 'component',
|
|
14
|
+
module: '@graphcommerce/magento-product',
|
|
15
|
+
ifConfig: 'configurableVariantValues.url',
|
|
16
|
+
}
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
props: PluginProps<ProductPageMetaProps> & AddToCartItemSelector,
|
|
18
|
-
) => {
|
|
18
|
+
export function ProductPageMeta(props: PluginProps<ProductPageMetaProps> & AddToCartItemSelector) {
|
|
19
19
|
const { Prev, product, index, ...rest } = props
|
|
20
20
|
const { replace, asPath } = useRouter()
|
|
21
21
|
|
|
@@ -37,5 +37,3 @@ const ConfigurableProductPageMetaUrls = (
|
|
|
37
37
|
|
|
38
38
|
return <Prev product={variant ? mergeDeep(product, variant) : product} {...rest} />
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
export const Plugin = ConfigurableProductPageMetaUrls
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import type { AddToCartItemSelector, ProductPageNameProps } from '@graphcommerce/magento-product'
|
|
2
|
-
import type {
|
|
2
|
+
import type { PluginConfig, PluginProps } from '@graphcommerce/next-config'
|
|
3
3
|
import { useConfigurableSelectedVariant } from '../../hooks'
|
|
4
4
|
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
export const config: PluginConfig = {
|
|
6
|
+
type: 'component',
|
|
7
|
+
module: '@graphcommerce/magento-product',
|
|
8
|
+
ifConfig: 'configurableVariantValues.content',
|
|
9
|
+
}
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
props: PluginProps<ProductPageNameProps> & AddToCartItemSelector,
|
|
11
|
-
) => {
|
|
11
|
+
export function ProductPageName(props: PluginProps<ProductPageNameProps> & AddToCartItemSelector) {
|
|
12
12
|
const { Prev, product, index, ...rest } = props
|
|
13
13
|
const variant = useConfigurableSelectedVariant({ url_key: product.url_key, index })
|
|
14
14
|
return <Prev product={variant ?? product} {...rest} />
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
export const Plugin = ConfigurableProductPageName
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { AddToCartItemSelector, ProductPagePriceProps } from '@graphcommerce/magento-product'
|
|
2
|
-
import type { PluginProps } from '@graphcommerce/next-config'
|
|
2
|
+
import type { PluginConfig, PluginProps } from '@graphcommerce/next-config'
|
|
3
3
|
import { useConfigurableSelectedVariant } from '../../hooks'
|
|
4
4
|
|
|
5
|
-
export const
|
|
6
|
-
|
|
5
|
+
export const config: PluginConfig = {
|
|
6
|
+
type: 'component',
|
|
7
|
+
module: '@graphcommerce/magento-product',
|
|
8
|
+
}
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
export function ProductPagePrice(
|
|
9
11
|
props: PluginProps<ProductPagePriceProps> & AddToCartItemSelector,
|
|
10
|
-
)
|
|
12
|
+
) {
|
|
11
13
|
const { Prev, product, index, ...rest } = props
|
|
12
14
|
const variant = useConfigurableSelectedVariant({ url_key: product.url_key, index })
|
|
13
15
|
|
|
@@ -21,5 +23,3 @@ const ConfigurableProductPagePrice = (
|
|
|
21
23
|
/>
|
|
22
24
|
)
|
|
23
25
|
}
|
|
24
|
-
|
|
25
|
-
export const Plugin = ConfigurableProductPagePrice
|
|
@@ -2,15 +2,17 @@ import type {
|
|
|
2
2
|
AddToCartItemSelector,
|
|
3
3
|
ProductPagePriceTiersProps,
|
|
4
4
|
} from '@graphcommerce/magento-product'
|
|
5
|
-
import type { PluginProps } from '@graphcommerce/next-config'
|
|
5
|
+
import type { PluginConfig, PluginProps } from '@graphcommerce/next-config'
|
|
6
6
|
import { useConfigurableSelectedVariant } from '../../hooks'
|
|
7
7
|
|
|
8
|
-
export const
|
|
9
|
-
|
|
8
|
+
export const config: PluginConfig = {
|
|
9
|
+
type: 'component',
|
|
10
|
+
module: '@graphcommerce/magento-product',
|
|
11
|
+
}
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
export function ProductPagePriceTiers(
|
|
12
14
|
props: PluginProps<ProductPagePriceTiersProps> & AddToCartItemSelector,
|
|
13
|
-
)
|
|
15
|
+
) {
|
|
14
16
|
const { Prev, product, index, ...rest } = props
|
|
15
17
|
const variant = useConfigurableSelectedVariant({ url_key: product.url_key, index })
|
|
16
18
|
|
|
@@ -19,5 +21,3 @@ const ConfigurableProductPagePriceTiers = (
|
|
|
19
21
|
|
|
20
22
|
return <Prev product={{ ...variant, options: product.options }} {...rest} />
|
|
21
23
|
}
|
|
22
|
-
|
|
23
|
-
export const Plugin = ConfigurableProductPagePriceTiers
|
|
@@ -2,16 +2,18 @@ import type {
|
|
|
2
2
|
AddToCartItemSelector,
|
|
3
3
|
ProductShortDescriptionProps,
|
|
4
4
|
} from '@graphcommerce/magento-product'
|
|
5
|
-
import type {
|
|
5
|
+
import type { PluginConfig, PluginProps } from '@graphcommerce/next-config'
|
|
6
6
|
import { useConfigurableSelectedVariant } from '../../hooks'
|
|
7
7
|
|
|
8
|
-
export const
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
export const config: PluginConfig = {
|
|
9
|
+
type: 'component',
|
|
10
|
+
module: '@graphcommerce/magento-product',
|
|
11
|
+
ifConfig: 'configurableVariantValues.content',
|
|
12
|
+
}
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
export function ProductShortDescription(
|
|
13
15
|
props: PluginProps<ProductShortDescriptionProps> & AddToCartItemSelector,
|
|
14
|
-
)
|
|
16
|
+
) {
|
|
15
17
|
const { Prev, product, ...rest } = props
|
|
16
18
|
const variant = useConfigurableSelectedVariant({ url_key: product.url_key, index: 0 })
|
|
17
19
|
|
|
@@ -27,5 +29,3 @@ const ConfigurableProductShortDescription = (
|
|
|
27
29
|
/>
|
|
28
30
|
)
|
|
29
31
|
}
|
|
30
|
-
|
|
31
|
-
export const Plugin = ConfigurableProductShortDescription
|