@graphcommerce/magento-product 9.0.4-canary.1 → 9.0.4-canary.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,33 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.4-canary.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2485](https://github.com/graphcommerce-org/graphcommerce/pull/2485) [`10200f1`](https://github.com/graphcommerce-org/graphcommerce/commit/10200f1eda8a34261ed3975c603b456014d4f8a3) - ProductSpecs now uses `attribute { label }` instead of `useQuery(ProductSpecsTypes)` ([@paales](https://github.com/paales))
8
+
9
+ ## 9.0.4-canary.10
10
+
11
+ ## 9.0.4-canary.9
12
+
13
+ ## 9.0.4-canary.8
14
+
15
+ ## 9.0.4-canary.7
16
+
17
+ ## 9.0.4-canary.6
18
+
19
+ ## 9.0.4-canary.5
20
+
21
+ ## 9.0.4-canary.4
22
+
23
+ ## 9.0.4-canary.3
24
+
25
+ ## 9.0.4-canary.2
26
+
27
+ ### Patch Changes
28
+
29
+ - [#2473](https://github.com/graphcommerce-org/graphcommerce/pull/2473) [`f085c89`](https://github.com/graphcommerce-org/graphcommerce/commit/f085c89416fd91cdc2729f8a6da0ec37d93e8e80) - Solve issue where the ProductListItemsBase was already wrapped in a form. ([@paales](https://github.com/paales))
30
+
3
31
  ## 9.0.4-canary.1
4
32
 
5
33
  ## 9.0.4-canary.0
@@ -1,4 +1,5 @@
1
1
  fragment JsonLdProduct on ProductInterface @inject(into: ["ProductPageItem"]) {
2
+ __typename
2
3
  uid
3
4
  name
4
5
  sku
@@ -1,7 +1,8 @@
1
1
  import { extendableComponent, LazyHydrate, RenderType, responsiveVal } from '@graphcommerce/next-ui'
2
2
  import type { BoxProps, Breakpoint, Theme } from '@mui/material'
3
3
  import { Box, useTheme } from '@mui/material'
4
- import { AddProductsToCartForm } from '../AddProductsToCart'
4
+ import React from 'react'
5
+ import { AddProductsToCartForm, useFormAddProductsToCart } from '../AddProductsToCart'
5
6
  import type { ProductListItemProps } from '../ProductListItem/ProductListItem'
6
7
  import type { ProductListItemsFragment } from './ProductListItems.gql'
7
8
  import type { ProductListItemRenderer } from './renderer'
@@ -84,8 +85,11 @@ export function ProductListItemsBase(props: ProductItemsGridProps) {
84
85
 
85
86
  const classes = withState({ size })
86
87
 
88
+ const context = useFormAddProductsToCart(true)
89
+ const MaybeAddProductsToCartForm = context ? React.Fragment : AddProductsToCartForm
90
+
87
91
  return (
88
- <AddProductsToCartForm>
92
+ <MaybeAddProductsToCartForm>
89
93
  <Box
90
94
  ref={containerRef}
91
95
  className={classes.root}
@@ -130,6 +134,6 @@ export function ProductListItemsBase(props: ProductItemsGridProps) {
130
134
  )}
131
135
  {children}
132
136
  </Box>
133
- </AddProductsToCartForm>
137
+ </MaybeAddProductsToCartForm>
134
138
  )
135
139
  }
@@ -4,5 +4,6 @@ fragment ProductPageDescription on ProductInterface {
4
4
  description {
5
5
  ...ComplexTextValue
6
6
  }
7
+ __typename
7
8
  url_key
8
9
  }
@@ -11,12 +11,11 @@ import type { Variant } from '@mui/material/styles/createTypography'
11
11
  import { ProductPageName } from '../ProductPageName'
12
12
  import type { ProductPageDescriptionFragment } from './ProductPageDescription.gql'
13
13
 
14
- export type ProductPageDescriptionProps = ProductPageDescriptionFragment &
15
- Omit<ColumnTwoWithTopProps, 'top' | 'left'> & {
16
- sx?: SxProps<Theme>
17
- fontSize?: 'responsive' | Variant
18
- product: ProductPageDescriptionFragment
19
- }
14
+ export type ProductPageDescriptionProps = Omit<ColumnTwoWithTopProps, 'top' | 'left'> & {
15
+ sx?: SxProps<Theme>
16
+ fontSize?: 'responsive' | Variant
17
+ product: ProductPageDescriptionFragment
18
+ }
20
19
 
21
20
  const componentName = 'ProductPageDescription'
22
21
  const parts = ['root', 'description'] as const
@@ -1,4 +1,5 @@
1
1
  fragment ProductPageGallery on ProductInterface {
2
+ __typename
2
3
  media_gallery {
3
4
  __typename
4
5
  label
@@ -1,4 +1,5 @@
1
1
  fragment ProductPageName on ProductInterface {
2
2
  name
3
+ __typename
3
4
  url_key
4
5
  }
@@ -1,4 +1,5 @@
1
1
  fragment ProductShortDescription on ProductInterface {
2
+ __typename
2
3
  url_key
3
4
  short_description {
4
5
  ...ComplexTextValue
@@ -17,6 +17,9 @@ fragment ProductSpecs on Products {
17
17
  items {
18
18
  code
19
19
  __typename
20
+ attribute {
21
+ label
22
+ }
20
23
  ... on AttributeValue {
21
24
  value
22
25
  }
@@ -1,8 +1,6 @@
1
- import { useQuery } from '@graphcommerce/graphql'
2
1
  import { extendableComponent, ListFormat } from '@graphcommerce/next-ui'
3
2
  import { Box } from '@mui/material'
4
3
  import type { ProductSpecsFragment } from './ProductSpecs.gql'
5
- import { ProductSpecsTypesDocument } from './ProductSpecsTypes.gql'
6
4
 
7
5
  const name = 'ProductSpecs'
8
6
  const parts = ['root', 'specs', 'options'] as const
@@ -15,19 +13,13 @@ export function ProductSpecsCustomAttributes(props: ProductSpecsCustomAttributes
15
13
 
16
14
  const specs = items?.[0]?.custom_attributesV2?.items
17
15
 
18
- const productSpecsTypes = useQuery(ProductSpecsTypesDocument)
19
-
20
16
  if (items?.length === 0) return null
21
17
 
22
18
  return (
23
19
  <>
24
20
  {specs?.map((item) => (
25
21
  <li key={item?.code}>
26
- <div>
27
- {productSpecsTypes?.data?.attributesList?.items?.find(
28
- (type) => type?.code === item?.code,
29
- )?.label ?? item?.code}
30
- </div>
22
+ <div>{item?.attribute?.label}</div>
31
23
  <Box className={classes.options}>
32
24
  {item?.__typename === 'AttributeSelectedOptions' && (
33
25
  <ListFormat listStyle='long' type='unit'>
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.4-canary.1",
5
+ "version": "9.0.4-canary.11",
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.4-canary.1",
22
- "@graphcommerce/eslint-config-pwa": "^9.0.4-canary.1",
23
- "@graphcommerce/framer-next-pages": "^9.0.4-canary.1",
24
- "@graphcommerce/framer-scroller": "^9.0.4-canary.1",
25
- "@graphcommerce/graphql": "^9.0.4-canary.1",
26
- "@graphcommerce/graphql-mesh": "^9.0.4-canary.1",
27
- "@graphcommerce/image": "^9.0.4-canary.1",
28
- "@graphcommerce/magento-cart": "^9.0.4-canary.1",
29
- "@graphcommerce/magento-store": "^9.0.4-canary.1",
30
- "@graphcommerce/next-ui": "^9.0.4-canary.1",
31
- "@graphcommerce/prettier-config-pwa": "^9.0.4-canary.1",
32
- "@graphcommerce/typescript-config-pwa": "^9.0.4-canary.1",
21
+ "@graphcommerce/ecommerce-ui": "^9.0.4-canary.11",
22
+ "@graphcommerce/eslint-config-pwa": "^9.0.4-canary.11",
23
+ "@graphcommerce/framer-next-pages": "^9.0.4-canary.11",
24
+ "@graphcommerce/framer-scroller": "^9.0.4-canary.11",
25
+ "@graphcommerce/graphql": "^9.0.4-canary.11",
26
+ "@graphcommerce/graphql-mesh": "^9.0.4-canary.11",
27
+ "@graphcommerce/image": "^9.0.4-canary.11",
28
+ "@graphcommerce/magento-cart": "^9.0.4-canary.11",
29
+ "@graphcommerce/magento-store": "^9.0.4-canary.11",
30
+ "@graphcommerce/next-ui": "^9.0.4-canary.11",
31
+ "@graphcommerce/prettier-config-pwa": "^9.0.4-canary.11",
32
+ "@graphcommerce/typescript-config-pwa": "^9.0.4-canary.11",
33
33
  "@lingui/core": "^4.2.1",
34
34
  "@lingui/macro": "^4.2.1",
35
35
  "@lingui/react": "^4.2.1",
@@ -1,8 +0,0 @@
1
- query ProductSpecsTypes {
2
- attributesList(entityType: CATALOG_PRODUCT, filters: { is_visible_on_front: true }) {
3
- items {
4
- code
5
- label
6
- }
7
- }
8
- }