@graphcommerce/framer-scroller 2.0.3 → 2.0.6
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 +99 -154
- package/components/MotionImageAspect.tsx +1 -3
- package/components/Scroller.tsx +5 -4
- package/components/ScrollerButton.tsx +3 -5
- package/components/ScrollerDots.tsx +1 -3
- package/components/ScrollerPageCounter.tsx +1 -3
- package/components/ScrollerProvider.tsx +1 -1
- package/hooks/useScrollTo.ts +1 -0
- package/hooks/useScroller.ts +5 -5
- package/index.ts +1 -11
- package/package.json +7 -7
- package/types.ts +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,43 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 2.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1307](https://github.com/ho-nl/m2-pwa/pull/1307) [`bd10506d3`](https://github.com/ho-nl/m2-pwa/commit/bd10506d32fdbc91d01dadc29a12ebd1e0943655) Thanks [@paales](https://github.com/paales)! - All default exports are now named exports internally and all `index.tsx` are renamed to the component name.
|
|
8
|
+
|
|
9
|
+
* [#1307](https://github.com/ho-nl/m2-pwa/pull/1307) [`27cb1f2d8`](https://github.com/ho-nl/m2-pwa/commit/27cb1f2d8dbfb8f1b301ce56fb6a2b6c1fc6a5ef) Thanks [@paales](https://github.com/paales)! - upgrade dependencies
|
|
10
|
+
|
|
11
|
+
* Updated dependencies [[`3d63b39f7`](https://github.com/ho-nl/m2-pwa/commit/3d63b39f7e330d1827a32dba782667d7b21adaba), [`bd10506d3`](https://github.com/ho-nl/m2-pwa/commit/bd10506d32fdbc91d01dadc29a12ebd1e0943655), [`27cb1f2d8`](https://github.com/ho-nl/m2-pwa/commit/27cb1f2d8dbfb8f1b301ce56fb6a2b6c1fc6a5ef)]:
|
|
12
|
+
- @graphcommerce/next-ui@4.2.4
|
|
13
|
+
- @graphcommerce/framer-utils@3.0.4
|
|
14
|
+
- @graphcommerce/image@3.1.1
|
|
15
|
+
|
|
16
|
+
## 2.0.5
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [#1294](https://github.com/ho-nl/m2-pwa/pull/1294) [`4e28c8afd`](https://github.com/ho-nl/m2-pwa/commit/4e28c8afd9cead3577dd0eff97b5c44ba4c1c862) Thanks [@paales](https://github.com/paales)! - set the duration of useScrollTo to 500 for the x direction
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [[`19f33e0aa`](https://github.com/ho-nl/m2-pwa/commit/19f33e0aaf4e3121edd444926d08b6459d3ef400), [`aea787542`](https://github.com/ho-nl/m2-pwa/commit/aea787542484a0480a48031fcc4a9a5566c6bfc7)]:
|
|
23
|
+
- @graphcommerce/next-ui@4.2.1
|
|
24
|
+
|
|
25
|
+
## 2.0.4
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- [#1285](https://github.com/ho-nl/m2-pwa/pull/1285) [`16d77b280`](https://github.com/ho-nl/m2-pwa/commit/16d77b2806e49e376d06bc0d578d38eb724b0c17) Thanks [@paales](https://github.com/paales)! - allow scroller button to be overwritten
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [[`c85294ba6`](https://github.com/ho-nl/m2-pwa/commit/c85294ba6d742ce78c074559a1e95409b25a5017)]:
|
|
32
|
+
- @graphcommerce/next-ui@4.1.3
|
|
33
|
+
|
|
3
34
|
## 2.0.3
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
|
6
37
|
|
|
7
|
-
- [`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96)
|
|
8
|
-
Thanks [@paales](https://github.com/paales)! - made packages public
|
|
38
|
+
- [`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96) Thanks [@paales](https://github.com/paales)! - made packages public
|
|
9
39
|
|
|
10
|
-
- Updated dependencies
|
|
11
|
-
[[`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96),
|
|
12
|
-
[`81ea406d5`](https://github.com/ho-nl/m2-pwa/commit/81ea406d54d6b5c662c030a7fea444abc4117a20),
|
|
13
|
-
[`3a719c88c`](https://github.com/ho-nl/m2-pwa/commit/3a719c88cad1eab58602de28c41adc0fc4827e1d),
|
|
14
|
-
[`5ffcb56bf`](https://github.com/ho-nl/m2-pwa/commit/5ffcb56bfcbe49ebeaf24f9341e819a145ab9a14)]:
|
|
40
|
+
- Updated dependencies [[`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96), [`81ea406d5`](https://github.com/ho-nl/m2-pwa/commit/81ea406d54d6b5c662c030a7fea444abc4117a20), [`3a719c88c`](https://github.com/ho-nl/m2-pwa/commit/3a719c88cad1eab58602de28c41adc0fc4827e1d), [`5ffcb56bf`](https://github.com/ho-nl/m2-pwa/commit/5ffcb56bfcbe49ebeaf24f9341e819a145ab9a14)]:
|
|
15
41
|
- @graphcommerce/framer-utils@3.0.3
|
|
16
42
|
- @graphcommerce/image@3.1.0
|
|
17
43
|
- @graphcommerce/next-ui@4.1.2
|
|
@@ -20,28 +46,13 @@
|
|
|
20
46
|
|
|
21
47
|
### Patch Changes
|
|
22
48
|
|
|
23
|
-
- [#1276](https://github.com/ho-nl/m2-pwa/pull/1276)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
* [
|
|
30
|
-
[`52a45bba4`](https://github.com/ho-nl/m2-pwa/commit/52a45bba4dc6dd6df3c81f5023df7d23ed8a534d)
|
|
31
|
-
Thanks [@paales](https://github.com/paales)! - Upgraded to
|
|
32
|
-
[NextJS 12.1](https://nextjs.org/blog/next-12-1)! This is just for compatibility, but we'll be
|
|
33
|
-
implementing
|
|
34
|
-
[On-demand Incremental Static Regeneration](https://nextjs.org/blog/next-12-1#on-demand-incremental-static-regeneration-beta)
|
|
35
|
-
soon.
|
|
36
|
-
|
|
37
|
-
This will greatly reduce the requirement to rebuid stuff and we'll add a management UI on the
|
|
38
|
-
frontend to be able to revalidate pages manually.
|
|
39
|
-
|
|
40
|
-
* Updated dependencies
|
|
41
|
-
[[`381e4c86a`](https://github.com/ho-nl/m2-pwa/commit/381e4c86a8321ce96e1fa5c7d3c0a0c0ff3e02c7),
|
|
42
|
-
[`ce09388e0`](https://github.com/ho-nl/m2-pwa/commit/ce09388e0d7ef33aee660612340f6fbae15ceec2),
|
|
43
|
-
[`e7c8e2756`](https://github.com/ho-nl/m2-pwa/commit/e7c8e2756d637cbcd2e793d62ef5721d35d9fa7b),
|
|
44
|
-
[`52a45bba4`](https://github.com/ho-nl/m2-pwa/commit/52a45bba4dc6dd6df3c81f5023df7d23ed8a534d)]:
|
|
49
|
+
- [#1276](https://github.com/ho-nl/m2-pwa/pull/1276) [`ce09388e0`](https://github.com/ho-nl/m2-pwa/commit/ce09388e0d7ef33aee660612340f6fbae15ceec2) Thanks [@paales](https://github.com/paales)! - We've moved lots of internal packages from `dependencies` to `peerDependencies`. The result of this is that there will be significantly less duplicate packages in the node_modules folders.
|
|
50
|
+
|
|
51
|
+
* [#1276](https://github.com/ho-nl/m2-pwa/pull/1276) [`52a45bba4`](https://github.com/ho-nl/m2-pwa/commit/52a45bba4dc6dd6df3c81f5023df7d23ed8a534d) Thanks [@paales](https://github.com/paales)! - Upgraded to [NextJS 12.1](https://nextjs.org/blog/next-12-1)! This is just for compatibility, but we'll be implementing [On-demand Incremental Static Regeneration](https://nextjs.org/blog/next-12-1#on-demand-incremental-static-regeneration-beta) soon.
|
|
52
|
+
|
|
53
|
+
This will greatly reduce the requirement to rebuid stuff and we'll add a management UI on the frontend to be able to revalidate pages manually.
|
|
54
|
+
|
|
55
|
+
* Updated dependencies [[`381e4c86a`](https://github.com/ho-nl/m2-pwa/commit/381e4c86a8321ce96e1fa5c7d3c0a0c0ff3e02c7), [`ce09388e0`](https://github.com/ho-nl/m2-pwa/commit/ce09388e0d7ef33aee660612340f6fbae15ceec2), [`e7c8e2756`](https://github.com/ho-nl/m2-pwa/commit/e7c8e2756d637cbcd2e793d62ef5721d35d9fa7b), [`52a45bba4`](https://github.com/ho-nl/m2-pwa/commit/52a45bba4dc6dd6df3c81f5023df7d23ed8a534d)]:
|
|
45
56
|
- @graphcommerce/next-ui@4.1.1
|
|
46
57
|
- @graphcommerce/framer-utils@3.0.2
|
|
47
58
|
- @graphcommerce/image@3.0.2
|
|
@@ -50,11 +61,8 @@
|
|
|
50
61
|
|
|
51
62
|
### Patch Changes
|
|
52
63
|
|
|
53
|
-
- [`0cbaa878b`](https://github.com/ho-nl/m2-pwa/commit/0cbaa878b8a844d5abbeb1797b625a33130e6514)
|
|
54
|
-
|
|
55
|
-
so that the packages link to back to the website and repository
|
|
56
|
-
- Updated dependencies
|
|
57
|
-
[[`0cbaa878b`](https://github.com/ho-nl/m2-pwa/commit/0cbaa878b8a844d5abbeb1797b625a33130e6514)]:
|
|
64
|
+
- [`0cbaa878b`](https://github.com/ho-nl/m2-pwa/commit/0cbaa878b8a844d5abbeb1797b625a33130e6514) Thanks [@paales](https://github.com/paales)! - Added homepage and repository package.json files, so that the packages link to back to the website and repository
|
|
65
|
+
- Updated dependencies [[`0cbaa878b`](https://github.com/ho-nl/m2-pwa/commit/0cbaa878b8a844d5abbeb1797b625a33130e6514)]:
|
|
58
66
|
- @graphcommerce/framer-utils@3.0.1
|
|
59
67
|
- @graphcommerce/image@3.0.1
|
|
60
68
|
- @graphcommerce/next-ui@4.0.1
|
|
@@ -63,191 +71,151 @@
|
|
|
63
71
|
|
|
64
72
|
### Major Changes
|
|
65
73
|
|
|
66
|
-
- [#1258](https://github.com/ho-nl/m2-pwa/pull/1258)
|
|
67
|
-
[`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05)
|
|
68
|
-
Thanks [@paales](https://github.com/paales)! - Upgraded to Material UI 5
|
|
74
|
+
- [#1258](https://github.com/ho-nl/m2-pwa/pull/1258) [`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05) Thanks [@paales](https://github.com/paales)! - Upgraded to Material UI 5
|
|
69
75
|
|
|
70
76
|
### Patch Changes
|
|
71
77
|
|
|
72
|
-
- Updated dependencies
|
|
73
|
-
[[`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05)]:
|
|
78
|
+
- Updated dependencies [[`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05)]:
|
|
74
79
|
- @graphcommerce/framer-utils@3.0.0
|
|
75
80
|
- @graphcommerce/image@3.0.0
|
|
76
81
|
- @graphcommerce/next-ui@4.0.0
|
|
77
82
|
|
|
78
|
-
All notable changes to this project will be documented in this file. See
|
|
79
|
-
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
83
|
+
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
80
84
|
|
|
81
85
|
# [1.2.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@1.1.25...@graphcommerce/framer-scroller@1.2.0) (2022-01-03)
|
|
82
86
|
|
|
83
87
|
### Bug Fixes
|
|
84
88
|
|
|
85
|
-
- make sure the useVelocitySnapTo resolves completely
|
|
86
|
-
([9d13fcb](https://github.com/ho-nl/m2-pwa/commit/9d13fcbf63ef8c0a964b9bd81accb6259a693c5c))
|
|
89
|
+
- make sure the useVelocitySnapTo resolves completely ([9d13fcb](https://github.com/ho-nl/m2-pwa/commit/9d13fcbf63ef8c0a964b9bd81accb6259a693c5c))
|
|
87
90
|
|
|
88
91
|
### Features
|
|
89
92
|
|
|
90
|
-
- **framer-next-pages:** reduce rerenders when navigating to a new page
|
|
91
|
-
([5cf3301](https://github.com/ho-nl/m2-pwa/commit/5cf330130bb3527057da015e3c4a6fa295d7262e))
|
|
93
|
+
- **framer-next-pages:** reduce rerenders when navigating to a new page ([5cf3301](https://github.com/ho-nl/m2-pwa/commit/5cf330130bb3527057da015e3c4a6fa295d7262e))
|
|
92
94
|
|
|
93
95
|
## [1.1.24](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@1.1.23...@graphcommerce/framer-scroller@1.1.24) (2021-12-23)
|
|
94
96
|
|
|
95
97
|
### Bug Fixes
|
|
96
98
|
|
|
97
|
-
- **framer-next-pages:** closing is janky, caused by setting pointer-events to none, trying without
|
|
98
|
-
resetting the pointerevents
|
|
99
|
-
([9247fa3](https://github.com/ho-nl/m2-pwa/commit/9247fa312926416802abd68ea04b1e6b52531f2c))
|
|
99
|
+
- **framer-next-pages:** closing is janky, caused by setting pointer-events to none, trying without resetting the pointerevents ([9247fa3](https://github.com/ho-nl/m2-pwa/commit/9247fa312926416802abd68ea04b1e6b52531f2c))
|
|
100
100
|
|
|
101
101
|
## [1.1.22](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@1.1.21...@graphcommerce/framer-scroller@1.1.22) (2021-12-22)
|
|
102
102
|
|
|
103
103
|
### Bug Fixes
|
|
104
104
|
|
|
105
|
-
- **framer-scroller:** make sure the first gallery dot is selected initially
|
|
106
|
-
([a2ed37b](https://github.com/ho-nl/m2-pwa/commit/a2ed37bd2c17eef46c0ee4cf8219a141b2e054b4))
|
|
105
|
+
- **framer-scroller:** make sure the first gallery dot is selected initially ([a2ed37b](https://github.com/ho-nl/m2-pwa/commit/a2ed37bd2c17eef46c0ee4cf8219a141b2e054b4))
|
|
107
106
|
|
|
108
107
|
## [1.1.21](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@1.1.20...@graphcommerce/framer-scroller@1.1.21) (2021-12-22)
|
|
109
108
|
|
|
110
109
|
### Bug Fixes
|
|
111
110
|
|
|
112
|
-
- **framer-scroller:** height of the gallery item isn't high enough
|
|
113
|
-
|
|
114
|
-
- **framer-scroller:**
|
|
115
|
-
([8d55630](https://github.com/ho-nl/m2-pwa/commit/8d55630a93cff91ac37e426bbe9f1b25b001556c))
|
|
116
|
-
- **framer-scroller:** would throw ssr warning
|
|
117
|
-
([a3db078](https://github.com/ho-nl/m2-pwa/commit/a3db0781d2433809c0bd4cb6ba37af79b611f3c4))
|
|
111
|
+
- **framer-scroller:** height of the gallery item isn't high enough ([0e84ba3](https://github.com/ho-nl/m2-pwa/commit/0e84ba3ecb8928870fdc0459a1c6c30fde372d91))
|
|
112
|
+
- **framer-scroller:** make sure the actual image will scale instead of the container ([8d55630](https://github.com/ho-nl/m2-pwa/commit/8d55630a93cff91ac37e426bbe9f1b25b001556c))
|
|
113
|
+
- **framer-scroller:** would throw ssr warning ([a3db078](https://github.com/ho-nl/m2-pwa/commit/a3db0781d2433809c0bd4cb6ba37af79b611f3c4))
|
|
118
114
|
|
|
119
115
|
## [1.1.20](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@1.1.19...@graphcommerce/framer-scroller@1.1.20) (2021-12-22)
|
|
120
116
|
|
|
121
117
|
### Bug Fixes
|
|
122
118
|
|
|
123
|
-
- **framer-scroller:** gallery didn't align images in the center
|
|
124
|
-
|
|
125
|
-
- **framer-scroller:** offaxis scroll was allowed on safari
|
|
126
|
-
([4ece409](https://github.com/ho-nl/m2-pwa/commit/4ece409fabad7e686d491cc6bc1682c4507f2d3b))
|
|
119
|
+
- **framer-scroller:** gallery didn't align images in the center ([0cf6066](https://github.com/ho-nl/m2-pwa/commit/0cf60669b2547d2c421eb07c1ba23d7718df74aa))
|
|
120
|
+
- **framer-scroller:** offaxis scroll was allowed on safari ([4ece409](https://github.com/ho-nl/m2-pwa/commit/4ece409fabad7e686d491cc6bc1682c4507f2d3b))
|
|
127
121
|
|
|
128
122
|
## [1.1.17](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@1.1.16...@graphcommerce/framer-scroller@1.1.17) (2021-12-21)
|
|
129
123
|
|
|
130
124
|
### Bug Fixes
|
|
131
125
|
|
|
132
|
-
- **framer-scroller:** apply will change only when animating
|
|
133
|
-
([77fee92](https://github.com/ho-nl/m2-pwa/commit/77fee92c0eb70691b699e1f6ba378ec16c534975))
|
|
126
|
+
- **framer-scroller:** apply will change only when animating ([77fee92](https://github.com/ho-nl/m2-pwa/commit/77fee92c0eb70691b699e1f6ba378ec16c534975))
|
|
134
127
|
|
|
135
128
|
## [1.1.14](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@1.1.13...@graphcommerce/framer-scroller@1.1.14) (2021-12-20)
|
|
136
129
|
|
|
137
130
|
### Bug Fixes
|
|
138
131
|
|
|
139
|
-
- **framer-scroller:** remove jank from scroller when opening
|
|
140
|
-
([c618bf2](https://github.com/ho-nl/m2-pwa/commit/c618bf290bd580fe5eb45663c44843dd751e00ed))
|
|
132
|
+
- **framer-scroller:** remove jank from scroller when opening ([c618bf2](https://github.com/ho-nl/m2-pwa/commit/c618bf290bd580fe5eb45663c44843dd751e00ed))
|
|
141
133
|
|
|
142
134
|
## [1.1.10](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@1.1.9...@graphcommerce/framer-scroller@1.1.10) (2021-12-17)
|
|
143
135
|
|
|
144
136
|
### Bug Fixes
|
|
145
137
|
|
|
146
|
-
- **framer-scroller:** make sure we're not throwing only warning when there are no children
|
|
147
|
-
([001c7d9](https://github.com/ho-nl/m2-pwa/commit/001c7d9a00e447d44134c00bd77505e52cf0f9d4))
|
|
138
|
+
- **framer-scroller:** make sure we're not throwing only warning when there are no children ([001c7d9](https://github.com/ho-nl/m2-pwa/commit/001c7d9a00e447d44134c00bd77505e52cf0f9d4))
|
|
148
139
|
|
|
149
140
|
## [1.1.8](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@1.1.7...@graphcommerce/framer-scroller@1.1.8) (2021-12-15)
|
|
150
141
|
|
|
151
142
|
### Bug Fixes
|
|
152
143
|
|
|
153
|
-
- scroller should not snap to off-axis while dragging and direction isn't set to both
|
|
154
|
-
([9118bfc](https://github.com/ho-nl/m2-pwa/commit/9118bfcb1eb9ade5f144167e47e0c26724ce832f))
|
|
144
|
+
- scroller should not snap to off-axis while dragging and direction isn't set to both ([9118bfc](https://github.com/ho-nl/m2-pwa/commit/9118bfcb1eb9ade5f144167e47e0c26724ce832f))
|
|
155
145
|
|
|
156
146
|
## [1.1.5](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@1.1.4...@graphcommerce/framer-scroller@1.1.5) (2021-12-06)
|
|
157
147
|
|
|
158
148
|
### Bug Fixes
|
|
159
149
|
|
|
160
|
-
- Accessibility, SEO
|
|
161
|
-
([a258837](https://github.com/ho-nl/m2-pwa/commit/a258837476d94d20d33e13a4c4f950fff57f7dca))
|
|
150
|
+
- Accessibility, SEO ([a258837](https://github.com/ho-nl/m2-pwa/commit/a258837476d94d20d33e13a4c4f950fff57f7dca))
|
|
162
151
|
|
|
163
152
|
## [1.1.2](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@1.1.1...@graphcommerce/framer-scroller@1.1.2) (2021-12-03)
|
|
164
153
|
|
|
165
154
|
### Bug Fixes
|
|
166
155
|
|
|
167
|
-
- height of scroller isn't correct
|
|
168
|
-
([8d847ad](https://github.com/ho-nl/m2-pwa/commit/8d847ad210cfe00bf88386912d97233402e16b81))
|
|
156
|
+
- height of scroller isn't correct ([8d847ad](https://github.com/ho-nl/m2-pwa/commit/8d847ad210cfe00bf88386912d97233402e16b81))
|
|
169
157
|
|
|
170
158
|
# [1.1.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@1.0.4...@graphcommerce/framer-scroller@1.1.0) (2021-12-03)
|
|
171
159
|
|
|
172
160
|
### Bug Fixes
|
|
173
161
|
|
|
174
|
-
- **framer-scroller:** do not scroll in the direction that is not being scrolled when dragging and
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
-
|
|
178
|
-
|
|
179
|
-
-
|
|
180
|
-
([8bd35a2](https://github.com/ho-nl/m2-pwa/commit/8bd35a2ebf5d10b44d04048c6360c7ac770221cf))
|
|
181
|
-
- make sure the overlay becomes visible, even if the overlay is scrolled
|
|
182
|
-
([1738c98](https://github.com/ho-nl/m2-pwa/commit/1738c982ea84ec2b93daa824c4b8c86ab2a3f5ed))
|
|
183
|
-
- make sure the overlays are rendered correctly on mobile
|
|
184
|
-
([48f7050](https://github.com/ho-nl/m2-pwa/commit/48f705060e99b997f5b1db03ccc49f1051a1ed8f))
|
|
185
|
-
- make the headerHeight properly configurable
|
|
186
|
-
([c39c942](https://github.com/ho-nl/m2-pwa/commit/c39c942a62a9bb9687ea553be28e37fb49a6b065))
|
|
162
|
+
- **framer-scroller:** do not scroll in the direction that is not being scrolled when dragging and thus delaying the reset to snap ([3198eed](https://github.com/ho-nl/m2-pwa/commit/3198eed7977039f712784ee6c17031d7efb20c25))
|
|
163
|
+
- **framer-scroller:** recursively find snapPoints for deeply nested children ([2203f00](https://github.com/ho-nl/m2-pwa/commit/2203f00a97bb4e4b381acad1d86b177105874d1f))
|
|
164
|
+
- **framer-scroller:** set the scrollTop when switching snap ([8bd35a2](https://github.com/ho-nl/m2-pwa/commit/8bd35a2ebf5d10b44d04048c6360c7ac770221cf))
|
|
165
|
+
- make sure the overlay becomes visible, even if the overlay is scrolled ([1738c98](https://github.com/ho-nl/m2-pwa/commit/1738c982ea84ec2b93daa824c4b8c86ab2a3f5ed))
|
|
166
|
+
- make sure the overlays are rendered correctly on mobile ([48f7050](https://github.com/ho-nl/m2-pwa/commit/48f705060e99b997f5b1db03ccc49f1051a1ed8f))
|
|
167
|
+
- make the headerHeight properly configurable ([c39c942](https://github.com/ho-nl/m2-pwa/commit/c39c942a62a9bb9687ea553be28e37fb49a6b065))
|
|
187
168
|
|
|
188
169
|
### Features
|
|
189
170
|
|
|
190
|
-
- **framer-scroller-sheet:** created package replacing the framer-sheet package
|
|
191
|
-
|
|
192
|
-
- **framer-scroller:**
|
|
193
|
-
|
|
194
|
-
- **framer-scroller:**
|
|
195
|
-
([ec8c24e](https://github.com/ho-nl/m2-pwa/commit/ec8c24e6d457a3ed1c055b27d7b94be5ed4b6f2c))
|
|
196
|
-
- **framer-scroller:** provide promise with scrollTo
|
|
197
|
-
([cbe59d9](https://github.com/ho-nl/m2-pwa/commit/cbe59d9e753cc2ab76b2de048139e0319f08d035))
|
|
198
|
-
- **framer-scroller:** split the grid functionality from the scroller
|
|
199
|
-
([81307ea](https://github.com/ho-nl/m2-pwa/commit/81307ea2652bf31a1f94e8db72af4ee161bdca2e))
|
|
171
|
+
- **framer-scroller-sheet:** created package replacing the framer-sheet package ([f9f2e91](https://github.com/ho-nl/m2-pwa/commit/f9f2e9101191f5cb5c4514ceb9534ddeb2476763))
|
|
172
|
+
- **framer-scroller:** find the direction of the scroller and set proper values ([631e24c](https://github.com/ho-nl/m2-pwa/commit/631e24c5c7ff67b49f83390789e8dadcb07eca04))
|
|
173
|
+
- **framer-scroller:** get the scrollSnapAlign from the element instead of the body ([ec8c24e](https://github.com/ho-nl/m2-pwa/commit/ec8c24e6d457a3ed1c055b27d7b94be5ed4b6f2c))
|
|
174
|
+
- **framer-scroller:** provide promise with scrollTo ([cbe59d9](https://github.com/ho-nl/m2-pwa/commit/cbe59d9e753cc2ab76b2de048139e0319f08d035))
|
|
175
|
+
- **framer-scroller:** split the grid functionality from the scroller ([81307ea](https://github.com/ho-nl/m2-pwa/commit/81307ea2652bf31a1f94e8db72af4ee161bdca2e))
|
|
200
176
|
|
|
201
177
|
## [1.0.2](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@1.0.1...@graphcommerce/framer-scroller@1.0.2) (2021-11-03)
|
|
202
178
|
|
|
203
179
|
### Bug Fixes
|
|
204
180
|
|
|
205
|
-
- various accessibility improvements
|
|
206
|
-
([47481a9](https://github.com/ho-nl/m2-pwa/commit/47481a9a882ba87968de6dd797557b0b275d75fb))
|
|
181
|
+
- various accessibility improvements ([47481a9](https://github.com/ho-nl/m2-pwa/commit/47481a9a882ba87968de6dd797557b0b275d75fb))
|
|
207
182
|
|
|
208
183
|
## [0.4.2](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@0.4.1...@graphcommerce/framer-scroller@0.4.2) (2021-10-29)
|
|
209
184
|
|
|
210
185
|
### Bug Fixes
|
|
211
186
|
|
|
212
|
-
- spacing of title on category landing on mobile
|
|
213
|
-
([8ed3550](https://github.com/ho-nl/m2-pwa/commit/8ed35502fd231d1d6a8e0a282f8961335d9dead3))
|
|
187
|
+
- spacing of title on category landing on mobile ([8ed3550](https://github.com/ho-nl/m2-pwa/commit/8ed35502fd231d1d6a8e0a282f8961335d9dead3))
|
|
214
188
|
|
|
215
189
|
# [0.4.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@0.3.3...@graphcommerce/framer-scroller@0.4.0) (2021-10-27)
|
|
216
190
|
|
|
217
191
|
### Features
|
|
218
192
|
|
|
219
|
-
- **nextjs:** upgraded to nextjs 12
|
|
220
|
-
([9331bc8](https://github.com/ho-nl/m2-pwa/commit/9331bc801f6419522115cc47d291d49d608d5a90))
|
|
193
|
+
- **nextjs:** upgraded to nextjs 12 ([9331bc8](https://github.com/ho-nl/m2-pwa/commit/9331bc801f6419522115cc47d291d49d608d5a90))
|
|
221
194
|
|
|
222
195
|
# [0.3.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@0.2.11...@graphcommerce/framer-scroller@0.3.0) (2021-10-19)
|
|
223
196
|
|
|
224
197
|
### Features
|
|
225
198
|
|
|
226
|
-
- **framer-scroller:** better defaults so the Scroller doesn't look broken when providing no props
|
|
227
|
-
([b177ce9](https://github.com/ho-nl/m2-pwa/commit/b177ce9570abb9ccfd4eb5cc34e43d157bb4e81a))
|
|
199
|
+
- **framer-scroller:** better defaults so the Scroller doesn't look broken when providing no props ([b177ce9](https://github.com/ho-nl/m2-pwa/commit/b177ce9570abb9ccfd4eb5cc34e43d157bb4e81a))
|
|
228
200
|
|
|
229
201
|
## [0.2.9](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@0.2.8...@graphcommerce/framer-scroller@0.2.9) (2021-10-11)
|
|
230
202
|
|
|
231
203
|
### Bug Fixes
|
|
232
204
|
|
|
233
|
-
- **framer-scroller:** dots should have a background
|
|
234
|
-
([8f2e1a1](https://github.com/ho-nl/m2-pwa/commit/8f2e1a1ffc9de3369938fe2f9e9f25f592739d8d))
|
|
205
|
+
- **framer-scroller:** dots should have a background ([8f2e1a1](https://github.com/ho-nl/m2-pwa/commit/8f2e1a1ffc9de3369938fe2f9e9f25f592739d8d))
|
|
235
206
|
|
|
236
207
|
## [0.2.8](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@0.2.7...@graphcommerce/framer-scroller@0.2.8) (2021-10-09)
|
|
237
208
|
|
|
238
209
|
### Bug Fixes
|
|
239
210
|
|
|
240
|
-
- **framer-scroller:** pan snap does not work on mobile
|
|
241
|
-
([660f242](https://github.com/ho-nl/m2-pwa/commit/660f242a38558669fa896a74e14cafdd85069d57))
|
|
211
|
+
- **framer-scroller:** pan snap does not work on mobile ([660f242](https://github.com/ho-nl/m2-pwa/commit/660f242a38558669fa896a74e14cafdd85069d57))
|
|
242
212
|
|
|
243
213
|
## [0.2.2](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@0.2.0...@graphcommerce/framer-scroller@0.2.2) (2021-09-27)
|
|
244
214
|
|
|
245
215
|
### Bug Fixes
|
|
246
216
|
|
|
247
|
-
- ignore example directories when publishing
|
|
248
|
-
|
|
249
|
-
- versions
|
|
250
|
-
([b8b306c](https://github.com/ho-nl/m2-pwa/commit/b8b306c8f3a13415e441d0593c638ae2a3731cd6))
|
|
217
|
+
- ignore example directories when publishing ([620cbb2](https://github.com/ho-nl/m2-pwa/commit/620cbb2d8e68b727b8593e2e45702c4d12276d92))
|
|
218
|
+
- versions ([b8b306c](https://github.com/ho-nl/m2-pwa/commit/b8b306c8f3a13415e441d0593c638ae2a3731cd6))
|
|
251
219
|
|
|
252
220
|
## [0.2.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@0.2.0...@graphcommerce/framer-scroller@0.2.1) (2021-09-27)
|
|
253
221
|
|
|
@@ -257,65 +225,42 @@ All notable changes to this project will be documented in this file. See
|
|
|
257
225
|
|
|
258
226
|
### Bug Fixes
|
|
259
227
|
|
|
260
|
-
- **framer-scroller:** center the prev/next buttons on the gallery
|
|
261
|
-
|
|
262
|
-
- **framer-
|
|
263
|
-
|
|
264
|
-
- **framer-slider:** prev/next buttons don't always show up correctly
|
|
265
|
-
([ba2510e](https://github.com/ho-nl/m2-pwa/commit/ba2510ea659344a2d71957eed396f4e5ce536a8c))
|
|
266
|
-
- make sure we can actually observe items
|
|
267
|
-
([4767b2a](https://github.com/ho-nl/m2-pwa/commit/4767b2a1bb23fc6d2e445c10c96da0a666212c55))
|
|
228
|
+
- **framer-scroller:** center the prev/next buttons on the gallery ([234dc37](https://github.com/ho-nl/m2-pwa/commit/234dc37fc46f723410e9a844bbcb33cfe5d8a588))
|
|
229
|
+
- **framer-scroller:** check if the ref exists instead of throwing an exception ([9cdfa0d](https://github.com/ho-nl/m2-pwa/commit/9cdfa0dd749c59159ce8f6f53dbabbcdddab049c))
|
|
230
|
+
- **framer-slider:** prev/next buttons don't always show up correctly ([ba2510e](https://github.com/ho-nl/m2-pwa/commit/ba2510ea659344a2d71957eed396f4e5ce536a8c))
|
|
231
|
+
- make sure we can actually observe items ([4767b2a](https://github.com/ho-nl/m2-pwa/commit/4767b2a1bb23fc6d2e445c10c96da0a666212c55))
|
|
268
232
|
|
|
269
233
|
### Features
|
|
270
234
|
|
|
271
|
-
- **framer-scroller:** created an MotionImageAspect component to properly center and handle scorller
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
- **framer-scroller:**
|
|
275
|
-
|
|
276
|
-
-
|
|
277
|
-
([f6a8329](https://github.com/ho-nl/m2-pwa/commit/f6a8329d2f761956a9d7bdc5243de336aa2e5ad4))
|
|
278
|
-
- **framer-scroller:** package to implement scroll-snap handling with JS
|
|
279
|
-
([b3a279f](https://github.com/ho-nl/m2-pwa/commit/b3a279f8b4acb2b9de99004efe0459c534786bdd))
|
|
280
|
-
- **framer-scroller:** pagination dots
|
|
281
|
-
([6a5557d](https://github.com/ho-nl/m2-pwa/commit/6a5557d10d08661662eb476c5fe2296b558c1cb5))
|
|
282
|
-
- renamed all packages to use [@graphcommerce](https://github.com/graphcommerce) instead of
|
|
283
|
-
[@reachdigital](https://github.com/reachdigital)
|
|
284
|
-
([491e4ce](https://github.com/ho-nl/m2-pwa/commit/491e4cec9a2686472dac36b79f999257c0811ffe))
|
|
235
|
+
- **framer-scroller:** created an MotionImageAspect component to properly center and handle scorller resizes ([2eb117e](https://github.com/ho-nl/m2-pwa/commit/2eb117e6c135ea8e009c91f854e9f9ef8e7375c5))
|
|
236
|
+
- **framer-scroller:** implemented the scroller on all pages ([73fb518](https://github.com/ho-nl/m2-pwa/commit/73fb518eff74edb2b3212e892b3d8cc2b088011b))
|
|
237
|
+
- **framer-scroller:** option to hide scrollbar ([f6a8329](https://github.com/ho-nl/m2-pwa/commit/f6a8329d2f761956a9d7bdc5243de336aa2e5ad4))
|
|
238
|
+
- **framer-scroller:** package to implement scroll-snap handling with JS ([b3a279f](https://github.com/ho-nl/m2-pwa/commit/b3a279f8b4acb2b9de99004efe0459c534786bdd))
|
|
239
|
+
- **framer-scroller:** pagination dots ([6a5557d](https://github.com/ho-nl/m2-pwa/commit/6a5557d10d08661662eb476c5fe2296b558c1cb5))
|
|
240
|
+
- renamed all packages to use [@graphcommerce](https://github.com/graphcommerce) instead of [@reachdigital](https://github.com/reachdigital) ([491e4ce](https://github.com/ho-nl/m2-pwa/commit/491e4cec9a2686472dac36b79f999257c0811ffe))
|
|
285
241
|
|
|
286
242
|
# Change Log
|
|
287
243
|
|
|
288
|
-
All notable changes to this project will be documented in this file. See
|
|
289
|
-
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
244
|
+
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
290
245
|
|
|
291
246
|
## [0.1.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/framer-scroller@0.1.0...@graphcommerce/framer-scroller@0.1.1) (2021-09-01)
|
|
292
247
|
|
|
293
248
|
### Bug Fixes
|
|
294
249
|
|
|
295
|
-
- **framer-slider:** prev/next buttons don't always show up correctly
|
|
296
|
-
|
|
297
|
-
- make sure we can actually observe items
|
|
298
|
-
([4767b2a](https://github.com/ho-nl/m2-pwa/commit/4767b2a1bb23fc6d2e445c10c96da0a666212c55))
|
|
250
|
+
- **framer-slider:** prev/next buttons don't always show up correctly ([ba2510e](https://github.com/ho-nl/m2-pwa/commit/ba2510ea659344a2d71957eed396f4e5ce536a8c))
|
|
251
|
+
- make sure we can actually observe items ([4767b2a](https://github.com/ho-nl/m2-pwa/commit/4767b2a1bb23fc6d2e445c10c96da0a666212c55))
|
|
299
252
|
|
|
300
253
|
# 0.1.0 (2021-09-01)
|
|
301
254
|
|
|
302
255
|
### Bug Fixes
|
|
303
256
|
|
|
304
|
-
- **framer-scroller:** center the prev/next buttons on the gallery
|
|
305
|
-
|
|
306
|
-
- **framer-scroller:** check if the ref exists instead of throwing an exception
|
|
307
|
-
([9cdfa0d](https://github.com/ho-nl/m2-pwa/commit/9cdfa0dd749c59159ce8f6f53dbabbcdddab049c))
|
|
257
|
+
- **framer-scroller:** center the prev/next buttons on the gallery ([234dc37](https://github.com/ho-nl/m2-pwa/commit/234dc37fc46f723410e9a844bbcb33cfe5d8a588))
|
|
258
|
+
- **framer-scroller:** check if the ref exists instead of throwing an exception ([9cdfa0d](https://github.com/ho-nl/m2-pwa/commit/9cdfa0dd749c59159ce8f6f53dbabbcdddab049c))
|
|
308
259
|
|
|
309
260
|
### Features
|
|
310
261
|
|
|
311
|
-
- **framer-scroller:** created an MotionImageAspect component to properly center and handle scorller
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
- **framer-scroller:**
|
|
315
|
-
|
|
316
|
-
- **framer-scroller:** option to hide scrollbar
|
|
317
|
-
([f6a8329](https://github.com/ho-nl/m2-pwa/commit/f6a8329d2f761956a9d7bdc5243de336aa2e5ad4))
|
|
318
|
-
- **framer-scroller:** package to implement scroll-snap handling with JS
|
|
319
|
-
([b3a279f](https://github.com/ho-nl/m2-pwa/commit/b3a279f8b4acb2b9de99004efe0459c534786bdd))
|
|
320
|
-
- **framer-scroller:** pagination dots
|
|
321
|
-
([6a5557d](https://github.com/ho-nl/m2-pwa/commit/6a5557d10d08661662eb476c5fe2296b558c1cb5))
|
|
262
|
+
- **framer-scroller:** created an MotionImageAspect component to properly center and handle scorller resizes ([2eb117e](https://github.com/ho-nl/m2-pwa/commit/2eb117e6c135ea8e009c91f854e9f9ef8e7375c5))
|
|
263
|
+
- **framer-scroller:** implemented the scroller on all pages ([73fb518](https://github.com/ho-nl/m2-pwa/commit/73fb518eff74edb2b3212e892b3d8cc2b088011b))
|
|
264
|
+
- **framer-scroller:** option to hide scrollbar ([f6a8329](https://github.com/ho-nl/m2-pwa/commit/f6a8329d2f761956a9d7bdc5243de336aa2e5ad4))
|
|
265
|
+
- **framer-scroller:** package to implement scroll-snap handling with JS ([b3a279f](https://github.com/ho-nl/m2-pwa/commit/b3a279f8b4acb2b9de99004efe0459c534786bdd))
|
|
266
|
+
- **framer-scroller:** pagination dots ([6a5557d](https://github.com/ho-nl/m2-pwa/commit/6a5557d10d08661662eb476c5fe2296b558c1cb5))
|
|
@@ -12,7 +12,7 @@ export type MotionImageAspectProps = Omit<ImageProps, 'layout' | 'unoptimized'>
|
|
|
12
12
|
* Note: We have a fallback for Safari 14 which doesn't yet support aspect-ratio, this causes a
|
|
13
13
|
* problem when the layout is animated. Should be fixed in Safari 15
|
|
14
14
|
*/
|
|
15
|
-
const MotionImageAspect = m(
|
|
15
|
+
export const MotionImageAspect = m(
|
|
16
16
|
forwardRef<HTMLImageElement, MotionImageAspectProps>((props, ref) => (
|
|
17
17
|
<Box
|
|
18
18
|
className='MotionImageAspect'
|
|
@@ -67,5 +67,3 @@ const MotionImageAspect = m(
|
|
|
67
67
|
)
|
|
68
68
|
|
|
69
69
|
MotionImageAspect.displayName = 'MotionImageAspect'
|
|
70
|
-
|
|
71
|
-
export default MotionImageAspect
|
package/components/Scroller.tsx
CHANGED
|
@@ -5,14 +5,15 @@ import { ScrollableProps, useScroller } from '../hooks/useScroller'
|
|
|
5
5
|
|
|
6
6
|
const ScrollerDiv = styled(m.div)({})
|
|
7
7
|
|
|
8
|
-
const Scroller = forwardRef<HTMLDivElement, ScrollableProps & { sx?: SxProps<Theme> }>(
|
|
8
|
+
export const Scroller = forwardRef<HTMLDivElement, ScrollableProps & { sx?: SxProps<Theme> }>(
|
|
9
9
|
(props, forwardedRef) => {
|
|
10
10
|
const { sx = [], ...scrollerProps } = props
|
|
11
|
-
const scroller = useScroller<'div'>(
|
|
11
|
+
const scroller = useScroller<'div', HTMLDivElement>(
|
|
12
|
+
{ grid: true, ...scrollerProps },
|
|
13
|
+
forwardedRef,
|
|
14
|
+
)
|
|
12
15
|
|
|
13
16
|
return <ScrollerDiv {...scroller} sx={[scroller.sx, ...(Array.isArray(sx) ? sx : [sx])]} />
|
|
14
17
|
},
|
|
15
18
|
)
|
|
16
19
|
Scroller.displayName = 'Scroller'
|
|
17
|
-
|
|
18
|
-
export default Scroller
|
|
@@ -10,7 +10,7 @@ export type ScrollerButtonProps = {
|
|
|
10
10
|
direction: SnapPositionDirection
|
|
11
11
|
} & FabProps
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
export const ScrollerButton = m(
|
|
14
14
|
React.forwardRef<HTMLDivElement, ScrollerButtonProps>((props, ref) => {
|
|
15
15
|
const { direction, sx = [], ...buttonProps } = props
|
|
16
16
|
|
|
@@ -34,16 +34,14 @@ const ScrollerFab = m(
|
|
|
34
34
|
<m.div ref={ref} style={{ scale, opacity: scale, willChange: 'scale, opacity', zIndex: 1 }}>
|
|
35
35
|
<Fab
|
|
36
36
|
type='button'
|
|
37
|
+
size='small'
|
|
37
38
|
{...buttonProps}
|
|
38
39
|
onClick={handleClick}
|
|
39
40
|
aria-label={direction}
|
|
40
|
-
size='small'
|
|
41
41
|
sx={[{ display: { xs: 'none', md: 'flex' } }, ...(Array.isArray(sx) ? sx : [sx])]}
|
|
42
42
|
/>
|
|
43
43
|
</m.div>
|
|
44
44
|
)
|
|
45
45
|
}),
|
|
46
46
|
)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export default ScrollerFab
|
|
47
|
+
ScrollerButton.displayName = 'ScrollerButton'
|
|
@@ -16,7 +16,7 @@ export type DotsProps = {
|
|
|
16
16
|
const componentName = 'ScrollerDots'
|
|
17
17
|
const { classes } = extendableComponent(componentName, ['root', 'dot', 'circle'] as const)
|
|
18
18
|
|
|
19
|
-
const ScrollerDots = m(
|
|
19
|
+
export const ScrollerDots = m(
|
|
20
20
|
React.forwardRef<HTMLDivElement, DotsProps>((props, ref) => {
|
|
21
21
|
const { fabProps, sx = [], ...containerProps } = props
|
|
22
22
|
|
|
@@ -76,5 +76,3 @@ const ScrollerDots = m(
|
|
|
76
76
|
}),
|
|
77
77
|
)
|
|
78
78
|
ScrollerDots.displayName = componentName
|
|
79
|
-
|
|
80
|
-
export default ScrollerDots
|
|
@@ -11,7 +11,7 @@ export type SliderPageCounterProps = {
|
|
|
11
11
|
sx?: SxProps<Theme>
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const ScrollerPageCounter = React.forwardRef<HTMLDivElement, SliderPageCounterProps>(
|
|
14
|
+
export const ScrollerPageCounter = React.forwardRef<HTMLDivElement, SliderPageCounterProps>(
|
|
15
15
|
({ sx = [] }, ref) => {
|
|
16
16
|
const { items } = useScrollerContext()
|
|
17
17
|
|
|
@@ -34,5 +34,3 @@ const ScrollerPageCounter = React.forwardRef<HTMLDivElement, SliderPageCounterPr
|
|
|
34
34
|
)
|
|
35
35
|
},
|
|
36
36
|
)
|
|
37
|
-
|
|
38
|
-
export default ScrollerPageCounter
|
|
@@ -62,7 +62,7 @@ function useObserveItems(scrollerRef: ReactHtmlRefObject, items: MotionValue<Ite
|
|
|
62
62
|
}, [items, observe])
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
export
|
|
65
|
+
export function ScrollerProvider(props: ScrollerProviderProps) {
|
|
66
66
|
const scrollerRef = useRef<HTMLDivElement>()
|
|
67
67
|
const cancels = useRef<PlaybackControls[]>([])
|
|
68
68
|
|
package/hooks/useScrollTo.ts
CHANGED
package/hooks/useScroller.ts
CHANGED
|
@@ -36,10 +36,10 @@ const parts = ['root'] as const
|
|
|
36
36
|
const { withState } = extendableComponent<OwnerProps, typeof name, typeof parts>(name, parts)
|
|
37
37
|
|
|
38
38
|
/** Make any HTML */
|
|
39
|
-
export function useScroller<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
) {
|
|
39
|
+
export function useScroller<
|
|
40
|
+
TagName extends keyof ReactHTML = 'div',
|
|
41
|
+
E extends HTMLElement = HTMLElement,
|
|
42
|
+
>(props: ScrollableProps<TagName>, forwardedRef: React.ForwardedRef<E>) {
|
|
43
43
|
const { hideScrollbar = false, children, grid = false, ...divProps } = props
|
|
44
44
|
|
|
45
45
|
const { scrollSnap, scrollerRef, enableSnap, disableSnap, snap, registerChildren } =
|
|
@@ -106,7 +106,7 @@ export function useScroller<TagName extends keyof ReactHTML = 'div'>(
|
|
|
106
106
|
snapToVelocity(info)
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
const ref: React.RefCallback<
|
|
109
|
+
const ref: React.RefCallback<E> = (el) => {
|
|
110
110
|
// @ts-expect-error current is assignable
|
|
111
111
|
scrollerRef.current = el ?? undefined
|
|
112
112
|
if (typeof forwardedRef === 'function') forwardedRef(el)
|
package/index.ts
CHANGED
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
export * from './types'
|
|
2
2
|
|
|
3
3
|
export * from './components/MotionImageAspect'
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
export { default as Scroller } from './components/Scroller'
|
|
7
|
-
|
|
4
|
+
export * from './components/Scroller'
|
|
8
5
|
export * from './components/ScrollerButton'
|
|
9
|
-
export { default as ScrollerButton } from './components/ScrollerButton'
|
|
10
|
-
|
|
11
6
|
export * from './components/ScrollerDots'
|
|
12
|
-
export { default as ScrollerDots } from './components/ScrollerDots'
|
|
13
|
-
|
|
14
7
|
export * from './components/ScrollerPageCounter'
|
|
15
|
-
export { default as ScrollerPageCounter } from './components/ScrollerPageCounter'
|
|
16
|
-
|
|
17
8
|
export * from './components/ScrollerProvider'
|
|
18
|
-
export { default as ScrollerProvider } from './components/ScrollerProvider'
|
|
19
9
|
|
|
20
10
|
export * from './hooks/useScrollerContext'
|
|
21
11
|
// export * from './hooks/useScroller'
|
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.0.
|
|
5
|
+
"version": "2.0.6",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "tsc -W"
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@graphcommerce/framer-utils": "^3.0.
|
|
19
|
-
"@graphcommerce/image": "^3.1.
|
|
20
|
-
"@graphcommerce/next-ui": "^4.
|
|
18
|
+
"@graphcommerce/framer-utils": "^3.0.4",
|
|
19
|
+
"@graphcommerce/image": "^3.1.1",
|
|
20
|
+
"@graphcommerce/next-ui": "^4.2.4"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@graphcommerce/eslint-config-pwa": "^4.0.
|
|
24
|
-
"@graphcommerce/prettier-config-pwa": "^4.0.
|
|
23
|
+
"@graphcommerce/eslint-config-pwa": "^4.0.5",
|
|
24
|
+
"@graphcommerce/prettier-config-pwa": "^4.0.3",
|
|
25
25
|
"@graphcommerce/typescript-config-pwa": "^4.0.2",
|
|
26
|
-
"@playwright/test": "^1.19.
|
|
26
|
+
"@playwright/test": "^1.19.2"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@mui/material": "^5.4.1",
|
package/types.ts
CHANGED
|
@@ -28,19 +28,19 @@ export type ScrollerContext = {
|
|
|
28
28
|
snap: MotionValue<boolean>
|
|
29
29
|
|
|
30
30
|
/** @private */
|
|
31
|
-
enableSnap()
|
|
31
|
+
enableSnap: () => void
|
|
32
32
|
/** @private */
|
|
33
|
-
disableSnap()
|
|
33
|
+
disableSnap: () => void
|
|
34
34
|
/** @private */
|
|
35
|
-
register(controls: PlaybackControls)
|
|
35
|
+
register: (controls: PlaybackControls) => void
|
|
36
36
|
/** @private */
|
|
37
|
-
stop()
|
|
37
|
+
stop: () => void
|
|
38
38
|
/** @private */
|
|
39
|
-
getSnapPosition(direction: SnapPositionDirection)
|
|
39
|
+
getSnapPosition: (direction: SnapPositionDirection) => Point
|
|
40
40
|
/** @private */
|
|
41
|
-
getScrollSnapPositions()
|
|
41
|
+
getScrollSnapPositions: () => Record<Axis, number[]>
|
|
42
42
|
/** @private */
|
|
43
|
-
registerChildren(children: React.ReactNode)
|
|
43
|
+
registerChildren: (children: React.ReactNode) => void
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
export type ScrollSnapTypeSingle = 'none' | 'block' | 'inline' | 'x' | 'y' | 'both'
|