@graphcommerce/magento-product 9.0.0-canary.72 → 9.0.0-canary.74

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,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.0-canary.74
4
+
5
+ ## 9.0.0-canary.73
6
+
3
7
  ## 9.0.0-canary.72
4
8
 
5
9
  ### Minor Changes
@@ -42,7 +42,7 @@ export function ProductFiltersProAggregations(props: ProductFiltersProAggregatio
42
42
  (aggregation) => {
43
43
  const filterType = filterTypes[aggregation.attribute_code]
44
44
  if (!filterType) {
45
- console.log('Filter not recognized', aggregation.attribute_code, filterTypes)
45
+ // console.log('Filter not recognized', aggregation.attribute_code, filterTypes)
46
46
  return null
47
47
  }
48
48
 
@@ -1,8 +1,8 @@
1
1
  import { LazyHydrate, RenderType, extendableComponent, responsiveVal } from '@graphcommerce/next-ui'
2
2
  import { Box, BoxProps, Breakpoint, Theme, useTheme } from '@mui/material'
3
- import { ProductListItemFragment } from '../../Api/ProductListItem.gql'
4
3
  import { AddProductsToCartForm } from '../AddProductsToCart'
5
4
  import { ProductListItemProps } from '../ProductListItem/ProductListItem'
5
+ import { ProductListItemsFragment } from './ProductListItems.gql'
6
6
  import { ProductListItemRenderer } from './renderer'
7
7
 
8
8
  type ComponentState = {
@@ -30,27 +30,25 @@ type ColumnConfig = {
30
30
 
31
31
  type ColumnsConfig = Partial<Record<Breakpoint, ColumnConfig>>
32
32
 
33
- export type ProductItemsGridProps = {
34
- items?:
35
- | Array<(ProductListItemFragment & ProductListItemProps) | null | undefined>
36
- | null
37
- | undefined
33
+ export type ProductItemsGridProps = ProductListItemsFragment & {
38
34
  renderers: ProductListItemRenderer
39
35
  loadingEager?: number
40
36
  title: string
41
37
  sx?: BoxProps['sx']
42
38
  columns?: ((theme: Theme) => ColumnsConfig) | ColumnsConfig
39
+ containerRef?: React.Ref<HTMLDivElement>
43
40
  } & Pick<ProductListItemProps, 'onClick' | 'titleComponent'> &
44
41
  ComponentState
45
42
 
46
43
  const slots = ['root'] as const
47
- const name = 'ProductListItemsBase' as const
44
+ const name = 'ProductListItemsBase'
48
45
 
49
46
  const { withState } = extendableComponent<ComponentState, typeof name, typeof slots>(name, slots)
50
47
 
51
48
  export function ProductListItemsBase(props: ProductItemsGridProps) {
52
49
  const {
53
50
  items,
51
+ containerRef,
54
52
  sx = [],
55
53
  renderers,
56
54
  loadingEager = 0,
@@ -84,6 +82,7 @@ export function ProductListItemsBase(props: ProductItemsGridProps) {
84
82
  return (
85
83
  <AddProductsToCartForm>
86
84
  <Box
85
+ ref={containerRef}
87
86
  className={classes.root}
88
87
  sx={[
89
88
  ...Object.entries(columnConfig).map(([key, column]) => ({
@@ -52,7 +52,7 @@ export type AnyFilterType =
52
52
  export function isFilterTypeEqual(filter?: unknown): filter is FilterEqualTypeInput {
53
53
  return Boolean(
54
54
  filter &&
55
- ('in' in (filter as FilterEqualTypeInput) || 'from' in (filter as FilterEqualTypeInput)),
55
+ ('in' in (filter as FilterEqualTypeInput) || 'eq' in (filter as FilterEqualTypeInput)),
56
56
  )
57
57
  }
58
58
 
@@ -72,7 +72,7 @@ export function toProductListParams(params: ProductFilterParams): ProductListPar
72
72
 
73
73
  const newFilers = Object.fromEntries(
74
74
  Object.entries(filters).filter(([, value]) => {
75
- if (isFilterTypeEqual(value)) return Boolean(value.in)
75
+ if (isFilterTypeEqual(value)) return Boolean(value.in || value.eq)
76
76
  if (isFilterTypeMatch(value)) return Boolean(value.match)
77
77
  if (isFilterTypeRange(value)) return Boolean(value.from || value.to)
78
78
  return false
@@ -50,15 +50,15 @@ export const prefetchProductList = debounce(
50
50
  variables: { ...variables, context },
51
51
  })
52
52
 
53
- const productFilters = client.query({
54
- query: ProductFiltersDocument,
55
- variables: {
56
- ...filtersVariables,
57
- context,
58
- },
59
- })
60
-
61
- const both = Promise.all([productList, productFilters])
53
+ // const productFilters = client.query({
54
+ // query: ProductFiltersDocument,
55
+ // variables: {
56
+ // ...filtersVariables,
57
+ // context,
58
+ // },
59
+ // })
60
+
61
+ const both = Promise.all([productList])
62
62
 
63
63
  // Push the query to the queue array.
64
64
  productListQueries.push(both)
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.0-canary.72",
5
+ "version": "9.0.0-canary.74",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -18,19 +18,18 @@
18
18
  "typescript": "5.5.3"
19
19
  },
20
20
  "peerDependencies": {
21
- "@graphcommerce/ecommerce-ui": "^9.0.0-canary.72",
22
- "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.72",
23
- "@graphcommerce/framer-next-pages": "^9.0.0-canary.72",
24
- "@graphcommerce/framer-scroller": "^9.0.0-canary.72",
25
- "@graphcommerce/graphql": "^9.0.0-canary.72",
26
- "@graphcommerce/graphql-mesh": "^9.0.0-canary.72",
27
- "@graphcommerce/image": "^9.0.0-canary.72",
28
- "@graphcommerce/magento-cart": "^9.0.0-canary.72",
29
- "@graphcommerce/magento-category": "^9.0.0-canary.72",
30
- "@graphcommerce/magento-store": "^9.0.0-canary.72",
31
- "@graphcommerce/next-ui": "^9.0.0-canary.72",
32
- "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.72",
33
- "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.72",
21
+ "@graphcommerce/ecommerce-ui": "^9.0.0-canary.74",
22
+ "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.74",
23
+ "@graphcommerce/framer-next-pages": "^9.0.0-canary.74",
24
+ "@graphcommerce/framer-scroller": "^9.0.0-canary.74",
25
+ "@graphcommerce/graphql": "^9.0.0-canary.74",
26
+ "@graphcommerce/graphql-mesh": "^9.0.0-canary.74",
27
+ "@graphcommerce/image": "^9.0.0-canary.74",
28
+ "@graphcommerce/magento-cart": "^9.0.0-canary.74",
29
+ "@graphcommerce/magento-store": "^9.0.0-canary.74",
30
+ "@graphcommerce/next-ui": "^9.0.0-canary.74",
31
+ "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.74",
32
+ "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.74",
34
33
  "@lingui/core": "^4.2.1",
35
34
  "@lingui/macro": "^4.2.1",
36
35
  "@lingui/react": "^4.2.1",