@graphcommerce/framer-utils 3.2.0 → 3.2.1
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/useClientSize.ts +6 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 3.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1675](https://github.com/graphcommerce-org/graphcommerce/pull/1675) [`1b1504c9b`](https://github.com/graphcommerce-org/graphcommerce/commit/1b1504c9b0e51f2787bce91e1ff1940f540411d6) Thanks [@paales](https://github.com/paales)! - Added crosssel functionality
|
|
8
|
+
|
|
9
|
+
- [#1675](https://github.com/graphcommerce-org/graphcommerce/pull/1675) [`6c2e27b1b`](https://github.com/graphcommerce-org/graphcommerce/commit/6c2e27b1be4aaa888e65a2bd69eaeb467a54a023) Thanks [@paales](https://github.com/paales)! - Use event listeners directly for the client-size, because it wasn’t updating properly it seemed
|
|
10
|
+
|
|
3
11
|
## 3.2.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/hooks/useClientSize.ts
CHANGED
|
@@ -19,19 +19,18 @@ export function useClientSizeCssVar() {
|
|
|
19
19
|
if (watching === true) return () => {}
|
|
20
20
|
|
|
21
21
|
const recalc = () => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
document.body.style.setProperty('--client-size-x', `${x.get()}px`)
|
|
25
|
-
document.body.style.setProperty('--client-size-y', `${y.get()}px`)
|
|
26
|
-
}
|
|
22
|
+
document.body.style.setProperty('--client-size-x', `${global.window?.innerWidth ?? 0}px`)
|
|
23
|
+
document.body.style.setProperty('--client-size-y', `${global.window?.innerHeight ?? 0}px`)
|
|
27
24
|
}
|
|
25
|
+
|
|
26
|
+
window.addEventListener('resize', recalc)
|
|
27
|
+
|
|
28
28
|
recalc()
|
|
29
29
|
watching = true
|
|
30
|
-
const reset = clientSize.y.onChange(recalc)
|
|
31
30
|
|
|
32
31
|
return () => {
|
|
33
32
|
watching = false
|
|
34
|
-
|
|
33
|
+
window.removeEventListener('resize', recalc)
|
|
35
34
|
}
|
|
36
35
|
}, [])
|
|
37
36
|
}
|
package/package.json
CHANGED