@graphcommerce/framer-scroller 2.1.25 → 2.1.28

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,28 @@
1
1
  # Change Log
2
2
 
3
+ ## 2.1.28
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`b6ce5548c`](https://github.com/graphcommerce-org/graphcommerce/commit/b6ce5548c66a8ca62d3aee29467045f7f07f30c8)]:
8
+ - @graphcommerce/next-ui@4.17.0
9
+
10
+ ## 2.1.27
11
+
12
+ ### Patch Changes
13
+
14
+ - [#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
15
+
16
+ - Updated dependencies [[`87a188d6f`](https://github.com/graphcommerce-org/graphcommerce/commit/87a188d6f216b7f7b9ec95afbe74f1146cb07ce4), [`1eb131766`](https://github.com/graphcommerce-org/graphcommerce/commit/1eb131766c32db6fcb0a8e83dba2c3d241658595)]:
17
+ - @graphcommerce/next-ui@4.16.0
18
+
19
+ ## 2.1.26
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies [[`a88f166f0`](https://github.com/graphcommerce-org/graphcommerce/commit/a88f166f0115c58254fe47171da51a5850658a32)]:
24
+ - @graphcommerce/next-ui@4.15.1
25
+
3
26
  ## 2.1.25
4
27
 
5
28
  ### 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
@@ -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
- registerChildren(children)
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.25",
5
+ "version": "2.1.28",
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.15.0"
20
+ "@graphcommerce/next-ui": "4.17.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@graphcommerce/eslint-config-pwa": "^4.1.9",