@regulaforensics/idv 3.10.262-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.json +1 -1
- package/examples/ionic/package.json +1 -1
- 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.json +4 -8
- 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
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"android": "scripts/android.sh"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@regulaforensics/idv": "3.10.
|
|
9
|
+
"@regulaforensics/idv": "3.10.263-beta",
|
|
10
10
|
"@regulaforensics/idv-module-document-reader": "3.10.377-rc",
|
|
11
11
|
"@regulaforensics/idv-module-face": "3.10.378-rc",
|
|
12
12
|
"@regulaforensics/document-reader-core-fullauthrfid": "9.9.3305",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"postinstall": "patch-package"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@regulaforensics/idv": "3.10.
|
|
10
|
+
"@regulaforensics/idv": "3.10.263-beta",
|
|
11
11
|
"@regulaforensics/idv-module-document-reader": "3.10.377-rc",
|
|
12
12
|
"@regulaforensics/idv-module-face": "3.10.378-rc",
|
|
13
13
|
"@regulaforensics/document-reader-core-fullauthrfid": "9.9.3305",
|
|
@@ -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
|
|
@@ -4,17 +4,15 @@
|
|
|
4
4
|
"scripts": {
|
|
5
5
|
"setup": "scripts/setup.sh",
|
|
6
6
|
"ios": "scripts/ios.sh",
|
|
7
|
-
"android": "scripts/android.sh"
|
|
8
|
-
"start": "expo start --port \"$npm_package_config_metroPort\""
|
|
7
|
+
"android": "scripts/android.sh"
|
|
9
8
|
},
|
|
10
9
|
"dependencies": {
|
|
11
|
-
"@regulaforensics/idv": "3.10.
|
|
10
|
+
"@regulaforensics/idv": "3.10.263-beta",
|
|
12
11
|
"@regulaforensics/idv-module-document-reader": "3.10.377-rc",
|
|
13
12
|
"@regulaforensics/idv-module-face": "3.10.378-rc",
|
|
14
13
|
"@regulaforensics/document-reader-core-fullauthrfid": "9.9.3305",
|
|
15
14
|
"@regulaforensics/face-core-basic": "8.4.884",
|
|
16
15
|
"expo": "~58.0.10",
|
|
17
|
-
"expo-dev-client": "~58.0.13",
|
|
18
16
|
"expo-build-properties": "~58.0.10",
|
|
19
17
|
"expo-custom-assets": "^1.5.0",
|
|
20
18
|
"react-native": "0.88.0",
|
|
@@ -22,14 +20,12 @@
|
|
|
22
20
|
"@types/react": "19.3.0",
|
|
23
21
|
"react-native-webview": "^14.0.1",
|
|
24
22
|
"typescript": "^7.0.2",
|
|
25
|
-
"@expo/config-plugins": "~58.0.9"
|
|
23
|
+
"@expo/config-plugins": "~58.0.9",
|
|
24
|
+
"react-native-fs": "^2.20.0"
|
|
26
25
|
},
|
|
27
26
|
"overrides": {
|
|
28
27
|
"xcode": {
|
|
29
28
|
"uuid": "^11.1.1"
|
|
30
29
|
}
|
|
31
|
-
},
|
|
32
|
-
"config": {
|
|
33
|
-
"metroPort": 8083
|
|
34
30
|
}
|
|
35
31
|
}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set -e
|
|
3
3
|
|
|
4
|
-
adb reverse tcp:${npm_package_config_metroPort} tcp:${npm_package_config_metroPort} >/dev/null || :
|
|
5
4
|
if [[ " $* " == *" --open "* ]] || [[ " $* " == *" -o "* ]]; then
|
|
6
5
|
open -a 'Android Studio' android
|
|
7
|
-
# Check if Metro is running at app's port.
|
|
8
|
-
if [[ "$(curl --silent --max-time 2 http://localhost:${npm_package_config_metroPort}/status)" != "packager-status:running" ]]; then
|
|
9
|
-
npm start
|
|
10
|
-
else
|
|
11
|
-
echo "Metro is already running on port ${npm_package_config_metroPort}."
|
|
12
|
-
fi
|
|
13
6
|
else
|
|
14
|
-
expo run:android --device --
|
|
7
|
+
npx expo run:android --device --no-bundler "$@"
|
|
15
8
|
fi
|
|
@@ -3,12 +3,6 @@ set -e
|
|
|
3
3
|
|
|
4
4
|
if [[ " $* " == *" --open "* ]] || [[ " $* " == *" -o "* ]]; then
|
|
5
5
|
open ios/IDV.xcworkspace
|
|
6
|
-
# Check if Metro is running at app's port.
|
|
7
|
-
if [[ "$(curl --silent --max-time 2 http://localhost:${npm_package_config_metroPort}/status)" != "packager-status:running" ]]; then
|
|
8
|
-
npm start
|
|
9
|
-
else
|
|
10
|
-
echo "Metro is already running on port ${npm_package_config_metroPort}."
|
|
11
|
-
fi
|
|
12
6
|
else
|
|
13
|
-
npx expo run:ios --device --
|
|
7
|
+
npx expo run:ios --device --no-bundler "$@"
|
|
14
8
|
fi
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const { withAppDelegate, withAppBuildGradle, withMainApplication, withXcodeProject } = require('expo/config-plugins')
|
|
2
|
+
|
|
3
|
+
function replaceRequired(contents, pattern, replacement, description) {
|
|
4
|
+
if (!pattern.test(contents)) throw new Error(`Standalone build: cannot find ${description}`)
|
|
5
|
+
return contents.replace(pattern, replacement)
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
module.exports = config => {
|
|
9
|
+
config = withAppDelegate(config, config => {
|
|
10
|
+
let contents = config.modResults.contents
|
|
11
|
+
if (!contents.includes('// Standalone demo: no development menu.')) {
|
|
12
|
+
contents = replaceRequired(contents, /let factory = ExpoReactNativeFactory\(delegate: delegate\)/,
|
|
13
|
+
`let factory = ExpoReactNativeFactory(delegate: delegate)
|
|
14
|
+
// Standalone demo: no development menu.
|
|
15
|
+
#if DEBUG
|
|
16
|
+
factory.devMenuConfiguration = RCTDevMenuConfiguration(
|
|
17
|
+
devMenuEnabled: false, shakeGestureEnabled: false, keyboardShortcutsEnabled: false)
|
|
18
|
+
#endif`, 'React Native factory')
|
|
19
|
+
}
|
|
20
|
+
contents = replaceRequired(contents,
|
|
21
|
+
/override func bundleURL\(\) -> URL\? \{[\s\S]*?\n \}/,
|
|
22
|
+
`override func bundleURL() -> URL? {
|
|
23
|
+
return Bundle.main.url(forResource: "main", withExtension: "jsbundle")
|
|
24
|
+
}`, 'bundleURL method')
|
|
25
|
+
config.modResults.contents = contents
|
|
26
|
+
return config
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
config = withXcodeProject(config, config => {
|
|
30
|
+
const phases = Object.values(config.modResults.hash.project.objects.PBXShellScriptBuildPhase || {})
|
|
31
|
+
const phase = phases.find(phase => phase.name === '"Bundle React Native code and images"')
|
|
32
|
+
if (!phase) throw new Error('Standalone build: cannot find iOS bundle build phase')
|
|
33
|
+
// Bundle plain JS in Debug as well. Hermes loads it directly, without an
|
|
34
|
+
// additional optimizing bytecode compiler pass or a Metro server.
|
|
35
|
+
phase.shellScript = JSON.stringify(`set -e
|
|
36
|
+
if [[ -f "$SRCROOT/.xcode.env" ]]; then source "$SRCROOT/.xcode.env"; fi
|
|
37
|
+
if [[ -f "$SRCROOT/.xcode.env.local" ]]; then source "$SRCROOT/.xcode.env.local"; fi
|
|
38
|
+
export PROJECT_ROOT="$PROJECT_DIR/.."
|
|
39
|
+
cd "$PROJECT_ROOT"
|
|
40
|
+
export NODE_ENV=production
|
|
41
|
+
export RCT_NO_LAUNCH_PACKAGER=1
|
|
42
|
+
ENTRY_FILE=$("$NODE_BINARY" -e "require('expo/scripts/resolveAppEntry')" "$PROJECT_ROOT" ios absolute | tail -n 1)
|
|
43
|
+
CLI_PATH=$("$NODE_BINARY" --print "require.resolve('@expo/cli', { paths: [require.resolve('expo/package.json')] })")
|
|
44
|
+
DEST="$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH"
|
|
45
|
+
mkdir -p "$DEST"
|
|
46
|
+
rm -rf "$DEST/web"
|
|
47
|
+
mkdir -p "$DEST/web/src"
|
|
48
|
+
cp src/*.html src/*.css "$DEST/web/src/"
|
|
49
|
+
cp -R images "$DEST/web/"
|
|
50
|
+
"$NODE_BINARY" "$CLI_PATH" export:embed --entry-file "$ENTRY_FILE" --platform ios --dev false --minify false --bundle-output "$DEST/main.jsbundle" --assets-dest "$DEST"
|
|
51
|
+
`)
|
|
52
|
+
phase.alwaysOutOfDate = 1
|
|
53
|
+
return config
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
config = withMainApplication(config, config => {
|
|
57
|
+
if (!config.modResults.contents.includes('useDevSupport = false')) {
|
|
58
|
+
config.modResults.contents = replaceRequired(config.modResults.contents,
|
|
59
|
+
/context = applicationContext,/, 'context = applicationContext,\n useDevSupport = false,', 'Android ReactHost context')
|
|
60
|
+
}
|
|
61
|
+
return config
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
config = withAppBuildGradle(config, config => {
|
|
65
|
+
if (!config.modResults.contents.includes('// Standalone demo: embed JS in Debug.')) {
|
|
66
|
+
config.modResults.contents = replaceRequired(config.modResults.contents, /react \{/,
|
|
67
|
+
`react {
|
|
68
|
+
// Standalone demo: embed JS in Debug.
|
|
69
|
+
debuggableVariants = []
|
|
70
|
+
extraPackagerArgs = ["--minify", "false"]
|
|
71
|
+
hermesFlags = ["-O0"]`, 'Android react block')
|
|
72
|
+
}
|
|
73
|
+
if (!config.modResults.contents.includes('tasks.register("copyWebAssets", Sync)')) {
|
|
74
|
+
config.modResults.contents += `
|
|
75
|
+
android.sourceSets.main.assets.srcDir(layout.buildDirectory.dir("generated/webAssets").get().asFile)
|
|
76
|
+
tasks.register("copyWebAssets", Sync) {
|
|
77
|
+
from(projectRoot) { include "src/*.html", "src/*.css", "images/**" }
|
|
78
|
+
into(layout.buildDirectory.dir("generated/webAssets/web"))
|
|
79
|
+
}
|
|
80
|
+
tasks.named("preBuild").configure { dependsOn("copyWebAssets") }
|
|
81
|
+
`
|
|
82
|
+
}
|
|
83
|
+
return config
|
|
84
|
+
})
|
|
85
|
+
return config
|
|
86
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/idv",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.263-beta",
|
|
4
4
|
"description": "This is an npm module for Regula IDV, which unifies access to all Regula products. This plugin makes possible to use it with react-native, cordova and capacitor applications. Supports Android and iOS.",
|
|
5
5
|
"main": "www/react-native/index.js",
|
|
6
6
|
"module": "www/capacitor/index.js",
|
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="@regulaforensics/idv" version="3.10.
|
|
2
|
+
<plugin id="@regulaforensics/idv" version="3.10.263-beta" xmlns="http://apache.org/cordova/ns/plugins/1.0">
|
|
3
3
|
<name>IDV</name>
|
|
4
4
|
<description>Cordova plugin for Regula IDV</description>
|
|
5
5
|
<license>commercial</license>
|
package/react-native-idv.podspec
CHANGED
package/test/package-lock.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<meta name="viewport" content="initial-scale=1, user-scalable=no, viewport-fit=cover">
|
|
2
|
-
<link rel="stylesheet" href="src/main.css">
|
|
3
|
-
|
|
4
|
-
<div id="content" style="height: 100%"></div>
|
|
5
|
-
|
|
6
|
-
<script>
|
|
7
|
-
(async () => {
|
|
8
|
-
document.getElementById("content").innerHTML = await fetch("src/main.html").then(r => r.text())
|
|
9
|
-
await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))
|
|
10
|
-
window.ReactNativeWebView.postMessage(JSON.stringify({ id: "ready" }))
|
|
11
|
-
})()
|
|
12
|
-
</script>
|