@graphcommerce/magento-wishlist 9.0.0-canary.76 → 9.0.0-canary.78
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 +8 -0
- package/hooks/useAddProductToWishlistAction.ts +8 -8
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @graphcommerce/magento-wishlist
|
|
2
2
|
|
|
3
|
+
## 9.0.0-canary.78
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2354](https://github.com/graphcommerce-org/graphcommerce/pull/2354) [`811d5e6`](https://github.com/graphcommerce-org/graphcommerce/commit/811d5e60ebafea6c4a0a968fdc366e5e316bc64e) - Contain ripple to wishlist button instead of propagating to product list item ([@bramvanderholst](https://github.com/bramvanderholst))
|
|
8
|
+
|
|
9
|
+
## 9.0.0-canary.77
|
|
10
|
+
|
|
3
11
|
## 9.0.0-canary.76
|
|
4
12
|
|
|
5
13
|
## 9.0.0-canary.75
|
|
@@ -57,12 +57,11 @@ export function useAddProductToWishlistAction(
|
|
|
57
57
|
if (selectedOptions.length !== productOptionsCount) return wishlistOptionsCount === 0
|
|
58
58
|
if (wishlistOptionsCount !== productOptionsCount) return false
|
|
59
59
|
|
|
60
|
-
return selectedOptions.every(
|
|
61
|
-
(
|
|
62
|
-
item.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
),
|
|
60
|
+
return selectedOptions.every((option) =>
|
|
61
|
+
item.configurable_options?.some(
|
|
62
|
+
// If an option is undefined this means the item is a wishlistItem but not all options were selected prior.
|
|
63
|
+
(opt) => opt?.configurable_product_option_value_uid === option,
|
|
64
|
+
),
|
|
66
65
|
)
|
|
67
66
|
})
|
|
68
67
|
|
|
@@ -92,8 +91,8 @@ export function useAddProductToWishlistAction(
|
|
|
92
91
|
const configurableOptions = selectedOptions.map((selected_option) => {
|
|
93
92
|
if (product.__typename !== 'ConfigurableProduct') return null
|
|
94
93
|
|
|
95
|
-
const configurable_option = product.configurable_options?.find(
|
|
96
|
-
|
|
94
|
+
const configurable_option = product.configurable_options?.find((confOption) =>
|
|
95
|
+
confOption?.values?.find((values) => values?.uid === selected_option),
|
|
97
96
|
)
|
|
98
97
|
|
|
99
98
|
const value = configurable_option?.values?.find((values) => values?.uid === selected_option)
|
|
@@ -133,6 +132,7 @@ export function useAddProductToWishlistAction(
|
|
|
133
132
|
}),
|
|
134
133
|
toggleItem: useEventCallback(toggleItem),
|
|
135
134
|
cancelBubble: useEventCallback((e) => {
|
|
135
|
+
e.stopPropagation()
|
|
136
136
|
e.preventDefault()
|
|
137
137
|
}),
|
|
138
138
|
showSuccess,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/magento-wishlist",
|
|
3
|
-
"version": "9.0.0-canary.
|
|
3
|
+
"version": "9.0.0-canary.78",
|
|
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.0.0-canary.
|
|
17
|
-
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.
|
|
18
|
-
"@graphcommerce/graphql": "^9.0.0-canary.
|
|
19
|
-
"@graphcommerce/graphql-mesh": "^9.0.0-canary.
|
|
20
|
-
"@graphcommerce/image": "^9.0.0-canary.
|
|
21
|
-
"@graphcommerce/magento-cart": "^9.0.0-canary.
|
|
22
|
-
"@graphcommerce/magento-customer": "^9.0.0-canary.
|
|
23
|
-
"@graphcommerce/magento-product": "^9.0.0-canary.
|
|
24
|
-
"@graphcommerce/magento-product-configurable": "^9.0.0-canary.
|
|
25
|
-
"@graphcommerce/magento-store": "^9.0.0-canary.
|
|
26
|
-
"@graphcommerce/next-config": "^9.0.0-canary.
|
|
27
|
-
"@graphcommerce/next-ui": "^9.0.0-canary.
|
|
28
|
-
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.
|
|
29
|
-
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.
|
|
16
|
+
"@graphcommerce/ecommerce-ui": "^9.0.0-canary.78",
|
|
17
|
+
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.78",
|
|
18
|
+
"@graphcommerce/graphql": "^9.0.0-canary.78",
|
|
19
|
+
"@graphcommerce/graphql-mesh": "^9.0.0-canary.78",
|
|
20
|
+
"@graphcommerce/image": "^9.0.0-canary.78",
|
|
21
|
+
"@graphcommerce/magento-cart": "^9.0.0-canary.78",
|
|
22
|
+
"@graphcommerce/magento-customer": "^9.0.0-canary.78",
|
|
23
|
+
"@graphcommerce/magento-product": "^9.0.0-canary.78",
|
|
24
|
+
"@graphcommerce/magento-product-configurable": "^9.0.0-canary.78",
|
|
25
|
+
"@graphcommerce/magento-store": "^9.0.0-canary.78",
|
|
26
|
+
"@graphcommerce/next-config": "^9.0.0-canary.78",
|
|
27
|
+
"@graphcommerce/next-ui": "^9.0.0-canary.78",
|
|
28
|
+
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.78",
|
|
29
|
+
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.78",
|
|
30
30
|
"@lingui/core": "^4.2.1",
|
|
31
31
|
"@lingui/macro": "^4.2.1",
|
|
32
32
|
"@lingui/react": "^4.2.1",
|