@graphcommerce/magento-product 9.1.0-canary.44 → 9.1.0-canary.46

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,15 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.1.0-canary.46
4
+
5
+ ## 9.1.0-canary.45
6
+
7
+ ### Patch Changes
8
+
9
+ - [`7d59e59`](https://github.com/graphcommerce-org/graphcommerce/commit/7d59e592b4bc87cb0e05b6128820de2762297f7f) - Make sure you are able to set the defaultValue for the ProductPagePrice when running in total mode, so it works for GroupedProducts that might start with a default quantity of zero. ([@paales](https://github.com/paales))
10
+
11
+ - [`7d59e59`](https://github.com/graphcommerce-org/graphcommerce/commit/7d59e592b4bc87cb0e05b6128820de2762297f7f) - Forward inputProps for AddProductToCartQuantity ([@paales](https://github.com/paales))
12
+
3
13
  ## 9.1.0-canary.44
4
14
 
5
15
  ## 9.1.0-canary.43
@@ -357,7 +367,6 @@
357
367
  - [#1749](https://github.com/graphcommerce-org/graphcommerce/pull/1749) [`0cc472915`](https://github.com/graphcommerce-org/graphcommerce/commit/0cc4729154d316227a41712b5f0adf514768e91f) - Introducing the new ProductFiltersPro component set with completely new filter and UI behavior. Filters will appear as a popper on the md and up breakpoints and as an overlay on sm and below breakpoints. Filters now have an Apply button instead of applying directly. ([@paales](https://github.com/paales))
358
368
 
359
369
  - [#1786](https://github.com/graphcommerce-org/graphcommerce/pull/1786) [`b76679204`](https://github.com/graphcommerce-org/graphcommerce/commit/b766792049e1e6ebe45671c0b36e78746ef159e2) - Created a completely new [GraphCommerce config system](https://www.graphcommerce.org/docs/framework/config) to allow for greater confiugration options and rely less on a .env file to configuration.
360
-
361
370
  - GraphCommerce can be configured in the graphcommerce.config.js
362
371
  - The configuration is automatically validated on startup.
363
372
  - All configuration values can be overwritten by environment variables. ([@paales](https://github.com/paales))
@@ -685,7 +694,6 @@
685
694
  ### Minor Changes
686
695
 
687
696
  - [#1602](https://github.com/graphcommerce-org/graphcommerce/pull/1602) [`5f781a217`](https://github.com/graphcommerce-org/graphcommerce/commit/5f781a217ce63ed56bc1a9983487b04400a8a315) Thanks [@ErwinOtten](https://github.com/ErwinOtten)! - Default styles and layout fixes
688
-
689
697
  - Scaled icons and fonts down. Size in typography is now more gradual: https://graphcommerce.vercel.app/test/typography
690
698
  - Multiple accessibility fixes. Missing button/input labels, and fixed spacing issues resulting in high % appropriately sized tap targets
691
699
  - Replaced responsiveVal usage with better performaning breakpointVal where possible
@@ -7,12 +7,12 @@ import { useFormAddProductsToCart } from './useFormAddProductsToCart'
7
7
 
8
8
  export type AddToCartQuantityProps = Omit<
9
9
  NumberFieldElementProps<AddProductsToCartMutationVariables>,
10
- 'error' | 'required' | 'inputProps' | 'helperText' | 'name' | 'control' | 'rules'
10
+ 'error' | 'required' | 'helperText' | 'name' | 'control' | 'rules'
11
11
  > &
12
12
  AddToCartItemSelector
13
13
 
14
14
  export function AddProductsToCartQuantity(props: AddToCartQuantityProps) {
15
- const { index = 0 } = props
15
+ const { index = 0, inputProps, ...rest } = props
16
16
  const { control } = useFormAddProductsToCart()
17
17
 
18
18
  return (
@@ -21,12 +21,16 @@ export function AddProductsToCartQuantity(props: AddToCartQuantityProps) {
21
21
  size='small'
22
22
  color='primary'
23
23
  required
24
- inputProps={{ min: 1, 'aria-label': i18n._(/* i18n */ 'Add to cart quantity') }}
24
+ inputProps={{
25
+ min: 1,
26
+ 'aria-label': i18n._(/* i18n */ 'Add to cart quantity'),
27
+ ...inputProps,
28
+ }}
25
29
  defaultValue={1}
26
30
  control={control}
27
31
  aria-label={i18n._(/* i18n */ 'Add to cart quantity')}
28
32
  name={`cartItems.${index}.quantity`}
29
- {...props}
33
+ {...rest}
30
34
  />
31
35
  )
32
36
  }
@@ -17,6 +17,7 @@ export type ProductPagePriceProps = {
17
17
  sx?: SxProps<Theme>
18
18
  variant?: 'item' | 'total'
19
19
  asNumber?: boolean
20
+ defaultValue?: number
20
21
  } & AddToCartItemSelector &
21
22
  UseCustomizableOptionPriceProps
22
23
 
@@ -28,10 +29,19 @@ const { classes } = extendableComponent('ProductPagePrice', [
28
29
  ] as const)
29
30
 
30
31
  export function ProductPagePrice(props: ProductPagePriceProps) {
31
- const { product, index = 0, prefix, suffix, sx, variant = 'item', asNumber } = props
32
+ const {
33
+ product,
34
+ index = 0,
35
+ prefix,
36
+ suffix,
37
+ sx,
38
+ variant = 'item',
39
+ asNumber,
40
+ defaultValue = 1,
41
+ } = props
32
42
 
33
43
  const { control } = useFormAddProductsToCart()
34
- const quantity = useWatch({ control, name: `cartItems.${index}.quantity` })
44
+ const quantity = useWatch({ control, name: `cartItems.${index}.quantity`, defaultValue })
35
45
  const price =
36
46
  getProductTierPrice(product, quantity) ?? product.price_range.minimum_price.final_price
37
47
 
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.1.0-canary.44",
5
+ "version": "9.1.0-canary.46",
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.1.0-canary.44",
22
- "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.44",
23
- "@graphcommerce/framer-next-pages": "^9.1.0-canary.44",
24
- "@graphcommerce/framer-scroller": "^9.1.0-canary.44",
25
- "@graphcommerce/graphql": "^9.1.0-canary.44",
26
- "@graphcommerce/graphql-mesh": "^9.1.0-canary.44",
27
- "@graphcommerce/image": "^9.1.0-canary.44",
28
- "@graphcommerce/magento-cart": "^9.1.0-canary.44",
29
- "@graphcommerce/magento-store": "^9.1.0-canary.44",
30
- "@graphcommerce/next-ui": "^9.1.0-canary.44",
31
- "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.44",
32
- "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.44",
21
+ "@graphcommerce/ecommerce-ui": "^9.1.0-canary.46",
22
+ "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.46",
23
+ "@graphcommerce/framer-next-pages": "^9.1.0-canary.46",
24
+ "@graphcommerce/framer-scroller": "^9.1.0-canary.46",
25
+ "@graphcommerce/graphql": "^9.1.0-canary.46",
26
+ "@graphcommerce/graphql-mesh": "^9.1.0-canary.46",
27
+ "@graphcommerce/image": "^9.1.0-canary.46",
28
+ "@graphcommerce/magento-cart": "^9.1.0-canary.46",
29
+ "@graphcommerce/magento-store": "^9.1.0-canary.46",
30
+ "@graphcommerce/next-ui": "^9.1.0-canary.46",
31
+ "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.46",
32
+ "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.46",
33
33
  "@lingui/core": "^4.2.1",
34
34
  "@lingui/macro": "^4.2.1",
35
35
  "@lingui/react": "^4.2.1",