@graphcommerce/magento-product 4.1.6 → 4.1.9

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,37 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.1.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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
8
+
9
+ ## 4.1.8
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [[`d8906cf4a`](https://github.com/graphcommerce-org/graphcommerce/commit/d8906cf4afbfc234aedd91a2c581f82623267357)]:
14
+ - @graphcommerce/magento-cart@4.2.7
15
+
16
+ ## 4.1.7
17
+
18
+ ### Patch Changes
19
+
20
+ - [#1399](https://github.com/graphcommerce-org/graphcommerce/pull/1399) [`fb277d8e1`](https://github.com/graphcommerce-org/graphcommerce/commit/fb277d8e1e3612c5e9cf890a30d19cfd1ff70542) Thanks [@paales](https://github.com/paales)! - Now using [@graphql-yoga](https://github.com/dotansimha/graphql-yoga) for GraphQL which has full support for [envelop](https://www.envelop.dev/) plugins.
21
+
22
+ * [#1399](https://github.com/graphcommerce-org/graphcommerce/pull/1399) [`fb277d8e1`](https://github.com/graphcommerce-org/graphcommerce/commit/fb277d8e1e3612c5e9cf890a30d19cfd1ff70542) Thanks [@paales](https://github.com/paales)! - Added a new @graphcommerce/cli package to generate the mesh so it can be generated _inside_ the @graphcommerce/graphql-mesh package to allow for better future extensibility.
23
+
24
+ - [#1399](https://github.com/graphcommerce-org/graphcommerce/pull/1399) [`da0ae7d02`](https://github.com/graphcommerce-org/graphcommerce/commit/da0ae7d0236e4908ba0bf0fa16656be516e841d4) Thanks [@paales](https://github.com/paales)! - Updated dependencies
25
+
26
+ - Updated dependencies [[`fb277d8e1`](https://github.com/graphcommerce-org/graphcommerce/commit/fb277d8e1e3612c5e9cf890a30d19cfd1ff70542), [`fb277d8e1`](https://github.com/graphcommerce-org/graphcommerce/commit/fb277d8e1e3612c5e9cf890a30d19cfd1ff70542), [`da0ae7d02`](https://github.com/graphcommerce-org/graphcommerce/commit/da0ae7d0236e4908ba0bf0fa16656be516e841d4)]:
27
+ - @graphcommerce/graphql@3.1.0
28
+ - @graphcommerce/graphql-mesh@4.1.0
29
+ - @graphcommerce/magento-cart@4.2.6
30
+ - @graphcommerce/magento-store@4.1.7
31
+ - @graphcommerce/next-ui@4.6.1
32
+ - @graphcommerce/framer-scroller@2.1.6
33
+ - @graphcommerce/image@3.1.5
34
+
3
35
  ## 4.1.6
4
36
 
5
37
  ### Patch Changes
@@ -1,5 +1,5 @@
1
- import { ProductImage } from '@graphcommerce/graphql'
2
- import { Product } from 'schema-dts'
1
+ import type { ProductImage } from '@graphcommerce/graphql-mesh'
2
+ import type { Product } from 'schema-dts'
3
3
  import { JsonLdProductFragment } from './JsonLdProduct.gql'
4
4
  import { JsonLdProductOfferFragment } from './JsonLdProductOffer.gql'
5
5
 
@@ -1,4 +1,4 @@
1
- import { ProductInterface } from '@graphcommerce/graphql'
1
+ import type { ProductInterface } from '@graphcommerce/graphql-mesh'
2
2
  import { ApolloCartErrorAlert, useFormGqlMutationCart } from '@graphcommerce/magento-cart'
3
3
  import { Money, MoneyProps } from '@graphcommerce/magento-store'
4
4
  import {
@@ -1,4 +1,5 @@
1
- import { cloneDeep, FilterEqualTypeInput } from '@graphcommerce/graphql'
1
+ import { cloneDeep } from '@graphcommerce/graphql'
2
+ import type { FilterEqualTypeInput } from '@graphcommerce/graphql-mesh'
2
3
  import { ChipMenu, ChipMenuProps, responsiveVal, extendableComponent } from '@graphcommerce/next-ui'
3
4
  import {
4
5
  Box,
@@ -8,7 +9,7 @@ import {
8
9
  ListItemText,
9
10
  listItemTextClasses,
10
11
  } from '@mui/material'
11
- import { SetRequired } from 'type-fest'
12
+ import type { SetRequired } from 'type-fest'
12
13
  import { useProductListLinkReplace } from '../../hooks/useProductListLinkReplace'
13
14
  import { useProductListParamsContext } from '../../hooks/useProductListParamsContext'
14
15
  import { ProductListLink } from '../ProductListLink/ProductListLink'
@@ -1,4 +1,5 @@
1
- import { cloneDeep, FilterRangeTypeInput } from '@graphcommerce/graphql'
1
+ import { cloneDeep } from '@graphcommerce/graphql'
2
+ import type { FilterRangeTypeInput } from '@graphcommerce/graphql-mesh'
2
3
  import { Money } from '@graphcommerce/magento-store'
3
4
  import { ChipMenu, ChipMenuProps, extendableComponent } from '@graphcommerce/next-ui'
4
5
  import { Trans } from '@lingui/macro'
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  Exact,
3
3
  Maybe,
4
4
  Scalars,
@@ -7,7 +7,7 @@ import {
7
7
  FilterEqualTypeInput,
8
8
  FilterMatchTypeInput,
9
9
  FilterRangeTypeInput,
10
- } from '@graphcommerce/graphql'
10
+ } from '@graphcommerce/graphql-mesh'
11
11
 
12
12
  /** This is mainly based on ProductListQueryVariables */
13
13
  export type ProductListParams = Exact<{
@@ -1,9 +1,9 @@
1
- import {
1
+ import type {
2
2
  FilterEqualTypeInput,
3
3
  FilterMatchTypeInput,
4
4
  FilterRangeTypeInput,
5
5
  SortEnum,
6
- } from '@graphcommerce/graphql'
6
+ } from '@graphcommerce/graphql-mesh'
7
7
  import { FilterTypes, ProductListParams } from './filterTypes'
8
8
 
9
9
  export function parseParams(
@@ -1,4 +1,5 @@
1
- import { gql, ApolloClient, NormalizedCacheObject, Exact } from '@graphcommerce/graphql'
1
+ import { gql, ApolloClient, NormalizedCacheObject } from '@graphcommerce/graphql'
2
+ import type { Exact } from '@graphcommerce/graphql-mesh'
2
3
  import { AllFilterInputTypes, FilterTypes } from './filterTypes'
3
4
 
4
5
  const allFilterInputTypes: AllFilterInputTypes[] = [
@@ -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'
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.6",
5
+ "version": "4.1.9",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,19 +12,20 @@
12
12
  }
13
13
  },
14
14
  "devDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^4.1.4",
16
- "@graphcommerce/prettier-config-pwa": "^4.0.5",
15
+ "@graphcommerce/eslint-config-pwa": "^4.1.5",
16
+ "@graphcommerce/prettier-config-pwa": "^4.0.6",
17
17
  "@graphcommerce/typescript-config-pwa": "^4.0.2",
18
- "@playwright/test": "^1.20.1",
19
- "type-fest": "2.12.1"
18
+ "@playwright/test": "^1.21.1",
19
+ "type-fest": "^2.12.2"
20
20
  },
21
21
  "dependencies": {
22
- "@graphcommerce/framer-scroller": "2.1.5",
23
- "@graphcommerce/graphql": "3.0.7",
24
- "@graphcommerce/image": "3.1.4",
25
- "@graphcommerce/magento-cart": "4.2.5",
26
- "@graphcommerce/magento-store": "4.1.6",
27
- "@graphcommerce/next-ui": "4.6.0",
22
+ "@graphcommerce/framer-scroller": "2.1.6",
23
+ "@graphcommerce/graphql": "3.1.0",
24
+ "@graphcommerce/graphql-mesh": "4.1.0",
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",
28
29
  "schema-dts": "^1.1.0"
29
30
  },
30
31
  "peerDependencies": {