@graphcommerce/framer-scroller 2.1.26 → 2.1.27
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 +9 -0
- package/components/ScrollerProvider.tsx +0 -1
- package/hooks/useScroller.ts +4 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 2.1.27
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1573](https://github.com/graphcommerce-org/graphcommerce/pull/1573) [`87a188d6f`](https://github.com/graphcommerce-org/graphcommerce/commit/87a188d6f216b7f7b9ec95afbe74f1146cb07ce4) Thanks [@paales](https://github.com/paales)! - Sovle issue where changing images in the scroller causes issues rerendering
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`87a188d6f`](https://github.com/graphcommerce-org/graphcommerce/commit/87a188d6f216b7f7b9ec95afbe74f1146cb07ce4), [`1eb131766`](https://github.com/graphcommerce-org/graphcommerce/commit/1eb131766c32db6fcb0a8e83dba2c3d241658595)]:
|
|
10
|
+
- @graphcommerce/next-ui@4.16.0
|
|
11
|
+
|
|
3
12
|
## 2.1.26
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -124,7 +124,6 @@ export function ScrollerProvider(props: ScrollerProviderProps) {
|
|
|
124
124
|
const count = React.Children.count(children)
|
|
125
125
|
if (!count && process.env.NODE_ENV !== 'production')
|
|
126
126
|
console.warn('[@graphcommerce/framer-scroller]: Can not find children')
|
|
127
|
-
if (count === items.get().length) return
|
|
128
127
|
|
|
129
128
|
const itemsArr: unknown[] = items.get().slice()
|
|
130
129
|
itemsArr.length = count
|
package/hooks/useScroller.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
useDomEvent,
|
|
11
11
|
useTransform,
|
|
12
12
|
} from 'framer-motion'
|
|
13
|
-
import React, { ReactHTML, useState } from 'react'
|
|
13
|
+
import React, { ReactHTML, useEffect, useState } from 'react'
|
|
14
14
|
import { isHTMLMousePointerEvent } from '../utils/isHTMLMousePointerEvent'
|
|
15
15
|
import { scrollSnapTypeDirection, SnapTypeDirection } from '../utils/scrollSnapTypeDirection'
|
|
16
16
|
import { useScrollerContext } from './useScrollerContext'
|
|
@@ -46,7 +46,9 @@ export function useScroller<
|
|
|
46
46
|
const { scrollSnap, scrollerRef, enableSnap, disableSnap, snap, registerChildren } =
|
|
47
47
|
useScrollerContext()
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
registerChildren(children)
|
|
51
|
+
}, [children, registerChildren])
|
|
50
52
|
|
|
51
53
|
const scroll = useElementScroll(scrollerRef)
|
|
52
54
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/framer-scroller",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "2.1.
|
|
5
|
+
"version": "2.1.27",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "tsc -W"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@graphcommerce/framer-utils": "3.1.4",
|
|
19
19
|
"@graphcommerce/image": "3.1.7",
|
|
20
|
-
"@graphcommerce/next-ui": "4.
|
|
20
|
+
"@graphcommerce/next-ui": "4.16.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@graphcommerce/eslint-config-pwa": "^4.1.9",
|