react-native-gesture-image-viewer 2.0.0-beta.5 → 2.0.0-beta.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.
@@ -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
- * @remark
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).
@@ -76,6 +76,7 @@ export function GestureTrigger({
76
76
  }, [id, onPress, children]);
77
77
  return /*#__PURE__*/_jsx(View, {
78
78
  ref: ref,
79
+ collapsable: false,
79
80
  children: wrapped
80
81
  });
81
82
  }
@@ -1 +1 @@
1
- {"version":3,"names":["Children","cloneElement","isValidElement","useMemo","useRef","View","registry","jsx","_jsx","GestureTrigger","id","children","onPress","ref","wrapped","child","only","originalOnPress","props","handlePress","args","setTriggerNode","current","__DEV__","console","warn"],"sourceRoot":"../../src","sources":["GestureTrigger.tsx"],"mappings":";;AACA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,cAAc,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAC/E,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,QAAQ,QAAQ,4BAAyB;;AAElD;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,SAAAC,GAAA,IAAAC,IAAA;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAwB;EAAEC,EAAE,GAAG,SAAS;EAAEC,QAAQ;EAAEC;AAAgC,CAAC,EAAE;EACnH,MAAMC,GAAG,GAAGT,MAAM,CAAO,IAAI,CAAC;EAE9B,MAAMU,OAAO,GAAGX,OAAO,CAAC,MAAM;IAC5B,MAAMY,KAAK,GAAGf,QAAQ,CAACgB,IAAI,CAACL,QAAQ,CAAC;IAErC,IAAI,eAACT,cAAc,CAACa,KAAK,CAAC,EAAE;MAC1B,OAAOJ,QAAQ;IACjB;IAEA,MAAMM,eAAe,GAAGF,KAAK,CAACG,KAAK,EAAEN,OAAO;IAE5C,MAAMO,WAAW,GAAGA,CAAC,GAAGC,IAAe,KAAK;MAC1Cd,QAAQ,CAACe,cAAc,CAACX,EAAE,EAAEG,GAAG,CAACS,OAAO,CAAC;MACxCL,eAAe,GAAG,GAAGG,IAAI,CAAC;MAC1BR,OAAO,GAAG,GAAGQ,IAAI,CAAC;MAElB,IAAIG,OAAO,IAAI,CAACN,eAAe,IAAI,CAACL,OAAO,EAAE;QAC3CY,OAAO,CAACC,IAAI,CAAC,oFAAoF,CAAC;MACpG;IACF,CAAC;IAED,oBAAOxB,YAAY,CAACc,KAAK,EAAE;MACzB,GAAGA,KAAK,CAACG,KAAK;MACdN,OAAO,EAAEO;IACX,CAAC,CAAC;EACJ,CAAC,EAAE,CAACT,EAAE,EAAEE,OAAO,EAAED,QAAQ,CAAC,CAAC;EAE3B,oBAAOH,IAAA,CAACH,IAAI;IAACQ,GAAG,EAAEA,GAAI;IAAAF,QAAA,EAAEG;EAAO,CAAO,CAAC;AACzC","ignoreList":[]}
1
+ {"version":3,"names":["Children","cloneElement","isValidElement","useMemo","useRef","View","registry","jsx","_jsx","GestureTrigger","id","children","onPress","ref","wrapped","child","only","originalOnPress","props","handlePress","args","setTriggerNode","current","__DEV__","console","warn","collapsable"],"sourceRoot":"../../src","sources":["GestureTrigger.tsx"],"mappings":";;AACA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,cAAc,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAC/E,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,QAAQ,QAAQ,4BAAyB;;AAElD;AACA;AACA;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AAO,CACJ,CAAC;AAEX","ignoreList":[]}
@@ -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
- * @remark
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).
@@ -1 +1 @@
1
- {"version":3,"file":"GestureTrigger.d.ts","sourceRoot":"","sources":["../../../src/GestureTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C;;;GAGG;AACH,KAAK,WAAW,GAAG;IAAE,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;CAAE,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,WAAW,IAAI;IACvD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,WAAW,EAAE,EAAE,EAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC,2CA6BlH"}
1
+ {"version":3,"file":"GestureTrigger.d.ts","sourceRoot":"","sources":["../../../src/GestureTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C;;;GAGG;AACH,KAAK,WAAW,GAAG;IAAE,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;CAAE,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,WAAW,IAAI;IACvD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,WAAW,EAAE,EAAE,EAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC,2CAiClH"}
@@ -31,7 +31,7 @@ export interface TriggerAnimationConfig extends WithTimingConfig {
31
31
  export interface GestureViewerProps<T = any, LC = typeof RNScrollView> {
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
- * @remark `GestureViewer` automatically removes instances from memory when components are unmounted, so no manual memory management is required.
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;
@@ -75,13 +75,13 @@ export interface GestureViewerProps<T = any, LC = typeof RNScrollView> {
75
75
  ListComponent: LC;
76
76
  /**
77
77
  * The width of the `GestureViewer`.
78
- * @remark If you don't set this prop, the width of the `GestureViewer` will be the same as the width of the screen.
78
+ * @remarks If you don't set this prop, the width of the `GestureViewer` will be the same as the width of the screen.
79
79
  * @defaultValue screen width
80
80
  */
81
81
  width?: number;
82
82
  /**
83
83
  * The props to pass to the list component.
84
- * @remark The `listProps` provides **type inference based on the selected list component**, ensuring accurate autocompletion and type safety in your IDE.
84
+ * @remarks The `listProps` provides **type inference based on the selected list component**, ensuring accurate autocompletion and type safety in your IDE.
85
85
  */
86
86
  listProps?: Partial<ConditionalListProps<LC>>;
87
87
  /**
@@ -94,7 +94,7 @@ export interface GestureViewerProps<T = any, LC = typeof RNScrollView> {
94
94
  containerStyle?: StyleProp<ViewStyle>;
95
95
  /**
96
96
  * Dismiss gesture options. Calls `onDismiss` function when swiping down.
97
- * @remark Useful for closing modals with downward swipe gestures.
97
+ * @remarks Useful for closing modals with downward swipe gestures.
98
98
  */
99
99
  dismiss?: {
100
100
  /**
@@ -114,32 +114,32 @@ export interface GestureViewerProps<T = any, LC = typeof RNScrollView> {
114
114
  resistance?: number;
115
115
  /**
116
116
  * By default, the background `opacity` gradually decreases from 1 to 0 during downward swipe gestures.
117
- * @remark When `false`, this animation is disabled.
117
+ * @remarks When `false`, this animation is disabled.
118
118
  * @defaultValue true
119
119
  */
120
120
  fadeBackdrop?: boolean;
121
121
  };
122
122
  /**
123
123
  * Controls left/right swipe gestures.
124
- * @remark When `false`, horizontal gestures are disabled.
124
+ * @remarks When `false`, horizontal gestures are disabled.
125
125
  * @defaultValue true
126
126
  */
127
127
  enableHorizontalSwipe?: boolean;
128
128
  /**
129
129
  * Only works when zoom is active, allows moving item position when zoomed.
130
- * @remark When `false`, gesture movement is disabled during zoom.
130
+ * @remarks When `false`, gesture movement is disabled during zoom.
131
131
  * @defaultValue true
132
132
  */
133
133
  enablePanWhenZoomed?: boolean;
134
134
  /**
135
135
  * Controls two-finger pinch gestures.
136
- * @remark When `false`, two-finger zoom gestures are disabled.
136
+ * @remarks When `false`, two-finger zoom gestures are disabled.
137
137
  * @defaultValue true
138
138
  */
139
139
  enablePinchZoom?: boolean;
140
140
  /**
141
141
  * Controls double-tap zoom gestures.
142
- * @remark When `false`, double-tap zoom gestures are disabled.
142
+ * @remarks When `false`, double-tap zoom gestures are disabled.
143
143
  * @defaultValue true
144
144
  */
145
145
  enableDoubleTapZoom?: boolean;
@@ -151,7 +151,7 @@ export interface GestureViewerProps<T = any, LC = typeof RNScrollView> {
151
151
  /**
152
152
  * Enables snap scrolling mode.
153
153
  *
154
- * @remark
154
+ * @remarks
155
155
  * **`false` (default)**: Paging mode (`pagingEnabled: true`)
156
156
  * - Scrolls by full screen size increments
157
157
  *
@@ -164,7 +164,7 @@ export interface GestureViewerProps<T = any, LC = typeof RNScrollView> {
164
164
  enableSnapMode?: boolean;
165
165
  /**
166
166
  * The spacing between items in pixels.
167
- * @remark Only applied when `enableSnapMode` is `true`.
167
+ * @remarks Only applied when `enableSnapMode` is `true`.
168
168
  * @defaultValue 0
169
169
  */
170
170
  itemSpacing?: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-gesture-image-viewer",
3
- "version": "2.0.0-beta.5",
4
- "description": "🖼️ A highly customizable and easy-to-use React Native image viewer with gesture support and external controls",
3
+ "version": "2.0.0-beta.6",
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",
@@ -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
- * @remark
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).
@@ -82,5 +82,9 @@ export function GestureTrigger<T extends WithOnPress>({ id = 'default', children
82
82
  });
83
83
  }, [id, onPress, children]);
84
84
 
85
- return <View ref={ref}>{wrapped}</View>;
85
+ return (
86
+ <View ref={ref} collapsable={false}>
87
+ {wrapped}
88
+ </View>
89
+ );
86
90
  }
package/src/types.ts CHANGED
@@ -41,7 +41,7 @@ export interface TriggerAnimationConfig extends WithTimingConfig {
41
41
  export interface GestureViewerProps<T = any, LC = typeof RNScrollView> {
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
- * @remark `GestureViewer` automatically removes instances from memory when components are unmounted, so no manual memory management is required.
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;
@@ -83,13 +83,13 @@ export interface GestureViewerProps<T = any, LC = typeof RNScrollView> {
83
83
  ListComponent: LC;
84
84
  /**
85
85
  * The width of the `GestureViewer`.
86
- * @remark If you don't set this prop, the width of the `GestureViewer` will be the same as the width of the screen.
86
+ * @remarks If you don't set this prop, the width of the `GestureViewer` will be the same as the width of the screen.
87
87
  * @defaultValue screen width
88
88
  */
89
89
  width?: number;
90
90
  /**
91
91
  * The props to pass to the list component.
92
- * @remark The `listProps` provides **type inference based on the selected list component**, ensuring accurate autocompletion and type safety in your IDE.
92
+ * @remarks The `listProps` provides **type inference based on the selected list component**, ensuring accurate autocompletion and type safety in your IDE.
93
93
  */
94
94
  listProps?: Partial<ConditionalListProps<LC>>;
95
95
  /**
@@ -102,7 +102,7 @@ export interface GestureViewerProps<T = any, LC = typeof RNScrollView> {
102
102
  containerStyle?: StyleProp<ViewStyle>;
103
103
  /**
104
104
  * Dismiss gesture options. Calls `onDismiss` function when swiping down.
105
- * @remark Useful for closing modals with downward swipe gestures.
105
+ * @remarks Useful for closing modals with downward swipe gestures.
106
106
  */
107
107
  dismiss?: {
108
108
  /**
@@ -122,32 +122,32 @@ export interface GestureViewerProps<T = any, LC = typeof RNScrollView> {
122
122
  resistance?: number;
123
123
  /**
124
124
  * By default, the background `opacity` gradually decreases from 1 to 0 during downward swipe gestures.
125
- * @remark When `false`, this animation is disabled.
125
+ * @remarks When `false`, this animation is disabled.
126
126
  * @defaultValue true
127
127
  */
128
128
  fadeBackdrop?: boolean;
129
129
  };
130
130
  /**
131
131
  * Controls left/right swipe gestures.
132
- * @remark When `false`, horizontal gestures are disabled.
132
+ * @remarks When `false`, horizontal gestures are disabled.
133
133
  * @defaultValue true
134
134
  */
135
135
  enableHorizontalSwipe?: boolean;
136
136
  /**
137
137
  * Only works when zoom is active, allows moving item position when zoomed.
138
- * @remark When `false`, gesture movement is disabled during zoom.
138
+ * @remarks When `false`, gesture movement is disabled during zoom.
139
139
  * @defaultValue true
140
140
  */
141
141
  enablePanWhenZoomed?: boolean;
142
142
  /**
143
143
  * Controls two-finger pinch gestures.
144
- * @remark When `false`, two-finger zoom gestures are disabled.
144
+ * @remarks When `false`, two-finger zoom gestures are disabled.
145
145
  * @defaultValue true
146
146
  */
147
147
  enablePinchZoom?: boolean;
148
148
  /**
149
149
  * Controls double-tap zoom gestures.
150
- * @remark When `false`, double-tap zoom gestures are disabled.
150
+ * @remarks When `false`, double-tap zoom gestures are disabled.
151
151
  * @defaultValue true
152
152
  */
153
153
  enableDoubleTapZoom?: boolean;
@@ -159,7 +159,7 @@ export interface GestureViewerProps<T = any, LC = typeof RNScrollView> {
159
159
  /**
160
160
  * Enables snap scrolling mode.
161
161
  *
162
- * @remark
162
+ * @remarks
163
163
  * **`false` (default)**: Paging mode (`pagingEnabled: true`)
164
164
  * - Scrolls by full screen size increments
165
165
  *
@@ -172,7 +172,7 @@ export interface GestureViewerProps<T = any, LC = typeof RNScrollView> {
172
172
  enableSnapMode?: boolean;
173
173
  /**
174
174
  * The spacing between items in pixels.
175
- * @remark Only applied when `enableSnapMode` is `true`.
175
+ * @remarks Only applied when `enableSnapMode` is `true`.
176
176
  * @defaultValue 0
177
177
  */
178
178
  itemSpacing?: number;