@graphcommerce/magento-wishlist 9.1.0-canary.39 → 9.1.0-canary.41

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,17 @@
1
1
  # @graphcommerce/magento-wishlist
2
2
 
3
+ ## 9.1.0-canary.41
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2530](https://github.com/graphcommerce-org/graphcommerce/pull/2530) [`c38c27f`](https://github.com/graphcommerce-org/graphcommerce/commit/c38c27fee77f5ba10db435b2e1532a7527e8155c) - Solve compat issue with adobe commerce ([@paales](https://github.com/paales))
8
+
9
+ ## 9.1.0-canary.40
10
+
11
+ ### Patch Changes
12
+
13
+ - [#2529](https://github.com/graphcommerce-org/graphcommerce/pull/2529) [`b331f4d`](https://github.com/graphcommerce-org/graphcommerce/commit/b331f4d060c1385569fbbe1592ac245832de55bc) - Remove all usages of the NoSsr component as the GraphQL layer already handles this. ([@paales](https://github.com/paales))
14
+
3
15
  ## 9.1.0-canary.39
4
16
 
5
17
  ## 9.1.0-canary.38
@@ -1,7 +1,7 @@
1
1
  import { DesktopHeaderBadge, extendableComponent, iconHeart, IconSvg } from '@graphcommerce/next-ui'
2
2
  import { i18n } from '@lingui/core'
3
3
  import type { BadgeProps, FabProps as FabPropsType, SxProps, Theme } from '@mui/material'
4
- import { Fab, NoSsr } from '@mui/material'
4
+ import { Fab } from '@mui/material'
5
5
  import React from 'react'
6
6
  import { useWishlistEnabled, useWishlistItems } from '../../hooks'
7
7
 
@@ -33,15 +33,13 @@ function WishlistFabContent(props: WishlistFabContentProps) {
33
33
  {...FabProps}
34
34
  sx={sx}
35
35
  >
36
- <NoSsr fallback={wishlistIcon}>
37
- {activeWishlist ? (
38
- <DesktopHeaderBadge color='primary' variant='dot' overlap='circular' {...BadgeProps}>
39
- {wishlistIcon}
40
- </DesktopHeaderBadge>
41
- ) : (
42
- wishlistIcon
43
- )}
44
- </NoSsr>
36
+ {activeWishlist ? (
37
+ <DesktopHeaderBadge color='primary' variant='dot' overlap='circular' {...BadgeProps}>
38
+ {wishlistIcon}
39
+ </DesktopHeaderBadge>
40
+ ) : (
41
+ wishlistIcon
42
+ )}
45
43
  </Fab>
46
44
  )
47
45
  }
@@ -55,9 +53,5 @@ export function WishlistFab(props: WishlistFabProps) {
55
53
  if (!enabled) return null
56
54
  const activeWishlist = wishlist.items.length > 0
57
55
 
58
- return (
59
- <NoSsr fallback={<WishlistFabContent {...props} activeWishlist={false} />}>
60
- <WishlistFabContent {...props} activeWishlist={activeWishlist} />
61
- </NoSsr>
62
- )
56
+ return <WishlistFabContent {...props} activeWishlist={activeWishlist} />
63
57
  }
@@ -1,6 +1,6 @@
1
1
  import { iconHeart, IconSvg, MenuFabSecondaryItem } from '@graphcommerce/next-ui'
2
2
  import type { SxProps, Theme } from '@mui/material'
3
- import { Badge, NoSsr } from '@mui/material'
3
+ import { Badge } from '@mui/material'
4
4
  import type { MouseEventHandler } from 'react'
5
5
  import React from 'react'
6
6
  import { useWishlistItems } from '../../hooks'
@@ -46,9 +46,5 @@ export function WishlistMenuFabItem(props: WishlistMenuFabItemProps) {
46
46
 
47
47
  const activeWishlist = wishlist.items.length > 0
48
48
 
49
- return (
50
- <NoSsr fallback={<WishlistMenuFabItemContent {...props} activeWishlist={false} />}>
51
- <WishlistMenuFabItemContent {...props} activeWishlist={activeWishlist} />
52
- </NoSsr>
53
- )
49
+ return <WishlistMenuFabItemContent {...props} activeWishlist={activeWishlist} />
54
50
  }
@@ -119,7 +119,7 @@ export function useAddProductToWishlistAction(
119
119
  : product.uid,
120
120
  configurable_options: allOptionsSelected ? configurableOptions : [],
121
121
  product,
122
- },
122
+ } as WishlistItemFragment,
123
123
  ]).then(() => setShowSuccess(true))
