@graphcommerce/magento-product 9.0.0-canary.107 → 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 +12 -0
- package/components/AddProductsToCart/AddProductsToCartError.tsx +1 -1
- package/components/AddProductsToCart/AddProductsToCartQuantity.tsx +2 -2
- package/components/ProductCustomizable/CustomizableAreaOption.tsx +1 -1
- package/components/ProductCustomizable/CustomizableCheckboxOption.tsx +1 -1
- package/components/ProductCustomizable/CustomizableDateOption.tsx +1 -1
- package/components/ProductCustomizable/CustomizableDropDownOption.tsx +1 -1
- package/components/ProductCustomizable/CustomizableFieldOption.tsx +1 -1
- package/components/ProductCustomizable/CustomizableMultipleOption.tsx +1 -1
- package/components/ProductCustomizable/CustomizableRadioOption.tsx +1 -1
- package/components/ProductCustomizable/ProductCustomizable.tsx +1 -1
- package/components/ProductFiltersPro/ProductFiltersProAllFiltersChip.tsx +2 -1
- package/components/ProductFiltersPro/ProductFiltersProSortDirectionArrow.tsx +4 -2
- package/components/ProductListFilters/FilterEqualType.tsx +1 -1
- package/components/ProductListFilters/FilterRangeType.tsx +1 -1
- package/components/ProductListItem/ProductListItem.tsx +3 -3
- package/components/ProductListItem/ProductListItemImage.tsx +1 -1
- package/components/ProductListItem/ProductListItemImageContainer.tsx +1 -1
- package/components/ProductListItem/ProductListItemLinkOrDiv.tsx +2 -2
- package/components/ProductListItems/ProductListItemsBase.tsx +3 -0
- package/components/ProductListSuggestions/ProductListSuggestions.tsx +1 -1
- package/components/ProductPageBreadcrumb/ProductPageBreadcrumb.tsx +2 -2
- package/components/ProductScroller/ProductScroller.tsx +1 -1
- package/components/ProductSidebarDelivery/ProductSidebarDelivery.tsx +1 -1
- package/package.json +13 -13
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) [`ebdf2c8`](https://github.com/graphcommerce-org/graphcommerce/commit/ebdf2c8ea5ba69fa11d33daa75ad12b7c1501460) - Hide ProductScroller components when no items are available ([@bramvanderholst](https://github.com/bramvanderholst))
|
8
|
+
|
9
|
+
- [#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))
|
10
|
+
|
11
|
+
- [#2438](https://github.com/graphcommerce-org/graphcommerce/pull/2438) [`673bf7c`](https://github.com/graphcommerce-org/graphcommerce/commit/673bf7c25b521c215b36db8f6c6ccfd70c4a7468) - Allow adding elements after/between product list items (e.g. banners) ([@bramvanderholst](https://github.com/bramvanderholst))
|
12
|
+
|
13
|
+
- [#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))
|
14
|
+
|
3
15
|
## 9.0.0-canary.107
|
4
16
|
|
5
17
|
## 9.0.0-canary.106
|
@@ -3,7 +3,7 @@ import { FormHelperText } from '@mui/material'
|
|
3
3
|
import type { AddToCartItemSelector } from './useFormAddProductsToCart'
|
4
4
|
import { useFormAddProductsToCart } from './useFormAddProductsToCart'
|
5
5
|
|
6
|
-
type AddProductsToCartErrorProps = {
|
6
|
+
export type AddProductsToCartErrorProps = {
|
7
7
|
children?: React.ReactNode
|
8
8
|
} & AddToCartItemSelector
|
9
9
|
|
@@ -5,7 +5,7 @@ import type { AddProductsToCartMutationVariables } from './AddProductsToCart.gql
|
|
5
5
|
import type { AddToCartItemSelector } from './useFormAddProductsToCart'
|
6
6
|
import { useFormAddProductsToCart } from './useFormAddProductsToCart'
|
7
7
|
|
8
|
-
type AddToCartQuantityProps = Omit<
|
8
|
+
export type AddToCartQuantityProps = Omit<
|
9
9
|
NumberFieldElementProps<AddProductsToCartMutationVariables>,
|
10
10
|
'error' | 'required' | 'inputProps' | 'helperText' | 'name' | 'control'
|
11
11
|
> &
|
@@ -20,13 +20,13 @@ export function AddProductsToCartQuantity(props: AddToCartQuantityProps) {
|
|
20
20
|
variant='outlined'
|
21
21
|
size='small'
|
22
22
|
color='primary'
|
23
|
-
{...props}
|
24
23
|
required
|
25
24
|
inputProps={{ min: 1, 'aria-label': i18n._(/* i18n */ 'Add to cart quantity') }}
|
26
25
|
defaultValue={1}
|
27
26
|
control={control}
|
28
27
|
aria-label={i18n._(/* i18n */ 'Add to cart quantity')}
|
29
28
|
name={`cartItems.${index}.quantity`}
|
29
|
+
{...props}
|
30
30
|
/>
|
31
31
|
)
|
32
32
|
}
|
@@ -7,7 +7,7 @@ import { Box, Checkbox } from '@mui/material'
|
|
7
7
|
import { useFormAddProductsToCart } from '../AddProductsToCart'
|
8
8
|
import type { OptionTypeRenderer } from './CustomizableAreaOption'
|
9
9
|
|
10
|
-
type CustomizableCheckboxOptionProps = React.ComponentProps<
|
10
|
+
export type CustomizableCheckboxOptionProps = React.ComponentProps<
|
11
11
|
OptionTypeRenderer['CustomizableCheckboxOption']
|
12
12
|
>
|
13
13
|
|
@@ -6,7 +6,7 @@ import { Box } from '@mui/material'
|
|
6
6
|
import { useFormAddProductsToCart } from '../AddProductsToCart'
|
7
7
|
import type { OptionTypeRenderer } from './CustomizableAreaOption'
|
8
8
|
|
9
|
-
type CustomizableDateOptionProps = React.ComponentProps<
|
9
|
+
export type CustomizableDateOptionProps = React.ComponentProps<
|
10
10
|
OptionTypeRenderer['CustomizableDateOption']
|
11
11
|
> & {
|
12
12
|
minDate?: Date
|
@@ -5,7 +5,7 @@ import { Box, MenuItem, TextField } from '@mui/material'
|
|
5
5
|
import { useFormAddProductsToCart } from '../AddProductsToCart'
|
6
6
|
import type { OptionTypeRenderer } from './CustomizableAreaOption'
|
7
7
|
|
8
|
-
type CustomizableDropDownOptionProps = React.ComponentProps<
|
8
|
+
export type CustomizableDropDownOptionProps = React.ComponentProps<
|
9
9
|
OptionTypeRenderer['CustomizableDropDownOption']
|
10
10
|
>
|
11
11
|
|
@@ -6,7 +6,7 @@ import { Box } from '@mui/material'
|
|
6
6
|
import { useFormAddProductsToCart } from '../AddProductsToCart'
|
7
7
|
import type { OptionTypeRenderer } from './CustomizableAreaOption'
|
8
8
|
|
9
|
-
type CustomizableFieldOptionProps = React.ComponentProps<
|
9
|
+
export type CustomizableFieldOptionProps = React.ComponentProps<
|
10
10
|
OptionTypeRenderer['CustomizableFieldOption']
|
11
11
|
>
|
12
12
|
|
@@ -7,7 +7,7 @@ import { Box } from '@mui/material'
|
|
7
7
|
import { useFormAddProductsToCart } from '../AddProductsToCart'
|
8
8
|
import type { OptionTypeRenderer } from './CustomizableAreaOption'
|
9
9
|
|
10
|
-
type CustomizableMultipleOptionProps = React.ComponentProps<
|
10
|
+
export type CustomizableMultipleOptionProps = React.ComponentProps<
|
11
11
|
OptionTypeRenderer['CustomizableMultipleOption']
|
12
12
|
>
|
13
13
|
|
@@ -7,7 +7,7 @@ import { Box } from '@mui/material'
|
|
7
7
|
import { useFormAddProductsToCart } from '../AddProductsToCart'
|
8
8
|
import type { OptionTypeRenderer } from './CustomizableAreaOption'
|
9
9
|
|
10
|
-
type CustomizableRadioOptionProps = React.ComponentProps<
|
10
|
+
export type CustomizableRadioOptionProps = React.ComponentProps<
|
11
11
|
OptionTypeRenderer['CustomizableRadioOption']
|
12
12
|
>
|
13
13
|
|
@@ -33,7 +33,7 @@ type OptionTypeRendererProp = Simplify<
|
|
33
33
|
: MissingOptionTypeRenderer & DefinedOptionTypeRenderer
|
34
34
|
>
|
35
35
|
|
36
|
-
type ProductCustomizableProps = AddToCartItemSelector & {
|
36
|
+
export type ProductCustomizableProps = AddToCartItemSelector & {
|
37
37
|
product: ProductCustomizableFragment & ProductPagePriceFragment
|
38
38
|
} & (keyof MissingOptionTypeRenderer extends never
|
39
39
|
? { renderer?: OptionTypeRendererProp }
|
@@ -19,7 +19,8 @@ export type ProductFiltersProAllFiltersChipProps = ProductFiltersProAggregations
|
|
19
19
|
Omit<
|
20
20
|
ChipOverlayOrPopperProps,
|
21
21
|
'label' | 'selected' | 'selectedLabel' | 'onApply' | 'onReset' | 'onClose' | 'children'
|
22
|
-
>
|
22
|
+
> &
|
23
|
+
Partial<Pick<ChipOverlayOrPopperProps, 'label' | 'selectedLabel' | 'children'>>
|
23
24
|
|
24
25
|
export function ProductFiltersProAllFiltersChip(props: ProductFiltersProAllFiltersChipProps) {
|
25
26
|
const { sort_fields, total_count, renderer, category, ...rest } = props
|
@@ -1,11 +1,13 @@
|
|
1
1
|
import type { SortEnum } from '@graphcommerce/graphql-mesh'
|
2
2
|
import { IconSvg, iconArrowDown, iconArrowUp } from '@graphcommerce/next-ui'
|
3
3
|
|
4
|
-
type
|
4
|
+
export type ProductFiltersProSortDirectionArrowProps = {
|
5
5
|
sortDirection: SortEnum | null
|
6
6
|
}
|
7
7
|
|
8
|
-
export function ProductFiltersProSortDirectionArrow({
|
8
|
+
export function ProductFiltersProSortDirectionArrow({
|
9
|
+
sortDirection,
|
10
|
+
}: ProductFiltersProSortDirectionArrowProps) {
|
9
11
|
return (
|
10
12
|
<IconSvg
|
11
13
|
src={sortDirection === 'ASC' || sortDirection === null ? iconArrowUp : iconArrowDown}
|
@@ -44,7 +44,7 @@ export type FilterIn = SetRequired<Omit<FilterEqualTypeInput, 'eq'>, 'in'>
|
|
44
44
|
|
45
45
|
type Filter = NonNullable<NonNullable<ProductListFiltersFragment['aggregations']>[number]>
|
46
46
|
|
47
|
-
type FilterEqualTypeProps = Filter & Omit<ChipMenuProps, 'selected'>
|
47
|
+
export type FilterEqualTypeProps = Filter & Omit<ChipMenuProps, 'selected'>
|
48
48
|
|
49
49
|
export function FilterEqualType(props: FilterEqualTypeProps) {
|
50
50
|
const { attribute_code, count, label, options, __typename, ...chipProps } = props
|
@@ -11,7 +11,7 @@ import { useProductListLinkReplace } from '../../hooks/useProductListLinkReplace
|
|
11
11
|
import { useProductListParamsContext } from '../../hooks/useProductListParamsContext'
|
12
12
|
import type { ProductListFiltersFragment } from './ProductListFilters.gql'
|
13
13
|
|
14
|
-
type FilterRangeTypeProps = NonNullable<
|
14
|
+
export type FilterRangeTypeProps = NonNullable<
|
15
15
|
NonNullable<ProductListFiltersFragment['aggregations']>[0]
|
16
16
|
> &
|
17
17
|
Omit<ChipMenuProps, 'selected'>
|
@@ -40,7 +40,7 @@ type StyleProps = {
|
|
40
40
|
imageOnly?: boolean
|
41
41
|
}
|
42
42
|
|
43
|
-
type BaseProps = {
|
43
|
+
export type BaseProps = {
|
44
44
|
imageOnly?: boolean
|
45
45
|
children?: React.ReactNode
|
46
46
|
sx?: SxProps<Theme>
|
@@ -53,9 +53,9 @@ type BaseProps = {
|
|
53
53
|
Pick<ImageProps, 'loading' | 'sizes' | 'dontReportWronglySizedImages'>
|
54
54
|
|
55
55
|
// eslint-disable-next-line react/no-unused-prop-types
|
56
|
-
type SkeletonProps = BaseProps & { __typename: 'Skeleton' }
|
56
|
+
export type SkeletonProps = BaseProps & { __typename: 'Skeleton' }
|
57
57
|
|
58
|
-
type ProductProps = BaseProps & ProductListItemFragment
|
58
|
+
export type ProductProps = BaseProps & ProductListItemFragment
|
59
59
|
|
60
60
|
export type ProductListItemProps = ProductProps | SkeletonProps
|
61
61
|
|
@@ -48,7 +48,7 @@ export function ProductListItemImageSkeleton(props: ProductListItemImageProps) {
|
|
48
48
|
)
|
49
49
|
}
|
50
50
|
|
51
|
-
type ImageOrPlaceholderProps = ProductListItemImageProps &
|
51
|
+
export type ImageOrPlaceholderProps = ProductListItemImageProps &
|
52
52
|
Omit<ImageProps, 'alt' | 'src'> & {
|
53
53
|
alt?: ImageProps['alt'] | null
|
54
54
|
src?: ImageProps['src'] | null
|
@@ -2,7 +2,7 @@ import { breakpointVal, responsiveVal } from '@graphcommerce/next-ui'
|
|
2
2
|
import type { BoxProps } from '@mui/material'
|
3
3
|
import { Box } from '@mui/material'
|
4
4
|
|
5
|
-
type ProductImageContainerProps = BoxProps
|
5
|
+
export type ProductImageContainerProps = BoxProps
|
6
6
|
|
7
7
|
export function ProductImageContainer(props: ProductImageContainerProps) {
|
8
8
|
const { sx = [] } = props
|
@@ -2,8 +2,8 @@ import { NextLink, breakpointVal } from '@graphcommerce/next-ui'
|
|
2
2
|
import type { BoxProps, ButtonBaseProps, SxProps, Theme } from '@mui/material'
|
3
3
|
import { Box, ButtonBase } from '@mui/material'
|
4
4
|
|
5
|
-
type ProductListItemLinkProps = ButtonBaseProps<typeof NextLink>
|
6
|
-
type ProductListItemLinkOrDivProps = ProductListItemLinkProps | BoxProps
|
5
|
+
export type ProductListItemLinkProps = ButtonBaseProps<typeof NextLink>
|
6
|
+
export type ProductListItemLinkOrDivProps = ProductListItemLinkProps | BoxProps
|
7
7
|
|
8
8
|
function isLink(props: ProductListItemLinkOrDivProps): props is ProductListItemLinkProps {
|
9
9
|
return 'href' in props
|
@@ -38,6 +38,7 @@ export type ProductItemsGridProps = ProductListItemsFragment & {
|
|
38
38
|
sx?: BoxProps['sx']
|
39
39
|
columns?: ((theme: Theme) => ColumnsConfig) | ColumnsConfig
|
40
40
|
containerRef?: React.Ref<HTMLDivElement>
|
41
|
+
children?: React.ReactNode
|
41
42
|
} & Pick<ProductListItemProps, 'onClick' | 'titleComponent'> &
|
42
43
|
ComponentState
|
43
44
|
|
@@ -57,6 +58,7 @@ export function ProductListItemsBase(props: ProductItemsGridProps) {
|
|
57
58
|
titleComponent,
|
58
59
|
onClick,
|
59
60
|
columns,
|
61
|
+
children,
|
60
62
|
} = props
|
61
63
|
|
62
64
|
const theme = useTheme()
|
@@ -124,6 +126,7 @@ export function ProductListItemsBase(props: ProductItemsGridProps) {
|
|
124
126
|
</LazyHydrate>
|
125
127
|
) : null,
|
126
128
|
)}
|
129
|
+
{children}
|
127
130
|
</Box>
|
128
131
|
</AddProductsToCartForm>
|
129
132
|
)
|
@@ -5,7 +5,7 @@ import { productListLinkFromFilter } from '../../hooks/useProductListLink'
|
|
5
5
|
import { useProductFiltersPro } from '../ProductFiltersPro'
|
6
6
|
import type { ProductListSuggestionsFragment } from './ProductListSuggestions.gql'
|
7
7
|
|
8
|
-
type ProductListSuggestionsProps = {
|
8
|
+
export type ProductListSuggestionsProps = {
|
9
9
|
products: ProductListSuggestionsFragment
|
10
10
|
}
|
11
11
|
|
@@ -6,13 +6,13 @@ import { Breadcrumbs, Link, Typography } from '@mui/material'
|
|
6
6
|
import { productPageCategory } from '../ProductPageCategory/productPageCategory'
|
7
7
|
import type { ProductPageBreadcrumbFragment } from './ProductPageBreadcrumb.gql'
|
8
8
|
|
9
|
-
type
|
9
|
+
export type ProductPageBreadcrumbProps = ProductPageBreadcrumbFragment &
|
10
10
|
Omit<BreadcrumbsProps, 'children'>
|
11
11
|
|
12
12
|
/**
|
13
13
|
* @deprecated Please use ProductPageBreadcrumbs
|
14
14
|
*/
|
15
|
-
export function ProductPageBreadcrumb(props:
|
15
|
+
export function ProductPageBreadcrumb(props: ProductPageBreadcrumbProps) {
|
16
16
|
const { categories, name, ...breadcrumbProps } = props
|
17
17
|
const prev = usePrevPageRouter()
|
18
18
|
|
@@ -36,7 +36,7 @@ export const ProductScroller = forwardRef<HTMLDivElement, ProductScrollerProps>(
|
|
36
36
|
|
37
37
|
const Wrapper = useContext(AddProductsToCartContext) ? React.Fragment : AddProductsToCartForm
|
38
38
|
|
39
|
-
if (!items) return null
|
39
|
+
if (!items || !items.length) return null
|
40
40
|
|
41
41
|
return (
|
42
42
|
<Box sx={sx} ref={ref}>
|
@@ -3,7 +3,7 @@ import { Trans } from '@lingui/react'
|
|
3
3
|
import { Box, darken, lighten } from '@mui/material'
|
4
4
|
import type { UseAddProductsToCartActionFragment } from '../AddProductsToCart/UseAddProductsToCartAction.gql'
|
5
5
|
|
6
|
-
type ProductSidebarDeliveryProps = {
|
6
|
+
export type ProductSidebarDeliveryProps = {
|
7
7
|
product?: UseAddProductsToCartActionFragment
|
8
8
|
}
|
9
9
|
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "@graphcommerce/magento-product",
|
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.108",
|
6
6
|
"sideEffects": false,
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
8
8
|
"eslintConfig": {
|
@@ -18,18 +18,18 @@
|
|
18
18
|
"typescript": "5.7.2"
|
19
19
|
},
|
20
20
|
"peerDependencies": {
|
21
|
-
"@graphcommerce/ecommerce-ui": "^9.0.0-canary.
|
22
|
-
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.
|
23
|
-
"@graphcommerce/framer-next-pages": "^9.0.0-canary.
|
24
|
-
"@graphcommerce/framer-scroller": "^9.0.0-canary.
|
25
|
-
"@graphcommerce/graphql": "^9.0.0-canary.
|
26
|
-
"@graphcommerce/graphql-mesh": "^9.0.0-canary.
|
27
|
-
"@graphcommerce/image": "^9.0.0-canary.
|
28
|
-
"@graphcommerce/magento-cart": "^9.0.0-canary.
|
29
|
-
"@graphcommerce/magento-store": "^9.0.0-canary.
|
30
|
-
"@graphcommerce/next-ui": "^9.0.0-canary.
|
31
|
-
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.
|
32
|
-
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.
|
21
|
+
"@graphcommerce/ecommerce-ui": "^9.0.0-canary.108",
|
22
|
+
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.108",
|
23
|
+
"@graphcommerce/framer-next-pages": "^9.0.0-canary.108",
|
24
|
+
"@graphcommerce/framer-scroller": "^9.0.0-canary.108",
|
25
|
+
"@graphcommerce/graphql": "^9.0.0-canary.108",
|
26
|
+
"@graphcommerce/graphql-mesh": "^9.0.0-canary.108",
|
27
|
+
"@graphcommerce/image": "^9.0.0-canary.108",
|
28
|
+
"@graphcommerce/magento-cart": "^9.0.0-canary.108",
|
29
|
+
"@graphcommerce/magento-store": "^9.0.0-canary.108",
|
30
|
+
"@graphcommerce/next-ui": "^9.0.0-canary.108",
|
31
|
+
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.108",
|
32
|
+
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.108",
|
33
33
|
"@lingui/core": "^4.2.1",
|
34
34
|
"@lingui/macro": "^4.2.1",
|
35
35
|
"@lingui/react": "^4.2.1",
|