@graphcommerce/magento-compare 8.0.6-canary.4 → 8.0.7
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 +4 -17
- package/components/CompareListForm.tsx +4 -8
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
# @graphcommerce/magento-compare
|
|
2
2
|
|
|
3
|
-
## 8.0.
|
|
3
|
+
## 8.0.7
|
|
4
4
|
|
|
5
|
-
## 8.0.6
|
|
6
|
-
|
|
7
|
-
## 8.0.6-canary.2
|
|
8
|
-
|
|
9
|
-
### Patch Changes
|
|
10
|
-
|
|
11
|
-
- [#2234](https://github.com/graphcommerce-org/graphcommerce/pull/2234) [`530076e`](https://github.com/graphcommerce-org/graphcommerce/commit/530076e3664703cb8b577b7fcf1998a420819f60) - Moved all usages of useFormPersist to the <FormPersist/> component to prevent rerenders.
|
|
12
|
-
([@FrankHarland](https://github.com/FrankHarland))
|
|
13
|
-
|
|
14
|
-
## 8.0.6-canary.1
|
|
15
|
-
|
|
16
|
-
## 8.0.6-canary.0
|
|
5
|
+
## 8.0.6
|
|
17
6
|
|
|
18
7
|
## 8.0.5
|
|
19
8
|
|
|
@@ -87,8 +76,7 @@
|
|
|
87
76
|
|
|
88
77
|
### Patch Changes
|
|
89
78
|
|
|
90
|
-
- [#2132](https://github.com/graphcommerce-org/graphcommerce/pull/2132) [`993f655`](https://github.com/graphcommerce-org/graphcommerce/commit/993f6559226f0ce2b63f372ccfc1409805b06a8d) - Compare button didn't have a proper hover state on the product page.
|
|
91
|
-
([@action-simon](https://github.com/action-simon))
|
|
79
|
+
- [#2132](https://github.com/graphcommerce-org/graphcommerce/pull/2132) [`993f655`](https://github.com/graphcommerce-org/graphcommerce/commit/993f6559226f0ce2b63f372ccfc1409805b06a8d) - Compare button didn't have a proper hover state on the product page. ([@action-simon](https://github.com/action-simon))
|
|
92
80
|
|
|
93
81
|
## 8.0.0-canary.100
|
|
94
82
|
|
|
@@ -148,8 +136,7 @@
|
|
|
148
136
|
|
|
149
137
|
### Patch Changes
|
|
150
138
|
|
|
151
|
-
- [#2132](https://github.com/graphcommerce-org/graphcommerce/pull/2132) [`993f655`](https://github.com/graphcommerce-org/graphcommerce/commit/993f6559226f0ce2b63f372ccfc1409805b06a8d) - Fix compare button hover state on product page
|
|
152
|
-
([@action-simon](https://github.com/action-simon))
|
|
139
|
+
- [#2132](https://github.com/graphcommerce-org/graphcommerce/pull/2132) [`993f655`](https://github.com/graphcommerce-org/graphcommerce/commit/993f6559226f0ce2b63f372ccfc1409805b06a8d) - Fix compare button hover state on product page ([@action-simon](https://github.com/action-simon))
|
|
153
140
|
|
|
154
141
|
## 8.0.0-canary.72
|
|
155
142
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useForm, useFormPersist, UseFormReturn, useWatch } from '@graphcommerce/ecommerce-ui'
|
|
2
2
|
import { filterNonNullableKeys, nonNullable } from '@graphcommerce/next-ui'
|
|
3
3
|
import React, { createContext, useContext, useEffect, useMemo, useRef } from 'react'
|
|
4
4
|
import { useCompareList } from '../hooks'
|
|
@@ -25,6 +25,7 @@ export function CompareListForm(props: CompareListFormProps) {
|
|
|
25
25
|
defaultValues: { selected: [...Array(gridColumns).keys()] },
|
|
26
26
|
})
|
|
27
27
|
|
|
28
|
+
useFormPersist({ form, name: 'CompareList', storage: 'localStorage' })
|
|
28
29
|
const selectedState = form.watch('selected')
|
|
29
30
|
const selectedPrevious = useRef<number[]>(selectedState)
|
|
30
31
|
const compareAbleItems = compareListData?.compareList?.items
|
|
@@ -59,15 +60,10 @@ export function CompareListForm(props: CompareListFormProps) {
|
|
|
59
60
|
}, [compareAbleItems?.length, compareListCount, form, gridColumns, selectedState])
|
|
60
61
|
|
|
61
62
|
const value = useMemo(
|
|
62
|
-
() => ({ ...form, selectedPrevious }
|
|
63
|
+
() => ({ ...form, selectedPrevious } satisfies CompareFormContextType),
|
|
63
64
|
[form],
|
|
64
65
|
)
|
|
65
|
-
return
|
|
66
|
-
<CompareFormContext.Provider value={value}>
|
|
67
|
-
<FormPersist form={form} name='CompareList' />
|
|
68
|
-
{children}
|
|
69
|
-
</CompareFormContext.Provider>
|
|
70
|
-
)
|
|
66
|
+
return <CompareFormContext.Provider value={value}>{children}</CompareFormContext.Provider>
|
|
71
67
|
}
|
|
72
68
|
|
|
73
69
|
export function useCompareForm() {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-compare",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "8.0.
|
|
5
|
+
"version": "8.0.7",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@graphcommerce/ecommerce-ui": "^8.0.
|
|
16
|
-
"@graphcommerce/eslint-config-pwa": "^8.0.
|
|
17
|
-
"@graphcommerce/framer-next-pages": "^8.0.
|
|
18
|
-
"@graphcommerce/framer-utils": "^8.0.
|
|
19
|
-
"@graphcommerce/graphql": "^8.0.
|
|
20
|
-
"@graphcommerce/magento-cart": "^8.0.
|
|
21
|
-
"@graphcommerce/magento-product": "^8.0.
|
|
22
|
-
"@graphcommerce/next-ui": "^8.0.
|
|
23
|
-
"@graphcommerce/prettier-config-pwa": "^8.0.
|
|
24
|
-
"@graphcommerce/typescript-config-pwa": "^8.0.
|
|
15
|
+
"@graphcommerce/ecommerce-ui": "^8.0.7",
|
|
16
|
+
"@graphcommerce/eslint-config-pwa": "^8.0.7",
|
|
17
|
+
"@graphcommerce/framer-next-pages": "^8.0.7",
|
|
18
|
+
"@graphcommerce/framer-utils": "^8.0.7",
|
|
19
|
+
"@graphcommerce/graphql": "^8.0.7",
|
|
20
|
+
"@graphcommerce/magento-cart": "^8.0.7",
|
|
21
|
+
"@graphcommerce/magento-product": "^8.0.7",
|
|
22
|
+
"@graphcommerce/next-ui": "^8.0.7",
|
|
23
|
+
"@graphcommerce/prettier-config-pwa": "^8.0.7",
|
|
24
|
+
"@graphcommerce/typescript-config-pwa": "^8.0.7",
|
|
25
25
|
"@lingui/core": "^4.2.1",
|
|
26
26
|
"@lingui/macro": "^4.2.1",
|
|
27
27
|
"@lingui/react": "^4.2.1",
|