124
124
  }
125
125
  }
@@ -4,7 +4,7 @@ import {
4
4
  useCustomerSession,
5
5
  useGuestQuery,
6
6
  } from '@graphcommerce/magento-customer'
7
- import { filterNonNullableKeys } from '@graphcommerce/next-ui'
7
+ import { filterNonNullableKeys, nonNullable } from '@graphcommerce/next-ui'
8
8
  import type { WishlistItemFragment } from '../../queries/WishlistItem.gql'
9
9
  import { useWishlistEnabled } from '../useWishlistEnabled/useWishlistEnabled'
10
10
  import type {
@@ -39,19 +39,18 @@ export function useWishlistItems(): UseWishlistItemsReturn {
39
39
  const wishlistGuest = useGuestQuery(UseWishlistGuestDocument, { skip: !enabled })
40
40
 
41
41
  if (loggedIn) {
42
- const items = filterNonNullableKeys(
42
+ const items = (
43
43
  (wishlistCustomer.data ?? wishlistCustomer.previousData)?.customer?.wishlists?.[0]?.items_v2
44
- ?.items,
45
- ['product'],
46
- )
44
+ ?.items ?? []
45
+ ).filter(nonNullable)
47
46
 
48
47
  return { ...wishlistCustomer, enabled, loggedIn: true, items }
49
48
  }
50
49
 
51
- const items = filterNonNullableKeys(
52
- (wishlistGuest.data ?? wishlistGuest.previousData)?.customer?.wishlists?.[0]?.items_v2?.items,
53
- ['product'],
54
- )
50
+ const items = (
51
+ (wishlistGuest.data ?? wishlistGuest.previousData)?.customer?.wishlists?.[0]?.items_v2?.items ??
52
+ []
53
+ ).filter(nonNullable)
55
54
 
56
55
  return { ...wishlistGuest, enabled, loggedIn: false, items }
57
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphcommerce/magento-wishlist",
3
- "version": "9.1.0-canary.39",
3
+ "version": "9.1.0-canary.41",
4
4
  "sideEffects": false,
5
5
  "prettier": "@graphcommerce/prettier-config-pwa",
6
6
  "browserslist": [
@@ -13,20 +13,20 @@
13
13
  }
14
14
  },
15
15
  "peerDependencies": {
16
- "@graphcommerce/ecommerce-ui": "^9.1.0-canary.39",
17
- "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.39",
18
- "@graphcommerce/graphql": "^9.1.0-canary.39",
19
- "@graphcommerce/graphql-mesh": "^9.1.0-canary.39",
20
- "@graphcommerce/image": "^9.1.0-canary.39",
21
- "@graphcommerce/magento-cart": "^9.1.0-canary.39",
22
- "@graphcommerce/magento-customer": "^9.1.0-canary.39",
23
- "@graphcommerce/magento-product": "^9.1.0-canary.39",
24
- "@graphcommerce/magento-product-configurable": "^9.1.0-canary.39",
25
- "@graphcommerce/magento-store": "^9.1.0-canary.39",
26
- "@graphcommerce/next-config": "^9.1.0-canary.39",
27
- "@graphcommerce/next-ui": "^9.1.0-canary.39",
28
- "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.39",
29
- "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.39",
16
+ "@graphcommerce/ecommerce-ui": "^9.1.0-canary.41",
17
+ "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.41",
18
+ "@graphcommerce/graphql": "^9.1.0-canary.41",
19
+ "@graphcommerce/graphql-mesh": "^9.1.0-canary.41",
20
+ "@graphcommerce/image": "^9.1.0-canary.41",
21
+ "@graphcommerce/magento-cart": "^9.1.0-canary.41",
22
+ "@graphcommerce/magento-customer": "^9.1.0-canary.41",
23
+ "@graphcommerce/magento-product": "^9.1.0-canary.41",
24
+ "@graphcommerce/magento-product-configurable": "^9.1.0-canary.41",
25
+ "@graphcommerce/magento-store": "^9.1.0-canary.41",
26
+ "@graphcommerce/next-config": "^9.1.0-canary.41",
27
+ "@graphcommerce/next-ui": "^9.1.0-canary.41",
28
+ "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.41",
29
+ "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.41",
30
30
  "@lingui/core": "^4.2.1",
31
31
  "@lingui/macro": "^4.2.1",
32
32
  "@lingui/react": "^4.2.1",