react-native-gesture-image-viewer 1.7.0 → 1.7.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.
|
@@ -22,7 +22,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
22
22
|
/**
|
|
23
23
|
* Wraps a pressable child element and registers its native view as a trigger for `GestureViewer`.
|
|
24
24
|
*
|
|
25
|
-
* @
|
|
25
|
+
* @remarks
|
|
26
26
|
* Behavior on press:
|
|
27
27
|
* - Registers the child's native node to the internal registry under the given `id`.
|
|
28
28
|
* - Invokes the child's own `onPress` first (if provided).
|
|
@@ -23,7 +23,7 @@ export type GestureTriggerProps<T extends WithOnPress> = {
|
|
|
23
23
|
/**
|
|
24
24
|
* Wraps a pressable child element and registers its native view as a trigger for `GestureViewer`.
|
|
25
25
|
*
|
|
26
|
-
* @
|
|
26
|
+
* @remarks
|
|
27
27
|
* Behavior on press:
|
|
28
28
|
* - Registers the child's native node to the internal registry under the given `id`.
|
|
29
29
|
* - Invokes the child's own `onPress` first (if provided).
|
|
@@ -31,7 +31,7 @@ export interface TriggerAnimationConfig extends WithTimingConfig {
|
|
|
31
31
|
export interface GestureViewerProps<T = any, LC = typeof RNFlatList> {
|
|
32
32
|
/**
|
|
33
33
|
* When you want to efficiently manage multiple `GestureViewer` instances, you can use the `id` prop to use multiple `GestureViewer` components.
|
|
34
|
-
* @
|
|
34
|
+
* @remarks `GestureViewer` automatically removes instances from memory when components are unmounted, so no manual memory management is required.
|
|
35
35
|
* @defaultValue 'default'
|
|
36
36
|
*/
|
|
37
37
|
id?: string;
|
|
@@ -79,14 +79,14 @@ export interface GestureViewerProps<T = any, LC = typeof RNFlatList> {
|
|
|
79
79
|
ListComponent: LC;
|
|
80
80
|
/**
|
|
81
81
|
* The width of the `GestureViewer`.
|
|
82
|
-
* @
|
|
82
|
+
* @remarks If you don't set this prop, the width of the `GestureViewer` will be the same as the width of the screen.
|
|
83
83
|
* @defaultValue screen width
|
|
84
84
|
*/
|
|
85
85
|
width?: number;
|
|
86
86
|
/**
|
|
87
87
|
* Enables snap scrolling mode.
|
|
88
88
|
*
|
|
89
|
-
* @
|
|
89
|
+
* @remarks
|
|
90
90
|
* **`false` (default)**: Paging mode (`pagingEnabled: true`)
|
|
91
91
|
* - Scrolls by full screen size increments
|
|
92
92
|
*
|
|
@@ -104,13 +104,13 @@ export interface GestureViewerProps<T = any, LC = typeof RNFlatList> {
|
|
|
104
104
|
dismissThreshold?: number;
|
|
105
105
|
/**
|
|
106
106
|
* Calls `onDismiss` function when swiping down.
|
|
107
|
-
* @
|
|
107
|
+
* @remarks Useful for closing modals with downward swipe gestures.
|
|
108
108
|
* @defaultValue true
|
|
109
109
|
*/
|
|
110
110
|
enableDismissGesture?: boolean;
|
|
111
111
|
/**
|
|
112
112
|
* Controls left/right swipe gestures.
|
|
113
|
-
* @
|
|
113
|
+
* @remarks When `false`, horizontal gestures are disabled.
|
|
114
114
|
* @defaultValue true
|
|
115
115
|
*/
|
|
116
116
|
enableSwipeGesture?: boolean;
|
|
@@ -121,7 +121,7 @@ export interface GestureViewerProps<T = any, LC = typeof RNFlatList> {
|
|
|
121
121
|
resistance?: number;
|
|
122
122
|
/**
|
|
123
123
|
* The props to pass to the list component.
|
|
124
|
-
* @
|
|
124
|
+
* @remarks The `listProps` provides **type inference based on the selected list component**, ensuring accurate autocompletion and type safety in your IDE.
|
|
125
125
|
*/
|
|
126
126
|
listProps?: Partial<ConditionalListProps<LC>>;
|
|
127
127
|
/**
|
|
@@ -134,25 +134,25 @@ export interface GestureViewerProps<T = any, LC = typeof RNFlatList> {
|
|
|
134
134
|
containerStyle?: StyleProp<ViewStyle>;
|
|
135
135
|
/**
|
|
136
136
|
* By default, the background `opacity` gradually decreases from 1 to 0 during downward swipe gestures.
|
|
137
|
-
* @
|
|
137
|
+
* @remarks When `false`, this animation is disabled.
|
|
138
138
|
* @defaultValue true
|
|
139
139
|
*/
|
|
140
140
|
animateBackdrop?: boolean;
|
|
141
141
|
/**
|
|
142
142
|
* Only works when zoom is active, allows moving item position when zoomed.
|
|
143
|
-
* @
|
|
143
|
+
* @remarks When `false`, gesture movement is disabled during zoom.
|
|
144
144
|
* @defaultValue true
|
|
145
145
|
*/
|
|
146
146
|
enableZoomPanGesture?: boolean;
|
|
147
147
|
/**
|
|
148
148
|
* Controls two-finger pinch gestures.
|
|
149
|
-
* @
|
|
149
|
+
* @remarks When `false`, two-finger zoom gestures are disabled.
|
|
150
150
|
* @defaultValue true
|
|
151
151
|
*/
|
|
152
152
|
enableZoomGesture?: boolean;
|
|
153
153
|
/**
|
|
154
154
|
* Controls double-tap zoom gestures.
|
|
155
|
-
* @
|
|
155
|
+
* @remarks When `false`, double-tap zoom gestures are disabled.
|
|
156
156
|
* @defaultValue true
|
|
157
157
|
*/
|
|
158
158
|
enableDoubleTapGesture?: boolean;
|
|
@@ -168,7 +168,7 @@ export interface GestureViewerProps<T = any, LC = typeof RNFlatList> {
|
|
|
168
168
|
maxZoomScale?: number;
|
|
169
169
|
/**
|
|
170
170
|
* The spacing between items in pixels.
|
|
171
|
-
* @
|
|
171
|
+
* @remarks Only applied when `useSnap` is `true`.
|
|
172
172
|
* @defaultValue 0
|
|
173
173
|
*/
|
|
174
174
|
itemSpacing?: number;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-gesture-image-viewer",
|
|
3
|
-
"version": "1.7.
|
|
4
|
-
"description": "🖼️
|
|
3
|
+
"version": "1.7.1",
|
|
4
|
+
"description": "🖼️ React Native Image Viewer - Reanimated-powered image gestures with full control",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -59,11 +59,20 @@
|
|
|
59
59
|
"photo-viewer",
|
|
60
60
|
"image-carousel",
|
|
61
61
|
"touch-gestures",
|
|
62
|
-
"react-native-reanimated",
|
|
63
|
-
"react-native-gesture-handler",
|
|
64
62
|
"lightbox",
|
|
65
63
|
"gallery",
|
|
66
|
-
"viewer"
|
|
64
|
+
"viewer",
|
|
65
|
+
"zoomable",
|
|
66
|
+
"double-tap",
|
|
67
|
+
"image viewer",
|
|
68
|
+
"react native image viewer",
|
|
69
|
+
"react-native-reanimated",
|
|
70
|
+
"react-native-gesture-handler",
|
|
71
|
+
"react-native-viewer",
|
|
72
|
+
"react-native-image-viewer",
|
|
73
|
+
"react-native-image-gallery",
|
|
74
|
+
"react-native-reanimated-image-viewer",
|
|
75
|
+
"react-native-image-zoom-viewer"
|
|
67
76
|
],
|
|
68
77
|
"repository": {
|
|
69
78
|
"type": "git",
|
package/src/GestureTrigger.tsx
CHANGED
|
@@ -27,7 +27,7 @@ export type GestureTriggerProps<T extends WithOnPress> = {
|
|
|
27
27
|
/**
|
|
28
28
|
* Wraps a pressable child element and registers its native view as a trigger for `GestureViewer`.
|
|
29
29
|
*
|
|
30
|
-
* @
|
|
30
|
+
* @remarks
|
|
31
31
|
* Behavior on press:
|
|
32
32
|
* - Registers the child's native node to the internal registry under the given `id`.
|
|
33
33
|
* - Invokes the child's own `onPress` first (if provided).
|
package/src/types.ts
CHANGED
|
@@ -41,7 +41,7 @@ export interface TriggerAnimationConfig extends WithTimingConfig {
|
|
|
41
41
|
export interface GestureViewerProps<T = any, LC = typeof RNFlatList> {
|
|
42
42
|
/**
|
|
43
43
|
* When you want to efficiently manage multiple `GestureViewer` instances, you can use the `id` prop to use multiple `GestureViewer` components.
|
|
44
|
-
* @
|
|
44
|
+
* @remarks `GestureViewer` automatically removes instances from memory when components are unmounted, so no manual memory management is required.
|
|
45
45
|
* @defaultValue 'default'
|
|
46
46
|
*/
|
|
47
47
|
id?: string;
|
|
@@ -87,14 +87,14 @@ export interface GestureViewerProps<T = any, LC = typeof RNFlatList> {
|
|
|
87
87
|
ListComponent: LC;
|
|
88
88
|
/**
|
|
89
89
|
* The width of the `GestureViewer`.
|
|
90
|
-
* @
|
|
90
|
+
* @remarks If you don't set this prop, the width of the `GestureViewer` will be the same as the width of the screen.
|
|
91
91
|
* @defaultValue screen width
|
|
92
92
|
*/
|
|
93
93
|
width?: number;
|
|
94
94
|
/**
|
|
95
95
|
* Enables snap scrolling mode.
|
|
96
96
|
*
|
|
97
|
-
* @
|
|
97
|
+
* @remarks
|
|
98
98
|
* **`false` (default)**: Paging mode (`pagingEnabled: true`)
|
|
99
99
|
* - Scrolls by full screen size increments
|
|
100
100
|
*
|
|
@@ -112,13 +112,13 @@ export interface GestureViewerProps<T = any, LC = typeof RNFlatList> {
|
|
|
112
112
|
dismissThreshold?: number;
|
|
113
113
|
/**
|
|
114
114
|
* Calls `onDismiss` function when swiping down.
|
|
115
|
-
* @
|
|
115
|
+
* @remarks Useful for closing modals with downward swipe gestures.
|
|
116
116
|
* @defaultValue true
|
|
117
117
|
*/
|
|
118
118
|
enableDismissGesture?: boolean;
|
|
119
119
|
/**
|
|
120
120
|
* Controls left/right swipe gestures.
|
|
121
|
-
* @
|
|
121
|
+
* @remarks When `false`, horizontal gestures are disabled.
|
|
122
122
|
* @defaultValue true
|
|
123
123
|
*/
|
|
124
124
|
enableSwipeGesture?: boolean;
|
|
@@ -129,7 +129,7 @@ export interface GestureViewerProps<T = any, LC = typeof RNFlatList> {
|
|
|
129
129
|
resistance?: number;
|
|
130
130
|
/**
|
|
131
131
|
* The props to pass to the list component.
|
|
132
|
-
* @
|
|
132
|
+
* @remarks The `listProps` provides **type inference based on the selected list component**, ensuring accurate autocompletion and type safety in your IDE.
|
|
133
133
|
*/
|
|
134
134
|
listProps?: Partial<ConditionalListProps<LC>>;
|
|
135
135
|
/**
|
|
@@ -142,25 +142,25 @@ export interface GestureViewerProps<T = any, LC = typeof RNFlatList> {
|
|
|
142
142
|
containerStyle?: StyleProp<ViewStyle>;
|
|
143
143
|
/**
|
|
144
144
|
* By default, the background `opacity` gradually decreases from 1 to 0 during downward swipe gestures.
|
|
145
|
-
* @
|
|
145
|
+
* @remarks When `false`, this animation is disabled.
|
|
146
146
|
* @defaultValue true
|
|
147
147
|
*/
|
|
148
148
|
animateBackdrop?: boolean;
|
|
149
149
|
/**
|
|
150
150
|
* Only works when zoom is active, allows moving item position when zoomed.
|
|
151
|
-
* @
|
|
151
|
+
* @remarks When `false`, gesture movement is disabled during zoom.
|
|
152
152
|
* @defaultValue true
|
|
153
153
|
*/
|
|
154
154
|
enableZoomPanGesture?: boolean;
|
|
155
155
|
/**
|
|
156
156
|
* Controls two-finger pinch gestures.
|
|
157
|
-
* @
|
|
157
|
+
* @remarks When `false`, two-finger zoom gestures are disabled.
|
|
158
158
|
* @defaultValue true
|
|
159
159
|
*/
|
|
160
160
|
enableZoomGesture?: boolean;
|
|
161
161
|
/**
|
|
162
162
|
* Controls double-tap zoom gestures.
|
|
163
|
-
* @
|
|
163
|
+
* @remarks When `false`, double-tap zoom gestures are disabled.
|
|
164
164
|
* @defaultValue true
|
|
165
165
|
*/
|
|
166
166
|
enableDoubleTapGesture?: boolean;
|
|
@@ -176,7 +176,7 @@ export interface GestureViewerProps<T = any, LC = typeof RNFlatList> {
|
|
|
176
176
|
maxZoomScale?: number;
|
|
177
177
|
/**
|
|
178
178
|
* The spacing between items in pixels.
|
|
179
|
-
* @
|
|
179
|
+
* @remarks Only applied when `useSnap` is `true`.
|
|
180
180
|
* @defaultValue 0
|
|
181
181
|
*/
|
|
182
182
|
itemSpacing?: number;
|