@graphcommerce/magento-product-configurable 9.0.0-canary.106 → 9.0.0-canary.108

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,17 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.0-canary.108
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2438](https://github.com/graphcommerce-org/graphcommerce/pull/2438) [`cb8d2f0`](https://github.com/graphcommerce-org/graphcommerce/commit/cb8d2f0059d64242260e30ce34655868f204ef4c) - Made all component prop types exported ([@bramvanderholst](https://github.com/bramvanderholst))
8
+
9
+ - [#2438](https://github.com/graphcommerce-org/graphcommerce/pull/2438) [`5b3ce00`](https://github.com/graphcommerce-org/graphcommerce/commit/5b3ce001c38cfe4ba9b7f64266d762b8bdaedf13) - Respect configurableVariantValues.gallery config when selecting a configurable variant. The image should only change to the simple product image when the config is set to true, otherwise the configurable image should remain. To keep this functionality, please set `configurableVariantValues: { gallery: true }` in your graphcommerce.config.js ([@bramvanderholst](https://github.com/bramvanderholst))
10
+
11
+ - [#2438](https://github.com/graphcommerce-org/graphcommerce/pull/2438) [`49937fd`](https://github.com/graphcommerce-org/graphcommerce/commit/49937fd765338e25899d427ee4d799fa7978faeb) - Allow changing various props for internal components ([@bramvanderholst](https://github.com/bramvanderholst))
12
+
13
+ ## 9.0.0-canary.107
14
+
3
15
  ## 9.0.0-canary.106
4
16
 
5
17
  ## 9.0.0-canary.105
@@ -3,7 +3,7 @@ import type { SxProps, Theme } from '@mui/material'
3
3
  import { Box } from '@mui/material'
4
4
  import type { ConfigurableCartItemFragment } from './ConfigurableCartItem.gql'
5
5
 
6
- type CartItemOptionsListProps = Partial<ConfigurableCartItemFragment> & {
6
+ export type CartItemOptionsListProps = Partial<ConfigurableCartItemFragment> & {
7
7
  sx?: SxProps<Theme>
8
8
  }
9
9
 
@@ -3,7 +3,7 @@ import { createContext, useCallback, useContext, useMemo, useState } from 'react
3
3
  import type { ConfigurableProductFormFragment } from './ConfigurableProductForm.gql'
4
4
  import cheapestVariant from './cheapestVariant'
5
5
 
6
- type ConfigurableProductFormProps = ConfigurableProductFormFragment & {
6
+ export type ConfigurableProductFormProps = ConfigurableProductFormFragment & {
7
7
  sku: string
8
8
  children?: React.ReactNode
9
9
  }
@@ -19,7 +19,7 @@ import { ConfigurableOptionsInput } from '../ConfigurableOptions/ConfigurableOpt
19
19
  import type { ConfigurableProductAddToCartMutationVariables } from '../graphql/ConfigurableProductAddToCart.gql'
20
20
  import { ConfigurableProductAddToCartDocument } from '../graphql/ConfigurableProductAddToCart.gql'
21
21
 
22
- type ConfigurableProductAddToCartProps = {
22
+ export type ConfigurableProductAddToCartProps = {
23
23
  variables: Omit<ConfigurableProductAddToCartMutationVariables, 'cartId' | 'selectedOptions'>
24
24
  name: string
25
25
  optionEndLabels?: Record<string, React.ReactNode>
package/SwatchList.tsx CHANGED
@@ -7,7 +7,7 @@ import { TextSwatchData } from './Swatches/TextSwatchData'
7
7
  import type { SwatchSize, SwatchTypeRenderer } from './Swatches/types'
8
8
  import type { ProductListItemConfigurableFragment } from './components/ProductListItemConfigurable/ProductListItemConfigurable.gql'
9
9
 
10
- type SwatchListProps = {
10
+ export type SwatchListProps = {
11
11
  attributes?: string[]
12
12
  configurable_options?: Maybe<ProductListItemConfigurableFragment['configurable_options']>
13
13
  }
@@ -4,7 +4,7 @@ import { Box } from '@mui/material'
4
4
  import type { ColorSwatchDataFragment } from './ColorSwatchData.gql'
5
5
  import type { SwatchDataProps } from './types'
6
6
 
7
- type ColorSwatchDataProps = ColorSwatchDataFragment &
7
+ export type ColorSwatchDataProps = ColorSwatchDataFragment &
8
8
  SwatchDataProps & {
9
9
  sx?: SxProps<Theme>
10
10
  }
@@ -5,7 +5,8 @@ import { Box } from '@mui/material'
5
5
  import type { ImageSwatchDataFragment } from './ImageSwatchData.gql'
6
6
  import type { SwatchDataProps } from './types'
7
7
 
8
- type ImageSwatchDataProps = ImageSwatchDataFragment & SwatchDataProps & { sx?: SxProps<Theme> }
8
+ export type ImageSwatchDataProps = ImageSwatchDataFragment &
9
+ SwatchDataProps & { sx?: SxProps<Theme> }
9
10
 
10
11
  type OwnerState = Pick<SwatchDataProps, 'size'>
11
12
  const name = 'ColorSwatchData'
@@ -5,7 +5,7 @@ import { Box } from '@mui/material'
5
5
  import type { TextSwatchDataFragment } from './TextSwatchData.gql'
6
6
  import type { SwatchDataProps } from './types'
7
7
 
8
- type TextSwatchDataProps = TextSwatchDataFragment & SwatchDataProps & { sx?: SxProps<Theme> }
8
+ export type TextSwatchDataProps = TextSwatchDataFragment & SwatchDataProps & { sx?: SxProps<Theme> }
9
9
 
10
10
  type OwnerState = Pick<SwatchDataProps, 'size'>
11
11
  const name = 'TextSwatchData'
@@ -3,7 +3,7 @@ import { SelectedCustomizableOptions } from '@graphcommerce/magento-cart-items'
3
3
  import { Box } from '@mui/material'
4
4
  import type { ConfigurableCartItemFragment } from '../../ConfigurableCartItem/ConfigurableCartItem.gql'
5
5
 
6
- type ConfigurableActionCartItemProps = ConfigurableCartItemFragment & CartItemFragment
6
+ export type ConfigurableActionCartItemProps = ConfigurableCartItemFragment & CartItemFragment
7
7
 
8
8
  export function ConfigurableCartItemOptions(props: ConfigurableActionCartItemProps) {
9
9
  const { configurable_options } = props
@@ -15,23 +15,25 @@ import type {
15
15
  ConfigurableOptionValueFragment,
16
16
  } from '../ConfigurableOptionValue'
17
17
 
18
- type Props = NonNullable<
18
+ export type ConfigurableProductOptionProps = NonNullable<
19
19
  NonNullable<ConfigurableOptionsFragment['configurable_options']>[number]
20
20
  > & {
21
21
  index: number
22
22
  optionIndex: number
23
+ optionStartLabels?: Record<string, React.ReactNode>
23
24
  optionEndLabels?: Record<string, React.ReactNode>
24
25
  sx?: SxProps<Theme>
25
26
  attribute_code: string
26
27
  render: typeof ConfigurableOptionValue
27
28
  } & UseConfigurableOptionsSelection
28
29
 
29
- export function ConfigurableProductOption(props: Props) {
30
+ export function ConfigurableProductOption(props: ConfigurableProductOptionProps) {
30
31
  const {
31
32
  values,
32
33
  label,
33
34
  index,
34
35
  optionIndex,
36
+ optionStartLabels,
35
37
  optionEndLabels,
36
38
  sx,
37
39
  attribute_code,
@@ -71,7 +73,7 @@ export function ConfigurableProductOption(props: Props) {
71
73
  return (
72
74
  <Box key={fieldName} sx={[...(Array.isArray(sx) ? sx : [sx])]}>
73
75
  <SectionHeader
74
- labelLeft={label}
76
+ labelLeft={optionStartLabels?.[attribute_code ?? ''] ?? label}
75
77
  labelRight={optionEndLabels?.[attribute_code ?? '']}
76
78
  sx={{ mt: 0 }}
77
79
  />
@@ -13,6 +13,7 @@ import { ConfigurableOptionValue } from '../ConfigurableOptionValue/Configurable
13
13
  import { ConfigurableProductOption } from './ConfigurableProductOption'
14
14
 
15
15
  export type ConfigurableProductOptionsProps = AddToCartItemSelector & {
16
+ optionStartLabels?: Record<string, React.ReactNode>
16
17
  optionEndLabels?: Record<string, React.ReactNode>
17
18
  sx?: SxProps<Theme>
18
19
  render?: typeof ConfigurableOptionValue
@@ -22,6 +23,7 @@ export type ConfigurableProductOptionsProps = AddToCartItemSelector & {
22
23
 
23
24
  export function ConfigurableProductOptions(props: ConfigurableProductOptionsProps) {
24
25
  const {
26
+ optionStartLabels,
25
27
  optionEndLabels,
26
28
  sx,
27
29
  render = ConfigurableOptionValue,
@@ -68,6 +70,7 @@ export function ConfigurableProductOptions(props: ConfigurableProductOptionsProp
68
70
  {...option}
69
71
  key={option.uid}
70
72
  render={render}
73
+ optionStartLabels={optionStartLabels}
71
74
  optionEndLabels={optionEndLabels}
72
75
  index={index}
73
76
  optionIndex={optionIndex}
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.106",
5
+ "version": "9.0.0-canary.108",
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.106",
16
- "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.106",
17
- "@graphcommerce/graphql": "^9.0.0-canary.106",
18
- "@graphcommerce/graphql-mesh": "^9.0.0-canary.106",
19
- "@graphcommerce/image": "^9.0.0-canary.106",
20
- "@graphcommerce/lingui-next": "9.0.0-canary.106",
21
- "@graphcommerce/magento-cart": "^9.0.0-canary.106",
22
- "@graphcommerce/magento-cart-items": "^9.0.0-canary.106",
23
- "@graphcommerce/magento-category": "^9.0.0-canary.106",
24
- "@graphcommerce/magento-customer": "^9.0.0-canary.106",
25
- "@graphcommerce/magento-product": "^9.0.0-canary.106",
26
- "@graphcommerce/magento-product-simple": "^9.0.0-canary.106",
27
- "@graphcommerce/magento-store": "^9.0.0-canary.106",
28
- "@graphcommerce/next-ui": "^9.0.0-canary.106",
29
- "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.106",
30
- "@graphcommerce/react-hook-form": "^9.0.0-canary.106",
31
- "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.106",
15
+ "@graphcommerce/ecommerce-ui": "^9.0.0-canary.108",
16
+ "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.108",
17
+ "@graphcommerce/graphql": "^9.0.0-canary.108",
18
+ "@graphcommerce/graphql-mesh": "^9.0.0-canary.108",
19
+ "@graphcommerce/image": "^9.0.0-canary.108",
20
+ "@graphcommerce/lingui-next": "9.0.0-canary.108",
21
+ "@graphcommerce/magento-cart": "^9.0.0-canary.108",
22
+ "@graphcommerce/magento-cart-items": "^9.0.0-canary.108",
23
+ "@graphcommerce/magento-category": "^9.0.0-canary.108",
24
+ "@graphcommerce/magento-customer": "^9.0.0-canary.108",
25
+ "@graphcommerce/magento-product": "^9.0.0-canary.108",
26
+ "@graphcommerce/magento-product-simple": "^9.0.0-canary.108",
27
+ "@graphcommerce/magento-store": "^9.0.0-canary.108",
28
+ "@graphcommerce/next-ui": "^9.0.0-canary.108",
29
+ "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.108",
30
+ "@graphcommerce/react-hook-form": "^9.0.0-canary.108",
31
+ "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.108",
32
32
  "@lingui/core": "^4.2.1",
33
33
  "@lingui/macro": "^4.2.1",
34
34
  "@lingui/react": "^4.2.1",
@@ -5,6 +5,7 @@ import { useConfigurableOptionsSelection } from '../../hooks'
5
5
  export const config: PluginConfig = {
6
6
  type: 'component',
7
7
  module: '@graphcommerce/magento-product',
8
+ ifConfig: 'configurableVariantValues.gallery',
8
9
  }
9
10
 
10
11
  export function ProductPageGallery(