@regulaforensics/idv 3.10.261-beta → 3.10.263-beta
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/examples/capacitor/package-lock.json +3 -558
- package/examples/capacitor/package.json +5 -4
- package/examples/ionic/package-lock.json +297 -829
- package/examples/ionic/package.json +7 -5
- package/examples/react_native/app.config.ts +4 -2
- package/examples/react_native/index.tsx +37 -7
- package/examples/react_native/metro.config.js +1 -3
- package/examples/react_native/package-lock.json +1220 -1141
- package/examples/react_native/package.json +6 -10
- package/examples/react_native/scripts/android.sh +1 -8
- package/examples/react_native/scripts/ios.sh +1 -7
- package/examples/react_native/scripts/setup.sh +0 -3
- package/examples/react_native/scripts/withoutMetroServer.js +86 -0
- package/package.json +1 -1
- package/plugin.xml +1 -1
- package/react-native-idv.podspec +1 -1
- package/test/package-lock.json +1 -1
- package/examples/react_native/index.html +0 -12
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
"postinstall": "patch-package"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@regulaforensics/idv": "3.10.
|
|
11
|
-
"@regulaforensics/idv-module-document-reader": "3.
|
|
12
|
-
"@regulaforensics/idv-module-face": "3.
|
|
10
|
+
"@regulaforensics/idv": "3.10.263-beta",
|
|
11
|
+
"@regulaforensics/idv-module-document-reader": "3.10.377-rc",
|
|
12
|
+
"@regulaforensics/idv-module-face": "3.10.378-rc",
|
|
13
13
|
"@regulaforensics/document-reader-core-fullauthrfid": "9.9.3305",
|
|
14
14
|
"@regulaforensics/face-core-basic": "8.4.884",
|
|
15
15
|
"@angular-devkit/build-angular": "^22.1.8",
|
|
@@ -32,8 +32,10 @@
|
|
|
32
32
|
"typescript": "~6.0.3"
|
|
33
33
|
},
|
|
34
34
|
"overrides": {
|
|
35
|
-
"serialize-javascript": "^7.1.
|
|
36
|
-
"uuid": "^11.1.1"
|
|
35
|
+
"serialize-javascript": "^7.1.2",
|
|
36
|
+
"uuid": "^11.1.1",
|
|
37
|
+
"source-map-js": "^1.2.2",
|
|
38
|
+
"shell-quote": "^1.11.0"
|
|
37
39
|
},
|
|
38
40
|
"cordova": {
|
|
39
41
|
"plugins": {
|
|
@@ -36,17 +36,19 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
|
|
|
36
36
|
},
|
|
37
37
|
plugins: [
|
|
38
38
|
'@regulaforensics/idv',
|
|
39
|
+
'./scripts/withoutMetroServer',
|
|
39
40
|
['expo-custom-assets', { assetsPaths: ['./assets'] }],
|
|
40
41
|
['expo-build-properties', {
|
|
42
|
+
ios: { networkInspector: false },
|
|
41
43
|
android: {
|
|
44
|
+
networkInspector: false,
|
|
42
45
|
extraMavenRepos: [
|
|
43
46
|
{ url: 'https://maven.regulaforensics.com/RegulaDocumentReader' },
|
|
44
47
|
{ url: 'https://maven.regulaforensics.com/RegulaDocumentReader/Beta' },
|
|
45
48
|
{ url: 'https://maven.regulaforensics.com/RegulaDocumentReader/Nightly' },
|
|
46
49
|
{ url: 'https://maven.regulaforensics.com/RegulaDocumentReader/Stage' }
|
|
47
50
|
]
|
|
48
|
-
}
|
|
49
|
-
ios: { networkInspector: false }
|
|
51
|
+
}
|
|
50
52
|
}]
|
|
51
53
|
]
|
|
52
54
|
})
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { registerRootComponent } from 'expo'
|
|
2
2
|
import WebView from 'react-native-webview'
|
|
3
3
|
import React from 'react'
|
|
4
|
+
import * as RNFS from 'react-native-fs'
|
|
5
|
+
import { Platform } from 'react-native'
|
|
4
6
|
import { main } from './src/main'
|
|
5
7
|
|
|
6
8
|
var webViewRef: any
|
|
@@ -47,17 +49,45 @@ const document = {
|
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
function parseValue(value: any) {
|
|
50
|
-
|
|
51
|
-
return value
|
|
52
|
+
const json = JSON.stringify(value)
|
|
53
|
+
return typeof value === 'string' ? `(window.webImages[${json}] ?? ${json})` : json
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function loadWebUI() {
|
|
57
|
+
const webRoot = Platform.OS === 'ios' ? RNFS.MainBundlePath + '/web/' : 'web/'
|
|
58
|
+
const readWebFile = Platform.OS === 'ios' ? RNFS.readFile : RNFS.readFileAssets
|
|
59
|
+
const readWebDir = Platform.OS === 'ios' ? RNFS.readDir : RNFS.readDirAssets
|
|
60
|
+
const webImages: Record<string, string> = {}
|
|
61
|
+
const [styles, content] = await Promise.all(['src/main.css', 'src/main.html'].map(path => readWebFile(webRoot + path, 'utf8')))
|
|
62
|
+
|
|
63
|
+
for (const file of (await readWebDir(webRoot + 'images')).filter(file => file.isFile())) {
|
|
64
|
+
const extension = file.name.split('.').pop()!.toLowerCase()
|
|
65
|
+
const type = ({ jpg: 'jpeg', svg: 'svg+xml' } as Record<string, string>)[extension] ?? extension
|
|
66
|
+
webImages['images/' + file.name] = `data:image/${type};base64,${await readWebFile(file.path, 'base64')}`
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const html = content.replace(/src="([^"]+)"/g, (match, path) => webImages[path] ? `src="${webImages[path]}"` : match)
|
|
70
|
+
return `<meta name="viewport" content="initial-scale=1, user-scalable=no, viewport-fit=cover">
|
|
71
|
+
<style>${styles}</style>
|
|
72
|
+
<div id="content" style="height: 100%">${html}</div>
|
|
73
|
+
<script>
|
|
74
|
+
window.webImages = ${JSON.stringify(webImages)};
|
|
75
|
+
requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
76
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({ id: "ready" }))
|
|
77
|
+
}))
|
|
78
|
+
</script>`
|
|
52
79
|
}
|
|
53
80
|
|
|
54
81
|
(globalThis as any).document = document;
|
|
55
|
-
registerRootComponent(() =>
|
|
56
|
-
|
|
82
|
+
registerRootComponent(() => {
|
|
83
|
+
const [html, setHtml] = React.useState('')
|
|
84
|
+
React.useEffect(() => { loadWebUI().then(setHtml).catch(console.error) }, [])
|
|
85
|
+
return html ? <WebView
|
|
57
86
|
ref={ref => { webViewRef = ref }}
|
|
58
87
|
onMessage={onMessage}
|
|
59
|
-
|
|
88
|
+
originWhitelist={['*']}
|
|
89
|
+
source={{ html }}
|
|
60
90
|
scrollEnabled={false}
|
|
61
91
|
overScrollMode={'content'}
|
|
62
|
-
/>
|
|
63
|
-
)
|
|
92
|
+
/> : null
|
|
93
|
+
})
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
const config = require('expo/metro-config').getDefaultConfig(__dirname)
|
|
2
2
|
config.watchFolders = [
|
|
3
|
-
__dirname + '/node_modules'
|
|
4
3
|
]
|
|
5
|
-
config.resolver.nodeModulesPaths =
|
|
6
|
-
config.resolver.assetExts.push('css')
|
|
4
|
+
config.resolver.nodeModulesPaths = [__dirname + '/node_modules']
|
|
7
5
|
module.exports = config
|