@webority-technologies/mobile-ui 0.0.4 → 0.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/lib/commonjs/components/DocumentViewer/DocumentViewer.js +70 -0
- package/lib/commonjs/components/DocumentViewer/index.js +13 -0
- package/lib/commonjs/components/ZoomableImage/ZoomableImage.js +204 -0
- package/lib/commonjs/components/ZoomableImage/index.js +13 -0
- package/lib/commonjs/components/index.js +125 -111
- package/lib/module/components/DocumentViewer/DocumentViewer.js +64 -0
- package/lib/module/components/DocumentViewer/index.js +4 -0
- package/lib/module/components/ZoomableImage/ZoomableImage.js +198 -0
- package/lib/module/components/ZoomableImage/index.js +4 -0
- package/lib/module/components/index.js +2 -0
- package/lib/typescript/commonjs/components/DocumentViewer/DocumentViewer.d.ts +27 -0
- package/lib/typescript/commonjs/components/DocumentViewer/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/ZoomableImage/ZoomableImage.d.ts +47 -0
- package/lib/typescript/commonjs/components/ZoomableImage/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/index.d.ts +4 -0
- package/lib/typescript/module/components/DocumentViewer/DocumentViewer.d.ts +27 -0
- package/lib/typescript/module/components/DocumentViewer/index.d.ts +3 -0
- package/lib/typescript/module/components/ZoomableImage/ZoomableImage.d.ts +47 -0
- package/lib/typescript/module/components/ZoomableImage/index.d.ts +3 -0
- package/lib/typescript/module/components/index.d.ts +4 -0
- package/package.json +5 -3
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ZoomableImage — a standalone pinch-to-zoom / pan / double-tap-to-zoom
|
|
5
|
+
* wrapper for a single piece of content (typically one `<Image>`).
|
|
6
|
+
*
|
|
7
|
+
* Reuses the same Reanimated 3 gesture composition `ImageGallery`'s internal
|
|
8
|
+
* lightbox slide uses (pinch clamped and rubber-banded at its limits, pan
|
|
9
|
+
* gated to only engage once zoomed in, double-tap toggling between baseline
|
|
10
|
+
* and `doubleTapScale`), stripped of the carousel-slide concerns that
|
|
11
|
+
* component needs and this one does not — there is no `index`/`total`/
|
|
12
|
+
* `active` because a standalone image is always the one being viewed.
|
|
13
|
+
*
|
|
14
|
+
* USAGE:
|
|
15
|
+
*
|
|
16
|
+
* <ZoomableImage>
|
|
17
|
+
* <Image source={{ uri }} style={styles.image} resizeMode="contain" />
|
|
18
|
+
* </ZoomableImage>
|
|
19
|
+
*
|
|
20
|
+
* Takes `children` rather than a `source`/`uri` prop: every real consumer of
|
|
21
|
+
* this pattern in the fleet wraps an already-authenticated image component
|
|
22
|
+
* (headers, caching, its own loading state) rather than a bare `<Image>`, so
|
|
23
|
+
* a `source` prop would force re-implementing that per app. Wrapping keeps
|
|
24
|
+
* this component ignorant of how the image is fetched.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
28
|
+
import { StyleSheet } from 'react-native';
|
|
29
|
+
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
30
|
+
import Animated, { runOnJS, useAnimatedStyle, useSharedValue, withSpring } from 'react-native-reanimated';
|
|
31
|
+
import { resolveHaptic, triggerHaptic } from "../../utils/index.js";
|
|
32
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
33
|
+
const DEFAULT_MAX_SCALE = 4;
|
|
34
|
+
const DEFAULT_MIN_SCALE = 1;
|
|
35
|
+
const DEFAULT_DOUBLE_TAP_SCALE = 2;
|
|
36
|
+
const SPRING_CONFIG = {
|
|
37
|
+
damping: 18,
|
|
38
|
+
stiffness: 220,
|
|
39
|
+
mass: 1
|
|
40
|
+
};
|
|
41
|
+
export const ZoomableImage = ({
|
|
42
|
+
children,
|
|
43
|
+
maxScale = DEFAULT_MAX_SCALE,
|
|
44
|
+
minScale = DEFAULT_MIN_SCALE,
|
|
45
|
+
doubleTapScale = DEFAULT_DOUBLE_TAP_SCALE,
|
|
46
|
+
disabled = false,
|
|
47
|
+
haptic,
|
|
48
|
+
style,
|
|
49
|
+
accessibilityLabel,
|
|
50
|
+
testID
|
|
51
|
+
}) => {
|
|
52
|
+
const scale = useSharedValue(1);
|
|
53
|
+
const savedScale = useSharedValue(1);
|
|
54
|
+
const translateX = useSharedValue(0);
|
|
55
|
+
const translateY = useSharedValue(0);
|
|
56
|
+
const savedTranslateX = useSharedValue(0);
|
|
57
|
+
const savedTranslateY = useSharedValue(0);
|
|
58
|
+
const resetTransform = useCallback(() => {
|
|
59
|
+
scale.value = withSpring(1, SPRING_CONFIG);
|
|
60
|
+
savedScale.value = 1;
|
|
61
|
+
translateX.value = withSpring(0, SPRING_CONFIG);
|
|
62
|
+
translateY.value = withSpring(0, SPRING_CONFIG);
|
|
63
|
+
savedTranslateX.value = 0;
|
|
64
|
+
savedTranslateY.value = 0;
|
|
65
|
+
}, [scale, savedScale, translateX, translateY, savedTranslateX, savedTranslateY]);
|
|
66
|
+
|
|
67
|
+
// Disabling mid-zoom must not leave the content stranded scaled/panned —
|
|
68
|
+
// snap it back the same way ImageGallery's slide resets on losing focus.
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (disabled) {
|
|
71
|
+
resetTransform();
|
|
72
|
+
}
|
|
73
|
+
}, [disabled, resetTransform]);
|
|
74
|
+
const triggerImpact = useCallback(() => {
|
|
75
|
+
const h = resolveHaptic(haptic, 'impactLight');
|
|
76
|
+
if (h) {
|
|
77
|
+
triggerHaptic(h);
|
|
78
|
+
}
|
|
79
|
+
}, [haptic]);
|
|
80
|
+
const pinch = useMemo(() => Gesture.Pinch().enabled(!disabled).onStart(() => {
|
|
81
|
+
'worklet';
|
|
82
|
+
|
|
83
|
+
savedScale.value = scale.value;
|
|
84
|
+
}).onUpdate(e => {
|
|
85
|
+
'worklet';
|
|
86
|
+
|
|
87
|
+
const next = savedScale.value * e.scale;
|
|
88
|
+
// Clamp minScale..maxScale on the UI thread so pinch feels rubbery at limits.
|
|
89
|
+
if (next < minScale) {
|
|
90
|
+
scale.value = minScale + (next - minScale) * 0.3;
|
|
91
|
+
} else if (next > maxScale) {
|
|
92
|
+
scale.value = maxScale + (next - maxScale) * 0.2;
|
|
93
|
+
} else {
|
|
94
|
+
scale.value = next;
|
|
95
|
+
}
|
|
96
|
+
}).onEnd(() => {
|
|
97
|
+
'worklet';
|
|
98
|
+
|
|
99
|
+
if (scale.value < minScale) {
|
|
100
|
+
scale.value = withSpring(minScale, SPRING_CONFIG);
|
|
101
|
+
translateX.value = withSpring(0, SPRING_CONFIG);
|
|
102
|
+
translateY.value = withSpring(0, SPRING_CONFIG);
|
|
103
|
+
savedScale.value = minScale;
|
|
104
|
+
savedTranslateX.value = 0;
|
|
105
|
+
savedTranslateY.value = 0;
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (scale.value > maxScale) {
|
|
109
|
+
scale.value = withSpring(maxScale, SPRING_CONFIG);
|
|
110
|
+
savedScale.value = maxScale;
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
savedScale.value = scale.value;
|
|
114
|
+
}), [disabled, scale, savedScale, translateX, translateY, savedTranslateX, savedTranslateY, minScale, maxScale]);
|
|
115
|
+
|
|
116
|
+
// Pan only engages when zoomed in — otherwise a scroll view or carousel this
|
|
117
|
+
// is nested inside keeps owning the gesture.
|
|
118
|
+
const pan = useMemo(() => Gesture.Pan().enabled(!disabled).minPointers(1).maxPointers(1).onStart(() => {
|
|
119
|
+
'worklet';
|
|
120
|
+
|
|
121
|
+
savedTranslateX.value = translateX.value;
|
|
122
|
+
savedTranslateY.value = translateY.value;
|
|
123
|
+
}).onUpdate(e => {
|
|
124
|
+
'worklet';
|
|
125
|
+
|
|
126
|
+
if (scale.value <= 1) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
translateX.value = savedTranslateX.value + e.translationX;
|
|
130
|
+
translateY.value = savedTranslateY.value + e.translationY;
|
|
131
|
+
}).onEnd(() => {
|
|
132
|
+
'worklet';
|
|
133
|
+
|
|
134
|
+
savedTranslateX.value = translateX.value;
|
|
135
|
+
savedTranslateY.value = translateY.value;
|
|
136
|
+
}), [disabled, scale, translateX, translateY, savedTranslateX, savedTranslateY]);
|
|
137
|
+
const doubleTap = useMemo(() => Gesture.Tap().enabled(!disabled).numberOfTaps(2).onEnd(() => {
|
|
138
|
+
'worklet';
|
|
139
|
+
|
|
140
|
+
runOnJS(triggerImpact)();
|
|
141
|
+
if (scale.value > 1) {
|
|
142
|
+
scale.value = withSpring(1, SPRING_CONFIG);
|
|
143
|
+
translateX.value = withSpring(0, SPRING_CONFIG);
|
|
144
|
+
translateY.value = withSpring(0, SPRING_CONFIG);
|
|
145
|
+
savedScale.value = 1;
|
|
146
|
+
savedTranslateX.value = 0;
|
|
147
|
+
savedTranslateY.value = 0;
|
|
148
|
+
} else {
|
|
149
|
+
scale.value = withSpring(doubleTapScale, SPRING_CONFIG);
|
|
150
|
+
savedScale.value = doubleTapScale;
|
|
151
|
+
}
|
|
152
|
+
}), [disabled, scale, savedScale, translateX, translateY, savedTranslateX, savedTranslateY, triggerImpact, doubleTapScale]);
|
|
153
|
+
|
|
154
|
+
// Race the gestures so they coordinate cleanly: a tap won't be misread as a
|
|
155
|
+
// tiny pan, and pan won't fire when the user actually starts a pinch.
|
|
156
|
+
const composed = useMemo(() => Gesture.Race(pinch, pan, doubleTap), [pinch, pan, doubleTap]);
|
|
157
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
158
|
+
transform: [{
|
|
159
|
+
translateX: translateX.value
|
|
160
|
+
}, {
|
|
161
|
+
translateY: translateY.value
|
|
162
|
+
}, {
|
|
163
|
+
scale: scale.value
|
|
164
|
+
}]
|
|
165
|
+
}));
|
|
166
|
+
return /*#__PURE__*/_jsx(GestureDetector, {
|
|
167
|
+
gesture: composed,
|
|
168
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
169
|
+
style: [styles.container, style],
|
|
170
|
+
testID: testID,
|
|
171
|
+
accessibilityLabel: accessibilityLabel,
|
|
172
|
+
accessibilityState: {
|
|
173
|
+
disabled
|
|
174
|
+
},
|
|
175
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
176
|
+
style: [styles.content, animatedStyle],
|
|
177
|
+
children: children
|
|
178
|
+
})
|
|
179
|
+
})
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
ZoomableImage.displayName = 'ZoomableImage';
|
|
183
|
+
const styles = StyleSheet.create({
|
|
184
|
+
container: {
|
|
185
|
+
flex: 1,
|
|
186
|
+
alignItems: 'center',
|
|
187
|
+
justifyContent: 'center',
|
|
188
|
+
overflow: 'hidden'
|
|
189
|
+
},
|
|
190
|
+
content: {
|
|
191
|
+
width: '100%',
|
|
192
|
+
height: '100%',
|
|
193
|
+
alignItems: 'center',
|
|
194
|
+
justifyContent: 'center'
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
export default ZoomableImage;
|
|
198
|
+
//# sourceMappingURL=ZoomableImage.js.map
|
|
@@ -24,6 +24,7 @@ export { DateRangePicker } from "./DateRangePicker/index.js";
|
|
|
24
24
|
export { Descriptions } from "./Descriptions/index.js";
|
|
25
25
|
export { Dialog } from "./Dialog/index.js";
|
|
26
26
|
export { Divider } from "./Divider/index.js";
|
|
27
|
+
export { DocumentViewer } from "./DocumentViewer/index.js";
|
|
27
28
|
export { Drawer } from "./Drawer/index.js";
|
|
28
29
|
export { EmptyState } from "./EmptyState/index.js";
|
|
29
30
|
export { ErrorBoundary, useErrorHandler, withErrorBoundary } from "./ErrorBoundary/index.js";
|
|
@@ -67,4 +68,5 @@ export { Timeline } from "./Timeline/index.js";
|
|
|
67
68
|
export { TimePicker } from "./TimePicker/index.js";
|
|
68
69
|
export { Toast, ToastProvider, toast, useToast } from "./Toast/index.js";
|
|
69
70
|
export { Tooltip } from "./Tooltip/index.js";
|
|
71
|
+
export { ZoomableImage } from "./ZoomableImage/index.js";
|
|
70
72
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
export interface DocumentViewerSource {
|
|
4
|
+
uri: string;
|
|
5
|
+
headers?: Record<string, string>;
|
|
6
|
+
cache?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface DocumentViewerProps {
|
|
9
|
+
source: DocumentViewerSource;
|
|
10
|
+
/** Trust self-signed / invalid certs on the document request. Default false. */
|
|
11
|
+
trustAllCerts?: boolean;
|
|
12
|
+
onLoadComplete?: (numberOfPages: number) => void;
|
|
13
|
+
onPageChanged?: (page: number, numberOfPages: number) => void;
|
|
14
|
+
onError?: (error: Error) => void;
|
|
15
|
+
/** Replaces the default themed spinner shown while the document loads. */
|
|
16
|
+
loadingIndicator?: () => React.ReactNode;
|
|
17
|
+
style?: StyleProp<ViewStyle>;
|
|
18
|
+
testID?: string;
|
|
19
|
+
accessibilityLabel?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Renders a PDF only — the WebView fallback consumer apps use for non-PDF
|
|
23
|
+
* office documents is a distinct rendering strategy and stays app-side.
|
|
24
|
+
*/
|
|
25
|
+
export declare const DocumentViewer: React.FC<DocumentViewerProps>;
|
|
26
|
+
export default DocumentViewer;
|
|
27
|
+
//# sourceMappingURL=DocumentViewer.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ZoomableImage — a standalone pinch-to-zoom / pan / double-tap-to-zoom
|
|
3
|
+
* wrapper for a single piece of content (typically one `<Image>`).
|
|
4
|
+
*
|
|
5
|
+
* Reuses the same Reanimated 3 gesture composition `ImageGallery`'s internal
|
|
6
|
+
* lightbox slide uses (pinch clamped and rubber-banded at its limits, pan
|
|
7
|
+
* gated to only engage once zoomed in, double-tap toggling between baseline
|
|
8
|
+
* and `doubleTapScale`), stripped of the carousel-slide concerns that
|
|
9
|
+
* component needs and this one does not — there is no `index`/`total`/
|
|
10
|
+
* `active` because a standalone image is always the one being viewed.
|
|
11
|
+
*
|
|
12
|
+
* USAGE:
|
|
13
|
+
*
|
|
14
|
+
* <ZoomableImage>
|
|
15
|
+
* <Image source={{ uri }} style={styles.image} resizeMode="contain" />
|
|
16
|
+
* </ZoomableImage>
|
|
17
|
+
*
|
|
18
|
+
* Takes `children` rather than a `source`/`uri` prop: every real consumer of
|
|
19
|
+
* this pattern in the fleet wraps an already-authenticated image component
|
|
20
|
+
* (headers, caching, its own loading state) rather than a bare `<Image>`, so
|
|
21
|
+
* a `source` prop would force re-implementing that per app. Wrapping keeps
|
|
22
|
+
* this component ignorant of how the image is fetched.
|
|
23
|
+
*/
|
|
24
|
+
import React from 'react';
|
|
25
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
26
|
+
import type { HapticType } from '../../utils';
|
|
27
|
+
export interface ZoomableImageProps {
|
|
28
|
+
/** The content to pinch-zoom, pan, and double-tap-zoom — typically a single `<Image>`. */
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
/** Upper bound on pinch and double-tap zoom. Default 4. */
|
|
31
|
+
maxScale?: number;
|
|
32
|
+
/** Lower bound on pinch zoom — the resting scale a pinch springs back to. Default 1. */
|
|
33
|
+
minScale?: number;
|
|
34
|
+
/** Scale a double tap zooms to; a second double tap returns to baseline. Default 2. */
|
|
35
|
+
doubleTapScale?: number;
|
|
36
|
+
/** Blocks pinch/pan/double-tap and smoothly resets any active zoom back to baseline. Default false. */
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
/** Haptic feedback on double-tap-to-zoom. Pass false to disable; pass a HapticType to override. */
|
|
39
|
+
haptic?: HapticType | false;
|
|
40
|
+
/** Style for the outer wrapping view. */
|
|
41
|
+
style?: StyleProp<ViewStyle>;
|
|
42
|
+
accessibilityLabel?: string;
|
|
43
|
+
testID?: string;
|
|
44
|
+
}
|
|
45
|
+
export declare const ZoomableImage: React.FC<ZoomableImageProps>;
|
|
46
|
+
export default ZoomableImage;
|
|
47
|
+
//# sourceMappingURL=ZoomableImage.d.ts.map
|
|
@@ -46,6 +46,8 @@ export type { DialogAction, DialogProps, DialogVariant } from './Dialog';
|
|
|
46
46
|
export { Dialog } from './Dialog';
|
|
47
47
|
export type { DividerOrientation, DividerProps, DividerSpacing } from './Divider';
|
|
48
48
|
export { Divider } from './Divider';
|
|
49
|
+
export type { DocumentViewerProps, DocumentViewerSource } from './DocumentViewer';
|
|
50
|
+
export { DocumentViewer } from './DocumentViewer';
|
|
49
51
|
export type { DrawerProps, DrawerRef, DrawerSide } from './Drawer';
|
|
50
52
|
export { Drawer } from './Drawer';
|
|
51
53
|
export type { EmptyStateAction, EmptyStateProps, EmptyStateSize } from './EmptyState';
|
|
@@ -132,4 +134,6 @@ export type { ToastApi, ToastOptions, ToastPosition, ToastProps, ToastProviderPr
|
|
|
132
134
|
export { Toast, ToastProvider, toast, useToast } from './Toast';
|
|
133
135
|
export type { TooltipPlacement, TooltipProps, TooltipTrigger } from './Tooltip';
|
|
134
136
|
export { Tooltip } from './Tooltip';
|
|
137
|
+
export type { ZoomableImageProps } from './ZoomableImage';
|
|
138
|
+
export { ZoomableImage } from './ZoomableImage';
|
|
135
139
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
export interface DocumentViewerSource {
|
|
4
|
+
uri: string;
|
|
5
|
+
headers?: Record<string, string>;
|
|
6
|
+
cache?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface DocumentViewerProps {
|
|
9
|
+
source: DocumentViewerSource;
|
|
10
|
+
/** Trust self-signed / invalid certs on the document request. Default false. */
|
|
11
|
+
trustAllCerts?: boolean;
|
|
12
|
+
onLoadComplete?: (numberOfPages: number) => void;
|
|
13
|
+
onPageChanged?: (page: number, numberOfPages: number) => void;
|
|
14
|
+
onError?: (error: Error) => void;
|
|
15
|
+
/** Replaces the default themed spinner shown while the document loads. */
|
|
16
|
+
loadingIndicator?: () => React.ReactNode;
|
|
17
|
+
style?: StyleProp<ViewStyle>;
|
|
18
|
+
testID?: string;
|
|
19
|
+
accessibilityLabel?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Renders a PDF only — the WebView fallback consumer apps use for non-PDF
|
|
23
|
+
* office documents is a distinct rendering strategy and stays app-side.
|
|
24
|
+
*/
|
|
25
|
+
export declare const DocumentViewer: React.FC<DocumentViewerProps>;
|
|
26
|
+
export default DocumentViewer;
|
|
27
|
+
//# sourceMappingURL=DocumentViewer.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ZoomableImage — a standalone pinch-to-zoom / pan / double-tap-to-zoom
|
|
3
|
+
* wrapper for a single piece of content (typically one `<Image>`).
|
|
4
|
+
*
|
|
5
|
+
* Reuses the same Reanimated 3 gesture composition `ImageGallery`'s internal
|
|
6
|
+
* lightbox slide uses (pinch clamped and rubber-banded at its limits, pan
|
|
7
|
+
* gated to only engage once zoomed in, double-tap toggling between baseline
|
|
8
|
+
* and `doubleTapScale`), stripped of the carousel-slide concerns that
|
|
9
|
+
* component needs and this one does not — there is no `index`/`total`/
|
|
10
|
+
* `active` because a standalone image is always the one being viewed.
|
|
11
|
+
*
|
|
12
|
+
* USAGE:
|
|
13
|
+
*
|
|
14
|
+
* <ZoomableImage>
|
|
15
|
+
* <Image source={{ uri }} style={styles.image} resizeMode="contain" />
|
|
16
|
+
* </ZoomableImage>
|
|
17
|
+
*
|
|
18
|
+
* Takes `children` rather than a `source`/`uri` prop: every real consumer of
|
|
19
|
+
* this pattern in the fleet wraps an already-authenticated image component
|
|
20
|
+
* (headers, caching, its own loading state) rather than a bare `<Image>`, so
|
|
21
|
+
* a `source` prop would force re-implementing that per app. Wrapping keeps
|
|
22
|
+
* this component ignorant of how the image is fetched.
|
|
23
|
+
*/
|
|
24
|
+
import React from 'react';
|
|
25
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
26
|
+
import type { HapticType } from '../../utils/index.js';
|
|
27
|
+
export interface ZoomableImageProps {
|
|
28
|
+
/** The content to pinch-zoom, pan, and double-tap-zoom — typically a single `<Image>`. */
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
/** Upper bound on pinch and double-tap zoom. Default 4. */
|
|
31
|
+
maxScale?: number;
|
|
32
|
+
/** Lower bound on pinch zoom — the resting scale a pinch springs back to. Default 1. */
|
|
33
|
+
minScale?: number;
|
|
34
|
+
/** Scale a double tap zooms to; a second double tap returns to baseline. Default 2. */
|
|
35
|
+
doubleTapScale?: number;
|
|
36
|
+
/** Blocks pinch/pan/double-tap and smoothly resets any active zoom back to baseline. Default false. */
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
/** Haptic feedback on double-tap-to-zoom. Pass false to disable; pass a HapticType to override. */
|
|
39
|
+
haptic?: HapticType | false;
|
|
40
|
+
/** Style for the outer wrapping view. */
|
|
41
|
+
style?: StyleProp<ViewStyle>;
|
|
42
|
+
accessibilityLabel?: string;
|
|
43
|
+
testID?: string;
|
|
44
|
+
}
|
|
45
|
+
export declare const ZoomableImage: React.FC<ZoomableImageProps>;
|
|
46
|
+
export default ZoomableImage;
|
|
47
|
+
//# sourceMappingURL=ZoomableImage.d.ts.map
|
|
@@ -46,6 +46,8 @@ export type { DialogAction, DialogProps, DialogVariant } from './Dialog/index.js
|
|
|
46
46
|
export { Dialog } from './Dialog/index.js';
|
|
47
47
|
export type { DividerOrientation, DividerProps, DividerSpacing } from './Divider/index.js';
|
|
48
48
|
export { Divider } from './Divider/index.js';
|
|
49
|
+
export type { DocumentViewerProps, DocumentViewerSource } from './DocumentViewer/index.js';
|
|
50
|
+
export { DocumentViewer } from './DocumentViewer/index.js';
|
|
49
51
|
export type { DrawerProps, DrawerRef, DrawerSide } from './Drawer/index.js';
|
|
50
52
|
export { Drawer } from './Drawer/index.js';
|
|
51
53
|
export type { EmptyStateAction, EmptyStateProps, EmptyStateSize } from './EmptyState/index.js';
|
|
@@ -132,4 +134,6 @@ export type { ToastApi, ToastOptions, ToastPosition, ToastProps, ToastProviderPr
|
|
|
132
134
|
export { Toast, ToastProvider, toast, useToast } from './Toast/index.js';
|
|
133
135
|
export type { TooltipPlacement, TooltipProps, TooltipTrigger } from './Tooltip/index.js';
|
|
134
136
|
export { Tooltip } from './Tooltip/index.js';
|
|
137
|
+
export type { ZoomableImageProps } from './ZoomableImage/index.js';
|
|
138
|
+
export { ZoomableImage } from './ZoomableImage/index.js';
|
|
135
139
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority-technologies/mobile-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Beautiful, animated, accessible React Native components, theme and form engine for Webority projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"typecheck": "tsc --noEmit"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@webority-technologies/mobile-core": "^0.0.
|
|
64
|
+
"@webority-technologies/mobile-core": "^0.0.5"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"expo": ">=57.0.0",
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"react": "^19.1.0",
|
|
70
70
|
"react-native": ">=0.81.0",
|
|
71
71
|
"react-native-gesture-handler": "^2.21.0 || ^3.0.0",
|
|
72
|
+
"react-native-pdf": ">=7.0.4",
|
|
72
73
|
"react-native-reanimated": "^4.0.0",
|
|
73
74
|
"react-native-safe-area-context": ">=5.4.0",
|
|
74
75
|
"react-native-worklets": ">=0.10.0"
|
|
@@ -103,6 +104,7 @@
|
|
|
103
104
|
]
|
|
104
105
|
},
|
|
105
106
|
"devDependencies": {
|
|
106
|
-
"expo-haptics": "^57.0.2"
|
|
107
|
+
"expo-haptics": "^57.0.2",
|
|
108
|
+
"react-native-pdf": "^7.0.4"
|
|
107
109
|
}
|
|
108
110
|
}
|