@graphcommerce/magento-product 8.1.0-canary.43 → 8.1.0-canary.45

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.
Files changed (52) hide show
  1. package/Api/ProductListItem.graphql +0 -1
  2. package/CHANGELOG.md +4 -0
  3. package/components/AddProductsToCart/AddProductsToCartButton.tsx +2 -2
  4. package/components/AddProductsToCart/AddProductsToCartFab.tsx +2 -2
  5. package/components/AddProductsToCart/AddProductsToCartForm.tsx +24 -26
  6. package/components/AddProductsToCart/AddProductsToCartSnackbar.tsx +25 -16
  7. package/components/ProductAddToCart/ProductAddToCart.tsx +6 -8
  8. package/components/ProductFiltersPro/PriceSlider.tsx +1 -2
  9. package/components/ProductFiltersPro/ProductFilterEqualChip.tsx +1 -1
  10. package/components/ProductFiltersPro/ProductFilterEqualSection.tsx +2 -2
  11. package/components/ProductFiltersPro/ProductFilterRangeChip.tsx +1 -1
  12. package/components/ProductFiltersPro/ProductFilterRangeSection.tsx +1 -1
  13. package/components/ProductFiltersPro/ProductFiltersPro.tsx +79 -17
  14. package/components/ProductFiltersPro/ProductFiltersProAggregations.tsx +17 -18
  15. package/components/ProductFiltersPro/ProductFiltersProAllFiltersChip.tsx +2 -2
  16. package/components/ProductFiltersPro/ProductFiltersProCategorySection.tsx +99 -39
  17. package/components/ProductFiltersPro/ProductFiltersProClearAll.tsx +4 -16
  18. package/components/ProductFiltersPro/ProductFiltersProLimitSection.tsx +1 -1
  19. package/components/ProductFiltersPro/ProductFiltersProNoResults.tsx +79 -0
  20. package/components/ProductFiltersPro/ProductFiltersProSortChip.tsx +1 -1
  21. package/components/ProductFiltersPro/ProductFiltersProSortSection.tsx +1 -1
  22. package/components/ProductFiltersPro/activeAggregations.ts +5 -9
  23. package/components/ProductFiltersPro/applyAggregationCount.ts +14 -8
  24. package/components/ProductFiltersPro/index.ts +4 -1
  25. package/components/ProductFiltersPro/{useClearAllFiltersHandler.ts → useProductFiltersProClearAllAction.ts} +1 -1
  26. package/components/ProductFiltersPro/useProductFiltersProHasFiltersApplied.ts +21 -0
  27. package/components/ProductList/ProductList.graphql +8 -5
  28. package/components/ProductListCount/ProductListCount.tsx +3 -1
  29. package/components/ProductListFilters/ProductFilters.graphql +7 -2
  30. package/components/ProductListFilters/ProductListFilters.graphql +1 -1
  31. package/components/ProductListItem/ProductDiscountLabel.tsx +2 -3
  32. package/components/ProductListItem/ProductListItem.tsx +3 -3
  33. package/components/ProductListItem/ProductListItemTitleAndPrice.tsx +18 -15
  34. package/components/ProductListItems/ProductListItemsBase.tsx +65 -23
  35. package/components/ProductListItems/filterTypes.tsx +14 -5
  36. package/components/ProductListItems/filteredProductList.tsx +23 -0
  37. package/components/ProductListItems/productListApplyCategoryDefaults.ts +44 -4
  38. package/components/ProductListItems/renderer.tsx +8 -2
  39. package/components/ProductListPagination/ProductListPagination.tsx +3 -1
  40. package/components/ProductListPrice/ProductListPrice.tsx +9 -4
  41. package/components/ProductListSuggestions/ProductListSuggestions.graphql +5 -0
  42. package/components/ProductListSuggestions/ProductListSuggestions.tsx +42 -0
  43. package/components/ProductPageDescription/ProductPageDescription.tsx +1 -1
  44. package/components/ProductPagePrice/ProductPagePrice.graphql +0 -6
  45. package/components/ProductPagePrice/ProductPagePrice.tsx +19 -12
  46. package/components/ProductPagePrice/ProductPagePriceTiers.tsx +4 -3
  47. package/components/ProductWeight/ProductWeight.tsx +12 -9
  48. package/components/index.ts +2 -0
  49. package/hooks/useProductList.ts +123 -0
  50. package/hooks/useProductListLink.ts +6 -3
  51. package/index.ts +1 -0
  52. package/package.json +14 -14
