@graphcommerce/magento-product 4.1.8 → 4.1.11

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,34 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.1.11
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`ba8cd4d34`](https://github.com/graphcommerce-org/graphcommerce/commit/ba8cd4d3480a7ec7e555b051cfd0fbc809c7aa12)]:
8
+ - @graphcommerce/graphql-mesh@4.1.2
9
+ - @graphcommerce/magento-cart@4.2.9
10
+ - @graphcommerce/magento-store@4.1.9
11
+
12
+ ## 4.1.10
13
+
14
+ ### Patch Changes
15
+
16
+ - [#1394](https://github.com/graphcommerce-org/graphcommerce/pull/1394) [`b6b8bb5b3`](https://github.com/graphcommerce-org/graphcommerce/commit/b6b8bb5b31b0891ea24733de34a3bd5c0a9604e4) Thanks [@paales](https://github.com/paales)! - Made fragments injectable so they can be extended
17
+
18
+ - Updated dependencies [[`06f7bdff8`](https://github.com/graphcommerce-org/graphcommerce/commit/06f7bdff882396f2b0e1a2873fbb718c7b06fab4), [`100f4c38c`](https://github.com/graphcommerce-org/graphcommerce/commit/100f4c38c8fcda4bc6e0425e38028b550b60adc2)]:
19
+ - @graphcommerce/graphql-mesh@4.1.1
20
+ - @graphcommerce/graphql@3.1.1
21
+ - @graphcommerce/next-ui@4.6.2
22
+ - @graphcommerce/magento-store@4.1.8
23
+ - @graphcommerce/magento-cart@4.2.8
24
+ - @graphcommerce/framer-scroller@2.1.7
25
+
26
+ ## 4.1.9
27
+
28
+ ### Patch Changes
29
+
30
+ - [#1419](https://github.com/graphcommerce-org/graphcommerce/pull/1419) [`a52a863f9`](https://github.com/graphcommerce-org/graphcommerce/commit/a52a863f9c69c6b3ae657dcce3bc9b14413ce125) Thanks [@NickdeK](https://github.com/NickdeK)! - Make ProductListSort stylable and translate "Sort By" string
31
+
3
32
  ## 4.1.8
4
33
 
5
34
  ### Patch Changes
@@ -1,7 +1,8 @@
1
1
  import { useQuery, cloneDeep } from '@graphcommerce/graphql'
2
2
  import { StoreConfigDocument } from '@graphcommerce/magento-store'
3
- import { ChipMenu, ChipMenuProps } from '@graphcommerce/next-ui'
4
- import { ListItem, ListItemText } from '@mui/material'
3
+ import { ChipMenu, ChipMenuProps, extendableComponent } from '@graphcommerce/next-ui'
4
+ import { Trans } from '@lingui/macro'
5
+ import { ListItem, ListItemText, SxProps, Theme } from '@mui/material'
5
6
  import React from 'react'
6
7
  import { useProductListLinkReplace } from '../../hooks/useProductListLinkReplace'
7
8
  import { useProductListParamsContext } from '../../hooks/useProductListParamsContext'
@@ -9,10 +10,16 @@ import { ProductListLink } from '../ProductListLink/ProductListLink'
9
10
  import { ProductListSortFragment } from './ProductListSort.gql'
10
11
 
11
12
  export type ProductListSortProps = ProductListSortFragment &
12
- Omit<ChipMenuProps, 'selected' | 'selectedLabel' | 'children' | 'label' | 'onDelete'>
13
+ Omit<ChipMenuProps, 'selected' | 'selectedLabel' | 'children' | 'label' | 'onDelete'> & {
14
+ sx?: SxProps<Theme>
15
+ }
16
+
17
+ const name = 'ProductListSort' as const
18
+ const parts = ['menu', 'item', 'link'] as const
19
+ const { classes } = extendableComponent(name, parts)
13
20
 
14
21
  export function ProductListSort(props: ProductListSortProps) {
15
- const { sort_fields, total_count, ...filterMenuProps } = props
22
+ const { sort_fields, total_count, sx = [], ...filterMenuProps } = props
16
23
  const { params } = useProductListParamsContext()
17
24
  const replaceRoute = useProductListLinkReplace()
18
25
  const { data: storeConfigQuery } = useQuery(StoreConfigDocument)
@@ -21,7 +28,7 @@ export function ProductListSort(props: ProductListSortProps) {
21
28
  const [currentSort = defaultSort] = Object.keys(params.sort)
22
29
  const currentOption = sort_fields?.options?.find((option) => option?.value === currentSort)
23
30
  const selected = currentSort !== defaultSort
24
- const label = 'Sort By'
31
+ const label = <Trans>Sort By</Trans>
25
32
 
26
33
  const removeFilter = () => {
27
34
  const linkParams = cloneDeep(params)
@@ -33,12 +40,14 @@ export function ProductListSort(props: ProductListSortProps) {
33
40
 
34
41
  return (
35
42
  <ChipMenu
43
+ className={classes.menu}
36
44
  variant='outlined'
37
45
  selected={selected}
38
46
  label={label}
39
47
  {...filterMenuProps}
40
48
  selectedLabel={selected ? currentOption?.label ?? '' : label}
41
49
  onDelete={selected ? removeFilter : undefined}
50
+ sx={Array.isArray(sx) ? sx : [sx]}
42
51
  >
43
52
  {sort_fields?.options?.map((option) => {
44
53
  const linkParams = cloneDeep(params)
@@ -48,6 +57,7 @@ export function ProductListSort(props: ProductListSortProps) {
48
57
 
49
58
  return (
50
59
  <ListItem
60
+ className={classes.item}
51
61
  button
52
62
  key={option?.value ?? ''}
53
63
  dense
@@ -57,6 +67,7 @@ export function ProductListSort(props: ProductListSortProps) {
57
67
  <ProductListLink
58
68
  {...chipProps}
59
69
  {...linkParams}
70
+ className={classes.link}
60
71
  ref={ref}
61
72
  color='inherit'
62
73
  underline='none'
@@ -0,0 +1,4 @@
1
+ fragment ComplexTextValue on ComplexTextValue @injectable {
2
+ html
3
+ __typename
4
+ }
@@ -2,6 +2,6 @@ fragment ProductPageDescription on ProductInterface {
2
2
  name
3
3
  ...ProductShortDescription
4
4
  description {
5
- html
5
+ ...ComplexTextValue
6
6
  }
7
7
  }
@@ -1,5 +1,5 @@
1
1
  fragment ProductShortDescription on ProductInterface {
2
2
  short_description {
3
- html
3
+ ...ComplexTextValue
4
4
  }
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import { ProductLinkFragment } from './ProductLink.gql'
2
2
 
3
- type ProductLinkProps = Omit<ProductLinkFragment, 'uid'>
3
+ export type ProductLinkProps = Omit<ProductLinkFragment, 'uid'>
4
4
 
5
5
  export function productLink(link: ProductLinkProps) {
6
6
  const { __typename, url_key } = link
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": "4.1.8",
5
+ "version": "4.1.11",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,20 +12,20 @@
12
12
  }
13
13
  },
14
14
  "devDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^4.1.5",
15
+ "@graphcommerce/eslint-config-pwa": "^4.1.6",
16
16
  "@graphcommerce/prettier-config-pwa": "^4.0.6",
17
17
  "@graphcommerce/typescript-config-pwa": "^4.0.2",
18
18
  "@playwright/test": "^1.21.1",
19
19
  "type-fest": "^2.12.2"
20
20
  },
21
21
  "dependencies": {
22
- "@graphcommerce/framer-scroller": "2.1.6",
23
- "@graphcommerce/graphql": "3.1.0",
24
- "@graphcommerce/graphql-mesh": "4.1.0",
22
+ "@graphcommerce/framer-scroller": "2.1.7",
23
+ "@graphcommerce/graphql": "3.1.1",
24
+ "@graphcommerce/graphql-mesh": "4.1.2",
25
25
  "@graphcommerce/image": "3.1.5",
26
- "@graphcommerce/magento-cart": "4.2.7",
27
- "@graphcommerce/magento-store": "4.1.7",
28
- "@graphcommerce/next-ui": "4.6.1",
26
+ "@graphcommerce/magento-cart": "4.2.9",
27
+ "@graphcommerce/magento-store": "4.1.9",
28
+ "@graphcommerce/next-ui": "4.6.2",
29
29
  "schema-dts": "^1.1.0"
30
30
  },
31
31
  "peerDependencies": {