@bytexbyte/berifyme-react-native-sdk 1.0.22 → 1.0.23
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/BerifymeModal/index.js +6 -3
- package/lib/commonjs/BerifymeModal/index.js.map +1 -1
- package/lib/commonjs/components/IncodeOnBoarding.js +116 -30
- package/lib/commonjs/components/IncodeOnBoarding.js.map +1 -1
- package/lib/commonjs/components/incodeLogin.js +102 -19
- package/lib/commonjs/components/incodeLogin.js.map +1 -1
- package/lib/module/BerifymeModal/index.js +6 -3
- package/lib/module/BerifymeModal/index.js.map +1 -1
- package/lib/module/components/IncodeOnBoarding.js +115 -31
- package/lib/module/components/IncodeOnBoarding.js.map +1 -1
- package/lib/module/components/incodeLogin.js +101 -20
- package/lib/module/components/incodeLogin.js.map +1 -1
- package/lib/typescript/commonjs/lib/commonjs/BerifymeModal/index.d.ts +2 -1
- package/lib/typescript/commonjs/lib/commonjs/BerifymeModal/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/lib/commonjs/components/IncodeOnBoarding.d.ts +2 -1
- package/lib/typescript/commonjs/lib/commonjs/components/IncodeOnBoarding.d.ts.map +1 -1
- package/lib/typescript/commonjs/lib/commonjs/components/incodeLogin.d.ts +2 -1
- package/lib/typescript/commonjs/lib/commonjs/components/incodeLogin.d.ts.map +1 -1
- package/lib/typescript/commonjs/lib/module/BerifymeModal/index.d.ts +2 -1
- package/lib/typescript/commonjs/lib/module/BerifymeModal/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/lib/module/components/IncodeOnBoarding.d.ts +2 -1
- package/lib/typescript/commonjs/lib/module/components/IncodeOnBoarding.d.ts.map +1 -1
- package/lib/typescript/commonjs/lib/module/components/incodeLogin.d.ts +2 -1
- package/lib/typescript/commonjs/lib/module/components/incodeLogin.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/BerifymeModal/index.d.ts +3 -1
- package/lib/typescript/commonjs/src/BerifymeModal/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/IncodeOnBoarding.d.ts +8 -2
- package/lib/typescript/commonjs/src/components/IncodeOnBoarding.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/incodeLogin.d.ts +5 -2
- package/lib/typescript/commonjs/src/components/incodeLogin.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +2 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/lib/commonjs/BerifymeModal/index.d.ts +2 -1
- package/lib/typescript/module/lib/commonjs/BerifymeModal/index.d.ts.map +1 -1
- package/lib/typescript/module/lib/commonjs/components/IncodeOnBoarding.d.ts +2 -1
- package/lib/typescript/module/lib/commonjs/components/IncodeOnBoarding.d.ts.map +1 -1
- package/lib/typescript/module/lib/commonjs/components/incodeLogin.d.ts +2 -1
- package/lib/typescript/module/lib/commonjs/components/incodeLogin.d.ts.map +1 -1
- package/lib/typescript/module/lib/module/BerifymeModal/index.d.ts +2 -1
- package/lib/typescript/module/lib/module/BerifymeModal/index.d.ts.map +1 -1
- package/lib/typescript/module/lib/module/components/IncodeOnBoarding.d.ts +2 -1
- package/lib/typescript/module/lib/module/components/IncodeOnBoarding.d.ts.map +1 -1
- package/lib/typescript/module/lib/module/components/incodeLogin.d.ts +2 -1
- package/lib/typescript/module/lib/module/components/incodeLogin.d.ts.map +1 -1
- package/lib/typescript/module/src/BerifymeModal/index.d.ts +3 -1
- package/lib/typescript/module/src/BerifymeModal/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/IncodeOnBoarding.d.ts +8 -2
- package/lib/typescript/module/src/components/IncodeOnBoarding.d.ts.map +1 -1
- package/lib/typescript/module/src/components/incodeLogin.d.ts +5 -2
- package/lib/typescript/module/src/components/incodeLogin.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +2 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { View } from 'react-native';
|
|
3
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { ActivityIndicator, StyleSheet, View } from 'react-native';
|
|
5
5
|
import WebView from 'react-native-webview';
|
|
6
6
|
import { environmentWebviewDomains } from "../environmentDomains.js";
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const ALLOWED_LOCALES = ['en', 'zh-TW', 'mix'];
|
|
9
|
+
function normalizeLocale(locale) {
|
|
10
|
+
if (locale && ALLOWED_LOCALES.includes(locale)) return locale;
|
|
11
|
+
return 'en';
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 與 SnapMatch 相同:掛載後暫禁 Web 端語言按鈕的毫秒數,讓 Incode 相機初始化完成再開放切換。
|
|
15
|
+
*/
|
|
16
|
+
const LANG_SWITCH_COOLDOWN_MS = 2000;
|
|
17
|
+
const CAMERA_RELEASE_MS = 500;
|
|
8
18
|
function IncodeOnboardingWebView({
|
|
9
19
|
token,
|
|
10
20
|
setError,
|
|
@@ -12,49 +22,123 @@ function IncodeOnboardingWebView({
|
|
|
12
22
|
setUser,
|
|
13
23
|
goBack,
|
|
14
24
|
goToAllSet,
|
|
15
|
-
environment
|
|
25
|
+
environment,
|
|
26
|
+
locale: localeProp = 'en'
|
|
16
27
|
}) {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
const [currentLocale, setCurrentLocale] = useState(() => normalizeLocale(localeProp));
|
|
29
|
+
const [webviewKey, setWebviewKey] = useState(0);
|
|
30
|
+
const [isRebuilding, setIsRebuilding] = useState(false);
|
|
31
|
+
const isRebuildingRef = useRef(false);
|
|
32
|
+
const webViewRef = useRef(null);
|
|
33
|
+
const rebuildGenerationRef = useRef(0);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
setCurrentLocale(normalizeLocale(localeProp));
|
|
36
|
+
}, [localeProp]);
|
|
37
|
+
const rebuildWebView = useCallback(newLocale => {
|
|
38
|
+
const generation = ++rebuildGenerationRef.current;
|
|
39
|
+
webViewRef.current?.injectJavaScript(`
|
|
40
|
+
(function() {
|
|
41
|
+
try {
|
|
42
|
+
document.querySelectorAll('video').forEach(function(v) {
|
|
43
|
+
try {
|
|
44
|
+
if (v.srcObject && typeof v.srcObject.getTracks === 'function') {
|
|
45
|
+
v.srcObject.getTracks().forEach(function(t) { t.stop(); });
|
|
46
|
+
v.srcObject = null;
|
|
47
|
+
}
|
|
48
|
+
} catch(e) {}
|
|
49
|
+
});
|
|
50
|
+
} catch(e) {}
|
|
51
|
+
})();
|
|
52
|
+
true;
|
|
53
|
+
`);
|
|
54
|
+
isRebuildingRef.current = true;
|
|
55
|
+
setIsRebuilding(true);
|
|
56
|
+
setCurrentLocale(normalizeLocale(newLocale));
|
|
57
|
+
const minDelayPromise = new Promise(resolve => setTimeout(resolve, CAMERA_RELEASE_MS));
|
|
58
|
+
void minDelayPromise.then(() => {
|
|
59
|
+
if (generation !== rebuildGenerationRef.current) return;
|
|
60
|
+
isRebuildingRef.current = false;
|
|
61
|
+
setIsRebuilding(false);
|
|
62
|
+
setWebviewKey(k => k + 1);
|
|
63
|
+
});
|
|
64
|
+
}, []);
|
|
65
|
+
const handleMessage = useCallback(event => {
|
|
66
|
+
try {
|
|
67
|
+
const messageData = JSON.parse(event.nativeEvent.data);
|
|
68
|
+
if (messageData.event === 'changeLocale' && typeof messageData.locale === 'string') {
|
|
69
|
+
rebuildWebView(messageData.locale);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (isRebuildingRef.current) return;
|
|
73
|
+
switch (messageData.event) {
|
|
74
|
+
case 'onSuccess':
|
|
75
|
+
console.log('onSuccess data', messageData.user);
|
|
76
|
+
if (messageData.user) {
|
|
77
|
+
setUser(messageData.user);
|
|
78
|
+
}
|
|
79
|
+
goToAllSet();
|
|
80
|
+
break;
|
|
81
|
+
case 'onGoBack':
|
|
82
|
+
console.log('User went back');
|
|
83
|
+
goBack();
|
|
84
|
+
break;
|
|
85
|
+
case 'onExit':
|
|
86
|
+
console.log('User exited');
|
|
87
|
+
setError('Something went wrong, but we’re working on it. Please try again later or contact support for assistance.');
|
|
88
|
+
break;
|
|
89
|
+
default:
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
} catch {
|
|
93
|
+
// ignore malformed message
|
|
37
94
|
}
|
|
38
|
-
};
|
|
95
|
+
}, [goBack, goToAllSet, rebuildWebView, setError, setUser]);
|
|
96
|
+
const params = new URLSearchParams({
|
|
97
|
+
userId: user.id,
|
|
98
|
+
token,
|
|
99
|
+
locale: currentLocale,
|
|
100
|
+
langCooldown: String(LANG_SWITCH_COOLDOWN_MS)
|
|
101
|
+
});
|
|
102
|
+
const uri = `${environmentWebviewDomains[environment]}/ReactNativeSDKIncodeWebViewOnBoarding?${params.toString()}`;
|
|
103
|
+
if (isRebuilding) {
|
|
104
|
+
return /*#__PURE__*/_jsx(View, {
|
|
105
|
+
style: styles.centered,
|
|
106
|
+
children: /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
107
|
+
size: "large"
|
|
108
|
+
})
|
|
109
|
+
});
|
|
110
|
+
}
|
|
39
111
|
return /*#__PURE__*/_jsx(View, {
|
|
40
|
-
style:
|
|
41
|
-
display: 'flex',
|
|
42
|
-
width: '100%',
|
|
43
|
-
height: '100%'
|
|
44
|
-
},
|
|
112
|
+
style: styles.fill,
|
|
45
113
|
children: /*#__PURE__*/_jsx(WebView, {
|
|
114
|
+
ref: webViewRef,
|
|
46
115
|
source: {
|
|
47
|
-
uri
|
|
116
|
+
uri
|
|
48
117
|
},
|
|
49
118
|
javaScriptEnabled: true,
|
|
50
119
|
domStorageEnabled: true,
|
|
51
120
|
mediaPlaybackRequiresUserAction: false,
|
|
52
121
|
allowsInlineMediaPlayback: true,
|
|
122
|
+
mediaCapturePermissionGrantType: "grant",
|
|
53
123
|
onLoad: () => console.log('WebView loaded successfully'),
|
|
54
124
|
onError: error => console.error('WebView error:', error),
|
|
55
125
|
onMessage: handleMessage
|
|
56
|
-
})
|
|
126
|
+
}, webviewKey)
|
|
57
127
|
});
|
|
58
128
|
}
|
|
129
|
+
const styles = StyleSheet.create({
|
|
130
|
+
fill: {
|
|
131
|
+
display: 'flex',
|
|
132
|
+
width: '100%',
|
|
133
|
+
height: '100%'
|
|
134
|
+
},
|
|
135
|
+
centered: {
|
|
136
|
+
flex: 1,
|
|
137
|
+
width: '100%',
|
|
138
|
+
height: '100%',
|
|
139
|
+
justifyContent: 'center',
|
|
140
|
+
alignItems: 'center'
|
|
141
|
+
}
|
|
142
|
+
});
|
|
59
143
|
export default IncodeOnboardingWebView;
|
|
60
144
|
//# sourceMappingURL=IncodeOnBoarding.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","WebView","environmentWebviewDomains","jsx","_jsx","IncodeOnboardingWebView","token","setError","user","setUser","goBack","goToAllSet","environment","handleMessage","event","messageData","JSON","parse","nativeEvent","data","console","log","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useRef","useState","ActivityIndicator","StyleSheet","View","WebView","environmentWebviewDomains","jsx","_jsx","ALLOWED_LOCALES","normalizeLocale","locale","includes","LANG_SWITCH_COOLDOWN_MS","CAMERA_RELEASE_MS","IncodeOnboardingWebView","token","setError","user","setUser","goBack","goToAllSet","environment","localeProp","currentLocale","setCurrentLocale","webviewKey","setWebviewKey","isRebuilding","setIsRebuilding","isRebuildingRef","webViewRef","rebuildGenerationRef","rebuildWebView","newLocale","generation","current","injectJavaScript","minDelayPromise","Promise","resolve","setTimeout","then","k","handleMessage","event","messageData","JSON","parse","nativeEvent","data","console","log","params","URLSearchParams","userId","id","langCooldown","String","uri","toString","style","styles","centered","children","size","fill","ref","source","javaScriptEnabled","domStorageEnabled","mediaPlaybackRequiresUserAction","allowsInlineMediaPlayback","mediaCapturePermissionGrantType","onLoad","onError","error","onMessage","create","display","width","height","flex","justifyContent","alignItems"],"sourceRoot":"../../../src","sources":["components/IncodeOnBoarding.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACvE,SAASC,iBAAiB,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAClE,OAAOC,OAAO,MAAM,sBAAsB;AAG1C,SAASC,yBAAyB,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElE,MAAMC,eAAe,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAU;AAEvD,SAASC,eAAeA,CAACC,MAA0B,EAAU;EAC3D,IAAIA,MAAM,IAAKF,eAAe,CAAuBG,QAAQ,CAACD,MAAM,CAAC,EAAE,OAAOA,MAAM;EACpF,OAAO,IAAI;AACb;AAiBA;AACA;AACA;AACA,MAAME,uBAAuB,GAAG,IAAI;AACpC,MAAMC,iBAAiB,GAAG,GAAG;AAE7B,SAASC,uBAAuBA,CAAC;EAC/BC,KAAK;EACLC,QAAQ;EACRC,IAAI;EACJC,OAAO;EACPC,MAAM;EACNC,UAAU;EACVC,WAAW;EACXX,MAAM,EAAEY,UAAU,GAAG;AACO,CAAC,EAAqB;EAClD,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGxB,QAAQ,CAAC,MAAMS,eAAe,CAACa,UAAU,CAAC,CAAC;EACrF,MAAM,CAACG,UAAU,EAAEC,aAAa,CAAC,GAAG1B,QAAQ,CAAC,CAAC,CAAC;EAC/C,MAAM,CAAC2B,YAAY,EAAEC,eAAe,CAAC,GAAG5B,QAAQ,CAAC,KAAK,CAAC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;EAEA,oBACEzD,IAAA,CAACJ,IAAI;IAACyD,KAAK,EAAEC,MAAM,CAACI,IAAK;IAAAF,QAAA,eACvBxD,IAAA,CAACH,OAAO;MACN8D,GAAG,EAAEpC,UAAW;MAEhBqC,MAAM,EAAE;QAAET;MAAI,CAAE;MAChBU,iBAAiB,EAAE,IAAK;MACxBC,iBAAiB,EAAE,IAAK;MACxBC,+BAA+B,EAAE,KAAM;MACvCC,yBAAyB,EAAE,IAAK;MAChCC,+BAA+B,EAAC,OAAO;MACvCC,MAAM,EAAEA,CAAA,KAAMvB,OAAO,CAACC,GAAG,CAAC,6BAA6B,CAAE;MACzDuB,OAAO,EAAGC,KAAK,IAAKzB,OAAO,CAACyB,KAAK,CAAC,gBAAgB,EAAEA,KAAK,CAAE;MAC3DC,SAAS,EAAEjC;IAAc,GATpBlB,UAUN;EAAC,CACE,CAAC;AAEX;AAEA,MAAMoC,MAAM,GAAG3D,UAAU,CAAC2E,MAAM,CAAC;EAC/BZ,IAAI,EAAE;IACJa,OAAO,EAAE,MAAM;IACfC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACDlB,QAAQ,EAAE;IACRmB,IAAI,EAAE,CAAC;IACPF,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdE,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAerE,uBAAuB","ignoreList":[]}
|
|
@@ -1,48 +1,129 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { View } from 'react-native';
|
|
3
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { ActivityIndicator, StyleSheet, View } from 'react-native';
|
|
5
5
|
import WebView from 'react-native-webview';
|
|
6
6
|
import { environmentWebviewDomains } from "../environmentDomains.js";
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const ALLOWED_LOCALES = ['en', 'zh-TW', 'mix'];
|
|
9
|
+
function normalizeLocale(locale) {
|
|
10
|
+
if (locale && ALLOWED_LOCALES.includes(locale)) return locale;
|
|
11
|
+
return 'en';
|
|
12
|
+
}
|
|
13
|
+
const LANG_SWITCH_COOLDOWN_MS = 2000;
|
|
14
|
+
const CAMERA_RELEASE_MS = 500;
|
|
8
15
|
function IncodeLoginWebView({
|
|
9
16
|
token,
|
|
10
17
|
setError,
|
|
11
18
|
user,
|
|
12
19
|
setUser,
|
|
13
20
|
goToAllSet,
|
|
14
|
-
environment
|
|
21
|
+
environment,
|
|
22
|
+
locale: localeProp = 'en'
|
|
15
23
|
}) {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
const [currentLocale, setCurrentLocale] = useState(() => normalizeLocale(localeProp));
|
|
25
|
+
const [webviewKey, setWebviewKey] = useState(0);
|
|
26
|
+
const [isRebuilding, setIsRebuilding] = useState(false);
|
|
27
|
+
const isRebuildingRef = useRef(false);
|
|
28
|
+
const webViewRef = useRef(null);
|
|
29
|
+
const rebuildGenerationRef = useRef(0);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setCurrentLocale(normalizeLocale(localeProp));
|
|
32
|
+
}, [localeProp]);
|
|
33
|
+
const rebuildWebView = useCallback(newLocale => {
|
|
34
|
+
const generation = ++rebuildGenerationRef.current;
|
|
35
|
+
webViewRef.current?.injectJavaScript(`
|
|
36
|
+
(function() {
|
|
37
|
+
try {
|
|
38
|
+
document.querySelectorAll('video').forEach(function(v) {
|
|
39
|
+
try {
|
|
40
|
+
if (v.srcObject && typeof v.srcObject.getTracks === 'function') {
|
|
41
|
+
v.srcObject.getTracks().forEach(function(t) { t.stop(); });
|
|
42
|
+
v.srcObject = null;
|
|
43
|
+
}
|
|
44
|
+
} catch(e) {}
|
|
45
|
+
});
|
|
46
|
+
} catch(e) {}
|
|
47
|
+
})();
|
|
48
|
+
true;
|
|
49
|
+
`);
|
|
50
|
+
isRebuildingRef.current = true;
|
|
51
|
+
setIsRebuilding(true);
|
|
52
|
+
setCurrentLocale(normalizeLocale(newLocale));
|
|
53
|
+
const minDelayPromise = new Promise(resolve => setTimeout(resolve, CAMERA_RELEASE_MS));
|
|
54
|
+
void minDelayPromise.then(() => {
|
|
55
|
+
if (generation !== rebuildGenerationRef.current) return;
|
|
56
|
+
isRebuildingRef.current = false;
|
|
57
|
+
setIsRebuilding(false);
|
|
58
|
+
setWebviewKey(k => k + 1);
|
|
59
|
+
});
|
|
60
|
+
}, []);
|
|
61
|
+
const handleMessage = useCallback(event => {
|
|
62
|
+
try {
|
|
63
|
+
const messageData = JSON.parse(event.nativeEvent.data);
|
|
64
|
+
if (messageData.event === 'changeLocale' && typeof messageData.locale === 'string') {
|
|
65
|
+
rebuildWebView(messageData.locale);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (isRebuildingRef.current) return;
|
|
69
|
+
if (messageData.event === 'onSuccess') {
|
|
70
|
+
console.log('onSuccess data', messageData.user);
|
|
71
|
+
if (messageData.user) setUser(messageData.user);
|
|
72
|
+
goToAllSet();
|
|
73
|
+
} else if (messageData.event === 'onExit') {
|
|
74
|
+
console.log('User exited');
|
|
75
|
+
setError('Something went wrong, but we’re working on it. Please try again later or contact support for assistance.');
|
|
76
|
+
}
|
|
77
|
+
} catch {
|
|
78
|
+
// ignore
|
|
25
79
|
}
|
|
26
|
-
};
|
|
80
|
+
}, [goToAllSet, rebuildWebView, setError, setUser]);
|
|
81
|
+
const params = new URLSearchParams({
|
|
82
|
+
token,
|
|
83
|
+
incodeId: user.incodeId ?? '',
|
|
84
|
+
locale: currentLocale,
|
|
85
|
+
langCooldown: String(LANG_SWITCH_COOLDOWN_MS)
|
|
86
|
+
});
|
|
87
|
+
const uri = `${environmentWebviewDomains[environment]}/ReactNativeSDKIncodeWebViewLogin?${params.toString()}`;
|
|
88
|
+
if (isRebuilding) {
|
|
89
|
+
return /*#__PURE__*/_jsx(View, {
|
|
90
|
+
style: styles.centered,
|
|
91
|
+
children: /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
92
|
+
size: "large"
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
}
|
|
27
96
|
return /*#__PURE__*/_jsx(View, {
|
|
28
|
-
style:
|
|
29
|
-
display: 'flex',
|
|
30
|
-
width: '100%',
|
|
31
|
-
height: '100%'
|
|
32
|
-
},
|
|
97
|
+
style: styles.fill,
|
|
33
98
|
children: /*#__PURE__*/_jsx(WebView, {
|
|
99
|
+
ref: webViewRef,
|
|
34
100
|
source: {
|
|
35
|
-
uri
|
|
101
|
+
uri
|
|
36
102
|
},
|
|
37
103
|
javaScriptEnabled: true,
|
|
38
104
|
domStorageEnabled: true,
|
|
39
105
|
mediaPlaybackRequiresUserAction: false,
|
|
40
106
|
allowsInlineMediaPlayback: true,
|
|
107
|
+
mediaCapturePermissionGrantType: "grant",
|
|
41
108
|
onLoad: () => console.log('WebView loaded successfully'),
|
|
42
109
|
onError: error => console.error('WebView error:', error),
|
|
43
110
|
onMessage: handleMessage
|
|
44
|
-
})
|
|
111
|
+
}, webviewKey)
|
|
45
112
|
});
|
|
46
113
|
}
|
|
114
|
+
const styles = StyleSheet.create({
|
|
115
|
+
fill: {
|
|
116
|
+
display: 'flex',
|
|
117
|
+
width: '100%',
|
|
118
|
+
height: '100%'
|
|
119
|
+
},
|
|
120
|
+
centered: {
|
|
121
|
+
flex: 1,
|
|
122
|
+
width: '100%',
|
|
123
|
+
height: '100%',
|
|
124
|
+
justifyContent: 'center',
|
|
125
|
+
alignItems: 'center'
|
|
126
|
+
}
|
|
127
|
+
});
|
|
47
128
|
export default IncodeLoginWebView;
|
|
48
129
|
//# sourceMappingURL=incodeLogin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","WebView","environmentWebviewDomains","jsx","_jsx","IncodeLoginWebView","token","setError","user","setUser","goToAllSet","environment","handleMessage","event","messageData","JSON","parse","nativeEvent","data","console","log","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useRef","useState","ActivityIndicator","StyleSheet","View","WebView","environmentWebviewDomains","jsx","_jsx","ALLOWED_LOCALES","normalizeLocale","locale","includes","LANG_SWITCH_COOLDOWN_MS","CAMERA_RELEASE_MS","IncodeLoginWebView","token","setError","user","setUser","goToAllSet","environment","localeProp","currentLocale","setCurrentLocale","webviewKey","setWebviewKey","isRebuilding","setIsRebuilding","isRebuildingRef","webViewRef","rebuildGenerationRef","rebuildWebView","newLocale","generation","current","injectJavaScript","minDelayPromise","Promise","resolve","setTimeout","then","k","handleMessage","event","messageData","JSON","parse","nativeEvent","data","console","log","params","URLSearchParams","incodeId","langCooldown","String","uri","toString","style","styles","centered","children","size","fill","ref","source","javaScriptEnabled","domStorageEnabled","mediaPlaybackRequiresUserAction","allowsInlineMediaPlayback","mediaCapturePermissionGrantType","onLoad","onError","error","onMessage","create","display","width","height","flex","justifyContent","alignItems"],"sourceRoot":"../../../src","sources":["components/incodeLogin.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACvE,SAASC,iBAAiB,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAClE,OAAOC,OAAO,MAAM,sBAAsB;AAG1C,SAASC,yBAAyB,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElE,MAAMC,eAAe,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAU;AAEvD,SAASC,eAAeA,CAACC,MAA0B,EAAU;EAC3D,IAAIA,MAAM,IAAKF,eAAe,CAAuBG,QAAQ,CAACD,MAAM,CAAC,EAAE,OAAOA,MAAM;EACpF,OAAO,IAAI;AACb;AAaA,MAAME,uBAAuB,GAAG,IAAI;AACpC,MAAMC,iBAAiB,GAAG,GAAG;AAE7B,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
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export const __esModule: boolean;
|
|
2
2
|
export default HomeModal;
|
|
3
|
-
declare function HomeModal({ apiKeyId, secretKey, environment, setGeneralVerificationToken, verifiedExternalPhoneNumber, onUpdate }: {
|
|
3
|
+
declare function HomeModal({ apiKeyId, secretKey, environment, setGeneralVerificationToken, verifiedExternalPhoneNumber, onUpdate, locale }: {
|
|
4
4
|
apiKeyId: any;
|
|
5
5
|
secretKey: any;
|
|
6
6
|
environment: any;
|
|
7
7
|
setGeneralVerificationToken: any;
|
|
8
8
|
verifiedExternalPhoneNumber: any;
|
|
9
9
|
onUpdate: any;
|
|
10
|
+
locale: any;
|
|
10
11
|
}): any;
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commonjs/BerifymeModal/index.js"],"names":[],"mappings":";;AAgCA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commonjs/BerifymeModal/index.js"],"names":[],"mappings":";;AAgCA;;;;;;;;QA+TC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const __esModule: boolean;
|
|
2
2
|
export default IncodeOnboardingWebView;
|
|
3
|
-
declare function IncodeOnboardingWebView({ token, setError, user, setUser, goBack, goToAllSet, environment }: {
|
|
3
|
+
declare function IncodeOnboardingWebView({ token, setError, user, setUser, goBack, goToAllSet, environment, locale: localeProp }: {
|
|
4
4
|
token: any;
|
|
5
5
|
setError: any;
|
|
6
6
|
user: any;
|
|
@@ -8,5 +8,6 @@ declare function IncodeOnboardingWebView({ token, setError, user, setUser, goBac
|
|
|
8
8
|
goBack: any;
|
|
9
9
|
goToAllSet: any;
|
|
10
10
|
environment: any;
|
|
11
|
+
locale?: string | undefined;
|
|
11
12
|
}): any;
|
|
12
13
|
//# sourceMappingURL=IncodeOnBoarding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IncodeOnBoarding.d.ts","sourceRoot":"","sources":["../../../../../commonjs/components/IncodeOnBoarding.js"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"IncodeOnBoarding.d.ts","sourceRoot":"","sources":["../../../../../commonjs/components/IncodeOnBoarding.js"],"names":[],"mappings":";;AAwBA;;;;;;;;;QA8GC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export const __esModule: boolean;
|
|
2
2
|
export default IncodeLoginWebView;
|
|
3
|
-
declare function IncodeLoginWebView({ token, setError, user, setUser, goToAllSet, environment }: {
|
|
3
|
+
declare function IncodeLoginWebView({ token, setError, user, setUser, goToAllSet, environment, locale: localeProp }: {
|
|
4
4
|
token: any;
|
|
5
5
|
setError: any;
|
|
6
6
|
user: any;
|
|
7
7
|
setUser: any;
|
|
8
8
|
goToAllSet: any;
|
|
9
9
|
environment: any;
|
|
10
|
+
locale?: string | undefined;
|
|
10
11
|
}): any;
|
|
11
12
|
//# sourceMappingURL=incodeLogin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incodeLogin.d.ts","sourceRoot":"","sources":["../../../../../commonjs/components/incodeLogin.js"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"incodeLogin.d.ts","sourceRoot":"","sources":["../../../../../commonjs/components/incodeLogin.js"],"names":[],"mappings":";;AAqBA;;;;;;;;QAkGC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export default HomeModal;
|
|
2
|
-
declare function HomeModal({ apiKeyId, secretKey, environment, setGeneralVerificationToken, verifiedExternalPhoneNumber, onUpdate }: {
|
|
2
|
+
declare function HomeModal({ apiKeyId, secretKey, environment, setGeneralVerificationToken, verifiedExternalPhoneNumber, onUpdate, locale }: {
|
|
3
3
|
apiKeyId: any;
|
|
4
4
|
secretKey: any;
|
|
5
5
|
environment: any;
|
|
6
6
|
setGeneralVerificationToken: any;
|
|
7
7
|
verifiedExternalPhoneNumber: any;
|
|
8
8
|
onUpdate: any;
|
|
9
|
+
locale: any;
|
|
9
10
|
}): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
10
11
|
import React from 'react';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../module/BerifymeModal/index.js"],"names":[],"mappings":";AAyBA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../module/BerifymeModal/index.js"],"names":[],"mappings":";AAyBA;;;;;;;;uEA+TC;kBAtV0C,OAAO"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default IncodeOnboardingWebView;
|
|
2
|
-
declare function IncodeOnboardingWebView({ token, setError, user, setUser, goBack, goToAllSet, environment }: {
|
|
2
|
+
declare function IncodeOnboardingWebView({ token, setError, user, setUser, goBack, goToAllSet, environment, locale: localeProp }: {
|
|
3
3
|
token: any;
|
|
4
4
|
setError: any;
|
|
5
5
|
user: any;
|
|
@@ -7,6 +7,7 @@ declare function IncodeOnboardingWebView({ token, setError, user, setUser, goBac
|
|
|
7
7
|
goBack: any;
|
|
8
8
|
goToAllSet: any;
|
|
9
9
|
environment: any;
|
|
10
|
+
locale?: string | undefined;
|
|
10
11
|
}): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
11
12
|
import React from 'react';
|
|
12
13
|
//# sourceMappingURL=IncodeOnBoarding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IncodeOnBoarding.d.ts","sourceRoot":"","sources":["../../../../../module/components/IncodeOnBoarding.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"IncodeOnBoarding.d.ts","sourceRoot":"","sources":["../../../../../module/components/IncodeOnBoarding.js"],"names":[],"mappings":";AAiBA;;;;;;;;;uEA8GC;kBA7H+D,OAAO"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export default IncodeLoginWebView;
|
|
2
|
-
declare function IncodeLoginWebView({ token, setError, user, setUser, goToAllSet, environment }: {
|
|
2
|
+
declare function IncodeLoginWebView({ token, setError, user, setUser, goToAllSet, environment, locale: localeProp }: {
|
|
3
3
|
token: any;
|
|
4
4
|
setError: any;
|
|
5
5
|
user: any;
|
|
6
6
|
setUser: any;
|
|
7
7
|
goToAllSet: any;
|
|
8
8
|
environment: any;
|
|
9
|
+
locale?: string | undefined;
|
|
9
10
|
}): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
10
11
|
import React from 'react';
|
|
11
12
|
//# sourceMappingURL=incodeLogin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incodeLogin.d.ts","sourceRoot":"","sources":["../../../../../module/components/incodeLogin.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"incodeLogin.d.ts","sourceRoot":"","sources":["../../../../../module/components/incodeLogin.js"],"names":[],"mappings":";AAcA;;;;;;;;uEAkGC;kBA9G+D,OAAO"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Environment, UpdateData } from '../enum';
|
|
3
|
-
declare function HomeModal({ apiKeyId, secretKey, environment, setGeneralVerificationToken, verifiedExternalPhoneNumber, onUpdate, }: {
|
|
3
|
+
declare function HomeModal({ apiKeyId, secretKey, environment, setGeneralVerificationToken, verifiedExternalPhoneNumber, onUpdate, locale, }: {
|
|
4
4
|
apiKeyId: string;
|
|
5
5
|
secretKey: string;
|
|
6
6
|
environment: Environment;
|
|
@@ -9,6 +9,8 @@ declare function HomeModal({ apiKeyId, secretKey, environment, setGeneralVerific
|
|
|
9
9
|
onUpdate?: ({ detail }: {
|
|
10
10
|
detail: UpdateData;
|
|
11
11
|
}) => void;
|
|
12
|
+
/** Incode WebView 初始語系(en | zh-TW | mix),與 SnapMatch `locale` 一致 */
|
|
13
|
+
locale?: string;
|
|
12
14
|
}): React.JSX.Element;
|
|
13
15
|
export default HomeModal;
|
|
14
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/BerifymeModal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAqBnD,OAAO,EAAE,WAAW,EAAmC,UAAU,EAAE,MAAM,SAAS,CAAC;AAYnF,iBAAS,SAAS,CAAC,EACjB,QAAQ,EAAE,SAAS,EACnB,WAAW,EAAE,2BAA2B,EACxC,2BAA2B,EAC3B,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/BerifymeModal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAqBnD,OAAO,EAAE,WAAW,EAAmC,UAAU,EAAE,MAAM,SAAS,CAAC;AAYnF,iBAAS,SAAS,CAAC,EACjB,QAAQ,EAAE,SAAS,EACnB,WAAW,EAAE,2BAA2B,EACxC,2BAA2B,EAC3B,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IACpC,WAAW,EAAE,WAAW,CAAC;IACzB,2BAA2B,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IACjF,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,UAAU,CAAA;KAAE,KAAK,IAAI,CAAC;IACxD,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA2YpB;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UserWithAgeAndFullName } from '../api/api';
|
|
3
3
|
import { Environment } from '../enum';
|
|
4
|
-
|
|
4
|
+
export type IncodeOnboardingWebViewProps = {
|
|
5
5
|
token: string;
|
|
6
6
|
setError: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
7
7
|
user: UserWithAgeAndFullName;
|
|
@@ -9,6 +9,12 @@ declare function IncodeOnboardingWebView({ token, setError, user, setUser, goBac
|
|
|
9
9
|
goBack: () => void;
|
|
10
10
|
goToAllSet: () => void;
|
|
11
11
|
environment: Environment;
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Incode Web 流程語系,對應 Frontend `?locale=`(en | zh-TW | mix)。
|
|
14
|
+
* 與 SnapMatch 一致;使用者於 Web 內切換語系時會 postMessage changeLocale,RN 會重建 WebView。
|
|
15
|
+
*/
|
|
16
|
+
locale?: string;
|
|
17
|
+
};
|
|
18
|
+
declare function IncodeOnboardingWebView({ token, setError, user, setUser, goBack, goToAllSet, environment, locale: localeProp, }: IncodeOnboardingWebViewProps): React.JSX.Element;
|
|
13
19
|
export default IncodeOnboardingWebView;
|
|
14
20
|
//# sourceMappingURL=IncodeOnBoarding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IncodeOnBoarding.d.ts","sourceRoot":"","sources":["../../../../../src/components/IncodeOnBoarding.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"IncodeOnBoarding.d.ts","sourceRoot":"","sources":["../../../../../src/components/IncodeOnBoarding.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAGxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAUtC,MAAM,MAAM,4BAA4B,GAAG;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IACnE,IAAI,EAAE,sBAAsB,CAAC;IAC7B,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAAC,CAAC;IAClF,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAQF,iBAAS,uBAAuB,CAAC,EAC/B,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,MAAM,EACN,UAAU,EACV,WAAW,EACX,MAAM,EAAE,UAAiB,GAC1B,EAAE,4BAA4B,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA0HlD;AAiBD,eAAe,uBAAuB,CAAC"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UserWithAgeAndFullName } from '../api/api';
|
|
3
3
|
import { Environment } from '../enum';
|
|
4
|
-
|
|
4
|
+
export type IncodeLoginWebViewProps = {
|
|
5
5
|
token: string;
|
|
6
6
|
setError: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
7
7
|
user: UserWithAgeAndFullName;
|
|
8
8
|
setUser: React.Dispatch<React.SetStateAction<UserWithAgeAndFullName | undefined>>;
|
|
9
9
|
goToAllSet: () => void;
|
|
10
10
|
environment: Environment;
|
|
11
|
-
|
|
11
|
+
/** Incode 登入 Web 語系,對應 Frontend `?locale=` */
|
|
12
|
+
locale?: string;
|
|
13
|
+
};
|
|
14
|
+
declare function IncodeLoginWebView({ token, setError, user, setUser, goToAllSet, environment, locale: localeProp, }: IncodeLoginWebViewProps): React.JSX.Element;
|
|
12
15
|
export default IncodeLoginWebView;
|
|
13
16
|
//# sourceMappingURL=incodeLogin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incodeLogin.d.ts","sourceRoot":"","sources":["../../../../../src/components/incodeLogin.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"incodeLogin.d.ts","sourceRoot":"","sources":["../../../../../src/components/incodeLogin.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAGxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAUtC,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IACnE,IAAI,EAAE,sBAAsB,CAAC;IAC7B,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAAC,CAAC;IAClF,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAKF,iBAAS,kBAAkB,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,UAAU,EACV,WAAW,EACX,MAAM,EAAE,UAAiB,GAC1B,EAAE,uBAAuB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA8G7C;AAiBD,eAAe,kBAAkB,CAAC"}
|
|
@@ -7,4 +7,6 @@ export declare const Berifyme: {
|
|
|
7
7
|
environment: typeof Environment;
|
|
8
8
|
};
|
|
9
9
|
export type { SnapMatchProps, SnapMatchUser } from "./components/SnapMatch";
|
|
10
|
+
export type { IncodeOnboardingWebViewProps, } from "./components/IncodeOnBoarding";
|
|
11
|
+
export type { IncodeLoginWebViewProps } from "./components/incodeLogin";
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5E,YAAY,EACV,4BAA4B,GAC7B,MAAM,+BAA+B,CAAC;AACvC,YAAY,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export const __esModule: boolean;
|
|
2
2
|
export default HomeModal;
|
|
3
|
-
declare function HomeModal({ apiKeyId, secretKey, environment, setGeneralVerificationToken, verifiedExternalPhoneNumber, onUpdate }: {
|
|
3
|
+
declare function HomeModal({ apiKeyId, secretKey, environment, setGeneralVerificationToken, verifiedExternalPhoneNumber, onUpdate, locale }: {
|
|
4
4
|
apiKeyId: any;
|
|
5
5
|
secretKey: any;
|
|
6
6
|
environment: any;
|
|
7
7
|
setGeneralVerificationToken: any;
|
|
8
8
|
verifiedExternalPhoneNumber: any;
|
|
9
9
|
onUpdate: any;
|
|
10
|
+
locale: any;
|
|
10
11
|
}): any;
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commonjs/BerifymeModal/index.js"],"names":[],"mappings":";;AAgCA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commonjs/BerifymeModal/index.js"],"names":[],"mappings":";;AAgCA;;;;;;;;QA+TC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const __esModule: boolean;
|
|
2
2
|
export default IncodeOnboardingWebView;
|
|
3
|
-
declare function IncodeOnboardingWebView({ token, setError, user, setUser, goBack, goToAllSet, environment }: {
|
|
3
|
+
declare function IncodeOnboardingWebView({ token, setError, user, setUser, goBack, goToAllSet, environment, locale: localeProp }: {
|
|
4
4
|
token: any;
|
|
5
5
|
setError: any;
|
|
6
6
|
user: any;
|
|
@@ -8,5 +8,6 @@ declare function IncodeOnboardingWebView({ token, setError, user, setUser, goBac
|
|
|
8
8
|
goBack: any;
|
|
9
9
|
goToAllSet: any;
|
|
10
10
|
environment: any;
|
|
11
|
+
locale?: string | undefined;
|
|
11
12
|
}): any;
|
|
12
13
|
//# sourceMappingURL=IncodeOnBoarding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IncodeOnBoarding.d.ts","sourceRoot":"","sources":["../../../../../commonjs/components/IncodeOnBoarding.js"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"IncodeOnBoarding.d.ts","sourceRoot":"","sources":["../../../../../commonjs/components/IncodeOnBoarding.js"],"names":[],"mappings":";;AAwBA;;;;;;;;;QA8GC"}
|