@@ -8,11 +8,14 @@ import {
8
8
  } from '../components/ProductListItems/filterTypes'
9
9
 
10
10
  export function productListLinkFromFilter(props: ProductFilterParams): string {
11
- const { url, sort, dir, currentPage, pageSize, filters: incoming } = props
11
+ const { url, sort, dir, currentPage, pageSize, filters: incoming, search } = props
12
12
  const isSearch = url.startsWith('search')
13
13
  const filters = isSearch ? incoming : { ...incoming, category_uid: undefined }
14
14
  const uid = incoming?.category_uid?.eq || incoming?.category_uid?.in?.[0]
15
15
 
16
+ let urlBase = url
17
+ if (isSearch) urlBase = search ? `search/${search}` : 'search'
18
+
16
19
  // base url path generation
17
20
  let paginateSort = ``
18
21
  let query = ``
@@ -38,9 +41,9 @@ export function productListLinkFromFilter(props: ProductFilterParams): string {
38
41
 
39
42
  // it's a category with filters, use the /c/ route.
40
43
  if (query && !isSearch)
41
- return `/c/${url}${paginateSort}/q${uid ? `/category_uid/${uid}` : ''}${query}`
44
+ return `/c/${urlBase}${paginateSort}/q${uid ? `/category_uid/${uid}` : ''}${query}`
42
45
 
43
- return query ? `/${url}${paginateSort}/q${query}` : `/${url}${paginateSort}`
46
+ return query ? `/${urlBase}${paginateSort}/q${query}` : `/${urlBase}${paginateSort}`
44
47
  }
45
48
 
46
49
  export function productListLink(props: ProductListParams): string {
package/index.ts CHANGED
@@ -5,4 +5,5 @@ export * from './hooks/useProductLink'
5
5
  export * from './hooks/useProductListLink'
6
6
  export * from './hooks/useProductListLinkReplace'
7
7
  export * from './hooks/useProductListParamsContext'
8
+ export * from './hooks/useProductList'
8
9
  export * from './hooks/ProductLink.gql'
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": "8.1.0-canary.43",
5
+ "version": "8.1.0-canary.45",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -18,19 +18,19 @@
18
18
  "typescript": "5.3.3"
19
19
  },
20
20
  "peerDependencies": {
21
- "@graphcommerce/ecommerce-ui": "^8.1.0-canary.43",
22
- "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.43",
23
- "@graphcommerce/framer-next-pages": "^8.1.0-canary.43",
24
- "@graphcommerce/framer-scroller": "^8.1.0-canary.43",
25
- "@graphcommerce/graphql": "^8.1.0-canary.43",
26
- "@graphcommerce/graphql-mesh": "^8.1.0-canary.43",
27
- "@graphcommerce/image": "^8.1.0-canary.43",
28
- "@graphcommerce/magento-cart": "^8.1.0-canary.43",
29
- "@graphcommerce/magento-category": "^8.1.0-canary.43",
30
- "@graphcommerce/magento-store": "^8.1.0-canary.43",
31
- "@graphcommerce/next-ui": "^8.1.0-canary.43",
32
- "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.43",
33
- "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.43",
21
+ "@graphcommerce/ecommerce-ui": "^8.1.0-canary.45",
22
+ "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.45",
23
+ "@graphcommerce/framer-next-pages": "^8.1.0-canary.45",
24
+ "@graphcommerce/framer-scroller": "^8.1.0-canary.45",
25
+ "@graphcommerce/graphql": "^8.1.0-canary.45",
26
+ "@graphcommerce/graphql-mesh": "^8.1.0-canary.45",
27
+ "@graphcommerce/image": "^8.1.0-canary.45",
28
+ "@graphcommerce/magento-cart": "^8.1.0-canary.45",
29
+ "@graphcommerce/magento-category": "^8.1.0-canary.45",
30
+ "@graphcommerce/magento-store": "^8.1.0-canary.45",
31
+ "@graphcommerce/next-ui": "^8.1.0-canary.45",
32
+ "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.45",
33
+ "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.45",
34
34
  "@lingui/core": "^4.2.1",
35
35
  "@lingui/macro": "^4.2.1",
36
36
  "@lingui/react": "^4.2.1",