Skip to content

Commit b6da413

Browse files
chore(release): version packages (beta) (#113)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 71e06f6 commit b6da413

File tree

3 files changed

+80
-1
lines changed

3 files changed

+80
-1
lines changed

.changeset/pre.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
"changesets": [
1010
"afraid-worlds-create",
1111
"curvy-bottles-fold",
12+
"evil-clowns-share",
13+
"fine-buses-argue",
1214
"good-tables-clap",
1315
"itchy-birds-count",
1416
"light-boxes-hope",
1517
"major-areas-mix",
1618
"many-ideas-trade",
19+
"open-baths-serve",
1720
"plain-buttons-start",
1821
"red-ducks-laugh",
1922
"rude-brooms-peel",

CHANGELOG.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,81 @@
11
# react-native-gesture-image-viewer
22

3+
## 2.0.0-beta.8
4+
5+
### Minor Changes
6+
7+
- 193779d: feat: add customizable `width` and `height` props to `GestureViewer`
8+
9+
- Add `height` prop to enable custom viewer height
10+
- Remove `useSnap` restriction for `width` customization
11+
- Allow custom `width` in both snap and paging modes
12+
- Maintain backward compatibility with screen dimensions as defaults
13+
- Improve flexibility for different layout requirements
14+
15+
Example:
16+
17+
```tsx
18+
<GestureViewer width={400} height={600} />
19+
```
20+
21+
- a7b58a5: feat: add auto-play functionality to gesture viewer with configurable interval
22+
23+
- add `autoPlay` and `autoPlayInterval` props
24+
- when `autoPlay` is enabled, the viewer will automatically play the next item after the specified interval
25+
- when `enableLoop` is enabled, the viewer will loop back to the first item after the last item
26+
- when `enableLoop` is disabled, the viewer will stop at the last item
27+
- when there is only one item, auto-play is disabled
28+
- interval must be a positive integer in milliseconds (values < 250ms are clamped to 250ms)
29+
- `autoPlayInterval` is optional and defaults to 3000ms
30+
- `autoPlay` is optional and defaults to `false`
31+
- when zoom or rotate gestures are detected, the auto-play will be paused
32+
33+
```tsx
34+
import { GestureViewer } from "react-native-gesture-image-viewer";
35+
36+
function App() {
37+
return <GestureViewer autoPlay autoPlayInterval={3000} />;
38+
}
39+
```
40+
41+
### Patch Changes
42+
43+
- 9b006b7: fix: improve type inference for listProps with generic list components
44+
45+
- Add InstantiateGeneric helper type for better generic component props inference
46+
- Change generic type parameter from T to ItemT for clarity
47+
- Fix type inference issues with FlashList, FlatList keyExtractor and renderItem props
48+
- Ensure all list component props receive correct ItemT type instead of unknown
49+
50+
**Before:**
51+
52+
```tsx
53+
<GestureViewer
54+
data={images}
55+
renderItem={renderImage}
56+
ListComponent={FlashList}
57+
// keyExtractor's item parameter was unknown type
58+
listProps={{
59+
keyExtractor: (item, index) => item.id, // ❌ item is unknown
60+
}}
61+
/>
62+
```
63+
64+
**After:**
65+
66+
```tsx
67+
<GestureViewer
68+
data={images}
69+
renderItem={renderImage}
70+
ListComponent={FlashList}
71+
// keyExtractor's item parameter is now properly typed
72+
listProps={{
73+
keyExtractor: (item, index) => item.id, // ✅ item has correct type
74+
// and other props...
75+
}}
76+
/>
77+
```
78+
379
## 2.0.0-beta.7
480

581
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-gesture-image-viewer",
3-
"version": "2.0.0-beta.7",
3+
"version": "2.0.0-beta.8",
44
"description": "🖼️ React Native Image Viewer - Reanimated-powered image gestures with full control",
55
"main": "./lib/module/index.js",
66
"types": "./lib/typescript/src/index.d.ts",

0 commit comments

Comments
 (0)