@velion-la/onboarding-sdk-react-native 1.0.0-beta.8 → 1.0.0-beta.9
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/camera/DocumentCapture.js +11 -3
- package/lib/commonjs/camera/DocumentCapture.js.map +1 -1
- package/lib/commonjs/camera/LivenessCamera.js +18 -3
- package/lib/commonjs/camera/LivenessCamera.js.map +1 -1
- package/lib/commonjs/camera/MapAddressPicker.js +12 -22
- package/lib/commonjs/camera/MapAddressPicker.js.map +1 -1
- package/lib/commonjs/ui/StepShell.js +19 -4
- package/lib/commonjs/ui/StepShell.js.map +1 -1
- package/lib/commonjs/ui/VelionOnboardingScreen.js +52 -13
- package/lib/commonjs/ui/VelionOnboardingScreen.js.map +1 -1
- package/lib/commonjs/utils/useSafeAreaInsets.js +41 -0
- package/lib/commonjs/utils/useSafeAreaInsets.js.map +1 -0
- package/lib/module/camera/DocumentCapture.js +11 -3
- package/lib/module/camera/DocumentCapture.js.map +1 -1
- package/lib/module/camera/LivenessCamera.js +18 -3
- package/lib/module/camera/LivenessCamera.js.map +1 -1
- package/lib/module/camera/MapAddressPicker.js +12 -23
- package/lib/module/camera/MapAddressPicker.js.map +1 -1
- package/lib/module/ui/StepShell.js +19 -4
- package/lib/module/ui/StepShell.js.map +1 -1
- package/lib/module/ui/VelionOnboardingScreen.js +55 -14
- package/lib/module/ui/VelionOnboardingScreen.js.map +1 -1
- package/lib/module/utils/useSafeAreaInsets.js +37 -0
- package/lib/module/utils/useSafeAreaInsets.js.map +1 -0
- package/lib/typescript/camera/DocumentCapture.d.ts.map +1 -1
- package/lib/typescript/camera/LivenessCamera.d.ts.map +1 -1
- package/lib/typescript/camera/MapAddressPicker.d.ts.map +1 -1
- package/lib/typescript/ui/StepShell.d.ts.map +1 -1
- package/lib/typescript/ui/VelionOnboardingScreen.d.ts.map +1 -1
- package/lib/typescript/utils/useSafeAreaInsets.d.ts +26 -0
- package/lib/typescript/utils/useSafeAreaInsets.d.ts.map +1 -0
- package/package.json +2 -1
- package/src/camera/DocumentCapture.tsx +12 -3
- package/src/camera/LivenessCamera.tsx +10 -3
- package/src/camera/MapAddressPicker.tsx +12 -18
- package/src/ui/StepShell.tsx +20 -3
- package/src/ui/VelionOnboardingScreen.tsx +53 -13
- package/src/utils/useSafeAreaInsets.ts +37 -0
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import { KeyboardAvoidingView, Platform, ScrollView, StyleSheet, Text, View } from 'react-native';
|
|
12
12
|
import { useTheme, withAlpha } from './theme';
|
|
13
13
|
import { BackButton } from './primitives/BackButton';
|
|
14
|
+
import { useSafeAreaInsets } from '../utils/useSafeAreaInsets';
|
|
14
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
16
|
export function StepShell({
|
|
16
17
|
title,
|
|
@@ -23,10 +24,19 @@ export function StepShell({
|
|
|
23
24
|
backDisabled = false
|
|
24
25
|
}) {
|
|
25
26
|
const theme = useTheme();
|
|
27
|
+
const insets = useSafeAreaInsets();
|
|
26
28
|
const showIconCircle = !theme.hideStepIcons && iconNode != null;
|
|
27
29
|
const body = /*#__PURE__*/_jsxs(ScrollView, {
|
|
28
|
-
style: styles.scroll
|
|
29
|
-
|
|
30
|
+
style: styles.scroll
|
|
31
|
+
// Add the device safe-area insets to the base padding so the header
|
|
32
|
+
// (icon + title) clears the top camera / notch and the trailing CTA
|
|
33
|
+
// clears the bottom navigation bar / gesture area on edge-to-edge
|
|
34
|
+
// Android and on iOS devices with a home indicator.
|
|
35
|
+
,
|
|
36
|
+
contentContainerStyle: [styles.scrollBody, {
|
|
37
|
+
paddingTop: BASE_PADDING_TOP + insets.top,
|
|
38
|
+
paddingBottom: BASE_PADDING_BOTTOM + insets.bottom
|
|
39
|
+
}],
|
|
30
40
|
keyboardShouldPersistTaps: "handled",
|
|
31
41
|
children: [onBack ? /*#__PURE__*/_jsx(BackButton, {
|
|
32
42
|
label: backLabel,
|
|
@@ -67,6 +77,11 @@ export function StepShell({
|
|
|
67
77
|
}
|
|
68
78
|
return body;
|
|
69
79
|
}
|
|
80
|
+
|
|
81
|
+
// Base vertical padding for the scroll body. Safe-area insets are added on top
|
|
82
|
+
// of these at render time (see `contentContainerStyle` above).
|
|
83
|
+
const BASE_PADDING_TOP = 12;
|
|
84
|
+
const BASE_PADDING_BOTTOM = 28;
|
|
70
85
|
const styles = StyleSheet.create({
|
|
71
86
|
flex: {
|
|
72
87
|
flex: 1
|
|
@@ -76,8 +91,8 @@ const styles = StyleSheet.create({
|
|
|
76
91
|
},
|
|
77
92
|
scrollBody: {
|
|
78
93
|
paddingHorizontal: 18,
|
|
79
|
-
paddingTop:
|
|
80
|
-
paddingBottom:
|
|
94
|
+
paddingTop: BASE_PADDING_TOP,
|
|
95
|
+
paddingBottom: BASE_PADDING_BOTTOM
|
|
81
96
|
},
|
|
82
97
|
header: {
|
|
83
98
|
alignItems: 'center',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["KeyboardAvoidingView","Platform","ScrollView","StyleSheet","Text","View","useTheme","withAlpha","BackButton","jsx","_jsx","jsxs","_jsxs","StepShell","title","subtitle","iconNode","children","avoidKeyboard","onBack","backLabel","backDisabled","theme","showIconCircle","hideStepIcons","body","style","styles","scroll","contentContainerStyle","scrollBody","keyboardShouldPersistTaps","label","onPress","disabled","header","iconCircle","backgroundColor","primaryColor","shadowColor","accessibilityElementsHidden","importantForAccessibility","color","textColor","textSecondaryColor","column","flex","behavior","OS","undefined","create","paddingHorizontal","
|
|
1
|
+
{"version":3,"names":["KeyboardAvoidingView","Platform","ScrollView","StyleSheet","Text","View","useTheme","withAlpha","BackButton","useSafeAreaInsets","jsx","_jsx","jsxs","_jsxs","StepShell","title","subtitle","iconNode","children","avoidKeyboard","onBack","backLabel","backDisabled","theme","insets","showIconCircle","hideStepIcons","body","style","styles","scroll","contentContainerStyle","scrollBody","paddingTop","BASE_PADDING_TOP","top","paddingBottom","BASE_PADDING_BOTTOM","bottom","keyboardShouldPersistTaps","label","onPress","disabled","header","iconCircle","backgroundColor","primaryColor","shadowColor","accessibilityElementsHidden","importantForAccessibility","color","textColor","textSecondaryColor","column","flex","behavior","OS","undefined","create","paddingHorizontal","alignItems","marginBottom","width","height","borderRadius","justifyContent","shadowOpacity","shadowRadius","shadowOffset","elevation","fontSize","fontWeight","letterSpacing","textAlign","marginTop","lineHeight","maxWidth","alignSelf","gap"],"sourceRoot":"../../../src","sources":["ui/StepShell.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SACEA,oBAAoB,EACpBC,QAAQ,EACRC,UAAU,EACVC,UAAU,EACVC,IAAI,EACJC,IAAI,QACC,cAAc;AACrB,SAASC,QAAQ,EAAEC,SAAS,QAAQ,SAAS;AAC7C,SAASC,UAAU,QAAQ,yBAAyB;AACpD,SAASC,iBAAiB,QAAQ,4BAA4B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAsB/D,OAAO,SAASC,SAASA,CAAC;EACxBC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,aAAa,GAAG,IAAI;EACpBC,MAAM;EACNC,SAAS,GAAG,OAAO;EACnBC,YAAY,GAAG;AACD,CAAC,EAAE;EACjB,MAAMC,KAAK,GAAGjB,QAAQ,CAAC,CAAC;EACxB,MAAMkB,MAAM,GAAGf,iBAAiB,CAAC,CAAC;EAElC,MAAMgB,cAAc,GAAG,CAACF,KAAK,CAACG,aAAa,IAAIT,QAAQ,IAAI,IAAI;EAE/D,MAAMU,IAAI,gBACRd,KAAA,CAACX,UAAU;IACT0B,KAAK,EAAEC,MAAM,CAACC;IACd;IACA;IACA;IACA;IAAA;IACAC,qBAAqB,EAAE,CACrBF,MAAM,CAACG,UAAU,EACjB;MACEC,UAAU,EAAEC,gBAAgB,GAAGV,MAAM,CAACW,GAAG;MACzCC,aAAa,EAAEC,mBAAmB,GAAGb,M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AAE,GAAG;IACbC,SAAS,EAAE,QAAQ;IACnBC,GAAG,EAAE;EACP;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -17,7 +17,33 @@ import { LoadingOverlay } from './overlays/LoadingOverlay';
|
|
|
17
17
|
import { PROGRESS_BAR, ProgressBar } from './overlays/ProgressBar';
|
|
18
18
|
import { getStrings } from '../i18n';
|
|
19
19
|
import { activateScreenKeepAwake, deactivateScreenKeepAwake } from '../utils/keepAwake';
|
|
20
|
-
import {
|
|
20
|
+
import { useSafeAreaInsets } from '../utils/useSafeAreaInsets';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Mounts `react-native-safe-area-context`'s `SafeAreaProvider` so descendant
|
|
24
|
+
* `useSafeAreaInsets()` calls resolve real device insets (notch / nav bar). The
|
|
25
|
+
* library is loaded dynamically with a fail-safe: hosts that strip it (or that
|
|
26
|
+
* already mount their own provider higher up) still render — a nested provider
|
|
27
|
+
* returns correct insets, and a missing module degrades to zero insets.
|
|
28
|
+
*/
|
|
29
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
|
+
function SafeAreaBoundary({
|
|
31
|
+
children
|
|
32
|
+
}) {
|
|
33
|
+
try {
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
35
|
+
const mod = require('react-native-safe-area-context');
|
|
36
|
+
const Provider = mod.SafeAreaProvider;
|
|
37
|
+
return /*#__PURE__*/_jsx(Provider, {
|
|
38
|
+
initialMetrics: mod.initialWindowMetrics,
|
|
39
|
+
children: children
|
|
40
|
+
});
|
|
41
|
+
} catch {
|
|
42
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
43
|
+
children: children
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
21
47
|
const INITIAL_STATE = {
|
|
22
48
|
loading: null,
|
|
23
49
|
stepNode: null,
|
|
@@ -31,14 +57,16 @@ export function VelionOnboardingScreen({
|
|
|
31
57
|
onFail,
|
|
32
58
|
onExit
|
|
33
59
|
}) {
|
|
34
|
-
return /*#__PURE__*/_jsx(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
60
|
+
return /*#__PURE__*/_jsx(SafeAreaBoundary, {
|
|
61
|
+
children: /*#__PURE__*/_jsx(ThemeProvider, {
|
|
62
|
+
themeOverrides: config.theme,
|
|
63
|
+
colorMode: config.colorMode ?? 'auto',
|
|
64
|
+
children: /*#__PURE__*/_jsx(VelionOnboardingInner, {
|
|
65
|
+
config: config,
|
|
66
|
+
onComplete: onComplete,
|
|
67
|
+
onFail: onFail,
|
|
68
|
+
onExit: onExit
|
|
69
|
+
})
|
|
42
70
|
})
|
|
43
71
|
});
|
|
44
72
|
}
|
|
@@ -49,6 +77,7 @@ function VelionOnboardingInner({
|
|
|
49
77
|
onExit
|
|
50
78
|
}) {
|
|
51
79
|
const theme = useTheme();
|
|
80
|
+
const insets = useSafeAreaInsets();
|
|
52
81
|
const t = getStrings(config.locale);
|
|
53
82
|
const [state, setState] = useState(INITIAL_STATE);
|
|
54
83
|
const [progress, setProgress] = useState(0);
|
|
@@ -187,13 +216,19 @@ function VelionOnboardingInner({
|
|
|
187
216
|
style: [styles.root, {
|
|
188
217
|
backgroundColor: theme.backgroundColor
|
|
189
218
|
}],
|
|
190
|
-
children: [
|
|
191
|
-
value: progress,
|
|
192
|
-
hidden: progressHidden
|
|
193
|
-
}) : null, /*#__PURE__*/_jsx(View, {
|
|
219
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
194
220
|
style: styles.content,
|
|
195
221
|
children: renderBody()
|
|
196
|
-
}),
|
|
222
|
+
}), showProgress ? /*#__PURE__*/_jsx(View, {
|
|
223
|
+
pointerEvents: "none",
|
|
224
|
+
style: [styles.progressOverlay, {
|
|
225
|
+
paddingTop: insets.top
|
|
226
|
+
}],
|
|
227
|
+
children: /*#__PURE__*/_jsx(ProgressBar, {
|
|
228
|
+
value: progress,
|
|
229
|
+
hidden: progressHidden
|
|
230
|
+
})
|
|
231
|
+
}) : null, showLoadingOverlay ? /*#__PURE__*/_jsx(LoadingOverlay, {
|
|
197
232
|
message: loadingText
|
|
198
233
|
}) : null]
|
|
199
234
|
});
|
|
@@ -206,6 +241,12 @@ const styles = StyleSheet.create({
|
|
|
206
241
|
flex: 1,
|
|
207
242
|
overflow: 'hidden'
|
|
208
243
|
},
|
|
244
|
+
progressOverlay: {
|
|
245
|
+
position: 'absolute',
|
|
246
|
+
top: 0,
|
|
247
|
+
left: 0,
|
|
248
|
+
right: 0
|
|
249
|
+
},
|
|
209
250
|
message: {
|
|
210
251
|
flex: 1,
|
|
211
252
|
alignItems: 'center',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useMemo","useRef","useState","StyleSheet","Text","View","VelionOnboarding","ThemeProvider","useTheme","LoadingOverlay","PROGRESS_BAR","ProgressBar","getStrings","activateScreenKeepAwake","deactivateScreenKeepAwake","jsx","_jsx","jsxs","_jsxs","INITIAL_STATE","loading","stepNode","error","result","exited","VelionOnboardingScreen","config","onComplete","onFail","onExit","themeOverrides","theme","colorMode","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useMemo","useRef","useState","StyleSheet","Text","View","VelionOnboarding","ThemeProvider","useTheme","LoadingOverlay","PROGRESS_BAR","ProgressBar","getStrings","activateScreenKeepAwake","deactivateScreenKeepAwake","useSafeAreaInsets","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","SafeAreaBoundary","children","mod","require","Provider","SafeAreaProvider","initialMetrics","initialWindowMetrics","INITIAL_STATE","loading","stepNode","error","result","exited","VelionOnboardingScreen","config","onComplete","onFail","onExit","themeOverrides","theme","colorMode","VelionOnboardingInner","insets","t","locale","state","setState","progress","setProgress","progressHidden","setProgressHidden","sdk","sessionId","apiUrl","sdkRef","current","onCompleteRef","onFailRef","onExitRef","attachView","setLoading","text","s","setStepNode","node","setError","err","setResult","complete","setTimeout","setExit","exit","unsubStepChange","on","curr","tick","start","detachView","destroy","renderBody","style","styles","message","title","color","errorColor","declineTitle","declineHeadline","body","textColor","declineMessage","status","approvedTitle","approvedBody","manualReviewTitle","manualReviewBody","rejectedTitle","rejectedBody","textSecondaryColor","showLoadingOverlay","loadingText","common","showProgress","showProgressBar","hideProgressBar","root","backgroundColor","content","pointerEvents","progressOverlay","paddingTop","top","value","hidden","create","flex","overflow","position","left","right","alignItems","justifyContent","paddingHorizontal","gap","fontSize","fontWeight","textAlign","lineHeight","maxWidth"],"sourceRoot":"../../../src","sources":["ui/VelionOnboardingScreen.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IACVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QAEH,OAAO;AACd,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACrD,SAASC,gBAAgB,QAA2B,0BAA0B;AAO9E,SAASC,aAAa,EAAEC,QAAQ,QAAQ,SAAS;AACjD,SAASC,cAAc,QAAQ,2BAA2B;AAC1D,SAASC,YAAY,EAAEC,WAAW,QAAQ,wBAAwB;AAClE,SAASC,UAAU,QAAQ,SAAS;AACpC,SACEC,uBAAuB,EACvBC,yBAAyB,QACpB,oBAAoB;AAC3B,SAASC,iBAAiB,QAAQ,4BAA4B;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAOA,SAASC,gBAAgBA,CAAC;EAAEC;AAAkC,CAAC,EAAE;EAC/D,IAAI;IACF;IACA,MAAMC,GAAG,GAAGC,OAAO,CAAC,gCAAgC,CAAC;IACrD,MAAMC,QAAQ,GAAGF,GAAG,CAACG,gBAAgB;IACrC,oBACEV,IAAA,CAACS,Q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+
*
|
|
6
|
+
* `react-native-safe-area-context` is a transitive peer of Expo SDK 54+ (and is
|
|
7
|
+
* declared as a peerDependency of this SDK), but we never import it statically:
|
|
8
|
+
* hosts that strip optional native deps, or render the SDK outside a
|
|
9
|
+
* `SafeAreaProvider`, must still get a usable layout. So the hook is loaded with
|
|
10
|
+
* a `require` inside a try/catch and falls back to zero insets.
|
|
11
|
+
*
|
|
12
|
+
* The `require` result is deterministic for the lifetime of the bundle (the
|
|
13
|
+
* module is either installed or not), so the conditional hook call below does
|
|
14
|
+
* not change across renders — it does not violate the rules of hooks. Callers
|
|
15
|
+
* MUST still invoke this hook unconditionally (before any early return).
|
|
16
|
+
*
|
|
17
|
+
* Insets are applied to UI chrome (headers, CTAs, camera controls) — never to
|
|
18
|
+
* the full-bleed `<Camera>` / `<MapView>` preview, which must keep covering the
|
|
19
|
+
* whole screen so OCR / liveness framing is not cropped.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const ZERO_INSETS = {
|
|
23
|
+
top: 0,
|
|
24
|
+
bottom: 0,
|
|
25
|
+
left: 0,
|
|
26
|
+
right: 0
|
|
27
|
+
};
|
|
28
|
+
export function useSafeAreaInsets() {
|
|
29
|
+
try {
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
31
|
+
const mod = require('react-native-safe-area-context');
|
|
32
|
+
return mod.useSafeAreaInsets();
|
|
33
|
+
} catch {
|
|
34
|
+
return ZERO_INSETS;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=useSafeAreaInsets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ZERO_INSETS","top","bottom","left","right","useSafeAreaInsets","mod","require"],"sourceRoot":"../../../src","sources":["utils/useSafeAreaInsets.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,MAAMA,WAAuB,GAAG;EAAEC,GAAG,EAAE,CAAC;EAAEC,MAAM,EAAE,CAAC;EAAEC,IAAI,EAAE,CAAC;EAAEC,KAAK,EAAE;AAAE,CAAC;AAExE,OAAO,SAASC,iBAAiBA,CAAA,EAAe;EAC9C,IAAI;IACF;IACA,MAAMC,GAAG,GAAGC,OAAO,CAAC,gCAAgC,CAAC;IACrD,OAAOD,GAAG,CAACD,iBAAiB,CAAC,CAAC;EAChC,CAAC,CAAC,MAAM;IACN,OAAOL,WAAW;EACpB;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentCapture.d.ts","sourceRoot":"","sources":["../../../src/camera/DocumentCapture.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAYH,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"DocumentCapture.d.ts","sourceRoot":"","sources":["../../../src/camera/DocumentCapture.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAYH,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAKlE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,EAAE,mBAAmB,CAAC;IACjC,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,YAAY,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,qBAAqB,EAAE,MAAM,CAAC;IAC9B,mCAAmC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC3D,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,UAAU,EACV,WAAW,EACX,UAAU,EACV,QAAQ,GACT,EAAE,oBAAoB,+BAkOtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LivenessCamera.d.ts","sourceRoot":"","sources":["../../../src/camera/LivenessCamera.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoBH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"LivenessCamera.d.ts","sourceRoot":"","sources":["../../../src/camera/LivenessCamera.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoBH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,4BAA4B,CAAC;AAKpC,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IAC3C;;;;;;OAMG;IACH,mBAAmB,CAAC,IAAI,EAAE;QACxB,mBAAmB,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;QAChD,gBAAgB,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;KAC1C,GAAG,IAAI,CAAC;IACT;;;;OAIG;IACH,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC;AAED;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,aAAa,GAAG,cAAc,CAAC;AAEzE,MAAM,WAAW,mBAAmB;IAClC,wEAAwE;IACxE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,wEAAwE;IACxE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C,2EAA2E;IAC3E,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IACtC,iFAAiF;IACjF,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,GAAG,SAAS,CAAC;IAC5E,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACrC,wCAAwC;IACxC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;CACrC;AAED,eAAO,MAAM,cAAc,sHAgP1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapAddressPicker.d.ts","sourceRoot":"","sources":["../../../src/camera/MapAddressPicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAKN,MAAM,OAAO,CAAC;AAcf,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"MapAddressPicker.d.ts","sourceRoot":"","sources":["../../../src/camera/MapAddressPicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAKN,MAAM,OAAO,CAAC;AAcf,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,uCAAuC,CAAC;AA0D/C,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE;QACf,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC3B,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC7B,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC7B,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KAC9B,GAAG,SAAS,CAAC;IACd,wEAAwE;IACxE,YAAY,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACjD,SAAS,EAAE,CACT,MAAM,EAAE,mBAAmB,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAClE,IAAI,CAAC;IACV,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,qBAAqB,qBAsN7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepShell.d.ts","sourceRoot":"","sources":["../../../src/ui/StepShell.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"StepShell.d.ts","sourceRoot":"","sources":["../../../src/ui/StepShell.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAavC,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,kFAAkF;IAClF,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAClC,gFAAgF;IAChF,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACpC;AAED,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,aAAoB,EACpB,MAAM,EACN,SAAmB,EACnB,YAAoB,GACrB,EAAE,cAAc,+BAiEhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VelionOnboardingScreen.d.ts","sourceRoot":"","sources":["../../../src/ui/VelionOnboardingScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAON,MAAM,OAAO,CAAC;AAEf,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,QAAQ,EACT,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"VelionOnboardingScreen.d.ts","sourceRoot":"","sources":["../../../src/ui/VelionOnboardingScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAON,MAAM,OAAO,CAAC;AAEf,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,QAAQ,EACT,MAAM,UAAU,CAAC;AA+BlB,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC9D,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC/C;;;;;OAKG;IACH,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CACvD;AAmBD,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,UAAU,EACV,MAAM,EACN,MAAM,GACP,EAAE,2BAA2B,qBAgB7B;AA8LD,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Shared safe-area inset hook with a dynamic, fail-safe loader.
|
|
3
|
+
*
|
|
4
|
+
* `react-native-safe-area-context` is a transitive peer of Expo SDK 54+ (and is
|
|
5
|
+
* declared as a peerDependency of this SDK), but we never import it statically:
|
|
6
|
+
* hosts that strip optional native deps, or render the SDK outside a
|
|
7
|
+
* `SafeAreaProvider`, must still get a usable layout. So the hook is loaded with
|
|
8
|
+
* a `require` inside a try/catch and falls back to zero insets.
|
|
9
|
+
*
|
|
10
|
+
* The `require` result is deterministic for the lifetime of the bundle (the
|
|
11
|
+
* module is either installed or not), so the conditional hook call below does
|
|
12
|
+
* not change across renders — it does not violate the rules of hooks. Callers
|
|
13
|
+
* MUST still invoke this hook unconditionally (before any early return).
|
|
14
|
+
*
|
|
15
|
+
* Insets are applied to UI chrome (headers, CTAs, camera controls) — never to
|
|
16
|
+
* the full-bleed `<Camera>` / `<MapView>` preview, which must keep covering the
|
|
17
|
+
* whole screen so OCR / liveness framing is not cropped.
|
|
18
|
+
*/
|
|
19
|
+
export interface EdgeInsets {
|
|
20
|
+
top: number;
|
|
21
|
+
bottom: number;
|
|
22
|
+
left: number;
|
|
23
|
+
right: number;
|
|
24
|
+
}
|
|
25
|
+
export declare function useSafeAreaInsets(): EdgeInsets;
|
|
26
|
+
//# sourceMappingURL=useSafeAreaInsets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSafeAreaInsets.d.ts","sourceRoot":"","sources":["../../../src/utils/useSafeAreaInsets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAID,wBAAgB,iBAAiB,IAAI,UAAU,CAQ9C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@velion-la/onboarding-sdk-react-native",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.9",
|
|
4
4
|
"description": "Native React Native SDK for the Velion Onboarding (KYC) flow: ID document OCR, passive + active liveness, device fingerprint, OTP verification, address picker, and personal / legal information forms.",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"react": ">=19.0.0",
|
|
75
75
|
"react-native": ">=0.81.0",
|
|
76
76
|
"react-native-maps": ">=1.20.0",
|
|
77
|
+
"react-native-safe-area-context": ">=4.0.0",
|
|
77
78
|
"react-native-svg": ">=15.0.0",
|
|
78
79
|
"react-native-vision-camera": ">=4.6.0"
|
|
79
80
|
},
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
import type { DocumentOrientation, DocumentSide } from '../types';
|
|
33
33
|
import { useTheme, withAlpha } from '../ui/theme';
|
|
34
34
|
import { Button } from '../ui/primitives/Button';
|
|
35
|
+
import { useSafeAreaInsets } from '../utils/useSafeAreaInsets';
|
|
35
36
|
|
|
36
37
|
export interface DocumentCaptureProps {
|
|
37
38
|
side: DocumentSide;
|
|
@@ -62,6 +63,7 @@ export function DocumentCapture({
|
|
|
62
63
|
onCancel,
|
|
63
64
|
}: DocumentCaptureProps) {
|
|
64
65
|
const theme = useTheme();
|
|
66
|
+
const insets = useSafeAreaInsets();
|
|
65
67
|
const cameraRef = useRef<Camera>(null);
|
|
66
68
|
// Cross-platform back-camera selection.
|
|
67
69
|
//
|
|
@@ -249,15 +251,22 @@ export function DocumentCapture({
|
|
|
249
251
|
]}
|
|
250
252
|
/>
|
|
251
253
|
) : null}
|
|
252
|
-
<
|
|
254
|
+
{/* The <Camera> above stays full-bleed (absoluteFill) so OCR framing is
|
|
255
|
+
never cropped; only the chrome below is offset by the safe-area
|
|
256
|
+
insets so the ✕ clears the top notch and the shutter clears the
|
|
257
|
+
bottom navigation bar / gesture area. */}
|
|
258
|
+
<View style={[styles.topBar, { top: insets.top + 12 }]}>
|
|
253
259
|
<Pressable onPress={onCancel} style={styles.iconBtn} accessibilityLabel={cancelLabel}>
|
|
254
260
|
<Text style={styles.iconBtnText}>✕</Text>
|
|
255
261
|
</Pressable>
|
|
256
262
|
</View>
|
|
257
|
-
<View
|
|
263
|
+
<View
|
|
264
|
+
style={[styles.instructions, { top: insets.top + 60 }]}
|
|
265
|
+
pointerEvents="none"
|
|
266
|
+
>
|
|
258
267
|
<Text style={styles.instructionsText}>{instructions}</Text>
|
|
259
268
|
</View>
|
|
260
|
-
<View style={styles.bottomBar}>
|
|
269
|
+
<View style={[styles.bottomBar, { bottom: insets.bottom + 32 }]}>
|
|
261
270
|
{error ? <Text style={styles.errorText}>{error}</Text> : null}
|
|
262
271
|
<Pressable
|
|
263
272
|
accessibilityRole="button"
|
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
} from 'react-native-vision-camera';
|
|
43
43
|
import { Button } from '../ui/primitives/Button';
|
|
44
44
|
import { useTheme, withAlpha } from '../ui/theme';
|
|
45
|
+
import { useSafeAreaInsets } from '../utils/useSafeAreaInsets';
|
|
45
46
|
|
|
46
47
|
export interface LivenessCameraHandle {
|
|
47
48
|
takeFrame: () => Promise<PhotoFile | null>;
|
|
@@ -95,6 +96,7 @@ export interface LivenessCameraProps {
|
|
|
95
96
|
export const LivenessCamera = forwardRef<LivenessCameraHandle, LivenessCameraProps>(
|
|
96
97
|
function LivenessCamera(props, ref) {
|
|
97
98
|
const theme = useTheme();
|
|
99
|
+
const insets = useSafeAreaInsets();
|
|
98
100
|
const cameraRef = useRef<Camera>(null);
|
|
99
101
|
const device = useCameraDevice('front');
|
|
100
102
|
// Pick a 720p / 30-fps format so the recorded mp4 stays a few MB instead
|
|
@@ -301,7 +303,7 @@ export const LivenessCamera = forwardRef<LivenessCameraHandle, LivenessCameraPro
|
|
|
301
303
|
/>
|
|
302
304
|
) : null}
|
|
303
305
|
{props.statusText ? (
|
|
304
|
-
<View style={styles.statusPill}>
|
|
306
|
+
<View style={[styles.statusPill, { top: insets.top + 130 }]}>
|
|
305
307
|
<ActivityIndicator color="#FFFFFF" size="small" />
|
|
306
308
|
<Text style={styles.statusText}>{props.statusText}</Text>
|
|
307
309
|
</View>
|
|
@@ -310,6 +312,7 @@ export const LivenessCamera = forwardRef<LivenessCameraHandle, LivenessCameraPro
|
|
|
310
312
|
<View
|
|
311
313
|
style={[
|
|
312
314
|
styles.toast,
|
|
315
|
+
{ bottom: insets.bottom + 100 },
|
|
313
316
|
{
|
|
314
317
|
backgroundColor:
|
|
315
318
|
props.toast.kind === 'success'
|
|
@@ -347,6 +350,8 @@ interface ProgressBarProps {
|
|
|
347
350
|
* so the user can tell the system is still listening.
|
|
348
351
|
*/
|
|
349
352
|
function ProgressBar({ progress, color }: ProgressBarProps) {
|
|
353
|
+
const insets = useSafeAreaInsets();
|
|
354
|
+
const trackBottom = insets.bottom + 60;
|
|
350
355
|
const clamped = Math.max(0, Math.min(1, progress));
|
|
351
356
|
const isIndeterminate = clamped < 0.05;
|
|
352
357
|
|
|
@@ -376,7 +381,7 @@ function ProgressBar({ progress, color }: ProgressBarProps) {
|
|
|
376
381
|
outputRange: ['-30%', '100%'],
|
|
377
382
|
});
|
|
378
383
|
return (
|
|
379
|
-
<View style={styles.progressTrack}>
|
|
384
|
+
<View style={[styles.progressTrack, { bottom: trackBottom }]}>
|
|
380
385
|
<Animated.View
|
|
381
386
|
style={[
|
|
382
387
|
styles.progressShimmer,
|
|
@@ -388,7 +393,7 @@ function ProgressBar({ progress, color }: ProgressBarProps) {
|
|
|
388
393
|
}
|
|
389
394
|
|
|
390
395
|
return (
|
|
391
|
-
<View style={styles.progressTrack}>
|
|
396
|
+
<View style={[styles.progressTrack, { bottom: trackBottom }]}>
|
|
392
397
|
<View
|
|
393
398
|
style={[
|
|
394
399
|
styles.progressBar,
|
|
@@ -421,6 +426,7 @@ interface ChallengeBannerProps {
|
|
|
421
426
|
* line / icon if needed without changing the call site.
|
|
422
427
|
*/
|
|
423
428
|
function ChallengeBanner({ text, tint: _tint }: ChallengeBannerProps) {
|
|
429
|
+
const insets = useSafeAreaInsets();
|
|
424
430
|
const opacity = useRef(new Animated.Value(0)).current;
|
|
425
431
|
const scale = useRef(new Animated.Value(0.85)).current;
|
|
426
432
|
|
|
@@ -451,6 +457,7 @@ function ChallengeBanner({ text, tint: _tint }: ChallengeBannerProps) {
|
|
|
451
457
|
pointerEvents="none"
|
|
452
458
|
style={[
|
|
453
459
|
styles.challengeBanner,
|
|
460
|
+
{ top: insets.top + 76 },
|
|
454
461
|
{
|
|
455
462
|
opacity,
|
|
456
463
|
transform: [{ scale }],
|
|
@@ -47,21 +47,9 @@ import {
|
|
|
47
47
|
type ParsedAddressFields,
|
|
48
48
|
} from '../utils/parseGoogleAddressComponents';
|
|
49
49
|
import { log } from '../utils/log';
|
|
50
|
+
import { useSafeAreaInsets } from '../utils/useSafeAreaInsets';
|
|
50
51
|
import { AddressSearchBar, type AddressSuggestion } from './AddressSearchBar';
|
|
51
52
|
|
|
52
|
-
// `react-native-safe-area-context` is a transitive peer of Expo SDK 54+, but
|
|
53
|
-
// not a direct dep of this SDK. Load it dynamically with a safe fallback so
|
|
54
|
-
// hosts that strip optional deps still get reasonable inset values.
|
|
55
|
-
function useSafeAreaInsets(): { top: number; bottom: number; left: number; right: number } {
|
|
56
|
-
try {
|
|
57
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
58
|
-
const mod = require('react-native-safe-area-context');
|
|
59
|
-
return mod.useSafeAreaInsets();
|
|
60
|
-
} catch {
|
|
61
|
-
return { top: 0, bottom: 0, left: 0, right: 0 };
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
53
|
const floatingShadow = {
|
|
66
54
|
shadowColor: '#000',
|
|
67
55
|
shadowOffset: { width: 0, height: 2 },
|
|
@@ -148,6 +136,15 @@ export function MapAddressPicker(
|
|
|
148
136
|
props: MapAddressPickerProps,
|
|
149
137
|
) {
|
|
150
138
|
const theme = useTheme();
|
|
139
|
+
// Hooks must run unconditionally — call this before the `!modules.MapView`
|
|
140
|
+
// early return below.
|
|
141
|
+
const insets = useSafeAreaInsets();
|
|
142
|
+
const topInset = Math.max(insets.top, Platform.OS === 'ios' ? 44 : 16);
|
|
143
|
+
const bottomInset = Math.max(insets.bottom, 16);
|
|
144
|
+
// Lift the floating "Next" button a notch above the safe-area inset so it
|
|
145
|
+
// doesn't sit flush against the iOS home indicator / Android gesture bar,
|
|
146
|
+
// which made it look clipped by the screen edge.
|
|
147
|
+
const buttonBottom = bottomInset + 12;
|
|
151
148
|
const modules = useRef<NativeModules>(loadNativeModules()).current;
|
|
152
149
|
|
|
153
150
|
const [coord, setCoord] = useState<{ latitude: number; longitude: number } | null>(
|
|
@@ -274,9 +271,6 @@ export function MapAddressPicker(
|
|
|
274
271
|
}
|
|
275
272
|
|
|
276
273
|
const { MapView, Marker, PROVIDER_GOOGLE } = modules;
|
|
277
|
-
const insets = useSafeAreaInsets();
|
|
278
|
-
const topInset = Math.max(insets.top, Platform.OS === 'ios' ? 44 : 16);
|
|
279
|
-
const bottomInset = Math.max(insets.bottom, 16);
|
|
280
274
|
|
|
281
275
|
return (
|
|
282
276
|
<View style={styles.root}>
|
|
@@ -333,7 +327,7 @@ export function MapAddressPicker(
|
|
|
333
327
|
{/* Floating banners stack above the bottom button. */}
|
|
334
328
|
<View
|
|
335
329
|
pointerEvents="box-none"
|
|
336
|
-
style={[styles.floatNotes, { bottom:
|
|
330
|
+
style={[styles.floatNotes, { bottom: buttonBottom + 76 }]}
|
|
337
331
|
>
|
|
338
332
|
{permissionDenied ? (
|
|
339
333
|
<Banner variant="warning" message={props.locationDenied} />
|
|
@@ -349,7 +343,7 @@ export function MapAddressPicker(
|
|
|
349
343
|
disabled={
|
|
350
344
|
!parsed || !isAddressSelectionComplete(parsed, props.requiredFields)
|
|
351
345
|
}
|
|
352
|
-
style={[styles.floatBottom, { bottom:
|
|
346
|
+
style={[styles.floatBottom, { bottom: buttonBottom }, floatingShadow]}
|
|
353
347
|
/>
|
|
354
348
|
</View>
|
|
355
349
|
);
|
package/src/ui/StepShell.tsx
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
} from 'react-native';
|
|
18
18
|
import { useTheme, withAlpha } from './theme';
|
|
19
19
|
import { BackButton } from './primitives/BackButton';
|
|
20
|
+
import { useSafeAreaInsets } from '../utils/useSafeAreaInsets';
|
|
20
21
|
|
|
21
22
|
export interface StepShellProps {
|
|
22
23
|
title: string;
|
|
@@ -49,13 +50,24 @@ export function StepShell({
|
|
|
49
50
|
backDisabled = false,
|
|
50
51
|
}: StepShellProps) {
|
|
51
52
|
const theme = useTheme();
|
|
53
|
+
const insets = useSafeAreaInsets();
|
|
52
54
|
|
|
53
55
|
const showIconCircle = !theme.hideStepIcons && iconNode != null;
|
|
54
56
|
|
|
55
57
|
const body = (
|
|
56
58
|
<ScrollView
|
|
57
59
|
style={styles.scroll}
|
|
58
|
-
|
|
60
|
+
// Add the device safe-area insets to the base padding so the header
|
|
61
|
+
// (icon + title) clears the top camera / notch and the trailing CTA
|
|
62
|
+
// clears the bottom navigation bar / gesture area on edge-to-edge
|
|
63
|
+
// Android and on iOS devices with a home indicator.
|
|
64
|
+
contentContainerStyle={[
|
|
65
|
+
styles.scrollBody,
|
|
66
|
+
{
|
|
67
|
+
paddingTop: BASE_PADDING_TOP + insets.top,
|
|
68
|
+
paddingBottom: BASE_PADDING_BOTTOM + insets.bottom,
|
|
69
|
+
},
|
|
70
|
+
]}
|
|
59
71
|
keyboardShouldPersistTaps="handled"
|
|
60
72
|
>
|
|
61
73
|
{onBack ? (
|
|
@@ -103,6 +115,11 @@ export function StepShell({
|
|
|
103
115
|
return body;
|
|
104
116
|
}
|
|
105
117
|
|
|
118
|
+
// Base vertical padding for the scroll body. Safe-area insets are added on top
|
|
119
|
+
// of these at render time (see `contentContainerStyle` above).
|
|
120
|
+
const BASE_PADDING_TOP = 12;
|
|
121
|
+
const BASE_PADDING_BOTTOM = 28;
|
|
122
|
+
|
|
106
123
|
const styles = StyleSheet.create({
|
|
107
124
|
flex: {
|
|
108
125
|
flex: 1,
|
|
@@ -112,8 +129,8 @@ const styles = StyleSheet.create({
|
|
|
112
129
|
},
|
|
113
130
|
scrollBody: {
|
|
114
131
|
paddingHorizontal: 18,
|
|
115
|
-
paddingTop:
|
|
116
|
-
paddingBottom:
|
|
132
|
+
paddingTop: BASE_PADDING_TOP,
|
|
133
|
+
paddingBottom: BASE_PADDING_BOTTOM,
|
|
117
134
|
},
|
|
118
135
|
header: {
|
|
119
136
|
alignItems: 'center',
|