@graphcommerce/magento-product 4.0.6 → 4.1.2

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,46 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1353](https://github.com/graphcommerce-org/graphcommerce/pull/1353) [`0e5ee7ba8`](https://github.com/graphcommerce-org/graphcommerce/commit/0e5ee7ba89698e5e711001e846ed182528060cba) Thanks [@paales](https://github.com/paales)! - Eslint: enable rules that were previously disabled and make fixes
8
+
9
+ * [#1353](https://github.com/graphcommerce-org/graphcommerce/pull/1353) [`59c71d6bf`](https://github.com/graphcommerce-org/graphcommerce/commit/59c71d6bf094ea27074b5d91efa79e1c9392445b) Thanks [@paales](https://github.com/paales)! - Product specs misspelling in typography
10
+
11
+ * Updated dependencies [[`829b8690b`](https://github.com/graphcommerce-org/graphcommerce/commit/829b8690bc5d0a46e596299e4120e9837a9f179c), [`49a2d6617`](https://github.com/graphcommerce-org/graphcommerce/commit/49a2d661712e1787fba46c6195f7b559189e23d9), [`f67da3cfb`](https://github.com/graphcommerce-org/graphcommerce/commit/f67da3cfbe2dcf5ea23519d088c5aa0074029182), [`218766869`](https://github.com/graphcommerce-org/graphcommerce/commit/218766869f7468c067a590857c942f3819f8add4), [`0e5ee7ba8`](https://github.com/graphcommerce-org/graphcommerce/commit/0e5ee7ba89698e5e711001e846ed182528060cba), [`829b8690b`](https://github.com/graphcommerce-org/graphcommerce/commit/829b8690bc5d0a46e596299e4120e9837a9f179c), [`829b8690b`](https://github.com/graphcommerce-org/graphcommerce/commit/829b8690bc5d0a46e596299e4120e9837a9f179c)]:
12
+ - @graphcommerce/framer-scroller@2.1.2
13
+ - @graphcommerce/next-ui@4.4.0
14
+ - @graphcommerce/magento-cart@4.2.1
15
+
16
+ ## 4.1.1
17
+
18
+ ### Patch Changes
19
+
20
+ - [#1337](https://github.com/graphcommerce-org/graphcommerce/pull/1337) [`bc5966129`](https://github.com/graphcommerce-org/graphcommerce/commit/bc5966129351a641db4deb3b4f04fe942c06f16b) Thanks [@paales](https://github.com/paales)! - Make sure any new types added to CustomizableProductInterface can be added and don’t immediately crash any query
21
+
22
+ * [#1337](https://github.com/graphcommerce-org/graphcommerce/pull/1337) [`645986e30`](https://github.com/graphcommerce-org/graphcommerce/commit/645986e306a38d3bb5a284ba04a9004060c592e6) Thanks [@paales](https://github.com/paales)! - make sure the fontSize isn’t required for ProductPageDescription
23
+
24
+ ## 4.1.0
25
+
26
+ ### Minor Changes
27
+
28
+ - [#1322](https://github.com/graphcommerce-org/graphcommerce/pull/1322) [`0298a0de1`](https://github.com/graphcommerce-org/graphcommerce/commit/0298a0de1d13e543c4124a6a099297b4e27e2b05) Thanks [@paales](https://github.com/paales)! - Added `<Slider size='large' />` and made styling with variants
29
+
30
+ * [#1322](https://github.com/graphcommerce-org/graphcommerce/pull/1322) [`e4ded94d7`](https://github.com/graphcommerce-org/graphcommerce/commit/e4ded94d7b0f0c87f86abcd31340d75533bde73e) Thanks [@paales](https://github.com/paales)! - Added a fontSize property to the ProductPageDescription to change the fontSize for the rendered paragraph
31
+
32
+ ### Patch Changes
33
+
34
+ - [#1322](https://github.com/graphcommerce-org/graphcommerce/pull/1322) [`bc8826b9d`](https://github.com/graphcommerce-org/graphcommerce/commit/bc8826b9dc1e6418b2720c9211e46791c33fca8a) Thanks [@paales](https://github.com/paales)! - ProductListFiltersContainer button alignment
35
+
36
+ * [#1322](https://github.com/graphcommerce-org/graphcommerce/pull/1322) [`7e910f3b8`](https://github.com/graphcommerce-org/graphcommerce/commit/7e910f3b8eb73cff33261956937124f95520d8e5) Thanks [@paales](https://github.com/paales)! - Allow overwriting ProductListLink underline
37
+
38
+ * Updated dependencies [[`5266388ea`](https://github.com/graphcommerce-org/graphcommerce/commit/5266388eaffda41592623ef7a3ddbbe03c8e0dad), [`9b35403d9`](https://github.com/graphcommerce-org/graphcommerce/commit/9b35403d9dbb2606ac7cf3bb641a0f9cc3d8a2ba), [`0298a0de1`](https://github.com/graphcommerce-org/graphcommerce/commit/0298a0de1d13e543c4124a6a099297b4e27e2b05), [`815132ea4`](https://github.com/graphcommerce-org/graphcommerce/commit/815132ea43937b4b84b59ec9974ac593cb4eb456), [`3326742a0`](https://github.com/graphcommerce-org/graphcommerce/commit/3326742a0dceb45f0cac4741ca09dc4d4f09ad90), [`7a3799bfc`](https://github.com/graphcommerce-org/graphcommerce/commit/7a3799bfc107f26aa9991a91db5f228e3476f4aa), [`9a77f88ed`](https://github.com/graphcommerce-org/graphcommerce/commit/9a77f88ed26cbecdae9a135c3cb234a5b7ecf4df), [`1e2a07141`](https://github.com/graphcommerce-org/graphcommerce/commit/1e2a071414154600430e6dcf0513d86ab78e0b28), [`0eeaad304`](https://github.com/graphcommerce-org/graphcommerce/commit/0eeaad30461b1d5b486438f0287fa76d49429044), [`bc5213547`](https://github.com/graphcommerce-org/graphcommerce/commit/bc52135471479c83d989449dad24798112e898f4), [`3f1912f55`](https://github.com/graphcommerce-org/graphcommerce/commit/3f1912f553318d5888f8af2b841918ef4ae96a84), [`d91359871`](https://github.com/graphcommerce-org/graphcommerce/commit/d91359871b023a9f0d305b37353c1ee2d0912248), [`b6c68cda8`](https://github.com/graphcommerce-org/graphcommerce/commit/b6c68cda8836a1d0c78ef351899cec9ec1037385)]:
39
+ - @graphcommerce/next-ui@4.3.0
40
+ - @graphcommerce/magento-store@4.1.3
41
+ - @graphcommerce/magento-cart@4.2.0
42
+ - @graphcommerce/framer-scroller@2.1.0
43
+
3
44
  ## 4.0.6
4
45
 
5
46
  ### Patch Changes
@@ -1,5 +1,6 @@
1
- fragment ProductCustomizable on CustomizableProductInterface {
1
+ fragment ProductCustomizable on CustomizableProductInterface @injectable {
2
2
  options {
3
+ uid
3
4
  __typename
4
5
  ...CustomizableAreaOption
5
6
  ...CustomizableCheckboxOption
@@ -8,7 +8,8 @@ import { FilterIn } from './FilterEqualType'
8
8
  import { ProductListFiltersFragment } from './ProductListFilters.gql'
9
9
 
10
10
  type Filter = NonNullable<NonNullable<ProductListFiltersFragment['aggregations']>[number]>
11
- export type FilterCheckboxTypeProps = Filter & Omit<ChipProps, 'selected'> & { sx?: SxProps<Theme> }
11
+ export type FilterCheckboxTypeProps = Filter &
12
+ Omit<ChipProps<'button'>, 'selected' | 'onDelete' | 'component'> & { sx?: SxProps<Theme> }
12
13
 
13
14
  export function FilterCheckboxType(props: FilterCheckboxTypeProps) {
14
15
  const { attribute_code, count, label, options, ...chipProps } = props
@@ -32,7 +33,8 @@ export function FilterCheckboxType(props: FilterCheckboxTypeProps) {
32
33
  link={{ scroll: false, replace: true }}
33
34
  >
34
35
  <Chip
35
- color={isActive ? undefined : 'default'}
36
+ component='button'
37
+ color={isActive ? 'primary' : 'default'}
36
38
  onDelete={
37
39
  isActive
38
40
  ? () => {
@@ -1,6 +1,7 @@
1
1
  import { cloneDeep, FilterRangeTypeInput } from '@graphcommerce/graphql'
2
2
  import { Money } from '@graphcommerce/magento-store'
3
3
  import { ChipMenu, ChipMenuProps, extendableComponent } from '@graphcommerce/next-ui'
4
+ import { Trans } from '@lingui/macro'
4
5
  import { Box, Slider } from '@mui/material'
5
6
  import React, { useEffect } from 'react'
6
7
  import { useProductListLinkReplace } from '../../hooks/useProductListLinkReplace'
@@ -12,8 +13,6 @@ type FilterRangeTypeProps = NonNullable<
12
13
  > &
13
14
  Omit<ChipMenuProps, 'selected'>
14
15
 
15
- const sliderThumbWidth = 28
16
-
17
16
  const { classes } = extendableComponent('FilterRangeType', ['root', 'container', 'slider'] as const)
18
17
 
19
18
  export function FilterRangeType(props: FilterRangeTypeProps) {
@@ -79,16 +78,16 @@ export function FilterRangeType(props: FilterRangeTypeProps) {
79
78
 
80
79
  if (from === min && to !== max)
81
80
  currentLabel = (
82
- <>
83
- {'Below '} <Money round value={Number(currentFilter?.to)} />
84
- </>
81
+ <Trans>
82
+ Below <Money round value={Number(currentFilter?.to)} />
83
+ </Trans>
85
84
  )
86
85
 
87
86
  if (from !== min && to === max)
88
87
  currentLabel = (
89
- <>
90
- {'Above '} <Money round value={Number(currentFilter?.from)} />
91
- </>
88
+ <Trans>
89
+ Above <Money round value={Number(currentFilter?.from)} />
90
+ </Trans>
92
91
  )
93
92
 
94
93
  if (from !== min && to !== max)
@@ -128,6 +127,7 @@ export function FilterRangeType(props: FilterRangeTypeProps) {
128
127
  <Slider
129
128
  min={min}
130
129
  max={max}
130
+ size='large'
131
131
  aria-labelledby='range-slider'
132
132
  value={value}
133
133
  onChange={(e, newValue) => {
@@ -142,23 +142,6 @@ export function FilterRangeType(props: FilterRangeTypeProps) {
142
142
  }}
143
143
  valueLabelDisplay='off'
144
144
  className={classes.slider}
145
- sx={(theme) => ({
146
- maxWidth: `calc(100% - ${sliderThumbWidth}px)`,
147
- margin: `${theme.spacings.xxs} auto`,
148
- display: 'block',
149
- paddingBottom: '32px',
150
- '& .MuiSlider-rail': {
151
- height: 4,
152
- borderRadius: '10px',
153
- },
154
- '& .MuiSlider-track': {
155
- height: 4,
156
- },
157
- '& .MuiSlider-thumb': {
158
- width: sliderThumbWidth,
159
- height: sliderThumbWidth,
160
- },
161
- })}
162
145
  />
163
146
  </Box>
164
147
  </ChipMenu>
@@ -2,7 +2,6 @@ import { Scroller, ScrollerButton, ScrollerProvider } from '@graphcommerce/frame
2
2
  import {
3
3
  iconChevronLeft,
4
4
  iconChevronRight,
5
- responsiveVal,
6
5
  IconSvg,
7
6
  useScrollY,
8
7
  extendableComponent,
@@ -87,7 +86,6 @@ export function ProductListFiltersContainer(props: ProductListFiltersContainerPr
87
86
  (theme) => ({
88
87
  display: 'flex',
89
88
  justifyContent: 'center',
90
- height: responsiveVal(44, 52),
91
89
  marginBottom: theme.spacings.sm,
92
90
  position: 'sticky',
93
91
  top: theme.page.vertical,
@@ -108,7 +106,7 @@ export function ProductListFiltersContainer(props: ProductListFiltersContainerPr
108
106
  direction='left'
109
107
  className={classes.sliderPrev}
110
108
  size='small'
111
- sx={{ position: 'absolute', top: 2, left: 2, zIndex: 10 }}
109
+ sx={{ position: 'absolute', top: 4, left: 2, zIndex: 10 }}
112
110
  >
113
111
  <IconSvg src={iconChevronLeft} />
114
112
  </ScrollerButton>
@@ -124,6 +122,8 @@ export function ProductListFiltersContainer(props: ProductListFiltersContainerPr
124
122
  background: theme.palette.background.default,
125
123
  borderRadius: '99em',
126
124
  },
125
+ display: 'grid',
126
+ alignItems: 'center',
127
127
  })}
128
128
  >
129
129
  <Scroller
@@ -166,7 +166,7 @@ export function ProductListFiltersContainer(props: ProductListFiltersContainerPr
166
166
  direction='right'
167
167
  className={classes.sliderNext}
168
168
  size='small'
169
- sx={{ position: 'absolute', top: 2, right: 2, zIndex: 10 }}
169
+ sx={{ position: 'absolute', top: 4, right: 2, zIndex: 10 }}
170
170
  >
171
171
  <IconSvg src={iconChevronRight} />
172
172
  </ScrollerButton>
@@ -43,7 +43,7 @@ export const ProductListLink = React.forwardRef<HTMLAnchorElement, ProductListLi
43
43
  {noLink ? (
44
44
  children
45
45
  ) : (
46
- <Link rel={rel} {...linkProps} ref={ref} onClick={updateParams} underline='hover'>
46
+ <Link rel={rel} underline='hover' {...linkProps} ref={ref} onClick={updateParams}>
47
47
  {children}
48
48
  </Link>
49
49
  )}
@@ -2,17 +2,25 @@ import {
2
2
  ColumnTwoWithTop,
3
3
  ColumnTwoWithTopProps,
4
4
  extendableComponent,
5
+ responsiveVal,
5
6
  } from '@graphcommerce/next-ui'
6
7
  import { Box, SxProps, Theme, Typography } from '@mui/material'
8
+ import { Variant } from '@mui/material/styles/createTypography'
7
9
  import { ProductPageDescriptionFragment } from './ProductPageDescription.gql'
8
10
 
9
11
  export type ProductPageDescriptionProps = ProductPageDescriptionFragment &
10
- Omit<ColumnTwoWithTopProps, 'top' | 'left'> & { sx?: SxProps<Theme> }
12
+ Omit<ColumnTwoWithTopProps, 'top' | 'left'> & {
13
+ sx?: SxProps<Theme>
14
+ fontSize?: 'responsive' | Variant
15
+ }
11
16
 
12
- const { classes } = extendableComponent('ProductPageDescription', ['root', 'description'] as const)
17
+ const componentName = 'ProductPageDescription'
18
+ const parts = ['root', 'description'] as const
19
+
20
+ const { classes } = extendableComponent(componentName, parts)
13
21
 
14
22
  export function ProductPageDescription(props: ProductPageDescriptionProps) {
15
- const { description, name, right, sx = [] } = props
23
+ const { description, name, right, fontSize = 'subtitle1', sx = [] } = props
16
24
 
17
25
  return (
18
26
  <ColumnTwoWithTop
@@ -29,31 +37,32 @@ export function ProductPageDescription(props: ProductPageDescriptionProps) {
29
37
  className={classes.description}
30
38
  // eslint-disable-next-line react/no-danger
31
39
  dangerouslySetInnerHTML={{ __html: description.html }}
32
- sx={(theme) => ({
33
- '& p:first-of-type': {
34
- marginTop: 0,
35
- },
36
- '& p, & li': {
37
- typography: 'body1',
38
- fontWeight: 400,
39
- [theme.breakpoints.up('md')]: {
40
- typography: 'h3',
41
- fontWeight: 400,
42
- '@supports (font-variation-settings: normal)': {
43
- fontVariationSettings: "'wght' 420",
44
- },
40
+ sx={[
41
+ {
42
+ '& p:first-of-type': {
43
+ marginTop: 0,
44
+ },
45
+ '& ul': {
46
+ padding: 0,
47
+ margin: 0,
48
+ display: 'inline',
49
+ listStyleType: 'none',
50
+ },
51
+ '& li': {
52
+ display: 'inline',
45
53
  },
46
54
  },
47
- '& ul': {
48
- padding: 0,
49
- margin: 0,
50
- display: 'inline',
51
- listStyleType: 'none',
55
+ fontSize === 'responsive' && {
56
+ '& p, & li': {
57
+ fontSize: responsiveVal(16, 30),
58
+ },
52
59
  },
53
- '& li': {
54
- display: 'inline',
60
+ fontSize !== 'responsive' && {
61
+ '& p, & li': {
62
+ fontSize,
63
+ },
55
64
  },
56
- })}
65
+ ]}
57
66
  />
58
67
  )
59
68
  }
@@ -20,7 +20,7 @@ export function ProductSpecs(props: ProductSpecsProps) {
20
20
  return (
21
21
  <Row
22
22
  className={classes.root}
23
- sx={[{ typographt: 'subtitle1' }, ...(Array.isArray(sx) ? sx : [sx])]}
23
+ sx={[{ typography: 'subtitle1' }, ...(Array.isArray(sx) ? sx : [sx])]}
24
24
  >
25
25
  <SectionContainer
26
26
  labelLeft={title}
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.0.6",
5
+ "version": "4.1.2",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,18 +12,18 @@
12
12
  }
13
13
  },
14
14
  "devDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^4.0.5",
15
+ "@graphcommerce/eslint-config-pwa": "^4.1.2",
16
16
  "@graphcommerce/prettier-config-pwa": "^4.0.3",
17
17
  "@graphcommerce/typescript-config-pwa": "^4.0.2",
18
18
  "@playwright/test": "^1.19.2"
19
19
  },
20
20
  "dependencies": {
21
- "@graphcommerce/framer-scroller": "^2.0.6",
21
+ "@graphcommerce/framer-scroller": "^2.1.2",
22
22
  "@graphcommerce/graphql": "^3.0.4",
23
23
  "@graphcommerce/image": "^3.1.1",
24
- "@graphcommerce/magento-cart": "^4.1.4",
25
- "@graphcommerce/magento-store": "^4.1.2",
26
- "@graphcommerce/next-ui": "^4.2.4",
24
+ "@graphcommerce/magento-cart": "^4.2.1",
25
+ "@graphcommerce/magento-store": "^4.1.3",
26
+ "@graphcommerce/next-ui": "^4.4.0",
27
27
  "schema-dts": "^1.1.0",
28
28
  "type-fest": "^2.12.0"
29
29
  },